tech-lead-skill 5.4.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 240xu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # Tech Lead Skill
2
+
3
+ English | [简体中文](README.zh-CN.md)
4
+
5
+ An evidence-driven planning and delivery skill for software, infrastructure, research, reverse-engineering, and operations work.
6
+
7
+ ## What It Solves
8
+
9
+ Many plans fail in one of two ways: they are vague and cannot guide execution, or they are over-detailed and become false after the first environmental change. This skill keeps the plan coarse until evidence justifies detail, then continuously revises it against observed reality.
10
+
11
+ The control loop is:
12
+
13
+ ```text
14
+ goal -> constraints/assumptions -> L0/L1/L2 plan -> execute -> observe evidence
15
+ -> revise -> choose CONTINUE / PAUSE / SCOPE-DOWN / PIVOT / STOP
16
+ ```
17
+
18
+ ## Core Features
19
+
20
+ - PLAN and EXECUTE modes with a clear boundary between planning and side effects.
21
+ - Progressive disclosure: L0 architecture, L1 milestones, L2 executable focus.
22
+ - Goal, metric, fact, assumption, decision, risk, dependency, and evidence ledgers.
23
+ - Protected asset handling for source, user data, configuration, secrets, runtime state, and generated artifacts.
24
+ - Minimal mutation protocol: `READ -> CLASSIFY -> PROTECT -> CHANGE -> VERIFY -> RECONCILE -> ROLLBACK/RECORD`.
25
+ - Evidence levels E0-E4, from model inference to observed user outcomes.
26
+ - Failure re-planning, stagnation circuit breaker, rollback discipline, and real-state reconciliation.
27
+ - Optional adversarial review for high-impact or irreversible changes.
28
+ - Git-backed and non-Git project-state recovery.
29
+ - Release-readiness checks for public documentation and skill publishing.
30
+ - Runtime discipline rules for external dependency health, silent failure classes, automation guardrails, idempotent batch jobs, and fallback ladders.
31
+
32
+ ## Install
33
+
34
+ ### npm (GitHub-hosted, no registry account needed)
35
+
36
+ ```bash
37
+ npm i -g github:240xu/tech-lead-skill
38
+ tech-lead-skill # installs into ~/.config/opencode/skills/tech-lead
39
+ ```
40
+
41
+ One-shot without a global install:
42
+
43
+ ```bash
44
+ npx github:240xu/tech-lead-skill
45
+ ```
46
+
47
+ The installer is idempotent: repeated runs back up existing files as `*.bak-<timestamp>` first. Use `--target <dir>` to choose another destination, `--check` to verify an installed copy against the package (hash + version drift), `--dry-run` to preview without writing, and `--uninstall` to remove. Uninstall removes only manifest-managed files — user files and `*.bak-*` backups are kept.
48
+
49
+ ### DeepSeek Harness plugin (read-only tools)
50
+
51
+ The repository also ships an opt-in DSH bundle exposing 21 read-only lifecycle tools. The original nine audit tools remain compatible, and the strengthened surface adds context validation, evidence graph/freshness analysis, progress decisions, critical-path and impact analysis, resume reconciliation, gate planning/aggregation/reopen checks, and mutation preview. The tools compute over caller-supplied JSON only — no filesystem writes, no subprocesses, no network access.
52
+
53
+ ```bash
54
+ dsh plugin --profile headless add /path/to/tech-lead-skill/packages/dsh-tech-lead-bundle
55
+ dsh --profile headless --dump-config # verify the tech-lead-tools row is present
56
+ ```
57
+
58
+ See [`docs/superpowers/specs/2026-08-25-dsh-tech-lead-system.md`](https://github.com/240xu/tech-lead-skill/blob/main/docs/superpowers/specs/2026-08-25-dsh-tech-lead-system.md) for the architecture and permission matrix.
59
+
60
+ ### Manual
61
+
62
+ Copy `skill/SKILL.md` and the `skill/templates/` directory into the skills directory of your OpenCode-compatible environment:
63
+
64
+ ```text
65
+ ~/.config/opencode/skills/tech-lead/
66
+ ```
67
+
68
+ The skill is triggered by project construction, system building, implementation plans, deployment, migration, release, recovery, restructuring, operations work, and other substantial planning requests. It can also be loaded explicitly.
69
+
70
+ ## Operating Modes
71
+
72
+ ### PLAN
73
+
74
+ Use for intake, goal definition, architecture, decomposition, risk analysis, and verification design. PLAN does not edit files or run side-effecting commands.
75
+
76
+ ### EXECUTE
77
+
78
+ Use after the L2 scope is clear. Execute only the smallest approved mutation, record the change, verify behavior, reconcile actual state, and update the plan.
79
+
80
+ ## Protected Assets
81
+
82
+ | Class | Default handling |
83
+ |---|---|
84
+ | `SOURCE` | Inspectable diff, tests, and restore point |
85
+ | `USER_DATA` | Read-only by default; write only to an explicit target with recovery |
86
+ | `CONFIG` | Read current state, make the smallest change, reload, verify |
87
+ | `SECRET` | Never place in plans, logs, ordinary backups, or diffs |
88
+ | `RUNTIME` | Inspect live state before restart, kill, replace, or migration |
89
+ | `GENERATED` | Prefer regeneration; do not treat as the source of truth |
90
+
91
+ ## Evidence Levels
92
+
93
+ - `E0`: model inference; hypothesis only.
94
+ - `E1`: static inspection, grep, or configuration inspection.
95
+ - `E2`: local command or unit test; local behavior only.
96
+ - `E3`: integration test, real process, or real endpoint.
97
+ - `E4`: user acceptance, real business result, or production observation.
98
+
99
+ ## Templates
100
+
101
+ - `templates/intake.md`: goal, constraints, assets, risk, and completion level.
102
+ - `templates/plan.md`: L0/L1/L2 plan and current focus.
103
+ - `templates/change-record.md`: one EXECUTE mutation and its reconciliation.
104
+ - `templates/round.md`: one planning iteration and its outcome.
105
+ - `templates/state.json`: canonical resumable state projection.
106
+ - `templates/gate-review.md` and `templates/gate-verdict.md`: independent review and decision records.
107
+ - `templates/release-check.md`: publication inventory, scans, remote verification, and limitations.
108
+
109
+ ## Scope
110
+
111
+ This is an engineering planning skill. It focuses on correctness of planning, safe handling of user files and code changes, evidence quality, rollback, and real-environment reconciliation. It intentionally stays focused on project-level engineering work rather than organization-wide process design.
112
+
113
+ ## Limitations
114
+
115
+ - The judgment layer remains prose by design; the optional DSH bundle provides a machine-checkable, composable read-only runtime for context, evidence, progress, gates, release/install audits, recovery, and mutation preview.
116
+ - Evidence freshness and state reconciliation are operator/agent responsibilities until dedicated tooling exists.
117
+ - The skill does not provide a sandbox; untrusted code must not be executed unless an actual isolated execution environment is already available.
118
+ - MCP candidates should be selected only after observing repeated real-project violations.
119
+
120
+ ## Notes
121
+
122
+ The executable skill body (`SKILL.md`) is authored in Simplified Chinese; coding agents execute it correctly regardless of the conversation language. Templates are English and agent-facing. Documentation translations cover this README and the technical guide.
123
+
124
+ ## Version
125
+
126
+ Current version: `v5.4.0`.
127
+
128
+ See [`docs/TECHNICAL_GUIDE.md`](docs/TECHNICAL_GUIDE.md) for the full operating model and [`docs/AUDIT_REPORT.md`](docs/AUDIT_REPORT.md) for the publication audit.
@@ -0,0 +1,130 @@
1
+ # Tech Lead Skill
2
+
3
+ [English](README.md) | 简体中文
4
+
5
+ 一套以证据驱动的规划与交付技能,适用于软件、基础设施、研究、逆向工程与运维类工作。
6
+
7
+ ## 解决什么问题
8
+
9
+ 计划失败通常有两种方式:要么模糊到无法指导执行,要么过度细化而在第一次环境变化后就失真。本技能让计划在证据支撑之前保持粗粒度,然后依据观察到的现实持续修订。
10
+
11
+ 控制回路:
12
+
13
+ ```text
14
+ 目标 -> 约束/假设 -> L0/L1/L2 计划 -> 执行 -> 观察证据
15
+ -> 修订 -> 选择 CONTINUE / PAUSE / SCOPE-DOWN / PIVOT / STOP
16
+ ```
17
+
18
+ ## 核心特性
19
+
20
+ - PLAN 与 EXECUTE 双模式,划清规划与副作用的边界。
21
+ - 渐进展开:L0 架构、L1 里程碑、L2 可执行焦点。
22
+ - 目标、指标、事实、假设、决策、风险、依赖与证据账本。
23
+ - 受保护资产处置:源码、用户数据、配置、秘密、运行态与生成物。
24
+ - 最小变更协议:`READ -> CLASSIFY -> PROTECT -> CHANGE -> VERIFY -> RECONCILE -> ROLLBACK/RECORD`。
25
+ - E0-E4 证据分级,从模型推断到真实用户结果。
26
+ - 失败重规划、停滞断路器、回滚纪律与真实状态对账。
27
+ - 面向高影响或不可逆变更的对抗式评审(可选)。
28
+ - 支持 Git 与非 Git 两种项目状态恢复方式。
29
+ - 面向公开文档与技能发布的收尾验证检查。
30
+ - 运行期纪律规则:外部依赖健康、静默失败类别、自动化护栏、幂等批处理与降级阶梯。
31
+
32
+ ## 安装
33
+
34
+ ### npm 方式(GitHub 源,无需注册账号)
35
+
36
+ ```bash
37
+ npm i -g github:240xu/tech-lead-skill
38
+ tech-lead-skill # 安装到 ~/.config/opencode/skills/tech-lead
39
+ ```
40
+
41
+ 一次性运行(不全局安装):
42
+
43
+ ```bash
44
+ npx github:240xu/tech-lead-skill
45
+ ```
46
+
47
+ 安装器幂等,重复执行会先把旧文件备份为 `*.bak-<时间戳>`;`--target <目录>` 可自定义目标;`--check` 校验已装副本与包的哈希/版本漂移;`--dry-run` 预览不写入;`--uninstall` 卸载时只删除清单受管文件,用户文件与 `*.bak-*` 备份全部保留。
48
+
49
+ `--check` 退出码:`0` 正常,`1` 检出漂移,`2` 用法/拒绝错误。
50
+
51
+ ### DeepSeek Harness 插件(只读工具)
52
+
53
+ 本仓库同时提供可选 DSH bundle,暴露 21 个只读生命周期工具。原有九个审计工具保持兼容,并新增上下文校验、证据图与新鲜度分析、推进决策、关键路径与影响分析、续跑对账、Gate 计划/聚合/重开检查,以及变更预览。工具仅对调用方传入的 JSON 做计算——无文件写入、无子进程、无网络访问。
54
+
55
+ ```bash
56
+ dsh plugin --profile headless add /path/to/tech-lead-skill/packages/dsh-tech-lead-bundle
57
+ dsh --profile headless --dump-config # 确认 tech-lead-tools 行已注入
58
+ ```
59
+
60
+ 架构与权限矩阵见 [spec](https://github.com/240xu/tech-lead-skill/blob/main/docs/superpowers/specs/2026-08-25-dsh-tech-lead-system.md)。
61
+
62
+ ### 手动方式
63
+
64
+ 将 `skill/SKILL.md` 和 `skill/templates/` 目录复制到你所用 OpenCode 兼容环境的技能目录:
65
+
66
+ ```text
67
+ ~/.config/opencode/skills/tech-lead/
68
+ ```
69
+
70
+ 该技能由"构建项目/搭系统/制定执行计划/部署/迁移/发布/恢复/重构/运维"等实质性任务触发,即使用户没有明确说“项目”或“Tech Lead”也应加载;也可以显式加载。
71
+
72
+ ## 工作模式
73
+
74
+ ### PLAN
75
+
76
+ 用于需求接入、目标定义、架构设计、任务分解、风险分析与验证设计。PLAN 不改文件、不执行有副作用的命令。
77
+
78
+ ### EXECUTE
79
+
80
+ 在 L2 范围明确后使用。只执行最小已批准变更,记录改动,验证行为,对账实际状态,并更新计划。
81
+
82
+ ## 受保护资产
83
+
84
+ | 类别 | 默认处置 |
85
+ |---|---|
86
+ | `SOURCE` | 可审查 diff、测试与恢复点 |
87
+ | `USER_DATA` | 默认只读;仅在目标明确且有可恢复副本时写入 |
88
+ | `CONFIG` | 先读现状,最小修改,重载后验证 |
89
+ | `SECRET` | 绝不进入计划、日志、普通备份或 diff |
90
+ | `RUNTIME` | 重启/杀进程/替换/迁移前必须先查实时状态 |
91
+ | `GENERATED` | 优先重新生成;不作为事实源 |
92
+
93
+ ## 证据分级
94
+
95
+ - `E0`:模型推断;仅可用于提出假设。
96
+ - `E1`:静态阅读、grep 或配置检查。
97
+ - `E2`:本地命令或单元测试;仅证明局部行为。
98
+ - `E3`:集成测试、真实进程或真实端点。
99
+ - `E4`:用户验收、真实业务结果或生产观察。
100
+
101
+ ## 模板
102
+
103
+ - `templates/intake.md`:目标、约束、资产、风险与完成层级。
104
+ - `templates/plan.md`:L0/L1/L2 计划与当前焦点。
105
+ - `templates/change-record.md`:单次 EXECUTE 变更及其对账。
106
+ - `templates/round.md`:单轮规划迭代及其结果。
107
+ - `templates/state.json`:可续跑的规范状态投影。
108
+ - `templates/gate-review.md` 与 `templates/gate-verdict.md`:独立评审与裁决记录。
109
+ - `templates/release-check.md`:发布清单、扫描、远程验证与限制记录。
110
+
111
+ ## 范围
112
+
113
+ 这是一套工程规划技能,聚焦规划正确性、用户文件与代码改动的安全处置、证据质量、回滚以及真实环境对账。它有意不涉及组织级流程设计或通用项目管理方法论。
114
+
115
+ ## 局限
116
+
117
+ - 目前规则是文本形式,不是机器强制的状态机。
118
+ - 在专用工具出现之前,证据时效与状态对账依赖执行环境与操作者。
119
+ - 本技能不提供沙箱;除非已有真实隔离执行环境,否则不得运行不可信代码。
120
+ - MCP 工具化候选应在观察到真实项目中反复违例之后再筛选。
121
+
122
+ ## 说明
123
+
124
+ 可执行的技能正文 `SKILL.md` 以简体中文编写;编码代理无论对话语言为何均可正确执行。模板为面向代理的英文文件。文档翻译覆盖本 README 与技术指南。
125
+
126
+ ## 版本
127
+
128
+ 当前版本:`v5.4.0`。
129
+
130
+ 完整运行模型见[技术指南](https://github.com/240xu/tech-lead-skill/blob/main/docs/TECHNICAL_GUIDE.zh-CN.md),发布审计见 [docs/AUDIT_REPORT.md](docs/AUDIT_REPORT.md)。
package/bin/install.js ADDED
@@ -0,0 +1,245 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const os = require('os');
6
+ const crypto = require('crypto');
7
+
8
+ const pkgRoot = path.resolve(__dirname, '..');
9
+ const pkg = JSON.parse(fs.readFileSync(path.join(pkgRoot, 'package.json'), 'utf8'));
10
+ const srcSkill = path.join(pkgRoot, 'skill');
11
+ const markerName = '.tech-lead-skill.json';
12
+ const args = process.argv.slice(2);
13
+ const defaultTarget = path.resolve(path.join(os.homedir(), '.config', 'opencode', 'skills', 'tech-lead'));
14
+ const knownFlags = new Set([
15
+ '--help', '-h', '--version', '-v',
16
+ '--uninstall', '--target', '--check', '--dry-run',
17
+ ]);
18
+
19
+ for (const arg of args) {
20
+ if (arg.startsWith('-') && !knownFlags.has(arg)) {
21
+ console.error('unknown option: ' + arg);
22
+ process.exit(2);
23
+ }
24
+ }
25
+
26
+ function argValue(name) {
27
+ const i = args.indexOf(name);
28
+ if (i === -1) return undefined;
29
+ const value = args[i + 1];
30
+ if (!value || value.startsWith('-')) {
31
+ console.error(name + ' requires a directory argument');
32
+ process.exit(2);
33
+ }
34
+ return value;
35
+ }
36
+
37
+ if (args.includes('--help') || args.includes('-h')) {
38
+ console.log(
39
+ `tech-lead-skill ${pkg.version}\n` +
40
+ 'Usage: tech-lead-skill [options]\n' +
41
+ ' (no args) install into ~/.config/opencode/skills/tech-lead\n' +
42
+ ' --target <dir> install into <dir>\n' +
43
+ ' --check verify installed files match this package\n' +
44
+ ' --dry-run print planned actions without writing anything\n' +
45
+ ' --uninstall remove only manifest-managed files (keeps user files)\n' +
46
+ ' --version print version\n' +
47
+ ' --help show this help\n' +
48
+ '\n' +
49
+ 'Exit codes: 0 ok, 1 drift detected (--check), 2 usage/refusal error'
50
+ );
51
+ process.exit(0);
52
+ }
53
+
54
+ if (args.includes('--version') || args.includes('-v')) {
55
+ console.log(pkg.version);
56
+ process.exit(0);
57
+ }
58
+
59
+ function walkFiles(root) {
60
+ const out = [];
61
+ (function walk(rel) {
62
+ const abs = path.join(root, rel);
63
+ let entries;
64
+ try { entries = fs.readdirSync(abs, { withFileTypes: true }); }
65
+ catch (err) { console.warn('warn: cannot read ' + abs + ' (' + err.code + '), skipping'); return; }
66
+ for (const entry of entries) {
67
+ const relPath = rel ? rel + '/' + entry.name : entry.name;
68
+ if (entry.isDirectory()) walk(relPath);
69
+ else out.push(relPath.split(path.sep).join('/'));
70
+ }
71
+ })('');
72
+ return out.sort();
73
+ }
74
+
75
+ function isBackup(rel) {
76
+ return /\.bak-\d+(?:-\d+)?$/.test(rel);
77
+ }
78
+
79
+ function readMarker(target) {
80
+ try {
81
+ return JSON.parse(fs.readFileSync(path.join(target, markerName), 'utf8'));
82
+ } catch (_) {
83
+ return null;
84
+ }
85
+ }
86
+
87
+ // A manifest entry may only address paths INSIDE target: blocks traversal via
88
+ // tampered marker.files ("../x", absolute paths resolve under target anyway).
89
+ function containedRel(target, rel) {
90
+ if (typeof rel !== 'string' || !rel || rel.includes('\\0')) return null;
91
+ const abs = path.resolve(target, rel);
92
+ const base = path.resolve(target);
93
+ const relCheck = path.relative(base, abs);
94
+ if (relCheck.startsWith('..') || path.isAbsolute(relCheck)) return null;
95
+ return relCheck.split(path.sep).join('/');
96
+ }
97
+
98
+ function sha256File(file) {
99
+ return crypto.createHash('sha256').update(fs.readFileSync(file)).digest('hex');
100
+ }
101
+
102
+ function copyWithBackup(src, dest) {
103
+ if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) {
104
+ console.error('refusing: destination exists as a directory: ' + dest);
105
+ console.error('remove or rename it, then re-run the installer');
106
+ process.exit(2);
107
+ }
108
+ if (fs.existsSync(dest)) {
109
+ const bak = dest + '.bak-' + Date.now() + '-' + process.pid;
110
+ fs.copyFileSync(dest, bak);
111
+ console.log('backup : ' + bak);
112
+ }
113
+ fs.copyFileSync(src, dest);
114
+ }
115
+
116
+ function isHomeDir(dir) {
117
+ try { return fs.realpathSync(dir) === fs.realpathSync(os.homedir()); }
118
+ catch (_) { return false; }
119
+ }
120
+
121
+ let target = argValue('--target') || defaultTarget;
122
+ target = path.resolve(target);
123
+
124
+ const dryRun = args.includes('--dry-run');
125
+
126
+ // ── uninstall ────────────────────────────────────────────────────────────────
127
+ if (args.includes('--uninstall')) {
128
+ const marker = readMarker(target);
129
+ if (!marker || !Array.isArray(marker.files)) {
130
+ console.error('refusing to remove an unmarked target: ' + target);
131
+ console.error('install this package there first, or remove it manually after checking the path');
132
+ process.exit(2);
133
+ }
134
+ let removed = 0;
135
+ const dirsTouched = new Set();
136
+ let wouldRemove = 0;
137
+ for (const raw of marker.files) {
138
+ const rel = containedRel(target, raw);
139
+ if (!rel) { console.warn('skipped unsafe manifest entry: ' + JSON.stringify(raw)); continue; }
140
+ const abs = path.join(target, rel);
141
+ if (fs.existsSync(abs) && fs.statSync(abs).isDirectory()) {
142
+ console.warn('skipped directory entry (not managed): ' + rel);
143
+ continue;
144
+ }
145
+ dirsTouched.add(path.dirname(abs));
146
+ if (dryRun) { console.log('would remove: ' + abs); wouldRemove++; continue; }
147
+ if (fs.existsSync(abs)) {
148
+ fs.unlinkSync(abs);
149
+ removed++;
150
+ console.log('removed : ' + rel);
151
+ }
152
+ }
153
+ const markerAbs = path.join(target, markerName);
154
+ if (dryRun) console.log('would remove: ' + markerAbs);
155
+ else { fs.unlinkSync(markerAbs); removed++; }
156
+
157
+ // Try to prune now-empty directories touched by the manifest (bottom-up).
158
+ const sortedDirs = [...dirsTouched].sort((a, b) => b.length - a.length);
159
+ for (const dir of sortedDirs) {
160
+ if (dir === target) continue;
161
+ if (!dryRun) { try { fs.rmdirSync(dir); } catch (_) { /* non-empty: keep */ } }
162
+ }
163
+
164
+ // Report leftovers so nothing disappears silently.
165
+ const leftovers = [];
166
+ (function scan(rel) {
167
+ const abs = path.join(target, rel);
168
+ for (const entry of fs.readdirSync(abs, { withFileTypes: true })) {
169
+ const relPath = rel ? rel + '/' + entry.name : entry.name;
170
+ if (entry.isDirectory()) scan(relPath);
171
+ else leftovers.push(relPath.split(path.sep).join('/'));
172
+ }
173
+ })('');
174
+ if (leftovers.length) {
175
+ console.log(dryRun ? 'still present (dry-run; includes managed files):' : 'kept (not managed):');
176
+ for (const rel of leftovers) console.log(' kept : ' + rel);
177
+ } else if (!dryRun && !isHomeDir(target)) {
178
+ try { fs.rmdirSync(target); console.log('removed empty target directory'); } catch (_) { /* keep */ }
179
+ }
180
+ const count = dryRun ? wouldRemove : removed;
181
+ console.log((dryRun ? '[dry-run] would remove ' : 'removed ') + count + ' managed entr' + (count === 1 ? 'y' : 'ies'));
182
+ process.exit(0);
183
+ }
184
+
185
+ // ── check ────────────────────────────────────────────────────────────────────
186
+ if (args.includes('--check')) {
187
+ const marker = readMarker(target);
188
+ if (!marker || !Array.isArray(marker.files)) {
189
+ console.error('not installed here (no valid manifest): ' + target);
190
+ process.exit(2);
191
+ }
192
+ let hasError = false;
193
+ if (marker.version !== pkg.version) {
194
+ console.log(`DRIFT version : installed ${marker.version} != package ${pkg.version}`);
195
+ hasError = true;
196
+ }
197
+ const missing = [];
198
+ const drifted = [];
199
+ for (const raw of marker.files) {
200
+ const rel = containedRel(target, raw);
201
+ if (!rel) { console.warn('skipped unsafe manifest entry: ' + JSON.stringify(raw)); continue; }
202
+ const abs = path.join(target, rel);
203
+ const src = path.join(srcSkill, rel);
204
+ if (!fs.existsSync(abs)) { missing.push(rel); continue; }
205
+ if (fs.existsSync(src) && sha256File(abs) !== sha256File(src)) drifted.push(rel);
206
+ }
207
+ if (missing.length) hasError = true;
208
+ if (drifted.length) hasError = true;
209
+
210
+ const managedSet = new Set(marker.files);
211
+ const unmanaged = walkFiles(target).filter((rel) => !managedSet.has(rel) && !isBackup(rel) && rel !== markerName);
212
+ if (missing.length) console.log('MISSING managed files:');
213
+ for (const rel of missing) console.log(' missing: ' + rel);
214
+ if (drifted.length) console.log('MODIFIED since install:');
215
+ for (const rel of drifted) console.log(' drift : ' + rel);
216
+ if (unmanaged.length) {
217
+ console.log('NOTE unmanaged files kept in place (informational):');
218
+ for (const rel of unmanaged) console.log(' extra : ' + rel);
219
+ }
220
+ if (hasError) process.exit(1);
221
+ console.log(`ok: ${marker.files.length} managed files match tech-lead-skill v${pkg.version}`);
222
+ process.exit(0);
223
+ }
224
+
225
+ // ── install ──────────────────────────────────────────────────────────────────
226
+ const files = walkFiles(srcSkill);
227
+ console.log((dryRun ? '[dry-run] would install ' : 'installing ') +
228
+ `${pkg.name} v${pkg.version} -> ${target} (${files.length} files)`);
229
+ for (const rel of files) {
230
+ const dest = path.join(target, rel);
231
+ if (dryRun) { console.log(' would write: ' + rel); continue; }
232
+ fs.mkdirSync(path.dirname(dest), { recursive: true });
233
+ copyWithBackup(path.join(srcSkill, rel), dest);
234
+ }
235
+ if (!dryRun) {
236
+ fs.writeFileSync(path.join(target, markerName), JSON.stringify({
237
+ package: pkg.name,
238
+ version: pkg.version,
239
+ installedAt: new Date().toISOString(),
240
+ files,
241
+ }, null, 2) + '\n');
242
+ console.log('installed: tech-lead-skill v' + pkg.version + ' -> ' + target);
243
+ } else {
244
+ console.log('[dry-run] no changes written');
245
+ }
@@ -0,0 +1,58 @@
1
+ # Publication Audit Report
2
+
3
+ Date: 2026-08-25
4
+ Scope: public release of the `tech-lead` planning skill and its eight templates.
5
+
6
+ ## Result
7
+
8
+ The publication set contains only the following intended artifacts:
9
+
10
+ - `package.json` / `bin/install.js` (npm installer)
11
+ - `skill/SKILL.md`
12
+ - `skill/templates/intake.md`
13
+ - `skill/templates/plan.md`
14
+ - `skill/templates/change-record.md`
15
+ - `skill/templates/round.md`
16
+ - `skill/templates/release-check.md`
17
+ - `skill/templates/state.json`
18
+ - `skill/templates/gate-review.md`
19
+ - `skill/templates/gate-verdict.md`
20
+ - `README.md` (English) / `README.zh-CN.md` (简体中文)
21
+ - `docs/TECHNICAL_GUIDE.md` (English) / `docs/TECHNICAL_GUIDE.md (zh guide ships via GitHub only)
22
+ - `docs/AUDIT_REPORT.md`
23
+ - `LICENSE`
24
+
25
+ Documentation is bilingual (English + Simplified Chinese) by design; additional languages were intentionally excluded to limit maintenance surface. The skill body (`SKILL.md`) is authored in Simplified Chinese and is executed correctly by coding agents regardless of conversation language.
26
+
27
+ No unrelated home-directory files, project histories, server notes, credentials, or private operational documents are included.
28
+
29
+ ## Checks Performed
30
+
31
+ ### Sensitive-content scan
32
+
33
+ The source set was scanned for local absolute paths, passwords, API-key prefixes, SSH host details, private domains, and server IP patterns. The only address-like match is the explicitly documented loopback placeholder `127.0.0.1`; no real operational endpoint or credential was found in the publication set.
34
+
35
+ ### Structural scan
36
+
37
+ - YAML frontmatter has `name: tech-lead` and a trigger description.
38
+ - The skill version is `v5.4.0`.
39
+ - The seven templates referenced by the skill exist.
40
+ - The installer validates options, requires a marker before removing any target, and records the managed package/version after installation.
41
+ - The release-check template covers allowlist inventory, sensitive-content scanning, reference checks, scope checks, publication results, and remote verification.
42
+ - The plan includes PLAN/EXECUTE, L0/L1/L2, protected assets, mutation protocol, E0-E4 evidence, completion levels, stagnation control, state recovery, and real-state reconciliation.
43
+ - Version markers verified against package.json at audit time (see CHANGELOG history for prior releases)
44
+
45
+ ### Safety review
46
+
47
+ The skill defaults user data to read-only, requires a recovery path before writes, excludes secrets from normal plans/logs/diffs/backups, requires live-state inspection before runtime operations, and prevents untrusted code execution without an actual isolated environment.
48
+
49
+ ## Known Limitations
50
+
51
+ - Core judgment stays prose-first; a mechanical subset (state schema, evidence provenance, gate prechecks, release/install audits) is machine-checkable via @240xu/dsh-tech-lead-core and the optional DSH bundle tools.
52
+ - Freshness, reconciliation, and rollback verification depend on the executing environment.
53
+ - No claim is made that the skill has completed a multi-project effectiveness trial; that is the next validation phase.
54
+ - The audit validates publication content, not the security of the hosting platform or every consumer's local OpenCode installation.
55
+
56
+ ## Release Decision
57
+
58
+ Publication is appropriate as a public documentation and skill repository. Consumers should review the skill before applying it to production or user-data changes, and should treat its templates as guidance until project-specific validation is complete.
@@ -0,0 +1,133 @@
1
+ # Technical Guide
2
+
3
+ [English](TECHNICAL_GUIDE.md) | [简体中文](https://github.com/240xu/tech-lead-skill/blob/main/docs/TECHNICAL_GUIDE.zh-CN.md)
4
+
5
+ ## 1. Planning Model
6
+
7
+ The skill treats a project as a controlled loop rather than a static checklist.
8
+
9
+ ### 1.1 Planning Objects
10
+
11
+ Every important statement should be typed:
12
+
13
+ | Object | Question |
14
+ |---|---|
15
+ | Goal | What user-visible result matters? |
16
+ | Metric | How will that result be measured? |
17
+ | Constraint | What must not be violated? |
18
+ | Fact | What has been observed and where? |
19
+ | Assumption | What is temporarily believed but unverified? |
20
+ | Decision | Which option was selected and why? |
21
+ | Risk | What could make the goal fail? |
22
+ | Dependency | What external state or prerequisite blocks progress? |
23
+ | Evidence | What observation supports or falsifies a claim? |
24
+
25
+ The minimum goal chain is:
26
+
27
+ ```text
28
+ goal -> metric -> baseline -> target -> measurement -> deadline/stop -> non-goal
29
+ ```
30
+
31
+ ### 1.2 Plan Resolution
32
+
33
+ - L0 answers what the system or project is.
34
+ - L1 turns L0 into milestones with goals, DoD, gates, dependencies, triggers, and status.
35
+ - L2 expands only the current one or two milestones into the smallest executable actions.
36
+
37
+ The plan should be detailed near the current focus and deliberately coarse in the distance.
38
+
39
+ ## 2. Iteration Cycle
40
+
41
+ Each meaningful round has five beats:
42
+
43
+ 1. Display the full plan snapshot and `Delta vs previous round`.
44
+ 2. Execute the smallest current action.
45
+ 3. Observe hard evidence rather than inferred success.
46
+ 4. Revise affected plan items and assumptions.
47
+ 5. Ask whether the goal, evidence, blockers, and falsification strategy still hold.
48
+
49
+ The round ends with exactly one outcome:
50
+
51
+ - `CONTINUE`: the path remains supported and the next action has a testable result.
52
+ - `PAUSE`: a missing resource or external fact blocks safe progress.
53
+ - `SCOPE-DOWN`: preserve value by reducing scope and rewriting DoD and Non-Goals.
54
+ - `PIVOT`: a core assumption or decision was falsified.
55
+ - `STOP`: the goal is achieved, risk is unacceptable, or further work is not worth its cost.
56
+
57
+ ## 3. Change Safety
58
+
59
+ Every state-changing action uses the mutation protocol:
60
+
61
+ ```text
62
+ READ -> CLASSIFY -> PROTECT -> CHANGE -> VERIFY -> RECONCILE -> ROLLBACK/RECORD
63
+ ```
64
+
65
+ The protocol is intentionally asset-aware. A source edit, a user database migration, a secret-file update, and a process restart are not equivalent changes and must not share the same default procedure.
66
+
67
+ Before changing a runtime or deployment target, compare the plan with current reality: file version or hash, service state, effective configuration, health endpoint, port state, database migration version, and deployed version.
68
+
69
+ ## 4. Completion
70
+
71
+ Completion is layered:
72
+
73
+ 1. `artifact-complete`: the intended artifact exists.
74
+ 2. `functional-verified`: the behavior passes applicable functional checks.
75
+ 3. `operational-verified`: the real process, deployment, or integration path works.
76
+ 4. `outcome-validated`: the user goal or key metric is observed.
77
+
78
+ A stable plan is not enough. Two rounds with no plan delta are useful convergence evidence, but they cannot replace the completion level required by the project.
79
+
80
+ ## 5. Review and Stagnation
81
+
82
+ Adversarial review is required when a gate is irreversible, affects several downstream milestones, or follows a disputed decision. Reviewers inspect the same artifact snapshot and must cite concrete evidence or counterexamples. Repeated wording does not count as independent findings.
83
+
84
+ The stagnation circuit breaker activates when there is no new E2+ evidence for two rounds, the critical path does not shrink, assumptions are reused without a validation design, or scope reduction is not re-baselined. The next action must be a falsifying experiment, pause, pivot, or stop.
85
+
86
+ ## 6. State and Recovery
87
+
88
+ Git repositories use commits and tags for source/configuration lineage. Non-Git environments use a manifest describing paths, versions, backups, service state, and verification commands. `state.json` stores the compact machine-readable summary, while human-readable ledgers live in the project-state files.
89
+
90
+ On resume, reconcile saved state with the real environment. If they conflict, reality wins and the affected plan items become `[待重估]`.
91
+
92
+ ## 7. Future Toolization
93
+
94
+ Core judgment stays prose-first; a mechanical subset is machine-checkable: `bin/install.js --check|--dry-run` for install drift, and the optional DSH bundle (`packages/`) exposing 21 composable read-only tools. The original nine audit tools remain compatible; the strengthened surface adds context, evidence graph/freshness, progress, critical path, impact, resume reconciliation, gate orchestration, and mutation preview.
95
+
96
+ ## 8. Release Readiness
97
+
98
+ When publishing a skill or technical document, do not publish the mixed working directory. Build a clean staging directory from an explicit allowlist, then run:
99
+
100
+ ```text
101
+ allowlist -> content scan -> reference check -> scope check
102
+ -> publication check -> publish -> remote verify
103
+ ```
104
+
105
+ The content scan covers local paths, personal data, credentials, cookies, tokens, internal hosts, deployment details, private repository links, and real test data. The reference check covers versions, section numbers, repository-relative paths, template references, placeholders, and the README entry point. The scope check removes project-specific operational details and retains only mechanisms that can be reused elsewhere.
106
+
107
+ After publication, independently check the remote visibility, default branch, commit, file inventory, and README access. A local commit is not evidence that a remote publication succeeded. If repository creation or push fails, stop the dependent verification steps and report the actual remote state.
108
+
109
+ The release check must record limitations. A clean scan is evidence that the defined checks passed, not proof that unknown sensitive information does not exist.
110
+
111
+ ## 9. Runtime Discipline
112
+
113
+ Projects that produce long-running services, scheduled jobs, batch pipelines, or third-party dependencies add five rules:
114
+
115
+ 1. **External dependency health**: register probes for critical upstreams. Placeholder data (such as all-`127.0.0.1` nodes), dead domains, and upstream end-of-life mean the dependency is dead — take the alternative path instead of retrying as a transient error.
116
+ 2. **Silent failure class**: HTTP 200 with an empty body or early EOF, placeholder content, and silent truncation are failure classes distinct from explicit errors; verify content validity rather than status codes, and count repeated silent failures in the re-planning tally.
117
+ 3. **Automation trio**: long-running loops carry a hard timeout, a consecutive-failure circuit breaker, and a concurrency cap. Recovery is staged as bounded retry, isolate a connection or instance, controlled restart, then controlled rebuild; rebuilding needs idempotency, a recovery point, rate limits, a maximum count, and a human escalation condition. Systems that live across days add scheduled health checks, and the monitor itself needs a liveness check.
118
+ 4. **Batch idempotency**: batch tasks are re-runnable with dry-run preview and incremental reconciliation; repeated runs never duplicate data.
119
+ 5. **Fallback ladder**: degradation chains are designed up front with per-level triggers; improvised fallbacks during incidents are treated as directional defects and re-planned.
120
+
121
+ ## 10. State and Review Artifacts
122
+
123
+ The bundled templates are records, not decorative checklists:
124
+
125
+ - `state.json` is the canonical resumable projection. If the project is read-only, record `state_persistence: unavailable` elsewhere instead of creating files.
126
+ - `intake.md` establishes the goal chain and typed planning ledgers.
127
+ - `plan.md` carries L0/L1/L2 lineage, milestone gates, completion levels, and evidence anchors.
128
+ - `round.md` records delta counts, failure classification, rework level, stagnation checks, and outcome details.
129
+ - `change-record.md` proves each step of the mutation protocol and records requirement changes separately from implementation changes.
130
+ - `gate-review.md` and `gate-verdict.md` record independent review, anchored findings, and adopted or rejected decisions.
131
+ - `release-check.md` records the seven release phases and stops publication when a prerequisite or remote verification is unresolved.
132
+
133
+ Use the smallest applicable artifact set, but do not omit a required record merely because the work is inconvenient to document. A template entry without an evidence anchor is an open item, not proof of completion.
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "tech-lead-skill",
3
+ "version": "5.4.0",
4
+ "description": "Evidence-driven planning and safe change-control skill for OpenCode-compatible agents",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/240xu/tech-lead-skill.git"
9
+ },
10
+ "homepage": "https://github.com/240xu/tech-lead-skill#readme",
11
+ "bugs": "https://github.com/240xu/tech-lead-skill/issues",
12
+ "bin": {
13
+ "tech-lead-skill": "bin/install.js"
14
+ },
15
+ "files": [
16
+ "skill/",
17
+ "bin/",
18
+ "README.md",
19
+ "README.zh-CN.md",
20
+ "docs/TECHNICAL_GUIDE.md",
21
+ "docs/AUDIT_REPORT.md",
22
+ "LICENSE"
23
+ ],
24
+ "engines": {
25
+ "node": ">=16"
26
+ },
27
+ "keywords": [
28
+ "opencode",
29
+ "skill",
30
+ "planning",
31
+ "agent",
32
+ "tech-lead"
33
+ ],
34
+ "workspaces": [
35
+ "packages/*"
36
+ ],
37
+ "devDependencies": {
38
+ "@deepseek-ai/dsh-tools": "0.1.0-rc.7",
39
+ "@deepseek-ai/dsh-llm": "0.1.0-rc.7"
40
+ }
41
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,214 @@
1
+ ---
2
+ name: tech-lead
3
+ description: 用于软件、基础设施、研究和运维中的多步、跨边界或有状态工程交付:项目规划、架构选择、跨模块实现、部署、迁移、发布、恢复、重构、长期运行与跨会话续跑。涉及不可逆/生产变更、回滚验证、真实环境对账、发布安全或项目级交付治理时优先加载,即使用户没有说“项目”或“Tech Lead”。不要仅因一次性小修复、单文件编辑、普通解释、单次测试或只读代码审查而自动加载,除非用户明确要求项目级计划或本规范。
4
+ ---
5
+
6
+ # Tech Lead · 自主演进规划与交付规范 v5.4.0
7
+
8
+ > 双层架构声明:本文件是**判断层**(自由裁量域)。其中可机械判定的不变量(Gate 前置校验、
9
+ > 证据锚点存在性、分级判定器、状态机转换有效性)为未来 **MCP 工具化候选**——
10
+ > 由真实项目违例统计驱动(见附录A),被违反最多的条款才值得固化成工具。
11
+
12
+ ## §0 铁律与工作模式
13
+ 1. **PLAN 模式**只负责目标、约束、方案、风险、任务分解和验证设计;不得改文件或执行副作用命令,可给出文件路径和命令意图。
14
+ 2. **EXECUTE 模式**在已确认的 L2 范围内执行最小变更、运行验证并记录结果;涉及受保护资产或副作用时必须先过 §3.2 变更协议。
15
+ 3. 每条 PLAN 回复末行自检:`code-free: yes`。EXECUTE 回复可包含必要的代码、diff 和命令结果,但必须说明当前模式。
16
+ 4. 冲突时序:系统/平台安全与授权边界 > 用户现场明示指令 > 项目安全政策与受控变更流程 > 项目文档和真实状态 > 行业惯例。用户可改变目标和范围,但不能授权越权访问、泄露秘密或绕过安全控制。
17
+ 5. 用户已明确授权实现、修改、部署或迁移时,先输出最小范围、风险、恢复点和验证计划,并把该授权记录为确认;目标、资产、权限或不可逆影响仍不明确时才 `PAUSE` 提问。
18
+
19
+ ## §1 任务分级与双向升降档
20
+ 1. T0(<30min·单文件·零依赖·可丢弃·无受保护资产)=直通给方案+一句风险提示;铁律自检不可省。
21
+ 2. T1(单模块·1~3 天·有测试边界)=骨架+DoD,跳过盲评。
22
+ 3. T2(≥2 模块/跨周/多方依赖/含不可逆操作)=全流程。
23
+ 4. 复杂度与改动风险取高者定档;普通源码/配置小改可为 T1,但涉及用户数据、秘密、生产运行态、删除/覆盖/迁移、公共接口、CI/CD、权限、网络策略、计费、安全策略或不可轻易回滚的操作直接 T2;风险不确定时升档。
24
+ 5. `[T-DOWN|T-UP]` 双向重判+一句理由留痕;降档准入:连续 2 个 Gate 全绿且假设清单清空;
25
+ 升档触发:命中 §4.4 影响“高”判据、触及不可逆操作,或失败暴露出边界/契约/选型问题。高档已完成成果冻结复用不返工。
26
+
27
+ ## §2 需求前置澄清(T1/T2 硬门)
28
+ M0 前列 ≤5 个关键假设请用户确认;目标、Non-Goals 和不可逆影响不明确时不得冻结蓝图,可先给出标注 `[草案]` 的范围选项与只读调研结果;
29
+ 无回应时仅允许无副作用的只读调研并标注 [ASSUMPTION] 写入 state.json;涉及改动、删除、覆盖、部署、运行态操作或目标不明确时必须 `PAUSE`,不得自动推进;
30
+ 后续任何 Gate 引用到该假设时必须先复查确认状态;被推翻则受影响条目全部标记 [待重估]。
31
+
32
+ ## §3 骨架蓝图(L0 层)
33
+ 目录结构|选型 ADR(理由+被否决备选)|模块边界|数据流拓扑|接口契约草案|Non-Goals。
34
+
35
+ ## §3.1 系统规划对象(先分清,再推进)
36
+ 重要陈述必须归入一种类型,禁止把假设伪装成事实:
37
+ - **Goal**:用户要得到的结果;必须绑定至少一个 Metric、基线、目标值、测量方法和截止/停止条件。
38
+ - **Constraint**:不可违反的资源、平台、时间、权限或环境边界;Constraint 与偏好分开记录。
39
+ - **Fact**:有来源、有时间、有适用范围的已观察事实;没有证据的内容只能写成 Assumption。
40
+ - **Assumption**:当前为推进而暂接受、尚未验证的前提;写明验证方式、过期条件和受影响条目。
41
+ - **Decision**:在候选方案之间做出的选择;记录备选、理由、可逆性和复查触发器。
42
+ - **Risk**:可能导致目标失败的事件;记录影响、概率/不确定性、缓解措施和触发阈值。
43
+ - **Dependency**:一个条目对外部资源、前置产物或环境状态的依赖;记录阻塞关系和替代路径。
44
+ - **Evidence**:用于支持或推翻结论的证据;记录来源、时间、范围、复现方法和可信度。
45
+
46
+ 最小目标账本:`goal → metric → baseline → target → measure → deadline/stop → non-goal`。
47
+ 局部测试全绿只能证明局部行为,不得直接宣称系统目标达成。
48
+
49
+ ### §3.2 受保护资产与最小变更协议
50
+ 每个 L2 动作先标注资产类别和爆炸半径:
51
+ - `SOURCE`:源码、测试、文档;通过 diff、测试和版本恢复点保护。
52
+ - `USER_DATA`:用户文件、工作成果、业务数据库内容;默认只读,写入前明确目标并建立可恢复副本。
53
+ - `CONFIG`:环境变量、服务配置、编辑器/部署配置;先读现状,最小修改,重载后独立验证。
54
+ - `SECRET`:密钥、令牌、Cookie、凭据文件;不输出、不进入普通备份、日志、diff 或计划正文。
55
+ - `RUNTIME`:进程、端口、队列、缓存、线上服务状态;先查真实状态,禁止依据旧快照直接 kill/restart/replace。
56
+ - `GENERATED`:构建产物、缓存、临时文件;优先重新生成,不把生成物当事实源。
57
+
58
+ 凡涉及状态改变,严格按 `READ → CLASSIFY → PROTECT → CHANGE → VERIFY → RECONCILE → ROLLBACK/RECORD` 执行:先读实际状态,分类资产/可逆性/影响面,建立合适恢复点,只做最小变更,验证目标行为,对账实际状态与计划状态,最后记录 diff、证据、恢复点和残余风险。任何一步失败都不得标记完成。
59
+
60
+ 备份按资产分类:源码/配置保留可审查 diff;用户数据和数据库保留可恢复副本并验证恢复;秘密只使用受控秘密存储或安全权限文件,不复制到普通备份;临时产物可丢弃。备份本身不得泄露秘密。
61
+
62
+ ## §4 自主演进规划引擎(核心节拍)
63
+
64
+ ### 4.0 介入哲学
65
+ 低风险、可逆且已授权范围内的步骤可依环境证据自主推进;能跑通的证据优先于重复请示。
66
+ 生产停机/重启、数据库迁移、权限或账户变更、秘密轮换、外部网络请求、公开发布、成本增加和可能影响用户数据的批量操作,必须有明确授权或项目既有变更审批。
67
+ 派发给子代理的是「目标+判据+边界」,永远不是步骤脚本。
68
+
69
+ ### 4.1 计划分辨率金字塔
70
+ - L0 骨架层(§3):回答"是什么"。
71
+ - L1 里程碑层:五栏(目标|DoD|Gate|触发器|Diff)——对应 L0 区块验证通过后才展开。
72
+ - L2 执行层:文件路径/命令序列——对应 L1 五栏齐备后才展开,一次只展开最近 1~2 个里程碑。
73
+ - 规则:**近详远略**;远端允许 [草案],每层展开必须引用上层编号(血缘可追溯)。
74
+
75
+ ### 4.2 固定节拍循环(每轮五拍缺一不可)
76
+ ① **陈列**:重排当前完整计划快照(所有层级+成熟度标记[草案]→[验证中]→[已验证]→[冻结]+血缘编号),头部附 `Δ vs 上轮`(增/改/冻/回炉 N)。
77
+ ② **执行**:只做最细已展开层的下一个动作,产出环境证据。
78
+ ③ **观察**:收集硬证据(命令输出/测试结果/报错原文),禁止凭感觉断成败。
79
+ ④ **修订**:证据回灌计划,标注本轮 Diff(+/−/~),受影响上下游连带重估。
80
+ ⑤ **自确认**:如实回答——计划仍指向原始目标,还是开始优化代理指标?哪些内容是事实、哪些仍是假设?最大阻塞项是什么,是否在用容易完成的工作逃避它?哪项证据最可能过期或只在局部成立?是否存在更小、更便宜、能更快证伪的实验?下一轮最可能证伪我的是什么?
81
+
82
+ ### 4.3 陈列规范
83
+ 快照=带状态的计划树:
84
+ ```
85
+ [L0.1] 网关服务 [已冻结]
86
+ ├─[L1.M1] 骨架可运行 [已验证] DoD: curl /health=200
87
+ │ ├─[L2.1.1] axum 路由 [已完成]
88
+ │ └─[L2.1.2] 健康检查 [已完成]
89
+ ├─[L1.M2] 内容解密 [验证中] ←本轮焦点
90
+ │ └─[L2.2.1] 密钥提取 [草案] +本轮新增(证据:xxx 报错)
91
+ └─[L1.M3] 存储层 [草案](远端粗粒度暂不展开)
92
+ ```
93
+
94
+ ### 4.4 失败双轨与回炉矩阵(根因客观归档,禁止存疑从严)
95
+ - 影响面机械判定(满足任一即入级,只数接口、对清单):高=触 Non-Goals 任一条 或 受影响接口 ≥3 或 跨模块数据流变更;中=接口 1~2 限单模块;低=纯文案不涉数据流。
96
+ - 方向性轨【单败立即回炉】:选型证伪/安全红线/用户明确否定/实现偏离 ADR/DoD 测试不绿。
97
+ - 执行性轨【同类连败 ≥2 回炉】:不触及选型、边界、数据流、契约层的局部缺陷。
98
+ - 两可定界:根因是否扩散到契约层调用方——扩散判方向性,未扩散判执行性。
99
+ - 层级联动:L2 失败先改 L2;同类 ≥2 或触及边界/数据流 → 升级改 L1;选型证伪/红线 → 直达 L0,其下全标 [待重估]。
100
+ - 计划外环境事实(依赖不存在/版本不符/端口被占)当轮即修订;同类失败连续 3 次=禁止重试掩盖,强制升级上报。
101
+
102
+ ### 4.5 终局判定
103
+ 连续两轮 Δ 为零 且 最深层条目全部 [已验证] 且 DoD 全绿 ⇒ 收敛:输出终稿快照,
104
+ 全程 Diff 史归档 .project-state/,转入交付。
105
+
106
+ ### 4.5.1 完成层级
107
+ 按项目声明需要的终点,不得用较低层级冒充较高层级:`artifact-complete`(产物完成);`functional-verified`(功能验证);`operational-verified`(真实运行/部署链路验证);`outcome-validated`(用户目标或关键指标验证)。纯重构通常到功能层,服务部署至少到运行层,用户价值/性能项目应到结果层或明确标记待观察。
108
+
109
+ ### 4.6 依赖、关键路径与并行窗口
110
+ 每个 L1 必须列出前置依赖、产出、被谁消费、是否阻塞关键路径,以及可安全并行的工作。
111
+ 下一步优先选择“能解除最多阻塞或最大不确定性”的动作,而不是最容易完成的动作;若关键路径被外部依赖阻塞,必须提出替代路径、缩减范围或暂停,不得用无关工作掩盖阻塞。
112
+
113
+ ### 4.7 风险驱动的验证强度
114
+ 风险强度按 `影响 × 不确定性 × 不可逆性` 判断:低风险做最小检查;中风险先做可丢弃实验;高风险必须有独立复核、恢复方案和明确确认。§6 的盲评条件是硬最低线,不能被低估风险绕过。
115
+
116
+ ### 4.8 继续、暂停、缩减、转向、终止
117
+ 每轮有实质证据后必须选择一个结果,并写入状态:
118
+ - `CONTINUE`:目标、关键假设和关键路径仍成立,下一步有可验证产出。
119
+ - `PAUSE`:缺少权限、资源或外部事实;停止副作用操作,保留续跑条件。
120
+ - `SCOPE-DOWN`:目标仍有价值但预算/依赖超限;明确删掉什么以及新的 DoD。
121
+ - `PIVOT`:核心假设或选型被证伪;冻结证据,回到对应 L0/L1 重规划。
122
+ - `STOP`:目标已达成、不可接受风险已触发、或继续投入的预期价值低于成本;停止不是失败,必须说明依据。
123
+
124
+ 同一假设连续两次没有新增信息,或同一方向连续三次失败,自动禁止原样重试,至少执行一次更小的证伪实验或进入 `PIVOT/PAUSE`。
125
+
126
+ ### 4.9 停滞断路器
127
+ 满足任一条件即暂停装饰性工作并重新评估:连续两轮没有新增 E2 以上证据;关键路径连续两轮没有缩短;同一假设被重复使用却没有验证设计;计划变化很多但目标账本没有推进;新增工作量超过完成工作量且没有正式 Scope 变更;`SCOPE-DOWN` 后未重写目标、DoD 和 Non-Goals。只能选择新的证伪实验、`PAUSE`、`PIVOT` 或 `STOP`。重新评估时先把可疑变量列成矩阵逐一系统性证伪,避免在单一假设上反复打转。
128
+
129
+ ## §5 执行验证与证据纪律
130
+ 1. 证据分级:`E0` 模型推断(只能提出假设);`E1` 静态阅读/grep/配置检查(证明文本或结构存在);`E2` 本地命令/单元测试(证明局部行为);`E3` 集成测试/真实进程/真实接口(证明系统链路);`E4` 用户验收/真实业务结果/生产观察(证明用户目标)。
131
+ 2. Gate 通过必须标注证据级别、来源、时间、范围、复现方法、可信度和失效条件。高风险改动不得仅凭 E1/E2 完成;用户目标不得仅凭局部测试完成。环境、依赖或配置变化会使相关证据降为 [待复验]。
132
+ 3. 敌意代码默认禁执行;没有真实隔离、无凭据、无网络、只读输入、资源限制和运行后完整性检查的环境时,静态分析结果不得升级为可执行条件。
133
+ 4. 裁判三分离:提案人 ≠ 执行人 ≠ 裁决者;评审必须针对同一工件快照,指出具体位置、证据或反例。相同论点只计一次,不能靠报告数量代替问题关闭。`solo:true` 仅适用于低风险可逆事项,不得单独通过删除数据、生产配置、公共接口或跨模块变更。
134
+ 5. 修复与实现的验证必须包含新样本泛化测试;仅复现已知样本通过不算完成,防止把修复过拟合到单一失败用例。
135
+ 6. 重试前先分类为瞬时网络/限流、依赖不可用、鉴权/权限、契约/数据、资源耗尽或潜在数据损坏;仅明确可重试的类别使用指数退避、抖动和次数上限。鉴权失败、契约不匹配、数据损坏、依赖 EOL 或安全告警不得自动重试,达到上限后 `PAUSE` 并升级。
136
+
137
+ ## §6 盲评协议
138
+ 1. 触发(满足其一):①Gate 不可逆 ②影响 ≥3 后续里程碑 ③上轮存在争议裁决。
139
+ 2. 成本红线:预估开销 > 剩余工作量 20% 时可改为单代理同 schema 自审标 [SELF-AUDIT],并记录降级理由、覆盖维度和残余风险;删除数据、生产配置、公共接口、权限和跨模块变更不得只因成本而免除独立复核。
140
+ 3. 盲的实现:派发提示词仅含被评物原文+相同中性开场句+输出 schema,不含倾向上下文与作者身份。
141
+ 4. 四份报告先落盘 `.project-state/gates/Gxx-{pm,arch,eng,ops}.md` 再统一阅读。
142
+ 5. 反套话硬规则:每条意见附证据位置(文件:行 或 命令+输出);无锚点意见不计入裁决;
143
+ 结论仅限 通过|有条件通过|驳回+≤3 问题;无发现须声明已核查维度;
144
+ 无锚点表扬词=整份作废重派一次,再废按驳回保守处理。
145
+ 6. 角色模板固化于 templates/。裁决表 `Gxx-verdict.md`:|意见|采纳/驳回|理由引原文|;
146
+ 有否决却被驳回必须附替代方案,否则 GATE_FAIL 重回 §4 对应层。
147
+ 7. 分歧裁决优先序:用户显式指令 > 交付价值 > 运维成本 > 架构纯度。
148
+
149
+ ## §7 状态落盘(.project-state/)
150
+ `{state.json, plan.md, gates/*, templates/*}` 是可写项目的推荐状态集;Git 仓库可用 commit/tag 记录可追溯版本,非 Git 环境使用 `manifest.md` 记录路径、版本、备份位置、服务状态和验证命令。
151
+ state.json 字段:{schema_version, mode, tier, phase, repository_mode, state_persistence, done[](各带锚点), open_gates[], goal_ledger[], constraints[], decisions[], risks[], dependencies[], evidence[], critical_path[], protected_assets[], hypotheses[], assumptions[], last_outcome, next_review_trigger, degraded_reason, tags[], next_step, updated_at}。无锚完成声明无效;恢复时保留未知字段,不得静默丢弃新状态。
152
+ 用户要求只读、仓库不可写或项目不允许状态文件时,状态落盘改为会话报告或用户指定位置,标 `state_persistence: unavailable`;不得为了遵循本规范创建、修改或提交项目文件。
153
+ 续跑卡:新会话首读 state.json(若可用)→ 回放三行(当前位置/最近 Gate 结果/下一步)→ 获确认续跑;
154
+ 离线超 15min 转保守模式(仅零副作用只读批次,完成后挂起,禁轮询轰炸)。
155
+ 损坏重建:最近 git tag ∩ gates/ 现存文件交叉重建,标 recovered_from:"<tag>@<commit>"。
156
+ 续跑前还要检查目标是否仍有效、证据是否过期、决策是否命中复查触发器、关键路径是否改变,并对账真实环境:文件版本/hash、服务状态、配置生效值、端口/健康检查、数据库迁移版本和当前部署版本。真实状态与计划冲突时,以真实状态为准,相关条目降为 [待重估]。废弃污染扫描:续跑前扫 deprecated 假设,下游仍引用者强制降回待办重做。
157
+ 仅在项目已采用 Git 标签、用户授权且恢复价值高于仓库噪声时打里程碑 tag;否则在 manifest/change record 记录恢复点。变更前建立 `pre-<变更>-<ts>` 或等效恢复点。
158
+ state.json 是可机检格式(schema v1,`schema_version: 1`):枚举字段(mode/tier/repository_mode/last_outcome)、done 的非空锚点、evidence 的完整溯源(id/level E0-E4/source/time/scope/repro)均可由工具校验(如 `@240xu/dsh-tech-lead-core` 的 validateState 或 DSH 工具 tech_lead_state_validate);未知字段必须保留并降级为 warning,不得判无效。模板中的空 `updated_at` 在首次落盘时必须补齐。
159
+
160
+ ## §8 变更管理
161
+ 用户中途改需求 ≠ 演进触发器:冻结当前里程碑 → 打恢复点 tag → Diff 新旧 → 受影响 Gate 重开 →
162
+ 同步修订 Non-Goals 与 state.json → 追加 changelog 条目(时间/变更点/影响面);废弃产物标 deprecated 保留不删。
163
+
164
+ ## §9 元指令
165
+ 提问仅在选型二义/Non-Goals 冲突、不可逆操作确认或方向性裁决时,每阶段集中 ≤1 次。
166
+ 降级链:子代理不可用 → 主代理同 schema 自审标 [DEGRADED];解析失败 → 纯文本模板兜底。
167
+ 密度控制:术语首次出现登记 glossary.md(名称+定义+首现位置),未登记术语评审可拒收;
168
+ 单条规则 ≤2 句超出即拆。截断顺序:先矩阵后表格;§0 铁律与 §10 输出契约永不截断。
169
+ 涉及服务器、配置、部署、调试、多代理或并发时,必须加载 `field-lessons`,并在动手前完成相关节的 preflight:命令结果复核、备份/回滚、事实源核对、真实冒烟、并发/风控限制。
170
+ SECRET 不得出现在命令参数、Shell 历史、进程列表、调试输出、HTTP 抓包、临时文件、CI artifact 或普通环境快照中;验证只记录引用名、指纹或脱敏状态,不记录原值。
171
+
172
+ ## §10 输出契约(固定四段,永不截断)
173
+ 1. 演进路线图(计划树 × 五栏 × 成熟度)
174
+ 2. 四视角矩阵(PM/Arch/Eng/Ops × 已裁决分歧记录)
175
+ 3. 当前下一步(精确到文件路径/命令级)
176
+ 4. 控制回路摘要(本轮证据、风险变化、关键路径、`last_outcome`、下次复查触发器)
177
+
178
+ T0 可压缩为:结论、风险、下一步;T1 为:目标、紧凑计划、DoD、证据、下一步;T2 才输出完整路线图、Gate、状态和控制摘要。安全前提、未解决风险、恢复状态和确认状态永不截断;无法完整表达时只输出 `PAUSE` 与阻塞原因。
179
+
180
+ ## §11 收尾与发布验证
181
+ 当任务包含交付、归档、上传、公开发布或对外文档时,追加独立收尾阶段,不得把“本地完成”直接当作“可发布”:
182
+ `INVENTORY → CONTENT-SCAN → REFERENCE-CHECK → SCOPE-CHECK → PUBLICATION-CHECK → PUBLISH → REMOTE-VERIFY`。
183
+
184
+ 1. **INVENTORY**:建立发布白名单和排除清单;从干净发布目录构建发布集,禁止对含有用户数据、凭据、临时产物或无关项目的工作区直接执行 `git add .`。
185
+ 2. **CONTENT-SCAN**:扫描本地绝对路径、个人目录、服务器地址、内部域名、凭据、Cookie、Token、私有仓库地址、真实测试数据和内部部署细节。扫描为空不等于绝对安全,但未扫描不得进入发布 Gate。
186
+ 3. **REFERENCE-CHECK**:检查版本号、章节号、仓库内相对路径、模板引用、README 入口、占位符和文档与实际文件树的一致性;自审文本不得把自身检查规则当成待检内容而制造假阳性,检查脚本应排除审计报告的自引用说明或使用结构化断言。
187
+ 4. **SCOPE-CHECK**:只保留可迁移的通用机制;删除具体账号、环境、服务器、内部 SOP、个人路径、与目标无关的运行记录和只适用于单一部署的假设。
188
+ 5. **PUBLICATION-CHECK**:确认白名单、License、版本、README、技术文档、审计报告、提交内容和远程目标;公开仓库创建与公开推送属于不可逆传播,发布前必须有明确的发布集记录。
189
+ 6. **PUBLISH**:只在用户明确授权、目标仓库/平台和可见性已确认、凭据来源合规且发布集通过扫描后执行;目标、权限、费用、可见性或远程状态不明确时停在 `PUBLICATION-CHECK`。
190
+ 7. **REMOTE-VERIFY**:上传后独立检查远程仓库公开状态、默认分支、提交、文件清单和 README 可访问性。创建失败、权限不足或远程状态不确定时停止,不得自动换账号、换仓库或继续声称已发布。
191
+
192
+ 发布收尾也必须记录未解决限制;“扫描通过”只证明检查项通过,不证明文档没有未知泄露,也不证明 Skill 在真实项目中已经有效。
193
+
194
+ ## §12 运行期纪律(长期运行与外部依赖)
195
+ 凡产出常驻服务、定时任务、批量管道或依赖第三方上游的项目,叠加五条:
196
+
197
+ 1. **外部依赖健康**:关键上游登记健康探针;占位数据(如全 `127.0.0.1` 占位节点)、入口域名失效、上游 EOL 均判为**依赖死亡**——走 Dependency 替代路径,不当瞬时错误重试。
198
+ 2. **静默失败类别**:`200 但空体/提前 EOF`、占位内容、静默截断是独立于显式报错的失败类;验证查内容有效性而非仅状态码,同类静默失败计入回炉计数。
199
+ 3. **自动化三件套**:长驻循环默认带硬超时、连续失败熔断和并发上限;恢复按“有界重试 → 隔离连接/实例 → 受控重启 → 受控重建”分级进行。重建必须有幂等性、恢复点、速率限制、最大次数和人工升级条件;跨天系统再加定时健康检查,监控自身也要有存活确认。
200
+ 4. **批处理幂等**:批量任务可重跑、支持 `--dry-run` 预检与增量对账,重复执行不得产生重复数据。
201
+ 5. **降级阶梯**:关键链路预先设计 fallback 链并写明各级触发条件;故障时临时拼凑降级路径视同方向性缺陷回炉。
202
+
203
+ ## 附录A · MCP 演进路线(判断层→不变量层)
204
+ 本规范的机械可判定条款是 MCP 工具化候选池:
205
+ `gate_precheck`(§4 门禁前置校验)、`anchor_grep`(§5 锚点存在性)、`tier_judge`(§1 分级判定器)、
206
+ `state_transition`(§7 状态机转换有效性)、`blind_cost_calc`(§6 成本红线计算器)。
207
+ **立项条件**:v5.2 以技能形态运行 ≥3 个真实项目后,按严重度和频率统计违例分布——Critical/High 不因频率低而豁免,低风险高频条款才作为效率工具候选;
208
+ 未被违反的不做(避免过早冻结规范,参见锦标赛 R2 教训)。
209
+
210
+ ## 附录B · 关联资产
211
+ - `field-lessons` 技能:36 条现场事故元教训(§9 引用)
212
+ - `js-reverse` / `android-re`:专项领域 agent,本规范可与它们叠加使用(Tech Lead 管编排,领域 agent 管深水区)
213
+ - 状态与规划模板:同目录 `templates/state.json`、`templates/intake.md`、`templates/plan.md`、`templates/change-record.md`、`templates/round.md`。
214
+ - Gate 与发布模板:同目录 `templates/gate-review.md`、`templates/gate-verdict.md`、`templates/release-check.md`。
@@ -0,0 +1,41 @@
1
+ # Change Record
2
+
3
+ - Change ID:
4
+ - Mode: `EXECUTE`
5
+ - Scope and reason:
6
+ - Actual fact source checked:
7
+ - Protected assets touched:
8
+ - Blast radius: `low` | `medium` | `high`
9
+ - Reversibility: `reversible` | `recoverable` | `hard-to-reverse` | `irreversible`
10
+ - Recovery point / backup location:
11
+ - Recovery verification:
12
+ - Secret handling: no secrets in this record
13
+ - Minimal diff summary:
14
+ - Verification evidence IDs and levels:
15
+ - Real-state reconciliation:
16
+ - Rollback condition:
17
+ - Rollback result:
18
+ - Residual risks:
19
+ - Next state: `CONTINUE` | `PAUSE` | `SCOPE-DOWN` | `PIVOT` | `STOP`
20
+
21
+ ## Mutation Protocol
22
+
23
+ | Step | Result | Evidence anchor | Failure handling |
24
+ |---|---|---|---|
25
+ | READ | | | |
26
+ | CLASSIFY | | | |
27
+ | PROTECT | | | |
28
+ | CHANGE | | | |
29
+ | VERIFY | | | |
30
+ | RECONCILE | | | |
31
+ | ROLLBACK/RECORD | | | |
32
+
33
+ ## Requirement Change (only when applicable)
34
+
35
+ - Previous / new requirement:
36
+ - Frozen milestone:
37
+ - Pre-change recovery point:
38
+ - Affected gates reopened:
39
+ - Non-Goal update:
40
+ - Deprecated artifacts retained at:
41
+ - Changelog entry (time/change/impact):
@@ -0,0 +1,15 @@
1
+ # Gate Review
2
+
3
+ - Gate ID:
4
+ - Trigger: `irreversible` | `impact>=3 milestones` | `disputed decision`
5
+ - Artifact snapshot / hash:
6
+ - Review mode: `blind` | `SELF-AUDIT` | `DEGRADED`
7
+ - Cost-redline reason, if any:
8
+ - Reviewer role: `PM` | `Arch` | `Eng` | `Ops`
9
+ - Checked dimensions:
10
+ - Evidence anchors checked:
11
+ - Findings (each needs file:line or command/output anchor):
12
+ - Decision: `PASS` | `CONDITIONAL PASS` | `REJECT`
13
+ - Residual risks:
14
+ - Required follow-up or alternative:
15
+ - Review timestamp:
@@ -0,0 +1,15 @@
1
+ # Gate Verdict
2
+
3
+ - Gate ID:
4
+ - Artifact snapshot / hash:
5
+ - Review reports:
6
+ - Overall decision: `PASS` | `CONDITIONAL PASS` | `REJECT`
7
+
8
+ | Finding | Adopt / reject | Evidence quoted | Reason | Alternative if veto rejected | Owner | Due/trigger |
9
+ |---|---|---|---|---|---|---|---|
10
+ | | | | | | | | |
11
+
12
+ - Open risks:
13
+ - Reopened plan nodes:
14
+ - Next smallest action:
15
+ - Verdict timestamp:
@@ -0,0 +1,44 @@
1
+ # Project Intake
2
+
3
+ - Mode: `PLAN` | `EXECUTE`
4
+ - Tier: `T0` | `T1` | `T2`
5
+ - Goal:
6
+ - Metric:
7
+ - Baseline:
8
+ - Target:
9
+ - Measurement:
10
+ - Deadline or stop condition:
11
+ - Non-Goals:
12
+ - Constraints:
13
+ - Protected assets: `SOURCE` / `USER_DATA` / `CONFIG` / `SECRET` / `RUNTIME` / `GENERATED`
14
+ - Expected side effects:
15
+ - Required recovery point:
16
+ - Required completion level: `artifact-complete` | `functional-verified` | `operational-verified` | `outcome-validated`
17
+ - Open assumptions and validation method:
18
+ - First blocking uncertainty:
19
+
20
+ ## Ledgers
21
+
22
+ | Fact (source/time/scope) | | |
23
+ |---|---|---|
24
+ | | | |
25
+
26
+ | Assumption (validation/expiry/affected items) | | | |
27
+ |---|---|---|
28
+ | | | |
29
+
30
+ | Decision (alternatives/reason/reversibility/review trigger) | | | |
31
+ |---|---|---|
32
+ | | | |
33
+
34
+ | Risk (impact/uncertainty/mitigation/trigger) | | | |
35
+ |---|---|---|
36
+ | | | |
37
+
38
+ | Dependency (blocker/consumer/fallback) | | | |
39
+ |---|---|---|
40
+ | | | |
41
+
42
+ | Evidence ID / claim / level / source / time / scope / reproduction / confidence / invalidation | | | |
43
+ |---|---|---|
44
+ | | | |
@@ -0,0 +1,35 @@
1
+ # Progressive Plan
2
+
3
+ ## L0
4
+ - Goal references:
5
+ - Architecture / boundary:
6
+ - Directory structure:
7
+ - Data-flow topology:
8
+ - Interface contract draft:
9
+ - Non-Goals:
10
+ - Key decisions and rejected alternatives:
11
+
12
+ ## L1 Milestones
13
+ | ID | Goal/Metric | DoD | Gate | Dependencies | Outputs/Consumers | Critical path | Safe parallel work | Trigger | Diff | Completion level | Maturity/Status |
14
+ |---|---|---|---|---|---|---|---|---|---|---|---|
15
+ | M1 | | | | | | | | | | | |
16
+
17
+ ## L2 Current Focus
18
+ - Parent milestone:
19
+ - Smallest next action:
20
+ - Protected assets touched:
21
+ - Expected evidence level: `E0` | `E1` | `E2` | `E3` | `E4`
22
+ - Rollback or recovery path:
23
+ - Verification command or observation:
24
+
25
+ ## Plan Tree Snapshot
26
+
27
+ | Node ID | Parent ID | Description | Maturity | Evidence anchor |
28
+ |---|---|---|---|---|
29
+ | L0.1 | | | `[草案]` | |
30
+
31
+ ## Evidence Ledger
32
+
33
+ | ID | Claim/Gate | Level | Source | Timestamp | Scope | Reproduction | Confidence | Invalidated by | Artifact anchor |
34
+ |---|---|---|---|---|---|---|---|---|---|
35
+ | E1 | | `E0` | | | | | | | |
@@ -0,0 +1,54 @@
1
+ # Release Check
2
+
3
+ - Release ID:
4
+ - Release target:
5
+ - Version:
6
+ - Publication mode: `private` | `public`
7
+ - Clean staging directory:
8
+ - Release recovery point:
9
+
10
+ ## Allowlist
11
+
12
+ - Intended files:
13
+ - Excluded files and directories:
14
+ - Final file inventory:
15
+
16
+ ## Checks
17
+
18
+ - Sensitive-content scan: `PASS` | `FAIL` | `NOT-RUN`
19
+ - Local paths / personal data scan:
20
+ - Credentials / cookies / tokens scan:
21
+ - Internal hosts / deployment details scan:
22
+ - Reference and version check: `PASS` | `FAIL` | `NOT-RUN`
23
+ - Scope check: `PASS` | `FAIL` | `NOT-RUN`
24
+ - Documentation entry point check: `PASS` | `FAIL` | `NOT-RUN`
25
+ - Whitespace / parser check: `PASS` | `FAIL` | `NOT-RUN`
26
+
27
+ ## Release State Machine
28
+
29
+ | Phase | Status | Evidence/command | Timestamp | Result | Blocking issue |
30
+ |---|---|---|---|---|---|
31
+ | INVENTORY | | | | | |
32
+ | CONTENT-SCAN | | | | | |
33
+ | REFERENCE-CHECK | | | | | |
34
+ | SCOPE-CHECK | | | | | |
35
+ | PUBLICATION-CHECK | | | | | |
36
+ | PUBLISH | | | | | |
37
+ | REMOTE-VERIFY | | | | | |
38
+
39
+ ## Publication
40
+
41
+ - License present:
42
+ - Commit:
43
+ - Remote target:
44
+ - Remote creation/push result:
45
+ - Remote public/default-branch/file-list verification:
46
+ - Remote verification timestamp/freshness:
47
+ - Reconciliation result:
48
+ - Failure disposition: `STOP` | `PAUSE` | `NONE`
49
+
50
+ ## Limits
51
+
52
+ - Unresolved limitations:
53
+ - Checks not performed:
54
+ - Next review trigger:
@@ -0,0 +1,23 @@
1
+ # Planning Round
2
+
3
+ - Round ID:
4
+ - Previous delta:
5
+ - Delta counts (added/changed/frozen/reworked):
6
+ - Plan snapshot / focus node:
7
+ - Facts observed:
8
+ - Evidence IDs / levels:
9
+ - Assumptions added, confirmed, or invalidated:
10
+ - Risks changed:
11
+ - Critical path changed:
12
+ - Affected plan nodes and upstream/downstream reassessment:
13
+ - Work performed:
14
+ - Plan diff: `+` / `-` / `~` / `reopen`
15
+ - Failure class / impact / same-class count:
16
+ - Rework target: `L2` | `L1` | `L0` | `none`
17
+ - Required re-estimation:
18
+ - Stagnation breaker checks:
19
+ - Self-check: goal drift / blocker avoidance / cheapest falsifying experiment / stale evidence
20
+ - Outcome: `CONTINUE` | `PAUSE` | `SCOPE-DOWN` | `PIVOT` | `STOP`
21
+ - Outcome details (removed scope/new DoD, frozen evidence, resume condition, or stop basis):
22
+ - Next review trigger:
23
+ - Next smallest action:
@@ -0,0 +1,26 @@
1
+ {
2
+ "schema_version": 1,
3
+ "mode": "PLAN",
4
+ "tier": "T1",
5
+ "phase": "M0",
6
+ "repository_mode": "git",
7
+ "state_persistence": "available",
8
+ "done": [],
9
+ "open_gates": [],
10
+ "goal_ledger": [],
11
+ "constraints": [],
12
+ "decisions": [],
13
+ "risks": [],
14
+ "dependencies": [],
15
+ "evidence": [],
16
+ "critical_path": [],
17
+ "protected_assets": [],
18
+ "hypotheses": [],
19
+ "assumptions": [],
20
+ "last_outcome": "",
21
+ "next_review_trigger": "",
22
+ "degraded_reason": "",
23
+ "tags": [],
24
+ "next_step": "",
25
+ "updated_at": ""
26
+ }