docopslab-dev 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +682 -324
  3. data/docopslab-dev.gemspec +3 -4
  4. data/lib/docopslab/dev/cast_ops.rb +199 -0
  5. data/lib/docopslab/dev/config_manager.rb +6 -6
  6. data/lib/docopslab/dev/data_utils.rb +42 -0
  7. data/lib/docopslab/dev/docker_aware.rb +40 -0
  8. data/lib/docopslab/dev/file_utils.rb +18 -7
  9. data/lib/docopslab/dev/git_branch.rb +201 -0
  10. data/lib/docopslab/dev/git_hooks.rb +17 -11
  11. data/lib/docopslab/dev/initializer.rb +34 -11
  12. data/lib/docopslab/dev/library/cache.rb +167 -0
  13. data/lib/docopslab/dev/library/fetch.rb +209 -0
  14. data/lib/docopslab/dev/library.rb +341 -0
  15. data/lib/docopslab/dev/linters.rb +73 -15
  16. data/lib/docopslab/dev/manifest.rb +28 -0
  17. data/lib/docopslab/dev/paths.rb +0 -17
  18. data/lib/docopslab/dev/script_manager.rb +12 -6
  19. data/lib/docopslab/dev/skim.rb +109 -0
  20. data/lib/docopslab/dev/spell_check.rb +2 -2
  21. data/lib/docopslab/dev/sync_ops.rb +94 -33
  22. data/lib/docopslab/dev/tasks.rb +58 -18
  23. data/lib/docopslab/dev/version.rb +1 -1
  24. data/lib/docopslab/dev.rb +77 -36
  25. data/specs/data/default-manifest.yml +23 -5
  26. data/specs/data/library-index.yml +22 -0
  27. data/specs/data/manifest-schema.yaml +142 -4
  28. data/specs/data/tasks-def.yml +122 -10
  29. metadata +28 -73
  30. data/assets/config-packs/actionlint/base.yml +0 -13
  31. data/assets/config-packs/actionlint/project.yml +0 -13
  32. data/assets/config-packs/htmlproofer/base.yml +0 -27
  33. data/assets/config-packs/htmlproofer/project.yml +0 -25
  34. data/assets/config-packs/rubocop/base.yml +0 -130
  35. data/assets/config-packs/rubocop/project.yml +0 -8
  36. data/assets/config-packs/shellcheck/base.shellcheckrc +0 -14
  37. data/assets/config-packs/subtxt/ai-asciidoc-antipatterns.sub.txt +0 -11
  38. data/assets/config-packs/vale/asciidoc/ExplicitSectionIDs.yml +0 -8
  39. data/assets/config-packs/vale/asciidoc/ExtraLineBeforeLevel1.yml +0 -7
  40. data/assets/config-packs/vale/asciidoc/OneSentencePerLine.yml +0 -8
  41. data/assets/config-packs/vale/asciidoc/PreferSourceBlocks.yml +0 -8
  42. data/assets/config-packs/vale/asciidoc/ProperAdmonitions.yml +0 -8
  43. data/assets/config-packs/vale/asciidoc/ProperDLs.yml +0 -7
  44. data/assets/config-packs/vale/asciidoc/UncleanListStart.yml +0 -8
  45. data/assets/config-packs/vale/authoring/ButParagraph.yml +0 -8
  46. data/assets/config-packs/vale/authoring/ExNotEg.yml +0 -8
  47. data/assets/config-packs/vale/authoring/LiteralTerms.yml +0 -20
  48. data/assets/config-packs/vale/authoring/Spelling.yml +0 -679
  49. data/assets/config-packs/vale/base.ini +0 -38
  50. data/assets/config-packs/vale/config/scripts/ExplicitSectionIDs.tengo +0 -56
  51. data/assets/config-packs/vale/config/scripts/ExtraLineBeforeLevel1.tengo +0 -121
  52. data/assets/config-packs/vale/config/scripts/OneSentencePerLine.tengo +0 -53
  53. data/assets/config-packs/vale/project.ini +0 -5
  54. data/assets/hooks/pre-commit +0 -63
  55. data/assets/hooks/pre-push +0 -72
  56. data/assets/scripts/adoc_section_ids.rb +0 -50
  57. data/assets/scripts/build-common.sh +0 -193
  58. data/assets/scripts/build-docker.sh +0 -64
  59. data/assets/scripts/build.sh +0 -56
  60. data/assets/scripts/parse_jekyll_asciidoc_logs.rb +0 -467
  61. data/assets/templates/Gemfile +0 -7
  62. data/assets/templates/Rakefile +0 -3
  63. data/assets/templates/gitignore +0 -69
  64. data/assets/templates/jekyll-asciidoc-fix.prompt.yml +0 -17
  65. data/assets/templates/spellcheck.prompt.yml +0 -16
  66. data/docs/agent/AGENTS.md +0 -229
  67. data/docs/agent/index.md +0 -80
  68. data/docs/agent/missions/conduct-release.md +0 -224
  69. data/docs/agent/missions/setup-new-project.md +0 -250
  70. data/docs/agent/roles/devops-release-engineer.md +0 -152
  71. data/docs/agent/roles/docops-engineer.md +0 -193
  72. data/docs/agent/roles/planner-architect.md +0 -74
  73. data/docs/agent/roles/product-engineer.md +0 -153
  74. data/docs/agent/roles/product-manager.md +0 -130
  75. data/docs/agent/roles/project-manager.md +0 -139
  76. data/docs/agent/roles/qa-testing-engineer.md +0 -115
  77. data/docs/agent/roles/tech-docs-manager.md +0 -143
  78. data/docs/agent/roles/tech-writer.md +0 -163
  79. data/docs/agent/skills/asciidoc.md +0 -609
  80. data/docs/agent/skills/code-commenting.md +0 -347
  81. data/docs/agent/skills/fix-broken-links.md +0 -309
  82. data/docs/agent/skills/fix-jekyll-asciidoc-build-errors.md +0 -23
  83. data/docs/agent/skills/fix-spelling-issues.md +0 -13
  84. data/docs/agent/skills/git.md +0 -170
  85. data/docs/agent/skills/github-issues.md +0 -135
  86. data/docs/agent/skills/product-release-rollback-and-patching.md +0 -71
  87. data/docs/agent/skills/rake-cli-dev.md +0 -57
  88. data/docs/agent/skills/readme-driven-dev.md +0 -13
  89. data/docs/agent/skills/release-history.md +0 -29
  90. data/docs/agent/skills/ruby.md +0 -192
  91. data/docs/agent/skills/schemagraphy-sgyml.md +0 -18
  92. data/docs/agent/skills/tests-running.md +0 -25
  93. data/docs/agent/skills/tests-writing.md +0 -45
  94. data/docs/agent/skills/write-the-docs.md +0 -54
  95. data/docs/agent/topics/common-project-paths.md +0 -117
  96. data/docs/agent/topics/dev-tooling-usage.md +0 -202
  97. data/docs/agent/topics/devops-ci-cd.md +0 -55
  98. data/docs/agent/topics/product-docs-deployment.md +0 -25
