@jenga-ai/agent 1.0.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 (177) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +340 -0
  3. package/agents/ai_engineer.md +113 -0
  4. package/agents/developer.md +236 -0
  5. package/agents/scrum-master.md +349 -0
  6. package/agents/scrutiny-agent.md +137 -0
  7. package/agents/solution-assessor.md +185 -0
  8. package/agents/tester.md +339 -0
  9. package/bin/jenga.js +70 -0
  10. package/hooks/copilot_session_end.sh +29 -0
  11. package/hooks/on_session_end.sh +238 -0
  12. package/hooks/prompt_router.sh +11 -0
  13. package/hooks/prompt_router_helper.js +52 -0
  14. package/hooks/session_end_helper.js +29 -0
  15. package/hooks/session_end_watcher.sh +24 -0
  16. package/lib/commands/attach.js +47 -0
  17. package/lib/commands/init.js +207 -0
  18. package/lib/commands/start.js +16 -0
  19. package/lib/commands/status.js +53 -0
  20. package/lib/config-schema.js +72 -0
  21. package/lib/inject-settings.js +61 -0
  22. package/lib/mirror.js +244 -0
  23. package/lib/resolve-project-dir.sh +47 -0
  24. package/mcp/execute-ticket/index.js +10 -0
  25. package/mcp/execute-ticket/package.json +5 -0
  26. package/mcp/help/index.js +79 -0
  27. package/mcp/help/package.json +14 -0
  28. package/mcp/router/README.md +19 -0
  29. package/mcp/router/embedder.js +23 -0
  30. package/mcp/router/index.js +204 -0
  31. package/mcp/router/matcher.js +87 -0
  32. package/mcp/router/package-lock.json +1048 -0
  33. package/mcp/router/package.json +11 -0
  34. package/mcp/router/skill-index.js +104 -0
  35. package/package.json +47 -0
  36. package/scripts/board_resolver.sh +46 -0
  37. package/scripts/e25_s01_extract_board_graph.py +292 -0
  38. package/scripts/e25_s01_generate_synthetic_board.py +90 -0
  39. package/scripts/measurement-10x.json +50 -0
  40. package/scripts/measurement-10x.txt +4 -0
  41. package/scripts/measurement-real.json +50 -0
  42. package/scripts/measurement-real.txt +4 -0
  43. package/scripts/postinstall.js +165 -0
  44. package/scripts/todo_cleanup.sh +22 -0
  45. package/scripts/todo_manager.sh +86 -0
  46. package/scripts/validate-board.sh +190 -0
  47. package/scripts/validate-story-format.sh +53 -0
  48. package/skills/brainstorm/SKILL.md +47 -0
  49. package/skills/btw/SKILL.md +42 -0
  50. package/skills/commit/SKILL.md +29 -0
  51. package/skills/commit/assets/user_instructions_template.md +22 -0
  52. package/skills/continue/SKILL.md +29 -0
  53. package/skills/convert/SKILL.md +124 -0
  54. package/skills/convert/convert_cli.py +235 -0
  55. package/skills/convert/tests/sample.csv +4 -0
  56. package/skills/convert/tests/sample.json +5 -0
  57. package/skills/convert/tests/sample.jsonl +3 -0
  58. package/skills/convert/tests/sample.yaml +18 -0
  59. package/skills/convert/tests/sample_obj.csv +2 -0
  60. package/skills/convert/tests/sample_obj.json +9 -0
  61. package/skills/deep-dive/SKILL.md +167 -0
  62. package/skills/do/SKILL.md +88 -0
  63. package/skills/do/assets/sender_template.json +12 -0
  64. package/skills/doc/SKILL.md +314 -0
  65. package/skills/doc/assets/path-objectives.yaml +38 -0
  66. package/skills/doc-sync/SKILL.md +167 -0
  67. package/skills/doc-sync/assets/default_excludes.txt +21 -0
  68. package/skills/doc-sync/assets/doc_targets.md +14 -0
  69. package/skills/dooo/SKILL.md +60 -0
  70. package/skills/error/SKILL.md +29 -0
  71. package/skills/evaluate/SKILL.md +45 -0
  72. package/skills/evaluate/assets/evaluation_invokation_template.yml +3 -0
  73. package/skills/evaluate/assets/evaluation_rapport_template.md +24 -0
  74. package/skills/examplify/SKILL.md +42 -0
  75. package/skills/help/SKILL.md +36 -0
  76. package/skills/improve/SKILL.md +55 -0
  77. package/skills/index/scripts/board-index +4 -0
  78. package/skills/index/scripts/board_index.py +615 -0
  79. package/skills/index/scripts/smoke_test.sh +86 -0
  80. package/skills/init/SKILL.md +44 -0
  81. package/skills/init/assets/.gitignore_template +15 -0
  82. package/skills/init/assets/PROJECT_SUMMARY_template.md +13 -0
  83. package/skills/init/assets/directory_structure.txt +13 -0
  84. package/skills/init/assets/test-config_template.json +4 -0
  85. package/skills/init/assets/workflow_template.json +30 -0
  86. package/skills/init/scripts/init.sh +48 -0
  87. package/skills/jbp/SKILL.md +25 -0
  88. package/skills/jenga/SKILL.md +68 -0
  89. package/skills/lgtm/SKILL.md +21 -0
  90. package/skills/mirror-public/SKILL.md +237 -0
  91. package/skills/mirror-public/assets/config.json +5 -0
  92. package/skills/mirror-public/scripts/mirror.sh +374 -0
  93. package/skills/pi-plan/SKILL.md +62 -0
  94. package/skills/pi-plan/assets/epic.json +7 -0
  95. package/skills/pi-plan/assets/story_template.md +18 -0
  96. package/skills/proceed/SKILL.md +29 -0
  97. package/skills/publish/SKILL.md +351 -0
  98. package/skills/publish/adapters/droplet.md +200 -0
  99. package/skills/publish/adapters/mobile-ios.md +114 -0
  100. package/skills/publish/adapters/npm-ci.md +223 -0
  101. package/skills/publish/adapters/npm.md +121 -0
  102. package/skills/publish/assets/ExportOptions.plist.template +19 -0
  103. package/skills/publish/assets/ci-contract.md +111 -0
  104. package/skills/publish/assets/ownership-matrix.md +17 -0
  105. package/skills/publish/assets/publish.example.json +85 -0
  106. package/skills/publish/assets/publish.example.npm-ci.json +40 -0
  107. package/skills/publish/assets/publish.example.npm.json +41 -0
  108. package/skills/publish/assets/secrets-guide.md +104 -0
  109. package/skills/publish/schemas/fixtures/npm-ci-minimal.json +17 -0
  110. package/skills/publish/schemas/fixtures/npm-ci-with-empty-secrets.json +18 -0
  111. package/skills/publish/schemas/fixtures/npm-ci-with-workflow-path.json +18 -0
  112. package/skills/publish/schemas/publish.schema.json +428 -0
  113. package/skills/publish/scripts/check_target_config.sh +96 -0
  114. package/skills/publish/scripts/droplet_pipeline.sh +208 -0
  115. package/skills/publish/scripts/generate_release_notes.sh +200 -0
  116. package/skills/publish/scripts/ios_pipeline.sh +486 -0
  117. package/skills/publish/scripts/npm_ci_pipeline.sh +225 -0
  118. package/skills/publish/scripts/npm_pipeline.sh +249 -0
  119. package/skills/publish/scripts/publish_common.sh +253 -0
  120. package/skills/publish/scripts/publish_deploy.sh +538 -0
  121. package/skills/publish/scripts/reconcile_tags.sh +135 -0
  122. package/skills/publish/scripts/run_gates.sh +616 -0
  123. package/skills/publish/scripts/setup_wizard.sh +394 -0
  124. package/skills/publish/scripts/show_history.sh +95 -0
  125. package/skills/publish/scripts/suggest_semver_bump.sh +105 -0
  126. package/skills/publish/scripts/validate_config.sh +163 -0
  127. package/skills/publish/scripts/validate_droplet_env.sh +45 -0
  128. package/skills/publish/scripts/validate_ios_env.sh +68 -0
  129. package/skills/publish/scripts/validate_npm_ci_env.sh +71 -0
  130. package/skills/publish/scripts/validate_npm_env.sh +22 -0
  131. package/skills/publish/scripts/write_ledger_entry.sh +126 -0
  132. package/skills/publish/wizards/droplet.md +275 -0
  133. package/skills/publish/wizards/mobile-ios.md +157 -0
  134. package/skills/publish/wizards/npm-ci.md +240 -0
  135. package/skills/publish/wizards/npm.md +224 -0
  136. package/skills/reconcile/SKILL.md +93 -0
  137. package/skills/reconcile/assets/report_format.md +44 -0
  138. package/skills/reconcile-origin/SKILL.md +75 -0
  139. package/skills/reconcile-origin/scripts/reconcile-origin.sh +372 -0
  140. package/skills/redo/SKILL.md +70 -0
  141. package/skills/route/SKILL.md +180 -0
  142. package/skills/self-sync/SKILL.md +73 -0
  143. package/skills/self-sync/scripts/run.js +136 -0
  144. package/skills/skillify/SKILL.md +68 -0
  145. package/skills/skillify/assets/init-new/SKILL.md +35 -0
  146. package/skills/skillify/assets/init-new/assets/.gitignore_template +15 -0
  147. package/skills/skillify/assets/init-new/assets/PROJECT_SUMMARY_template.md +13 -0
  148. package/skills/skillify/assets/init-new/assets/directory_structure.txt +10 -0
  149. package/skills/skillify/assets/init-new/assets/test-config_template.json +4 -0
  150. package/skills/skillify/assets/init-new/assets/workflow_template.json +17 -0
  151. package/skills/skillify/assets/init-new/scripts/init.sh +48 -0
  152. package/skills/skillify/assets/init-old/SKILL.md +124 -0
  153. package/skills/spinoff/SKILL.md +48 -0
  154. package/skills/status/SKILL.md +33 -0
  155. package/skills/status/assets/output_format.md +41 -0
  156. package/skills/todo/SKILL.md +46 -0
  157. package/skills/todo/assets/todo_handoff_template.md +22 -0
  158. package/skills/todo/assets/todo_template.md +3 -0
  159. package/skills/train/SKILL.md +116 -0
  160. package/skills/train/assets/dashboard-templates/classifiers.html +106 -0
  161. package/skills/train/assets/dashboard-templates/nlp.html +102 -0
  162. package/skills/train/assets/dashboard-templates/transformers.html +98 -0
  163. package/skills/train/assets/results-parsers/__init__.py +9 -0
  164. package/skills/train/assets/results-parsers/classifiers.py +84 -0
  165. package/skills/train/assets/results-parsers/nlp.py +88 -0
  166. package/skills/train/assets/results-parsers/reporter.py +154 -0
  167. package/skills/train/assets/results-parsers/transformers.py +120 -0
  168. package/skills/train/train_cli.py +786 -0
  169. package/templates/EXECUTION_PLAN_TEMPLATE.md +43 -0
  170. package/templates/EXECUTION_SUMMARY_TEMPLATE.md +50 -0
  171. package/templates/JENGA_CONFIG_TEMPLATE.json +23 -0
  172. package/templates/PROBLEM_RAPPORT_TEMPLATE.md +88 -0
  173. package/templates/SCRUM_BOARD_SCHEMA.md +311 -0
  174. package/templates/SKILL.md +16 -0
  175. package/templates/SKILL_TEMPLATE.md +28 -0
  176. package/templates/USER_INSTRUCTIONS_TEMPLATE.md +22 -0
  177. package/templates/copilot-instructions.md.tpl +55 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: do
