@open-agent-toolkit/cli 0.2.5 → 0.2.7

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 (104) hide show
  1. package/assets/docs/cli-utilities/configuration.md +40 -0
  2. package/assets/docs/cli-utilities/tool-packs.md +31 -0
  3. package/assets/docs/workflows/projects/artifacts.md +27 -0
  4. package/assets/docs/workflows/skills/explainer-kit.md +125 -0
  5. package/assets/docs/workflows/skills/index.md +4 -0
  6. package/assets/migration/pjm-restructure.md +12 -0
  7. package/assets/public-package-versions.json +4 -4
  8. package/assets/skills/explainer-kit/SKILL.md +95 -0
  9. package/assets/skills/explainer-kit/examples/project-explainer/content.md +31 -0
  10. package/assets/skills/explainer-kit/examples/project-explainer/fact-base.md +22 -0
  11. package/assets/skills/explainer-kit/examples/project-recap/content.md +34 -0
  12. package/assets/skills/explainer-kit/examples/project-recap/fact-base.md +22 -0
  13. package/assets/skills/explainer-kit/examples/theme-bundle.json +87 -0
  14. package/assets/skills/explainer-kit/palettes/ember.json +37 -0
  15. package/assets/skills/explainer-kit/palettes/forest.json +37 -0
  16. package/assets/skills/explainer-kit/palettes/neutral.json +37 -0
  17. package/assets/skills/explainer-kit/palettes/ocean.json +37 -0
  18. package/assets/skills/explainer-kit/palettes/violet.json +37 -0
  19. package/assets/skills/explainer-kit/profiles/clean.json +42 -0
  20. package/assets/skills/explainer-kit/profiles/editorial.json +42 -0
  21. package/assets/skills/explainer-kit/profiles/technical.json +39 -0
  22. package/assets/skills/explainer-kit/recipes/engineer-tour.json +33 -0
  23. package/assets/skills/explainer-kit/recipes/project-explainer.json +33 -0
  24. package/assets/skills/explainer-kit/recipes/project-recap.json +34 -0
  25. package/assets/skills/explainer-kit/references/contracts.md +101 -0
  26. package/assets/skills/explainer-kit/references/destination-contract.md +94 -0
  27. package/assets/skills/explainer-kit/references/extension-contract.md +71 -0
  28. package/assets/skills/explainer-kit/references/fact-base-contract.md +119 -0
  29. package/assets/skills/explainer-kit/schemas/build-record.schema.json +92 -0
  30. package/assets/skills/explainer-kit/schemas/durability-evidence.schema.json +53 -0
  31. package/assets/skills/explainer-kit/schemas/fact-base.schema.json +129 -0
  32. package/assets/skills/explainer-kit/schemas/manifest.schema.json +193 -0
  33. package/assets/skills/explainer-kit/schemas/publish-receipt.schema.json +97 -0
  34. package/assets/skills/explainer-kit/schemas/publish-request.schema.json +32 -0
  35. package/assets/skills/explainer-kit/schemas/run-request.schema.json +132 -0
  36. package/assets/skills/explainer-kit/schemas/theme.schema.json +217 -0
  37. package/assets/skills/explainer-kit/scripts/lib/content-approval.mjs +180 -0
  38. package/assets/skills/explainer-kit/scripts/lib/contracts.mjs +680 -0
  39. package/assets/skills/explainer-kit/scripts/lib/durability.mjs +538 -0
  40. package/assets/skills/explainer-kit/scripts/lib/fact-base.mjs +494 -0
  41. package/assets/skills/explainer-kit/scripts/lib/fs-safe.mjs +218 -0
  42. package/assets/skills/explainer-kit/scripts/lib/qa.mjs +512 -0
  43. package/assets/skills/explainer-kit/scripts/lib/recipes.mjs +289 -0
  44. package/assets/skills/explainer-kit/scripts/lib/records.mjs +231 -0
  45. package/assets/skills/explainer-kit/scripts/lib/render.mjs +485 -0
  46. package/assets/skills/explainer-kit/scripts/lib/s3-static.mjs +587 -0
  47. package/assets/skills/explainer-kit/scripts/lib/safe-paths.mjs +96 -0
  48. package/assets/skills/explainer-kit/scripts/lib/theme.mjs +332 -0
  49. package/assets/skills/explainer-kit/scripts/publish.mjs +76 -0
  50. package/assets/skills/explainer-kit/scripts/record-durability.mjs +64 -0
  51. package/assets/skills/explainer-kit/scripts/render-qa.mjs +273 -0
  52. package/assets/skills/explainer-kit/scripts/run.mjs +778 -0
  53. package/assets/skills/explainer-kit/scripts/validate.mjs +59 -0
  54. package/assets/skills/explainer-kit/templates/deck-shell.html +233 -0
  55. package/assets/skills/explainer-kit/templates/diagram-shell.html +219 -0
  56. package/assets/skills/explainer-kit/templates/engineer-tour.html +273 -0
  57. package/assets/skills/explainer-kit/templates/house-style.html +218 -0
  58. package/assets/skills/oat-explainer-kit/SKILL.md +92 -0
  59. package/assets/skills/oat-explainer-kit/references/config-contract.md +67 -0
  60. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +143 -0
  61. package/assets/skills/oat-explainer-kit/references/migration.md +143 -0
  62. package/assets/skills/oat-explainer-kit/scripts/bind-project-sources.mjs +103 -0
  63. package/assets/skills/oat-explainer-kit/scripts/check-core.mjs +127 -0
  64. package/assets/skills/oat-explainer-kit/scripts/finalize-tracked-run.mjs +392 -0
  65. package/assets/skills/oat-explainer-kit/scripts/persist-intent.mjs +130 -0
  66. package/assets/skills/oat-explainer-kit/scripts/resolve-config.mjs +293 -0
  67. package/assets/skills/oat-explainer-kit/scripts/resolve-intent.mjs +209 -0
  68. package/assets/skills/oat-explainer-kit/scripts/resolve-paths.mjs +166 -0
  69. package/assets/skills/oat-explainer-kit/scripts/run.mjs +284 -0
  70. package/assets/skills/oat-project-autonomous/SKILL.md +22 -1
  71. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +5 -1
  72. package/assets/skills/oat-project-complete/SKILL.md +166 -28
  73. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +5 -1
  74. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  75. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +17 -0
  76. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +5 -1
  77. package/assets/skills/oat-project-plan/SKILL.md +30 -1
  78. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +5 -1
  79. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +5 -1
  80. package/assets/skills/oat-project-summary/SKILL.md +20 -1
  81. package/assets/skills/oat-wave-execute/SKILL.md +1 -1
  82. package/dist/commands/config/index.d.ts.map +1 -1
  83. package/dist/commands/config/index.js +232 -1
  84. package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
  85. package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
  86. package/dist/commands/init/tools/shared/skill-manifest.js +2 -0
  87. package/dist/commands/project/archive/archive-utils.d.ts +12 -0
  88. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  89. package/dist/commands/project/archive/archive-utils.js +320 -8
  90. package/dist/commands/project/archive/index.d.ts.map +1 -1
  91. package/dist/commands/project/archive/index.js +1 -0
  92. package/dist/commands/project/archive/push-runner.d.ts +1 -0
  93. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  94. package/dist/commands/project/archive/push-runner.js +9 -2
  95. package/dist/config/oat-config.d.ts +26 -0
  96. package/dist/config/oat-config.d.ts.map +1 -1
  97. package/dist/config/oat-config.js +88 -0
  98. package/dist/config/resolve.d.ts.map +1 -1
  99. package/dist/config/resolve.js +18 -0
  100. package/dist/validation/project-state.d.ts +3 -0
  101. package/dist/validation/project-state.d.ts.map +1 -1
  102. package/dist/validation/project-state.js +91 -0
  103. package/package.json +2 -2
  104. /package/assets/skills/{oat-wave-execute/assets/program-recap.recipe.json → explainer-kit/recipes/program-recap.json} +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-complete
