cap-pro 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.
- package/.claude-plugin/README.md +26 -0
- package/.claude-plugin/marketplace.json +24 -0
- package/.claude-plugin/plugin.json +24 -0
- package/LICENSE +21 -0
- package/README.ja-JP.md +834 -0
- package/README.ko-KR.md +823 -0
- package/README.md +806 -0
- package/README.pt-BR.md +452 -0
- package/README.zh-CN.md +800 -0
- package/agents/cap-architect.md +269 -0
- package/agents/cap-brainstormer.md +207 -0
- package/agents/cap-curator.md +276 -0
- package/agents/cap-debugger.md +365 -0
- package/agents/cap-designer.md +246 -0
- package/agents/cap-historian.md +464 -0
- package/agents/cap-migrator.md +291 -0
- package/agents/cap-prototyper.md +197 -0
- package/agents/cap-validator.md +308 -0
- package/bin/install.js +5433 -0
- package/cap/bin/cap-tools.cjs +853 -0
- package/cap/bin/lib/arc-scanner.cjs +344 -0
- package/cap/bin/lib/cap-affinity-engine.cjs +862 -0
- package/cap/bin/lib/cap-anchor.cjs +228 -0
- package/cap/bin/lib/cap-annotation-writer.cjs +340 -0
- package/cap/bin/lib/cap-checkpoint.cjs +434 -0
- package/cap/bin/lib/cap-cluster-detect.cjs +945 -0
- package/cap/bin/lib/cap-cluster-display.cjs +52 -0
- package/cap/bin/lib/cap-cluster-format.cjs +245 -0
- package/cap/bin/lib/cap-cluster-helpers.cjs +295 -0
- package/cap/bin/lib/cap-cluster-io.cjs +212 -0
- package/cap/bin/lib/cap-completeness.cjs +540 -0
- package/cap/bin/lib/cap-deps.cjs +583 -0
- package/cap/bin/lib/cap-design-families.cjs +332 -0
- package/cap/bin/lib/cap-design.cjs +966 -0
- package/cap/bin/lib/cap-divergence-detector.cjs +400 -0
- package/cap/bin/lib/cap-doctor.cjs +752 -0
- package/cap/bin/lib/cap-feature-map-internals.cjs +19 -0
- package/cap/bin/lib/cap-feature-map-migrate.cjs +335 -0
- package/cap/bin/lib/cap-feature-map-monorepo.cjs +885 -0
- package/cap/bin/lib/cap-feature-map-shard.cjs +315 -0
- package/cap/bin/lib/cap-feature-map.cjs +1943 -0
- package/cap/bin/lib/cap-fitness-score.cjs +1075 -0
- package/cap/bin/lib/cap-impact-analysis.cjs +652 -0
- package/cap/bin/lib/cap-learn-review.cjs +1072 -0
- package/cap/bin/lib/cap-learning-signals.cjs +627 -0
- package/cap/bin/lib/cap-loader.cjs +227 -0
- package/cap/bin/lib/cap-logger.cjs +57 -0
- package/cap/bin/lib/cap-memory-bridge.cjs +764 -0
- package/cap/bin/lib/cap-memory-confidence.cjs +452 -0
- package/cap/bin/lib/cap-memory-dir.cjs +987 -0
- package/cap/bin/lib/cap-memory-engine.cjs +698 -0
- package/cap/bin/lib/cap-memory-extends.cjs +398 -0
- package/cap/bin/lib/cap-memory-graph.cjs +790 -0
- package/cap/bin/lib/cap-memory-migrate.cjs +2015 -0
- package/cap/bin/lib/cap-memory-pin.cjs +183 -0
- package/cap/bin/lib/cap-memory-platform.cjs +490 -0
- package/cap/bin/lib/cap-memory-prune.cjs +707 -0
- package/cap/bin/lib/cap-memory-schema.cjs +812 -0
- package/cap/bin/lib/cap-migrate-tags.cjs +309 -0
- package/cap/bin/lib/cap-migrate.cjs +540 -0
- package/cap/bin/lib/cap-pattern-apply.cjs +1203 -0
- package/cap/bin/lib/cap-pattern-pipeline.cjs +1034 -0
- package/cap/bin/lib/cap-plugin-manifest.cjs +80 -0
- package/cap/bin/lib/cap-realtime-affinity.cjs +399 -0
- package/cap/bin/lib/cap-reconcile.cjs +570 -0
- package/cap/bin/lib/cap-research-gate.cjs +218 -0
- package/cap/bin/lib/cap-scope-filter.cjs +402 -0
- package/cap/bin/lib/cap-semantic-pipeline.cjs +1038 -0
- package/cap/bin/lib/cap-session-extract.cjs +987 -0
- package/cap/bin/lib/cap-session.cjs +445 -0
- package/cap/bin/lib/cap-snapshot-linkage.cjs +963 -0
- package/cap/bin/lib/cap-stack-docs.cjs +646 -0
- package/cap/bin/lib/cap-tag-observer.cjs +371 -0
- package/cap/bin/lib/cap-tag-scanner.cjs +1766 -0
- package/cap/bin/lib/cap-telemetry.cjs +466 -0
- package/cap/bin/lib/cap-test-audit.cjs +1438 -0
- package/cap/bin/lib/cap-thread-migrator.cjs +307 -0
- package/cap/bin/lib/cap-thread-synthesis.cjs +545 -0
- package/cap/bin/lib/cap-thread-tracker.cjs +519 -0
- package/cap/bin/lib/cap-trace.cjs +399 -0
- package/cap/bin/lib/cap-trust-mode.cjs +336 -0
- package/cap/bin/lib/cap-ui-design-editor.cjs +642 -0
- package/cap/bin/lib/cap-ui-mind-map.cjs +712 -0
- package/cap/bin/lib/cap-ui-thread-nav.cjs +693 -0
- package/cap/bin/lib/cap-ui.cjs +1245 -0
- package/cap/bin/lib/cap-upgrade.cjs +1028 -0
- package/cap/bin/lib/cli/arg-helpers.cjs +49 -0
- package/cap/bin/lib/cli/frontmatter-router.cjs +31 -0
- package/cap/bin/lib/cli/init-router.cjs +68 -0
- package/cap/bin/lib/cli/phase-router.cjs +102 -0
- package/cap/bin/lib/cli/state-router.cjs +61 -0
- package/cap/bin/lib/cli/template-router.cjs +37 -0
- package/cap/bin/lib/cli/uat-router.cjs +29 -0
- package/cap/bin/lib/cli/validation-router.cjs +26 -0
- package/cap/bin/lib/cli/verification-router.cjs +31 -0
- package/cap/bin/lib/cli/workstream-router.cjs +39 -0
- package/cap/bin/lib/commands.cjs +961 -0
- package/cap/bin/lib/config.cjs +467 -0
- package/cap/bin/lib/convention-reader.cjs +258 -0
- package/cap/bin/lib/core.cjs +1241 -0
- package/cap/bin/lib/feature-aggregator.cjs +423 -0
- package/cap/bin/lib/frontmatter.cjs +337 -0
- package/cap/bin/lib/init.cjs +1443 -0
- package/cap/bin/lib/manifest-generator.cjs +383 -0
- package/cap/bin/lib/milestone.cjs +253 -0
- package/cap/bin/lib/model-profiles.cjs +69 -0
- package/cap/bin/lib/monorepo-context.cjs +226 -0
- package/cap/bin/lib/monorepo-migrator.cjs +509 -0
- package/cap/bin/lib/phase.cjs +889 -0
- package/cap/bin/lib/profile-output.cjs +989 -0
- package/cap/bin/lib/profile-pipeline.cjs +540 -0
- package/cap/bin/lib/roadmap.cjs +330 -0
- package/cap/bin/lib/security.cjs +394 -0
- package/cap/bin/lib/session-manager.cjs +292 -0
- package/cap/bin/lib/skeleton-generator.cjs +179 -0
- package/cap/bin/lib/state.cjs +1032 -0
- package/cap/bin/lib/template.cjs +231 -0
- package/cap/bin/lib/test-detector.cjs +62 -0
- package/cap/bin/lib/uat.cjs +283 -0
- package/cap/bin/lib/verify.cjs +889 -0
- package/cap/bin/lib/workspace-detector.cjs +371 -0
- package/cap/bin/lib/workstream.cjs +492 -0
- package/cap/commands/gsd/workstreams.md +63 -0
- package/cap/references/arc-standard.md +315 -0
- package/cap/references/cap-agent-architecture.md +101 -0
- package/cap/references/cap-gitignore-template +9 -0
- package/cap/references/cap-zero-deps.md +158 -0
- package/cap/references/checkpoints.md +778 -0
- package/cap/references/continuation-format.md +249 -0
- package/cap/references/contract-test-templates.md +312 -0
- package/cap/references/feature-map-template.md +25 -0
- package/cap/references/git-integration.md +295 -0
- package/cap/references/git-planning-commit.md +38 -0
- package/cap/references/model-profiles.md +174 -0
- package/cap/references/phase-numbering.md +126 -0
- package/cap/references/planning-config.md +202 -0
- package/cap/references/property-test-templates.md +316 -0
- package/cap/references/security-test-templates.md +347 -0
- package/cap/references/session-template.json +8 -0
- package/cap/references/tdd.md +263 -0
- package/cap/references/user-profiling.md +681 -0
- package/cap/references/verification-patterns.md +612 -0
- package/cap/templates/UAT.md +265 -0
- package/cap/templates/claude-md.md +175 -0
- package/cap/templates/codebase/architecture.md +255 -0
- package/cap/templates/codebase/concerns.md +310 -0
- package/cap/templates/codebase/conventions.md +307 -0
- package/cap/templates/codebase/integrations.md +280 -0
- package/cap/templates/codebase/stack.md +186 -0
- package/cap/templates/codebase/structure.md +285 -0
- package/cap/templates/codebase/testing.md +480 -0
- package/cap/templates/config.json +44 -0
- package/cap/templates/context.md +352 -0
- package/cap/templates/continue-here.md +78 -0
- package/cap/templates/copilot-instructions.md +7 -0
- package/cap/templates/debug-subagent-prompt.md +91 -0
- package/cap/templates/discussion-log.md +63 -0
- package/cap/templates/milestone-archive.md +123 -0
- package/cap/templates/milestone.md +115 -0
- package/cap/templates/phase-prompt.md +610 -0
- package/cap/templates/planner-subagent-prompt.md +117 -0
- package/cap/templates/project.md +186 -0
- package/cap/templates/requirements.md +231 -0
- package/cap/templates/research-project/ARCHITECTURE.md +204 -0
- package/cap/templates/research-project/FEATURES.md +147 -0
- package/cap/templates/research-project/PITFALLS.md +200 -0
- package/cap/templates/research-project/STACK.md +120 -0
- package/cap/templates/research-project/SUMMARY.md +170 -0
- package/cap/templates/research.md +552 -0
- package/cap/templates/roadmap.md +202 -0
- package/cap/templates/state.md +176 -0
- package/cap/templates/summary.md +364 -0
- package/cap/templates/user-preferences.md +498 -0
- package/cap/templates/verification-report.md +322 -0
- package/cap/workflows/add-phase.md +112 -0
- package/cap/workflows/add-tests.md +351 -0
- package/cap/workflows/add-todo.md +158 -0
- package/cap/workflows/audit-milestone.md +340 -0
- package/cap/workflows/audit-uat.md +109 -0
- package/cap/workflows/autonomous.md +891 -0
- package/cap/workflows/check-todos.md +177 -0
- package/cap/workflows/cleanup.md +152 -0
- package/cap/workflows/complete-milestone.md +767 -0
- package/cap/workflows/diagnose-issues.md +231 -0
- package/cap/workflows/discovery-phase.md +289 -0
- package/cap/workflows/discuss-phase-assumptions.md +653 -0
- package/cap/workflows/discuss-phase.md +1049 -0
- package/cap/workflows/do.md +104 -0
- package/cap/workflows/execute-phase.md +846 -0
- package/cap/workflows/execute-plan.md +514 -0
- package/cap/workflows/fast.md +105 -0
- package/cap/workflows/forensics.md +265 -0
- package/cap/workflows/health.md +181 -0
- package/cap/workflows/help.md +660 -0
- package/cap/workflows/insert-phase.md +130 -0
- package/cap/workflows/list-phase-assumptions.md +178 -0
- package/cap/workflows/list-workspaces.md +56 -0
- package/cap/workflows/manager.md +362 -0
- package/cap/workflows/map-codebase.md +377 -0
- package/cap/workflows/milestone-summary.md +223 -0
- package/cap/workflows/new-milestone.md +486 -0
- package/cap/workflows/new-project.md +1250 -0
- package/cap/workflows/new-workspace.md +237 -0
- package/cap/workflows/next.md +97 -0
- package/cap/workflows/node-repair.md +92 -0
- package/cap/workflows/note.md +156 -0
- package/cap/workflows/pause-work.md +176 -0
- package/cap/workflows/plan-milestone-gaps.md +273 -0
- package/cap/workflows/plan-phase.md +857 -0
- package/cap/workflows/plant-seed.md +169 -0
- package/cap/workflows/pr-branch.md +129 -0
- package/cap/workflows/profile-user.md +449 -0
- package/cap/workflows/progress.md +507 -0
- package/cap/workflows/quick.md +757 -0
- package/cap/workflows/remove-phase.md +155 -0
- package/cap/workflows/remove-workspace.md +90 -0
- package/cap/workflows/research-phase.md +82 -0
- package/cap/workflows/resume-project.md +326 -0
- package/cap/workflows/review.md +228 -0
- package/cap/workflows/session-report.md +146 -0
- package/cap/workflows/settings.md +283 -0
- package/cap/workflows/ship.md +228 -0
- package/cap/workflows/stats.md +60 -0
- package/cap/workflows/transition.md +671 -0
- package/cap/workflows/ui-phase.md +298 -0
- package/cap/workflows/ui-review.md +161 -0
- package/cap/workflows/update.md +323 -0
- package/cap/workflows/validate-phase.md +170 -0
- package/cap/workflows/verify-phase.md +254 -0
- package/cap/workflows/verify-work.md +637 -0
- package/commands/cap/annotate.md +165 -0
- package/commands/cap/brainstorm.md +393 -0
- package/commands/cap/checkpoint.md +106 -0
- package/commands/cap/completeness.md +94 -0
- package/commands/cap/continue.md +72 -0
- package/commands/cap/debug.md +588 -0
- package/commands/cap/deps.md +169 -0
- package/commands/cap/design.md +479 -0
- package/commands/cap/init.md +354 -0
- package/commands/cap/iterate.md +249 -0
- package/commands/cap/learn.md +459 -0
- package/commands/cap/memory.md +275 -0
- package/commands/cap/migrate-feature-map.md +91 -0
- package/commands/cap/migrate-memory.md +108 -0
- package/commands/cap/migrate-tags.md +91 -0
- package/commands/cap/migrate.md +131 -0
- package/commands/cap/prototype.md +510 -0
- package/commands/cap/reconcile.md +121 -0
- package/commands/cap/review.md +360 -0
- package/commands/cap/save.md +72 -0
- package/commands/cap/scan.md +404 -0
- package/commands/cap/start.md +356 -0
- package/commands/cap/status.md +118 -0
- package/commands/cap/test-audit.md +262 -0
- package/commands/cap/test.md +394 -0
- package/commands/cap/trace.md +133 -0
- package/commands/cap/ui.md +167 -0
- package/hooks/dist/cap-check-update.js +115 -0
- package/hooks/dist/cap-context-monitor.js +185 -0
- package/hooks/dist/cap-learn-review-hook.js +114 -0
- package/hooks/dist/cap-learning-hook.js +192 -0
- package/hooks/dist/cap-memory.js +299 -0
- package/hooks/dist/cap-prompt-guard.js +97 -0
- package/hooks/dist/cap-statusline.js +157 -0
- package/hooks/dist/cap-tag-observer.js +115 -0
- package/hooks/dist/cap-version-check.js +112 -0
- package/hooks/dist/cap-workflow-guard.js +175 -0
- package/hooks/hooks.json +55 -0
- package/package.json +58 -0
- package/scripts/base64-scan.sh +262 -0
- package/scripts/build-hooks.js +93 -0
- package/scripts/cap-removal-checklist.md +202 -0
- package/scripts/prompt-injection-scan.sh +199 -0
- package/scripts/run-tests.cjs +181 -0
- package/scripts/secret-scan.sh +227 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cap:reconcile
|
|
3
|
+
description: One-shot status drift reconciliation -- propose AC promotions and feature-state corrections for FEATURE-MAP.md, with dry-run preview and audit log.
|
|
4
|
+
argument-hint: "[--apply] [-y]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- AskUserQuestion
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<!-- @cap-context CAP v2.0 reconcile command -- one-shot cleanup of historical status drift in FEATURE-MAP.md introduced before F-041 (parser fix) and F-042 (state propagation) shipped. Combines AC-status drift detection (Phase 1) with implementation-presence drift detection (Phase 2). -->
|
|
13
|
+
<!-- @cap-decision Dry-run by default. The --apply flag is required to actually mutate FEATURE-MAP.md, and a confirmation prompt is shown before writes (skippable with -y for CI). -->
|
|
14
|
+
<!-- @cap-decision F-043 (this feature) is excluded from Phase 2 self-promotion -- the developer decides when to ship F-043, not the tool. -->
|
|
15
|
+
<!-- @cap-feature(feature:F-043) /cap:reconcile is the user-facing entry point for the reconciliation tool. -->
|
|
16
|
+
|
|
17
|
+
<objective>
|
|
18
|
+
<!-- @cap-todo(ac:F-043/AC-1) Scan FEATURE-MAP.md and propose AC status updates for every drifting feature (state shipped/tested with pending ACs). -->
|
|
19
|
+
<!-- @cap-todo(ac:F-043/AC-2) Output a dry-run diff first; require explicit confirmation (--apply + prompt) before writing. -->
|
|
20
|
+
|
|
21
|
+
Reconciles status drift in FEATURE-MAP.md by:
|
|
22
|
+
1. **Phase 1** -- promoting pending ACs to `tested` for every feature whose state is `shipped` or `tested` (catches drift introduced by the F-041 parser bug).
|
|
23
|
+
2. **Phase 2** -- updating `planned` features to `prototyped` or `tested` based on actual code presence detected via `@cap-feature` tags + sibling test-file probe.
|
|
24
|
+
3. **Phase 3** -- verifying that `detectDrift` returns zero entries after the changes, and emitting `.cap/memory/reconciliation-2026-04.md` audit log.
|
|
25
|
+
|
|
26
|
+
**Arguments:**
|
|
27
|
+
- `--apply` -- actually write the changes (default is dry-run)
|
|
28
|
+
- `-y` / `--yes` -- skip the confirmation prompt (CI use)
|
|
29
|
+
</objective>
|
|
30
|
+
|
|
31
|
+
<context>
|
|
32
|
+
$ARGUMENTS
|
|
33
|
+
|
|
34
|
+
@FEATURE-MAP.md
|
|
35
|
+
</context>
|
|
36
|
+
|
|
37
|
+
<process>
|
|
38
|
+
|
|
39
|
+
## Step 0: Parse flags
|
|
40
|
+
|
|
41
|
+
Check `$ARGUMENTS` for:
|
|
42
|
+
- `--apply` -- if present, set `apply_mode = true`
|
|
43
|
+
- `-y` or `--yes` -- if present, set `skip_confirm = true`
|
|
44
|
+
|
|
45
|
+
If neither flag is present: `apply_mode = false` (dry-run).
|
|
46
|
+
|
|
47
|
+
Log: `cap:reconcile | mode: {dry-run|apply} | confirm: {prompt|skip}`
|
|
48
|
+
|
|
49
|
+
## Step 1: Build the plan and print the dry-run preview
|
|
50
|
+
|
|
51
|
+
<!-- @cap-todo(ac:F-043/AC-2) Always print the dry-run preview first, even when --apply is set. The confirmation prompt comes after. -->
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
node -e "
|
|
55
|
+
const r = require('./cap/bin/lib/cap-reconcile.cjs');
|
|
56
|
+
const plan = r.planReconciliation(process.cwd());
|
|
57
|
+
console.log(r.formatPlan(plan));
|
|
58
|
+
console.log('---');
|
|
59
|
+
console.log('PLAN_TOTAL_CHANGES=' + plan.totalChanges);
|
|
60
|
+
"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Display the preview verbatim. Capture `PLAN_TOTAL_CHANGES`.
|
|
64
|
+
|
|
65
|
+
If `PLAN_TOTAL_CHANGES === 0`: report "Feature Map is already consistent -- no reconciliation needed." and **stop**.
|
|
66
|
+
|
|
67
|
+
## Step 2: Dry-run exit (when --apply is not set)
|
|
68
|
+
|
|
69
|
+
If `apply_mode` is false: report "Dry-run only. Re-run with `--apply` to commit changes." and **stop**. Exit code 0.
|
|
70
|
+
|
|
71
|
+
## Step 3: Confirm before applying (when --apply is set)
|
|
72
|
+
|
|
73
|
+
<!-- @cap-todo(ac:F-043/AC-2) Confirmation prompt is the second safety gate before writes. -->
|
|
74
|
+
|
|
75
|
+
If `skip_confirm` is false:
|
|
76
|
+
- Use AskUserQuestion to present: `"Apply N changes to FEATURE-MAP.md? Audit log will be written to .cap/memory/reconciliation-2026-04.md"` with options `["yes", "no"]`.
|
|
77
|
+
- If the user picks `no`: report "Aborted -- no changes written." and **stop**. Exit code 0.
|
|
78
|
+
|
|
79
|
+
## Step 4: Execute the plan
|
|
80
|
+
|
|
81
|
+
<!-- @cap-todo(ac:F-043/AC-3) executeReconciliation walks the lifecycle path for Phase 2 transitions and propagates AC promotions on every 'tested' hop. -->
|
|
82
|
+
<!-- @cap-todo(ac:F-043/AC-4) The audit log is written by executeReconciliation as part of Phase 3. -->
|
|
83
|
+
<!-- @cap-todo(ac:F-043/AC-5) executeReconciliation re-runs detectDrift after writing and includes the count in its result. -->
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
node -e "
|
|
87
|
+
const r = require('./cap/bin/lib/cap-reconcile.cjs');
|
|
88
|
+
const plan = r.planReconciliation(process.cwd());
|
|
89
|
+
const result = r.executeReconciliation(process.cwd(), plan);
|
|
90
|
+
console.log(JSON.stringify(result, null, 2));
|
|
91
|
+
process.exit(result.success ? 0 : 1);
|
|
92
|
+
"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Step 5: Report results
|
|
96
|
+
|
|
97
|
+
If success:
|
|
98
|
+
```
|
|
99
|
+
Reconciliation complete.
|
|
100
|
+
Changes applied: {plan.totalChanges}
|
|
101
|
+
Post-reconciliation drift: 0
|
|
102
|
+
Audit log: .cap/memory/reconciliation-2026-04.md
|
|
103
|
+
|
|
104
|
+
Suggested next:
|
|
105
|
+
git diff FEATURE-MAP.md # review the rewritten Feature Map
|
|
106
|
+
git add FEATURE-MAP.md .cap/memory/reconciliation-2026-04.md
|
|
107
|
+
git commit -m "fix: reconcile status drift in Feature Map"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If failure:
|
|
111
|
+
```
|
|
112
|
+
Reconciliation failed: {result.error}
|
|
113
|
+
Pre-drift count: {plan.preDriftCount}
|
|
114
|
+
Post-drift count: {result.postDriftCount}
|
|
115
|
+
|
|
116
|
+
Recovery: git checkout -- FEATURE-MAP.md # revert to pre-reconciliation state
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Exit code 0 on success, 1 on failure.
|
|
120
|
+
|
|
121
|
+
</process>
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cap:review
|
|
3
|
+
description: Two-stage CAP review — Stage 1 verifies AC compliance against FEATURE-MAP.md and @cap-feature tags, Stage 2 evaluates code quality (security, maintainability, complexity, error handling, test coverage). Stage 2 only runs if Stage 1 passes. TRIGGER when a feature is in state `tested` and the user says "review F-XXX / ready to ship / let's review before merge / final check", after `/cap:test` passes, or proactively before any merge to main of CAP-tagged code. --stage2-only skips the AC compliance gate when only quality review is needed. Spawns cap-validator MODE: REVIEW.
|
|
4
|
+
argument-hint: "[--features NAME] [--stage2-only]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Edit
|
|
9
|
+
- Bash
|
|
10
|
+
- Task
|
|
11
|
+
- Glob
|
|
12
|
+
- Grep
|
|
13
|
+
- AskUserQuestion
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<!-- @cap-context CAP v2.0 review command -- orchestrates two-stage code review. Collects test results, reads Feature Map ACs, spawns cap-validator agent. -->
|
|
17
|
+
<!-- @cap-decision Stage 2 only runs if Stage 1 passes -- prevents wasted review cycles on code that does not meet spec. -->
|
|
18
|
+
<!-- @cap-decision Review output goes to .cap/REVIEW.md -- centralized under .cap/ runtime directory. -->
|
|
19
|
+
|
|
20
|
+
<objective>
|
|
21
|
+
<!-- @cap-todo(ref:AC-58) /cap:review shall invoke the cap-validator agent for two-stage review. -->
|
|
22
|
+
|
|
23
|
+
Runs two-stage code review:
|
|
24
|
+
1. Stage 1: Check Feature Map AC compliance (does the code implement what was promised?)
|
|
25
|
+
2. Stage 2: Check code quality (security, maintainability, error handling)
|
|
26
|
+
|
|
27
|
+
Stage 2 only runs if Stage 1 passes.
|
|
28
|
+
|
|
29
|
+
**Arguments:**
|
|
30
|
+
- `--features NAME` -- scope review to specific Feature Map entries
|
|
31
|
+
- `--stage2-only` -- skip Stage 1, run only code quality review
|
|
32
|
+
</objective>
|
|
33
|
+
|
|
34
|
+
<context>
|
|
35
|
+
$ARGUMENTS
|
|
36
|
+
|
|
37
|
+
@FEATURE-MAP.md
|
|
38
|
+
@.cap/SESSION.json
|
|
39
|
+
</context>
|
|
40
|
+
|
|
41
|
+
<process>
|
|
42
|
+
|
|
43
|
+
## Step 0: Parse flags
|
|
44
|
+
|
|
45
|
+
Check `$ARGUMENTS` for:
|
|
46
|
+
- `--features NAME` -- if present, store as `feature_filter`
|
|
47
|
+
- `--stage2-only` -- if present, set `stage2_only = true`
|
|
48
|
+
|
|
49
|
+
## Step 1: Collect test results
|
|
50
|
+
|
|
51
|
+
Run existing tests to get current pass/fail state:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
node --test tests/*.test.cjs 2>&1 | tail -30
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Store output as `test_output` and exit code as `test_exit_code`.
|
|
58
|
+
|
|
59
|
+
## Step 2: Read Feature Map ACs for review scope
|
|
60
|
+
|
|
61
|
+
<!-- @cap-todo(ref:AC-59) Stage 1: cap-validator shall verify that the implementation satisfies all acceptance criteria listed in the Feature Map entry. -->
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node -e "
|
|
65
|
+
const fm = require('./cap/bin/lib/cap-feature-map.cjs');
|
|
66
|
+
const session = require('./cap/bin/lib/cap-session.cjs');
|
|
67
|
+
const scanner = require('./cap/bin/lib/cap-tag-scanner.cjs');
|
|
68
|
+
// @cap-todo(ac:F-081/AC-4 iter:2) Migrated to {safe: true} opt-in to preserve CLI on duplicate-ID FEATURE-MAP.
|
|
69
|
+
// @cap-decision(F-081/iter2) Warn on parseError; continue with partial map for read-only display.
|
|
70
|
+
const featureMap = fm.readFeatureMap(process.cwd(), undefined, { safe: true });
|
|
71
|
+
if (featureMap && featureMap.parseError) {
|
|
72
|
+
console.warn('cap: review — duplicate feature ID detected, AC checklist uses partial map: ' + String(featureMap.parseError.message).trim());
|
|
73
|
+
}
|
|
74
|
+
const s = session.loadSession(process.cwd());
|
|
75
|
+
const tags = scanner.scanDirectory(process.cwd());
|
|
76
|
+
const groups = scanner.groupByFeature(tags);
|
|
77
|
+
|
|
78
|
+
console.log(JSON.stringify({
|
|
79
|
+
activeFeature: s.activeFeature,
|
|
80
|
+
features: featureMap.features.map(f => ({
|
|
81
|
+
id: f.id, title: f.title, state: f.state,
|
|
82
|
+
acs: f.acs, files: f.files
|
|
83
|
+
})),
|
|
84
|
+
tagGroups: Object.fromEntries(
|
|
85
|
+
Object.entries(groups).map(([k, v]) => [k, v.map(t => ({ type: t.type, file: t.file, line: t.line, description: t.description }))])
|
|
86
|
+
)
|
|
87
|
+
}));
|
|
88
|
+
"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Scope features:**
|
|
92
|
+
- If `feature_filter`: filter to matching IDs
|
|
93
|
+
- Else if active feature: use only that feature
|
|
94
|
+
- Else: use all features with state `tested`
|
|
95
|
+
|
|
96
|
+
Store as `review_features`.
|
|
97
|
+
|
|
98
|
+
## Step 3: Spawn cap-validator for Stage 1 (AC compliance)
|
|
99
|
+
|
|
100
|
+
<!-- @cap-todo(ref:AC-61) cap-validator shall check that all code implementing the feature has appropriate @cap-feature annotations. -->
|
|
101
|
+
|
|
102
|
+
**Skip Stage 1 if `stage2_only`.**
|
|
103
|
+
|
|
104
|
+
Spawn `cap-validator` via Task tool:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
**MODE: REVIEW**
|
|
108
|
+
|
|
109
|
+
**STAGE 1: ACCEPTANCE CRITERIA COMPLIANCE**
|
|
110
|
+
|
|
111
|
+
**Features under review:**
|
|
112
|
+
{For each review_feature:}
|
|
113
|
+
Feature: {feature.id} - {feature.title} [{feature.state}]
|
|
114
|
+
Implementation files: {feature.files.join(', ')}
|
|
115
|
+
Acceptance criteria:
|
|
116
|
+
{For each AC:}
|
|
117
|
+
{ac.id}: {ac.description} [{ac.status}]
|
|
118
|
+
{End for}
|
|
119
|
+
{End for}
|
|
120
|
+
|
|
121
|
+
**Tag evidence:**
|
|
122
|
+
{For each feature in tagGroups:}
|
|
123
|
+
{feature_id}: {tags.length} tags across {unique files}
|
|
124
|
+
{End for}
|
|
125
|
+
|
|
126
|
+
**Test results:**
|
|
127
|
+
{test_output}
|
|
128
|
+
Test exit code: {test_exit_code}
|
|
129
|
+
|
|
130
|
+
**Stage 1 checklist:**
|
|
131
|
+
For each AC in each feature under review:
|
|
132
|
+
1. Is there code that implements this AC?
|
|
133
|
+
2. Is the implementing code annotated with @cap-feature(feature:{ID})?
|
|
134
|
+
3. Is there a test that verifies this AC?
|
|
135
|
+
4. Does the test pass?
|
|
136
|
+
|
|
137
|
+
**Return format:**
|
|
138
|
+
=== STAGE 1 RESULTS ===
|
|
139
|
+
VERDICT: PASS | FAIL
|
|
140
|
+
{For each feature:}
|
|
141
|
+
FEATURE: {id}
|
|
142
|
+
{For each AC:}
|
|
143
|
+
{ac.id}: PASS | FAIL | PARTIAL -- {evidence or reason}
|
|
144
|
+
{End for}
|
|
145
|
+
{End for}
|
|
146
|
+
MISSING_ANNOTATIONS: [list of files implementing features without @cap-feature tags]
|
|
147
|
+
=== END STAGE 1 RESULTS ===
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Parse the Stage 1 results.
|
|
151
|
+
|
|
152
|
+
**If Stage 1 VERDICT is FAIL and NOT `stage2_only`:**
|
|
153
|
+
|
|
154
|
+
Display Stage 1 failures and STOP:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
cap:review Stage 1 FAILED.
|
|
158
|
+
|
|
159
|
+
{For each failing AC:}
|
|
160
|
+
{feature.id}/{ac.id}: FAIL -- {reason}
|
|
161
|
+
{End for}
|
|
162
|
+
|
|
163
|
+
{If missing annotations:}
|
|
164
|
+
Missing @cap-feature annotations:
|
|
165
|
+
{For each file: - file}
|
|
166
|
+
{End if}
|
|
167
|
+
|
|
168
|
+
Stage 2 (code quality) skipped -- fix Stage 1 issues first.
|
|
169
|
+
Run /cap:iterate to address gaps, then re-run /cap:review.
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Step 4: Spawn cap-validator for Stage 2 (code quality)
|
|
173
|
+
|
|
174
|
+
<!-- @cap-todo(ref:AC-60) Stage 2: cap-validator shall perform code quality review (naming, structure, complexity, test coverage, tag completeness). -->
|
|
175
|
+
|
|
176
|
+
Spawn `cap-validator` via Task tool:
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
**MODE: REVIEW** (Stage 2 only)
|
|
180
|
+
|
|
181
|
+
**STAGE 2: CODE QUALITY REVIEW**
|
|
182
|
+
|
|
183
|
+
{If not stage2_only:}
|
|
184
|
+
Stage 1 passed. All ACs verified.
|
|
185
|
+
{End if}
|
|
186
|
+
|
|
187
|
+
**Features under review:**
|
|
188
|
+
{For each review_feature:}
|
|
189
|
+
Feature: {feature.id} - {feature.title}
|
|
190
|
+
Implementation files: {feature.files.join(', ')}
|
|
191
|
+
{End for}
|
|
192
|
+
|
|
193
|
+
**Review checklist:**
|
|
194
|
+
1. **Naming:** Are function/variable/file names clear and consistent with project conventions?
|
|
195
|
+
2. **Structure:** Is the code organized logically? Are modules appropriately sized?
|
|
196
|
+
3. **Complexity:** Are there functions > 50 lines? Deep nesting > 3 levels? Cyclomatic complexity concerns?
|
|
197
|
+
4. **Error handling:** Are errors handled gracefully? Are edge cases covered?
|
|
198
|
+
5. **Security:** Any hardcoded credentials, SQL injection vectors, XSS risks, path traversal?
|
|
199
|
+
6. **Test coverage:** Are critical paths tested? Are error paths tested?
|
|
200
|
+
7. **Tag completeness:** Does every significant function have @cap-feature annotation?
|
|
201
|
+
8. **Dependencies:** Are there unnecessary imports or tight coupling between modules?
|
|
202
|
+
|
|
203
|
+
**Return format:**
|
|
204
|
+
=== STAGE 2 RESULTS ===
|
|
205
|
+
VERDICT: PASS | PASS_WITH_NOTES | FAIL
|
|
206
|
+
FINDINGS:
|
|
207
|
+
{numbered list of findings with severity: critical/warning/note}
|
|
208
|
+
TOP_5_ACTIONS:
|
|
209
|
+
1. {actionable improvement}
|
|
210
|
+
2. ...
|
|
211
|
+
=== END STAGE 2 RESULTS ===
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Parse Stage 2 results.
|
|
215
|
+
|
|
216
|
+
## Step 5: Update Feature Map status
|
|
217
|
+
|
|
218
|
+
<!-- @cap-todo(ref:AC-62) cap-validator shall update the feature state in FEATURE-MAP.md from tested to shipped upon passing both review stages. -->
|
|
219
|
+
|
|
220
|
+
If both stages pass (or Stage 1 skipped with `stage2_only` and Stage 2 passes):
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
node -e "
|
|
224
|
+
const fm = require('./cap/bin/lib/cap-feature-map.cjs');
|
|
225
|
+
const targetIds = {JSON.stringify(target_feature_ids)};
|
|
226
|
+
for (const id of targetIds) {
|
|
227
|
+
const result = fm.updateFeatureState(process.cwd(), id, 'shipped');
|
|
228
|
+
console.log(id + ': ' + (result ? 'updated to shipped' : 'state unchanged'));
|
|
229
|
+
}
|
|
230
|
+
"
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Write review report:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
node -e "
|
|
237
|
+
const fs = require('node:fs');
|
|
238
|
+
const path = require('node:path');
|
|
239
|
+
const capDir = path.join(process.cwd(), '.cap');
|
|
240
|
+
if (!fs.existsSync(capDir)) fs.mkdirSync(capDir, { recursive: true });
|
|
241
|
+
// Write review file (content constructed by command layer from parsed results)
|
|
242
|
+
"
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Write `.cap/REVIEW.md` using the Write tool with the combined Stage 1 + Stage 2 findings.
|
|
246
|
+
|
|
247
|
+
Update session:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
node -e "
|
|
251
|
+
const session = require('./cap/bin/lib/cap-session.cjs');
|
|
252
|
+
session.updateSession(process.cwd(), {
|
|
253
|
+
lastCommand: '/cap:review',
|
|
254
|
+
lastCommandTimestamp: new Date().toISOString(),
|
|
255
|
+
step: 'review-complete'
|
|
256
|
+
});
|
|
257
|
+
"
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Step 6: Generate Manual Testing Checklist
|
|
261
|
+
|
|
262
|
+
After automated review passes, generate a checklist of things only a human can verify. Derive from the Feature Map ACs and implementation context.
|
|
263
|
+
|
|
264
|
+
**Categories of manual tests (include all that apply):**
|
|
265
|
+
|
|
266
|
+
1. **Visual/UX verification** — Does the UI look correct? Is the layout intuitive? Do transitions feel smooth?
|
|
267
|
+
2. **User flow verification** — Can a real user complete the happy path end-to-end? Are error states clear?
|
|
268
|
+
3. **Cross-browser/device** — Does it work on mobile? Different browsers?
|
|
269
|
+
4. **Data verification** — Does real data (not test data) display correctly? Are edge cases handled (empty states, long names, special characters)?
|
|
270
|
+
5. **Permission/access verification** — Can you confirm User A really cannot see User B's data? Try it manually.
|
|
271
|
+
6. **Integration verification** — Do external services (Google Calendar, Zoom, Stripe) actually connect and work?
|
|
272
|
+
7. **Performance perception** — Does it feel fast enough? Any visible loading delays?
|
|
273
|
+
|
|
274
|
+
**Generate the checklist:**
|
|
275
|
+
|
|
276
|
+
For each feature under review, analyze the ACs and implementation files to determine which manual tests are needed:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
MANUAL TESTING CHECKLIST
|
|
280
|
+
========================
|
|
281
|
+
|
|
282
|
+
These tests cannot be automated. A human must verify each item
|
|
283
|
+
before the feature is considered production-ready.
|
|
284
|
+
|
|
285
|
+
Feature: {feature title}
|
|
286
|
+
|
|
287
|
+
Visual / UX:
|
|
288
|
+
[ ] {specific check derived from feature, e.g., "Booking form shows correct time slots for selected date"}
|
|
289
|
+
[ ] {e.g., "Error message appears when double-booking is attempted"}
|
|
290
|
+
|
|
291
|
+
User Flow:
|
|
292
|
+
[ ] {e.g., "Complete a booking from start to confirmation as a new user"}
|
|
293
|
+
[ ] {e.g., "Cancel an existing booking and verify calendar is updated"}
|
|
294
|
+
|
|
295
|
+
Permissions:
|
|
296
|
+
[ ] {e.g., "Log in as Berater A — confirm you cannot see Berater B's bookings"}
|
|
297
|
+
[ ] {e.g., "Log in as Admin — confirm you CAN see all bookings"}
|
|
298
|
+
|
|
299
|
+
External Integrations:
|
|
300
|
+
[ ] {e.g., "Connect Google Calendar — verify new booking appears in calendar"}
|
|
301
|
+
[ ] {e.g., "Connect Zoom — verify meeting link is generated"}
|
|
302
|
+
|
|
303
|
+
Edge Cases:
|
|
304
|
+
[ ] {e.g., "Book a slot at 23:50 that crosses midnight — verify correct date handling"}
|
|
305
|
+
[ ] {e.g., "Enter a name with special characters (umlauts, emojis) — verify display"}
|
|
306
|
+
|
|
307
|
+
Status: [ ] All checks passed [ ] Issues found (describe below)
|
|
308
|
+
Issues: _______________________________________________
|
|
309
|
+
Verified by: ________________ Date: ________________
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Write this checklist to `.cap/MANUAL-TESTS.md` using the Write tool.
|
|
313
|
+
|
|
314
|
+
Display the checklist to the user with a clear message:
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
IMPORTANT: The automated review passed, but these manual checks
|
|
318
|
+
are required before shipping to production.
|
|
319
|
+
|
|
320
|
+
Please work through the checklist above. It takes approximately
|
|
321
|
+
{N} minutes (estimated from item count * 2 min per check).
|
|
322
|
+
|
|
323
|
+
The checklist is saved at .cap/MANUAL-TESTS.md — share it with
|
|
324
|
+
your team or use it as a sign-off document.
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Use AskUserQuestion:
|
|
328
|
+
> "The manual testing checklist has been generated. Would you like to go through it now, or save it for later?"
|
|
329
|
+
> Options: "Go through now" / "Save for later" / "Skip manual tests"
|
|
330
|
+
|
|
331
|
+
If "Go through now": Walk through each item with the user, asking them to confirm each check.
|
|
332
|
+
If "Save for later": Remind them: ".cap/MANUAL-TESTS.md keeps the manual checklist; revisit it with `/cap:status` or run the checks directly when ready."
|
|
333
|
+
If "Skip": Warn: "Manual tests skipped. Feature will be marked as shipped but .cap/MANUAL-TESTS.md remains open."
|
|
334
|
+
|
|
335
|
+
## Step 7: Final report
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
cap:review complete.
|
|
339
|
+
|
|
340
|
+
Stage 1 (AC compliance): {PASS or FAIL or SKIPPED}
|
|
341
|
+
Stage 2 (Code quality): {PASS or PASS_WITH_NOTES or FAIL}
|
|
342
|
+
Stage 3 (Manual tests): {PENDING — N items to verify}
|
|
343
|
+
|
|
344
|
+
{If both automated stages pass:}
|
|
345
|
+
Feature state updated: {feature_ids} -> shipped
|
|
346
|
+
Review report: .cap/REVIEW.md
|
|
347
|
+
Manual tests: .cap/MANUAL-TESTS.md
|
|
348
|
+
|
|
349
|
+
Top 5 actions:
|
|
350
|
+
{top_5_actions}
|
|
351
|
+
{End if}
|
|
352
|
+
|
|
353
|
+
{If stage 2 has notes:}
|
|
354
|
+
Review passed with notes. See .cap/REVIEW.md for details.
|
|
355
|
+
{End if}
|
|
356
|
+
|
|
357
|
+
REMINDER: {N} manual test items pending in .cap/MANUAL-TESTS.md
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
</process>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cap:save
|
|
3
|
+
description: Save current session context to a snapshot file via the cap-historian agent. Cross-session continuity without compression losses.
|
|
4
|
+
argument-hint: "[name] [--unassigned] [--platform=<topic>] [--feature=<F-ID>] [--fork=<parent-snapshot>]"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Task
|
|
7
|
+
- Read
|
|
8
|
+
- Bash
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<!-- @cap-context Thin orchestrator. Real lifecycle work lives in agents/cap-historian.md (modes: SAVE / CONTINUE / FORK). Mirrors the test.md→cap-validator wrapper shape. -->
|
|
12
|
+
<!-- @cap-decision /cap:save delegates to cap-historian via Task() with MODE: SAVE prefix. Backwards-compat: positional [name], --unassigned, --platform=<topic> preserved verbatim. New: --feature=<F-ID> is forwarded; --fork=<parent> redirects to MODE: FORK. -->
|
|
13
|
+
<!-- @cap-feature(feature:F-079) Snapshot-Linkage to Features and Platform — frontmatter `feature:` / `platform:` fields wire snapshots to F-076 per-feature / F-078 platform memory layers. cap-historian reuses cap-snapshot-linkage.cjs; soft-warn semantics inherited. -->
|
|
14
|
+
|
|
15
|
+
<objective>
|
|
16
|
+
Spawn `cap-historian` to capture current session context as a `.cap/snapshots/<name>.md` snapshot with Frontmatter linkage and a JSONL index entry. The snapshot can later be loaded via `/cap:continue`.
|
|
17
|
+
|
|
18
|
+
**Arguments (backwards-compatible):**
|
|
19
|
+
- `[name]` — optional snapshot name (default: auto-generated from active feature + date, else `YYYY-MM-DD-HHMM`).
|
|
20
|
+
- `--unassigned` — save without feature/platform linkage (soft-warn on stderr).
|
|
21
|
+
- `--platform=<topic>` — link to platform topic (kebab-case). Mutually exclusive with `--unassigned`.
|
|
22
|
+
- `--feature=<F-ID>` — explicit feature linkage override (default: `SESSION.json.activeFeature`).
|
|
23
|
+
- `--fork=<parent-snapshot>` — branch off a parent snapshot ("what if X instead"). Routes to MODE: FORK; parent is never mutated.
|
|
24
|
+
</objective>
|
|
25
|
+
|
|
26
|
+
<context>
|
|
27
|
+
$ARGUMENTS
|
|
28
|
+
</context>
|
|
29
|
+
|
|
30
|
+
<process>
|
|
31
|
+
|
|
32
|
+
## Step 1: Detect mode
|
|
33
|
+
|
|
34
|
+
If `$ARGUMENTS` contains `--fork=<parent>`, mode is **FORK**. Otherwise mode is **SAVE**.
|
|
35
|
+
|
|
36
|
+
## Step 2: Spawn cap-historian
|
|
37
|
+
|
|
38
|
+
Invoke `cap-historian` via Task tool with the appropriate mode prefix:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
**MODE: SAVE** (or **MODE: FORK** if --fork= present)
|
|
42
|
+
|
|
43
|
+
$ARGUMENTS
|
|
44
|
+
|
|
45
|
+
Capture current session context. Reuse cap-snapshot-linkage.cjs for linkage
|
|
46
|
+
resolution and cap-session-extract.cjs for source-JSONL discovery. Write snapshot
|
|
47
|
+
to .cap/snapshots/<name>.md (refuse to overwrite — append -2/-3 if needed) and
|
|
48
|
+
append an event line to .cap/snapshots/index.jsonl.
|
|
49
|
+
|
|
50
|
+
Return the structured `=== HISTORIAN SAVE RESULTS ===` (or FORK) block verbatim.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Wait for cap-historian to complete. Parse the structured results block.
|
|
54
|
+
|
|
55
|
+
## Step 3: Confirm to user
|
|
56
|
+
|
|
57
|
+
After the agent returns, surface the outcome in the legacy-compatible shape:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Snapshot saved to .cap/snapshots/<name>.md
|
|
61
|
+
Linkage: feature=<F-NNN> | platform=<topic> | unassigned
|
|
62
|
+
Files captured: <N>
|
|
63
|
+
|
|
64
|
+
To continue in a fresh session: /cap:continue <name>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
For FORK mode, also include `Forked from: <parent>`.
|
|
68
|
+
|
|
69
|
+
**Note:** The snapshot is auto-wired into per-feature/platform memory by the
|
|
70
|
+
`hooks/cap-memory.js` pipeline on the next run (F-079/AC-4) — no manual step.
|
|
71
|
+
|
|
72
|
+
</process>
|