Install
openclaw skills install @yuanyan/auto-specSpec-driven development assistant: helps write precise behavioral specs before coding, or reverse-engineer specs from existing code for understanding and alignment. Use this skill when the user mentions "write a spec", "generate spec", "spec-driven", "behavioral contract", "reverse spec from code", "clarify this module's behavior", or "align on intent". Also applies when the user says "I want to add a feature, help me think it through first" or "what does this code actually do, walk me through it".
openclaw skills install @yuanyan/auto-specCode is the single source of truth.
Specs are inputs — they help humans align intent and assist AI coding — not deliverables. Specs don't need to stay in sync with code permanently; regenerate from code when needed.
Three hard constraints follow:
Therefore, specs generated by this skill are presented in the conversation by default, not written to files. Only persist to disk when the user explicitly asks, and treat it as a temporary snapshot, not a long-lived document.
The user has an idea or requirement but hasn't written code yet. Turn vague intent into precise behavioral contracts, then (if requested) implement according to the spec.
Typical triggers:
Code already exists. The user wants to understand what it does, or wants to establish a baseline before making changes. Extract behavioral contracts from the code.
Typical triggers:
A spec is not prose — it's a structured behavioral contract. Granularity is chosen automatically based on scope:
| User's scope | Granularity | Example |
|---|---|---|
| A single function/method | Function-level | Behavior of CalculateQuota |
| A single file/class | Module-level | Responsibilities and interface of quota_service.go |
| A feature/capability | Feature-level | Complete behavior of "quota management" |
| A system/service | System-level | Overall behavior of "order system" |
Don't ask the user to specify granularity — infer from context. When uncertain, go one level higher than what the user described, then drill down into key parts within the spec.
Each spec contains the following sections (trim as needed — don't pad with empty content just to fill the template):
# [Name] Spec
## Overview
One or two sentences explaining what this is and why it exists.
## Glossary
Only needed when domain-specific terms or easily confused concepts are present.
- **TermA**: definition
## Behavioral Contracts
### Scenario 1: [Scenario Name]
- **Precondition**: what state the system is in
- **Input**: what triggers this behavior
- **Expected behavior**: what the system should do
- **Postcondition**: what state the system should be in afterward
- **Error cases**: what happens if something goes wrong
### Scenario 2: ...
## Constraints & Boundaries
- Performance constraints, security constraints, business rules, etc.
- Explicitly stating "what we don't do" is equally important
## Dependencies
- What external systems/modules/interfaces this depends on
- Who depends on this
## Open Questions
Items that need further confirmation (if any).
[TBD] for things you're not sure about — don't fabricate.Understand intent
Research context
Generate spec
Iterate and confirm
[TBD] items(Optional) Implement according to spec
Locate the code
Extract behavior
Generate spec
[NOTE] to flag anything that doesn't match expectationsDeliver