Token导航 LogoToken导航TokenDH.com
研究检索权限需确认github未标认证来源可访问clear审计未展示

spec_design规格设计

Agent Skill

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

总安装

998

周安装

40

GitHub Stars

公开资料未说明

下载量

323
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:spec_design(规格设计)
来源仓库:https://github.com/ikatsuba/skills
仓库路径:skills/spec_design
安装命令:
npx skills add ikatsuba/skills --skill "spec:design"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add ikatsuba/skills --skill "spec:design"

简介

辅助界面视觉与交互体验设计决策。

  • 提供布局、配色与组件层级建议。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 集成于 Cursor 等编辑器提升 UI 产出质量。
  • 需参考现有品牌指南与无障碍标准。
  • spec_design 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Create Design Document

Creates a design document based on the requirements and chosen research solutions. This command reads both .specs/<spec-name>/requirements.md and .specs/<spec-name>/research.md, then generates a technical design that implements the chosen approaches.

Role

You are a Software Architect. Your job is to translate chosen solutions into a buildable technical blueprint.

  • Define components, interfaces, data flows, and integration points
  • Produce diagrams and type definitions precise enough for an engineer to implement without guessing
  • Validate the design against the actual codebase, not assumptions
  • Never introduce requirements not present in the requirements document

When to use

Use this skill when the user needs to:

  • Create a technical design document from existing requirements
  • Generate architecture diagrams and component specifications
  • Plan implementation details before coding

Instructions

Step 0: Check Prerequisites

Read the frontmatter of each prerequisite document. A document's status is in its YAML frontmatter status field. If no frontmatter exists, treat as DRAFT.

PrerequisitePathGate
requirements.specs/<spec-name>/requirements.mdHARD
research.specs/<spec-name>/research.mdSOFT
  • HARD gate failed (missing or status is not APPROVED): Display: "Cannot proceed: requirements.md is missing or not APPROVED (current status: <status>). Run spec:approve <spec-name> requirements first." Use AskUserQuestion with options: "Run spec:approve now", "Cancel". Do NOT offer "proceed anyway".
  • SOFT gate failed (missing or status is not APPROVED): Display: "Warning: research.md is missing or not APPROVED. Proceeding without research may lead to lower quality design." Use AskUserQuestion with options: "Proceed anyway", "Run spec:approve first", "Cancel".
  • All gates pass: Proceed silently to Step 1.

Step 1: Locate Specification Documents

  1. If $0 is provided, use it as the spec name and look in .specs/<spec-name>/
  2. If no spec name provided, list available specs in .specs/ and use the AskUserQuestion tool to let the user choose
  3. Read and analyze:

- requirements.md — the requirements document (required) - research.md — the research document with chosen solutions (recommended)

Step 2: Analyze the Codebase

Before writing the design, analyze the codebase using parallel sub-agents. The depth of exploration depends on whether research.md exists:

2a. Codebase Exploration (launch in parallel)

Use the Task tool with subagent_type=Explore to run exploration agents in parallel.

When research.md EXISTS with CHOSEN solutions — run 2 focused validation agents:

  1. Integration Validator — you are an Integration Validator. Find specific files, APIs, and models that will be affected. Verify that integration points described in research.md actually exist.
  2. Impact Analyst — you are an Impact Analyst. Identify the exact files and components that will need to be created or modified. Map the full data flow.

The research already covers architecture and patterns — do NOT re-discover what is already documented.

When research.md is MISSING — run 4 broad discovery agents:

  1. Architecture Scout — you are an Architecture Scout. Explore overall project structure, entry points, module boundaries, and dependency graph.
  2. Patterns Analyst — you are a Patterns Analyst. Identify coding conventions, design patterns, naming styles, error handling approaches, and testing patterns used in the codebase.
  3. Integration Validator — you are an Integration Validator. Find APIs, services, database models, external dependencies, and configuration files relevant to the requirements.
  4. Impact Analyst — you are an Impact Analyst. Based on the requirements document, identify specific files and components that will need to be created or modified.

All agents MUST be launched in a single message (parallel tool calls) to maximize efficiency.

2b. Technology Research (launch in parallel with 2a)

Use external information sources to complement the research document — do not repeat investigation already captured in research.md. Focus on implementation-level details needed for the design:

  1. Context7 MCP server — use resolve-library-id and query-docs to fetch up-to-date documentation for key dependencies found in package.json, go.mod, Cargo.toml, or equivalent manifest files. Query API references and implementation patterns relevant to the chosen solutions
  2. Web search — use WebSearch to find implementation guides, code examples, and known pitfalls specific to the chosen approaches
  3. Web fetch — if the requirements or research reference specific APIs, services, or specs (e.g., OAuth, OpenAPI schemas, RFC documents), use WebFetch to retrieve and analyze them

Launch these research tasks in parallel with the codebase exploration agents above.

2c. Synthesize Findings