3
- version: 1.5.3
3
+ version: 1.5.4
4
4
  description: Use when all implementation work is finished and the project is ready to close. Marks the OAT project lifecycle as complete.
5
5
  disable-model-invocation: true
6
6
  user-invocable: true
@@ -91,6 +91,7 @@ remain valid.
91
91
  ```bash
92
92
  ARCHIVE_PREF=$(oat config get workflow.archiveOnComplete 2>/dev/null || true)
93
93
  PR_ON_COMPLETE=$(oat config get workflow.createPrOnComplete 2>/dev/null || true)
94
+ PROJECT_RECAP_CONFIG=$(oat config get workflow.explainers.projectRecap --json 2>/dev/null || true)
94
95
  ```
95
96
 
96
97
  - **If `ARCHIVE_PREF` is `true`:** Set `SHOULD_ARCHIVE="true"`. Skip the archive question. Print `Archive on complete: enabled (from workflow.archiveOnComplete).`
@@ -103,6 +104,19 @@ PR_ON_COMPLETE=$(oat config get workflow.createPrOnComplete 2>/dev/null || true)
103
104
 
104
105
  The "Ready to mark complete?" confirmation is always asked — it is a meaningful "are you sure" moment, not a preference.
105
106
 
107
+ Resolve `projectRecap` intent before presenting the batched completion prompt.
108
+ Use the `oat-explainer-kit` lifecycle intent resolver in interactive mode with
109
+ the current `oat_project_recap` value from the same `state.md` read and the
110
+ source-aware `workflow.explainers.projectRecap` preference. Preserve the state
111
+ content hash required by the adapter's safe intent persistence contract.
112
+
113
+ When resolution returns `needsPrompt: true`, add exactly one project-recap question to that same batched prompt: "Generate a final project recap as part of completion?" Do not open a second prompt. Resolve the answer as `generate` or `skip`, then use the adapter's intent persistence helper with the captured state hash. Persist either `generate` or `skip` as the returned `interactive` record before continuing. If persistence reports a stale write, re-read state and resolve precedence again; never retry the stale record blindly. A valid persisted `oat_project_recap` decision prevents another prompt.
114
+
115
+ Set `SHOULD_GENERATE_RECAP="true"` only when the final resolved decision is
116
+ `generate`; otherwise set it to `"false"`. Direct `always` or `never` workflow
117
+ preference results are effective for this run but are not copied into project
118
+ state.
119
+
106
120
  Also preflight summary status using the same freshness rules as `oat-project-summary`:
107
121
 
108
122
  - `summary.md` is `missing` when `{PROJECT_PATH}/summary.md` does not exist
@@ -116,7 +130,8 @@ Also preflight summary status using the same freshness rules as `oat-project-sum
116
130
  3. **Generate or refresh summary** (only if summary status is `missing` or `stale`): present the status explicitly:
117
131
  - Missing example: "A summary has not been generated yet. Would you like me to generate it now as part of completion?"
118
132
  - Stale example: "The project summary is out of date. Would you like me to refresh it now as part of completion?"
119
- 4. **Open PR:** "Open a PR in GitHub after generating the PR description?" ask this only when no tracked open PR already exists.
133
+ 4. **Generate final project recap** (only when recap intent resolution returned `needsPrompt: true`): "Generate a final project recap as part of completion?"
134
+ 5. **Open PR:** "Open a PR in GitHub after generating the PR description?" — ask this only when no tracked open PR already exists.
120
135
 
121
136
  If `oat_pr_status` is `open`, do not ask the Open PR question. Set `SHOULD_OPEN_PR="false"` and treat the existing PR as already tracked.
122
137
 
@@ -127,12 +142,13 @@ Ready to complete project **{PROJECT_NAME}**?
127
142
 
128
143
  1. Archive the project after completion? (yes/no)
129
144
  2. A summary has not been generated yet. Generate it now as part of completion? (yes/no)
130
- 3. Open a PR in GitHub? (yes/no)
145
+ 3. Generate a final project recap as part of completion? (yes/no)
146
+ 4. Open a PR in GitHub? (yes/no)
131
147
  ```
132
148
 
133
149
  If the user declines the completion confirmation, exit gracefully.
