@garygentry/feature-forge 0.2.13 → 0.3.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/README.md +6 -3
- package/adapters/GENERATION-REPORT.md +20 -0
- package/adapters/claude/.feature-forge-bundle.json +1 -1
- package/adapters/claude/references/epic-manifest-schema.json +5 -0
- package/adapters/claude/references/forge-config-schema.json +2 -2
- package/adapters/claude/references/shared-conventions.md +12 -0
- package/adapters/claude/references/stacks/_generic.md +21 -0
- package/adapters/claude/references/stacks/go.md +19 -0
- package/adapters/claude/references/stacks/python.md +21 -0
- package/adapters/claude/references/stacks/rust.md +19 -0
- package/adapters/claude/references/stacks/typescript.md +23 -0
- package/adapters/claude/scripts/epic-manifest.py +75 -5
- package/adapters/claude/scripts/forge-root.sh +102 -14
- package/adapters/claude/scripts/forge-session.py +68 -9
- package/adapters/claude/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-1-prd/SKILL.md +2 -0
- package/adapters/claude/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-2-tech/SKILL.md +2 -0
- package/adapters/claude/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-3-specs/SKILL.md +2 -0
- package/adapters/claude/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-4-backlog/SKILL.md +5 -0
- package/adapters/claude/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/claude/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-5-loop/SKILL.md +7 -9
- package/adapters/claude/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/claude/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/claude/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/claude/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/claude/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/claude/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/claude/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/claude/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/claude/skills/forge-verify/SKILL.md +3 -3
- package/adapters/claude/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/claude/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/codex/.feature-forge-bundle.json +1 -1
- package/adapters/codex/references/epic-manifest-schema.json +5 -0
- package/adapters/codex/references/forge-config-schema.json +2 -2
- package/adapters/codex/references/shared-conventions.md +12 -0
- package/adapters/codex/references/stacks/_generic.md +21 -0
- package/adapters/codex/references/stacks/go.md +19 -0
- package/adapters/codex/references/stacks/python.md +21 -0
- package/adapters/codex/references/stacks/rust.md +19 -0
- package/adapters/codex/references/stacks/typescript.md +23 -0
- package/adapters/codex/scripts/epic-manifest.py +75 -5
- package/adapters/codex/scripts/forge-root.sh +102 -14
- package/adapters/codex/scripts/forge-session.py +68 -9
- package/adapters/codex/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-1-prd/SKILL.md +2 -0
- package/adapters/codex/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-2-tech/SKILL.md +2 -0
- package/adapters/codex/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-3-specs/SKILL.md +2 -0
- package/adapters/codex/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-4-backlog/SKILL.md +5 -0
- package/adapters/codex/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/codex/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-5-loop/SKILL.md +7 -9
- package/adapters/codex/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/codex/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/codex/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/codex/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/codex/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/codex/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/codex/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/codex/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/codex/skills/forge-verify/SKILL.md +3 -3
- package/adapters/codex/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/codex/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/copilot/.feature-forge-bundle.json +1 -1
- package/adapters/copilot/references/epic-manifest-schema.json +5 -0
- package/adapters/copilot/references/forge-config-schema.json +2 -2
- package/adapters/copilot/references/shared-conventions.md +12 -0
- package/adapters/copilot/references/stacks/_generic.md +21 -0
- package/adapters/copilot/references/stacks/go.md +19 -0
- package/adapters/copilot/references/stacks/python.md +21 -0
- package/adapters/copilot/references/stacks/rust.md +19 -0
- package/adapters/copilot/references/stacks/typescript.md +23 -0
- package/adapters/copilot/scripts/epic-manifest.py +75 -5
- package/adapters/copilot/scripts/forge-root.sh +102 -14
- package/adapters/copilot/scripts/forge-session.py +68 -9
- package/adapters/copilot/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-1-prd/forge-1-prd.md +2 -0
- package/adapters/copilot/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-2-tech/forge-2-tech.md +2 -0
- package/adapters/copilot/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-3-specs/forge-3-specs.md +2 -0
- package/adapters/copilot/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-4-backlog/forge-4-backlog.md +5 -0
- package/adapters/copilot/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/copilot/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-5-loop/forge-5-loop.md +7 -9
- package/adapters/copilot/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/copilot/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/copilot/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/copilot/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/copilot/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/copilot/skills/forge-verify/forge-verify.md +3 -3
- package/adapters/copilot/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/copilot/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/cursor/.feature-forge-bundle.json +1 -1
- package/adapters/cursor/references/epic-manifest-schema.json +5 -0
- package/adapters/cursor/references/forge-config-schema.json +2 -2
- package/adapters/cursor/references/shared-conventions.md +12 -0
- package/adapters/cursor/references/stacks/_generic.md +21 -0
- package/adapters/cursor/references/stacks/go.md +19 -0
- package/adapters/cursor/references/stacks/python.md +21 -0
- package/adapters/cursor/references/stacks/rust.md +19 -0
- package/adapters/cursor/references/stacks/typescript.md +23 -0
- package/adapters/cursor/scripts/epic-manifest.py +75 -5
- package/adapters/cursor/scripts/forge-root.sh +102 -14
- package/adapters/cursor/scripts/forge-session.py +68 -9
- package/adapters/cursor/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-1-prd/forge-1-prd.mdc +2 -0
- package/adapters/cursor/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-2-tech/forge-2-tech.mdc +2 -0
- package/adapters/cursor/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-3-specs/forge-3-specs.mdc +2 -0
- package/adapters/cursor/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-4-backlog/forge-4-backlog.mdc +5 -0
- package/adapters/cursor/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/cursor/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-5-loop/forge-5-loop.mdc +7 -9
- package/adapters/cursor/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/cursor/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/cursor/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/cursor/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/cursor/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/cursor/skills/forge-verify/forge-verify.mdc +3 -3
- package/adapters/cursor/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/cursor/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/gemini/.feature-forge-bundle.json +1 -1
- package/adapters/gemini/gemini-extension.json +1 -1
- package/adapters/gemini/references/epic-manifest-schema.json +5 -0
- package/adapters/gemini/references/forge-config-schema.json +2 -2
- package/adapters/gemini/references/shared-conventions.md +12 -0
- package/adapters/gemini/references/stacks/_generic.md +21 -0
- package/adapters/gemini/references/stacks/go.md +19 -0
- package/adapters/gemini/references/stacks/python.md +21 -0
- package/adapters/gemini/references/stacks/rust.md +19 -0
- package/adapters/gemini/references/stacks/typescript.md +23 -0
- package/adapters/gemini/scripts/epic-manifest.py +75 -5
- package/adapters/gemini/scripts/forge-root.sh +102 -14
- package/adapters/gemini/scripts/forge-session.py +68 -9
- package/adapters/gemini/skills/forge/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-0-epic/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-1-prd/forge-1-prd.md +2 -0
- package/adapters/gemini/skills/forge-1-prd/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-2-tech/forge-2-tech.md +2 -0
- package/adapters/gemini/skills/forge-2-tech/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-2-tech/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-3-specs/forge-3-specs.md +2 -0
- package/adapters/gemini/skills/forge-3-specs/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-3-specs/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-4-backlog/forge-4-backlog.md +5 -0
- package/adapters/gemini/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/gemini/skills/forge-4-backlog/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-5-loop/forge-5-loop.md +7 -9
- package/adapters/gemini/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/gemini/skills/forge-5-loop/references/runner-contract.md +41 -0
- package/adapters/gemini/skills/forge-5-loop/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-6-docs/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-fix/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/gemini/skills/forge-guide/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/_generic.md +21 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/go.md +19 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/python.md +21 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/rust.md +19 -0
- package/adapters/gemini/skills/forge-guide/references/stacks/typescript.md +23 -0
- package/adapters/gemini/skills/forge-verify/forge-verify.md +3 -3
- package/adapters/gemini/skills/forge-verify/references/shared-conventions.md +12 -0
- package/adapters/gemini/skills/forge-verify/references/verification-checklists.md +82 -3
- package/adapters/pi/.feature-forge-bundle.json +6 -0
- package/adapters/pi/agents/forge-researcher.md +139 -0
- package/adapters/pi/agents/forge-spec-writer.md +116 -0
- package/adapters/pi/agents/forge-verifier.md +126 -0
- package/adapters/pi/extensions/ask-user-question/LICENSE +21 -0
- package/adapters/pi/extensions/ask-user-question/README.md +91 -0
- package/adapters/pi/extensions/ask-user-question/ask-user-question.ts +298 -0
- package/adapters/pi/extensions/ask-user-question/config.ts +78 -0
- package/adapters/pi/extensions/ask-user-question/events.ts +57 -0
- package/adapters/pi/extensions/ask-user-question/index.ts +61 -0
- package/adapters/pi/extensions/ask-user-question/locales/de.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/en.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/es.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/fr.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/pt-BR.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/pt.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/ru.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/uk.json +27 -0
- package/adapters/pi/extensions/ask-user-question/locales/zh.json +29 -0
- package/adapters/pi/extensions/ask-user-question/reconcile.ts +49 -0
- package/adapters/pi/extensions/ask-user-question/rpc-fallback.ts +168 -0
- package/adapters/pi/extensions/ask-user-question/state/build-questionnaire.ts +302 -0
- package/adapters/pi/extensions/ask-user-question/state/i18n-bridge.ts +53 -0
- package/adapters/pi/extensions/ask-user-question/state/key-router.ts +277 -0
- package/adapters/pi/extensions/ask-user-question/state/questionnaire-session.ts +234 -0
- package/adapters/pi/extensions/ask-user-question/state/row-intent.ts +145 -0
- package/adapters/pi/extensions/ask-user-question/state/selectors/contract.ts +26 -0
- package/adapters/pi/extensions/ask-user-question/state/selectors/derivations.ts +42 -0
- package/adapters/pi/extensions/ask-user-question/state/selectors/focus.ts +19 -0
- package/adapters/pi/extensions/ask-user-question/state/selectors/projections.ts +101 -0
- package/adapters/pi/extensions/ask-user-question/state/state-reducer.ts +292 -0
- package/adapters/pi/extensions/ask-user-question/state/state.ts +55 -0
- package/adapters/pi/extensions/ask-user-question/tool/format-answer.ts +31 -0
- package/adapters/pi/extensions/ask-user-question/tool/response-envelope.ts +49 -0
- package/adapters/pi/extensions/ask-user-question/tool/types.ts +147 -0
- package/adapters/pi/extensions/ask-user-question/tool/validate-questionnaire.ts +58 -0
- package/adapters/pi/extensions/ask-user-question/vendor-config-shim.ts +65 -0
- package/adapters/pi/extensions/ask-user-question/view/component-binding.ts +47 -0
- package/adapters/pi/extensions/ask-user-question/view/components/inline-input.ts +98 -0
- package/adapters/pi/extensions/ask-user-question/view/components/multi-select-view.ts +193 -0
- package/adapters/pi/extensions/ask-user-question/view/components/option-list-view.ts +70 -0
- package/adapters/pi/extensions/ask-user-question/view/components/preview/markdown-content-cache.ts +79 -0
- package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-block-renderer.ts +111 -0
- package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-box-renderer.ts +88 -0
- package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-layout-decider.ts +202 -0
- package/adapters/pi/extensions/ask-user-question/view/components/preview/preview-pane.ts +228 -0
- package/adapters/pi/extensions/ask-user-question/view/components/submit-picker.ts +67 -0
- package/adapters/pi/extensions/ask-user-question/view/components/tab-bar.ts +59 -0
- package/adapters/pi/extensions/ask-user-question/view/components/wrapping-select.ts +293 -0
- package/adapters/pi/extensions/ask-user-question/view/dialog-builder.ts +224 -0
- package/adapters/pi/extensions/ask-user-question/view/props-adapter.ts +125 -0
- package/adapters/pi/extensions/ask-user-question/view/stateful-view.ts +26 -0
- package/adapters/pi/extensions/ask-user-question/view/tab-components.ts +18 -0
- package/adapters/pi/extensions/ask-user-question/view/tab-content-strategy.ts +252 -0
- package/adapters/pi/package.json +26 -0
- package/adapters/pi/references/epic-manifest-schema.json +125 -0
- package/adapters/pi/references/forge-config-schema.json +236 -0
- package/adapters/pi/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/references/portable-root.md +71 -0
- package/adapters/pi/references/process-overview.md +143 -0
- package/adapters/pi/references/ralph-loop-contract.md +221 -0
- package/adapters/pi/references/shared-conventions.md +295 -0
- package/adapters/pi/references/skill-frontmatter.schema.json +17 -0
- package/adapters/pi/references/stack-resolution.md +54 -0
- package/adapters/pi/references/stacks/_generic.md +111 -0
- package/adapters/pi/references/stacks/go.md +157 -0
- package/adapters/pi/references/stacks/python.md +184 -0
- package/adapters/pi/references/stacks/rust.md +170 -0
- package/adapters/pi/references/stacks/typescript.md +134 -0
- package/adapters/pi/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/references/templates/specs-hygiene/AGENTS.md +32 -0
- package/adapters/pi/references/templates/specs-hygiene/CLAUDE.md +31 -0
- package/adapters/pi/references/vendor-construct-inventory.md +50 -0
- package/adapters/pi/scripts/epic-manifest.py +1694 -0
- package/adapters/pi/scripts/forge-bootstrap.py +1070 -0
- package/adapters/pi/scripts/forge-init.sh +58 -0
- package/adapters/pi/scripts/forge-root.sh +179 -0
- package/adapters/pi/scripts/forge-session.py +1888 -0
- package/adapters/pi/scripts/validate-traceability.py +150 -0
- package/adapters/pi/skills/forge/SKILL.md +243 -0
- package/adapters/pi/skills/forge/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge/references/process-overview.md +143 -0
- package/adapters/pi/skills/forge/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-0-epic/SKILL.md +308 -0
- package/adapters/pi/skills/forge-0-epic/references/edit-mode.md +266 -0
- package/adapters/pi/skills/forge-0-epic/references/epic-manifest-subcommands.md +75 -0
- package/adapters/pi/skills/forge-0-epic/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-0-epic/references/portable-root.md +71 -0
- package/adapters/pi/skills/forge-0-epic/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-0-epic/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-1-prd/SKILL.md +164 -0
- package/adapters/pi/skills/forge-1-prd/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-1-prd/references/prd-template.md +106 -0
- package/adapters/pi/skills/forge-1-prd/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-1-prd/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-2-tech/SKILL.md +225 -0
- package/adapters/pi/skills/forge-2-tech/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-2-tech/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-2-tech/references/stack-discovery-checklist.md +95 -0
- package/adapters/pi/skills/forge-2-tech/references/stack-resolution.md +54 -0
- package/adapters/pi/skills/forge-2-tech/references/stacks/_generic.md +111 -0
- package/adapters/pi/skills/forge-2-tech/references/stacks/go.md +157 -0
- package/adapters/pi/skills/forge-2-tech/references/stacks/python.md +184 -0
- package/adapters/pi/skills/forge-2-tech/references/stacks/rust.md +170 -0
- package/adapters/pi/skills/forge-2-tech/references/stacks/typescript.md +134 -0
- package/adapters/pi/skills/forge-2-tech/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-3-specs/SKILL.md +178 -0
- package/adapters/pi/skills/forge-3-specs/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-3-specs/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-3-specs/references/spec-archetypes.md +106 -0
- package/adapters/pi/skills/forge-3-specs/references/spec-examples.md +71 -0
- package/adapters/pi/skills/forge-3-specs/references/stacks/_generic.md +111 -0
- package/adapters/pi/skills/forge-3-specs/references/stacks/go.md +157 -0
- package/adapters/pi/skills/forge-3-specs/references/stacks/python.md +184 -0
- package/adapters/pi/skills/forge-3-specs/references/stacks/rust.md +170 -0
- package/adapters/pi/skills/forge-3-specs/references/stacks/typescript.md +134 -0
- package/adapters/pi/skills/forge-3-specs/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-4-backlog/SKILL.md +175 -0
- package/adapters/pi/skills/forge-4-backlog/references/forge-config-schema.json +236 -0
- package/adapters/pi/skills/forge-4-backlog/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-4-backlog/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-4-backlog/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-5-loop/SKILL.md +314 -0
- package/adapters/pi/skills/forge-5-loop/references/forge-config-schema.json +236 -0
- package/adapters/pi/skills/forge-5-loop/references/ralph-loop-contract.md +221 -0
- package/adapters/pi/skills/forge-5-loop/references/result-reporting.md +85 -0
- package/adapters/pi/skills/forge-5-loop/references/runner-contract.md +341 -0
- package/adapters/pi/skills/forge-5-loop/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-5-loop/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-6-docs/SKILL.md +202 -0
- package/adapters/pi/skills/forge-6-docs/references/doc-conventions.md +126 -0
- package/adapters/pi/skills/forge-6-docs/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-6-docs/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-bootstrap/SKILL.md +250 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/ci/github-actions.yml +12 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/generic/run.sh +3 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/generic/test.sh +13 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/go/go.mod +3 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/go/main.go +12 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/go/main_test.go +11 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/AGENTS.md +35 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/CLAUDE.md +36 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/hygiene/README.md +11 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/licenses/Apache-2.0/LICENSE +198 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/licenses/MIT/LICENSE +21 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/python/pyproject.toml +24 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/python/src/{{PKG}}/__init__.py +5 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/python/src/{{PKG}}/main.py +13 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/python/tests/test_smoke.py +8 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/rust/Cargo.toml +15 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/rust/src/lib.rs +7 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/rust/src/main.rs +5 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/rust/tests/smoke.rs +6 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/package.json +15 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/src/index.ts +4 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/test/smoke.test.ts +6 -0
- package/adapters/pi/skills/forge-bootstrap/references/templates/typescript/tsconfig.json +14 -0
- package/adapters/pi/skills/forge-fix/SKILL.md +98 -0
- package/adapters/pi/skills/forge-fix/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-fix/references/stage-exit-protocol.md +258 -0
- package/adapters/pi/skills/forge-guide/SKILL.md +192 -0
- package/adapters/pi/skills/forge-guide/references/forge-config-schema.json +236 -0
- package/adapters/pi/skills/forge-guide/references/process-overview.md +143 -0
- package/adapters/pi/skills/forge-guide/references/ralph-loop-contract.md +221 -0
- package/adapters/pi/skills/forge-guide/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-guide/references/stack-resolution.md +54 -0
- package/adapters/pi/skills/forge-guide/references/stacks/_generic.md +111 -0
- package/adapters/pi/skills/forge-guide/references/stacks/go.md +157 -0
- package/adapters/pi/skills/forge-guide/references/stacks/python.md +184 -0
- package/adapters/pi/skills/forge-guide/references/stacks/rust.md +170 -0
- package/adapters/pi/skills/forge-guide/references/stacks/typescript.md +134 -0
- package/adapters/pi/skills/forge-init/SKILL.md +72 -0
- package/adapters/pi/skills/forge-verify/SKILL.md +273 -0
- package/adapters/pi/skills/forge-verify/references/pipeline-state-schema.json +191 -0
- package/adapters/pi/skills/forge-verify/references/shared-conventions.md +295 -0
- package/adapters/pi/skills/forge-verify/references/verification-checklists.md +477 -0
- package/dist/agent-targets.d.ts +1 -1
- package/dist/agent-targets.js +23 -3
- package/dist/detect.d.ts +1 -1
- package/dist/detect.js +2 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +2 -2
- package/dist/placements.js +5 -1
- package/dist/rauf.d.ts +4 -4
- package/dist/rauf.js +3 -3
- package/dist/types.d.ts +31 -6
- package/dist/types.js +6 -3
- package/package.json +14 -3
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
# Stage Exit Protocol
|
|
2
|
+
|
|
3
|
+
The single source of truth for how every forge **authoring** stage closes. It
|
|
4
|
+
replaces the old ad-hoc "Next steps:" bullet lists with one fixed, correctly-ordered
|
|
5
|
+
sequence: **verify (if missing or stale) → `/clear` → run the next command.**
|
|
6
|
+
|
|
7
|
+
Two principles this protocol encodes (do not relitigate — they are locked product
|
|
8
|
+
decisions):
|
|
9
|
+
|
|
10
|
+
1. **Clearing is recommended on its own merits at every stage boundary** — a clean
|
|
11
|
+
start for the next stage — *not* as a proxy for a full context window. Window
|
|
12
|
+
fullness only changes *how emphatically* the clear is recommended, never *whether*
|
|
13
|
+
it is.
|
|
14
|
+
2. **Verify happens before the clear, never after** — in the authoring session, whether
|
|
15
|
+
manual **or** auto. Verify's clean-room subagent is dispatched from the *current*
|
|
16
|
+
session, so the findings digest and any fix decision land where the context to act on
|
|
17
|
+
them still exists. This holds for auto-verify too: the stage skill dispatches the
|
|
18
|
+
clean-room verify (and any autoFix) at stage end, in-session, before the exit — it is
|
|
19
|
+
**not** deferred to the navigator, which runs *after* the `/clear` with none of the
|
|
20
|
+
authoring context. Clearing first throws that context away.
|
|
21
|
+
|
|
22
|
+
## How this file is used
|
|
23
|
+
|
|
24
|
+
The five authoring stages (`forge-0-epic` … `forge-4-backlog`) close with the
|
|
25
|
+
**Scripted Stage Exit**: a short stamped block (below) that runs
|
|
26
|
+
`forge-session.py stage-exit`, obeys the DIRECTIVES it prints per the **directive
|
|
27
|
+
contract** in this file, and prints the script-emitted NEXT-STEPS block verbatim as the
|
|
28
|
+
absolute last output. All the conditional logic the old prose blocks asked the model to
|
|
29
|
+
compute (effective auto-verify, freshness collapse, gate selection, host wording) now
|
|
30
|
+
lives in the script, deterministically; only genuinely interactive work (clean-room
|
|
31
|
+
subagent dispatch, `AskUserQuestion` gates) remains prose — specified once here, not
|
|
32
|
+
per stage.
|
|
33
|
+
|
|
34
|
+
The loop (`forge-5-loop`) keeps its bespoke exits: it stamps the **standard block**
|
|
35
|
+
(step-6 epic-member handoff) and the **warm variant** (all-done closing) below,
|
|
36
|
+
verbatim. `forge-6-docs` is **terminal** — it stamps no exit block.
|
|
37
|
+
|
|
38
|
+
A drift-guard test (`tests/test_stage_exit_protocol.py`) asserts each stamp site still
|
|
39
|
+
contains its block, so an edit here must be mirrored into every stamp site (and
|
|
40
|
+
vice-versa).
|
|
41
|
+
|
|
42
|
+
## Stamp sites
|
|
43
|
+
|
|
44
|
+
| Stamp site | Block |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `forge-0-epic` … `forge-4-backlog` | scripted-stage-exit stamp |
|
|
47
|
+
| `forge-5-loop` (step-6 epic-member handoff) | standard |
|
|
48
|
+
| `forge-5-loop` (all-done closing → docs) | warm |
|
|
49
|
+
|
|
50
|
+
The scripted stamp fills one build-time slot, `{stage-exit-args}` — the per-stage
|
|
51
|
+
argument list (e.g. `--feature "{feature}" --stage forge-2-tech`; the epic stage passes
|
|
52
|
+
`--feature "{epic}" --stage forge-0-epic --next-feature "{first-actionable-feature}"`).
|
|
53
|
+
`{feature}` / `{epic}` / `{specsDir}` / `{first-actionable-feature}` remain runtime
|
|
54
|
+
placeholders the skill resolves before running the command, exactly as elsewhere.
|
|
55
|
+
|
|
56
|
+
<!-- BEGIN: scripted-stage-exit-stamp -->
|
|
57
|
+
**Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
R="$(bash -c 'for d in "${CLAUDE_PLUGIN_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
61
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
62
|
+
python3 "$R/scripts/forge-session.py" stage-exit {stage-exit-args} --specs-dir "{specsDir}" --host claude
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Obey the DIRECTIVES it prints, in order, per the directive contract: `runInStageVerify: true` → dispatch the in-stage clean-room verify now (honoring `autoFixEligible`); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user; non-empty `invalidAutoVerifyKeys` → print a one-line warning. Then **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.**
|
|
66
|
+
<!-- END: scripted-stage-exit-stamp -->
|
|
67
|
+
|
|
68
|
+
## Directive contract
|
|
69
|
+
|
|
70
|
+
`stage-exit` emits a DIRECTIVES object and a NEXT-STEPS block. The skill executes the
|
|
71
|
+
directives **in this order**; the script has already computed every conditional, so a
|
|
72
|
+
directive is an instruction, not a question to re-derive.
|
|
73
|
+
|
|
74
|
+
### `invalidAutoVerifyKeys` (non-empty)
|
|
75
|
+
|
|
76
|
+
Print a one-line warning first (e.g. "⚠️ forge.config.json `autoVerifyStages` has
|
|
77
|
+
unknown keys: … — they are ignored; fix the typo").
|
|
78
|
+
|
|
79
|
+
### `runInStageVerify: true` — in-stage auto-verify {stageNoun}
|
|
80
|
+
|
|
81
|
+
Auto-verify is effective for this stage and verification is outstanding — verify **now,
|
|
82
|
+
in this session** (principle #2 applied to auto-verify: the digest and any fix decision
|
|
83
|
+
land here, where the authoring context still exists — not deferred to a post-`/clear`
|
|
84
|
+
navigator):
|
|
85
|
+
|
|
86
|
+
1. **Clean-room verify (require-clean).** Dispatch the clean-room `forge-verifier`
|
|
87
|
+
subagent from this session in require-clean mode — the same path the navigator uses
|
|
88
|
+
(`skills/forge-verify/SKILL.md`). Dispatch it **synchronously and await its digest
|
|
89
|
+
inline** — do **not** run it in the background or announce it as "still running";
|
|
90
|
+
the digest and any fix decision must land in this session. It inherits none of this
|
|
91
|
+
session's context, so no `/clear` is needed and only a compact digest returns.
|
|
92
|
+
**Clean-room unavailable** (no `Agent` tool, `forge-verifier` not dispatchable) **or
|
|
93
|
+
a non-answer returned** (the verifier returned a placeholder / "still running" /
|
|
94
|
+
delegation message instead of a findings block): do **not** run inline and do **not**
|
|
95
|
+
silently accept the non-answer as a pass — leave verify **pending** so the navigator
|
|
96
|
+
catch-up fires on a later Claude-host `/skill:forge`, print the
|
|
97
|
+
`verifyCommand` for the user to run, and continue to the NEXT-STEPS block.
|
|
98
|
+
2. **Verify passed / no findings** → the fresh verify state is recorded by the
|
|
99
|
+
clean-room run; continue to the NEXT-STEPS block.
|
|
100
|
+
3. **Verify found findings** →
|
|
101
|
+
- **`autoFixEligible: true` AND the findings document has zero unresolved decision
|
|
102
|
+
points** → chain `feature-forge:forge-fix` in-session (it owns its own commit +
|
|
103
|
+
step tracking), then run a **mandatory re-verify** in require-clean mode. Continue
|
|
104
|
+
to the NEXT-STEPS block only if the re-verify passes. On any precondition miss, a
|
|
105
|
+
forge-fix early stop, or a red re-verify, fall through to the digest gate below —
|
|
106
|
+
never a silent partial mutation. (`autoFixEligible` already folds in the config
|
|
107
|
+
`autoFix` flag and the clean-tree precondition; a dirty tree or
|
|
108
|
+
`gitCommitAfterStage: false` arrives here as `false`.)
|
|
109
|
+
- **`autoFixEligible: false`, or unresolved decision points** → surface a **compact
|
|
110
|
+
findings digest** as text, then present the gate via `AskUserQuestion`: **Run
|
|
111
|
+
`forge-fix` now** *(recommended — you are in-context and the digest is right
|
|
112
|
+
here)* / **Clear + advance anyway** (leave the findings for later) / **Stop
|
|
113
|
+
here**. Do **not** hard-stop and do **not** silently walk past. Act on the choice,
|
|
114
|
+
then continue to the NEXT-STEPS block.
|
|
115
|
+
|
|
116
|
+
### `verifyGate: "standard"` — the Standard Verify Gate
|
|
117
|
+
|
|
118
|
+
Auto-verify is off for this stage and verification is outstanding (`verifyState` is
|
|
119
|
+
`never`, `stale`, or `failing`). Verify **now, before clearing**, using
|
|
120
|
+
`AskUserQuestion` with exactly these three options — but only when the host has a
|
|
121
|
+
question mechanism **and** the clean-room path is available (the `Agent` tool plus a
|
|
122
|
+
dispatchable `forge-verifier` subagent); otherwise degrade exactly as `manual-print`
|
|
123
|
+
below:
|
|
124
|
+
|
|
125
|
+
- **Verify {stageNoun} now** *(recommended)* — dispatch the clean-room `forge-verifier`
|
|
126
|
+
subagent from this session in require-clean mode; the digest returns here so any fix
|
|
127
|
+
decision keeps its context. One-time — it does **not** change config.
|
|
128
|
+
- **Verify now + enable auto-verify going forward** — verify now **and** patch
|
|
129
|
+
`"autoVerify": true` into `forge.config.json` in place (preserve formatting and every
|
|
130
|
+
other key) so future stages verify automatically, no prompt. This complements the
|
|
131
|
+
`forge-init` opt-in. **Do not auto-commit this config change** — treat it like
|
|
132
|
+
`notes`: a user-facing edit the user commits on their own cadence, never folded into
|
|
133
|
+
a stage's artifact commit.
|
|
134
|
+
- **Skip for now** — go straight to the NEXT-STEPS block without verifying. Record this
|
|
135
|
+
stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip
|
|
136
|
+
handling) **only** on an explicit skip — a skip does not go stale.
|
|
137
|
+
|
|
138
|
+
If verify runs and finds findings, handle them exactly as in the in-stage flow above
|
|
139
|
+
(digest + `AskUserQuestion` gate; `autoFixEligible` applies unchanged).
|
|
140
|
+
|
|
141
|
+
### `verifyGate: "manual-print"`
|
|
142
|
+
|
|
143
|
+
Verification is outstanding but the host cannot present the gate or dispatch
|
|
144
|
+
clean-room. Do **not** run verify inline — print the `verifyCommand` for the user to
|
|
145
|
+
run (mirroring `autoInvokeNextStage`), offer the auto-verify enable as plain text only
|
|
146
|
+
if a config write is possible, and continue to the NEXT-STEPS block. Verify state stays
|
|
147
|
+
outstanding, so the navigator catch-up can fire later.
|
|
148
|
+
|
|
149
|
+
### `verifyGate: "none"`
|
|
150
|
+
|
|
151
|
+
Verification is already resolved (fresh or explicitly skipped) or the in-stage run
|
|
152
|
+
above covers it. Say so in one line and continue to the NEXT-STEPS block.
|
|
153
|
+
|
|
154
|
+
### `epicReconcile` (epic backflow — present only when there are open requests)
|
|
155
|
+
|
|
156
|
+
Emitted only when the exiting member carries `open` `epicChangeRequests` (recorded by
|
|
157
|
+
`forge-1-prd`/`forge-2-tech` when the epic *decomposition* itself must change — see
|
|
158
|
+
`references/pipeline-state-schema.json`). Absent on the common path and for standalone
|
|
159
|
+
features. The script has already folded the routing into the NEXT-STEPS block, so this
|
|
160
|
+
directive is informational — you do **not** re-derive the wording:
|
|
161
|
+
|
|
162
|
+
- `required: true` (at least one `blocksCurrent: true` request) — the NEXT-STEPS block's
|
|
163
|
+
fenced **primary** command is the epic reconcile command
|
|
164
|
+
(`/skill:forge-0-epic {epic}`), and the normal next stage is demoted to a
|
|
165
|
+
follow-up line ("After reconciling, continue with …"). This is *reconcile-before-specs*:
|
|
166
|
+
proceeding would author artifacts against a decomposition that is about to change. It is
|
|
167
|
+
strongest when exiting `forge-2-tech` (next is `forge-3-specs`, the point of no cheap
|
|
168
|
+
return).
|
|
169
|
+
- `reminder: true` (only `blocksCurrent: false` requests) — normal next-stage routing is
|
|
170
|
+
unchanged; the block appends a non-blocking reminder line ("You also flagged N epic
|
|
171
|
+
change(s) to reconcile when convenient …"). This is *finish-then-edit*.
|
|
172
|
+
|
|
173
|
+
Either way the added lines are host-neutral (no literal `/clear`) and sit **above** the
|
|
174
|
+
sentinel; just print the NEXT-STEPS block verbatim as always.
|
|
175
|
+
|
|
176
|
+
### Deferred decisions — do not solicit next-stage decisions at this exit
|
|
177
|
+
|
|
178
|
+
Each stage owns its own decisions. At a stage exit, do **not** pull a *later* stage's
|
|
179
|
+
decision forward — do not ask the user (or decide unilaterally) something that properly
|
|
180
|
+
belongs to the next stage's interview (e.g. at `forge-1-prd` exit, don't settle the
|
|
181
|
+
concrete cache backend that `forge-2-tech` will design). Soliciting it here guesses ahead
|
|
182
|
+
of the stage that owns the context, and the answer has nowhere durable to live.
|
|
183
|
+
|
|
184
|
+
Instead, when you notice a decision that belongs downstream, **record it structurally** as
|
|
185
|
+
a `deferredDecisions[]` entry on this feature's `.pipeline-state.json` (schema in
|
|
186
|
+
`references/pipeline-state-schema.json`; same direct-edit path as `notes` /
|
|
187
|
+
`epicChangeRequests[]`): `question` (phrased for the target stage), optional `rationale`
|
|
188
|
+
and `targetStage`, `raisedBy` (this stage), `raisedAt` (ISO-8601 UTC), `status: "open"`.
|
|
189
|
+
This keeps the exit focused on *this* stage's next-step routing while carrying the open
|
|
190
|
+
question forward for the owning stage to resolve (it flips `status` to `addressed` when it
|
|
191
|
+
does). Prefer a `deferredDecisions[]` entry over stuffing the same thing into the free-text
|
|
192
|
+
`notes` string. This is a recording affordance, not a gate: never block the exit on it.
|
|
193
|
+
|
|
194
|
+
### The NEXT-STEPS block (always last)
|
|
195
|
+
|
|
196
|
+
Print the script's NEXT-STEPS block **verbatim as your absolute last output**. Nothing
|
|
197
|
+
follows its final sentinel line (`─ forge: end of stage ─`) — no caveats, no summary,
|
|
198
|
+
no sign-off. The block already carries the `/clear` recommendation (host-aware wording
|
|
199
|
+
via `--host`) and the exact next command, so trailing prose can only push the user's
|
|
200
|
+
next action out of view.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Standard block
|
|
205
|
+
|
|
206
|
+
Stamped at the loop's step-6 epic-member handoff (finishing feature A → starting
|
|
207
|
+
feature B's PRD). It self-adapts: step 1's verify gate only fires when verification is
|
|
208
|
+
actually outstanding, so at a boundary where verify already ran (or was explicitly
|
|
209
|
+
skipped, or auto-verify is on) it silently collapses to just the `/clear` →
|
|
210
|
+
next-command steps.
|
|
211
|
+
|
|
212
|
+
Slots: `{stage}` (a lowercase noun phrase), `{verify-command}`, `{next-command}`.
|
|
213
|
+
|
|
214
|
+
<!-- BEGIN: standard-exit-block -->
|
|
215
|
+
**This stage is done — walk the user through the Stage Exit Protocol** before moving on. The order is fixed, and step 2 is something only the user can do:
|
|
216
|
+
|
|
217
|
+
1. **Verify {stage} first — if it isn't already verified.** If verify already ran in this session — via the in-stage auto-verify on the authoring stages, or the interactive impl-verify offered above on the loop — or is already fresh on record, or the stage was explicitly skipped, say so and go straight to step 2. Only when `autoVerify` is off for this stage **and** verify is **missing or stale** do you present the **Standard Verify Gate**: verify **now, before clearing**, using `AskUserQuestion` with exactly these three options — but only when the host has a question mechanism **and** the clean-room path is available (the `Agent` tool plus a dispatchable `forge-verifier` subagent):
|
|
218
|
+
- **Verify {stage} now** *(recommended)* — dispatch the clean-room `forge-verifier` subagent from this session in require-clean mode; the digest returns here so any fix decision keeps its context. One-time — it does **not** change config.
|
|
219
|
+
- **Verify now + enable auto-verify going forward** — verify now **and** patch `"autoVerify": true` into `forge.config.json` in place (preserve formatting and every other key) so future stages verify automatically, no prompt. This complements the `forge-init` opt-in. **Do not auto-commit this config change** — treat it like `notes`: a user-facing edit the user commits on their own cadence, never folded into a stage's artifact commit.
|
|
220
|
+
- **Skip for now** — go straight to `/clear` and the next command without verifying. Record this stage's verify status as `"skipped"` in pipeline state (mirroring the existing skip handling) **only** on an explicit skip — a skip does not go stale.
|
|
221
|
+
|
|
222
|
+
**Host / clean-room fallback (not a user-selectable option):** if the question mechanism, the `Agent` tool, or the `forge-verifier` subagent is unavailable, do **not** run clean-room — degrade to printing `{verify-command}` for the user to run inline/manually (mirroring `autoInvokeNextStage`), and offer the auto-verify enable as plain text only if a config write is possible.
|
|
223
|
+
2. **Then `/clear`.** Recommended **unconditionally** at this boundary for a clean start — independent of how full the context window is. Every artifact is on disk, so the work survives the clear. **I can't `/clear` for you — you have to run it yourself.**
|
|
224
|
+
3. **Then run the next command** in the fresh session — or re-run `/skill:forge` to let the navigator resume from disk:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
{next-command}
|
|
228
|
+
```
|
|
229
|
+
<!-- END: standard-exit-block -->
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Warm-acceptable variant
|
|
234
|
+
|
|
235
|
+
Stamp this only at the `forge-5-loop → forge-6-docs` boundary (the all-done result
|
|
236
|
+
report). Here clearing is **optional**: the docs stage benefits from the still-warm
|
|
237
|
+
context of what the loop actually did, and impl-verify is already offered interactively
|
|
238
|
+
by the loop itself, so this block defers rather than re-presenting a gate.
|
|
239
|
+
|
|
240
|
+
> **Note — no literal `/clear` here.** The warm block lives in `result-reporting.md`, a
|
|
241
|
+
> skill-*own* reference that the adapter build copies **verbatim** (unlike skill bodies,
|
|
242
|
+
> it is not host-term translated), so a literal `/clear` would reach non-Claude adapters
|
|
243
|
+
> undegraded. The warm variant says "clearing is optional" anyway, so it is phrased
|
|
244
|
+
> host-neutrally without the token on purpose — do not reintroduce `/clear` here. (The
|
|
245
|
+
> standard block *does* use `/clear`; that is fine because every standard stamp site is a
|
|
246
|
+
> skill **body**, where `scripts/build-adapters.py` degrades it.)
|
|
247
|
+
|
|
248
|
+
<!-- BEGIN: warm-exit-block -->
|
|
249
|
+
**The loop is complete — this is the one boundary where clearing before the next stage is optional.**
|
|
250
|
+
|
|
251
|
+
1. **Verify is already offered above.** Impl-verify is offered interactively right after this report (Step 5b for a standalone feature, Step 6.1 for an epic member) — run it there rather than as a second gate. It runs clean-room, so it needs no fresh session.
|
|
252
|
+
2. **Clearing is optional here — warm is fine.** `forge-6-docs` benefits from the still-warm context of what the loop actually did, so continuing in this same session is the easy default. A cold start also works — every artifact is on disk — but there is no need to force it.
|
|
253
|
+
3. **Then run the next command** — in this warm session, or a fresh one if you prefer:
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
{next-command}
|
|
257
|
+
```
|
|
258
|
+
<!-- END: warm-exit-block -->
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-0-epic/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-0-epic
|
|
4
|
+
description: 'Create or edit a forge epic: decompose a large change into discrete member features with dependencies, charters, and structured contracts, producing epic-manifest.json + EPIC.md. Re-run on an existing epic to enter edit mode (add/remove/reorder features, change dependencies). Use when the user runs /skill:forge-0-epic or explicitly asks to start/modify an epic. Do NOT trigger for single-feature PRD work (that is forge-1-prd) or for general project planning outside forge.'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# forge-0-epic — Epic Decomposition & Orchestration
|
|
8
|
+
|
|
9
|
+
Create an epic — a named grouping of related forge features with declared dependencies
|
|
10
|
+
and shared contracts — through a structured decomposition interview, OR edit an existing
|
|
11
|
+
epic. The manifest is the source of truth; EPIC.md mirrors it. All graph/validation work
|
|
12
|
+
is delegated to `scripts/epic-manifest.py`.
|
|
13
|
+
|
|
14
|
+
This skill **composes** JSON and **issues** helper commands. It NEVER eyeballs a dependency
|
|
15
|
+
graph for cycles, NEVER hand-rolls a manifest write where a mutator exists, and NEVER asks a
|
|
16
|
+
question in inline prose — every question goes through `AskUserQuestion`.
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
Read and follow `references/shared-conventions.md` for:
|
|
21
|
+
- the **Feature Name Requirement** (applied here to the *epic* name — see below),
|
|
22
|
+
- the **User Input Protocol** (the AskUserQuestion guardrail — all questions go through the tool),
|
|
23
|
+
- **Configuration Reading**, and
|
|
24
|
+
- the **Git Commit Protocol**.
|
|
25
|
+
|
|
26
|
+
**Epic name handling.** The single positional argument is the **epic** name (not a feature).
|
|
27
|
+
If no name is given, STOP and ask for one — do not guess. Convert multi-word input to a single
|
|
28
|
+
kebab-case token. The name must satisfy `SAFE_NAME_RE` (`^[a-z0-9]+(?:-[a-z0-9]+)*$`); the
|
|
29
|
+
helper rejects unsafe names. Member feature names are elicited later, in the interview.
|
|
30
|
+
|
|
31
|
+
**Force mode.** `--force` is honored as in shared-conventions: skip pipeline-state prerequisite
|
|
32
|
+
checks but still load any on-disk artifacts.
|
|
33
|
+
|
|
34
|
+
**Config values read** (defaults from shared-conventions): `specsDir` (default `./specs`),
|
|
35
|
+
`gitCommitAfterStage` (default true), `commitPrefix` (default `forge`).
|
|
36
|
+
|
|
37
|
+
**Helper invocation.** Every helper call uses the convention from 01 §2.2 — the absolute
|
|
38
|
+
plugin path and the configured specs dir:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
42
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
43
|
+
python3 "$R/scripts/epic-manifest.py" <subcommand> ... --specs-dir "{specsDir}"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`$R` resolves to the installed plugin root via the portable resolver (`scripts/forge-root.sh`,
|
|
47
|
+
bootstrapped by the prelude above; see `references/portable-root.md`). Pass `--specs-dir "{specsDir}"`
|
|
48
|
+
on every invocation.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Step 0 — Dispatch Detection
|
|
53
|
+
|
|
54
|
+
Resolve the epic subtree path `{specsDir}/{epic}/` and decide which branch to run.
|
|
55
|
+
|
|
56
|
+
1. **Collision check — is this name already a standalone feature?** If `{specsDir}/{epic}/`
|
|
57
|
+
exists and directly contains a `.pipeline-state.json` of its own (i.e. it is itself a
|
|
58
|
+
*feature* directory, not an epic root), STOP. Surface verbatim:
|
|
59
|
+
> `{epic}` is already a standalone feature, not an epic. Choose a different epic name or
|
|
60
|
+
> relocate the feature.
|
|
61
|
+
|
|
62
|
+
2. **Manifest existence probe** — does this epic already have a manifest?
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
test -f "{specsDir}/{epic}/epic-manifest.json" && echo EXISTS || echo NEW
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- **NEW** (no `epic-manifest.json`) → **Creation branch** (Step C1 onward).
|
|
69
|
+
- **EXISTS** → **Edit branch** (§ Edit Mode below).
|
|
70
|
+
|
|
71
|
+
This manifest-existence dispatch **is** forge-0-epic's stage-entry guard: a re-entry on an existing epic lands in Edit Mode (helper-mutated, re-validated) rather than re-running the creation interview, so the **Stage-Entry Guard** block used by `forge-1-prd`..`forge-4-backlog` does not apply here (an epic has no self `.pipeline-state.json` to stamp — it writes member states).
|
|
72
|
+
|
|
73
|
+
3. **Pre-flight epic-name uniqueness (creation only).** Before composing anything for a NEW
|
|
74
|
+
epic, confirm the epic name itself does not collide with any existing feature or epic:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
78
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
79
|
+
python3 "$R/scripts/epic-manifest.py" check-name "{epic}" --specs-dir "{specsDir}"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Exit `0` → the name is free; proceed to C1.
|
|
83
|
+
- Exit `1` (`duplicate-name`) → STOP and surface the helper's finding **verbatim**; ask
|
|
84
|
+
for a different epic name, then re-run check-name.
|
|
85
|
+
- Exit `2` (unsafe name) → STOP and surface the finding; ask for a corrected name.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Creation Branch
|
|
90
|
+
|
|
91
|
+
### Step 1 — Branch Setup
|
|
92
|
+
|
|
93
|
+
Invoke the **Branch Setup** block in `references/shared-conventions.md` with `{label}` = `{epic}` and
|
|
94
|
+
`{scope}` = `epic`. It self-gates (skips when not a git repo or when `branchPerFeature` is false),
|
|
95
|
+
detects whether you're on the default branch, and strongly recommends — still optionally — creating
|
|
96
|
+
`{branchPrefix}{epic}` when you are. Each member feature's `forge-1-prd` inherits this branch rather
|
|
97
|
+
than prompting again.
|
|
98
|
+
|
|
99
|
+
### Step C1 — Epic Framing Interview
|
|
100
|
+
|
|
101
|
+
Output context as text (what an epic is, that a decomposition interview will follow). Then
|
|
102
|
+
call `AskUserQuestion` to elicit:
|
|
103
|
+
|
|
104
|
+
1. **Epic goal / problem** — the overarching change being decomposed. Becomes the EPIC.md
|
|
105
|
+
"Overall Goal" narrative and seeds the manifest `description`.
|
|
106
|
+
2. **One-paragraph description** — a confirmed/edited summary. Becomes the manifest `description`.
|
|
107
|
+
|
|
108
|
+
The epic `name` is the validated CLI argument from Step 0 — do NOT prompt for it again.
|
|
109
|
+
|
|
110
|
+
### Step C2 — Feature-List Interview
|
|
111
|
+
|
|
112
|
+
Drive a decomposition dialogue. Output your analysis as text first (how the goal might split,
|
|
113
|
+
right-sizing guidance: each feature should be a single pipeline-sized unit — a unit forge-1-prd
|
|
114
|
+
through forge-5-loop would carry end-to-end — not item-level interleaving). Then use
|
|
115
|
+
`AskUserQuestion` to elicit the candidate feature list. Per the **Decision Support** protocol in `references/shared-conventions.md`, lead with a **recommended decomposition** and a one-line rationale rather than asking the user to invent it unaided, then probe its seams ("Is any of these two really one? Is any one really two?"), naming the trade-off (more features = more parallelism but more edges). Iterate until the user confirms.
|
|
116
|
+
|
|
117
|
+
For **each** proposed feature name, before accepting it into the set, enforce global uniqueness
|
|
118
|
+
and name safety via the helper:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
122
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
123
|
+
python3 "$R/scripts/epic-manifest.py" check-name "{feature}" --specs-dir "{specsDir}"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- Exit `0` → accept the name.
|
|
127
|
+
- Exit `1` (`duplicate-name`) → reject that name; surface the finding verbatim and re-prompt
|
|
128
|
+
for a different name.
|
|
129
|
+
- Exit `2` (`unsafe-name`) → reject; surface the finding and re-prompt.
|
|
130
|
+
|
|
131
|
+
Never accept a feature name that has not passed `check-name` exit 0.
|
|
132
|
+
|
|
133
|
+
### Step C3 — Per-Feature Charter + Structured Contracts
|
|
134
|
+
|
|
135
|
+
For each confirmed feature, run a focused `AskUserQuestion` batch (one feature at a time,
|
|
136
|
+
2–3 questions per call) eliciting:
|
|
137
|
+
|
|
138
|
+
- **Charter** — a single paragraph: scope statement + contract obligations. This is a
|
|
139
|
+
**charter only, NOT a PRD**. Do NOT conduct a full requirements interview here. If the user
|
|
140
|
+
starts dictating detailed requirements, redirect (as context text, then continue the batch):
|
|
141
|
+
> "That's PRD-level detail — `forge-1-prd` will capture it when this feature is ready. For
|
|
142
|
+
> the charter I just need the one-paragraph scope and what it must expose/consume."
|
|
143
|
+
- **`exposes`** — zero or more structured `Contract` objects this feature provides to
|
|
144
|
+
dependents. Each is `{ "name", "kind", "summary" }` where `kind` ∈
|
|
145
|
+
`function | type | endpoint | module | event`.
|
|
146
|
+
- **`consumes`** — zero or more structured `ConsumedContract` objects this feature relies on.
|
|
147
|
+
Each is `{ "from", "name", "summary" }`, where `from` is a sibling feature name in this epic.
|
|
148
|
+
|
|
149
|
+
Collect these into plain JSON objects per feature. Do NOT free-form the contracts in prose —
|
|
150
|
+
the structured arrays are the source of truth; EPIC.md renders them as prose later (Step C6).
|
|
151
|
+
|
|
152
|
+
### Step C4 — Dependency-Edge Interview
|
|
153
|
+
|
|
154
|
+
For each feature, use `AskUserQuestion`: "Which sibling features must be complete before this
|
|
155
|
+
one can build?" → populates `dependsOn: [names]`.
|
|
156
|
+
|
|
157
|
+
**Seed the suggestion from `consumes`:** a `consumes.from` X strongly implies `dependsOn` X. Per the **Decision Support** protocol, offer the union of each feature's `consumes.from` set as the **recommended default**, evidence-backed — but flag the cost (each edge serializes the loop and blocks dependents, so add only what contracts require). User confirms/overrides; `dependsOn` is authoritative.
|
|
158
|
+
|
|
159
|
+
The `features[]` array order is the user-declared sequence from C2 (order is a presentation
|
|
160
|
+
sequence, **not** a dependency ordering). Preserve the C2 order unless the user asks to reorder.
|
|
161
|
+
|
|
162
|
+
### Step C5 — Compose & Validate the Manifest
|
|
163
|
+
|
|
164
|
+
Compose the full `epic-manifest.json` per the 00 §2 schema, setting:
|
|
165
|
+
|
|
166
|
+
- `schemaVersion`: `1`
|
|
167
|
+
- `epic`: `"{epic}"`
|
|
168
|
+
- `description`: from C1
|
|
169
|
+
- `status`: `"active"`
|
|
170
|
+
- `narrativeDoc`: `"EPIC.md"`
|
|
171
|
+
- `createdAt` and `updatedAt`: the **same** current ISO-8601 UTC timestamp (`createdAt == updatedAt`)
|
|
172
|
+
- `features[]`: in declared order, each with `name`, `charter`, `dependsOn`, `exposes`,
|
|
173
|
+
`consumes`. **No per-feature `status` field** — including one makes the manifest fail
|
|
174
|
+
validation (the `cached-status` finding).
|
|
175
|
+
|
|
176
|
+
Write the composed JSON to `{specsDir}/{epic}/epic-manifest.json` (creating the epic dir first).
|
|
177
|
+
For the *initial* creation write the skill writes the file directly — atomic guarantees are only
|
|
178
|
+
required for in-place mutation, which is the helper mutators' job. Creating the epic dir first creates `{specsDir}/`, so after writing the manifest invoke the **Specs Directory Hygiene** block in `references/shared-conventions.md` (idempotent; stage anything it writes with this stage's commit). Then validate:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
182
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
183
|
+
python3 "$R/scripts/epic-manifest.py" validate "{epic}" --specs-dir "{specsDir}" --json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
- Exit `0` → proceed to C6.
|
|
187
|
+
- Exit `1` → the manifest is malformed. Surface **every** `findings[]` entry **verbatim**, do
|
|
188
|
+
NOT proceed, and loop back into the relevant interview step to correct, then re-compose and
|
|
189
|
+
re-validate:
|
|
190
|
+
- `cycle` → re-open the dependency interview (C4).
|
|
191
|
+
- `dangling-ref` → re-open C4 (bad `dependsOn`) or C3 (bad `consumes.from`).
|
|
192
|
+
- `duplicate-name` / `unsafe-name` → re-open the feature-list interview (C2).
|
|
193
|
+
- `cached-status` / schema violation → fix the composed JSON and re-validate.
|
|
194
|
+
- Exit `2` → IO/usage error (missing manifest or unreadable). Surface and STOP.
|
|
195
|
+
|
|
196
|
+
Acyclicity, uniqueness, and dangling-ref checks are thus ALWAYS performed by the helper, never
|
|
197
|
+
by the LLM eyeballing the graph.
|
|
198
|
+
|
|
199
|
+
> **Contracts have no mutator.** There is intentionally no `--exposes-json`/`--consumes-json`
|
|
200
|
+
> flag. At creation, the skill populates each feature's `exposes`/`consumes` directly in the
|
|
201
|
+
> composed manifest entry (above), then re-runs `validate` — exactly as described here. The
|
|
202
|
+
> same pattern applies after an edit-mode `add-feature` (see Edit Mode).
|
|
203
|
+
|
|
204
|
+
### Step C6 — Generate EPIC.md
|
|
205
|
+
|
|
206
|
+
Generate `{specsDir}/{epic}/EPIC.md` from the **validated** manifest. It is the human-readable
|
|
207
|
+
**mirror** of the manifest (the manifest is the source of truth). For the full EPIC.md structure
|
|
208
|
+
skeleton, read `references/edit-mode.md` (EPIC.md Mirror Template section) — the same template the
|
|
209
|
+
edit-mode E5 patch applies.
|
|
210
|
+
|
|
211
|
+
**The mirror rule.** Render each feature's `exposes`/`consumes` arrays as prose, one bullet per
|
|
212
|
+
contract entry, preserving `name`, `kind`/`from`, and `summary`. Do not invent a contract that
|
|
213
|
+
is not in the manifest, and do not omit one that is. The Overall Goal and Decomposition
|
|
214
|
+
Rationale are the only prose without a 1:1 manifest counterpart. The skill does NOT itself diff
|
|
215
|
+
EPIC.md against the manifest — drift detection is `forge-verify` epic mode CHECK-E06.
|
|
216
|
+
|
|
217
|
+
### Step C7 — Create Member Subdirectories + Back-Pointer States
|
|
218
|
+
|
|
219
|
+
After the manifest validates and EPIC.md is written, create one subdirectory per member feature
|
|
220
|
+
so the navigator and resolver can see them before any stage runs. For each `features[].name`:
|
|
221
|
+
|
|
222
|
+
1. Create `{specsDir}/{epic}/{feature}/`.
|
|
223
|
+
2. Write `{specsDir}/{epic}/{feature}/.pipeline-state.json` conforming to
|
|
224
|
+
`references/pipeline-state-schema.json`, carrying:
|
|
225
|
+
- `epic`: `"{epic}"` — the back-pointer.
|
|
226
|
+
- `currentStage`: `"forge-1-prd"` — the next actionable stage for the member.
|
|
227
|
+
- `stages["forge-0-epic"]`: `{ "status": "complete", "version": 1, "completedAt": "<ts>" }`
|
|
228
|
+
— recording that the epic stage seeded this member.
|
|
229
|
+
- No other stages (all other stages absent/pending), exactly as a freshly-initialized
|
|
230
|
+
standalone feature. **No per-feature `status` beyond the stage entry** — the member state
|
|
231
|
+
holds derived stage progress only.
|
|
232
|
+
|
|
233
|
+
For an example member state, read `references/edit-mode.md` (Member State Example section).
|
|
234
|
+
|
|
235
|
+
The member subtree holds the **same** artifact set a standalone feature holds; only
|
|
236
|
+
`.pipeline-state.json` exists at creation. No PRD/specs are authored here. The epic subtree is
|
|
237
|
+
now self-contained: manifest + EPIC.md + one subdirectory per member.
|
|
238
|
+
|
|
239
|
+
### Step C8 — Review, Pipeline State & Commit
|
|
240
|
+
|
|
241
|
+
1. **Review.** Present a summary (epic name, N features, dependency edges, contracts) as text, then use `AskUserQuestion`: "Does this epic decomposition look right? Any feature, dependency, or contract to change before I commit?" If the user wants changes, loop back to the relevant creation step, re-compose, and re-validate.
|
|
242
|
+
|
|
243
|
+
2. **Commit (Git Commit Protocol).** If `gitCommitAfterStage` is true, follow the Git Commit Protocol in shared-conventions:
|
|
244
|
+
- Stage the whole epic subtree only: `git add {specsDir}/{epic}/` — never `git add -A`. This captures `epic-manifest.json`, `EPIC.md`, and all member `.pipeline-state.json` files atomically.
|
|
245
|
+
- Commit with message `"{commitPrefix}({epic}): create epic with {N} features"`.
|
|
246
|
+
- On success, capture the commit hash for the closing message only — the epic manifest has no `commitHash` field, so nothing is written back into a committed file and the two-commit step of the Git Commit Protocol does not apply here. On failure (pre-commit hook, conflict), report and do not mark complete; never use `--amend`/`--no-verify`/`--force`.
|
|
247
|
+
|
|
248
|
+
3. **Closing message — the Stage Exit Protocol.** Congratulate the user ("Epic `{epic}` created with {N} features."), then close with the Stage Exit Protocol below (single-sourced in `references/stage-exit-protocol.md`; the epic → first-PRD boundary is a full stage boundary — do not improvise a "Next steps" list). `{first-actionable-feature}` = any feature with empty `dependsOn` (or the first entry of `render-status`'s `actionable` set):
|
|
249
|
+
|
|
250
|
+
**Close this stage with the Scripted Stage Exit** (contract: `references/stage-exit-protocol.md`; do not improvise a "Next steps" list). Run:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
R="$(bash -c 'for d in "${FEATURE_FORGE_ROOT:-}" "$HOME"/.claude/skills/feature-forge "$HOME"/.claude/plugins/cache/*/feature-forge/* "$HOME"/.claude/plugins/*/feature-forge "$HOME"/.agents/skills/feature-forge ./.agents/skills/feature-forge; do [ -x "$d/scripts/forge-root.sh" ] && exec "$d/scripts/forge-root.sh"; done')"
|
|
254
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
255
|
+
python3 "$R/scripts/forge-session.py" stage-exit --feature "{epic}" --stage forge-0-epic --next-feature "{first-actionable-feature}" --specs-dir "{specsDir}" --host pi
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Obey the DIRECTIVES it prints, in order, per the directive contract: `runInStageVerify: true` → dispatch the in-stage clean-room verify now (honoring `autoFixEligible`); `verifyGate: "standard"` → present the Standard Verify Gate; `verifyGate: "manual-print"` → print the `verifyCommand` for the user; non-empty `invalidAutoVerifyKeys` → print a one-line warning. Then **print the NEXT-STEPS block verbatim as your absolute last output — nothing after its sentinel line.**
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Edit Mode
|
|
263
|
+
|
|
264
|
+
Entered from Step 0 when `{specsDir}/{epic}/epic-manifest.json` already exists (the **EXISTS**
|
|
265
|
+
branch). The edit branch mutates the manifest **only** through helper mutators — atomic
|
|
266
|
+
(temp file + `os.replace`) and internally re-validated, so a refused write leaves the manifest
|
|
267
|
+
**byte-identical**; the skill never hand-rolls an in-place write. Every question goes through
|
|
268
|
+
`AskUserQuestion`, and **every mutation is committed individually** so git history is the audit trail.
|
|
269
|
+
|
|
270
|
+
For the full E1–E6 mechanics — the E1 refuse-if-invalid protocol, E2 operation→mutator table, E3
|
|
271
|
+
contracts/remove-feature caveats (incl. the verbatim WARN block), E4 impact-warning rules, E5
|
|
272
|
+
EPIC.md patch rule, and the E6 Observability / Pipeline State & Commit machinery
|
|
273
|
+
(`.epic-state.json` schema, `updatedAt` rules, Git Commit Protocol shared with C8) — read
|
|
274
|
+
`references/edit-mode.md`. For the exact `epic-manifest.py` mutator flag surface and
|
|
275
|
+
per-subcommand exit-code (`0`/`1`/`2`) handling, read `references/epic-manifest-subcommands.md`.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Error Handling
|
|
280
|
+
|
|
281
|
+
The skill **never** repairs a corrupt manifest automatically and **never** proceeds past a gating
|
|
282
|
+
helper exit `≥ 1`. All findings are surfaced **verbatim**. For the full condition → helper-signal →
|
|
283
|
+
skill-behavior disposition table, read `references/epic-manifest-subcommands.md` (Error Handling
|
|
284
|
+
section).
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Gotchas
|
|
289
|
+
|
|
290
|
+
- The argument names an **epic**, not a feature — this is the only stage where that is true.
|
|
291
|
+
Member feature names come from the C2 interview, each gated through `check-name`.
|
|
292
|
+
- Never eyeball the dependency graph for cycles. Compose the manifest, run `validate`, and
|
|
293
|
+
surface findings. The helper owns acyclicity, uniqueness, dangling-ref, and schema checks.
|
|
294
|
+
- A charter is one paragraph, not a PRD. Redirect requirement-level detail to `forge-1-prd`.
|
|
295
|
+
- Contracts have no mutator: edit `exposes`/`consumes` in the composed manifest entry, then
|
|
296
|
+
re-run `validate`.
|
|
297
|
+
- All questions go through `AskUserQuestion`. Never put a question in your text output.
|
|
298
|
+
|
|
299
|
+
---
|
|
300
|
+
|
|
301
|
+
## Host execution notes (Pi)
|
|
302
|
+
|
|
303
|
+
This Pi bundle preserves Claude's `AskUserQuestion` references because it ships a Pi compatibility extension registering an `AskUserQuestion` tool. On Pi:
|
|
304
|
+
|
|
305
|
+
- **User input:** use `AskUserQuestion` for genuine user decisions. It supports multiple questions, option descriptions, recommended ordering, multi-select, previews, and free-form Other/custom answers.
|
|
306
|
+
- **Skill dispatch:** Pi uses `/skill:<name>` commands. If you cannot invoke a skill directly, print the exact `/skill:<name> ...` command for the user to run.
|
|
307
|
+
- **Subagents:** this bundle declares its custom agents (`forge-researcher`, `forge-spec-writer`, `forge-verifier`) as package agents. If a `subagent` tool is registered, dispatch one with `{ agent: "forge-verifier", task: "..." }`, or fan several out concurrently with `{ tasks: [{ agent: "forge-spec-writer", task: "..." }, ...] }`. If no `subagent` tool is available, run that step inline yourself.
|
|
308
|
+
- **Background / monitoring:** run long-lived commands in the foreground and report progress as it arrives.
|