Auto-Spec for Openclaw

A spec-driven development assistant that helps developers align intent through behavioral contracts before coding or by reverse-engineering existing logic.

yuanyan
v0.0.1
Apr 27, 2026
1
710
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install auto-spec

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install auto-spec using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Auto-Spec?

Auto-Spec is a sophisticated assistant designed for spec-driven development within the ecosystem of Openclaw Skills. It operates on the core belief that code is the single source of truth, treating specifications as disposable inputs that facilitate human-AI alignment rather than permanent documentation. By focusing on behavioral contracts rather than static files, it ensures that your development process remains lean, agile, and free from the overhead of maintaining out-of-sync documentation.

This skill bridges the gap between vague requirements and precise implementation. Whether you are starting a new feature from scratch or trying to decipher a legacy codebase, Auto-Spec provides the structured framework necessary to define what the system should do. It prioritizes precision over completeness, emphasizing edge cases, error paths, and logical postconditions that are often missed in traditional development cycles.

Auto-Spec Use Cases

  • Thinking through complex features before writing a single line of code to avoid logical debt.
  • Generating a behavioral baseline for legacy modules to understand existing functionality.
  • Aligning intent between a developer and an AI agent to ensure implementation matches requirements.
  • Clarifying module responsibilities and interfaces during architectural refactoring.
  • Documenting edge cases and error handling scenarios for critical system components.

How Auto-Spec Works

  1. Intent Analysis: The skill identifies the user's goal, whether it is starting a new feature (Forward Spec) or analyzing existing code (Reverse Spec).
  2. Contextual Research: It scans the relevant codebase to understand existing conventions, integration points, and dependencies.
  3. Granularity Selection: The system automatically determines if the spec should be at the function, module, feature, or system level based on the scope of the request.
  4. Spec Generation: A structured Markdown spec is generated in the conversation, featuring behavioral contracts, preconditions, and expected outcomes.
  5. Iterative Refinement: The user reviews the spec, and the assistant updates it until all [TBD] items are resolved and the intent is clear.
  6. Traceable Implementation: If requested, the skill proceeds to code the solution, referencing specific scenarios from the spec to maintain strict behavioral alignment.

Auto-Spec Setup

To enable Auto-Spec within your environment, ensure your AI agent is configured to recognize the Openclaw Skills directory. No manual file creation is required for the specs themselves as they are transient by design.

# Example: Triggering a spec-driven session via CLI
openclaw run auto-spec "Help me think through a new rate-limiting feature"

Simply invoke the skill by mentioning keywords like "write a spec", "reverse-engineer", or "behavioral contract" during your session.

Auto-Spec Data Schema & Taxonomy

Auto-Spec follows a strict, non-persistent data philosophy. While specs are usually kept in-session, they follow this structured taxonomy when displayed or saved:

Section Content Description
Overview Purpose and context of the module or feature.
Glossary Definitions for domain-specific terminology.
Behavioral Contracts Scenarios including Preconditions, Inputs, and Postconditions.
Constraints Performance, security, and business rule boundaries.
Dependencies List of external modules or system interactions.
Open Questions Unresolved items marked with [TBD] for user clarification.

Auto-Spec Advanced Features

  • Automated Granularity Inference: Intelligently scales the spec detail from single functions to entire systems without manual toggling.
  • Bidirectional Logic Extraction: Capable of moving from intent-to-code or code-to-intent seamlessly.
  • Conflict Detection: Identifies discrepancies between what the code currently does and what the user likely intended.
  • Traceable Coding: Hooks into the implementation phase by referencing spec scenario IDs in generated code comments.
  • Zero-Drift Policy: Avoids technical debt by treating specs as ephemeral snapshots rather than permanent, high-maintenance files.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*