134
150
 
135
- Store the answers as `SHOULD_ARCHIVE`, `SHOULD_GENERATE_SUMMARY`, and `SHOULD_OPEN_PR` for use in later steps.
151
+ After the user accepts the completion confirmation, store the answers as `SHOULD_ARCHIVE`, `SHOULD_GENERATE_SUMMARY`, `SHOULD_GENERATE_RECAP`, and `SHOULD_OPEN_PR` for use in later steps. Persist a prompted recap answer only after that confirmation is accepted.
136
152
 
137
153
  If the summary status is `current`, set `SHOULD_GENERATE_SUMMARY="false"` and note that a current summary is already available.
138
154
 
@@ -257,7 +273,26 @@ Check if `{PROJECT_PATH}/summary.md` exists and whether it is current against th
257
273
  - Used as source for the PR description (in Step 7)
258
274
  - Preserved in the archived project directory (in Step 8)
259
275
 
260
- ### Step 3.6: Project Log Completion Gate
276
+ ### Step 3.6: Select Final Project Recap
277
+
278
+ Run this gate after the optional summary refresh and before any lifecycle
279
+ mutation. Initialize `SELECTED_PROJECT_RECAP_RUN=""`.
280
+
281
+ When `SHOULD_GENERATE_RECAP="true"`, inspect manifests under
282
+ `{PROJECT_PATH}/explainers/` before generating. A fresh `project-recap` manifest for the current completed implementation is reused without invoking the adapter again. Fresh means the manifest identifies recipe `project-recap`, belongs to this project, has a terminal outcome, and its recorded source hashes match the current approved implementation inputs, including the refreshed summary when present.
283
+
284
+ If no fresh recap exists, invoke `scripts/run.mjs#runOatExplainer` exactly once with recipe `project-recap`, project invocation, the active project, and unattended lifecycle mode so approved OAT artifacts do not trigger a second content prompt. A failed adapter run warns but does not block completion. Use a returned valid terminal `project-recap` manifest as the selected run; do not rerun to improve its outcome.
285
+ Supply the provider-neutral critic callback (or validated critic module entry point for JSON/CLI invocation) on every federated adapter run.
286
+
287
+ Set `SELECTED_PROJECT_RECAP_RUN` only to the final selected `project-recap` run. The value must be project-relative in the form `explainers/<run-slug>` so it can be passed safely to the archive CLI. An incomplete, stale, wrong-project, or `project-explainer` manifest is never selected as the final recap.
288
+
289
+ When recap intent resolves to `skip`, or generation produces no valid final recap, leave `SELECTED_PROJECT_RECAP_RUN` empty and complete without a recap. Record any failed recap attempt as a warning rather than changing project completion status.
290
+
291
+ `project-explainer` runs are active-project working artifacts, not durable post-completion reference products. Do not export, re-attest, or add archive-aware PR or summary reference links for a `project-explainer` run.
292
+
293
+ For `IS_SHARED_PROJECT="false"`, never export a tracked project recap and never construct or pass `--project-recap-run`. A local-scope recap remains `built-not-durable` unless its manifest already contains independently verified publish evidence. Do not treat local filesystem presence as durability. Completion-bookkeeping durability, relocation re-attestation, and archive-aware recap links are handled by the later durability stage, not by this selection gate.
294
+
295
+ ### Step 3.7: Project Log Completion Gate
261
296
 
262
297
  Run the project-log status probe before any lifecycle mutation or archive work:
263
298
 
@@ -309,7 +344,7 @@ oat project log append \
309
344
  --body "Completion sealed at $(date -u +%Y-%m-%dT%H:%M:%SZ); project-log roll-up status: ok."
