shipgate-cli 0.0.0-stage → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +261 -2
  3. package/agents/context-builder.md +158 -0
  4. package/agents/debug-executor.md +234 -0
  5. package/assets/gates/classifier.js +245 -0
  6. package/assets/gates/dsh/index.js +767 -0
  7. package/assets/gates/dsh/policy.json +93 -0
  8. package/assets/gates/index.js +3 -0
  9. package/assets/gates/pi/index.js +1131 -0
  10. package/assets/gates/pi/policy.json +93 -0
  11. package/assets/gates/policy.js +4267 -0
  12. package/assets/gates/profiles/ai4s-dry-lab.json +64 -0
  13. package/assets/gates/profiles/ai4s-quant.json +36 -0
  14. package/assets/pi-extensions/auto-continue.ts +176 -0
  15. package/assets/pi-extensions/goal-mode.ts +313 -0
  16. package/bin/shipgate.mjs +9 -0
  17. package/commands/ai-spec.md +9 -0
  18. package/commands/api-first.md +33 -0
  19. package/commands/code-review.md +7 -0
  20. package/commands/codebase-context.md +19 -0
  21. package/commands/debug-ui.md +147 -0
  22. package/commands/debug.md +101 -0
  23. package/commands/dev-env-scan.md +18 -0
  24. package/commands/dev-host-init.md +28 -0
  25. package/commands/discover-skill-opportunities.md +33 -0
  26. package/commands/fork-sync.md +17 -0
  27. package/commands/gh-actions.md +26 -0
  28. package/commands/goal-driven-development.md +7 -0
  29. package/commands/intent-grill.md +7 -0
  30. package/commands/iteration-manager.md +7 -0
  31. package/commands/loop-engineer.md +21 -0
  32. package/commands/nodejs-npm-auto-release.md +12 -0
  33. package/commands/prd.md +7 -0
  34. package/commands/project-health-audit.md +7 -0
  35. package/commands/ralph-yolo.md +346 -0
  36. package/commands/ralph.md +226 -0
  37. package/commands/security-audit.md +7 -0
  38. package/commands/ux-experience-audit.md +133 -0
  39. package/docs/ARCHITECTURE.md +63 -0
  40. package/docs/GATES.md +106 -0
  41. package/docs/HARNESS.md +257 -0
  42. package/package.json +48 -4
  43. package/references/ADR-FORMAT.md +67 -0
  44. package/references/CONTEXT-FORMAT.md +62 -0
  45. package/references/mcp-config-template.json +54 -0
  46. package/scripts/fix-skill-frontmatter.mjs +66 -0
  47. package/scripts/migrate-skillpack.mjs +257 -0
  48. package/skills/ai-spec/SKILL.md +90 -0
  49. package/skills/api-first-modular/SKILL.md +411 -0
  50. package/skills/code-debugger/SKILL.md +379 -0
  51. package/skills/code-review/SKILL.md +62 -0
  52. package/skills/codebase-context/SKILL.md +139 -0
  53. package/skills/debug-ui/SKILL.md +220 -0
  54. package/skills/dev-env-scan/SKILL.md +147 -0
  55. package/skills/dev-host-init/SKILL.md +198 -0
  56. package/skills/dev-host-init/scripts/fill-placeholders.py +226 -0
  57. package/skills/dev-host-init/scripts/host-scan.ps1 +159 -0
  58. package/skills/dev-host-init/scripts/host-scan.sh +201 -0
  59. package/skills/dev-host-init/scripts/render-now.py +488 -0
  60. package/skills/dev-host-init/scripts/tools-catalog.py +229 -0
  61. package/skills/dev-host-init/templates/graph-first-gate.ts +291 -0
  62. package/skills/dev-host-init/templates/host-injection.template.md +725 -0
  63. package/skills/discover-skill-opportunities/SKILL.md +145 -0
  64. package/skills/discover-skill-opportunities/references/accounting-finance-ops.md +24 -0
  65. package/skills/discover-skill-opportunities/references/business-consulting.md +24 -0
  66. package/skills/discover-skill-opportunities/references/evidence-and-privacy.md +39 -0
  67. package/skills/discover-skill-opportunities/references/finance-investment.md +24 -0
  68. package/skills/discover-skill-opportunities/references/legal-and-compliance.md +24 -0
  69. package/skills/discover-skill-opportunities/references/output-contract.md +75 -0
  70. package/skills/discover-skill-opportunities/references/product-and-operations.md +24 -0
  71. package/skills/discover-skill-opportunities/references/quant-trading.md +24 -0
  72. package/skills/discover-skill-opportunities/references/scientific-research.md +24 -0
  73. package/skills/discover-skill-opportunities/references/scoring-rubric.md +45 -0
  74. package/skills/discover-skill-opportunities/references/session-skill-review.md +78 -0
  75. package/skills/discover-skill-opportunities/references/software-development.md +24 -0
  76. package/skills/fork-sync/SKILL.md +86 -0
  77. package/skills/gh-actions-architect/SKILL.md +395 -0
  78. package/skills/goal-driven-development/SKILL.md +132 -0
  79. package/skills/intent-grill/SKILL.md +46 -0
  80. package/skills/iteration-manager/SKILL.md +53 -0
  81. package/skills/loop-engineer/SKILL.md +108 -0
  82. package/skills/nodejs-npm-auto-release/SKILL.md +141 -0
  83. package/skills/prd/SKILL.md +63 -0
  84. package/skills/project-health-audit/SKILL.md +64 -0
  85. package/skills/ralph/SKILL.md +329 -0
  86. package/skills/ralph-yolo/SKILL.md +623 -0
  87. package/skills/security-audit/SKILL.md +114 -0
  88. package/skills/security-audit/references/audit-checklist.md +135 -0
  89. package/skills/security-audit/references/evidence-conventions.md +54 -0
  90. package/skills/security-audit/references/findings-schema.md +37 -0
  91. package/skills/security-audit/references/stack-signatures.md +66 -0
  92. package/skills/shipgate/SKILL.md +40 -0
  93. package/skills/shipgate-install/SKILL.md +87 -0
  94. package/skills/shipgate-quality/SKILL.md +80 -0
  95. package/skills/shipgate-security/SKILL.md +97 -0
  96. package/skills/shipgate-spec/SKILL.md +67 -0
  97. package/skills/ux-experience-audit/SKILL.md +202 -0
  98. package/src/cli.mjs +118 -0
  99. package/src/commands/ask.mjs +82 -0
  100. package/src/commands/deploy.mjs +587 -0
  101. package/src/commands/gates.mjs +83 -0
  102. package/src/commands/policy.mjs +116 -0
  103. package/src/gates/quality.mjs +123 -0
  104. package/src/gates/security.mjs +92 -0
  105. package/src/gates/ship.mjs +74 -0
  106. package/src/gates/spec.mjs +88 -0
  107. package/src/harness/index.mjs +203 -0
  108. package/src/inject/render.mjs +75 -0
  109. package/src/lib/cfg.mjs +66 -0
  110. package/src/lib/duration.mjs +41 -0
  111. package/src/lib/engines.mjs +182 -0
  112. package/src/lib/exec.mjs +80 -0
  113. package/src/lib/fsx.mjs +119 -0
  114. package/src/lib/gate.mjs +329 -0
  115. package/src/lib/log.mjs +31 -0
  116. package/src/lib/skills.mjs +347 -0
  117. package/src/lib/state.mjs +50 -0
  118. package/src/lib/update.mjs +67 -0
  119. package/src/version.mjs +14 -0
  120. package/templates/agents-snippet.md +82 -0
  121. package/templates/dev-profile.schema.json +119 -0
  122. package/templates/prd.json.example +64 -0
  123. package/templates/rule.json.example +28 -0
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: iteration-manager
3
+ description: Convert delivery outcomes, user acceptance, review findings, production signals, incidents, metrics, and deferred debt into the next controlled development iteration. Use after a goal is delivered, stopped, or partially accepted to decide whether evidence requires a bug fix, debt item, PRD amendment, SPEC amendment, or new change. Do not silently rewrite approved historical PRD/SPEC artifacts or start implementation without the next required approval.
4
+ ---
5
+
6
+ # Iteration Manager
7
+
8
+ ## Overview
9
+
10
+ Close the learning loop after implementation. Preserve what was approved, compare expected and observed outcomes, then create the smallest correctly classified next work item.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read `CHANGE.md`, PRD, SPEC, traceability, goal state, review, evidence, delivery state, user acceptance, operational signals, and unresolved debt.
15
+ 2. Compare expected outcomes and acceptance criteria with observed behavior. Separate product gap, implementation defect, specification defect, environmental issue, and new demand.
16
+ 3. Classify every residual:
17
+ - `BUG`: approved behavior was implemented incorrectly;
18
+ - `DEBT`: behavior is acceptable but creates a documented engineering liability;
19
+ - `PRD_AMENDMENT`: user outcome, scope, or acceptance must change;
20
+ - `SPEC_AMENDMENT`: engineering contract was incomplete or incorrect without changing product intent;
21
+ - `NEW_CHANGE`: independent demand outside the approved change;
22
+ - `NO_ACTION`: evidence does not justify more work.
23
+ 4. Preserve prior documents. Create a versioned amendment or new change ID rather than overwriting approved history.
24
+ 5. Record priority, evidence, owner, dependencies, risk, and the next approval Gate.
25
+ 6. Update `OUTCOME.md`; route bug to `code-debugger`, debt to the debt register, amendments to `prd`/`ai-spec`, and new demand to `intent-grill`.
26
+
27
+ ## Decision rules
28
+
29
+ - Continue the same goal only when work remains within the same approved SPEC version.
30
+ - Reopen a completed milestone only with evidence and an audit trail.
31
+ - Do not convert review findings into hidden scope additions.
32
+ - Do not treat telemetry correlation as causation without supporting evidence.
33
+ - Do not start implementation while the next PRD/SPEC amendment is unapproved.
34
+
35
+ ## Output Contract
36
+
37
+ Produce:
38
+
39
+ 1. expected-versus-observed outcome table;
40
+ 2. residual classification with evidence and confidence;
41
+ 3. accepted/deferred debt changes;
42
+ 4. new change or amendment identifiers and parent links;
43
+ 5. recommended priority and next route;
44
+ 6. explicit decision: continue goal, open amendment, open new change, or close.
45
+
46
+ ## Related skills
47
+
48
+ | Relation | Skill | Scenario |
49
+ |---|---|---|
50
+ | Receives | goal-driven-development / code-review | Delivery and residual evidence |
51
+ | Routes to | code-debugger | Implementation defect |
52
+ | Routes to | project-health-audit | Debt or baseline update |
53
+ | Routes to | intent-grill / prd / ai-spec | New or amended contract |
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: loop-engineer
3
+ description: Loop 系统工程师 — 从用户需求出发,设计并开发完整的多 skill 联动 package。扫描现有 skill 资产,识别可复用与缺失项,逐一开发后组包,编写主调度 skill 平滑层。也可用于对已有 package 进行联动完整性审计(格式合规+主调度逻辑+入口文档同步+命名一致性)。当用户说"我需要一个 XX 系统/loop/agent 包"、"帮我设计一个多技能联动方案"、"检查 package 联动完整性"时触发。不适用于单个 skill 开发。
4
+ ---
5
+
6
+ # Loop Engineer — 需求驱动的系统化 Skill Package 工程师
7
+
8
+ ## 角色定位
9
+
10
+ 你是 **Loop Engineer**(循环系统工程师),skill-governor 的上层调度者。
11
+
12
+ - skill-governor = 单兵(单个 skill 的开发与质量门控)
13
+ - Loop Engineer = 参谋长(从需求到交付的完整作战体系设计)
14
+
15
+ 产出不是"一个 skill",而是"一套相互联动、可被单入口调度的 skill package"。
16
+
17
+ ## 工作模式
18
+
19
+ - **模式 A: 新建 Package** — 完整执行 Phase 0 → Phase 5 全流程
20
+ - **模式 B: 审计已有 Package** — 执行 Phase 1 资产盘点 + Phase 5 验证 checklist,输出诊断报告
21
+
22
+ ## 核心哲学:OODA Loop 嵌套
23
+
24
+ ```
25
+ 外层 Loop(你的工作循环):
26
+ Observe: 扫描仓库资产 + 用户需求
27
+ Orient: Gap 分析 — 什么有、什么缺
28
+ Decide: 开发计划 — 先做什么、后做什么
29
+ Act: 调用 skill-governor 逐一开发 → 组包 → 平滑层
30
+
31
+ 内层 Loop(每个子 skill 的开发):
32
+ 由 skill-governor 规范驱动
33
+ ```
34
+
35
+ ## Workflow
36
+
37
+ ### Phase 0: 需求理解与 OODA 映射
38
+ 1. 接收用户需求,提炼能力模块清单
39
+ 2. 映射 Observe/Orient/Decide/Act 四槽位 + 修正面
40
+ 3. 获得用户确认
41
+
42
+ ### Phase 1: 资产盘点与 Gap 分析
43
+ 1. 扫描现有 skill 列表
44
+ 2. 生成 Gap 报告(可复用 / 需适配 / 需新建)
45
+ 3. **【必须】识别主调度 Skill** — 每个 package 必须有且仅有一个主调度节点
46
+ 4. **【必须】Package 定位输出** — 目的 + 主调度名 + 子 skill 职责
47
+ 5. Gate: 用户确认
48
+
49
+ ### Phase 2: 缺失 Skill 开发
50
+ - 对每个缺失 skill 走 skill-governor 全流程(三镜像同步)
51
+ - Gate: 缺失列表清零
52
+
53
+ ### Phase 3: 组包
54
+ 1. 创建 package 三平台目录
55
+ 2. 复制所有相关 skill
56
+ 3. 路径验证
57
+
58
+ ### Phase 4: 平滑层与主调度
59
+ 1. 确定主调度 skill(可复用已有 / 新建 orchestrator / 加前置分诊)
60
+ 2. 编写主调度 SKILL.md(能力索引 + 路由逻辑表 + 数据流 + 回流机制)
61
+ 3. 上下文传递与错误回退
62
+ - **【关键】关联段必须同时写入 Claude/Codex/Gemini 三平台的 SKILL.md** — 不可只写一个平台
63
+ - 关联段写入后立即做交叉验证:A 说"可调用 B",则 B 必须有"被调用于 A"
64
+
65
+ ### Phase 5: 验证与交付
66
+
67
+ **5.1 三平台格式合规检查** — Codex/Claude/Gemini 格式 + description 语义一致
68
+
69
+ **5.2 主调度逻辑检查** — 有主调度 / 路由表完整 / 无歧义 / 有回流机制
70
+
71
+ **5.3 入口文档同步检查** — CLAUDE.md / AGENTS.md / GEMINI.md 列出所有 skill 且命名一致
72
+
73
+ **5.4 命名一致性检查** — command 名可追溯到 skill 名,无混淆或重复
74
+
75
+ **5.5 联动路径检查** — 引用路径存在 / scripts 有效 / 接口对齐 / 无孤立文件
76
+
77
+ **5.6 README 生成/更新** — 架构图 + 清单 + 主调度说明 + 部署 + 示例
78
+
79
+ Gate: 用户确认 → commit
80
+
81
+ ## Output Contract
82
+
83
+ | 产出物 | 必须 |
84
+ |--------|------|
85
+ | Gap Analysis Report(含主调度识别) | Yes |
86
+ | Package 目录(三平台) | Yes |
87
+ | 主调度 Skill(含路由表 + 回流机制) | Yes |
88
+ | 平滑层 | Yes |
89
+ | 入口文档(CLAUDE.md/AGENTS.md/GEMINI.md) | Yes |
90
+ | Package README | Yes |
91
+
92
+ ## Guardrails
93
+
94
+ - 不跳过资产盘点
95
+ - 不在未确认 Gap 报告时开发
96
+ - **不忽略主调度 skill 的识别** — 每个 package 必须有主调度
97
+ - **不跳过入口文档同步** — CLAUDE.md / AGENTS.md / GEMINI.md 必须反映实际 skill
98
+ - **不忽略命名一致性** — command 名必须可追溯到 skill 名
99
+ - **【严格】三平台一致性不可破** — 关联段/路由表/回流机制必须同时写入 .claude/.codex/.gemini
100
+ - **【严格】关联段交叉验证** — A 可调用 B ↔ B 被调用于 A
101
+ - 每个新 skill 走完 skill-governor 全流程
102
+ - 平滑层只做接口对齐,不改子 skill 核心逻辑
103
+
104
+ ## 关联 Skill(网络调度协议)
105
+
106
+ | 关系 | Skill | 场景 |
107
+ |------|-------|------|
108
+ | 被调用 | ai-spec | 需要设计多 skill 联动系统时 |
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: nodejs-npm-auto-release
3
+ description: Set up and run a standardized Node.js npm release workflow with auto version bump, npm publish via GitHub Actions, and local pre-push checks. Use when you want a repo to auto-bump version on push to main, publish to npm, and keep release steps consistent.
4
+ ---
5
+
6
+ # Node.js NPM Auto Release
7
+
8
+ ## Overview
9
+
10
+ Provide a repeatable workflow to prepare, verify, and ship npm packages with a combined auto-version-and-publish GitHub Action, plus local checks before push.
11
+
12
+ ## Setup Checklist
13
+
14
+ 1. Add release scripts in `package.json`
15
+
16
+ ```json
17
+ {
18
+ "scripts": {
19
+ "release:patch": "npm version patch -m \"chore(release): v%s\"",
20
+ "release:minor": "npm version minor -m \"chore(release): v%s\"",
21
+ "release:major": "npm version major -m \"chore(release): v%s\""
22
+ }
23
+ }
24
+ ```
25
+
26
+ 2. Add `.npmignore` to keep packages clean
27
+
28
+ Typical entries:
29
+ - `.github/`
30
+ - `.claude/`
31
+ - `docs/`
32
+ - `tests/`
33
+ - `.env`
34
+ - `node_modules/`
35
+
36
+ 3. Add the combined workflow file
37
+
38
+ Create `.github/workflows/auto-version-publish.yml` with:
39
+
40
+ ```yaml
41
+ name: auto version and publish
42
+
43
+ on:
44
+ push:
45
+ branches:
46
+ - main
47
+
48
+ permissions:
49
+ contents: write
50
+ id-token: write
51
+
52
+ jobs:
53
+ release:
54
+ if: ${{ !contains(github.event.head_commit.message, 'chore(release):') }}
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - name: Checkout
58
+ uses: actions/checkout@v4
59
+ with:
60
+ fetch-depth: 0
61
+
62
+ - name: Setup Node.js
63
+ uses: actions/setup-node@v4
64
+ with:
65
+ node-version: "18"
66
+ registry-url: "https://registry.npmjs.org"
67
+
68
+ - name: Install dependencies
69
+ run: |
70
+ npm ci
71
+
72
+ - name: Typecheck
73
+ run: |
74
+ npm run typecheck
75
+
76
+ - name: Test
77
+ run: |
78
+ npm test
79
+
80
+ - name: Configure git
81
+ run: |
82
+ git config user.name "github-actions[bot]"
83
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
84
+
85
+ - name: Bump patch version and tag
86
+ run: |
87
+ npm version patch -m "chore(release): v%s [skip ci]"
88
+
89
+ - name: Push version bump and tag
90
+ run: |
91
+ git push origin HEAD:main --follow-tags
92
+
93
+ - name: Publish
94
+ env:
95
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
96
+ run: |
97
+ npm publish --access public
98
+ ```
99
+
100
+ 4. Set GitHub secret
101
+
102
+ Add `NPM_TOKEN` in repo Secrets with publish permission.
103
+
104
+ ## Release Workflow
105
+
106
+ 1. Local checks
107
+
108
+ ```bash
109
+ npm run typecheck
110
+ npm test
111
+ npm pack --dry-run
112
+ ```
113
+
114
+ 2. Commit and push
115
+
116
+ ```bash
117
+ git add -A
118
+ git commit -m "feat: update package"
119
+ git push origin main
120
+ ```
121
+
122
+ 3. Verify release
123
+
124
+ - Ensure `auto version and publish` workflow succeeds
125
+ - Confirm new tag created
126
+ - Confirm npm version:
127
+
128
+ ```bash
129
+ npm view <package-name> version
130
+ ```
131
+
132
+ ## Notes
133
+
134
+ - Auto-release skips commits containing `chore(release):` to avoid loops.
135
+ - If you need manual bump, use `npm run release:patch` then push tags.
136
+
137
+ ## 关联 Skill(网络调度协议)
138
+
139
+ | 关系 | Skill | 场景 |
140
+ |------|-------|------|
141
+ | 被调用 | ralph / ralph-yolo | 开发完成后自动发布 |
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: prd
3
+ description: Create or amend a versioned Product Requirements Document from an aligned Change Brief and available project-health evidence. Use before engineering SPEC work to define users, goals, scope, non-goals, stories, dependencies, risks, success metrics, rollout expectations, Definition of Ready/Done, and acceptance criteria. Do not implement code or route directly to an execution harness before PRD and SPEC approval.
4
+ ---
5
+
6
+ # PRD
7
+
8
+ ## Overview
9
+
10
+ Create a product contract that is testable, dependency-aware, and suitable for engineering specification. Preserve approved history through amendments.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read `CHANGE.md`, project context, HEALTH/debt baseline, existing PRD versions, user evidence, and applicable constraints.
15
+ 2. Ask only unresolved product questions; do not substitute engineering preferences for user outcomes.
16
+ 3. Define problem, users, current behavior, goals, non-goals, scope, success metrics, risks, assumptions, and operational expectations.
17
+ 4. Write dependency-ordered user stories. Give each stable ID, rationale, priority, dependencies, acceptance criteria, and evidence method.
18
+ 5. Include compatibility, migration/rollout expectations, failure/degraded behavior, security/privacy needs, observability, and support implications when relevant.
19
+ 6. Map technical debt findings to before/during/after/accepted product constraints without prescribing implementation details.
20
+ 7. Validate Definition of Ready and Definition of Done.
21
+ 8. Save `tasks/<change-id>/PRD.md`; request approval and preserve prior approved versions through amendments.
22
+
23
+ ## Required story schema
24
+
25
+ ```yaml
26
+ id: US-001
27
+ title: ""
28
+ user: ""
29
+ outcome: ""
30
+ priority: 1
31
+ dependencies: []
32
+ acceptance_criteria: []
33
+ evidence_method: []
34
+ risks: []
35
+ status: draft
36
+ ```
37
+
38
+ ## Definition of Ready
39
+
40
+ - intent is aligned and scope/non-goals are explicit;
41
+ - user and outcome are known;
42
+ - blocking health/debt decisions are recorded;
43
+ - every story has dependencies and testable acceptance;
44
+ - metrics, risks, failure behavior, and rollout expectations are sufficient for the change;
45
+ - unresolved questions are visible and accepted or resolved.
46
+
47
+ ## Definition of Done
48
+
49
+ Define product completion independently from implementation activity: acceptance evidence passes, required documentation/operability exists, rollout/rollback expectations are satisfied, and accepted residuals are recorded.
50
+
51
+ ## Output Contract
52
+
53
+ Produce versioned PRD metadata, problem/users/goals/non-goals/scope, stories, dependencies, success metrics, risks, debt impact, Ready/Done, acceptance matrix, unresolved questions, approval status, and next route.
54
+
55
+ Do not call Ralph or any coding harness directly. Approved PRD routes to `ai-spec`; approved SPEC routes to `goal-driven-development`.
56
+
57
+ ## Related skills
58
+
59
+ | Relation | Skill | Scenario |
60
+ |---|---|---|
61
+ | Receives | intent-grill / project-health-audit | Change and health evidence |
62
+ | Hands off | ai-spec | Engineering contract |
63
+ | Receives back | iteration-manager | PRD amendment |
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: project-health-audit
3
+ description: Establish an evidence-backed project health and technical-debt baseline before PRD, SPEC, refactoring, migration, or major feature work. Use to inspect build/test/lint status, architecture hotspots, dependency and security risk, mocks/stubs/TODOs, documentation drift, migrations, and recent change hotspots, then classify debt as before/during/after the proposed change. Do not implement remediations unless separately authorized.
4
+ ---
5
+
6
+ # Project Health Audit
7
+
8
+ ## Overview
9
+
10
+ Determine whether existing system conditions block, constrain, or should be addressed alongside a proposed change. Produce a reproducible baseline, not a generic code-quality opinion.
11
+
12
+ ## Workflow
13
+
14
+ 1. Read repository rules, change intent, architecture/context artifacts, Git state, CI configuration, manifests, tests, migrations, and recent history.
15
+ 2. Discover the repository's own check commands; run safe read-only or normal validation checks appropriate to the audit scope.
16
+ 3. Inspect build/test/lint/type status, flaky or skipped tests, dependency/security signals, module coupling, change hotspots, TODO/FIXME/stub/mock, migrations, configuration drift, observability, and documentation drift.
17
+ 4. Attach file, command, commit, report, or log evidence to every finding. Separate observed failure from inferred risk.
18
+ 5. Score severity, likelihood, change relevance, remediation cost, and confidence.
19
+ 6. Classify remediation timing as `BEFORE_CHANGE`, `DURING_CHANGE`, `AFTER_CHANGE`, or `ACCEPTED`.
20
+ 7. Write `tasks/<change-id>/HEALTH.md` and a structured debt register when the project has a change workspace.
21
+
22
+ ## Debt schema
23
+
24
+ ```yaml
25
+ debt_id: TD-001
26
+ title: ""
27
+ severity: critical|high|medium|low
28
+ evidence: []
29
+ affected_modules: []
30
+ blocks_change: false
31
+ timing: BEFORE_CHANGE|DURING_CHANGE|AFTER_CHANGE|ACCEPTED
32
+ remediation: ""
33
+ owner: ""
34
+ confidence: high|medium|low
35
+ status: open
36
+ ```
37
+
38
+ ## Guardrails
39
+
40
+ - Do not equate old code with debt; require impact and evidence.
41
+ - Do not run destructive migrations, upgrades, deployments, or broad autofixes during an audit.
42
+ - Do not hide failed checks. Distinguish environment failure from product failure.
43
+ - Avoid universal thresholds; prefer repository policy and change-specific risk.
44
+ - Route implementation findings to the approved goal/SPEC instead of silently expanding scope.
45
+
46
+ ## Output Contract
47
+
48
+ Produce:
49
+
50
+ 1. audit scope, environment, commands, and limitations;
51
+ 2. baseline status for build/test/lint/type/security/docs/migrations;
52
+ 3. prioritized debt register with evidence and confidence;
53
+ 4. change-impact map and blocking debt;
54
+ 5. before/during/after remediation recommendation;
55
+ 6. inputs to PRD/SPEC and explicit non-findings.
56
+
57
+ ## Related skills
58
+
59
+ | Relation | Skill | Scenario |
60
+ |---|---|---|
61
+ | Uses | codebase-context | Architecture and impact evidence |
62
+ | Feeds | intent-grill / prd / ai-spec | Change constraints and debt decisions |
63
+ | Feeds | goal-driven-development | Required preconditions and debt controls |
64
+ | Receives | iteration-manager | Deferred findings from delivered work |