3
+ description: Execute tasks from the scrum board. Reads from project/todo.md, resolves each entry to its full scrum board context, and drives the developer agent through implementation with the correct sender object and communication contract. Loops until all selected tasks are done or the user exits.
4
+ keywords:
5
+ - do
6
+ - execute
7
+ - implement
8
+ - work on
9
+ - build
10
+ examples:
11
+ - "implement the login feature"
12
+ - "work on the API endpoint"
13
+ metadata:
14
+ prefered_agent: developer
15
+ ---
16
+
17
+ # Do — Execute Scrum Board Tasks
18
+
19
+ ## Instructions
20
+
21
+ ### 1. Check for `project/todo.md`
22
+ Run `bash scripts/todo_manager.sh exists`. If it exits non-zero, inform the user there are no queued tasks and exit.
23
+
24
+ ### 2. List tasks and let the user choose
25
+ Run `bash scripts/todo_manager.sh list` to display the queued tasks. Ask the user:
26
+ - Execute a specific task (by number or title)
27
+ - Execute the next task from the top of the list
28
+ - Exit
29
+
30
+ ### 3. Detect and break down Epics or Stories (scrum-master phase)
31
+
32
+ Before resolving a task for execution, inspect the selected entry's ID:
33
+
34
+ - **Epic (`E##`)** — the entry refers to a whole epic that has not yet been broken into stories.
35
+ Use the scrum-master agent to read the epic's board file (`$(bash scripts/board_resolver.sh)epics/`) and decompose it into stories. For each story produced:
36
+ 1. Write a story file to `$(bash scripts/board_resolver.sh)stories/`.
37
+ 2. Run `bash scripts/todo_manager.sh add '<story title>: <E##_S##>'`
38
+ After breakdown, Run `bash scripts/todo_manager.sh remove '<epic entry title>'` and go back to step 2 so the new stories are visible.
39
+
40
+ - **Story (`E##_S##`) with no tasks** — the entry refers to a story that has not yet been broken into tasks.
41
+ Check `$(bash scripts/board_resolver.sh)tasks/` for any task files whose front-matter `story_id` matches this story. If none exist, use the scrum-master agent to read the story's board file and decompose it into tasks. For each task produced:
42
+ 1. Write a task file to `$(bash scripts/board_resolver.sh)tasks/`.
43
+ After breakdown, keep the story entry in `project/todo.md` (tasks are discovered from it automatically). Go back to step 2.
44
+
45
+ - **Story (`E##_S##`) with existing tasks**, or **Task (`E##_S##_T##`)** — no breakdown needed; proceed to step 4.
46
+
47
+ ### 4. Resolve the task to full scrum board context
48
+ Each todo entry uses the format: `<mission title>: <E##_S##_T##>` (or `E##_S##` if no task ID).
49
+
50
+ Before starting:
51
+ 1. Locate and read the matching file from `$(bash scripts/board_resolver.sh)tasks/` (or `$(bash scripts/board_resolver.sh)stories/` if story-level)
52
+ 2. If the file does not exist, warn the user and skip — do not proceed with a task that has no scrum board definition
53
+ 3. Present a brief summary of the task: title, acceptance criteria, parent story, parent epic
54
+
55
+ ### 5. Invoke the developer agent
56
+ Pass the following to the developer agent:
57
+
58
+ **Sender object**: Copy `assets/sender_template.json` and populate all known fields (session_id, task_id, story_id, epic_id, current ISO 8601 UTC date).
59
+
60
+ **Context payload** (plain text alongside the sender object):
61
+ - Full task/story file content (title, description, acceptance criteria)
62
+ - Parent story and epic summaries (read from board files)
63
+ - Any relevant context from `project/PROJECT_SUMMARY.md`
64
+
65
+ The developer agent will:
66
+ - Log the incoming sender object to `project/logs/events.json`
67
+ - Create a worktree named `<E##_S##_T##-short-slug>`
68
+ - Implement, commit at milestones, and invoke the tester agent
69
+ - Return when the tester has verified the work
70
+
71
+ ### 6. Verify documentation
72
+ After the developer completes the task, confirm the following documentation was written:
73
+ - **Execution plan** — `project/documentation/plans/<E##_S##_T##>-plan.md` must exist (written by the developer before starting work)
74
+ - **Execution summary** — `project/documentation/summaries/<E##_S##_T##>-summary.md` must exist (written by the developer before invoking the tester)
75
+
76
+ If either file is missing, ask the developer to produce it before continuing.
77
+
78
+ Additionally, if the completed work introduces user-facing changes, update `README.md` and `WARP.md` accordingly.
79
+
80
+ ### 7. After successful completion
81
+ - Check for any `_INSTRUCTIONS.md` files in `$(bash scripts/board_resolver.sh)tasks/` whose ID matches the completed task. If found, present them to the user and explain that these actions must be completed before the feature will work correctly.
82
+ - Invoke the `/commit` skill to commit the work (if not already committed by the developer)
83
+ - Run `bash scripts/todo_manager.sh remove '<task title>'` to remove the completed task from `project/todo.md`
84
+ - Run `bash scripts/todo_manager.sh teardown` to delete `project/todo.md` if it is now effectively empty
85
+
86
+ ### 8. Loop
87
+ Go back to step 1.
88
+
@@ -0,0 +1,12 @@
1
+ {
2
+ "sender": {
3
+ "agent": "orchestrator",
4
+ "session_id": "",
5
+ "task_id": "",
6
+ "story_id": "",
7
+ "epic_id": "",
8
+ "date": "",
9
+ "paths": [],
10
+ "worktree": ""
11
+ }
12
+ }
@@ -0,0 +1,314 @@
1
+ ---
2
+ name: doc
3
+ description: Generate or update a documentation file by resolving a target path to a clear documentation objective before writing.
4
+ metadata:
5
+ prefered_agent: developer
6
+ keywords:
7
+ - doc
8
+ - documentation
9
+ - write docs
10
+ - generate docs
11
+ - update docs
12
+ examples:
13
+ - "/doc"
14
+ - "/doc docs/API.md"
15
+ - "generate documentation for the CLI"
16
+ - "update the contributing guide"
17
+ ---
18
+
19
+ # Doc — Documentation Synthesis and Regeneration
20
+
21
+ ## Input Format
22
+
23
+ ```text
24
+ /doc [target-path]
25
+ ```
26
+
27
+ - If `target-path` is omitted, default to `README.md`.
28
+ - If `target-path` is provided, use it exactly as written after `/doc`.
29
+ - Do not guess additional arguments or rewrite the requested path.
30
+
31
+ ## Reference Asset
32
+
33
+ Load `skills/doc/assets/path-objectives.yaml` before resolving the documentation objective. Treat it as the source of truth for the `default_target`, known target paths, and their structural requirements.
34
+
35
+ ## Synthesis Context Contract
36
+
37
+ After target resolution, all generation must operate on a synthesis context object. E24_S03 is responsible for producing the final implementation, but this story defines the field contract that downstream generation must consume.
38
+
39
+ ```yaml
40
+ target_path: README.md
41
+ objective: project overview
42
+ project_name: JengaAgent
43
+ project_description: Structured multi-agent development workflow
44
+ features: []
45
+ getting_started: []
46
+ board_items: []
47
+ conflicts_resolved: []
48
+ sources_used: []
49
+ existing_intent: null
50
+ ```
51
+
52
+ Required fields from E24_S03:
53
+ - `target_path`
54
+ - `objective`
55
+ - `project_name`
56
+ - `project_description`
57
+ - `features`
58
+ - `getting_started`
59
+ - `board_items`
60
+ - `conflicts_resolved`
61
+ - `sources_used`
62
+ - `existing_intent`
63
+
64
+ If the shared collector from E24_S03 is not yet merged, construct a temporary context with the same field names so later steps remain compatible.
65
+
66
+ ## Instructions
67
+
68
+ ### 1. Parse the target path
69
+
70
+ 1. Read `default_target` from `skills/doc/assets/path-objectives.yaml`. If it is missing, fall back to `README.md`.
71
+ 2. Remove the `/doc` command token from the invocation.
72
+ 3. Trim the remaining text.
73
+ 4. If nothing remains, set `target_path` to `default_target`.
74
+ 5. Otherwise, set `target_path` to the trimmed remainder.
75
+
76
+ Examples:
77
+ - `/doc` → `target_path = README.md`
78
+ - `/doc docs/API.md` → `target_path = docs/API.md`
79
+ - `/doc docs/CLI.md` → `target_path = docs/CLI.md`
80
+
81
+ ### 2. Resolve the objective from the rule table
82
+
83
+ 1. Read `skills/doc/assets/path-objectives.yaml`.
84
+ 2. Find an entry whose `path` exactly matches `target_path`.
85
+ 3. If a match exists, set:
86
+ - `objective` to the entry's `objective`
87
+ - `objective_summary` to the entry's `summary`
88
+ - `required_sections` / `optional_sections` from the entry when present
89
+ 4. If no match exists, stop and use the ambiguity gate in Step 4.
90
+
91
+ ### 3. Surface the resolved contract before continuing
92
+
93
+ Before any synthesis or writing work, clearly surface the resolved contract in this shape:
94
+
95
+ ```text
96
+ Resolved /doc target
97
+ - target_path: <target_path>
98
+ - objective: <objective>
99
+ - summary: <objective_summary>
100
+ - required_sections: <required_sections when present>
101
+ - optional_sections: <optional_sections when present>
102
+ ```
103
+
104
+ If the matched rule includes section guidance, carry it forward as constraints for the subsequent documentation work.
105
+
106
+ ### 4. Ambiguity gate for unknown targets
107
+
108
+ If `target_path` is not present in `skills/doc/assets/path-objectives.yaml`:
109
+
110
+ - Ask the user exactly: `What should <target_path> document? Please describe the objective.`
111
+ - Do **not** guess the objective.
112
+ - Do **not** proceed with documentation generation or updates until the user answers.
113
+ - Once the user clarifies, treat their response as the `objective`, set `objective_summary` from the same clarification when helpful, surface the resolved contract, and continue.
114
+
115
+ ### 5. Load or assemble the synthesis context
116
+
117
+ 1. Start from the E24_S03 synthesis context when it is available.
118
+ 2. Ensure `target_path` and `objective` from Steps 1–3 are copied into the context.
119
+ 3. Populate `project_name`, `project_description`, `features`, `getting_started`, `board_items`, `conflicts_resolved`, and `sources_used` from the evidence collector.
120
+ 4. If any field is temporarily unavailable because E24_S03 has not landed yet, gather the missing evidence manually and store it under the same field names.
121
+ 5. Initialise `existing_intent` to `null` before inspecting the target file.
122
+
123
+ ### 6. Read the existing target before generation
124
+
125
+ `/doc` owns the full target file. If the target already exists:
126
+
127
+ 1. Read the current file before generating anything.
128
+ 2. Extract maintainer intent that may still matter after regeneration, such as:
129
+ - custom sections that still fit the target objective
130
+ - warnings, caveats, migration notes, or known-issue callouts
131
+ - terminology preferences or audience cues
132
+ - maintainers' explicit scope boundaries
133
+ 3. Do **not** carry forward stale factual claims that conflict with the new evidence.
134
+ 4. Save the retained intent into `synthesis_context.existing_intent`.
135
+
136
+ If the target file does not exist, keep `existing_intent = null`.
137
+
138
+ ### 7. Generate a complete replacement file
139
+
140
+ 1. Build a **full file string** from the synthesis context and the resolved target objective.
141
+ 2. Treat the generated output as the entire authoritative file.
142
+ 3. Do **not** patch a single section, append new text to the end, or leave untouched legacy sections in place.
143
+ 4. Keep the output valid Markdown.
144
+ 5. When writing, replace the old file contents in one operation.
145
+
146
+ ### 8. Generate `README.md` for the project-overview objective
147
+
148
+ When `target_path = README.md`, generate the full document around the resolved project-overview contract.
149
+
150
+ #### Required structure
151
+
152
+ ```md
153
+ # <project_name>
154
+
155
+ ## Description
156
+ ...
157
+
158
+ ## Getting Started
159
+ ...
160
+ ```
161
+
162
+ #### Description rules
163
+
164
+ - Source Description content from `project_description`, `features`, and any still-valid `existing_intent`.
165
+ - Explain what the project is, what problem it solves, and who it is for.
166
+ - Keep the section concise and factual.
167
+ - Cap the section at **1000 words maximum**.
168
+ - Prefer a tight narrative plus bullets over repetitive prose.
169
+
170
+ #### Getting Started rules
171
+
172
+ - Source the section from `getting_started` first.
173
+ - Fill missing setup detail from concrete manifests and entrypoints already present in the codebase (for example `package.json`, `pyproject.toml`, `go.mod`, startup scripts, or checked-in app packages).
174
+ - Cover install, configure, and run steps only when evidence exists.
175
+ - Preserve useful setup warnings from `existing_intent` when they are still valid.
176
+ - Output valid Markdown lists or numbered steps.
177
+
178
+ ### 9. Conditionally include a README Examples section
179
+
180
+ Only add `## Examples` to `README.md` when the synthesis context supports a grounded project-type inference.
181
+
182
+ #### Infer the project type from evidence
183
+
184
+ Use the synthesis context first, then reinforce it with manifests and source layout:
185
+
186
+ - **CLI** indicators:
187
+ - `bin` in `package.json`
188
+ - Python CLI entrypoints such as `[project.scripts]` / `[tool.poetry.scripts]`
189
+ - CLI-focused board items or feature descriptions
190
+ - command-oriented code or existing CLI docs
191
+ - **API** indicators:
192
+ - web-framework dependencies
193
+ - route/controller files
194
+ - `openapi.yaml` / `openapi.yml`
195
+ - board items describing endpoints or request/response behavior
196
+ - **Library / SDK** indicators:
197
+ - no CLI `bin`
198
+ - export-heavy modules or public interfaces
199
+ - registry-publishing metadata
200
+ - board items describing integration from another project
201
+
202
+ Choose the strongest evidenced type in this priority order when multiple types appear: explicit synthesis-context evidence, manifest metadata, source-layout evidence, then board-item wording. If no type can be supported confidently, omit the Examples section entirely.
203
+
204
+ #### Examples rules
205
+
206
+ - Generate at least **two concrete examples** when the section is included.
207
+ - Every example must come from real capabilities present in `features`, `getting_started`, `sources_used`, or retained `existing_intent`.
208
+ - Match the example shape to the inferred type:
209
+ - **CLI** → command invocations with realistic flags and outcomes
210
+ - **API** → request/response examples such as `curl` or HTTP snippets
211
+ - **Library / SDK** → import-and-use code snippets
212
+ - Do **not** include placeholder examples, pseudo-commands, or guessed endpoints.
213
+ - If you cannot produce two grounded examples, omit the section instead of improvising.
214
+
215
+ ### 10. Generate non-README targets from the rule table
216
+
217
+ For every known non-README target, the path-to-objective rule table determines the file structure. Generate a full document that satisfies the matched rule.
218
+
219
+ #### `docs/API.md` — API reference documentation
220
+
221
+ Required shape:
222
+
223
+ ```md
224
+ # API Reference
225
+
226
+ ## Overview
227
+ ...
228
+
229
+ ## Endpoints or Interfaces
230
+ ### <module or route group>
231
+ - Signature / method + path
232
+ - Parameters or request fields
233
+ - Return values or response shape
234
+
235
+ ## Request and Response Details
236
+ ...
237
+ ```
238
+
239
+ Rules:
240
+ - Group content by module, route family, or interface namespace.
241
+ - Include function signatures or HTTP method/path pairs when evidence exists.
242
+ - Document parameters, request bodies, return values, and notable errors.
243
+ - Use `sources_used` and `board_items` to ground scope; do not invent undocumented endpoints.
244
+
245
+ #### `docs/CLI.md` — CLI usage guide
246
+
247
+ Required shape:
248
+
249
+ ```md
250
+ # CLI Guide
251
+
252
+ ## Overview
253
+ ...
254
+
255
+ ## Commands
256
+ ...
257
+
258
+ ## Flags
259
+ ...
260
+
261
+ ## Examples
262
+ ...
263
+ ```
264
+
265
+ Rules:
266
+ - Derive the command name from CLI entrypoints such as `package.json#bin`.
267
+ - List commands and subcommands with concise descriptions.
268
+ - Document flags with names, accepted values, defaults, and effects when evidence exists.
269
+ - Include usage examples grounded in real workflows from the synthesis context.
270
+
271
+ #### `docs/CONTRIBUTING.md` — contributor guide
272
+
273
+ Required shape:
274
+
275
+ ```md
276
+ # Contributing
277
+
278
+ ## Development Setup
279
+ ...
280
+
281
+ ## Workflow
282
+ ...
283
+
284
+ ## Contribution Expectations
285
+ ...
286
+ ```
287
+
288
+ Rules:
289
+ - Use manifests, repo scripts, and existing maintainer guidance to describe setup.
290
+ - Explain branch, PR, review, and testing expectations only from repository evidence.
291
+ - Carry forward still-valid maintainer norms captured in `existing_intent`.
292
+
293
+ #### `CHANGELOG.md` — changelog / release notes
294
+
295
+ Required shape:
296
+
297
+ ```md
298
+ # Changelog
299
+
300
+ ## <version or date heading>
301
+ ### Notable Changes
302
+ - ...
303
+ ```
304
+
305
+ Rules:
306
+ - Derive entries from `git log`; do not fabricate releases.
307
+ - Group entries by version tag when tags exist.
308
+ - If version tags do not exist, group by date-based headings instead.
309
+ - Summarize each entry from commit subjects and, when needed, nearby commit context.
310
+ - Keep newest entries first.
311
+
312
+ ### 11. Continue using the resolved objective
313
+
314
+ After the target path and objective are resolved, use them as the contract for all subsequent `/doc` work. Known paths must bypass the ambiguity gate, and all later decisions about evidence gathering, scope, regeneration, and structure must honor the surfaced `target_path` and `objective` instead of inferring a different goal.
@@ -0,0 +1,38 @@
1
+ default_target: README.md
2
+ rules:
3
+ - path: README.md
4
+ objective: project overview
5
+ summary: Create or update a high-level project overview.
6
+ required_sections:
7
+ - Description
8
+ - Getting Started
9
+ optional_sections:
10
+ - Examples
11
+ - path: docs/API.md
12
+ objective: API reference documentation
13
+ summary: Document the public API surface, endpoints, inputs, outputs, and integration details.
14
+ required_sections:
15
+ - Overview
16
+ - Endpoints or Interfaces
17
+ - Request and Response Details
18
+ - path: docs/CLI.md
19
+ objective: CLI usage guide
20
+ summary: Explain command usage, arguments, flags, examples, and common workflows.
21
+ required_sections:
22
+ - Overview
23
+ - Commands
24
+ - Flags
25
+ - Examples
26
+ - path: docs/CONTRIBUTING.md
27
+ objective: contributor guide
28
+ summary: Explain how contributors should set up, work on, test, and submit changes.
29
+ required_sections:
30
+ - Development Setup
31
+ - Workflow
32
+ - Contribution Expectations
33
+ - path: CHANGELOG.md
34
+ objective: changelog / release notes
35
+ summary: Record notable changes, releases, and upgrade notes in chronological order.
36
+ required_sections:
37
+ - Release Entries
38
+ - Notable Changes
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: doc-sync
3
+ description: Compare the current state of a project with its documentation and update documentation to reflect changes. Accepts `update:`, `source:`, `exclude:`, and `minify:` arguments to control scope. Use when documentation may be out of date with implementation, or when the user asks to sync, refresh, update, or shrink docs.
4
+ keywords:
5
+ - doc-sync
6
+ - documentation
7
+ - update docs
8
+ - sync docs
9
+ examples:
10
+ - "update the documentation"
11
+ - "sync docs with current state"
12
+ ---
13
+
14
+ # Doc-Sync — Keep Documentation in Sync with the Codebase
15
+
16
+ ## What this skill does
17
+
18
+ Analyses project source files, compares them against existing documentation, and updates any documentation that is stale, incomplete, or missing. Can be scoped with arguments to focus on specific files or exclude noise.
19
+
20
+ ---
21
+
22
+ ## Argument Parsing
23
+
24
+ Before doing anything, check the user's message for arguments. Arguments may appear in any order and may be combined in a single invocation.
25
+
26
+ | Argument | Format | Meaning |
27
+ |---|---|---|
28
+ | `--update:` | `update: <path(s)>` | Documentation file(s) to check and update. Comma or space-separated. |
29
+ | `--source:` | `source: <path(s)>` | Source file(s) or director(ies) to prioritize when analysing changes. Comma or space-separated. |
30
+ | `--exclude:` | `exclude: <path(s)>` | File(s) or director(ies) to skip entirely — neither read as source nor updated. Comma or space-separated. |
31
+ | `--minify:` | `minify: <percent>` | Reduce each target documentation file by approximately N% by removing redundant and non-essential content. Defaults to `70` (i.e. scale down to 70% of original size) if no value is given. |
32
+
33
+ **Examples:**
34
+ - `doc-sync update: docs/API.md source: src/api/`
35
+ - `doc-sync exclude: node_modules, dist update: README.md`
36
+ - `doc-sync source: src/auth/ update: docs/auth.md, docs/security.md`
37
+ - `doc-sync minify: 50 update: docs/API.md`
38
+ - `doc-sync minify: update: README.md` *(uses default 70%)*
39
+
40
+ All paths are interpreted relative to the project root.
41
+
42
+ ---
43
+
44
+ ## Instructions
45
+
46
+ ### 1. Parse arguments
47
+
48
+ Extract any `update:`, `source:`, `exclude:`, and `minify:` values from the user's message.
49
+ - Store each as a list: `update_targets`, `source_paths`, `exclude_paths`.
50
+ - Store `minify` as a number `minify_pct`. If the `minify:` key is present but has no value, default to `70`. If `minify:` is absent entirely, set `minify_pct` to `null` (no minification).
51
+ - Merge `exclude_paths` with the default excludes from `assets/default_excludes.txt`.
52
+
53
+ ### 2. Resolve update targets
54
+
55
+ If `update_targets` is **not empty**, use those paths as the documentation files to update.
56
+
57
+ If `update_targets` is **empty**, resolve targets from `assets/doc_targets.md`:
58
+ - Read the file and parse the **Documentation Targets** list.
59
+ - Each entry is a relative path to a documentation file to keep up to date.
60
+ - If no entry matches an existing file, skip it and note it as missing.
61
+
62
+ If neither source has targets (no arguments and no doc_targets), scan the project for documentation files:
63
+ - Look for `*.md`, `docs/`, `documentation/`, `project/documentation/`, `README*`, `CHANGELOG*`, `CONTRIBUTING*`.
64
+ - Ask the user: *"I found the following documentation files. Which should I update?"* — present the list and let them select.
65
+
66
+ ### 3. Resolve analysis sources
67
+
68
+ If `source_paths` is **not empty**, read those files and directories (recursively if directories).
69
+
70
+ If `source_paths` is **empty**, infer sources from each update target:
71
+ - Read the existing content of the documentation file.
72
+ - Look for mentions of paths, module names, function names, or API routes that hint at what code it describes.
73
+ - Use those hints to locate relevant source files in the project.
74
+ - Fall back to a broad scan of common source directories (`src/`, `lib/`, `app/`, project root) if no hints are found.
75
+
76
+ Apply `exclude_paths` at this step — skip any file or directory matching an excluded path.
77
+
78
+ ### 4. Analyse for drift
79
+
80
+ For each update target and its resolved sources:
81
+
82
+ 1. **Read the documentation file** — understand what it currently claims (structure, API, config, behaviour, examples).
83
+ 2. **Read the source files** — extract the current reality (exported functions, routes, config keys, CLI flags, env vars, class names, etc.).
84
+ 3. **Compare** — identify:
85
+ - Sections that reference removed or renamed things.
86
+ - Missing documentation for new things added in source.
87
+ - Outdated examples, wrong flag names, stale code snippets.
88
+ - Incorrect or missing configuration keys/values.
89
+
90
+ ### 5. Report findings before updating
91
+
92
+ Before making any writes, present a concise drift summary per file:
93
+
94
+ ```
95
+ 📄 docs/API.md
96
+ ✏️ /api/users route renamed to /api/members in source
97
+ ➕ New endpoint POST /api/invites not documented
98
+ 🗑️ Reference to deprecated `--verbose` flag still present
99
+
100
+ 📄 README.md
101
+ ✏️ Setup instructions reference Node 16; project now requires Node 20
102
+ ➕ New environment variable DATABASE_URL not listed
103
+ ```
104
+
105
+ Ask: *"Should I apply all updates, or skip any of these?"*
106
+
107
+ ### 6. Apply updates
108
+
109
+ For each approved update:
110
+ - Edit the documentation file in-place — preserve existing structure, tone, and formatting.
111
+ - Replace stale references with accurate ones.
112
+ - Add new sections or entries for undocumented items.
113
+ - Remove or mark deprecated items with a note if full removal seems too aggressive (ask when uncertain).
114
+ - Do not alter sections that appear unrelated to the analysed source files.
115
+
116
+ ### 6a. Minify (if `minify_pct` is set)
117
+
118
+ After sync edits are applied (or if only minification was requested), reduce each target file to approximately `minify_pct`% of its current size:
119
+
120
+ **What to remove — in priority order:**
121
+ 1. Duplicate explanations of the same concept said in multiple ways.
122
+ 2. Verbose prose that restates what a code example already shows clearly.
123
+ 3. Historical context, changelogs, or migration notes buried in reference docs.
124
+ 4. Filler phrases ("It is important to note that…", "As mentioned above…").
125
+ 5. Redundant examples where one concise example covers the same case as two or three longer ones — keep the most illustrative, remove the rest.
126
+ 6. Section headers with no meaningful content beneath them.
127
+
128
+ **What to keep — never remove:**
129
+ - All unique technical facts (function signatures, config keys, env vars, routes, types).
130
+ - Code examples that demonstrate something not expressed in prose.
131
+ - Warnings, caveats, and known limitations.
132
+ - Installation and setup steps.
133
+
134
+ **Process:**
135
+ 1. Calculate the current character count of the file.
136
+ 2. Target size = `current_size × (minify_pct / 100)`.
137
+ 3. Remove content following the priority list above until the file is at or below the target size.
138
+ 4. If the target cannot be reached without removing essential content, stop at the smallest safe size and note the actual reduction achieved.
139
+ 5. Do not rewrite or paraphrase kept content — only remove.
140
+
141
+ ### 7. Summarise changes
142
+
143
+ After all writes are done, print a summary:
144
+
145
+ ```
146
+ ✅ Updated 3 documentation files:
147
+ - docs/API.md (2 sections updated, 1 added)
148
+ - README.md (setup instructions refreshed)
149
+ - docs/config.md (3 new env vars added)
150
+
151
+ 🗜️ Minified 2 documentation files:
152
+ - docs/API.md (4 200 → 2 940 chars, −30%)
153
+ - README.md (3 100 → 2 170 chars, −30%)
154
+
155
+ ⚠️ Skipped 1 file (no matching sources found):
156
+ - docs/legacy.md
157
+ ```
158
+
159
+ If nothing needed updating, print: `✅ Documentation is already in sync with the source.`
160
+ If minification could not reach the target, note: `⚠️ docs/API.md reduced to X% (target was Y% — essential content limit reached).`
161
+
162
+ ---
163
+
164
+ ## Reference files
165
+
166
+ - `assets/doc_targets.md` — Editable list of documentation files this skill checks by default.
167
+ - `assets/default_excludes.txt` — Paths always excluded from source analysis unless overridden.
@@ -0,0 +1,21 @@
1
+ # Default Excludes
2
+ # Paths listed here are never used as analysis sources.
3
+ # One path per line. Supports directory names and file names.
4
+ # Lines starting with # are ignored.
5
+
6
+ node_modules
7
+ dist
8
+ build
9
+ .git
10
+ .cache
11
+ coverage
12
+ .next
13
+ .nuxt
14
+ out
15
+ tmp
16
+ temp
17
+ *.lock
18
+ *.log
19
+ package-lock.json
20
+ yarn.lock
21
+ pnpm-lock.yaml
@@ -0,0 +1,14 @@
1
+ # Documentation Targets
2
+
3
+ List the relative paths (from the project root) to documentation files that `doc-sync` should check and update by default — when no `update:` argument is provided.
4
+
5
+ Add one path per line inside the list below. Blank lines and lines starting with `#` are ignored.
6
+
7
+ ## Documentation Targets
8
+
9
+ <!-- Add your project's documentation files here, one per line -->
10
+ README.md
11
+ <!-- docs/API.md -->
12
+ <!-- docs/config.md -->
13
+ <!-- CHANGELOG.md -->
14
+ <!-- CONTRIBUTING.md -->