@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,224 @@
1
+ # npm setup wizard
2
+
3
+ Use this template to collect the values required for an `npm` publish target.
4
+ Each section maps directly to a field in `publish.json`.
5
+
6
+ Before running the prompts, load the project's `package.json` (if present) so
7
+ `name` can be offered as the default for `package_name`. If `publish.json`
8
+ already contains a target whose `type` is `npm`, ask the user whether to
9
+ **overwrite** the existing target or **update** individual fields — do not
10
+ silently replace it.
11
+
12
+ After collecting answers, write the target block to `publish.json` (create the
13
+ file from the base scaffold if it does not exist) and generate
14
+ `project/instructions/E26_S04_T02_INSTRUCTIONS.md` documenting the `NPM_TOKEN`
15
+ prerequisite. See the "Post-collection actions" section at the bottom for the
16
+ full write sequence.
17
+
18
+ ## Question: package_name
19
+
20
+ Maps to: `targets[].npm.package_name`
21
+
22
+ Enter the npm package name as it should appear in the registry.
23
+ If a `package.json` exists at the project root, offer its `name` field as the
24
+ default. Supports scoped names such as `@scope/name`.
25
+
26
+ ## Expected format:
27
+
28
+ Lowercase, url-safe name matching `^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$`
29
+ (e.g. `jenga-agent`, `@my-org/utils`). Max 214 characters.
30
+
31
+ ## Question: access
32
+
33
+ Maps to: `targets[].npm.access`
34
+
35
+ Choose the registry access level for this package.
36
+ `public` publishes an openly-installable package. `restricted` publishes a
37
+ private package (requires a paid npm plan or a private registry such as
38
+ GitHub Packages).
39
+
40
+ ## Expected format:
41
+
42
+ One of: `public`, `restricted`. Press Enter to accept the default (`public`).
43
+
44
+ ## Question: dist_tag
45
+
46
+ Maps to: `targets[].npm.dist_tag`
47
+
48
+ Enter the npm dist-tag applied to this publish. `latest` is the default
49
+ install tag; use tags like `next` or `beta` for pre-releases so that
50
+ `npm install <pkg>` continues to resolve to the current stable version.
51
+
52
+ ## Expected format:
53
+
54
+ Lowercase tag matching `^[a-z0-9][a-z0-9._-]*$` (e.g. `latest`, `next`,
55
+ `beta`). Press Enter to accept the default (`latest`).
56
+
57
+ ## Question: registry
58
+
59
+ Maps to: `targets[].npm.registry`
60
+
61
+ Enter the registry URL to publish to.
62
+ For the public npm registry, accept the default. For GitHub Packages, use
63
+ `https://npm.pkg.github.com`. For a private/internal registry, use the URL
64
+ provided by your registry operator.
65
+
66
+ ## Expected format:
67
+
68
+ An absolute `https://` URL (e.g. `https://registry.npmjs.org`,
69
+ `https://npm.pkg.github.com`). Press Enter to accept the default
70
+ (`https://registry.npmjs.org`).
71
+
72
+ ## Question: dry_run
73
+
74
+ Maps to: `targets[].notes` (captured as a wizard-authored note; there is no
75
+ dedicated schema field for dry-run because it is a per-invocation pipeline
76
+ concern, not persistent target config).
77
+
78
+ Ask whether the first deploy against this target should be executed as a
79
+ dry-run (`npm publish --dry-run`). A dry-run packs and validates the tarball
80
+ and contacts the registry without publishing, letting you confirm the target
81
+ config end-to-end before spending a real version bump.
82
+
83
+ If the user answers **yes**, append a line to the target's `notes` field
84
+ along the lines of:
85
+
86
+ > First deploy should be a dry-run (`npm publish --dry-run`) per wizard
87
+ > preference. Remove this note after the dry-run passes.
88
+
89
+ If the user answers **no**, do not add a dry-run note; the pipeline will
90
+ publish for real on the first run.
91
+
92
+ ## Expected format:
93
+
94
+ Yes/no. Press Enter to accept the default (`yes` — recommended for the first
95
+ deploy).
96
+
97
+ ## Prerequisite: NPM_TOKEN
98
+
99
+ The npm pipeline reads the auth token from the `NPM_TOKEN` environment
100
+ variable at publish time (`skills/publish/adapters/npm.md` defines this
101
+ contract). The wizard does not collect the token value — that would be
102
+ unsafe. Instead, at the end of the wizard, write the following instructions
103
+ file so the user knows exactly what to configure:
104
+
105
+ **File to write:** `project/instructions/E26_S04_T02_INSTRUCTIONS.md`
106
+
107
+ **Contents (verbatim template):**
108
+
109
+ ```markdown
110
+ # npm Publish — Setup Instructions
111
+
112
+ **Epic**: E26 — NPM-Compatible Distribution
113
+ **Required before**: running `/publish deploy` against the npm target
114
+
115
+ ## Overview
116
+
117
+ The npm publish pipeline authenticates with the target registry using an
118
+ automation token stored in the `NPM_TOKEN` environment variable. This file
119
+ walks you through obtaining that token and making it available to the
120
+ pipeline.
121
+
122
+ ## Steps
123
+
124
+ 1. Sign in to https://www.npmjs.com with the account that owns (or is a
125
+ maintainer of) the package.
126
+ 2. Open **Account Settings** → **Access Tokens** → **Generate New Token**.
127
+ 3. Choose **Automation** (this token type bypasses 2FA prompts, which is
128
+ required for CI/scripted publishes).
129
+ 4. Copy the generated token immediately — npm shows it only once.
130
+ 5. Store the token in the environment the pipeline runs in:
131
+ - **Local development**: add `export NPM_TOKEN=<token>` to a shell rc
132
+ file that is loaded before running `/publish deploy`, or place it in
133
+ a git-ignored `.env` file and source it in your shell.
134
+ - **CI (GitHub Actions, etc.)**: add `NPM_TOKEN` as an encrypted
135
+ repository secret and expose it to the publish job via
136
+ `env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}`.
137
+ - **GitHub Packages**: use a GitHub Personal Access Token with
138
+ `write:packages` scope in place of an npm.js token, and export it as
139
+ `NPM_TOKEN` (or `NODE_AUTH_TOKEN` if your `.npmrc` uses that name).
140
+ 6. Never commit the token value to the repository. `.env` files, shell rc
141
+ files, and CI logs must all be treated as sensitive.
142
+
143
+ ## Verification
144
+
145
+ Run `npm whoami --registry <your-registry-url>` with `NPM_TOKEN` set. It
146
+ should print your npm username. If it prints an anonymous / not-logged-in
147
+ error, the token is missing, expired, or scoped to the wrong registry.
148
+
149
+ ## Notes
150
+
151
+ - Automation tokens do not expire by default but can be revoked at any time
152
+ from the npm Access Tokens page.
153
+ - If you rotate the token, update the value everywhere it is stored (local
154
+ env, CI secrets) — the pipeline reads it fresh on every invocation.
155
+ - The `secrets.NPM_TOKEN` entry in `publish.json` is a reference like
156
+ `"$NPM_TOKEN"`, not the token value itself. The publish adapter resolves
157
+ the reference against the current environment.
158
+ ```
159
+
160
+ Do not skip generating this file, even if the user says the token is already
161
+ configured — the instructions file is the durable record of what the
162
+ pipeline expects.
163
+
164
+ ## Post-collection actions
165
+
166
+ Once all five answers have been collected, perform the following steps in
167
+ order:
168
+
169
+ 1. **Load or scaffold `publish.json`.** If the file does not exist at the
170
+ project root, create it from the base scaffold with `version: 1`,
171
+ populated `defaults`, and an empty `targets` array. If it does exist,
172
+ parse and preserve every unrelated field.
173
+ 2. **Check for an existing npm target.** Scan `targets[]` for any entry with
174
+ `"type": "npm"`. If one exists, ask the user:
175
+ - **overwrite** — replace the entire target block with the wizard output
176
+ - **update** — merge the wizard answers into the existing target
177
+ field-by-field, keeping any user-added fields (e.g. custom `checks`
178
+ or `notes`) intact.
179
+ If none exists, append a new target block.
180
+ 3. **Write the target block.** Emit it in the exact shape below (with
181
+ dry-run note only if the user answered yes):
182
+
183
+ ```json
184
+ {
185
+ "name": "npm-<package-slug>",
186
+ "type": "npm",
187
+ "platform": "npm-registry",
188
+ "checks": {
189
+ "pre": ["lint", "type-check"],
190
+ "post": ["smoke-test"]
191
+ },
192
+ "secrets": {
193
+ "NPM_TOKEN": "$NPM_TOKEN"
194
+ },
195
+ "npm": {
196
+ "package_name": "<answer>",
197
+ "access": "<answer>",
198
+ "registry": "<answer>",
199
+ "dist_tag": "<answer>"
200
+ },
201
+ "notes": "<optional dry-run note per user preference>"
202
+ }
203
+ ```
204
+
205
+ Notes on shape:
206
+ - `name` is derived from the package name (slugified, lowercased). If a
207
+ collision exists, suffix with `-2`, `-3`, etc.
208
+ - `platform` is `npm-registry` for `https://registry.npmjs.org`. If the
209
+ user supplied `https://npm.pkg.github.com`, set `platform` to
210
+ `github-packages` instead.
211
+ - `secrets` includes `NPM_TOKEN` by default. If the user's registry uses
212
+ `NODE_AUTH_TOKEN` (common with GitHub Packages `.npmrc` setups), swap
213
+ the key accordingly — the schema accepts either.
214
+ - Omit the `notes` field entirely when the user declined the dry-run.
215
+ 4. **Validate against the schema.** Run `scripts/validate_publish_config.sh`
216
+ (or the equivalent AJV invocation) before saving. If validation fails,
217
+ report the error and abort — do not write a broken `publish.json`.
218
+ 5. **Write the instructions file.** Create
219
+ `project/instructions/E26_S04_T02_INSTRUCTIONS.md` with the verbatim
220
+ template from the "Prerequisite: NPM_TOKEN" section above. Create the
221
+ `project/instructions/` directory if it does not exist.
222
+ 6. **Report to the user.** Print a short summary listing (a) the target
223
+ block written, (b) the path to the instructions file, and (c) the exact
224
+ env var they must set before running `/publish deploy`.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: reconcile
3
+ description: Reconcile the scrum board with actual implementation state. Cross-checks every task's board status against git history and worktrees, merges orphaned worktree branches, demotes unimplemented "Done" items, promotes secretly-implemented items, and cleans stale entries from todo.md. Use when the board feels out of sync, after a big merge session, when tasks were completed outside the normal workflow, or when todo.md has grown stale. Trigger on phrases like "sync the board", "clean up the board", "reconcile", "board is out of date", "todo is stale", or "check what's really done".
4
+ metadata:
5
+ prefered_agent: scrum-master
6
+ ---
7
+
8
+ # Reconcile — Board ↔ Code Synchronisation
9
+
10
+ Walks the full board (epics → stories → tasks), verifies each item's status against what actually exists in git, and fixes any drift. Also cleans `project/todo.md` of entries that are already done.
11
+
12
+ ## Instructions
13
+
14
+ ### 0. Read configuration
15
+ Read `project/configs/workflow.json` for board paths. Fall back to `project/board/` if missing.
16
+ The statuses that count as "completed" are: **Done**, **Passed**, **Passed with remarks**.
17
+
18
+ ### 1. Snapshot the board
19
+ Scan every file in `epics/`, `stories/`, and `tasks/`. For each item record:
20
+ - `id`, `title`, `status` (the **pre-reconcile** status — needed in phase 4)
21
+ - `date_completed` (if set)
22
+
23
+ Also read `project/todo.md` and parse every non-comment, non-blank line into a list of todo entries.
24
+
25
+ ### 2. Verify "completed" tasks — are they really implemented?
26
+ For every task whose status is a completed status:
27
+
28
+ 1. **Search git history** — run `git log --all --oneline --grep="<task_id>"` (e.g. `E01_S01_T01`). A matching commit is strong evidence of implementation.
29
+ 2. **Check documentation artefacts** — look for a plan or summary file under `project/documentation/plans/` or `project/documentation/summaries/` whose name contains the task ID.
30
+ 3. **Read the task's acceptance criteria** and spot-check the codebase for the key deliverables described (e.g. if the task says "create `scripts/foo.sh`", verify the file exists).
31
+
32
+ If implementation **is confirmed** — no action needed; the status is correct.
33
+
34
+ If implementation **cannot be confirmed**:
35
+ 1. List git worktrees (`git worktree list`) and branches (`git branch --all`) that appear to match the task ID or its slug (the branch naming convention is `<E##_S##_T##-short-slug>`).
36
+ 2. If a matching worktree or branch exists:
37
+ - Inform the user and ask for confirmation before merging.
38
+ - On confirmation, merge the branch into the current branch (`git merge <branch>`).
39
+ - After a successful merge, the task stays at its completed status.
40
+ - If the merge has conflicts, alert the user and **do not** change the status — leave it for manual resolution.
41
+ 3. If **no** matching branch or worktree exists:
42
+ - Change the task's status to **Pending** in its board file.
43
+ - Clear `date_started` and `date_completed`.
44
+ - Report the demotion.
45
+
46
+ ### 3. Verify "incomplete" tasks — are they secretly implemented?
47
+ For every task whose status is **not** a completed status (Pending, In Progress, Running, Blocked, etc.):
48
+
49
+ 1. **Search git history** for commits referencing the task ID.
50
+ 2. **Check documentation artefacts** as in phase 2.
51
+ 3. **Spot-check acceptance criteria** against the codebase.
52
+
53
+ If implementation **is confirmed**:
54
+ - Update the task's status to **Passed** in its board file.
55
+ - Set `date_completed` to today (ISO 8601).
56
+ - If the task is listed in `project/todo.md`, **comment it out** by wrapping the line:
57
+ ```
58
+ <!-- RECONCILED: <original line> -->
59
+ ```
60
+ - Report the promotion.
61
+
62
+ If implementation **is not confirmed** — no action needed; the status is already correct.
63
+
64
+ ### 4. Roll up story and epic statuses
65
+ After all tasks have been reconciled:
66
+
67
+ - For each **story**: if all of its tasks are now in a completed status, set the story to **Done** (if not already). If any task was demoted, and the story was previously completed, set the story back to **In Progress**.
68
+ - For each **epic**: apply the same roll-up logic over its stories.
69
+
70
+ #### DoD Gap Detection
71
+
72
+ After rolling up statuses, scan every story whose status is a completed status (`Passed`, `Passed with remarks`, `Done`) for unchecked Definition of Done items:
73
+
74
+ 1. Read the story file and locate the `## Definition of Done` section. If the section is absent, skip this story gracefully (no error).
75
+ 2. Scan the DoD section for any lines matching `^- \[ \]` (unchecked checkboxes).
76
+ 3. If unchecked boxes are found: record the story ID, story title, and the full text of each unchecked item.
77
+ 4. If all DoD boxes are already ticked (`- [x]`), or the DoD section is absent, no gap is reported for that story.
78
+
79
+ At the end of Phase 4, if any DoD gaps were found across any stories, include a **"DoD Gaps"** section in the reconcile report (see `assets/report_format.md`) listing each affected story and its unchecked items.
80
+
81
+ **Important:** Gap detection is **report-only**. Do not automatically change the status of any story or epic based on unchecked DoD boxes — surface the gaps so a human can review and decide.
82
+
83
+ ### 5. Clean `project/todo.md`
84
+ Walk the todo entries parsed in phase 1:
85
+
86
+ - **Already-done entries** — if an entry references a task/story/epic whose pre-reconcile status (from the snapshot in phase 1) was already a completed status **and** whose implementation has been confirmed (phase 2), **remove the line entirely** from `project/todo.md`.
87
+ - **Newly-reconciled entries** — entries that were commented out in phase 3 stay as `<!-- RECONCILED: ... -->`.
88
+ - If `project/todo.md` is left with only the header, the format comment, and blank lines, delete the file.
89
+
90
+ ### 6. Print a summary
91
+ Output a reconciliation report using the format in `assets/report_format.md`.
92
+
93
+ If no changes were made, print: `Board and todo.md are in sync — nothing to reconcile. ✅`
@@ -0,0 +1,44 @@
1
+ ## Reconciliation Report Format
2
+
3
+ ```
4
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
5
+ RECONCILIATION REPORT
6
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
7
+
8
+ 📊 Scanned: <N> epics, <N> stories, <N> tasks
9
+
10
+ ⬇️ DEMOTED (were Done/Passed → now Pending)
11
+ 🔧 E##_S##_T## · <Task Title> — no commits or artefacts found
12
+
13
+ 🔀 MERGED (worktree branch merged)
14
+ 🔧 E##_S##_T## · <Task Title> — merged branch <branch-name>
15
+
16
+ ⬆️ PROMOTED (were incomplete → now Passed)
17
+ 🔧 E##_S##_T## · <Task Title> — commits found, acceptance criteria met
18
+
19
+ 🔄 ROLL-UP CHANGES
20
+ 📖 E##_S## · <Story Title> — <old status> → <new status>
21
+ 📦 E## · <Epic Title> — <old status> → <new status>
22
+
23
+ ⚠️ DOD GAPS (completed stories with unchecked Definition of Done items)
24
+ 📖 E##_S## · <Story Title>
25
+ - [ ] <unchecked DoD item text>
26
+ - [ ] <unchecked DoD item text>
27
+ 📖 E##_S## · <Story Title>
28
+ - [ ] <unchecked DoD item text>
29
+
30
+ 🧹 TODO CLEANUP
31
+ Removed: <N> stale entries
32
+ Commented out: <N> newly-reconciled entries
33
+ todo.md deleted: yes/no
34
+
35
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
36
+ ```
37
+
38
+ ### Section rules
39
+
40
+ - Omit any section that has zero items (e.g. if nothing was demoted, skip the DEMOTED block entirely).
41
+ - The MERGED section should include the branch name that was merged.
42
+ - The TODO CLEANUP section is always shown if `project/todo.md` existed at the start, even if zero changes were made (in that case show all counts as 0).
43
+ - If `project/todo.md` did not exist, omit the TODO CLEANUP section.
44
+ - The DOD GAPS section is omitted if no completed stories have unchecked DoD checkboxes.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: reconcile-origin
3
+ description: Sync the current (or specified) branch with origin by rebasing local commits on top of the latest upstream state.
4
+ keywords:
5
+ - "sync branch"
6
+ - "rebase origin"
7
+ - "reconcile origin"
8
+ - "pull rebase"
9
+ examples:
10
+ - "sync my branch with origin"
11
+ - "rebase local commits on top of origin"
12
+ - "reconcile-origin feature/my-branch"
13
+ ---
14
+
15
+ # Reconcile Origin
16
+
17
+ Use this skill to rebase local work on top of the latest `origin/<branch>` state without re-implementing git logic inline.
18
+
19
+ ## Instructions
20
+
21
+ 1. Determine the target branch:
22
+ - If the user passed an argument, use that branch name.
23
+ - Otherwise, use the current branch name.
24
+
25
+ 2. Invoke `.agents/skills/reconcile-origin/scripts/reconcile-origin.sh [<branch>]` and capture stdout.
26
+ - Do not run any inline git commands in this skill — all git work is handled by the script.
27
+ - The script handles dirty-worktree detection internally and returns `{"status":"error","code":"uncommitted_changes",...}` if the working tree is not clean.
28
+
29
+ 3. Parse the script's JSON response and react by `status`:
30
+ - `ok`
31
+ - Report success.
32
+ - Include the branch name and `rebased_commits` count.
33
+ - `local_branch_missing`
34
+ - If `remote_exists` is `true`, present options in this format:
35
+
36
+ What would you like to do?
37
+ 1. Create a local tracking branch for `<branch>` and continue `/reconcile-origin`
38
+ 2. Cancel and inspect the branch setup manually
39
+ 3. Other (describe below)
40
+
41
+ - If the user chooses option 1, invoke `.agents/skills/reconcile-origin/scripts/reconcile-origin.sh <branch> --create-tracking`.
42
+ - If `remote_exists` is `false`, explain that neither a local branch nor `origin/<branch>` was found and stop.
43
+ - `conflict`
44
+ - Present one structured conflict rapport per item in `conflicts`.
45
+ - For each conflict include:
46
+ - File path
47
+ - The `description`
48
+ - `local_section`
49
+ - `origin_section`
50
+ - Then present options in this format:
51
+
52
+ What would you like to do?
53
+ 1. Resolve the conflict now by merging both sides carefully
54
+ 2. Keep the local intent, then re-apply the essential upstream change manually
55
+ 3. Handle it later — leave annotated conflict markers in the file and continue the scripted flow
56
+ 4. Other (describe below)
57
+
58
+ - If the user chooses “Handle it later”, invoke `.agents/skills/reconcile-origin/scripts/reconcile-origin.sh <branch> --handle-later <file>` for the selected conflict file.
59
+ - `handled_later`
60
+ - Confirm that the selected file was annotated for later resolution.
61
+ - Tell the user the conflict markers were intentionally preserved with a `# RECONCILE-ORIGIN CONFLICT:` note.
62
+ - `error`
63
+ - Report the script's `message` clearly.
64
+ - If `code` indicates `branch_not_found_on_origin`, explain that the remote branch could not be fetched.
65
+ - If `code` indicates `uncommitted_changes`, remind the user to stash or commit first.
66
+
67
+ 4. When presenting a conflict rapport, make the incompatibility explicit.
68
+ - Explain what the local section is trying to preserve.
69
+ - Explain what the origin section changed upstream.
70
+ - Recommend at least two concrete resolution paths before offering “Handle it later” as the final actionable option.
71
+
72
+ ## Guard Rails
73
+
74
+ - All git work must go through `.agents/skills/reconcile-origin/scripts/reconcile-origin.sh`.
75
+ - Do not inline fetch, checkout, pull, merge, rebase, or status commands in this skill body.