Spec

codewithmukesh/dotnet-claude-kit/skills/spec

作者 codewithmukesh23300897f4d1无许可证754 个星标收录于 2026年10月8日更新于 2026年10月8日仓库2个月前更新

Turn a vague feature or product idea into an agreed, persisted specification through relentless structured questioning. Never assumes — every gap, ambiguity, or "probably" becomes a question to the developer, and the spec cannot be approved while open questions remain. Produces docs/specs/<NNN>-<slug>.md with acceptance criteria that /plan, /scaffold, and /tdd consume. Use when: "spec", "write a spec", "spec this out", "requirements", "PRD", "acceptance criteria", "define the feature", "user stories", "what should we build", or before planning any feature too big to describe in one sentence.

AI 生成的概览

通过结构化提问,把模糊的功能想法转化为双方确认并持久化的规格说明文件。

功能
引导智能体执行一套严格的规格说明流程:先复述想法,再围绕九个维度进行分轮提问,最后在 docs/specs/ - .md 起草规格文件。规格内容包括范围、领域模型、API 契约、授权、边界情况、非功能性需求、集成、编号验收标准、延后决策和待解决问题。它强制遵循草稿、审核中、已批准的状态生命周期,批准需要开发者阅读文档并明确同意。批准后的规格会交接给规划、脚手架和测试驱动开发环节。
适用场景
适用于一句话说不清的功能、新产品或模块想法,或在规划非平凡功能之前。也适用于实现过程中需求变得模糊、需要暂停并先写规格的情况。缺陷修复、重构以及实体明确的单端点 CRUD 不适用。
运行要求
无需脚本或特殊工具,仅为指令。它会在 docs/specs/ 下写入 markdown 文件,并需要开发者回答问题并明确批准规格。

/spec — Relentless Specification Workflow

What

Converts an idea into a written, versioned specification that both the developer and Claude explicitly agree on — before any planning or code. The contract:

  • Never assume. Every gap in the idea becomes a question. If Claude catches itself thinking "probably", "presumably", or "the usual way" — that thought is a question to ask, not a decision to make.
  • Relentless, but structured. Questions come in focused rounds (3–5 at a time) across nine dimensions — not one overwhelming dump, and not a single polite round that stops early.
  • Agreement is explicit. Specs have a status lifecycle: Draft → In Review → Approved. Implementation never starts from a Draft. Approval requires the developer to read the final document and say so.
  • Specs are files, not chat. Output persists to docs/specs/<NNN>-<slug>.md and survives the session. Plans, tests, and commits reference it.

When

  • Any feature too big to describe completely in one sentence
  • New product or module ideas ("I want to add team workspaces")
  • Before /plan for non-trivial features — plan consumes the approved spec
  • When requirements feel fuzzy mid-implementation: stop, /spec, re-plan
  • Trigger phrases: "spec", "requirements", "PRD", "define the feature", "acceptance criteria"

Skip for: bug fixes, refactors, single-endpoint CRUD where the entity is obvious.

How

Step 1: Capture and Restate

Take the raw idea and restate it in one paragraph: what Claude understood, in its own words. End with: "Is this the idea? What did I get wrong?" Do not begin questioning until the developer confirms the restatement — questioning the wrong idea wastes everyone's time.

Step 2: Questioning Rounds

Work through the nine dimensions in order. Each round: pick the 3–5 most load-bearing unanswered questions (answers that reshape later questions come first). Where the harness supports selectable options, present choices with trade-offs — and a recommendation — but the developer chooses; a recommendation is never silently applied.

#DimensionWhat to pin down
1Problem & usersWho hurts today, how they work around it, what success looks like
2ScopeWhat is IN this iteration, what is explicitly OUT, where the MVP line sits
3Domain & dataEntities, relationships, lifecycle (create→archive→delete?), retention
4API contractResources, endpoints, request/response shapes, pagination, versioning
5AuthorizationWho can do what, role/claim model, tenant boundaries
6Edge cases & failure modesConcurrency, duplicates, idempotency, partial failure, limits
7Non-functionalsExpected volume, latency budget, growth assumptions
8IntegrationsExternal services, published events, webhooks, side effects
9Acceptance criteriaTestable Given/When/Then for every behavior in scope

Rules of relentless questioning:

  • Record every answer in the draft spec immediately — answers are requirements, not conversation.
  • Challenge contradictions on the spot: "In round 1 you said X; this answer implies not-X. Which wins?"
  • "I don't know" is a legal answer → moves to Deferred Decisions with an explicit fallback the developer chooses now ("default to soft-delete until decided"). Silent deferral is forbidden.
  • A dimension is done when a follow-up round generates zero new questions for it.
  • The questioning phase is done when ALL nine dimensions are done. Do not stop because the conversation feels long — stopping early is how assumptions sneak in.

Step 3: Draft the Spec File

Determine the next number from existing files in docs/specs/ (create the directory if missing). Write docs/specs/<NNN>-<slug>.md:

markdown
# Spec NNN: <Title>
**Status:** Draft**Date:** <today>
## Problem            <!-- who hurts, why now -->## Scope              <!-- ### In / ### Out — both explicit -->## Domain Model       <!-- entities, relationships, lifecycle -->## API Contract       <!-- endpoints table: verb, route, request, response, errors -->## Authorization      <!-- who can do what -->## Edge Cases & Failure Modes## Non-Functional Requirements## Integrations## Acceptance Criteria  <!-- Given/When/Then, numbered AC-1, AC-2, ... -->## Deferred Decisions   <!-- decision, chosen fallback, revisit trigger -->## Open Questions       <!-- MUST be empty before approval -->

