forgedev 1.1.3 → 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 +58 -10
- package/bin/chainproof.js +126 -0
- package/bin/devforge.js +2 -1
- package/package.json +33 -7
- package/src/chainproof-bridge.js +330 -0
- package/src/ci-mode.js +85 -0
- package/src/claude-configurator.js +87 -49
- package/src/cli.js +35 -12
- 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 +65 -6
- 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/plans/.gitkeep +0 -0
- package/templates/base/docs/uat/UAT_CHECKLIST.csv.template +2 -0
- package/templates/base/docs/uat/UAT_TEMPLATE.md.template +22 -0
- 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 +22 -7
- package/templates/claude-code/agents/chief-of-staff.md +42 -8
- package/templates/claude-code/agents/code-quality-reviewer.md +15 -1
- package/templates/claude-code/agents/database-reviewer.md +16 -2
- 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 +61 -0
- package/templates/claude-code/agents/loop-operator.md +27 -12
- package/templates/claude-code/agents/planner.md +21 -7
- package/templates/claude-code/agents/product-strategist.md +138 -0
- 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 +15 -0
- package/templates/claude-code/agents/spec-validator.md +45 -1
- package/templates/claude-code/agents/tdd-guide.md +21 -7
- package/templates/claude-code/agents/uat-validator.md +18 -0
- package/templates/claude-code/claude-md/base.md +15 -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 +54 -26
- package/templates/claude-code/commands/fix-loop.md +211 -0
- package/templates/claude-code/commands/full-audit.md +37 -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 -37
- 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 +20 -10
- package/templates/claude-code/hooks/scripts/autofix-python.mjs +4 -5
- package/templates/claude-code/hooks/scripts/autofix-typescript.mjs +4 -4
- package/templates/claude-code/hooks/scripts/code-hygiene.mjs +293 -0
- package/templates/claude-code/hooks/scripts/guard-protected-files.mjs +2 -2
- 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 +6 -6
- package/templates/claude-code/skills/nextjs/SKILL.md +1 -1
- package/templates/claude-code/skills/playwright/SKILL.md +6 -5
- package/templates/claude-code/skills/security-api/SKILL.md +1 -1
- package/templates/claude-code/skills/security-web/SKILL.md +2 -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/__init__.py +0 -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 +52 -0
- package/templates/testing/pytest/backend/tests/__init__.py +0 -0
- package/templates/testing/pytest/backend/tests/conftest.py.template +11 -0
- package/templates/testing/pytest/backend/tests/test_health.py.template +10 -0
- package/templates/testing/vitest/vitest.config.ts.template +18 -0
- package/CLAUDE.md +0 -38
- package/templates/claude-code/commands/done.md +0 -19
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
## RULES
|
|
15
15
|
- Never commit `.env` files or secrets
|
|
16
|
-
- Never modify migration files directly
|
|
16
|
+
- Never modify migration files directly. Generate new migrations instead
|
|
17
17
|
- All API responses use structured error format: `{ "error": { "code": "ERR_CODE", "message": "..." } }`
|
|
18
18
|
- Never leak stack traces to clients
|
|
19
19
|
- Health check endpoints must always be available
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
{{STACK_SPECIFIC_RULES}}
|
|
23
23
|
|
|
24
24
|
## Pitfalls
|
|
25
|
-
- Never commit lock file merge conflicts
|
|
26
|
-
- Never use loose types (`any` in TS, `Any` in Python)
|
|
27
|
-
- Never hardcode URLs, ports, or credentials
|
|
28
|
-
- Never catch errors silently
|
|
29
|
-
- Never push directly to main
|
|
25
|
+
- Never commit lock file merge conflicts. Delete and regenerate
|
|
26
|
+
- Never use loose types (`any` in TS, `Any` in Python). Use strict types and narrow explicitly
|
|
27
|
+
- Never hardcode URLs, ports, or credentials. Use environment variables
|
|
28
|
+
- Never catch errors silently. Always log or re-throw
|
|
29
|
+
- Never push directly to main. Always use feature branches
|
|
30
30
|
- Run `{{TEST_COMMAND}}` before marking any task complete
|
|
31
31
|
|
|
32
32
|
## Agents
|
|
@@ -48,9 +48,17 @@ Delegate to specialized agents for complex tasks:
|
|
|
48
48
|
| `chief-of-staff` | Orchestrate multi-agent complex tasks |
|
|
49
49
|
| `loop-operator` | Run autonomous improvement loops |
|
|
50
50
|
| `harness-optimizer` | Audit and optimize Claude Code setup |
|
|
51
|
+
| `product-strategist` | Research competitors, evaluate maturity, recommend improvements |
|
|
52
|
+
| `prompt-auditor` | Audit agent prompts for clarity, consistency, and intent protocol compliance |
|
|
53
|
+
| `spec-validator` | Validate implementation matches specification |
|
|
54
|
+
| `production-readiness` | Verify project is ready for production deployment |
|
|
55
|
+
| `uat-validator` | Map UAT scenarios to tests and report coverage gaps |
|
|
56
|
+
| `frontend-builder` | Build frontend UI with Google Stitch and UI UX Pro Max, preview for acceptance |
|
|
57
|
+
| `deep-reviewer` | Deep code review with multi-pass analysis |
|
|
58
|
+
| `enforcement-gate` | Independently verify agent claims before issuing verdict |
|
|
51
59
|
|
|
52
60
|
## Skills
|
|
53
|
-
Framework-specific knowledge is in `.claude/skills
|
|
61
|
+
Framework-specific knowledge is in `.claude/skills/`. Reference these for deep patterns:
|
|
54
62
|
{{SKILLS_LIST}}
|
|
55
63
|
|
|
56
64
|
## Completion Protocol
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
## FastAPI Conventions
|
|
2
2
|
- Pydantic v2 for all request/response schemas (use model_config, not class Config)
|
|
3
|
-
- SQLAlchemy 2.0 async style
|
|
3
|
+
- SQLAlchemy 2.0 async style. Use `select()` not `query()`, `async with session` not `session.query`
|
|
4
4
|
- Dependency injection via `Depends()` for DB sessions, auth, etc.
|
|
5
|
-
- All endpoints return Pydantic models
|
|
5
|
+
- All endpoints return Pydantic models. Never return raw dicts
|
|
6
6
|
- Use `@asynccontextmanager` lifespan for startup/shutdown
|
|
7
7
|
- Database session via `get_db()` dependency (backend/app/db/session.py)
|
|
8
8
|
- Error responses use `AppError` classes (backend/app/core/errors.py)
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
- Ruff for linting, pyright for type checking
|
|
13
13
|
|
|
14
14
|
## FastAPI Pitfalls
|
|
15
|
-
- Never use `session.query()
|
|
16
|
-
- Never return raw dicts from endpoints
|
|
17
|
-
- Always use `Depends()` for DB session injection
|
|
18
|
-
- Never use `from module import
|
|
19
|
-
- Never use `session.commit()` inside a route
|
|
20
|
-
- Never store passwords as plaintext
|
|
15
|
+
- Never use `session.query()`. That's SQLAlchemy 1.x; use `select()` with `session.execute()`
|
|
16
|
+
- Never return raw dicts from endpoints. Always use a Pydantic response model
|
|
17
|
+
- Always use `Depends()` for DB session injection. Never create sessions manually
|
|
18
|
+
- Never use `from module import *`. Always use explicit imports
|
|
19
|
+
- Never use `session.commit()` inside a route. Let the dependency handle transaction lifecycle
|
|
20
|
+
- Never store passwords as plaintext. Always use bcrypt or argon2 hashing
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
## Polyglot Full-Stack Conventions
|
|
2
|
-
- `frontend/` contains the Next.js application
|
|
3
|
-
- `backend/` contains the FastAPI application
|
|
2
|
+
- `frontend/` contains the Next.js application. Follow Next.js conventions above
|
|
3
|
+
- `backend/` contains the FastAPI application. Follow FastAPI conventions above
|
|
4
4
|
- Frontend and backend communicate via REST API only
|
|
5
5
|
- API base URL configured in frontend via `NEXT_PUBLIC_API_URL` environment variable
|
|
6
6
|
- Shared types: define API contracts in backend Pydantic schemas, mirror in frontend TypeScript types
|
|
7
7
|
- Never import between frontend and backend directories
|
|
8
8
|
- Docker Compose orchestrates both services + PostgreSQL
|
|
9
9
|
- Frontend runs on port 3000, backend on port 8000
|
|
10
|
-
- Database owned by backend
|
|
10
|
+
- Database owned by backend. Frontend never accesses DB directly
|
|
11
11
|
- Authentication: NextAuth on frontend, JWT validation on backend
|
|
12
12
|
- E2E tests in root `e2e/` directory test the full stack together
|
|
13
13
|
|
|
14
14
|
## Polyglot Pitfalls
|
|
15
|
-
- Never import between `frontend/` and `backend
|
|
15
|
+
- Never import between `frontend/` and `backend/`. They are separate applications
|
|
16
16
|
- Always define API contracts in backend Pydantic schemas first, then mirror in frontend TypeScript types
|
|
17
|
-
- Always use `NEXT_PUBLIC_API_URL` for backend calls
|
|
18
|
-
- Never run migrations from the frontend
|
|
17
|
+
- Always use `NEXT_PUBLIC_API_URL` for backend calls. Never hardcode `localhost:8000`
|
|
18
|
+
- Never run migrations from the frontend. Database is owned by backend
|
|
19
19
|
- Never share `node_modules` or `__pycache__` between frontend and backend
|
|
20
20
|
- Always test both services together with Docker Compose before deploying
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Hono Conventions
|
|
2
|
+
- Hono app with typed routes. Use `c.json()` for responses, `c.req.json()` for request bodies
|
|
3
|
+
- Prisma client accessed via singleton (includes retry + graceful shutdown)
|
|
4
|
+
- Route handlers in `src/routes/`. Each file exports a Hono instance mounted by `app.route()`
|
|
5
|
+
- Use Hono middleware for CORS, auth, logging. Register with `app.use()`
|
|
6
|
+
- Error responses via `app.onError()` global handler. Never leak stack traces
|
|
7
|
+
- TypeScript strict mode. Use Zod for request validation
|
|
8
|
+
- Environment variables via `process.env`. Validate required vars at startup
|
|
9
|
+
- Build with `tsc`, run with `node dist/index.js`
|
|
10
|
+
- Prisma for database: `npx prisma db push` for dev, `npx prisma migrate` for production
|
|
11
|
+
|
|
12
|
+
## Hono Pitfalls
|
|
13
|
+
- Never return raw strings from API endpoints. Always use `c.json()` with typed objects
|
|
14
|
+
- Never use `app.onError()` to return stack traces. Log server-side, return generic error to client
|
|
15
|
+
- Never hardcode ports. Always use `process.env.PORT` with a fallback
|
|
16
|
+
- Never skip `c.req.valid()` for user input. Always validate with Zod middleware
|
|
17
|
+
- Never use synchronous file I/O in route handlers. Use async operations
|
|
18
|
+
- Never forget graceful shutdown. Register SIGTERM/SIGINT handlers to close server and DB
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
## Next.js Conventions
|
|
2
|
-
- Use App Router (src/app/)
|
|
2
|
+
- Use App Router (src/app/). No pages/ directory
|
|
3
3
|
- Server Components by default; add 'use client' only when needed (event handlers, hooks, browser APIs)
|
|
4
4
|
- Use server actions for mutations, not API routes
|
|
5
5
|
- Colocate loading.tsx, error.tsx, not-found.tsx with page.tsx
|
|
6
6
|
- Use `@/` path alias for imports from src/
|
|
7
|
-
- Tailwind CSS for styling
|
|
7
|
+
- Tailwind CSS for styling. Use `cn()` from `@/lib/utils` for conditional classes
|
|
8
8
|
- Prisma client accessed via `@/lib/db` singleton (includes retry + graceful shutdown)
|
|
9
9
|
- Form validation with Zod schemas shared between client and server
|
|
10
10
|
- Images via `next/image`, links via `next/link`
|
|
11
11
|
- Environment variables: NEXT_PUBLIC_ prefix for client-side, plain for server-side
|
|
12
12
|
|
|
13
13
|
## Next.js Pitfalls
|
|
14
|
-
-
|
|
15
|
-
- Never use `router.push()` when `<Link>` works
|
|
14
|
+
- Avoid Client Components with `useEffect` for data fetching. Prefer async Server Components instead
|
|
15
|
+
- Never use `router.push()` when `<Link>` works. Link enables prefetching
|
|
16
16
|
- Always add `loading.tsx` for pages with async data fetching
|
|
17
17
|
- Never add `'use client'` unless the component actually uses browser APIs, event handlers, or hooks
|
|
18
|
-
- Never use `fetch()` without error handling
|
|
18
|
+
- Never use `fetch()` without error handling. Always check `response.ok`
|
|
19
19
|
- Never store server-only secrets in `NEXT_PUBLIC_` variables
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Remix Conventions
|
|
2
|
+
- File-based routing in `app/routes/`. Use Remix v2 flat route convention
|
|
3
|
+
- Loaders for data fetching (`loader`), actions for mutations (`action`)
|
|
4
|
+
- Use `useLoaderData()` and `useActionData()` for typed data access in components
|
|
5
|
+
- Server-only code stays in loaders/actions and `.server.ts` files
|
|
6
|
+
- Tailwind CSS for styling. Import styles in `app/root.tsx`
|
|
7
|
+
- Prisma client accessed via singleton in `app/lib/db.server.ts`
|
|
8
|
+
- Form submissions via `<Form>` component, not `fetch()`. Remix handles progressive enhancement
|
|
9
|
+
- API resource routes in `app/routes/api.*.ts` for REST endpoints
|
|
10
|
+
- Environment variables: server-side only by default. Use `loader` to pass to client
|
|
11
|
+
|
|
12
|
+
## Remix Pitfalls
|
|
13
|
+
- Never use `useEffect` for data fetching. Use `loader` functions instead
|
|
14
|
+
- Never import server-only modules (Prisma, fs) in client components. Use `.server.ts` suffix
|
|
15
|
+
- Never use `fetch()` for mutations when `<Form>` works. Form enables progressive enhancement
|
|
16
|
+
- Never skip error boundaries. Add `ErrorBoundary` exports to route modules
|
|
17
|
+
- Never use `redirect()` outside loaders/actions. It only works in server context
|
|
18
|
+
- Never access `process.env` in client code. Pass values through `loader` data
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Run a focused security audit on all changed files.
|
|
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. Get list of changed files: `git diff --name-only`
|
|
4
18
|
2. Launch the security-reviewer agent on those files
|
|
5
19
|
3. Additionally check:
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Run the spec-validator agent against the specification.
|
|
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. Find spec files in `docs/` (look for files with "spec", "requirements", or "PRD" in the name)
|
|
4
18
|
2. If no spec found, ask the user to provide the spec file path
|
|
5
19
|
3. Launch the spec-validator agent with the spec file
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Verify that all API endpoints are properly wired between frontend and backend.
|
|
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. Find all backend API endpoints (route handlers, FastAPI routers)
|
|
4
18
|
2. Find all frontend API calls (fetch, axios, server actions)
|
|
5
19
|
3. Cross-reference: every backend endpoint should have at least one frontend caller
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
Incrementally fix build, lint, and type errors with minimal, safe 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
|
## Step 1: Detect and Run Build
|
|
4
18
|
|
|
5
19
|
Run the build and capture errors:
|
|
@@ -41,3 +55,17 @@ Show results:
|
|
|
41
55
|
- Suggested next steps for unresolved issues
|
|
42
56
|
|
|
43
57
|
Fix one error at a time. Prefer minimal diffs over refactoring.
|
|
58
|
+
|
|
59
|
+
## Step 6: Recommend Next Step
|
|
60
|
+
|
|
61
|
+
After the fix summary, always recommend the single best next action. Evaluate in this order:
|
|
62
|
+
|
|
63
|
+
1. **Remaining errors** — if any build/lint/type errors remain, recommend the specific fix
|
|
64
|
+
2. **Test gaps** — if the fix touched untested code, recommend writing tests
|
|
65
|
+
3. **Security review** — if the fix touched auth, input handling, or API routes, recommend `/audit-security`
|
|
66
|
+
4. **Code review** — if significant logic changed, recommend `/code-review`
|
|
67
|
+
5. **UAT impact** — if the fix affects user-facing behavior, flag which UAT scenarios need re-verification
|
|
68
|
+
6. **Performance** — if the fix introduced new queries, loops, or async patterns, flag for perf review
|
|
69
|
+
7. **All clean** — if everything passes, recommend `/pre-pr` or the next feature to build
|
|
70
|
+
|
|
71
|
+
Format: **Next step:** one sentence with the specific command or action to take.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Build frontend UI components using AI-powered generation with Google Stitch and UI UX Pro Max design intelligence.
|
|
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 - e.g., 'Build a login page with social auth buttons']"
|
|
10
|
+
SCOPE: "[Components to generate, target directory, framework]"
|
|
11
|
+
SUCCESS_CRITERIA: "[Component renders, matches design system, user accepts preview]"
|
|
12
|
+
INTENT_HASH: "[First 8 chars of SHA256(INTENT|SCOPE|SUCCESS_CRITERIA)]"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Step 1: Gather Requirements
|
|
16
|
+
|
|
17
|
+
Ask the user (if not already specified):
|
|
18
|
+
1. **What to build**: page, component, section, layout?
|
|
19
|
+
2. **Functionality**: what does it do?
|
|
20
|
+
3. **Style preference**: any aesthetic direction? (minimal, bold, playful, corporate, etc.)
|
|
21
|
+
|
|
22
|
+
Detect automatically:
|
|
23
|
+
- Project framework (check package.json, tsconfig, etc.)
|
|
24
|
+
- Existing design system or component library
|
|
25
|
+
- CSS approach (Tailwind, CSS Modules, styled-components)
|
|
26
|
+
|
|
27
|
+
## Step 2: Launch Frontend Builder
|
|
28
|
+
|
|
29
|
+
Invoke the **frontend-builder** agent with:
|
|
30
|
+
- The user's request
|
|
31
|
+
- Detected framework and conventions
|
|
32
|
+
- The Intent Contract
|
|
33
|
+
|
|
34
|
+
The agent will:
|
|
35
|
+
1. Generate a design system (via UI UX Pro Max if available)
|
|
36
|
+
2. Generate UI code (via Google Stitch if available, or manually)
|
|
37
|
+
3. Preview the result for user approval
|
|
38
|
+
4. Write accepted components to the project
|
|
39
|
+
|
|
40
|
+
## Step 3: Post-Build Verification
|
|
41
|
+
|
|
42
|
+
After the agent completes:
|
|
43
|
+
1. Run the project's dev server if not already running
|
|
44
|
+
2. Verify the component renders without console errors
|
|
45
|
+
3. Check responsive layout (mobile, tablet, desktop)
|
|
46
|
+
4. Run lint and type check to ensure no issues introduced
|
|
47
|
+
|
|
48
|
+
## Quick Examples
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
# Generate a landing page
|
|
52
|
+
/build-ui Create a SaaS landing page with hero, features grid, pricing table, and CTA
|
|
53
|
+
|
|
54
|
+
# Generate a specific component
|
|
55
|
+
/build-ui Build a data table component with sorting, filtering, and pagination
|
|
56
|
+
|
|
57
|
+
# Generate with style direction
|
|
58
|
+
/build-ui Build a dashboard sidebar with glassmorphism style and dark mode support
|
|
59
|
+
```
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
-
Review uncommitted changes for security issues and code quality.
|
|
1
|
+
Review uncommitted changes for security issues and code quality. This is the required review step before committing.
|
|
2
|
+
|
|
3
|
+
The pre-commit gate will block commits until this review completes. After review, the commit will be allowed.
|
|
4
|
+
|
|
5
|
+
## Intent Contract
|
|
6
|
+
|
|
7
|
+
Before invoking any agent, construct this block and pass it as context:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
INTENT_CONTRACT:
|
|
11
|
+
INTENT: "[User's original request verbatim]"
|
|
12
|
+
SCOPE: "[Files/areas to examine]"
|
|
13
|
+
SUCCESS_CRITERIA: "[What done looks like]"
|
|
14
|
+
INTENT_HASH: "[First 8 chars of SHA256(INTENT|SCOPE|SUCCESS_CRITERIA)]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Every agent invocation MUST include this block. If an agent's output does not echo back the INTENT_HASH, its results are considered unverified.
|
|
2
18
|
|
|
3
19
|
## Step 1: Get Changed Files
|
|
4
20
|
|
|
@@ -6,39 +22,51 @@ Review uncommitted changes for security issues and code quality.
|
|
|
6
22
|
git diff --name-only HEAD
|
|
7
23
|
```
|
|
8
24
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
For each changed file, check:
|
|
25
|
+
If no changes, report "Nothing to review" and exit.
|
|
12
26
|
|
|
13
|
-
|
|
14
|
-
- Hardcoded credentials, API keys, tokens
|
|
15
|
-
- SQL injection vulnerabilities
|
|
16
|
-
- XSS vulnerabilities
|
|
17
|
-
- Missing input validation
|
|
18
|
-
- Path traversal risks
|
|
27
|
+
## Step 2: Launch Review Agents (in parallel)
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
- Functions > 50 lines
|
|
22
|
-
- Files > 800 lines
|
|
23
|
-
- Nesting depth > 4 levels
|
|
24
|
-
- Missing error handling
|
|
25
|
-
- console.log / print statements left in
|
|
26
|
-
- TODO/FIXME comments without tracking
|
|
29
|
+
Launch all three agents on the changed files:
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
31
|
+
| Agent | Focus |
|
|
32
|
+
|-------|-------|
|
|
33
|
+
| `code-quality-reviewer` | Code patterns, complexity, maintainability, naming |
|
|
34
|
+
| `security-reviewer` | Vulnerabilities, injection, credential exposure, input validation |
|
|
35
|
+
| `deep-reviewer` | Behavioral integrity, runtime correctness, configuration validity, dependency quality, user-facing text, regression and scalability risks |
|
|
32
36
|
|
|
33
|
-
## Step 3:
|
|
37
|
+
## Step 3: Collect and Report Findings
|
|
34
38
|
|
|
35
39
|
For each issue found:
|
|
36
|
-
- **Severity**: CRITICAL, HIGH, MEDIUM
|
|
40
|
+
- **Severity**: CRITICAL, HIGH, MEDIUM, LOW
|
|
37
41
|
- **File**: path and line number
|
|
38
42
|
- **Issue**: what's wrong
|
|
39
43
|
- **Fix**: how to fix it
|
|
44
|
+
|
|
40
45
|
## Step 4: Verdict
|
|
41
46
|
|
|
42
|
-
- If CRITICAL issues found
|
|
43
|
-
- If
|
|
44
|
-
-
|
|
47
|
+
- If CRITICAL issues found: list required fixes, do NOT mark as reviewed
|
|
48
|
+
- If HIGH issues found (no CRITICAL): strongly recommend fixes, mark as reviewed with warnings
|
|
49
|
+
- If only MEDIUM/LOW: approve with suggestions, mark as reviewed
|
|
50
|
+
|
|
51
|
+
## Step 5: Update Review Marker
|
|
52
|
+
|
|
53
|
+
After review completes (with no CRITICAL findings), write the review marker so the pre-commit gate knows these files have been reviewed:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
echo '{"files": [<list of reviewed files>], "timestamp": "<ISO timestamp>", "verdict": "<APPROVED|APPROVED_WITH_WARNINGS>"}' > .claude/.last-review
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This marker is checked by the pre-commit gate. If new files are staged after review, the gate will require re-review.
|
|
60
|
+
|
|
61
|
+
## Step 6: Recommend Next Step
|
|
62
|
+
|
|
63
|
+
After the review, always recommend the single best next action:
|
|
64
|
+
|
|
65
|
+
1. **CRITICAL fixes** — if any CRITICAL findings, recommend the specific fix with file:line
|
|
66
|
+
2. **HIGH fixes** — if HIGH findings with clear fixes, recommend `/build-fix` or manual fix
|
|
67
|
+
3. **Test coverage** — if reviewed code lacks tests, recommend writing tests for the specific functions
|
|
68
|
+
4. **Security hardening** — if security findings exist, recommend `/audit-security` for a deeper pass
|
|
69
|
+
5. **Ready to commit** — if review is clean, recommend committing with a suggested commit message
|
|
70
|
+
6. **Ready for PR** — if already committed, recommend `/pre-pr`
|
|
71
|
+
|
|
72
|
+
Format: **Next step:** one sentence with the specific command or action to take.
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
Run an automated fix-review-regression loop with enforcement gates until all tests pass, code is verified clean, and every agent's work is independently confirmed.
|
|
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: "All tests pass, no lint/type errors, no CRITICAL or HIGH review findings, no regressions, all agents APPROVED by enforcement gate"
|
|
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
|
+
## Enforcement Protocol
|
|
18
|
+
|
|
19
|
+
**After every phase that involves an agent doing work**, invoke the `enforcement-gate` agent with:
|
|
20
|
+
1. The Intent Contract
|
|
21
|
+
2. The agent's full output (including PROOF_OF_INTENT)
|
|
22
|
+
3. The baseline metrics from Phase 0
|
|
23
|
+
|
|
24
|
+
**Gate rules:**
|
|
25
|
+
- `APPROVED` (confidence >= 99.99%) → proceed to next phase
|
|
26
|
+
- `NEEDS_REVIEW` (confidence 75-99.98%) → surface discrepancies to user, ask whether to proceed or halt
|
|
27
|
+
- `REJECTED` (confidence < 75% OR false claim OR regression) → halt the loop, report what failed and why
|
|
28
|
+
|
|
29
|
+
No phase transition happens without an APPROVED or explicit user override.
|
|
30
|
+
|
|
31
|
+
## Phase 0: Baseline
|
|
32
|
+
|
|
33
|
+
Run all checks and capture the starting state:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
{{TEST_COMMAND}}
|
|
37
|
+
{{LINT_COMMAND}}
|
|
38
|
+
{{TYPE_CHECK_COMMAND}}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Record as structured baseline:
|
|
42
|
+
```
|
|
43
|
+
BASELINE:
|
|
44
|
+
TESTS: [total, passing, failing]
|
|
45
|
+
LINT_ERRORS: [count]
|
|
46
|
+
TYPE_ERRORS: [count]
|
|
47
|
+
TIMESTAMP: [ISO 8601]
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If everything passes already, skip to Phase 2 (deep review only).
|
|
51
|
+
|
|
52
|
+
## Phase 1: Fix (build-error-resolver agent)
|
|
53
|
+
|
|
54
|
+
Delegate to the `build-error-resolver` agent with the Intent Contract:
|
|
55
|
+
|
|
56
|
+
1. Group errors by file, sorted by dependency order
|
|
57
|
+
2. Fix one error at a time with the smallest possible change
|
|
58
|
+
3. Re-run all checks after each fix to confirm no regressions
|
|
59
|
+
4. Continue until all errors are resolved
|
|
60
|
+
|
|
61
|
+
**Stop conditions** (bail out and report to user):
|
|
62
|
+
- Same error persists after 3 attempts
|
|
63
|
+
- A fix introduces more errors than it resolves
|
|
64
|
+
- Fix requires architectural changes beyond a simple repair
|
|
65
|
+
- No progress across 2 consecutive iterations
|
|
66
|
+
- Maximum 5 fix iterations reached
|
|
67
|
+
|
|
68
|
+
### Enforcement Gate 1
|
|
69
|
+
|
|
70
|
+
After build-error-resolver completes, invoke `enforcement-gate`:
|
|
71
|
+
- Verify all claimed fixes are real (re-run `{{TEST_COMMAND}}`, `{{LINT_COMMAND}}`, `{{TYPE_CHECK_COMMAND}}`)
|
|
72
|
+
- Verify no regressions against baseline
|
|
73
|
+
- Verify scope coverage (did the agent touch only files it claimed?)
|
|
74
|
+
|
|
75
|
+
If REJECTED → halt and report. If APPROVED → proceed to Phase 2.
|
|
76
|
+
|
|
77
|
+
## Phase 2: Deep Review (deep-reviewer agent)
|
|
78
|
+
|
|
79
|
+
Run `git diff` to capture all changes since baseline.
|
|
80
|
+
|
|
81
|
+
Invoke the `deep-reviewer` agent with the Intent Contract and the full diff. The deep reviewer will:
|
|
82
|
+
|
|
83
|
+
1. Read every changed hunk line-by-line
|
|
84
|
+
2. Analyze for: correctness, security, data integrity, performance, edge cases, API contract, readability
|
|
85
|
+
3. For each finding: exact file/line, severity, description, suggested fix, and a runnable test case
|
|
86
|
+
4. Return structured findings with confidence scores
|
|
87
|
+
|
|
88
|
+
### Triage Findings
|
|
89
|
+
|
|
90
|
+
Categorize the deep reviewer's output:
|
|
91
|
+
|
|
92
|
+
| Finding Type | Action |
|
|
93
|
+
|-------------|--------|
|
|
94
|
+
| CRITICAL with fix + test case | → Phase 3 (auto-fix) |
|
|
95
|
+
| HIGH with fix + test case | → Phase 3 (auto-fix) |
|
|
96
|
+
| CRITICAL/HIGH needing human judgment | → Halt loop, surface to user |
|
|
97
|
+
| MEDIUM/LOW | → Collect for final report |
|
|
98
|
+
| Confidence < 70% | → Collect for final report, mark as uncertain |
|
|
99
|
+
|
|
100
|
+
## Phase 3: Fix Review Findings (build-error-resolver agent)
|
|
101
|
+
|
|
102
|
+
For each CRITICAL/HIGH finding from Phase 2 that has an auto-fixable suggestion:
|
|
103
|
+
|
|
104
|
+
1. Apply the suggested fix from the deep reviewer
|
|
105
|
+
2. Run the test case the deep reviewer generated — it must pass
|
|
106
|
+
3. Run `{{TEST_COMMAND}}` — all existing tests must still pass
|
|
107
|
+
4. Move to next finding
|
|
108
|
+
|
|
109
|
+
**Cap**: Maximum 2 iterations of fix-review. If findings keep appearing, halt and report.
|
|
110
|
+
|
|
111
|
+
### Enforcement Gate 2
|
|
112
|
+
|
|
113
|
+
After fixing review findings, invoke `enforcement-gate`:
|
|
114
|
+
- Verify every applied fix resolves its finding
|
|
115
|
+
- Verify all generated test cases pass
|
|
116
|
+
- Verify no regressions against baseline
|
|
117
|
+
- Verify the deep reviewer's test cases actually test what they claim
|
|
118
|
+
|
|
119
|
+
If REJECTED → revert the fixes from this phase, report findings to user as manual tasks. If APPROVED → proceed to Phase 4.
|
|
120
|
+
|
|
121
|
+
## Phase 4: Regression + New Test Validation
|
|
122
|
+
|
|
123
|
+
Run the full test suite:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
{{TEST_COMMAND}}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Compare against Phase 0 baseline:
|
|
130
|
+
- If any previously passing test now fails → **REGRESSION DETECTED**
|
|
131
|
+
- Delegate to `build-error-resolver` to fix (max 2 iterations)
|
|
132
|
+
- Run through `enforcement-gate` again
|
|
133
|
+
- If regression persists after gate, halt and report
|
|
134
|
+
- If test count decreased (tests were deleted) → flag as **WARNING**
|
|
135
|
+
- If all tests pass and count is stable or increased → **GREEN**
|
|
136
|
+
|
|
137
|
+
Then verify any new test cases generated by the deep reviewer:
|
|
138
|
+
- Each test must target a specific finding
|
|
139
|
+
- Each test must fail WITHOUT the fix and pass WITH the fix (if we can verify this)
|
|
140
|
+
- Tests that pass regardless of the fix are flagged as `WEAK_TEST`
|
|
141
|
+
|
|
142
|
+
### Enforcement Gate 3 (Final)
|
|
143
|
+
|
|
144
|
+
Invoke `enforcement-gate` one last time on the entire session:
|
|
145
|
+
- Re-run all checks from scratch: `{{TEST_COMMAND}}`, `{{LINT_COMMAND}}`, `{{TYPE_CHECK_COMMAND}}`
|
|
146
|
+
- Verify final state against baseline (test count, pass rate, error counts)
|
|
147
|
+
- Verify every agent's PROOF_OF_INTENT hash matches the original INTENT_HASH
|
|
148
|
+
- Produce final confidence score
|
|
149
|
+
|
|
150
|
+
If REJECTED → report what failed. If APPROVED → proceed to report.
|
|
151
|
+
|
|
152
|
+
## Phase 5: Final Report
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
## Fix Loop Report
|
|
156
|
+
|
|
157
|
+
**Baseline**: X tests (Y passing, Z failing), L lint errors, T type errors
|
|
158
|
+
**Result**: X tests (Y passing, Z failing), L lint errors, T type errors
|
|
159
|
+
|
|
160
|
+
### Phase Results
|
|
161
|
+
| Phase | Agent | Enforcement Verdict | Confidence |
|
|
162
|
+
|-------|-------|-------------------|------------|
|
|
163
|
+
| 1. Fix | build-error-resolver | APPROVED/REJECTED | XX% |
|
|
164
|
+
| 2. Deep Review | deep-reviewer | N/A (read-only) | N/A |
|
|
165
|
+
| 3. Fix Findings | build-error-resolver | APPROVED/REJECTED | XX% |
|
|
166
|
+
| 4. Regression | enforcement-gate | APPROVED/REJECTED | XX% |
|
|
167
|
+
|
|
168
|
+
### Deep Review Findings
|
|
169
|
+
| ID | File:Line | Severity | Category | Status |
|
|
170
|
+
|----|-----------|----------|----------|--------|
|
|
171
|
+
| DR-001 | path:line | CRITICAL | Correctness | FIXED / DEFERRED / MANUAL |
|
|
172
|
+
|
|
173
|
+
### Test Cases Generated
|
|
174
|
+
| Finding | Test File | Status |
|
|
175
|
+
|---------|-----------|--------|
|
|
176
|
+
| DR-001 | path/to/test | PASSING / WEAK / FAILING |
|
|
177
|
+
|
|
178
|
+
### Enforcement Audit Trail
|
|
179
|
+
[For each gate: what was checked, what passed, what failed, confidence score]
|
|
180
|
+
|
|
181
|
+
### Remaining Items (MEDIUM/LOW)
|
|
182
|
+
[Non-blocking findings for user to address at their discretion]
|
|
183
|
+
|
|
184
|
+
### Intent Verification Summary
|
|
185
|
+
[Each agent's INTENT_MATCH status, any DRIFT_DETECTED flags]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## Guardrails
|
|
189
|
+
|
|
190
|
+
- **Max total iterations across all phases**: 10 (prevents infinite loops)
|
|
191
|
+
- **Regression tolerance**: 0 (no previously passing test may break)
|
|
192
|
+
- **Review-fix cap**: 2 iterations (prevents review-fix ping-pong)
|
|
193
|
+
- **Enforcement gates**: 3 mandatory (after Phase 1, after Phase 3, final)
|
|
194
|
+
- **No phase transition without APPROVED or explicit user override**
|
|
195
|
+
- Never suppress or skip a failing test to make the loop pass
|
|
196
|
+
- Never mark a finding as resolved without the enforcement gate confirming it
|
|
197
|
+
- If any phase halts, the report must still be generated with what was completed
|
|
198
|
+
|
|
199
|
+
## Phase 6: Recommend Next Step
|
|
200
|
+
|
|
201
|
+
After the final report, always recommend the single best next action:
|
|
202
|
+
|
|
203
|
+
1. **Manual findings** — if CRITICAL/HIGH findings were deferred, recommend fixing them with specific file:line references
|
|
204
|
+
2. **Weak tests** — if any generated test cases were flagged WEAK, recommend strengthening them
|
|
205
|
+
3. **Security** — if changes touched auth, input handling, or API routes, recommend `/audit-security`
|
|
206
|
+
4. **UAT** — if changes affect user-facing behavior, recommend `/run-uat` with specific scenarios
|
|
207
|
+
5. **PR readiness** — if everything is green, recommend `/pre-pr`
|
|
208
|
+
6. **Dependency check** — if the fix revealed outdated deps, recommend updating them
|
|
209
|
+
7. **Architecture** — if fixes were workarounds, recommend the proper architectural fix
|
|
210
|
+
|
|
211
|
+
Format: **Next step:** one sentence with the specific command or action to take.
|