skills/implement/SKILL.md
Scope execution pipeline and implementation methodology. Use for executing scopes (TDD three-phase pipeline), verifying completion, debugging, or building features from requirements.
npx skillsauth add srnnkls/tropos implementInstall 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.
Active scopes:
!find scopes -maxdepth 3 -name scope.md 2>/dev/null
Checkpoints:
!find scopes -name checkpoint.yaml -maxdepth 3 2>/dev/null
Git status:
!git status --short 2>/dev/null
Current branch:
!git branch --show-current 2>/dev/null
Base drift (behind-count + overlapping files vs trunk):
!b=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@.*/@@'); b=${b:-main}; git fetch origin "$b" --quiet 2>/dev/null; mb=$(git merge-base "origin/$b" HEAD 2>/dev/null); behind=$(git rev-list --count "HEAD..origin/$b" 2>/dev/null); echo "base=$b behind=${behind:-?}"; if [ "${behind:-0}" -gt 0 ]; then echo "-- base changed since fork --"; git diff --name-only "HEAD...origin/$b" 2>/dev/null; echo "-- this branch changed --"; git diff --name-only "$mb" HEAD 2>/dev/null; fi
Executes scopes and tasks via three-phase TDD pipeline (tester → implementer → reviewer).
INVARIANT: The orchestrator NEVER writes code or tests. All code authoring — including test code — MUST be delegated to fresh subagents. This applies to ALL routes: scope execution, single tasks, file paths, and task descriptions. No exceptions.
Pre-parse: Extract these directives from $ARGUMENTS before pattern matching:
--reviewers <aliases> — comma-separated list from {opus, sonnet, gpt, gemini}. Resolution and alias table: /review SKILL.md "Reviewer Selection". Resolved list is passed to Phase A.5 + Phase C dispatch. If absent and validation.yaml.review_config is also absent, fall back to the interactive AskUserQuestion prompt (same as /review).--worktree (or bare worktree) — checkout the determined branch as a git worktree add ... instead of in-place git switch. See "Git Workflow" → "Procedure" step 4.--base <branch> — base branch for new-branch creation. If absent and the branch doesn't exist, AskUserQuestion. See "Git Workflow" → "Procedure" step 3.--state <draft|open> — PR state when auto-creating a pull request at the end of execution (default: draft). Only used when $ARGUMENTS contains an issue reference.gh:<n>, #<n>, or a GitHub issue URL — flags GitHub-issue branch naming AND enables auto-PR creation after final review. See "Git Workflow" → "Branch Determination" and operations/execute.md Step 10.Apply these rules to remaining $ARGUMENTS in order:
| Pattern | Route | Action |
|---|---|---|
| "verify" or "done" | Verify | Read and follow operations/verify.md |
| "debug" or "trace" | Debug | Read and follow operations/debug.md |
| Matches ./scopes/*/*/ path | Execute | Read and follow operations/execute.md |
| Exactly one active scope | Execute | Read and follow operations/execute.md |
| File path or task description | Direct | Use methodology below |
| No argument | Menu | See fallback |
When no argument or ambiguous, use AskUserQuestion:
Header: Implement
Question: What would you like to do?
multiSelect: false
Options:
- Scope execution: Execute active scope with TDD pipeline (tester → implementer → reviewer)
- Verify: Evidence-based verification before claiming done
- Debug: Root cause tracing for a bug or failure
- Implement: Single implementation task with methodology below
Routing by selection:
| Selection | Action |
|---|---|
| Scope execution | Read and follow operations/execute.md |
| Verify | Read and follow operations/verify.md |
| Debug | Read and follow operations/debug.md |
| Implement | Use methodology below |
MANDATORY: The dispatcher MUST ensure a dedicated branch is checked out before dispatching any phase. Never run implementation phases on main/master or on an unrelated branch.
Detect the branch source from $ARGUMENTS and apply the matching naming convention:
| Source | Detection | Branch Name | Example |
|---|---|---|---|
| GitHub issue | gh:<n>, #<n>, or github.com/<owner>/<repo>/issues/<n> | <issue#>-<issue-title-in-kebab-case> | 142-add-user-auth |
| Scope | ./scopes/<state>/<name>/ path or active scope | feat/<scope-name> | feat/user-auth |
| Direct task | File path or task description, no scope/issue | AskUserQuestion (see below) | — |
For GitHub issues: Fetch the title with gh issue view <n> --json title -q .title, kebab-case it (lowercase, spaces/punctuation → -, collapse repeats, trim), then prefix with the issue number. Do NOT add a feat/ prefix — match GitHub's own branch convention.
Header: Branch
Question: No branch detected for this work. How should I proceed?
multiSelect: false
Options:
- Use current branch: <current-branch>
- Create new branch: provide name
- GitHub issue: provide issue number
--base <branch> was passed in $ARGUMENTS → use it.Header: Base branch
Question: New branch <name> needs a base. Which branch should it fork from?
multiSelect: false
Options:
- origin/<trunk> (freshly fetched trunk — default)
- <current-branch> (current — pick if cascading)
- Other: provide branch name
main/master — it may be stale (this is how branches are born already behind). When the base is the trunk, git fetch origin <trunk> and use origin/<trunk>.git rev-parse --verify <base>) before proceeding.--worktree (or worktree) from $ARGUMENTS:
skills/git/reference/worktree.md end-to-end with BRANCH_NAME=<branch> from step 1 and the resolved base from step 3. All subsequent phases run from the reported worktree path.git switch <name> and pull latestgit switch <name> (tracks remote)git switch -c <name> <base> using the resolved base from step 3origin/<trunk>); a branch created from any local ref, or created earlier by an outside tool (workon, gh issue develop, manual checkout), can already be behind — run the check. Read the Base drift block in Pre-loaded Context. If behind > 0, follow reference/base-drift-preflight.md to detect overlap and gate. Do not dispatch Phase A past a non-empty overlap without a user decision.Never dispatch testers/implementers/reviewers while still on main, master, a stale unrelated branch, or a branch whose base drifted with unresolved overlapping changes.
The orchestrator NEVER writes code or tests. All code authoring is delegated to subagents.
Even for a single task, the four-phase pipeline applies:
Dispatch a fresh tester subagent (subagent_type: "task-tester") to write failing tests.
operations/execute.md)Why a separate subagent? The orchestrator's understanding of the task leaks into hand-written tests, causing oracle mirroring (tests that mirror implementation logic) and mock tautologies (mocks that assume the answer). A fresh subagent discovers behavior from code and specs independently.
Dispatch all configured reviewers in parallel (Claude Task + Codex Bash × N per /review config) on the test files from Phase A. Same cartesian dispatch pattern as Phase C — Codex shell-outs are mandatory whenever Codex is installed.
issues_foundSee dispatch template in reference/subagent-workflow.md — Test Review Dispatch Template.
Dispatch a fresh implementer subagent (subagent_type: "task-implementer") with the test-review-cleared tester report.
For single tasks, review can be done inline or via reviewer subagent(s) depending on scope.
Use the tester and implementer dispatch templates from reference/subagent-workflow.md.
If you catch yourself writing test code or implementation code directly: STOP. You are the orchestrator. You dispatch. You verify. You do not author.
Domain skills inject specifics into this generic methodology:
When invoked via a domain skill, follow the domain-specific guidance provided.
tools
External code-review harness (`peer` zsh tool): canonical model registry, idle-stall watchdog, and self-parallelising fan-out to codex/gemini. Use when dispatching external (non-Claude) reviewers from the review or implement pipelines — call `peer run`/`peer <harness>` instead of `codex exec`/`gcloud`+Vertex directly.
testing
Unified validation dispatcher. Auto-detects validation type from argument or presents selection menu. Routes to test, implement (verify), or hooks-test.
development
Test-driven development methodology (RED-GREEN-REFACTOR). Use when implementing features, fixing bugs, or changing behavior - write failing test first, then minimal code to pass.
development
Create new Claude Code skills following project patterns and best practices. Use when building new skills, extracting reusable capabilities, or converting commands to skills.