implement

Installation
SKILL.md

MANDATORY: implement: Rust owns lifecycle start/finish (skills/shared/run-lifecycle-ownership.tsv). Never run the generic lifecycle (${CLAUDE_PLUGIN_ROOT}/skills/shared/run-lifecycle.md). Send --lifecycle-parent-context only to Step 0.

Implement Skill

MANDATORY: READ ENTIRE FILE before composing user-facing prose: ${CLAUDE_PLUGIN_ROOT}/skills/shared/readability-style.md.

End-to-end: fetch the vetted larch:plan, materialize artifacts, implement, validate, commit, review, ship the PR, monitor CI, and clean up. With --merge: also run CI+rebase+merge, delete the local branch, verify main, and have the active Step 8+ driver checkpoint the run-log manifest plus scripts/larch.sh final-report write before exit. The tmpdir/tracking summary may reflect MERGE_RESULT without any post-merge git commit (NEVER #16). Step 18 owns the complete terminal snapshot and publication. Step 19 owns cleanup.

Protocol Execution Directive. You are the /implement orchestrator. After flag parsing and mutual-exclusion checks, your FIRST external actions MUST be: (1) when forked_target=true, run "${CLAUDE_PLUGIN_ROOT}/scripts/larch.sh" admission fork-env once and parse UPSTREAM_REPO plus sibling fork KV lines from stdout; (2) run exactly one "${CLAUDE_PLUGIN_ROOT}/scripts/larch.sh" implement preflight call as the sole mechanical surface for Preflight items 1-3, passing --repo "$UPSTREAM_REPO" when forked; (3) after prompt-side Preflight judgment, run Step 0 unchanged through ${CLAUDE_PLUGIN_ROOT}/skills/implement/scripts/step-0-bootstrap.sh --mode initial. Prompt-side judgment starts only after helper exit 0. Item 4 is the main-agent plan-adequacy audit when force_requested=false; force skips it and proceeds to item 6. Item 6 remains the semantic materiality judgment after AUDIT=pass or force skip. When forked_target=true and UPSTREAM_REPO is already set from (1), do not re-run scripts/larch.sh admission fork-env; reuse the fork metadata to avoid a second bootstrap tmpdir.

Anti-halt continuation reminder. After each child Skill call (/review, /issue, /implement) and each numbered or sub-step Bash helper, including scripts/larch.sh checks run-relevant, IMMEDIATELY continue to this skill's NEXT numbered step. Do NOT stop on cleanup output, Bash stdout, status, summary, handoff, recap, or "returning to parent" prose. For bgjob-migrated steps, WAIT means the next action is another identical bgjob wait; after final DONE, parse required KVs from the last DONE stdout and $IMPLEMENT_TMPDIR/bgjob/<step>.result.env. Applies from Preflight through Step 19 except explicit non-sequential directives in THIS file (skip to Step N, bail to cleanup, jump back, loop back, fall through, break out). Every relevant-checks helper call is covered. Critical boundary: Step 9b PR creation → Step 10 CI monitor immediately; PR creation is NOT the end. Critical boundary: when the active Rust Step 8+ ship pr driver exits, route only from process exit code + JSON stdout; do not parse ship-pr-state.sh or the retired bash exit matrix. Critical boundary: after route-exit emits NEXT_ACTION=ci-fix, do NOT end the turn; run the ci-fix repair procedure in the same turn. Critical boundary: after preflight audit passes (AUDIT=pass), continue through Preflight items 6-7, then run Step 0 ${CLAUDE_PLUGIN_ROOT}/skills/implement/scripts/step-0-bootstrap.sh --mode initial; do NOT end the turn on the audit-pass envelope. Critical boundary: after the force plan-adequacy audit skip breadcrumb prints, continue through Preflight items 6–7, then run Step 0; do NOT halt waiting for an AUDIT=pass envelope on the force skip path. Terminal boundary: the combined Step 16-17 wrapper only captures a pending final-report body; Step 18 terminalizes and publishes logs, Step 19 cleans up and relays the teardown tail, then the selected final-report body is the last plain-chat text with no following tool call. → shared/subskill-invocation.md#anti-halt

Skill-name fallback reminder. When invoking a child skill via the Skill tool from this file, ALWAYS try the bare name first ("design", "review", "issue", "implement"). Use the fully qualified larch: form ("larch:design", etc.) only after bare-name lookup returns Unknown skill; in a consumer repo with a different plugin namespace, use that namespace as the fallback. /implement does not invoke relevant-checks through the Skill tool on the green path; it uses the captured Rust checks helper so success returns one bounded machine line, or RELEVANT_CHECKS_SKIPPED=true only on explicit --allow-skip test paths. Phase 1 (#3364) does not invoke /release; versioning moves to /release (Phase 3). Do NOT mirror this skill's own namespaced invocation (larch:implement) onto child Skill calls. → shared/subskill-invocation.md#bare-name-fallback

Load-Bearing Invariants

Two invariants enforced across multiple steps. Anchor cross-step questions here; do not re-derive inline.

  1. Step 9a.1 OOS Sentinel Idempotency — re-running /implement in the same session MUST NOT double-file vote-accepted non-security OOS. Enforcement: Rust-owned ${CLAUDE_PLUGIN_ROOT}/scripts/larch.sh oos file reads accepted inputs, the sentinel, and run NDJSON; binds prior URLs by stable ID/title; and files only unmatched blocks. Why: durable evidence makes retries deterministic.
Installs
1
GitHub Stars
4
First Seen
Sep 15, 2026