ai-sdlc-architecture

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ai-sdlc-architecture: Traceable System Design

ai-sdlc-architecture:可追溯的系统设计

Optional domain skill, not required by the core module. Every rule below is important to follow. None of it can be skipped. Architecture artifacts support SDD; they do not replace requirements or ADR authority.
可选领域技能,核心模块无需依赖此技能。 以下每条规则都必须遵守,无一例外。 架构工件支持SDD,但不会替代需求或ADR的权威性。

0. Skill Card

0. 技能卡片

  • Skill name:
    ai-sdlc-architecture
  • Primary audience: Architecture, Dev
  • Supporting audience: QA, Security, Delivery, BA
  • Audience tags: Architecture, Dev, QA, Security
  • SDLC stage: Design and implementation planning
  • Purpose: Preserve traceable architecture boundaries, decisions, and risks.
  • Output:
    architecture.md
    and
    _ai_sdlc/architecture.toon
  • 技能名称:
    ai-sdlc-architecture
  • 主要受众:架构师、开发人员(Dev)
  • 支持受众:QA、安全、交付、业务分析师(BA)
  • 受众标签:Architecture、Dev、QA、Security
  • SDLC阶段:设计与实施规划
  • 目的:保留可追溯的架构边界、决策及风险。
  • 输出:
    architecture.md
    _ai_sdlc/architecture.toon

0.1 Required Inputs

0.1 必需输入

  • Implementation feature root.
  • Architecture input using
    ai-sdlc-architecture-input/v1
    .
  • Requirement, acceptance, risk, or decision trace targets.
  • 实现功能的根目录。
  • 使用
    ai-sdlc-architecture-input/v1
    格式的架构输入。
  • 需求、验收标准、风险或决策的追溯目标。

0.2 Clarification Rules

0.2 澄清规则

  • Ask when system boundary, quality attribute, authority, or irreversible choice is ambiguous.
  • Separate constraints from decisions and decisions from implementation tasks.
  • Record alternatives and consequences for every material decision.
  • Do not invent infrastructure, data classification, or production topology.
  • 当系统边界、质量属性、权限或不可逆选择存在歧义时,需主动询问。
  • 将约束与决策分离,决策与实施任务分离。
  • 为每个重要决策记录备选方案及后果。
  • 不得自行虚构基础设施、数据分类或生产拓扑结构。

0.2.1 Flow Mode Flags

0.2.1 流程模式标识

  • Support
    --quick-flow
    and
    --full-flow
    ; full flow takes precedence.
  • Quick flow permits a bounded architecture slice with explicit gaps.
  • Full flow requires at least one decision, risk, and validation check.
  • Both modes require trace targets for constraints, interfaces, decisions, and risks.
  • 支持
    --quick-flow
    --full-flow
    模式;全流程模式优先级更高。
  • 快速流程允许生成有明确缺口的限定性架构切片。
  • 全流程要求至少包含一项决策、风险及验证检查。
  • 两种模式均需为约束、接口、决策及风险设置追溯目标。

0.3 Output Rules

0.3 输出规则

  • Return design scope, decision/risk counts, blockers, validation status, and output paths directly in the Codex response.
  • Before the final response, emit
    ai-sdlc-handoff/v1
    with
    result
    ,
    blockers
    ,
    next_required
    , and
    next_optional
    ; every action includes
    reason
    ,
    command
    , and
    expected_artifact
    .
  • Do not create
    summary.txt
    ,
    *-summary.txt
    , or untraced diagrams.
  • Keep Markdown authoritative for detail and TOON bounded for routing.
  • 在Codex响应中直接返回设计范围、决策/风险数量、阻塞项、验证状态及输出路径。
  • 在最终响应之前,发送包含
    result
    blockers
    next_required
    next_optional
    ai-sdlc-handoff/v1
    ;每个操作需包含
    reason
    command
    expected_artifact
  • 不得创建
    summary.txt
    *-summary.txt
    或无追溯关系的图表。
  • 详细内容以Markdown为权威依据,TOON格式仅用于流转。

0.4 Artifact Routing

0.4 工件流转

  • Write
    <feature-root>/architecture.md
    .
  • Write
    <feature-root>/_ai_sdlc/architecture.toon
    .
  • Keep ADRs or decision-log entries separate when organizational authority requires them; link their IDs from architecture decisions.
  • Do not write into refinement unless architecture work is explicitly upstream.
  • 写入
    <feature-root>/architecture.md
  • 写入
    <feature-root>/_ai_sdlc/architecture.toon
  • 当组织权限要求时,需将ADR或决策日志条目单独存放;从架构决策中关联其ID。
  • 除非架构工作明确处于上游环节,否则不得写入细化阶段的内容。

0.5 Feature State Machine

0.5 功能状态机

  • Read
    <feature-root>/_ai_sdlc/state.toon
    before architecture work.
  • Architecture is an optional design utility and does not add a core lifecycle stage.
  • --state-check
    is read-only;
    --begin-state
    and
    --complete-state
    are rejected.
  • Route accepted design changes back through SDD and change-impact recovery.
  • 在开展架构工作前,读取
    <feature-root>/_ai_sdlc/state.toon
  • 架构是可选的设计工具,不会添加核心生命周期阶段。
  • --state-check
    为只读模式;拒绝
    --begin-state
    --complete-state
    指令。
  • 已接受的设计变更需通过SDD及变更影响恢复流程流转。

0.6 Artifact Metadata And Metatags

