claude-everything-workflow 0.1.9 → 0.2.3
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/AGENTS.md +20 -20
- package/CLAUDE.md +1 -5
- package/README.md +151 -113
- package/agents/e2e-runner.md +8 -141
- package/agents/harness-optimizer.md +3 -2
- package/commands/code-review.md +10 -15
- package/commands/learn.md +97 -0
- package/commands/pr.md +5 -6
- package/commands/to-spec.md +11 -0
- package/commands/verify.md +7 -11
- package/harness/manifest.json +346 -0
- package/hooks/check-code-size.js +33 -12
- package/hooks/check-console-log.js +72 -24
- package/package.json +10 -2
- package/rules/01-base.md +9 -49
- package/rules/02-code-size.md +5 -20
- package/rules/03-architecture.md +9 -61
- package/rules/04-error-handling.md +4 -26
- package/rules/05-git-workflow.md +12 -39
- package/rules/06-comments.md +3 -43
- package/rules/07-forbidden.md +8 -31
- package/rules/08-specialty-rules-index.md +18 -0
- package/rules/09-first-principles-adversarial-testing.md +6 -18
- package/rules/common/agent-orchestration.md +8 -47
- package/rules/common/context-hygiene.md +9 -72
- package/rules/common/harness-engineering.md +11 -38
- package/rules/common/hooks.md +13 -82
- package/rules/common/performance.md +8 -71
- package/rules/common/pr-automation.md +7 -68
- package/rules/common/skills-learning.md +12 -36
- package/rules/common/testing.md +16 -59
- package/scripts/cleanup-retired-skills.js +214 -0
- package/scripts/install-rules.js +100 -0
- package/scripts/install.ps1 +99 -87
- package/scripts/install.sh +77 -78
- package/scripts/learning/review-confidence.js +1 -4
- package/scripts/legacy-common-rule-hashes.json +78 -0
- package/scripts/merge-claude-settings.cjs +75 -0
- package/scripts/retired-skill-files.json +54 -0
- package/scripts/upstream-capability-baseline.json +27 -0
- package/scripts/upstream-capability-map.json +155 -0
- package/scripts/verify/core.js +91 -0
- package/scripts/verify/grilling-spec-gate-checks.js +266 -0
- package/scripts/verify/install-rules.test.js +156 -0
- package/scripts/verify/metadata-checks.js +747 -0
- package/scripts/verify/repository-checks.js +409 -0
- package/scripts/verify/runtime-checks.js +593 -0
- package/scripts/verify/skill-invocation.test.js +86 -0
- package/scripts/verify/skill-manifest-checks.js +197 -0
- package/scripts/verify/skill-manifest-checks.test.js +123 -0
- package/scripts/verify/workflow-checks.js +685 -0
- package/scripts/verify/workflow-ownership-fixtures.js +371 -0
- package/scripts/verify/workflow-ownership.js +780 -0
- package/scripts/verify-harness.js +18 -1075
- package/scripts/verify-upstream-capability-map.js +118 -0
- package/skills/README.md +28 -16
- package/skills/code-review/SKILL.md +63 -0
- package/skills/code-review/references/spec-reviewer-prompt.md +24 -0
- package/skills/code-review/references/standards-reviewer-prompt.md +35 -0
- package/skills/codebase-design/SKILL.md +63 -0
- package/skills/codebase-design/references/deepening.md +27 -0
- package/skills/codebase-design/references/design-it-twice.md +17 -0
- package/skills/continuous-learning-v2/SKILL.md +8 -8
- package/skills/continuous-learning-v2/config.json +0 -4
- package/skills/domain-modeling/SKILL.md +101 -0
- package/skills/e2e-testing/SKILL.md +20 -310
- package/skills/e2e-testing/references/playwright-patterns.md +324 -0
- package/skills/feature-acceptance/SKILL.md +89 -0
- package/skills/grilling/SKILL.md +83 -0
- package/skills/handoff/SKILL.md +55 -0
- package/skills/handoff/agents/openai.yaml +2 -0
- package/skills/implement/SKILL.md +48 -0
- package/skills/implement/references/ticket-delivery.md +43 -0
- package/skills/improve-codebase-architecture/SKILL.md +47 -0
- package/skills/improve-codebase-architecture/agents/openai.yaml +2 -0
- package/skills/iterative-retrieval/SKILL.md +10 -1
- package/skills/learn/README.md +2 -2
- package/skills/prototype/SKILL.md +50 -0
- package/skills/prototype/references/logic.md +28 -0
- package/skills/prototype/references/ui.md +30 -0
- package/skills/resolving-merge-conflicts/SKILL.md +27 -0
- package/skills/spec-gate/SKILL.md +149 -0
- package/skills/spec-gate/agents/openai.yaml +4 -0
- package/skills/spec-gate/references/spec-document-reviewer-prompt.md +31 -0
- package/skills/subagent-driven-development/SKILL.md +95 -414
- package/skills/systematic-debugging/SKILL.md +11 -49
- package/skills/systematic-debugging/references/diagnosing-bugs.upstream.md +129 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.js +75 -0
- package/skills/systematic-debugging/scripts/hitl-loop.template.sh +41 -0
- package/skills/test-driven-development/SKILL.md +24 -4
- package/skills/to-tickets/SKILL.md +96 -0
- package/skills/triage/SKILL.md +53 -0
- package/skills/triage/agents/openai.yaml +2 -0
- package/skills/triage/references/agent-brief.md +32 -0
- package/skills/triage/references/out-of-scope.md +14 -0
- package/skills/using-git-worktrees/SKILL.md +8 -5
- package/skills/using-superpowers/SKILL.md +76 -43
- package/skills/using-superpowers/references/process-outcomes.md +41 -0
- package/skills/verification-before-completion/SKILL.md +5 -4
- package/skills/visual-companion/SKILL.md +62 -0
- package/skills/visual-companion/agents/openai.yaml +4 -0
- package/skills/{brainstorming/visual-companion.md → visual-companion/references/guide.md} +1 -1
- package/skills/{brainstorming → visual-companion}/scripts/frame-template.html +42 -12
- package/skills/visual-companion/scripts/pages.cjs +28 -0
- package/skills/visual-companion/scripts/server-utils.cjs +82 -0
- package/skills/{brainstorming → visual-companion}/scripts/server.cjs +108 -248
- package/skills/{brainstorming → visual-companion}/scripts/start-server.sh +18 -4
- package/skills/visual-companion/scripts/websocket.cjs +86 -0
- package/agents/architect.md +0 -59
- package/agents/code-reviewer.md +0 -57
- package/agents/planner.md +0 -124
- package/agents/tdd-guide.md +0 -101
- package/commands/e2e.md +0 -28
- package/commands/evolve.md +0 -42
- package/commands/harness-audit.md +0 -27
- package/commands/instinct-status.md +0 -38
- package/commands/learn-eval.md +0 -91
- package/commands/projects.md +0 -27
- package/commands/promote.md +0 -29
- package/commands/prune.md +0 -46
- package/commands/tdd.md +0 -27
- package/homunculus/instincts/personal/always-test-first.md +0 -28
- package/homunculus/instincts/personal/pr-ci-quality-gate.md +0 -30
- package/rules/08-ecc-integration.md +0 -46
- package/rules/common/implementation.md +0 -25
- package/rules/common/security.md +0 -19
- package/skills/brainstorming/SKILL.md +0 -185
- package/skills/brainstorming/agents/openai.yaml +0 -3
- package/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
- package/skills/context-budget/SKILL.md +0 -59
- package/skills/discover-unknowns-zh/SKILL.md +0 -112
- package/skills/discover-unknowns-zh/agents/openai.yaml +0 -4
- package/skills/discover-unknowns-zh/references/prompt-patterns.md +0 -144
- package/skills/documentation-lookup/SKILL.md +0 -90
- package/skills/executing-plans/SKILL.md +0 -66
- package/skills/find-skills/SKILL.md +0 -142
- package/skills/skill-creator/LICENSE.txt +0 -202
- package/skills/skill-creator/SKILL.md +0 -356
- package/skills/skill-creator/references/output-patterns.md +0 -82
- package/skills/skill-creator/references/workflows.md +0 -28
- package/skills/skill-creator/scripts/init_skill.py +0 -303
- package/skills/skill-creator/scripts/package_skill.py +0 -110
- package/skills/skill-creator/scripts/quick_validate.py +0 -95
- package/skills/subagent-driven-development/implementer-prompt.md +0 -139
- package/skills/subagent-driven-development/scripts/review-package +0 -44
- package/skills/subagent-driven-development/scripts/sdd-workspace +0 -22
- package/skills/subagent-driven-development/scripts/task-brief +0 -40
- package/skills/subagent-driven-development/task-reviewer-prompt.md +0 -188
- package/skills/writing-plans/SKILL.md +0 -206
- package/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
- /package/skills/{brainstorming → visual-companion}/scripts/helper.js +0 -0
- /package/skills/{brainstorming → visual-companion}/scripts/stop-server.sh +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const crypto = require("crypto");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const { execFileSync } = require("child_process");
|
|
8
|
+
|
|
9
|
+
const projectRoot = path.resolve(__dirname, "..");
|
|
10
|
+
|
|
11
|
+
function readJson(relative) {
|
|
12
|
+
return JSON.parse(fs.readFileSync(path.join(projectRoot, relative), "utf8"));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function assert(condition, message) {
|
|
16
|
+
if (!condition) throw new Error(message);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function sorted(values) {
|
|
20
|
+
return [...values].sort();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function sha256(file) {
|
|
24
|
+
return crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function parseArgs(argv) {
|
|
28
|
+
if (argv.length === 0) return null;
|
|
29
|
+
if (argv.length !== 2 || argv[0] !== "--upstream-root") {
|
|
30
|
+
throw new Error(
|
|
31
|
+
"Usage: node scripts/verify-upstream-capability-map.js " +
|
|
32
|
+
"[--upstream-root <mattpocock-skills-clone>]",
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return path.resolve(argv[1]);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function validatePinnedInventory(manifest, baseline) {
|
|
39
|
+
assert(baseline.schema_version === 1, "invalid baseline schema");
|
|
40
|
+
assert(
|
|
41
|
+
baseline.repository === manifest.upstream.repository &&
|
|
42
|
+
baseline.commit === manifest.upstream.commit,
|
|
43
|
+
"baseline and capability map pin different upstream snapshots",
|
|
44
|
+
);
|
|
45
|
+
const mapped = sorted(manifest.capabilities.map((entry) => entry.upstream));
|
|
46
|
+
const recorded = sorted(Object.keys(baseline.engineering || {}));
|
|
47
|
+
assert(
|
|
48
|
+
JSON.stringify(mapped) === JSON.stringify(recorded),
|
|
49
|
+
"baseline and capability map have different Engineering inventories",
|
|
50
|
+
);
|
|
51
|
+
assert(
|
|
52
|
+
/^[0-9a-f]{64}$/.test(
|
|
53
|
+
baseline.support_dependencies?.["productivity/handoff"] || "",
|
|
54
|
+
),
|
|
55
|
+
"baseline is missing the handoff source hash",
|
|
56
|
+
);
|
|
57
|
+
for (const [name, hash] of Object.entries(baseline.engineering)) {
|
|
58
|
+
assert(/^[0-9a-f]{64}$/.test(hash), `invalid source hash for ${name}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function engineeringInventory(upstreamRoot) {
|
|
63
|
+
const directory = path.join(upstreamRoot, "skills", "engineering");
|
|
64
|
+
return fs.readdirSync(directory, { withFileTypes: true })
|
|
65
|
+
.filter((entry) => {
|
|
66
|
+
const skill = path.join(directory, entry.name, "SKILL.md");
|
|
67
|
+
return entry.isDirectory() && fs.existsSync(skill);
|
|
68
|
+
})
|
|
69
|
+
.map((entry) => entry.name);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function verifyClone(upstreamRoot, manifest, baseline) {
|
|
73
|
+
const head = execFileSync("git", ["-C", upstreamRoot, "rev-parse", "HEAD"], {
|
|
74
|
+
encoding: "utf8",
|
|
75
|
+
}).trim();
|
|
76
|
+
assert(head === manifest.upstream.commit, `upstream clone is at ${head}`);
|
|
77
|
+
const actual = sorted(engineeringInventory(upstreamRoot));
|
|
78
|
+
const expected = sorted(Object.keys(baseline.engineering));
|
|
79
|
+
assert(
|
|
80
|
+
JSON.stringify(actual) === JSON.stringify(expected),
|
|
81
|
+
"upstream Engineering inventory differs from the pinned baseline",
|
|
82
|
+
);
|
|
83
|
+
for (const [name, expectedHash] of Object.entries(baseline.engineering)) {
|
|
84
|
+
const file = path.join(upstreamRoot, "skills", "engineering", name, "SKILL.md");
|
|
85
|
+
assert(sha256(file) === expectedHash, `upstream source changed: ${name}`);
|
|
86
|
+
}
|
|
87
|
+
const handoff = path.join(
|
|
88
|
+
upstreamRoot,
|
|
89
|
+
"skills",
|
|
90
|
+
"productivity",
|
|
91
|
+
"handoff",
|
|
92
|
+
"SKILL.md",
|
|
93
|
+
);
|
|
94
|
+
assert(
|
|
95
|
+
sha256(handoff) === baseline.support_dependencies["productivity/handoff"],
|
|
96
|
+
"upstream source changed: productivity/handoff",
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function main(argv = process.argv.slice(2)) {
|
|
101
|
+
const upstreamRoot = parseArgs(argv);
|
|
102
|
+
const manifest = readJson("scripts/upstream-capability-map.json");
|
|
103
|
+
const baseline = readJson("scripts/upstream-capability-baseline.json");
|
|
104
|
+
validatePinnedInventory(manifest, baseline);
|
|
105
|
+
if (upstreamRoot) verifyClone(upstreamRoot, manifest, baseline);
|
|
106
|
+
process.stdout.write(
|
|
107
|
+
`Verified upstream ${manifest.upstream.commit.slice(0, 7)}: ` +
|
|
108
|
+
`${manifest.capabilities.length} Engineering mappings ` +
|
|
109
|
+
`(${manifest.capabilities.filter((entry) => entry.status === "excluded").length} excluded) + handoff\n`,
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
try {
|
|
114
|
+
main();
|
|
115
|
+
} catch (error) {
|
|
116
|
+
process.stderr.write(`${error instanceof Error ? error.message : error}\n`);
|
|
117
|
+
process.exitCode = 1;
|
|
118
|
+
}
|
package/skills/README.md
CHANGED
|
@@ -2,35 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
正式 skill 保持 `skills/<skill-name>/SKILL.md` 平铺结构,兼容 Claude Code、Codex 和打包安装的发现方式。分类只在本索引维护,不用物理嵌套目录;需要长材料时,放到对应 skill 的 `references/`。
|
|
4
4
|
|
|
5
|
+
入口只维护选择与通用约束:`using-superpowers` 的过程返回处理在 `references/process-outcomes.md`,`implement` 的 ticket 状态机在 `references/ticket-delivery.md`。只在对应模式读取;普通直接交付不加载这两份引用。
|
|
6
|
+
|
|
7
|
+
调用策略登记在 `harness/manifest.json`,由 `npm run verify` 按宿主校验。`implicit` 允许模型在命中描述与正文条件时调用,不等于授权外部写入;本项目需要明确请求的入口接受自然语言,不要求用户再输入 `/name` 或 `$name`;路由不能把任务复杂度当作用户请求。Skill 正文仍按命中后加载,不能把分类索引当作全量加载清单。
|
|
8
|
+
|
|
9
|
+
实施、审查、领域设计、E2E、原型、视觉辅助和 `/learn` 依赖的能力允许工作流按条件调用,仍遵守各自的用户请求、同意和写入边界。`handoff`、`improve-codebase-architecture`、`triage` 仅在用户明确请求相应任务时使用;宿主允许模型识别自然语言请求,正文仍限制任务范围。
|
|
10
|
+
|
|
5
11
|
## Process / 门禁
|
|
6
12
|
|
|
7
13
|
- `using-superpowers`:非平凡任务的 skill 路由、优先级和完成声明纪律。
|
|
8
|
-
- `
|
|
9
|
-
- `
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `
|
|
14
|
+
- `grilling`:对计划、设计或重大用户决策进行单问式压力测试。
|
|
15
|
+
- `spec-gate`:显式 formal spec 或高风险任务的零访谈成稿、自审和用户批准门。
|
|
16
|
+
- `using-git-worktrees`:新功能必须使用 worktree;其他隔离条件与复用方式按 Git 规则执行。
|
|
17
|
+
- `to-tickets`:把已批准工作拆成 tracer-bullet tickets 和 blocking graph。
|
|
18
|
+
- `implement`:执行用户授权的低风险 direct scope、已批准 Spec scope 或 frontier ticket;仅 ticket 路径 claim、resolve 并刷新 frontier。
|
|
19
|
+
- `subagent-driven-development`:router 对已授权范围发现多个相互独立的 frontier tickets 时,分派到隔离 worktree 的 fresh subagent。
|
|
20
|
+
- `triage`:对 Issue/外部 PR 分类、验证并形成 agent-ready brief。
|
|
21
|
+
- `handoff`:将当前上下文脱敏压缩到临时 Markdown,供全新 session 接续。
|
|
14
22
|
- `verification-before-completion`:完成、通过、已修复或 ready 声明前的新鲜验证门。
|
|
15
23
|
|
|
24
|
+
## 旁路设计能力
|
|
25
|
+
|
|
26
|
+
- `domain-modeling`:领域术语、实体关系、不变量、生命周期和 bounded context 变化建模。
|
|
27
|
+
- `codebase-design`:deep module、interface、seam、adapter、leverage 和 locality 设计词汇。
|
|
28
|
+
- `improve-codebase-architecture`:扫描 deepening 机会、展示报告并收敛选中候选。
|
|
29
|
+
- `prototype`:用 logic TUI 或视觉 UI 原型回答一个可运行的设计问题。
|
|
30
|
+
- `visual-companion`:经用户同意后,在安全本地浏览器中展示视觉方案和图示。
|
|
31
|
+
|
|
16
32
|
## Engineering / 开发实践
|
|
17
33
|
|
|
34
|
+
- `code-review`:简单、明确、低风险且可验证的任务可自审;复杂或证据不足时使用一个独立子智能体,高风险使用 Standards/Spec 双轴;必要的独立审查不可用时阻塞。
|
|
18
35
|
- `test-driven-development`:行为变化的 Red Test Gate。
|
|
19
|
-
- `systematic-debugging
|
|
36
|
+
- `systematic-debugging`:区分普通明确失败与疑难故障;预期 TDD RED 留在实现循环。
|
|
37
|
+
- `resolving-merge-conflicts`:按双方原始意图逐 hunk 解决 merge/rebase 冲突。
|
|
20
38
|
- `e2e-testing`:Playwright E2E 模式、CI、制品和 flaky 处理。
|
|
21
|
-
- `
|
|
39
|
+
- `feature-acceptance`:以真实证据、用例矩阵和二次审核完成用户功能验收。
|
|
22
40
|
|
|
23
41
|
## Harness / 上下文与编排
|
|
24
42
|
|
|
25
|
-
- `
|
|
26
|
-
- `iterative-retrieval`:subagent 和大仓库探索的迭代检索闭环。
|
|
43
|
+
- `iterative-retrieval`:事实、证据、盲点、subagent 和大仓库探索的迭代检索闭环。
|
|
27
44
|
- `continuous-learning-v2`:Hook 观察、project/global instinct、学习评估和演化。
|
|
28
45
|
|
|
29
|
-
## Meta / Skill 管理
|
|
30
|
-
|
|
31
|
-
- `skill-creator`:创建或更新 skill 的结构和质量规则。
|
|
32
|
-
- `find-skills`:查找可安装或本地已有 skill。
|
|
33
|
-
|
|
34
46
|
## Learn / 学习沉淀
|
|
35
47
|
|
|
36
|
-
学习目录 `learn/` 经 `/learn
|
|
48
|
+
学习目录 `learn/` 经 `/learn eval` 质量门确认学习模式,必须继续按 `skills/learn/<category>/` 分类保存。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: Review a fixed diff and confirmed scope; use self-review for verifiable low-risk work and independent review as risk grows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
Origin: `mattpocock/skills@2ab9580`, adapted to fixed-base review and proportionate verification.
|
|
9
|
+
Review depth belongs here; callers supply the scope, base, risk and available evidence.
|
|
10
|
+
|
|
11
|
+
## Pin the review package
|
|
12
|
+
|
|
13
|
+
1. Resolve the user-supplied or caller-recorded base with `git rev-parse`. A pre-delivery/pre-ticket base
|
|
14
|
+
is valid input. Never invent a missing base; explicit `--staged` review needs none.
|
|
15
|
+
2. Select the package:
|
|
16
|
+
- committed branch: `git diff <base>...HEAD` and `git log <base>..HEAD --oneline`;
|
|
17
|
+
- active worktree: `git diff <base>` includes committed changes and tracked staged and unstaged edits;
|
|
18
|
+
- staged-only: `git diff --cached`.
|
|
19
|
+
3. Include task-owned untracked files in full; exclude unrelated dirty files explicitly.
|
|
20
|
+
4. Use an explicit Spec, the caller's direct-scope contract/approved Spec/ticket, or confirmed user
|
|
21
|
+
acceptance criteria. Only then inspect tracker references or matching durable documents if needed.
|
|
22
|
+
Do not ask again for a base or scope the caller already supplied. Never infer requirements from the diff.
|
|
23
|
+
5. Missing base or required acceptance evidence is `BLOCKED`. An intentionally empty package is `NO CHANGES`.
|
|
24
|
+
For a standalone review with no confirmed requirements, report the Spec axis as `NOT RUN` without
|
|
25
|
+
requiring an extra user confirmation; implementation completion still requires its acceptance criteria.
|
|
26
|
+
|
|
27
|
+
## Select review depth
|
|
28
|
+
|
|
29
|
+
`--mode auto` is the default. Select by risk and verification evidence, not file count, model generation
|
|
30
|
+
or confidence. State the selected mode and reason briefly.
|
|
31
|
+
|
|
32
|
+
| Mode | Trigger | Execution |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| self | Clear requirements, local and reversible low-risk changes, with direct checks or relevant tests covering the result; no unresolved risk or repeated unexpected failures | The implementing agent checks the diff against requirements and relevant rules, then provides verification evidence; no review subagent |
|
|
35
|
+
| independent | Cross-module behavior, complex dependencies, hidden constraints, insufficient verification, repeated unexpected failures, or an explicit request for independent review | One fresh read-only subagent checks Standards and Spec against the same package |
|
|
36
|
+
| dual | High-risk changes such as authorization, persistent data, destructive operations or public contracts, or an explicit request for two isolated axes | Spawn two parallel subagents: separate Standards and Spec reviewers |
|
|
37
|
+
|
|
38
|
+
`--mode self|independent|dual` may request a mode, but cannot weaken the review required by the scope or
|
|
39
|
+
project. Self-review requires every self condition above; otherwise use independent, or dual for high
|
|
40
|
+
risk. Reassess if the scope grows or verification exposes a gap. Review never replaces required tests.
|
|
41
|
+
|
|
42
|
+
For self-review, keep the result concise and use relevant existing checks or direct inspection; do not
|
|
43
|
+
load the independent-review prompts, invent low-value tests, or write a long checklist just for ceremony.
|
|
44
|
+
The implementing agent cannot serve as its own independent reviewer.
|
|
45
|
+
|
|
46
|
+
For independent or dual review, load `references/standards-reviewer-prompt.md` and
|
|
47
|
+
`references/spec-reviewer-prompt.md` only for the reviewer that needs them. Repository standards override
|
|
48
|
+
smell heuristics. Each independent context receives only the frozen package, relevant rules, confirmed
|
|
49
|
+
scope and verification evidence. Reviewers are read-only and must not influence each other.
|
|
50
|
+
|
|
51
|
+
When independent or dual review is selected, lack of agent capacity is never a reason to downgrade to
|
|
52
|
+
self. If parallelism is unavailable, run dual axes sequentially in fresh isolated contexts. If no
|
|
53
|
+
independent context is available, return `BLOCKED`, mark review `NOT RUN`, and do not claim completion.
|
|
54
|
+
|
|
55
|
+
## Report and follow-up
|
|
56
|
+
|
|
57
|
+
Report mode, base and scope source, then separate `Standards` and `Spec` findings with evidence and severity.
|
|
58
|
+
Do not merge or rerank findings across axes. Include checks not run and remaining risks.
|
|
59
|
+
For self-review with no findings, a short conclusion and verification evidence are sufficient.
|
|
60
|
+
|
|
61
|
+
Fix Critical/Important findings before completion. Recheck affected axes against the same base and updated
|
|
62
|
+
package; rerun both when scope, shared behavior or review assumptions change. Reuse checks whose relevant
|
|
63
|
+
inputs are unchanged. A task's complete acceptance and required verification remain completion gates.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Spec reviewer
|
|
2
|
+
|
|
3
|
+
Review only the supplied fixed review package against the supplied Spec, plan, issue, or acceptance
|
|
4
|
+
criteria. Do not report general style opinions.
|
|
5
|
+
|
|
6
|
+
Find:
|
|
7
|
+
|
|
8
|
+
1. requirements that are missing or partial;
|
|
9
|
+
2. behavior that was not requested and may be scope creep;
|
|
10
|
+
3. behavior that looks implemented but is wrong;
|
|
11
|
+
4. acceptance checks that cannot be established from the supplied evidence.
|
|
12
|
+
|
|
13
|
+
Quote or cite the exact requirement and implementation location for every finding. If no confirmed
|
|
14
|
+
Spec source exists, return `NOT RUN`; do not reconstruct requirements from the diff.
|
|
15
|
+
|
|
16
|
+
Return:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
STATUS: PASS | FAIL | NOT RUN | BLOCKED
|
|
20
|
+
FINDINGS:
|
|
21
|
+
- [severity] Spec:line; file:line — requirement, gap, impact, smallest correction
|
|
22
|
+
CHECKS_NOT_RUN:
|
|
23
|
+
- ...
|
|
24
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Standards reviewer
|
|
2
|
+
|
|
3
|
+
Review only the supplied diff/untracked-file package against the supplied repository standards and
|
|
4
|
+
the heuristic baseline below. Repository rules override the baseline. Skip issues already enforced
|
|
5
|
+
by automated tooling.
|
|
6
|
+
|
|
7
|
+
Report hard documented-rule violations separately from smell observations. Every smell is a
|
|
8
|
+
judgement call, not an automatic violation; cite the exact hunk and explain the concrete maintenance
|
|
9
|
+
risk.
|
|
10
|
+
|
|
11
|
+
## Fowler smell baseline
|
|
12
|
+
|
|
13
|
+
- **Mysterious Name**: a name hides what the value or behavior means; rename or clarify the design.
|
|
14
|
+
- **Duplicated Code**: the same logic shape appears more than once; consolidate the shared behavior.
|
|
15
|
+
- **Feature Envy**: behavior reaches more into another module's data than its own; move it toward
|
|
16
|
+
the data owner.
|
|
17
|
+
- **Data Clumps**: the same fields or parameters repeatedly travel together; introduce one concept.
|
|
18
|
+
- **Primitive Obsession**: a primitive stands in for a domain concept that needs invariants.
|
|
19
|
+
- **Repeated Switches**: repeated branching on the same discriminator; centralize the dispatch.
|
|
20
|
+
- **Shotgun Surgery**: one behavior change requires scattered edits; gather the change boundary.
|
|
21
|
+
- **Divergent Change**: one module changes for unrelated reasons; separate responsibilities.
|
|
22
|
+
- **Speculative Generality**: abstractions exist for unrequested future needs; remove or inline them.
|
|
23
|
+
- **Message Chains**: callers navigate deep object graphs; hide navigation behind a stable interface.
|
|
24
|
+
- **Middle Man**: a layer only delegates without adding policy or simplification; remove it.
|
|
25
|
+
- **Refused Bequest**: an inheritor rejects most inherited behavior; prefer composition.
|
|
26
|
+
|
|
27
|
+
Return:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
STATUS: PASS | FAIL | BLOCKED
|
|
31
|
+
FINDINGS:
|
|
32
|
+
- [severity] hard-rule | smell — file:line — evidence, risk, smallest correction
|
|
33
|
+
CHECKS_NOT_RUN:
|
|
34
|
+
- ...
|
|
35
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebase-design
|
|
3
|
+
description: Design deep modules and seams when interfaces leak complexity or tests cross internals.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codebase Design
|
|
7
|
+
|
|
8
|
+
Origin: `mattpocock/skills@2ab9580`, adapted to this repository's routing and safety gates.
|
|
9
|
+
|
|
10
|
+
Design deep modules: substantial behavior behind a small interface, placed at a clean seam and tested
|
|
11
|
+
through that interface.
|
|
12
|
+
|
|
13
|
+
## Vocabulary
|
|
14
|
+
|
|
15
|
+
Use these terms consistently:
|
|
16
|
+
|
|
17
|
+
- **Module**: anything with an interface and implementation, at any scale.
|
|
18
|
+
- **Interface**: everything callers must know: signature, invariants, ordering, errors, configuration
|
|
19
|
+
and relevant performance behavior.
|
|
20
|
+
- **Implementation**: behavior hidden inside the module.
|
|
21
|
+
- **Depth**: leverage provided per unit of interface a caller must learn.
|
|
22
|
+
- **Seam**: a place where behavior can change without editing the caller.
|
|
23
|
+
- **Adapter**: a concrete implementation that fills a role at a seam.
|
|
24
|
+
- **Leverage**: capability reused across callers and tests.
|
|
25
|
+
- **Locality**: change, knowledge and verification concentrated behind one interface.
|
|
26
|
+
|
|
27
|
+
Avoid substituting vague terms such as “component”, “service”, “API” or “boundary” when the design
|
|
28
|
+
question is specifically about a module, interface or seam.
|
|
29
|
+
|
|
30
|
+
## Design Checks
|
|
31
|
+
|
|
32
|
+
1. Define the caller-visible behavior and constraints.
|
|
33
|
+
2. Locate the current seam and list what leaks across it.
|
|
34
|
+
3. Apply the deletion test: if the module vanished, would complexity disappear or spread into callers?
|
|
35
|
+
4. Reduce methods, parameters, ordering knowledge and configuration callers must carry.
|
|
36
|
+
5. Hide policy and orchestration behind the interface while preserving observable behavior.
|
|
37
|
+
6. Treat the interface as the test surface; tests and callers should cross the same seam.
|
|
38
|
+
7. Introduce an adapter only when something actually varies. One adapter is hypothetical; two make a
|
|
39
|
+
seam real.
|
|
40
|
+
8. Compare at least two materially different interfaces when the decision is consequential.
|
|
41
|
+
|
|
42
|
+
## Dependency Strategy
|
|
43
|
+
|
|
44
|
+
Read `references/deepening.md` when merging shallow modules or changing dependencies. Read
|
|
45
|
+
`references/design-it-twice.md` when alternative interfaces need independent exploration.
|
|
46
|
+
|
|
47
|
+
## Output
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
Module:
|
|
51
|
+
Current interface and seam:
|
|
52
|
+
Leaked complexity:
|
|
53
|
+
Proposed interface:
|
|
54
|
+
Hidden implementation:
|
|
55
|
+
Adapters:
|
|
56
|
+
Depth / leverage / locality:
|
|
57
|
+
Test surface:
|
|
58
|
+
Compatibility and migration:
|
|
59
|
+
Open consequential decisions:
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Return unresolved user decisions to `skills/using-superpowers/SKILL.md`. Do not implement or persist
|
|
63
|
+
an architectural decision unless the active workflow authorizes it.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Deepening Modules
|
|
2
|
+
|
|
3
|
+
## Dependency Categories
|
|
4
|
+
|
|
5
|
+
1. **In-process**: pure computation or in-memory state. Merge and test through the new interface.
|
|
6
|
+
2. **Local-substitutable**: local test stand-ins such as an in-memory filesystem or embedded database.
|
|
7
|
+
Keep the dependency behind an internal seam and run the stand-in in tests.
|
|
8
|
+
3. **Remote but owned**: an internal service. Define a port at the seam, inject the transport adapter,
|
|
9
|
+
and test with an in-memory adapter.
|
|
10
|
+
4. **True external**: a third-party service. Inject a narrow port and use a controlled fake or mock
|
|
11
|
+
adapter at the same seam.
|
|
12
|
+
|
|
13
|
+
## Seam Discipline
|
|
14
|
+
|
|
15
|
+
- Do not expose an internal seam merely because a test uses it.
|
|
16
|
+
- One adapter is hypothetical; production plus test adapters make a real seam.
|
|
17
|
+
- Prefer one deep external interface over a chain of public pass-through modules.
|
|
18
|
+
- New tests observe behavior through the deepened interface.
|
|
19
|
+
- Delete superseded shallow tests once equivalent behavior is covered at the new seam.
|
|
20
|
+
|
|
21
|
+
## Safe Migration
|
|
22
|
+
|
|
23
|
+
1. Record the old public behavior and compatibility constraints.
|
|
24
|
+
2. Add the new interface beside the old when an atomic change cannot remain green.
|
|
25
|
+
3. Move callers in reversible batches.
|
|
26
|
+
4. Run tests at the new interface and existing public boundaries.
|
|
27
|
+
5. Remove the old interface only when no callers remain and rollback evidence exists.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Design It Twice
|
|
2
|
+
|
|
3
|
+
Use when one interface choice will materially affect callers, testability or long-term locality.
|
|
4
|
+
|
|
5
|
+
1. Frame constraints, dependencies, current coupling and the behavior that must stay stable.
|
|
6
|
+
2. Generate at least three materially different interface designs:
|
|
7
|
+
- minimum surface and maximum leverage;
|
|
8
|
+
- maximum flexibility;
|
|
9
|
+
- simplest common caller;
|
|
10
|
+
- ports-and-adapters shape when a remote dependency exists.
|
|
11
|
+
3. For each design include interface, usage, hidden implementation, adapter strategy and trade-offs.
|
|
12
|
+
4. Compare depth, locality, seam placement, compatibility and test surface.
|
|
13
|
+
5. Recommend one design or a justified hybrid.
|
|
14
|
+
|
|
15
|
+
Independent subagents may generate alternatives when the active runtime and user authorization allow
|
|
16
|
+
delegation. Give each only the same constraints and a different design objective; do not leak a
|
|
17
|
+
preferred answer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: continuous-learning-v2
|
|
3
|
-
description:
|
|
3
|
+
description: "管理观察、instinct、学习评估和演化;仅在显式学习或 Hook 配置请求时使用。"
|
|
4
4
|
version: 2.1.0
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -21,7 +21,7 @@ version: 2.1.0
|
|
|
21
21
|
- **Project instinct**:默认作用域,只服务当前项目,避免跨项目污染。
|
|
22
22
|
- **Global instinct**:经用户确认后才跨项目应用。
|
|
23
23
|
- **Confidence**:`0.3/0.5/0.7/0.9`,不会因时间自动衰减;长期未观察只进入待审查。
|
|
24
|
-
- **Promotion**:先 `/promote --dry-run` 预览,再由用户确认是否 `--apply`。
|
|
24
|
+
- **Promotion**:先 `/learn promote --dry-run` 预览,再由用户确认是否 `--apply`。
|
|
25
25
|
|
|
26
26
|
## 数据布局
|
|
27
27
|
|
|
@@ -41,12 +41,12 @@ ${XDG_DATA_HOME:-~/.local/share}/ecc-homunculus/
|
|
|
41
41
|
|
|
42
42
|
| 命令 | 作用 |
|
|
43
43
|
| --- | --- |
|
|
44
|
-
| `/learn
|
|
45
|
-
| `/
|
|
46
|
-
| `/projects` | 调用 `scripts/learning/projects.js` 查看项目注册表 |
|
|
47
|
-
| `/promote --dry-run` | 调用 `scripts/learning/promote.js` 预览 project -> global |
|
|
48
|
-
| `/evolve` | 聚类 instinct,评估是否演化为 skill/command/agent |
|
|
49
|
-
| `/prune` | 只清理人工标记删除、拒绝或归档的 instinct |
|
|
44
|
+
| `/learn eval` | 从当前会话提取可复用模式,保存前走质量门 |
|
|
45
|
+
| `/learn status --review` | 调用 `scripts/learning/review-confidence.js` 审查 project/global/legacy instincts |
|
|
46
|
+
| `/learn projects` | 调用 `scripts/learning/projects.js` 查看项目注册表 |
|
|
47
|
+
| `/learn promote --dry-run` | 调用 `scripts/learning/promote.js` 预览 project -> global |
|
|
48
|
+
| `/learn evolve` | 聚类 instinct,评估是否演化为 skill/command/agent |
|
|
49
|
+
| `/learn prune` | 只清理人工标记删除、拒绝或归档的 instinct |
|
|
50
50
|
|
|
51
51
|
## 脚本入口
|
|
52
52
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: domain-modeling
|
|
3
|
+
description: Model changes to business concepts, entities, states, relationships, invariants, or ownership; exclude ordinary refactors.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Domain Modeling
|
|
7
|
+
|
|
8
|
+
Make domain changes explicit without becoming a workflow gate or a second clarification engine.
|
|
9
|
+
|
|
10
|
+
## Boundary
|
|
11
|
+
|
|
12
|
+
Trigger only when the task introduces or changes at least one of:
|
|
13
|
+
|
|
14
|
+
- domain terms and their precise meanings;
|
|
15
|
+
- entities, value objects, or their relationships;
|
|
16
|
+
- invariants and ownership rules;
|
|
17
|
+
- lifecycle states or transitions;
|
|
18
|
+
- a bounded context or the contract between contexts.
|
|
19
|
+
|
|
20
|
+
Do not trigger for ordinary code complexity, a new module that reuses the existing model, or read-only use of established `CONTEXT.md` vocabulary.
|
|
21
|
+
|
|
22
|
+
## Inputs
|
|
23
|
+
|
|
24
|
+
Consume verified repository facts, an optional confirmed grilling handoff, the current approved or
|
|
25
|
+
draft Spec, and `docs/agent-workflow/project-context.md` when it exists. Do not ask the user for
|
|
26
|
+
discoverable facts and do not own consequential user decisions.
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
1. Extract existing terms, entities, invariants, states, owners, and context boundaries from code and documents.
|
|
31
|
+
2. Identify what the task adds, removes, renames, or transfers.
|
|
32
|
+
3. State ambiguous terms and contract conflicts without silently resolving user-owned choices.
|
|
33
|
+
4. Produce the smallest model needed for the task: glossary, relationship list, invariants, lifecycle, boundary map, and ADR recommendation when relevant.
|
|
34
|
+
5. Return the model to the currently routed Skill; do not select or invoke the next workflow Skill.
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
Use only the applicable parts:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
Domain vocabulary:
|
|
42
|
+
- Term: definition
|
|
43
|
+
|
|
44
|
+
Entities and relationships:
|
|
45
|
+
- Entity/value object: ownership and relationship
|
|
46
|
+
|
|
47
|
+
Invariants:
|
|
48
|
+
- invariant and enforcement boundary
|
|
49
|
+
|
|
50
|
+
Lifecycle:
|
|
51
|
+
- state -> event -> next state
|
|
52
|
+
|
|
53
|
+
Bounded contexts:
|
|
54
|
+
- context: responsibility and external contract
|
|
55
|
+
|
|
56
|
+
ADR recommendations:
|
|
57
|
+
- decision that merits a durable record
|
|
58
|
+
|
|
59
|
+
Unresolved consequential decisions:
|
|
60
|
+
- stable decision subject and evidence
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If an unresolved item changes product meaning, ownership, a public contract, persistence, or a high-cost boundary, return it to the current router/Spec Gate contract. Do not interview or choose for the user.
|
|
64
|
+
|
|
65
|
+
## Persistence Gate
|
|
66
|
+
|
|
67
|
+
Default mode keeps output in the active handoff or Spec. Do not modify tracked `CONTEXT.md`, ADRs,
|
|
68
|
+
schemas, or code merely because domain modeling triggered.
|
|
69
|
+
|
|
70
|
+
**Persistent documentation mode** is enabled only by an explicit documented grilling request or
|
|
71
|
+
direct user approval to maintain domain docs during the session. In that mode:
|
|
72
|
+
|
|
73
|
+
1. Use confirmed context and ADR locations from `docs/agent-workflow/project-context.md` when present,
|
|
74
|
+
otherwise from existing repository conventions or the user's confirmed request.
|
|
75
|
+
2. When a term becomes stable, show the exact glossary change and obtain write approval before
|
|
76
|
+
updating it inline.
|
|
77
|
+
3. Offer an ADR only when the decision is hard to reverse, surprising without context and the result
|
|
78
|
+
of a real trade-off; show its path/content before writing.
|
|
79
|
+
4. Keep `CONTEXT.md` implementation-free and keep ADRs concise.
|
|
80
|
+
|
|
81
|
+
Outside that mode, persistence after an approved Spec remains a router-selected ticket or implementation task.
|
|
82
|
+
If project context is absent, do not invent a documentation layout.
|
|
83
|
+
|
|
84
|
+
### Glossary shape
|
|
85
|
+
|
|
86
|
+
- Define only project-specific domain terms in one or two sentences.
|
|
87
|
+
- Choose one canonical term and list misleading synonyms under `Avoid`.
|
|
88
|
+
- A single-context repository uses root `CONTEXT.md`; a real multi-context repository uses
|
|
89
|
+
`CONTEXT-MAP.md` pointing to context-local glossaries.
|
|
90
|
+
|
|
91
|
+
### ADR shape
|
|
92
|
+
|
|
93
|
+
- Use the configured ADR directory and the next sequential number.
|
|
94
|
+
- Lead with one short paragraph covering context, decision and reason.
|
|
95
|
+
- Add status, alternatives or consequences only when they carry durable information.
|
|
96
|
+
|
|
97
|
+
## Examples
|
|
98
|
+
|
|
99
|
+
- Adding a subscription entity with trial, active, suspended, and cancelled lifecycle states triggers this Skill.
|
|
100
|
+
- Renaming an internal helper while consuming unchanged billing vocabulary does not trigger it.
|
|
101
|
+
- Moving authorization ownership between bounded contexts triggers it and may surface a high-risk decision for Spec Gate.
|