harnessed 4.6.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +37 -3
  2. package/dist/cli.mjs +682 -433
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/manifests/optional/codegraph.yaml +6 -4
  7. package/manifests/optional/ecc.ee5-answers.json +13 -0
  8. package/manifests/optional/ecc.yaml +64 -0
  9. package/messages/en.json +4 -1
  10. package/messages/zh-Hans.json +20 -3
  11. package/package.json +1 -1
  12. package/workflows/auto/SKILL.zh-Hans.md +129 -0
  13. package/workflows/capabilities.yaml +120 -0
  14. package/workflows/disciplines/doc-discipline.zh-Hans.yaml +49 -0
  15. package/workflows/disciplines/karpathy.yaml +5 -5
  16. package/workflows/disciplines/karpathy.zh-Hans.yaml +47 -0
  17. package/workflows/disciplines/operational.yaml +6 -6
  18. package/workflows/disciplines/operational.zh-Hans.yaml +79 -0
  19. package/workflows/disciplines/output-style.yaml +7 -7
  20. package/workflows/disciplines/output-style.zh-Hans.yaml +62 -0
  21. package/workflows/disciplines/priority.yaml +2 -2
  22. package/workflows/disciplines/priority.zh-Hans.yaml +28 -0
  23. package/workflows/discuss/auto/SKILL.zh-Hans.md +75 -0
  24. package/workflows/discuss/phase/SKILL.zh-Hans.md +73 -0
  25. package/workflows/discuss/strategic/SKILL.zh-Hans.md +78 -0
  26. package/workflows/discuss/subtask/SKILL.zh-Hans.md +79 -0
  27. package/workflows/plan/architecture/SKILL.zh-Hans.md +74 -0
  28. package/workflows/plan/auto/SKILL.zh-Hans.md +75 -0
  29. package/workflows/plan/phase/SKILL.zh-Hans.md +76 -0
  30. package/workflows/research/SKILL.zh-Hans.md +81 -0
  31. package/workflows/retro/SKILL.zh-Hans.md +71 -0
  32. package/workflows/role-prompts.zh-Hans.yaml +501 -0
  33. package/workflows/ship/auto/SKILL.zh-Hans.md +46 -0
  34. package/workflows/ship/preflight/SKILL.zh-Hans.md +38 -0
  35. package/workflows/task/auto/SKILL.zh-Hans.md +80 -0
  36. package/workflows/task/clarify/SKILL.zh-Hans.md +79 -0
  37. package/workflows/task/code/SKILL.zh-Hans.md +85 -0
  38. package/workflows/task/deliver/SKILL.zh-Hans.md +113 -0
  39. package/workflows/task/test/SKILL.zh-Hans.md +90 -0
  40. package/workflows/verify/auto/SKILL.zh-Hans.md +89 -0
  41. package/workflows/verify/code-review/SKILL.zh-Hans.md +71 -0
  42. package/workflows/verify/design/SKILL.zh-Hans.md +74 -0
  43. package/workflows/verify/multispec/SKILL.zh-Hans.md +88 -0
  44. package/workflows/verify/paranoid/SKILL.zh-Hans.md +74 -0
  45. package/workflows/verify/progress/SKILL.zh-Hans.md +69 -0
  46. package/workflows/verify/qa/SKILL.zh-Hans.md +76 -0
  47. package/workflows/verify/security/SKILL.zh-Hans.md +70 -0
  48. package/workflows/verify/simplify/SKILL.zh-Hans.md +70 -0
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var package_default = {
3
- version: "4.6.0"};
3
+ version: "4.8.0"};
4
4
 
5
5
  // src/index.ts
6
6
  var VERSION = package_default.version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,OAkGb,CAAA;;;AC/FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.6.0\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\",\n \"harnessed-inject-state\": \"./bin/harnessed-inject-state.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
