forgedev 1.2.0 → 1.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 +57 -10
- package/bin/chainproof.js +126 -0
- package/package.json +25 -7
- package/src/chainproof-bridge.js +330 -0
- package/src/ci-mode.js +85 -0
- package/src/claude-configurator.js +86 -49
- package/src/cli.js +30 -7
- package/src/composer.js +159 -34
- package/src/doctor-checks-chainproof.js +106 -0
- package/src/doctor-checks.js +39 -20
- package/src/doctor-prompts.js +9 -9
- package/src/doctor.js +37 -4
- package/src/guided.js +3 -3
- package/src/index.js +31 -10
- package/src/init-mode.js +64 -11
- package/src/menu.js +178 -0
- package/src/prompts.js +5 -12
- package/src/recommender.js +134 -10
- package/src/scanner.js +57 -2
- package/src/uat-generator.js +204 -189
- package/src/update-check.js +9 -4
- package/src/update.js +1 -1
- package/src/utils.js +64 -5
- package/templates/ai/guardrails-py/backend/app/ai/__init__.py +29 -0
- package/templates/ai/guardrails-py/backend/app/ai/audit_log.py +133 -0
- package/templates/ai/guardrails-py/backend/app/ai/client.py.template +323 -0
- package/templates/ai/guardrails-py/backend/app/ai/health.py.template +157 -0
- package/templates/ai/guardrails-py/backend/app/ai/input_guard.py +98 -0
- package/templates/ai/guardrails-ts/src/lib/ai/audit-log.ts.template +164 -0
- package/templates/ai/guardrails-ts/src/lib/ai/client.ts.template +403 -0
- package/templates/ai/guardrails-ts/src/lib/ai/health.ts.template +165 -0
- package/templates/ai/guardrails-ts/src/lib/ai/index.ts.template +17 -0
- package/templates/ai/guardrails-ts/src/lib/ai/input-guard.ts.template +124 -0
- package/templates/auth/nextauth/src/lib/auth.ts.template +12 -7
- package/templates/backend/express/Dockerfile.template +18 -0
- package/templates/backend/express/package.json.template +33 -0
- package/templates/backend/express/src/index.ts.template +34 -0
- package/templates/backend/express/src/routes/health.ts.template +27 -0
- package/templates/backend/express/tsconfig.json +17 -0
- package/templates/backend/fastapi/backend/Dockerfile.template +5 -0
- package/templates/backend/fastapi/backend/app/api/health.py.template +1 -1
- package/templates/backend/fastapi/backend/app/core/config.py.template +1 -1
- package/templates/backend/fastapi/backend/app/core/errors.py +1 -1
- package/templates/backend/fastapi/backend/app/main.py.template +3 -1
- package/templates/backend/fastapi/backend/requirements.txt.template +2 -0
- package/templates/backend/hono/Dockerfile.template +18 -0
- package/templates/backend/hono/package.json.template +31 -0
- package/templates/backend/hono/src/index.ts.template +32 -0
- package/templates/backend/hono/src/routes/health.ts.template +27 -0
- package/templates/backend/hono/tsconfig.json +18 -0
- package/templates/base/docs/uat/UAT_TEMPLATE.md.template +1 -1
- package/templates/chainproof/base/.chainproof/config.json.template +11 -0
- package/templates/chainproof/base/.chainproof/mcp-server.mjs +310 -0
- package/templates/chainproof/base/.mcp.json +9 -0
- package/templates/chainproof/fastapi/.chainproof/middleware.json.template +14 -0
- package/templates/chainproof/nextjs/.chainproof/hooks.json.template +19 -0
- package/templates/chainproof/polyglot/.chainproof/config.json.template +21 -0
- package/templates/claude-code/agents/architect.md +25 -11
- package/templates/claude-code/agents/build-error-resolver.md +19 -5
- package/templates/claude-code/agents/chief-of-staff.md +42 -8
- package/templates/claude-code/agents/code-quality-reviewer.md +14 -0
- package/templates/claude-code/agents/database-reviewer.md +15 -1
- package/templates/claude-code/agents/deep-reviewer.md +191 -0
- package/templates/claude-code/agents/doc-updater.md +19 -5
- package/templates/claude-code/agents/docs-lookup.md +19 -5
- package/templates/claude-code/agents/e2e-runner.md +26 -12
- package/templates/claude-code/agents/enforcement-gate.md +102 -0
- package/templates/claude-code/agents/frontend-builder.md +188 -0
- package/templates/claude-code/agents/harness-optimizer.md +36 -1
- package/templates/claude-code/agents/loop-operator.md +27 -13
- package/templates/claude-code/agents/planner.md +21 -7
- package/templates/claude-code/agents/product-strategist.md +24 -10
- package/templates/claude-code/agents/production-readiness.md +14 -0
- package/templates/claude-code/agents/prompt-auditor.md +115 -0
- package/templates/claude-code/agents/refactor-cleaner.md +22 -8
- package/templates/claude-code/agents/security-reviewer.md +14 -0
- package/templates/claude-code/agents/spec-validator.md +15 -1
- package/templates/claude-code/agents/tdd-guide.md +21 -7
- package/templates/claude-code/agents/uat-validator.md +14 -0
- package/templates/claude-code/claude-md/base.md +14 -7
- package/templates/claude-code/claude-md/fastapi.md +8 -8
- package/templates/claude-code/claude-md/fullstack.md +6 -6
- package/templates/claude-code/claude-md/hono.md +18 -0
- package/templates/claude-code/claude-md/nextjs.md +5 -5
- package/templates/claude-code/claude-md/remix.md +18 -0
- package/templates/claude-code/commands/audit-security.md +14 -0
- package/templates/claude-code/commands/audit-spec.md +14 -0
- package/templates/claude-code/commands/audit-wiring.md +14 -0
- package/templates/claude-code/commands/build-fix.md +28 -0
- package/templates/claude-code/commands/build-ui.md +59 -0
- package/templates/claude-code/commands/code-review.md +53 -31
- package/templates/claude-code/commands/fix-loop.md +211 -0
- package/templates/claude-code/commands/full-audit.md +36 -8
- package/templates/claude-code/commands/generate-prd.md +1 -1
- package/templates/claude-code/commands/generate-sdd.md +74 -0
- package/templates/claude-code/commands/generate-uat.md +107 -35
- package/templates/claude-code/commands/help.md +68 -0
- package/templates/claude-code/commands/live-uat.md +268 -0
- package/templates/claude-code/commands/optimize-claude-md.md +15 -1
- package/templates/claude-code/commands/plan.md +3 -3
- package/templates/claude-code/commands/pre-pr.md +57 -19
- package/templates/claude-code/commands/product-strategist.md +21 -0
- package/templates/claude-code/commands/resume-session.md +10 -10
- package/templates/claude-code/commands/run-uat.md +59 -2
- package/templates/claude-code/commands/save-session.md +10 -10
- package/templates/claude-code/commands/simplify.md +36 -0
- package/templates/claude-code/commands/tdd.md +17 -18
- package/templates/claude-code/commands/verify-all.md +24 -0
- package/templates/claude-code/commands/verify-intent.md +55 -0
- package/templates/claude-code/commands/workflows.md +52 -40
- package/templates/claude-code/hooks/polyglot.json +10 -1
- package/templates/claude-code/hooks/python.json +10 -1
- package/templates/claude-code/hooks/scripts/autofix-polyglot.mjs +2 -2
- package/templates/claude-code/hooks/scripts/autofix-python.mjs +1 -1
- package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +1 -1
- package/templates/claude-code/hooks/scripts/code-hygiene.mjs +293 -0
- package/templates/claude-code/hooks/scripts/pre-commit-gate.mjs +207 -0
- package/templates/claude-code/hooks/typescript.json +10 -1
- package/templates/claude-code/skills/ai-prompts/SKILL.md +119 -41
- package/templates/claude-code/skills/git-workflow/SKILL.md +5 -5
- package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
- package/templates/claude-code/skills/playwright/SKILL.md +5 -5
- package/templates/claude-code/skills/security-api/SKILL.md +1 -1
- package/templates/claude-code/skills/security-web/SKILL.md +1 -1
- package/templates/claude-code/skills/testing-patterns/SKILL.md +9 -9
- package/templates/database/prisma-postgres/{.env.example → .env.example.template} +1 -0
- package/templates/database/sqlalchemy-postgres/{.env.example → .env.example.template} +1 -0
- package/templates/docs-portal/fastapi/backend/app/portal/__pycache__/docs_reader.cpython-314.pyc +0 -0
- package/templates/docs-portal/fastapi/backend/app/portal/docs_reader.py +201 -0
- package/templates/docs-portal/fastapi/backend/app/portal/html_renderer.py +229 -0
- package/templates/docs-portal/fastapi/backend/app/portal/router.py.template +35 -0
- package/templates/docs-portal/nextjs/src/app/portal/[category]/[slug]/page.tsx +81 -0
- package/templates/docs-portal/nextjs/src/app/portal/[category]/page.tsx +65 -0
- package/templates/docs-portal/nextjs/src/app/portal/layout.tsx.template +54 -0
- package/templates/docs-portal/nextjs/src/app/portal/page.tsx +85 -0
- package/templates/docs-portal/nextjs/src/components/portal/markdown-renderer.tsx +101 -0
- package/templates/docs-portal/nextjs/src/components/portal/mobile-portal-nav.tsx +81 -0
- package/templates/docs-portal/nextjs/src/components/portal/portal-nav.tsx +86 -0
- package/templates/docs-portal/nextjs/src/lib/docs.ts +139 -0
- package/templates/frontend/nextjs/package.json.template +3 -1
- package/templates/frontend/react/index.html.template +12 -0
- package/templates/frontend/react/package.json.template +34 -0
- package/templates/frontend/react/src/App.tsx.template +10 -0
- package/templates/frontend/react/src/index.css +1 -0
- package/templates/frontend/react/src/main.tsx +10 -0
- package/templates/frontend/react/tsconfig.json +17 -0
- package/templates/frontend/react/vite.config.ts.template +15 -0
- package/templates/frontend/react/vitest.config.ts +9 -0
- package/templates/frontend/remix/app/root.tsx.template +31 -0
- package/templates/frontend/remix/app/routes/_index.tsx.template +19 -0
- package/templates/frontend/remix/app/routes/api.health.ts.template +10 -0
- package/templates/frontend/remix/app/tailwind.css +1 -0
- package/templates/frontend/remix/package.json.template +39 -0
- package/templates/frontend/remix/tsconfig.json +18 -0
- package/templates/frontend/remix/vite.config.ts.template +7 -0
- package/templates/infra/github-actions/.github/workflows/ci.yml.template +3 -0
- package/docs/00-README.md +0 -310
- package/docs/01-universal-prompt-library.md +0 -1049
- package/docs/02-claude-code-mastery-playbook.md +0 -283
- package/docs/03-multi-agent-verification.md +0 -565
- package/docs/04-errata-and-verification-checklist.md +0 -284
- package/docs/05-universal-scaffolder-vision.md +0 -452
- package/docs/06-confidence-assessment-and-repo-prompt.md +0 -407
- package/docs/errata.md +0 -58
- package/docs/multi-agent-verification.md +0 -66
- package/docs/playbook.md +0 -95
- package/docs/prompt-library.md +0 -160
- package/docs/uat/UAT_CHECKLIST.csv +0 -9
- package/docs/uat/UAT_TEMPLATE.md +0 -163
- package/templates/claude-code/commands/done.md +0 -19
- /package/{docs/plans/.gitkeep → templates/docs-portal/fastapi/backend/app/portal/__init__.py} +0 -0
|
@@ -1,13 +1,39 @@
|
|
|
1
1
|
Read docs/uat/UAT_TEMPLATE.md and execute the UAT verification process.
|
|
2
2
|
|
|
3
|
+
## Intent Contract
|
|
4
|
+
|
|
5
|
+
Before invoking any agent, construct this block and pass it as context:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
INTENT_CONTRACT:
|
|
9
|
+
INTENT: "[User's original request verbatim]"
|
|
10
|
+
SCOPE: "[Files/areas to examine]"
|
|
11
|
+
SUCCESS_CRITERIA: "[What done looks like]"
|
|
12
|
+
INTENT_HASH: "[First 8 chars of SHA256(INTENT|SCOPE|SUCCESS_CRITERIA)]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Every agent invocation MUST include this block. If an agent's output does not echo back the INTENT_HASH, its results are considered unverified.
|
|
16
|
+
|
|
17
|
+
## Phase 1: Automated Verification
|
|
18
|
+
|
|
3
19
|
For each scenario in the UAT template:
|
|
4
20
|
1. Check if automated tests exist that cover this scenario
|
|
5
21
|
2. If automated: run the test and report PASS/FAIL
|
|
6
22
|
3. If not automated: flag as MANUAL REQUIRED
|
|
7
23
|
4. Update docs/uat/UAT_CHECKLIST.csv with results
|
|
8
24
|
|
|
25
|
+
## Phase 2: Business Rules Verification
|
|
26
|
+
|
|
27
|
+
If `docs/uat/BUSINESS_RULES.md` exists (generated by `/generate-uat`):
|
|
28
|
+
1. For each business rule, check if an automated test validates it
|
|
29
|
+
2. If yes: run the test, compare actual output against the documented expected output
|
|
30
|
+
3. If no: flag the rule as UNTESTED and add it to the manual testing queue
|
|
31
|
+
|
|
32
|
+
## Phase 3: Results Summary
|
|
33
|
+
|
|
9
34
|
Output:
|
|
10
35
|
- Automated coverage: X/Y scenarios have automated tests
|
|
36
|
+
- Business rule coverage: X/Y rules have automated tests
|
|
11
37
|
- Results: X passed, Y failed, Z need manual testing
|
|
12
38
|
- Blocking issues: list any P0 failures
|
|
13
39
|
|
|
@@ -16,6 +42,37 @@ For P0 failures:
|
|
|
16
42
|
- Suggest a fix if the failure is obvious
|
|
17
43
|
- Mark as BLOCKED in the checklist
|
|
18
44
|
|
|
45
|
+
## Phase 4: Manual Testing Bridge
|
|
46
|
+
|
|
19
47
|
For scenarios needing manual testing:
|
|
20
|
-
|
|
21
|
-
|
|
48
|
+
1. Group them by page/endpoint
|
|
49
|
+
2. Check if a browser automation tool is available (Claude in Chrome, Playwright MCP)
|
|
50
|
+
3. If available, ask the user: "I found X scenarios that need manual verification. Would you like me to test them live against the running app? (This will run /live-uat on just these scenarios)"
|
|
51
|
+
4. If the user agrees, run `/live-uat` with scope limited to the MANUAL REQUIRED scenarios
|
|
52
|
+
5. If no browser tool available, provide step-by-step manual instructions for each scenario
|
|
53
|
+
|
|
54
|
+
## Phase 5: Coverage Gap Report
|
|
55
|
+
|
|
56
|
+
After all phases complete, generate a coverage report:
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
## UAT Coverage Report
|
|
60
|
+
|
|
61
|
+
### Automated
|
|
62
|
+
- Scenarios covered: X/Y (Z%)
|
|
63
|
+
- Business rules covered: X/Y (Z%)
|
|
64
|
+
- All P0 scenarios covered: YES/NO
|
|
65
|
+
|
|
66
|
+
### Manual (tested via /live-uat)
|
|
67
|
+
- Scenarios tested: X
|
|
68
|
+
- Passed: X | Failed: X
|
|
69
|
+
|
|
70
|
+
### Gaps (no coverage at all)
|
|
71
|
+
- [list scenarios with neither automated nor manual coverage]
|
|
72
|
+
|
|
73
|
+
### Recommended Actions
|
|
74
|
+
- [write tests for P0 scenarios without automation]
|
|
75
|
+
- [add business rule assertions to existing tests]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Update docs/uat/UAT_CHECKLIST.csv with final results for all scenarios.
|
|
@@ -2,10 +2,10 @@ Save the current session state so work can be resumed in a future conversation.
|
|
|
2
2
|
|
|
3
3
|
## Process
|
|
4
4
|
|
|
5
|
-
1. **Gather context
|
|
6
|
-
2. **Create folder
|
|
7
|
-
3. **Write session file
|
|
8
|
-
4. **Show to user
|
|
5
|
+
1. **Gather context**: Review what was discussed, built, and decided this session
|
|
6
|
+
2. **Create folder**: `mkdir -p docs/sessions` (or `~/.claude/sessions/`)
|
|
7
|
+
3. **Write session file**: `docs/sessions/YYYY-MM-DD-session.md`
|
|
8
|
+
4. **Show to user**: Display contents and ask for corrections
|
|
9
9
|
|
|
10
10
|
## Session File Format
|
|
11
11
|
|
|
@@ -23,12 +23,12 @@ Save the current session state so work can be resumed in a future conversation.
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
## What WORKED (with evidence)
|
|
26
|
-
- **[thing]**
|
|
26
|
+
- **[thing]** - confirmed by: [specific evidence like "tests pass", "200 response"]
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
30
|
## What Did NOT Work (and why)
|
|
31
|
-
- **[approach]**
|
|
31
|
+
- **[approach]** - failed because: [exact reason / error message]
|
|
32
32
|
|
|
33
33
|
---
|
|
34
34
|
|
|
@@ -48,7 +48,7 @@ Save the current session state so work can be resumed in a future conversation.
|
|
|
48
48
|
---
|
|
49
49
|
|
|
50
50
|
## Decisions Made
|
|
51
|
-
- **[decision]**
|
|
51
|
+
- **[decision]** - reason: [why]
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
@@ -63,7 +63,7 @@ Save the current session state so work can be resumed in a future conversation.
|
|
|
63
63
|
|
|
64
64
|
## Rules
|
|
65
65
|
|
|
66
|
-
- Write every section honestly
|
|
67
|
-
- The "What Did NOT Work" section is the most critical
|
|
68
|
-
- Each session gets its own file
|
|
66
|
+
- Write every section honestly. "Nothing yet" is better than skipping a section
|
|
67
|
+
- The "What Did NOT Work" section is the most critical because it prevents retrying failed approaches
|
|
68
|
+
- Each session gets its own file. Never append to previous sessions
|
|
69
69
|
- Wait for user confirmation before closing
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Review the current codebase for structural quality and clean it up. This is not about style or formatting — it is about architecture hygiene.
|
|
2
|
+
|
|
3
|
+
## What to check
|
|
4
|
+
|
|
5
|
+
1. **Long files** (over 300 lines): Split into smaller, focused modules. Each file should have a single responsibility.
|
|
6
|
+
|
|
7
|
+
2. **Long functions** (over 50 lines): Extract helper functions. If a function does more than one thing, break it apart.
|
|
8
|
+
|
|
9
|
+
3. **Duplicate code**: Find code blocks that appear in multiple files. Extract them into a shared utility module that individual files can import. Common patterns to look for:
|
|
10
|
+
- Repeated validation logic
|
|
11
|
+
- Identical error handling blocks
|
|
12
|
+
- Copy-pasted API call patterns
|
|
13
|
+
- Similar data transformation functions
|
|
14
|
+
|
|
15
|
+
4. **Directory bloat**: If a directory has more than 20 source files, suggest grouping them into subdirectories by feature or domain.
|
|
16
|
+
|
|
17
|
+
5. **Stale test files**: Find test files whose corresponding source files have been deleted or renamed. Ask if they should be removed.
|
|
18
|
+
|
|
19
|
+
6. **Dead exports**: Find exported functions or constants that nothing imports. Ask if they should be removed.
|
|
20
|
+
|
|
21
|
+
## How to fix
|
|
22
|
+
|
|
23
|
+
For each issue found:
|
|
24
|
+
- Explain what the problem is and why it matters
|
|
25
|
+
- Show the specific files and line numbers
|
|
26
|
+
- Make the fix (extract utility, split file, delete dead code)
|
|
27
|
+
- Verify imports still work after refactoring
|
|
28
|
+
- Run tests to confirm nothing broke
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
- Do NOT add new dependencies
|
|
32
|
+
- Do NOT change public APIs or function signatures
|
|
33
|
+
- Do NOT refactor code that is already clean
|
|
34
|
+
- Keep the fixes minimal and focused — one problem at a time
|
|
35
|
+
- When extracting shared utilities, place them in the most logical existing directory (e.g., `src/lib/`, `src/utils/`, `shared/`)
|
|
36
|
+
- Always preserve existing test coverage
|
|
@@ -6,10 +6,10 @@ Enforce test-driven development: write failing tests FIRST, then implement.
|
|
|
6
6
|
RED → GREEN → REFACTOR → REPEAT
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
1. **RED
|
|
10
|
-
2. **GREEN
|
|
11
|
-
3. **REFACTOR
|
|
12
|
-
4. **REPEAT
|
|
9
|
+
1. **RED**: Write a failing test (because the code doesn't exist yet)
|
|
10
|
+
2. **GREEN**: Write the minimum code to make the test pass
|
|
11
|
+
3. **REFACTOR**: Improve the code while keeping tests green
|
|
12
|
+
4. **REPEAT**: Next scenario
|
|
13
13
|
|
|
14
14
|
## Process
|
|
15
15
|
|
|
@@ -17,40 +17,40 @@ RED → GREEN → REFACTOR → REPEAT
|
|
|
17
17
|
2. Launch the `tdd-guide` agent
|
|
18
18
|
3. Define types/interfaces first
|
|
19
19
|
4. Write failing tests covering: happy path, edge cases, error cases
|
|
20
|
-
5. Run `{{TEST_COMMAND}}`
|
|
20
|
+
5. Run `{{TEST_COMMAND}}` to verify tests FAIL for the right reason
|
|
21
21
|
6. Implement minimal code to pass
|
|
22
|
-
7. Run `{{TEST_COMMAND}}`
|
|
22
|
+
7. Run `{{TEST_COMMAND}}` to verify tests PASS
|
|
23
23
|
8. Refactor if needed, keeping tests green
|
|
24
|
-
9. Check coverage
|
|
24
|
+
9. Check coverage. Target 80%+ minimum
|
|
25
25
|
|
|
26
26
|
## Example
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
User: /tdd I need a function to validate email addresses
|
|
30
30
|
|
|
31
|
-
Step 1
|
|
31
|
+
Step 1 - SCAFFOLD:
|
|
32
32
|
Create types/interfaces for input and output
|
|
33
33
|
|
|
34
|
-
Step 2
|
|
34
|
+
Step 2 - RED (write failing tests):
|
|
35
35
|
- "should accept valid email: user@example.com"
|
|
36
36
|
- "should reject email without @"
|
|
37
37
|
- "should reject email without domain"
|
|
38
38
|
- "should reject empty string"
|
|
39
39
|
- "should handle unicode characters"
|
|
40
40
|
|
|
41
|
-
Step 3
|
|
41
|
+
Step 3 - Run tests → all FAIL (expected, no implementation yet)
|
|
42
42
|
|
|
43
|
-
Step 4
|
|
43
|
+
Step 4 - GREEN (implement minimal code):
|
|
44
44
|
Write just enough to pass all tests
|
|
45
45
|
|
|
46
|
-
Step 5
|
|
46
|
+
Step 5 - Run tests → all PASS
|
|
47
47
|
|
|
48
|
-
Step 6
|
|
48
|
+
Step 6 - REFACTOR:
|
|
49
49
|
Extract constants, improve naming, add JSDoc
|
|
50
50
|
|
|
51
|
-
Step 7
|
|
51
|
+
Step 7 - Run tests → still PASS
|
|
52
52
|
|
|
53
|
-
Step 8
|
|
53
|
+
Step 8 - Check coverage → 100%
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
## Rules
|
|
@@ -75,6 +75,5 @@ Step 8 — Check coverage → 100%
|
|
|
75
75
|
|
|
76
76
|
## After TDD
|
|
77
77
|
|
|
78
|
-
- `/build-fix`
|
|
79
|
-
- `/code-review`
|
|
80
|
-
- `/done` — verify the task is complete
|
|
78
|
+
- `/build-fix` - if build errors come up
|
|
79
|
+
- `/code-review` - review the implementation, then commit
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Run the full verification chain on the current changes.
|
|
2
2
|
|
|
3
|
+
## Intent Contract
|
|
4
|
+
|
|
5
|
+
Before invoking any agent, construct this block and pass it as context:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
INTENT_CONTRACT:
|
|
9
|
+
INTENT: "[User's original request verbatim]"
|
|
10
|
+
SCOPE: "[Files/areas to examine]"
|
|
11
|
+
SUCCESS_CRITERIA: "[What done looks like]"
|
|
12
|
+
INTENT_HASH: "[First 8 chars of SHA256(INTENT|SCOPE|SUCCESS_CRITERIA)]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Every agent invocation MUST include this block. If an agent's output does not echo back the INTENT_HASH, its results are considered unverified.
|
|
16
|
+
|
|
3
17
|
1. Run lint: `{{LINT_COMMAND}}`
|
|
4
18
|
2. Run type check: `{{TYPE_CHECK_COMMAND}}`
|
|
5
19
|
3. Run tests: `{{TEST_COMMAND}}`
|
|
@@ -9,3 +23,13 @@ Run the full verification chain on the current changes.
|
|
|
9
23
|
|
|
10
24
|
Summarize all findings grouped by severity (critical, high, medium, low).
|
|
11
25
|
If any critical issues found, list them prominently at the top.
|
|
26
|
+
|
|
27
|
+
## Recommend Next Step
|
|
28
|
+
|
|
29
|
+
After the summary, always recommend the single best next action based on findings:
|
|
30
|
+
- **CRITICAL findings** → recommend the specific fix
|
|
31
|
+
- **HIGH findings** → recommend addressing before proceeding
|
|
32
|
+
- **No issues** → recommend `/pre-pr`
|
|
33
|
+
- **MEDIUM/LOW only** → recommend committing, note optional improvements
|
|
34
|
+
|
|
35
|
+
Format: **Next step:** one sentence with the specific command or action to take.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Run the Intent Verification Protocol compliance check across all agents and commands.
|
|
2
|
+
|
|
3
|
+
## Intent Contract
|
|
4
|
+
|
|
5
|
+
Before invoking any agent, construct this block:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
INTENT_CONTRACT:
|
|
9
|
+
INTENT: "Verify all agents and commands comply with the Intent Verification Protocol"
|
|
10
|
+
SCOPE: ".claude/agents/, .claude/commands/"
|
|
11
|
+
SUCCESS_CRITERIA: "Every agent has PROOF_OF_INTENT, every command that invokes agents has Intent Contract, no cross-agent consistency violations"
|
|
12
|
+
INTENT_HASH: "IVP-COMPLIANCE"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Step 1: Protocol Compliance Scan
|
|
16
|
+
|
|
17
|
+
For each file in `.claude/agents/`:
|
|
18
|
+
1. Check for `PROOF_OF_INTENT` block in output section
|
|
19
|
+
2. Check for `NO_CONTRACT_RECEIVED` fallback handling
|
|
20
|
+
3. Record compliance status
|
|
21
|
+
|
|
22
|
+
For each file in `.claude/commands/` that references an agent:
|
|
23
|
+
1. Check for `INTENT_CONTRACT` section
|
|
24
|
+
2. Check that `INTENT_HASH` is referenced
|
|
25
|
+
3. Record compliance status
|
|
26
|
+
|
|
27
|
+
## Step 2: Launch prompt-auditor
|
|
28
|
+
|
|
29
|
+
Run the **prompt-auditor** agent on the full `.claude/` configuration with the Intent Contract above.
|
|
30
|
+
|
|
31
|
+
## Step 3: Cross-Validation
|
|
32
|
+
|
|
33
|
+
1. Pick 3 agents at random
|
|
34
|
+
2. For each, evaluate: given a sample intent, would the agent's instructions produce output that includes a valid PROOF_OF_INTENT?
|
|
35
|
+
3. Flag any agent whose instructions are ambiguous enough that the proof section could be skipped
|
|
36
|
+
|
|
37
|
+
## Step 4: Compliance Report
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
INTENT VERIFICATION PROTOCOL - COMPLIANCE REPORT
|
|
41
|
+
|
|
42
|
+
OVERALL: [X/Y agents compliant, A/B commands compliant]
|
|
43
|
+
|
|
44
|
+
NON-COMPLIANT AGENTS:
|
|
45
|
+
- [agent name]: [what's missing]
|
|
46
|
+
|
|
47
|
+
NON-COMPLIANT COMMANDS:
|
|
48
|
+
- [command name]: [what's missing]
|
|
49
|
+
|
|
50
|
+
CONSISTENCY ISSUES:
|
|
51
|
+
- [cross-agent term conflicts, severity definition mismatches]
|
|
52
|
+
|
|
53
|
+
RECOMMENDATIONS:
|
|
54
|
+
- [prioritized list of fixes]
|
|
55
|
+
```
|
|
@@ -1,40 +1,52 @@
|
|
|
1
|
-
Show the developer what workflows are available.
|
|
2
|
-
|
|
3
|
-
## Available Workflows
|
|
4
|
-
|
|
5
|
-
### Development
|
|
6
|
-
- `/plan`
|
|
7
|
-
- `/tdd`
|
|
8
|
-
- `/build-fix`
|
|
9
|
-
- `/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- `/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
- `/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- `/
|
|
21
|
-
- `/audit
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
###
|
|
31
|
-
- `/
|
|
32
|
-
- `/
|
|
33
|
-
- `/
|
|
34
|
-
|
|
35
|
-
###
|
|
36
|
-
- `/
|
|
37
|
-
- `/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
1
|
+
Show the developer what workflows are available.
|
|
2
|
+
|
|
3
|
+
## Available Workflows
|
|
4
|
+
|
|
5
|
+
### Development
|
|
6
|
+
- `/plan` - Create an implementation plan before writing code
|
|
7
|
+
- `/tdd` - Write failing tests first, then implement (test-driven development)
|
|
8
|
+
- `/build-fix` - Fix build, lint, and type errors incrementally
|
|
9
|
+
- `/fix-loop` - Automated fix-review-regression loop until green
|
|
10
|
+
- `/build-ui` - Build frontend UI with AI-powered generation (Google Stitch + UI UX Pro Max)
|
|
11
|
+
- `/code-review` - Review changes for security and quality (required before commit)
|
|
12
|
+
- `/simplify` - Find duplicate code, long files, and extract shared utilities
|
|
13
|
+
|
|
14
|
+
### Daily
|
|
15
|
+
- `/help` - Not sure what to do? This guides you to the right workflow
|
|
16
|
+
- `/status` - Run all checks and show a project dashboard
|
|
17
|
+
- `/next` - Figure out what to work on next
|
|
18
|
+
|
|
19
|
+
### Verification
|
|
20
|
+
- `/verify-all` - Run lint, type check, tests, then launch all reviewers
|
|
21
|
+
- `/full-audit` - Run every audit and review agent in a single pass
|
|
22
|
+
- `/audit-spec` - Validate implementation against a spec/PRD
|
|
23
|
+
- `/audit-wiring` - Find dead or unwired features
|
|
24
|
+
- `/audit-security` - Run a security audit
|
|
25
|
+
- `/verify-intent` - Verify all agents comply with Intent Verification Protocol
|
|
26
|
+
|
|
27
|
+
### Strategy
|
|
28
|
+
- Use `product-strategist` agent - Research competitors, evaluate project maturity, recommend improvements
|
|
29
|
+
|
|
30
|
+
### Release
|
|
31
|
+
- `/pre-pr` - Prepare and create a pull request
|
|
32
|
+
- `/run-uat` - Execute UAT scenarios
|
|
33
|
+
- `/live-uat` - Run live UAT by interacting with the running application
|
|
34
|
+
|
|
35
|
+
### Generation
|
|
36
|
+
- `/generate-prd` - Generate a PRD from the current codebase
|
|
37
|
+
- `/generate-sdd` - Generate a Software Design Document from the codebase
|
|
38
|
+
- `/generate-uat` - Generate UAT scenarios and checklists
|
|
39
|
+
- `/optimize-claude-md` - Slim down an oversized CLAUDE.md
|
|
40
|
+
|
|
41
|
+
### Session
|
|
42
|
+
- `/save-session` - Save current work context for later resumption
|
|
43
|
+
- `/resume-session` - Load a saved session and continue where you left off
|
|
44
|
+
|
|
45
|
+
## Quality Gates (automatic)
|
|
46
|
+
|
|
47
|
+
These run automatically, you don't need to remember them:
|
|
48
|
+
- **On commit**: Pre-commit gate runs lint, tests, secrets check, and requires code review
|
|
49
|
+
- **On stop**: Code hygiene check runs automatically
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
Run `/status` to see where things stand, then `/next` to pick up work.
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
"command": "node .claude/hooks/guard-protected-files.mjs"
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"matcher": "Bash",
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "node .claude/hooks/pre-commit-gate.mjs"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
12
21
|
}
|
|
13
22
|
],
|
|
14
23
|
"PostToolUse": [
|
|
@@ -27,7 +36,7 @@
|
|
|
27
36
|
"hooks": [
|
|
28
37
|
{
|
|
29
38
|
"type": "command",
|
|
30
|
-
"command": "
|
|
39
|
+
"command": "node .claude/hooks/code-hygiene.mjs"
|
|
31
40
|
}
|
|
32
41
|
]
|
|
33
42
|
}
|
|
@@ -9,6 +9,15 @@
|
|
|
9
9
|
"command": "node .claude/hooks/guard-protected-files.mjs"
|
|
10
10
|
}
|
|
11
11
|
]
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"matcher": "Bash",
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"type": "command",
|
|
18
|
+
"command": "node .claude/hooks/pre-commit-gate.mjs"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
12
21
|
}
|
|
13
22
|
],
|
|
14
23
|
"PostToolUse": [
|
|
@@ -27,7 +36,7 @@
|
|
|
27
36
|
"hooks": [
|
|
28
37
|
{
|
|
29
38
|
"type": "command",
|
|
30
|
-
"command": "
|
|
39
|
+
"command": "node .claude/hooks/code-hygiene.mjs"
|
|
31
40
|
}
|
|
32
41
|
]
|
|
33
42
|
}
|
|
@@ -31,7 +31,7 @@ process.stdin.on('end', () => {
|
|
|
31
31
|
try {
|
|
32
32
|
execFileSync('npx', ['eslint', '--fix', targetPath], { stdio: 'pipe', cwd: 'frontend' });
|
|
33
33
|
} catch {
|
|
34
|
-
// eslint may exit non-zero for unfixable issues
|
|
34
|
+
// eslint may exit non-zero for unfixable issues, that's okay
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
} else if (filePath.endsWith('.py')) {
|
|
@@ -42,7 +42,7 @@ process.stdin.on('end', () => {
|
|
|
42
42
|
try {
|
|
43
43
|
execFileSync('ruff', ['check', '--fix', targetPath], { stdio: 'pipe', cwd: 'backend' });
|
|
44
44
|
} catch {
|
|
45
|
-
// ruff may exit non-zero for unfixable issues
|
|
45
|
+
// ruff may exit non-zero for unfixable issues, that's okay
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -27,7 +27,7 @@ process.stdin.on('end', () => {
|
|
|
27
27
|
try {
|
|
28
28
|
execFileSync('ruff', ['check', '--fix', resolved], { stdio: 'pipe' });
|
|
29
29
|
} catch {
|
|
30
|
-
// ruff may exit non-zero for unfixable issues
|
|
30
|
+
// ruff may exit non-zero for unfixable issues, that's okay
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
process.exit(0);
|
|
@@ -27,7 +27,7 @@ process.stdin.on('end', () => {
|
|
|
27
27
|
try {
|
|
28
28
|
execFileSync('npx', ['eslint', '--fix', resolved], { stdio: 'pipe' });
|
|
29
29
|
} catch {
|
|
30
|
-
// eslint may exit non-zero for unfixable issues
|
|
30
|
+
// eslint may exit non-zero for unfixable issues, that's okay
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|