@namewta/speculo 1.0.18 → 1.0.20
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/README.md +8 -7
- package/THIRD-PARTY-NOTICES.md +33 -0
- package/dist/src/agent-files.js +2 -2
- package/dist/src/agent-files.js.map +1 -1
- package/dist/src/agent-skills.d.ts +81 -0
- package/dist/src/agent-skills.js +530 -0
- package/dist/src/agent-skills.js.map +1 -0
- package/dist/src/cli.js +11 -3
- package/dist/src/cli.js.map +1 -1
- package/dist/src/config.js +5 -3
- package/dist/src/config.js.map +1 -1
- package/dist/src/doctor.js +7 -2
- package/dist/src/doctor.js.map +1 -1
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.js +23 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/manifest.d.ts +9 -0
- package/dist/src/manifest.js +45 -7
- package/dist/src/manifest.js.map +1 -1
- package/dist/src/refresh.js +40 -0
- package/dist/src/refresh.js.map +1 -1
- package/dist/src/structured.js +15 -4
- package/dist/src/structured.js.map +1 -1
- package/dist/src/transaction.d.ts +24 -3
- package/dist/src/transaction.js +191 -12
- package/dist/src/transaction.js.map +1 -1
- package/package.json +10 -4
- package/scripts/validate-skills.mjs +56 -0
- package/template/AGENTS.md +1 -1
- package/template/CLAUDE.md +1 -1
- package/template/canonical/canonical-specdev-goal-plan.md +158 -30
- package/template/canonical/canonical-specdev-grill-with-docs.md +155 -33
- package/template/canonical/canonical-specdev-spec.md +162 -161
- package/template/canonical/canonical-specdev-tickets.md +155 -29
- package/template/canonical/canonical-specdev-wayfinder.md +144 -29
- package/template/commands/handoff.md +16 -0
- package/template/commands/retro.md +12 -10
- package/template/skills/archive-and-consolidate/SKILL.md +163 -7
- package/template/skills/archive-and-consolidate/references/cleanup-rules.md +1 -1
- package/template/skills/docs-sync/references/agents/claude-redirect.md +8 -8
- package/template/skills/docs-sync/references/agents/content-contract.md +1 -1
- package/template/skills/docs-sync/references/agents/manifest-discovery.md +7 -7
- package/template/skills/docs-sync/references/agents/role-classification.md +4 -4
- package/template/skills/docs-sync/references/agents-contract.md +1 -1
- package/template/skills/engineering-standards-builder/SKILL.md +149 -9
- package/template/skills/engineering-standards-builder/agents/openai.yaml +2 -0
- package/template/skills/engineering-standards-builder/manifest.txt +2 -1
- package/template/skills/engineering-standards-builder/references/rules/09-mechanical-guardrails.md +9 -0
- package/template/skills/engineering-standards-builder/scripts/validate-builder.mjs +4 -7
- package/template/skills/git-history-squash/SKILL.md +87 -11
- package/template/skills/git-history-squash/agents/openai.yaml +2 -0
- package/template/skills/optimize-codex-config/SKILL.md +71 -11
- package/template/skills/retrospective/SKILL.md +43 -0
- package/template/skills/{speculo-retro → retrospective}/references/friction-taxonomy.md +22 -13
- package/template/skills/{speculo-retro → retrospective}/references/issue-drafting-sop.md +13 -21
- package/template/skills/source-code-zip/SKILL.md +44 -8
- package/template/skills/source-code-zip/references/{entry-procedure.md → cli-reference.md} +0 -43
- package/template/skills/upstream-fork-sync/SKILL.md +71 -8
- package/template/skills/{writing-great-skills → writing-for-agents}/GLOSSARY.md +1 -1
- package/template/skills/writing-for-agents/SKILL.md +22 -0
- package/template/skills/writing-for-agents/agents/openai.yaml +2 -0
- package/template/skills/{writing-great-skills/references/entry-procedure.md → writing-for-agents/references/authoring-principles.md} +2 -9
- package/template/workflows/learning/A-archive/A-archive.md +2 -5
- package/template/workflows/learning/A-assess-and-plan/A-assess-and-plan.md +2 -5
- package/template/workflows/learning/C-consolidate/C-consolidate.md +2 -5
- package/template/workflows/learning/G-goal/G-goal.md +5 -23
- package/template/workflows/learning/H-homework/H-homework.md +2 -5
- package/template/workflows/learning/I-init-setup/I-init-setup.md +4 -9
- package/template/workflows/learning/L-lesson/L-lesson.md +2 -5
- package/template/workflows/learning/Q-question/Q-question.md +16 -8
- package/template/workflows/learning/Q-question/inquiry-template.md +2 -0
- package/template/workflows/learning/Q-question/tools/validate-inquiry.mjs +112 -0
- package/template/workflows/learning/R-review/R-review.md +3 -6
- package/template/workflows/learning/README.md +2 -2
- package/template/workflows/learning/common/rules/knowledge-organization.md +1 -1
- package/template/workflows/learning/common/rules/mastery-policy.md +1 -1
- package/template/workflows/learning/common/skills/socratic-questioning/SKILL.md +1 -1
- package/template/workflows/ops/D-project-deploy/D-project-deploy.md +6 -2
- package/template/workflows/ops/H-host-manage/H-host-manage.md +10 -18
- package/template/workflows/ops/H-host-manage/references/host-profiles.md +21 -0
- package/template/workflows/ops/I-initialize/I-initialize.md +4 -4
- package/template/workflows/ops/README.md +22 -84
- package/template/workflows/ops/S-server-connect/S-server-connect.md +3 -3
- package/template/workflows/ops/V-inventory-view/V-inventory-view.md +2 -2
- package/template/workflows/ops/common/rules/deployment-layout.md +51 -0
- package/template/workflows/ops/common/rules/recovery.md +6 -0
- package/template/workflows/ops/common/rules/server-onboarding.md +6 -0
- package/template/workflows/ops/common/tests/test_ops.mjs +5 -8
- package/template/workflows/ops/common/tests/test_ops_bootstrap.mjs +71 -14
- package/template/workflows/ops/common/tests/test_ops_workspace.mjs +17 -8
- package/template/workflows/ops/common/tools/opslib/bootstrap.mjs +4 -4
- package/template/workflows/ops/common/tools/opslib/transport.mjs +3 -3
- package/template/workflows/person/M-mao-zedong-cognitive-os/M-mao-zedong-cognitive-os.md +13 -68
- package/template/workflows/person/S-steelman-deliberation/S-steelman-deliberation.md +11 -123
- package/template/workflows/person/S-steelman-deliberation/references/state-and-publication.md +86 -0
- package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +2 -17
- package/template/workflows/specdev/A-archive-and-consolidate/consolidation-interview.md +13 -4
- package/template/workflows/specdev/C-code-review/C-code-review.md +4 -15
- package/template/workflows/specdev/C-code-review/code-review-template.md +4 -0
- package/template/workflows/specdev/D-diagnose-bugs/D-diagnose-bugs.md +4 -20
- package/template/workflows/specdev/G-grill-with-docs/G-grill-with-docs.md +2 -2
- package/template/workflows/specdev/G-grill-with-docs/references/interview-procedure.md +6 -6
- package/template/workflows/specdev/I-implement/I-implement.md +2 -2
- package/template/workflows/specdev/I-implement/evidence-template.md +8 -0
- package/template/workflows/specdev/I-implement/references/implementation-procedure.md +9 -43
- package/template/workflows/specdev/I-implement/tdd-rules.md +4 -0
- package/template/workflows/specdev/I-init-setup/I-init-setup.md +16 -117
- package/template/workflows/specdev/I-init-setup/config-template.json +5 -1
- package/template/workflows/specdev/I-init-setup/references/first-setup.md +46 -0
- package/template/workflows/specdev/INDEX.md +2 -2
- package/template/workflows/specdev/L-learn-change/L-learn-change.md +11 -89
- package/template/workflows/specdev/L-learn-change/references/lesson-format.md +47 -0
- package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +2 -2
- package/template/workflows/specdev/P-goal-plan/planning-modes.md +1 -1
- package/template/workflows/specdev/P-prototype/P-prototype.md +7 -17
- package/template/workflows/specdev/P-prototype/logic-protocol.md +11 -0
- package/template/workflows/specdev/P-prototype/logic-template.md +27 -0
- package/template/workflows/specdev/P-prototype/project-preview-protocol.md +9 -0
- package/template/workflows/specdev/R-retro/R-retro.md +26 -0
- package/template/workflows/specdev/R-retro/retro-template.md +27 -0
- package/template/workflows/specdev/R-review-architecture/R-review-architecture.md +19 -57
- package/template/workflows/specdev/R-review-architecture/architecture-review-template.md +2 -1
- package/template/workflows/specdev/R-review-architecture/references/selected-design.md +23 -0
- package/template/workflows/specdev/R-review-architecture/review-rubric.md +2 -2
- package/template/workflows/specdev/README.md +17 -6
- package/template/workflows/specdev/S-spec/S-spec.md +13 -136
- package/template/workflows/specdev/T-tickets/T-tickets.md +6 -2
- package/template/workflows/specdev/T-triage/T-triage.md +32 -141
- package/template/workflows/specdev/T-triage/capture-protocol.md +1 -1
- package/template/workflows/specdev/T-triage/ci-security-protocol.md +11 -0
- package/template/workflows/specdev/T-triage/intake-protocol.md +29 -4
- package/template/workflows/specdev/T-triage/pr-delivery-protocol.md +13 -0
- package/template/workflows/specdev/T-triage/pr-record-template.md +39 -0
- package/template/workflows/specdev/T-triage/publish-protocol.md +1 -1
- package/template/workflows/specdev/T-triage/queue-protocol.md +7 -0
- package/template/workflows/specdev/T-triage/reconcile-protocol.md +1 -1
- package/template/workflows/specdev/T-triage/references/issue-pr-policy.md +23 -0
- package/template/workflows/specdev/T-triage/references/release-authentication.md +9 -0
- package/template/workflows/specdev/T-triage/references/release-notes-injection.md +21 -0
- package/template/workflows/specdev/T-triage/references/workflow-yaml-reference.md +37 -0
- package/template/workflows/specdev/T-triage/release-preflight.md +13 -0
- package/template/workflows/specdev/T-triage/release-protocol.md +12 -0
- package/template/workflows/specdev/T-triage/release-recovery.md +18 -0
- package/template/workflows/specdev/T-triage/remote-operations.md +25 -0
- package/template/workflows/specdev/T-triage/scripts/github-transport.mjs +208 -0
- package/template/workflows/specdev/T-triage/source-template.md +7 -0
- package/template/workflows/specdev/T-triage/triage-run-template.md +34 -0
- package/template/workflows/specdev/T-triage/triage-template.md +4 -1
- package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +2 -2
- package/template/workflows/specdev/common/rules/artifact-contract.md +7 -0
- package/template/workflows/specdev/common/rules/change-completion.md +6 -0
- package/template/workflows/specdev/common/rules/deployment-handoff.md +23 -0
- package/template/workflows/specdev/common/rules/workflow-routing.md +6 -0
- package/template/workflows/specdev/common/rules/workflow-state-and-lifecycle.md +1 -1
- package/template/workflows/specdev/common/schemas/config.schema.json +137 -26
- package/template/workflows/specdev/common/schemas/logic-prototype.schema.json +62 -0
- package/template/workflows/specdev/common/schemas/pull-request.schema.json +90 -0
- package/template/workflows/specdev/common/schemas/retrospective.schema.json +58 -0
- package/template/workflows/specdev/common/schemas/triage-run.schema.json +149 -0
- package/template/workflows/specdev/common/schemas/triage.schema.json +117 -15
- package/template/workflows/specdev/common/skills/code-review/SKILL.md +5 -4
- package/template/workflows/specdev/common/skills/code-review/references/result-reuse.md +15 -0
- package/template/workflows/specdev/common/tools/delivery-artifacts.mjs +95 -0
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +60 -19
- package/template/workflows/specdev/runtime-contract.json +4 -2
- package/template/skills/archive-and-consolidate/references/entry-procedure.md +0 -178
- package/template/skills/docs-sync/references/entry-procedure.md +0 -3
- package/template/skills/engineering-standards-builder/references/entry-procedure.md +0 -154
- package/template/skills/git-history-squash/references/entry-procedure.md +0 -94
- package/template/skills/github-npm-ops/SKILL.md +0 -19
- package/template/skills/github-npm-ops/references/ci-and-security-ops.md +0 -178
- package/template/skills/github-npm-ops/references/entry-procedure.md +0 -25
- package/template/skills/github-npm-ops/references/failure-recovery.md +0 -123
- package/template/skills/github-npm-ops/references/issue-pr-triage.md +0 -219
- package/template/skills/github-npm-ops/references/issue-transport.md +0 -26
- package/template/skills/github-npm-ops/references/package-json-checklist.md +0 -171
- package/template/skills/github-npm-ops/references/preflight-checklist.md +0 -39
- package/template/skills/github-npm-ops/references/publish-detection.md +0 -68
- package/template/skills/github-npm-ops/references/release-notes-injection.md +0 -238
- package/template/skills/github-npm-ops/references/release-pipeline.md +0 -108
- package/template/skills/github-npm-ops/references/setup-npm-token.md +0 -63
- package/template/skills/github-npm-ops/references/troubleshooting-playbook.md +0 -293
- package/template/skills/github-npm-ops/references/version-bump-flow.md +0 -217
- package/template/skills/github-npm-ops/references/workflow-yaml-reference.md +0 -268
- package/template/skills/github-npm-ops/scripts/issue-transport.mjs +0 -227
- package/template/skills/optimize-codex-config/references/entry-procedure.md +0 -78
- package/template/skills/speculo-retro/SKILL.md +0 -19
- package/template/skills/speculo-retro/references/entry-procedure.md +0 -23
- package/template/skills/upstream-fork-sync/references/entry-procedure.md +0 -78
- package/template/skills/writing-great-skills/SKILL.md +0 -23
- /package/template/skills/{writing-great-skills → writing-for-agents}/references/document-contract.md +0 -0
- /package/template/workflows/specdev/{G-grill-with-docs → common/rules}/adr-format.md +0 -0
- /package/template/workflows/specdev/{G-grill-with-docs → common/rules}/context-format.md +0 -0
- /package/template/workflows/specdev/{I-implement → common/rules}/design-it-twice.md +0 -0
- /package/template/workflows/specdev/{G-grill-with-docs/domain-modeling-rules.md → common/rules/domain-modeling.md} +0 -0
|
@@ -1,21 +1,161 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: engineering-standards-builder
|
|
3
3
|
description: Generate or refresh project-specific engineering skills after the user explicitly invokes the builder.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
metadata: {"speculo-invocation": "user-only"}
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
#
|
|
8
|
+
# Engineering Standards Builder
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
本 Skill 只在用户明确调用时运行。它不会在新项目中自动启动,也不把 Builder 自带的通用建议直接复制成项目规范。
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
目标是先理解当前项目真实的代码、目录、配置、测试、CI 与模板,再生成一组可长期复用的项目专属 Skill:一个稳定的工程规范路由入口,以及零个或多个有独立触发价值的领域 Skill。
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
```text
|
|
15
|
+
项目事实 + 用户指定的重点范围 + 已确认目标
|
|
16
|
+
-> 证据审计与冲突收敛
|
|
17
|
+
-> 最小充分 Skill Set
|
|
18
|
+
-> .agents/skills/
|
|
19
|
+
```
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
- Output and write owner remain those declared by the entry procedure and the owning command/workflow.
|
|
17
|
-
- Do not infer missing scope, credentials, target, or authorization.
|
|
21
|
+
## 产物与所有权
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
始终生成根路由:
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
```text
|
|
26
|
+
.agents/skills/
|
|
27
|
+
├── engineering-standards/
|
|
28
|
+
│ ├── SKILL.md
|
|
29
|
+
│ ├── generated-skill-set.json
|
|
30
|
+
│ └── references/project/
|
|
31
|
+
│ ├── 00-project-profile.md
|
|
32
|
+
│ ├── 01-module-map.md
|
|
33
|
+
│ ├── 02-decisions-and-exceptions.md
|
|
34
|
+
│ ├── 03-skill-map.md
|
|
35
|
+
│ ├── 04-source-and-template-map.md
|
|
36
|
+
│ └── review-checklist.md
|
|
37
|
+
└── <optional-domain-skill>/
|
|
38
|
+
├── SKILL.md
|
|
39
|
+
└── references/...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`engineering-standards` 是规范权威与路由器;领域 Skill 负责可独立触发的实现导航,不重复定义冲突规则。`generated-skill-set.json` 只登记 Builder 拥有的 `.agents/skills/*` 路径。刷新时不得改动或删除清单之外的 Skill。
|
|
43
|
+
|
|
44
|
+
## 最小原则
|
|
45
|
+
|
|
46
|
+
- 不按语言、目录或 Agent 数量机械拆 Skill。
|
|
47
|
+
- 能由根路由和少量 references 清楚表达时,不新增领域 Skill。
|
|
48
|
+
- 没有项目证据的规则不生成;Builder references 只提供审计维度与 fallback。
|
|
49
|
+
- 不复制项目源码、FM 模板或脚手架正文;引用其真实路径并说明适用条件、集成步骤和验证方式。
|
|
50
|
+
- 不新增配置文件、参数、时间戳、hash 或模型元数据来制造形式化负担。
|
|
51
|
+
- 扫描深度、文件数和字节限制只是脚本内部资源保护,不是用户需要决策的项目规范。
|
|
52
|
+
|
|
53
|
+
## 执行流程
|
|
54
|
+
|
|
55
|
+
### 1. 确定项目根与学习范围
|
|
56
|
+
|
|
57
|
+
从用户当前工作目录、Git/Workspace 边界和用户指定的代码或目录确定真实项目根。记录需要重点学习的模块、代码、目录、模板或脚手架;未指定时覆盖所有可编辑模块。
|
|
58
|
+
|
|
59
|
+
读取现有 `AGENTS.md`、`CLAUDE.md`、贡献文档、架构文档和 `.agents/skills/`,但将它们视为待验证证据。识别 generated、vendor、build、cache、fixture 与冻结目录。发现已有 `generated-skill-set.json` 时进入 refresh;只有 legacy `engineering-standards` 时,在计划中声明接管该根 Skill,其他现有 Skill 一律视为非 Builder 所有。
|
|
60
|
+
|
|
61
|
+
冲突优先级见 [治理与证据优先级](references/rules/00-governance-and-precedence.md),路径和 scope 见 [证据、拓扑与作用域](references/rules/02-evidence-topology-and-scope.md)。本阶段只读。
|
|
62
|
+
|
|
63
|
+
**完成标准**:项目根、重点范围、排除范围、现有规范和 Builder 写入边界明确。
|
|
64
|
+
|
|
65
|
+
### 2. 建立确定性事实基线
|
|
66
|
+
|
|
67
|
+
运行扫描器并捕获 stdout;默认不在项目中持久化 inventory:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
node <skill-root>/scripts/discover-project.mjs --root <project-root> --pretty
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
扫描合同见 [项目发现合同](references/rules/01-project-discovery.md)。扫描器只提供拓扑基线,不能替代源码审计。继续读取真实 manifest/build 配置、CI 命令、公共入口、代表性实现、测试、消费者与项目模板。
|
|
74
|
+
|
|
75
|
+
**完成标准**:每个可编辑模块有路径、技术栈、入口、质量门禁和证据;扫描限制、冲突与未知项已记录。
|
|
76
|
+
|
|
77
|
+
存在可机械验证的边界/约束缺口时,读取 [工程约束](references/rules/09-mechanical-guardrails.md),决定是否提出接入与验证方案。
|
|
78
|
+
|
|
79
|
+
### 3. 用 Agent Team 分域取证
|
|
80
|
+
|
|
81
|
+
当运行环境支持 Agent Team 且存在两个以上可独立审计的证据域时,默认由 leader 并行派发只读 scout。证据域按项目真实边界划分,例如架构与公共 API、后端、前端、公共复用、测试与 CI、FM/脚手架;不得套用固定角色表。
|
|
82
|
+
|
|
83
|
+
leader 是唯一写入者。每个 scout 必须返回同一份精简证据合同:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Scope
|
|
87
|
+
Observed capability
|
|
88
|
+
Canonical source paths
|
|
89
|
+
Mature implementations
|
|
90
|
+
Template paths
|
|
91
|
+
Consumers and tests
|
|
92
|
+
Applicable conditions
|
|
93
|
+
Legacy/counterexamples
|
|
94
|
+
Conflicts/unknowns
|
|
95
|
+
Recommended skill boundary
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
leader 必须复读高影响路径,检查跨域冲突,并把同一事实的重复报告合并。Agent Team 不可用或任务不可合理拆分时,leader 按相同合同顺序审计;结果标准不变。
|
|
99
|
+
|
|
100
|
+
**完成标准**:重要规范均有真实路径、消费者或测试支撑;反例、旧实现和未知项没有被“多数模式”掩盖。
|
|
101
|
+
|
|
102
|
+
### 4. 收敛规范与 Skill 边界
|
|
103
|
+
|
|
104
|
+
先识别项目已经声明的 canonical 模板或代码样板,例如 `docs/fm/**`、scaffold、generator assets。模板与成熟代码冲突时,判断它是目标模板、过期模板还是仅负责骨架,并记录 current、target 与 migration;不得静默任选一方。
|
|
105
|
+
|
|
106
|
+
只有同时满足以下条件才创建领域 Skill:
|
|
107
|
+
|
|
108
|
+
1. 有可独立描述的触发场景;
|
|
109
|
+
2. 会在多次开发中复用;
|
|
110
|
+
3. 有充分的项目源码、模板、测试或配置证据;
|
|
111
|
+
4. 与根路由或其他领域 Skill 边界清晰;
|
|
112
|
+
5. 独立后能明显减少无关上下文。
|
|
113
|
+
|
|
114
|
+
否则内容留在 `engineering-standards`。领域 Skill 名称来自项目语义,不使用固定列表或固定数量。高影响未知项按 [决策收敛合同](references/rules/03-interview-and-decisions.md) 询问;用户已授权直接生成时,将无法安全推断的事项记为 `pending-decision`。
|
|
115
|
+
|
|
116
|
+
只读取与项目事实匹配的 [通用规则索引](references/rules/README.md)、[TypeScript/JavaScript](references/typescript/README.md)、[Java](references/java/README.md)、[Go](references/go/README.md) 或 [Rust](references/rust/README.md) references。内置语言包和 [未内置语言 fallback](references/rules/16-language-adapter-contract.md) 是检查清单,不是高于项目代码的规范来源。
|
|
117
|
+
|
|
118
|
+
**完成标准**:每个生成 Skill 都有独立价值和证据边界;没有为了覆盖目录或技术栈而过度拆分。
|
|
119
|
+
|
|
120
|
+
### 5. 计划、生成与刷新
|
|
121
|
+
|
|
122
|
+
先展示精简计划:模块与证据摘要、Skill Map、每个 Skill 的来源路径、保留/更新/新增/删除项、冲突决策和验证命令。用户已在当前请求中授权实施时,展示后直接执行。
|
|
123
|
+
|
|
124
|
+
按 [Skill Set 生成合同](references/rules/14-generation-contract.md) 和 [模板索引](templates/README.md) 生成。所有项目引用使用项目根相对路径,并说明:何时读取、它负责什么、输出位置、需要哪些手工集成、运行什么验证。
|
|
125
|
+
|
|
126
|
+
先准备完整候选内容并校验,再替换 Builder 拥有的文件。刷新规则:
|
|
127
|
+
|
|
128
|
+
- 只更新或删除旧 `generated-skill-set.json` 登记的路径;
|
|
129
|
+
- 名称与未登记 Skill 冲突时停止覆盖并重新命名或询问;
|
|
130
|
+
- 保留仍有效的用户决策、例外和项目特有知识;
|
|
131
|
+
- 删除或重命名必须在计划中显式列出;
|
|
132
|
+
- 候选验证失败时保留旧 Skill Set;发布后验证失败时恢复旧内容;
|
|
133
|
+
- 相同项目事实与决策重复运行应无无意义 diff。
|
|
134
|
+
|
|
135
|
+
**完成标准**:根路由、领域 Skill、项目引用与所有权清单一致,清单外 Skill 未发生变化。
|
|
136
|
+
|
|
137
|
+
### 6. 验证与报告
|
|
138
|
+
|
|
139
|
+
运行:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
node <skill-root>/scripts/validate-generated-skill.mjs --root <project-root> --strict
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
再按 [验证合同](references/rules/15-validation-contract.md) 执行项目已存在且本次允许的质量门禁。不得通过删除测试、放宽编译配置或扩大例外获取通过。
|
|
146
|
+
|
|
147
|
+
最终报告生成/更新/保留/删除的 Skill,关键证据与模板路径,运行命令及退出码,未验证项、待确认决策和临时例外。
|
|
148
|
+
|
|
149
|
+
**完成标准**:所有权、frontmatter、Skill 路由、项目内引用、选择性适配和规则字段通过;项目门禁通过或留下可复现阻塞证据。
|
|
150
|
+
|
|
151
|
+
## Builder 自校验
|
|
152
|
+
|
|
153
|
+
维护本 Skill 时读取 [fixture 合同](examples/README.md),并运行:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
node scripts/sync-manifest.mjs --root . --check
|
|
157
|
+
node scripts/validate-builder.mjs --root .
|
|
158
|
+
node scripts/self-test.mjs --root .
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
这些脚本无第三方依赖、接受显式根目录、拒绝路径越界,并提供 `--help`。
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
agents/openai.yaml
|
|
1
2
|
examples/fallback/kotlin-gradle/build.gradle.kts
|
|
2
3
|
examples/fallback/kotlin-gradle/expected.json
|
|
3
4
|
examples/fallback/kotlin-gradle/src/main/kotlin/example/App.kt
|
|
@@ -44,7 +45,6 @@ examples/typescript/vue-vite/src/main.ts
|
|
|
44
45
|
examples/typescript/vue-vite/tsconfig.json
|
|
45
46
|
examples/typescript/vue-vite/vite.config.ts
|
|
46
47
|
README.md
|
|
47
|
-
references/entry-procedure.md
|
|
48
48
|
references/go/00-detection-and-scope.md
|
|
49
49
|
references/go/01-language-and-idioms.md
|
|
50
50
|
references/go/02-modules-packages-and-layout.md
|
|
@@ -67,6 +67,7 @@ references/rules/05-files-directories-and-naming.md
|
|
|
67
67
|
references/rules/06-apis-errors-resources-and-concurrency.md
|
|
68
68
|
references/rules/07-documentation-and-comments.md
|
|
69
69
|
references/rules/08-testing-strategy.md
|
|
70
|
+
references/rules/09-mechanical-guardrails.md
|
|
70
71
|
references/rules/09-security-configuration-and-data.md
|
|
71
72
|
references/rules/10-performance-observability-and-i18n.md
|
|
72
73
|
references/rules/11-tooling-quality-gates-and-ci.md
|
package/template/skills/engineering-standards-builder/references/rules/09-mechanical-guardrails.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 可验证的工程约束
|
|
2
|
+
|
|
3
|
+
仅在项目证据支持且用户所选范围需要时应用。先检查现有 lint、test、pre-commit、CI 是否已有规则且真正接入;已有检查失效优先修复接入,不复制禁令到更多文档。
|
|
4
|
+
|
|
5
|
+
TypeScript 深模块可用项目现有 dependency-cruiser 或等价工具表达公开入口、私有实现、依赖方向与无环约束。先观察消费者和既有 exports/API;不能统一强制所有项目采用某种目录布局。测试可以通过公共入口验证行为,内部测试是否保留按实际维护收益决定。
|
|
6
|
+
|
|
7
|
+
候选机械约束必须有通过→故意违规失败→恢复后通过的证据,并证明违规落地、检查命中了实际文件。pre-commit 只作为项目已有/明确选择的执行点,不默认安装 Husky、格式化器或依赖,不静默修改 CI。新增安装、脚本或配置属于独立实现写集,由调用方决定。
|
|
8
|
+
|
|
9
|
+
生成的工程 Skill 只引用实际存在的命令和约束;尚未实现的建议单列,不伪装成已生效规则。
|
|
@@ -128,8 +128,6 @@ async function main() {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
const skillFile = fileByRel.get('SKILL.md');
|
|
131
|
-
const entryProcedure = fileByRel.get('references/entry-procedure.md');
|
|
132
|
-
if (!entryProcedure) errors.push('references/entry-procedure.md is missing');
|
|
133
131
|
if (!skillFile) errors.push('SKILL.md is missing');
|
|
134
132
|
else {
|
|
135
133
|
const skillText = await readFile(skillFile.abs, 'utf8');
|
|
@@ -145,11 +143,11 @@ async function main() {
|
|
|
145
143
|
try { metadata = JSON.parse(frontmatter.values.metadata ?? '{}'); }
|
|
146
144
|
catch { errors.push('Builder metadata must use the emitted JSON-flow mapping'); }
|
|
147
145
|
if (metadata['speculo-invocation'] !== 'user-only') errors.push('Builder must remain explicitly user-invoked with metadata.speculo-invocation=user-only');
|
|
148
|
-
if (!skillText.includes('
|
|
146
|
+
if (!skillText.includes('本 Skill 只在用户明确调用时运行。')) errors.push('Builder must retain its visible explicit user selection boundary');
|
|
149
147
|
}
|
|
150
|
-
const contractText =
|
|
148
|
+
const contractText = skillText;
|
|
151
149
|
for (const requiredConcept of ['Agent Team', 'generated-skill-set.json', '最小原则', 'Skill 边界']) {
|
|
152
|
-
if (!contractText.includes(requiredConcept)) errors.push(`
|
|
150
|
+
if (!contractText.includes(requiredConcept)) errors.push(`SKILL.md is missing core contract: ${requiredConcept}`);
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
|
|
@@ -204,7 +202,6 @@ async function main() {
|
|
|
204
202
|
|
|
205
203
|
const allowedReferenceRoots = new Set(['rules', 'typescript', 'java', 'go', 'rust']);
|
|
206
204
|
for (const file of files.filter((item) => item.rel.startsWith('references/'))) {
|
|
207
|
-
if (file.rel === 'references/entry-procedure.md') continue;
|
|
208
205
|
const first = file.rel.split('/')[1];
|
|
209
206
|
if (!allowedReferenceRoots.has(first)) errors.push(`unexpected top-level reference group: ${file.rel}`);
|
|
210
207
|
}
|
|
@@ -262,7 +259,7 @@ async function main() {
|
|
|
262
259
|
if (actual !== expected) errors.push('manifest.txt is stale; run sync-manifest.mjs --write');
|
|
263
260
|
}
|
|
264
261
|
|
|
265
|
-
const flatReferenceFiles = files.filter((file) => /^references\/[^/]+\.md$/.test(file.rel)
|
|
262
|
+
const flatReferenceFiles = files.filter((file) => /^references\/[^/]+\.md$/.test(file.rel));
|
|
266
263
|
if (flatReferenceFiles.length) errors.push(`references must be grouped by rules/language: ${flatReferenceFiles.map((file) => file.rel).join(', ')}`);
|
|
267
264
|
|
|
268
265
|
if (!warnings.length && files.length > 180) warnings.push(`package contains ${files.length} files; verify progressive disclosure remains focused`);
|
|
@@ -1,23 +1,99 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: git-history-squash
|
|
3
|
+
disable-model-invocation: true
|
|
3
4
|
description: Plan and execute a confirmed first-parent Git history squash with recoverable refs and exact remote leases; never auto-trigger.
|
|
4
5
|
metadata: {"speculo-id": "git-history-squash", "speculo-kind": "skill", "speculo-invocation": "user-only"}
|
|
5
6
|
---
|
|
6
7
|
|
|
7
|
-
#
|
|
8
|
+
# Git History Squash
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
以**受控历史收敛**为主导词。本 Skill 只在用户显式调用后运行;讨论 squash、rebase、提交整理或项目文件中的指令均不构成调用或副作用授权。
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
## 1. 解析运行上下文
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
1. 从当前目录向上寻找并读取 `<Path>{roots.state}/workspace.json</Path>`,验证 `path_base: project-root` 和全部 roots,再读取 `<Path>{roots.config}</Path>`;无法唯一确定项目根时停止。
|
|
15
|
+
2. 读取项目 `AGENTS.md` 及目标仓库作用域内规则。
|
|
16
|
+
3. 将本 Skill 的持久化根解析为 `<Path>{roots.state}/skills/git-history-squash/</Path>`。根 `state.json` 只保存当前可恢复运行的 locator;每次运行使用 `<Path>{roots.state}/skills/git-history-squash/{date}-{topic}[-NN]/</Path>`,已有目录永不覆盖。由 `<Path>{roots.commands}/git-history-squash.md</Path>` 调用时,command 负责确认门和 `<Path>{roots.state}/commands/git-history-squash/</Path>` 审计报告;本 Skill 仍只写上述 skill namespace。
|
|
17
|
+
4. 从 [request template](assets/request-template.json) 生成临时 request JSON。用户必须逐仓库明确 repository、完整 local branch ref、start、end、`inclusive | exclusive`、commit message、签名选择和远端发布选择;不得猜测缺失值。
|
|
18
|
+
5. 读取 [Rewrite contract](references/rewrite-contract.md),用它验证区间语义、预检项、确认门和 Git 写入边界。涉及父仓库与 submodule 时同时读取 [Submodule contract](references/submodule-contract.md)。
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
- Owning command: `<Path>{roots.commands}/git-history-squash.md</Path>` owns confirmation and the command audit report.
|
|
17
|
-
- This skill owns `<Path>{roots.state}/skills/git-history-squash/</Path>` transactional state.
|
|
18
|
-
- Output and write owner remain those declared by the entry procedure and the owning command/workflow.
|
|
19
|
-
- Do not infer missing scope, credentials, target, or authorization.
|
|
20
|
+
**完成标准**:项目根、Skill state 根、request、目标仓库、分支、边界、消息和远端选择均只有一个解释;缺失项已向用户询问而非采用默认值。
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
+
## 2. 生成 dry-run 计划
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
运行:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
node <Path>{roots.skills}/git-history-squash/scripts/git-history-squash.mjs</Path> plan \
|
|
28
|
+
--root . \
|
|
29
|
+
--state-root <Path>{roots.state}/skills/git-history-squash</Path> \
|
|
30
|
+
--evidence-root <Path>{roots.state}</Path> \
|
|
31
|
+
--request <request.json>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`plan` 可以写本 Skill 的报告与恢复 state,但不得创建 Git object、移动 ref、改变 index/worktree 或访问远端写接口。它冻结完整 SHA、区间计数、merge 数、worktree、dirty/operation 状态、关联 refs、workflow evidence、submodule 图、远端 tip 和可验证的保护策略。
|
|
35
|
+
|
|
36
|
+
将脚本返回的 `change`、`report`、`next_action` 和 digest 原样保存。任何 blocker 都保持 dry-run,返回报告和修复条件。
|
|
37
|
+
|
|
38
|
+
**完成标准**:报告位于本 Skill 的唯一运行目录;所有 Git refs 与工作区状态和 plan 前相同;只有无 blocker 的精确 manifest 才产生 `confirm-local`。
|
|
39
|
+
|
|
40
|
+
## 3. 本地确认与执行
|
|
41
|
+
|
|
42
|
+
向用户展示报告中的完整本地 manifest:每个 repository、branch、start/end/baseline SHA、first-parent/reachable/merge 数、commit message、签名选择、backup ref、关联 refs/worktrees,以及 submodule 执行层。
|
|
43
|
+
|
|
44
|
+
只有用户在当前对话中明确确认该 manifest 和 `plan_digest` 后运行:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
node <Path>{roots.skills}/git-history-squash/scripts/git-history-squash.mjs</Path> apply \
|
|
48
|
+
--root . \
|
|
49
|
+
--state-root <Path>{roots.state}/skills/git-history-squash</Path> \
|
|
50
|
+
--change <change> \
|
|
51
|
+
--confirm-plan <plan_digest>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
脚本执行前重验完整计划。每个仓库使用终点 tree 与唯一 baseline parent 创建新 commit,再以 compare-and-swap ref transaction 同时创建 backup ref、移动目标 branch。任一漂移停止当前层;不删除或改写其他 branch、tag、worktree、stash、reflog 或 workflow evidence。
|
|
55
|
+
|
|
56
|
+
多层 submodule 图只执行当前 eligible 层;下层要求发布时,父层必须等下层远端验证后重新产生新的 `plan_digest` 并再次确认。
|
|
57
|
+
|
|
58
|
+
**完成标准**:脚本重读证明每个已处理仓库的新 tree、parent、提交数、backup ref 和工作区状态满足合同;失败时 state/report 明确区分已完成与未完成仓库。
|
|
59
|
+
|
|
60
|
+
## 4. 远端确认与发布
|
|
61
|
+
|
|
62
|
+
当脚本返回 `confirm-publish` 时,向用户展示完整远端 manifest:repository、remote、remote branch、冻结的 old SHA、local new SHA、保护策略和发布顺序。
|
|
63
|
+
|
|
64
|
+
只有用户在当前对话中明确确认该 manifest 和 `publish_digest` 后运行:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
node <Path>{roots.skills}/git-history-squash/scripts/git-history-squash.mjs</Path> publish \
|
|
68
|
+
--root . \
|
|
69
|
+
--state-root <Path>{roots.state}/skills/git-history-squash</Path> \
|
|
70
|
+
--change <change> \
|
|
71
|
+
--confirm-publish <publish_digest>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
发布只使用精确 `--force-with-lease=<ref>:<old-sha>` 和单一显式 refspec。远端 tip 漂移、保护策略不允许、push 失败或回读不等于 new SHA 时立即停止;不回滚已经发布的其他仓库。
|
|
75
|
+
|
|
76
|
+
**完成标准**:每个成功远端 branch 回读精确等于 new SHA;父仓库 gitlink 指向的 child SHA 已先从对应远端 branch 到达;未发布仓库及恢复步骤已进入报告。
|
|
77
|
+
|
|
78
|
+
## 5. 恢复或结束
|
|
79
|
+
|
|
80
|
+
读取 [Recovery contract](references/recovery-contract.md)。中断或重入时先运行:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
node <Path>{roots.skills}/git-history-squash/scripts/git-history-squash.mjs</Path> status \
|
|
84
|
+
--root . \
|
|
85
|
+
--state-root <Path>{roots.state}/skills/git-history-squash</Path> \
|
|
86
|
+
--change <change>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
实际 refs/remotes 与 state 一致时,使用脚本返回的下一 digest 回到步骤 3 或 4。漂移时保持 blocked,按报告生成新的精确恢复计划并重新取得授权;本 Skill 不自动执行恢复或清理。
|
|
90
|
+
|
|
91
|
+
**完成标准**:运行状态为 `completed-local | completed-published | blocked-partial` 之一;报告包含全部确认、验证、远端结果和精确恢复命令,且没有 token、email、凭证 URL 或机器绝对路径。
|
|
92
|
+
|
|
93
|
+
## 固定边界
|
|
94
|
+
|
|
95
|
+
- `end` 必须等于目标 local branch tip;v1 不改写分支内部区间。
|
|
96
|
+
- `start` 必须位于 `end` 的 first-parent 链;`inclusive` 使用 `start^1` 为 baseline,root start 产生无 parent 新提交;`exclusive` 保留 start 并以其为 baseline。
|
|
97
|
+
- dry-run 不 fetch、不 stash、不 checkout、不创建 commit/tree、不移动 ref、不改变 index、不 push。
|
|
98
|
+
- 本 Skill 不调用 `rebase`、普通 `--force`、没有精确 expected SHA 的 lease、`reset --hard` 或自动 cleanup。
|
|
99
|
+
- GitHub 远端只有在 protection/rules 查询成功且允许非 fast-forward update 时才发布;无法验证策略的远端只生成本地计划。
|
|
@@ -3,19 +3,79 @@ name: optimize-codex-config
|
|
|
3
3
|
description: Audit config.toml/auth.json and diagnose Codex 413 or related failures; modify configuration only after explicit confirmation.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Optimize Codex Config
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
以**体检**为主导词:先建立脱敏事实,再提出配置变更。默认只读;修改本机配置前必须向用户展示完整目标和脱敏 diff,并取得本次修改的明确确认。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 1. 锁定范围与权限
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- Output and write owner remain those declared by the entry procedure and the owning command/workflow.
|
|
17
|
-
- Do not infer missing scope, credentials, target, or authorization.
|
|
12
|
+
1. 解析实际 `CODEX_HOME`;未显式设置时使用当前用户的 `~/.codex`。将它转成绝对路径并确认目标是目录且不是符号链接。
|
|
13
|
+
2. 将请求归类为只读体检、故障诊断或配置修改。只读体检和诊断不取得写权限。
|
|
14
|
+
3. 将本 skill 的写入边界限制为用户明确指定的本机 Codex 文件。CC Switch 数据库、远端 API、反向代理和 Nginx 只输出归因与交接建议。
|
|
15
|
+
4. 在任何可能写入前记录 `config.toml` 的哈希、大小和修改时间,并检查目标文件是否存在已证明的可写句柄。普通 Codex CLI、ChatGPT/Codex 应用进程及其 helper 的存在不构成 writer 证据。
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
**完成标准:** 实际 `CODEX_HOME`、任务类型、允许写入的文件和外部边界均已明确;符号链接、已证明的活跃 writer、不明确目标,或修改任务无法取得 writer 观测时已成为 blocker。只读任务可以把不可用探针记录为 unknown 后继续。
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
## 2. 建立只读基线
|
|
20
|
+
|
|
21
|
+
从本 `SKILL.md` 所在目录运行:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
node scripts/audit-codex-config.mjs --codex-home <absolute-directory> --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
需要离线或可复现 fixture 时加入 `--no-command-probes`;需要缩小会话扫描范围时使用 `--since-days <N>`。先运行 `--help` 核对当前接口;CLI 不在导出的 `PATH` 中时,用 `command -v codex` 取得绝对路径并传给 `--codex-bin`。
|
|
28
|
+
|
|
29
|
+
1. 保留审计脚本的结构化结果;不得把 `auth.json` 内容、提示词、工具输出、完整接口 URL 或 bearer token复制进报告。
|
|
30
|
+
2. 直接查看配置时,先遮蔽 `experimental_bearer_token`、静态认证 header、环境变量值和 URL 主机。只检查 `auth.json` 的存在、文件类型、权限和 Codex 报告的认证模式,不读取或打印文件内容。
|
|
31
|
+
3. 对配置、供应商、认证、权限、Agent、MCP、Hook 或历史设置提出判断前,读取 [configuration contract](references/configuration-contract.md),并用已安装 CLI 与当前官方配置参考验证每个拟使用的键。
|
|
32
|
+
4. 把用户提供的既有设置视为需要保留或评估的事实,不把个人模型、认证方式或权限策略提升为通用默认值。
|
|
33
|
+
|
|
34
|
+
**完成标准:** 当前版本、配置指纹、认证存储模式、供应商契约、权限、Agent、MCP、Hook、会话故障和 writer 状态均有脱敏证据;无法取得的事实被标为 unknown。
|
|
35
|
+
|
|
36
|
+
## 3. 归因故障
|
|
37
|
+
|
|
38
|
+
当请求包含 HTTP 状态码、SSE、超时或 compaction 失败时,读取 [troubleshooting](references/troubleshooting.md),按其中证据梯度完成归因。
|
|
39
|
+
|
|
40
|
+
1. 关联错误发生前最近一次 `token_count`,但只保留 token 数和模型上下文窗口。
|
|
41
|
+
2. 区分本机配置、认证、供应商 wire API、远端模型服务和前置代理。HTML 代理错误页属于代理证据,不归因给模型。
|
|
42
|
+
3. 对外部问题给出可复现证据、影响、临时本机缓解和服务端交接项。本 skill 不探测或修改用户未授权的远端系统。
|
|
43
|
+
|
|
44
|
+
**完成标准:** 每个错误只有一个主要归属域,证据与推断分开,所有本机缓解都标明质量、成本或频率代价。
|
|
45
|
+
|
|
46
|
+
## 4. 设计目标状态
|
|
47
|
+
|
|
48
|
+
只询问审计无法发现且会改变方案的偏好:模型与推理等级、认证存储、审批与沙箱、网络访问、Agent 并发、供应商认证方式、历史保留,以及 MCP/Hook 的保留意图。
|
|
49
|
+
|
|
50
|
+
输出确认包:
|
|
51
|
+
|
|
52
|
+
1. 当前状态和问题证据;
|
|
53
|
+
2. 目标状态及每项理由;
|
|
54
|
+
3. 逐文件脱敏 diff;
|
|
55
|
+
4. 明确保留的未知项、MCP、Hook、profile 和兼容设置;
|
|
56
|
+
5. 备份名、原子写入方法、验证命令和回滚条件;
|
|
57
|
+
6. 不在本机范围内的外部 blocker。
|
|
58
|
+
|
|
59
|
+
只采用当前官方参考与已安装 CLI 均能验证的键。项目级 `.codex/config.toml` 不承载 provider、auth 或其他被 Codex 忽略的机器级设置。
|
|
60
|
+
|
|
61
|
+
**完成标准:** 用户无需猜测任何目标值;diff 不含 secret;未关联的现有设置不会被清理;外部问题不会伪装成本机可修复项。
|
|
62
|
+
|
|
63
|
+
## 5. 确认后原子写入
|
|
64
|
+
|
|
65
|
+
只有用户在看到确认包后明确同意本次变更,才执行以下动作:
|
|
66
|
+
|
|
67
|
+
1. 重读指纹;若配置已变化、存在目标文件的可写句柄,或 writer 探针仍为 unknown,停止并重新体检。
|
|
68
|
+
2. 为每个待改文件创建不覆盖的 `*.pre-optimize-<YYYYMMDD-HHMMSS>.bak`,并将包含凭据的文件权限设为 `0600`。
|
|
69
|
+
3. 在同一目录写临时文件、解析或加载验证成功后 rename 到目标,保留与任务无关的表和注释。
|
|
70
|
+
4. 仅在用户明确要求且已安装 Codex 能验证格式时处理 `auth.json`。文件存储是有效选择,不强制迁移钥匙串;不得自行发明认证 JSON schema。
|
|
71
|
+
|
|
72
|
+
**完成标准:** 写入前后的指纹、备份和确认可对应;目标文件是原子替换结果;没有越出已确认文件集合。
|
|
73
|
+
|
|
74
|
+
## 6. 验证与交付
|
|
75
|
+
|
|
76
|
+
1. 运行 `codex doctor --json`,再核对 `codex features list` 和 `codex debug models --bundled` 中与目标相关的能力。
|
|
77
|
+
2. 验证配置加载、认证模式、权限与沙箱、MCP、Hook、Agent 和旧会话恢复。只有用户授权可能计费的网络请求后,才执行最小第三方 API 请求。
|
|
78
|
+
3. 任一必须验证项失败时恢复备份,重跑相同检查并报告原始失败与回滚结果。
|
|
79
|
+
4. 报告已改变、已保留、已验证、未验证和外部 blocker;不回显任何 secret 或完整 URL。
|
|
80
|
+
|
|
81
|
+
**完成标准:** 所有已确认变更通过本机验证,或已完整回滚;报告包含命令、退出码和关键脱敏证据。
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: retrospective
|
|
3
|
+
description: Analyze a development session or Speculo usage feedback when asked for a retrospective; return evidence, root causes, and improvement proposals to the caller, without executing fixes or remote operations.
|
|
4
|
+
metadata: {"speculo-id": "retrospective", "speculo-kind": "skill", "speculo-legacy-name": "Speculo Retro"}
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Retrospective
|
|
8
|
+
|
|
9
|
+
## 输入
|
|
10
|
+
|
|
11
|
+
- 当前会话、开发活动及调用方明确关联的 change/commands/workflows。
|
|
12
|
+
- `commands/<command>/*.md` 报告、active change 状态、archive 和 `INDEX.md` 声明的知识 store。
|
|
13
|
+
- 可选已有 issues,用于语义去重。
|
|
14
|
+
|
|
15
|
+
## 流程
|
|
16
|
+
|
|
17
|
+
1. 按本次 scope 和来源 ID 定位相关证据,再读取 [ friction-taxonomy.md ](references/friction-taxonomy.md);穷尽当前范围内的已定位摩擦,不全量读取 archive/知识库。完成标准:每项都有来源路径或对话节点。
|
|
18
|
+
2. 按 bug、friction、missing-capability、doc-gap、ergonomics 归类,合并同一根因。完成标准:每项只属于一个根因簇,合并关系可追溯。
|
|
19
|
+
3. 按下方修复方向分类,再评估影响与频率,过滤一次性噪声;低信号项标为丢弃或仅记教训。完成标准:每项都有优先级和处置理由。
|
|
20
|
+
4. 读取 [ issue-drafting-sop.md ](references/issue-drafting-sop.md),生成 issue-ready 提案并与已有 issue 去重。完成标准:标题、证据、问题、建议、验收、影响资产和去重结论齐全。
|
|
21
|
+
|
|
22
|
+
## 输出
|
|
23
|
+
|
|
24
|
+
- 按优先级排序的 `file-issue | lesson-only | discard | duplicate | insufficient-evidence | no-findings` 结果,不强行制造 Issue。
|
|
25
|
+
- 合并/丢弃说明和调用方执行 `gh` 所需字段。
|
|
26
|
+
|
|
27
|
+
本 skill 不写文件、不调用外部 API;调用方 command/Work 负责持久化、授权和后续路由。
|
|
28
|
+
|
|
29
|
+
## 修复方向:先减少未来重复指令
|
|
30
|
+
|
|
31
|
+
每个根因簇保留原 issue type,同时选择一个 remediation_axis;这不是新的远程标签或状态机。
|
|
32
|
+
|
|
33
|
+
| remediation_axis | 首选提案与验收 |
|
|
34
|
+
|---|---|
|
|
35
|
+
| code-defect | 最小复现/回归测试与局部修复,证明目标症状红→绿 |
|
|
36
|
+
| deterministic-check-gap | lint、validator、pre-commit 或 CI 中可判定断言,至少一个通过与一个拒绝样本 |
|
|
37
|
+
| context-pointer | 修正触发、owner、失效路径或条件引用;验证应触发与近邻不触发 |
|
|
38
|
+
| judgment-rule | 仅保留不能由机械检查替代的真实判断、权衡与边界,注明反例 |
|
|
39
|
+
| environment-discovery | 修复命令/工具/配置的可发现性或环境反馈,避免文档缓存简单可查询事实 |
|
|
40
|
+
|
|
41
|
+
检查缺口优先提到测试/工具,不再把同一禁令复制到多个 Work。没有因果证据时标为假设并给验证方法;删除指令的提案必须附运行对照方案,不把“模型应该会”当作删除证据。
|
|
42
|
+
|
|
43
|
+
只提出建议,不直接改 AGENTS/全局提示词、永久知识或项目代码,不创建远程 Issue;调用方的报告、确认与目标仓库边界保持。
|
|
@@ -8,17 +8,26 @@
|
|
|
8
8
|
|
|
9
9
|
1. **当前对话上下文** —— 本次会话激活过的 command / workflow;用户在哪一步卡住、追问、返工;为绕开限制做了哪些手动动作;哪些指令被误解。
|
|
10
10
|
2. **命令产物** —— `<Path>{roots.state}/commands/{command}/*.md</Path>`:其中记录的验证失败、未完成和阻塞点是一手摩擦。
|
|
11
|
-
3. **change 状态机** —— `<Path>{roots.state}/{workflow}/changes/{change}/.status.json</Path
|
|
12
|
-
|
|
13
|
-
- `blocked` —— 卡点,记录阻塞原因
|
|
14
|
-
- `skipped` —— phase 被跳过,可能是冗余或不适用
|
|
15
|
-
- `updated_at` 长期停滞 —— 流程让人不想推进
|
|
16
|
-
4. **change 产物正文** —— `prd.md`、`tdd-*.md`、`slices.md`、`diagnosis.md` 中显式写下的「待澄清」「风险」「TODO」。
|
|
11
|
+
3. **change 状态机** —— 按所属 workflow schema 读取 `<Path>{roots.state}/{workflow}/changes/{change}/.status.json</Path>`;SpecDev 使用 current_work、works_run、真实工件和失败记录,不假定存在 phase_history。停滞时间仅为线索,不能推断用户动机或问题根因。
|
|
12
|
+
4. **change 产物正文** —— 所属 workflow 的 Spec、Ticket、Evidence、diagnosis.md 等真实工件中显式写下的待澄清、风险和阻塞;不臆造不存在的文件。
|
|
17
13
|
5. **沉淀教训** —— 各 workflow 声明的 lessons/knowledge store:已记录但尚未转成改进项的教训,用于去重与佐证频率。
|
|
18
|
-
6. **契约落差** —— 实际产物路径、frontmatter
|
|
14
|
+
6. **契约落差** —— 实际产物路径、frontmatter、命名是否偏离所属入口的合同及 schema;不同工件命名分别判断,不能强制全部使用日期前缀。
|
|
19
15
|
|
|
20
16
|
## 摩擦类型分类
|
|
21
17
|
|
|
18
|
+
先从实际证据检查以下七个环境维度;没有信号的维度记为不适用,不扩大当前会话范围。维度、主类型和 remediation_axis 分别描述发生位置、问题性质和改进方向,不能互相替代。
|
|
19
|
+
|
|
20
|
+
| 维度 | 检查与建议 |
|
|
21
|
+
|---|---|
|
|
22
|
+
| 导航 | 隐藏依赖、跨模块跳转和关键文件入口是否可发现;优先修复上下文指针 |
|
|
23
|
+
| 自动检查 | 回读关联 scripts、lint、测试与 CI;区分缺少检查、已有检查未接入和检查失效,避免重建同类检查 |
|
|
24
|
+
| 编码标准 | 可确定判错的约束进入机械检查;权衡与设计判断留给审查规则 |
|
|
25
|
+
| 全局指令 | AGENTS 中反复追加的 steering 能否归入既有工程标准或检查;不直接修改用户全局文件 |
|
|
26
|
+
| 工具使用 | 无效调用、重复读取和命令发现成本;保留实际调用证据,建议可测量的改进 |
|
|
27
|
+
| 无效指令 | 指令是否未被触发、重复、过时或无法影响行为;删除建议须有正反样例与对照验证 |
|
|
28
|
+
| 信息访问 | 开发日志、只读服务、环境反馈是否足够定位问题;建议最小必要访问,不默认扩大凭据或服务权限 |
|
|
29
|
+
|
|
30
|
+
|
|
22
31
|
每个摩擦点归且仅归一个**主类型**:
|
|
23
32
|
|
|
24
33
|
| 类型 | 含义 | 典型表现 |
|
|
@@ -31,17 +40,17 @@
|
|
|
31
40
|
|
|
32
41
|
## 优先级评分
|
|
33
42
|
|
|
34
|
-
优先级 = **影响面 ×
|
|
43
|
+
优先级 = **影响面 × 发生频率**,落到四档(由调用方映射标签):
|
|
35
44
|
|
|
36
45
|
- 影响面:`broad`(影响所有使用者 / 破坏契约)|`partial`(影响部分流程)|`cosmetic`(轻微体验)
|
|
37
46
|
- 发生频率:`recurring`(多次出现 / 多来源佐证)|`occasional`|`one-off`
|
|
38
47
|
|
|
39
48
|
| 优先级 | 判定 |
|
|
40
49
|
|--------|------|
|
|
41
|
-
| `
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
50
|
+
| `critical` | 破坏契约、数据/产物丢失、覆盖用户改动 —— 无论频率 |
|
|
51
|
+
| `high` | `broad` 影响且 `recurring`,或显著阻塞主流程 |
|
|
52
|
+
| `medium` | `partial` 影响,或 `broad` 但仅 `occasional` |
|
|
53
|
+
| `low` | `cosmetic`,或 `one-off` 且有 workaround |
|
|
45
54
|
|
|
46
55
|
## 噪声过滤规则
|
|
47
56
|
|
|
@@ -52,4 +61,4 @@
|
|
|
52
61
|
- **降级为教训** —— 属于「用法/约定」而非「资产缺陷」的,建议记入 `LESSONS.md` 而非提 issue。
|
|
53
62
|
- **可行动性闸门** —— 无法描述出「改哪个 asset、怎么改、怎么验收」的,先标 `needs-design`,不要凭空提模糊 issue。
|
|
54
63
|
|
|
55
|
-
只把通过闸门、`
|
|
64
|
+
只把通过闸门、`medium` 及以上、或 `recurring` 的高信号项推进到 issue 起草。
|
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
```jsonc
|
|
10
10
|
{
|
|
11
11
|
"title": "string, 见标题规范",
|
|
12
|
-
"type": "bug |
|
|
13
|
-
"priority": "
|
|
14
|
-
"area": "string|null, 例
|
|
12
|
+
"type": "bug | friction | missing-capability | doc-gap | ergonomics",
|
|
13
|
+
"priority": "critical | high | medium | low",
|
|
14
|
+
"area": "string|null, 例 commands / workflows / skills / cli / contract",
|
|
15
15
|
"body": "string, 见正文结构",
|
|
16
|
+
"remediation_axis": "code-defect | deterministic-check-gap | context-pointer | judgment-rule | environment-discovery",
|
|
17
|
+
"regression": {"positive": "通过样本与可观察结果", "negative": "拒绝/停止样本与不应出现的副作用"},
|
|
16
18
|
"affected": ["相对路径,例 speculo/commands/archive-and-consolidate.md"],
|
|
17
|
-
"evidence": ["
|
|
18
|
-
"disposition": "file-issue |
|
|
19
|
+
"evidence": ["证据出处,例当前会话节点或具体工件及段落"],
|
|
20
|
+
"disposition": "file-issue | lesson-only | discard | duplicate",
|
|
19
21
|
"dup_of": "number|null, 疑似重复的已存在 issue 编号"
|
|
20
22
|
}
|
|
21
23
|
```
|
|
@@ -26,19 +28,9 @@
|
|
|
26
28
|
- 前缀对齐类型:`bug:` / `enhancement:` / `docs:` / `feature:`
|
|
27
29
|
- 单行、可独立读懂、不超过约 70 字,含受影响的 asset 名。
|
|
28
30
|
|
|
29
|
-
##
|
|
31
|
+
## 分类与标签
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
| 提案 type | issue 类型标签 |
|
|
34
|
-
|-----------|---------------|
|
|
35
|
-
| `bug` | `bug` |
|
|
36
|
-
| `friction` | `enhancement` |
|
|
37
|
-
| `missing-capability` | `feature-request` |
|
|
38
|
-
| `doc-gap` | `documentation` |
|
|
39
|
-
| `ergonomics` | `enhancement` |
|
|
40
|
-
|
|
41
|
-
不确定改动方向的额外加 `needs-design`。
|
|
33
|
+
只返回语义类型、优先级与领域;标签名称、存在性、创建权限和映射由调用方决定,不要求每个仓库都具备某套标签。不确定改进方向时记录设计缺口,不自行增加远程标签。
|
|
42
34
|
|
|
43
35
|
## 正文结构
|
|
44
36
|
|
|
@@ -58,7 +50,7 @@
|
|
|
58
50
|
[改哪个 asset、怎么改。给相对路径与具体方向,不要泛泛而谈。]
|
|
59
51
|
|
|
60
52
|
## 验收标准
|
|
61
|
-
[
|
|
53
|
+
[可验证的完成判据、通过/拒绝样本、回归命令与未验证项。机械问题写确定性检查,不以新增提示词代替测试。]
|
|
62
54
|
|
|
63
55
|
## 受影响资产
|
|
64
56
|
[列出相关相对路径。]
|
|
@@ -69,9 +61,9 @@
|
|
|
69
61
|
起草后、交给调用方提交前,对每条做去重判定:
|
|
70
62
|
|
|
71
63
|
1. 提取标题与根因的关键词。
|
|
72
|
-
2. 由调用方用 `gh issue list --repo <owner/repo> --search "<关键词>" --state all --limit 20`
|
|
73
|
-
3. 命中语义重复:把 `disposition` 设为 `
|
|
64
|
+
2. 由调用方用 `gh issue list --repo <owner/repo> --search "<关键词>" --state all --limit 20` 检索;Skill 自身不执行远程检索。
|
|
65
|
+
3. 命中语义重复:把 `disposition` 设为 `duplicate` 并在 `dup_of` 记录已存在编号,默认不重复提;仅当用户明确要求才补提。
|
|
74
66
|
|
|
75
67
|
## 交接契约
|
|
76
68
|
|
|
77
|
-
本 skill
|
|
69
|
+
本 skill 只返回结构化提案清单与丢弃/合并说明,**不写文件、不调用 `gh`、不创建 issue**。command 或 Work 选择自己的报告路径、标签和授权方式;无发现与证据不足同样是有效分析结果。
|