跳到正文
FunCoding

搜索

搜索文档、Skill 和 MCP

kiro-spec-design

Generate comprehensive technical design translating requirements (WHAT) into architecture (HOW) with discovery process. Use when creating architecture from requirements.

文档与办公3.7ktools/cc-sdd/templates/agents/claude-code-skills/skills/kiro-spec-design/SKILL.md

安装

把这段话发给 Claude Code、Codex 或 Cursor。智能体会先检查安全性,你确认后才安装。

读取 https://funcoding.ai/skills/gotalab/cc-sdd/tools-cc-sdd-templates-agents-claude-code-skills-skills-kiro-spec-design/install.md ,按里面的步骤帮我安装这个 Skill。

SKILL.md

kiro-spec-design Skill

Core Mission

  • Success Criteria:
    • All requirements mapped to technical components with clear interfaces
    • The design makes responsibility boundaries explicit enough to guide task generation and review
    • Appropriate architecture discovery and research completed
    • Design aligns with steering context and existing patterns
    • Visual diagrams included for complex architectures

Execution Steps

Step 1: Gather Context

Reuse steering/spec context already available from conversation; load missing context below. Select skills for the current task even when steering/spec context is already available:

  • {{KIRO_DIR}}/specs/{feature}/spec.json, requirements.md, design.md (if exists)
  • {{KIRO_DIR}}/specs/{feature}/research.md (if exists, contains gap analysis from /kiro-validate-gap)
  • Core steering context: product.md, tech.md, structure.md
  • Additional steering files only when directly relevant to requirement coverage, architecture boundaries, integrations, runtime prerequisites, security/performance constraints, or team conventions that affect implementation readiness
  • Use explicitly requested skills and task-relevant local skills/playbooks, including design, accessibility, and UX. Select by description and read only needed guidance, even for small tasks; preserve required checks and host/project rules.
  • Consult relevant domain skills even when building by hand without adopting a new library.
  • {{KIRO_DIR}}/settings/templates/specs/design.md for document structure
  • Read rules/design-principles.md from this skill's directory for design principles
  • {{KIRO_DIR}}/settings/templates/specs/research.md for discovery log structure

Validate requirements approval:

  • If auto-approve flag is true: Auto-approve requirements in spec.json
  • Otherwise: Verify approval status (stop if unapproved, see Safety & Fallback)

Step 2: Discovery & Analysis

Critical: This phase ensures design is based on complete, accurate information.

  1. Classify Feature Type:

    • New Feature (greenfield) → Full discovery required
    • Extension (existing system) → Integration-focused discovery
    • Simple Addition (CRUD/UI) → Minimal or no discovery
    • Complex Integration → Comprehensive analysis required
  2. Execute Appropriate Discovery Process:

    For Complex/New Features:

    • Read and execute rules/design-discovery-full.md from this skill's directory
    • Conduct thorough research using WebSearch/WebFetch:
      • Latest architectural patterns and best practices
      • External dependency verification (APIs, libraries, versions, compatibility)
      • Official documentation, migration guides, known issues
      • Performance benchmarks and security considerations

    For Extensions:

    • Read and execute rules/design-discovery-light.md from this skill's directory
    • Focus on integration points, existing patterns, compatibility
    • Use Grep to analyze existing codebase patterns

    For Simple Additions:

    • Skip formal discovery, quick pattern check only
Parallel Research (subagent dispatch)

The following research areas are independent and can be dispatched as subagents via the Agent tool. The agent should decide the optimal decomposition based on feature complexity — split, merge, add, or skip subagents as needed. Each subagent returns a findings summary (not raw data) to keep the main context clean for synthesis.

Typical research areas (adjust as appropriate):

  • Codebase analysis: Existing architecture patterns, integration points, code conventions (using Grep/Glob)
  • External research: Dependencies, APIs, latest best practices (using WebSearch/WebFetch)
  • Context loading (usually main context): Steering files, design principles, discovery rules, templates

For simple additions, skip subagent dispatch entirely and do a quick pattern check in main context.

After all findings return, synthesize in main context before proceeding.

  1. Retain Discovery Findings for Step 3:

    • External API contracts and constraints
    • Technology decisions with rationale
    • Existing patterns to follow or extend
    • Integration points and dependencies
    • Identified risks and mitigation strategies
    • Boundary candidates, out-of-boundary decisions, and likely revalidation triggers
  2. Persist Findings to Research Log:

    • Create or update {{KIRO_DIR}}/specs/{feature}/research.md using the shared template
    • Summarize discovery scope and key findings
    • Record investigations with sources and implications
    • Document architecture pattern evaluation, design decisions, and risks
    • If research.md already exists, briefly record consulted skills and the guidance used in its existing research notes.
    • Use the language specified in spec.json when writing or updating research.md

Step 3: Synthesis

Apply design synthesis to discovery findings before writing.

  • Read and apply rules/design-synthesis.md from this skill's directory
  • This step requires the full picture from discovery findings — execute in main context, not in a subagent
  • Record synthesis outcomes (generalizations found, build-vs-adopt decisions, simplifications) in research.md