data/lib/docopslab/dev.rb CHANGED
@@ -8,16 +8,23 @@ require 'pathname'
8
8
  require 'shellwords'
9
9
  require_relative 'dev/version' # includes RUBY_TARGET
10
10
  require_relative 'dev/paths'
11
+ require_relative 'dev/docker_aware'
12
+ require_relative 'dev/manifest'
11
13
  require_relative 'dev/spell_check'
12
14
  require_relative 'dev/log_parser'
15
+ require_relative 'dev/skim'
13
16
  require_relative 'dev/tasks'
14
17
  require_relative 'dev/git_hooks'
15
18
  require_relative 'dev/tool_execution'
19
+ require_relative 'dev/git_branch'
16
20
  require_relative 'dev/linters'
17
21
  require_relative 'dev/config_manager'
18
22
  require_relative 'dev/file_utils'
19
23
  require_relative 'dev/script_manager'
24
+ require_relative 'dev/library'
20
25
  require_relative 'dev/sync_ops'
26
+ require_relative 'dev/data_utils'
27
+ require_relative 'dev/cast_ops'
21
28
  require_relative 'dev/checkers'
22
29
  require_relative 'dev/initializer'
23
30
  require_relative 'dev/auto_fix_asciidoc'
@@ -37,45 +44,74 @@ module DocOpsLab
37
44
  end
38
45
  end
39
46
 
40
- # Path constants
41
- # Project paths (local/runtime)
47
+ # Path constants (Backwards compatibility)
42
48
  MANIFEST_PATH = '.config/docopslab-dev.yml'
43
- CONFIG_VENDOR_DIR = Paths.config_vendor_dir
44
- HOOKS_DIR = '.git/hooks'
45
-
46
- # Runtime/generated config files (merged from base + local)
47
- CONFIG_PATHS = Paths::CONFIG_FILES
48
-
49
- # Shorthand for rubocop (most commonly referenced)
50
- RUBOCOP_CONFIG_PATH = CONFIG_PATHS[:rubocop]
51
-
52
- # Gem source paths (assets bundled with gem)
53
- MANIFEST_DEF_PATH = File.join(GEM_ROOT, 'specs', 'data', 'default-manifest.yml')
54
- TOOLS_DEF_PATH = File.join(GEM_ROOT, 'specs', 'data', 'tools.yml')
55
- CONFIG_PACKS_SOURCE_DIR = Paths.gem_config_packs
56
- SCRIPTS_SOURCE_DIR = Paths.gem_scripts
57
- HOOKS_SOURCE_DIR = Paths.gem_hooks
58
- TEMPLATES_DIR = File.join(GEM_ROOT, 'assets', 'templates')
59
- GITIGNORE_STUB_SOURCE_PATH = File.join(TEMPLATES_DIR, 'gitignore')
60
- GEMFILE_STUB_SOURCE_PATH = File.join(TEMPLATES_DIR, 'Gemfile')
61
- RAKEFILE_STUB_SOURCE_PATH = File.join(TEMPLATES_DIR, 'Rakefile')
62
-
63
- # Cached data
64
- @manifest = nil
65
- @tools_data = nil
49
+ XDG_CACHE_SUBPATH = 'docopslab/dev/library'
66
50
 
67
51
  class << self
68
52
  attr_accessor :manifest, :tools_data
53
+ attr_writer :manifest_path, :xdg_cache_subpath
69
54
 
70
- # Common Utility
55
+ def manifest_path
56
+ @manifest_path || MANIFEST_PATH
57
+ end
58
+
59
+ def xdg_cache_subpath
60
+ @xdg_cache_subpath || XDG_CACHE_SUBPATH
61
+ end
62
+
63
+ # Upstream library defaults
64
+ def default_library_repo
65
+ 'DocOps/lab'
66
+ end
67
+
68
+ def default_library_branch
69
+ 'labdev-library'
70
+ end
71
+
72
+ # Project paths (local/runtime)
73
+ def config_vendor_dir
74
+ Paths.config_vendor_dir
75
+ end
76
+
77
+ def hooks_dir
78
+ '.git/hooks'
79
+ end
80
+
81
+ # Runtime/generated config files (merged from base + local)
82
+ def config_paths
83
+ Paths::CONFIG_FILES
84
+ end
85
+
86
+ # Shorthand for rubocop (most commonly referenced)
87
+ def rubocop_config_path
88
+ config_paths[:rubocop]
89
+ end
90
+
91
+ # Gem data paths (bundled with gem in specs/data/)
92
+ def manifest_def_path
93
+ File.join(GEM_ROOT, 'specs', 'data', 'default-manifest.yml')
94
+ end
95
+
96
+ def tools_def_path
97
+ File.join(GEM_ROOT, 'specs', 'data', 'tools.yml')
98
+ end
99
+
100
+ # Asset paths are resolved at runtime from the remote library cache.
101
+ # Use Library.resolve('config-packs/...'), Library.resolve('templates/...') etc.
102
+ def library_path subpath=nil
103
+ return Library::Cache.current_path unless subpath
104
+
105
+ File.join(Library::Cache.current_path, subpath)
106
+ end
71
107
 
72
108
  def load_manifest force_reload: false
73
109
  return @manifest if @manifest && !force_reload
74
110
 
75
- @manifest = YAML.load_file(MANIFEST_PATH) if File.exist?(MANIFEST_PATH)
111
+ @manifest = YAML.load_file(manifest_path) if File.exist?(manifest_path)
76
112
  @manifest
