claude-everything-workflow 0.1.8 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +19 -20
- package/README.md +112 -104
- package/agents/code-reviewer.md +15 -44
- package/agents/harness-optimizer.md +3 -2
- package/agents/planner.md +23 -107
- package/commands/code-review.md +25 -9
- package/commands/learn.md +97 -0
- package/commands/pr.md +4 -0
- package/commands/to-spec.md +11 -0
- package/hooks/check-code-size.js +33 -12
- package/hooks/check-console-log.js +72 -24
- package/package.json +5 -2
- package/rules/01-base.md +19 -42
- package/rules/02-code-size.md +6 -17
- package/rules/03-architecture.md +16 -54
- package/rules/04-error-handling.md +4 -25
- package/rules/05-git-workflow.md +9 -37
- package/rules/06-comments.md +3 -37
- package/rules/07-forbidden.md +6 -30
- 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 +10 -47
- package/rules/common/context-hygiene.md +9 -72
- package/rules/common/harness-engineering.md +11 -38
- package/rules/common/hooks.md +11 -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 +15 -59
- package/scripts/cleanup-retired-skills.js +214 -0
- package/scripts/install.ps1 +73 -85
- package/scripts/install.sh +54 -77
- package/scripts/learning/review-confidence.js +1 -4
- package/scripts/merge-claude-settings.cjs +75 -0
- package/scripts/retired-skill-files.json +37 -0
- package/scripts/upstream-capability-baseline.json +27 -0
- package/scripts/upstream-capability-map.json +150 -0
- package/scripts/verify/core.js +91 -0
- package/scripts/verify/grilling-spec-gate-checks.js +260 -0
- package/scripts/verify/metadata-checks.js +724 -0
- package/scripts/verify/repository-checks.js +435 -0
- package/scripts/verify/runtime-checks.js +593 -0
- package/scripts/verify/workflow-checks.js +741 -0
- package/scripts/verify/workflow-ownership-fixtures.js +371 -0
- package/scripts/verify/workflow-ownership.js +780 -0
- package/scripts/verify-harness.js +16 -1075
- package/scripts/verify-upstream-capability-map.js +117 -0
- package/skills/README.md +24 -10
- package/skills/code-review/SKILL.md +50 -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 +7 -7
- package/skills/continuous-learning-v2/config.json +0 -4
- package/skills/domain-modeling/SKILL.md +100 -0
- package/skills/feature-acceptance/SKILL.md +89 -0
- package/skills/grilling/SKILL.md +83 -0
- package/skills/handoff/SKILL.md +56 -0
- package/skills/implement/SKILL.md +97 -0
- package/skills/improve-codebase-architecture/SKILL.md +48 -0
- package/skills/iterative-retrieval/SKILL.md +10 -1
- package/skills/learn/README.md +2 -2
- package/skills/project-context/SKILL.md +94 -0
- package/skills/project-context/agents/openai.yaml +6 -0
- package/skills/project-context/references/project-context-template.md +61 -0
- 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/research/SKILL.md +48 -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 +7 -51
- 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 +18 -2
- package/skills/to-tickets/SKILL.md +94 -0
- package/skills/triage/SKILL.md +53 -0
- package/skills/triage/references/agent-brief.md +32 -0
- package/skills/triage/references/out-of-scope.md +14 -0
- package/skills/using-superpowers/SKILL.md +140 -40
- 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/skills/wayfinder/SKILL.md +57 -0
- 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/documentation-lookup/SKILL.md +0 -90
- package/skills/executing-plans/SKILL.md +0 -66
- 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,117 @@
|
|
|
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 capabilities + handoff\n`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
main();
|
|
114
|
+
} catch (error) {
|
|
115
|
+
process.stderr.write(`${error instanceof Error ? error.message : error}\n`);
|
|
116
|
+
process.exitCode = 1;
|
|
117
|
+
}
|
package/skills/README.md
CHANGED
|
@@ -5,31 +5,45 @@
|
|
|
5
5
|
## Process / 门禁
|
|
6
6
|
|
|
7
7
|
- `using-superpowers`:非平凡任务的 skill 路由、优先级和完成声明纪律。
|
|
8
|
-
- `
|
|
9
|
-
- `
|
|
10
|
-
- `executing-plans`:按已批准计划顺序执行。
|
|
11
|
-
- `subagent-driven-development`:用户批准 commit/PR/SDD handling 后的任务拆分、审查和进度账本。
|
|
8
|
+
- `grilling`:对计划、设计或重大用户决策进行单问式压力测试。
|
|
9
|
+
- `spec-gate`:显式 formal spec 或高风险任务的零访谈成稿、自审和用户批准门。
|
|
12
10
|
- `using-git-worktrees`:脏工作区、高风险或并行任务的隔离工作区准备。
|
|
11
|
+
- `to-tickets`:把已批准工作拆成 tracer-bullet tickets 和 blocking graph。
|
|
12
|
+
- `implement`:执行用户授权的低风险 direct scope、已批准 Spec scope 或 frontier ticket;仅 ticket 路径 claim、resolve 并刷新 frontier。
|
|
13
|
+
- `subagent-driven-development`:router 对已授权范围发现多个相互独立的 frontier tickets 时,分派到隔离 worktree 的 fresh subagent。
|
|
14
|
+
- `wayfinder`:为跨 session 的模糊工作维护 decision-ticket map/frontier。
|
|
15
|
+
- `triage`:对 Issue/外部 PR 分类、验证并形成 agent-ready brief。
|
|
16
|
+
- `handoff`:将当前上下文脱敏压缩到临时 Markdown,供全新 session 接续。
|
|
13
17
|
- `verification-before-completion`:完成、通过、已修复或 ready 声明前的新鲜验证门。
|
|
14
18
|
|
|
19
|
+
## 旁路设计能力
|
|
20
|
+
|
|
21
|
+
- `project-context`:显式配置项目工作追踪、领域文档和 ADR 的长期位置。
|
|
22
|
+
- `domain-modeling`:领域术语、实体关系、不变量、生命周期和 bounded context 变化建模。
|
|
23
|
+
- `codebase-design`:deep module、interface、seam、adapter、leverage 和 locality 设计词汇。
|
|
24
|
+
- `improve-codebase-architecture`:扫描 deepening 机会、展示报告并收敛选中候选。
|
|
25
|
+
- `prototype`:用 logic TUI 或视觉 UI 原型回答一个可运行的设计问题。
|
|
26
|
+
- `visual-companion`:经用户同意后,在安全本地浏览器中展示视觉方案和图示。
|
|
27
|
+
|
|
15
28
|
## Engineering / 开发实践
|
|
16
29
|
|
|
30
|
+
- `code-review`:用两个隔离 subagent 并行执行 Standards 与 Spec 双轴审查。
|
|
17
31
|
- `test-driven-development`:行为变化的 Red Test Gate。
|
|
18
32
|
- `systematic-debugging`:失败、异常结果和 flaky 行为的根因调试。
|
|
33
|
+
- `resolving-merge-conflicts`:按双方原始意图逐 hunk 解决 merge/rebase 冲突。
|
|
19
34
|
- `e2e-testing`:Playwright E2E 模式、CI、制品和 flaky 处理。
|
|
20
|
-
- `
|
|
35
|
+
- `feature-acceptance`:以真实证据、用例矩阵和二次审核完成用户功能验收。
|
|
21
36
|
|
|
22
37
|
## Harness / 上下文与编排
|
|
23
38
|
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
39
|
+
- `iterative-retrieval`:事实、证据、盲点、subagent 和大仓库探索的迭代检索闭环。
|
|
40
|
+
- `research`:后台一手来源调查与逐项引用的 Markdown 研究记录。
|
|
26
41
|
- `continuous-learning-v2`:Hook 观察、project/global instinct、学习评估和演化。
|
|
27
42
|
|
|
28
43
|
## Meta / Skill 管理
|
|
29
44
|
|
|
30
|
-
- `
|
|
31
|
-
- `find-skills`:查找可安装或本地已有 skill。
|
|
45
|
+
- `find-skills`:查找本地已有或开放生态中可安装的 agent skill。
|
|
32
46
|
|
|
33
47
|
## Learn / 学习沉淀
|
|
34
48
|
|
|
35
|
-
学习目录 `learn/` 经 `/learn
|
|
49
|
+
学习目录 `learn/` 经 `/learn eval` 质量门确认学习模式,必须继续按 `skills/learn/<category>/` 分类保存。
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-review
|
|
3
|
+
description: "Review changes since a user-supplied fixed point with two parallel subagents: one for repository standards and Fowler smell heuristics, one for Spec compliance. Use for branch, PR, or work-in-progress review before completion."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Review
|
|
7
|
+
|
|
8
|
+
Origin: `mattpocock/skills@2ab9580`, adapted to this repository's fixed-base and no-implicit-write rules.
|
|
9
|
+
|
|
10
|
+
## Pin the review package
|
|
11
|
+
|
|
12
|
+
1. Resolve the user-supplied base with `git rev-parse`. Never infer a missing base. Only explicit
|
|
13
|
+
`--staged` review has no branch base.
|
|
14
|
+
2. Select one review package:
|
|
15
|
+
- committed branch: `git diff <base>...HEAD` plus `git log <base>..HEAD --oneline`;
|
|
16
|
+
- active no-commit/mixed worktree: `git diff <base>`, which includes committed changes plus
|
|
17
|
+
tracked staged and unstaged changes relative to the base;
|
|
18
|
+
- explicit staged-only review: `git diff --cached`.
|
|
19
|
+
3. For branch and worktree modes, list task-owned untracked files explicitly and include their complete
|
|
20
|
+
content/diff because Git does not include untracked files. Record unrelated dirty files as excluded.
|
|
21
|
+
4. Capture the selected package once and give the identical package to both reviewers.
|
|
22
|
+
5. Stop as `BLOCKED` when a required base is invalid or the intended review package is empty.
|
|
23
|
+
6. Resolve the Spec source in order: explicit `--spec`, tracker reference in commits, matching durable
|
|
24
|
+
Spec/plan, then user confirmation that no Spec exists.
|
|
25
|
+
7. Read repository standards and only the rules relevant to the changed areas.
|
|
26
|
+
|
|
27
|
+
## Run two isolated axes
|
|
28
|
+
|
|
29
|
+
Spawn two parallel subagents with isolated contexts. Do not ask one reviewer to simulate both axes.
|
|
30
|
+
|
|
31
|
+
- **Standards reviewer**: load `references/standards-reviewer-prompt.md`, the fixed review package,
|
|
32
|
+
relevant repository standards, and the complete smell baseline from that prompt.
|
|
33
|
+
- **Spec reviewer**: load `references/spec-reviewer-prompt.md`, the same fixed review package, and
|
|
34
|
+
the complete Spec source. Skip this subagent only when the user confirms there is no Spec.
|
|
35
|
+
|
|
36
|
+
Both are read-only. They must not edit files or influence one another. If the runtime cannot create
|
|
37
|
+
two isolated review contexts, return `BLOCKED`; do not silently collapse them into one reviewer.
|
|
38
|
+
|
|
39
|
+
## Aggregate
|
|
40
|
+
|
|
41
|
+
Report the two results side by side under `## Standards` and `## Spec`. Do not merge or rerank
|
|
42
|
+
findings across axes. Preserve each axis's severity order and evidence.
|
|
43
|
+
|
|
44
|
+
End with:
|
|
45
|
+
|
|
46
|
+
- finding count and worst severity within each axis;
|
|
47
|
+
- checks not run;
|
|
48
|
+
- the minimal required fixes or missing input.
|
|
49
|
+
|
|
50
|
+
After fixes, rerun both axes against the same base and current full review package.
|
|
@@ -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 or improve deep modules, interfaces, seams, adapters, leverage, locality, and testability. Use when a module interface is too broad, callers carry duplicated complexity, tests reach through internals, or architecture work needs the Matt Pocock deep-module vocabulary."
|
|
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.
|
|
@@ -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,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: domain-modeling
|
|
3
|
+
description: "Model domain vocabulary, entity relationships, invariants, lifecycle transitions, and bounded context changes. Use only when a task introduces or changes domain concepts or ownership boundaries; do not trigger for ordinary code complexity, file count, or merely consuming existing CONTEXT.md vocabulary."
|
|
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 the confirmed context and ADR locations from `docs/agent-workflow/project-context.md`.
|
|
74
|
+
2. When a term becomes stable, show the exact glossary change and obtain write approval before
|
|
75
|
+
updating it inline.
|
|
76
|
+
3. Offer an ADR only when the decision is hard to reverse, surprising without context and the result
|
|
77
|
+
of a real trade-off; show its path/content before writing.
|
|
78
|
+
4. Keep `CONTEXT.md` implementation-free and keep ADRs concise.
|
|
79
|
+
|
|
80
|
+
Outside that mode, persistence after an approved Spec remains a router-selected ticket or implementation task.
|
|
81
|
+
If project context is absent, do not invent a documentation layout.
|
|
82
|
+
|
|
83
|
+
### Glossary shape
|
|
84
|
+
|
|
85
|
+
- Define only project-specific domain terms in one or two sentences.
|
|
86
|
+
- Choose one canonical term and list misleading synonyms under `Avoid`.
|
|
87
|
+
- A single-context repository uses root `CONTEXT.md`; a real multi-context repository uses
|
|
88
|
+
`CONTEXT-MAP.md` pointing to context-local glossaries.
|
|
89
|
+
|
|
90
|
+
### ADR shape
|
|
91
|
+
|
|
92
|
+
- Use the configured ADR directory and the next sequential number.
|
|
93
|
+
- Lead with one short paragraph covering context, decision and reason.
|
|
94
|
+
- Add status, alternatives or consequences only when they carry durable information.
|
|
95
|
+
|
|
96
|
+
## Examples
|
|
97
|
+
|
|
98
|
+
- Adding a subscription entity with trial, active, suspended, and cancelled lifecycle states triggers this Skill.
|
|
99
|
+
- Renaming an internal helper while consuming unchanged billing vocabulary does not trigger it.
|
|
100
|
+
- Moving authorization ownership between bounded contexts triggers it and may surface a high-risk decision for Spec Gate.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-acceptance
|
|
3
|
+
description: 用于功能验收、回归验证、确认修复是否生效,以及需要用真实界面、视频或日志证据判断用户流程是否正常的任务。适用于“验收一下”“测一下”“确认修复”“给我可复核证据”等请求。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 功能验收
|
|
7
|
+
|
|
8
|
+
把验收请求转成可复现、可复核的结论。优先验证用户可观察的行为,不用代码阅读、模拟页面或单个 API 响应替代真实流程。
|
|
9
|
+
|
|
10
|
+
## 输出协议
|
|
11
|
+
|
|
12
|
+
每个用例和整体结论只能是 `PASS / FAIL / BLOCKED / NOT RUN`。
|
|
13
|
+
|
|
14
|
+
- `PASS`:预期结果与关键断言满足,证据已经复核。
|
|
15
|
+
- `FAIL`:结果、错误提示、数据变化或技术断言不符合预期。
|
|
16
|
+
- `BLOCKED`:缺少明确的环境、权限、账号、数据或外部依赖。
|
|
17
|
+
- `NOT RUN`:本轮未执行的非核心用例,必须说明未覆盖风险。
|
|
18
|
+
|
|
19
|
+
不要用“看起来正常”替代结论。用户明确要求的核心用例不能无理由标为 `NOT RUN`。
|
|
20
|
+
|
|
21
|
+
## 路由
|
|
22
|
+
|
|
23
|
+
- 需要新增或维护可提交、可在 CI 重跑的浏览器测试时,读取 `skills/e2e-testing/SKILL.md`,必要时委派 `agents/e2e-runner.md`。
|
|
24
|
+
- 需要定位失败根因时,先读取 `skills/systematic-debugging/SKILL.md`,不要在验收报告中猜测修复方案。
|
|
25
|
+
- 完成声明仍须遵守 `skills/verification-before-completion/SKILL.md` 的新鲜验证证据要求。
|
|
26
|
+
- 仅在用例相互独立、运行环境允许且任务授权并行时并发执行;共享状态、顺序依赖或无并发授权时串行执行,并说明原因。
|
|
27
|
+
|
|
28
|
+
## 流程
|
|
29
|
+
|
|
30
|
+
### 1. 定义目标
|
|
31
|
+
|
|
32
|
+
记录被测功能、真实用户入口、核心成功标准、环境前置条件和不可执行的高风险动作。没有测试前置条件时先标记 `BLOCKED`,不要通过注入凭据、篡改本地状态或破坏共享数据绕过。
|
|
33
|
+
|
|
34
|
+
### 2. 写用例矩阵
|
|
35
|
+
|
|
36
|
+
先写用例矩阵,再开始操作:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
| ID | 场景 | 前置条件 | 步骤 | 期望结果 | keyNodes | evidenceMedium | 结果 |
|
|
40
|
+
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
41
|
+
| A1 | 主成功路径 | 已启动服务 | 从真实入口完成操作 | 用户可见结果正确 | 入口 / 操作 / 结果 | image | NOT RUN |
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- 至少覆盖主成功路径;按风险补充错误、空状态、权限或关键分支。
|
|
45
|
+
- `keyNodes` 写明名称、重要性、预期观察和证据角色。
|
|
46
|
+
- `evidenceMedium` 只能是 `image`、`video` 或 `log`。关键节点超过 10 个或需要表达过程时用 `video`。
|
|
47
|
+
- 真实产品流程的 `image` 或 `video` 必须来自真实产品页面或应用界面;API、数据库或脚本输出只作为辅助 `log` 证据。
|
|
48
|
+
|
|
49
|
+
### 3. 采集证据
|
|
50
|
+
|
|
51
|
+
在目标项目工作区的已忽略临时目录保存需要持久复核的产物,例如 `tmp/acceptance/<run-id>/`。每个用例单独保存截图、视频或日志,并记录来源 URL/窗口、采集时间、采集前动作和对应的 `keyNodes`。
|
|
52
|
+
|
|
53
|
+
- 操作前采集基线,操作后采集结果;分支判断点不能只保留最终截图。
|
|
54
|
+
- 视频应覆盖触发、操作和完成信号;不要用静态图片伪装视频。
|
|
55
|
+
- 日志记录相关 console、网络或服务端错误,不把 token、Cookie、账号、密码、个人数据或其他敏感信息写入证据或报告。
|
|
56
|
+
- 无法继续时立即停止该用例,记录可复现的 `failureReason` 与缺失条件。
|
|
57
|
+
|
|
58
|
+
### 4. 二次审核
|
|
59
|
+
|
|
60
|
+
主 agent 必须二次审核每份关键证据,不能只引用执行者的自报结论。
|
|
61
|
+
|
|
62
|
+
- `image`:确认可渲染、来源真实、URL 和关键节点正确,且不是空白页、登录页或无关页面。
|
|
63
|
+
- `video`:确认时长合理,并覆盖触发、过程和完成信号。
|
|
64
|
+
- `log`:确认关键断言存在,且没有与结论冲突的相关错误。
|
|
65
|
+
|
|
66
|
+
任何 image/video 用例未完成二次审核时,整体不能是 `PASS`。
|
|
67
|
+
|
|
68
|
+
### 5. 报告
|
|
69
|
+
|
|
70
|
+
报告保持简短但可复核:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
结论:PASS / FAIL / BLOCKED / NOT RUN
|
|
74
|
+
被测功能:
|
|
75
|
+
被测地址 / 命令:
|
|
76
|
+
用例结果:
|
|
77
|
+
| ID | 场景 | 结果 | 原因 | 关键证据 |
|
|
78
|
+
二次审核:已打开的证据;改判原因
|
|
79
|
+
技术摘要:相关 console / 网络 / 服务端错误
|
|
80
|
+
未覆盖风险:
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
核心用例任一 `FAIL` 时整体为 `FAIL`;没有 `FAIL` 但核心用例 `BLOCKED` 时整体为 `BLOCKED`;核心用例全部 `PASS` 且证据审核完成时整体才为 `PASS`。
|
|
84
|
+
|
|
85
|
+
## 边界
|
|
86
|
+
|
|
87
|
+
- 不把 mock 页面、Storybook、历史截图、终端截图或伪造数据当作真实产品验收证据。
|
|
88
|
+
- 不为验收执行用户未授权的写操作、支付、删除或生产数据变更。
|
|
89
|
+
- 不把一次性验收替代应提交的单元测试、类型检查或 E2E 测试;它们互为补充。
|