Every optimization targets a measured fixed-cost component (eval/workflow_bench ground base: workflow arm −211% to −333% vs baseline, all tasks resolved): - Plan form is category-priced: compact form (core sections w/ § anchors preserved, ≤80 lines excl. pack, mini-pack subset of the context pack) for narrow/default categories; the full 13 sections only for deep work (refactor/security/performance/concurrency/architecture). A compact plan outgrowing its cap reclassifies to full rather than overflowing. - Freshness gate is category-priced: compact categories default to accept (source-weighted, refresh only when a graph claim becomes load-bearing); strict stays the default for full-plan categories — the rebuild+re-index was the largest single fixed cost. - Turn economy: per-category tool-call budgets (~10 to ~45; architecture uncapped); budget exhaustion routes open questions to §12 instead of more digging. - gitnexus-work fast path: HEAD == evidence pin → skip all citation re-reading (the pin's entire point); mini-pack fields tolerated. - lfg Lane 1 boundary triage: tasks below the measured ~35-turn boundary get offered gitnexus-work direct mode before the plan lane is spent. Copies re-synced (npm skills/, plugin, ~/.agents); steering + sync guards green. Re-measurement of the workflow arm follows to verify the numbers actually improve. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
7.2 KiB
| name | description |
|---|---|
| gitnexus-work | Use when executing an engineering plan produced by gitnexus-plan (or a small bounded task directly) — implements step by step with GitNexus impact checks before every symbol edit, tests from the plan's scenarios, and detect_changes gating every commit. Examples: "/gitnexus-work docs/plans/2026-07-11-gitnexus-plan-ingestion-retry.md", "/gitnexus-work" (latest plan), "execute the plan". |
gitnexus-work — execute a gitnexus-plan
Execute an implementation plan produced by gitnexus-plan, shipping it as a
sequence of verified, atomic commits. The plan's section 11
(implementation_context pack) is the primary machine-readable input; the
prose sections are its rationale. This skill does edit code — it is the
executor counterpart to the planning-only gitnexus-plan.
/gitnexus-work <plan path> # execute this plan
/gitnexus-work # newest docs/plans/*gitnexus-plan*.md here
/gitnexus-work <small task text> # direct mode, see Input triage
Input triage
- Plan path (or blank → the newest
docs/plans/*gitnexus-plan*.mdunder the current repo root; plans written elsewhere —out:override, other target repo — must be passed by explicit path): the normal mode; continue to Phase 1. If Phase 1's pre-completed check finds every §7 step of that newest plan already landed, stop and ask instead of re-executing it. - Bare task text: trivial and bounded (1–2 files, no architectural
decisions) → implement directly with the same discipline:
impactbefore every symbol edit, minimal change, tests when behavior changes, verification commands taken from the repo's own scripts (package.json / CI),detect_changesbefore every commit. Anything larger → recommend running/gitnexus-planfirst; honor the user's choice if they decline.
Phase 1 — Load and re-anchor the plan
- Read the plan document completely. It is a decision artifact, not a
script: scope boundaries and
avoidentries bind you; exact code is yours to write. Never edit the plan body. - Parse the §11
implementation_contextpack:acceptance_criteria,primary_symbols,related_symbols,files_to_modify,execution_path,pdg_constraints,architectural_patterns,tests,verification_commands,risks,assumptions,open_questions,avoid. Compact plans carry the mini-pack subset — absent optional fields are empty, not errors. - Drift check. The plan header pins the commit its evidence was
verified at. HEAD equals the pin → every citation is still verified:
skip all re-reading and go straight to work — that is the pin's entire
point. If HEAD has moved since, diff the pinned commit against HEAD
for every file the pack cites —
files_to_modify,primary_symbols/related_symbolsfiles, files named inpdg_constraints.affected_statements,architectural_patterns[]example locations,tests[].file— untouched files keep their verified status; changed files get their cited ranges re-read before you rely on them. Material drift (a planned seam no longer exists) → stop and send the plan back throughgitnexus-planDeepen mode. - Re-verify
assumptionscheaply (each one names what to check). A failed assumption is a stop-and-replan signal for the steps that depend on it, not something to code around silently. - Note
open_questions— if one blocks a step and the answer materially changes the work, ask the user before that step, not after. - Pre-completed check. If commits for this plan already exist on the branch (a prior partial run, or a post-route-back Deepen cycle), verify which §7 steps have landed at HEAD: those are skipped and reported as pre-completed, and execution resumes at the first unlanded step. All steps landed → report that and stop.
Phase 2 — Environment
- On the default branch → create a feature branch named from the plan slug. On a feature branch already → stay only if it is meaningful for this plan (name matches the plan slug, or the user confirms); otherwise branch from here with the slug name.
- If the plan document is not yet committed, commit it now
(
docs(plans): add <slug> plan) — the plan travels with the work it drives, and the final review diff then includes it. - Confirm the
verification_commandsfrom the pack actually run in this checkout (dependencies installed, builds present) before starting, not after the last step.
Phase 3 — Execute the Implementation Sequence
Work through plan §7 step by step, in order. For each step:
- Impact before editing. For every symbol the step modifies, run
impact {target, direction: "upstream"}first and account for the direct (d=1) dependents. HIGH or CRITICAL risk → surface it to the user with the blast radius before proceeding (repo mandate — see AGENTS.md GitNexus rules). - Honor the constraints.
pdg_constraintsentries state ordering and dependence facts the change must preserve;avoidentries are hard prohibitions;architectural_patternsname the shape to mirror (read the example location before inventing one). - Implement minimally. The smallest change that completes the step, following the surrounding code's conventions.
- Test from the plan's scenarios. Each
tests[]scenario (input → action → expected outcome) becomes a real test in the named file. Add coverage the plan missed if the step's behavior demands it; never delete or weaken an assertion to make a step pass. - Verify. Run the step-relevant
verification_commands(they carry their build prerequisites; use them as written). - Commit atomically.
detect_changes {scope: "staged"}before every commit to confirm only the expected symbols and flows are affected (repo mandate); then one conventional commit per step. Unexpected affected flows → investigate before committing, not after.
Steps are independently actionable: after any commit the tree is coherent.
If a step reveals the plan is wrong, stop that step, re-verify the affected
claims at HEAD, and either adapt (small, in-scope deviation — record it in
the commit message and final summary) or route back to gitnexus-plan
Deepen mode (structural miss) — with a one-line ask to the user when the
choice isn't obvious.
Phase 4 — Finish
- Run the full
verification_commandssuite once, at the end, even if every step already passed individually. - Walk plan §13 (Definition of Done) and the pack's
acceptance_criteriaitem by item; anything unmet is either finished now or reported as explicitly unmet — never silently dropped. - Report: steps completed, commits made, deviations from the plan (with why), assumptions that failed re-verification, DoD status, and anything deferred. Test failures are reported with their output, not smoothed over.
Never
- Skip the Phase 3 gates: no symbol edit without
impact, no commit withoutdetect_changes. - Expand scope beyond the plan — §12's deferred follow-ups stay deferred.
- Mutate the plan body (committing the file verbatim in Phase 2 is not mutation), weaken failing tests, or present unverified work as verified.