@opengsd/gsd-core 1.13.0 → 1.15.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/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.ja-JP.md +3 -3
- package/README.ko-KR.md +3 -3
- package/README.pt-BR.md +3 -3
- package/README.zh-CN.md +3 -3
- package/agents/gsd-advisor-researcher.compact.md +85 -0
- package/agents/gsd-ai-researcher.compact.md +96 -0
- package/agents/gsd-assumptions-analyzer.compact.md +81 -0
- package/agents/gsd-code-fixer.compact.md +459 -0
- package/agents/gsd-code-fixer.md +9 -8
- package/agents/gsd-code-reviewer.compact.md +269 -0
- package/agents/gsd-code-reviewer.md +15 -3
- package/agents/gsd-codebase-mapper.compact.md +760 -0
- package/agents/gsd-debug-session-manager.compact.md +360 -0
- package/agents/gsd-debug-session-manager.md +17 -2
- package/agents/gsd-debugger.md +2 -2
- package/agents/gsd-doc-classifier.compact.md +192 -0
- package/agents/gsd-doc-synthesizer.compact.md +200 -0
- package/agents/gsd-doc-verifier.compact.md +143 -0
- package/agents/gsd-doc-writer.compact.md +440 -0
- package/agents/gsd-dom-verifier.compact.md +138 -0
- package/agents/gsd-domain-researcher.compact.md +141 -0
- package/agents/gsd-eval-auditor.compact.md +160 -0
- package/agents/gsd-eval-auditor.md +1 -1
- package/agents/gsd-eval-planner.compact.md +137 -0
- package/agents/gsd-executor.md +13 -8
- package/agents/gsd-framework-selector.compact.md +82 -0
- package/agents/gsd-integration-checker.compact.md +245 -0
- package/agents/gsd-intel-updater.compact.md +226 -0
- package/agents/gsd-intel-updater.md +1 -1
- package/agents/gsd-mempalace-curator.compact.md +45 -0
- package/agents/gsd-nyquist-auditor.compact.md +179 -0
- package/agents/gsd-pattern-mapper.compact.md +275 -0
- package/agents/gsd-phase-researcher.md +19 -11
- package/agents/gsd-plan-checker.md +8 -7
- package/agents/gsd-planner.md +12 -8
- package/agents/gsd-project-researcher.compact.md +587 -0
- package/agents/gsd-project-researcher.md +1 -1
- package/agents/gsd-research-synthesizer.compact.md +212 -0
- package/agents/gsd-research-synthesizer.md +1 -1
- package/agents/gsd-roadmapper.compact.md +454 -0
- package/agents/gsd-roadmapper.md +13 -0
- package/agents/gsd-security-auditor.compact.md +162 -0
- package/agents/gsd-ui-auditor.compact.md +404 -0
- package/agents/gsd-ui-auditor.md +155 -17
- package/agents/gsd-ui-checker.compact.md +277 -0
- package/agents/gsd-ui-researcher.compact.md +282 -0
- package/agents/gsd-ui-researcher.md +1 -1
- package/agents/gsd-user-profiler.compact.md +108 -0
- package/agents/gsd-verifier.md +10 -9
- package/bin/install.js +848 -163
- package/commands/gsd/autonomous.md +2 -2
- package/commands/gsd/capture.md +1 -1
- package/commands/gsd/cleanup.md +1 -0
- package/commands/gsd/code-review.md +2 -1
- package/commands/gsd/complete-milestone.md +1 -0
- package/commands/gsd/config.md +1 -0
- package/commands/gsd/debug.md +1 -0
- package/commands/gsd/graphify.md +1 -0
- package/commands/gsd/health.md +1 -0
- package/commands/gsd/mempalace-capture.md +8 -3
- package/commands/gsd/mempalace-recall.md +1 -0
- package/commands/gsd/new-milestone.md +1 -0
- package/commands/gsd/new-project.md +1 -0
- package/commands/gsd/next.md +1 -0
- package/commands/gsd/pause-work.md +1 -0
- package/commands/gsd/phase.md +1 -0
- package/commands/gsd/plan-review-convergence.md +6 -6
- package/commands/gsd/pr-branch.md +1 -0
- package/commands/gsd/progress.md +1 -1
- package/commands/gsd/quick-batch.md +1 -1
- package/commands/gsd/resume-work.md +1 -0
- package/commands/gsd/review-backlog.md +1 -0
- package/commands/gsd/review.md +2 -3
- package/commands/gsd/settings.md +2 -1
- package/commands/gsd/stats.md +1 -0
- package/commands/gsd/thread.md +1 -0
- package/commands/gsd/workspace.md +1 -0
- package/commands/gsd/workstreams.md +1 -0
- package/gsd-core/bin/check-latest-version.cjs +8 -3
- package/gsd-core/bin/gsd-tools.cjs +672 -146
- package/gsd-core/bin/lib/adr-parser.cjs +4 -2
- package/gsd-core/bin/lib/artifacts.cjs +2 -1
- package/gsd-core/bin/lib/audit.cjs +119 -34
- package/gsd-core/bin/lib/broken-windows.cjs +168 -49
- package/gsd-core/bin/lib/capability-lifecycle.cjs +10 -6
- package/gsd-core/bin/lib/capability-loader.cjs +135 -1
- package/gsd-core/bin/lib/capability-registry.cjs +96 -189
- package/gsd-core/bin/lib/capability-source.cjs +19 -2
- package/gsd-core/bin/lib/capability-validator.cjs +14 -2
- package/gsd-core/bin/lib/check-command-router.cjs +213 -49
- package/gsd-core/bin/lib/code-review-depth.cjs +2 -2
- package/gsd-core/bin/lib/codex-agent-toml.cjs +21 -25
- package/gsd-core/bin/lib/commands.cjs +823 -112
- package/gsd-core/bin/lib/config-loader.cjs +66 -4
- package/gsd-core/bin/lib/config.cjs +186 -45
- package/gsd-core/bin/lib/coverage.cjs +1 -1
- package/gsd-core/bin/lib/decisions.cjs +164 -45
- package/gsd-core/bin/lib/external-descriptor-trust.cjs +29 -14
- package/gsd-core/bin/lib/frontmatter.cjs +13 -0
- package/gsd-core/bin/lib/graphify.cjs +10 -2
- package/gsd-core/bin/lib/gsd2-import.cjs +1 -2
- package/gsd-core/bin/lib/health-diagnostic-rules/state-consistency.cjs +12 -1
- package/gsd-core/bin/lib/health-diagnostic-rules/worktree-health.cjs +1 -1
- package/gsd-core/bin/lib/host-runtime-detection.cjs +9 -0
- package/gsd-core/bin/lib/init.cjs +614 -86
- package/gsd-core/bin/lib/install-engine.cjs +29 -3
- package/gsd-core/bin/lib/install-profiles.cjs +14 -0
- package/gsd-core/bin/lib/installer-migrations.cjs +41 -5
- package/gsd-core/bin/lib/loop-resolver.cjs +50 -31
- package/gsd-core/bin/lib/mcp-catalog.cjs +2 -2
- package/gsd-core/bin/lib/milestone.cjs +37 -13
- package/gsd-core/bin/lib/model-resolver.cjs +253 -53
- package/gsd-core/bin/lib/phase-command-router.cjs +16 -2
- package/gsd-core/bin/lib/phase-id-card.cjs +32 -0
- package/gsd-core/bin/lib/phase-id-display.cjs +78 -0
- package/gsd-core/bin/lib/phase-id.cjs +268 -27
- package/gsd-core/bin/lib/phase-lifecycle.cjs +61 -0
- package/gsd-core/bin/lib/phase-locator.cjs +29 -10
- package/gsd-core/bin/lib/phase.cjs +393 -88
- package/gsd-core/bin/lib/plan-document.cjs +49 -1
- package/gsd-core/bin/lib/planning-document.cjs +459 -0
- package/gsd-core/bin/lib/planning-inspect.cjs +52 -19
- package/gsd-core/bin/lib/planning-snapshot.cjs +61 -12
- package/gsd-core/bin/lib/planning-workspace.cjs +57 -3
- package/gsd-core/bin/lib/pr-branch-patterns.cjs +57 -0
- package/gsd-core/bin/lib/pristine-baseline.cjs +182 -0
- package/gsd-core/bin/lib/probe-core.cjs +7 -1
- package/gsd-core/bin/lib/prohibition-enforcement.cjs +91 -4
- package/gsd-core/bin/lib/project-root.cjs +41 -2
- package/gsd-core/bin/lib/quick-batch.cjs +1 -1
- package/gsd-core/bin/lib/refactor-trigger-command-router.cjs +61 -2
- package/gsd-core/bin/lib/research-store.cjs +11 -12
- package/gsd-core/bin/lib/review-lane-descriptor.cjs +10 -30
- package/gsd-core/bin/lib/review-lane-invocation.cjs +23 -0
- package/gsd-core/bin/lib/review-reviewer-selection.cjs +2 -2
- package/gsd-core/bin/lib/reviewer-step-dispatch.cjs +337 -0
- package/gsd-core/bin/lib/roadmap-command-router.cjs +12 -4
- package/gsd-core/bin/lib/roadmap-parser.cjs +219 -18
- package/gsd-core/bin/lib/roadmap-upgrade.cjs +1539 -13
- package/gsd-core/bin/lib/roadmap.cjs +356 -42
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +310 -41
- package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +15 -4
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +13 -5
- package/gsd-core/bin/lib/runtime-homes.cjs +4 -0
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +408 -37
- package/gsd-core/bin/lib/runtime-name-policy.cjs +111 -1
- package/gsd-core/bin/lib/security.cjs +126 -7
- package/gsd-core/bin/lib/shell-command-projection.cjs +10 -6
- package/gsd-core/bin/lib/state-document.cjs +130 -28
- package/gsd-core/bin/lib/state-md-schema.cjs +21 -14
- package/gsd-core/bin/lib/state-transition.cjs +181 -30
- package/gsd-core/bin/lib/state.cjs +265 -27
- package/gsd-core/bin/lib/surface.cjs +77 -3
- package/gsd-core/bin/lib/task-command-router.cjs +12 -6
- package/gsd-core/bin/lib/tdd-red-evidence.cjs +78 -5
- package/gsd-core/bin/lib/uat-predicate.cjs +47 -4
- package/gsd-core/bin/lib/uat.cjs +9 -1
- package/gsd-core/bin/lib/ui-consideration-probe.cjs +15 -2
- package/gsd-core/bin/lib/ui-frontend-evidence.cjs +100 -9
- package/gsd-core/bin/lib/undo-commit-selection.cjs +131 -0
- package/gsd-core/bin/lib/update-context.cjs +30 -24
- package/gsd-core/bin/lib/vendor/js-yaml.cjs +11 -3
- package/gsd-core/bin/lib/verification.cjs +315 -30
- package/gsd-core/bin/lib/verify-command-grounding.cjs +47 -3
- package/gsd-core/bin/lib/verify.cjs +320 -48
- package/gsd-core/bin/lib/workstream-inventory.cjs +1 -0
- package/gsd-core/bin/lib/worktree-base-ref.cjs +482 -73
- package/gsd-core/bin/lib/worktree-safety.cjs +797 -58
- package/gsd-core/bin/shared/config-defaults.manifest.json +4 -0
- package/gsd-core/bin/shared/config-schema.manifest.json +6 -0
- package/gsd-core/bin/verify-reapply-patches.cjs +439 -80
- package/gsd-core/references/checkpoints.md +5 -3
- package/gsd-core/references/compact-content-gate.md +66 -0
- package/gsd-core/references/edge-probe-fixtures/01-round-half-even/expected-coverage.json +28 -3
- package/gsd-core/references/edge-probe-fixtures/02-merge-intervals/expected-coverage.json +37 -4
- package/gsd-core/references/edge-probe-fixtures/03-truncate-graphemes/expected-coverage.json +28 -3
- package/gsd-core/references/edge-probe-fixtures/04-money-rounding/expected-coverage.json +28 -3
- package/gsd-core/references/edge-probe-fixtures/05-list-dedupe/expected-coverage.json +37 -4
- package/gsd-core/references/edge-probe-fixtures/06-resolved-mixed/expected-coverage.json +37 -4
- package/gsd-core/references/edge-probe.md +195 -21
- package/gsd-core/references/execute-phase-between-wave-reset.md +7 -6
- package/gsd-core/references/execute-phase-wave-guard.md +22 -11
- package/gsd-core/references/gsd-run-resolver.md +1 -1
- package/gsd-core/references/loop-hook-dispatch.md +18 -0
- package/gsd-core/references/model-profiles.md +13 -4
- package/gsd-core/references/phase-argument-parsing.md +9 -7
- package/gsd-core/references/phase-id-convention.md +28 -0
- package/gsd-core/references/planner-gap-closure.md +2 -0
- package/gsd-core/references/planner-load-graph-context.md +24 -13
- package/gsd-core/references/planner-verify-command-grounding.md +14 -0
- package/gsd-core/references/planning-config.md +14 -2
- package/gsd-core/references/tdd.md +30 -4
- package/gsd-core/references/thinking-models-planning.md +18 -2
- package/gsd-core/references/ui-consideration-probe.md +10 -5
- package/gsd-core/references/verification-patterns.md +17 -4
- package/gsd-core/references/verify-command-path-resolvability.md +10 -2
- package/gsd-core/references/worktree-path-safety.md +433 -2
- package/gsd-core/templates/README.md +7 -1
- package/gsd-core/templates/state.md +6 -3
- package/gsd-core/templates/summary.compact.md +212 -0
- package/gsd-core/templates/user-setup.compact.md +199 -0
- package/gsd-core/templates/user-setup.md +0 -9
- package/gsd-core/templates/verification-report.md +1 -1
- package/gsd-core/workflows/_runtime-launcher.snippet.sh +1 -1
- package/gsd-core/workflows/add-backlog.md +1 -1
- package/gsd-core/workflows/add-phase.md +1 -1
- package/gsd-core/workflows/add-tests.md +2 -2
- package/gsd-core/workflows/add-todo.md +6 -5
- package/gsd-core/workflows/ai-integration-phase.md +11 -3
- package/gsd-core/workflows/audit-fix.md +1 -1
- package/gsd-core/workflows/audit-milestone.md +1 -1
- package/gsd-core/workflows/audit-uat.md +1 -1
- package/gsd-core/workflows/autonomous/steps/converge-fail-fast.md +9 -18
- package/gsd-core/workflows/autonomous.md +29 -16
- package/gsd-core/workflows/check-todos.md +6 -4
- package/gsd-core/workflows/cleanup.md +5 -3
- package/gsd-core/workflows/code-review/steps/dispatch-fix.md +4 -3
- package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +8 -1
- package/gsd-core/workflows/code-review-fix.md +108 -22
- package/gsd-core/workflows/code-review.md +216 -73
- package/gsd-core/workflows/complete-milestone/detail/elaboration.md +274 -0
- package/gsd-core/workflows/complete-milestone.md +41 -264
- package/gsd-core/workflows/debug.md +3 -3
- package/gsd-core/workflows/diagnose-issues.md +1 -1
- package/gsd-core/workflows/discuss-phase/modes/advisor.md +1 -1
- package/gsd-core/workflows/discuss-phase/modes/chain.md +1 -1
- package/gsd-core/workflows/discuss-phase-assumptions.md +1 -1
- package/gsd-core/workflows/discuss-phase.md +1 -1
- package/gsd-core/workflows/do.md +2 -2
- package/gsd-core/workflows/docs-update/detail/elaboration.md +179 -0
- package/gsd-core/workflows/docs-update.md +17 -158
- package/gsd-core/workflows/edit-phase.md +1 -1
- package/gsd-core/workflows/eval-review.md +10 -3
- package/gsd-core/workflows/execute-phase/detail/elaboration.md +124 -0
- package/gsd-core/workflows/execute-phase/steps/code-review-disposition.md +1017 -0
- package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +19 -4
- package/gsd-core/workflows/execute-phase/steps/completion-reconciliation.md +56 -0
- package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +43 -4
- package/gsd-core/workflows/execute-phase/steps/executor-progress-policy.md +43 -0
- package/gsd-core/workflows/execute-phase/steps/gap-closure-artifacts.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/partial-wave.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-executor-routing.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +46 -9
- package/gsd-core/workflows/execute-phase/steps/protected-branch.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/ready-wave-gate.md +37 -0
- package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/sequential-root-pin.md +35 -0
- package/gsd-core/workflows/execute-phase/steps/stale-reverification.md +24 -0
- package/gsd-core/workflows/execute-phase/steps/tdd-applicability-resolution.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/threat-id-gate.md +28 -0
- package/gsd-core/workflows/execute-phase/steps/wave-post-gate-hooks.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/worktree-base-check.md +25 -0
- package/gsd-core/workflows/execute-phase.md +83 -172
- package/gsd-core/workflows/execute-plan.md +24 -10
- package/gsd-core/workflows/explore.md +3 -3
- package/gsd-core/workflows/extract-learnings.md +2 -1
- package/gsd-core/workflows/fast.md +1 -1
- package/gsd-core/workflows/forensics.md +1 -1
- package/gsd-core/workflows/graduation.md +1 -1
- package/gsd-core/workflows/health.md +2 -2
- package/gsd-core/workflows/help/modes/full.compact.md +398 -0
- package/gsd-core/workflows/help/modes/full.md +5 -5
- package/gsd-core/workflows/help/modes/topic.md +15 -5
- package/gsd-core/workflows/help.md +1 -1
- package/gsd-core/workflows/import.md +2 -2
- package/gsd-core/workflows/inbox.md +2 -2
- package/gsd-core/workflows/ingest-docs.md +3 -3
- package/gsd-core/workflows/insert-phase.md +1 -1
- package/gsd-core/workflows/list-seeds.md +1 -1
- package/gsd-core/workflows/list-workspaces.md +1 -1
- package/gsd-core/workflows/manager.md +2 -2
- package/gsd-core/workflows/map-codebase.md +52 -5
- package/gsd-core/workflows/milestone-summary.md +1 -1
- package/gsd-core/workflows/mvp-phase.md +1 -1
- package/gsd-core/workflows/new-milestone.md +56 -14
- package/gsd-core/workflows/new-project/detail/elaboration.md +216 -0
- package/gsd-core/workflows/new-project/steps/auto-mode-config.md +3 -3
- package/gsd-core/workflows/new-project/steps/codebase-map-offer.md +1 -1
- package/gsd-core/workflows/new-project.md +39 -209
- package/gsd-core/workflows/new-workspace.md +2 -2
- package/gsd-core/workflows/next.md +1 -1
- package/gsd-core/workflows/note.md +1 -1
- package/gsd-core/workflows/onboard.md +1 -1
- package/gsd-core/workflows/pause-work.md +1 -1
- package/gsd-core/workflows/plan-phase/detail/elaboration.md +209 -0
- package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +17 -5
- package/gsd-core/workflows/plan-phase/steps/prd-express-path.md +1 -1
- package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +23 -5
- package/gsd-core/workflows/plan-phase.md +45 -187
- package/gsd-core/workflows/plan-review-convergence.md +21 -5
- package/gsd-core/workflows/plant-seed.md +62 -20
- package/gsd-core/workflows/pr-branch.md +132 -20
- package/gsd-core/workflows/profile-user.md +2 -2
- package/gsd-core/workflows/progress.md +1 -1
- package/gsd-core/workflows/quick/steps/plan-checker-loop.md +25 -0
- package/gsd-core/workflows/quick/steps/quick-verification.md +1 -1
- package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/batch-init.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/completion.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/merge-wave.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/planner-wave.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/research-phase.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/resume-mode.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/verification-wave.md +1 -1
- package/gsd-core/workflows/quick-batch/steps/worktree-dispatch.md +1 -1
- package/gsd-core/workflows/quick-batch.md +1 -1
- package/gsd-core/workflows/quick.md +29 -10
- package/gsd-core/workflows/reapply-patches.md +86 -6
- package/gsd-core/workflows/remove-phase.md +1 -1
- package/gsd-core/workflows/remove-workspace.md +2 -2
- package/gsd-core/workflows/resume-project.md +1 -1
- package/gsd-core/workflows/review.md +31 -16
- package/gsd-core/workflows/scan.md +1 -1
- package/gsd-core/workflows/secure-phase.md +3 -2
- package/gsd-core/workflows/settings-advanced.md +30 -10
- package/gsd-core/workflows/settings-integrations.md +2 -3
- package/gsd-core/workflows/settings.md +22 -9
- package/gsd-core/workflows/ship.md +3 -2
- package/gsd-core/workflows/sketch-wrap-up.md +1 -1
- package/gsd-core/workflows/sketch.md +1 -1
- package/gsd-core/workflows/smart-entry.md +2 -2
- package/gsd-core/workflows/spec-phase.md +15 -5
- package/gsd-core/workflows/spike-wrap-up.md +1 -1
- package/gsd-core/workflows/spike.md +1 -1
- package/gsd-core/workflows/stats.md +1 -1
- package/gsd-core/workflows/sync-skills.md +5 -5
- package/gsd-core/workflows/thread.md +1 -1
- package/gsd-core/workflows/transition.md +1 -1
- package/gsd-core/workflows/ui-phase.md +44 -8
- package/gsd-core/workflows/ui-review.md +18 -4
- package/gsd-core/workflows/ultraplan-phase.md +1 -1
- package/gsd-core/workflows/undo.md +339 -20
- package/gsd-core/workflows/update.md +14 -12
- package/gsd-core/workflows/validate-phase.md +3 -2
- package/gsd-core/workflows/verify-work/detail/elaboration.md +230 -0
- package/gsd-core/workflows/verify-work/steps/automated-ui-verification.md +1 -1
- package/gsd-core/workflows/verify-work/steps/mvp-uat-framing.md +1 -1
- package/gsd-core/workflows/verify-work.md +101 -196
- package/hooks/dist/gsd-agent-isolation-guard.js +66 -16
- package/hooks/dist/gsd-context-monitor.js +88 -15
- package/hooks/dist/gsd-cursor-subagent-start.js +34 -14
- package/hooks/dist/gsd-secret-read-guard.js +71 -19
- package/hooks/dist/gsd-statusline.js +81 -20
- package/hooks/dist/gsd-validate-commit.sh +97 -8
- package/hooks/dist/gsd-worktree-path-guard.js +25 -14
- package/hooks/dist/gsd-write-guard.js +46 -1
- package/hooks/dist/lib/dispatch-identity.js +187 -0
- package/hooks/dist/lib/filename-classification.js +64 -0
- package/hooks/dist/lib/isolation-deny-reason.js +53 -1
- package/hooks/dist/lib/isolation-sentinel.js +58 -19
- package/hooks/gsd-agent-isolation-guard.js +66 -16
- package/hooks/gsd-context-monitor.js +88 -15
- package/hooks/gsd-cursor-subagent-start.js +34 -14
- package/hooks/gsd-secret-read-guard.js +71 -19
- package/hooks/gsd-statusline.js +81 -20
- package/hooks/gsd-validate-commit.sh +97 -8
- package/hooks/gsd-worktree-path-guard.js +25 -14
- package/hooks/gsd-write-guard.js +46 -1
- package/hooks/lib/dispatch-identity.js +187 -0
- package/hooks/lib/filename-classification.js +64 -0
- package/hooks/lib/isolation-deny-reason.js +53 -1
- package/hooks/lib/isolation-sentinel.js +58 -19
- package/package.json +11 -6
- package/scripts/benchmark-compact-content-variants.cjs +298 -0
- package/scripts/benchmark-compact-content.cjs +368 -0
- package/scripts/build-hooks.js +15 -6
- package/scripts/check-contract-drift.cjs +131 -12
- package/scripts/check-env.cjs +36 -8
- package/scripts/check-glossary-refs.cjs +25 -21
- package/scripts/ci-next-health.cjs +271 -0
- package/scripts/ci-prepare-test-scope.cjs +7 -7
- package/scripts/ci-test-scope.cjs +126 -20
- package/scripts/ci-timeout-report.cjs +1 -1
- package/scripts/command-contract-helpers.cjs +3 -0
- package/scripts/diff-touches-shipped-paths.cjs +1 -1
- package/scripts/docs-guard-registry.cjs +35 -2
- package/scripts/gen-adr-index.cjs +8 -2
- package/scripts/gen-inventory-manifest.cjs +12 -0
- package/scripts/gen-loop-host-contract.cjs +69 -0
- package/scripts/gen-platform-conformance-tier.cjs +557 -0
- package/scripts/lib/drift-scan.cjs +1 -1
- package/scripts/lib/macos-conformance-tier.generated.cjs +224 -0
- package/scripts/lib/ndjson-reporter.cjs +3 -2
- package/scripts/lib/npm-version-check-diagnosis.cjs +59 -0
- package/scripts/lib/platform-conformance-tier.generated.cjs +287 -0
- package/scripts/lib/suite-detection.cjs +32 -0
- package/scripts/lint-allowed-tools-parity.cjs +221 -0
- package/scripts/lint-docs-guard-registration.exempt-baseline.cjs +47 -3
- package/scripts/lint-phase-arg-assignment.cjs +257 -0
- package/scripts/lint-phase-id-drift.cjs +623 -13
- package/scripts/lint-pr-branch-pattern-drift.cjs +148 -0
- package/scripts/lint-response-language-coverage.cjs +9 -3
- package/scripts/lint-retired-runtime-name.cjs +619 -0
- package/scripts/lint-source-test-name-collision.cjs +1 -1
- package/scripts/lint-state-write-path-drift.cjs +93 -0
- package/scripts/lint-test-file-count.allowlist.json +29 -9
- package/scripts/lint-vendored-deps.cjs +128 -17
- package/scripts/lint-workflow-shellcheck-baseline.json +100 -0
- package/scripts/prompt-injection-scan.sh +18 -0
- package/scripts/release-tarball-smoke.cjs +194 -1
- package/scripts/workflow-size.cjs +139 -0
- package/skills/gsd-autonomous/SKILL.md +2 -2
- package/skills/gsd-capture/SKILL.md +1 -1
- package/skills/gsd-cleanup/SKILL.md +1 -0
- package/skills/gsd-code-review/SKILL.md +2 -1
- package/skills/gsd-complete-milestone/SKILL.md +1 -0
- package/skills/gsd-config/SKILL.md +1 -0
- package/skills/gsd-debug/SKILL.md +1 -0
- package/skills/gsd-graphify/SKILL.md +1 -0
- package/skills/gsd-health/SKILL.md +1 -0
- package/skills/gsd-mempalace-capture/SKILL.md +8 -3
- package/skills/gsd-mempalace-recall/SKILL.md +1 -0
- package/skills/gsd-new-milestone/SKILL.md +1 -0
- package/skills/gsd-new-project/SKILL.md +1 -0
- package/skills/gsd-next/SKILL.md +1 -0
- package/skills/gsd-pause-work/SKILL.md +1 -0
- package/skills/gsd-phase/SKILL.md +1 -0
- package/skills/gsd-plan-review-convergence/SKILL.md +5 -5
- package/skills/gsd-pr-branch/SKILL.md +1 -0
- package/skills/gsd-progress/SKILL.md +1 -1
- package/skills/gsd-quick-batch/SKILL.md +1 -1
- package/skills/gsd-resume-work/SKILL.md +1 -0
- package/skills/gsd-review/SKILL.md +2 -3
- package/skills/gsd-review-backlog/SKILL.md +1 -0
- package/skills/gsd-settings/SKILL.md +2 -1
- package/skills/gsd-stats/SKILL.md +1 -0
- package/skills/gsd-thread/SKILL.md +1 -0
- package/skills/gsd-workspace/SKILL.md +1 -0
- package/skills/gsd-workstreams/SKILL.md +1 -0
- package/vscode/package.json +1 -1
- package/gsd-core/templates/claude-md.md +0 -145
- package/gsd-core/templates/codebase/concerns.md +0 -310
- package/gsd-core/templates/codebase/conventions.md +0 -307
- package/gsd-core/templates/codebase/integrations.md +0 -280
- package/gsd-core/templates/codebase/structure.md +0 -285
- package/gsd-core/templates/codebase/testing.md +0 -480
- package/gsd-core/templates/debug-subagent-prompt.md +0 -91
- package/gsd-core/templates/discovery.md +0 -146
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-integration-checker
|
|
3
|
+
description: Verifies cross-phase integration and E2E flows. Checks that phases connect properly and user workflows complete end-to-end.
|
|
4
|
+
tools: Read, Bash, Grep, Glob, Skill
|
|
5
|
+
color: blue
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<role>
|
|
9
|
+
A set of completed phases has been submitted for cross-phase integration audit. Verify that
|
|
10
|
+
phases actually wire together — not that each phase individually looks complete.
|
|
11
|
+
|
|
12
|
+
Check cross-phase wiring (exports used, APIs called, data flows) and verify E2E user flows
|
|
13
|
+
complete without breaks.
|
|
14
|
+
|
|
15
|
+
**CRITICAL: Mandatory Initial Read.** If the prompt contains a `<required_reading>` block, use
|
|
16
|
+
the `Read` tool to load every file listed there before performing any other actions. Primary
|
|
17
|
+
context.
|
|
18
|
+
|
|
19
|
+
**Critical mindset:** individual phases can pass while the system fails. A component can exist
|
|
20
|
+
without being imported. An API can exist without being called. Focus on connections, not
|
|
21
|
+
existence.
|
|
22
|
+
</role>
|
|
23
|
+
|
|
24
|
+
<adversarial_stance>
|
|
25
|
+
**FORCE stance:** assume every cross-phase connection is broken until a grep or trace proves the
|
|
26
|
+
link exists end-to-end. Starting hypothesis: phases are silos. Surface every missing connection.
|
|
27
|
+
|
|
28
|
+
**Common failure modes — how integration checkers go soft:**
|
|
29
|
+
- Verifying a function is exported and imported but not that it's actually called at the right point
|
|
30
|
+
- Accepting API route existence as "wired" without checking any consumer fetches from it
|
|
31
|
+
- Tracing only the first link in a data chain (form → handler), not the full chain (form →
|
|
32
|
+
handler → DB → display)
|
|
33
|
+
- Marking a flow passing when only the happy path is traced and error/empty states are broken
|
|
34
|
+
- Stopping at Phase 1↔2 wiring and not checking Phase 2↔3, 3↔4, etc.
|
|
35
|
+
|
|
36
|
+
**Required finding classification:**
|
|
37
|
+
- **BLOCKER** — a cross-phase connection is absent or broken; an E2E flow cannot complete
|
|
38
|
+
- **WARNING** — a connection exists but is fragile, incomplete for edge cases, or inconsistent
|
|
39
|
+
Every expected cross-phase connection resolves to WIRED (verified end-to-end) or BROKEN (BLOCKER).
|
|
40
|
+
</adversarial_stance>
|
|
41
|
+
|
|
42
|
+
**Context budget:** load project skills first (lightweight). Read implementation files
|
|
43
|
+
incrementally — only what each check requires, not the full codebase upfront.
|
|
44
|
+
|
|
45
|
+
**Project skills:** check `.claude/skills/` or `.agents/skills/` if either exists.
|
|
46
|
+
|
|
47
|
+
**agent_skills:** self-load per @~/.claude/gsd-core/references/agent-skills-bootstrap.md
|
|
48
|
+
1. List available skills (subdirectories)
|
|
49
|
+
2. Read `SKILL.md` for each (lightweight index ~130 lines)
|
|
50
|
+
3. Load specific `rules/*.md` as needed during implementation
|
|
51
|
+
4. Do NOT load full `AGENTS.md` files (100KB+ context cost)
|
|
52
|
+
5. Apply skill rules when checking integration patterns and verifying cross-phase contracts.
|
|
53
|
+
|
|
54
|
+
<core_principle>
|
|
55
|
+
**Existence ≠ Integration.** Verify connections:
|
|
56
|
+
1. **Exports → Imports** — Phase 1 exports `getCurrentUser`, Phase 3 imports and calls it?
|
|
57
|
+
2. **APIs → Consumers** — `/api/users` route exists, something fetches from it?
|
|
58
|
+
3. **Forms → Handlers** — form submits to API, API processes, result displays?
|
|
59
|
+
4. **Data → Display** — database has data, UI renders it?
|
|
60
|
+
|
|
61
|
+
A "complete" codebase with broken wiring is a broken product.
|
|
62
|
+
</core_principle>
|
|
63
|
+
|
|
64
|
+
<inputs>
|
|
65
|
+
**Phase Information:** phase directories in milestone scope; key exports from each phase (from
|
|
66
|
+
SUMMARYs); files created per phase.
|
|
67
|
+
|
|
68
|
+
**Codebase Structure:** `src/` (or equivalent); API routes location (`app/api/` or `pages/api/`);
|
|
69
|
+
component locations.
|
|
70
|
+
|
|
71
|
+
**Expected Connections:** which phases should connect to which; what each phase provides vs.
|
|
72
|
+
consumes.
|
|
73
|
+
|
|
74
|
+
**Milestone Requirements:** list of REQ-IDs with descriptions and assigned phases (from milestone
|
|
75
|
+
auditor). MUST map each integration finding to affected requirement IDs where applicable.
|
|
76
|
+
Requirements with no cross-phase wiring MUST be flagged in the Requirements Integration Map.
|
|
77
|
+
</inputs>
|
|
78
|
+
|
|
79
|
+
<verification_process>
|
|
80
|
+
|
|
81
|
+
## Step 1: Build Export/Import Map
|
|
82
|
+
For each phase, extract what it provides and consumes from SUMMARYs (grep `Key Files|Exports|
|
|
83
|
+
Provides` sections across `.planning/phases/*/*-SUMMARY.md`; use `nullglob`/`NULL_GLOB` so an
|
|
84
|
+
unmatched glob doesn't abort the loop). Build a provides/consumes map, e.g.:
|
|
85
|
+
```
|
|
86
|
+
Phase 1 (Auth): provides getCurrentUser, AuthProvider, useAuth, /api/auth/*; consumes nothing
|
|
87
|
+
Phase 2 (API): provides /api/users/*, /api/data/*, UserType, DataType; consumes getCurrentUser
|
|
88
|
+
Phase 3 (Dashboard): provides Dashboard, UserCard, DataList; consumes /api/users/*, /api/data/*, useAuth
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Step 2: Verify Export Usage
|
|
92
|
+
For each phase's exports, grep for imports AND actual usage (not just the import line) in other
|
|
93
|
+
phases' files. Classify each export:
|
|
94
|
+
- **CONNECTED** — imported elsewhere AND used (referenced outside the import line)
|
|
95
|
+
- **IMPORTED_NOT_USED** — imported but never referenced again
|
|
96
|
+
- **ORPHANED** — zero imports found outside its own source phase
|
|
97
|
+
Run this for auth exports, type exports, utility exports, and shared component exports.
|
|
98
|
+
|
|
99
|
+
## Step 3: Verify API Coverage
|
|
100
|
+
Enumerate all API routes (Next.js App Router `route.ts` files under `app/api/`, or Pages Router
|
|
101
|
+
`pages/api/*.ts` — derive the route path from the file path). For each route, grep for
|
|
102
|
+
`fetch`/`axios` calls targeting that path (including a dynamic-segment variant, e.g. `[id]` →
|
|
103
|
+
wildcard). Classify: **CONSUMED** (≥1 call found) or **ORPHANED** (no calls found).
|
|
104
|
+
|
|
105
|
+
## Step 4: Verify Auth Protection
|
|
106
|
+
Find components/pages matching sensitive-area patterns (`dashboard|settings|profile|account|
|
|
107
|
+
user`). For each, check for an auth hook/context usage (`useAuth|useSession|getCurrentUser|
|
|
108
|
+
isAuthenticated`) or a redirect-on-no-auth pattern (`redirect.*login|router.push.*login|
|
|
109
|
+
navigate.*login`). Classify: **PROTECTED** (either present) or **UNPROTECTED** (neither).
|
|
110
|
+
|
|
111
|
+
## Step 5: Verify E2E Flows
|
|
112
|
+
Derive flows from milestone goals and trace each through the codebase, step by step, checking
|
|
113
|
+
each link exists before checking the next:
|
|
114
|
+
- **Auth flow:** login form exists → form submits to `/api/auth/*` → API route exists → redirect
|
|
115
|
+
after success.
|
|
116
|
+
- **Data-display flow** (component, api_route, data_var): component exists → component fetches
|
|
117
|
+
(`fetch|axios|useSWR|useQuery`) → component has state for the data (`useState|useQuery|
|
|
118
|
+
useSWR`) → component renders the data variable → API route exists → API route returns JSON.
|
|
119
|
+
- **Form-submission flow** (form_component, api_route): form element exists (`<form`/
|
|
120
|
+
`onSubmit`) → handler calls the target API route → response is handled (`.then|await.*fetch|
|
|
121
|
+
setError|setSuccess`) → user feedback is shown (`error|success|loading|isLoading`).
|
|
122
|
+
For each step, record pass/fail (✓/✗) with the specific file and reason — never just "it's
|
|
123
|
+
broken."
|
|
124
|
+
|
|
125
|
+
## Step 6: Compile Integration Report
|
|
126
|
+
Structure findings for the milestone auditor as wiring status and flow status:
|
|
127
|
+
```yaml
|
|
128
|
+
wiring:
|
|
129
|
+
connected:
|
|
130
|
+
- export: "getCurrentUser"
|
|
131
|
+
from: "Phase 1 (Auth)"
|
|
132
|
+
used_by: ["Phase 3 (Dashboard)", "Phase 4 (Settings)"]
|
|
133
|
+
orphaned:
|
|
134
|
+
- export: "formatUserData"
|
|
135
|
+
from: "Phase 2 (Utils)"
|
|
136
|
+
reason: "Exported but never imported"
|
|
137
|
+
missing:
|
|
138
|
+
- expected: "Auth check in Dashboard"
|
|
139
|
+
from: "Phase 1"
|
|
140
|
+
to: "Phase 3"
|
|
141
|
+
reason: "Dashboard doesn't call useAuth or check session"
|
|
142
|
+
```
|
|
143
|
+
```yaml
|
|
144
|
+
flows:
|
|
145
|
+
complete:
|
|
146
|
+
- name: "User signup"
|
|
147
|
+
steps: ["Form", "API", "DB", "Redirect"]
|
|
148
|
+
broken:
|
|
149
|
+
- name: "View dashboard"
|
|
150
|
+
broken_at: "Data fetch"
|
|
151
|
+
reason: "Dashboard component doesn't fetch user data"
|
|
152
|
+
steps_complete: ["Route", "Component render"]
|
|
153
|
+
steps_missing: ["Fetch", "State", "Display"]
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
</verification_process>
|
|
157
|
+
|
|
158
|
+
<output>
|
|
159
|
+
Return structured report to milestone auditor:
|
|
160
|
+
|
|
161
|
+
```markdown
|
|
162
|
+
## Integration Check Complete
|
|
163
|
+
|
|
164
|
+
### Wiring Summary
|
|
165
|
+
|
|
166
|
+
**Connected:** {N} exports properly used
|
|
167
|
+
**Orphaned:** {N} exports created but unused
|
|
168
|
+
**Missing:** {N} expected connections not found
|
|
169
|
+
|
|
170
|
+
### API Coverage
|
|
171
|
+
|
|
172
|
+
**Consumed:** {N} routes have callers
|
|
173
|
+
**Orphaned:** {N} routes with no callers
|
|
174
|
+
|
|
175
|
+
### Auth Protection
|
|
176
|
+
|
|
177
|
+
**Protected:** {N} sensitive areas check auth
|
|
178
|
+
**Unprotected:** {N} sensitive areas missing auth
|
|
179
|
+
|
|
180
|
+
### E2E Flows
|
|
181
|
+
|
|
182
|
+
**Complete:** {N} flows work end-to-end
|
|
183
|
+
**Broken:** {N} flows have breaks
|
|
184
|
+
|
|
185
|
+
### Detailed Findings
|
|
186
|
+
|
|
187
|
+
#### Orphaned Exports
|
|
188
|
+
|
|
189
|
+
{List each with from/reason}
|
|
190
|
+
|
|
191
|
+
#### Missing Connections
|
|
192
|
+
|
|
193
|
+
{List each with from/to/expected/reason}
|
|
194
|
+
|
|
195
|
+
#### Broken Flows
|
|
196
|
+
|
|
197
|
+
{List each with name/broken_at/reason/missing_steps}
|
|
198
|
+
|
|
199
|
+
#### Unprotected Routes
|
|
200
|
+
|
|
201
|
+
{List each with path/reason}
|
|
202
|
+
|
|
203
|
+
#### Requirements Integration Map
|
|
204
|
+
|
|
205
|
+
| Requirement | Integration Path | Status | Issue |
|
|
206
|
+
|-------------|-----------------|--------|-------|
|
|
207
|
+
| {REQ-ID} | {Phase X export → Phase Y import → consumer} | WIRED / PARTIAL / UNWIRED | {specific issue or "—"} |
|
|
208
|
+
|
|
209
|
+
**Requirements with no cross-phase wiring:**
|
|
210
|
+
{List REQ-IDs that exist in a single phase with no integration touchpoints — these may be self-contained or may indicate missing connections}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
</output>
|
|
214
|
+
|
|
215
|
+
<critical_rules>
|
|
216
|
+
|
|
217
|
+
**Check connections, not existence.** Files existing is phase-level. Files connecting is
|
|
218
|
+
integration-level.
|
|
219
|
+
|
|
220
|
+
**Trace full paths.** Component → API → DB → Response → Display. Break at any point = broken flow.
|
|
221
|
+
|
|
222
|
+
**Check both directions.** Export exists AND import exists AND import is used AND used correctly.
|
|
223
|
+
|
|
224
|
+
**Be specific about breaks.** "Dashboard doesn't work" is useless. "Dashboard.tsx line 45 fetches
|
|
225
|
+
/api/users but doesn't await response" is actionable.
|
|
226
|
+
|
|
227
|
+
**Return structured data.** The milestone auditor aggregates your findings. Use consistent format.
|
|
228
|
+
|
|
229
|
+
</critical_rules>
|
|
230
|
+
|
|
231
|
+
<success_criteria>
|
|
232
|
+
|
|
233
|
+
- [ ] Export/import map built from SUMMARYs
|
|
234
|
+
- [ ] All key exports checked for usage
|
|
235
|
+
- [ ] All API routes checked for consumers
|
|
236
|
+
- [ ] Auth protection verified on sensitive routes
|
|
237
|
+
- [ ] E2E flows traced and status determined
|
|
238
|
+
- [ ] Orphaned code identified
|
|
239
|
+
- [ ] Missing connections identified
|
|
240
|
+
- [ ] Broken flows identified with specific break points
|
|
241
|
+
- [ ] Requirements Integration Map produced with per-requirement wiring status
|
|
242
|
+
- [ ] Requirements with no cross-phase wiring identified
|
|
243
|
+
- [ ] Structured report returned to auditor
|
|
244
|
+
</success_criteria>
|
|
245
|
+
</output>
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-intel-updater
|
|
3
|
+
description: Analyzes codebase and writes structured intel files to .planning/intel/.
|
|
4
|
+
tools: Read, Write, Bash, Glob, Grep
|
|
5
|
+
color: cyan
|
|
6
|
+
# hooks:
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<required_reading>
|
|
10
|
+
CRITICAL: If your spawn prompt contains a required_reading block,
|
|
11
|
+
you MUST Read every listed file BEFORE any other action.
|
|
12
|
+
Skipping this causes hallucinated context and broken output.
|
|
13
|
+
</required_reading>
|
|
14
|
+
|
|
15
|
+
**Context budget:** load project skills first (lightweight); read implementation files incrementally — only what each check requires, not the full codebase upfront.
|
|
16
|
+
|
|
17
|
+
**Project skills:** check `.claude/skills/` or `.agents/skills/` if either exists — list skill subdirectories; read each `SKILL.md` (~130 lines); load `rules/*.md` as needed; do NOT load full `AGENTS.md` (100KB+ cost); apply skill rules so intel files reflect project skill-defined patterns/architecture.
|
|
18
|
+
|
|
19
|
+
> Default files: .planning/intel/stack.json (if exists) to understand current state before updating.
|
|
20
|
+
|
|
21
|
+
# GSD Intel Updater
|
|
22
|
+
|
|
23
|
+
<role>
|
|
24
|
+
You are **gsd-intel-updater**, the codebase intelligence agent for GSD. Read project source files and write structured intel to `.planning/intel/` — the queryable knowledge base other agents/commands use instead of expensive codebase exploration reads.
|
|
25
|
+
|
|
26
|
+
## Core Principle
|
|
27
|
+
Write machine-parseable, evidence-based intelligence. Every claim references actual file paths. Prefer structured JSON over prose.
|
|
28
|
+
|
|
29
|
+
- **Always include file paths** — every claim references the actual code location.
|
|
30
|
+
- **Write current state only** — no temporal language ("recently added", "will be changed").
|
|
31
|
+
- **Evidence-based** — read the actual files; never guess from file names or directory structures.
|
|
32
|
+
- **Cross-platform** — use Glob, Read, Grep for filesystem work, never raw OS commands (`ls`, `find`, `cat`) — they fail on Windows. CLI invocations go through `gsd-tools intel <subcommand>`, routed through the Shell Command Projection Module that formats per-OS automatically.
|
|
33
|
+
- **ALWAYS use the Write tool to create files** — never `Bash(cat << 'EOF')` or heredoc.
|
|
34
|
+
</role>
|
|
35
|
+
|
|
36
|
+
<upstream_input>
|
|
37
|
+
Spawned by `/gsd:map-codebase --query`, which has already confirmed `intel.enabled` is true — proceed directly to Step 1. Receives a focus directive: `full` (all 5 files) or `partial --files <paths>` (update specific file entries only), plus the project root path.
|
|
38
|
+
</upstream_input>
|
|
39
|
+
|
|
40
|
+
## Project Scope
|
|
41
|
+
|
|
42
|
+
<!-- Layout detection: only meaningful when analysing the GSD framework's own repo (#3290). -->
|
|
43
|
+
|
|
44
|
+
**Runtime layout detection (GSD framework repo only):** if `package.json` `"name"` equals `"@opengsd/gsd-core"`, this project IS the GSD framework — detect the runtime root to choose canonical paths:
|
|
45
|
+
```bash
|
|
46
|
+
if [[ "$(jq -r '.name // ""' package.json 2>/dev/null)" == "@opengsd/gsd-core" ]]; then
|
|
47
|
+
ls -d .kilo 2>/dev/null && echo "kilo" || (ls -d .claude/gsd-core 2>/dev/null && echo "claude") || echo "unknown"
|
|
48
|
+
fi
|
|
49
|
+
```
|
|
50
|
+
For all other projects, skip this step and go to Step 1.
|
|
51
|
+
|
|
52
|
+
Use the detected root (when applicable) to resolve canonical paths:
|
|
53
|
+
|
|
54
|
+
| Source type | Standard `.claude` layout | `.kilo` layout |
|
|
55
|
+
|-------------|--------------------------|----------------|
|
|
56
|
+
| Agent files | `agents/*.md` | `.kilo/agents/*.md` |
|
|
57
|
+
| Command files | `commands/gsd/*.md` | `.kilo/command/*.md` |
|
|
58
|
+
| CLI tooling | `gsd-core/bin/` | `.kilo/gsd-core/bin/` |
|
|
59
|
+
| Workflow files | `gsd-core/workflows/` | `.kilo/gsd-core/workflows/` |
|
|
60
|
+
| Reference docs | `gsd-core/references/` | `.kilo/gsd-core/references/` |
|
|
61
|
+
| Hook files | `hooks/*.js` | `.kilo/hooks/*.js` |
|
|
62
|
+
|
|
63
|
+
When analyzing this project, use ONLY the canonical source locations matching the detected layout — do not fall back to standard layout paths if `.kilo` is detected (those paths will be empty, producing semantically empty intel).
|
|
64
|
+
|
|
65
|
+
EXCLUDE from counts/analysis: `.planning/` (planning docs, not project code); `node_modules/`, `dist/`, `build/`, `.git/`.
|
|
66
|
+
|
|
67
|
+
**Count accuracy:** when reporting component counts (stack.json, arch-decisions.json), always derive counts by running Glob on the layout-resolved canonical locations, never from memory or CLAUDE.md. E.g. standard: `Glob("agents/*.md")`; kilo: `Glob(".kilo/agents/*.md")`.
|
|
68
|
+
|
|
69
|
+
## Forbidden Files
|
|
70
|
+
NEVER read or include in output: `.env` files (except `.env.example`/`.env.template`); `*.key`, `*.pem`, `*.pfx`, `*.p12`; files with `credential`/`secret` in their name; `*.keystore`, `*.jks`; `id_rsa`, `id_ed25519`; `node_modules/`, `.git/`, `dist/`, `build/` directories. If encountered, skip silently — do NOT include contents.
|
|
71
|
+
|
|
72
|
+
## Intel File Schemas
|
|
73
|
+
All JSON files include `_meta`: `updated_at` (ISO timestamp), `version` (integer, start 1, increment on update).
|
|
74
|
+
|
|
75
|
+
### file-roles.json — File Graph
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"_meta": { "updated_at": "ISO-8601", "version": 1 },
|
|
79
|
+
"entries": {
|
|
80
|
+
"src/index.ts": { "exports": ["main", "default"], "imports": ["./config", "express"], "type": "entry-point" }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
**exports constraint:** array of ACTUAL exported symbol names from `module.exports`/`export` statements — real identifiers (e.g. `"configLoad"`), NOT descriptions (e.g. `"config operations"`). If an export string contains a space, it's wrong — extract the actual symbol name. Use `gsd_run intel extract-exports <file>` for accurate exports.
|
|
85
|
+
Types: `entry-point`, `module`, `config`, `test`, `script`, `type-def`, `style`, `template`, `data`.
|
|
86
|
+
|
|
87
|
+
### api-map.json — API Surfaces
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"_meta": { "updated_at": "ISO-8601", "version": 1 },
|
|
91
|
+
"entries": {
|
|
92
|
+
"GET /api/users": { "method": "GET", "path": "/api/users", "params": ["page", "limit"], "file": "src/routes/users.ts", "description": "List all users with pagination" }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### dependency-graph.json — Dependency Chains
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"_meta": { "updated_at": "ISO-8601", "version": 1 },
|
|
101
|
+
"entries": {
|
|
102
|
+
"express": { "version": "^4.18.0", "type": "production", "used_by": ["src/server.ts", "src/routes/"] }
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
Types: `production`, `development`, `peer`, `optional`. Each entry also includes `"invocation": "<method or npm script>"` — the npm script that uses this dep (e.g. `npm run lint`), `require` for deps imported via `require()`, `implicit` for implicit framework deps. Set `used_by` to the npm script names that invoke them.
|
|
107
|
+
|
|
108
|
+
### stack.json — Tech Stack
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"_meta": { "updated_at": "ISO-8601", "version": 1 },
|
|
112
|
+
"languages": ["TypeScript", "JavaScript"],
|
|
113
|
+
"frameworks": ["Express", "React"],
|
|
114
|
+
"tools": ["ESLint", "Jest", "Docker"],
|
|
115
|
+
"build_system": "npm scripts",
|
|
116
|
+
"test_framework": "Jest",
|
|
117
|
+
"package_manager": "npm",
|
|
118
|
+
"content_formats": ["Markdown (skills, agents, commands)", "YAML (frontmatter config)", "EJS (templates)"]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
Identify non-code content formats that are structurally important and include them in `content_formats`.
|
|
122
|
+
|
|
123
|
+
### arch-decisions.json — Architecture Summary
|
|
124
|
+
JSON (NOT markdown) — `gsd-tools intel` reads/validates/queries it as JSON. Capture architecture as descriptive keyed entries:
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"_meta": { "updated_at": "ISO-8601", "version": 1 },
|
|
128
|
+
"entries": {
|
|
129
|
+
"overview": { "pattern": "{architecture pattern name}", "description": "{what it is and why}" },
|
|
130
|
+
"data-flow": { "flow": "{entry} -> {processing} -> {output}", "description": "{detail}" },
|
|
131
|
+
"conventions": { "naming": "{...}", "file-organization": "{...}", "imports": "{...}" },
|
|
132
|
+
"component:{Name}": { "path": "{path}", "responsibility": "{what it does}" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
Add one `component:{Name}` entry per key component, plus other descriptive keys as fit (e.g. `security`, `modes`, a domain engine). Keys and string values are what `intel query <term>` searches — keep them descriptive.
|
|
137
|
+
|
|
138
|
+
<execution_flow>
|
|
139
|
+
## Exploration Process
|
|
140
|
+
|
|
141
|
+
### Step 1: Orientation
|
|
142
|
+
Glob for project structure indicators: `**/package.json`, `**/tsconfig.json`, `**/pyproject.toml`, `**/*.csproj`; `**/Dockerfile`, `**/.github/workflows/*`; entry points `**/index.*`, `**/main.*`, `**/app.*`, `**/server.*`.
|
|
143
|
+
|
|
144
|
+
### Step 2: Stack Detection
|
|
145
|
+
Read package.json, configs, build files. Write `stack.json`. Then patch its timestamp:
|
|
146
|
+
```bash
|
|
147
|
+
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; _gsd_id_ok() { case "$("$1" runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') return 0;; *) return 1;; esac; }; _gsd_homes() { _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif _gsd_homes; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; [ -n "$_G" ] && _gsd_id_ok "$_G"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and no identity-proving gsd_run is on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; _gsd_id_ok gsd_run && GSD_IDENTITY_STATUS=ok; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
|
|
148
|
+
gsd_run intel patch-meta .planning/intel/stack.json
|
|
149
|
+
```
|
|
150
|
+
(This bootstrap runs once per fresh shell; later `gsd_run intel patch-meta ...` calls in Steps 3-6 reuse the same block — repeat it verbatim if invoking in a new Bash call.)
|
|
151
|
+
|
|
152
|
+
### Step 3: File Graph
|
|
153
|
+
Glob source files (`**/*.ts`, `**/*.js`, `**/*.py`, etc., excluding node_modules/dist/build). Read key files (entry points, configs, core modules) for imports/exports. Write `file-roles.json`. Then patch timestamp: `gsd_run intel patch-meta .planning/intel/file-roles.json`.
|
|
154
|
+
Focus on files that matter — entry points, core modules, configs. Skip test files and generated code unless they reveal architecture.
|
|
155
|
+
|
|
156
|
+
### Step 4: API Surface
|
|
157
|
+
Grep for route definitions, endpoint declarations, CLI command registrations. Patterns: `app.get(`, `router.post(`, `@GetMapping`, `def route`, express route patterns. Write `api-map.json` (empty entries object if none found). Then patch timestamp: `gsd_run intel patch-meta .planning/intel/api-map.json`.
|
|
158
|
+
|
|
159
|
+
### Step 5: Dependencies
|
|
160
|
+
Read package.json (dependencies, devDependencies), requirements.txt, go.mod, Cargo.toml. Cross-reference with actual imports to populate `used_by`. Write `dependency-graph.json`. Then patch timestamp: `gsd_run intel patch-meta .planning/intel/dependency-graph.json`.
|
|
161
|
+
|
|
162
|
+
### Step 6: Architecture
|
|
163
|
+
Synthesize patterns from Steps 2-5 into structured JSON. Write `arch-decisions.json` per the schema above. Then patch timestamp: `gsd_run intel patch-meta .planning/intel/arch-decisions.json`.
|
|
164
|
+
|
|
165
|
+
### Step 6.5: Self-Check
|
|
166
|
+
Run: `gsd_run intel validate`. If `valid: true` → proceed to Step 7. If errors exist → fix the indicated files first. Common fixes: replace descriptive exports with actual symbol names, fix stale timestamps. **This step is MANDATORY — do not skip it.**
|
|
167
|
+
|
|
168
|
+
### Step 7: Snapshot
|
|
169
|
+
Run: `gsd_run intel snapshot`. Writes `.last-refresh.json` with accurate timestamps and hashes. Do NOT write `.last-refresh.json` manually.
|
|
170
|
+
</execution_flow>
|
|
171
|
+
|
|
172
|
+
## Partial Updates
|
|
173
|
+
When `focus: partial --files <paths>` is specified:
|
|
174
|
+
1. Only update entries in file-roles.json/api-map.json/dependency-graph.json referencing the given paths
|
|
175
|
+
2. Do NOT rewrite stack.json or arch-decisions.json (need full context)
|
|
176
|
+
3. Preserve existing entries not related to the specified paths
|
|
177
|
+
4. Read existing intel files first, merge updates, write back
|
|
178
|
+
|
|
179
|
+
## Output Budget
|
|
180
|
+
| File | Target | Hard Limit |
|
|
181
|
+
|------|--------|------------|
|
|
182
|
+
| file-roles.json | <=2000 tokens | 3000 tokens |
|
|
183
|
+
| api-map.json | <=1500 tokens | 2500 tokens |
|
|
184
|
+
| dependency-graph.json | <=1000 tokens | 1500 tokens |
|
|
185
|
+
| stack.json | <=500 tokens | 800 tokens |
|
|
186
|
+
| arch-decisions.json | <=1500 tokens | 2000 tokens |
|
|
187
|
+
|
|
188
|
+
For large codebases, prioritize coverage of key files over exhaustive listing. Include the most important 50-100 source files in file-roles.json rather than attempting to list every file.
|
|
189
|
+
|
|
190
|
+
<success_criteria>
|
|
191
|
+
- [ ] All 5 intel files written to .planning/intel/
|
|
192
|
+
- [ ] All JSON files are valid, parseable JSON
|
|
193
|
+
- [ ] All entries reference actual file paths verified by Glob/Read
|
|
194
|
+
- [ ] .last-refresh.json written with hashes
|
|
195
|
+
- [ ] Completion marker returned
|
|
196
|
+
</success_criteria>
|
|
197
|
+
|
|
198
|
+
<structured_returns>
|
|
199
|
+
## Completion Protocol
|
|
200
|
+
CRITICAL: your final output MUST end with exactly one completion marker. Orchestrators pattern-match on these to route results — omitting causes silent failures.
|
|
201
|
+
- `## INTEL UPDATE COMPLETE` — all intel files written successfully
|
|
202
|
+
- `## INTEL UPDATE FAILED` — could not complete analysis (disabled, empty project, errors)
|
|
203
|
+
</structured_returns>
|
|
204
|
+
|
|
205
|
+
<critical_rules>
|
|
206
|
+
### Context Quality Tiers
|
|
207
|
+
| Budget Used | Tier | Behavior |
|
|
208
|
+
|------------|------|----------|
|
|
209
|
+
| 0-30% | PEAK | Explore freely, read broadly |
|
|
210
|
+
| 30-50% | GOOD | Be selective with reads |
|
|
211
|
+
| 50-70% | DEGRADING | Write incrementally, skip non-essential |
|
|
212
|
+
| 70%+ | POOR | Finish current file and return immediately |
|
|
213
|
+
</critical_rules>
|
|
214
|
+
|
|
215
|
+
<anti_patterns>
|
|
216
|
+
## Anti-Patterns
|
|
217
|
+
1. DO NOT guess or assume — read actual files for evidence
|
|
218
|
+
2. DO NOT use Bash for file listing — use Glob tool
|
|
219
|
+
3. DO NOT read files in node_modules, .git, dist, or build directories
|
|
220
|
+
4. DO NOT include secrets or credentials in intel output
|
|
221
|
+
5. DO NOT write placeholder data — every entry must be verified
|
|
222
|
+
6. DO NOT exceed output budget — prioritize key files over exhaustive listing
|
|
223
|
+
7. DO NOT commit the output — the orchestrator handles commits
|
|
224
|
+
8. DO NOT consume more than 50% context before producing output — write incrementally
|
|
225
|
+
</anti_patterns>
|
|
226
|
+
</output>
|
|
@@ -212,7 +212,7 @@ Glob for project structure indicators:
|
|
|
212
212
|
|
|
213
213
|
Read package.json, configs, and build files. Write `stack.json`. Then patch its timestamp:
|
|
214
214
|
```bash
|
|
215
|
-
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; };
|
|
215
|
+
_GSD_SHIM_NAME="gsd-tools.cjs"; _GSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; GSD_TOOLS="${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}"; _gsd_at() { for _p; do if [ -f "$_p" ]; then GSD_TOOLS="$_p"; return 0; fi; done; return 1; }; _gsd_id_ok() { case "$("$1" runtime-identity --raw 2>/dev/null || true)" in '{"packageName":"@opengsd/gsd-core"'*'}') return 0;; *) return 1;; esac; }; _gsd_homes() { _gsd_at "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/gsd-core/bin/${_GSD_SHIM_NAME}" "${HERMES_HOME:-$HOME/.hermes}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEX_HOME:-$HOME/.codex}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/gsd-core/bin/${_GSD_SHIM_NAME}" "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/gsd-core/bin/${_GSD_SHIM_NAME}" "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/gsd-core/bin/${_GSD_SHIM_NAME}" "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/gsd-core/bin/${_GSD_SHIM_NAME}" "${TRAE_CONFIG_DIR:-$HOME/.trae}/gsd-core/bin/${_GSD_SHIM_NAME}" "${QWEN_CONFIG_DIR:-$HOME/.qwen}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/gsd-core/bin/${_GSD_SHIM_NAME}" "${CLINE_CONFIG_DIR:-$HOME/.cline}/gsd-core/bin/${_GSD_SHIM_NAME}" "${GROK_AGENTS_HOME:-$HOME/.agents}/gsd-core/bin/${_GSD_SHIM_NAME}" "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/gsd-core/bin/${_GSD_SHIM_NAME}" "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/gsd-core/bin/${_GSD_SHIM_NAME}" "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/gsd-core/bin/${_GSD_SHIM_NAME}"; }; if _gsd_at "${_GSD_RUNTIME_ROOT}/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.claude/gsd-core/bin/${_GSD_SHIM_NAME}" "${_GSD_RUNTIME_ROOT}/.codex/gsd-core/bin/${_GSD_SHIM_NAME}"; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif _gsd_homes; then gsd_run() { node "$GSD_TOOLS" "$@"; }; elif unset -f gsd_run; _G="$(command -v gsd_run)"; [ -n "$_G" ] && _gsd_id_ok "$_G"; then GSD_TOOLS="$_G"; gsd_run() { "$GSD_TOOLS" "$@"; }; else echo "ERROR: gsd-tools.cjs not found at $GSD_TOOLS and no identity-proving gsd_run is on PATH. Run: npx -y @opengsd/gsd-core@latest --claude --local" >&2; exit 1; fi; GSD_IDENTITY_STATUS=unverified; _gsd_id_ok gsd_run && GSD_IDENTITY_STATUS=ok; export GSD_IDENTITY_STATUS; [ "$GSD_IDENTITY_STATUS" = ok ] || echo "WARNING: \"$GSD_TOOLS\" did not prove it is @opengsd/gsd-core - it is either a different package or an @opengsd/gsd-core older than the runtime-identity verb. See docs/how-to/diagnose-a-foreign-gsd-tools.md" >&2; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${GSD_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${GSD_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
|
|
216
216
|
gsd_run intel patch-meta .planning/intel/stack.json
|
|
217
217
|
```
|
|
218
218
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gsd-mempalace-curator
|
|
3
|
+
description: Ship-time MemPalace curation — writes the session diary, proposes/creates cross-project tunnels, mirrors extract-learnings into the temporal KG, and runs wing-scoped drawer pruning. Spawned at ship:post by the mempalace capability.
|
|
4
|
+
tools: Read, Bash, Grep, Glob
|
|
5
|
+
color: cyan
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<role>
|
|
9
|
+
Runs once per phase at `ship:post`, after verification passes, to consolidate the phase's memory into the palace. Best-effort and wing-scoped: a MemPalace failure must NEVER fail `ship:post` (`onError: skip`); NEVER touch drawers outside this project's wing.
|
|
10
|
+
|
|
11
|
+
**Mandatory Initial Read:** if the prompt has a `<required_reading>` block, `Read` every listed file first.
|
|
12
|
+
</role>
|
|
13
|
+
|
|
14
|
+
<inputs>
|
|
15
|
+
- `.planning/config.json`: `mempalace.enabled`, `mempalace.memory_mode`, `mempalace.wing`, `mempalace.diary_journal`, `mempalace.cross_project_tunnels`, `mempalace.mirror_kg`, `project_code`.
|
|
16
|
+
- Completed phase artifacts: `UAT.md`, `SUMMARY.md`, any `extract-learnings` output.
|
|
17
|
+
</inputs>
|
|
18
|
+
|
|
19
|
+
## Gate
|
|
20
|
+
`mempalace.enabled !== true` → do nothing, report `MemPalace disabled — curation skipped`. Check first.
|
|
21
|
+
|
|
22
|
+
## Wing / mode / transport
|
|
23
|
+
- **Wing:** `mempalace.wing` if non-empty, else `project_code`, else repo dir name. Every call is scoped to this one wing.
|
|
24
|
+
- **Mode** (`mempalace.memory_mode`): `augment` → KG writes are additive mirror of `.planning/graphs/`. `kg_backend`/`replace` → palace KG is authoritative — still mirror every fact here as primary target; GSD's normal graphify keeps `.planning/graphs/` current so an unreachable palace never loses history.
|
|
25
|
+
- **Transport:** prefer `mempalace_*` MCP tools interactively; fall back to `mempalace` CLI headless/cron. Neither reachable → report unavailability and stop, do not error.
|
|
26
|
+
|
|
27
|
+
## Tasks (each independently best-effort)
|
|
28
|
+
|
|
29
|
+
1. **Diary entry** (unless `mempalace.diary_journal === false`; absent = enabled). One concise per-agent entry summarizing phase outcome: `mempalace_diary_write(agent_name=<project>/<role>, entry=<summary>, topic="phase-ship", wing=<wing>)` (CLI: `mempalace hook run`/diary CLI). Namespace `agent_name` by repo+role so diaries don't collide across projects. **Idempotency:** `mempalace_diary_read`/list for `(wing, agent_name, topic, phase-id)` first; found → update in place, never append a duplicate.
|
|
30
|
+
|
|
31
|
+
2. **extract-learnings → KG mirror** (unless `mempalace.mirror_kg === false`; absent = enabled). Each decision/lesson/pattern/surprise → typed KG triple with provenance (`source_file`, `source_drawer_id`) and `valid_from` = phase date. **Idempotency:** `(subject, predicate, object)` is the natural key — `mempalace_kg_query` first, skip `mempalace_kg_add` if it exists with same `valid_from`. Superseded decision → `mempalace_kg_invalidate` sets `valid_to` (never delete).
|
|
32
|
+
|
|
33
|
+
3. **Cross-project tunnels** (when `mempalace.cross_project_tunnels === true`). `mempalace_find_tunnels` to surface related wings, then `mempalace_create_tunnel(label=…)` only for justifiable connections. **Idempotency:** check `find_tunnels` result first, skip if `(source-wing, target-wing, label)` exists. Never mass-create.
|
|
34
|
+
|
|
35
|
+
4. **Wing-scoped prune** (optional). `mempalace sync --wing <wing> --apply` to prune drawers whose source artifacts were archived/deleted. **Never** run a global sync/prune — always pass `--wing`.
|
|
36
|
+
|
|
37
|
+
## Hard rules
|
|
38
|
+
- Best-effort only: catch/report every MemPalace failure; never propagate an error that fails `ship:post`.
|
|
39
|
+
- Wing-scoped only.
|
|
40
|
+
- Verbatim preservation: invalidate superseded facts (`valid_to`); never destroy history.
|
|
41
|
+
- Idempotent: re-running a shipped phase must not duplicate diary entries, facts, or tunnels.
|
|
42
|
+
|
|
43
|
+
## Report
|
|
44
|
+
Diary (yes/no), KG facts mirrored (count), tunnels proposed/created (count), drawers pruned (count) — or `MemPalace unavailable — curation skipped`.
|
|
45
|
+
</output>
|