agentleFS
mhgolestanmhgolestan/code-context-mcp/.claude/skills/speckit-companion-mark-complete/SKILL.md

speckit-companion-mark-complete

Skill0 starsChanged 50 days agoMITView on GitHub

Mark the active spec completed — the Companion workflow''s terminal step (writes status: completed)

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify Python is available by running python3 --version.

    line 22
  2. Very specific:

    If python3 is not available, warn the user and skip: [companion] Warning: python3 not detected.

    line 23
  3. Distinctive:

    Do not fail the host command.

    line 25
  4. Distinctive:

    Run the writer from the repository root:

    line 29
  5. Very specific:

    Never invent requirements to pad the list.

    line 61
  6. Distinctive:

    After the completion write succeeds, fold the deltas you just authored into the durable living spec(s) — OpenSpec's "archive" step.

    line 65
  7. Very specific:

    If python3 is missing, skip with the warning above (never fail the host command).

    line 98

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mark Spec Complete

Promote the active feature to the terminal completed status in .spec-context.json. This is the Companion workflow's final step: it runs after implement has finished so the spec lands at the end of the Active → Completed lifecycle. The command writes completed via the shared write-context.py path — you never hand-edit .spec-context.json to do it.

The stock speckit workflow has no terminal step and force-closes without ever writing completed; this step is what gives the Companion pipeline its explicit completion gate.

Prerequisites

  • Verify Python is available by running python3 --version.
  • If python3 is not available, warn the user and skip: [companion] Warning: python3 not detected; skipped mark-complete. Do not fail the host command.

Execution

Run the writer from the repository root:

python3 .specify/extensions/companion/scripts/write-context.py --mark-complete --by ai

The script resolves the active feature directory on its own (--feature-dir → SPECIFY_FEATURE_DIRECTORY → SPECIFY_FEATURE → .specify/feature.json → git branch prefix). Pass --feature-dir specs/<NNN>-<slug> when you already know it.

--mark-complete keeps currentStep at implement (the last real step) and sets status: completed, preserving the canonical invariant that the last history entry's step equals currentStep. It is the only sanctioned writer of completed.

A spec whose record holds no verification and no concern explaining why still completes. The script records one concern, finished, unverified, and prints a [companion] Warning: line. That line reports a completed spec, not a failed command: do not retry it.

Fold living-spec deltas (opt-in, best-effort)

Account for every loaded capability first — a delta or an explicit skip, never silence. Living specs stay current only if completion writes the change back, so before folding, read livingSpecs.loaded in this feature's .spec-context.json and go through every name in it. For a loaded capability whose behavior this feature actually changed, append a delta block to this feature's spec.md — ## ADDED / MODIFIED / REMOVED / RENAMED Requirements — capturing the real new or changed requirement, and mark each block with <!-- capability: <name> --> so the fold routes it to the right spec. For a loaded capability this feature did not change (one you merely read for context), record an explicit skip instead — one call per untouched capability, so "correctly nothing" stays distinguishable from "silently nothing":

python3 .specify/extensions/companion/scripts/write-context.py --living-spec-skip "<name>: <one-line reason it wasn't changed>"

Never invent requirements to pad the list. By the end, every name in livingSpecs.loaded is accounted for — a delta block or a recorded skip; a capability that is neither is a hole the fold flags loudly. The writes land in the feature's PR diff, so they are reviewed there.

After the completion write succeeds, fold the deltas you just authored into the durable living spec(s) — OpenSpec's "archive" step. Run from the repository root:

python3 .specify/extensions/companion/scripts/write-context.py --fold-living-spec --by ai

This parses the feature spec for ## ADDED / MODIFIED / REMOVED / RENAMED Requirements blocks and applies each to the resolved capabilities/<name>/<name>.spec.md — the changed-files-matched capability for unmarked blocks, and every <!-- capability: <name> -->-marked capability for the rest, so each capability spec receives only its own requirements. It is opt-in (only acts when living-specs.yml sets enabled: true), a clean no-op when the spec carries no delta block, idempotent on re-run, and records the synced capability names onto livingSpecs.synced in .spec-context.json. Best-effort — it never fails the host command.

Read what it printed. A block marked for a capability the registry does not hold has nowhere to land, so the fold names it and folds nothing for it. That is the ordinary case for a feature that introduced behaviour no capability owned yet. Register it with the files this feature actually touched, then fold again — the fold is idempotent, so the capabilities that already landed are untouched:

python3 .specify/extensions/companion/scripts/register-capability.py --name <name> --match '<glob>'
python3 .specify/extensions/companion/scripts/write-context.py --fold-living-spec --by ai

Name it for what a person can now do, not for the directory it lives in, and say in your summary that a new capability appeared and why.

Graceful Degradation

Best-effort and idempotent:

  • If python3 is missing, skip with the warning above (never fail the host command).
  • A spec already at completed or archived is left untouched — the script reports it and exits 0.

Output

On success: [companion] Marked specs/<NNN>-<slug>/.spec-context.json complete (status=completed, by=ai).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.