77
113
  rescue StandardError => e
78
- warn "Failed to load manifest: #{e.message}"
114
+ warn "Failed to load manifest at #{manifest_path}: #{e.message}"
79
115
  nil
80
116
  end
81
117
 
@@ -83,8 +119,8 @@ module DocOpsLab
83
119
  return @tools_data if @tools_data
84
120
 
85
121
  @tools_data = begin
86
- if File.exist?(TOOLS_DEF_PATH)
87
- YAML.load_file(TOOLS_DEF_PATH)
122
+ if File.exist?(tools_def_path)
123
+ YAML.load_file(tools_def_path)
88
124
  else
89
125
  []
90
126
  end
@@ -160,7 +196,7 @@ module DocOpsLab
160
196
  end
161
197
 
162
198
  def bootstrap_project
163
- Initializer.bootstrap_project
199
+ Initializer.bootstrap_project(self)
164
200
  end
165
201
 
166
202
  def install_vale_styles
@@ -205,6 +241,10 @@ module DocOpsLab
205
241
  SyncOps.sync_docs(self, force: force)
206
242
  end
207
243
 
244
+ def sync_templates force: false
245
+ SyncOps.sync_templates(self, force: force)
246
+ end
247
+
208
248
  # Checkers & Finders
209
249
 
210
250
  def tool_available? tool_name
@@ -317,8 +357,9 @@ module DocOpsLab
317
357
  end
318
358
 
319
359
  def run_vale file_path=nil, opts_string='', output_format: :cli, filter: nil, style_override: nil
320
- Linters.run_vale self, file_path, opts_string, output_format: output_format, filter: filter,
321
- style_override: style_override
360
+ Linters.run_vale(
361
+ self, file_path, opts_string,
362
+ output_format: output_format, filter: filter, style_override: style_override)
322
363
  end
323
364
 
324
365
  def lint_file file_path
@@ -357,12 +398,12 @@ style_override: style_override
357
398
  puts "❌ Vale rule file not found: #{style_path}"
358
399
  return
359
400
  end
360
- config = File.read(CONFIG_PATHS[:vale])
401
+ config = File.read(Paths::CONFIG_FILES[:vale])
361
402
  config.lines.each do |line|
362
403
  next unless line.strip.start_with?("#{package}.#{rule_name} =")
363
404
 
364
405
  rule_setting = line.strip.split('=', 2).last.strip
365
- puts "⚙️ Rule setting from #{CONFIG_PATHS[:vale]}: '#{rule_setting}'"
406
+ puts "⚙️ Rule setting from #{Paths::CONFIG_FILES[:vale]}: '#{rule_setting}'"
366
407
  break
367
408
  end
368
409
  unless File.exist?(style_path)
@@ -376,7 +417,7 @@ style_override: style_override
376
417
 
377
418
  def print_cop rule
378
419
  puts "📄 RuboCop cop documentation for: #{rule}"
379
- cmd = "bundle exec rubocop --show-cops #{rule} --config #{RUBOCOP_CONFIG_PATH}"
420
+ cmd = "bundle exec rubocop --show-cops #{rule} --config #{File.join(Paths.config_vendor_dir, 'rubocop.yml')}"
380
421
  success = system(cmd)
381
422
  puts '❌ Failed to retrieve RuboCop cop documentation' unless success
382
423
  end
@@ -1,12 +1,7 @@
1
1
  source:
2
2
  repo: DocOps/lab
3
3
  ref: v1
4
- root: gems/docopslab-dev/assets/config-packs
5
-
6
4
  docs:
7
- - source: docs/agent/AGENTS.md
8
- target: AGENTS.md
9
- synced: false
10
5
  - source: docs/agent/skills/*.md
11
6
  target: .agent/docs/skills/
12
7
  synced: true
@@ -17,6 +12,15 @@ docs:
17
12
  target: .agent/docs/roles/
18
13
  synced: true
19
14
 
15
+ templates:
16
+ manifest:
17
+ - source: templates/AGENTS.markdown
18
+ target: ./AGENTS.md
19
+ - source: templates/gitignore
20
+ target: .gitignore
21
+ - source: templates/README.asciidoc
22
+ target: README.adoc
23
+
20
24
  tools:
21
25
  - tool: rubocop
22
26
  files:
@@ -35,6 +39,14 @@ tools:
35
39
  - source: vale/project.ini
36
40
  target: .config/vale.local.ini
37
41
  synced: false
42
+ paths:
43
+ lint: ['.']
44
+ skip:
45
+ - build/*
46
+ - specs/*
47
+ - .agent/**/*
48
+ - .config/.vendor/**/*
49
+ exts: ['adoc']
38
50
 
