thevoidforge 21.0.10 → 21.0.12
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/dist/.claude/commands/ai.md +69 -0
- package/dist/.claude/commands/architect.md +121 -0
- package/dist/.claude/commands/assemble.md +201 -0
- package/dist/.claude/commands/assess.md +75 -0
- package/dist/.claude/commands/blueprint.md +135 -0
- package/dist/.claude/commands/build.md +116 -0
- package/dist/.claude/commands/campaign.md +201 -0
- package/dist/.claude/commands/cultivation.md +166 -0
- package/dist/.claude/commands/current.md +128 -0
- package/dist/.claude/commands/dangerroom.md +74 -0
- package/dist/.claude/commands/debrief.md +178 -0
- package/dist/.claude/commands/deploy.md +99 -0
- package/dist/.claude/commands/devops.md +143 -0
- package/dist/.claude/commands/gauntlet.md +140 -0
- package/dist/.claude/commands/git.md +104 -0
- package/dist/.claude/commands/grow.md +146 -0
- package/dist/.claude/commands/imagine.md +126 -0
- package/dist/.claude/commands/portfolio.md +50 -0
- package/dist/.claude/commands/prd.md +113 -0
- package/dist/.claude/commands/qa.md +107 -0
- package/dist/.claude/commands/review.md +151 -0
- package/dist/.claude/commands/security.md +100 -0
- package/dist/.claude/commands/test.md +96 -0
- package/dist/.claude/commands/thumper.md +116 -0
- package/dist/.claude/commands/treasury.md +100 -0
- package/dist/.claude/commands/ux.md +118 -0
- package/dist/.claude/commands/vault.md +189 -0
- package/dist/.claude/commands/void.md +108 -0
- package/dist/CHANGELOG.md +1918 -0
- package/dist/CLAUDE.md +250 -0
- package/dist/HOLOCRON.md +856 -0
- package/dist/VERSION.md +123 -0
- package/dist/docs/NAMING_REGISTRY.md +478 -0
- package/dist/docs/methods/AI_INTELLIGENCE.md +276 -0
- package/dist/docs/methods/ASSEMBLER.md +142 -0
- package/dist/docs/methods/BACKEND_ENGINEER.md +165 -0
- package/dist/docs/methods/BUILD_JOURNAL.md +185 -0
- package/dist/docs/methods/BUILD_PROTOCOL.md +426 -0
- package/dist/docs/methods/CAMPAIGN.md +568 -0
- package/dist/docs/methods/CONTEXT_MANAGEMENT.md +189 -0
- package/dist/docs/methods/DEEP_CURRENT.md +184 -0
- package/dist/docs/methods/DEVOPS_ENGINEER.md +295 -0
- package/dist/docs/methods/FIELD_MEDIC.md +261 -0
- package/dist/docs/methods/FORGE_ARTIST.md +108 -0
- package/dist/docs/methods/FORGE_KEEPER.md +268 -0
- package/dist/docs/methods/GAUNTLET.md +344 -0
- package/dist/docs/methods/GROWTH_STRATEGIST.md +466 -0
- package/dist/docs/methods/HEARTBEAT.md +168 -0
- package/dist/docs/methods/MCP_INTEGRATION.md +139 -0
- package/dist/docs/methods/MUSTER.md +148 -0
- package/dist/docs/methods/PRD_GENERATOR.md +186 -0
- package/dist/docs/methods/PRODUCT_DESIGN_FRONTEND.md +250 -0
- package/dist/docs/methods/QA_ENGINEER.md +337 -0
- package/dist/docs/methods/RELEASE_MANAGER.md +145 -0
- package/dist/docs/methods/SECURITY_AUDITOR.md +320 -0
- package/dist/docs/methods/SUB_AGENTS.md +335 -0
- package/dist/docs/methods/SYSTEMS_ARCHITECT.md +171 -0
- package/dist/docs/methods/TESTING.md +359 -0
- package/dist/docs/methods/THUMPER.md +175 -0
- package/dist/docs/methods/TIME_VAULT.md +120 -0
- package/dist/docs/methods/TREASURY.md +184 -0
- package/dist/docs/methods/TROUBLESHOOTING.md +265 -0
- package/dist/docs/patterns/README.md +52 -0
- package/dist/docs/patterns/ad-billing-adapter.ts +537 -0
- package/dist/docs/patterns/ad-platform-adapter.ts +421 -0
- package/dist/docs/patterns/ai-classifier.ts +195 -0
- package/dist/docs/patterns/ai-eval.ts +272 -0
- package/dist/docs/patterns/ai-orchestrator.ts +341 -0
- package/dist/docs/patterns/ai-router.ts +194 -0
- package/dist/docs/patterns/ai-tool-schema.ts +237 -0
- package/dist/docs/patterns/api-route.ts +241 -0
- package/dist/docs/patterns/backtest-engine.ts +499 -0
- package/dist/docs/patterns/browser-review.ts +292 -0
- package/dist/docs/patterns/combobox.tsx +300 -0
- package/dist/docs/patterns/component.tsx +262 -0
- package/dist/docs/patterns/daemon-process.ts +338 -0
- package/dist/docs/patterns/data-pipeline.ts +297 -0
- package/dist/docs/patterns/database-migration.ts +466 -0
- package/dist/docs/patterns/e2e-test.ts +629 -0
- package/dist/docs/patterns/error-handling.ts +312 -0
- package/dist/docs/patterns/execution-safety.ts +601 -0
- package/dist/docs/patterns/financial-transaction.ts +342 -0
- package/dist/docs/patterns/funding-plan.ts +462 -0
- package/dist/docs/patterns/game-entity.ts +137 -0
- package/dist/docs/patterns/game-loop.ts +113 -0
- package/dist/docs/patterns/game-state.ts +143 -0
- package/dist/docs/patterns/job-queue.ts +225 -0
- package/dist/docs/patterns/kongo-integration.ts +164 -0
- package/dist/docs/patterns/middleware.ts +363 -0
- package/dist/docs/patterns/mobile-screen.tsx +139 -0
- package/dist/docs/patterns/mobile-service.ts +167 -0
- package/dist/docs/patterns/multi-tenant.ts +382 -0
- package/dist/docs/patterns/oauth-token-lifecycle.ts +223 -0
- package/dist/docs/patterns/outbound-rate-limiter.ts +260 -0
- package/dist/docs/patterns/prompt-template.ts +195 -0
- package/dist/docs/patterns/revenue-source-adapter.ts +311 -0
- package/dist/docs/patterns/service.ts +224 -0
- package/dist/docs/patterns/sse-endpoint.ts +118 -0
- package/dist/docs/patterns/stablecoin-adapter.ts +511 -0
- package/dist/docs/patterns/third-party-script.ts +68 -0
- package/dist/scripts/thumper/gom-jabbar.sh +241 -0
- package/dist/scripts/thumper/relay.sh +610 -0
- package/dist/scripts/thumper/scan.sh +359 -0
- package/dist/scripts/thumper/thumper.sh +190 -0
- package/dist/scripts/thumper/water-rings.sh +76 -0
- package/dist/scripts/voidforge.js +1 -1
- package/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# BUILD JOURNAL — Persistent Logging & Audit Trail
|
|
2
|
+
## System Protocol · Used by: All Agents
|
|
3
|
+
|
|
4
|
+
> *Every agent produces output. Every phase leaves a record. Every decision is recoverable.*
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
The build journal is Claude Code's persistent memory across sessions. When context compresses or a new session starts, agents read journal files to recover state instead of re-deriving it. Every phase, every audit, every decision gets logged to disk.
|
|
9
|
+
|
|
10
|
+
## Journal Directory
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
docs/
|
|
14
|
+
LEARNINGS.md ← Project-scoped operational learnings (created on first use)
|
|
15
|
+
logs/
|
|
16
|
+
build-state.md ← Current phase, active agents, blockers, next steps
|
|
17
|
+
phase-00-orient.md ← Picard's PRD extraction, ADRs, gaps, assumptions
|
|
18
|
+
phase-01-scaffold.md ← Framework decisions, file structure, config choices
|
|
19
|
+
phase-02-infrastructure.md ← DB setup, Redis, env verification, boot status
|
|
20
|
+
phase-03-auth.md ← Auth implementation, Kenobi's review, test results
|
|
21
|
+
phase-04-core.md ← Core feature decisions, test results, verification
|
|
22
|
+
phase-05-features.md ← Each feature batch: decisions, tests, verification
|
|
23
|
+
phase-06-integrations.md ← Each integration: config, test mode results, Kenobi review
|
|
24
|
+
phase-07-admin.md ← Admin panel decisions, audit logging setup
|
|
25
|
+
phase-08-marketing.md ← Pages built, SEO, responsive verification
|
|
26
|
+
phase-09-qa-audit.md ← Batman's findings, bug tracker, test results
|
|
27
|
+
phase-10-ux-audit.md ← Galadriel's findings, a11y audit, issue tracker
|
|
28
|
+
phase-11-security-audit.md ← Kenobi's findings, remediation status, checklist
|
|
29
|
+
phase-12-deploy.md ← Infrastructure setup, deploy results, monitoring
|
|
30
|
+
phase-13-launch.md ← Launch checklist status, final verification
|
|
31
|
+
decisions.md ← Running log of all non-obvious decisions
|
|
32
|
+
handoffs.md ← Every agent-to-agent handoff with context
|
|
33
|
+
errors.md ← Every significant error encountered and resolution
|
|
34
|
+
agent-activity.jsonl ← Live agent dispatch log (JSONL — powers Danger Room ticker)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Log Entry Format
|
|
38
|
+
|
|
39
|
+
Every log entry follows this structure:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
### [TIMESTAMP] [AGENT] — [ACTION]
|
|
43
|
+
|
|
44
|
+
**Phase:** [current phase]
|
|
45
|
+
**Status:** completed | in-progress | blocked | skipped
|
|
46
|
+
**Files changed:** [list]
|
|
47
|
+
|
|
48
|
+
**What happened:**
|
|
49
|
+
[2-3 sentences describing what was done and why]
|
|
50
|
+
|
|
51
|
+
**Decisions made:**
|
|
52
|
+
- [Decision]: [Rationale]
|
|
53
|
+
|
|
54
|
+
**Tests:**
|
|
55
|
+
- [test name]: pass/fail
|
|
56
|
+
- Coverage: [X%] for [area]
|
|
57
|
+
|
|
58
|
+
**Blockers/Issues:**
|
|
59
|
+
- [Issue]: [Status]
|
|
60
|
+
|
|
61
|
+
**Next steps:**
|
|
62
|
+
- [What the next agent or phase should do]
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Operational Learnings (`docs/LEARNINGS.md`)
|
|
66
|
+
|
|
67
|
+
Unlike build logs (which are session-scoped), `LEARNINGS.md` is project-scoped and accumulates across sessions. It stores operational facts that code review can't catch — API quirks, decision rationale, root causes, environment constraints.
|
|
68
|
+
|
|
69
|
+
- **Created:** On first approved learning (via `/debrief` Step 2.5 or `/vault` session-end sync)
|
|
70
|
+
- **Read by:** `/build` Phase 0, `/campaign` Step 1, `/architect` Step 0, `/assemble` Phase 0
|
|
71
|
+
- **Written by:** `/debrief` (proposes candidates) → user approves → `/vault` (appends)
|
|
72
|
+
- **Cap:** 50 active entries. Promoted learnings replaced with pointers to `LESSONS.md`
|
|
73
|
+
- **Staleness:** Entries with `verified` older than 90 days flagged as potentially stale at read time
|
|
74
|
+
|
|
75
|
+
See ADR-035 for the full design rationale.
|
|
76
|
+
|
|
77
|
+
## build-state.md — The Master State File
|
|
78
|
+
|
|
79
|
+
This is the most important file. It's read at the start of every session. Keep it under 50 lines.
|
|
80
|
+
|
|
81
|
+
```markdown
|
|
82
|
+
# Build State
|
|
83
|
+
|
|
84
|
+
**Project:** [name]
|
|
85
|
+
**Current Phase:** [X]
|
|
86
|
+
**Last Updated:** [timestamp]
|
|
87
|
+
**Active Agent:** [name]
|
|
88
|
+
|
|
89
|
+
## Phase Status
|
|
90
|
+
| Phase | Status | Gate Passed |
|
|
91
|
+
|-------|--------|-------------|
|
|
92
|
+
| 0 | complete | yes |
|
|
93
|
+
| 1 | complete | yes |
|
|
94
|
+
| 2 | in-progress | — |
|
|
95
|
+
| 3-13 | not started | — |
|
|
96
|
+
|
|
97
|
+
## Current Blockers
|
|
98
|
+
- [none or list]
|
|
99
|
+
|
|
100
|
+
## Deployment
|
|
101
|
+
- **Target:** [Vercel / Railway / VPS / none yet]
|
|
102
|
+
- **Method:** [CLI (`npx vercel --prod`) / Git integration / manual]
|
|
103
|
+
- **Last deployed commit:** [hash or "not yet deployed"]
|
|
104
|
+
- **Production URL:** [url or "N/A"]
|
|
105
|
+
|
|
106
|
+
## Recent Decisions
|
|
107
|
+
- [last 3-5 decisions with rationale]
|
|
108
|
+
|
|
109
|
+
## Next Steps
|
|
110
|
+
1. [immediate next action]
|
|
111
|
+
2. [after that]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## When to Write
|
|
115
|
+
|
|
116
|
+
| Event | Write to | What |
|
|
117
|
+
|-------|----------|------|
|
|
118
|
+
| Phase starts | `phase-XX-*.md` + `build-state.md` | Agent, scope, plan |
|
|
119
|
+
| Non-obvious decision | `decisions.md` + phase log | Decision, rationale, alternatives considered |
|
|
120
|
+
| Phase gate passed | `build-state.md` + phase log | Gate criteria met, test results |
|
|
121
|
+
| Phase gate failed | `build-state.md` + phase log + `errors.md` | What failed, root cause, recovery plan |
|
|
122
|
+
| Agent handoff | `handoffs.md` | From agent, to agent, context, files, blockers |
|
|
123
|
+
| Bug found | Phase log + QA bug tracker | Severity, repro, root cause |
|
|
124
|
+
| Error encountered | `errors.md` + phase log | Error, diagnosis, resolution |
|
|
125
|
+
| Test results | Phase log | Pass/fail, coverage delta |
|
|
126
|
+
| Session ending | `build-state.md` | Current state, what's done, what's next |
|
|
127
|
+
|
|
128
|
+
## When to Read
|
|
129
|
+
|
|
130
|
+
| Event | Read | Why |
|
|
131
|
+
|-------|------|-----|
|
|
132
|
+
| Session starts | `build-state.md` | Know where you are |
|
|
133
|
+
| Starting a new phase | Previous phase log + `build-state.md` | Understand context from prior work |
|
|
134
|
+
| Agent receives handoff | `handoffs.md` + relevant phase log | Get context from handing-off agent |
|
|
135
|
+
| Debugging a failure | `errors.md` + relevant phase log | Check if this has happened before |
|
|
136
|
+
| Context is compressed | `build-state.md` + current phase log | Recover full state |
|
|
137
|
+
| Resuming after interruption | `build-state.md` | Pick up exactly where you left off |
|
|
138
|
+
|
|
139
|
+
## Logging Rules
|
|
140
|
+
|
|
141
|
+
1. **Write after every meaningful action.** Don't wait until the end of a phase to log.
|
|
142
|
+
2. **Log decisions in real-time.** If you're choosing between approaches, log the choice and why.
|
|
143
|
+
3. **Log failures immediately.** The diagnosis process is valuable — capture it.
|
|
144
|
+
4. **Keep build-state.md under 50 lines.** It's loaded every session. Archive completed phases to their individual logs.
|
|
145
|
+
5. **Log test results with every verification.** Pass/fail, coverage numbers, which tests are new.
|
|
146
|
+
6. **Every handoff gets a log entry.** The receiving agent should be able to start from the handoff entry alone.
|
|
147
|
+
7. **Never delete log entries.** Append or update status. The history is the point.
|
|
148
|
+
8. **Log what you tried, not just what worked.** Failed approaches save future sessions from repeating them.
|
|
149
|
+
|
|
150
|
+
## Agent-Specific Logging
|
|
151
|
+
|
|
152
|
+
Each agent produces domain-specific log output:
|
|
153
|
+
|
|
154
|
+
| Agent | Extra Log Content |
|
|
155
|
+
|-------|------------------|
|
|
156
|
+
| **Picard** | ADRs, architecture diagrams, tradeoff analysis |
|
|
157
|
+
| **Stark** | API route inventory, schema changes, integration configs |
|
|
158
|
+
| **Galadriel** | Screen inventory, a11y findings, component state audit |
|
|
159
|
+
| **Batman** | Bug tracker table, test coverage report, regression checklist |
|
|
160
|
+
| **Kenobi** | Security findings with severity, remediation status, checklist |
|
|
161
|
+
| **Kusanagi** | Server inventory, deploy results, health check status, cost log |
|
|
162
|
+
|
|
163
|
+
## Deliverables Logging
|
|
164
|
+
|
|
165
|
+
When an agent produces a deliverable (BACKEND_AUDIT.md, SECURITY_CHECKLIST.md, etc.), log it:
|
|
166
|
+
|
|
167
|
+
```markdown
|
|
168
|
+
### [TIMESTAMP] [AGENT] — Deliverable produced
|
|
169
|
+
|
|
170
|
+
**File:** /docs/SECURITY_AUDIT.md
|
|
171
|
+
**Type:** Security audit report
|
|
172
|
+
**Findings:** 3 critical, 7 high, 12 medium, 5 low
|
|
173
|
+
**Status:** Critical items remediated, high items in progress
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Recovery Protocol
|
|
177
|
+
|
|
178
|
+
When starting a new session after context compression or interruption:
|
|
179
|
+
|
|
180
|
+
1. Read `/logs/build-state.md` — know current phase and blockers
|
|
181
|
+
2. Read the current phase log — understand what's been done
|
|
182
|
+
3. Read `/logs/decisions.md` (last 10 entries) — understand recent choices
|
|
183
|
+
4. If resuming someone else's work, read `/logs/handoffs.md` for context
|
|
184
|
+
5. Continue from the "Next steps" in build-state.md
|
|
185
|
+
6. First action: update build-state.md with your session start
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
# BUILD PROTOCOL — PRD to Production
|
|
2
|
+
## System Protocol · Orchestrates: All Agents · Defined by: **Fury** (Marvel)
|
|
3
|
+
## The Master Sequence
|
|
4
|
+
|
|
5
|
+
> *This is the playbook. Every other method doc is a tool this playbook invokes at the right moment.*
|
|
6
|
+
|
|
7
|
+
## Phase Roster
|
|
8
|
+
|
|
9
|
+
| Phase | Lead | Supporting | Parallelizable |
|
|
10
|
+
|-------|------|-----------|---------------|
|
|
11
|
+
| 0. Orient | **Picard** | All read PRD | No — must complete first |
|
|
12
|
+
| 1. Scaffold | **Stark** + **Kusanagi** | — | No — foundation for everything |
|
|
13
|
+
| 2. Infrastructure | **Kusanagi** | **Stark** (DB) | No — must boot before features |
|
|
14
|
+
| 3. Auth | **Stark** + **Galadriel** | **Kenobi** (review) | No — gates all user features |
|
|
15
|
+
| 4. Core Feature | **Stark** + **Galadriel** | — | No — first vertical slice |
|
|
16
|
+
| 5. Supporting Features | **Stark** + **Galadriel** | **Batman** (regression) | Yes — features can be built in parallel sessions if they don't share schema |
|
|
17
|
+
| 6. Integrations | **Stark** (Romanoff) | **Kenobi** (security) | Yes — independent integrations can be parallel |
|
|
18
|
+
| 7. Admin & Ops | **Stark** + **Galadriel** | **Picard** (review) | Yes — parallel with Phase 8 |
|
|
19
|
+
| 8. Marketing Pages | **Galadriel** | — | Yes — parallel with Phase 7 |
|
|
20
|
+
| 9-11. Review Cycle | **Batman** + **Galadriel** + **Kenobi** | All | Yes — all three run in parallel, then double-pass |
|
|
21
|
+
| 12. Deploy | **Kusanagi** | **Batman** (smoke) | No — sequential, high risk |
|
|
22
|
+
| 13. Launch | All | — | No — final verification |
|
|
23
|
+
|
|
24
|
+
Full character pools: `/docs/NAMING_REGISTRY.md`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Dispatch Model
|
|
29
|
+
|
|
30
|
+
Build phases that involve code generation, testing, or review SHOULD dispatch to sub-agents per `SUB_AGENTS.md` "Parallel Agent Standard." Independent phases (e.g., Phase 4 Core Feature + Phase 5 Supporting Features if they touch different domains) can run as parallel agents. The main thread sequences phases, applies cross-phase gates, and manages the build journal. (Field report #270)
|
|
31
|
+
|
|
32
|
+
## Project Sizing — Read BEFORE Starting
|
|
33
|
+
|
|
34
|
+
Not every project needs all 13 phases. Read the PRD frontmatter (the YAML block at the top of `/docs/PRD.md`) to determine which phases apply.
|
|
35
|
+
|
|
36
|
+
### Frontmatter Validation (Phase 0, first action)
|
|
37
|
+
|
|
38
|
+
Check these values exist and are valid:
|
|
39
|
+
|
|
40
|
+
| Field | Valid Values | Default if Missing |
|
|
41
|
+
|-------|-------------|-------------------|
|
|
42
|
+
| `type` | full-stack, api-only, static-site, prototype, game, quantitative | full-stack |
|
|
43
|
+
| `auth` | yes, no | yes |
|
|
44
|
+
| `payments` | stripe, lemonsqueezy, none | none |
|
|
45
|
+
| `workers` | yes, no | no |
|
|
46
|
+
| `admin` | yes, no | no |
|
|
47
|
+
| `marketing` | yes, no | no |
|
|
48
|
+
| `email` | resend, sendgrid, ses, none | none |
|
|
49
|
+
| `deploy` | vps, vercel, railway, cloudflare, static, docker | vps |
|
|
50
|
+
| `ai` | yes / no | no |
|
|
51
|
+
| `backtest` | yes / no | no |
|
|
52
|
+
| `live_execution` | yes / no | no |
|
|
53
|
+
| `data_source` | exchange / database / api / file | — |
|
|
54
|
+
|
|
55
|
+
If a value is missing or invalid, log it and use the default. If the entire frontmatter block is missing, flag it as a Phase 0 gap and use all defaults.
|
|
56
|
+
|
|
57
|
+
### Implementation Completeness Gate (every phase)
|
|
58
|
+
|
|
59
|
+
Before marking any phase complete, verify: **no function returns hardcoded success without side effects, no method throws `'Implement...'` or `'Not implemented'`, no handler logs a message but performs no work.** If a feature within the phase cannot be fully implemented (e.g., requires external API credentials not yet available), do not create stub files — document it as deferred in ROADMAP.md and move on. Sandbox adapters returning realistic fake data are full implementations, not stubs. This gate is non-negotiable. (Field report: v17.0 assessment found 77 `throw new Error('Implement...')` calls across 8 adapter files shipped as functional.)
|
|
60
|
+
|
|
61
|
+
### Python Framework Detection
|
|
62
|
+
|
|
63
|
+
When `framework` is `django` or `fastapi`:
|
|
64
|
+
- **Phase 1:** Scaffold with `django-admin startproject` or `poetry init` + FastAPI boilerplate
|
|
65
|
+
- **Phase 2:** Use `python manage.py migrate` (Django) or Alembic (FastAPI) for database setup
|
|
66
|
+
- **Phase 9-11:** Use `pytest` instead of `jest/vitest`. Django test client or FastAPI TestClient for endpoint testing.
|
|
67
|
+
- **Patterns:** Load the Django/FastAPI Deep Dive sections from each pattern file (api-route, service, middleware, error-handling, component, job-queue, multi-tenant)
|
|
68
|
+
- **Security:** Check Django-specific settings (SECRET_KEY, DEBUG=True in prod, ALLOWED_HOSTS, CSRF)
|
|
69
|
+
|
|
70
|
+
### Game Project Detection
|
|
71
|
+
|
|
72
|
+
When `type` is `game`:
|
|
73
|
+
- **Phase 1:** Scaffold with engine-specific project structure: Godot project (`godot --path`), Phaser + webpack, Three.js + vite, or Pixi.js
|
|
74
|
+
- **Phase 2:** Game infrastructure: asset pipeline (sprites, audio, fonts), scene management, input system (keyboard/gamepad/touch), audio system
|
|
75
|
+
- **Phase 3:** Replaced by "Game Core" — game loop (fixed timestep + interpolation), ECS or component system, state machines, physics (if applicable)
|
|
76
|
+
- **Phase 4:** Replaced by "Gameplay" — core mechanics, player controller, enemies/AI, level design data structures, collision handling
|
|
77
|
+
- **Phase 5:** Replaced by "Game UI" — HUD, menus, inventory, dialog system, screen transitions, pause overlay
|
|
78
|
+
- **Phase 6:** Replaced by "Polish" — particles, screen shake, hit pause, juice, audio cues, camera dynamics, game feel
|
|
79
|
+
- **Phase 7:** Replaced by "Content" — levels, balancing, progression curves, save/load, difficulty scaling
|
|
80
|
+
- **Phase 8:** Replaced by "Game Marketing" — store page copy, screenshots, trailer script, press kit, itch.io/Steam page
|
|
81
|
+
- **Phase 9-11:** Game-specific QA: frame rate profiling, input latency, memory leaks, speedrun exploit testing, save corruption, platform testing
|
|
82
|
+
- **Phase 12:** Build + export: WebGL, desktop (Electron), mobile, Steam/itch.io distribution
|
|
83
|
+
- **Agents activated:** Spike-GameDev (architecture), Éowyn-GameFeel (juice), Deathstroke-Exploit (game QA), L-Profiler (performance)
|
|
84
|
+
|
|
85
|
+
### Mobile Framework Detection
|
|
86
|
+
|
|
87
|
+
When `deploy` is `ios`, `android`, or `cross-platform`:
|
|
88
|
+
- **Phase 1:** Scaffold with `npx react-native init` (React Native), `flutter create` (Flutter), or Xcode project (SwiftUI)
|
|
89
|
+
- **Phase 5:** Mobile-specific UI: safe area insets, navigation stacks (React Navigation / Navigator), gestures, haptic feedback, platform-specific components (`Platform.select`)
|
|
90
|
+
- **Phase 9 QA additions:** Orientation changes, deep link handling, push notification delivery, offline mode, battery optimization, app backgrounding/foregrounding, memory pressure
|
|
91
|
+
- **Phase 11 Security additions:** Certificate pinning, Keychain (iOS) / Keystore (Android) for secrets, jailbreak/root detection, transport security (ATS/NSC), code obfuscation, no secrets in bundle
|
|
92
|
+
- **Phase 12:** Build + code sign + upload: `xcodebuild` → TestFlight (iOS), `./gradlew assembleRelease` → Play Console (Android)
|
|
93
|
+
- **Agents activated:** Uhura-Mobile (architecture), Samwise-Mobile (a11y), Rex-Mobile (security)
|
|
94
|
+
|
|
95
|
+
### Quantitative Project Detection
|
|
96
|
+
|
|
97
|
+
When `type: "quantitative"` is set in frontmatter:
|
|
98
|
+
|
|
99
|
+
**Phase 2 (Schema):** Migration Safety Gate applies. Data models must support time-series data (timestamps, OHLCV, tick data).
|
|
100
|
+
|
|
101
|
+
**Phase 4 (Core Features):**
|
|
102
|
+
- If `backtest: yes`: verify backtest has no lookahead bias, walk-forward validation is implemented, slippage/commission are modeled. See `docs/patterns/backtest-engine.ts`.
|
|
103
|
+
- If `live_execution: yes`: verify execution layer has order validation, position limits, exchange precision fetched from API (never hardcoded), paper/live toggle, circuit breaker. See `docs/patterns/execution-safety.ts`.
|
|
104
|
+
- Verify data pipeline handles gaps, duplicates, and timezone issues. See `docs/patterns/data-pipeline.ts`.
|
|
105
|
+
|
|
106
|
+
**Phase 12 (Deploy):** If `live_execution: yes`, deploy checklist includes: paper trading period completed, position limits configured, circuit breaker thresholds set, reconciliation verified.
|
|
107
|
+
|
|
108
|
+
**Strategy Whitelist Gate (if `live_execution: yes`):** Every strategy defaults to OFF. Strategy config must include an `enabled: boolean` field defaulting to `false`. To go live, the operator explicitly sets `enabled: true` per strategy. Verify: (1) grep for strategy registration — each must read an `enabled` flag, (2) no strategy bypasses the check via constructor defaults or env var fallbacks that default to `true`, (3) the strategy list shows enabled/disabled state. A strategy that runs because nobody turned it off is the quantitative equivalent of an open firewall. (Field report #277)
|
|
109
|
+
|
|
110
|
+
### Conditional Skip Rules
|
|
111
|
+
|
|
112
|
+
| PRD Frontmatter | Phase to Skip | Reason |
|
|
113
|
+
|-----------------|---------------|--------|
|
|
114
|
+
| `auth: no` | Phase 3 | No authentication needed |
|
|
115
|
+
| `payments: none` | Phase 6 payment section | No payment integration |
|
|
116
|
+
| `admin: no` | Phase 7 | No admin dashboard |
|
|
117
|
+
| `marketing: no` | Phase 8 | No marketing/landing pages |
|
|
118
|
+
| `workers: no` | Phase 6 queue section | No background jobs |
|
|
119
|
+
| `deploy: static` | Phase 2 (partial), Phase 12 (simplified) | Static hosting |
|
|
120
|
+
| `type: api-only` | Phase 8, Galadriel's UX pass in Phases 9-11 | No frontend |
|
|
121
|
+
|
|
122
|
+
When skipping a phase, log it to `/logs/build-state.md`: "Skipping Phase X — PRD indicates [reason]."
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Build Journal — Log Everything
|
|
127
|
+
|
|
128
|
+
Every phase produces a log file in `/logs/`. See `/docs/methods/BUILD_JOURNAL.md` for the full protocol.
|
|
129
|
+
|
|
130
|
+
**Minimum logging per phase:**
|
|
131
|
+
1. Update `/logs/build-state.md` when starting and completing each phase
|
|
132
|
+
2. Write phase-specific log (`/logs/phase-XX-*.md`) with decisions, changes, test results
|
|
133
|
+
3. Log non-obvious decisions to `/logs/decisions.md`
|
|
134
|
+
4. Log agent handoffs to `/logs/handoffs.md`
|
|
135
|
+
|
|
136
|
+
**Why:** When context compresses or a new session starts, agents read journal files to recover state. The journal is your persistent memory.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## The Sequence
|
|
141
|
+
|
|
142
|
+
**Phase 0 — Picard Orients.**
|
|
143
|
+
1. Validate PRD frontmatter (see table above)
|
|
144
|
+
2. Read entire PRD — extract: identity, stack, architecture, data model, routes, flows, tiers, integrations, env vars, deployment target
|
|
145
|
+
3. Determine project profile and skip rules
|
|
146
|
+
4. Flag missing items — list each gap explicitly with "inferred [assumption]" or "BLOCKED — needs answer"
|
|
147
|
+
5. Check for VoidForge vault (`~/.voidforge/vault.enc`). If present, cross-reference env vars from the PRD against vault contents and provisioning state (`~/.voidforge/runs/*.json`). Distinguish "missing credential" (truly BLOCKED) from "vault-available credential" (resolvable via `voidforge deploy`). (Field report #40)
|
|
148
|
+
6. **Wong loads lessons:** Read `/docs/LESSONS.md`. For each entry matching the current project's framework, database, auth pattern, or integration stack, note it: "Lesson from prior build: [summary]." These inform later phases — e.g., if a lesson says "React useEffect render loops escape review," trace render cycles proactively in Phase 4+. Log matched lessons in phase-00-orient.md.
|
|
149
|
+
6a. **Wong loads operational learnings:** If `docs/LEARNINGS.md` exists, read it. For each entry, note the constraint it implies for this build. Entries with `verified` older than 90 days are flagged as potentially stale — note them but verify before relying on them. Learnings inform Phase 2+ decisions: known API quirks prevent repeated dead ends, decision rationale prevents re-evaluation, root causes prevent re-investigation. Log matched learnings in phase-00-orient.md alongside lessons. (ADR-035)
|
|
150
|
+
7. **Troi confirms PRD extraction:** Troi reads the PRD prose and verifies that Picard's extraction (routes, schema, features, integrations) matches what the PRD actually says. Catches misinterpretations before they propagate through 8+ build phases. Log discrepancies in phase-00-orient.md.
|
|
151
|
+
8. **Historical validation for data-dependent systems.** If the project involves trading, financial analysis, pricing, or any domain where the business case depends on real-world data patterns: validate the strategy against historical data BEFORE building infrastructure. Pull trailing 3+ weeks of data from venue/provider APIs, run the analysis, and produce regression tests against historical data points. These regression tests become the ongoing validation suite — re-run weekly (or per-campaign) to detect edge decay. If regression tests start failing mid-campaign, flag dependent strategies for re-evaluation. Do NOT default to "monitor live data for N weeks" when historical data is available — that blocks the entire campaign unnecessarily. (Field report #126)
|
|
152
|
+
9. Produce initial ADRs in `/docs/adrs/`
|
|
153
|
+
10. Create `/logs/build-state.md` and `/logs/phase-00-orient.md`
|
|
154
|
+
11. If PRD has critical gaps (no schema, no stack, no features defined): **STOP. Flag to user. Do not proceed.**
|
|
155
|
+
|
|
156
|
+
**Phase 0.5 — Picard's Conflict Scan.**
|
|
157
|
+
|
|
158
|
+
Before a single line is written, scan the PRD frontmatter for structural contradictions:
|
|
159
|
+
- Auth required but no session store (database: none + auth: yes) → flag
|
|
160
|
+
- Payments enabled but auth disabled (payments: stripe + auth: no) → flag
|
|
161
|
+
- WebSocket features but static/Cloudflare deploy (deploy: cloudflare + features needing persistent connections) → flag
|
|
162
|
+
- Workers enabled but deploy target has no background process support (workers: yes + deploy: vercel) → flag
|
|
163
|
+
- Database specified but deploy target doesn't support persistent storage (database: postgres + deploy: static) → flag
|
|
164
|
+
- Cache specified but deploy target can't run Redis (cache: redis + deploy: static) → flag
|
|
165
|
+
- Admin panel but no auth (admin: yes + auth: no) → flag
|
|
166
|
+
- Email integration but no env vars for provider credentials → flag
|
|
167
|
+
|
|
168
|
+
If any contradictions found: present them to the user with specific resolution options. Do NOT proceed to Phase 1 until all contradictions are resolved or acknowledged. Log resolutions in `/logs/phase-00-orient.md`.
|
|
169
|
+
|
|
170
|
+
This catches architecture mistakes that currently escape until Phase 9-11 reviews — where fixing them costs hours instead of minutes.
|
|
171
|
+
|
|
172
|
+
**Phase 1 — Stark + Kusanagi Scaffold.**
|
|
173
|
+
1. **Migration Completeness Check (existing codebases only):** Before scaffolding, scan for duplicate implementations — same class name, same function name, or same route pattern in multiple directories (e.g., `src/` and `core/`, `v1/` and `v2/`). If found: flag as blocker. An abandoned migration is worse than no migration — two architectures create confusion, duplicate maintenance, and allow each to reference the other. Resolve before proceeding: complete the migration, revert it, or document the boundary. (Field report #125: stubs in `core/services/` returned True without acting while working code in `src/` was never connected.)
|
|
174
|
+
2. **Auth-from-Day-One:** When scaffolding includes HTTP endpoints, require at minimum an API key middleware stub that returns 401 by default. Full auth (JWT, OAuth, 2FA) stays in Phase 3, but every endpoint is locked from birth. The cost of a simple API key check is minutes; the cost of public exposure during Phases 1-2 is catastrophic for financial or data-sensitive systems. (Field report #125: all endpoints shipped with `allow_origins=["*"]`, zero authentication, bound to `0.0.0.0` — existed unprotected for 2+ build phases.)
|
|
175
|
+
3. Initialize framework, configs, schema, directory structure, types, utils, root layout
|
|
176
|
+
4. Set up test runner per `/docs/methods/TESTING.md`
|
|
177
|
+
5. When `e2e: yes` in frontmatter, include Playwright setup in test runner initialization: install `@playwright/test`, create `playwright.config.ts`, write 1 smoke test that verifies the app loads in a browser.
|
|
178
|
+
6. Every placeholder references its PRD section
|
|
179
|
+
6. **Tailwind v4 projects:** If framework is Next.js and styling is Tailwind, create `postcss.config.mjs` (`export default { plugins: { "@tailwindcss/postcss": {} } }`) and ensure `globals.css` starts with `@import "tailwindcss" source("../.."). Tailwind v4's implicit scanning breaks in deployed environments when non-source files (methodology docs, build logs) are scanned.
|
|
180
|
+
7. Log to `/logs/phase-01-scaffold.md`
|
|
181
|
+
|
|
182
|
+
**Phase 2 — Kusanagi Infrastructure.**
|
|
183
|
+
1. Database (Banner assists) -> Redis -> Environment
|
|
184
|
+
2. **Schema-first:** Read the full schema (Prisma schema, Django models, Rails migrations, SQL DDL) for ALL target models before writing any database scripts, seed files, or migration code. Check required fields, unique constraints, foreign keys, default values, and enum types. A migration that misses a NOT NULL constraint or a unique index creates data integrity bugs that compound across every subsequent phase. (Triage fix from field report batch #149-#153.)
|
|
185
|
+
3. **Signature-first:** Read actual function signatures before writing inter-module calls — don't rely on memory or pattern-matching. Open the target file and check parameter names, types, and order. A call that type-checks but passes the wrong value (e.g., a config object where a number was expected) can silently produce incorrect behavior. (Field report #258: `classifyTier()` called with config object as aggregate spend — NaN comparisons fell through to auto_approve.)
|
|
186
|
+
4. Verify: dev server starts, build passes, lint passes, typecheck passes, `npm test` passes
|
|
187
|
+
5. Log to `/logs/phase-02-infrastructure.md`
|
|
188
|
+
|
|
189
|
+
**Migration Safety Gate (conditional — if database migrations exist):**
|
|
190
|
+
Before applying any migration to a production database, verify:
|
|
191
|
+
- [ ] New columns added as nullable (or with defaults) — never bare NOT NULL on existing tables
|
|
192
|
+
- [ ] Column removals preceded by code change that stops reading the column (deploy code first, migrate second)
|
|
193
|
+
- [ ] Large table operations use batched processing (no full-table locks on tables >100k rows)
|
|
194
|
+
- [ ] Every migration has a tested rollback/down migration
|
|
195
|
+
- [ ] Data backfills are idempotent (safe to re-run if interrupted)
|
|
196
|
+
- [ ] Migration tested against production-volume data (not just dev fixtures)
|
|
197
|
+
See `docs/patterns/database-migration.ts` for reference implementations.
|
|
198
|
+
|
|
199
|
+
**Phase 3 — Auth (Kenobi Reviews).**
|
|
200
|
+
1. Providers, login, signup, password reset, sessions, middleware, roles
|
|
201
|
+
2. Password manager compatible
|
|
202
|
+
3. Write auth integration tests — all paths including failures
|
|
203
|
+
4. Kenobi reviews session config, password hashing, CSRF
|
|
204
|
+
5. **Stored value rename check:** Before renaming any constant that is persisted as a stored value (DB column values, cache keys, config identifiers, raw_cache source names, vault keys), grep for ALL references including string literals in SQL queries, pipeline configs, migration files, and test fixtures. Stored values have invisible consumers — a rename that passes TypeScript compilation can break runtime lookups. (Field report #268: FETCH_CONFIGS key rename would have broken 20+ pipeline files referencing source keys in `raw_cache`.)
|
|
205
|
+
6. Log to `/logs/phase-03-auth.md`
|
|
206
|
+
|
|
207
|
+
**Phase 3a — Worker/Job Environment Verification (if workers exist).**
|
|
208
|
+
If the project has BullMQ workers, background jobs, cron processes, or any process that runs outside the main web server: verify that the worker's environment loading matches the web server's. Check for `.env` empty-value shadowing (an empty `KEY=` in `.env` shadows a populated `KEY=value` in `.env.local`). Workers using `dotenv/config` do NOT inherit Next.js/framework env loading — they only see `.env`, not `.env.local` or `.env.production`. (Field report #266: Worker couldn't download from R2 because `.env` had empty `R2_ENDPOINT=` that shadowed the `.env.local` value.)
|
|
209
|
+
|
|
210
|
+
**Phase 4 — Core Feature.**
|
|
211
|
+
1. Single most important user journey, end-to-end vertical slice
|
|
212
|
+
2. Follow patterns: `/docs/patterns/api-route.ts`, `/docs/patterns/service.ts`, `/docs/patterns/component.tsx`
|
|
213
|
+
3. Write unit tests for core service logic + integration tests for API routes
|
|
214
|
+
4. When `e2e: yes`, write one E2E test for the core user journey. This test becomes the canary for all future regressions — if this test breaks, the build is broken.
|
|
215
|
+
5. **Visual intent confirmation:** For visual/layout changes, confirm placement intent (replace vs augment) before coding. "Add logo to hero" and "logo IS the hero" produce very different implementations. Ask: "Should this replace the existing content, or be added alongside it?" (Field report #111)
|
|
216
|
+
6. **Fail-closed defaults:** Privacy-sensitive gates (content filters, scope permissions, visibility rules) MUST default to deny. The unknown/default case blocks access — never allows it. Fail-open is a security bug.
|
|
217
|
+
7. **Sibling grep at build time:** Before committing, grep the codebase for the same pattern in sibling locations (constants, SQL queries, function signatures, router files). Fix ALL instances, not just the one you changed. This catches the #1 source of partial fixes.
|
|
218
|
+
8. Log to `/logs/phase-04-core.md`
|
|
219
|
+
|
|
220
|
+
**AI Gate (conditional — if `ai: yes` in frontmatter):** After the vertical slice is built, Hari Seldon reviews the first AI integration point. Validates: model selection, prompt structure, basic error handling, eval strategy exists. If no AI features in this phase, skip.
|
|
221
|
+
|
|
222
|
+
### Integration Verification Gate (after each service)
|
|
223
|
+
After building a service, verify at least one consumer calls it at the point of decision (not just imports it). Grep for actual call sites: `serviceName.methodName(`. If a service is imported but never called from business logic, flag as CRITICAL — it's decorative, not functional. Building a RiskGuard and wiring it into an observation loop is NOT the same as having strategies call `riskGuard.checkLimits()` before executing. (Field report #151: CapitalAllocator built and "wired" but strategies used hardcoded limits — $25K orders on $5K account.)
|
|
224
|
+
|
|
225
|
+
- **Class instantiation check:** Grep for new class definitions created in this build phase. Verify each is instantiated in the application entrypoint (not just imported). A class with passing unit tests but never instantiated in `main()` or `app.ts` is decorative code.
|
|
226
|
+
|
|
227
|
+
### Data Flow Verification Checkpoint (after Phase 3 wiring)
|
|
228
|
+
Before building features that consume data, verify the pipeline works end-to-end: source -> storage -> consumer. Log one real data point at each stage. If any stage returns zeros, empty arrays, or placeholder data — stop and fix the pipeline before proceeding. Features built on broken data pipelines pass all tests but fail in production. (Field report #152: WebSocket manager had placeholder _update_candles(); all downstream features saw zeros.)
|
|
229
|
+
|
|
230
|
+
### Integration Wiring Check
|
|
231
|
+
|
|
232
|
+
After building a new service, worker, or pipeline, verify it's connected to the system:
|
|
233
|
+
1. Search for `TODO` comments referencing the new feature in existing code
|
|
234
|
+
2. Check existing call sites that should consume the new service — are they updated?
|
|
235
|
+
3. Verify new workers/jobs are registered in the main entry point (e.g., `workers/index.ts`)
|
|
236
|
+
4. Check that new API routes are imported in the router
|
|
237
|
+
5. **Parameter threading check:** For any feature that passes context (user_id, org_id, tenant_id) through multiple layers, trace the parameter from the HTTP boundary to the final DB query. Verify each intermediate function accepts and forwards the parameter. A grep for the parameter name in each file on the call chain is the minimum check. (Field report #99: entire per-user fetch pipeline was a no-op — user_id computed then silently discarded at the function boundary.)
|
|
238
|
+
6. **Frontend route registration:** For every new page component or tab, verify a corresponding route exists in the router configuration (App.tsx, router.ts, or equivalent). For every new API endpoint consumed by frontend, verify the fetch call exists. Grep `Route.*path=` or framework equivalent in the router file after adding new pages. (Field report #99: ConnectionsTab built but unreachable — no route in App.tsx.)
|
|
239
|
+
7. **Consumer verification:** For new configuration/preference stores, verify at least one consumer reads the stored values and changes behavior accordingly. A preference that is stored but never read is dead code. (Field report #99: widget preferences API built but no pipeline consumer checked preferences before processing.)
|
|
240
|
+
8. **Cross-language contract check:** When the project has multiple languages (e.g., Python backend + TypeScript frontend), verify field names match across boundaries. A Python model returning `sender` while TypeScript expects `sender_jid` causes silent data loss. Grep both codebases for shared entity field names.
|
|
241
|
+
|
|
242
|
+
New infrastructure that isn't wired to consumers is dead code. This check runs at the end of every build mission, not deferred to review. (Field report #33: entire enrichment pipeline was dead code — orchestrator built but never connected to conversation engine.)
|
|
243
|
+
|
|
244
|
+
### Deferred Wiring Check
|
|
245
|
+
Grep for deferred wiring comments: `Set after`, `Wire after`, `None #`, `TODO: wire`. Verify each was resolved. Unresolved deferred wiring is decorative code.
|
|
246
|
+
|
|
247
|
+
**Multi-tenant sweep (conditional):** If this phase adds or modifies auth, ownership, or multi-tenant logic, run an org_id/ownership sweep: grep all `WHERE id = ?` (or ORM equivalent) queries across all routes/services and verify each includes an ownership check (`AND org_id = ?`, `AND userId = ?`, or equivalent). This catches IDOR vulnerabilities from queries that filter by primary key without scoping to the authenticated user's tenant.
|
|
248
|
+
|
|
249
|
+
**Role enforcement sweep (conditional):** If this phase adds new API endpoints, verify each non-GET endpoint has role/permission enforcement. Grep for route registrations without auth middleware: any POST/PATCH/DELETE endpoint missing a `require_role`, `requireAuth`, or equivalent middleware is a security gap.
|
|
250
|
+
|
|
251
|
+
**Phase 5 — Supporting Features.**
|
|
252
|
+
1. Build in dependency order: schema -> API -> UI -> wire up -> verify
|
|
253
|
+
2. One batch = one feature or tightly coupled feature group (max ~200 lines changed per batch)
|
|
254
|
+
3. After each batch: build passes, previous flows work, new flow works, all tests pass
|
|
255
|
+
4. If a batch breaks a previous flow: revert the batch, isolate the conflict, fix, re-verify (see Rollback below)
|
|
256
|
+
5. **Enum/tier consumer sweep:** When adding new enum values (tiers, roles, statuses, categories), grep ALL consumers of that enum. Verify each handles the new value. Prefer centralized config lookups (e.g., `getTierConfig(tier)`) over hardcoded comparisons (`tier === 'PRO' || tier === 'ENTERPRISE'`). This is the #1 source of tier enforcement drift.
|
|
257
|
+
6. **Split router file warning:** If the project has multiple router files (e.g., `router.ts` + `api-router.ts`, or framework-split `routes/` directories), verify sibling fixes hit ALL router files. When adding auth middleware, rate limiting, or error handling to one router, grep for sibling route registrations in other router files. (Field report #99: dual router files caused sibling fixes to miss half the routes.)
|
|
258
|
+
7. Log each batch to `/logs/phase-05-features.md`
|
|
259
|
+
|
|
260
|
+
**Phase 6 — Integrations.**
|
|
261
|
+
1. Each integration: client wrapper, env vars, test mode, error handling, retry logic
|
|
262
|
+
2. For async work, follow `/docs/patterns/job-queue.ts`
|
|
263
|
+
3. Kenobi reviews each integration
|
|
264
|
+
4. Log to `/logs/phase-06-integrations.md`
|
|
265
|
+
|
|
266
|
+
**Phase 7 — Admin & Operations.**
|
|
267
|
+
1. Dashboard, user management, analytics views, billing, audit logging
|
|
268
|
+
2. Log to `/logs/phase-07-admin.md`
|
|
269
|
+
|
|
270
|
+
**Phase 8 — Marketing Pages.**
|
|
271
|
+
1. Homepage, features, pricing, legal, SEO meta
|
|
272
|
+
2. **Cross-surface consistency sweep:** After changing pricing, tier names, feature descriptions, or agent counts, search for OLD values across ALL surfaces: marketing pages, dashboard CTAs, API error messages, email templates, JSON-LD structured data, admin panels, README, HOLOCRON. Numeric claims ("170+ agents", "13 phases") must match actual counts.
|
|
273
|
+
3. Log to `/logs/phase-08-marketing.md`
|
|
274
|
+
|
|
275
|
+
**Phases 9-11 — Double-Pass Review Cycle (Batman + Galadriel + Kenobi).**
|
|
276
|
+
|
|
277
|
+
The review phases use a double-pass pattern: find → fix → re-verify. This catches fix-induced regressions — the #1 source of shipped bugs.
|
|
278
|
+
|
|
279
|
+
**Screenshot before commit for visual changes:** If the change affects visual output (CSS, HTML, component render), capture a Playwright screenshot before committing. Verify the render matches expectations. Three broken versions were deployed before screenshots caught a chart rendering bug.
|
|
280
|
+
|
|
281
|
+
*Pass 1 — Find (parallel):*
|
|
282
|
+
1. Batman executes `/docs/methods/QA_ENGINEER.md` through Step 5 (find + fix). Oracle, Red Hood, Alfred, Deathstroke, Constantine scan in parallel. When E2E tests exist, run `npm run test:e2e` alongside unit tests. E2E failures in the review cycle are treated as findings.
|
|
283
|
+
2. Galadriel executes `/docs/methods/PRODUCT_DESIGN_FRONTEND.md` through Step 6. Elrond, Arwen, Samwise analyze in parallel.
|
|
284
|
+
3. Kenobi executes `/docs/methods/SECURITY_AUDITOR.md` Phase 1-2. Leia, Chewie, Rex, Maul scan in parallel, then Yoda, Windu, Ahsoka, Padmé sequentially.
|
|
285
|
+
4. If AI code exists, Hari Seldon runs alongside Batman, Galadriel, and Kenobi in the review cycle. Seldon deploys: Salvor Hardin (models) + Gaal Dornick (prompts) + Hober Mallow (tools) + Bliss (safety) in parallel.
|
|
286
|
+
5. Log findings to `/logs/phase-09-qa-audit.md`, `/logs/phase-10-ux-audit.md`, `/logs/phase-11-security-audit.md`
|
|
287
|
+
|
|
288
|
+
*Fix batch:*
|
|
289
|
+
5. Resolve all critical/high findings across all three audits. Where findings conflict between agents (e.g., security fix degrades UX), apply conflict resolution from SUB_AGENTS.md.
|
|
290
|
+
|
|
291
|
+
**Build artifact verification (conditional — if project has a separate build step for workers/scripts):**
|
|
292
|
+
After running any build command (`build:workers`, `tsc --build`, webpack, etc.), verify the compiled output contains the expected code. Grep the output directory for key exports, function names, or registrations that were added since the last build. Tests run against source files — a stale `dist/` that's missing your new code will pass all tests but fail in production. (Field report #263: `dist/workers/index.js` was stale, missing 4 new worker registrations — cron jobs never fired despite source being correct.)
|
|
293
|
+
|
|
294
|
+
**Process reload gate (if project uses a process manager):** After any build step (`npm run build`, `next build`, `tsc`), the running process MUST be reloaded via its process manager (`pm2 reload`, `systemctl restart`, `docker compose restart`) before verification. A build that completes but is never loaded into the running process is invisible to users — health checks pass against the old process while serving stale code. Verify the health endpoint reports the new build hash after reload. (Field reports #278, #279)
|
|
295
|
+
|
|
296
|
+
*Pass 2 — Re-Verify (parallel):*
|
|
297
|
+
6. Batman: Nightwing re-runs test suite + Red Hood re-probes fixed areas + Deathstroke re-tests authorization boundaries.
|
|
298
|
+
7. Galadriel: Samwise re-audits a11y on modified components + Radagast re-checks edge cases.
|
|
299
|
+
8. Kenobi: Maul re-probes all remediated vulnerabilities, verifies fixes hold.
|
|
300
|
+
9. If Pass 2 finds new issues, fix and re-verify until clean.
|
|
301
|
+
|
|
302
|
+
**Phase 12 — Kusanagi Deploys.**
|
|
303
|
+
1. Execute `/docs/methods/DEVOPS_ENGINEER.md` full sequence
|
|
304
|
+
2. Complete first-deploy pre-flight checklist (see `/devops` command)
|
|
305
|
+
3. **Route registration check:** Verify all new API/route files are imported in the server entry point. Grep the entry point (e.g., `server.ts`, `app.ts`, `urls.py`) for imports of every new route file created during this build. An exported handler that isn't imported is a silent 404. (Field report #258: blueprint API routes exported but never registered via `addRoute()` in `server.ts` — wizard UI silently 404'd.)
|
|
306
|
+
4. **Docker smoke test (field report #147):** If the project uses Docker/docker-compose, verify the container entrypoint runs the NEW code, not a legacy file. Run `docker compose up --build` (or equivalent) and confirm the process that starts is the architecture you just built. A 39-mission campaign once shipped with the legacy entrypoint because nobody checked what `CMD` pointed to.
|
|
307
|
+
5. **Schema.sql sync gate:** After applying any migrations, regenerate `schema.sql` from the live database (e.g., `sqlite3 db.sqlite3 .schema > schema.sql`). Post-process the output: add `IF NOT EXISTS` to all `CREATE TABLE` and `CREATE INDEX` statements, remove `sqlite_sequence` (cannot be created manually). Commit the updated schema.sql. Stale schema.sql files cause false findings in `/assess` and mislead downstream consumers. (Field reports #232, #242)
|
|
308
|
+
6. **Reference file freshness:** Before running `/assess` on an existing codebase, regenerate reference files (schema.sql, API docs, type exports) from the live system. Stale reference files generate false findings that waste triage time — the v7.0 assessment over-reported multi-tenant gaps because schema.sql showed 20 tables vs 52 actual. (Field report #232)
|
|
309
|
+
7. Log to `/logs/phase-12-deploy.md`
|
|
310
|
+
|
|
311
|
+
### The Living PRD
|
|
312
|
+
|
|
313
|
+
The PRD evolves with the build. At each phase gate (4, 6, 8), Troi checks: does the implementation match the PRD? If it deviates:
|
|
314
|
+
1. **Code bug** — the code is wrong, fix it to match the PRD
|
|
315
|
+
2. **PRD drift** — the PRD was wrong or incomplete. Update the PRD section to match what was actually built. Mark the change: `<!-- Updated in Phase N: [reason] -->`
|
|
316
|
+
3. **Intentional deviation** — log as ADR: "PRD said X, we built Y, because Z"
|
|
317
|
+
|
|
318
|
+
**Troi's compliance check is two-way:** fix the code OR update the PRD. The PRD stays true because it evolves with reality. At the end of the build, diff the final PRD against the Phase 0 snapshot — the diff is the "PRD Drift View" that shows how the plan evolved during execution.
|
|
319
|
+
|
|
320
|
+
Store the Phase 0 PRD snapshot as `docs/PRD-snapshot-phase0.md` (or a git tag). The diff between snapshot and final PRD is the living document's evolution record.
|
|
321
|
+
|
|
322
|
+
**Phase 12.5 — Wong's Pattern Usage Log.**
|
|
323
|
+
After build completes and before launch, Wong logs which patterns were used in this build:
|
|
324
|
+
1. For each file created during the build, check if it follows a pattern from `docs/patterns/`
|
|
325
|
+
2. Log: pattern name, framework adaptation used (if any), custom modifications made
|
|
326
|
+
3. Store in project-level `docs/pattern-usage.json` (or append to existing)
|
|
327
|
+
4. This data feeds Wong's promotion analysis in `/debrief` — recurring variations across 10+ projects become candidate patterns
|
|
328
|
+
|
|
329
|
+
**Phase 13 — Launch Checklist.**
|
|
330
|
+
All flows in production. SSL. Email. Payments. Analytics. Monitoring. Backups. Security headers. Legal. Performance. Mobile. Accessibility. Tests passing. **Build-time env var verification:** For every new `NEXT_PUBLIC_*` / `VITE_*` / `REACT_APP_*` reference introduced during this build, verify the variable exists in `.env` or the deploy environment. Missing build-time vars cause features to silently disappear without errors. (Field report #104) Log final status to `/logs/phase-13-launch.md`.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## Phase Verification Gates
|
|
335
|
+
|
|
336
|
+
Every phase must pass its gate before proceeding. Each gate requires BOTH manual verification AND automated checks where applicable.
|
|
337
|
+
|
|
338
|
+
| Phase | Manual Verification | Automated Check | Fail = |
|
|
339
|
+
|-------|-------------------|----------------|--------|
|
|
340
|
+
| 0 | All PRD sections accounted for | Frontmatter validates | STOP — fix PRD |
|
|
341
|
+
| 1 | Directory structure looks right | `npm run build` passes, test runner works | Fix before proceeding |
|
|
342
|
+
| 2 | Dev server starts in browser | `npm test` passes, DB connects | Fix infra |
|
|
343
|
+
| 3 | Login/signup/logout flow works in browser | Auth integration tests pass | Fix auth |
|
|
344
|
+
| 4 | Walk through core journey end-to-end. **Troi:** routes/components match PRD §4. **Padmé:** primary flow completes end-to-end. | Core service tests pass (>80% coverage) | Fix before adding features |
|
|
345
|
+
| 5 | Each new feature works, previous flows still work | All tests pass, no regressions | Revert batch, fix |
|
|
346
|
+
| 6 | Each integration works in test mode. **Padmé:** integrations work in the primary flow. | Integration tests pass | Fix integration |
|
|
347
|
+
| 7 | Admin views show real data, audit log works | Tests pass | Fix |
|
|
348
|
+
| 8 | Pages render on mobile + desktop. **Troi:** landing page matches PRD brand section. | Build passes | Fix |
|
|
349
|
+
| 9-11 Pass 1 | All critical/high findings identified | All agents report | Fix in batch |
|
|
350
|
+
| 9-11 Pass 2 | Fixes verified, no regressions | Re-verification clean | Fix new issues, re-verify |
|
|
351
|
+
| 12 | App loads in production, health check passes | Monitoring receives data, backup runs | Rollback + fix |
|
|
352
|
+
| 13 | All checklist items verified | All tests pass in production | Fix before launch |
|
|
353
|
+
|
|
354
|
+
**Gate failure protocol:** Log the failure in the phase log and `/logs/errors.md`. Do not advance to the next phase. Fix the issue, re-verify, then proceed.
|
|
355
|
+
|
|
356
|
+
---
|
|
357
|
+
|
|
358
|
+
## Test Execution Timeline
|
|
359
|
+
|
|
360
|
+
Tests are written alongside features, not bolted on later. This is the authoritative timeline:
|
|
361
|
+
|
|
362
|
+
| Phase | Test Activity | Breaking Gate? |
|
|
363
|
+
|-------|-------------|---------------|
|
|
364
|
+
| 1 | Test runner set up, first smoke test | Yes — runner must work |
|
|
365
|
+
| 2 | Infrastructure verified via test commands | Yes — `npm test` must pass |
|
|
366
|
+
| 3 | Auth integration tests written | Yes — auth tests must pass |
|
|
367
|
+
| 4 | Core service unit tests + API integration tests | Yes — >80% core service coverage |
|
|
368
|
+
| 5 | Tests for each feature batch | Yes — all tests must pass before next batch |
|
|
369
|
+
| 6 | Integration tests for each external service | Yes — test mode must work |
|
|
370
|
+
| 9 | Nightwing runs full suite, writes missing tests | Yes — suite must be green |
|
|
371
|
+
| 12 | Smoke tests in production | Yes — health check must pass |
|
|
372
|
+
|
|
373
|
+
"Breaking gate" = failing tests prevent phase advancement. No exceptions.
|
|
374
|
+
|
|
375
|
+
**Emergency callback testing:** Test emergency/shutdown callbacks for actual behavior, not just invocation count. A callback that calls `pause()` instead of `cancel()` passes a mock test but fails in production.
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Phase Rollback Strategy
|
|
380
|
+
|
|
381
|
+
When a batch or phase introduces a regression:
|
|
382
|
+
|
|
383
|
+
0. **Verify branch:** `git branch --show-current` — confirm you're on the expected branch before reverting. Rolling back on `main` when you meant a feature branch corrupts shared history. (Field report #281)
|
|
384
|
+
1. **Identify:** Which batch/commit introduced the regression?
|
|
385
|
+
2. **Revert:** `git revert <commit>` or `git stash` the batch changes
|
|
386
|
+
3. **Verify:** Confirm the regression is gone — run tests, walk through affected flow
|
|
387
|
+
4. **Isolate:** In the reverted code, identify the specific change that caused the break
|
|
388
|
+
5. **Fix:** Apply the fix in isolation, test it against the affected flow
|
|
389
|
+
6. **Re-apply:** Re-introduce the original batch with the fix included
|
|
390
|
+
7. **Log:** Document in `/logs/errors.md`: what broke, why, how it was fixed
|
|
391
|
+
|
|
392
|
+
**Never:** Force through a failing gate. Stack untested changes. Proceed hoping the next phase will fix it.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## Small Batches — Definition
|
|
397
|
+
|
|
398
|
+
A "small batch" means:
|
|
399
|
+
- **One user flow or component cluster** per batch
|
|
400
|
+
- **Max ~200 lines of production code changed** (tests don't count toward this limit)
|
|
401
|
+
- **One clear sentence** describes what the batch does
|
|
402
|
+
- **Independently verifiable** — you can test this batch without building the next one
|
|
403
|
+
|
|
404
|
+
Examples of good batches:
|
|
405
|
+
- "Add project creation: schema + API route + service + basic form"
|
|
406
|
+
- "Add project list page with pagination and empty state"
|
|
407
|
+
- "Add Stripe webhook handler for subscription events"
|
|
408
|
+
|
|
409
|
+
Examples of batches that are too big:
|
|
410
|
+
- "Add all CRUD operations for projects, teams, and billing"
|
|
411
|
+
- "Implement the entire dashboard"
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Principles
|
|
416
|
+
|
|
417
|
+
1. PRD is source of truth. Agents don't override product decisions. If the PRD is ambiguous, flag it and present options — don't decide product direction.
|
|
418
|
+
2. Build vertically. Complete one flow before starting the next.
|
|
419
|
+
3. Verify at every step. Run the app. Click through. Prove it works.
|
|
420
|
+
4. Small diffs. Each change explainable in one sentence. Max ~200 lines per batch.
|
|
421
|
+
5. Flag unknowns early. Ambiguity gets flagged, not guessed.
|
|
422
|
+
6. Infrastructure before features. A feature on broken infra is useless.
|
|
423
|
+
7. Method docs are tools, not bureaucracy. Follow the spirit, not just the letter.
|
|
424
|
+
8. Test as you build. Write tests alongside features. Tests are a breaking gate.
|
|
425
|
+
9. Skip what doesn't apply. Not every project needs every phase.
|
|
426
|
+
10. Log everything. Decisions, test results, failures, handoffs. The journal is your memory.
|