maxsimcli 5.0.6 → 5.1.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.
Files changed (91) hide show
  1. package/README.md +316 -288
  2. package/dist/assets/CHANGELOG.md +14 -0
  3. package/dist/assets/hooks/maxsim-capture-learnings.cjs +128 -0
  4. package/dist/assets/hooks/maxsim-capture-learnings.cjs.map +1 -0
  5. package/dist/assets/hooks/maxsim-check-update.cjs +126 -88
  6. package/dist/assets/hooks/maxsim-check-update.cjs.map +1 -1
  7. package/dist/assets/hooks/maxsim-notification-sound.cjs +87 -43
  8. package/dist/assets/hooks/maxsim-notification-sound.cjs.map +1 -1
  9. package/dist/assets/hooks/maxsim-statusline.cjs +45 -171
  10. package/dist/assets/hooks/maxsim-statusline.cjs.map +1 -1
  11. package/dist/assets/hooks/maxsim-stop-sound.cjs +86 -43
  12. package/dist/assets/hooks/maxsim-stop-sound.cjs.map +1 -1
  13. package/dist/assets/hooks/maxsim-sync-reminder.cjs +72 -21
  14. package/dist/assets/hooks/maxsim-sync-reminder.cjs.map +1 -1
  15. package/dist/assets/templates/agents/AGENTS.md +62 -51
  16. package/dist/assets/templates/agents/executor.md +44 -59
  17. package/dist/assets/templates/agents/planner.md +36 -31
  18. package/dist/assets/templates/agents/researcher.md +35 -43
  19. package/dist/assets/templates/agents/verifier.md +29 -31
  20. package/dist/assets/templates/commands/maxsim/debug.md +20 -154
  21. package/dist/assets/templates/commands/maxsim/execute.md +19 -33
  22. package/dist/assets/templates/commands/maxsim/go.md +21 -20
  23. package/dist/assets/templates/commands/maxsim/help.md +5 -14
  24. package/dist/assets/templates/commands/maxsim/init.md +18 -40
  25. package/dist/assets/templates/commands/maxsim/plan.md +22 -37
  26. package/dist/assets/templates/commands/maxsim/progress.md +15 -16
  27. package/dist/assets/templates/commands/maxsim/quick.md +18 -29
  28. package/dist/assets/templates/commands/maxsim/settings.md +18 -26
  29. package/dist/assets/templates/references/continuation-format.md +2 -4
  30. package/dist/assets/templates/references/model-profiles.md +2 -2
  31. package/dist/assets/templates/references/planning-config.md +10 -11
  32. package/dist/assets/templates/references/self-improvement.md +120 -0
  33. package/dist/assets/templates/rules/conventions.md +1 -1
  34. package/dist/assets/templates/rules/verification-protocol.md +1 -1
  35. package/dist/assets/templates/skills/brainstorming/SKILL.md +35 -26
  36. package/dist/assets/templates/skills/code-review/SKILL.md +78 -55
  37. package/dist/assets/templates/skills/commit-conventions/SKILL.md +70 -36
  38. package/dist/assets/templates/skills/github-operations/SKILL.md +142 -0
  39. package/dist/assets/templates/skills/handoff-contract/SKILL.md +62 -28
  40. package/dist/assets/templates/skills/maxsim-batch/SKILL.md +68 -42
  41. package/dist/assets/templates/skills/maxsim-simplify/SKILL.md +65 -40
  42. package/dist/assets/templates/skills/project-memory/SKILL.md +121 -0
  43. package/dist/assets/templates/skills/research/SKILL.md +126 -0
  44. package/dist/assets/templates/skills/roadmap-writing/SKILL.md +71 -68
  45. package/dist/assets/templates/skills/systematic-debugging/SKILL.md +37 -25
  46. package/dist/assets/templates/skills/tdd/SKILL.md +36 -39
  47. package/dist/assets/templates/skills/using-maxsim/SKILL.md +69 -55
  48. package/dist/assets/templates/skills/verification/SKILL.md +167 -0
  49. package/dist/assets/templates/workflows/batch.md +249 -268
  50. package/dist/assets/templates/workflows/diagnose-issues.md +225 -151
  51. package/dist/assets/templates/workflows/execute-plan.md +191 -981
  52. package/dist/assets/templates/workflows/execute.md +350 -309
  53. package/dist/assets/templates/workflows/go.md +119 -138
  54. package/dist/assets/templates/workflows/health.md +71 -114
  55. package/dist/assets/templates/workflows/help.md +85 -147
  56. package/dist/assets/templates/workflows/init-existing.md +180 -1373
  57. package/dist/assets/templates/workflows/init.md +53 -165
  58. package/dist/assets/templates/workflows/new-milestone.md +91 -334
  59. package/dist/assets/templates/workflows/new-project.md +165 -1384
  60. package/dist/assets/templates/workflows/plan-create.md +182 -73
  61. package/dist/assets/templates/workflows/plan-discuss.md +89 -82
  62. package/dist/assets/templates/workflows/plan-research.md +191 -85
  63. package/dist/assets/templates/workflows/plan.md +122 -58
  64. package/dist/assets/templates/workflows/progress.md +76 -310
  65. package/dist/assets/templates/workflows/quick.md +70 -495
  66. package/dist/assets/templates/workflows/sdd.md +231 -221
  67. package/dist/assets/templates/workflows/settings.md +90 -120
  68. package/dist/assets/templates/workflows/verify-phase.md +296 -258
  69. package/dist/cli.cjs +17 -23465
  70. package/dist/cli.cjs.map +1 -1
  71. package/dist/install.cjs +356 -8358
  72. package/dist/install.cjs.map +1 -1
  73. package/package.json +16 -22
  74. package/dist/assets/templates/skills/agent-system-map/SKILL.md +0 -92
  75. package/dist/assets/templates/skills/evidence-collection/SKILL.md +0 -87
  76. package/dist/assets/templates/skills/github-artifact-protocol/SKILL.md +0 -67
  77. package/dist/assets/templates/skills/github-tools-guide/SKILL.md +0 -89
  78. package/dist/assets/templates/skills/input-validation/SKILL.md +0 -51
  79. package/dist/assets/templates/skills/memory-management/SKILL.md +0 -75
  80. package/dist/assets/templates/skills/research-methodology/SKILL.md +0 -137
  81. package/dist/assets/templates/skills/sdd/SKILL.md +0 -91
  82. package/dist/assets/templates/skills/tool-priority-guide/SKILL.md +0 -80
  83. package/dist/assets/templates/skills/verification-before-completion/SKILL.md +0 -71
  84. package/dist/assets/templates/skills/verification-gates/SKILL.md +0 -169
  85. package/dist/assets/templates/workflows/discuss-phase.md +0 -683
  86. package/dist/assets/templates/workflows/research-phase.md +0 -73
  87. package/dist/assets/templates/workflows/verify-work.md +0 -572
  88. package/dist/core-D5zUr9cb.cjs +0 -4305
  89. package/dist/core-D5zUr9cb.cjs.map +0 -1
  90. package/dist/skills-CjFWZIGM.cjs +0 -6824
  91. package/dist/skills-CjFWZIGM.cjs.map +0 -1
@@ -1,1496 +1,303 @@
1
1
  <purpose>
2
- Initialize MAXSIM in an existing codebase through a scan-first-then-ask flow. This workflow detects existing `.planning/` state, runs codebase analysis (4 mapper agents), validates README against scan findings, asks scan-informed questions with smart defaults, and generates stage-aware planning documents. Supports `--auto` mode for fully autonomous initialization.
3
-
4
- Output: `.planning/` directory with config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md, and codebase/ analysis docs.
2
+ Initialize MAXSIM in an existing project with code. Performs a deep parallel codebase scan first, synthesizes findings, confirms with the user, then proceeds with GitHub setup and config. GitHub Issues are the sole source of truth no local .planning/ directory is created or referenced.
5
3
  </purpose>
6
4
 
