agentleFS
simonbbyrnesimonbbyrne/claude-skills/spec-extract/SKILL.md

spec-extract

Skill1 starsChanged 8 months agoMITView on GitHub

Reverse-engineer a Design-by-Contract feature spec.md (invariants, operations, state model) from the currently focused Vue component and its related composables/helpers.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. arcasilesgroup/ai-engineering★ 65same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    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:

    Read the currently focused Vue SFC (the entry component).

    line 18
  2. Distinctive:

    Do NOT attempt to summarize the whole repo.

    line 26
  3. Distinctive:

    If key referenced code is missing/unavailable, record it under Open Questions / Missing Context.

    line 27
  4. Very specific:

    Write a single markdown file named <ComponentName>.spec.md (e.g.

    line 31
  5. Very specific:

    Create <ComponentName>.spec.md with this exact structure:

    line 41
  6. Distinctive:

    This is the most important section: Write as:

    line 65
  7. Distinctive:

    Only include invariants strongly supported by the code.

    line 71
  8. Distinctive:

    If uncertain, write as Candidate INV and explain why it's uncertain.

    line 72
  9. Very specific:

    Prefer precise boolean predicates (e.g.

    line 73
  10. Distinctive:

    Do not invent product intent.

    line 106
  11. Distinctive:

    Prefer "the code implies X" rather than "it should do X".

    line 107
  12. Distinctive:

    If you cannot prove something from the provided code, label it Candidate or put it in Open Questions.

    line 108
  13. Distinctive:

    Use consistent IDs (INV-_, OP-_).

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Extract Skill (Vue 3 + TypeScript)

How to run

  • Open the feature's primary Vue SFC in the editor (the "current file"), e.g. Counter.vue.
  • Run /spec-extract.

Inputs (what to read)

You MUST base the spec on the code you can see/read. Use a feature-scoped approach:

  1. Read the currently focused Vue SFC (the entry component). Determine it from the most recent ide_opened_file tag in the conversation context. If no such tag is present, ask the user to provide the file path before proceeding.
  2. Identify and read the primary composable/store used by that component.
  3. Identify and read any direct helper modules used for domain logic by the component/composable.
  4. Optionally read the API client functions called by the composable/store (only if referenced).

Scoping rules

  • Prioritize files in the same folder as the current component, then nearby feature folders.
  • Do NOT attempt to summarize the whole repo.
  • If key referenced code is missing/unavailable, record it under Open Questions / Missing Context.

Output location

Write a single markdown file named <ComponentName>.spec.md (e.g. LscLazy.spec.md) in the same folder as the currently focused Vue SFC. Derive the component name from the SFC filename (strip the .vue extension).

GOAL

Produce a feature spec that can be used as a test oracle and to generate unit/component/E2E tests.

Invariants are the primary deliverable. A spec with 5 precise invariants and 3 operations is more valuable than a complete but shallow spec. Prioritize depth of invariant discovery over breadth of section coverage.

OUTPUT FORMAT

Create <ComponentName>.spec.md with this exact structure:

<Feature Name> Spec

Purpose

1–3 sentences of user-visible behavior.

Scope

  • In scope
  • Out of scope

State Model

List state variables grouped by source. For each, include: name, type, and default/initial value only.

  • Inputs (props, route params): propName: Type = default
  • UI state (component refs/reactive): varName: Type = default
  • Domain state (composable/store): varName: Type = default
  • External dependencies (API, storage, time): varName: Type = default

Invariants (Always True)

This is the most important section. Write as:

  • INV-1 (<ShortName>): <precise predicate>

Rules:

  • Only include invariants strongly supported by the code.
  • If uncertain, write as Candidate INV and explain why it's uncertain.
  • Prefer precise boolean predicates (e.g. items.length > 0, a ∩ b = ∅).
  • Include UI-scoped predicates here too (e.g. saveButton.disabled ↔ !isValid). Do not create a separate UI Rules section.

Where to look for invariants (in priority order):

  1. Initialization functions — any function that normalizes, seeds, or derives initial state. Guards inside it reveal what the code treats as always-true (e.g. a filter on valid IDs implies a membership invariant).
  2. Cross-collection constraints — when items are split across multiple collections, look for partition properties: disjointness (a ∩ b = ∅), completeness (a ∪ b = allItems), or mutual exclusion.
  3. Cardinality guards — > 0 checks, .length validations, clamping logic. Each is a candidate invariant on a count or size.
  4. Computed properties with boolean output — computed(() => x && y) used as a guard elsewhere implies x && y must hold for the feature to function correctly.
  5. Repeated if (...) return guards — the same condition checked at the top of multiple operations is almost always an invariant the code is trying to enforce.

Operations (Events/Actions)

For every operation that changes state or causes side effects:

OP-<n> <operationName>

  • requires (preconditions):
  • ensures (postconditions): use x' notation for post-state (e.g., value' = value + 1)
  • failure behavior:

Include operations triggered by user events (click/submit), lifecycle hooks (mounted), watchers/effects, and API calls.

Open Questions / Ambiguities

List behaviors not uniquely determined by code. For each:

  • give 2–3 plausible options
  • state what the code currently implies (if anything)
  • note any missing context (imports/types/utilities not read)

STRICT RULES

  • Do not invent product intent.
  • Prefer "the code implies X" rather than "it should do X".
  • If you cannot prove something from the provided code, label it Candidate or put it in Open Questions.
  • Use consistent IDs (INV-, OP-).
  • Output <ComponentName>.spec.md only (no extra commentary).

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.