39
51
  - tool: htmlproofer
40
52
  enabled: false # Disabled by default, enable per project
@@ -62,3 +74,9 @@ tools:
62
74
  - source: actionlint/project.yml
63
75
  target: .config/actionlint.yml
64
76
  synced: false
77
+
78
+ library:
79
+ enabled: true
80
+ source:
81
+ repo: DocOps/lab
82
+ ref: labdev-library
@@ -0,0 +1,22 @@
1
+ categories:
2
+ - dest: README.adoc
3
+ source: gems/docopslab-dev/docs/library-readme.adoc
4
+
5
+ - dest: config-packs
6
+ source: gems/docopslab-dev/assets/config-packs
7
+
8
+ - dest: hooks
9
+ source: gems/docopslab-dev/assets/hooks
10
+
11
+ - dest: scripts
12
+ source: gems/docopslab-dev/assets/scripts
13
+
14
+ - dest: templates
15
+ source: gems/docopslab-dev/assets/templates
16
+
17
+ - dest: docs/agent
18
+ source: gems/docopslab-dev/docs/agent
19
+ prebuild: gemdo:gen_agent_docs
20
+
21
+ - dest: templates/AGENTS.markdown
22
+ source: _docs/templates/AGENTS.markdown
@@ -5,7 +5,7 @@ $schema:
5
5
  version: v1
6
6
  properties:
7
7
  _meta:
8
- req: [source,tools]
8
+ req: [source,tools,docs,library,attributes,templates]
9
9
  source:
10
10
  type: Map
11
11
  properties:
@@ -26,7 +26,7 @@ $schema:
26
26
  default: config-packs
27
27
  tools:
28
28
  type: ArrayTable
29
- desc: List of config targets to sync & tools to permit.
29
+ desc: Registry of config targets to sync & tools to permit.
30
30
  properties:
31
31
  _meta:
32
32
  req: [tool,files]
@@ -43,7 +43,7 @@ $schema:
43
43
  default: false
44
44
  files:
45
45
  type: ArrayTable
46
- desc: List of upstream/local file pairs
46
+ desc: Manifest of upstream/local file pairs
47
47
  properties:
48
48
  _meta:
49
49
  req: [upstream,local]
@@ -60,4 +60,142 @@ $schema:
60
60
  enabled:
61
61
  type: Boolean
62
62
  desc: Whether this file mapping is active
