MCPInstall
davidlee avatar

close

Use to formally close a slice once its phases are complete, audited, and reconciled — confirm the rollup, verify spec-coherence, harvest durable findings, reconcile lifecycle status, and land a clean final commit. Routed to from /reconcile.

Installs
142
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/davidlee/doctrine --skill close
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads close automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Close

You are executing formal closure, not just marking work done.

Inputs:

  • completed, audited, reconciled implementation phases
  • the reconciliation review (RV) with every finding terminal and the ## Reconciliation Outcome recorded (see /reconcile)
  • the governing slice id

Process

  1. Pre-check:

    • Phase exit criteria (EX-) and verification (VT-) are met. Confirm the rollup: doctrine slice list should show the slice as X/X complete with no !N blocked, no ?N anomalous, no — untracked.
    • /reconcile is done (via /audit → /reconcile): the RV ledger is resolved, every governance/spec finding is dispositioned, and the RV carries a ## Reconciliation Outcome section. If the reconciliation brief was empty (no-op), the outcome confirms that explicitly.
    • Durable findings from the slice are harvested per lib:reference/harvest.md before closure — or consciously rejected. A clean slice may harvest nothing; the conscious-rejection gate is what closure checks.
    • doctrine check gate is green.
  2. Spec-coherence gate — confirm reconciliation is complete before done: Before the terminal transition, verify every item from the audit's reconciliation brief is resolved through one of four paths:

    • REV done — governance/spec items covered by a done REV (revision status REV-N done). The REV rationale (revision-NNN.md) carries the reconcile narrative.
    • Withdrawn — finding withdrawn in the RV with rationale.
    • Tolerated — finding tolerated in the RV with rationale.
    • Escalated to design — slice transitioned back to design via the design back-edge (reconcile → design). Additionally:
    • Every per-slice direct-edit item is applied to design.md / slice-NNN.md and recorded in the ## Reconciliation Outcome.
    • The RV ledger is resolved (done · await=none): every finding terminal and the pass concluded (review conclude RV-NNN --basis …). A ledger whose findings are all terminal — a zero-finding ledger included — reads active · await=raiser until the raiser concludes it; conclude it, do not raise a token finding. The absence of unresolved blockers is what gates the transition, never the status string (a display summary, never a gate).
    • The reconcile outcome is recorded (REV rationale and/or RV ## Reconciliation Outcome). No free-floating "rejected" disposition is permitted — every finding must land in one of the terminal states above. If any item is unresolved, refuse close and return to /reconcile. (The structural closure seam is the mechanical backstop; this gate is the substantive check — the verb enforces; the skill verifies.)
  3. Commit cleanly: land .doctrine/** workflow artefacts in small, clean conventional commits scoped with the slice id, rather than letting them accumulate. Code and workflow edits go together or separately, whichever commits cleanly first.

    Stage the slug symlink. */new verbs lay out <kind>/NNN/ and a sibling slug symlink <kind>/NNN-slug -> NNN (slice, review, revision, rec, …). A path-scoped git add <kind>/NNN/ stages the dir but misses the symlink, stranding it uncommitted. Stage both — git add <kind>/NNN* — or add the symlink explicitly. Check git status for a dangling NNN-slug before the final commit. 3a. Dispatched slice — integrate the admitted OID (post-audit only). If the slice was driven by /dispatch, project the audited units now:

    # 0. Resolve the trunk delivery ref once (config-driven; default refs/heads/main):
    trunk=$(doctrine dispatch deliver-to)
    
    # 1. Admit a close_target candidate (if not already done during /reconcile):
    doctrine dispatch candidate create --slice <N> --label close-001 \
      --role close_target --payload code --base "$trunk" \
      --source refs/heads/review/<N>
    doctrine dispatch candidate admit --slice <N> --role close_target \
      --candidate refs/heads/candidate/<N>/close-001 --review RV-NNN
    
    # 2. Project onto trunk (--trunk is REQUIRED; omitting it is a dry run):
    doctrine dispatch sync --slice <N> --integrate --trunk "$trunk"
    

    When a candidate workflow is active this targets the immutable admitted close_target OID (and --edge the admitted review_surface OID) under a fast-forward-only CAS row — never a raw phase/*/review/* tip or the mutable candidate ref, and never a close-time merge. A moved trunk refuses (admit a superseding close-target candidate on the new base). This is the only place --integrate runs — never at /dispatch conclude, only here, post-audit.

    Verify (tree-true). After --integrate --trunk, both checks below must pass — do not proceed to step 4 unless they do:

    # (a) No phantom reverse-diff: the tracked working tree matches HEAD. A nonzero
    #     exit means integrate advanced the ref but desynced the live checkout — STOP.
    git diff --quiet HEAD
    
    # (b) The projected delta genuinely landed (not a silent dry-run): the committed
    #     journal's trunk row holds the planned tip; it must equal the trunk ref.
    trunk=$(doctrine dispatch deliver-to)
    planned=$(doctrine dispatch sync --slice <N> --show-journal-trunk-oid \
      --trunk "$trunk")
    git diff --quiet "$planned" "$trunk"
    

    (a) is the phantom-reverse-diff detector — the whole tracked tree, not path-limited (a phantom reverse-diff can span any file the slice projected, not just src/). (b) reads the trunk row's planned_new_oid from the committed dispatch/<N> journal — a tree-read, stable from this checkout — and diffs it against the resolved trunk delivery ref (doctrine dispatch deliver-to, default refs/heads/main); a difference means trunk does not hold the projected tip, so integration did not land.

3b. Split lineage — the payload reached trunk out-of-band (--record-integration). See lib:reference/dispatch-mechanics.md § Split lineage — record an already-landed payload, don't advance trunk. The close gate still refuses done ("dispatched but no trunk row"). Record the earned row instead of hand-editing journal.toml:

trunk=$(doctrine dispatch deliver-to)
doctrine dispatch sync --slice <N> --record-integration --trunk "$trunk"

Per lib:reference/dispatch-mechanics.md § Split lineage, --record-integration asserts the payload is already an ancestor of trunk and commits a single Verified trunk row. Then slice status <N> done reads that row and passes. This is the sanctioned replacement for a hand-written journal row; land the payload out-of-band as git merge --no-ff phase/<N>-NN (or the admitted candidate), not review/<N>.

  1. Transition lifecycle: confirm the slice is in reconcile (flip it with doctrine slice status <id> reconcile if /audit didn't), then doctrine slice status <id> done (<id> is the bare number, e.g. 40). The closure seam enforces the order and refuses while an RV targeting the slice carries an unresolved blocker. Re-run doctrine slice list and confirm the ⚠ divergence marker is gone — authored status now agrees with the rollup. (The terminal set is {done, abandoned}; closure here is the done path — abandoning a slice is a separate decision, not this skill.)
  2. Close the originating backlog item: if a backlog item (ISS/IMP/CHR/RSK) spawned this slice, transition it too — doctrine backlog edit <ID> --status resolved --resolution fixed (or the resolution that fits). A closed slice with its origin still open is hygiene debt.
  3. If a blocking finding remains unresolved, do not close — return to /reconcile. If closure depends on tolerated drift with material tradeoffs, /consult before normalising around it.

Drift discharge recipe

When slice status <id> done refuses with undischarged residual drift, each flagged requirement needs an accept REC owned by the closing slice that satisfies all three clauses:

  • (a) move = accept — an affirm, not revise/redesign.
  • (b) a [[status_delta]] naming the requirement whose to equals its current authored status (the status the refusal prints).
  • (c) the REC's [[evidence_ref]] set ⊇ every distinct coverage key feeding that requirement's composite, so fresh contradictory evidence cannot be excused by a stale REC.

Author it, then hand-edit the two tables:

doctrine rec new --move accept --owning-slice SL-NNN --title "accept REQ-NNN"
# then hand-author the [[status_delta]] and [[evidence_ref]] tables

Full predicate, rationale, and a worked example: doctrine memory show mem.pattern.doctrine.close-drift-discharge-rec.

Outcomes

  • The slice is done, with the rollup in agreement.
  • The originating backlog item (if any) is resolved.
  • Durable guidance is captured in memory or consciously rejected.
  • The tree is clean and the workflow artefacts are committed.

FAQ

What does the close skill do?

Use to formally close a slice once its phases are complete, audited, and reconciled — confirm the rollup, verify spec-coherence, harvest durable findings, reconcile lifecycle status, and land a clean final commit. Routed to from /reconcile.

How do I install close?

Run npx skills add https://github.com/davidlee/doctrine --skill close in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/close/ (personal) or .claude/skills/close/ (project).

Which AI agents can use close?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is close safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains close?

It is published by davidlee in davidlee/doctrine. It has 142 recorded installs.

More from davidlee/doctrine

View all →
davidlee avatar

code-review

davidlee/doctrine

Use whenever reviewing code for quality and correctness — a diff, PR, module, or subsystem — producing verified, severity-ranked findings on the RV ledger. Not for comprehension tours (walkthrough) or doctrine-conformance hunts (inquisition, user-invoked only).

davidlee avatar

pair

davidlee/doctrine

Agentic pair programming — drive a change together with a human partner in the loop, narrating intent and pausing at decision points. Use when the user wants to work side-by-side rather than hand off a whole task. Calibrated by three dials (role, detail, autonomy) and an always-on challenge mandate.

AI & Agents148 installs
davidlee avatar

consult

davidlee/doctrine

Use the moment you hit an unanticipated obstacle, a decision with competing tradeoffs, or emergent complexity mid-task — before adapting planned scope, adding a dependency, taking a shortcut, or making any impactful concession on your own.

davidlee avatar

handover

davidlee/doctrine

Use when handing work to a fresh context — first bring the durable harvest current, then emit a continuation at one of two weights — a printed continuation prompt (light) or a handover.md context packet (full). Use whenever a fresh agent would more efficiently continue.

AI & Agents146 installs
davidlee avatar

canon

davidlee/doctrine

Use before making architectural or workflow choices, when correctness depends on project governance, or when entering an unfamiliar subsystem — to load the project's authoritative rules before you act on assumptions.

davidlee avatar

retrieve-memory

davidlee/doctrine

Use before making non-trivial assumptions — before touching a subsystem you have not this session, before running or changing a command pipeline, when code and docs conflict, when asked "what is the right way here?", when debugging a recurring failure, or when about to answer with "probably/usually/likely".

Popular code quality & workflow skills

View category →
mattpocock avatar

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock avatar

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock avatar

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

mattpocock avatar

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock avatar

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.