AgentSkillsCN

skill-architect

为新Agent技能进行需求分析与架构设计。当用户提出“设计技能”“绘制design.md”“生成Mermaid图”“初始化.skill-context”等需求时,可启用此技能。当您需要:(1) 收集技能构建的创意灵感;(2) 基于architect.md框架分析用户需求;(3) 利用Mermaid图表绘制初步的架构设计方案。此技能是Master Skill Suite中的核心技能之一(架构师→规划师→构建师)。

SKILL.md
--- frontmatter
name: skill-architect
description: Phan tich yeu cau va thiet ke kien truc cho Agent Skill moi. Trigger khi user noi: "thiet ke skill", "ve design.md", "ve so do mermaid", "khoi tao .skill-context". Su dung khi can (1) thu thap y tuong xay dung skill, (2) phan tich yeu cau dua tren framework architect.md, (3) tao ban thiet ke kien truc voi Mermaid diagrams. Skill nay la #1 trong bo Master Skill Suite (Architect -> Planner -> Builder).

Skill Architect

Mission

Act as a Senior Skill Architect. Analyze user requirements for building a new Agent Skill, apply the architecture framework from knowledge/architect.md, and produce a complete architecture design document at .skill-context/{skill-name}/design.md.

This skill ONLY designs — it does NOT write implementation code.

Mandatory Boot Sequence

  1. Read this SKILL.md file.
  2. Read knowledge/architect.md — the architecture framework (3 Pillars, 7 Zones).
  3. Determine the skill name from user input (kebab-case).
  4. Run scripts/init_context.py {skill-name} to create the context directory.
  5. Proceed to Phase 1.

Progressive Writing Rule

⚠️ CRITICAL: After init_context.py runs, design.md exists with empty section headings. This file is the living document — write analysis results into it immediately after each phase is confirmed by the user.

Do NOT wait until Phase 3 to write everything at once. The design.md file must reflect the current state of analysis at all times.

After PhaseWrite to design.md sectionsContent
Phase 1 confirmed§1 Problem Statement, §10 MetadataPain point, user & context, expected output, reference docs
Phase 2 confirmed§2 Capability Map, §3 Zone Mapping, §8 Risks & Blind Spots3 Pillars breakdown, 7 Zones table, blind spots, tools
Phase 3 confirmed§4, §5, §6, §7, §9 + update §10 statusDiagrams, interaction points, progressive disclosure, open questions

Why: If the conversation is interrupted or context is lost, design.md preserves all confirmed analysis. The next session can resume from where it stopped by reading the file.

Phase 1: Collect (Thu thap)

Gather information about the skill the user wants to build.

  1. Read user input: idea description, reference documents (if any).
  2. Identify three core elements:
    • Pain Point: What problem does this skill solve?
    • User & Context: Who uses it and in what context?
    • Expected Output: What does the skill produce?
  3. If any element is missing, ask at most 3 short questions to fill the gaps.
  4. If user provides reference documents, note them for resources/.
  5. Run scripts/init_context.py {skill-name} to create .skill-context/{skill-name}/.

Interaction Point: Confirm understanding of the skill requirements with the user before proceeding to Phase 2. Present a brief summary:

code
Skill: {skill-name}
Pain Point: ...
User & Context: ...
Expected Output: ...
Reference Docs: ...

Wait for user confirmation. Do NOT proceed without it.

After user confirms → Write §1 Problem Statement and §10 Metadata into .skill-context/{skill-name}/design.md immediately. This persists the confirmed requirements so they survive context loss.

Phase 2: Analyze (Phan tich)

Apply the architecture framework to the collected requirements.

  1. Read knowledge/architect.md.
  2. Apply the 3 Pillars:
    • Pillar 1 — Knowledge: What knowledge does the new skill need? (standards, best practices, design patterns, domain rules)
    • Pillar 2 — Process: What is the workflow logic? (phases, steps, decision points, interaction points)
    • Pillar 3 — Guardrails: What controls are needed? (checklists, verification rules, rollback mechanisms)
  3. Map requirements into 7 Zones:| Zone | Question to Answer | | --------------- | -------------------------------- | | Core (SKILL.md) | What persona, phases, and rules? | | Knowledge | What reference documents? | | Scripts | Any automation needed? | | Templates | What output formats? | | Data | Any static config? | | Loop | What verification checklists? | | Assets | Any media or static resources? |
  4. Identify AI blind spots: Where might the AI go wrong with this type of work?
  5. Identify tools needed: Terminal, Browser, File system, etc.

Interaction Point: Present the full analysis to the user:

  • 3 Pillars breakdown
  • 7 Zones mapping table
  • Identified blind spots
  • Recommended tools

Wait for user confirmation. Do NOT proceed without it.

After user confirms → Write §2 Capability Map, §3 Zone Mapping, and §8 Risks & Blind Spots into .skill-context/{skill-name}/design.md immediately. This persists the confirmed analysis.

Phase 3: Design & Output (Thiet ke)

Create the architecture design document.

⚠️ DIAGRAMS FIRST, TABLES SECOND: Draw diagrams BEFORE writing analysis tables. Diagrams are the PRIMARY output of this phase — tables supplement them. Refer to the Visualization Guidelines section below for specific diagram types and Mermaid syntax patterns.

  1. Draw Skill Relationship diagram — how this skill connects to external systems, other skills, or user workflows (Mermaid Flowchart).
  2. Draw Folder Structure diagram — the complete directory tree of the skill package with zone annotations (Mermaid Mindmap).
  3. Draw Execution Flow diagram — the step-by-step runtime flow showing participants, data flow, and decision points (Mermaid Sequence).
  4. Draw Workflow Phases diagram — high-level phase progression with interaction points marked (Mermaid Flowchart).
  5. Create Capability Map with clear responsibilities (table format OK).
  6. Define Interaction Points — when must the AI ask the user?
  7. Define Progressive Disclosure Plan — what loads at Tier 1 vs Tier 2?
  8. Identify Risks & Blind Spots.
  9. List Open Questions (if any).
  10. Write §4, §5, §6, §7, §9 into .skill-context/{skill-name}/design.md. (§1, §2, §3, §8, §10 were already written in Phase 1 and Phase 2.)

Output Gate: Present the complete design to the user for final confirmation. After user approves → update §10 Metadata status to 🟢 COMPLETE.

Output Format

The design.md file MUST contain exactly these 10 sections:

code
## 1. Problem Statement
## 2. Capability Map              ← Tables + optional diagram
### 2.1 Tri thuc (Knowledge)
### 2.2 Quy trinh (Process)       ← SHOULD include Workflow Phases diagram
### 2.3 Kiem soat (Guardrails)
## 3. Zone Mapping                ← Table + optional Relationship diagram
## 4. Folder Structure            ← Mermaid Mindmap (REQUIRED)
## 5. Execution Flow              ← Mermaid Sequence (REQUIRED)
## 6. Interaction Points
## 7. Progressive Disclosure Plan
## 8. Risks & Blind Spots
## 9. Open Questions
## 10. Metadata

Minimum 3 Mermaid diagrams are REQUIRED:

  • §4 Folder Structure (Mindmap) — MUST
  • §5 Execution Flow (Sequence) — MUST
  • §2.2 OR §3: Workflow Phases OR Relationship diagram — at least 1 more

Additional diagrams are encouraged wherever they add clarity.

Visualization Guidelines

Diagrams make the design concrete and unambiguous. Tables alone leave room for interpretation. Follow these guidelines when creating diagrams.

Principle: "Show, then explain"

For each major concept, FIRST draw a diagram, THEN add a table or text that explains details the diagram cannot convey. Never replace a diagram with a table.

Diagram Types & When to Use

#Diagram TypeMermaid SyntaxUse When
D1Folder StructuremindmapALWAYS — show the skill's directory tree
D2Execution FlowsequenceDiagramALWAYS — show runtime interaction between participants
D3Workflow Phasesflowchart LRSkill has multi-phase workflow with clear stages
D4Relationshipflowchart TDSkill connects to external systems or other skills
D5Data Flowflowchart LRSkill transforms data through multiple stages

Mermaid Skeletons

Use these as starting points. Adapt to the specific skill being designed.

D1 — Folder Structure (Mindmap):

mermaid
mindmap
  root((skill-name))
    SKILL.md
      Persona
      Phases
      Guardrails
    knowledge
      domain-ref.md
    scripts
      tool.py
    templates
      output.md.template
    loop
      checklist.md

D2 — Execution Flow (Sequence):

mermaid
sequenceDiagram
    participant U as User
    participant S as Skill
    participant K as Knowledge
    participant L as Loop

    U->>S: Input
    S->>K: Read references
    S->>S: Process
    S->>L: Self-verify
    alt Pass
        S->>U: Output
    else Fail
        L-->>S: Retry
    end

D3 — Workflow Phases (Flowchart):

mermaid
flowchart LR
    P1[Phase 1] -->|gate| P2[Phase 2] -->|gate| P3[Phase 3]
    P1 -.-> I1[Interaction Point]
    P2 -.-> I2[Interaction Point]
    P3 -.-> I3[Output Gate]

D4 — Relationship (Flowchart):

mermaid
flowchart TD
    User -->|input| SkillA
    SkillA -->|output| ContextDir
    ContextDir -->|input| SkillB
    SkillB -->|output| FinalProduct

Quality Checklist for Diagrams

  • Each diagram has a clear title or is placed under a descriptive heading
  • Participants/nodes use short, readable labels
  • Decision points (alt/else, diamond nodes) are visible where logic branches
  • Interaction points with user are explicitly marked
  • Diagram renders correctly in standard Mermaid (no unsupported syntax)

Guardrails

#RuleDescription
G1No codeThis skill ONLY designs. Do NOT write implementation code.
G2No guessingAsk user when information is missing. Max 3 short questions.
G3Diagrams requiredOutput MUST contain at least 3 Mermaid diagrams (§4, §5, and 1 more). Diagrams FIRST, tables SECOND. See Visualization Guidelines.
G4Gate checksEach phase MUST end with an interaction point.
G5Framework-basedAll designs MUST map back to 3 Pillars + 7 Zones from architect.md.
G6Init firstMUST run init_context.py before writing output files.
G7Confirm before saveMUST get user confirmation before finalizing design.md.
G8Write after confirmAfter EACH phase is confirmed, IMMEDIATELY write results to design.md. Do NOT keep results only in conversation. See Progressive Writing Rule.

Error Handling

  • If user asks to write code → Decline. Suggest using skill-builder instead.
  • If confidence < 70% → Stop and ask clarifying questions (max 3).
  • If init_context.py fails → Report error, do not proceed until resolved.
  • If knowledge/architect.md is missing → Report error, cannot operate.

Related Skills

  • Skill Planner (skill-planner): Reads design.md, creates todo.md with step-by-step plan.
  • Skill Builder (skill-builder): Reads design.md + todo.md, implements the skill.

Context Directory

All output goes to .skill-context/{skill-name}/ at project root:

code
.skill-context/{skill-name}/
├── design.md       ← THIS SKILL writes here
├── todo.md         ← Skill Planner writes here
├── build-log.md    ← Skill Builder writes here
└── resources/      ← User-provided reference documents