AgentSkillsCN

unified-process

指导 AI 代理遵循统一过程方法论。适用于以下场景:(1) 创建或审查 UP 文档(愿景、需求、用例、实体模型、架构、验收测试、补充规范);(2) 在新项目中搭建 UP 文档结构;(3) 当文档内容发生变更时,运用级联原则;(4) 核验文档边界(需求 vs 用例 vs 架构)。触发关键词:“UP”、“统一过程”、“AIUP”、“撰写愿景”、“撰写需求”、“审查用例”、“级联变更”、“文档层级”。

SKILL.md
--- frontmatter
name: unified-process
description: >
  Guide for following the Unified Process methodology with AI agents. Use when:
  (1) Creating or reviewing UP artefacts (vision, requirements, use cases, entity model, architecture, acceptance tests, supplementary specs),
  (2) Setting up UP document structure in a new project,
  (3) Applying the cascade principle when documents change,
  (4) Validating document boundaries (requirements vs use cases vs architecture).
  Trigger on: "UP", "unified process", "AIUP", "write vision", "write requirements", "review use case", "cascade change", "document hierarchy".

Unified Process

Specifications-driven development where specs drive code, not the reverse.

Core Principles

  1. Traceability via identifiers: G-001 (goals) → REQ-001 (requirements) → UC-001 (use cases) → TC-001 (tests)
  2. Cascade principle: Changes flow downward only. Changing a goal may affect everything; changing a test affects only code.
  3. Appropriate abstraction: Each document type has a specific level. Don't mix concerns.
  4. Requirements describe needs, not solutions: "Data must persist durably" (need) vs "Use PostgreSQL" (solution)
  5. Specs drive code, not reverse (AIUP): When reality diverges from specs, update specs first. Code is regenerable.
  6. Iterative refinement: Specifications, code, and tests improve together through short cycles. Perfect specs are impossible—iterate.

Document Hierarchy

code
Vision (G-001, G-002...)           ← WHY are we building this?
    ↓
Requirements (REQ-001, NFR-001...)  ← WHAT must the system do?
    ↓
Use Cases (UC-001, UC-002...)       ← HOW do actors achieve goals?
    ↓
Entity Model + Architecture         ← WHAT concepts exist? HOW is it structured?
    ↓
Acceptance Tests (TC-001...)        ← HOW do we verify it works?
    ↓
Code

Workflows

Creating a new artefact

  1. Identify the artefact type needed
  2. Read the catalogue definition: references/<artefact>.md
  3. Use the template from assets/templates/ if available
  4. Write the document following "Should contain" guidance
  5. Validate against the checklist in the catalogue
  6. Verify traceability (IDs link upstream)

Reviewing an artefact

  1. Read the catalogue definition for that artefact type
  2. Check against "Should NOT contain" list — common mistakes
  3. Verify examples match "Good" patterns, not "Bad"
  4. Confirm appropriate abstraction level
  5. Validate traceability chain

When a document changes (cascade)

  1. Identify what changed and its identifier (e.g., REQ-001)
  2. Search codebase for that identifier
  3. Create tickets for each affected downstream artefact:
    • Requirements change → update use cases, tests, code
    • Use case change → update tests, code
    • Test change → update code only
  4. Changes do NOT ripple upward

Setting up UP in a new project

  1. Create docs/unified-process/ directory
  2. Copy templates from assets/templates/ as starting points
  3. Decide which artefacts to use (see "Minimum Viable Process" below)
  4. Link UP work to issue tracker using identifiers

Minimum Viable Process

For simple projects, you may only need:

  • Vision (one paragraph + goals)
  • Requirements (bullet list with IDs)
  • Acceptance Tests (how you know it works)

Add more artefacts as complexity grows. See references/artefact-index.md for the complete catalogue of all possible UP artefacts and when to use each.

When to Suggest Additional Artefacts

Suggest a Business Case when: Justifying budget, competing for resources, need ROI tracking.

Suggest a Stakeholder Map when: Multiple groups with conflicting interests, political complexity.

Suggest a Risk Register when: Significant unknowns, high-stakes project, need to communicate risks.

Suggest a Glossary when: Team uses terms inconsistently, domain is unfamiliar.

Suggest ADRs when: Team turnover, long-lived system, need to explain "why we did it this way."

Suggest API Specification when: Building APIs for consumers, contract-first development.

Suggest Deployment Runbook when: Complex deployment, ops team different from dev team.

For the full decision guide, consult references/artefact-index.md.

Artefact Quick Reference

ArtefactPurposeKey Rule
VisionWhy + what success looks likeGoals are measurable outcomes, not features
RequirementsWhat the system must doNeeds, not solutions. No tech names.
Use CasesHow actors achieve goalsGoal-oriented, not function-oriented. No UI details.
Entity ModelCore business conceptsNOT a database schema. No PKs, no SQL types.
ArchitectureSystem structure + decisionsComponents + rationale. No code.
Acceptance TestsVerify requirements metBusiness language. Observable behaviour only.
Supplementary SpecsNFRs + cross-cutting concernsMeasurable. FURPS+ categories.

For detailed guidance on any artefact, read references/<artefact>.md.

Common Boundary Violations

Requirements becoming use cases: If you're writing interaction steps, it's a use case.

Use cases becoming UI specs: "User clicks blue button" → wrong. "User initiates checkout" → correct.

Entity model becoming database schema: Primary keys, foreign keys, SQL types → wrong. Business concepts → correct.

Architecture including code: Function definitions → wrong. Component responsibilities → correct.

Requirements prescribing solutions: Technology names in requirements → move to architecture.

Identifier Conventions

PrefixDocument
G-Vision / Goals
REQ-Functional Requirements
NFR-Non-Functional Requirements
UC-Use Cases
TC-Test Cases
ADR-Architecture Decision Records

Consistency matters more than convention—use what fits your project.