After all parallel agents and research complete, synthesize the results into a unified understanding:

  • Current architecture and where the new feature fits
  • Existing patterns to follow (or consciously deviate from with justification)
  • Technology constraints and best practices from documentation
  • Files and components to create or modify
  • Integration points and potential risks

Step 3: Create the Design Document

Create the document at .specs/<spec-name>/design.md with this structure:

The document MUST begin with YAML frontmatter before the first # heading:

---
status: DRAFT
created: <today's date YYYY-MM-DD>
updated: <today's date YYYY-MM-DD>
---
# Design Document: [Feature Name]

## Overview

[Brief description of what will be implemented and the key changes]

### Key Changes

1. [Major change 1]
2. [Major change 2]
3. [Major change 3]

### Chosen Approach

[If research.md exists, summarize the chosen variants and how they map to this design]

| Problem Area | Chosen Solution | Reference |
|-------------|----------------|-----------|
| [Area 1]    | [Variant name]  | research.md §1 |
| [Area 2]    | [Variant name]  | research.md §2 |

## Architecture

### Component Diagram

\`\`\`mermaid
graph TB
    subgraph "Module Name"
        A[Component A]
        B[Component B]
    end

    subgraph "External"
        C[External Service]
    end

    A --> B
    B --> C
\`\`\`

### Data Flow

\`\`\`mermaid
sequenceDiagram
    participant U as User
    participant C as Component
    participant S as Service
    participant E as External

    U->>C: Action
    C->>S: Request
    S->>E: API Call
    E-->>S: Response
    S-->>C: Result
    C-->>U: Display
\`\`\`

## Components and Interfaces

### [Component/Service Name]

[Description of the component]

\`\`\`typescript
// Path: src/path/to/file.ts

interface InterfaceName {
  property: Type;
  method(param: Type): ReturnType;
}

class ClassName {
  constructor(config: ConfigType);

  methodName(param: Type): ReturnType;
}
\`\`\`

[Continue with additional components]

## Data Models

### [Model Name]

\`\`\`typescript
interface ModelName {
  // Properties with comments
  field1: string;  // Description
  field2: number;  // Description
}
\`\`\`

## Data Flow Completeness

For each new field or entity introduced by this feature, trace the full data flow to ensure nothing is missed during implementation:

| Field/Entity | Schema | Migration | Query/Mutation | API Type | Frontend Type | UI Component |
|-------------|--------|-----------|---------------|----------|--------------|-------------|
| [field1]    | `path` | `path`    | `path`        | `path`   | `path`       | `path`      |
| [field2]    | `path` | N/A       | `path`        | `path`   | `path`       | `path`      |

Any field missing from a layer in this table is a bug waiting to happen. If a layer is not applicable (e.g., no migration needed), mark it as N/A with a reason.

## Error Handling

### Error Types and Handling

| Error | User Message |
|-------|-------------|
| Network error | "Could not connect to server." |
| Invalid input | "Please check your input." |

## Testing Strategy

### Approach

[Describe the testing approach - unit tests, integration tests, etc.]

### Unit Tests

\`\`\`typescript
describe('ComponentName', () => {
  it('should [expected behavior]', () => {
    // Test example
  });
});
\`\`\`

### Edge Cases

1. [Edge case 1] - [Expected handling]
2. [Edge case 2] - [Expected handling]

Writing Guidelines

  1. Include diagrams - Use Mermaid for architecture and flow diagrams
  2. Show TypeScript interfaces - Define all new interfaces and types
  3. Reference file paths - Indicate where code will be located
  4. Map to requirements - Ensure design covers all requirements
  5. Consider error cases - Document error handling strategy
  6. Include test examples - Show how components will be tested
  7. Align with chosen research solutions - Implement the variants marked CHOSEN in research.md; deviate only with explicit rationale
  8. Design for natural user flows - Every interaction flow must minimize navigation hops. When related entities are managed on different pages (e.g., categories and subcategories), the design MUST include inline creation mechanisms (modal dialogs, quick-add controls in dropdowns/selects) so the user can create a dependent entity without leaving the current context. Never design flows where the user has to go to page A, create entity X, go back to page B, and then link X — instead, provide in-context creation of X directly on page B.

Step 4: Confirm with User

After creating the document, show the user:

  1. The location of the created file
  2. A summary of the design decisions
  3. Use the AskUserQuestion tool to ask if they want to make changes or proceed, with options like "Looks good, proceed to tasks", "I want to make changes", "Review design first"

Arguments

  • $ARGUMENTS - The spec name via $0 (e.g., "user-auth", "payment-flow")

If not provided, list available specs and ask the user to choose.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.86%
按下载量换算84

Codex

24.77%
按下载量换算80

OpenCode

17.07%
按下载量换算55

Cursor

11.98%
按下载量换算39

windsurf

7.75%
按下载量换算25

kiro-cli

3.63%
按下载量换算12

安全审计

暂无安全审计结果可展示。

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills