/jonhill90-skills:close-the-loopfrom jonhill90-skills
Confirms a change is fully specified before starting: implementation details, test evidence, and governing rules. Use before non-trivial work, plan review, or PRs needing planning evidence.
Ships in jonhill90-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A loop closes when the work is implemented, verified, and reported against the rules that govern it. Most failures are missing inputs, not missing effort: the test that was never specified, the constraint nobody read, the "done" that named no evidence.
Run this before starting. It costs minutes and it is the difference between finishing and reopening.
If any answer is no, the missing input is the first task — not the work.
The sections below are how those three questions get answered on paper.
Every non-trivial plan must include all 9 sections. Order is flexible; names accept alternatives.
What does success look like? What observable signal confirms this work landed correctly?
## Goal / Signal
After this lands:
- Observable signal: <what changes in the system>
- User-facing impact: <what users see differently>
Alternatives: Objective
What is in scope and what is explicitly out of scope for this change?
## Scope
**In scope:**
- Item A
- Item B
**Out of scope:**
- Item C (future PR)
Map each requirement to its test. This is the contract between what we build and how we verify it.
## TDD Matrix
| Requirement | Test | Type |
|---|---|---|
| Feature X works | `test_feature_x` | unit |
| API returns 200 | `test_api_returns_200` | integration |
Alternatives: Test Matrix
Ordered steps with enough detail that another agent could execute them. Group by TDD phase (Red/Green/Refactor) when applicable.
## Implementation Steps
### Phase 1: Red
1. Write failing test for X
### Phase 2: Green
2. Implement X to pass test
### Phase 3: Refactor
3. Clean up implementation
Alternatives: Approach
Concrete commands and expected results. Every claim in the plan maps to a verification step.
## Verification Matrix
| Check | Command | Expected Result |
|---|---|---|
| Tests pass | `pytest tests/ -v` | All green |
| Lint clean | `shellcheck scripts/*.sh` | No errors |
Alternatives: Verification Checklist
Manual workaround rule: Treat undocumented manual workarounds as blockers by default. Identify the root cause and durable fix, then state one disposition:
patch first;split follow-uponly when the current change is independently safe, does not weaken security, and survives redeploy; ormerge nowonly when the workaround was unnecessary or the durable fix is already included.
What CI checks enforce this change? What drift could occur and how is it caught?
## CI / Drift Gates
- **New gate:** `check_foo.py` runs on PRs
- **Existing gates preserved:** bats, compose, shellcheck
- **Drift risk:** If X changes, Y catches it
Alternatives: CI Gates, Drift Gates
What could go wrong and how do we prevent or handle it?
## Risks & Mitigations
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| X breaks Y | Low | High | Guard with Z |
Checkbox list of all conditions that must be true before this work is complete.
## Definition of Done
- [ ] All tests pass
- [ ] CI green
- [ ] Docs updated
- [ ] Line count constraints met
Alternatives: Done Criteria
When should work stop? What explicit boundaries prevent scope creep?
## Stop Conditions
**Stop if:**
- X exceeds threshold Y
- Approach Z proves unviable
**Out of scope:**
- Future enhancement A
- Unrelated refactor B
Alternatives: Out of Scope, Out-of-Scope
Copy into your plan and check off as you complete each section:
- [ ] Goal / Signal
- [ ] Scope
- [ ] TDD Matrix
- [ ] Implementation Steps
- [ ] Verification Matrix
- [ ] CI / Drift Gates
- [ ] Risks & Mitigations
- [ ] Definition of Done
- [ ] Stop Conditions
| Anti-Pattern | Why It Fails | Fix |
|---|---|---|
| Vague goal ("improve things") | No observable signal to verify | State concrete before/after |
| TDD matrix without test names | Can't verify tests were written | Name every test function |
| Steps without phase grouping | Unclear when to test vs. implement | Group by Red/Green/Refactor |
| Missing stop conditions | Scope creep goes unchecked | Define explicit boundaries |
| Verification without commands | "It works" isn't evidence | Include exact commands + expected output |
| Risks without mitigations | Identified but unaddressed | Every risk needs a mitigation |
| DoD without checkboxes | Can't track completion | Use - [ ] for each condition |
| Scope without "out of scope" | Boundaries are implicit | Explicitly list what you won't do |
| CI section says "existing" only | Doesn't explain new enforcement | Document new gates + drift risks |
| Verification via ad-hoc manual workaround | Root cause unknown, fix isn't durable, breaks on redeploy | Identify root cause, determine least-privilege fix, state merge recommendation: patch first (default), split follow-up (only if safe to ship independently, no security regression, no redeploy breakage), or merge now (only if no real workaround needed or durable fix already in PR) |
Use primer before planning unfamiliar work. For implementation that
changes behavior, follow red-green-refactor: write the failing test from
the TDD matrix first. Execute the commands from the verification matrix
before reporting completion.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
planning, tdd, definition-of-done, implementation-plan, test-matrix
Other plugins' skills for the same job
npx claudepluginhub jonhill90/skills --plugin jonhill90-skills44 skills in this plugin
/adopt-or-buildDecide, per component, whether to adopt an existing name, dependency, library, or tool or build it in-house, weighing blast radius over convenience. Use at the point a name or dependency is about to be chosen or recommended — before it is proposed, not after. Not for finding a technology's capability ceiling (research-the-limit), not the mechanism for genuinely different reviewer lenses (ask-a-council, which this skill may call), and not a substitute for attacking the chosen answer (devils-advocate, which this skill invokes as its final step)./ask-a-councilConvene several harnesses or models against one question, each doing a distinct job it can fail at — different evidence, a different objective, or a withheld conclusion — before an artifact becomes load-bearing and being wrong is expensive. Diversity comes from what each reviewer is given, never from a character it plays. Use when the failure modes genuinely differ in kind — a single reviewer's prompt would only catch what its own lens looks for. Not for a question a cheap deterministic check settles (run the check first); not for one reviewer's prompt (sanity-check owns that); not for dispatch mechanics or isolation boundaries (dispatching-subagents owns those); not for trusting a verdict already returned (verify-the-instrument owns that)./central-hub-mcpOrient on Central Hub through its read-only hub-mcp server — call hub_orient first, then only the targeted tool the answer still needs — and connect an AI harness to hub-mcp. Use when a session needs live Central Hub state (c1 cluster apps, the agent notebook, the bi-temporal fact graph, open PRs and CI), when hub-mcp tools appear in the tool list, or when configuring Claude Code, Codex CLI, Claude Desktop, Copilot, Antigravity, Pi, OpenClaw, Hermes, Paperclip, Rex, or another MCP client to reach hub-mcp./create-skillDesign, create, and validate portable Agent Skills with effective triggers, concise instructions, and reusable scripts, references, or assets. Use when adding a new skill, substantially restructuring an existing skill, or validating a skill's structure, frontmatter, links, and bundled scripts./decide-by-variantBuild several genuinely different real artifacts in the real medium with fake data, and let the human pick by looking, instead of asking a taste decision in prose. Use whenever a decision has no objectively right answer — a glyph, a layout, a default, a name, a wording, a sort order — and describing the options in words would cost the human more thought than looking at them would. Run determine-intent first — if the answer is already a known parameter, build nothing. Not for getting different positions from agents on one question (ask-a-council); not for attacking an answer once chosen (devils-advocate runs after a variant is picked, not instead of building one)./derive-independently-then-compareDerive an answer from the source corpus a second time, without reading the first derivation, then compare — before trusting a conclusion drawn from a large body of transcripts, notes, or documents about what someone wants, prefers, or constrains. Use when a claim about a person's stated intent or a parameter cannot be traced to a quote, or before that claim is reported as fact. Runs before sanity-check and devils-advocate, not instead of them — a reviewer or an opposing case inherits whatever inputs the first pass fabricated, and this is the only one of the three that re-reads the source rather than the write-up. Not ask-a-council (different positions on a shared question, not the same question re-derived from source); not determine-signals (finds what was already checked, not whether what was reported was actually found there).