310
345
  ```
311
346
 
312
- Only append this seal after Step 3.6 has either confirmed there are no entries
347
+ Only append this seal after Step 3.7 has either confirmed there are no entries
313
348
  to roll up or obtained `status: "ok"`. If the append fails for an existing log,
314
349
  stop before setting lifecycle complete or archiving. No project-log append may follow the seal.
315
350
 
@@ -405,6 +440,10 @@ When archiving, the project artifacts at `{PROJECT_PATH}/{plan,implementation,di
405
440
  - When `archive.summaryExportPath` is unset or `summary.md` is missing, omit this bullet rather than emit a broken link.
406
441
  - **Keep References bullets** that resolve independently of the archive: backlog item links under `.oat/repo/pjm/backlog/`, decision record links under `.oat/repo/reference/decisions/`, repo-reference docs, ticket URLs, and anything else under tracked paths outside the project directory.
407
442
  - Apply the existing `localPaths`-based exclusion rule from `oat-project-pr-final` Step 4 on top of these rules — it already covers `.oat/**/pr` and `.oat/**/reviews/archived` and may catch additional patterns configured per repo.
443
+ - Do not add a durable reference for any `project-explainer` run. Only the selected final `project-recap` can enter the tracked completion export path.
444
+ - When a final project recap is selected, defer its summary and PR link until
445
+ Step 8 returns `projectRecapExport.exportRoot`. Do not predict that path from
446
+ the date or project name.
408
447
 
409
448
  Anti-pattern: do not "rescue" a dropped artifact by linking to its archived path under `.oat/projects/archived/<name>/...`. That path is gitignored on every checkout and never reaches the remote.
410
449
 
@@ -412,7 +451,7 @@ Anti-pattern: do not "rescue" a dropped artifact by linking to its archived path
412
451
 
413
452
  **Skip if `SHOULD_ARCHIVE` is false or `IS_SHARED_PROJECT` is false.**
414
453
 
415
- This conditional skips archive movement only; it does not skip the Step 3.6
454
+ This conditional skips archive movement only; it does not skip the Step 3.7
416
455
  seal append for an existing project log.
417
456
 
418
457
  Archive happens after PR description generation (so artifacts are readable at tracked paths) but before commit+push (so the archive deletion is included in the commit).
@@ -421,26 +460,60 @@ The archive-side effects in this step are CLI-owned. Do not reimplement local ar
421
460
 
422
461
  ```bash
423
462
  ARCHIVE_OUTPUT=""
424
- if ! ARCHIVE_OUTPUT=$(oat project archive "$PROJECT_PATH" 2>&1); then
463
+ ARCHIVE_ARGS=("$PROJECT_PATH")
464
+ if [[ -n "$SELECTED_PROJECT_RECAP_RUN" ]]; then
465
+ ARCHIVE_ARGS+=("--project-recap-run" "$SELECTED_PROJECT_RECAP_RUN")
466
+ fi
467
+
468
+ if ! ARCHIVE_OUTPUT=$(oat project archive "${ARCHIVE_ARGS[@]}" --json 2>&1); then
425
469
  printf '%s\n' "$ARCHIVE_OUTPUT" >&2
426
470
  echo "Error: Project archive failed." >&2
427
471
  exit 1
428
472
  fi
429
473
 
430
474
  printf '%s\n' "$ARCHIVE_OUTPUT"
475
+ ```
431
476
 
432
- ARCHIVE_PATH=$(printf '%s\n' "$ARCHIVE_OUTPUT" | sed -nE 's/^Archived project `[^`]+` to `(.+)`\.$/\1/p' | tail -1)
433
- if [[ -z "$ARCHIVE_PATH" ]]; then
434
- echo "Error: oat project archive did not report the archived path." >&2
435
- exit 1
436
- fi
477
+ Parse `ARCHIVE_OUTPUT` as the `oat project archive --json` report. Require
478
+ `status: "ok"`, `mode: "apply"`, and a non-empty `archivePath`; use its
479
+ `s3Path`, `summaryExportFile`, and `warnings` fields for later reporting. Set
480
+ `ARCHIVE_PATH` from `archivePath`, then set `PROJECT_PATH="$ARCHIVE_PATH"`.
437
481
 
438
- PROJECT_PATH="$ARCHIVE_PATH"
439
- ARCHIVE_S3_PATH=$(printf '%s\n' "$ARCHIVE_OUTPUT" | sed -nE 's/^S3 archive: (.+)$/\1/p' | tail -1)
440
- ARCHIVE_S3_CONTEXT=$(printf '%s\n' "$ARCHIVE_OUTPUT" | grep -E '^Archive S3 sync: .*profile=.*region=' | tail -1 || true)
441
- ```
482
+ When `SELECTED_PROJECT_RECAP_RUN` is non-empty, also require the report's
483
+ `projectRecapExport.sourceRunRoot`, `projectRecapExport.exportRoot`, and
484
+ `projectRecapExport.manifest.relativePath === "manifest.json"`. Confirm the
485
+ reported source is the selected run under the pre-archive project path and the
486
+ export root is inside the tracked
487
+ `.oat/repo/reference/project-recaps/` root. Record:
488
+
489
+ - `sourceRunRoot` as the relocation source;
490
+ - `exportRoot` as the final recap run root; and
491
+ - `exportRoot/manifest.relativePath` as the final manifest.
492
+
493
+ Do not infer or reconstruct the recap export root. The archive report is
494
+ authoritative. A missing, malformed, mismatched, outside-root, or gitignored
495
+ export report is an archive failure; stop before lifecycle bookkeeping.
496
+ Never use the gitignored archive as evidence or a link target.
442
497
 
443
- Use `ARCHIVE_S3_CONTEXT` in Step 12 if the command reports profile/region details. If S3 sync ran and only `ARCHIVE_S3_PATH` is available, report the destination and note that credential context was not emitted by the command.
498
+ SELECTED_PROJECT_RECAP_RUN must be project-relative. Never add `--project-recap-run` when `SELECTED_PROJECT_RECAP_RUN` is empty. The empty case remains the existing archive behavior. Because this step runs only for shared projects, local-scope projects never pass a recap archive argument.
499
+
500
+ The no-recap invocation remains `oat project archive "$PROJECT_PATH"` with
501
+ `--json` added only to select the machine-readable report.
502
+ Use `ARCHIVE_S3_CONTEXT` in Step 12 if the command reports profile/region details.
503
+
504
+ #### Step 8.5: Finalize Archive-Aware Recap Links
505
+
506
+ Run this only when archive returned a `projectRecapExport`.
507
+
508
+ Rewrite recap links in the tracked summary export and the PR description body from `projectRecapExport.exportRoot`; do not derive them from the local archive.
509
+ Use a repository-relative path under
510
+ `.oat/repo/reference/project-recaps/` and a blob URL on the current head branch
511
+ while the PR is open. If `summaryExportFile` is non-null, update its concise
512
+ `Explainer Outcome` recap link. Update the archived PR-description artifact
513
+ used by Step 11 or 11.5 so its recap reference points to the same tracked root.
514
+ Omit either link when its containing artifact does not exist.
515
+
516
+ Use the current head branch for the blob URL while the PR is open. Never link to `.oat/projects/archived/`; it is gitignored and will return 404 remotely.
444
517
 
445
518
  ### Step 9: Regenerate Dashboard
446
519
 
@@ -452,7 +525,9 @@ oat state refresh
452
525
 
453
526
  ### Step 10: Commit + Push Bookkeeping (Required)
454
527
 
455
- Completion is not done until bookkeeping changes are committed and pushed. This prevents local-only `state.md` updates that leave project status stale for later sessions/reviews.
528
+ Completion is not done until lifecycle changes are committed. This commit also
529
+ anchors commit durability for a selected shared-project recap. Do not push yet
530
+ when recap attestation is pending.
456
531
 
457
532
  Expected changes may include:
458
533
 
@@ -463,21 +538,80 @@ Expected changes may include:
463
538
  - `.oat/state.md` is regenerated locally in Step 9 but should not be staged; it is generated dashboard state and normally gitignored.
464
539
  - `.oat/config.local.json` (if `activeProject` cleared)
465
540
  - Shared-project deletions under `{PROJECTS_ROOT}/{PROJECT_NAME}` (if archived)
541
+ - The complete tracked recap export and tracked summary export reported by
542
+ archive (if present)
466
543
 
467
544
  Run:
468
545
 
469
546
  ```bash
470
547
  git status --short
471
- git add -A
548
+ git add -- <exact completion and lifecycle paths>
472
549
  git commit -m "chore(oat): complete project lifecycle for ${PROJECT_NAME}"
473
- git push
550
+ LIFECYCLE_COMMIT=$(git rev-parse HEAD)
474
551
  ```
475
552
 
476
553
  Rules:
477
554
 
478
- - If there are unrelated unstaged/staged changes, stage and commit only the completion/bookkeeping files (do not sweep unrelated work into this commit).
555
+ - If there are unrelated unstaged/staged changes, stage and commit only the
556
+ completion/bookkeeping files. Never use a repository-wide `git add -A` when
557
+ unrelated changes exist.
479
558
  - If there is nothing to commit, state that explicitly and verify whether the completion bookkeeping was already committed in a prior commit.
480
- - If push fails, report the failure and do not claim completion is fully recorded.
559
+ - The lifecycle bookkeeping commit is the artifact commit for final recap
560
+ durability. It must contain the final run's immutable paths.
561
+ - Snapshot unrelated working-tree changes before finalization so the shared
562
+ finalizer can verify they remain unchanged.
563
+
564
+ ### Step 10.5: Re-attest Final Project Recap
565
+
566
+ Skip when no final recap was selected, for local-scope projects, or when the
567
+ selected recap is already durable solely through independently verified publish
568
+ evidence.
569
+
570
+ For an archived recap, consume the exact `projectRecapExport` values recorded
571
+ in Step 8. Plan finalization through
572
+ `oat-explainer-kit/scripts/finalize-tracked-run.mjs#planTrackedRunFinalization`
573
+ with:
574
+
575
+ - `runRoot`: `projectRecapExport.exportRoot`;
576
+ - `manifestPath`:
577
+ `projectRecapExport.exportRoot/projectRecapExport.manifest.relativePath`;
578
+ - commitMode: `completion-bookkeeping`;
579
+ - relocatedFrom: `sourceRunRoot`; and
580
+ - context `artifactCommit`: the full `LIFECYCLE_COMMIT` SHA.
581
+
582
+ For a shared project that was not archived, use the selected active run and
583
+ omit `relocatedFrom`, but keep the same `completion-bookkeeping` mode.
584
+
585
+ The lifecycle bookkeeping commit is the artifact commit. Call the compatible
586
+ core's `recordDurability(...)` with the finalizer's planned request. Submit only immutable paths under `projectRecapExport.exportRoot` as commit evidence for an archived recap; `manifest.json` and `build-record.json` are mutable records and
587
+ must not appear in that evidence path list. The successful exported-path
588
+ attestation supersedes the prior active-path evidence. Verify the resulting
589
+ manifest records the old evidence in `supersedes` and reports the final
590
+ tracked export path.
591
+
592
+ Never submit the gitignored archive path as commit evidence. Local archive
593
+ presence cannot make a recap durable.
594
+
595
+ A failed exported recap attestation does not fail project completion. Preserve
596
+ the tracked export, report `built-not-durable`, retain actionable recovery
597
+ details, and continue to the evidence commit.
598
+
599
+ ### Step 10.6: Commit Evidence + Push
600
+
601
+ When Step 10.5 ran, create the evidence update. Commit only the exported `manifest.json` and `build-record.json` as the evidence update, including warning-bearing records from a failed attestation. On failure, commit the warning-bearing `manifest.json` and `build-record.json`. Run
602
+ `verifyTrackedRunFinalization(...)` with the artifact commit, immediate evidence
603
+ commit parent/order, exact evidence paths, attestation outcome, and unchanged
604
+ unrelated-change snapshots.
605
+
606
+ Archive completion is exactly two commits when recap attestation runs:
607
+
608
+ 1. lifecycle bookkeeping, including the tracked recap export; then
609
+ 2. final recap evidence records.
610
+
611
+ Push once after both commits exist so they travel together. If no attestation
612
+ ran, push the lifecycle bookkeeping commit once. If verification detects
613
+ contamination or wrong commit order, do not push. If push fails, report the
614
+ failure and do not claim completion is fully recorded.
481
615
 
482
616
  ### Step 11: Open PR in GitHub (Conditional)
483
617
 
@@ -491,10 +625,9 @@ Steps:
491
625
  1. Locate the PR description artifact at `{PROJECT_PATH}/pr/project-pr-*.md`.
492
626
  2. Write the stripped body to a temporary file (remove all lines from the opening `---` through the closing `---`, inclusive).
493
627
  3. Verify the temp file does not start with YAML frontmatter keys.
494
- 4. Push and create the PR:
628
+ 4. Create the PR from the branch already pushed in Step 10.6:
495
629
 
496
630
  ```bash
497
- git push -u origin "$(git rev-parse --abbrev-ref HEAD)"
498
631
  gh pr create --base main --title "{title}" --body-file "$TMP_BODY"
499
632
  ```
500
633
 
@@ -506,7 +639,7 @@ Do not assume `gh` is installed; if missing, instruct manual PR creation using t
506
639
 
507
640
  **Run only when `WAS_PR_OPEN_AT_START="true"` AND `SHOULD_ARCHIVE="true"`.**
508
641
 
509
- When the PR was already open at the start of this skill (typically because `oat-project-pr-final` ran earlier in the lifecycle) AND we just archived, the GitHub PR description authored by `oat-project-pr-final` still points to the active artifact paths. Step 8 moved those artifacts to a gitignored archive location and Step 10 pushed the move, so any blob link in the open PR body now 404s. Push the regenerated archive-aware body to the existing PR.
642
+ When the PR was already open at the start of this skill (typically because `oat-project-pr-final` ran earlier in the lifecycle) AND we just archived, the GitHub PR description authored by `oat-project-pr-final` still points to the active artifact paths. Step 8 moved those artifacts to a gitignored archive location and Step 10.6 pushed the move, so any blob link in the open PR body now 404s. Push the regenerated archive-aware body to the existing PR.
510
643
 
511
644
  Skip this step when:
512
645
 
@@ -540,7 +673,8 @@ Failure handling:
540
673
 
541
674
  - If `gh` is missing, warn and print the path to the regenerated artifact body so the user can paste it into the PR manually. Do not fail the skill.
542
675
  - If `gh pr edit` fails (e.g. PR was merged between Step 2 and now, or the auth token lacks edit permission), warn and continue. Step 12's completion summary should call out that the PR body was not updated and surface the artifact path so the user can update it manually.
543
- - Never re-archive or re-commit on failure here — the lifecycle bookkeeping in Step 10 already shipped.
676
+ - Never re-archive or re-commit on failure here — the lifecycle bookkeeping
677
+ and any recap evidence update in Step 10.6 already shipped.
544
678
 
545
679
  ### Step 12: Confirm to User
546
680
 
@@ -549,7 +683,11 @@ Show user:
549
683
  - "Project **{PROJECT_NAME}** marked as complete."
550
684
  - If archived: "Archived location: **{PROJECT_PATH}**"
551
685
  - If S3 archive sync ran: include `ARCHIVE_S3_CONTEXT` when the archive command reported profile/region details. If only `ARCHIVE_S3_PATH` is available, include the S3 destination and note that profile/region context was not reported by the command. Never echo raw credentials (`AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, etc.).
552
- - Include commit hash and push result for the bookkeeping changes.
686
+ - Include both lifecycle bookkeeping and recap evidence commit hashes when
687
+ attestation ran, plus the single push result.
688
+ - Report the final recap outcome and tracked reference root. A failed
689
+ attestation is a warning with `built-not-durable`, not a project-completion
690
+ failure.
553
691
  - If PR was opened: include the PR URL.
554
692
  - If `oat_pr_url` is present, show it in the completion summary even when PR creation was skipped because the project already tracked an open PR.
555
693
  - If Step 11.5 ran, report whether the PR description was synced (e.g. `PR description synced: <PR URL>`) or warn that the sync failed and surface the artifact path so the user can update it manually.
@@ -142,6 +142,7 @@ remains.
142
142
  | PLAN-09 | `oat-project-plan` | Plan artifact-review findings | Accept offered Medium/Minor fixes | Apply unambiguous artifact-local fixes and re-review; unresolved Critical or material ambiguity stops | `auto-resolve` / `boundary:unresolved-critical-findings` | Plan review row and residuals |
143
143
  | PLAN-10 | `oat-project-plan` | Parallel-group proposal | Confirm a candidate group | Accept only when write-set and dependency evidence proves independence; otherwise keep sequential and record why | `auto-resolve` | Plan Parallelism section |
144
144
  | PLAN-11 | `oat-project-plan` | Configured exit gate | `block`, `prompt`, or `warn` after failure | Apply configured failure semantics; `prompt` becomes a reported boundary | `auto-resolve` / `boundary:repository-policy-approval` | Structured gate result and disposition |
145
+ | PLAN-12 | `oat-project-plan` | Project-explainer intent | Generate or skip the project explainer | Preserve explicit or persisted intent; in autonomy generate only when kickoff explicitly requested it and never prompt | `auto-resolve` | Persisted project-explainer intent |
145
146
  | IMPORT-01 | `oat-project-import-plan` | Inherited dirty tree | Commit, proceed, or abort | Proceed without staging unrelated files; destructive cleanup stops | `auto-resolve` / `boundary:destructive-change-risk` | Import preflight note |
146
147
  | IMPORT-02 | `oat-project-import-plan` | Missing project | Ask for project identity | Use explicit invocation context; otherwise stop rather than guess | `boundary:product-judgment` | Resolved project path |
147
148
  | IMPORT-03 | `oat-project-import-plan` | Source plan selection or extension exception | Choose a candidate/path or confirm nonstandard Markdown | Use an explicit unique source; ambiguity or nonstandard content stops | `auto-resolve` / `boundary:product-judgment` | Import reference metadata |
@@ -169,6 +170,7 @@ remains.
169
170
  | IMPLEMENT-16 | `oat-project-implement` | Final HiLL approval | Approve, decline, or defer between pre/post steps | After passing auto-review and successful pre-approval steps, record approval and continue post-approval steps; otherwise stop | `auto-resolve` / `boundary:unresolved-critical-findings` | Sequence snapshot, review artifact, dispatch record |
170
171
  | IMPLEMENT-17 | `oat-project-implement` | Next-step prompt | Choose lifecycle tail actions | Unreachable when the autonomous sequence snapshot exists; never present the prompt | `auto-resolve` | Completed sequence snapshot |
171
172
  | IMPLEMENT-18 | `oat-project-implement` | Configured exit gate | `block`, `prompt`, or `warn` after validated findings | Apply configured failure semantics only to a validated, receive-eligible `blocked` envelope after durable receive; all operational, validation, correlation, malformed/contradictory-envelope, launch, and receive failures stop regardless of `onFailure`, including `warn` | `auto-resolve` / `boundary:repository-policy-approval` | Validated structured gate result, completed receive, and disposition |
173
+ | IMPLEMENT-19 | `oat-project-implement` | Implementation-tail project recap | Generate or skip the final project recap | In autonomy attempt one recap when no fresh recap exists; preserve resolved interactive intent otherwise, and never block completion on recap outcome | `auto-resolve` | Recap manifest and outcome record |
172
174
  | DOCUMENT-01 | `oat-project-document` | Missing project path | Ask for a path | Use explicit/active project only; otherwise stop | `boundary:product-judgment` | Resolved project path |
173
175
  | DOCUMENT-02 | `oat-project-document` | Documentation delta approval | Apply all, individual, or skip | Invoke the existing `--auto` path and apply all non-destructive recommendations | `auto-resolve` | Documentation delta and state update |
174
176
  | DOCUMENT-03 | `oat-project-document` | Delete or restructure docs | Require explicit approval | Stop before destructive or broad restructuring not already authorized by the plan | `boundary:destructive-change-risk` | Documentation blocker |
@@ -256,7 +258,9 @@ remains immutable baseline evidence for the original p01-t01 verification.
256
258
  | `oat-dispatch-subagents/references/provider-cursor.md` | `ca11e28923eb -> NG`; `be0a84c48fc0 -> NG` |
257
259
  | `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG` |
258
260
  | `oat-project-dispatch-subagents/SKILL.md` | `eca03ad1ca12 -> PDISPATCH-01`; `59fbcdc79cea -> PDISPATCH-01` |
259
- | `oat-project-complete/SKILL.md` | `b4934a85feee -> NG` |
261
+ | `oat-project-plan/SKILL.md` | `f99e44b39932 -> PLAN-12`; `7e6a9854504b -> NG` |
262
+ | `oat-project-implement/references/completion-and-closeout.md` | `6909a5a5a1fa -> IMPLEMENT-19`; `a7c02ef670fd -> IMPLEMENT-19` |
263
+ | `oat-project-complete/SKILL.md` | `ffad9f909dba -> COMPLETE-01`; `ffe636f736e8 -> COMPLETE-01`; `ea2dced337be -> COMPLETE-01`; `93d3e4ee3355 -> COMPLETE-01`; `2407ebed0921 -> NG`; `0177956707aa -> NG`; `8305b5bb65ef -> NG` |
260
264
 
261
265
  ## Prompt-scan comparison
262
266
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-implement
3
- version: 2.1.6
3
+ version: 2.1.7
4
4
  description: Use when plan.md is ready for execution. Dispatches one phase implementer per phase, owns independent phase review and bounded fix routing, and supports plan-declared worktree-isolated parallel phases.
5
5
  oat_gateable: true
6
6
  argument-hint: '[--retry-limit <N>] [--dry-run]'
@@ -741,6 +741,23 @@ checkpoint protocol to gate bookkeeping, final HiLL bookkeeping, and completion
741
741
  bookkeeping. A mixed commit, missing child transition, or non-state path in the
742
742
  checkpoint-persistence commit fails closed as stale.
743
743
 
744
+ **Implementation-Tail Project Recap:**
745
+
746
+ The final-closeout orchestrator owns one project-recap gate. Run this recap gate after the final code review has passed and configured pre-approval summary/document steps have completed, but before final HiLL approval. Preserve the stored order of all other pre-approval steps and the existing final review sequence; the recap gate does not replace or repeat either.
747
+
748
+ Before generating, inspect the active project's explainer runs. A fresh `project-recap` manifest for the current completed implementation deduplicates the lifecycle-tail run: reuse it and do not invoke the adapter again. Fresh means the manifest identifies recipe `project-recap`, belongs to this project, has a terminal outcome, and its recorded source hashes match the current approved implementation inputs. A merely present, incomplete, wrong-recipe, or stale manifest does not satisfy this check.
749
+
750
+ Resolve recap intent through `oat-explainer-kit`. When `OAT_AUTONOMOUS=1` and no fresh recap exists, attempt `project-recap` exactly once; missing or stale persisted intent cannot suppress this autonomous attempt. Interactive mode honors the adapter's resolved persisted or workflow intent.
751
+
752
+ Invoke the `oat-explainer-kit` adapter first, then run its shared tracked-run finalizer in `dedicated` mode for a successful build. Use the adapter result and finalizer result as returned; do not improvise commits, durability evidence, or reruns. Outcomes `failed` and `built-not-durable` are recorded warnings, never blockers for final HiLL approval, completion reporting, or later PR steps.
753
+ Supply the provider-neutral critic callback (or validated critic module entry point for JSON/CLI invocation) on every federated adapter run.
754
+
755
+ Always include the selected or attempted recap's outcome and run path in the
756
+ implementation completion report. If `summary.md` exists, append or refresh its
757
+ single concise `Explainer Outcome` section using the manifest and build record;
758
+ never append a second outcome section. If no recap was attempted or reused,
759
+ leave the summary unchanged.
760
+
744
761
  1. Dispatch incomplete `pre_approval` steps in stored order.
745
762
  2. When they succeed and a final checkpoint exists, commit `status:
746
763
  awaiting_approval` with `approval: pending` before asking for final HiLL
@@ -142,6 +142,7 @@ remains.
142
142
  | PLAN-09 | `oat-project-plan` | Plan artifact-review findings | Accept offered Medium/Minor fixes | Apply unambiguous artifact-local fixes and re-review; unresolved Critical or material ambiguity stops | `auto-resolve` / `boundary:unresolved-critical-findings` | Plan review row and residuals |
143
143
  | PLAN-10 | `oat-project-plan` | Parallel-group proposal | Confirm a candidate group | Accept only when write-set and dependency evidence proves independence; otherwise keep sequential and record why | `auto-resolve` | Plan Parallelism section |
144
144
  | PLAN-11 | `oat-project-plan` | Configured exit gate | `block`, `prompt`, or `warn` after failure | Apply configured failure semantics; `prompt` becomes a reported boundary | `auto-resolve` / `boundary:repository-policy-approval` | Structured gate result and disposition |
145
+ | PLAN-12 | `oat-project-plan` | Project-explainer intent | Generate or skip the project explainer | Preserve explicit or persisted intent; in autonomy generate only when kickoff explicitly requested it and never prompt | `auto-resolve` | Persisted project-explainer intent |
145
146
  | IMPORT-01 | `oat-project-import-plan` | Inherited dirty tree | Commit, proceed, or abort | Proceed without staging unrelated files; destructive cleanup stops | `auto-resolve` / `boundary:destructive-change-risk` | Import preflight note |
146
147
  | IMPORT-02 | `oat-project-import-plan` | Missing project | Ask for project identity | Use explicit invocation context; otherwise stop rather than guess | `boundary:product-judgment` | Resolved project path |
147
148
  | IMPORT-03 | `oat-project-import-plan` | Source plan selection or extension exception | Choose a candidate/path or confirm nonstandard Markdown | Use an explicit unique source; ambiguity or nonstandard content stops | `auto-resolve` / `boundary:product-judgment` | Import reference metadata |
@@ -169,6 +170,7 @@ remains.
169
170
  | IMPLEMENT-16 | `oat-project-implement` | Final HiLL approval | Approve, decline, or defer between pre/post steps | After passing auto-review and successful pre-approval steps, record approval and continue post-approval steps; otherwise stop | `auto-resolve` / `boundary:unresolved-critical-findings` | Sequence snapshot, review artifact, dispatch record |
170
171
  | IMPLEMENT-17 | `oat-project-implement` | Next-step prompt | Choose lifecycle tail actions | Unreachable when the autonomous sequence snapshot exists; never present the prompt | `auto-resolve` | Completed sequence snapshot |
171
172
  | IMPLEMENT-18 | `oat-project-implement` | Configured exit gate | `block`, `prompt`, or `warn` after validated findings | Apply configured failure semantics only to a validated, receive-eligible `blocked` envelope after durable receive; all operational, validation, correlation, malformed/contradictory-envelope, launch, and receive failures stop regardless of `onFailure`, including `warn` | `auto-resolve` / `boundary:repository-policy-approval` | Validated structured gate result, completed receive, and disposition |
173
+ | IMPLEMENT-19 | `oat-project-implement` | Implementation-tail project recap | Generate or skip the final project recap | In autonomy attempt one recap when no fresh recap exists; preserve resolved interactive intent otherwise, and never block completion on recap outcome | `auto-resolve` | Recap manifest and outcome record |
172
174
  | DOCUMENT-01 | `oat-project-document` | Missing project path | Ask for a path | Use explicit/active project only; otherwise stop | `boundary:product-judgment` | Resolved project path |
173
175
  | DOCUMENT-02 | `oat-project-document` | Documentation delta approval | Apply all, individual, or skip | Invoke the existing `--auto` path and apply all non-destructive recommendations | `auto-resolve` | Documentation delta and state update |
174
176
  | DOCUMENT-03 | `oat-project-document` | Delete or restructure docs | Require explicit approval | Stop before destructive or broad restructuring not already authorized by the plan | `boundary:destructive-change-risk` | Documentation blocker |
@@ -256,7 +258,9 @@ remains immutable baseline evidence for the original p01-t01 verification.
256
258
  | `oat-dispatch-subagents/references/provider-cursor.md` | `ca11e28923eb -> NG`; `be0a84c48fc0 -> NG` |
257
259
  | `oat-dispatch-subagents/references/record-schema.md` | `78f8069274a8 -> NG` |
258
260
  | `oat-project-dispatch-subagents/SKILL.md` | `eca03ad1ca12 -> PDISPATCH-01`; `59fbcdc79cea -> PDISPATCH-01` |
259
- | `oat-project-complete/SKILL.md` | `b4934a85feee -> NG` |
261
+ | `oat-project-plan/SKILL.md` | `f99e44b39932 -> PLAN-12`; `7e6a9854504b -> NG` |
262
+ | `oat-project-implement/references/completion-and-closeout.md` | `6909a5a5a1fa -> IMPLEMENT-19`; `a7c02ef670fd -> IMPLEMENT-19` |
263
+ | `oat-project-complete/SKILL.md` | `ffad9f909dba -> COMPLETE-01`; `ffe636f736e8 -> COMPLETE-01`; `ea2dced337be -> COMPLETE-01`; `93d3e4ee3355 -> COMPLETE-01`; `2407ebed0921 -> NG`; `0177956707aa -> NG`; `8305b5bb65ef -> NG` |
260
264
 
261
265
  ## Prompt-scan comparison
262
266
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-project-plan
3
- version: 1.4.2
3
+ version: 1.4.3
4
4
  description: Use when design.md is complete and executable implementation tasks are needed. Breaks design into bite-sized TDD tasks in canonical plan.md format.
5
5
  oat_gateable: true
6
6
  disable-model-invocation: true
@@ -155,6 +155,20 @@ Read for implementation context:
155
155
  - `.oat/repo/knowledge/testing.md` - Testing patterns
156
156
  - `.oat/repo/knowledge/stack.md` - Available tools and dependencies
157
157
 
158
+ ### Step 4.5: Resolve Project-Explainer Intent
159
+
160
+ Resolve `projectExplainer` intent before drafting the plan. Use the
161
+ `oat-explainer-kit` lifecycle intent resolver with interactive mode, the current
162
+ `oat_project_explainer` state value, and the source-aware
163
+ `workflow.explainers.projectExplainer` preference.
164
+
165
+ When resolution returns `needsPrompt: true`, ask exactly once whether to generate the project explainer, then resolve again with the answer and persist the returned `interactive` record.
166
+ A valid persisted `oat_project_explainer` decision prevents another prompt.
167
+ Persist through the adapter's optimistic-concurrency helper; on a stale write,
168
+ re-read state and resolve precedence again instead of retrying the old record.
169
+ Do not persist decisions derived only from `always` or `never` workflow
170
+ preferences.
171
+
158
172
  ### Step 4.9: Snapshot Explicit Phase-Review Setting Before Plan Overwrite
159
173
 
160
174
  Before Step 5 can replace an existing `plan.md`, inspect the source text and
@@ -636,6 +650,21 @@ Total: {N} tasks
636
650
  Ready for implementation"
637
651
  ```
638
652
 
653
+ ### Step 15.5: Generate the Project Explainer When Selected
654
+
655
+ Generate only after plan artifact review, the configured plan gate, and the plan commit have completed successfully.
656
+ When the resolved project-explainer decision is `generate`, invoke
657
+ `oat-explainer-kit` for the `project-explainer` recipe using the approved
658
+ project artifacts and report its outcome and run path. A `skip` decision ends
659
+ this step without invoking the adapter.
660
+ Supply the provider-neutral critic callback (or validated critic module entry point for JSON/CLI invocation) on every federated adapter run.
661
+
662
+ Explainer failure must not roll back, amend, or invalidate the valid committed plan.
663
+ Preserve the adapter's failure outcome and recovery guidance, warn the user,
664
+ and continue to the planning summary. This post-plan product does not replace
665
+ or reorder plan artifact review, dispatch resolution, the configured plan gate,
666
+ or HiLL handling.
667
+
639
668
  ### Step 16: Output Summary
640
669
 
641
670
  ```