Agent Skillskdlbs/kandev › spec

spec

GitHub

用于创建或更新产品需求与系统设计文档,明确可观测行为与技术路径。适用于新功能、合同变更及规范工作,通过路由规则定位所属系统并遵循特定模板撰写,确保需求清晰且可追溯。

.agents/skills/spec/SKILL.md kdlbs/kandev

触发场景

需要编写新的产品需求文档 需要创建或更新系统设计文档 涉及新功能的规格定义 合同或接口行为的变更说明

安装

npx skills add kdlbs/kandev --skill spec -g -y
更多选项

非标准路径

npx skills add https://github.com/kdlbs/kandev/tree/main/.agents/skills/spec -g -y

不安装直接使用

npx skills use kdlbs/kandev@spec

指定 Agent (Claude Code)

npx skills add kdlbs/kandev --skill spec -a claude-code -g -y

安装 repo 全部 skill

npx skills add kdlbs/kandev --all -g -y

预览 repo 内 skill

npx skills add kdlbs/kandev --list

SKILL.md

Frontmatter
{
    "name": "spec",
    "description": "Create or update Kandev product requirements and system-design documents before implementation. Use for new product behavior, changed contracts, or explicit specification work. Do not use for implementation plans, work orders, incidents, or behavior-preserving refactors."
}

Specification Authoring

Use this skill to create or update durable specifications. Requirements define observable behavior. System designs define the technical path that satisfies requirements.

The canonical rules are in docs/specs/guide/. Read these files before you write an artifact:

  • Always read structure-and-ownership.md.
  • Read requirements.md for requirement work.
  • Read system-design.md for system-design work.
  • Read traceability-and-lifecycle.md for IDs, statuses, references, or migration work.

Use the templates in docs/specs/templates/.

Artifact routing

Route the request before you write:

Request Artifact
Kandev-wide purpose, actors, principles, measures, or constraints docs/specs/product/
Observable behavior for one owning system <system>/requirements/
Technical contracts, models, boundaries, or control flow <system>/system-design/
Durable choice with meaningful alternatives /record and an ADR
Delivery sequence and implementation tasks /plan
Incident or behavior-preserving refactor No product requirement
Bug /fix, which checks the existing requirement first

Do not create a generic spec.md file.

Workflow

1. Locate the owning system

Read docs/specs/README.md and the likely system README.md. If the system has not migrated, use docs/specs/INDEX.md to locate the legacy source.

Search all system indexes, requirements, and designs for the capability name and its main nouns. Update an existing capability when it owns the same actor, lifecycle, and contract.

Choose the system that owns the source of truth and durable contract. Do not choose an owner from the code directories that change. Record one sentence in the working notes that states why the selected system owns the capability.

User visibility does not make a capability UI-owned. Keep provider state, task state, permissions, persistence, and recovery with their owning systems. Put desktop, mobile, accessibility, and visible failure outcomes in that owner's requirement. Create a UI requirement only for an independent and reusable presentation contract.

The same system owns the requirement and its design. Other systems link to that source. They do not copy it or claim its requirement IDs in design frontmatter.

If no system owns the behavior, define the new system boundary before you write requirements. A new system needs a README.md based on the system template.

2. Confirm intent

Use /interview-me when a missing product choice changes behavior, ownership, permissions, persistence, or a public contract. Do not hide an unresolved choice in a draft.

3. Write requirements

Create or update:

docs/specs/<system>/requirements/<capability>.md

Each requirement document must contain:

  • Valid frontmatter.
  • One or more stable REQ-* IDs.
  • At least one AC-* acceptance criterion for each requirement.
  • Observable behavior and explicit exclusions.

Use user stories only when they clarify a natural actor and outcome. Do not put files, functions, database queries, or implementation sequences in a requirement.

Keep one cohesive vertical outcome together. Do not create separate backend and UI requirements for the same feature. Split only when actors, lifecycles, or contracts are independent.

4. Write system design

Create or update this file when the change needs a technical design:

docs/specs/<system>/system-design/<capability>.md

The design must list the applicable REQ-* IDs in frontmatter. It can use an explicit empty list for internal infrastructure with no independent product requirement.

Describe stable components, models, contracts, flow, failure behavior, persistence, security, and observability when they apply. Link to global ADRs. Do not copy requirement or ADR text.

Cover all runtime boundaries that implement the owned outcome. A provider-owned design can include backend services, storage, projections, frontend components, responsive behavior, and tests. Do not create a parallel UI design for those same requirements.

5. Update the system index

Add the new documents to the system README.md. State the system boundary and link adjacent systems when ownership can be confused.

During migration, name the new source as authoritative. Replace the old source with a link or archive it. Do not leave two editable sources of truth.

6. Validate

Review the artifacts before you run the linter:

  • One system owns each requirement and its design.
  • No adjacent system contains a copied requirement or UI-only duplicate.
  • Requirements contain observable behavior, not storage, control flow, or file details.
  • Every acceptance criterion states a testable behavior. No criterion delegates its meaning to migrated source detail.
  • Designs map requirement IDs without copying requirement text.
  • New files do not copy the legacy Migrated source detail wrapper.
  • New artifacts appear in the owning system index.

Run:

python3 scripts/lint-spec-files.test.py
python3 scripts/lint-spec-files.py --all
git diff --check -- docs/specs docs/decisions

If a file reaches its size limit, split it by capability, lifecycle, or contract boundary. Do not add a size exception for a new document.

Design-package behavior

When this skill runs inside /spec-driven-development or /fix, continue to the system design, plan, and work orders. Stop after requirements only when the user explicitly requests a requirements review or a material question blocks safe design.

For a standalone specification request, report the changed paths, requirement IDs, design references, validation results, and open questions. Then return control to the user.

版本历史

  • 0e4ae86 当前 2026-08-27 18:29

    收紧了规范的所有权定义和迁移规则,并建立了面向系统的规范治理机制。

  • 1578843 2026-08-16 08:48
  • b4239d8 2026-07-24 17:33

同 Skill 集合

.agents/skills/acp-debug/SKILL.md
.agents/skills/add-integration/SKILL.md
.agents/skills/clean-branches/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/commit/SKILL.md
.agents/skills/context-engineering/SKILL.md
.agents/skills/create-kandev-plugin/SKILL.md
.agents/skills/debug/SKILL.md
.agents/skills/docs-maintainer/SKILL.md
.agents/skills/e2e/SKILL.md
.agents/skills/fix/SKILL.md
.agents/skills/harness-improvement/SKILL.md
.agents/skills/interview-me/SKILL.md
.agents/skills/plan/SKILL.md
.agents/skills/planner-orchestration/SKILL.md
.agents/skills/playwright-cli/SKILL.md
.agents/skills/pr-fixup/SKILL.md
.agents/skills/pr/SKILL.md
.agents/skills/product-demo-seeding/SKILL.md
.agents/skills/product-video-capture/SKILL.md
.agents/skills/push/SKILL.md
.agents/skills/qa/SKILL.md
.agents/skills/record/SKILL.md
.agents/skills/release/SKILL.md
.agents/skills/runtime-feature-flags/SKILL.md
.agents/skills/simplify/SKILL.md
.agents/skills/spec-driven-development/SKILL.md
.agents/skills/tdd/SKILL.md
.agents/skills/using-agent-skills/SKILL.md
.agents/skills/verify/SKILL.md
.agents/skills/mobile-parity/SKILL.md

元信息

文件数
0
版本
0e4ae86
Hash
a0380aa3
收录时间
2026-07-24 17:33

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-28 00:11
浙ICP备14020137号-1 $访客地图$