skills/mp-execute/SKILL.md
Execute tasks with TDD from GitHub issues, milestones, or inline descriptions. Use when: "execute issue", "implement issue", "work on issue", "execute tasks", "run TDD"
npx skillsauth add MartinoPolo/mpx-claude-code mp-executeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Unified execution skill with TDD methodology. Accepts GitHub issues, milestones, or inline tasks.
Use compressed output throughout execution: drop articles, filler, pleasantries, hedging. Fragments OK. Use abbreviations (DB/auth/config) and arrows (X → Y). Pattern: [thing] [action] [reason]. [next step]. Keep technical terms exact, code blocks intact, error messages verbatim.
When reading sub-agent results, extract only actionable findings — ignore verbose prose.
Exception: Step 11 final report uses normal professional prose (it's posted as a PR comment and read by humans).
/mp-execute #42 # Single GitHub issue
/mp-execute milestone:"Epic 2" # Pick one open, unblocked issue from milestone
/mp-execute "add dark mode toggle" # Inline task (no GitHub issue)
/mp-execute "- [ ] add dark mode toggle\n- [ ] fix header spacing" # Inline checklist
/mp-execute --full-review #42 # Single issue with 6-reviewer full review
/mp-execute --no-review #42 # Simple task — skip reviewer sub-agents
/mp-execute --no-auto-merge #42 # Stop after CI green; leave PR open
Detect input type from $ARGUMENTS:
#42gh issue view <number> --json title,body,labels,comments,state,milestone,url
Extract: goal, constraints, acceptance criteria, blocking relationships.
milestone:"Epic 2"gh issue list --milestone "Epic 2" --state open --json number,title,labels,body
Select exactly one open, unblocked issue from milestone order and execute only that issue in this run. If none are unblocked, report blockers and stop.
"add dark mode toggle, fix header spacing"Parse comma-separated tasks or markdown checklist items. No GitHub issue — just execute with TDD.
If no $ARGUMENTS: ask user what to execute.
Spawn mp-issue-analyzer sub-agent to explore + analyze + plan:
Issue: [title, body, acceptance criteria] Codebase: [project root]
- Explore the codebase to understand relevant areas
- Classify issue type (bug/task/feature) with rationale
- Create execution plan with:
- Files to modify/create
- Behaviors to test (for TDD)
- Acceptance criteria mapped to test cases
- Risk areas and open questions
- If external library behavior is uncertain, note it for Context7 lookup
If analyzer identifies open questions → ask user (clarification gate).
If analyzer identifies external library uncertainty → spawn mp-context7-docs-fetcher sub-agent.
bash $HOME/.claude/scripts/detect-check-scripts.sh
Parse output key=value pairs. Store all detected commands — both check-style (CHECK_ALL, TYPECHECK, LINT, FORMAT, BUILD) and test-style (TEST, TEST_UNIT, TEST_E2E) — for use in Step 5 and Step 6.
Treat test commands as first-class checks. They are the CI parity gate: if CI runs them, this skill must run them locally before push.
Execute the selected issue/task using red-green-refactor:
From the analyzer output (or inline task description), list the behaviors that need tests:
Spawn mp-tdd-executor sub-agent with:
The executor handles the full red-green-refactor cycle for each behavior.
After TDD execution, always spawn mp-checker with detected static check commands from Step 3 (CHECK_ALL or TYPECHECK/LINT/FORMAT/BUILD). Static checks always run — they are part of the CI-parity gate.
Unless --no-review is set, also spawn these sonnet reviewer sub-agents in parallel:
mp-reviewer-code-qualitymp-reviewer-best-practicesmp-reviewer-spec-alignmentmp-reviewer-test-qualityIf --full-review is set, additionally spawn in parallel:
mp-reviewer-securitymp-reviewer-performancemp-reviewer-error-handlingIf reviewers or checker report issues (confidence > 65):
mp-executor sub-agent (sonnet) with pre-analyzed fix instructions: for each finding, pass the file path, current code, and exact change to apply. Do not pass raw findings for the executor to interpret.If still failing after 3 iterations → collect remaining issues as unresolved items for triage in Step 7.
This step runs the project's own test suites exactly as CI does. This is the mandatory CI-parity gate and must pass before commit/push.
Using the test commands detected in Step 3 (TEST, TEST_UNIT, TEST_E2E), spawn mp-checker with:
TEST or TEST_UNIT (unit tests — fast, always run)TEST_E2E (e2e/browser tests — run when any of the following changed: source files, route files, component files, e2e spec files, build config, or dependencies)If no test commands were detected → skip to Step 6c.
If any test command fails:
mp-executor sub-agent (sonnet) with pre-analyzed fix instructions: for each failure, pass the file path, root cause, and exact change to apply. The executor applies fixes — it does not diagnose.If tests still fail after 3 iterations → do not push. Report failures to user and stop. This is a hard blocker, not an unresolved item.
When changes are UI-heavy and e2e tests don't cover the specific interaction, optionally spawn mp-playwright-tester sub-agent for exploratory browser-based verification. This is in addition to TEST_E2E, never a replacement for it.
After review and frontend verification, collect any items that remain unresolved:
If no unresolved items → skip to Step 8.
Spawn mp-unresolved-issue-tracker sub-agent:
Source issue: #<current_issue> Unresolved items:
- <summary>: <reasoning why unresolved> — <description>
- ...
The agent finds the parent PRD, scans sibling issues for scope match (appends to sibling body if fits), and creates/updates an Unresolved: [PRD title] tracking issue (labeled HITL) for remaining items. See agents/mp-unresolved-issue-tracker.md for full logic.
Spawn mp-git-committer sub-agent to stage, commit, and push:
push: true (for GitHub issues) / false (for inline tasks) issue_ref: "refs #N" or "fixes #N" (for GitHub issues) commit_hint: summary of implemented behaviors from Step 4
Handle result:
For inline tasks (no GitHub issue): skip to Step 11.
Spawn mp-pr-manager sub-agent to create or update the PR:
issue_number: N (from Step 1) description_hint: summary of changes and behaviors implemented
Handle result:
After creating/updating the PR, check mergeability:
gh pr view <pr_number> --json mergeable,mergeStateStatus --jq '{mergeable, mergeStateStatus}'
If mergeable is CONFLICTING: the base branch has diverged and CI will not run until conflicts are resolved. Do not assume CI is pending or rate-limited — merge conflicts are the most common reason for missing CI checks.
git fetch origin <base_branch>
git merge origin/<base_branch>
mp-git-committer sub-agent with push: true, commit_hint: "merge conflict resolution with <base>"If still conflicting after 2 iterations → escalate to user.
The skill is not done until CI is green. Local Step 6 is not a substitute — CI environment differences (OS, headless browsers, timing, secrets, build flags) can still produce divergent results.
After push (and after confirming PR is mergeable per Step 9d), watch checks until they complete:
gh pr checks <pr_number> --watch
If any CI check fails:
gh run view <run_id> --log-failed
If CI still fails after 3 iterations → escalate to user with full log summary. Do not declare completion.
The skill is done only when all of these are true:
--no-auto-merge is setgh pr checks <pr> shows all checks passedAfter CI is green:
gh pr comment <pr_number> --body-file <temp_file>
The comment must be byte-identical to the text output as the final report of this run, so the PR carries a complete audit trail.
--no-auto-merge is set, merge the PR and sync the main worktree:3a. Check PR state (auto-merge may have already merged it):
gh pr view <pr_number> --json state --jq '.state'
3b. Merge if still open (without --delete-branch — it fails in worktree contexts):
If state is OPEN:
gh pr merge <pr_number> --squash --auto
If state is MERGED, skip.
3c. Delete the remote feature branch (idempotent):
git push origin --delete <branch_name> 2>/dev/null || true
3d. Pull merged changes into the main worktree:
MAIN_REPO=$(dirname "$(cd "$(git rev-parse --git-common-dir)" && pwd)")
git -C "$MAIN_REPO" pull
Skip 3d if not in a worktree (i.e., git rev-parse --git-common-dir returns .git).
Code quality and git conventions enforced by hooks.
@ts-ignore, eslint-disable)gh pr checks shows green, not when local checks passAuto-merge is the default behavior: after CI is green and the final-report comment is posted, the PR is squash-merged and the branch deleted. Use --no-auto-merge to opt out.
| Flag | Effect |
| ----------------- | ------------------------------------------------------------------------------- |
| --full-review | Add security, performance, and error-handling reviewers (6 reviewers total) |
| --no-review | Skip all reviewer sub-agents in Step 5 (static checks still run for CI parity) |
| --no-tdd | Skip TDD loop, implement directly (for trivial changes like config updates) |
| --no-auto-merge | Stop after CI green + final-report comment; leave PR open instead of merging it |
development
Audit all active skills for consistency, convention drift, and common issues. Auto-fixes where possible, reports remaining issues. Use when: "audit skills", "skill audit", "check skills", "lint skills"
testing
Ship finished work: sync base, commit, push, PR, wait for CI green, merge. Use when: "ship it", "ship and merge", "ship this"
development
Scan recent Claude Code sessions for grilling/design discussions, extract decisions, and update CONTEXT.md + DECISIONS.md. Use when: "harvest decisions", "extract decisions from sessions", "update docs from sessions", "sync decisions"
tools
Consolidate CONTEXT.md: remove duplicates, outdated items, tighten language. Use when: "consolidate context", "clean up context", "simplify context", "consolidate requirements"