← 返回
开发者工具 中文

Spec Writer

Generate structured implementation spec documents for coding projects or features. Use when a user provides a requirement, feature idea, bug description, or...
为编码项目或功能生成结构化的实施规范文档。当用户提供需求、功能创意、错误描述或……时使用。
lgyanami
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 529
下载
💾 3
安装
1
版本
#latest

概述

Spec Writer — Structured Implementation Spec Generator

Generate high-quality, AI-agent-friendly spec documents from vague requirements.

When to Use

  • User has a requirement, feature idea, bug report, or GitHub issue
  • User wants a structured document before coding starts
  • User says "write a spec", "plan this out", "spec this feature", etc.
  • dev-workflow Phase 2 needs a detailed spec (can be called as a sub-step)

Output

A single Markdown spec document saved to the project directory (default: SPEC.md or spec/.md).

Workflow

Step 1: Gather Context

Collect information from available sources. Do not ask the user for things you can find yourself.

From the user's input:

  • What to build and why
  • Any explicit constraints or preferences

From the project (if accessible):

  • Tech stack (package.json, Cargo.toml, pyproject.toml, go.mod, etc.)
  • Project structure (directory layout)
  • Existing architecture docs (llmdoc/, README, ARCHITECTURE.md, etc.)
  • Code style patterns (sample existing code)
  • Test setup (test framework, where tests live, how to run them)
  • Git workflow (branch conventions, CI config)

From external sources (if referenced):

  • GitHub issue details (title, body, comments, labels)
  • Linked docs, designs, or API references

Step 2: Draft the Spec

Use the spec template at references/spec-template.md. Read it before generating.

Fill every section based on gathered context. Key principles:

  • Be specific, not vague. "React 18 with TypeScript and Vite" not "React project."
  • Focus on what and why first. User stories and success criteria anchor everything.
  • Include real commands. Full commands with flags, not just tool names.
  • Show, don't describe. One code example beats three paragraphs of explanation.
  • State what NOT to do. Explicit exclusions prevent agent drift.
  • Use three-tier boundaries. ✅ Always / ⚠️ Ask first / 🚫 Never.

Step 3: Review with User

Present the draft to the user. Common discussion points:

  • Are the user stories complete? Any missing scenarios?
  • Is the technical approach acceptable? Alternative architectures?
  • Are boundaries correct? Anything too strict or too loose?
  • Are verification criteria testable and sufficient?
  • Is the task breakdown granularity right?

Revise until the user confirms. Mark status as "✅ Confirmed" when approved.

Step 4: Save and Deliver

Save the confirmed spec to the project. Suggested locations:

  • Single feature: SPEC.md in project root
  • Multiple specs: spec/.md
  • With dev-workflow: the spec replaces the requirement doc in Phase 2

Tell the user the spec is ready and suggest next steps:

  • Hand to a coding agent (dev-workflow, Claude Code, Codex, etc.)
  • Use as a reference for manual implementation
  • Share with team for review

Adapting to Project Scale

Small task (bug fix, small feature):

  • Skip or compress sections that don't apply
  • Focus on: Objective, Changes, Boundaries, Verification
  • Total spec: ~50-100 lines

Medium task (feature, refactor):

  • Use full template
  • Total spec: ~100-250 lines

Large task (new module, major feature):

  • Use full template with extended task breakdown
  • Consider splitting into multiple specs (one per component/module)
  • Include architecture diagram description or data model
  • Total spec: ~200-400 lines

Principles

These come from industry best practices (GitHub's study of 2,500+ agent files, Anthropic's context engineering research, and practical spec-driven development patterns):

  1. Spec is the source of truth — It persists across sessions, anchoring the agent when context gets long or sessions restart.
  1. Structure for parseability — Clear Markdown headings, consistent format. AI models handle well-structured text better than free-form prose.
  1. Six core areas — Commands, Testing, Project Structure, Code Style, Git Workflow, Boundaries. Use as a completeness checklist.
  1. Three-tier boundaries — ✅ Always do (proceed without asking) / ⚠️ Ask first (need human approval) / 🚫 Never do (hard stop). More effective than flat rule lists.
  1. Modularity — Each section should be independently useful. A coding agent working on the backend doesn't need the frontend spec section in its context.
  1. Living document — Update the spec when decisions change. An outdated spec is worse than no spec.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 04:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,188
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,200
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,209