Skip to content

Commit e08c0d0

Browse files
authored
Merge pull request #151 from zevorn/codex/feature-capability-map
Add capability map to gen-plan
2 parents eec73c4 + 8d896a4 commit e08c0d0

22 files changed

Lines changed: 290 additions & 52 deletions

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A Claude Code plugin that provides iterative development with independent AI rev
1515
- **Iteration over Perfection** -- Instead of expecting perfect output in one shot, Humanize leverages continuous feedback loops where issues are caught early and refined incrementally.
1616
- **One Build + One Review** -- Claude implements, Codex independently reviews. No blind spots.
1717
- **Ralph Loop with Swarm Mode** -- Iterative refinement continues until all acceptance criteria are met. Optionally parallelize with Agent Teams.
18+
- **Capability Anchors** -- Generated plans include a feature/capability map, and RLCR rounds keep Claude and Codex anchored to the relevant capability node.
1819
- **Begin with the End in Mind** -- Before the loop starts, Humanize verifies that *you* understand the plan you are about to execute. The human must remain the architect. ([Details](docs/usage.md#begin-with-the-end-in-mind))
1920

2021
## How It Works
@@ -58,6 +59,7 @@ Requires [codex CLI](https://github.com/openai/codex) for review. See the full [
5859
/humanize:gen-plan --input .humanize/explore/<run-id>/final-idea.md --output docs/plan.md
5960
```
6061
Add `--coach` to run mandatory short-answer stage quizzes after each planning stage. Normal plan decision questions stay separate; quiz mismatches are treated as design drift, AI design correction, or background gaps before the agent expands the next planning layer.
62+
Generated plans include a `Feature Map / Capability Map` before the task breakdown so each task carries its global capability context.
6163

6264
4. **Refine an annotated plan** before implementation when reviewers add comments (`CMT:` ... `ENDCMT`, `<cmt>` ... `</cmt>`, or `<comment>` ... `</comment>`):
6365
```bash
@@ -68,6 +70,7 @@ Requires [codex CLI](https://github.com/openai/codex) for review. See the full [
6870
```bash
6971
/humanize:start-rlcr-loop docs/plan.md
7072
```
73+
When the plan has a capability map, RLCR records a `Capability Anchor` in each round contract and Goal Tracker active task so Claude coding and Codex review stay aligned with the map.
7174

7275
6. **Consult Gemini** for deep web research (requires Gemini CLI):
7376
```bash

commands/gen-plan.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,15 @@ Example: "The implementation includes core feature X with basic validation"
533533
534534
<Describe relative dependencies between components, not time estimates>
535535
536+
## Feature Map / Capability Map
537+
538+
Use this section to map feature- or capability-level dependencies and context. It supplements `## Task Breakdown` by showing how related tasks carry business, design, and implementation context across the plan; it is not a replacement for executable tasks.
539+
540+
| Capability ID | Capability / Feature | Target ACs | Depends On | Context Summary | Implementation Surface |
541+
|---------------|----------------------|------------|------------|-----------------|------------------------|
542+
| cap1 | <User-facing or internal capability> | AC-1, AC-2 | - | Business: <why this matters>; Design: <expected behavior/UX/API>; Implementation: <state, data, or integration context to preserve> | <files/modules/components likely involved> |
543+
| cap2 | <Dependent capability> | AC-3 | cap1 | Business: <dependency rationale>; Design: <constraints inherited from cap1>; Implementation: <interfaces or decisions reused from cap1> | <files/modules/components likely involved> |
544+
536545
## Task Breakdown
537546
538547
Each task must include exactly one routing tag:
@@ -636,7 +645,9 @@ When `alternative_plan_language` is empty, absent, set to `"English"`, or set to
636645
637646
18. **Convergence Requirement**: The plan MUST record Claude/Codex agreements, resolved disagreements, and final convergence status in `## Claude-Codex Deliberation`. Stop only when convergence conditions are met or max rounds reached with explicit carry-over decisions.
638647
639-
19. **Task Tag Requirement**: The plan MUST include `## Task Breakdown`, and every task MUST be tagged as either `coding` or `analyze` (no untagged tasks, no other tag values).
648+
19. **Feature Map Requirement**: The plan MUST include `## Feature Map / Capability Map` before `## Task Breakdown`. Use it to group tasks into feature/capability nodes, record capability dependencies, and preserve business/design/implementation context that later implementation rounds should carry forward. Capability IDs must be stable and dependency references must point to existing capability IDs or `-`.
649+
650+
20. **Task Tag Requirement**: The plan MUST include `## Task Breakdown`, and every task MUST be tagged as either `coding` or `analyze` (no untagged tasks, no other tag values).
640651
641652
---
642653

commands/refine-plan.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ The refined plan MUST retain these required sections:
412412

413413
Optional sections that MUST be preserved when present in the input:
414414

415+
- `## Feature Map / Capability Map`
415416
- `## Codex Team Workflow`
416417
- `## Convergence Log`
417418
- `--- Original Design Draft Start ---` appendix and its matching end marker

commands/start-rlcr-loop.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,19 +142,20 @@ This loop uses a **Goal Tracker** to prevent goal drift across iterations:
142142

143143
### Structure
144144
- **IMMUTABLE SECTION**: Ultimate Goal and Acceptance Criteria (set in Round 0, never changed)
145-
- **MUTABLE SECTION**: Active Tasks, Completed Items, Deferred Items, Plan Evolution Log
145+
- **MUTABLE SECTION**: Active Tasks, Capability anchors, Completed Items, Deferred Items, Plan Evolution Log
146146

147147
### Key Features
148148
1. **Acceptance Criteria**: Each task maps to a specific AC - nothing can be "forgotten"
149-
2. **Task Tag Routing**: Every task should carry `coding` or `analyze` tag from plan generation
149+
2. **Capability Anchors**: When the plan has `Feature Map / Capability Map`, each mainline task and round contract records the relevant capability node
150+
3. **Task Tag Routing**: Every task should carry `coding` or `analyze` tag from plan generation
150151
- `coding -> Claude`, `analyze -> Codex`
151-
3. **Plan Evolution Log**: If you discover the plan needs changes, document the change with justification
152-
4. **Explicit Deferrals**: Deferred tasks require strong justification and impact analysis
153-
5. **Full Alignment Checks**: At configurable intervals (default every 5 rounds: rounds 4, 9, 14, etc.), Codex conducts a comprehensive goal alignment audit. Use `--full-review-round N` to customize (min: 2)
152+
4. **Plan Evolution Log**: If you discover the plan needs changes, document the change with justification
153+
5. **Explicit Deferrals**: Deferred tasks require strong justification and impact analysis
154+
6. **Full Alignment Checks**: At configurable intervals (default every 5 rounds: rounds 4, 9, 14, etc.), Codex conducts a comprehensive goal alignment audit. Use `--full-review-round N` to customize (min: 2)
154155

155156
### How to Use
156157
1. **Round 0**: Initialize the Goal Tracker with Ultimate Goal and Acceptance Criteria
157-
2. **Each Round**: Update task status, log plan changes, note discovered issues
158+
2. **Each Round**: Update task status, capability anchors, log plan changes, note discovered issues
158159
3. **Before Exit**: Ensure goal-tracker.md reflects current state accurately
159160

160161
## Important Rules

docs/usage.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ Humanize creates an iterative feedback loop with two phases:
1111

1212
The loop continues until all acceptance criteria are met or no issues remain.
1313

14+
When a plan includes `Feature Map / Capability Map`, RLCR also tracks a per-round
15+
`Capability Anchor`. Claude uses it to keep implementation tied to the relevant
16+
business, design, and implementation context, while Codex reviews capability-map
17+
alignment alongside normal acceptance criteria.
18+
1419
## Begin with the End in Mind
1520

1621
Before the RLCR loop starts any work, Humanize runs a **Plan Understanding Quiz** -- a brief pre-flight check that verifies you genuinely understand the plan you are about to execute.
@@ -46,6 +51,9 @@ The quiz is advisory, not a gate. You always have the option to proceed. But tha
4651
```bash
4752
/humanize:gen-plan --input draft.md --output docs/plan.md
4853
```
54+
The generated plan includes a `Feature Map / Capability Map` that records
55+
capability dependencies and context before tasks are split into executable
56+
`coding` and `analyze` work.
4957
2. If the plan is reviewed with comment annotations, refine it and generate a QA ledger:
5058
```bash
5159
/humanize:refine-plan --input docs/plan.md
@@ -173,9 +181,13 @@ Workflow:
173181
3. Analyzes draft for clarity, consistency, completeness, and functionality
174182
4. Engages user to resolve any issues found
175183
5. When `--coach` is enabled, runs mandatory stage quizzes after each planning stage; normal plan decision questions stay separate, and quiz mismatches become design drift, AI design corrections, or background gaps before overall acceptance
176-
6. Generates a structured plan.md with acceptance criteria
184+
6. Generates a structured plan.md with acceptance criteria, capability map, and task routing tags
177185
7. Optionally starts `/humanize:start-rlcr-loop` if `--auto-start-rlcr-if-converged` conditions are met
178186

187+
The capability map supplements the task breakdown: it tells Claude and Codex
188+
which global feature or capability each task belongs to, what it depends on, and
189+
which business/design/implementation context must be preserved during RLCR.
190+
179191
If reviewers later annotate the generated plan with comment blocks, run
180192
`/humanize:refine-plan --input <plan.md>` before starting or resuming implementation.
181193

hooks/loop-codex-stop-hook.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,6 +1439,14 @@ Follow the plan's per-task routing tags strictly:
14391439
- `coding` task -> Claude executes directly
14401440
- `analyze` task -> execute via `/humanize:ask-codex`, then integrate the result
14411441
- Keep Goal Tracker Active Tasks columns `Tag` and `Owner` aligned with execution
1442+
1443+
## Capability Anchor Reminder
1444+
1445+
If the plan contains `## Feature Map / Capability Map`:
1446+
- The round contract must name the relevant Capability ID(s) or capability/feature name(s)
1447+
- Goal Tracker Active Tasks must keep their `Capability` column aligned with the round contract
1448+
- Mainline work must preserve the selected capability's business, design, and implementation context
1449+
- Do not let queued or future-scope capability work take over the current round
14421450
ROUTING_EOF
14431451
}
14441452

@@ -1566,11 +1574,12 @@ You are in the **Review Phase** of the RLCR loop. Codex has performed a code rev
15661574
## Instructions
15671575
15681576
1. Re-anchor on the original plan and current goal tracker before changing code
1569-
2. Refresh the round contract at {{ROUND_CONTRACT_FILE}}
1577+
2. Refresh the round contract at {{ROUND_CONTRACT_FILE}}, including its Capability Anchor when the plan has a capability map
15701578
3. Address only the issues that are truly blocking the current mainline objective or code-review acceptance
1571-
4. Record non-blocking follow-up items as queued, not as the main goal
1572-
5. Commit your changes after fixing the issues
1573-
6. Write your summary to: {{SUMMARY_FILE}}"
1579+
4. Keep fixes inside the current Capability Anchor unless review proves it was wrong
1580+
5. Record non-blocking follow-up items as queued, not as the main goal
1581+
6. Commit your changes after fixing the issues
1582+
7. Write your summary to: {{SUMMARY_FILE}}"
15741583

15751584
load_and_render_safe "$TEMPLATE_DIR" "claude/review-phase-prompt.md" "$fallback" \
15761585
"REVIEW_CONTENT=$review_content" \
@@ -2054,6 +2063,7 @@ Before executing tasks in this round:
20542063
1. Read @{{BITLESSON_FILE}}
20552064
2. Run \`bitlesson-selector\` for each task/sub-task
20562065
3. Follow selected lesson IDs (or \`NONE\`)
2066+
4. Preserve the Capability Anchor from @{{ROUND_CONTRACT_FILE}} when the plan has a capability map
20572067
20582068
## Codex Review
20592069
{{REVIEW_CONTENT}}
@@ -2069,7 +2079,7 @@ Before writing code:
20692079
- Re-read @{{PLAN_FILE}}
20702080
- Re-read @{{GOAL_TRACKER_FILE}}
20712081
- Re-read the recent round summaries and review results
2072-
- Rewrite @{{ROUND_CONTRACT_FILE}} with a recovery-focused mainline objective
2082+
- Rewrite @{{ROUND_CONTRACT_FILE}} with a recovery-focused mainline objective and Capability Anchor
20732083
20742084
Do not spend this round clearing queued work. Recover mainline progress first.
20752085

prompt-template/block/round-contract-missing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Before you try to exit this round, write the current round contract to:
66
The round contract must restate:
77
- The single **mainline objective** for this round
88
- The target ACs
9+
- The Capability Anchor for this round, or `N/A` when the plan has no `Feature Map / Capability Map`
910
- Which issues are truly **blocking**
1011
- Which issues are **queued** and out of scope
1112
- The concrete success criteria for this round

prompt-template/claude/drift-replan-prompt.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Before changing code:
2525
Your recovery contract must contain:
2626
- Exactly one recovered **mainline objective**
2727
- The 1-2 target ACs that prove mainline progress this round
28+
- The recovered **Capability Anchor**: relevant `Feature Map / Capability Map` node(s), or `N/A` if the plan has no capability map
2829
- The root cause of recent drift or stagnation
2930
- Which issues are truly **blocking** the recovered mainline objective
3031
- Which issues remain **queued** and explicitly out of scope
@@ -56,6 +57,7 @@ Below is Codex's review result:
5657

5758
Before starting work, **read and update** @{{GOAL_TRACKER_FILE}} as needed:
5859
- Keep the immutable section unchanged
60+
- Re-anchor Active Tasks on the recovered Capability Anchor when the plan has a `Feature Map / Capability Map`
5961
- Record the drift/stagnation cause in the mutable section if it changed planning
6062
- Keep blocking vs queued issue classification accurate
6163
- Ensure the tracker and contract now describe the same recovered mainline objective
@@ -64,5 +66,6 @@ Before starting work, **read and update** @{{GOAL_TRACKER_FILE}} as needed:
6466

6567
- Do not spend this round mostly on queued cleanup
6668
- Do not broaden scope to compensate for previous stalls
69+
- Do not jump to unrelated or future-scope capability nodes to compensate for previous stalls
6770
- If the original approach was flawed, log the plan evolution explicitly instead of silently changing direction
6871
- If you cannot produce a credible recovered mainline objective, say so in the summary with concrete blockers

prompt-template/claude/next-round-prompt.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Before writing code:
2020
Your round contract must contain:
2121
- Exactly one **mainline objective**
2222
- The 1-2 target ACs for this round
23+
- The **Capability Anchor**: relevant `Feature Map / Capability Map` node(s), or `N/A` if the plan has no capability map
2324
- Which issues are truly **blocking** that mainline objective
2425
- Which issues are **queued** and explicitly out of scope
2526
- Concrete success criteria for this round
@@ -55,6 +56,7 @@ Below is Codex's review result:
5556

5657
Before starting work, **read** @{{GOAL_TRACKER_FILE}} to understand:
5758
- The Ultimate Goal and Acceptance Criteria you're working toward
59+
- Which Capability each Active Task belongs to, when the plan has a `Feature Map / Capability Map`
5860
- Which tasks are Active, Completed, or Deferred
5961
- Which side issues are blocking vs queued
6062
- Any Plan Evolution that has occurred
@@ -67,6 +69,8 @@ If you cannot safely reconcile the tracker yourself, include an optional "Goal T
6769
## Mainline Guardrails
6870

6971
- Keep the mainline objective from @{{ROUND_CONTRACT_FILE}} stable for this round
72+
- Keep the Capability Anchor from @{{ROUND_CONTRACT_FILE}} stable for this round
73+
- Before implementing each mainline task, restate how it fits the anchored capability's business, design, and implementation context
7074
- Do not let queued issues take over the round
7175
- If Codex reported several findings, classify them into:
7276
- mainline gaps

prompt-template/claude/review-phase-prompt.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Before touching code:
1010
- Refresh the current round contract at @{{ROUND_CONTRACT_FILE}}
1111

1212
The round contract must preserve a single mainline objective. Code review findings do NOT automatically become the new round objective.
13+
If the original plan contains `## Feature Map / Capability Map`, the refreshed contract must also preserve or update the current Capability Anchor intentionally.
1314

1415
## Review Results
1516

@@ -35,9 +36,10 @@ Do not create new `[mainline]` tasks in review phase unless the review proves th
3536

3637
1. **Refresh the round contract** at `{{ROUND_CONTRACT_FILE}}`
3738
2. **Address blocking issues first** and keep the mainline objective stable
38-
3. **Focus on fixes only** - do not add new features or make unrelated changes
39-
4. **Commit your changes** after fixing the issues
40-
5. **Write your summary** to: `{{SUMMARY_FILE}}`
39+
3. **Keep fixes inside the Capability Anchor** unless the review proves the anchor was wrong
40+
4. **Focus on fixes only** - do not add new features or make unrelated changes
41+
5. **Commit your changes** after fixing the issues
42+
6. **Write your summary** to: `{{SUMMARY_FILE}}`
4143

4244
## Summary Template
4345

0 commit comments

Comments
 (0)