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
- arcasilesgroup/ai-engineeringtheir own version, first seen Nov 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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.
- spec-validateSkill
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
- Very specific: line 18
Read the currently focused Vue SFC (the entry component).
- Distinctive: line 26
Do NOT attempt to summarize the whole repo.
- Distinctive: line 27
If key referenced code is missing/unavailable, record it under Open Questions / Missing Context.
- Very specific: line 31
Write a single markdown file named <ComponentName>.spec.md (e.g.
- Very specific: line 41
Create <ComponentName>.spec.md with this exact structure:
- Distinctive: line 65
This is the most important section: Write as:
- Distinctive: line 71
Only include invariants strongly supported by the code.
- Distinctive: line 72
If uncertain, write as Candidate INV and explain why it's uncertain.
- Very specific: line 73
Prefer precise boolean predicates (e.g.
- Distinctive: line 106
Do not invent product intent.
- Distinctive: line 107
Prefer "the code implies X" rather than "it should do X".
- Distinctive: line 108
If you cannot prove something from the provided code, label it Candidate or put it in Open Questions.
- Distinctive: line 109
Use consistent IDs (INV-_, OP-_).
≈ “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.
Files
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:
- Read the currently focused Vue SFC (the entry component). Determine it from the most recent
ide_opened_filetag in the conversation context. If no such tag is present, ask the user to provide the file path before proceeding. - Identify and read the primary composable/store used by that component.
- Identify and read any direct helper modules used for domain logic by the component/composable.
- 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):
- 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).
- Cross-collection constraints — when items are split across multiple collections, look for partition properties: disjointness (
a ∩ b = ∅), completeness (a ∪ b = allItems), or mutual exclusion. - Cardinality guards —
> 0checks,.lengthvalidations, clamping logic. Each is a candidate invariant on a count or size. - Computed properties with boolean output —
computed(() => x && y)used as a guard elsewhere impliesx && ymust hold for the feature to function correctly. - Repeated
if (...) returnguards — 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.mdonly (no extra commentary).
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
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.

