agentleFS
telefrektelefrek/vallorcine/skills/spec-resolve/SKILL.md

spec-resolve

Skill0 starsChanged 7 months agoMITView on GitHub

Resolve a context bundle of relevant specs for a feature

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 10 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run corpus health check:

    line 17
  2. Very specific:

    If output says "Not initialized", tell the user to run /spec-init first.

    line 21
  3. Very specific:

    Read the Domains matched: line from the bundle header.

    line 38
  4. Distinctive:

    Ask yourself: given the feature description, could there be relevant domains not captured by keyword matching?

    line 43
  5. Distinctive:

    If you identify missing domains, run once more with override:

    line 49
  6. Distinctive:

    If after two runs the domain set still seems incomplete, append a note to the bundle header:

    line 58
  7. Very specific:

    If Omitted (budget): is non-empty, append to the bundle:

    line 68
  8. Very specific:

    If the bundle contains a ## Displacement section, the resolver detected that new spec requirements contradict existing APPROVED specs.

    line 80
  9. Distinctive:

    Read the full requirement text from both spec files to give the user context.

    line 101
  10. Distinctive:

    Use AskUserQuestion with options:

    line 103
  11. Very specific:

    Narrow new / Narrow old: Stop the resolve. Display which spec needs editing and suggest /spec-author to make the revision.

    line 116
  12. Distinctive:

    After all displacements are resolved (or deferred), append to the bundle:

    line 125
  13. Distinctive:

    If any decision was "Narrow new" or "Narrow old", the bundle output stops here — do not proceed to Step 4.

    line 134
  14. Distinctive:

    Never read spec files outside what the script returns

    line 149
  15. Distinctive:

    Never invoke /spec-resolve recursively

    line 150
  16. Very specific:

    If NEEDS_DOMAIN_INFERENCE=true appears in script stderr, that is handled by step 2 — it is not an error

    line 151

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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-resolve <feature-description>

Build a resolved context bundle of relevant specifications for a feature. The bundle is a pre-filtered, token-budgeted input artifact for the implementation agent. You never navigate the .spec/ corpus manually — the bash resolver does all file discovery and filtering.


Pre-flight guard

Run corpus health check:

bash .claude/scripts/spec-stats.sh

If output says "Not initialized", tell the user to run /spec-init first. Stop.


Step 1 — Run the resolver script

bash .claude/scripts/spec-resolve.sh "$ARGUMENTS" 25000

Capture the full output as BUNDLE.


Step 2 — Domain completeness check (single inference step)

Read the Domains matched: line from the bundle header.

Then read ONLY .spec/CLAUDE.md — specifically the Domain Taxonomy table. No other files.

Ask yourself: given the feature description, could there be relevant domains not captured by keyword matching? Consider:

  • Does the feature touch interfaces owned by an unmatched domain?
  • Does the feature description use synonyms or abstractions that don't appear literally as domain names?

If you identify missing domains, run once more with override:

OVERRIDE_DOMAINS="storage,query,compaction" \
  bash .claude/scripts/spec-resolve.sh "$ARGUMENTS" 25000

Replace BUNDLE with this output.

Hard limit: maximum two script invocations. Do not loop.

If after two runs the domain set still seems incomplete, append a note to the bundle header:

Possible missing domains: <your assessment> — load manually if needed

Step 3 — Handle budget omissions

If Omitted (budget): is non-empty, append to the bundle:

## Budget Omissions
These specs were excluded due to token budget. If your feature directly
modifies their interfaces, load them individually:
<list omitted IDs>

Step 3.5 — Displacement resolution

If the bundle contains a ## Displacement section, the resolver detected that new spec requirements contradict existing APPROVED specs. Each displacement must be resolved before the bundle is complete.

Skip this step entirely if no ## Displacement section exists.

Parse and group

Parse each DISPLACED: line from the section. Group by existing spec ID so the user sees all displacements per spec together.

Resolve each displacement

For each displaced existing spec, display:

── Displacement detected ─────────────────────
  New: <new_id>.<req_id> — "<requirement text>"
  Existing: <existing_id>.<req_id> — "<requirement text>"
  Signal: <signal from DISPLACED line>

Read the full requirement text from both spec files to give the user context.

Use AskUserQuestion with options:

  • "Accept" (description: invalidate the existing requirement — adds <existing_id>.<existing_req_id> to the new spec's invalidates array)
  • "Narrow new spec" (description: revise the new spec to avoid the conflict — stop and re-run after editing)
  • "Narrow old spec" (description: revise the existing spec to coexist — stop and re-run after editing)
  • "Defer" (description: record as unresolved obligation and continue)

Process decisions

  • Accept: Record <existing_id>.<existing_req_id> for the new spec's invalidates array. The spec-write step will include it when registering.
  • Narrow new / Narrow old: Stop the resolve. Display which spec needs editing and suggest /spec-author to make the revision. The bundle is incomplete — the user must re-run /spec-resolve after editing.
  • Defer: Append [UNRESOLVED: displacement — <new_id> vs <existing_id>] to the new spec's open_obligations. The spec will remain DRAFT and be excluded from downstream stages until resolved.

Append resolution summary

After all displacements are resolved (or deferred), append to the bundle:

## Displacement Resolution
| Existing Spec | Requirement | Decision | Action |
|---------------|-------------|----------|--------|
| <id> | <req_id> | Accept | → invalidates in new spec |
| <id> | <req_id> | Defer | → open_obligations in new spec |

If any decision was "Narrow new" or "Narrow old", the bundle output stops here — do not proceed to Step 4.


Step 4 — Output the bundle

Emit the complete bundle. Do not summarize, rewrite, or interpret it. The bundle is an input artifact for the implementation agent.


Hard constraints

  • Maximum two script invocations per resolve call
  • Never read spec files outside what the script returns
  • Never invoke /spec-resolve recursively
  • If NEEDS_DOMAIN_INFERENCE=true appears in script stderr, that is handled by step 2 — it is not an error

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.