ai-sdlc-change-set

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ai-sdlc-change-set: Isolated Change Workspace

ai-sdlc-change-set:隔离式变更工作区

Internal AI SDLC skill, not client-facing by default. Every rule below is important to follow. None of it can be skipped. A change workspace proposes intent; it never becomes canonical truth by itself.
内部AI SDLC技能,默认不面向客户。 以下每条规则都必须遵守,不可跳过任何一条。 变更工作区仅用于提出意向,本身不会成为规范事实。

0. Skill Card

0. 技能卡片

  • Skill name:
    ai-sdlc-change-set
  • Primary audience: Delivery, Dev, BA
  • Supporting audience: PM, QA, Architecture, Security
  • Audience tags: Delivery, Dev, BA, PM, QA
  • SDLC stage: Controlled change intake
  • Purpose: Create and validate an isolated, reviewable workspace before any authoritative specification mutation.
  • Output:
    changes/<change-id>/
    with proposal, design, tasks, delta and evidence indexes, lifecycle records, preview, approval, and recovery evidence
  • 技能名称:
    ai-sdlc-change-set
  • 核心受众:Delivery、Dev、BA
  • 支持受众:PM、QA、架构师、安全团队
  • 受众标签:Delivery、Dev、BA、PM、QA
  • SDLC阶段:受控变更接收
  • 用途:在对权威规范进行任何修改前,创建并验证一个可评审的隔离工作区。
  • 输出:
    changes/<change-id>/
    目录,包含提案、设计、任务、增量与证据索引、生命周期记录、预览、审批及恢复证据

0.1 Required Inputs

0.1 必填输入

  • Repository root and a lowercase hyphenated change ID.
  • Change title, summary, owner, and one or more repository-relative canonical target paths.
  • Quick or full flow selection when organization policy requires it.
  • 仓库根目录及小写连字符格式的变更ID(change ID)。
  • 变更标题、摘要、所有者,以及一个或多个相对于仓库的规范目标路径。
  • 当组织政策要求时,选择快速流程(quick flow)或完整流程(full flow)。

0.2 Clarification Rules

0.2 澄清规则

  • Ask when the owner, target authority, or intended outcome is ambiguous.
  • Reject absolute paths, parent traversal, targets inside
    changes/
    , and duplicate targets instead of normalizing them silently.
  • Treat generated workspace content as a proposal until a later controlled apply workflow proves approval and conflict freedom.
  • 当所有者、目标权限或预期结果不明确时,主动询问。
  • 拒绝绝对路径、父目录遍历、
    changes/
    目录内的目标及重复目标,而非静默处理。
  • 在后续受控应用工作流确认审批通过且无冲突前,将生成的工作区内容视为提案。

0.2.1 Flow Mode Flags

0.2.1 流程模式标志

  • Support
    --quick-flow
    and
    --full-flow
    ; full flow takes precedence.
  • Quick flow may create a draft from confirmed repository context and visible assumptions.
  • Full flow requires explicit owner, summary, and canonical targets.
  • Neither flow reads, writes, renames, or deletes canonical targets.
  • 支持
    --quick-flow
    --full-flow
    ;完整流程优先级更高。
  • 快速流程可基于已确认的仓库上下文和明确假设生成草稿。
  • 完整流程需要明确的所有者、摘要和规范目标。
  • 两种流程均不会读取、写入、重命名或删除规范目标。

0.3 Output Rules

0.3 输出规则

  • Report the change ID, workspace path, status, owner, targets, fingerprint, validation result, and next required action.
  • Before the final response, emit an
    ai-sdlc-handoff/v1
    result that routes a structurally valid workspace to delta authoring and validation. Include
    next_required
    and
    next_optional
    actions with reasons, commands, and expected artifacts.
  • Return progress, validation, and handoff summaries directly in the Codex response.
  • Do not create
    summary.txt
    ,
    *-summary.txt
    , or another standalone summary file.
  • Do not create ad hoc summaries outside the canonical workspace files.
  • 报告变更ID、工作区路径、状态、所有者、目标、指纹、验证结果及下一步必填操作。
  • 在最终响应前,输出
    ai-sdlc-handoff/v1
    结果,将结构有效的工作区路由至增量编写与验证环节。包含
    next_required
    next_optional
    操作,附带原因、命令及预期产物。
  • 在Codex响应中直接返回进度、验证及交接摘要。
  • 不得创建
    summary.txt
    *-summary.txt
    或其他独立摘要文件。
  • 不得在规范工作区文件外创建临时摘要。

0.4 Artifact Routing

0.4 产物路由

  • Route every change to
    <repository>/changes/<change-id>/
    .
  • Keep human intent in
    proposal.md
    ,
    design.md
    ,
    tasks.md
    ,
    deltas/index.md
    , and
    evidence/index.md
    .
  • Keep complete agent-facing TOON beside interoperable JSON for the change set, delta set, apply preview, approval, and recovery records.
  • Never store a change workspace inside
    specs/
    ,
    specs-refiniment/
    , or a canonical target directory.
  • 将所有变更路由至
    <repository>/changes/<change-id>/
    目录。
  • 将人工意向存储在
    proposal.md
    design.md
    tasks.md
    deltas/index.md
    evidence/index.md
    中。
  • 为变更集、增量集、应用预览、审批及恢复记录保留完整的Agent可读TOON格式,同时提供可互操作的JSON格式。
  • 不得将变更工作区存储在
    specs/
    specs-refiniment/
    或规范目标目录内。

0.5 Feature State Machine

0.5 特性状态机

  • Change status begins as
    draft
    in the change-set record.
  • T002 creates only the intake state; later delta, preview, apply, and archive tasks own their state transitions.
  • Read the owning feature
    _ai_sdlc/state.toon
    when targets belong to an existing feature, but do not modify feature
    state.toon
    during intake.
  • 变更状态在变更集记录中初始为
    draft
    (草稿)。
  • T002仅创建接收状态;后续的增量、预览、应用及归档任务负责状态转换。
  • 当目标属于现有特性时,读取所属特性的
    _ai_sdlc/state.toon
    ,但在接收阶段不得修改该特性的
    state.toon

0.6 Artifact Metadata And Metatags

0.6 产物元数据与元标签

  • Generated Markdown starts with
    artifact_metadata
    frontmatter using
    ai-sdlc-change-set-metadata/v1
    .
  • Include change ID, artifact, status, owner, created and updated dates, canonical targets, and
    metatags
    for
    ai-sdlc
    ,
    change-set
    ,
    proposal
    , and
    draft
    .
  • The JSON record uses schema
    ai-sdlc-change-set/v1
    and a deterministic contract fingerprint.
  • 生成的Markdown文件以
    artifact_metadata
    前置内容开头,使用
    ai-sdlc-change-set-metadata/v1
    格式。
  • 包含变更ID、产物类型、状态、所有者、创建及更新日期、规范目标,以及
    ai-sdlc
    change-set
    proposal
    draft
    的元标签。
  • JSON记录使用
    ai-sdlc-change-set/v1
    schema及确定性合约指纹。

0.7 Specs Index

0.7 规范索引

  • Read
    _ai_sdlc/specs-index.toon
    first and use
    specs-index.md
    for human feature discovery when canonical targets belong to existing specs.
  • A draft change workspace is not a feature spec and does not refresh either specs index.
  • The later apply workflow refreshes indexes only after an approved canonical artifact change.
  • 当规范目标属于现有规范时,优先读取
    _ai_sdlc/specs-index.toon
    ,并使用
    specs-index.md
    进行人工特性发现。
  • 草稿变更工作区不属于特性规范,不会刷新任何规范索引。
  • 仅在规范产物变更获得批准后,后续的应用工作区才会刷新索引。

References

参考资料

  • Read
    references/change-set-contract.md
    before creating or reviewing a workspace.
  • Use
    references/change-set.schema.json
    for the versioned machine contract.
  • Use
    scripts/change_set.py
    for deterministic emit, create, and validation.
  • Read
    references/spec-delta-contract.md
    before authoring or reviewing delta Markdown and use
    references/spec-delta.schema.json
    for its projection.
  • Use
    scripts/spec_delta.py
    to validate and project semantic deltas.
  • Read
    references/apply-preview-contract.md
    before reviewing planned target changes and use
    references/change-preview.schema.json
    for the projection.
  • Use
    scripts/change_preview.py
    to compile diffs, conflicts, stale evidence, reopen actions, and required gates without target writes.
  • Read
    references/controlled-apply-contract.md
    before applying or archiving.
  • Validate approval with
    references/change-approval.schema.json
    and recovery evidence with
    references/change-recovery.schema.json
    .
  • Use
    scripts/change_apply.py
    only after a ready preview and explicit approval.
  • 在创建或评审工作区前,阅读
    references/change-set-contract.md
  • 使用
    references/change-set.schema.json
    作为版本化机器合约。
  • 使用
    scripts/change_set.py
    进行确定性输出、创建及验证。
  • 在编写或评审增量Markdown前,阅读
    references/spec-delta-contract.md
    ,并使用
    references/spec-delta.schema.json
    进行映射。
  • 使用
    scripts/spec_delta.py
    验证并映射语义增量。
  • 在评审计划目标变更前,阅读
    references/apply-preview-contract.md
    ,并使用
    references/change-preview.schema.json
    进行映射。
  • 使用
    scripts/change_preview.py
    编译差异、冲突、过期证据、重开操作及必填校验门,且不会写入目标内容。
  • 在应用或归档前,阅读
    references/controlled-apply-contract.md
  • 使用
    references/change-approval.schema.json
    验证审批,使用
    references/change-recovery.schema.json
    验证恢复证据。
  • 仅在预览就绪且获得明确审批后,使用
    scripts/change_apply.py

Script Usage

脚本用法

bash
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --title "Add session timeout" --summary "Expire inactive sessions." --owner Security --target specs/auth/requirements.md --emit --quick-flow
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --title "Add session timeout" --summary "Expire inactive sessions." --owner Security --target specs/auth/requirements.md --create --full-flow
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --validate --format toon
python3 skills/ai-sdlc-change-set/scripts/spec_delta.py . --change-id add-session-timeout --validate --write --format toon
python3 skills/ai-sdlc-change-set/scripts/change_preview.py . --change-id add-session-timeout --preview --write --format toon
python3 skills/ai-sdlc-change-set/scripts/change_apply.py . --change-id add-session-timeout --apply --approval changes/add-session-timeout/evidence/owner-approval.json --format toon
python3 skills/ai-sdlc-change-set/scripts/change_apply.py . --change-id add-session-timeout --archive --format toon
--emit
renders the planned record without writes.
--create
builds the workspace atomically and fails if it already exists.
--validate
verifies the existing workspace and fingerprint.
bash
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --title "Add session timeout" --summary "Expire inactive sessions." --owner Security --target specs/auth/requirements.md --emit --quick-flow
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --title "Add session timeout" --summary "Expire inactive sessions." --owner Security --target specs/auth/requirements.md --create --full-flow
python3 skills/ai-sdlc-change-set/scripts/change_set.py . --change-id add-session-timeout --validate --format toon
python3 skills/ai-sdlc-change-set/scripts/spec_delta.py . --change-id add-session-timeout --validate --write --format toon
python3 skills/ai-sdlc-change-set/scripts/change_preview.py . --change-id add-session-timeout --preview --write --format toon
python3 skills/ai-sdlc-change-set/scripts/change_apply.py . --change-id add-session-timeout --apply --approval changes/add-session-timeout/evidence/owner-approval.json --format toon
python3 skills/ai-sdlc-change-set/scripts/change_apply.py . --change-id add-session-timeout --archive --format toon
--emit
仅渲染计划记录,不执行写入操作。
--create
原子化构建工作区,若工作区已存在则执行失败。
--validate
验证现有工作区及指纹。

Purpose

目的

Separate proposed change intent from current system truth so humans and AI can review scope, ownership, targets, tasks, deltas, and evidence before any canonical mutation is possible.
将提议的变更意向与当前系统事实分离,以便人工和AI在可能发生规范修改前,评审变更范围、所有权、目标、任务、增量及证据。

Inputs

输入要求

  • Use a stable change ID that describes one bounded outcome.
  • Use repository-relative POSIX paths for canonical targets.
  • Use an accountable role or person as owner.
  • Keep summary factual and state uncertainty in the proposal after creation.
  • 使用能描述单一有限成果的稳定变更ID。
  • 规范目标使用相对于仓库的POSIX路径。
  • 指定可问责的角色或人员作为所有者。
  • 摘要需基于事实,创建后在提案中记录不确定性内容。

Steps

步骤

  1. Inspect canonical sources read-only and identify their authority owners.
  2. Run
    --emit
    to review the planned workspace and fingerprint.
  3. Resolve unsafe IDs, paths, duplicate targets, or missing ownership.
  4. Run
    --create
    ; confirm canonical target bytes did not change.
  5. Edit proposal sections through normal reviewed repository changes.
  6. Run
    --validate
    before authoring semantic deltas.
  7. Author delta Markdown with stable requirement IDs and operation-specific evidence, then run
    spec_delta.py --validate
    .
  8. Compile preview and resolve every conflict, stale reference, reopen action, and required gate.
  9. Obtain explicit approval tied to the current preview fingerprint and every required gate.
  10. Apply through
    change_apply.py
    , inspect the completed recovery manifest, then archive the evidence-preserving workspace.
  1. 只读检查规范源,确定其权限所有者。
  2. 运行
    --emit
    评审计划的工作区及指纹。
  3. 解决不安全的ID、路径、重复目标或缺失所有权的问题。
  4. 运行
    --create
    ;确认规范目标内容未发生变化。
  5. 通过常规仓库评审修改提案章节。
  6. 在编写语义增量前运行
    --validate
  7. 编写带有稳定需求ID及特定操作证据的增量Markdown,然后运行
    spec_delta.py --validate
  8. 编译预览并解决所有冲突、过期引用、重开操作及必填校验门。
  9. 获取与当前预览指纹及所有必填校验门绑定的明确审批。
  10. 通过
    change_apply.py
    执行应用,检查已完成的恢复清单,然后归档保留证据的工作区。

Output Spec

输出规范

The
ai-sdlc-change-set/v1
record is written as complete TOON plus JSON and contains
change_id
,
title
,
summary
,
status
,
owner
,
flow_mode
, dates, canonical targets, workspace artifact paths, authority rules, and
contract_fingerprint
.
The
ai-sdlc-spec-delta/v1
TOON/JSON pair contains normalized operations, target and source evidence, exact source hashes, and a deterministic fingerprint.
The
ai-sdlc-change-preview/v1
TOON/JSON pair contains virtual target hashes and diffs, conservative conflicts, stale references, reopen actions, gates, and a fingerprint that becomes invalid when any input drifts.
The JSON schemas
ai-sdlc-change-approval/v1
and
ai-sdlc-change-recovery/v1
bind accountable approval to the current preview and preserve transaction, backup, apply, and rollback evidence.
Quality gate:
  • Pass when the workspace has every required artifact, the JSON record matches the schema, paths are safe and unique, headings and metadata are complete, and the fingerprint recomputes exactly.
  • Fail when creation would overwrite a workspace, a target crosses a safety boundary, metadata and machine state disagree, or any required artifact is missing.
ai-sdlc-change-set/v1
记录以完整TOON格式加JSON格式编写,包含
change_id
title
summary
status
owner
flow_mode
、日期、规范目标、工作区产物路径、权限规则及
contract_fingerprint
ai-sdlc-spec-delta/v1
TOON/JSON对包含标准化操作、目标及源证据、精确源哈希,以及确定性指纹。
ai-sdlc-change-preview/v1
TOON/JSON对包含虚拟目标哈希及差异、保守冲突、过期引用、重开操作、校验门,以及当任何输入发生偏移时会失效的指纹。
JSON schema
ai-sdlc-change-approval/v1
ai-sdlc-change-recovery/v1
将可问责审批与当前预览绑定,并保留事务、备份、应用及回滚证据。
质量校验门:
  • 通过条件:工作区包含所有必填产物,JSON记录符合schema,路径安全且唯一,标题及元数据完整,指纹可精确重新计算。
  • 失败条件:创建操作会覆盖现有工作区,目标跨越安全边界,元数据与机器状态不一致,或缺失任何必填产物。

Examples

示例

Valid target:
specs/identity/requirements.md
.
Invalid counter-example:
../../policy.md
. Reject it because a change target must remain repository-relative and cannot traverse outside the repository.
有效目标:
specs/identity/requirements.md
无效反例:
../../policy.md
。拒绝该目标,因为变更目标必须相对于仓库,且不能遍历到仓库外部。

Edge Cases

边缘情况

  • A target may not exist yet when the proposal adds a new canonical artifact; record it explicitly and let delta validation decide whether
    ADDED
    is valid.
  • Multiple targets are sorted for deterministic identity.
  • Re-running
    --create
    never merges or replaces an existing workspace.
  • A hand-edited record with a stale fingerprint fails validation.
  • Empty delta and evidence indexes are valid at intake and become stricter in later lifecycle stages.
  • Preview returns status
    blocked
    and exit code 2 for semantic conflicts while still emitting complete review evidence.
  • Interrupted or failed multi-target apply uses the persisted recovery manifest to restore every already-replaced target before another attempt is accepted.
  • 当提案添加新的规范产物时,目标可能尚未存在;需明确记录该目标,由增量验证决定
    ADDED
    操作是否有效。
  • 多个目标会按确定性标识排序。
  • 重新运行
    --create
    绝不会合并或替换现有工作区。
  • 带有过期指纹的手动编辑记录会验证失败。
  • 增量及证据索引为空在接收阶段是有效的,后续生命周期阶段会更严格。
  • 若存在语义冲突,预览会返回
    blocked
    状态及退出码2,同时仍会输出完整的评审证据。
  • 多目标应用被中断或失败时,会使用持久化的恢复清单恢复所有已被替换的目标,之后才会接受新的尝试。

Scope Boundary

范围边界

  • Do not treat valid requirement delta semantics as approval or compatibility.
  • Never mutate a target outside the controlled apply command or without an accepted, current, all-gates approval record.
  • Do not compute downstream impact; use
    $ai-sdlc-change-impact
    and preview.
  • Do not mutate canonical artifacts, policy, feature state, or specs indexes.
  • This skill does not grant approval and does not merge, commit, or release a change. It may apply and archive only after validating external approval.
  • 不得将有效的需求增量语义视为审批或兼容性确认。
  • 绝不能在受控应用命令外,或在未获得已接收、当前、全校验门通过的审批记录时修改目标。
  • 不得计算下游影响;使用
    $ai-sdlc-change-impact
    及预览功能。
  • 不得修改规范产物、政策、特性状态或规范索引。
  • 本技能不授予审批权限,也不合并、提交或发布变更。仅在验证外部审批通过后,才可执行应用及归档操作。