63
- default: true
63
+ default: true
64
+ paths:
65
+ desc: Additional path-based config for tools that support it
66
+ type: Map
67
+ properties:
68
+ lint:
69
+ type: ArrayList
70
+ desc: List of paths to include in linting (relative to project root)
71
+ skip:
72
+ type: ArrayList
73
+ desc: List of paths to exclude from linting (relative to project root)
74
+ exts:
75
+ type: ArrayList
76
+ desc: |
77
+ List of file extensions to include in linting (ex: ['adoc', 'md'])
78
+ docs:
79
+ type: ArrayTable
80
+ desc: Registry of documentation targets to sync.
81
+ properties:
82
+ _meta:
83
+ req: [source,target]
84
+ source:
85
+ type: Path
86
+ desc: Upstream path, relative to the library source path (usually `library/`) (supports globs)
87
+ target:
88
+ type: Path
89
+ desc: Local destination path within the project repo (directory if source is glob)
90
+ synced:
91
+ type: Boolean
92
+ desc: |
93
+ Whether to auto-sync this file from upstream.
94
+ WARNING: This overwrites local changes.
95
+ default: true
96
+ templates:
97
+ type: ArrayTable
98
+ desc: Registry of templates used to sync local file content.
99
+ properties:
100
+ _meta:
101
+ req: [source,target]
102
+ source:
103
+ type: Path
104
+ desc: Upstream path to a template file, relative to the library source path (usually `library/`).
105
+ docs: |
106
+ The base path for this value is established by the `library.source.path` property.
107
+ target:
108
+ type: Path
109
+ desc: |
110
+ Local destination path within the project repo, including filename and extension.
111
+ synced:
112
+ type: Boolean
113
+ desc: |
114
+ Whether to auto-sync this file from upstream.
115
+ If properly conigured, local modifications outside canonical blocks.
116
+ default: true
117
+ data:
118
+ type: Map
119
+ desc: Optional data to render the template with.
120
+
121
+ library:
122
+ type: Map
123
+ desc: |
124
+ Configuration for remote library fetch and host-wide cache.
125
+ This feature is for using an alternate library on a per-repo basis.
126
+ It can be used to cache and use non-standard libraries stored in a distinct path on the host.
127
+ properties:
128
+ _meta:
129
+ acc: [enabled,source,sync,catalog]
130
+ enabled:
131
+ type: Boolean
132
+ desc: Whether library sync operations are active.
133
+ default: true
134
+ source:
135
+ type: Map
136
+ desc: Remote source configuration for the library.
137
+ properties:
138
+ _meta:
139
+ req: [repo,ref]
140
+ type:
141
+ type: Slug
142
+ desc: Fetch strategy (git-branch | git-repo | http-archive)
143
+ default: git-branch
144
+ repo:
145
+ type: String
146
+ desc: |
147
+ Git repository to fetch library from, either on Git (`owner/name`) or a local path on host (value starting: `~` for relative to home, `.` for relevant to present directory, or `/` for asbolute paths).
148
+ default: DocOps/lab
149
+ ref:
150
+ type: String
151
+ desc: Branch or tag to fetch from.
152
+ default: labdev-library
153
+ path:
154
+ type: Path
155
+ desc: Path within the repository to the library root. Defaults to the branch root if omitted.
156
+ sync:
157
+ type: Map
158
+ desc: Caching and sync behaviour.
159
+ properties:
160
+ _meta:
161
+ req: []
162
+ mode:
163
+ type: Slug
164
+ desc: Fetch mode. Currently only latest-only is supported.
165
+ default: latest-only
166
+ cache_root:
167
+ type: Path
168
+ desc: |
169
+ Override the XDG-derived cache root for the library snapshot.
170
+ Defaults the the host's `$XDG_CACHE_HOME/docopslab/dev/library` (usually `~/.cache/docopslab/dev/library`).
171
+
172
+ local_path:
173
+ type: Path
174
+ desc: |
175
+ Local directory pointing to the active library snapshot (e.g. `library/current`).
176
+ When set and the catalog is present, this acts as the primary cache source and
177
+ the remote SHA check is skipped entirely; intended for the library maintainer's
178
+ own repo (monorepo use). Its parent directory is used as the effective cache root.
179
+ Downstream consumer projects omit this and rely on the XDG cache or `sync.cache_root`.
180
+ catalog:
181
+ type: Map
182
+ desc: Optional asset-level overrides; replaces any external library index file.
183
+ properties:
184
+ _meta:
185
+ overrides:
186
+ type: ArrayTable
187
+ desc: Per-asset path override entries applied after cache resolution.
188
+ properties:
189
+ _meta:
190
+ req: [path]
191
+ path:
192
+ type: Path
193
+ desc: |
194
+ Relative path within the library (ex: templates/README.asciidoc).
195
+ category:
196
+ type: Slug
197
+ desc: Override the inferred category label for this asset.
198
+ exclude:
199
+ type: Boolean
200
+ desc: Exclude this path from resolution results.
201
+ default: false
@@ -18,15 +18,16 @@ labdev:
18
18
  _desc: Run assessments on the project environment and managed assets
19
19
  env:
20
20
  _desc: Assess the local environment and configuration
21
- updates:
22
- _desc: Check for updates to managed assets from upstream
23
21
  all:
24
22
  _alias: "labdev:check"
25
23
  init:
24
+ _desc: Initialize development environment assets for this project
26
25
  all:
27
26
  _desc: Bootstrap the development environment for this project
28
27
  docs:
29
28
  _desc: Sync agent documentation files to project
