@garygentry/feature-forge 0.2.14 → 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/forge-config-schema.json +2 -2
- package/adapters/claude/scripts/forge-root.sh +47 -3
- package/adapters/claude/scripts/forge-session.py +30 -8
- package/adapters/claude/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/claude/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/claude/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/codex/.feature-forge-bundle.json +1 -1
- package/adapters/codex/references/forge-config-schema.json +2 -2
- package/adapters/codex/scripts/forge-root.sh +47 -3
- package/adapters/codex/scripts/forge-session.py +30 -8
- package/adapters/codex/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/codex/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/codex/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/copilot/.feature-forge-bundle.json +1 -1
- package/adapters/copilot/references/forge-config-schema.json +2 -2
- package/adapters/copilot/scripts/forge-root.sh +47 -3
- package/adapters/copilot/scripts/forge-session.py +30 -8
- package/adapters/copilot/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/copilot/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/copilot/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/cursor/.feature-forge-bundle.json +1 -1
- package/adapters/cursor/references/forge-config-schema.json +2 -2
- package/adapters/cursor/scripts/forge-root.sh +47 -3
- package/adapters/cursor/scripts/forge-session.py +30 -8
- package/adapters/cursor/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/cursor/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/cursor/skills/forge-guide/references/forge-config-schema.json +2 -2
- package/adapters/gemini/.feature-forge-bundle.json +1 -1
- package/adapters/gemini/gemini-extension.json +1 -1
- package/adapters/gemini/references/forge-config-schema.json +2 -2
- package/adapters/gemini/scripts/forge-root.sh +47 -3
- package/adapters/gemini/scripts/forge-session.py +30 -8
- package/adapters/gemini/skills/forge-4-backlog/references/forge-config-schema.json +2 -2
- package/adapters/gemini/skills/forge-5-loop/references/forge-config-schema.json +2 -2
- package/adapters/gemini/skills/forge-guide/references/forge-config-schema.json +2 -2
- 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,134 @@
|
|
|
1
|
+
# TypeScript Stack Profile
|
|
2
|
+
|
|
3
|
+
Stack-specific guidance for TypeScript projects (Node.js/Bun, monorepo or single-package).
|
|
4
|
+
|
|
5
|
+
## Stack Identity
|
|
6
|
+
|
|
7
|
+
- **Language**: TypeScript
|
|
8
|
+
- **Runtime**: Node.js or Bun (check `package.json` `engines` field and lock files)
|
|
9
|
+
- **Package management**: npm, pnpm, yarn, or bun (check for respective lock files)
|
|
10
|
+
- **Common monorepo tools**: Turborepo (`turbo.json`), Nx (`nx.json`), Lerna (`lerna.json`)
|
|
11
|
+
|
|
12
|
+
## Discovery Checklist
|
|
13
|
+
|
|
14
|
+
When examining a TypeScript project, check for:
|
|
15
|
+
|
|
16
|
+
- **Runtime**: Bun or Node.js (check `package.json` for which)
|
|
17
|
+
- **Package management**: Check for `bun.lockb`, `pnpm-lock.yaml`, `package-lock.json`, or `yarn.lock`
|
|
18
|
+
- **Monorepo**: Check for `turbo.json` (Turborepo), `nx.json` (Nx), or `lerna.json` (Lerna)
|
|
19
|
+
- **Framework**: Check existing packages for Hono, Express, Fastify, etc.
|
|
20
|
+
- **Frontend**: Check for React, Vue, Svelte, etc.
|
|
21
|
+
- **Routing**: Check for TanStack Router, React Router, Next.js, etc.
|
|
22
|
+
- **Database**: Check for Drizzle, Prisma, TypeORM, etc.
|
|
23
|
+
- **Validation**: Check for Zod, Yup, io-ts, etc.
|
|
24
|
+
- **UI Components**: Check for shadcn/ui, Radix, MUI, etc.
|
|
25
|
+
- **Styling**: Check for Tailwind (v3 or v4), CSS Modules, styled-components, etc.
|
|
26
|
+
|
|
27
|
+
## Archetype Conventions
|
|
28
|
+
|
|
29
|
+
### 00-core-definitions.md (TypeScript)
|
|
30
|
+
|
|
31
|
+
- **Type aliases and union types**: Use `type` declarations for unions, intersections, utility types
|
|
32
|
+
- **Core interfaces**: Define with `interface` keyword, JSDoc on every field
|
|
33
|
+
- **Error class hierarchy**: Base error class extending `Error` with `code: string` property; domain-specific subclasses with typed properties
|
|
34
|
+
- **Constants and enums**: Use `const` declarations and `as const` assertions; prefer string union types over `enum`
|
|
35
|
+
- **Utility types**: Generic helpers like `Result<T, E>`, `Optional<T>`, etc.
|
|
36
|
+
- **Barrel exports**: Export everything from `src/index.ts`
|
|
37
|
+
|
|
38
|
+
### 01-architecture-layout.md (TypeScript)
|
|
39
|
+
|
|
40
|
+
- **Package.json**: `name`, `exports` map (subpath exports like `.`, `./server`, `./client`, `./react`), `dependencies`, `devDependencies`, `scripts`
|
|
41
|
+
- **tsconfig.json**: Key compiler options, extends root config
|
|
42
|
+
- **Barrel export structure**: What each `index.ts` re-exports
|
|
43
|
+
- **Build considerations**: Bundle vs unbundled, ESM vs CJS
|
|
44
|
+
|
|
45
|
+
### Monorepo conventions
|
|
46
|
+
|
|
47
|
+
- **Package naming**: `@repo/{name}` for shared packages, `@starter/{name}` for app-specific (adapt to project convention)
|
|
48
|
+
- **Internal dependencies**: Reference as `@repo/{package}` in `package.json`
|
|
49
|
+
- **Workspace protocol**: `"@repo/config": "workspace:*"` in pnpm, `"@repo/config": "*"` in bun
|
|
50
|
+
|
|
51
|
+
## Spec Quality Rules
|
|
52
|
+
|
|
53
|
+
- All TypeScript must be valid syntax — not pseudocode
|
|
54
|
+
- Include complete interfaces with generics where applicable
|
|
55
|
+
- Use discriminated unions for result types (e.g., `{ success: true; data: T } | { success: false; error: E }`)
|
|
56
|
+
- Every interface field must have JSDoc explaining its purpose
|
|
57
|
+
- Include explicit import paths in all code examples
|
|
58
|
+
- Use `async/await` for asynchronous operations (not raw Promises)
|
|
59
|
+
|
|
60
|
+
## Verification Specifics
|
|
61
|
+
|
|
62
|
+
- **Type checking**: `bun run typecheck`, `tsc --noEmit`, or `npx tsc --noEmit`
|
|
63
|
+
- **Barrel export validation**: Every `index.ts` re-exports what the spec says
|
|
64
|
+
- **Cross-package type checks**: `bun run typecheck` (or equivalent) passes for both the feature package AND packages that depend on it
|
|
65
|
+
- **Import path validation**: All import paths resolve correctly per the `exports` map in `package.json`
|
|
66
|
+
|
|
67
|
+
### Runtime Entrypoints & Bootstrap-Wiring Sites
|
|
68
|
+
|
|
69
|
+
Used by `CHECK-I22` (a runtime-required bootstrap needs a **non-test** caller on one of these) and
|
|
70
|
+
`CHECK-I23` (a heavy init wired into a **universal** bootstrap entry should move to a lazier site).
|
|
71
|
+
|
|
72
|
+
- **Runtime entrypoints (a legitimate non-test call site):** a `package.json` `bin` / CLI `main`; a
|
|
73
|
+
server entry that actually starts listening (`src/server.ts`, `src/index.ts` invoking `listen`); a
|
|
74
|
+
worker/consumer file; and for Next.js — `middleware.ts`, `app/**/route.ts` route handlers,
|
|
75
|
+
`app/**/{page,layout,template}.tsx`, server actions, and `instrumentation.ts`. Express/Hono/Fastify:
|
|
76
|
+
the file that constructs the app and calls `.listen()`.
|
|
77
|
+
- **Universal bootstrap entries (run on every startup — the `CHECK-I23` risk site):** Next.js
|
|
78
|
+
`instrumentation.ts` / `instrumentation.js` (its `register()` runs once per server process before
|
|
79
|
+
any request), an app-server preload/`register`/`--import` hook, a root `app/layout.tsx` that
|
|
80
|
+
eagerly imports server singletons, and global test setup (`vitest.setup.ts`, `jest.setup.ts`) if it
|
|
81
|
+
bootstraps production graphs. Wiring a heavy init here loads it on **every** cold start (and, under
|
|
82
|
+
the dev server, on every module re-evaluation).
|
|
83
|
+
- **Heavy server-only import markers (what makes an init "heavy" for `CHECK-I23`):** DB/ORM clients
|
|
84
|
+
(`drizzle-orm`, `@prisma/client`, `pg`, `mongoose`, `kysely`), queue/worker libs (`bullmq`, `bull`,
|
|
85
|
+
`kafkajs`, `ioredis`), telemetry/observability SDKs (`@opentelemetry/*`, `@sentry/node`), and a
|
|
86
|
+
whole-service-layer barrel (`import * as services from "@repo/services"`). An init that pulls any of
|
|
87
|
+
these into a universal bootstrap entry is the CHECK-I23 pattern — recommend lazy init at the first
|
|
88
|
+
route/handler/worker that needs it.
|
|
89
|
+
|
|
90
|
+
## Testing
|
|
91
|
+
|
|
92
|
+
- **Framework**: Vitest (most common in modern TS), Jest, or testing-library
|
|
93
|
+
- **Test file location**: Co-located (`*.test.ts` next to source) or in `__tests__/` directories
|
|
94
|
+
- **Fixture patterns**: Factory functions, test builders
|
|
95
|
+
- **Type testing**: `expectTypeOf` from vitest for type-level assertions
|
|
96
|
+
|
|
97
|
+
## Common Frameworks
|
|
98
|
+
|
|
99
|
+
| Category | Options |
|
|
100
|
+
|----------|---------|
|
|
101
|
+
| Backend | Hono, Express, Fastify, Koa |
|
|
102
|
+
| Frontend | React, Vue, Svelte, Solid |
|
|
103
|
+
| Routing | TanStack Router, React Router, Next.js App Router |
|
|
104
|
+
| Database | Drizzle, Prisma, TypeORM, Kysely |
|
|
105
|
+
| Validation | Zod, Valibot, Yup, io-ts |
|
|
106
|
+
| UI Components | shadcn/ui, Radix, MUI, Mantine |
|
|
107
|
+
| Styling | Tailwind CSS, CSS Modules, styled-components, vanilla-extract |
|
|
108
|
+
|
|
109
|
+
## Example: Project-Level Override
|
|
110
|
+
|
|
111
|
+
Create `.feature-forge/stack-decisions.md` (legacy alias: `.claude/references/stack-decisions.md`) in your project root:
|
|
112
|
+
|
|
113
|
+
```markdown
|
|
114
|
+
# Stack Decisions
|
|
115
|
+
|
|
116
|
+
## Runtime & Build
|
|
117
|
+
- Bun 1.x for runtime and package management
|
|
118
|
+
- Turborepo for monorepo orchestration
|
|
119
|
+
|
|
120
|
+
## Backend
|
|
121
|
+
- Hono for HTTP framework
|
|
122
|
+
- Drizzle ORM with PostgreSQL
|
|
123
|
+
- Zod for runtime validation
|
|
124
|
+
|
|
125
|
+
## Frontend
|
|
126
|
+
- React 19 with TanStack Router (SPA-first)
|
|
127
|
+
- shadcn/ui component library
|
|
128
|
+
- Tailwind CSS v4 with oklch color theming
|
|
129
|
+
|
|
130
|
+
## Conventions
|
|
131
|
+
- Barrel exports from index.ts in every package
|
|
132
|
+
- Package naming: @repo/{name} for shared, @starter/{name} for app-specific
|
|
133
|
+
- Vitest for testing
|
|
134
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-init/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-init
|
|
4
|
+
description: Initialize feature-forge configuration in the current project. Use when user runs /skill:forge-init or asks to set up forge for the first time. Creates forge.config.json with defaults. Do NOT trigger for general project initialization or setup tasks outside the forge pipeline.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Initialize Feature Forge
|
|
8
|
+
|
|
9
|
+
Run the initialization script to create `forge.config.json` with default settings:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
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')"
|
|
13
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
14
|
+
bash "$R/scripts/forge-init.sh"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
After initialization, the config file will contain defaults for:
|
|
18
|
+
- `specsDir`: `./specs`
|
|
19
|
+
- `docsDir`: `./docs/architecture`
|
|
20
|
+
- `backlogDir`: `null` (backlog lives alongside specs)
|
|
21
|
+
- `gitCommitAfterStage`: `true`
|
|
22
|
+
- `commitPrefix`: `forge`
|
|
23
|
+
- `stack`: `null` (detected during `/skill:forge-2-tech`)
|
|
24
|
+
- `typeCheckCommand`: `null` (set during `/skill:forge-2-tech`)
|
|
25
|
+
- `testCommand`: `null` (set during `/skill:forge-2-tech`)
|
|
26
|
+
- `smokeCommand`: `null` (optional end-to-end smoke that boots the wired app and drives one request; set it to enable impl-verify's runnability check `CHECK-I21` — distinct from `testCommand`)
|
|
27
|
+
- `autoInvokeNextStage`: `true` (the navigator auto-starts the next stage after you confirm; set `false` to only print the command)
|
|
28
|
+
- `contextWindowTokens`: `null` (the navigator infers the context window; set to your model's window, e.g. `1000000` for a 1M-context model, for accurate context-usage advice)
|
|
29
|
+
- `contextWarnThreshold`: `0.7` (fraction of the window past which the navigator suggests a clean session)
|
|
30
|
+
- `autoVerify`: `false` (set `true` to run `forge-verify` automatically after each authoring stage completes — in-stage, in the same session, before the exit block; it costs an extra clean-room verify per stage, so it trades a little time/tokens for catching errors early)
|
|
31
|
+
- `autoVerifyStages`: `{}` (per-stage overrides for `autoVerify`)
|
|
32
|
+
- `autoFix`: `false` (set `true` to chain `forge-fix` after an auto-verify finds issues)
|
|
33
|
+
|
|
34
|
+
If `forge.config.json` already exists, the script will not overwrite it.
|
|
35
|
+
|
|
36
|
+
## Offer auto-verify
|
|
37
|
+
|
|
38
|
+
The template writes `autoVerify: false`. After the config is created (and only when the script
|
|
39
|
+
actually created it — skip this if it reported the file already exists), offer to turn
|
|
40
|
+
auto-verify on, then write the choice back into `forge.config.json`.
|
|
41
|
+
|
|
42
|
+
If the `AskUserQuestion` tool is available, ask exactly one question:
|
|
43
|
+
|
|
44
|
+
> **Enable auto-verify?** Verification runs in a clean-room subagent in-stage after each
|
|
45
|
+
> authoring stage completes — in the same session, before the exit block, so any fix
|
|
46
|
+
> decision keeps its context. It never needs a `/new` and only returns a compact digest.
|
|
47
|
+
> **Recommended: on.** (Change later by editing `autoVerify` in `forge.config.json`.)
|
|
48
|
+
|
|
49
|
+
Options: **Enable (recommended)** / **Leave off**.
|
|
50
|
+
|
|
51
|
+
- On **Enable**: patch `"autoVerify": false` → `"autoVerify": true` in the generated
|
|
52
|
+
`forge.config.json` in place, preserving formatting and every other key.
|
|
53
|
+
- On **Leave off**: leave the config as written (`autoVerify: false`).
|
|
54
|
+
|
|
55
|
+
If the host lacks a structured question tool but can still prompt the user (e.g. Codex asks in
|
|
56
|
+
plain text), use that — ask the one question directly and wait for the reply; it is the same
|
|
57
|
+
choice, just rendered differently. Only when the host has **no** way to ask at all (a fully
|
|
58
|
+
non-interactive / headless run) do you skip the prompt: leave `autoVerify: false` and print the
|
|
59
|
+
one-line note `Set "autoVerify": true in forge.config.json to verify automatically after each stage.`
|
|
60
|
+
|
|
61
|
+
After initialization, start the pipeline with `/skill:forge-1-prd <feature-name>`.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Host execution notes (Pi)
|
|
66
|
+
|
|
67
|
+
This Pi bundle preserves Claude's `AskUserQuestion` references because it ships a Pi compatibility extension registering an `AskUserQuestion` tool. On Pi:
|
|
68
|
+
|
|
69
|
+
- **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.
|
|
70
|
+
- **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.
|
|
71
|
+
- **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.
|
|
72
|
+
- **Background / monitoring:** run long-lived commands in the foreground and report progress as it arrives.
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
---
|
|
2
|
+
# GENERATED — DO NOT EDIT. Source: skills/forge-verify/SKILL.md. Regenerate: python3 scripts/build-adapters.py
|
|
3
|
+
name: forge-verify
|
|
4
|
+
description: Verify forge pipeline artifacts for completeness, consistency, and quality. Use when user runs /skill:forge-verify or asks to check forge specs, backlog, or implementation for gaps. Do NOT trigger for general code review, quality checks, or verification tasks outside the forge pipeline.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# forge-verify — Verification Gate
|
|
8
|
+
|
|
9
|
+
Analyze feature artifacts for completeness, consistency, and quality. Produce structured, actionable findings designed for a fresh-context agent to apply.
|
|
10
|
+
|
|
11
|
+
## Which role are you? (read this first)
|
|
12
|
+
|
|
13
|
+
This skill is loaded in two different roles. Determine yours before proceeding:
|
|
14
|
+
|
|
15
|
+
- **You ARE the `forge-verifier` subagent** — you were dispatched via the host's subagent mechanism, you have read-only tools (Read, Glob, Grep, Bash) and **no** Agent/host's subagent mechanism, and this skill is pre-loaded in your context. **SKIP "Subagent Delegation (parent orchestrator only)" and "Synthesize" below — those describe how a *parent* dispatches *you*, not work for you to do.** Do **not** dispatch anything, do **not** try to spawn a verifier. Go straight to **Prerequisites → Steps 1–6**, execute the checks yourself, and **return your findings as your response** (the parent writes the document to disk). Dispatching a subagent from here is the classic self-referential loop — never do it.
|
|
16
|
+
- **You are the parent orchestrator** — a navigator (`/skill:forge`), a stage skill's in-stage auto-verify, or a direct `/skill:forge-verify` invocation, and you have the host's subagent mechanism. Use "Subagent Delegation" to dispatch the `forge-verifier` subagent, then "Synthesize" to assemble and write the document.
|
|
17
|
+
|
|
18
|
+
## Subagent Delegation (parent orchestrator only)
|
|
19
|
+
|
|
20
|
+
This skill is delegated to the `forge-verifier` subagent via the host's subagent mechanism. The verifier subagent has:
|
|
21
|
+
- **Read-only tools** (Read, Glob, Grep, Bash) — it cannot accidentally modify specs
|
|
22
|
+
- **Persistent memory** — it accumulates knowledge about this project's recurring issues and patterns across sessions
|
|
23
|
+
- **The forge-verify skill pre-loaded** — so it has all verification checklists and guidance at startup
|
|
24
|
+
|
|
25
|
+
### Choose single vs. parallel dispatch
|
|
26
|
+
|
|
27
|
+
Pick based on how many checks the mode carries (see the per-mode totals in Step 3):
|
|
28
|
+
|
|
29
|
+
- **Small modes (prd ~15, tech ~15): single verifier.** Use the host's subagent mechanism once with
|
|
30
|
+
`the forge-verifier custom agent`, passing the feature name and mode. It runs all
|
|
31
|
+
checks and returns findings.
|
|
32
|
+
- **Large modes (specs ~38, backlog ~27, impl ~23): parallel dimensioned fan-out.**
|
|
33
|
+
Split the mode's checklist into **dimension groups** and dispatch **one
|
|
34
|
+
`forge-verifier` per group, in parallel — a single message with multiple subagent
|
|
35
|
+
calls** (the `superpowers:dispatching-parallel-agents` pattern). Each instance owns a
|
|
36
|
+
disjoint slice of CHECK-IDs, so it verifies deeper over a narrower scope and they all
|
|
37
|
+
run concurrently. Suggested groups (map to the category clusters in
|
|
38
|
+
`references/verification-checklists.md`):
|
|
39
|
+
- **specs:** (1) types/contracts, (2) architecture/layout, (3) cross-reference &
|
|
40
|
+
traceability, (4) testing strategy, (5) integration.
|
|
41
|
+
- **backlog:** (1) item scoping & acceptance criteria, (2) dependency/ordering sanity,
|
|
42
|
+
(3) spec coverage & traceability, (4) schema/enum correctness.
|
|
43
|
+
- **impl:** (1) requirement coverage vs specs, (2) integration correctness,
|
|
44
|
+
(3) testing, (4) code-quality/conventions, (5) runnability (owns CHECK-I21/I22 —
|
|
45
|
+
the smoke command and the non-test-caller heuristic).
|
|
46
|
+
|
|
47
|
+
In each parallel instance's prompt, pass: the feature, the mode, the **dimension
|
|
48
|
+
label**, the **exact CHECK-IDs it owns**, and a note that **it is one of several
|
|
49
|
+
parallel instances** — it must verify ONLY its assigned checks and return findings
|
|
50
|
+
for that slice. Tell parallel instances to treat their `MEMORY.md` as **read-only**
|
|
51
|
+
(apply learned patterns, but do NOT write it — concurrent writers would race);
|
|
52
|
+
memory consolidation is left to single-verifier runs.
|
|
53
|
+
|
|
54
|
+
### Synthesize (parent session)
|
|
55
|
+
|
|
56
|
+
The verifier(s) are read-only — they return findings as their response; **you** (the
|
|
57
|
+
parent) assemble and write the single document to
|
|
58
|
+
`{resolvedFeatureDir}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`. When you fanned out:
|
|
59
|
+
1. Concatenate all instances' findings and **renumber `V-NNN` IDs uniquely** across the
|
|
60
|
+
merged set.
|
|
61
|
+
2. **Dedup** overlaps — when two instances flag the same file+location+issue (e.g. a
|
|
62
|
+
cross-reference and a type-contract verifier both catch one mismatch), keep one,
|
|
63
|
+
union their `Checklist:` IDs.
|
|
64
|
+
3. Build the **single Fix Execution Plan** over the merged findings (Step 5). The output
|
|
65
|
+
document format is unchanged, so `forge-fix` consumes it identically.
|
|
66
|
+
|
|
67
|
+
### Adversarial confirmation (opt-in "deep verify")
|
|
68
|
+
|
|
69
|
+
When the user asks for a deep/thorough verify, add a confirmation pass before writing:
|
|
70
|
+
for each `error`- and `gap`-severity finding, dispatch a short skeptic `forge-verifier`
|
|
71
|
+
prompted to **refute** it ("here is a claimed finding; prove it wrong; default to
|
|
72
|
+
REFUTED if you cannot confirm it from the artifacts"). Drop findings the skeptic refutes
|
|
73
|
+
with confidence — this cuts false positives before they reach the user. Lower-severity
|
|
74
|
+
findings (`improvement`, `inconsistency`) skip this pass.
|
|
75
|
+
|
|
76
|
+
### Fallback
|
|
77
|
+
|
|
78
|
+
If the `forge-verifier` subagent is not available (not installed, or an environment
|
|
79
|
+
without subagents), fall back to running verification inline in the current session.
|
|
80
|
+
|
|
81
|
+
**Inline execution guidance:** If running inline (not as subagent), process verification checklists one category at a time to manage context pressure. Load only the artifacts needed for each category, verify, summarize findings, then move to the next category.
|
|
82
|
+
|
|
83
|
+
### Require-clean (`auto`) mode — unattended auto-verify
|
|
84
|
+
|
|
85
|
+
When the navigator auto-invokes this skill (its `autoVerify` path), it passes a
|
|
86
|
+
**require-clean** signal (e.g. args include `--require-clean`, or the invocation is
|
|
87
|
+
described as auto-verify). In this mode the clean-room guarantee is load-bearing: the
|
|
88
|
+
whole reason auto-verify is safe to run without a `/new` is that the `forge-verifier`
|
|
89
|
+
subagent inherits none of the dispatching session's context. Running inline would break
|
|
90
|
+
that — it would consume the dispatching session's context and invalidate the no-clear
|
|
91
|
+
justification.
|
|
92
|
+
|
|
93
|
+
So in require-clean mode, **do NOT fall back to inline execution**. If the host's subagent mechanism
|
|
94
|
+
or `forge-verifier` subagent is not dispatchable, return a **sentinel** instead of doing
|
|
95
|
+
any work:
|
|
96
|
+
|
|
97
|
+
> `CLEAN_ROOM_UNAVAILABLE: forge-verifier subagent not dispatchable — verify not run.`
|
|
98
|
+
|
|
99
|
+
Do not analyze artifacts, do not write a findings document, and do not touch pipeline
|
|
100
|
+
state. The navigator detects this sentinel and degrades to its manual verify gate (Tier
|
|
101
|
+
2/3), so verify state stays outstanding and the stage is never marked verified on false
|
|
102
|
+
assurance. **Manual / interactive invocation** (the normal `/skill:forge-verify`
|
|
103
|
+
path, no require-clean signal) keeps the inline fallback above unchanged.
|
|
104
|
+
|
|
105
|
+
## Prerequisites
|
|
106
|
+
|
|
107
|
+
Read and follow `references/shared-conventions.md` for feature name validation, configuration reading, and force mode handling before proceeding.
|
|
108
|
+
|
|
109
|
+
Resolve the feature directory via the **Feature Directory Resolution** block in `references/shared-conventions.md` (so a standalone feature resolves to its flat `{specsDir}/{feature}/` path exactly as today, and an epic member resolves to its nested `{specsDir}/{epic}/{feature}/` path). Use the resulting `{resolvedFeatureDir}` everywhere this skill reads or writes a per-feature artifact or state file — the `{specsDir}/{feature}/…` forms below are shorthand for the resolved path, not a literal flat layout. This does not apply to **epic mode**, whose paths are epic-scoped (`{specsDir}/{epic}/…`) by design.
|
|
110
|
+
|
|
111
|
+
**Turn structure reminder:** Output analysis/context as text, then route ALL questions through `AskUserQuestion`. Never embed questions in text output — the user will not be prompted and the session will stall.
|
|
112
|
+
|
|
113
|
+
## Step 1: Read Configuration and Determine Mode
|
|
114
|
+
|
|
115
|
+
Read `{resolvedFeatureDir}/.pipeline-state.json` to understand current pipeline state.
|
|
116
|
+
|
|
117
|
+
### Mode Selection
|
|
118
|
+
|
|
119
|
+
If a stage is specified as a second argument (e.g., `/skill:forge-verify auth specs`), use that mode. Otherwise, auto-detect based on pipeline state:
|
|
120
|
+
|
|
121
|
+
- **epic mode**: Explicit via `/skill:forge-verify {epic} epic`, or auto-detected when the named argument resolves to an **epic directory** — i.e. `{specsDir}/{name}/epic-manifest.json` exists (an epic root holds `epic-manifest.json` but no `.pipeline-state.json` of its own). When the argument is an epic, prefer epic mode over feature-mode resolution.
|
|
122
|
+
- **prd mode**: If `forge-1-prd` is complete but `forge-verify-prd` is not `passed` or `findings-applied`
|
|
123
|
+
- **tech mode**: If `forge-2-tech` is complete but `forge-verify-tech` is not `passed` or `findings-applied`
|
|
124
|
+
- **specs mode**: If `forge-3-specs` is complete but `forge-verify-specs` is not `passed` or `findings-applied`
|
|
125
|
+
- **backlog mode**: If `forge-4-backlog` is complete but `forge-verify-backlog` is not `passed` or `findings-applied`
|
|
126
|
+
- **impl mode**: If user explicitly requests or if implementation code exists for this feature
|
|
127
|
+
|
|
128
|
+
If ambiguous, use `AskUserQuestion` to ask which stage to verify.
|
|
129
|
+
|
|
130
|
+
## Step 2: Load All Relevant Artifacts
|
|
131
|
+
|
|
132
|
+
Load into context ALL artifacts for this feature based on mode:
|
|
133
|
+
|
|
134
|
+
**For prd mode:**
|
|
135
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
136
|
+
|
|
137
|
+
**For tech mode:**
|
|
138
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
139
|
+
- `{resolvedFeatureDir}/tech-spec.md`
|
|
140
|
+
|
|
141
|
+
**For specs mode:**
|
|
142
|
+
- `{resolvedFeatureDir}/PRD.md`
|
|
143
|
+
- `{resolvedFeatureDir}/tech-spec.md`
|
|
144
|
+
- `{resolvedFeatureDir}/##-*.md` (all implementation specs)
|
|
145
|
+
|
|
146
|
+
**For backlog mode:**
|
|
147
|
+
- All of the above, PLUS
|
|
148
|
+
- `{resolvedFeatureDir}/backlog.json` (or `{backlogDir}/{feature}/backlog.json` if `backlogDir` is configured) — resolve `{resolvedFeatureDir}` via the **Feature Directory Resolution** block in `references/shared-conventions.md`, using the same composed path as forge-4-backlog and forge-5-loop (04 §6.2)
|
|
149
|
+
|
|
150
|
+
**For impl mode:**
|
|
151
|
+
- All of the above, PLUS
|
|
152
|
+
- The actual source code for this feature (read package directory)
|
|
153
|
+
- Source code of packages this feature integrates with
|
|
154
|
+
|
|
155
|
+
**For epic mode:**
|
|
156
|
+
- `{specsDir}/{epic}/epic-manifest.json`
|
|
157
|
+
- `{specsDir}/{epic}/EPIC.md`
|
|
158
|
+
- each member feature's `.pipeline-state.json` (for the `epic` back-pointer + derived status)
|
|
159
|
+
- each **completed** member's `PRD.md` + `tech-spec.md` (for contract-drift checking, CHECK-E06)
|
|
160
|
+
|
|
161
|
+
## Step 3: Run Verification Checklists
|
|
162
|
+
|
|
163
|
+
Read `references/verification-checklists.md` for the detailed checklists per mode. Execute every check. Do not skip checks because things "look fine." That same reference also holds the relocated **Findings Document Template (Step 4)**, the worked **Example Findings (Step 4)**, and the **Epic Mode State Write Detail (Step 6)** sections used later in this skill.
|
|
164
|
+
|
|
165
|
+
Each check in `verification-checklists.md` has a unique ID (CHECK-P01, CHECK-T01, CHECK-S01, CHECK-B01, etc.). As you execute each check, record its ID and result (pass/fail/not-applicable). After completing all checks, report the total: "Executed N of M checks. Results: X pass, Y fail, Z not-applicable." If your count is significantly below the expected total for the mode (prd: ~15 checks, tech: ~15 checks, specs: ~38 checks, backlog: ~27 checks, impl: ~23 checks, epic: ~10 checks), you likely skipped checks — go back and complete them.
|
|
166
|
+
|
|
167
|
+
**Epic mode dispatch.** Epic mode is a small (~10-check) checklist, so per the single-vs-parallel rule above, dispatch a **single `forge-verifier`** via the host's subagent mechanism, passing the epic name and `mode=epic`. The verifier runs CHECK-E01..E10 from the `## Epic Mode Checklist` in `references/verification-checklists.md` (E01/E02/E03/E08 are delegated to `epic-manifest.py validate`/`check-name`; E04–E07, E09, and E10 are verifier judgment) and returns its findings.
|
|
168
|
+
|
|
169
|
+
### Important: Be Specific, Not General
|
|
170
|
+
|
|
171
|
+
BAD finding: "The error handling could be more thorough."
|
|
172
|
+
GOOD finding: "PRD.md REQ-ERR-04 requires rate limit retry behavior, but spec 03-provider-registry.md only handles rate limits by throwing — no retry logic is specified."
|
|
173
|
+
|
|
174
|
+
Every finding must include:
|
|
175
|
+
1. A unique ID (V-001, V-002, etc.)
|
|
176
|
+
2. Severity: `gap` (missing requirement coverage), `inconsistency` (contradictory specs), `improvement` (not wrong but could be better), `error` (factually incorrect)
|
|
177
|
+
3. Exact location (file + section)
|
|
178
|
+
4. What's wrong
|
|
179
|
+
5. Suggested fix (specific enough that a fresh agent can apply it)
|
|
180
|
+
6. References (which other files/sections are involved)
|
|
181
|
+
7. Related checklist item(s) (e.g., CHECK-P01, CHECK-S12)
|
|
182
|
+
|
|
183
|
+
## Step 4: Write Findings Document
|
|
184
|
+
|
|
185
|
+
Ensure the `.verification/` subdirectory exists, then write findings to `{resolvedFeatureDir}/.verification/VERIFY-{mode}-{YYYY-MM-DD}.md`.
|
|
186
|
+
|
|
187
|
+
**For epic mode**, the target is `{specsDir}/{epic}/.verification/VERIFY-epic-{YYYY-MM-DD}.md` (the same format, with `{mode}=epic`).
|
|
188
|
+
|
|
189
|
+
The full findings-document template (report header, `V-NNN` finding shape, and the
|
|
190
|
+
Fix Execution Plan layout) and the worked **Example Findings** (gap / inconsistency /
|
|
191
|
+
improvement) live in `references/verification-checklists.md` under the **Findings
|
|
192
|
+
Document Template (Step 4)** and **Example Findings (Step 4)** sections — follow that
|
|
193
|
+
template verbatim when writing the document.
|
|
194
|
+
|
|
195
|
+
## Step 5: Fix Plan and Next Steps
|
|
196
|
+
|
|
197
|
+
The Fix Execution Plan (written as part of the findings document in Step 4) is ALWAYS generated regardless of mode. This ensures the findings document is self-contained: diagnosis + action plan in one artifact.
|
|
198
|
+
|
|
199
|
+
When building the Fix Execution Plan:
|
|
200
|
+
1. Group related findings into logical steps (e.g., all type-system fixes together)
|
|
201
|
+
2. Order steps to avoid conflicts (fix shared types before documents that reference them)
|
|
202
|
+
3. Each step must be specific enough for a fresh agent with zero prior context to execute
|
|
203
|
+
4. Flag any findings that require user decisions before fixes can be applied
|
|
204
|
+
|
|
205
|
+
**If in plan mode:** Also write the Fix Execution Plan to the active plan file so the plan mode workflow is preserved. The user reviews the plan, exits plan mode, and a fresh agent executes the fixes.
|
|
206
|
+
|
|
207
|
+
**If not in plan mode:** Output the following as text:
|
|
208
|
+
"Findings and fix plan written to `{findings-file}`."
|
|
209
|
+
|
|
210
|
+
Then use `AskUserQuestion` to ask how to proceed. Follow the **Decision Support** protocol in `references/shared-conventions.md`: recommend a path based on the findings and give each option a one-line trade-off. Let the severity and volume of findings drive the recommendation — e.g. recommend (b) **Apply fixes now** when findings are clear-cut and mechanical; recommend (a) **Review first** when findings involve design judgment or you flagged low-confidence items; recommend (c) **plan-mode workflow** when the fixes are large or interdependent enough to warrant a reviewed plan. Present:
|
|
211
|
+
- **(a) Review the findings first** — read `{findings-file}` and decide per-finding; safest, but you act on nothing until you return.
|
|
212
|
+
- **(b) Run `/skill:forge-fix {feature}` now** — applies the fix plan immediately; fastest, best when findings are unambiguous.
|
|
213
|
+
- **(c) Enter plan mode and re-run `/skill:forge-verify {feature}`** — produces a reviewable plan before any edits; best for large or risky fix sets.
|
|
214
|
+
|
|
215
|
+
Do NOT embed this question in your text output.
|
|
216
|
+
|
|
217
|
+
## Step 6: Update Pipeline State
|
|
218
|
+
|
|
219
|
+
Write pipeline state conforming to `references/pipeline-state-schema.json`.
|
|
220
|
+
|
|
221
|
+
Update `{resolvedFeatureDir}/.pipeline-state.json`:
|
|
222
|
+
- Set the relevant verify entry status to `findings-reported` (or `passed` when there
|
|
223
|
+
are zero findings)
|
|
224
|
+
- Record `findingsFile`, `findingsCount`, `verifiedAt`
|
|
225
|
+
- Record `verifiedStageVersion` = the current `version` of the production stage entry
|
|
226
|
+
this verify covers (e.g. verifying `tech` → `stages["forge-2-tech"].version`). This
|
|
227
|
+
feeds the navigator's freshness ledger: a later revision to that artifact bumps its
|
|
228
|
+
`version`, so the recorded value no longer matches and auto-verify re-fires. Omitting
|
|
229
|
+
this leaves the verify looking stale (safe: the navigator re-verifies rather than
|
|
230
|
+
skips).
|
|
231
|
+
|
|
232
|
+
Do NOT mark as `findings-applied` — that happens after the fix pass.
|
|
233
|
+
|
|
234
|
+
### Epic mode state (`.epic-state.json`)
|
|
235
|
+
|
|
236
|
+
Epic mode is **epic-scoped**, not per-feature: record its result into the epic-level
|
|
237
|
+
state file `{specsDir}/{epic}/.epic-state.json` — **never** into any member's
|
|
238
|
+
`.pipeline-state.json`. Set `stages.forge-verify-epic.status` to `findings-reported`
|
|
239
|
+
(or `passed` if zero findings), recording `findingsFile`, `findingsCount`, and
|
|
240
|
+
`verifiedAt`. The full `.epic-state.json` schema (minimal shape) and the atomic
|
|
241
|
+
temp-file + `os.replace()` **write-mechanism** detail (lazy-create, merge/replace,
|
|
242
|
+
fail-intact) — including the worked Python snippet — live in
|
|
243
|
+
`references/verification-checklists.md` under the **Epic Mode State Write Detail
|
|
244
|
+
(Step 6)** section. Follow it verbatim.
|
|
245
|
+
|
|
246
|
+
Do NOT mark as `findings-applied` — that happens after the fix pass.
|
|
247
|
+
|
|
248
|
+
## Gotchas
|
|
249
|
+
|
|
250
|
+
- This skill should be run in plan mode for best results. The plan gives the user a chance to review before committing to changes.
|
|
251
|
+
- Verification is most valuable when it finds things that are MISSING, not just things that are present but imperfect. Prioritize gap detection over style preferences.
|
|
252
|
+
- Don't verify things that are intentionally left open (check the PRD's "Open Questions" section).
|
|
253
|
+
- If you find zero issues, say so honestly. Don't manufacture findings to seem thorough. But zero findings on a complex feature is suspicious — double-check.
|
|
254
|
+
- The findings document must be self-contained. A fresh agent reading it should be able to apply every fix without needing conversational context from this session.
|
|
255
|
+
- For backlog verification, also run the loop runner's validate command (resolve `loopRunner` from `forge.config.json`, default rauf: `rauf backlog validate . --backlog {backlogDir} --specs-dir {resolvedFeatureDir} --json`). Include any findings it reports (exit 1) as verification findings; if the runner isn't installed yet (command missing), note that backlog validation was skipped rather than failing.
|
|
256
|
+
- For specs verification, also run the deterministic traceability validator to supplement agent-driven traceability checks. Include any uncovered requirements or orphaned references as findings:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
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')"
|
|
260
|
+
[ -n "$R" ] || { echo "feature-forge: cannot locate plugin root" >&2; exit 1; }
|
|
261
|
+
python3 "$R/scripts/validate-traceability.py" {resolvedFeatureDir}/PRD.md {resolvedFeatureDir}/ --json
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## Host execution notes (Pi)
|
|
267
|
+
|
|
268
|
+
This Pi bundle preserves Claude's `AskUserQuestion` references because it ships a Pi compatibility extension registering an `AskUserQuestion` tool. On Pi:
|
|
269
|
+
|
|
270
|
+
- **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.
|
|
271
|
+
- **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.
|
|
272
|
+
- **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.
|
|
273
|
+
- **Background / monitoring:** run long-lived commands in the foreground and report progress as it arrives.
|