ai-sdlc-doctor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ai-sdlc-doctor: Diagnostics And Safe Upgrade Plans

ai-sdlc-doctor:诊断与安全升级计划

Internal AI SDLC skill, not client-facing by default. Doctor and upgrade planning are read-only with respect to installation files.
内部AI SDLC Skill,默认不面向客户。 Doctor工具与升级规划对安装文件仅具备只读权限。

0. Skill Card

0. Skill卡片

  • Skill name:
    ai-sdlc-doctor
  • Primary audience: Dev, Delivery
  • Supporting audience: Release, Architecture
  • Audience tags: Dev, Delivery, Release, Architecture
  • SDLC stage: Installation and upgrade operations
  • Purpose: Explain installation health and upgrade impact before mutation.
  • Output:
    _ai_sdlc/doctor/report.{toon,json,md}
    or
    _ai_sdlc/upgrades/<id>/plan.{toon,json,md}
  • Skill名称:
    ai-sdlc-doctor
  • 主要受众: 开发人员、交付人员
  • 支持受众: 发布人员、架构师
  • 受众标签: Dev, Delivery, Release, Architecture
  • SDLC阶段: 安装与升级操作
  • 用途: 在执行变更前说明安装健康状况与升级影响。
  • 输出:
    _ai_sdlc/doctor/report.{toon,json,md}
    _ai_sdlc/upgrades/<id>/plan.{toon,json,md}

0.1 Required Inputs

0.1 必填输入项

  • Repository root for doctor checks.
  • Current and target versioned inventories plus active harness API for upgrade planning.
  • 用于Doctor检查的仓库根目录。
  • 当前与目标版本化文件清单,以及用于升级规划的活跃harness API。

0.2 Clarification Rules

0.2 澄清规则

  • Ask when the installation root or target inventory is ambiguous.
  • Reject unsafe paths, invalid hashes, duplicate files, invalid versions, and incompatible API ranges.
  • Never repair, install, delete, overwrite, migrate, or restore files automatically.
  • 当安装根目录或目标清单不明确时,需询问确认。
  • 拒绝不安全路径、无效哈希、重复文件、无效版本以及不兼容的API范围。
  • 绝不自动执行修复、安装、删除、覆盖、迁移或恢复文件的操作。

0.2.1 Flow Mode Flags

0.2.1 流程模式标志

  • Support
    --quick-flow
    and
    --full-flow
    ; full flow takes precedence.
  • Full flow requires review of every warning, migration, backup, rollback, and blocker.
  • 支持
    --quick-flow
    --full-flow
    ;全流程模式优先级更高。
  • 全流程模式要求审核每一条警告、迁移、备份、回滚与阻塞项。

0.3 Output Rules

0.3 输出规则

  • Default to complete TOON with checks, evidence, remediation, file changes, migrations, backups, rollback actions, blockers, and fingerprints.
  • Return summaries directly in the Codex response.
  • Emit
    ai-sdlc-handoff/v1
    with
    result
    ,
    blockers
    ,
    next_required
    , and
    next_optional
    ; actions include
    reason
    ,
    command
    , and
    expected_artifact
    .
  • Do not create
    summary.txt
    ,
    *-summary.txt
    , or another standalone summary file.
  • 默认生成完整的TOON格式报告,包含检查项、证据、修复方案、文件变更、 迁移、备份、回滚操作、阻塞项与指纹信息。
  • 在Codex响应中直接返回摘要内容。
  • 输出
    ai-sdlc-handoff/v1
    格式数据,包含
    result
    blockers
    next_required
    next_optional
    ;操作信息包含
    reason
    command
    expected_artifact
  • 不得创建
    summary.txt
    *-summary.txt
    或其他独立的摘要文件。

0.4 Artifact Routing

0.4 制品路由

  • Write generated reports only below repository
    _ai_sdlc/
    .
  • Keep authored upgrade inventories visible and version controlled.
  • Never treat a generated plan as authority to apply changes.
  • 生成的报告仅写入仓库
    _ai_sdlc/
    目录下。
  • 保持已创建的升级清单可见并受版本控制。
  • 绝不将生成的计划视为执行变更的授权依据。