29
+ templates:
30
+ _desc: Bootstrap cast targets from prime templates (init-only; skips existing files)
30
31
  run:
31
32
  # there is no labdev:run:all
32
33
  script:
@@ -87,15 +88,19 @@ labdev:
87
88
  shellcheck:
88
89
  _desc: Run the base shellcheck command and options.
89
90
  _args:
91
+ path:
92
+ summ: Optional path to a specific file, directory, or glob to check.
93
+ required: false
90
94
  opts:
91
95
  summ: Additional arguments to pass to the shellcheck command.
92
96
  docs: |
93
97
  Use like:
94
- bundle exec rake 'labdev:run:shellcheck["--enable=all --format=gcc"]'
98
+ bundle exec rake 'labdev:run:shellcheck[scripts/build.sh,"--enable=all --format=gcc"]'
95
99
  required: false
96
100
  _test:
97
101
  - bundle exec rake 'labdev:run:shellcheck'
98
- - bundle exec rake 'labdev:run:shellcheck["--enable=all --format=gcc"]'
102
+ - bundle exec rake 'labdev:run:shellcheck[scripts/build.sh]'
103
+ - bundle exec rake 'labdev:run:shellcheck[scripts/,"--enable=all --format=gcc"]'
99
104
  actionlint:
100
105
  _desc: Run the base actionlint command and options.
101
106
  _args:
@@ -111,16 +116,26 @@ labdev:
111
116
  sync:
112
117
  _desc: Sync all managed files (configs, scripts, docs, styles, etc)
113
118
  all:
114
- _alias: "labdev:sync"
119
+ _desc: Check library freshness then sync all managed assets (configs, scripts, docs, templates, hooks, styles)
115
120
  configs:
116
121
  _desc: Sync configuration files from config pack
117
122
  scripts:
118
123
  _desc: Update non-local (`.vendor/`) scripts from upstream
119
124
  docs:
120
125
  _desc: Sync files to untracked local paths
121
- # _args:
122
- # force:
123
- # GET RID OF docs[force], this makes no sense, we always overwrite
126
+ templates:
127
+ _desc: Sync canonical blocks from prime templates into manifest cast targets
128
+ _args:
129
+ path:
130
+ summ: Optional target file path to restrict the sync to a single entry.
131
+ required: false
132
+ dry:
133
+ summ: Pass 'dry' to preview changes without writing files.
134
+ required: false
135
+ _test:
136
+ - bundle exec rake labdev:sync:templates
137
+ - bundle exec rake 'labdev:sync:templates[AGENTS.md]'
138
+ - bundle exec rake 'labdev:sync:templates[AGENTS.md,dry]'
124
139
  styles:
125
140
  _desc: Sync Vale styles from gem source to project
126
141
  local:
@@ -129,6 +144,22 @@ labdev:
129
144
  _desc: Sync custom styles from gem and download remote packages
130
145
  hooks:
131
146
  _desc: Update git hooks from templates (interactive)
147
+ library:
148
+ _desc: Fetch the remote library (if stale) and sync content to manifest-configured paths
149
+ _test:
150
+ - bundle exec rake labdev:sync:library
151
+ stage:
152
+ _desc: Stage a local library directory into the cache and sync to project paths (bypasses remote fetch)
153
+ _args:
154
+ path:
155
+ summ: |
156
+ Optional path to the local library directory to stage.
157
+ Defaults to manifest library.local_path, then .library/ in the
158
+ current directory, then ../lab/.library/ for downstream projects.
159
+ required: false
160
+ _test:
161
+ - bundle exec rake labdev:sync:library:stage
162
+ - bundle exec rake 'labdev:sync:library:stage[../lab/.library]'
132
163
  vale:
133
164
  _desc: Sync Vale config and all styles (custom + remote packages)
134
165
  local:
@@ -286,9 +317,13 @@ labdev:
286
317
  required: false
287
318
  show:
288
319
  scripts:
289
- _desc: List available script templatest
320
+ _desc: List available script templates
290
321
  hooks:
291
322
  _desc: List available hook templates
323
+ library:
324
+ _desc: Show the current library cache status and version
325
+ _test:
326
+ - bundle exec rake labdev:show:library
292
327
  rule:
293
328
  _desc: Show details about a specific linting rule
294
329
  _args:
