-
Notifications
You must be signed in to change notification settings - Fork 0
feat(execution): wire Execute→Review→Simplify→Review pipeline into executor workflow #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,7 @@ export interface ExecutePhaseContext { | |
| state_path: string; | ||
| roadmap_path: string; | ||
| config_path: string; | ||
| skill_paths: string; | ||
| } | ||
|
|
||
| export interface PlanPhaseContext { | ||
|
|
@@ -393,6 +394,8 @@ export function cmdInitExecutePhase(cwd: string, phase: string | undefined, raw: | |
| const milestone = getMilestoneInfo(cwd); | ||
| const phase_req_ids = extractReqIds(cwd, phase!); | ||
|
|
||
| const skillPaths = path.join(os.homedir(), '.claude', 'skills'); | ||
|
|
||
| const result: ExecutePhaseContext = { | ||
| executor_model: resolveModelInternal(cwd, 'maxsim-executor'), | ||
| verifier_model: resolveModelInternal(cwd, 'maxsim-verifier'), | ||
|
|
@@ -431,6 +434,7 @@ export function cmdInitExecutePhase(cwd: string, phase: string | undefined, raw: | |
| state_path: '.planning/STATE.md', | ||
| roadmap_path: '.planning/ROADMAP.md', | ||
| config_path: '.planning/config.json', | ||
| skill_paths: skillPaths, | ||
| }; | ||
|
Comment on lines
397
to
438
|
||
|
|
||
| output(result, raw); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,7 +23,7 @@ Before executing, discover project context: | |||||||||||||
|
|
||||||||||||||
| **Self-improvement lessons:** Read `.planning/LESSONS.md` if it exists — accumulated lessons from past executions on this codebase. Apply them proactively to avoid known mistakes before they become deviations. | ||||||||||||||
|
|
||||||||||||||
| **Project skills:** Check `.agents/skills/` directory if it exists: | ||||||||||||||
| **Project skills:** Check `~/.claude/skills/` directory if it exists (also check `.claude/skills/` in the project root as a fallback): | ||||||||||||||
| 1. List available skills (subdirectories) | ||||||||||||||
| 2. Read `SKILL.md` for each skill (lightweight index ~130 lines) | ||||||||||||||
| 3. Load specific `rules/*.md` files as needed during implementation | ||||||||||||||
|
|
@@ -80,22 +80,57 @@ grep -n "type=\"checkpoint" [plan-path] | |||||||||||||
| **Pattern C: Continuation** — Check `<completed_tasks>` in prompt, verify commits exist, resume from specified task. | ||||||||||||||
| </step> | ||||||||||||||
|
|
||||||||||||||
| <step name="task_context_loading"> | ||||||||||||||
| ## Task-Based Context Loading (EXEC-03) | ||||||||||||||
|
|
||||||||||||||
| For each task, load ONLY the files listed in the task's `Files:` field — not the entire codebase. | ||||||||||||||
|
|
||||||||||||||
| 1. Call `skill-context` or read the plan to get the task's file list | ||||||||||||||
| 2. Use the `Read` tool to load only those specific files | ||||||||||||||
| 3. If the task has no `Files:` field, load files referenced in the task description | ||||||||||||||
|
Comment on lines
+88
to
+90
|
||||||||||||||
| 1. Call `skill-context` or read the plan to get the task's file list | |
| 2. Use the `Read` tool to load only those specific files | |
| 3. If the task has no `Files:` field, load files referenced in the task description | |
| 1. Read the plan (e.g., `PLAN.md`) and parse the current task's `Files:` field to get the task's file list | |
| 2. Use the `Read` tool to load only those specific files | |
| 3. If the task has no `Files:` field, load files explicitly referenced in the task description |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -152,7 +152,7 @@ Execute each wave in sequence. Within a wave: parallel if `PARALLELIZATION=true` | |||||||||
| - .planning/STATE.md (State) | ||||||||||
| - .planning/config.json (Config, if exists) | ||||||||||
| - ./CLAUDE.md (Project instructions, if exists — follow project-specific guidelines and coding conventions) | ||||||||||
| - .agents/skills/ (Project skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation) | ||||||||||
| - ~/.claude/skills/ (Skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation) | ||||||||||
|
||||||||||
| - ~/.claude/skills/ (Skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation) | |
| - ./.claude/skills/ (Project-local skills, if exists — override or extend global skills; list skills and read SKILL.md for each) | |
| - ~/.claude/skills/ (Global skills, if exists — list skills, read SKILL.md for each, follow relevant rules during implementation) |
Copilot
AI
Mar 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description says skill path references were updated “across executor and orchestrator”, but there are still multiple templates referencing .agents/skills/ (e.g., templates/workflows/plan-phase.md, templates/workflows/quick.md, and several agent templates like maxsim-planner.md). If the skills directory move is intended repo-wide, those remaining references will keep pointing at the old location and create inconsistent behavior/documentation.
Copilot
AI
Mar 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suggested command uses --grep="{phase}-{first_plan_in_wave}", but first_plan_in_wave isn’t defined anywhere else in this workflow template (unlike {phase}-{plan} above). As written, this is likely to be copy-pasted and fail or produce an empty commit hash. Consider computing the first plan ID for the wave explicitly (or using the collected plan IDs/commit hashes from the wave) and reference that variable here.
| # Get all files changed in this wave | |
| WAVE_FIRST_COMMIT=$(git log --oneline --all --grep="{phase}-{first_plan_in_wave}" --reverse | head -1 | cut -d' ' -f1) | |
| # Get all files changed in this wave. | |
| # Assumes $WAVE_FIRST_COMMIT was recorded when starting the wave (the first commit for this wave). |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -144,13 +144,32 @@ Deviations are normal — handle via rules below. | |||||||||||
|
|
||||||||||||
| 1. Read @context files from prompt | ||||||||||||
| 2. Per task: | ||||||||||||
| - `type="auto"`: if `tdd="true"` → TDD execution. Implement with deviation rules + auth gates. Verify done criteria. Commit (see task_commit). Track hash for Summary. | ||||||||||||
| - `type="auto"`: if `tdd="true"` → TDD execution. Implement with deviation rules + auth gates. Verify done criteria. **Simplify** (see simplify_pass). Re-verify. Commit (see task_commit). Track hash for Summary. | ||||||||||||
| - `type="checkpoint:*"`: STOP → checkpoint_protocol → wait for user → continue only after confirmation. | ||||||||||||
| 3. Run `<verification>` checks | ||||||||||||
| 4. Confirm `<success_criteria>` met | ||||||||||||
| 5. Document deviations in Summary | ||||||||||||
| </step> | ||||||||||||
|
|
||||||||||||
| <step name="simplify_pass"> | ||||||||||||
| ## Post-Task Simplification | ||||||||||||
|
|
||||||||||||
| After each task's implementation passes tests but BEFORE committing, run a simplification pass on the files modified by that task: | ||||||||||||
|
|
||||||||||||
| 1. **Duplication check:** Scan modified files for copy-pasted blocks, near-identical functions, repeated patterns. Extract shared helpers where 3+ lines repeat. | ||||||||||||
| 2. **Dead code removal:** Remove unused imports, unreachable branches, commented-out code, unused variables/functions introduced by this task. | ||||||||||||
| 3. **Complexity reduction:** Simplify nested conditionals (early returns), flatten callback chains, replace verbose patterns with idiomatic equivalents. | ||||||||||||
|
|
||||||||||||
| **Rules:** | ||||||||||||
| - Only simplify files touched by the current task — do NOT refactor unrelated code | ||||||||||||
| - Changes must be behavior-preserving (no new features, no bug fixes) | ||||||||||||
| - If no simplification opportunities found, skip — do not force changes | ||||||||||||
| - After applying simplifications, re-run the task's verification to confirm nothing broke | ||||||||||||
| - Track simplifications as part of the task (not as separate deviations) | ||||||||||||
|
|
||||||||||||
| **Skip if:** Task only modifies config files, documentation, or has fewer than 10 lines of code changes. | ||||||||||||
| </step> | ||||||||||||
|
|
||||||||||||
| <authentication_gates> | ||||||||||||
|
|
||||||||||||
| ## Authentication Gates | ||||||||||||
|
|
@@ -270,6 +289,51 @@ TASK_COMMITS+=("Task ${TASK_NUM}: ${TASK_COMMIT}") | |||||||||||
|
|
||||||||||||
| </task_commit> | ||||||||||||
|
|
||||||||||||
| <wave_code_review> | ||||||||||||
| ## Post-Wave Code Review Gate | ||||||||||||
|
|
||||||||||||
| After ALL tasks in a wave complete (all committed), run a 2-stage code review on the wave's changes before proceeding to the next wave. | ||||||||||||
|
|
||||||||||||
| **1. Identify wave changes:** | ||||||||||||
| ```bash | ||||||||||||
| # Get the diff for all commits in this wave | ||||||||||||
| WAVE_FIRST_COMMIT=$(echo "${TASK_COMMITS[0]}" | awk '{print $NF}') | ||||||||||||
| git diff ${WAVE_FIRST_COMMIT}^..HEAD --name-only | ||||||||||||
|
Comment on lines
+300
to
+301
|
||||||||||||
| WAVE_FIRST_COMMIT=$(echo "${TASK_COMMITS[0]}" | awk '{print $NF}') | |
| git diff ${WAVE_FIRST_COMMIT}^..HEAD --name-only | |
| # WAVE_FIRST_COMMIT must be set to the first commit hash of this wave at wave start, e.g.: | |
| # WAVE_FIRST_COMMIT=$(git rev-parse --short HEAD) | |
| git diff "${WAVE_FIRST_COMMIT}^"..HEAD --name-only |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExecutePhaseContextis exported from the published CLI package; adding a new required field (skill_paths) is a breaking TypeScript change for any external consumers that construct this type. Consider making it optional (or adding a new optional field) to preserve compatibility, especially since it’s not yet used elsewhere in the codebase.