0.6 工件元数据与元标签

  • Markdown starts with
    artifact_metadata
    using schema
    ai-sdlc-architecture-metadata/v1
    .
  • Include
    metatags
    for
    ai-sdlc
    ,
    architecture
    ,
    design
    , and
    traceable
    .
  • Record feature, workspace, flow mode, state file, trace IDs, and status.
  • Markdown需以使用
    ai-sdlc-architecture-metadata/v1
    schema的
    artifact_metadata
    开头。
  • 包含
    ai-sdlc
    architecture
    design
    traceable
    的元标签。
  • 记录功能、工作区、流程模式、状态文件、追溯ID及状态。

0.7 Specs Index

0.7 规范索引

  • Read
    specs/_ai_sdlc/specs-index.toon
    and feature state before broad reads.
  • Refresh
    specs/specs-index.md
    only after a durable architecture write.
  • Do not alter
    specs-refiniment/_ai_sdlc/specs-index.toon
    or
    specs-refiniment/specs-index.md
    for implementation-owned architecture.
  • 在进行大范围读取前,先读取
    specs/_ai_sdlc/specs-index.toon
    及功能状态。
  • 仅在完成持久化架构写入后,更新
    specs/specs-index.md
  • 对于归属于实施环节的架构内容,不得修改
    specs-refiniment/_ai_sdlc/specs-index.toon
    specs-refiniment/specs-index.md

References

参考资料

  • Read
    references/architecture-contract.md
    for the input schema and design gates.
  • Use
    scripts/architecture.py
    to validate and route canonical outputs.
  • 读取
    references/architecture-contract.md
    获取输入schema及设计关卡要求。
  • 使用
    scripts/architecture.py
    验证并流转标准输出。

Script Usage

脚本使用

bash
python3 skills/ai-sdlc-architecture/scripts/architecture.py specs/payments --input /tmp/architecture.json --emit --quick-flow
python3 skills/ai-sdlc-architecture/scripts/architecture.py specs/payments --input /tmp/architecture.json --write --full-flow --format toon
bash
python3 skills/ai-sdlc-architecture/scripts/architecture.py specs/payments --input /tmp/architecture.json --emit --quick-flow
python3 skills/ai-sdlc-architecture/scripts/architecture.py specs/payments --input /tmp/architecture.json --write --full-flow --format toon

Purpose

目标

Add architecture depth when a feature needs it without making architecture ceremony or the optional module a dependency of every core workflow.
在功能需要时增加架构深度,同时避免将架构流程或可选模块作为每个核心工作流的依赖。

Inputs

输入要求

  • Capture design context and constraints before components.
  • Trace interfaces and decisions to durable requirement or decision IDs.
  • Give risks an owner and mitigation.
  • Provide executable or inspectable validation evidence.
  • 在定义组件前,先捕获设计上下文及约束。
  • 将接口和决策追溯至持久化的需求或决策ID。
  • 为风险指定负责人及缓解措施。
  • 提供可执行或可检查的验证证据。

Steps

步骤

  1. Read requirements, decisions, project context, state, and relevant quality findings.
  2. Define boundaries, constraints, components, and interfaces.
  3. Compare alternatives and record decisions plus consequences.
  4. Identify architecture risks, owners, and mitigations.
  5. Define validation checks for the design claims.
  6. Finalize canonical outputs with the deterministic script.
  7. Route implementation changes through SDD tasks and validation.
  1. 读取需求、决策、项目上下文、状态及相关质量检查结果。
  2. 定义边界、约束、组件及接口。
  3. 对比备选方案,记录决策及后果。
  4. 识别架构风险、负责人及缓解措施。
  5. 为设计声明定义验证检查项。
  6. 通过确定性脚本生成标准输出。
  7. 通过SDD任务及验证流程流转实施变更。

Output Spec

输出规范

ai-sdlc-architecture/v1
contains context, constraints, components, interfaces, decisions, risks, and validation checks with trace targets and owners.
Quality gate:
  • Pass when boundaries are explicit and every material claim has traceability.
  • Full flow fails without decisions, risks, validation, alternatives, consequences, risk ownership, or mitigation.
ai-sdlc-architecture/v1
包含上下文、约束、组件、接口、决策、风险及验证检查,且带有追溯目标及负责人。
质量关卡:
  • 当边界明确且每个重要声明都具备可追溯性时,判定为通过。
  • 若缺少决策、风险、验证、备选方案、后果、风险负责人或缓解措施,全流程模式判定为失败。

Examples

示例

A valid decision records
DEC-021
, its requirement traces, selected option, rationale, alternatives, and operational consequences. “Use microservices because they scale” is invalid without evidence, boundary, alternatives, or tradeoff.
有效的决策需记录
DEC-021
、其需求追溯信息、选定方案、理由、备选方案及运营后果。仅“使用微服务因为它们可扩展”的表述无效,因为缺少证据、边界、备选方案或权衡分析。

Edge Cases

边缘情况

  • A local reversible patch may use quick flow and record no new decision.
  • External systems remain components with explicit unverified interface assumptions.
  • Existing ADRs are referenced, not duplicated.
  • Diagram generation is optional; structured contracts remain authoritative.
  • 本地可逆补丁可使用快速流程,且无需记录新决策。
  • 外部系统仍作为组件处理,需明确记录未验证的接口假设。
  • 仅引用现有ADR,不得重复创建。
  • 图表生成为可选操作;结构化契约仍为权威依据。

Scope Boundary

范围边界

  • Do not approve architecture on behalf of owners.
  • Do not provision infrastructure or change production systems.
  • Do not replace SDD requirements, tests, tasks, or decisions.
  • Do not hide unresolved architecture risks.
  • Use
    $ai-sdlc-change-impact
    when an accepted design changes downstream work.
  • 不得代表架构所有者批准架构方案。
  • 不得配置基础设施或修改生产系统。
  • 不得替代SDD的需求、测试、任务或决策。
  • 不得隐瞒未解决的架构风险。
  • 当已接受的设计变更影响下游工作时,需使用
    $ai-sdlc-change-impact