agentleFS
exasol-labsexasol-labs/speq-skill/.claude/skills/speq-record/SKILL.md

speq-record

Skill56 starsChanged 15 days agoMITView on GitHub

Merges implemented spec deltas into the permanent specs and archives the plan. Use after /speq-implement, or to record, merge, or archive a finished plan. Arg: plan-name.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 3 are distinctive, and 7 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.

  • 7

    Very specific

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

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

    Verify the preconditions, merge the plan's deltas into the permanent specs, promote its ADRs, and archive the plan.

    line 12
  2. Very specific:

    Read plan.md, list the delta specs (specs/_plans/<plan-name>//spec.md), and run speq feature list.

    line 31
  3. Very specific:

    Run speq plan validate <plan-name> first: it checks marker balance, illegal marker and anchor pairs, and repeated anchors.

    line 48
  4. Very specific:

    Before you merge a delta spec, check that the target spec holds every scenario a DELTA:CHANGED or DELTA:REMOVED block names.

    line 52
  5. Very specific:

    After each merge, strip all <!-- DELTA:* --> markers and run speq feature validate <domain>/<feature>.

    line 62
  6. Very specific:

    Read ## Directions in specs/_plans/<plan-name>/intent.md.

    line 79
  7. Distinctive:

    Options Considered: only when the direction names a rejected alternative

    line 90
  8. Distinctive:

    Consequences: only when the direction states an effect on later work

    line 91
  9. Very specific:

    Write all of them into ONE new fragment specs/_decision/NNN-<plan-name>.md (NNN = existing fragment count plus one, zero-padded to 3 …

    line 94
  10. Distinctive:

    Only when every validation passed and every threshold decision is resolved:

    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

Spec Recorder

User Arguments

$ARGUMENTS

Verify the preconditions, merge the plan's deltas into the permanent specs, promote its ADRs, and archive the plan. Recording is mechanical: merge what the deltas say, nothing more. You run no git write: the user commits, or /speq-implement-pr does.

Required Skills

Invoke before starting:

  • /speq-cli — spec validation
  • /speq-formats — ADR rules, fragment layout, architecture formats
  • /speq-writing-guardrails — prose style for promoted ADRs

Workflow

Phase 1: Resolve Plan Name

Get the plan name from the user prompt. If none is given, ask the user to choose from the plans under specs/_plans/.

Phase 2: Verify Preconditions

No specs/_plans/<plan-name>/verification-report.md → stop: "Run /speq-implement <plan-name> first."

Read plan.md, list the delta specs (specs/_plans/<plan-name>/**/spec.md), and run speq feature list.

Phase 3: Check the Architecture Delta

Skip this phase when specs/_plans/<plan-name>/architecture.md is absent, and report Architecture: no delta. Otherwise the delta changes specs/architecture.md. The speq CLI does not see it, so you check and apply it by hand. Its format is in architecture-delta-template.md in /speq-formats, the target format in architecture-template.md in /speq-formats.

  1. Already applied? The delta is applied when each CHANGED section in specs/architecture.md already equals its block body, each NEW section exists with its block body, and each REMOVED section is gone. This happens on a rerun after a threshold decision. Then report Architecture: already merged and go to Phase 4.
  2. Pre-check (read-only).
    • The H1 is # Architecture Delta: <plan-name>. DELTA markers are balanced. Each block's first non-empty line is ## <Section> and is its only ## line. No two blocks share an anchor. NEW and REMOVED target non-canonical sections only.
    • specs/architecture.md exists, each CHANGED and REMOVED anchor exists in it, and no NEW anchor exists in it.
    • Line rules: outside blocks only the H1, the BASE comment, and blank lines. Inside blocks only - bullets, fenced blocks, and blank lines. No ###, no tables, no prose paragraphs.
  3. Base check. Compare git hash-object specs/architecture.md with the BASE comment. If they differ, run git cat-file -p <BASE> and compare each CHANGED and REMOVED section with the same section in the current file. A differing section, or a missing blob, stops the record with a stale-base error: a stale BASE would overwrite another plan's changes.

Failure format: Recording failed: architecture delta: architecture.md:<line>: <rule>. On failure, do not fix the delta. The plan stays unarchived. Report the message and stop. The fix is a plan change: correct the plan's architecture.md, or refresh its BASE.

Phase 4: Merge Feature Deltas

Run speq plan validate <plan-name> first: it checks marker balance, illegal marker and anchor pairs, and repeated anchors. Then, for each delta spec at specs/_plans/<plan-name>/<domain>/<feature>/spec.md: a new feature is copied with its markers stripped, an existing one is merged by the table below.

A delta block's anchor is the first non-empty line inside the block. ### Scenario: <name> and ## Background match exactly. # Feature: <name> matches by the prefix # Feature, so a description delta MAY rename the feature.

Before you merge a delta spec, check that the target spec holds every scenario a DELTA:CHANGED or DELTA:REMOVED block names. If one is missing, stop and report the delta file and the scenario name.

AnchorMarkerAction
### Scenario:DELTA:NEWAppend the scenario
### Scenario:DELTA:CHANGEDReplace the scenario with the same name
### Scenario:DELTA:REMOVEDDelete the scenario with the same name
## Background, # FeatureDELTA:CHANGEDReplace the whole section (heading plus body) in place. A line the block omits is deleted
## Background, # FeatureDELTA:NEW, DELTA:REMOVEDRejected: both sections are required and always exist

After each merge, strip all <!-- DELTA:* --> markers and run speq feature validate <domain>/<feature>. If validation fails, stop and report. Do not guess fixes.

Phase 5: Merge the Architecture Delta

Skip when Phase 3 skipped or found the delta already applied.

  1. Build the merged text in memory. CHANGED replaces the heading and body up to the next ##, and a line the block omits is deleted. NEW appends the section at the end. REMOVED deletes the section. Strip all DELTA markers. Write the file once.
  2. Post-check. The H1 is # Architecture. The six canonical sections appear once each, in order. No ## heading is duplicated. No DELTA text is left. The line rules hold. On failure, restore the original text, report it in the failure format, and do not archive.

Report line: Architecture: § Components (CHANGED), § Deployment (NEW). List the lines each CHANGED block removed, so the user can spot an accidental deletion.

Phase 6: Check Library Thresholds

A spec with more than 10 scenarios, or a domain with more than 8 features, needs a reorganization. Stop before archiving, propose a concrete one (which scenarios or features move where), and ask the user. Never reorganize without that answer. Under /speq-implement-pr, the run is the answer: apply your proposal.

Phase 7: Promote ADRs

Read ## Directions in specs/_plans/<plan-name>/intent.md. If it is absent or no direction is marked ADR: yes, skip this phase.

For each direction marked ADR: yes, write an ADR per adr-rules.md in /speq-formats:

  • Title: a short noun phrase for the choice
  • ID: a kebab-case slug of the title, unique across every file in specs/_decision/
  • Plan: <plan-name>
  • Status: Accepted. Recording the plan is the acceptance
  • Supersedes (optional): the slug from the direction's supersedes <slug>. It must name an existing ADR
  • Context: one or two sentences from the direction's reason: the situation that forces the choice, as present fact, per ADR rule 5
  • Decision: the direction's choice, in one to three sentences
  • Options Considered: only when the direction names a rejected alternative
  • Consequences: only when the direction states an effect on later work
  • The criterion and § <section> are not mapped into the ADR

Write all of them into ONE new fragment specs/_decision/NNN-<plan-name>.md (NNN = existing fragment count plus one, zero-padded to 3 digits), H1 # Decisions: <plan-name>, one ## ADR: <Title> block per direction in intent.md order. Edit no other fragment: a supersede is a one-way pointer from the new ADR. Run speq decision-log validate.

Phase 8: Archive

Only when every validation passed and every threshold decision is resolved:

  1. Run speq feature validate.
  2. mv specs/_plans/<plan-name> specs/_recorded/NNN-<plan-name>, where NNN = existing entry count in specs/_recorded/ plus one, zero-padded to 3 digits. The architecture delta moves with the plan.

Phase 9: Confirm Completion

✓ Verification report confirmed
✓ All deltas merged
✓ Spec library validated
✓ Plan archived: specs/_recorded/NNN-<plan-name>
✓ Architecture merged: <sections>   (omit when no delta)
✓ ADRs accepted: N — <slugs>   (omit when none)

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.