0.5 Feature State Machine

0.5 功能状态机

  • Read owning feature
    _ai_sdlc/state.toon
    when diagnostics affect feature work.
  • Diagnostics and upgrade plans do not mutate feature state.
  • 当诊断影响功能工作时,读取所属功能的
    _ai_sdlc/state.toon
    文件。
  • 诊断与升级规划不会修改功能状态。

0.6 Artifact Metadata And Metatags

0.6 制品元数据与元标签

  • Related Markdown uses canonical
    artifact_metadata
    and
    metatags
    .
  • Machine records use versioned doctor, inventory, and upgrade-plan schemas.
  • 相关Markdown文件使用标准的
    artifact_metadata
    metatags
  • 机器记录使用版本化的doctor、清单与升级计划架构。

0.7 Specs Index

0.7 规范索引

  • Read
    _ai_sdlc/specs-index.toon
    first and use
    specs-index.md
    for human review.
  • Operational reports do not refresh either index.
  • 优先读取
    _ai_sdlc/specs-index.toon
    ,并使用
    specs-index.md
    供人工审核。
  • 运营报告不会刷新上述任一索引。

References

参考资料

  • Read
    references/doctor-contract.md
    before interpreting health or upgrade safety.
  • Use
    references/diagnostics.json
    as the deterministic check registry.
  • Validate inventories with
    references/upgrade-inventory.schema.json
    .
  • Use
    scripts/doctor.py
    for all reports and plans.
  • 在解读健康状况或升级安全性前,需阅读
    references/doctor-contract.md
  • 使用
    references/diagnostics.json
    作为确定性检查注册表。
  • 使用
    references/upgrade-inventory.schema.json
    验证清单。
  • 所有报告与计划均通过
    scripts/doctor.py
    生成。

Script Usage

脚本使用

bash
python3 skills/ai-sdlc-doctor/scripts/doctor.py . --doctor --write
python3 skills/ai-sdlc-doctor/scripts/doctor.py . --upgrade --current current.json --target target.json --upgrade-id v2-preview --write
bash
python3 skills/ai-sdlc-doctor/scripts/doctor.py . --doctor --write
python3 skills/ai-sdlc-doctor/scripts/doctor.py . --upgrade --current current.json --target target.json --upgrade-id v2-preview --write

Purpose

目标

Make operational gaps and upgrade risk reviewable before any installation mutation.
在执行任何安装变更前,让运营缺口与升级风险可被审核。

Steps

步骤

  1. Run registered prerequisite, layout, module, skill, and docs checks.
  2. Report evidence and exact remediation without executing it.
  3. Validate current and target inventories and API compatibility.
  4. Diff files into add, modify, remove, unchanged, and schema-migration actions.
  5. Plan backups for every modified or removed file.
  6. Plan reverse-order rollback for every proposed change.
  7. Emit TOON-first records; require a later authorized workflow to apply them.
  1. 运行已注册的前置条件、布局、模块、Skill与文档检查。
  2. 报告证据与具体修复方案,但不执行。
  3. 验证当前与目标清单及API兼容性。
  4. 将文件差异分为新增、修改、删除、无变更与架构迁移操作。
  5. 为每个修改或删除的文件规划备份。
  6. 为每个拟议的变更规划逆序回滚操作。
  7. 优先输出TOON格式记录;需后续授权工作流方可执行变更。

Output Spec

输出规范

Doctor checks have stable codes, statuses, evidence, and remediation. Upgrade plans contain exact hashes, schema transitions, backup destinations, rollback actions, compatibility blockers, and deterministic identity.
Doctor检查具备稳定的代码、状态、证据与修复方案。升级计划包含精确哈希、架构转换、备份目标、回滚操作、兼容性阻塞项与确定性标识。

Scope Boundary

范围边界

  • Do not install dependencies or modify the installation.
  • Do not execute remediation, backup, migration, apply, or rollback actions.
  • Do not hide incompatible or destructive changes behind an aggregate status.
  • 不得安装依赖或修改现有安装。
  • 不得执行修复、备份、迁移、应用或回滚操作。
  • 不得将不兼容或破坏性变更隐藏在聚合状态之后。