Step 4: Generate Design Draft

  1. Generate Design Draft:
    • Follow specs/design.md template structure and generation instructions strictly
    • Boundary-first requirement: Before expanding supporting sections, make the boundary explicit. The draft must clearly define what this spec owns, what it does not own, which dependencies are allowed, and what changes would require downstream revalidation.
    • Integrate all discovery findings and synthesis outcomes: Use researched information (APIs, patterns, technologies) and synthesis decisions (generalizations, build-vs-adopt, simplifications) throughout component definitions, architecture decisions, and integration points
    • File Structure Plan (required): Populate the File Structure Plan section with concrete file paths and responsibilities. Analyze the codebase to determine which files need to be created vs. modified. Each file must have one clear responsibility. This section directly drives task _Boundary:_ annotations and implementation Task Briefs — vague file structures produce vague implementations.
    • Testing Strategy: Derive test items from requirements' acceptance criteria, not generic patterns. Each test item should reference specific components and behaviors from this design. E2E paths must map to the critical user flows identified in requirements. Avoid vague entries like "test login works" -- instead specify what is being verified and why it matters.
    • If existing design.md found in Step 1, use it as reference context (merge mode)
    • Apply design rules: Type Safety, Visual Communication, Formal Tone
    • Use language specified in spec.json
    • Keep this as a draft until the review gate passes; do not write design.md yet

Step 5: Review Design Draft

  • Read and apply rules/design-review-gate.md from this skill's directory
  • Verify requirements coverage, architecture readiness, and implementation executability before finalizing the design
  • If issues are local to the draft, repair the design and review again
  • Keep the review bounded to at most 2 repair passes
  • If the draft exposes a real requirements/design gap, stop and return to requirements clarification instead of papering over it in design.md

Step 6: Finalize Design Document

  1. Write Final Design:

    • Write {{KIRO_DIR}}/specs/{feature}/design.md only after the design review gate passes
    • Write research.md with discovery findings and synthesis outcomes (if not already written)
  2. Update Metadata in spec.json:

    • Set phase: "design-generated"
    • Set approvals.design.generated: true, approved: false
    • Set approvals.requirements.approved: true
    • Update updated_at timestamp

Critical Constraints

  • Type Safety:
    • Enforce strong typing aligned with the project's technology stack.
    • For statically typed languages, define explicit types/interfaces and avoid unsafe casts.
    • For TypeScript, never use any; prefer precise types and generics.
    • For dynamically typed languages, provide type hints/annotations where available (e.g., Python type hints) and validate inputs at boundaries.
    • Document public interfaces and contracts clearly to ensure cross-component type safety.
  • Requirements Traceability IDs: Use numeric requirement IDs only (e.g. "1.1", "1.2", "3.1", "3.3") exactly as defined in requirements.md. Do not invent new IDs or use alphabetic labels.

Output Description

Command execution output (separate from design.md content):

Provide brief summary in the language specified in spec.json:

  1. Status: Confirm design document generated at {{KIRO_DIR}}/specs/{feature}/design.md
  2. Discovery Type: Which discovery process was executed (full/light/minimal)
  3. Key Findings: 2-3 critical insights from discovery that shaped the design
  4. Review Gate: Confirm the design review gate passed
  5. Next Action: Approval workflow guidance (see Safety & Fallback)
  6. Research Log: Confirm research.md updated with latest decisions

Format: Concise Markdown (under 200 words) - this is the command output, NOT the design document itself

Note: The actual design document follows {{KIRO_DIR}}/settings/templates/specs/design.md structure.

Safety & Fallback

Error Scenarios

Requirements Not Approved:

  • Stop Execution: Cannot proceed without approved requirements
  • User Message: "Requirements not yet approved. Approval required before design generation."
  • Suggested Action: "Run /kiro-spec-design {feature} -y to auto-approve requirements and proceed"

Missing Requirements:

  • Stop Execution: Requirements document must exist
  • User Message: "No requirements.md found at {{KIRO_DIR}}/specs/{feature}/requirements.md"
  • Suggested Action: "Run /kiro-spec-requirements {feature} to generate requirements first"

Template Missing:

  • User Message: "Template file missing at {{KIRO_DIR}}/settings/templates/specs/design.md"
  • Suggested Action: "Check repository setup or restore template file"
  • Fallback: Use inline basic structure with warning

Steering Context Missing:

  • Warning: "Steering directory empty or missing - design may not align with project standards"
  • Proceed: Continue with generation but note limitation in output

Invalid Requirement IDs:

  • Stop Execution: If requirements.md is missing numeric IDs or uses non-numeric headings (for example, "Requirement A"), stop and instruct the user to fix requirements.md before continuing.

Spec Gap Found During Design Review:

  • Stop Execution: Do not write a patched-over design.md
  • User Message: "Design review found a real spec gap or ambiguity that must be resolved before design can be finalized."
  • Suggested Action: Clarify or fix requirements.md, then re-run /kiro-spec-design {feature}

Next Phase: Task Generation

If Design Approved:

  • Optional: Run /kiro-validate-design {feature} for interactive quality review
  • Run /kiro-spec-tasks {feature} to generate implementation tasks
  • Or /kiro-spec-tasks {feature} -y to auto-approve and proceed directly

If Modifications Needed:

  • Provide feedback and re-run /kiro-spec-design {feature}
  • Existing design used as reference (merge mode)

相似的 Skill

pdf
anthropics/skills180k

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.

文档与办公

discernment-nudge
anthropics/skills180k

discernment-nudge

After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.

文档与办公

doc-coauthoring
anthropics/skills180k

doc-coauthoring

Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.

文档与办公

docx
anthropics/skills180k

docx

Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.

文档与办公

pptx
anthropics/skills180k

pptx

Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.

文档与办公

canvas-design
anthropics/skills180k

canvas-design

Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.

文档与办公