hool-cli 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,6 +2,8 @@ import fs from 'fs/promises';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import os from 'os';
|
|
4
4
|
const CLAUDE_MCP_CONFIG_PATH = path.join(os.homedir(), '.claude', 'mcp_servers.json');
|
|
5
|
+
const HOOL_START_MARKER = '<!-- HOOL:START -->';
|
|
6
|
+
const HOOL_END_MARKER = '<!-- HOOL:END -->';
|
|
5
7
|
function getMcpSection(projectType) {
|
|
6
8
|
const mcps = ['- **context7**: Use `mcp__context7__resolve-library-id` and `mcp__context7__query-docs` for up-to-date library documentation'];
|
|
7
9
|
if (['web-app', 'browser-game', 'animation'].includes(projectType)) {
|
|
@@ -12,8 +14,9 @@ function getMcpSection(projectType) {
|
|
|
12
14
|
}
|
|
13
15
|
return mcps.join('\n');
|
|
14
16
|
}
|
|
15
|
-
function generateClaudeMd(config) {
|
|
16
|
-
return
|
|
17
|
+
function generateClaudeMd(config, orchestratorContent) {
|
|
18
|
+
return `${HOOL_START_MARKER}
|
|
19
|
+
# HOOL — Agent-Driven SDLC
|
|
17
20
|
|
|
18
21
|
This project uses the HOOL framework. The Product Lead is the sole user-facing agent.
|
|
19
22
|
All other agents are internal — dispatched by the Product Lead as subagents.
|
|
@@ -21,12 +24,12 @@ All other agents are internal — dispatched by the Product Lead as subagents.
|
|
|
21
24
|
## Quick Start
|
|
22
25
|
|
|
23
26
|
You are the Product Lead. On every invocation — **before answering any question**:
|
|
24
|
-
1. Read
|
|
25
|
-
2. Read \`operations/
|
|
26
|
-
3. Read \`
|
|
27
|
-
4. Read your
|
|
27
|
+
1. Read \`operations/current-phase.md\` to know where you are
|
|
28
|
+
2. Read \`operations/task-board.md\` to know what's in flight
|
|
29
|
+
3. Read your memory files (\`memory/product-lead/hot.md\`, \`best-practices.md\`, \`issues.md\`)
|
|
30
|
+
4. Read the full orchestrator prompt below — your complete process and rules
|
|
28
31
|
5. **If there are pending tasks**: Tell the user what's pending and ask if you should proceed, or if they have something else in mind. Do NOT silently wait for explicit instructions — you are the driver, not a passenger.
|
|
29
|
-
6. Continue from where you left off (see Autonomous Execution Loop
|
|
32
|
+
6. Continue from where you left off (see Autonomous Execution Loop below)
|
|
30
33
|
|
|
31
34
|
## How to Dispatch Subagents
|
|
32
35
|
|
|
@@ -62,24 +65,49 @@ Phase 4 (Architecture) is the FINAL human gate. After that, you run autonomously
|
|
|
62
65
|
- You are the **sole user-facing agent** — the user only talks to you
|
|
63
66
|
- All state lives in files: \`phases/\`, \`operations/\`, \`memory/\`
|
|
64
67
|
- Agents never modify their own prompts — escalate to \`operations/needs-human-review.md\`
|
|
65
|
-
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Orchestrator Prompt
|
|
72
|
+
|
|
73
|
+
${orchestratorContent}
|
|
74
|
+
${HOOL_END_MARKER}
|
|
66
75
|
`;
|
|
67
76
|
}
|
|
68
77
|
export class ClaudeCodeAdapter {
|
|
69
78
|
platform = 'claude-code';
|
|
70
79
|
async injectInstructions(config) {
|
|
71
80
|
const claudeMdPath = path.join(config.projectDir, 'CLAUDE.md');
|
|
72
|
-
const
|
|
73
|
-
|
|
81
|
+
const orchestratorPath = path.join(config.projectDir, '.hool', 'prompts', 'orchestrator.md');
|
|
82
|
+
let orchestratorContent = '';
|
|
83
|
+
try {
|
|
84
|
+
orchestratorContent = await fs.readFile(orchestratorPath, 'utf-8');
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Fallback: read from promptsDir (source) if .hool/prompts doesn't exist yet
|
|
88
|
+
try {
|
|
89
|
+
orchestratorContent = await fs.readFile(path.join(config.promptsDir, 'orchestrator.md'), 'utf-8');
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
orchestratorContent = '<!-- orchestrator.md not found — run hool init to generate -->';
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const content = generateClaudeMd(config, orchestratorContent);
|
|
96
|
+
// Replace between markers, append, or create new
|
|
74
97
|
try {
|
|
75
98
|
const existing = await fs.readFile(claudeMdPath, 'utf-8');
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
const startIdx = existing.indexOf(HOOL_START_MARKER);
|
|
100
|
+
const endIdx = existing.indexOf(HOOL_END_MARKER);
|
|
101
|
+
if (startIdx >= 0 && endIdx >= 0) {
|
|
102
|
+
// Marker-based replacement — clean upgrade path
|
|
103
|
+
const before = existing.slice(0, startIdx);
|
|
104
|
+
const after = existing.slice(endIdx + HOOL_END_MARKER.length);
|
|
105
|
+
await fs.writeFile(claudeMdPath, before + content + after, 'utf-8');
|
|
106
|
+
}
|
|
107
|
+
else if (existing.includes('# HOOL')) {
|
|
108
|
+
// Legacy format (pre-markers) — replace from old header onwards
|
|
109
|
+
const legacyIdx = existing.indexOf('# HOOL');
|
|
110
|
+
await fs.writeFile(claudeMdPath, existing.slice(0, legacyIdx) + content, 'utf-8');
|
|
83
111
|
}
|
|
84
112
|
else {
|
|
85
113
|
await fs.writeFile(claudeMdPath, existing + '\n\n' + content, 'utf-8');
|
|
@@ -118,7 +146,7 @@ export class ClaudeCodeAdapter {
|
|
|
118
146
|
'',
|
|
119
147
|
' Start building:',
|
|
120
148
|
' $ claude',
|
|
121
|
-
' >
|
|
149
|
+
' > Begin Phase 1: Brainstorm',
|
|
122
150
|
'',
|
|
123
151
|
' Or if you have the /hool skill registered:',
|
|
124
152
|
' > /hool start',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../src/adapters/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAGpB,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 -19,25 +19,29 @@ export function getOnboardOperationTemplates(mode = 'interactive') {
|
|
|
19
19
|
- **Phase**: onboarding
|
|
20
20
|
- **Status**: awaiting-analysis
|
|
21
21
|
|
|
22
|
-
Onboarding an existing project. The Product Lead will:
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
27
|
-
5.
|
|
28
|
-
6. Present a summary for human review
|
|
22
|
+
Onboarding an existing project. See the "Onboarding Process" section in the orchestrator prompt for the full scan checklist and phase doc requirements. The Product Lead will:
|
|
23
|
+
1. Full project scan — read ALL docs, configs, code structure, git history
|
|
24
|
+
2. Reverse-engineer EVERY applicable phase doc (brainstorm, spec, design, architecture, LLDs, test plan)
|
|
25
|
+
3. Populate operations files (bugs from TODOs, tech debt, inconsistencies, client preferences)
|
|
26
|
+
4. Seed agent memory with findings
|
|
27
|
+
5. Present comprehensive summary for human review
|
|
29
28
|
|
|
30
29
|
After onboarding completes and human reviews, phase transitions to **standby**.
|
|
31
30
|
`,
|
|
32
31
|
'task-board.md': `# Task Board
|
|
33
32
|
|
|
34
33
|
## Active Tasks
|
|
35
|
-
- [ ] ONBOARD-001:
|
|
36
|
-
- [ ] ONBOARD-002:
|
|
37
|
-
- [ ] ONBOARD-003: Spec inference —
|
|
38
|
-
- [ ] ONBOARD-004:
|
|
39
|
-
- [ ] ONBOARD-005:
|
|
40
|
-
- [ ] ONBOARD-006:
|
|
34
|
+
- [ ] ONBOARD-001: Full project scan — read ALL docs (README, CLAUDE.md, CONTRIBUTING, CHANGELOG, docs/, AI instruction files), ALL configs (package.json/pyproject.toml/etc, tsconfig, eslint, docker, CI/CD, .env.example), ALL existing memory (memory/*/best-practices.md, issues.md, cold.md, governor-feedback.md — PRESERVE these), any MEMORY.md/LEARNINGS.md/docs/.agent-memory/, existing HOOL state (operations/, phases/, .hool/*.json), map directory tree, identify entry points, git log -50, git shortlog -sn | assigned: product-lead
|
|
35
|
+
- [ ] ONBOARD-002: Brainstorm extraction — reverse-engineer phases/01-brainstorm/brainstorm.md from README, docs, git history. Capture: vision, goals, target users, key decisions, constraints. Tag all items [INFERRED] | assigned: product-lead | depends: ONBOARD-001
|
|
36
|
+
- [ ] ONBOARD-003: Spec inference — reverse-engineer phases/02-spec/spec.md from code behavior, existing tests (test names ARE spec), API endpoints, UI screens, docs. Write user stories with acceptance criteria. Tag each: [FROM-CODE], [FROM-TESTS], [FROM-DOCS], [INFERRED]. Flag anything that looks like a bug | assigned: product-lead | depends: ONBOARD-001
|
|
37
|
+
- [ ] ONBOARD-004: Architecture extraction — reverse-engineer phases/04-architecture/architecture.md, contracts/, schema.md, flows/ from code structure, configs, dependency graph, API routes, DB schemas/migrations/models | assigned: product-lead | depends: ONBOARD-001
|
|
38
|
+
- [ ] ONBOARD-005: Design extraction (if FE exists) — reverse-engineer phases/03-design/design.md from frontend components, CSS/design tokens, layouts. Skip if no frontend | assigned: product-lead | depends: ONBOARD-001
|
|
39
|
+
- [ ] ONBOARD-006: FE LLD extraction (if FE exists) — reverse-engineer phases/05-fe-scaffold/fe-lld.md from frontend code patterns, component hierarchy, routing, state management. Skip if no frontend | assigned: product-lead | depends: ONBOARD-004
|
|
40
|
+
- [ ] ONBOARD-007: BE LLD extraction (if BE exists) — reverse-engineer phases/06-be-scaffold/be-lld.md from backend code patterns, service layer, middleware, data access. Skip if no backend | assigned: product-lead | depends: ONBOARD-004
|
|
41
|
+
- [ ] ONBOARD-008: Test plan extraction — reverse-engineer phases/07-test-plan/test-plan.md from existing test files, test configs, CI test commands. Map existing tests to spec stories. Capture coverage gaps | assigned: product-lead | depends: ONBOARD-003
|
|
42
|
+
- [ ] ONBOARD-009: Operations population — scan for TODOs/FIXMEs/HACK (→ bugs.md), tech debt/code smells (→ issues.md), doc-vs-code gaps (→ inconsistencies.md), infer client preferences from configs/lint rules (→ client-preferences.md) | assigned: product-lead | depends: ONBOARD-001
|
|
43
|
+
- [ ] ONBOARD-010: Seed agent memory — route findings to agent memory files (see orchestrator "Memory Seeding" section for per-agent routing). Write each finding from the receiving agent's perspective. A finding CAN go to multiple agents if actionable from each role. Skip agents the project doesn't use. Append to existing memory, don't overwrite | assigned: product-lead | depends: ONBOARD-002 ONBOARD-003 ONBOARD-004 ONBOARD-009
|
|
44
|
+
- [ ] ONBOARD-011: Human review gate — write summary to needs-human-review.md listing every phase doc produced with confidence level, all inconsistencies, all issues. Present to user for review | assigned: product-lead | depends: ONBOARD-010
|
|
41
45
|
|
|
42
46
|
## Completed Tasks
|
|
43
47
|
_None._
|
|
@@ -70,25 +74,29 @@ export function getOnboardCurrentPhase(mode = 'interactive') {
|
|
|
70
74
|
- **Phase**: onboarding
|
|
71
75
|
- **Status**: awaiting-analysis
|
|
72
76
|
|
|
73
|
-
Onboarding an existing project. The Product Lead will:
|
|
74
|
-
1.
|
|
75
|
-
2.
|
|
76
|
-
3.
|
|
77
|
-
4.
|
|
78
|
-
5.
|
|
79
|
-
6. Present a summary for human review
|
|
77
|
+
Onboarding an existing project. See the "Onboarding Process" section in the orchestrator prompt for the full scan checklist and phase doc requirements. The Product Lead will:
|
|
78
|
+
1. Full project scan — read ALL docs, configs, code structure, git history
|
|
79
|
+
2. Reverse-engineer EVERY applicable phase doc (brainstorm, spec, design, architecture, LLDs, test plan)
|
|
80
|
+
3. Populate operations files (bugs from TODOs, tech debt, inconsistencies, client preferences)
|
|
81
|
+
4. Seed agent memory with findings
|
|
82
|
+
5. Present comprehensive summary for human review
|
|
80
83
|
|
|
81
84
|
After onboarding completes and human reviews, phase transitions to **standby**.
|
|
82
85
|
`;
|
|
83
86
|
}
|
|
84
87
|
export function getOnboardTasksPrepend() {
|
|
85
88
|
return `## Re-onboard Tasks
|
|
86
|
-
- [ ] ONBOARD-001:
|
|
87
|
-
- [ ] ONBOARD-002:
|
|
88
|
-
- [ ] ONBOARD-003:
|
|
89
|
-
- [ ] ONBOARD-004:
|
|
90
|
-
- [ ] ONBOARD-005:
|
|
91
|
-
- [ ] ONBOARD-006:
|
|
89
|
+
- [ ] ONBOARD-001: Full project scan — read ALL docs (README, CLAUDE.md, CONTRIBUTING, CHANGELOG, docs/, AI instruction files), ALL configs (package.json/pyproject.toml/etc, tsconfig, eslint, docker, CI/CD, .env.example), ALL existing memory (memory/*/best-practices.md, issues.md, cold.md, governor-feedback.md — PRESERVE these), any MEMORY.md/LEARNINGS.md/docs/.agent-memory/, existing HOOL state (operations/, phases/, .hool/*.json), map directory tree, identify entry points, git log -50, git shortlog -sn. Compare against existing phase docs for drift | assigned: product-lead
|
|
90
|
+
- [ ] ONBOARD-002: Update brainstorm — compare phases/01-brainstorm/brainstorm.md against current README/docs/git history. Update or create if missing. Tag changes [RE-ONBOARD] | assigned: product-lead | depends: ONBOARD-001
|
|
91
|
+
- [ ] ONBOARD-003: Update spec — compare phases/02-spec/spec.md against current code behavior, tests, API endpoints. Add new stories, mark removed features. Tag: [FROM-CODE], [FROM-TESTS], [FROM-DOCS], [INFERRED] | assigned: product-lead | depends: ONBOARD-001
|
|
92
|
+
- [ ] ONBOARD-004: Update architecture — compare phases/04-architecture/ against current code structure, configs, deps. Update architecture.md, contracts/, schema.md, flows/ | assigned: product-lead | depends: ONBOARD-001
|
|
93
|
+
- [ ] ONBOARD-005: Update design (if FE exists) — compare phases/03-design/ against current frontend. Skip if no frontend | assigned: product-lead | depends: ONBOARD-001
|
|
94
|
+
- [ ] ONBOARD-006: Update FE LLD (if FE exists) — compare phases/05-fe-scaffold/fe-lld.md against current frontend code. Skip if no frontend | assigned: product-lead | depends: ONBOARD-004
|
|
95
|
+
- [ ] ONBOARD-007: Update BE LLD (if BE exists) — compare phases/06-be-scaffold/be-lld.md against current backend code. Skip if no backend | assigned: product-lead | depends: ONBOARD-004
|
|
96
|
+
- [ ] ONBOARD-008: Update test plan — compare phases/07-test-plan/ against current test files. Map new tests to stories. Flag coverage gaps | assigned: product-lead | depends: ONBOARD-003
|
|
97
|
+
- [ ] ONBOARD-009: Update operations — rescan for TODOs/FIXMEs (→ bugs.md), tech debt (→ issues.md), doc-vs-code gaps (→ inconsistencies.md), preferences from configs (→ client-preferences.md) | assigned: product-lead | depends: ONBOARD-001
|
|
98
|
+
- [ ] ONBOARD-010: Seed agent memory — route findings to agent memory files (see orchestrator "Memory Seeding" section for per-agent routing). Write each finding from the receiving agent's perspective. A finding CAN go to multiple agents if actionable from each role. Skip agents the project doesn't use. Append to existing memory, don't overwrite | assigned: product-lead | depends: ONBOARD-002 ONBOARD-003 ONBOARD-004 ONBOARD-009
|
|
99
|
+
- [ ] ONBOARD-011: Human review gate — write summary to needs-human-review.md listing changes since last onboard, new inconsistencies, updated phase docs with confidence levels | assigned: product-lead | depends: ONBOARD-010
|
|
92
100
|
|
|
93
101
|
`;
|
|
94
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,OAAe,aAAa;IAChE,OAAO;QACL,kBAAkB,EAAE,kCAAkC,IAAI,sDAAsD;QAEhH,eAAe,EAAE,mFAAmF;QAEpG,SAAS,EAAE,4CAA4C;QAEvD,WAAW,EAAE,uCAAuC;QAEpD,oBAAoB,EAAE,wDAAwD;QAE9E,uBAAuB,EAAE,2DAA2D;QAEpF,uBAAuB,EAAE,gOAAgO;QAEzP,mBAAmB,EAAE,i4BAAi4B;QAEt5B,iBAAiB,EAAE,sCAAsC;KAC1D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAe,aAAa;IACvE,OAAO;QACL,kBAAkB,EAAE;;cAEV,IAAI
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB,CAAC,OAAe,aAAa;IAChE,OAAO;QACL,kBAAkB,EAAE,kCAAkC,IAAI,sDAAsD;QAEhH,eAAe,EAAE,mFAAmF;QAEpG,SAAS,EAAE,4CAA4C;QAEvD,WAAW,EAAE,uCAAuC;QAEpD,oBAAoB,EAAE,wDAAwD;QAE9E,uBAAuB,EAAE,2DAA2D;QAEpF,uBAAuB,EAAE,gOAAgO;QAEzP,mBAAmB,EAAE,i4BAAi4B;QAEt5B,iBAAiB,EAAE,sCAAsC;KAC1D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,OAAe,aAAa;IACvE,OAAO;QACL,kBAAkB,EAAE;;cAEV,IAAI;;;;;;;;;;;;CAYjB;QAEG,eAAe,EAAE;;;;;;;;;;;;;;;;;CAiBpB;QAEG,SAAS,EAAE;;;CAGd;QAEG,WAAW,EAAE;;;CAGhB;QAEG,oBAAoB,EAAE;;;CAGzB;QAEG,uBAAuB,EAAE;;;CAG5B;QAEG,uBAAuB,EAAE,gOAAgO;QAEzP,mBAAmB,EAAE,i4BAAi4B;QAEt5B,iBAAiB,EAAE,sCAAsC;KAC1D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAe,aAAa;IACjE,OAAO;;cAEK,IAAI;;;;;;;;;;;;CAYjB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;CAaR,CAAC;AACF,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,QAAQ,EAAE,kGAAkG;QAE5G,SAAS,EAAE,gBAAgB;QAE3B,mBAAmB,EAAE,4DAA4D;QAEjF,WAAW,EAAE,oDAAoD;QAEjE,sBAAsB,EAAE,6CAA6C;KACtE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/prompts/orchestrator.md
CHANGED
|
@@ -83,6 +83,142 @@ You may ONLY write to these paths:
|
|
|
83
83
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
|
+
## Onboarding Process (Existing Codebase)
|
|
87
|
+
|
|
88
|
+
When `operations/current-phase.md` says **phase: onboarding**, you are reverse-engineering an existing project into HOOL's phase structure. Your goal: read EVERYTHING available and fill as many phase docs as the evidence supports.
|
|
89
|
+
|
|
90
|
+
### What to Scan (Prescriptive — Read ALL of These)
|
|
91
|
+
|
|
92
|
+
**Documentation first** — the richest source of intent:
|
|
93
|
+
- `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, any `docs/` directory
|
|
94
|
+
- Existing `CLAUDE.md`, `.cursor/rules/`, `.cursorrules`, any AI instruction files
|
|
95
|
+
- Wiki pages, API docs, OpenAPI/Swagger specs, architecture decision records (ADRs)
|
|
96
|
+
- Inline code comments, JSDoc/docstrings, module-level documentation
|
|
97
|
+
|
|
98
|
+
**Configuration and metadata:**
|
|
99
|
+
- `package.json` / `pyproject.toml` / `Cargo.toml` / `go.mod` / `*.csproj` — stack, deps, scripts
|
|
100
|
+
- `tsconfig.json` / `eslint.*` / `prettier.*` / `.editorconfig` — coding conventions
|
|
101
|
+
- `Dockerfile`, `docker-compose.*`, `Procfile` — deployment and infrastructure
|
|
102
|
+
- CI/CD configs (`.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`)
|
|
103
|
+
- `.env.example`, `.env.template` — required environment variables (never read `.env` itself)
|
|
104
|
+
|
|
105
|
+
**Source code structure:**
|
|
106
|
+
- Directory tree — `ls` or `find` to map the full project layout
|
|
107
|
+
- Entry points (`src/index.*`, `main.*`, `app.*`, `server.*`)
|
|
108
|
+
- Routing files (Express routes, Next.js pages, Django urls, etc.)
|
|
109
|
+
- Database schemas, migrations, seed files, ORMs/models
|
|
110
|
+
- API endpoints, controllers, services, middleware
|
|
111
|
+
- Frontend components, pages, layouts, design system tokens
|
|
112
|
+
- State management (stores, reducers, contexts)
|
|
113
|
+
- Shared utilities, constants, types/interfaces
|
|
114
|
+
|
|
115
|
+
**Testing:**
|
|
116
|
+
- Test directories (`tests/`, `__tests__/`, `spec/`, `*.test.*`, `*.spec.*`)
|
|
117
|
+
- Test config (`jest.config.*`, `vitest.config.*`, `playwright.config.*`, `cypress.config.*`)
|
|
118
|
+
- Test fixtures, mocks, factories
|
|
119
|
+
|
|
120
|
+
**Git history:**
|
|
121
|
+
- `git log --oneline -50` — recent activity and commit patterns
|
|
122
|
+
- `git log --all --oneline --graph -20` — branch structure
|
|
123
|
+
- `git shortlog -sn` — contributors
|
|
124
|
+
|
|
125
|
+
**Existing memory and knowledge stores:**
|
|
126
|
+
- `memory/*/best-practices.md` — accumulated patterns and gotchas from previous HOOL cycles (PRESERVE — hard-won agent learnings)
|
|
127
|
+
- `memory/*/issues.md` — personal issues each agent has logged (PRESERVE)
|
|
128
|
+
- `memory/*/cold.md` — full agent journals (scan for relevant context, don't overwrite)
|
|
129
|
+
- `memory/*/hot.md` — recent context snapshots (will be rebuilt, but read first to understand where agents left off)
|
|
130
|
+
- `memory/*/governor-feedback.md` — corrective feedback from governor (PRESERVE — active directives)
|
|
131
|
+
- `docs/.agent-memory/` — if present (e.g. Astra-style memory), read for accumulated project knowledge
|
|
132
|
+
- Platform-specific memory (`~/.claude/projects/*/memory/`) — check if the platform has stored project-level learnings
|
|
133
|
+
- Any `MEMORY.md`, `LEARNINGS.md`, or similar knowledge-base files in the project root or docs/
|
|
134
|
+
|
|
135
|
+
**Existing HOOL state (re-onboard only):**
|
|
136
|
+
- `operations/` — all operations files (current-phase, task-board, bugs, issues, inconsistencies, client-preferences, governor-rules, governor-log)
|
|
137
|
+
- `phases/` — all existing phase docs (compare against code for drift — UPDATE rather than replace)
|
|
138
|
+
- `.hool/agents.json` — verify agent manifest matches current agent count and prompts
|
|
139
|
+
- `.hool/mcps.json` — verify MCP manifest matches current registry
|
|
140
|
+
|
|
141
|
+
### What to Produce (Fill Every Applicable Phase)
|
|
142
|
+
|
|
143
|
+
For each phase, write the doc ONLY if you have enough evidence. Mark confidence levels. Skip phases the project type doesn't need (check project-profile.md).
|
|
144
|
+
|
|
145
|
+
**Phase 01 — Brainstorm** (`phases/01-brainstorm/brainstorm.md`):
|
|
146
|
+
- Extract from: README, docs, git history, commit messages, PR descriptions
|
|
147
|
+
- Capture: project vision, goals, target users, key decisions made, constraints, scope boundaries
|
|
148
|
+
- Tag with `[INFERRED]` — this is what the project appears to be, not what someone explicitly told you
|
|
149
|
+
|
|
150
|
+
**Phase 02 — Spec** (`phases/02-spec/spec.md`, `features/`):
|
|
151
|
+
- Extract from: code behavior, existing tests (test names ARE spec), API endpoints, UI screens, docs
|
|
152
|
+
- Capture: user stories with acceptance criteria inferred from what the code actually does
|
|
153
|
+
- Mark each story: `[FROM-CODE]`, `[FROM-TESTS]`, `[FROM-DOCS]`, `[INFERRED]`
|
|
154
|
+
- WARNING: bugs may appear as features — flag anything that looks wrong
|
|
155
|
+
|
|
156
|
+
**Phase 03 — Design** (`phases/03-design/design.md`, `cards/`, `flows/`):
|
|
157
|
+
- Extract from: frontend components, CSS/design tokens, layout files, screenshots if available
|
|
158
|
+
- Capture: screen inventory, component list, design system (colors, typography, spacing)
|
|
159
|
+
- Only if the project has a frontend/UI
|
|
160
|
+
|
|
161
|
+
**Phase 04 — Architecture** (`phases/04-architecture/architecture.md`, `contracts/`, `schema.md`, `flows/`):
|
|
162
|
+
- Extract from: code structure, configs, dependency graph, API routes, DB schemas
|
|
163
|
+
- Capture: tech stack, system diagram, module breakdown, data flows
|
|
164
|
+
- `contracts/` — reverse-engineer API contracts from route handlers, controllers, API docs
|
|
165
|
+
- `schema.md` — reverse-engineer from migrations, model files, ORM definitions
|
|
166
|
+
- `flows/` — reverse-engineer key data flows from code paths
|
|
167
|
+
|
|
168
|
+
**Phase 05 — FE LLD** (`phases/05-fe-scaffold/fe-lld.md`):
|
|
169
|
+
- Extract from: frontend code patterns, component hierarchy, routing, state management
|
|
170
|
+
- Capture: component tree, page structure, data fetching patterns, conventions
|
|
171
|
+
- Only if the project has a frontend
|
|
172
|
+
|
|
173
|
+
**Phase 06 — BE LLD** (`phases/06-be-scaffold/be-lld.md`):
|
|
174
|
+
- Extract from: backend code patterns, service layer, middleware, data access
|
|
175
|
+
- Capture: module layout, service patterns, middleware chain, error handling conventions
|
|
176
|
+
- Only if the project has a backend
|
|
177
|
+
|
|
178
|
+
**Phase 07 — Test Plan** (`phases/07-test-plan/test-plan.md`, `cases/`):
|
|
179
|
+
- Extract from: existing test files, test configs, CI test commands
|
|
180
|
+
- Capture: what's tested, what's not, test framework, coverage gaps
|
|
181
|
+
- Map existing tests to spec user stories
|
|
182
|
+
|
|
183
|
+
**Operations:**
|
|
184
|
+
- `operations/bugs.md` — known bugs from issues, TODOs, FIXMEs in code
|
|
185
|
+
- `operations/issues.md` — tech debt, code smells, deprecated patterns
|
|
186
|
+
- `operations/inconsistencies.md` — doc-vs-code gaps, config mismatches, stale docs
|
|
187
|
+
- `operations/client-preferences.md` — infer from existing configs, lint rules, conventions
|
|
188
|
+
|
|
189
|
+
**Memory Seeding** (ONBOARD-010):
|
|
190
|
+
Route findings to agent memory files. Do NOT blindly duplicate — identify which agents each finding is actionable for and write it from that agent's perspective.
|
|
191
|
+
|
|
192
|
+
Per-agent routing:
|
|
193
|
+
- **be-tech-lead/best-practices.md** — architectural patterns, module boundaries, API design conventions, error handling patterns, dependency management gotchas. Tag: `[PATTERN]` or `[GOTCHA]`
|
|
194
|
+
- **be-tech-lead/issues.md** — architectural debt, missing abstractions, coupling issues
|
|
195
|
+
- **fe-tech-lead/best-practices.md** — component patterns, state management conventions, styling system, routing patterns. Tag: `[PATTERN]` or `[GOTCHA]`
|
|
196
|
+
- **fe-tech-lead/issues.md** — FE architectural debt, inconsistent patterns
|
|
197
|
+
- **be-dev/best-practices.md** — concrete coding conventions (naming, file structure, import order), common pitfalls in this codebase. Tag: `[PATTERN]` or `[GOTCHA]`
|
|
198
|
+
- **be-dev/issues.md** — code-level debt (TODOs, FIXMEs, deprecated usage, copy-paste code)
|
|
199
|
+
- **fe-dev/best-practices.md** — FE coding conventions, component naming, test patterns. Tag: `[PATTERN]` or `[GOTCHA]`
|
|
200
|
+
- **fe-dev/issues.md** — FE code-level debt
|
|
201
|
+
- **qa/best-practices.md** — test framework conventions, coverage expectations, test data patterns. Tag: `[PATTERN]`
|
|
202
|
+
- **qa/issues.md** — coverage gaps, missing test types, flaky test patterns, untested critical paths
|
|
203
|
+
- **forensic/issues.md** — known fragile areas, previous incidents if visible in git history, areas with high churn
|
|
204
|
+
- **governor/best-practices.md** — project-specific rules inferred from lint configs, CI checks, existing conventions. Tag: `[PATTERN]`
|
|
205
|
+
|
|
206
|
+
Rules:
|
|
207
|
+
- A single finding CAN go to multiple agents if actionable from each perspective — but write it differently for each role
|
|
208
|
+
- Skip agents the project doesn't use (no FE agents for CLI tools, etc.)
|
|
209
|
+
- Preserve existing memory entries — append, don't overwrite
|
|
210
|
+
- Use the standard tags: `[PATTERN]`, `[GOTCHA]`, `[ARCH-*]` for best-practices; plain text for issues
|
|
211
|
+
|
|
212
|
+
### Onboarding Gate
|
|
213
|
+
|
|
214
|
+
After all tasks complete:
|
|
215
|
+
1. Write summary to `operations/needs-human-review.md` listing every phase doc you produced, with confidence level
|
|
216
|
+
2. List all inconsistencies and issues found
|
|
217
|
+
3. Present to user: "Here's what I found. Please review before we proceed."
|
|
218
|
+
4. After human review, transition `operations/current-phase.md` to **standby**
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
86
222
|
## Phase 0: Project Init
|
|
87
223
|
|
|
88
224
|
### Writes
|
|
@@ -451,8 +587,8 @@ Spawn **Forensic** subagent with context:
|
|
|
451
587
|
After Phase 11 completes (all bugs resolved, QA passes), the Product Lead runs a cross-agent retrospective.
|
|
452
588
|
|
|
453
589
|
### Reads
|
|
454
|
-
- `memory/*/best-practices.md` — all
|
|
455
|
-
- `memory/*/issues.md` — all
|
|
590
|
+
- `memory/*/best-practices.md` — all 8 agents' accumulated patterns and gotchas
|
|
591
|
+
- `memory/*/issues.md` — all 8 agents' personal issues logs
|
|
456
592
|
- `operations/inconsistencies.md` — what mismatches surfaced during the cycle
|
|
457
593
|
- `operations/bugs.md` — what bugs were found and their root causes
|
|
458
594
|
- `operations/task-board.md` — planned vs actual tasks, blocked/re-assigned tasks
|
|
@@ -573,6 +709,31 @@ User reports bug -> operations/bugs.md (tagged [USER])
|
|
|
573
709
|
-> Route to Forensic
|
|
574
710
|
```
|
|
575
711
|
|
|
712
|
+
### Governor Audits
|
|
713
|
+
The Governor is a behavioral auditor — it does NOT build, test, or review code. It audits whether agents followed the rules.
|
|
714
|
+
|
|
715
|
+
**When to trigger:**
|
|
716
|
+
- After every 3 agent dispatches (automatic cadence)
|
|
717
|
+
- After any task that touches `operations/governor-rules.md` or agent prompts
|
|
718
|
+
- When an agent's output looks suspicious (unexpected file edits, missing dispatch briefs)
|
|
719
|
+
- Manually: user says "run governor" or similar
|
|
720
|
+
|
|
721
|
+
**How to dispatch:**
|
|
722
|
+
1. Read `.hool/prompts/agents/governor.md`
|
|
723
|
+
2. Read `memory/governor/hot.md`, `memory/governor/best-practices.md`
|
|
724
|
+
3. Dispatch Governor subagent with context:
|
|
725
|
+
- `operations/governor-rules.md` — the rules to audit against
|
|
726
|
+
- `operations/governor-log.md` — previous audit trail
|
|
727
|
+
- `memory/*/cold.md` (last 20 entries each) — what agents actually did
|
|
728
|
+
- Any dispatch briefs from `operations/context/` for audited tasks
|
|
729
|
+
4. Governor writes:
|
|
730
|
+
- `memory/<agent>/governor-feedback.md` — corrective feedback for violating agents
|
|
731
|
+
- `operations/governor-log.md` — audit trail entry
|
|
732
|
+
- `operations/governor-rules.md` — new rules (append only, never modify/remove)
|
|
733
|
+
- `operations/needs-human-review.md` — structural issues (missing rules, prompt gaps)
|
|
734
|
+
|
|
735
|
+
**After governor returns:** Read `operations/governor-log.md` for the latest audit. If any agent received feedback in their `governor-feedback.md`, factor it into the next dispatch to that agent.
|
|
736
|
+
|
|
576
737
|
### Escalation
|
|
577
738
|
- Subjective or ambiguous items -> `operations/needs-human-review.md`
|
|
578
739
|
- Never guess on product decisions — escalate
|