ai-sdlc-change-set
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseai-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: with proposal, design, tasks, delta and evidence indexes, lifecycle records, preview, approval, and recovery evidence
changes/<change-id>/
- 技能名称:
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 , and duplicate targets instead of normalizing them silently.
changes/ - 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 and
--quick-flow; full flow takes precedence.--full-flow - 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 result that routes a structurally valid workspace to delta authoring and validation. Include
ai-sdlc-handoff/v1andnext_requiredactions with reasons, commands, and expected artifacts.next_optional - Return progress, validation, and handoff summaries directly in the Codex response.
- Do not create ,
summary.txt, or another standalone summary file.*-summary.txt - 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, anddeltas/index.md.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/, or a canonical target directory.specs-refiniment/
- 将所有变更路由至目录。
<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 in the change-set record.
draft - T002 creates only the intake state; later delta, preview, apply, and archive tasks own their state transitions.
- Read the owning feature when targets belong to an existing feature, but do not modify feature
_ai_sdlc/state.toonduring intake.state.toon
- 变更状态在变更集记录中初始为(草稿)。
draft - T002仅创建接收状态;后续的增量、预览、应用及归档任务负责状态转换。
- 当目标属于现有特性时,读取所属特性的,但在接收阶段不得修改该特性的
_ai_sdlc/state.toon。state.toon
0.6 Artifact Metadata And Metatags
0.6 产物元数据与元标签
- Generated Markdown starts with frontmatter using
artifact_metadata.ai-sdlc-change-set-metadata/v1 - Include change ID, artifact, status, owner, created and updated dates,
canonical targets, and for
metatags,ai-sdlc,change-set, andproposal.draft - The JSON record uses schema and a deterministic contract fingerprint.
ai-sdlc-change-set/v1
- 生成的Markdown文件以前置内容开头,使用
artifact_metadata格式。ai-sdlc-change-set-metadata/v1 - 包含变更ID、产物类型、状态、所有者、创建及更新日期、规范目标,以及、
ai-sdlc、change-set、proposal的元标签。draft - JSON记录使用schema及确定性合约指纹。
ai-sdlc-change-set/v1
0.7 Specs Index
0.7 规范索引
- Read first and use
_ai_sdlc/specs-index.toonfor human feature discovery when canonical targets belong to existing specs.specs-index.md - 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 before creating or reviewing a workspace.
references/change-set-contract.md - Use for the versioned machine contract.
references/change-set.schema.json - Use for deterministic emit, create, and validation.
scripts/change_set.py - Read before authoring or reviewing delta Markdown and use
references/spec-delta-contract.mdfor its projection.references/spec-delta.schema.json - Use to validate and project semantic deltas.
scripts/spec_delta.py - Read before reviewing planned target changes and use
references/apply-preview-contract.mdfor the projection.references/change-preview.schema.json - Use to compile diffs, conflicts, stale evidence, reopen actions, and required gates without target writes.
scripts/change_preview.py - Read before applying or archiving.
references/controlled-apply-contract.md - Validate approval with and recovery evidence with
references/change-approval.schema.json.references/change-recovery.schema.json - Use only after a ready preview and explicit approval.
scripts/change_apply.py
- 在创建或评审工作区前,阅读。
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--create--validatebash
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--validatePurpose
目的
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
步骤
- Inspect canonical sources read-only and identify their authority owners.
- Run to review the planned workspace and fingerprint.
--emit - Resolve unsafe IDs, paths, duplicate targets, or missing ownership.
- Run ; confirm canonical target bytes did not change.
--create - Edit proposal sections through normal reviewed repository changes.
- Run before authoring semantic deltas.
--validate - Author delta Markdown with stable requirement IDs and operation-specific
evidence, then run .
spec_delta.py --validate - Compile preview and resolve every conflict, stale reference, reopen action, and required gate.
- Obtain explicit approval tied to the current preview fingerprint and every required gate.
- Apply through , inspect the completed recovery manifest, then archive the evidence-preserving workspace.
change_apply.py
- 只读检查规范源,确定其权限所有者。
- 运行评审计划的工作区及指纹。
--emit - 解决不安全的ID、路径、重复目标或缺失所有权的问题。
- 运行;确认规范目标内容未发生变化。
--create - 通过常规仓库评审修改提案章节。
- 在编写语义增量前运行。
--validate - 编写带有稳定需求ID及特定操作证据的增量Markdown,然后运行。
spec_delta.py --validate - 编译预览并解决所有冲突、过期引用、重开操作及必填校验门。
- 获取与当前预览指纹及所有必填校验门绑定的明确审批。
- 通过执行应用,检查已完成的恢复清单,然后归档保留证据的工作区。
change_apply.py
Output Spec
输出规范
The record is written as complete TOON plus JSON and contains , ,
, , , , dates, canonical targets, workspace
artifact paths, authority rules, and .
ai-sdlc-change-set/v1change_idtitlesummarystatusownerflow_modecontract_fingerprintThe TOON/JSON pair contains normalized operations, target
and source evidence, exact source hashes, and a deterministic fingerprint.
ai-sdlc-spec-delta/v1The 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.
ai-sdlc-change-preview/v1The JSON schemas and
bind accountable approval to the current preview
and preserve transaction, backup, apply, and rollback evidence.
ai-sdlc-change-approval/v1ai-sdlc-change-recovery/v1Quality 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/v1change_idtitlesummarystatusownerflow_modecontract_fingerprintai-sdlc-spec-delta/v1ai-sdlc-change-preview/v1JSON schema 和将可问责审批与当前预览绑定,并保留事务、备份、应用及回滚证据。
ai-sdlc-change-approval/v1ai-sdlc-change-recovery/v1质量校验门:
- 通过条件:工作区包含所有必填产物,JSON记录符合schema,路径安全且唯一,标题及元数据完整,指纹可精确重新计算。
- 失败条件:创建操作会覆盖现有工作区,目标跨越安全边界,元数据与机器状态不一致,或缺失任何必填产物。
Examples
示例
Valid target: .
specs/identity/requirements.mdInvalid counter-example: . Reject it because a change target
must remain repository-relative and cannot traverse outside the repository.
../../policy.md有效目标:。
specs/identity/requirements.md无效反例:。拒绝该目标,因为变更目标必须相对于仓库,且不能遍历到仓库外部。
../../policy.mdEdge Cases
边缘情况
- A target may not exist yet when the proposal adds a new canonical artifact;
record it explicitly and let delta validation decide whether is valid.
ADDED - Multiple targets are sorted for deterministic identity.
- Re-running never merges or replaces an existing workspace.
--create - 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 and exit code 2 for semantic conflicts while still emitting complete review evidence.
blocked - Interrupted or failed multi-target apply uses the persisted recovery manifest to restore every already-replaced target before another attempt is accepted.
- 当提案添加新的规范产物时,目标可能尚未存在;需明确记录该目标,由增量验证决定操作是否有效。
ADDED - 多个目标会按确定性标识排序。
- 重新运行绝不会合并或替换现有工作区。
--create - 带有过期指纹的手动编辑记录会验证失败。
- 增量及证据索引为空在接收阶段是有效的,后续生命周期阶段会更严格。
- 若存在语义冲突,预览会返回状态及退出码2,同时仍会输出完整的评审证据。
blocked - 多目标应用被中断或失败时,会使用持久化的恢复清单恢复所有已被替换的目标,之后才会接受新的尝试。
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 and preview.
$ai-sdlc-change-impact - 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 - 不得修改规范产物、政策、特性状态或规范索引。
- 本技能不授予审批权限,也不合并、提交或发布变更。仅在验证外部审批通过后,才可执行应用及归档操作。