1
+ {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,OAkGb,CAAA;;;AC/FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.8.0\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\",\n \"harnessed-inject-state\": \"./bin/harnessed-inject-state.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
@@ -1,8 +1,10 @@
1
1
  # yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
2
- # OPT-IN catalog manifest — lives in manifests/optional/ so `install-base` (which
3
- # globs only manifests/tools + manifests/skill-packs) never pulls it into the base
4
- # profile, and `harnessed install <name>` (tools + skill-packs only) never installs
5
- # it. CodeGraph ships its own installer; harnessed catalogs + detects only.
2
+ # OPT-IN catalog manifest — lives in manifests/optional/ so `harnessed setup`
3
+ # Step B (which globs only manifests/tools + manifests/skill-packs) never pulls it
4
+ # into the base profile (no auto-install). It IS installable on demand: explicit
5
+ # `harnessed install codegraph` resolves manifests/optional/ as the third tier and
6
+ # runs the npm-cli method below. CodeGraph ships its own installer; harnessed
7
+ # catalogs + detects only.
6
8
  apiVersion: harnessed/v1
7
9
  kind: Manifest
8
10
  metadata:
@@ -0,0 +1,13 @@
1
+ {
2
+ "upstream": "github.com/affaan-m/ECC",
3
+ "created_at": "2026-06-17T00:00:00.000Z",
4
+ "author": "easyinplay",
5
+ "q1_reusable_surface": "真 reusable surface。ECC 是稳定分发的 CC plugin 上游 (marketplace ecc@ecc),提供 ~55 个 dev domain-pattern 知识库 + 28 个 per-language reviewer/build-resolver — 长期可复用的能力源,非临时 wrapper。A posture 只收能力片 (Bucket 11 加性 + verify alias),不收 ECC 的 orchestration loop。",
6
+ "q2_name_fit": "名字 fit (已是 plugin id ecc@ecc)。命名冲突: 存在且已在 ADR-0034 §3 de-confliction 矩阵处理 — ECC 的 review/orchestration/learn/checkpoint 与 gstack/gsd/superpowers/harnessed checkpoint 引擎重名。Bucket 11 加性 entry 走 domain/cost/hook 正交 fires_when 轴 (零命名冲突);per-language reviewer 走 alias-收编挂到现有 verify capability。",
7
+ "q3_overlap": "大量 overlap — ECC 是与 GSD/superpowers/gstack 平行的完整栈。已在 ADR-0034 逐 family 处理: 加性区 (domain/cost/hook, 零 overlap) / alias-收编区 (verify 维度, priority.yaml 仲裁单一 fire) / 碰撞区 (orchestration/review/learning/multi-agent/token, 默认 NOT wire) / 硬排除区 (checkpoint/ledger/compact/learning keystone 引擎)。枚举 (246 skills/61 agents) 已核对 partition 站得住。",
8
+ "q4_concept_vs_identity": "import 概念。收的是 domain-pattern 知识 + per-language review 能力, NOT import ECC 的产品身份/orchestration/做事方式。不 vendor 代码 (装配主义)。A posture 明确边界: 能力片可控同化, ECC 的 plan/execute/learn/checkpoint loop 一律不接。",
9
+ "q5_user_understanding": "能。Bucket 11 capability 以 harnessed 自己的 fires_when 语义暴露 (subtask.domain == 'postgres' → postgres pattern), 用户看到的是 harnessed 路由, 无需知道 ECC 存在。per-language reviewer 走现有 verify capability 的 alias 同理。ECC 仅作为 impl 来源, 对用户透明。",
10
+ "ee5_gate": "PASSED",
11
+ "deconfliction_adr": "docs/adr/0034-ecc-assimilation-deconfliction.md",
12
+ "posture": "A (additive-first: domain-pattern starter-set ≤8 + cost/hook + per-language reviewer alias)"
13
+ }
@@ -0,0 +1,64 @@
1
+ # yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
2
+ #
3
+ # OPT-IN catalog manifest — lives in manifests/optional/ so `harnessed setup` /
4
+ # install-base (which globs ONLY manifests/tools + manifests/skill-packs) NEVER
5
+ # auto-installs ECC into the base profile. ECC is an optional upstream AND a
6
+ # pre-release (stability=unstable) — users opt in explicitly. harnessed catalogs
7
+ # this manifest + routes a curated subset (capabilities.yaml Bucket 11 + verify
8
+ # aliases, opt-in no-op when ECC absent); the install cmd below is the user-run
9
+ # path (`claude plugin install ecc@ecc`). Sister: manifests/optional/codegraph.yaml.
10
+ #
11
+ # ECC (Affaan Mustafa) selective assimilation — A posture per ADR-0034.
12
+ # ECC is a near-complete PARALLEL stack (its own plan/execute/review/learn/
13
+ # checkpoint/multi-agent). harnessed does NOT wire that; it assimilates ONLY the
14
+ # additive zones (domain-pattern starter-set ≤8 + cost-report/model-route +
15
+ # hookify) and收编s per-language reviewers/build-resolvers as verify-dimension
16
+ # aliases. checkpoint/ledger/compact/learning families are HARD-EXCLUDED (keystone
17
+ # engine collision, same rationale as gsd-execute-phase).
18
+ #
19
+ # De-confliction matrix SoT: docs/adr/0034-ecc-assimilation-deconfliction.md
20
+ # EE-5 gate record: manifests/optional/ecc.ee5-answers.json
21
+ apiVersion: harnessed/v1
22
+ kind: Manifest
23
+ metadata:
24
+ name: ecc
25
+ display_name: ECC (selective domain + verify-alias assimilation, A posture)
26
+ description: ECC selective assimilation per ADR-0034 (A posture) — additive domain-pattern + cost/hook + per-language reviewer alias.
27
+ upstream:
28
+ source: github.com/affaan-m/ECC
29
+ homepage: https://ecc.tools
30
+ repository: https://github.com/affaan-m/ECC.git
31
+ license: MIT
32
+ notice: |
33
+ ECC (Engineering Claude Code) by Affaan Mustafa, distributed via the `ecc`
34
+ Claude Code marketplace. harnessed assimilates a curated subset selectively
35
+ (A posture, de-confliction per ADR-0034) — NOT vendored, NOT wired as a
36
+ parallel stack. Upstream is pre-release (2.0.0-rc.1); stability=unstable.
37
+ spec:
38
+ type: cc-plugin
39
+ component_type: command
40
+ category: engineering
41
+ install_type: skill
42
+ install:
43
+ method: cc-plugin-marketplace
44
+ cmd: "claude plugin marketplace add affaan-m/ECC && claude plugin install ecc@ecc"
45
+ git_ref: ec92b528471df708c2384ebbcc82b390b60f535a
46
+ idempotent_check: "claude plugin list 2>&1 | grep -qw ecc"
47
+ marketplace_source:
48
+ source: github
49
+ repo: affaan-m/ECC
50
+ verify:
51
+ cmd: "claude plugin list 2>&1 | grep -qw ecc"
52
+ timeout_ms: 10000
53
+ uninstall:
54
+ cmd: "claude plugin uninstall ecc@ecc"
55
+ upstream_health:
56
+ stability: unstable
57
+ last_check: "2026-06-17"
58
+ last_known_good_version: 2.0.0-rc.1
59
+ fallback_action: warn
60
+ signed_by: easyinplay
61
+ platforms:
62
+ - linux
63
+ - darwin
64
+ - win32
package/messages/en.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "agent_teams.missing_nonblocking": " non-blocking — auto-degrades to subagent fan-out\n",
29
29
 
30
30
  "install.manifest_not_found": "error: manifest '{{name}}' not found",
31
- "install.manifest_not_found.fix": " fix: ensure manifests/tools/{{name}}.yaml or manifests/skill-packs/{{name}}.yaml exists",
31
+ "install.manifest_not_found.fix": " fix: ensure manifests/tools/{{name}}.yaml, manifests/skill-packs/{{name}}.yaml, or manifests/optional/{{name}}.yaml exists",
32
32
  "install.audit_hint": " fix: run 'harnessed audit' to inspect manifest issues",
33
33
  "install.success": "installed {{name}}",
34
34
  "install.success_with_version": "installed {{name}}@{{version}}",
@@ -84,6 +84,9 @@
84
84
  "status.lock_release_hint": " to release: wait for process to finish or delete {{path}}",
85
85
  "status.lock_free": "\nlock: free",
86
86
 
87
+ "here.no_workflow": "no active workflow for this repo ({{path}} has no entry for cwd)",
88
+ "here.no_workflow.hint": " to start: run a stage (e.g. `harnessed gates discuss`) or `harnessed run <workflow>`",
89
+
87
90
  "audit_log.no_records_file": "no audit records found ({{path}} does not exist)",
88
91
  "audit_log.no_records_empty": "no audit records found (audit.log is empty)",
89
92
  "audit_log.jq_missing": "✗ jq not found in PATH — run: harnessed doctor",
@@ -28,7 +28,7 @@
28
28
  "agent_teams.missing_nonblocking": " non-blocking — auto-degrades to subagent fan-out\n",
29
29
 
30
30
  "install.manifest_not_found": "error: manifest '{{name}}' not found",
31
- "install.manifest_not_found.fix": " fix: ensure manifests/tools/{{name}}.yaml or manifests/skill-packs/{{name}}.yaml exists",
31
+ "install.manifest_not_found.fix": " fix: ensure manifests/tools/{{name}}.yaml, manifests/skill-packs/{{name}}.yaml, or manifests/optional/{{name}}.yaml exists",
32
32
  "install.audit_hint": " fix: run 'harnessed audit' to inspect manifest issues",
33
33
  "install.success": "installed {{name}}",
34
34
  "install.success_with_version": "installed {{name}}@{{version}}",
@@ -39,8 +39,22 @@
39
39
  "uninstall.confirm.prompt": "Uninstall '{{name}}'? This cannot be undone.",
40
40
  "uninstall.cancelled": "aborted: user cancelled",
41
41
  "uninstall.completed": "uninstalled {{name}}",
42
- "uninstall.yes_dryrun_conflict": "error: --yes is incompatible with --dry-run (dry-run does not mutate)",
43
- "uninstall.yes_dryrun_conflict.fix": " fix: harnessed uninstall {{name}} --yes (immediate) OR harnessed uninstall {{name}} --dry-run (preview)",
42
+ "uninstall.unified.nothing": "无需操作 未找到 harnessed 产物",
43
+ "uninstall.unified.header": "harnessed uninstall 将移除以下内容:",
44
+ "uninstall.unified.commands": " Commands: ~/.claude/commands/ 中 {{count}} 个 harnessed 生成的 slash command 文件",
45
+ "uninstall.unified.skills": " Skills: ~/.claude/skills/ 中 {{count}} 个 workflow skill 目录",
46
+ "uninstall.unified.settings": " Settings: ~/.claude/settings.json 中的 harnessed 环境变量(CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS、HARNESSED_USER_LANG)",
47
+ "uninstall.unified.state_dir": " State directory: ~/.claude/harnessed/(含 backups、audit log、state、lock)",
48
+ "uninstall.unified.upstream_note": "\nUpstream 组件(npm packages、MCP servers、CC plugins、git-cloned repos、npx skills)不受影响。",
49
+ "uninstall.unified.dry_run_hint": "\n(dry-run — 去掉 --dry-run 重新运行以实际移除)",
50
+ "uninstall.unified.confirm": "移除 harnessed 自身的文件?Upstream 组件(npm packages、MCP servers、CC plugins 等)不受影响。此操作不可撤销。",
51
+ "uninstall.unified.removing": "正在移除 harnessed 文件...",
52
+ "uninstall.unified.removed_commands": " 已移除 {{count}} 个 command 文件",
53
+ "uninstall.unified.removed_skills": " 已移除 {{count}} 个 skill 目录",
54
+ "uninstall.unified.removed_settings": " 已移除 ~/.claude/settings.json 中的 harnessed 环境变量",
55
+ "uninstall.unified.removed_state_dir": " 已移除 ~/.claude/harnessed/",
56
+ "uninstall.unified.partial_failure": "\n{{count}} 个条目无法移除(权限不足或已不存在):",
57
+ "uninstall.unified.complete": "uninstall 完成 — harnessed 自身的文件已移除",
44
58
 
45
59
  "gc.invalid_duration": "error: invalid --older-than '{{value}}'",
46
60
  "gc.invalid_duration.fix": " fix: use format <N>{d|h|m|w} e.g. 30d / 24h / 60m / 4w",
@@ -70,6 +84,9 @@
70
84
  "status.lock_release_hint": " to release: wait for process to finish or delete {{path}}",
71
85
  "status.lock_free": "\nlock: free",
72
86
 
87
+ "here.no_workflow": "当前 repo 无 active workflow({{path}} 中没有 cwd 对应条目)",
88
+ "here.no_workflow.hint": " 开始:运行一个 stage(如 `harnessed gates discuss`)或 `harnessed run <workflow>`",
89
+
73
90
  "audit_log.no_records_file": "no audit records found ({{path}} does not exist)",
74
91
  "audit_log.no_records_empty": "no audit records found (audit.log is empty)",
75
92
  "audit_log.jq_missing": "✗ jq not found in PATH — run: harnessed doctor",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnessed",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "description": "AI coding harness package manager + composition orchestrator",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: auto
3
+ description: |
4
+ 超级主控编排器 — 一行命令跑完整 6-stage 功能开发流 (research conditional →
5
+ discuss → plan → task → verify → retro mandatory), 适合 trivial / well-defined feature OR 你
6
+ 想 hands-off。每 stage 内部仍 fan-out sub-workflow per 现有 stage-master orchestrator pattern。
7
+ v3.2.0 强化:Phase 0 AI 1-shot complexity assessment + Phase 0.5 understanding check prompt
8
+ + Phase 5 `/retro` mandatory。
9
+ schema_version: harnessed.workflow.v3 with delegates_to (6 sub: research conditional order 0 +
10
+ 4 stage-master order 1-4 + retro mandatory order 5) + disciplines_applied (6 default)
11
+ + tools_available (agent-teams-create + planning-with-files)。Fail-fast default; opt-in
12
+ `--staged` flag 重现 stage gate UX (每 stage 完停 user review)。
13
+ Triggered by slash command `/auto` (bare per ADR 0030 namespace policy D-02 LOCK)
14
+ after `harnessed setup`.
15
+ trigger_phrases:
16
+ - "auto"
17
+ - "自动跑完"
18
+ - "完整流程"
19
+ - "一键开发"
20
+ - "auto chain"
21
+ - "super master"
22
+ ---
23
+
24
+ # auto 超级主控编排器 (v3.2.0 增强版)
25
+
26
+ ## 概述
27
+
28
+ v3.2.0 新增 — 6-stage 节奏 (research conditional → discuss → plan → task → verify → retro
29
+ mandatory), sister 四个 stage-master `/discuss /plan /task /verify` 仍可独立调用;
30
+ `/auto` 是可选的一行命令 chain。
31
+
32
+ | order | sub | gate ref | mode | when fires |
33
+ | ----- | --- | -------- | ---- | ---------- |
34
+ | 0 | `research` | `judgments.stage-routing.auto-research-unclear.fires` | serial | user_understanding_unclear == true (Phase 0.5 prompt n) |
35
+ | 1 | `discuss` | (unconditional — 4-stage chain 起点) | serial | always |
36
+ | 2 | `plan` | (unconditional — stage 2) | serial | always |
37
+ | 3 | `task` | (unconditional — stage 3) | serial | always |
38
+ | 4 | `verify` | (unconditional — stage 4 收尾) | serial | always |
39
+ | 5 | `retro` | (unconditional — auto mode mandatory) | serial | always |
40
+
41
+ 引擎运行时通过 `runMasterOrchestrator` 依次 spawn 6 个子工作流 yaml,遵循
42
+ T3.5.W0.1 — 递归单层抽象 (super-master → stage-master OR standalone → sub-workflow):
43
+
44
+ - 顶层调用 `/auto` → 加载 `workflows/auto/workflow.yaml` → runAutoPreFlight hook
45
+ - pre-flight Phase 0: `assessComplexity(taskDescription)` → small/medium 自动 continue;
46
+ large → 提示用户切 `--staged` (y) OR abort 建议手动 (n)
47
+ - pre-flight Phase 0.5: `promptUserUnderstanding()` → y 跳过 research;n 设置
48
+ `user_understanding_unclear = true` 进 ctx → research 关卡触发
49
+ - spawn order 0: `workflows/research/workflow.yaml` (if gate fires)
50
+ - spawn order 1-4: 4 个 stage-master `workflows/<sub>/auto/workflow.yaml`
51
+ - spawn order 5: `workflows/retro/workflow.yaml` (mandatory unconditional)
52
+
53
+ K8 ctx single snapshot:auto 顶层调用 1 个 snapshot,传递给全部 6 个 spawn
54
+ (sister Phase 3.5 W0.1 pattern verbatim,1 snapshot per top-level invoke 跨整个 cycle)。
55
+
56
+ ## 默认行为
57
+
58
+ - **Pre-flight 关卡**: complexity assessment + understanding check (交互式提示)
59
+ - **连续 chain**: 6 个 stage 一行命令跑完,中间不停
60
+ - **Fail-fast**: 任一 stage 失败立即停止,`harnessed resume` 续跑
61
+ - **Context 自动传递**: planning-with-files `.planning/<phase>/` 喂给下游 stage
62
+ - **Retro mandatory**: auto mode hands-off 场景,末尾强制 `/retro` 总结 (无 opt-out flag)
63
+ - **沿用 sister planning-with-files /plan 持久化 cadence**
64
+
65
+ ## 可选 flag
66
+
67
+ - `--staged` opt-in: 每个 stage-master 跑完后停止,等用户 review/confirm 后跑下一个 stage (stage gate UX)
68
+
69
+ ## 何时用 `/auto` vs 4 个 stage-master 手动
70
+
71
+ ✅ **触发 `/auto`**:
72
+ - Trivial / well-defined feature (e.g. CRUD endpoint + standard pattern)
73
+ - Hands-off 场景 (你想"跑完再回来看")
74
+ - 跨 stage decision 都明显 (无 open question)
75
+ - AI 自动判断需求复杂度 small/medium → 直接 continue;large → 自动建议 `--staged`
76
+
77
+ ❌ **跳过 `/auto` → 分阶段手动 `/discuss` → `/plan` → `/task` → `/verify`**:
78
+ - 关键发布 / 大重构 (需 stage gate 审查)
79
+ - 跨 stage 有 open implementation decisions
80
+ - 你想在 stage 之间做 hands-on 审查
81
+ - 不确定整体方向 (此时手动 `/discuss` 强 grill)
82
+ - AI complexity gate 判定 large 且用户不切 `--staged` → 建议 abort 手动
83
+
84
+ ## Capability refs
85
+
86
+ Sister `workflows/capabilities.yaml`:
87
+ - `agent-teams-create` — Bucket 5 agent-platform (verify 阶段 multispec Pattern C 4-specialist team,当 critical-release-upgrade 关卡触发时)
88
+ - `planning-with-files` — Bucket 4 核心能力 (持久化 task_plan.md + progress.md
89
+ 跨 6 个 stage 自动传递 context)
90
+ - Downstream sub refs:
91
+ - sub `research` upstream → `workflows/research/workflow.yaml` (standalone)
92
+ - sub `discuss` upstream → `workflows/discuss/auto/workflow.yaml` (stage-master)
93
+ - sub `plan` upstream → `workflows/plan/auto/workflow.yaml` (stage-master)
94
+ - sub `task` upstream → `workflows/task/auto/workflow.yaml` (stage-master)
95
+ - sub `verify` upstream → `workflows/verify/auto/workflow.yaml` (stage-master)
96
+ - sub `retro` upstream → `workflows/retro/workflow.yaml` (standalone)
97
+
98
+ ## 调用方式
99
+
100
+ - Slash command: `/auto <feature description>` (bare per ADR 0030 namespace policy D-02 LOCK
101
+ after `harnessed setup`)
102
+ - 4 个 stage-master `/discuss /plan /task /verify` 仍可独立调用 — `/auto` 是可选的新工作流
103
+ - `--staged` opt-in 启用 stage gate UX (每 stage 跑完后停止等用户 review)
104
+
105
+ ## 如何调用
106
+
107
+ 使用 Bash 工具运行:
108
+
109
+ ```bash
110
+ echo "$ARGUMENTS" | harnessed run auto --task-stdin
111
+ ```
112
+
113
+ 如果 `$ARGUMENTS` 为空,运行 `harnessed run auto`(不带 stdin pipe)。
114
+
115
+ 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。根据对话上下文决定是否调用 — 该提示仅供参考,不作强制指引。
116
+ - 如需逐 stage 审查,追加 `--staged`(每个 stage 完成后暂停,等待用户 review)。
117
+
118
+ <!-- harnessed-generated:v3.4.4 -->
119
+
120
+ ## 参考文档
121
+
122
+ - D-01 master orchestrator 委托模式
123
+ - D-02 bare slash cmd 约定 (ADR 0030 namespace policy LOCK)
124
+ - D-13 declarative SoT (delegates_to[] 声明 + engine 消费)
125
+ - workflows/{research,retro}/workflow.yaml — 2 个 standalone (research conditional + retro mandatory)
126
+ - workflows/{discuss,plan,task,verify}/auto/workflow.yaml — 4 个 stage-master Phase 3.5 SHIPPED
127
+ - workflows/judgments/stage-routing.yaml — auto-research-unclear trigger (v3.2.0 新增)
128
+ - src/workflow/masterOrchestrator.ts — 'auto' literal + recursive spawn + runAutoPreFlight hook
129
+ - CHANGELOG [3.2.0] — complexity gate + research/retro flow + `--staged` rename
@@ -137,6 +137,13 @@ capabilities:
137
137
  since: v2.0
138
138
  category: tool-slash-cmd
139
139
  description: verify-work parallel fan-out (multi-agent high-confidence findings)
140
+ # ADR-0034 Finding 1 — ECC per-language reviewers收编 as verify-dimension aliases
141
+ # (NOT a parallel Bucket 11 entry; runtime/priority.yaml picks the language-matching
142
+ # one → single fire, no triple-review). Opt-in: no-op when ECC absent.
143
+ aliases:
144
+ - { impl: ecc, cmd: "ecc:python-review" }
145
+ - { impl: ecc, cmd: "ecc:rust-review" }
146
+ - { impl: ecc, cmd: "ecc:go-review" }
140
147
  fires_when:
141
148
  - phase.stage == 'verify'
142
149
 
@@ -311,8 +318,14 @@ capabilities:
311
318
  since: v2.0
312
319
  category: tool-slash-cmd
313
320
  description: GSD systematic debugging (overlap with mattpocock /diagnose — alias)
321
+ # ADR-0034 Finding 1 — ECC per-language build-resolvers收编 as debug/verify-dimension
322
+ # aliases (build-failure fix; runtime picks language-matching one). Opt-in: no-op
323
+ # when ECC absent.
314
324
  aliases:
315
325
  - { impl: mattpocock-skills, cmd: /diagnose }
326
+ - { impl: ecc, cmd: "ecc:rust-build" }
327
+ - { impl: ecc, cmd: "ecc:go-build" }
328
+ - { impl: ecc, cmd: "ecc:build-fix" }
316
329
  fires_when:
317
330
  - subtask.type == 'debug'
318
331
 
@@ -1263,3 +1276,110 @@ capabilities:
1263
1276
  description: GSD docs-update post-ship doc update
1264
1277
  fires_when:
1265
1278
  - phase.needs_doc_update == true
1279
+
1280
+ # ============================================================================
1281
+ # Bucket 11 — ECC selective assimilation, A posture (ADR-0034)
1282
+ # ============================================================================
1283
+ #
1284
+ # ECC is a near-complete PARALLEL stack; per ADR-0034 de-confliction matrix
1285
+ # harnessed wires ONLY the additive zones here (domain-pattern starter-set ≤8 +
1286
+ # cost-report + hookify) on ORTHOGONAL fires_when axes (subtask.domain /
1287
+ # needs_cost_report / needs_hook_authoring — no existing entry fires on these).
1288
+ # per-language reviewers/build-resolvers are NOT here — they收编 as verify-
1289
+ # dimension aliases under code-review / gsd-debug (Finding 1). orchestration/
1290
+ # review/learning/multi-agent/checkpoint families are NOT wired / HARD-EXCLUDED.
1291
+ #
1292
+ # Opt-in pattern (sister `codegraph`): NO install_type/plugin_id presence-check —
1293
+ # ECC is an optional upstream; absent ECC just means these cmds no-op (no warn
1294
+ # for non-ECC users). cmd = plugin-namespaced `ecc:<skill>` (sister superpowers).
1295
+ # impl: ecc is a provenance label (open-string per capabilities schema).
1296
+
1297
+ ecc-mcp-server-patterns:
1298
+ impl: ecc
1299
+ cmd: "ecc:mcp-server-patterns"
1300
+ since: v7.1
1301
+ category: tool-slash-cmd
1302
+ description: MCP server design patterns (ECC domain library — CC-harness-builder core)
1303
+ fires_when:
1304
+ - subtask.domain == 'mcp_server'
1305
+
1306
+ ecc-python-patterns:
1307
+ impl: ecc
1308
+ cmd: "ecc:python-patterns"
1309
+ since: v7.1
1310
+ category: tool-slash-cmd
1311
+ description: Python idiom/structure patterns (ECC domain library)
1312
+ fires_when:
1313
+ - subtask.domain == 'python'
1314
+
1315
+ ecc-rust-patterns:
1316
+ impl: ecc
1317
+ cmd: "ecc:rust-patterns"
1318
+ since: v7.1
1319
+ category: tool-slash-cmd
1320
+ description: Rust ownership/idiom patterns (ECC domain library)
1321
+ fires_when:
1322
+ - subtask.domain == 'rust'
1323
+
1324
+ ecc-golang-patterns:
1325
+ impl: ecc
1326
+ cmd: "ecc:golang-patterns"
1327
+ since: v7.1
1328
+ category: tool-slash-cmd
1329
+ description: Go idiom/concurrency patterns (ECC domain library)
1330
+ fires_when:
1331
+ - subtask.domain == 'golang'
1332
+
1333
+ ecc-postgres-patterns:
1334
+ impl: ecc
1335
+ cmd: "ecc:postgres-patterns"
1336
+ since: v7.1
1337
+ category: tool-slash-cmd
1338
+ description: PostgreSQL schema/query/perf patterns (ECC domain library)
1339
+ fires_when:
1340
+ - subtask.domain == 'postgres'
1341
+
1342
+ ecc-docker-patterns:
1343
+ impl: ecc
1344
+ cmd: "ecc:docker-patterns"
1345
+ since: v7.1
1346
+ category: tool-slash-cmd
1347
+ description: Docker/container build patterns (ECC domain library)
1348
+ fires_when:
1349
+ - subtask.domain == 'docker'
1350
+
1351
+ ecc-nextjs-turbopack:
1352
+ impl: ecc
1353
+ cmd: "ecc:nextjs-turbopack"
1354
+ since: v7.1
1355
+ category: tool-slash-cmd
1356
+ description: Next.js + Turbopack frontend patterns (ECC domain library)
1357
+ fires_when:
1358
+ - subtask.domain == 'nextjs'
1359
+
1360
+ ecc-api-design:
1361
+ impl: ecc
1362
+ cmd: "ecc:api-design"
1363
+ since: v7.1
1364
+ category: tool-slash-cmd
1365
+ description: API contract/versioning design patterns (ECC domain library)
1366
+ fires_when:
1367
+ - subtask.domain == 'api_design'
1368
+
1369
+ ecc-cost-tracking:
1370
+ impl: ecc
1371
+ cmd: "ecc:cost-tracking"
1372
+ since: v7.1
1373
+ category: tool-slash-cmd
1374
+ description: LLM cost/token spend reporting (ECC additive — harnessed has no cost report)
1375
+ fires_when:
1376
+ - subtask.needs_cost_report == true
1377
+
1378
+ ecc-hookify-rules:
1379
+ impl: ecc
1380
+ cmd: "ecc:hookify-rules"
1381
+ since: v7.1
1382
+ category: tool-slash-cmd
1383
+ description: Author CC hooks from observed behavior (ECC additive — no harnessed equivalent)
1384
+ fires_when:
1385
+ - subtask.needs_hook_authoring == true
@@ -0,0 +1,49 @@
1
+ # workflows/disciplines/doc-discipline.yaml
2
+ # 文档纪律 — bundled discipline (STATE digest line-limit + one-fact-per-file +
3
+ # overview-pointer-no-inline-narrative + transient-consume-then-archive +
4
+ # status-derived-from-artifacts + responsibility-matrix-one-home)
5
+ # Phase v6.0 T11.1 — 7th L0 Discipline Substrate per D-09
6
+ # Codifies CLAUDE.md 文档纪律 section (三层渐进式结构 + 反腐防膨胀铁律)
7
+
8
+ schema_version: harnessed.discipline.v1
9
+ discipline: doc
10
+ enforcement_layer: commit
11
+ auto_enforce: true
12
+
13
+ rules:
14
+ - id: state-digest-line-limit
15
+ description: STATE.md 超过 100 行触发 halt;通过 `HARNESSED_ALLOW_LONG_STATE=1` override
16
+ enforcement: halt
17
+ trigger: "phase.type == 'commit' AND changed_files contains '.planning/STATE.md'"
18
+ check_method: external-cmd
19
+ # No auto_fix_cmd — halt rules do not auto-fix; override is env-based in TS
20
+
21
+ - id: one-fact-per-file
22
+ description: 决策类文档必须单一主题;同一事实跨文件重复散布违反 one-fact-per-file
23
+ enforcement: warn
24
+ trigger: "phase.type == 'commit' AND changed_files matches '\\.planning/'"
25
+ check_method: heuristic
26
+
27
+ - id: overview-pointer-no-inline-narrative
28
+ description: ROADMAP/概览类文档不得内联收尾叙事(叙事进 SUMMARY,而非 ROADMAP)
29
+ enforcement: warn
30
+ trigger: "phase.type == 'commit' AND changed_files matches 'ROADMAP\\.md|STATE\\.md'"
31
+ check_method: heuristic
32
+
33
+ - id: transient-consume-then-archive
34
+ description: HANDOFF 及其他 transient 产物必须在消费后归档,不得堆积在 .planning/ 根目录
35
+ enforcement: warn
36
+ trigger: "phase.type == 'commit' AND changed_files matches 'HANDOFF'"
37
+ check_method: heuristic
38
+
39
+ - id: status-derived-from-artifacts
40
+ description: Phase 状态必须从 VERIFICATION 产物 + 测试结果派生,而非在 STATE/ROADMAP 里手动维护布尔值
41
+ enforcement: warn
42
+ trigger: "phase.type == 'commit' AND changed_files contains '.planning/STATE.md'"
43
+ check_method: heuristic
44
+
45
+ - id: responsibility-matrix-one-home
46
+ description: 每个事实按责任矩阵只有唯一归处(决策→ADR,需求→REQUIREMENTS 等);跨文件重复即违规
47
+ enforcement: info
48
+ trigger: "phase.type == 'commit' AND changed_files matches '\\.planning/'"
49
+ check_method: heuristic
@@ -10,7 +10,7 @@ auto_enforce: true
10
10
 
11
11
  rules:
12
12
  - id: think-before-coding
13
- description: 先思考后写代码,不直接 dump 代码;每个子任务前 brainstorm 设计意图
13
+ description: Think before coding; do not dump code directly; brainstorm the design intent before each subtask
14
14
  enforcement: warn
15
15
  trigger: subtask.type == 'code-write'
16
16
  check_method: heuristic
@@ -18,14 +18,14 @@ rules:
18
18
  # (e.g., 'Plan:' / 'Approach:' / '设计:' / '思路:'),若全是 code block → warn
19
19
 
20
20
  - id: simplicity-first
21
- description: 追求最小有效代码,避免不必要复杂度;YAGNI / 不为假设场景写代码
21
+ description: Pursue the minimal effective code, avoid unnecessary complexity; YAGNI / do not write code for hypothetical scenarios
22
22
  enforcement: warn
23
23
  trigger: always-on
24
24
  check_method: llm-judge
25
25
  # check_method='llm-judge' — verify phase 调用 code-simplifier review
26
26
 
27
27
  - id: surgical-changes
28
- description: 小步原子修改,每个 commit 单一职责;不大段重写
28
+ description: Small atomic changes, single responsibility per commit; no large-scale rewrites
29
29
  enforcement: warn
30
30
  trigger: phase.type == 'execute'
31
31
  check_method: external-cmd
@@ -33,13 +33,13 @@ rules:
33
33
  # 单 commit > 300 line diff → warn (rough heuristic, override allowed via task spec)
34
34
 
35
35
  - id: goal-driven-execution
36
- description: 目标驱动,不发散 / 不无关重构;只解决当前任务 + 不夹带 cleanup
36
+ description: Goal-driven, do not diverge / do no unrelated refactoring; solve only the current task and do not smuggle in cleanup
37
37
  enforcement: warn
38
38
  trigger: phase.type == 'execute'
39
39
  check_method: heuristic
40
40
 
41
41
  - id: file-length-200-hard-limit
42
- description: 单文件 ≤200L 硬限 (per project CLAUDE.md karpathy 心法 reminder);超过 → split helper
42
+ description: Single-file ≤200L hard limit (per project CLAUDE.md karpathy guideline reminder); over the limit → split into a helper
43
43
  enforcement: halt
44
44
  trigger: phase.type == 'execute' AND file.lines > 200
45
45
  check_method: external-cmd
@@ -0,0 +1,47 @@
1
+ # workflows/disciplines/karpathy.yaml
2
+ # karpathy 心法 + 编码硬限 — bundled discipline (think-before-coding / simplicity-first / surgical-changes / goal-driven)
3
+ # Phase v3.0-3.3 W0.4 ship per D-09 (L0 Discipline Substrate)
4
+ # Snapshot of CLAUDE.md as of v3.0 ship date (K7 mitigation, verbatim)
5
+
6
+ schema_version: harnessed.discipline.v1
7
+ discipline: karpathy
8
+ enforcement_layer: code-writing
9
+ auto_enforce: true
10
+
11
+ rules:
12
+ - id: think-before-coding
13
+ description: 先思考后写代码,不直接 dump 代码;每个子任务前 brainstorm 设计意图
14
+ enforcement: warn
15
+ trigger: subtask.type == 'code-write'
16
+ check_method: heuristic
17
+ # check_method='heuristic' — runtime engine 检查 subagent 输出 first 200 char 是否含设计意图 marker
18
+ # (e.g., 'Plan:' / 'Approach:' / '设计:' / '思路:'),若全是 code block → warn
19
+
20
+ - id: simplicity-first
21
+ description: 追求最小有效代码,避免不必要复杂度;YAGNI / 不为假设场景写代码
22
+ enforcement: warn
23
+ trigger: always-on
24
+ check_method: llm-judge
25
+ # check_method='llm-judge' — verify phase 调用 code-simplifier review
26
+
27
+ - id: surgical-changes
28
+ description: 小步原子修改,每个 commit 单一职责;不大段重写
29
+ enforcement: warn
30
+ trigger: phase.type == 'execute'
31
+ check_method: external-cmd
32
+ auto_fix_cmd: 'git diff --stat HEAD~1 | awk ''{lines+=$3} END {if (lines>300) exit 1}'''
33
+ # 单 commit > 300 line diff → warn (rough heuristic, override allowed via task spec)
34
+
35
+ - id: goal-driven-execution
36
+ description: 目标驱动,不发散 / 不无关重构;只解决当前任务 + 不夹带 cleanup
37
+ enforcement: warn
38
+ trigger: phase.type == 'execute'
39
+ check_method: heuristic
40
+
41
+ - id: file-length-200-hard-limit
42
+ description: 单文件 ≤200L 硬限 (per project CLAUDE.md karpathy 心法 reminder);超过 → split helper
43
+ enforcement: halt
44
+ trigger: phase.type == 'execute' AND file.lines > 200
45
+ check_method: external-cmd
46
+ auto_fix_cmd: 'wc -l <file> | awk ''{if ($1>200) exit 1}'''
47
+ # 实装 split helper pattern (sister fallbackHandlers.ts / sdkReconcile.ts ≤80L)