@@ -301,13 +336,90 @@ labdev:
301
336
  _test:
302
337
  - bundle exec rake 'labdev:show:rule[rubocop,Layout/LineLength]'
303
338
  - bundle exec rake 'labdev:show:rule[vale,DocOpsLab-Authoring.ExNotEg]'
339
+ skim:
340
+ _desc: Skim source files for machine-oriented structured outlines (AsciiDoc + Markdown autodetect)
341
+ _args:
342
+ path:
343
+ summ: |
344
+ File path, directory, or glob of source files.
345
+ Format auto-detected from extension.
346
+ required: true
347
+ form:
348
+ summ: |
349
+ Output shape: tree, flat, or tree,flat (comma-separated).
350
+ Defaults to tree for AsciiDoc, flat for Markdown.
351
+ When form is explicitly passed, output defaults to JSON.
352
+ required: false
353
+ syntax:
354
+ summ: |
355
+ Override output format: json or yaml.
356
+ Default: yaml when form is omitted; json when form is explicitly passed.
357
+ required: false
358
+ _test:
359
+ - bundle exec rake 'labdev:skim[README.adoc]'
360
+ - bundle exec rake 'labdev:skim[.,flat]'
361
+ - bundle exec rake 'labdev:skim[.,tree]'
362
+ - bundle exec rake 'labdev:skim[*.adoc,,json]'
363
+ - bundle exec rake 'labdev:skim[.,both]'
364
+ adoc:
365
+ _desc: Skim AsciiDoc source files using Sourcerer::SourceSkim
366
+ _args:
367
+ path:
368
+ summ: File path, directory, or glob of AsciiDoc source files.
369
+ required: true
370
+ form:
371
+ summ: |
372
+ Output shape: tree, flat, or tree,flat (comma-separated).
373
+ Defaults to tree. When form is explicitly passed, output defaults to JSON.
374
+ required: false
375
+ syntax:
376
+ summ: |
377
+ Override output format: json or yaml.
378
+ Default: yaml when form is omitted; json when form is explicitly passed.
379
+ required: false
380
+ _test:
381
+ - bundle exec rake 'labdev:skim:adoc[README.adoc]'
382
+ - bundle exec rake 'labdev:skim:adoc[.,flat]'
383
+ - bundle exec rake 'labdev:skim:adoc[*.adoc,,yaml]'
384
+ md:
385
+ _desc: Skim Markdown source files using Sourcerer::SourceSkim. Supports upstream:local overlay path syntax.
386
+ _docs: |
387
+ Accepts a single path or an upstream:local overlay pair (colon-separated).
388
+
389
+ With two paths, local files shadow upstream files sharing the same relative path,
390
+ and local-only files are appended. This is useful when a project maintains local
391
+ additions or overrides alongside a synced upstream docs library.
392
+
393
+ Examples:
394
+ Single path: .agent/docs/
395
+ Overlay pair: .agent/docs/:_docs/agent/
396
+ _args:
397
+ path:
398
+ summ: |
399
+ File path, directory, or glob of Markdown source files.
400
+ Optionally provide two directories as upstream:local to merge with local overrides taking precedence.
401
+ required: true
402
+ form:
403
+ summ: |
404
+ Output shape: tree, flat, or tree,flat (comma-separated).
405
+ Defaults to flat for Markdown. When form is explicitly passed, output defaults to JSON.
406
+ required: false
407
+ syntax:
408
+ summ: |
409
+ Override output format: json or yaml.
410
+ Default: yaml when form is omitted; json when form is explicitly passed.
411
+ required: false
412
+ _test:
413
+ - bundle exec rake 'labdev:skim:md[.agent/docs/]'
414
+ - bundle exec rake 'labdev:skim:md[.agent/docs/,flat,json]'
415
+ - bundle exec rake 'labdev:skim:md[.agent/docs/:_docs/agent/,flat,json]'
304
416
  # ADDING:
305
417
  help:
306
418
  _desc: Show help information about labdev tasks
307
419
  _docs: |
308
420
  Default behavior is to show general help information.
309
421
 
310
- Use like:
422
+ Use like:
311
423
  bundle exec rake 'labdev:help[lint:ruby]'
312
424
  _args:
313
425
  task_string: