You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/CLAUDE.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,3 +7,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi
7
7
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
8
8
- The plan template in `commands/gen-plan.md` (Phase 5 Plan Structure section) and `prompt-template/plan/gen-plan-template.md` are intentionally kept in sync. When modifying either file, ensure both are updated to maintain consistency.
9
9
- Conversely, changes to `prompt-template/plan/gen-plan-template.md` must also be reflected in the Plan Structure section of `commands/gen-plan.md`.
10
+
- The directions.json schema v1 is defined in two places that must stay in sync: the jq validation expression in `scripts/validate-directions-json.sh` and the schema documentation in `commands/gen-idea.md` (Step 4.5). When adding, removing, or renaming a field in either place, update the other.
11
+
- Worker constraints (hard caps, isolation rules, no-push rule, sentinel format) are documented in four places that must stay in sync: `commands/explore-idea.md` (coordinator phases), `prompt-template/explore/worker-prompt.md` (worker instructions), `scripts/validate-explore-idea-io.sh` (cap enforcement), and `docs/usage.md` (user-facing option docs). Any change to a cap value or constraint must be reflected in all four.
Copy file name to clipboardExpand all lines: README.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,29 +45,35 @@ Requires [codex CLI](https://github.com/openai/codex) for review. See the full [
45
45
```bash
46
46
/humanize:gen-idea "add undo/redo to the editor"
47
47
```
48
-
Output goes to `.humanize/ideas/<slug>-<timestamp>.md`by default. Pass a `.md` path to expand existing rough notes. `--n` controls how many parallel directions explore the idea (default 6).
48
+
Output goes to `.humanize/ideas/<slug>-<timestamp>.md`and a companion `directions.json` artifact. Pass a `.md` path to expand existing rough notes. `--n` controls how many parallel directions explore the idea (default 6).
49
49
50
-
2.**Generate a plan**from your draft:
50
+
2.**Explore directions as parallel prototypes**(optional — skip if you want to go straight to planning):
Dispatches bounded parallel prototype workers (one per direction), each running in an isolated git worktree. After all workers complete, writes `.humanize/explore/<run-id>/explore-report.md` for audit/ranking details and `.humanize/explore/<run-id>/final-idea.md` as the plan-ready synthesis. Worker worktrees are optional prototype fast paths; the default follow-up is to generate a clean plan from `final-idea.md`.
54
55
55
-
3.**Refine an annotated plan** before implementation when reviewers add comments (`CMT:` ... `ENDCMT`, `<cmt>` ... `</cmt>`, or `<comment>` ... `</comment>`):
56
+
3.**Generate a plan** from your draft or explored final idea:
4.**Refine an annotated plan** before implementation when reviewers add comments (`CMT:` ... `ENDCMT`, `<cmt>` ... `</cmt>`, or `<comment>` ... `</comment>`):
56
62
```bash
57
63
/humanize:refine-plan --input docs/plan.md
58
64
```
59
65
60
-
4.**Run the loop**:
66
+
5.**Run the loop**:
61
67
```bash
62
68
/humanize:start-rlcr-loop docs/plan.md
63
69
```
64
70
65
-
5.**Consult Gemini** for deep web research (requires Gemini CLI):
71
+
6.**Consult Gemini** for deep web research (requires Gemini CLI):
66
72
```bash
67
73
/humanize:ask-gemini What are the latest best practices for X?
68
74
```
69
75
70
-
6.**Monitor progress (in another terminal, not inside Claude Code)**:
76
+
7.**Monitor progress (in another terminal, not inside Claude Code)**:
71
77
```bash
72
78
source<path/to/humanize>/scripts/humanize.sh # Or just add it into your .bashec or .zshrc
@@ -16,7 +18,7 @@ Read and execute below with ultrathink.
16
18
17
19
## Hard Constraint: Draft-Only Output
18
20
19
-
This command MUST NOT implement features, modify source code, or create commits while producing the draft. Permitted writes are limited to the single output draft file produced in Phase 4; prerequisite directory creation for the default `.humanize/ideas/` path by the validation script is permitted as part of that write. All exploration subagents run read-only.
21
+
This command MUST NOT implement features, modify source code, or create commits while producing the draft. Permitted writes are limited to the output draft file and its companion `directions.json` artifact produced in Phase 4; prerequisite directory creation for the default `.humanize/ideas/` path by the validation script is permitted. `rm` is permitted solely to delete those two just-written files when companion JSON validation fails (no-partial-output cleanup). All exploration subagents run read-only.
20
22
21
23
This command transforms a loose idea into a repo-grounded draft suitable as input to `/humanize:gen-plan`. It applies directed-diversity exploration: a lead picks N orthogonal directions, N parallel `Explore` subagents develop each, the lead synthesizes a draft with one primary direction plus N-1 alternatives. Each direction carries objective evidence from the repo.
22
24
@@ -28,7 +30,7 @@ This command transforms a loose idea into a repo-grounded draft suitable as inpu
28
30
2. IO Validation
29
31
3. Direction Generation
30
32
4. Parallel Exploration
31
-
5. Synthesisand Write
33
+
5. Synthesis, Write Draft, and Write Companion JSON
32
34
33
35
---
34
36
@@ -51,14 +53,15 @@ Run:
51
53
```
52
54
53
55
Handle exit codes:
54
-
-`0`: Parse stdout to extract `INPUT_MODE`, `OUTPUT_FILE`, `SLUG`, `TEMPLATE_FILE`, `N` (each appears on its own `KEY: value` line). When `INPUT_MODE` is `file`, stdout additionally contains an `IDEA_BODY_FILE: <path>` line; extract that too. Continue to Phase 2. (`SLUG` is informational — the script has already incorporated it into `OUTPUT_FILE`, so later phases do not need to use `SLUG` directly.)
56
+
-`0`: Parse stdout to extract `INPUT_MODE`, `OUTPUT_FILE`, `DIRECTIONS_JSON_FILE`, `SLUG`, `TEMPLATE_FILE`, `N` (each appears on its own `KEY: value` line). When `INPUT_MODE` is `file`, stdout additionally contains an `IDEA_BODY_FILE: <path>` line; extract that too. Continue to Phase 2. (`SLUG` is informational — the script has already incorporated it into `OUTPUT_FILE`, so later phases do not need to use `SLUG` directly.)
55
57
-`1`: Report "Missing or empty idea input" and stop.
56
58
-`2`: Report "Input looks like a file path but is missing, not readable, or not `.md`" and stop.
57
59
-`3`: Report "Output directory does not exist — please create it or choose a different path" and stop.
58
60
-`4`: Report "Output file already exists — choose a different path" and stop.
59
61
-`5`: Report "No write permission to output directory" and stop.
60
-
-`6`: Report "Invalid arguments" with the stdout usage text and stop.
62
+
-`6`: Report "Invalid arguments — output path must have `.md` suffix" with the stdout usage text and stop.
-`8`: Report "Companion directions.json already exists — choose a different output path or remove the existing companion file" and stop.
62
65
63
66
Before `VALIDATION_SUCCESS`, stdout may contain one or more lines starting with `WARNING:` (for example, `WARNING: short idea (<N> chars); proceeding` when an inline idea is under 10 characters). Surface these warnings to the user in your final report but continue Phase 2 normally. `WARNING:` lines are informational, not errors.
64
67
@@ -190,13 +193,73 @@ Produce the finalized draft content in memory by replacing placeholders:
190
193
191
194
Write the finalized content to `OUTPUT_FILE` using the `Write` tool. Single write; no progressive edits.
192
195
193
-
### Step 4.5: Report
196
+
### Step 4.5: Build and Write Companion JSON
197
+
198
+
Construct the companion `directions.json` in memory using all surviving direction proposals from Phase 3, then write it to `DIRECTIONS_JSON_FILE` (from Phase 1 stdout).
199
+
200
+
**JSON structure (schema version 1):**
201
+
202
+
```json
203
+
{
204
+
"schema_version": 1,
205
+
"title": "<TITLE from Step 4.2>",
206
+
"original_idea": "<IDEA_BODY verbatim>",
207
+
"synthesis_notes": "<SYNTHESIS_NOTES from Step 4.3>",
208
+
"metadata": {
209
+
"n_requested": <N>,
210
+
"n_returned": <count of surviving directions>,
211
+
"timestamp": "<YYYYMMDD-HHmmss>",
212
+
"draft_path": "<OUTPUT_FILE>"
213
+
},
214
+
"directions": [
215
+
{
216
+
"direction_id": "dir-<NN>-<dir-slug>",
217
+
"dir_slug": "<lowercase-alphanumeric-hyphen slug derived from direction name>",
218
+
"source_index": <original 0-based index from DIRECTIONS list>,
219
+
"display_order": <0 for primary, 1..K for alternatives in sequential order>,
220
+
"is_primary": <true for PRIMARY, false otherwise>,
221
+
"name": "<direction name>",
222
+
"rationale": "<direction rationale from Phase 2>",
223
+
"raw_phase3_response": "<exact raw subagent response text for this direction>",
224
+
"approach_summary": "<APPROACH_SUMMARY from subagent>",
-`dir_slug`: Derived from direction name — lowercase, replace non-alphanumeric with hyphens, collapse consecutive hyphens, strip leading/trailing hyphens. Must match `^[a-z0-9-]+$`.
236
+
-`dir_slug` collision handling: if two direction names slugify to the same value, append `-2`, `-3`, etc. by original `source_index` order until every `dir_slug` is unique.
237
+
-`source_index`: The 0-based index of this direction in the original `DIRECTIONS` list from Phase 2 (before any degradation drops).
238
+
-`display_order`: 0 for the primary direction, 1 through K for alternatives in their sequential order.
239
+
-`is_primary`: `true` for exactly one direction (PRIMARY), `false` for all others.
240
+
-`objective_evidence`: Each bullet item from the subagent's `OBJECTIVE_EVIDENCE` field as a string array element.
241
+
-`known_risks`: Each bullet item from the subagent's `KNOWN_RISKS` field as a string array element.
242
+
-`metadata.n_returned` must equal `directions.length`.
243
+
244
+
After writing `DIRECTIONS_JSON_FILE`, validate it:
If validation fails, delete both `OUTPUT_FILE` and `DIRECTIONS_JSON_FILE` and stop with error: `companion JSON validation failed — this is a bug in the command; please report it`.
Generates a repo-grounded idea draft using directed-diversity exploration. A lead agent picks N orthogonal directions, N parallel Explore subagents develop each direction with objective evidence from the repo, and the lead synthesizes a draft with one primary direction plus N-1 alternatives.
Launches bounded parallel prototype workers — one per selected direction — each running in an isolated git worktree. After all workers complete, synthesizes an explore report plus a plan-ready final idea:
95
+
-**Tier 1**: Best product direction (ranked by user value, evidence, strategic fit)
96
+
-**Tier 2**: Most implementation-ready prototype (ranked by outcome: task status, Codex verdict, tests, commits)
97
+
98
+
**Options:**
99
+
-`--directions <ids>` — comma-separated `direction_id` or `source_index` values to run (default: first 6 by display order)
0 commit comments