Step 4: Review Loop

Set status to In Review. Present the complete spec and ask: "Read this end-to-end. What is wrong, missing, or over-engineered?" Fold corrections in and re-present. Repeat until the developer has no further changes. New answers may spawn new questions — that is the process working, not a failure to converge.

Step 5: The Agreement Gate

Approval is a deliberate act, never inferred from silence or "looks good" in passing. Ask explicitly: "Do you approve this spec? After approval, code follows the spec — changes go through the spec first." On approval, set **Status:** Approved (<date>).

  • Open Questions must be empty. If any remain, the spec cannot be approved — resolve or defer each one explicitly.
  • If implementation later reveals a wrong assumption: stop, set status back to In Review, fix the spec with the developer, then resume. Code never silently diverges from an approved spec.

Step 6: Handoff

  • /plan reads the approved spec and maps acceptance criteria to implementation steps
  • /tdd turns acceptance criteria into the first failing tests (AC-n → test name)
  • Commits for the feature reference the spec: feat: team workspaces (spec 004)

Example

User: /spec users should be able to invite teammates
Claude: Here's what I understood: an existing user can invite another person  to join their... workspace? account? That's already my first gap.  Is this the idea? What did I get wrong?
User: yes, invite to their organization
Claude: Round 1 — Scope & Users:  1. Can invitees be people without an existing account, or only registered users?  2. Who can invite — any member, or only admins/owners?  3. Is there a limit on pending invites (per org, per plan)?  4. Out of scope check: bulk invites and SSO-provisioned members — both OUT for now?
User: 1: both. 2: admins only. 3: no limit. 4: correct, both out.
Claude: Round 2 — Edge cases (your "both" in Q1 raises these):  1. Inviting an email that already has a pending invite — error, or resend?  2. Invite expiry — 7 days, 30 days, never?  3. Invitee already belongs to another org — multi-org membership or rejection?  ...
[…rounds continue until all nine dimensions are exhausted…]
Claude: Spec written to docs/specs/004-team-invitations.md (In Review).  Read it end-to-end. What is wrong, missing, or over-engineered?
User: looks right. approved.
Claude: Status: Approved (2026-06-12). Next: /plan to map AC-1..AC-9  to implementation steps.

Related

  • /plan — Consumes the approved spec; never plan a spec-worthy feature without one
  • /tdd — Acceptance criteria become the first failing tests
  • /scaffold — Generates the slices the plan calls for
  • architecture-advisor — Load during Step 2 if the feature forces architectural decisions

来源与署名

来源:codewithmukesh/dotnet-claude-kit位于skills/spec提交2330089

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 codewithmukesh/dotnet-claude-kit 的技能

Wrap Up

codewithmukesh

在会话结束时把已完成工作、待办任务与经验写入交接文件,并在会话开始时重新载入。

Productivity & Workflow7542个月前更新

Workflow Mastery

codewithmukesh

Claude Code workflow mastery for .NET developers. Covers parallel execution with git worktrees, plan mode strategy, verification loops, auto-formatting hooks, permission setup for dotnet CLI, prompting techniques, subagent patterns, and context discipline — token budget management, MCP-first navigation, lazy loading, and subagent isolation — all adapted for the .NET ecosystem. Load this skill when setting up Claude Code for a .NET project, optimizing workflows, running parallel sessions, when context is running low or sessions feel sluggish, when exploring a large codebase efficiently, or when the user mentions "productivity", "workflow", "parallel", "worktree", "plan mode", "permissions", "hooks", "10x", "setup Claude Code", "speed up development", "context", "tokens", "budget", "running out of context", "too many files", or "large codebase". Inspired by tips from Boris Cherny (creator of Claude Code) and the Anthropic team.

待分类7542个月前更新

Vertical Slice

codewithmukesh

指导 .NET 开发者采用垂直切片架构组织应用,涵盖功能文件夹、端点分组与处理程序模式。

Software Development7542个月前更新

Testing

codewithmukesh

Testing strategy for .NET 10 applications. Covers xUnit v3, WebApplicationFactory for integration tests, Testcontainers for real database testing, Verify for snapshot testing, and the AAA pattern. Load this skill when writing tests, setting up test infrastructure, reviewing test coverage, or when the user mentions "test", "xUnit", "WebApplicationFactory", "Testcontainers", "integration test", "unit test", "bUnit", "snapshot test", "Verify", "test coverage", "AAA pattern", "WireMock", or "FakeTimeProvider".

待分类7542个月前更新

Tdd

codewithmukesh

Guided test-driven development workflow for .NET 10 using xUnit v3, WebApplicationFactory, Testcontainers, and Verify snapshots. Follows the strict red-green-refactor cycle. Use when: "TDD", "test-driven", "let's TDD this", "red green refactor", "write the test first", or when building a feature with clear acceptance criteria.

待分类7542个月前更新

Serilog

codewithmukesh

Structured logging with Serilog for .NET 10 applications. Covers two-stage bootstrap, appsettings configuration, enrichers, sinks, request logging, destructuring, and Serilog.Expressions. Load this skill when setting up Serilog, configuring log sinks, enrichers, or structured logging, or when the user mentions "Serilog", "structured logging", "log enrichment", "Seq", "LogContext", "UseSerilog", "WriteTo", "message template", "Serilog.Expressions", "request logging", "log sink", "rolling file", or "audit log".

待分类7542个月前更新