7
- <required_reading>
8
- Read all files referenced by the invoking prompt's execution_context before starting.
9
- @~/.claude/maxsim/references/thinking-partner.md
10
- @~/.claude/maxsim/references/questioning.md
11
- </required_reading>
12
-
13
- <auto_mode>
14
- ## Auto Mode Detection
15
-
16
- Check if `--auto` flag is present in $ARGUMENTS.
17
-
18
- **If auto mode:**
19
- - Skip all questions (conflict resolution, config, existing state, future direction, milestone)
20
- - Run full codebase scan (always)
21
- - Infer everything from code: purpose, stack, architecture, stage, vision
22
- - Auto mode does NOT require an idea document (unlike new-project's --auto)
23
- - Default config: stage=MVP, branching_strategy=none, model_profile=balanced, mode=yolo, depth=standard
24
- - After scan: generate all documents with smart inferences
25
- - Add `<!-- Auto-generated by /maxsim:init --auto. Review recommended. -->` comment at top of each generated document
26
- - Auto mode still creates all documents: config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md
27
- - If `.planning/` exists: auto mode defaults to merge behavior (keep existing, fill gaps, re-scan)
28
- - If `.planning/` does not exist: create fresh
29
- </auto_mode>
30
-
31
5
  <process>
32
6
 
33
- ## Step 1: Setup (Init Context)
34
-
35
- **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
36
-
37
- **If `INIT_CONTEXT` was already loaded by the router** (the init.md workflow runs this before delegating), use that JSON directly — do NOT re-run the CLI command.
7
+ ## Phase 1: Prerequisites Gate
38
8
 
39
- **Otherwise**, run:
9
+ Before any user interaction, verify GitHub is accessible.
40
10
 
41
11
  ```bash
42
- INIT=$(node ~/.claude/maxsim/bin/maxsim-tools.cjs init init-existing)
12
+ gh auth status 2>/dev/null && echo "AUTH_OK" || echo "AUTH_FAIL"
13
+ git remote get-url origin 2>/dev/null && echo "REMOTE_OK" || echo "REMOTE_FAIL"
43
14
  ```
44
15
 
45
- Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `mapper_model`, `commit_docs`, `project_exists`, `planning_exists`, `planning_files`, `has_codebase_map`, `has_existing_code`, `has_package_file`, `has_git`, `has_readme`, `conflict_detected`, `existing_file_count`, `brave_search_available`, `parallelization`, `project_path`, `codebase_dir`, `github_ready`, `has_github_remote`, `gh_authenticated`.
46
-
47
- **If `has_existing_code` is false AND `has_package_file` is false:**
16
+ **If AUTH_FAIL:**
48
17
 
49
18
  ```
50
19
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
51
- MAXSIM ► NO CODE DETECTED
20
+ MAXSIM ► GITHUB CLI NOT AUTHENTICATED
52
21
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
53
22
 
54
- No source code or package manifest detected in this directory.
55
- For greenfield projects, use /maxsim:init instead.
56
- ```
57
-
58
- Use AskUserQuestion:
59
- - header: "Continue?"
60
- - question: "No code detected. Continue with init-existing anyway, or switch to new-project?"
61
- - options:
62
- - "Continue anyway" -- I know there's code here (maybe in subdirectories)
63
- - "Switch to /maxsim:init" -- This is a greenfield project
23
+ MAXSIM requires GitHub CLI authentication.
64
24
 
65
- **If "Switch":** Print "Run `/maxsim:init` to start a greenfield project." and exit.
66
- **If "Continue":** Proceed to Step 2.
25
+ Fix: gh auth login
67
26
 
68
- **In auto mode:** If no code detected, proceed anyway (scan will find what it can).
69
-
70
- **If `has_git` is false:** Initialize git:
71
- ```bash
72
- git init
27
+ Then re-run /maxsim:init.
73
28
  ```
74
29
 
75
- ## Step 1b: GitHub Prerequisites Gate
76
-
77
- **This gate is MANDATORY. Do not proceed if it fails.**
78
-
79
- Parse init context for `has_github_remote` and `gh_authenticated`:
80
-
81
- 1. If `has_github_remote` is false:
82
- - STOP. Tell user:
83
- ```
84
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
85
- MAXSIM ► NO GITHUB REMOTE FOUND
86
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
30
+ Stop. Do not proceed.
87
31
 
88
- MAXSIM requires a GitHub remote to track phases as Issues.
89
-
90
- To fix: git remote add origin <your-repo-url>
91
-
92
- Then re-run /maxsim:init.
93
- ```
94
- - Do NOT proceed with initialization.
95
-
96
- 2. If `gh_authenticated` is false:
97
- - STOP. Tell user:
98
- ```
99
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
100
- MAXSIM ► GITHUB CLI NOT AUTHENTICATED
101
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
-
103
- MAXSIM requires GitHub CLI authentication to create phase issues.
104
-
105
- To fix: gh auth login
106
-
107
- Then re-run /maxsim:init.
108
- ```
109
- - Do NOT proceed with initialization.
110
-
111
- 3. Both checks passed — run `github setup` with the project name as the milestone title:
112
- ```bash
113
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github setup --milestone-title "[project name]"
114
- ```
115
-
116
- 4. If `github setup` fails:
117
- - STOP with the error message returned by the tool.
118
- - Do not fall back to local-only mode.
119
-
120
- 5. Record the `project_number` and board details returned by `github setup` for use in the Phase Issue Creation step.
121
-
122
- ## Step 2: Conflict Resolution
123
-
124
- **If auto mode:** Skip dialog. If `conflict_detected`, use merge behavior automatically (keep existing files, fill gaps, always re-scan codebase). Proceed to Step 3.
125
-
126
- **If `conflict_detected` is false:** Create `.planning/` directory, proceed to Step 3:
127
- ```bash
128
- mkdir -p .planning
129
- ```
130
-
131
- **If `conflict_detected` is true:**
132
-
133
- Show existing files:
134
- ```bash
135
- ls -la .planning/ 2>/dev/null
136
- ```
137
-
138
- Present conflict dialog:
32
+ **If REMOTE_FAIL:**
139
33
 
140
34
  ```
141
35
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
142
- MAXSIM ► EXISTING .planning/ DETECTED
36
+ MAXSIM ► NO GITHUB REMOTE FOUND
143
37
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
38
 
145
- Found {existing_file_count} files in .planning/:
146
- [list files with last-modified dates from ls output]
147
-
148
- How should I proceed?
149
- ```
150
-
151
- Use AskUserQuestion:
152
- - header: "Conflict"
153
- - question: "`.planning/` already exists. How should I proceed?"
154
- - options:
155
- - "Merge (Recommended)" -- Keep existing files, fill gaps, re-scan codebase
156
- - "Overwrite" -- Delete existing .planning/ and start fresh
157
- - "Cancel" -- Exit (run /maxsim:progress (health check) to diagnose)
158
-
159
- **On Merge:**
160
- - Note which core files exist: config.json, PROJECT.md, REQUIREMENTS.md, ROADMAP.md, STATE.md
161
- - For each missing file: will be created in Step 9
162
- - For each existing file: check for required section headers in Step 9. If missing headers, fill gaps
163
- - Always re-scan codebase (Step 3 deletes and recreates `.planning/codebase/`)
164
- - Proceed to Step 3
39
+ MAXSIM requires a GitHub remote to track phases as Issues.
165
40
 
166
- **On Overwrite:**
167
-
168
- Use AskUserQuestion:
169
- - header: "Backup"
170
- - question: "Back up existing .planning/ to .planning.bak/ before overwrite?"
171
- - options:
172
- - "Yes (Recommended)" -- Save backup to .planning.bak/
173
- - "No" -- Delete without backup
41
+ Fix: git remote add origin <url>
174
42
 
175
- If yes:
176
- ```bash
177
- rm -rf .planning.bak/ 2>/dev/null
178
- mv .planning/ .planning.bak/
179
- mkdir -p .planning
180
- ```
181
-
182
- If no:
183
- ```bash
184
- rm -rf .planning/
185
- mkdir -p .planning
43
+ Then re-run /maxsim:init.
186
44
  ```
187
45
 
188
- Proceed to Step 3.
46
+ Stop. Do not proceed.
189
47
 
190
- **On Cancel:**
191
- Print: "Cancelled. Run `/maxsim:progress (health check)` to diagnose your .planning/ state."
192
- Exit workflow.
48
+ ## Phase 2: Deep Codebase Scan
193
49
 
194
- ## Step 3: Codebase Scan
195
-
196
- Always runs, regardless of conflict mode. The codebase scan is always fresh.
197
-
198
- ```
199
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
200
- MAXSIM ► SCANNING CODEBASE
201
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
202
- ```
203
-
204
- Ensure `.planning/codebase/` exists (delete and recreate if exists):
205
- ```bash
206
- rm -rf .planning/codebase/
207
- mkdir -p .planning/codebase/
208
- ```
50
+ Print immediately:
209
51
 
210
52
  ```
211
- Spawning 4 codebase mappers in parallel...
212
- → Tech mapper (STACK.md)
213
- → Architecture mapper (ARCHITECTURE.md)
214
- → Quality mapper (CONVENTIONS.md)
215
- → Concerns mapper (CONCERNS.md)
53
+ Scanning existing codebase...
216
54
  ```
217
55
 
218
- Spawn 4 mapper agents using the Task tool. Follow the EXACT pattern from `templates/workflows/map-codebase.md`.
56
+ Spawn 10+ parallel Research agents to deeply analyze the codebase. Use the Agent tool with `isolation: "worktree"` and `run_in_background: true` for all agents simultaneously.
219
57
 
220
- **CRITICAL:** Spawn mapper agents directly using the Task tool. Do NOT invoke `/maxsim:init (codebase mapping stage)` command (that would exit the current workflow context).
58
+ **Agent 1 Architecture overview:**
59
+ Prompt: "Analyze the top-level structure of this repository. List all top-level directories (exclude .git, node_modules, vendor, dist, build). Identify the architectural pattern: monorepo, monolith, microservices, library, CLI tool, web app, mobile app, or hybrid. Identify the primary entry point(s). Return JSON with keys: top_level_dirs (array), architecture_pattern (string), entry_points (array), notable_structure_notes (string)."
221
60
 
222
- **Agent 1: Tech Focus**
61
+ **Agent 2 Language and framework detection:**
62
+ Prompt: "Detect all programming languages used in this repository (by file extension frequency). Identify the primary framework(s): React, Vue, Express, Django, Rails, Spring, etc. Read package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, or equivalent manifest. Return JSON with keys: primary_language (string), secondary_languages (array), frameworks (array), runtime_version (string), project_name (string), project_version (string)."
223
63
 
224
- ```
225
- Task(
226
- subagent_type="researcher",
227
- model="{mapper_model}",
228
- run_in_background=true,
229
- description="Map codebase tech stack",
230
- prompt="Focus: tech
64
+ **Agent 3 — Dependency analysis:**
65
+ Prompt: "Read the package manifest (package.json, requirements.txt, pyproject.toml, Cargo.toml, go.mod, etc.). List the top 15 production dependencies and top 10 dev dependencies. Flag any dependencies that are outdated, deprecated, or have known security advisories if detectable from lock files. Return JSON with keys: prod_deps (array of {name, version}), dev_deps (array of {name, version}), flags (array of {name, issue})."
231
66
 
232
- Analyze this codebase for technology stack and external integrations.
67
+ **Agent 4 Test coverage and quality:**
68
+ Prompt: "Find all test files in this repository (*.test.*, *.spec.*, tests/, __tests__/, spec/). Count them. Identify the test framework(s). Look for coverage config or reports. Check if tests are passing by reading CI status files or recent CI output if present. Return JSON with keys: test_file_count (number), test_frameworks (array), coverage_tool (string or null), coverage_percent (number or null), test_patterns (array), test_quality_notes (string)."
233
69
 
234
- Write these documents to .planning/codebase/:
235
- - STACK.md - Languages, runtime, frameworks, dependencies, configuration
70
+ **Agent 5 CI/CD pipeline:**
71
+ Prompt: "Read .github/workflows/, .circleci/config.yml, .gitlab-ci.yml, Jenkinsfile, .travis.yml, or equivalent CI config. Identify all workflow triggers, jobs, test commands, build commands, and deployment targets. Note any broken or disabled workflows. Return JSON with keys: ci_provider (string), workflows (array of {name, triggers, jobs}), test_commands (array), build_commands (array), deploy_targets (array), broken_workflows (array)."
236
72
 
237
- Explore thoroughly. Write documents directly using templates. Return confirmation only."
238
- )
239
- ```
73
+ **Agent 6 Code quality and linting:**
74
+ Prompt: "Read .eslintrc*, .prettierrc*, pyproject.toml [tool.ruff or tool.black], .rubocop.yml, .golangci.yml, or equivalent lint/format config. Identify the linter, formatter, and key enforced rules. Check if pre-commit hooks are configured (.pre-commit-config.yaml or .husky/). Return JSON with keys: linter (string), formatter (string), key_rules (array), pre_commit_configured (boolean), lint_notes (string)."
240
75
 
241
- **Agent 2: Architecture Focus**
76
+ **Agent 7 Database and data layer:**
77
+ Prompt: "Look for ORM configs, migration files (migrations/, db/migrate/, alembic/), schema files (schema.prisma, schema.sql), or database connection setup. Identify: database type (postgres, mysql, sqlite, mongodb, etc.), ORM or query builder, migration tool, and key schema entities. Return JSON with keys: db_type (string or null), orm (string or null), migration_tool (string or null), schema_entities (array of string), data_notes (string)."
242
78
 
243
- ```
244
- Task(
245
- subagent_type="researcher",
246
- model="{mapper_model}",
247
- run_in_background=true,
248
- description="Map codebase architecture",
249
- prompt="Focus: arch
79
+ **Agent 8 — Environment and configuration:**
80
+ Prompt: "Read .env.example, .env.sample, .env.template, or any documented environment variable files (do NOT read actual .env files with real secrets). List all documented environment variables and their purpose. Also check for config management patterns (dotenv, 12-factor, secrets managers). Return JSON with keys: env_vars (array of {name, description, required}), config_pattern (string), config_notes (string)."
250
81
 
251
- Analyze this codebase architecture and directory structure.
82
+ **Agent 9 Deployment and infrastructure:**
83
+ Prompt: "Look for Dockerfile, docker-compose.yml, Kubernetes manifests (k8s/, kubernetes/), Terraform (.tf files), AWS CDK, Pulumi, or serverless.yml. Identify: whether the app is containerized, the orchestration approach, cloud provider, and infrastructure-as-code tool. Return JSON with keys: containerized (boolean), base_image (string or null), orchestration (string or null), cloud_provider (string or null), iac_tool (string or null), deploy_notes (string)."
252
84
 
253
- Write these documents to .planning/codebase/:
254
- - ARCHITECTURE.md - Pattern, layers, data flow, abstractions, entry points
85
+ **Agent 10 Tech debt and open work:**
86
+ Prompt: "Search source files for TODO, FIXME, HACK, XXX, and DEPRECATED comments. Count occurrences per file. List the top 10 files by comment count. Also run: gh issue list --state open --json number,title,labels,createdAt to get open GitHub issues. Return JSON with keys: todo_files (array of {file, count}), total_todos (number), open_issues (array of {number, title, labels}), debt_notes (string)."
255
87
 
256
- Explore thoroughly. Write documents directly using templates. Return confirmation only."
257
- )
258
- ```
88
+ **Agent 11 API surface (if applicable):**
89
+ Prompt: "Look for route definitions, API endpoint declarations, OpenAPI/Swagger specs, GraphQL schemas, or gRPC proto files. Summarize the API surface: how many endpoints/operations, authentication mechanism, versioning strategy. Return JSON with keys: api_type (rest/graphql/grpc/none), endpoint_count (number or null), auth_mechanism (string or null), api_version (string or null), spec_file (string or null), api_notes (string)."
259
90
 
260
- **Agent 3: Quality Focus**
91
+ **Agent 12 Documentation state:**
92
+ Prompt: "Check for: README.md (and its completeness), docs/ directory, wiki link in repo metadata, inline code comments density (sample 5 files), CHANGELOG.md, ADR records (docs/adr/ or similar). Return JSON with keys: has_readme (boolean), readme_quality (poor/basic/good/comprehensive), has_docs_dir (boolean), has_changelog (boolean), has_adrs (boolean), doc_notes (string)."
261
93
 
262
- ```
263
- Task(
264
- subagent_type="researcher",
265
- model="{mapper_model}",
266
- run_in_background=true,
267
- description="Map codebase conventions",
268
- prompt="Focus: quality
94
+ After all agents complete, synthesize all JSON outputs into a single `SCAN_FINDINGS` object covering: architecture, languages, frameworks, dependencies, test coverage, CI/CD, code quality, database, environment, deployment, tech debt, API surface, and documentation state.
269
95
 
270
- Analyze this codebase for coding conventions and testing patterns.
96
+ ## Phase 3: Findings Presentation and Confirmation
271
97
 
272
- Write these documents to .planning/codebase/:
273
- - CONVENTIONS.md - Code style, naming, patterns, error handling
98
+ Present synthesized findings to the user:
274
99
 
275
- Explore thoroughly. Write documents directly using templates. Return confirmation only."
276
- )
277
100
  ```
101
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
102
+ MAXSIM ► CODEBASE SCAN COMPLETE
103
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
278
104
 
279
- **Agent 4: Concerns Focus**
105
+ Architecture: {architecture_pattern}
106
+ Language: {primary_language} ({secondary_languages})
107
+ Frameworks: {frameworks}
108
+ Tests: {test_file_count} files | {coverage_percent}% coverage | {test_frameworks}
109
+ CI/CD: {ci_provider} — {workflow count} workflows
110
+ Database: {db_type} via {orm}
111
+ Tech debt: {total_todos} TODOs | {open_issues count} open issues
112
+ API: {api_type} — {endpoint_count} endpoints
113
+ Docs: README: {readme_quality} | Changelog: {has_changelog}
280
114
 
115
+ Deploy: {containerized} | {cloud_provider} | {iac_tool}
281
116
  ```
282
- Task(
283
- subagent_type="researcher",
284
- model="{mapper_model}",
285
- run_in_background=true,
286
- description="Map codebase concerns",
287
- prompt="Focus: concerns
288
-
289
- Analyze this codebase for technical debt, known issues, and areas of concern.
290
117
 
291
- Write this document to .planning/codebase/:
292
- - CONCERNS.md - Tech debt, bugs, security, performance, fragile areas
293
-
294
- Explore thoroughly. Write document directly using template. Return confirmation only."
295
- )
296
- ```
118
+ Use AskUserQuestion:
119
+ - header: "Scan Results Confirm or Correct"
120
+ - questions:
121
+ 1. "Does this look accurate? What should be corrected?" (freeform, optional)
122
+ 2. "What is the primary goal of this project — what problem does it solve?" (freeform)
123
+ 3. "What are the no-gos — things MAXSIM agents must never touch or modify?" (freeform)
124
+ 4. "What are the acceptance criteria for the next milestone?" (freeform)
297
125
 
298
- If `parallelization` is true, spawn all 4 with `run_in_background=true` (parallel). Otherwise spawn sequentially (no `run_in_background`).
126
+ Incorporate any corrections into `PROJECT_CONTEXT`.
299
127
 
300
- Wait for all agents to complete.
128
+ ## Phase 4: GitHub Setup
301
129
 
302
- Print per-agent completion status:
303
- ```
304
- ✓ Tech mapper complete: STACK.md
305
- ✓ Architecture mapper complete: ARCHITECTURE.md
306
- ✓ Quality mapper complete: CONVENTIONS.md
307
- ✓ Concerns mapper complete: CONCERNS.md
308
- ```
130
+ Execute in sequence:
309
131
 
310
- After all agents complete, also create a file tree overview:
132
+ **4a. Ensure labels:**
311
133
 
312
134
  ```bash
313
- git ls-files --others --cached --exclude-standard | grep -v node_modules | grep -v __pycache__ | grep -v .next | grep -v dist/ | grep -v build/ | head -200 > .planning/codebase/STRUCTURE.md
135
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github ensure-labels
314
136
  ```
315
137
 
316
- Then wrap it with a header:
138
+ **4b. Create GitHub Project Board:**
317
139
 
318
- Read `.planning/codebase/STRUCTURE.md`, prepend:
319
-
320
- ```markdown
321
- # Codebase File Structure
322
-
323
- **Generated:** [date]
324
-
325
- ## File Tree
140
+ ```bash
141
+ REPO=$(gh repo view --json owner,name -q '"\(.owner.login)/\(.name)"')
142
+ OWNER=$(gh repo view --json owner -q '.owner.login')
143
+ PROJECT_NAME="{project_name} MAXSIM"
326
144
 
327
- ```
328
- [file tree content]
145
+ gh project create --owner "$OWNER" --title "$PROJECT_NAME"
329
146
  ```
330
147
 
331
- ---
332
- *Structure snapshot: [date]*
333
- ```
148
+ Capture the project number.
149
+
150
+ **4c. Store project board number:**
334
151
 
335
- Verify all documents created:
336
152
  ```bash
337
- ls -la .planning/codebase/
338
- wc -l .planning/codebase/*.md
153
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github set-project --number {PROJECT_NUMBER}
339
154
  ```
340
155
 
341
- If any document is missing or empty, note the failure and continue.
156
+ **4d. Create initial milestone:**
342
157
 
343
- ## Step 4: README Validation
344
-
345
- **If `has_readme` is true:**
346
-
347
- Read README.md:
348
158
  ```bash
349
- cat README.md
159
+ gh api repos/$REPO/milestones \
160
+ --method POST \
161
+ --field title="Milestone 1 — {project_name}" \
162
+ --field description="Initial milestone created by MAXSIM" \
163
+ --field state="open"
350
164
  ```
351
165
 
352
- Read key scan findings from `.planning/codebase/STACK.md` and `.planning/codebase/ARCHITECTURE.md`.
166
+ Capture the milestone number.
353
167
 
354
- Compare README claims against scan findings. **Only flag clear contradictions:**
355
- - README says "React app" but code is all Python → flag
356
- - README describes features not visible in code → do NOT flag (different scopes are normal)
357
- - README mentions deprecated tech but code uses current versions → flag
358
- - README is empty or minimal → note for later (PROJECT.md will capture this)
168
+ ## Phase 5: Local Setup
359
169
 
360
- Store discrepancy notes in a variable for use in Steps 6 and 9.
170
+ **5a. Write .claude/maxsim/config.json:**
361
171
 
362
- **If `has_readme` is false:** Skip. Note that no README exists for Step 9 context.
172
+ Create `.claude/maxsim/config.json` with:
363
173
 
364
- ## Step 5: Config Questions
365
-
366
- **If auto mode:** Skip. Use defaults and write config:
367
174
  ```json
368
175
  {
369
- "mode": "yolo",
370
- "depth": "standard",
371
- "parallelization": true,
372
- "commit_docs": false,
373
- "model_profile": "balanced",
374
- "workflow": {
375
- "research": true,
376
- "plan_checker": true,
377
- "verifier": true
378
- }
379
- }
380
- ```
381
-
382
- Write `.planning/config.json` with defaults and proceed to Step 9 (document generation).
383
-
384
- **If interactive mode:**
385
-
386
- ```
387
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
388
- MAXSIM ► CONFIGURATION
389
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
390
- ```
391
-
392
- **Check for global defaults** at `~/.maxsim/defaults.json`. If the file exists, offer to use saved defaults:
393
-
394
- ```
395
- AskUserQuestion([
396
- {
397
- question: "Use your saved default settings? (from ~/.maxsim/defaults.json)",
398
- header: "Defaults",
399
- multiSelect: false,
400
- options: [
401
- { label: "Yes (Recommended)", description: "Use saved defaults, skip settings questions" },
402
- { label: "No", description: "Configure settings manually" }
403
- ]
404
- }
405
- ])
406
- ```
407
-
408
- If "Yes": read `~/.maxsim/defaults.json`, use those values, skip to **Write config.json** below.
409
-
410
- If "No" or defaults.json doesn't exist, ask:
411
-
412
- **Round 1 -- Core settings:**
413
-
414
- ```
415
- AskUserQuestion([
416
- {
417
- header: "Mode",
418
- question: "How do you want to work?",
419
- multiSelect: false,
420
- options: [
421
- { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
422
- { label: "Interactive", description: "Confirm at each step" }
423
- ]
424
- },
425
- {
426
- header: "Depth",
427
- question: "How thorough should planning be?",
428
- multiSelect: false,
429
- options: [
430
- { label: "Quick", description: "Ship fast (3-5 phases, 1-3 plans each)" },
431
- { label: "Standard (Recommended)", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
432
- { label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
433
- ]
434
- },
435
- {
436
- header: "AI Models",
437
- question: "Which AI models for planning agents?",
438
- multiSelect: false,
439
- options: [
440
- { label: "Balanced (Recommended)", description: "Sonnet for most agents -- good quality/cost ratio" },
441
- { label: "Quality", description: "Opus for research/roadmap -- higher cost, deeper analysis" },
442
- { label: "Budget", description: "Haiku where possible -- fastest, lowest cost" }
443
- ]
444
- }
445
- ])
446
- ```
447
-
448
- **Round 2 -- Git and branching:**
449
-
450
- Auto-detect branching strategy from git:
451
- ```bash
452
- git branch -a 2>/dev/null
453
- ```
454
-
455
- If feature/* or develop branches exist, suggest that strategy. Otherwise default to 'none'.
456
-
457
- ```
458
- AskUserQuestion([
459
- {
460
- header: "Git Tracking",
461
- question: "Commit planning docs to git?",
462
- multiSelect: false,
463
- options: [
464
- { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
465
- { label: "No", description: "Keep .planning/ local-only (add to .gitignore)" }
466
- ]
467
- }
468
- ])
469
- ```
470
-
471
- **Round 3 -- Workflow agents:**
472
-
473
- ```
474
- AskUserQuestion([
475
- {
476
- header: "Research",
477
- question: "Research before planning each phase? (adds tokens/time)",
478
- multiSelect: false,
479
- options: [
480
- { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
481
- { label: "No", description: "Plan directly from requirements" }
482
- ]
176
+ "version": "6",
177
+ "project_name": "{project_name}",
178
+ "description": "{description}",
179
+ "architecture": "{architecture_pattern}",
180
+ "tech_stack": ["{primary_language}", "{frameworks}"],
181
+ "testing": {
182
+ "frameworks": ["{test_frameworks}"],
183
+ "coverage_percent": {coverage_percent}
483
184
  },
484
- {
485
- header: "Plan Check",
486
- question: "Verify plans will achieve their goals? (adds tokens/time)",
487
- multiSelect: false,
488
- options: [
489
- { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
490
- { label: "No", description: "Execute plans without verification" }
491
- ]
185
+ "ci_provider": "{ci_provider}",
186
+ "database": "{db_type}",
187
+ "no_gos": ["{no_go items}"],
188
+ "acceptance_criteria": "{acceptance_criteria}",
189
+ "github": {
190
+ "repo": "{owner/repo}",
191
+ "project_number": {PROJECT_NUMBER},
192
+ "milestone_number": {MILESTONE_NUMBER}
492
193
  },
493
- {
494
- header: "Verifier",
495
- question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
496
- multiSelect: false,
497
- options: [
498
- { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
499
- { label: "No", description: "Trust execution, skip verification" }
500
- ]
501
- }
502
- ])
503
- ```
504
-
505
- **Write config.json:**
506
-
507
- ```json
508
- {
509
- "mode": "[yolo|interactive]",
510
- "depth": "[quick|standard|comprehensive]",
511
- "parallelization": true,
512
- "commit_docs": [true|false],
513
- "model_profile": "[quality|balanced|budget]",
514
- "workflow": {
515
- "research": [true|false],
516
- "plan_checker": [true|false],
517
- "verifier": [true|false]
518
- }
194
+ "scan_date": "{ISO timestamp}",
195
+ "initialized_at": "{ISO timestamp}"
519
196
  }
520
197
  ```
521
198
 
522
- **If commit_docs = No:** Add `.planning/` to `.gitignore`.
523
-
524
- Write `.planning/config.json`:
525
- ```bash
526
- mkdir -p .planning
527
- ```
528
- Use the Write tool to create `.planning/config.json`.
529
-
530
- ## Step 6: Existing State Confirmation
531
-
532
- **If auto mode:** Skip. Use scan findings as-is. Proceed to Step 9.
199
+ **5b. Write or update CLAUDE.md:**
533
200
 
534
- Read the scan outputs:
535
201
  ```bash
536
- cat .planning/codebase/STACK.md
537
- cat .planning/codebase/ARCHITECTURE.md
538
- cat .planning/codebase/CONVENTIONS.md
539
- cat .planning/codebase/CONCERNS.md
540
- ```
541
-
542
- Present scan findings as a "new developer onboarding overview":
543
-
544
- ```
545
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
546
- MAXSIM ► CODEBASE SCAN COMPLETE
547
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
548
-
549
- ## Your Project
550
-
551
- **Purpose:** [Inferred from README + ARCHITECTURE.md analysis]
552
- **Tech Stack:** [From STACK.md -- e.g., React 18 + TypeScript 5.3, Express.js backend]
553
- **Architecture:** [From ARCHITECTURE.md -- e.g., Monorepo with 3 packages]
554
- **Key Patterns:** [From CONVENTIONS.md -- e.g., repository pattern, React hooks]
555
- **Known Concerns:** [From CONCERNS.md -- e.g., 12 TODOs, no auth test coverage]
556
-
557
- Confidence: ~85% -- some inferences may need correction.
558
- ```
559
-
560
- Include confidence qualifiers for uncertain findings:
561
- - Stack detection from package.json = HIGH confidence
562
- - Architecture inference from file structure = MEDIUM confidence
563
- - Purpose inference from README = MEDIUM-HIGH confidence
564
- - Pattern inference from code sampling = MEDIUM confidence
565
-
566
- If README discrepancies were found in Step 4, flag them:
567
- ```
568
- Warning: README Discrepancy: Your README describes [X] but the code implements [Y]. Which is current?
569
- ```
570
-
571
- Ask user to confirm or correct via AskUserQuestion:
572
- - header: "Scan"
573
- - question: "Does this look right? Correct anything that's wrong."
574
- - options:
575
- - "Looks correct" -- Proceed with these findings
576
- - "Some corrections" -- Let me fix some details
577
-
578
- If "Some corrections": ask "What needs correcting?" (freeform), capture corrections, apply to working context.
579
-
580
- Apply thinking-partner behaviors when presenting findings:
581
- - **Surface unstated assumptions** — "The scan assumes X is your primary framework — is that accurate?"
582
- - **Make consequences visible** — "Your architecture pattern means Y for future phases."
583
- - **Propose alternatives** — If concerns were found, suggest approaches: "The scan found tech debt in Z. We could address it early or defer — here are the trade-offs."
584
-
585
- ## Step 6b: Stack Preference Questions
586
-
587
- **If auto mode:** Skip. Use all detected technologies as-is (keep all). Proceed to Step 6c.
588
-
589
- Read `.planning/codebase/STACK.md` and extract architecturally significant dependencies.
590
-
591
- **Filter to only framework-level choices:**
592
- - Framework (React, Next.js, Express, Django, etc.)
593
- - Database (PostgreSQL, MongoDB, Redis, etc.)
594
- - ORM/Query builder (Drizzle, Prisma, SQLAlchemy, etc.)
595
- - State management (Redux, Zustand, Vuex, etc.)
596
- - Testing framework (Vitest, Jest, pytest, etc.)
597
- - Build tools (Vite, Webpack, tsup, etc.)
598
-
599
- **Explicitly EXCLUDE:**
600
- - Utility libraries (lodash, uuid, date-fns, etc.)
601
- - Dev tools (prettier, eslint, biome, etc.)
602
- - Type definitions (@types/*)
603
- - Runtime dependencies that are implementation details
604
-
605
- **Cap at 8-10 items max** to avoid overwhelming the user.
606
-
607
- Present to user:
608
-
609
- ```
610
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
611
- MAXSIM ► STACK PREFERENCES
612
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
613
-
614
- Your codebase uses these key technologies. For each, do you want to keep, evolve, or replace?
615
- ```
616
-
617
- For each significant dependency, use AskUserQuestion:
618
- - header: "[Technology Name]"
619
- - question: "[Technology] [version] -- [detected purpose]"
620
- - options:
621
- - "Keep" -- Continue using [Technology] as-is
622
- - "Evolve" -- Upgrade or modernize (describe target)
623
- - "Replace" -- Switch to alternative (describe replacement)
624
-
625
- If "Evolve" or "Replace": capture the target via freeform follow-up.
626
-
627
- **Capture decisions as constraints** for CONVENTIONS.md and DECISIONS.md. "Keep" entries become locked stack conventions. "Evolve" entries become phase goals. "Replace" entries become phase goals with migration requirements.
628
-
629
- ## Step 6c: Convention Confirmation
630
-
631
- **If auto mode:** Skip. Promote all scan-detected conventions as-is. Proceed to Step 6d.
632
-
633
- Read `.planning/codebase/CONVENTIONS.md` (from the codebase mapper agent) and extract detected coding conventions.
634
-
635
- Present scan-detected conventions to user for confirmation:
636
-
637
- ```
638
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
639
- MAXSIM ► CONVENTION CONFIRMATION
640
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
641
-
642
- Your codebase uses these patterns. Should new code follow them?
202
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs install write-claude-md \
203
+ --project-name "{project_name}" \
204
+ --description "{description}"
643
205
  ```
644
206
 
645
- For each major convention category (file naming, error handling, testing patterns, code style):
646
-
647
- Use AskUserQuestion:
648
- - header: "[Convention Category]"
649
- - question: "Detected: [description of convention]. Should new code follow this?"
650
- - options:
651
- - "Yes, follow this" -- Promote to project convention
652
- - "No, change it" -- Describe the preferred convention
653
- - "Not sure" -- Skip for now
207
+ If unavailable, write `.claude/maxsim/PROJECT.md` directly with full project context.
654
208
 
655
- If "No, change it": capture the preferred convention via freeform.
209
+ **5c. Commit initialization files:**
656
210
 
657
- **Promote confirmed conventions** to `.planning/CONVENTIONS.md` using the template from `templates/conventions.md`:
658
- - Tech Stack: from Step 6b stack preferences (keep/evolve decisions)
659
- - File Layout: from confirmed file structure conventions
660
- - Error Handling: from confirmed error handling patterns
661
- - Testing: from confirmed testing conventions
662
- - Set `{{source}}` to "init-existing scan + user confirmation"
663
- - Set `{{generated_or_confirmed}}` to "confirmed"
664
-
665
- Write `.planning/CONVENTIONS.md` directly using the Write tool (CONVENTIONS.md is not a valid artefakt type):
666
211
  ```bash
667
- # Use the Write tool to create .planning/CONVENTIONS.md with the content above
668
- ```
669
-
670
- ## Step 6d: No-Gos from Scan
671
-
672
- **If auto mode:** Skip. Auto-generate no-gos from CONCERNS.md findings. Proceed to Step 7.
673
-
674
- Read `.planning/codebase/CONCERNS.md` (if it exists) and extract findings as candidate no-gos.
675
-
676
- Present scan findings as candidate no-gos:
677
-
678
- ```
679
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
680
- MAXSIM ► NO-GOS FROM CODEBASE SCAN
681
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
682
-
683
- Based on the codebase scan, here are potential no-gos for new code:
212
+ git add .claude/
213
+ git commit -m "chore: initialize MAXSIM v6"
684
214
  ```
685
215
 
686
- For each significant finding from CONCERNS.md:
687
-
688
- Use AskUserQuestion:
689
- - header: "No-Go?"
690
- - question: "[Finding from CONCERNS.md] -- should this be a no-go for new code?"
691
- - options:
692
- - "Yes, add as no-go" -- This should be explicitly forbidden
693
- - "No, skip" -- This is acceptable or not relevant
694
- - "Modify" -- I want to adjust the wording
695
-
696
- If "Modify": capture adjusted wording via freeform.
697
-
698
- After all findings are reviewed:
699
-
700
- Use AskUserQuestion:
701
- - header: "Additional"
702
- - question: "Any additional no-gos based on your experience with this codebase?"
703
- - options:
704
- - "No, that covers it" -- Proceed
705
- - "Yes, let me add" -- Capture additional no-gos
706
-
707
- Confirmed no-gos flow into NO-GOS.md during document generation (Step 9f) using the structured template from `templates/no-gos.md`.
708
-
709
- ## Step 7: Future Direction Questions
710
-
711
- **If auto mode:** Skip. Generate generic "continue development" goals. Proceed to Step 9.
712
-
713
- Ask these questions sequentially using AskUserQuestion:
714
-
715
- **Question 1: Pain Points**
216
+ ## Phase 6: Roadmap (Optional)
716
217
 
717
218
  Use AskUserQuestion:
718
- - header: "Pain Points"
719
- - question: "What pain points or issues brought you to MAXSIM?"
219
+ - header: "Initial Roadmap"
220
+ - question: "Based on the scan findings and your goals, would you like to generate an initial roadmap now?"
720
221
  - options:
721
- - "Codebase complexity" -- Hard to track what's where, need structure
722
- - "No planning" -- Building ad-hoc, want a roadmap
723
- - "Tech debt" -- Need organized approach to cleanup
724
- - "New features" -- Want to add features systematically
725
- - "Other" -- Let me explain
222
+ - "Yes, generate roadmap from scan findings" create phase issues
223
+ - "No, I'll plan manually with /maxsim:plan" skip
726
224
 
727
- If "Other": capture freeform response.
225
+ **If "No":** Print completion message and exit.
728
226
 
729
- **Question 2: Project Stage**
227
+ **If "Yes":**
730
228
 
731
- Infer default from scan: tests exist + CI config = production; some tests = MVP; no tests = prototype.
732
-
733
- Use AskUserQuestion:
734
- - header: "Stage"
735
- - question: "What stage is your project in?"
736
- - options:
737
- - "Prototype" -- Early exploration, things change rapidly
738
- - "MVP" -- Core features working, refining toward release
739
- - "Production" -- Users depend on it, stability matters
740
- - "Maintenance" -- Stable, focused on fixes and incremental improvements
741
-
742
- **Question 3: Production Sub-Questions (only if stage = Production or Maintenance)**
743
-
744
- If the user selected Production or Maintenance:
745
-
746
- Use AskUserQuestion:
747
- - header: "Constraints"
748
- - question: "What absolutely cannot be broken? (These become MUST NOT requirements)"
749
- - options:
750
- - "Let me describe" -- I'll list specific things
751
-
752
- Capture their response (freeform). These become MUST NOT entries in REQUIREMENTS.md.
753
-
754
- Use AskUserQuestion:
755
- - header: "Deployment"
756
- - question: "Deployment requirements?"
757
- - options:
758
- - "Zero-downtime required" -- Can't take the service down for deploys
759
- - "Downtime OK" -- Brief maintenance windows are acceptable
760
- - "No deployments planned" -- Not deploying changes to production
761
-
762
- Use AskUserQuestion:
763
- - header: "Staging"
764
- - question: "Do you have a staging environment?"
765
- - options:
766
- - "Yes" -- Changes go through staging first
767
- - "No" -- Deploy directly to production
768
- - "Partial" -- Some things have staging, others don't
769
-
770
- Use AskUserQuestion:
771
- - header: "Rollback"
772
- - question: "Is a rollback plan needed for changes?"
773
- - options:
774
- - "Yes" -- Must be able to undo any change quickly
775
- - "No" -- Forward-fix is acceptable
776
- - "Depends" -- For some changes yes, others no
777
-
778
- **Question 4: General Constraints**
779
-
780
- Use AskUserQuestion:
781
- - header: "Limits"
782
- - question: "What constraints should I know about? (deadlines, backward compatibility, things that can't change)"
783
- - options:
784
- - "No major constraints" -- Flexible on approach
785
- - "Some constraints" -- Let me describe them
786
-
787
- If "Some constraints": capture freeform response.
788
-
789
- **Question 5: Missing Context**
790
-
791
- Use AskUserQuestion:
792
- - header: "Context"
793
- - question: "Is there anything the scan may have missed? (external integrations, business rules, organizational constraints)"
794
- - options:
795
- - "Scan covered it" -- Nothing major missing
796
- - "Yes, some things" -- Let me add context
229
+ Use the Agent tool with `run_in_background: false` to spawn a Roadmap agent. Self-contained prompt:
797
230
 
798
- If "Yes, some things": capture freeform response.
231
+ "You are creating an initial GitHub roadmap for a MAXSIM v6 project initialized in an existing codebase.
799
232
 
800
- **Question 6: Vision**
233
+ Project details:
234
+ - Name: {project_name}
235
+ - Description: {description}
236
+ - Architecture: {architecture_pattern}
237
+ - Tech stack: {primary_language}, {frameworks}
238
+ - Goals: {goals}
239
+ - Acceptance criteria: {acceptance_criteria}
240
+ - Tech debt to address: {total_todos} TODOs, {open_issue_count} open issues
241
+ - No-gos: {no_gos}
801
242
 
802
- Ask inline (freeform, NOT AskUserQuestion):
243
+ Scan summary:
244
+ - Test coverage: {coverage_percent}%
245
+ - CI provider: {ci_provider}
246
+ - Database: {db_type}
803
247
 
804
- "What is your vision for this project? What are you trying to build? No time horizon needed -- just purpose and direction."
248
+ Create 4–8 phase GitHub Issues on the repo {owner/repo}. Consider:
249
+ - Stabilization phases if coverage is low or debt is high
250
+ - Feature phases aligned with stated goals
251
+ - Infrastructure phases if CI/CD or deploy needs work
805
252
 
806
- Wait for response.
253
+ Each phase issue must:
254
+ 1. Have title format: 'Phase N: {phase_name}'
255
+ 2. Have label 'phase:{N}'
256
+ 3. Have a body with: goal statement, 5–10 acceptance criteria as task list (- [ ] item), and any relevant context from the scan
257
+ 4. Be added to milestone #{MILESTONE_NUMBER}
807
258
 
808
- **Thinking-partner follow-up on vision:**
259
+ Commands:
260
+ gh issue create --title 'Phase N: {name}' --label 'phase:{N}' --milestone {MILESTONE_NUMBER} --body '{body}' --repo {owner/repo}
809
261
 
810
- After the user shares their vision, apply thinking-partner behaviors:
811
- - Challenge vague statements: "You said 'improve performance' — improve which operations, for which users?"
812
- - Surface assumptions: "That assumes users will migrate from X — is that the plan?"
813
- - Propose alternatives if the vision seems narrow: "Have you considered approaching it from Y angle instead?"
262
+ After creating all issues, add each to the GitHub Project Board:
263
+ gh project item-add {PROJECT_NUMBER} --owner {OWNER} --url {issue_url}
814
264
 
815
- Use 1-2 follow-up AskUserQuestion prompts to sharpen the vision if needed. Don't over-question — 1-2 rounds max.
265
+ Set each issue status to 'To Do':
266
+ node ~/.claude/maxsim/bin/maxsim-tools.cjs github set-status --issue-number {N} --status 'To Do'
816
267
 
817
- ## Step 8: Milestone Suggestion
268
+ Return the list of created issue numbers and titles."
818
269
 
819
- **If auto mode:** Generate a milestone name from the inferred project purpose. Proceed to Step 9.
270
+ After the agent completes, display the phase list.
820
271
 
821
- Synthesize all gathered information and suggest a first milestone:
822
-
823
- ```
824
- Based on what you have and where you're going, I'd suggest:
825
-
826
- **Milestone: [Suggested Name]**
827
- Reasoning: [Why this milestone makes sense given current state and goals]
828
- ```
829
-
830
- Use AskUserQuestion:
831
- - header: "Milestone"
832
- - question: "Does this milestone name work?"
833
- - options:
834
- - "Yes" -- Use this name
835
- - "Rename" -- I have a different name in mind
836
-
837
- If "Rename": ask "What would you like to call it?" (freeform), capture response.
838
-
839
- ## Step 9: Document Generation
840
-
841
- Generate all planning documents. In merge mode, check if each file exists first. For existing files, check for required section headers. If a required header is missing, add the section. If present, leave it. For missing files, create from scratch.
842
-
843
- **Merge mode section-detection rules:**
844
- - PROJECT.md: required headers `## Core Value`, `## Key Decisions`
845
- - REQUIREMENTS.md: required headers `## Requirements` (or `## v1` / `## v2` etc.)
846
- - ROADMAP.md: required headers `## Phases`, `## Progress`
847
- - STATE.md: required headers `## Current Position`, `## Accumulated Context`
848
-
849
- If a required header is missing from an existing file, add the section at the end. If present, leave the file as-is.
850
-
851
- ### 9a: PROJECT.md
852
-
853
- **Skip if merge mode and file exists with all required headers.**
854
-
855
- Use template from `templates/project.md` as base. Fill in:
856
-
857
- **Standard sections:**
858
- - Project name (from README or directory name)
859
- - What This Is (from scan findings + README + user corrections)
860
- - Core Value (inferred from scan purpose or user's vision)
861
- - Requirements section (initial Active requirements from user goals)
862
- - Context section (technical environment from scan)
863
- - Constraints (from production sub-questions + general constraints)
864
- - Key Decisions table (from config choices + user decisions)
865
-
866
- **Extra sections for existing projects (per CONTEXT.md Decision 4):**
867
-
868
- Add these AFTER the standard sections:
869
-
870
- ```markdown
871
- ## Current State Summary
872
-
873
- [Condensed scan findings as onboarding overview for future agents.
874
- Include: tech stack, architecture pattern, key design patterns, current capabilities.]
875
-
876
- ## Known Risks / Tech Debt
877
-
878
- [From CONCERNS.md + user additions from Step 7.
879
- Format as actionable list with severity indicators.]
880
-
881
- ## Codebase Analysis
882
-
883
- Detailed codebase analysis available in:
884
- - `.planning/codebase/STACK.md` -- Technology stack
885
- - `.planning/codebase/ARCHITECTURE.md` -- Architecture patterns
886
- - `.planning/codebase/CONVENTIONS.md` -- Code conventions
887
- - `.planning/codebase/CONCERNS.md` -- Known issues and tech debt
888
- - `.planning/codebase/STRUCTURE.md` -- File tree overview
889
- ```
890
-
891
- If README discrepancies were found in Step 4:
892
- ```markdown
893
- ## README Validation Note
894
-
895
- README may be outdated in the following areas:
896
- - [discrepancy 1]
897
- - [discrepancy 2]
898
- Consider updating README to reflect current state.
899
- ```
900
-
901
- If no discrepancies, omit this section.
902
-
903
- **If auto mode:** Add at top of file:
904
- ```markdown
905
- <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
906
- ```
907
-
908
- ### 9b: REQUIREMENTS.md
909
-
910
- **Skip if merge mode and file exists with all required headers.**
911
-
912
- Use stage-aware format per CONTEXT.md Decision 4:
913
-
914
- **Prototype stage:**
915
- ```markdown
916
- # Requirements: [Project Name]
917
-
918
- **Defined:** [date]
919
- **Core Value:** [from PROJECT.md]
920
- **Stage:** Prototype
921
-
922
- ## Requirements
923
-
924
- Lightweight requirements for rapid exploration.
925
-
926
- - [ ] [Goal 1 -- informal description]
927
- - [ ] [Goal 2 -- informal description]
928
- - [ ] [Goal 3 -- informal description]
929
-
930
- ## Out of Scope
931
-
932
- - [Exclusion] -- [reason]
933
-
934
- ## Traceability
935
-
936
- | Requirement | Phase | Status |
937
- |-------------|-------|--------|
938
- | [Goal 1] | Phase 1 | Pending |
939
-
940
- ---
941
- *Requirements defined: [date]*
942
- ```
943
-
944
- **MVP stage:**
945
- ```markdown
946
- # Requirements: [Project Name]
947
-
948
- **Defined:** [date]
949
- **Core Value:** [from PROJECT.md]
950
- **Stage:** MVP
951
-
952
- ## v1 Requirements
953
-
954
- User stories for initial release.
955
-
956
- ### [Category 1]
957
-
958
- - [ ] **[CAT]-01**: As a user, I can [action] so that [benefit]
959
- - [ ] **[CAT]-02**: As a user, I can [action] so that [benefit]
960
-
961
- ### [Category 2]
962
-
963
- - [ ] **[CAT]-01**: As a user, I can [action] so that [benefit]
964
-
965
- ## v2 Requirements
966
-
967
- Deferred to future release.
968
-
969
- - **[CAT]-01**: [description]
970
-
971
- ## Out of Scope
972
-
973
- | Feature | Reason |
974
- |---------|--------|
975
- | [Feature] | [Why excluded] |
976
-
977
- ## Traceability
978
-
979
- | Requirement | Phase | Status |
980
- |-------------|-------|--------|
981
- | [CAT]-01 | Phase 1 | Pending |
982
-
983
- **Coverage:**
984
- - v1 requirements: [X] total
985
- - Mapped to phases: [Y]
986
- - Unmapped: [Z]
987
-
988
- ---
989
- *Requirements defined: [date]*
990
- ```
991
-
992
- **Production stage:**
993
- ```markdown
994
- # Requirements: [Project Name]
995
-
996
- **Defined:** [date]
997
- **Core Value:** [from PROJECT.md]
998
- **Stage:** Production
999
-
1000
- ## v1 Requirements
1001
-
1002
- Formal acceptance criteria with stability guards.
1003
-
1004
- ### [Category 1]
1005
-
1006
- - [ ] **[CAT]-01**: [Specific, testable requirement]
1007
- - Acceptance: [measurable criterion]
1008
- - [ ] **[CAT]-02**: [Specific, testable requirement]
1009
- - Acceptance: [measurable criterion]
1010
-
1011
- ### Stability Guards
1012
-
1013
- These are MUST NOT requirements derived from production constraints:
1014
-
1015
- - [ ] **GUARD-01**: MUST NOT break [critical thing from production sub-questions]
1016
- - [ ] **GUARD-02**: MUST NOT cause downtime during [operation]
1017
- - [ ] **GUARD-03**: MUST NOT remove backward compatibility with [system]
1018
-
1019
- ## v2 Requirements
1020
-
1021
- - **[CAT]-01**: [description]
1022
-
1023
- ## Out of Scope
1024
-
1025
- | Feature | Reason |
1026
- |---------|--------|
1027
- | [Feature] | [Why excluded] |
1028
-
1029
- ## Traceability
1030
-
1031
- | Requirement | Phase | Status |
1032
- |-------------|-------|--------|
1033
- | [CAT]-01 | Phase 1 | Pending |
1034
- | GUARD-01 | All phases | Active |
1035
-
1036
- **Coverage:**
1037
- - v1 requirements: [X] total
1038
- - Guards: [Y] total
1039
- - Mapped to phases: [Z]
1040
-
1041
- ---
1042
- *Requirements defined: [date]*
1043
- ```
1044
-
1045
- **Maintenance stage:** Same as Production format with additional stability focus:
1046
- ```markdown
1047
- ### Maintenance Focus
1048
-
1049
- - [ ] **MAINT-01**: All existing tests continue to pass after changes
1050
- - [ ] **MAINT-02**: No regression in [critical metric]
1051
- ```
1052
-
1053
- **If auto mode:** Add at top of file:
1054
- ```markdown
1055
- <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
1056
- ```
1057
-
1058
- ### 9c: ROADMAP.md
1059
-
1060
- **Skip if merge mode and file exists with all required headers.**
1061
-
1062
- Use template from `templates/roadmap.md`.
272
+ ## Completion
1063
273
 
1064
274
  ```
1065
275
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1066
- MAXSIM ► CREATING ROADMAP
276
+ MAXSIM ► PROJECT INITIALIZED
1067
277
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1068
278
 
1069
- ◆ Spawning roadmapper...
1070
- ```
1071
-
1072
- Spawn the planner (roadmap mode) via Task tool to generate the roadmap:
279
+ Project: {project_name}
280
+ GitHub: {owner/repo}
281
+ Board: {project_name} — MAXSIM (#{PROJECT_NUMBER})
282
+ Milestone: Milestone 1 (#{MILESTONE_NUMBER})
283
+ Phases: {N} phases created (or "none yet")
284
+ Scanned: {agent count} analysis agents completed
1073
285
 
286
+ Next step: /maxsim:go
1074
287
  ```
1075
- Task(prompt="
1076
- <planning_context>
1077
-
1078
- <files_to_read>
1079
- - .planning/PROJECT.md (Project context)
1080
- - .planning/REQUIREMENTS.md (Requirements)
1081
- - .planning/config.json (Depth and mode settings)
1082
- </files_to_read>
1083
-
1084
- <scan_context>
1085
- The project is an EXISTING codebase being initialized. Scan findings summary:
1086
-
1087
- **Tech Stack:** [from STACK.md]
1088
- **Architecture:** [from ARCHITECTURE.md]
1089
- **Key Patterns:** [from CONVENTIONS.md]
1090
- **Known Concerns:** [from CONCERNS.md]
1091
- </scan_context>
1092
-
1093
- <user_context>
1094
- **Vision:** [user's vision from Step 7, or inferred from scan in auto mode]
1095
- **Pain Points:** [from Step 7]
1096
- **Stage:** [prototype/MVP/production/maintenance]
1097
- **Milestone:** [suggested milestone name from Step 8]
1098
- </user_context>
1099
-
1100
- </planning_context>
1101
-
1102
- <instructions>
1103
- Create roadmap for an EXISTING project:
1104
- 1. Derive 3-5 concrete suggested phases based on actual scan findings and stated goals
1105
- 2. NO TBD placeholder phases -- every phase must be specific and actionable
1106
- 3. Map every v1 requirement to exactly one phase
1107
- 4. Derive 2-5 success criteria per phase (observable user behaviors)
1108
- 5. Validate 100% coverage
1109
- 6. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
1110
- 7. Return ROADMAP CREATED with summary
1111
-
1112
- This is an existing project -- phases should address real found issues and user goals,
1113
- not generic setup phases. The codebase already exists.
1114
-
1115
- Write files first, then return. This ensures artifacts persist even if context is lost.
1116
- </instructions>
1117
- ", subagent_type="planner", model="{roadmapper_model}", description="Create roadmap for existing project")
1118
- ```
1119
-
1120
- **Handle roadmapper return:**
1121
-
1122
- **If `## ROADMAP BLOCKED`:**
1123
- - Present blocker information
1124
- - Work with user to resolve
1125
- - Re-spawn when resolved
1126
-
1127
- **If `## ROADMAP CREATED`:**
1128
-
1129
- Read the created ROADMAP.md and present it inline:
1130
-
1131
- ```
1132
- ## Proposed Roadmap
1133
-
1134
- **[N] phases** | **[X] requirements mapped** | All v1 requirements covered
1135
-
1136
- | # | Phase | Goal | Requirements |
1137
- |---|-------|------|--------------|
1138
- | 1 | [Name] | [Goal] | [REQ-IDs] |
1139
- | 2 | [Name] | [Goal] | [REQ-IDs] |
1140
- | 3 | [Name] | [Goal] | [REQ-IDs] |
1141
- ```
1142
-
1143
- **If auto mode:** Skip approval gate. Proceed to Step 9d.
1144
-
1145
- **If interactive mode:**
1146
-
1147
- Use AskUserQuestion:
1148
- - header: "Roadmap"
1149
- - question: "Does this roadmap structure work for you?"
1150
- - options:
1151
- - "Approve" -- Commit and continue
1152
- - "Adjust phases" -- Tell me what to change
1153
- - "Review full file" -- Show raw ROADMAP.md
1154
-
1155
- If "Approve": continue.
1156
- If "Adjust phases": get feedback, re-spawn roadmapper with revision context, re-present. Loop until approved.
1157
- If "Review full file": display raw `cat .planning/ROADMAP.md`, then re-ask.
1158
-
1159
- ### 9c-ii: Create Phase Issues on GitHub
1160
-
1161
- After the roadmap is finalized (approved or auto-mode), create a GitHub Issue for each phase. This is a mandatory step — phase tracking lives in GitHub, not in local `.planning/phases/` files (per WIRE-02).
1162
-
1163
- Display banner:
1164
- ```
1165
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1166
- MAXSIM ► CREATING GITHUB PHASE ISSUES
1167
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1168
- ```
1169
-
1170
- 1. Parse `.planning/ROADMAP.md` to extract all phases. For each phase, collect:
1171
- - `phase_number` (e.g., `01`, `02`)
1172
- - `phase_name` (e.g., "Foundation")
1173
- - `goal` (the phase goal statement)
1174
- - `requirements` (list of REQ-IDs mapped to this phase)
1175
- - `success_criteria` (list of observable outcomes)
1176
-
1177
- 2. For each phase, run `github create-phase`:
1178
- ```bash
1179
- node ~/.claude/maxsim/bin/maxsim-tools.cjs github create-phase \
1180
- --phase-number "[phase_number]" \
1181
- --phase-name "[phase_name]" \
1182
- --goal "[goal]"
1183
- ```
1184
- The tool auto-adds each issue to the project board with "To Do" status.
1185
-
1186
- 3. Track results per phase. If any phase issue creation fails:
1187
- - Log which phases succeeded and which failed.
1188
- - Offer targeted retry for failed phases only (do not re-create successful ones).
1189
-
1190
- 4. Report completion:
1191
- ```
1192
- ✓ Created {N} phase issues on GitHub Project Board #{project_number}
1193
- ```
1194
-
1195
- **Note:** Per WIRE-02, phase-level artifact files (PLAN.md, SUMMARY.md, RESEARCH.md, CONTEXT.md) are NOT created in `.planning/phases/` during init. These live exclusively as GitHub Issue comments and bodies. The following local files are still created and committed: PROJECT.md, REQUIREMENTS.md, config.json, STATE.md, ROADMAP.md.
1196
-
1197
- ### 9d: STATE.md
1198
-
1199
- **Skip if merge mode and file exists with all required headers.**
1200
-
1201
- If the roadmapper already created STATE.md (it usually does), verify it exists. If not, create using template from `templates/state.md`.
1202
-
1203
- Pre-populate:
1204
- - **Project Reference:** Core value from PROJECT.md, current focus = Phase 1
1205
- - **Current Position:** Phase 1 of [N], ready to plan
1206
- - **Decisions section:** Add constraints as decisions (e.g., "Must maintain backward compatibility with API v1")
1207
- - **Blockers section:** Add known tech debt and risks from CONCERNS.md as blockers
1208
-
1209
- **If auto mode:** Add at top of file:
1210
- ```markdown
1211
- <!-- Auto-generated by /maxsim:init --auto. Review recommended. -->
1212
- ```
1213
-
1214
- ### 9e: config.json
1215
-
1216
- Already written in Step 5. If merge mode and config.json existed, it was preserved (unless user chose overwrite).
1217
-
1218
- ### 9f: Artefakte Generation
1219
-
1220
- Generate structured artefakte documents from gathered context.
1221
-
1222
- **DECISIONS.md:**
1223
-
1224
- ```bash
1225
- node ~/.claude/maxsim/bin/maxsim-tools.cjs artefakte-write decisions
1226
- ```
1227
-
1228
- Write content:
1229
-
1230
- ```markdown
1231
- # Key Decisions
1232
-
1233
- **Generated:** [date]
1234
- **Source:** Init-existing initialization
1235
-
1236
- | # | Decision | Rationale | Alternatives Considered | Status |
1237
- |---|----------|-----------|------------------------|--------|
1238
- | 1 | [Config choice: mode] | [Why] | [Other options] | Locked |
1239
- | 2 | [Stage assessment] | [Evidence from scan] | [Other stages considered] | Locked |
1240
- | 3 | [Any constraint decisions from Step 7] | [Why] | [Alternatives] | Locked |
1241
-
1242
- ---
1243
- *Decisions captured during /maxsim:init initialization*
1244
- ```
1245
-
1246
- **ACCEPTANCE-CRITERIA.md:**
1247
-
1248
- ```bash
1249
- node ~/.claude/maxsim/bin/maxsim-tools.cjs artefakte-write acceptance-criteria
1250
- ```
1251
-
1252
- Write content:
1253
-
1254
- ```markdown
1255
- # Acceptance Criteria
1256
-
1257
- **Generated:** [date]
1258
- **Source:** Init-existing initialization
1259
-
1260
- ## Project-Level Criteria
1261
-
1262
- - [ ] [Observable outcome from user's vision]
1263
- - [ ] [Observable outcome from user's vision]
1264
- - [ ] [Stability guard from production constraints, if applicable]
1265
-
1266
- ## Phase-Level Criteria
1267
-
1268
- Populated per-phase during /maxsim:plan (discussion stage).
1269
-
1270
- ---
1271
- *Criteria derived from init-existing initialization*
1272
- ```
1273
-
1274
- **NO-GOS.md:**
1275
-
1276
- ```bash
1277
- node ~/.claude/maxsim/bin/maxsim-tools.cjs artefakte-write no-gos
1278
- ```
1279
-
1280
- Write content:
1281
-
1282
- ```markdown
1283
- # No-Gos
1284
-
1285
- **Generated:** [date]
1286
- **Source:** Init-existing initialization
1287
-
1288
- ## Must Not Break
1289
-
1290
- [From production constraints / GUARD requirements in REQUIREMENTS.md]
1291
-
1292
- - [Critical thing that cannot break] -- [why]
1293
-
1294
- ## Anti-Patterns
1295
-
1296
- [From CONCERNS.md and user input]
1297
-
1298
- - [Approach to avoid] -- [why]
1299
-
1300
- ## Scope Boundaries
1301
-
1302
- - [What this milestone is NOT trying to achieve]
1303
-
1304
- ---
1305
- *No-gos captured during /maxsim:init initialization*
1306
- ```
1307
-
1308
- **If auto mode:** Generate artefakte from scan findings with reasonable inferences. Mark uncertain entries with `(inferred)`.
1309
-
1310
- **Commit artefakte:**
1311
-
1312
- ```bash
1313
- node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: generate initialization artefakte" --files .planning/DECISIONS.md .planning/ACCEPTANCE-CRITERIA.md .planning/NO-GOS.md
1314
- ```
1315
-
1316
- ## Step 9g: Agent Dry-Run Validation
1317
-
1318
- **Always runs after all documents are generated — this is the quality gate for init output.**
1319
-
1320
- Spawn a test agent to validate that all generated docs contain enough information for a fresh agent to start Phase 1 without asking clarifying questions.
1321
-
1322
- ```
1323
- Task(prompt="
1324
- You are a fresh agent about to start Phase 1 of this project.
1325
- Read the following files and report what you would need to ask before starting work.
1326
-
1327
- Do NOT infer missing information. If a specific library version is not stated, report it as a gap.
1328
- If the error handling pattern is not described, report it as a gap.
1329
- Your job is to find what is NOT written, not to demonstrate you could figure it out.
1330
-
1331
- <files_to_read>
1332
- - .planning/PROJECT.md
1333
- - .planning/REQUIREMENTS.md
1334
- - .planning/CONVENTIONS.md
1335
- - .planning/NO-GOS.md
1336
- - .planning/ROADMAP.md
1337
- </files_to_read>
1338
-
1339
- Report format:
1340
-
1341
- ## DRY-RUN RESULT
1342
-
1343
- ### Can Start: YES/NO
1344
-
1345
- ### Gaps Found:
1346
- - [What information is missing]
1347
- - [What is ambiguous]
1348
- - [What would need clarification]
1349
-
1350
- ### Quality Score: [1-10]
1351
- (10 = could start immediately with zero questions, 1 = need major clarifications)
1352
- ", model="{planner_model}", description="Agent readiness dry-run")
1353
- ```
1354
-
1355
- **Handle dry-run results:**
1356
-
1357
- **If gaps found (Can Start = NO or Quality Score < 7):**
1358
- - For each gap, update the relevant document to fill it:
1359
- - Missing tech versions → update CONVENTIONS.md Tech Stack
1360
- - Missing error handling → update CONVENTIONS.md Error Handling
1361
- - Ambiguous requirements → update REQUIREMENTS.md
1362
- - Missing constraints → update NO-GOS.md
1363
- - Commit the fixes:
1364
- ```bash
1365
- node ~/.claude/maxsim/bin/maxsim-tools.cjs commit "docs: fill gaps from agent dry-run validation" --files .planning/PROJECT.md .planning/REQUIREMENTS.md .planning/CONVENTIONS.md .planning/NO-GOS.md
1366
- ```
1367
-
1368
- **If no gaps (Can Start = YES and Quality Score >= 7):**
1369
- - Continue to Step 10.
1370
-
1371
- ## Step 10: Git Stage and Summary
1372
-
1373
- Stage all changed files:
1374
- ```bash
1375
- git add .planning/
1376
- ```
1377
-
1378
- If `commit_docs` is true:
1379
- ```bash
1380
- git commit -m "docs: initialize MAXSIM in existing project via /maxsim:init"
1381
- ```
1382
-
1383
- Print structured summary:
1384
-
1385
- ```
1386
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1387
- MAXSIM ► INITIALIZATION COMPLETE ✓
1388
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1389
-
1390
- Created:
1391
- ✓ .planning/config.json -- Workflow preferences
1392
- ✓ .planning/PROJECT.md -- Project context + current state
1393
- ✓ .planning/CONVENTIONS.md -- Confirmed coding conventions for agents
1394
- ✓ .planning/REQUIREMENTS.md -- [Stage]-format requirements
1395
- ✓ .planning/ROADMAP.md -- [Milestone name] + [N] phases
1396
- ✓ .planning/STATE.md -- Pre-populated project memory
1397
- ✓ .planning/codebase/ -- Full codebase analysis (4 docs + structure)
1398
- ✓ GitHub Project Board #{project_number} -- [N] phase issues created with "To Do" status
1399
- ```
1400
-
1401
- If auto mode, append:
1402
- ```
1403
- Documents were auto-generated from codebase analysis. Review recommended before starting execution.
1404
- ```
1405
-
1406
- Print next steps:
1407
-
1408
- ```
1409
- ───────────────────────────────────────────────────────────────
1410
-
1411
- ## ▶ Next Up
1412
-
1413
- **Phase 1: [Phase Name]** -- [Goal from ROADMAP.md]
1414
-
1415
- /maxsim:plan 1 -- plan the first phase
1416
-
1417
- <sub>/clear first → fresh context window</sub>
1418
-
1419
- ───────────────────────────────────────────────────────────────
1420
-
1421
- **Also available:**
1422
- - /maxsim:progress -- review the generated roadmap
1423
- - /maxsim:progress -- see project status
1424
-
1425
- ───────────────────────────────────────────────────────────────
1426
- ```
1427
-
1428
- **End of workflow.**
1429
288
 
1430
289
  </process>
1431
290
 
1432
- <output>
1433
-
1434
- - `.planning/config.json`
1435
- - `.planning/PROJECT.md`
1436
- - `.planning/CONVENTIONS.md`
1437
- - `.planning/REQUIREMENTS.md`
1438
- - `.planning/ROADMAP.md`
1439
- - `.planning/STATE.md`
1440
- - `.planning/DECISIONS.md`
1441
- - `.planning/ACCEPTANCE-CRITERIA.md`
1442
- - `.planning/NO-GOS.md`
1443
- - `.planning/codebase/STACK.md`
1444
- - `.planning/codebase/ARCHITECTURE.md`
1445
- - `.planning/codebase/CONVENTIONS.md`
1446
- - `.planning/codebase/CONCERNS.md`
1447
- - `.planning/codebase/STRUCTURE.md`
1448
-
1449
- </output>
1450
-
1451
- <success_criteria>
1452
-
1453
- - [ ] .planning/ directory created (or merged)
1454
- - [ ] Git repo initialized (if not already)
1455
- - [ ] GitHub remote detected (gate passed)
1456
- - [ ] GitHub CLI authenticated (gate passed)
1457
- - [ ] `github setup` called successfully — project_number recorded
1458
- - [ ] Conflict detection completed (merge/overwrite/cancel dialog)
1459
- - [ ] Codebase scan completed (4 mapper agents spawned)
1460
- - [ ] README validated against scan findings
1461
- - [ ] Config questions answered (or auto-defaulted)
1462
- - [ ] Existing state presented and confirmed (or auto-inferred)
1463
- - [ ] Future direction gathered (pain points, stage, constraints, vision)
1464
- - [ ] Production sub-questions asked (if production/maintenance stage)
1465
- - [ ] Milestone suggested and confirmed
1466
- - [ ] PROJECT.md created with brownfield extra sections
1467
- - [ ] REQUIREMENTS.md created with stage-aware format
1468
- - [ ] ROADMAP.md created with 3-5 concrete phases (no TBD)
1469
- - [ ] `github create-phase` called for every phase — all issues on board with "To Do" status
1470
- - [ ] STATE.md created with pre-populated decisions and blockers
1471
- - [ ] config.json created with workflow settings
1472
- - [ ] .planning/codebase/ populated with scan documents
1473
- - [ ] Git staging completed
1474
- - [ ] Stack preference questions asked (keep/evolve/replace for framework-level choices)
1475
- - [ ] Convention confirmation completed (scan-detected conventions presented to user)
1476
- - [ ] CONVENTIONS.md generated from confirmed conventions
1477
- - [ ] CONCERNS.md findings presented as candidate no-gos
1478
- - [ ] Agent dry-run validation passed (Quality Score >= 7)
1479
- - [ ] Structured summary printed
1480
- - [ ] Next steps suggested: /maxsim:progress then /maxsim:plan 1
1481
-
1482
- **Auto mode criteria:**
1483
- - [ ] All questions skipped
1484
- - [ ] Smart defaults applied
1485
- - [ ] All documents flagged as auto-generated
1486
- - [ ] Review recommendation printed
1487
-
1488
- **Merge mode criteria:**
1489
- - [ ] Existing files preserved where complete
1490
- - [ ] Missing files created
1491
- - [ ] Incomplete files had gaps filled
1492
- - [ ] Codebase always re-scanned
1493
-
1494
- **Atomic commits:** Each artifact committed if commit_docs is true.
1495
-
1496
- </success_criteria>
291
+ <constraints>
292
+ - Tool name is Agent (NOT Task)
293
+ - No SlashCommand tool
294
+ - GitHub Issues is the SOLE source of truth — no local .planning/ directory
295
+ - Use `node ~/.claude/maxsim/bin/maxsim-tools.cjs` for CLI operations
296
+ - EnterPlanMode must be used before any code-modifying execution steps
297
+ - Agent spawning uses: Agent tool with isolation:"worktree", run_in_background:true (for parallel scan) or run_in_background:false (for sequential roadmap work)
298
+ - Self-contained agent prompts — every agent prompt includes all context it needs inline, no external references
299
+ - Maximum 4 questions per AskUserQuestion call
300
+ - Do NOT read actual .env files with real secrets — only .env.example or documented equivalents
301
+ - Spawn all scan agents simultaneously; do not wait for one before starting the next
302
+ - Synthesize all agent findings before presenting to user — do not dump raw JSON
303
+ </constraints>