harnessed 4.32.22 → 4.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/bin/harnessed-inject-state.mjs +16 -0
- package/dist/cli.mjs +1471 -302
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schemas/index.mjs.map +1 -1
- package/manifests/optional/doc-discipline-gate.yaml +54 -0
- package/messages/en.json +8 -0
- package/messages/zh-Hans.json +8 -0
- package/package.json +1 -1
- package/routing/decision_rules.yaml +1 -1
- package/workflows/README.md +1 -1
- package/workflows/auto/SKILL.md +13 -9
- package/workflows/auto/SKILL.zh-Hans.md +13 -9
- package/workflows/capabilities.yaml +100 -40
- package/workflows/defaults.yaml +8 -2
- package/workflows/disciplines/karpathy.yaml +29 -0
- package/workflows/disciplines/karpathy.zh-Hans.yaml +27 -0
- package/workflows/disciplines/language.yaml +15 -10
- package/workflows/disciplines/operational.yaml +1 -1
- package/workflows/disciplines/operational.zh-Hans.yaml +1 -1
- package/workflows/disciplines/output-style.yaml +10 -2
- package/workflows/disciplines/output-style.zh-Hans.yaml +10 -2
- package/workflows/disciplines/priority.yaml +15 -2
- package/workflows/disciplines/priority.zh-Hans.yaml +15 -2
- package/workflows/discuss/auto/SKILL.md +4 -4
- package/workflows/discuss/auto/SKILL.zh-Hans.md +4 -4
- package/workflows/discuss/auto/workflow.yaml +16 -3
- package/workflows/discuss/phase/SKILL.md +1 -1
- package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/strategic/SKILL.md +1 -1
- package/workflows/discuss/strategic/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/subtask/SKILL.md +1 -1
- package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
- package/workflows/judgments/parallelism-gate.yaml +11 -6
- package/workflows/judgments/phase-gate.yaml +5 -1
- package/workflows/judgments/stage-routing.yaml +21 -26
- package/workflows/judgments/strategic-gate.yaml +30 -0
- package/workflows/judgments/user-overrides.yaml +7 -3
- package/workflows/judgments/web-testing-routing.yaml +33 -12
- package/workflows/plan/architecture/SKILL.md +7 -3
- package/workflows/plan/architecture/SKILL.zh-Hans.md +7 -3
- package/workflows/plan/auto/SKILL.md +11 -7
- package/workflows/plan/auto/SKILL.zh-Hans.md +11 -7
- package/workflows/plan/phase/SKILL.md +7 -3
- package/workflows/plan/phase/SKILL.zh-Hans.md +7 -3
- package/workflows/research/SKILL.md +24 -9
- package/workflows/research/SKILL.zh-Hans.md +23 -9
- package/workflows/research/workflow.yaml +43 -3
- package/workflows/retro/SKILL.md +7 -3
- package/workflows/retro/SKILL.zh-Hans.md +7 -3
- package/workflows/role-prompts.yaml +28 -21
- package/workflows/role-prompts.zh-Hans.yaml +22 -17
- package/workflows/ship/auto/SKILL.md +11 -7
- package/workflows/ship/auto/SKILL.zh-Hans.md +11 -7
- package/workflows/ship/preflight/SKILL.md +7 -3
- package/workflows/ship/preflight/SKILL.zh-Hans.md +7 -3
- package/workflows/task/auto/SKILL.md +26 -16
- package/workflows/task/auto/SKILL.zh-Hans.md +26 -16
- package/workflows/task/auto/workflow.yaml +11 -4
- package/workflows/task/clarify/SKILL.md +1 -1
- package/workflows/task/clarify/SKILL.zh-Hans.md +1 -1
- package/workflows/task/code/SKILL.md +7 -3
- package/workflows/task/code/SKILL.zh-Hans.md +7 -3
- package/workflows/task/deliver/SKILL.md +53 -35
- package/workflows/task/deliver/SKILL.zh-Hans.md +54 -36
- package/workflows/task/deliver/workflow.yaml +32 -24
- package/workflows/task/test/SKILL.md +37 -3
- package/workflows/task/test/SKILL.zh-Hans.md +33 -3
- package/workflows/task/test/workflow.yaml +13 -0
- package/workflows/verify/auto/SKILL.md +12 -8
- package/workflows/verify/auto/SKILL.zh-Hans.md +12 -8
- package/workflows/verify/auto/workflow.yaml +3 -1
- package/workflows/verify/code-review/SKILL.md +7 -3
- package/workflows/verify/code-review/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/design/SKILL.md +24 -10
- package/workflows/verify/design/SKILL.zh-Hans.md +24 -10
- package/workflows/verify/design/workflow.yaml +36 -7
- package/workflows/verify/eval-review/SKILL.md +7 -3
- package/workflows/verify/eval-review/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/multispec/SKILL.md +17 -10
- package/workflows/verify/multispec/SKILL.zh-Hans.md +16 -10
- package/workflows/verify/multispec/workflow.yaml +7 -5
- package/workflows/verify/paranoid/SKILL.md +7 -3
- package/workflows/verify/paranoid/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/progress/SKILL.md +7 -3
- package/workflows/verify/progress/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/qa/SKILL.md +44 -14
- package/workflows/verify/qa/SKILL.zh-Hans.md +44 -14
- package/workflows/verify/qa/workflow.yaml +61 -2
- package/workflows/verify/security/SKILL.md +7 -3
- package/workflows/verify/security/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/simplify/SKILL.md +7 -3
- package/workflows/verify/simplify/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/validate-phase/SKILL.md +7 -3
- package/workflows/verify/validate-phase/SKILL.zh-Hans.md +7 -3
- package/manifests/skill-packs/karpathy-skills.yaml +0 -65
- package/manifests/tools/ralph-loop.yaml +0 -46
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAqGb,CAAA;;;AClGO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.37.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 && node ./scripts/build-hooks.mjs\",\n \"build:hooks\": \"node ./scripts/build-hooks.mjs\",\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 \"build:binary\": \"bun scripts/build-binary.mjs\"\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 \"esbuild\": \"0.27.7\",\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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/manifest/schema/metadata.ts","../../src/manifest/schema/installMethods/ccHookAdd.ts","../../src/manifest/schema/installMethods/ccPluginMarketplace.ts","../../src/manifest/schema/installMethods/gitCloneWithSetup.ts","../../src/manifest/schema/installMethods/mcpHttpAdd.ts","../../src/manifest/schema/installMethods/mcpStdioAdd.ts","../../src/manifest/schema/installMethods/npmCli.ts","../../src/manifest/schema/installMethods/npxSkillInstaller.ts","../../src/manifest/schema/installMethods/index.ts","../../src/manifest/schema/spec.ts","../../src/manifest/schema/index.ts","../../src/schemas/index.ts"],"names":["Type","GIT_REF_PATTERN"],"mappings":";;;AAMO,IAAM,UAAA,GAAa,I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EA,IAAM,iBAAA,GAAoB,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,IAAI,CAAC,CAAC,SAAA,EAAW,cAAc,CAAA,MAAO;AAAA,EACrF,EAAA,EAAI;AAAA,IACF,IAAA,EAAM,QAAA;AAAA,IACN,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,YAAY,EAAE,IAAA,EAAM,EAAE,KAAA,EAAO,WAAU,EAAE;AAAA,QACzC,QAAA,EAAU,CAAC,MAAM;AAAA;AACnB,KACF;AAAA,IACA,QAAA,EAAU,CAAC,MAAM;AAAA,GACnB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,QAAA;AAAA,IACN,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,UAAA,EAAY;AAAA,UACV,OAAA,EAAS;AAAA,YACP,IAAA,EAAM,QAAA;AAAA,YACN,YAAY,EAAE,MAAA,EAAQ,EAAE,IAAA,EAAM,gBAAe,EAAE;AAAA,YAC/C,QAAA,EAAU,CAAC,QAAQ;AAAA;AACrB,SACF;AAAA,QACA,QAAA,EAAU,CAAC,SAAS;AAAA;AACtB,KACF;AAAA,IACA,QAAA,EAAU,CAAC,MAAM;AAAA;AAErB,CAAA,CAAE,CAAA;AAKK,IAAM,cAAA,GAAiB;AAAA,EAC5B,GAAI,YAAA;AAAA,EACJ,GAAA,EAAK,uDAAA;AAAA,EACL,KAAA,EAAO,uBAAA;AAAA,EACP,WAAA,EAAa,qEAAA;AAAA,EACb,KAAA,EAAO;AACT;;;ACnEO,IAAM,cAAA,GAAiB","file":"index.mjs","sourcesContent":["// Metadata sub-schema per ADR 0001 § Top-level structure.\n// Fields: apiVersion (Literal harnessed/v1), kind (Literal Manifest),\n// metadata.{name, display_name?, description, upstream{...}}.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const ApiVersion = Type.Literal('harnessed/v1')\nexport const Kind = Type.Literal('Manifest')\n\n// SPDX whitelist per ADR 0001 line 51.\n// ADR 0010 errata — license whitelist extension (D-03/D-05). `MIT-0` (MIT No\n// Attribution, SPDX-registered) added for baoyu-skills; `anthropics-official`\n// carve-out added for anthropics/skills monorepo sub-skills (frontend-design /\n// document-skills / webapp-testing) which have no per-skill LICENSE file.\nconst SpdxLicense = Type.Union([\n Type.Literal('MIT'),\n Type.Literal('Apache-2.0'),\n Type.Literal('BSD-3-Clause'),\n Type.Literal('ISC'),\n Type.Literal('0BSD'),\n Type.Literal('MIT-0'),\n Type.Literal('anthropics-official'),\n])\n\n// ADR 0010 errata — license provenance audit field (D-04). Records where the\n// license info was sourced from so it can be mechanically audited. Optional —\n// additive only, A7' 8-pillar safe (no existing manifest broken).\nconst LicenseSource = Type.Union([\n Type.Literal('README'),\n Type.Literal('registry'),\n Type.Literal('none'),\n Type.Literal('anthropics-official'),\n])\n\nconst Upstream = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n homepage: Type.String({ format: 'uri' }),\n repository: Type.String({ format: 'uri' }),\n license: SpdxLicense,\n license_source: Type.Optional(LicenseSource),\n notice: Type.String({ minLength: 1, maxLength: 500 }),\n },\n { additionalProperties: false },\n)\n\nexport const MetadataSchema = Type.Object(\n {\n name: Type.String({ pattern: '^[a-z0-9][a-z0-9-]*$', minLength: 1 }),\n display_name: Type.Optional(Type.String()),\n description: Type.String({ minLength: 1, maxLength: 120 }),\n upstream: Upstream,\n },\n { additionalProperties: false },\n)\n","// install.method = cc-hook-add per ADR 0001 type×method matrix + Phase 2.4 W3 T3.1 (D-04 § 3.1).\n//\n// IMPL NOTE (Phase 2.4 W3 / R2.4.4): Claude Code SessionStart / UserPromptSubmit /\n// PreToolUse / PostToolUse hooks are configured in ~/.claude/settings.json under\n// `hooks.<event>[].{matcher, command}` shape. This install method lets a manifest\n// register a hook entry idempotently. The hook_command is the bash invocation the\n// user wants run on that lifecycle event (e.g. `node scripts/dashboard.mjs --no-open`\n// to auto-spawn the dashboard on session start).\n//\n// Sister: npxSkillInstaller schema (~17L) — same minimal TypeBox shape, no exotic\n// fields. `idempotent_check` reused from the 6 sister install methods (preflight\n// invariant per src/installers/lib/preflight.ts contract).\n\nimport { Type } from '@sinclair/typebox'\n\nconst HookEvent = Type.Union([\n Type.Literal('SessionStart'),\n Type.Literal('UserPromptSubmit'),\n Type.Literal('PreToolUse'),\n Type.Literal('PostToolUse'),\n // 4.30.0 (issue #6) — Stop hook for mode-B tool-call corruption auto-recovery.\n Type.Literal('Stop'),\n])\n\nexport const CcHookAdd = Type.Object(\n {\n method: Type.Literal('cc-hook-add'),\n cmd: Type.String({ minLength: 1 }), // audit-trail (the bash invocation registered)\n // cwd/env required by lib/spawn.ts discriminated-union access (sister 6 method\n // shape parity — even though cc-hook-add does not spawn, generic spawn helper\n // expects these fields on the install union).\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n hook_event: HookEvent,\n hook_matcher: Type.Optional(Type.String()),\n hook_command: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = cc-plugin-marketplace per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, git_ref.\n//\n// Phase 1.1.1 hotfix M1 — git_ref pattern enforces SHA (7-40 hex) or SemVer\n// tag, rejecting branch names like HEAD/main/master that would silently\n// drift. ADR 0001 § \"版本锁哲学\" requires reproducible installs.\n//\n// Phase 1.2 ADR 0005 errata — `marketplace_source` optional field for\n// third-party marketplaces (e.g. OthmanAdi/planning-with-files which is NOT\n// in claude-plugins-official). v0.1 only `source: github`. Official upstream\n// can omit; phase 2.1 cc-plugin-marketplace installer will consume this\n// field structurally instead of parsing the cmd string.\n\nimport { Type } from '@sinclair/typebox'\n\nconst GIT_REF_PATTERN = '^([a-f0-9]{7,40}|v?\\\\d+\\\\.\\\\d+\\\\.\\\\d+([.-][\\\\w.-]+)?)$'\nconst REPO_PATTERN = '^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$'\n\nexport const CcPluginMarketplace = Type.Object(\n {\n method: Type.Literal('cc-plugin-marketplace'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n git_ref: Type.String({ minLength: 1, pattern: GIT_REF_PATTERN }),\n idempotent_check: Type.String({ minLength: 1 }),\n // ADR 0005 — third-party marketplace structured metadata (optional).\n marketplace_source: Type.Optional(\n Type.Object(\n {\n source: Type.Literal('github'),\n repo: Type.String({ pattern: REPO_PATTERN, minLength: 3 }),\n },\n { additionalProperties: false },\n ),\n ),\n },\n { additionalProperties: false },\n)\n","// install.method = git-clone-with-setup per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, git_ref.\n//\n// Phase 1.1.1 hotfix M1 — git_ref pattern enforces SHA (7-40 hex) or SemVer\n// tag, rejecting branch names like HEAD/main/master that would silently\n// drift. ADR 0001 § \"版本锁哲学\" requires reproducible installs.\n\nimport { Type } from '@sinclair/typebox'\n\nconst GIT_REF_PATTERN = '^([a-f0-9]{7,40}|v?\\\\d+\\\\.\\\\d+\\\\.\\\\d+([.-][\\\\w.-]+)?)$'\n\nexport const GitCloneWithSetup = Type.Object(\n {\n method: Type.Literal('git-clone-with-setup'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n git_ref: Type.String({ minLength: 1, pattern: GIT_REF_PATTERN }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method = mcp-http-add per ADR 0001 type×method matrix (mcp-npm only).\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const McpHttpAdd = Type.Object(\n {\n method: Type.Literal('mcp-http-add'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = mcp-stdio-add per ADR 0001 type×method matrix (mcp-npm only).\n// Required: cmd, idempotent_check, npm_version.\n// Note: cmd should invoke `claude mcp add --scope project ...` (R3.2),\n// but schema only validates structure — actual cmd template is per-manifest.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const McpStdioAdd = Type.Object(\n {\n method: Type.Literal('mcp-stdio-add'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = npm-cli per ADR 0001 type×method matrix (cli-npm only).\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const NpmCli = Type.Object(\n {\n method: Type.Literal('npm-cli'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method = npx-skill-installer per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const NpxSkillInstaller = Type.Object(\n {\n method: Type.Literal('npx-skill-installer'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method discriminated union per ADR 0001 type×method matrix.\n// 6 methods: cc-plugin-marketplace, git-clone-with-setup, npx-skill-installer,\n// npm-cli, mcp-stdio-add, mcp-http-add.\n//\n// IMPL NOTE (Rule 1 / F8): TypeBox's Type.Union(..., { discriminator })\n// emits `anyOf` + lacks `type: \"object\"` + `required: [\"method\"]`, but Ajv\n// `discriminator: true` strict mode requires `oneOf` + `type: \"object\"` +\n// `required: [\"method\"]`. We hand-build the discriminator-compatible shape\n// here so Ajv accepts it. The inferred TypeScript type still tracks via\n// Static<>; Ajv accepts hand-rolled JSON Schema objects with no DX cost.\n\nimport { type Static, Type } from '@sinclair/typebox'\nimport { CcHookAdd } from './ccHookAdd.js'\nimport { CcPluginMarketplace } from './ccPluginMarketplace.js'\nimport { GitCloneWithSetup } from './gitCloneWithSetup.js'\nimport { McpHttpAdd } from './mcpHttpAdd.js'\nimport { McpStdioAdd } from './mcpStdioAdd.js'\nimport { NpmCli } from './npmCli.js'\nimport { NpxSkillInstaller } from './npxSkillInstaller.js'\n\nconst branches = [\n CcPluginMarketplace,\n GitCloneWithSetup,\n NpxSkillInstaller,\n NpmCli,\n McpStdioAdd,\n McpHttpAdd,\n CcHookAdd,\n] as const\n\n// Hand-built JSON Schema that Ajv `discriminator: true` strict mode accepts.\n// Strict mode also requires `properties.method` declared at the discriminator\n// level (else `strictRequired` complains that `method` is required but undefined\n// at this object scope). Per-branch `additionalProperties: false` is preserved\n// (each TypeBox object already sets it).\nexport const InstallSchema = {\n type: 'object',\n discriminator: { propertyName: 'method' },\n required: ['method'],\n properties: {\n method: { type: 'string' },\n },\n oneOf: branches as unknown as object[],\n} as const\n\n// Re-derive the TS type via TypeBox's regular Union (this is unused at runtime\n// but gives downstream consumers a typed `Manifest['spec']['install']`).\nconst InstallUnion = Type.Union([...branches])\nexport type Install = Static<typeof InstallUnion>\n","// spec sub-schema per ADR 0001 § Top-level structure.\n// Fields: type, component_type, install (discriminated union), verify, uninstall,\n// upstream_health, signed_by, signature?, platforms,\n// tested_with_versions?, mutually_exclusive_with?,\n// category, install_type, decision_rules? (ADR 0007 errata — phase 1.3 加),\n// phase?, triggers? (ADR 0009 errata — phase 1.5 T5.5 加).\n//\n// IMPL NOTE — phase 1.5 T5.5 (ADR 0009 § Decision / D1.5-6 / D1.5-7 / Pattern L\n// spec-level metadata 加法 + Pattern T): adds 2 optional spec-level fields for\n// the mattpocock 23 招式 phase routing schema. `phase` is a 4-value enum\n// (discuss / plan / execute / verify) mirroring `decision_rules.yaml` v2\n// `mattpocock_phases` keys; `triggers` is an optional object carrying routing\n// hints (complexity_threshold / tdd_required / brainstorming_required). Both\n// optional — additive only, A7' 8-pillar enforcement (no existing manifest\n// broken). NOTE: this schema uses TypeBox (`@sinclair/typebox`), the project's\n// established schema lib — NOT zod; the task_plan `z.enum` / `z.object` outline\n// is a planning-doc shorthand, implemented here as `Type.Union` / `Type.Object`\n// per ADR 0001 + the no-new-deps constraint.\n\nimport { Type } from '@sinclair/typebox'\nimport { type Install, InstallSchema } from './installMethods/index.js'\n\nconst TypeEnum = Type.Union([\n Type.Literal('cc-plugin'),\n Type.Literal('cc-skill-pack'),\n Type.Literal('mcp-npm'),\n Type.Literal('cli-npm'),\n // Phase 2.4 W3 T3.1 (D-04 § 3.1 + R2.4.4 + B-22) — 5th type, 1:1 with install_type:'hook'.\n // Lifecycle hooks registered to ~/.claude/settings.json (SessionStart / UserPromptSubmit /\n // PreToolUse / PostToolUse) via the cc-hook-add install method.\n Type.Literal('cc-hook'),\n])\n\nconst ComponentType = Type.Union([\n Type.Literal('command'),\n Type.Literal('behavior-rule'),\n Type.Literal('mcp-tool'),\n Type.Literal('cli-binary'),\n])\n\nconst Verify = Type.Object(\n {\n cmd: Type.String({ minLength: 1 }),\n timeout_ms: Type.Optional(Type.Integer({ minimum: 100, maximum: 60_000 })),\n expected_exit_code: Type.Optional(Type.Integer()),\n },\n { additionalProperties: false },\n)\n\nconst Uninstall = Type.Object(\n {\n cmd: Type.String({ minLength: 1 }),\n cleanup_paths: Type.Optional(Type.Array(Type.String())),\n },\n { additionalProperties: false },\n)\n\nconst Stability = Type.Union([\n Type.Literal('stable'),\n Type.Literal('beta'),\n Type.Literal('unstable'),\n Type.Literal('archived'),\n])\n\nconst FallbackAction = Type.Union([\n Type.Literal('warn'),\n Type.Literal('block'),\n Type.Literal('use_alternative'),\n])\n\nconst UpstreamHealth = Type.Object(\n {\n stability: Stability,\n last_check: Type.String({ format: 'date' }),\n last_known_good_version: Type.String({ minLength: 1 }),\n fallback_action: FallbackAction,\n alternative: Type.Optional(Type.String()),\n },\n { additionalProperties: false },\n)\n\nconst Platform = Type.Union([Type.Literal('linux'), Type.Literal('darwin'), Type.Literal('win32')])\n\nconst Signature = Type.Object(\n { sigstore_bundle: Type.String({ format: 'uri' }) },\n { additionalProperties: false },\n)\n\nconst TestedWithVersions = Type.Object(\n {\n cc_versions: Type.Optional(Type.Array(Type.String())),\n node_versions: Type.Optional(Type.Array(Type.String())),\n },\n { additionalProperties: false },\n)\n\n// ADR 0007 errata — categorization schema (phase 1.3 T2.1 加 3 字段).\n// `category` (必填, 6 enum) + `install_type` (必填, 4 enum, 与 install.method 1:N 闭合) +\n// `decision_rules` (optional, per-manifest decision hint — 全局 rule-set 在\n// routing/decision_rules.yaml T3.1, schema 完全独立).\nconst Category = Type.Union([\n Type.Literal('meta'),\n Type.Literal('engineering'),\n Type.Literal('design'),\n Type.Literal('content'),\n Type.Literal('testing'),\n Type.Literal('search'),\n])\n\nconst InstallType = Type.Union([\n Type.Literal('skill'),\n Type.Literal('mcp'),\n Type.Literal('npm'),\n Type.Literal('git'),\n // Phase 2.4 W3 T3.1 (D-04 § 3.1 + R2.4.4 + B-22) — 5th install_type, 1:1 with TypeEnum:'cc-hook'.\n Type.Literal('hook'),\n])\n\nconst DecisionRules = Type.Object(\n {\n trigger: Type.Optional(Type.String({ minLength: 1 })),\n default_expert: Type.Optional(Type.String({ minLength: 1 })),\n arbitration_rule: Type.Optional(Type.String({ minLength: 1 })),\n override_signals: Type.Optional(\n Type.Array(\n Type.Object(\n {\n phrase: Type.String({ minLength: 1 }),\n use: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n ),\n ),\n // Phase 2.3 W2 T2.5 — CD-3 negative-space hint mirror (B-17 per-manifest hint\n // redundant guard layer; SSOT remains routing/decision_rules.yaml — D-04 lead).\n // Additive optional; existing manifests unchanged (A7 守恒).\n do_not_use_when: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),\n if_rejected_use: Type.Optional(Type.String({ minLength: 1 })),\n },\n { additionalProperties: false },\n)\n\n// ADR 0009 errata — mattpocock 23 招式 phase routing schema (phase 1.5 T5.5).\n// `Phase` (optional, 4 enum — 1:1 with decision_rules.yaml v2 mattpocock_phases\n// keys) + `Triggers` (optional, routing hints per D1.5-7). Both additive.\nconst Phase = Type.Union([\n Type.Literal('discuss'),\n Type.Literal('plan'),\n Type.Literal('execute'),\n Type.Literal('verify'),\n])\n\nconst Triggers = Type.Object(\n {\n complexity_threshold: Type.Optional(Type.Integer({ minimum: 1 })),\n tdd_required: Type.Optional(Type.Boolean()),\n brainstorming_required: Type.Optional(Type.Boolean()),\n },\n { additionalProperties: false },\n)\n\n// ADR 0010 errata — bundle-install modeling (#10, D2.1-1). One install action\n// may surface multiple named units (e.g. document-skills → pptx/docx/xlsx/pdf).\n// `provides` absent ⇒ atomic manifest (unchanged behavior). Present ⇒ one\n// install exposes N named units. `install`/`verify`/`uninstall` stay singular —\n// the bundle is installed by ONE action. Bundle manifests use the existing\n// `type: 'cc-skill-pack'` (D2.1-2 — no new TypeEnum/ComponentType value).\nconst ProvidedUnit = Type.Object(\n {\n id: Type.String({ minLength: 1 }), // routing-addressable, <org>-<repo>-<unit>\n component_type: ComponentType, // reuse existing union\n },\n { additionalProperties: false },\n)\n\n// v4.14.0 — cross-harness overrides (patch 4.14.0 T3 REVISED). A manifest whose\n// default install path is claude-flavored may declare a per-harness alternative\n// (today only `codex`). Structure REUSES the install discriminated union + the\n// Verify schema verbatim — an override is a full replacement install block (and\n// optionally verify), not a patch. runInstall merges the override by\n// detectPlatform().id BEFORE dispatch; absent override + claude-only method →\n// aborted 'harness-mismatch' (honest skip; ralph-loop / gstack use this).\nconst HarnessOverride = Type.Object(\n {\n install: Type.Unsafe<Install>(InstallSchema),\n verify: Type.Optional(Verify),\n },\n { additionalProperties: false },\n)\n\nconst HarnessOverrides = Type.Object(\n {\n codex: Type.Optional(HarnessOverride),\n },\n { additionalProperties: false },\n)\n\nexport const SpecSchema = Type.Object(\n {\n type: TypeEnum,\n component_type: ComponentType,\n install: Type.Unsafe<Install>(InstallSchema),\n verify: Verify,\n uninstall: Uninstall,\n upstream_health: UpstreamHealth,\n signed_by: Type.String({ pattern: '^[a-zA-Z0-9-]+$', minLength: 1 }),\n signature: Type.Optional(Signature),\n platforms: Type.Array(Platform, { minItems: 1, uniqueItems: true }),\n tested_with_versions: Type.Optional(TestedWithVersions),\n mutually_exclusive_with: Type.Optional(Type.Array(Type.String())),\n category: Category,\n install_type: InstallType,\n decision_rules: Type.Optional(DecisionRules),\n // ADR 0009 errata (phase 1.5 T5.5) — mattpocock phase routing schema.\n phase: Type.Optional(Phase),\n triggers: Type.Optional(Triggers),\n // ADR 0010 errata (phase 2.1 T1.3) — bundle-install `provides` field.\n provides: Type.Optional(Type.Array(ProvidedUnit, { minItems: 2, uniqueItems: true })),\n // v4.14.0 — per-harness install/verify overrides (codex only for now).\n harness_overrides: Type.Optional(HarnessOverrides),\n },\n { additionalProperties: false },\n)\n","// Manifest schema v1 — main entry per ADR 0001.\n// Top-level: { apiVersion, kind, metadata, spec } with strict additionalProperties: false.\n//\n// Type × install.method matrix (ADR 0001 § 4.5) is enforced via top-level `allOf`\n// with `if/then` clauses. Without this, the install discriminator only validates\n// the chosen method's structure but allows e.g. `type: cli-npm` paired with\n// `method: cc-plugin-marketplace` (matrix violation). Rule 2 enforcement.\n\nimport { Type } from '@sinclair/typebox'\nimport { ApiVersion, Kind, MetadataSchema } from './metadata.js'\nimport { SpecSchema } from './spec.js'\n\n// TypeBox-typed base — drives Static<typeof ManifestBase> for the inferred\n// Manifest TS type (re-exported via ./types.js).\nexport const ManifestBase = Type.Object(\n {\n apiVersion: ApiVersion,\n kind: Kind,\n metadata: MetadataSchema,\n spec: SpecSchema,\n },\n { additionalProperties: false },\n)\n\n// Per-type allowed install.method whitelist per ADR 0001 line 104-113.\nconst matrix: Record<string, string[]> = {\n 'cc-plugin': ['cc-plugin-marketplace'],\n 'cc-skill-pack': ['cc-plugin-marketplace', 'git-clone-with-setup', 'npx-skill-installer'],\n 'mcp-npm': ['mcp-stdio-add', 'mcp-http-add'],\n 'cli-npm': ['npm-cli'],\n}\n\nconst matrixConstraints = Object.entries(matrix).map(([typeValue, allowedMethods]) => ({\n if: {\n type: 'object',\n properties: {\n spec: {\n type: 'object',\n properties: { type: { const: typeValue } },\n required: ['type'],\n },\n },\n required: ['spec'],\n },\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema `then` keyword (conditional schemas), not a thenable.\n then: {\n type: 'object',\n properties: {\n spec: {\n type: 'object',\n properties: {\n install: {\n type: 'object',\n properties: { method: { enum: allowedMethods } },\n required: ['method'],\n },\n },\n required: ['install'],\n },\n },\n required: ['spec'],\n },\n}))\n\n// Runtime JSON Schema fed to Ajv: typed base + matrix allOf clauses + metadata.\n// We spread ManifestBase (a TypeBox object that is already a valid JSON Schema)\n// and append the cross-field constraints.\nexport const ManifestSchema = {\n ...(ManifestBase as unknown as Record<string, unknown>),\n $id: 'https://harnessed.dev/schemas/manifest.v1.schema.json',\n title: 'harnessed Manifest v1',\n description: 'Per ADR 0001. Strict mode (additionalProperties: false everywhere).',\n allOf: matrixConstraints,\n}\n","// Re-export schemas for third-party consumers via `harnessed/schemas` exports field.\n// Consumers can `import { ManifestSchema } from 'harnessed/schemas'` and feed it\n// to their own Ajv instance, OR consume the standalone JSON artifact at\n// `schemas/manifest.v1.schema.json` (built by `scripts/build-schema.mjs`).\n\nexport { ManifestSchema } from '../manifest/schema/index.js'\nexport const SCHEMA_VERSION = 'v1'\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/manifest/schema/metadata.ts","../../src/manifest/schema/installMethods/ccHookAdd.ts","../../src/manifest/schema/installMethods/ccPluginMarketplace.ts","../../src/manifest/schema/installMethods/gitCloneWithSetup.ts","../../src/manifest/schema/installMethods/mcpHttpAdd.ts","../../src/manifest/schema/installMethods/mcpStdioAdd.ts","../../src/manifest/schema/installMethods/npmCli.ts","../../src/manifest/schema/installMethods/npxSkillInstaller.ts","../../src/manifest/schema/installMethods/index.ts","../../src/manifest/schema/spec.ts","../../src/manifest/schema/index.ts","../../src/schemas/index.ts"],"names":["Type","GIT_REF_PATTERN"],"mappings":";;;AAMO,IAAM,UAAA,GAAa,IAAA,CAAK,OAAA,CAAQ,cAAc,CAAA;AAC9C,IAAM,IAAA,GAAO,IAAA,CAAK,OAAA,CAAQ,UAAU,CAAA;AAO3C,IAAM,WAAA,GAAc,KAAK,KAAA,CAAM;AAAA,EAC7B,IAAA,CAAK,QAAQ,KAAK,CAAA;AAAA,EAClB,IAAA,CAAK,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AM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,YAAY,EAAE,IAAA,EAAM,EAAE,KAAA,EAAO,WAAU,EAAE;AAAA,QACzC,QAAA,EAAU,CAAC,MAAM;AAAA;AACnB,KACF;AAAA,IACA,QAAA,EAAU,CAAC,MAAM;AAAA,GACnB;AAAA;AAAA,EAEA,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,QAAA;AAAA,IACN,UAAA,EAAY;AAAA,MACV,IAAA,EAAM;AAAA,QACJ,IAAA,EAAM,QAAA;AAAA,QACN,UAAA,EAAY;AAAA,UACV,OAAA,EAAS;AAAA,YACP,IAAA,EAAM,QAAA;AAAA,YACN,YAAY,EAAE,MAAA,EAAQ,EAAE,IAAA,EAAM,gBAAe,EAAE;AAAA,YAC/C,QAAA,EAAU,CAAC,QAAQ;AAAA;AACrB,SACF;AAAA,QACA,QAAA,EAAU,CAAC,SAAS;AAAA;AACtB,KACF;AAAA,IACA,QAAA,EAAU,CAAC,MAAM;AAAA;AAErB,CAAA,CAAE,CAAA;AAKK,IAAM,cAAA,GAAiB;AAAA,EAC5B,GAAI,YAAA;AAAA,EACJ,GAAA,EAAK,uDAAA;AAAA,EACL,KAAA,EAAO,uBAAA;AAAA,EACP,WAAA,EAAa,qEAAA;AAAA,EACb,KAAA,EAAO;AACT;;;ACnEO,IAAM,cAAA,GAAiB","file":"index.mjs","sourcesContent":["// Metadata sub-schema per ADR 0001 § Top-level structure.\n// Fields: apiVersion (Literal harnessed/v1), kind (Literal Manifest),\n// metadata.{name, display_name?, description, upstream{...}}.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const ApiVersion = Type.Literal('harnessed/v1')\nexport const Kind = Type.Literal('Manifest')\n\n// SPDX whitelist per ADR 0001 line 51.\n// ADR 0010 errata — license whitelist extension (D-03/D-05). `MIT-0` (MIT No\n// Attribution, SPDX-registered) added for baoyu-skills; `anthropics-official`\n// carve-out added for anthropics/skills monorepo sub-skills (frontend-design /\n// document-skills / webapp-testing) which have no per-skill LICENSE file.\nconst SpdxLicense = Type.Union([\n Type.Literal('MIT'),\n Type.Literal('Apache-2.0'),\n Type.Literal('BSD-3-Clause'),\n Type.Literal('ISC'),\n Type.Literal('0BSD'),\n Type.Literal('MIT-0'),\n Type.Literal('anthropics-official'),\n])\n\n// ADR 0010 errata — license provenance audit field (D-04). Records where the\n// license info was sourced from so it can be mechanically audited. Optional —\n// additive only, A7' 8-pillar safe (no existing manifest broken).\nconst LicenseSource = Type.Union([\n Type.Literal('README'),\n Type.Literal('registry'),\n Type.Literal('none'),\n Type.Literal('anthropics-official'),\n])\n\nconst Upstream = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n homepage: Type.String({ format: 'uri' }),\n repository: Type.String({ format: 'uri' }),\n license: SpdxLicense,\n license_source: Type.Optional(LicenseSource),\n notice: Type.String({ minLength: 1, maxLength: 500 }),\n },\n { additionalProperties: false },\n)\n\nexport const MetadataSchema = Type.Object(\n {\n name: Type.String({ pattern: '^[a-z0-9][a-z0-9-]*$', minLength: 1 }),\n display_name: Type.Optional(Type.String()),\n description: Type.String({ minLength: 1, maxLength: 120 }),\n upstream: Upstream,\n },\n { additionalProperties: false },\n)\n","// install.method = cc-hook-add per ADR 0001 type×method matrix + Phase 2.4 W3 T3.1 (D-04 § 3.1).\n//\n// IMPL NOTE (Phase 2.4 W3 / R2.4.4): Claude Code SessionStart / UserPromptSubmit /\n// PreToolUse / PostToolUse hooks are configured in ~/.claude/settings.json under\n// `hooks.<event>[].{matcher, command}` shape. This install method lets a manifest\n// register a hook entry idempotently. The hook_command is the bash invocation the\n// user wants run on that lifecycle event (e.g. `node scripts/dashboard.mjs --no-open`\n// to auto-spawn the dashboard on session start).\n//\n// Sister: npxSkillInstaller schema (~17L) — same minimal TypeBox shape, no exotic\n// fields. `idempotent_check` reused from the 6 sister install methods (preflight\n// invariant per src/installers/lib/preflight.ts contract).\n\nimport { Type } from '@sinclair/typebox'\n\nconst HookEvent = Type.Union([\n Type.Literal('SessionStart'),\n Type.Literal('UserPromptSubmit'),\n Type.Literal('PreToolUse'),\n Type.Literal('PostToolUse'),\n // 4.30.0 (issue #6) — Stop hook for mode-B tool-call corruption auto-recovery.\n Type.Literal('Stop'),\n])\n\nexport const CcHookAdd = Type.Object(\n {\n method: Type.Literal('cc-hook-add'),\n cmd: Type.String({ minLength: 1 }), // audit-trail (the bash invocation registered)\n // cwd/env required by lib/spawn.ts discriminated-union access (sister 6 method\n // shape parity — even though cc-hook-add does not spawn, generic spawn helper\n // expects these fields on the install union).\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n hook_event: HookEvent,\n hook_matcher: Type.Optional(Type.String()),\n hook_command: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = cc-plugin-marketplace per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, git_ref.\n//\n// Phase 1.1.1 hotfix M1 — git_ref pattern enforces SHA (7-40 hex) or SemVer\n// tag, rejecting branch names like HEAD/main/master that would silently\n// drift. ADR 0001 § \"版本锁哲学\" requires reproducible installs.\n//\n// Phase 1.2 ADR 0005 errata — `marketplace_source` optional field for\n// third-party marketplaces (e.g. OthmanAdi/planning-with-files which is NOT\n// in claude-plugins-official). v0.1 only `source: github`. Official upstream\n// can omit; phase 2.1 cc-plugin-marketplace installer will consume this\n// field structurally instead of parsing the cmd string.\n\nimport { Type } from '@sinclair/typebox'\n\nconst GIT_REF_PATTERN = '^([a-f0-9]{7,40}|v?\\\\d+\\\\.\\\\d+\\\\.\\\\d+([.-][\\\\w.-]+)?)$'\nconst REPO_PATTERN = '^[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+$'\n\nexport const CcPluginMarketplace = Type.Object(\n {\n method: Type.Literal('cc-plugin-marketplace'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n git_ref: Type.String({ minLength: 1, pattern: GIT_REF_PATTERN }),\n idempotent_check: Type.String({ minLength: 1 }),\n // ADR 0005 — third-party marketplace structured metadata (optional).\n marketplace_source: Type.Optional(\n Type.Object(\n {\n source: Type.Literal('github'),\n repo: Type.String({ pattern: REPO_PATTERN, minLength: 3 }),\n },\n { additionalProperties: false },\n ),\n ),\n },\n { additionalProperties: false },\n)\n","// install.method = git-clone-with-setup per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, git_ref.\n//\n// Phase 1.1.1 hotfix M1 — git_ref pattern enforces SHA (7-40 hex) or SemVer\n// tag, rejecting branch names like HEAD/main/master that would silently\n// drift. ADR 0001 § \"版本锁哲学\" requires reproducible installs.\n\nimport { Type } from '@sinclair/typebox'\n\nconst GIT_REF_PATTERN = '^([a-f0-9]{7,40}|v?\\\\d+\\\\.\\\\d+\\\\.\\\\d+([.-][\\\\w.-]+)?)$'\n\nexport const GitCloneWithSetup = Type.Object(\n {\n method: Type.Literal('git-clone-with-setup'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n git_ref: Type.String({ minLength: 1, pattern: GIT_REF_PATTERN }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method = mcp-http-add per ADR 0001 type×method matrix (mcp-npm only).\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const McpHttpAdd = Type.Object(\n {\n method: Type.Literal('mcp-http-add'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = mcp-stdio-add per ADR 0001 type×method matrix (mcp-npm only).\n// Required: cmd, idempotent_check, npm_version.\n// Note: cmd should invoke `claude mcp add --scope project ...` (R3.2),\n// but schema only validates structure — actual cmd template is per-manifest.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const McpStdioAdd = Type.Object(\n {\n method: Type.Literal('mcp-stdio-add'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n)\n","// install.method = npm-cli per ADR 0001 type×method matrix (cli-npm only).\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const NpmCli = Type.Object(\n {\n method: Type.Literal('npm-cli'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method = npx-skill-installer per ADR 0001 type×method matrix.\n// Required: cmd, idempotent_check, npm_version.\n\nimport { Type } from '@sinclair/typebox'\n\nexport const NpxSkillInstaller = Type.Object(\n {\n method: Type.Literal('npx-skill-installer'),\n cmd: Type.String({ minLength: 1 }),\n cwd: Type.Optional(Type.String()),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n args: Type.Optional(Type.Record(Type.String(), Type.Unknown())),\n npm_version: Type.String({ minLength: 1 }),\n idempotent_check: Type.String({ minLength: 1 }),\n // 4.23.0 (issue #3 req 5) — skill names this pack copies into the flat\n // ~/.claude/skills namespace; enables pre-install collision warnings against\n // shipped workflow names + post-install undeclared-name drift detection.\n installs_skills: Type.Optional(Type.Array(Type.String({ minLength: 1 }))),\n },\n { additionalProperties: false },\n)\n","// install.method discriminated union per ADR 0001 type×method matrix.\n// 6 methods: cc-plugin-marketplace, git-clone-with-setup, npx-skill-installer,\n// npm-cli, mcp-stdio-add, mcp-http-add.\n//\n// IMPL NOTE (Rule 1 / F8): TypeBox's Type.Union(..., { discriminator })\n// emits `anyOf` + lacks `type: \"object\"` + `required: [\"method\"]`, but Ajv\n// `discriminator: true` strict mode requires `oneOf` + `type: \"object\"` +\n// `required: [\"method\"]`. We hand-build the discriminator-compatible shape\n// here so Ajv accepts it. The inferred TypeScript type still tracks via\n// Static<>; Ajv accepts hand-rolled JSON Schema objects with no DX cost.\n\nimport { type Static, Type } from '@sinclair/typebox'\nimport { CcHookAdd } from './ccHookAdd.js'\nimport { CcPluginMarketplace } from './ccPluginMarketplace.js'\nimport { GitCloneWithSetup } from './gitCloneWithSetup.js'\nimport { McpHttpAdd } from './mcpHttpAdd.js'\nimport { McpStdioAdd } from './mcpStdioAdd.js'\nimport { NpmCli } from './npmCli.js'\nimport { NpxSkillInstaller } from './npxSkillInstaller.js'\n\nconst branches = [\n CcPluginMarketplace,\n GitCloneWithSetup,\n NpxSkillInstaller,\n NpmCli,\n McpStdioAdd,\n McpHttpAdd,\n CcHookAdd,\n] as const\n\n// Hand-built JSON Schema that Ajv `discriminator: true` strict mode accepts.\n// Strict mode also requires `properties.method` declared at the discriminator\n// level (else `strictRequired` complains that `method` is required but undefined\n// at this object scope). Per-branch `additionalProperties: false` is preserved\n// (each TypeBox object already sets it).\nexport const InstallSchema = {\n type: 'object',\n discriminator: { propertyName: 'method' },\n required: ['method'],\n properties: {\n method: { type: 'string' },\n },\n oneOf: branches as unknown as object[],\n} as const\n\n// Re-derive the TS type via TypeBox's regular Union (this is unused at runtime\n// but gives downstream consumers a typed `Manifest['spec']['install']`).\nconst InstallUnion = Type.Union([...branches])\nexport type Install = Static<typeof InstallUnion>\n","// spec sub-schema per ADR 0001 § Top-level structure.\n// Fields: type, component_type, install (discriminated union), verify, uninstall,\n// upstream_health, signed_by, signature?, platforms,\n// tested_with_versions?, mutually_exclusive_with?,\n// category, install_type, decision_rules? (ADR 0007 errata — phase 1.3 加),\n// phase?, triggers? (ADR 0009 errata — phase 1.5 T5.5 加).\n//\n// IMPL NOTE — phase 1.5 T5.5 (ADR 0009 § Decision / D1.5-6 / D1.5-7 / Pattern L\n// spec-level metadata 加法 + Pattern T): adds 2 optional spec-level fields for\n// the mattpocock 23 招式 phase routing schema. `phase` is a 4-value enum\n// (discuss / plan / execute / verify) mirroring `decision_rules.yaml` v2\n// `mattpocock_phases` keys; `triggers` is an optional object carrying routing\n// hints (complexity_threshold / tdd_required / brainstorming_required). Both\n// optional — additive only, A7' 8-pillar enforcement (no existing manifest\n// broken). NOTE: this schema uses TypeBox (`@sinclair/typebox`), the project's\n// established schema lib — NOT zod; the task_plan `z.enum` / `z.object` outline\n// is a planning-doc shorthand, implemented here as `Type.Union` / `Type.Object`\n// per ADR 0001 + the no-new-deps constraint.\n\nimport { Type } from '@sinclair/typebox'\nimport { type Install, InstallSchema } from './installMethods/index.js'\n\nconst TypeEnum = Type.Union([\n Type.Literal('cc-plugin'),\n Type.Literal('cc-skill-pack'),\n Type.Literal('mcp-npm'),\n Type.Literal('cli-npm'),\n // Phase 2.4 W3 T3.1 (D-04 § 3.1 + R2.4.4 + B-22) — 5th type, 1:1 with install_type:'hook'.\n // Lifecycle hooks registered to ~/.claude/settings.json (SessionStart / UserPromptSubmit /\n // PreToolUse / PostToolUse) via the cc-hook-add install method.\n Type.Literal('cc-hook'),\n])\n\nconst ComponentType = Type.Union([\n Type.Literal('command'),\n Type.Literal('behavior-rule'),\n Type.Literal('mcp-tool'),\n Type.Literal('cli-binary'),\n])\n\nconst Verify = Type.Object(\n {\n cmd: Type.String({ minLength: 1 }),\n timeout_ms: Type.Optional(Type.Integer({ minimum: 100, maximum: 60_000 })),\n expected_exit_code: Type.Optional(Type.Integer()),\n },\n { additionalProperties: false },\n)\n\nconst Uninstall = Type.Object(\n {\n cmd: Type.String({ minLength: 1 }),\n cleanup_paths: Type.Optional(Type.Array(Type.String())),\n },\n { additionalProperties: false },\n)\n\nconst Stability = Type.Union([\n Type.Literal('stable'),\n Type.Literal('beta'),\n Type.Literal('unstable'),\n Type.Literal('archived'),\n])\n\nconst FallbackAction = Type.Union([\n Type.Literal('warn'),\n Type.Literal('block'),\n Type.Literal('use_alternative'),\n])\n\nconst UpstreamHealth = Type.Object(\n {\n stability: Stability,\n last_check: Type.String({ format: 'date' }),\n last_known_good_version: Type.String({ minLength: 1 }),\n fallback_action: FallbackAction,\n alternative: Type.Optional(Type.String()),\n },\n { additionalProperties: false },\n)\n\nconst Platform = Type.Union([Type.Literal('linux'), Type.Literal('darwin'), Type.Literal('win32')])\n\nconst Signature = Type.Object(\n { sigstore_bundle: Type.String({ format: 'uri' }) },\n { additionalProperties: false },\n)\n\nconst TestedWithVersions = Type.Object(\n {\n cc_versions: Type.Optional(Type.Array(Type.String())),\n node_versions: Type.Optional(Type.Array(Type.String())),\n },\n { additionalProperties: false },\n)\n\n// ADR 0007 errata — categorization schema (phase 1.3 T2.1 加 3 字段).\n// `category` (必填, 6 enum) + `install_type` (必填, 4 enum, 与 install.method 1:N 闭合) +\n// `decision_rules` (optional, per-manifest decision hint — 全局 rule-set 在\n// routing/decision_rules.yaml T3.1, schema 完全独立).\nconst Category = Type.Union([\n Type.Literal('meta'),\n Type.Literal('engineering'),\n Type.Literal('design'),\n Type.Literal('content'),\n Type.Literal('testing'),\n Type.Literal('search'),\n])\n\nconst InstallType = Type.Union([\n Type.Literal('skill'),\n Type.Literal('mcp'),\n Type.Literal('npm'),\n Type.Literal('git'),\n // Phase 2.4 W3 T3.1 (D-04 § 3.1 + R2.4.4 + B-22) — 5th install_type, 1:1 with TypeEnum:'cc-hook'.\n Type.Literal('hook'),\n])\n\nconst DecisionRules = Type.Object(\n {\n trigger: Type.Optional(Type.String({ minLength: 1 })),\n default_expert: Type.Optional(Type.String({ minLength: 1 })),\n arbitration_rule: Type.Optional(Type.String({ minLength: 1 })),\n override_signals: Type.Optional(\n Type.Array(\n Type.Object(\n {\n phrase: Type.String({ minLength: 1 }),\n use: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n ),\n ),\n // Phase 2.3 W2 T2.5 — CD-3 negative-space hint mirror (B-17 per-manifest hint\n // redundant guard layer; SSOT remains routing/decision_rules.yaml — D-04 lead).\n // Additive optional; existing manifests unchanged (A7 守恒).\n do_not_use_when: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),\n if_rejected_use: Type.Optional(Type.String({ minLength: 1 })),\n },\n { additionalProperties: false },\n)\n\n// ADR 0009 errata — mattpocock 23 招式 phase routing schema (phase 1.5 T5.5).\n// `Phase` (optional, 4 enum — 1:1 with decision_rules.yaml v2 mattpocock_phases\n// keys) + `Triggers` (optional, routing hints per D1.5-7). Both additive.\nconst Phase = Type.Union([\n Type.Literal('discuss'),\n Type.Literal('plan'),\n Type.Literal('execute'),\n Type.Literal('verify'),\n])\n\nconst Triggers = Type.Object(\n {\n complexity_threshold: Type.Optional(Type.Integer({ minimum: 1 })),\n tdd_required: Type.Optional(Type.Boolean()),\n brainstorming_required: Type.Optional(Type.Boolean()),\n },\n { additionalProperties: false },\n)\n\n// ADR 0010 errata — bundle-install modeling (#10, D2.1-1). One install action\n// may surface multiple named units (e.g. document-skills → pptx/docx/xlsx/pdf).\n// `provides` absent ⇒ atomic manifest (unchanged behavior). Present ⇒ one\n// install exposes N named units. `install`/`verify`/`uninstall` stay singular —\n// the bundle is installed by ONE action. Bundle manifests use the existing\n// `type: 'cc-skill-pack'` (D2.1-2 — no new TypeEnum/ComponentType value).\nconst ProvidedUnit = Type.Object(\n {\n id: Type.String({ minLength: 1 }), // routing-addressable, <org>-<repo>-<unit>\n component_type: ComponentType, // reuse existing union\n },\n { additionalProperties: false },\n)\n\n// v4.14.0 — cross-harness overrides (patch 4.14.0 T3 REVISED). A manifest whose\n// default install path is claude-flavored may declare a per-harness alternative\n// (today only `codex`). Structure REUSES the install discriminated union + the\n// Verify schema verbatim — an override is a full replacement install block (and\n// optionally verify), not a patch. runInstall merges the override by\n// detectPlatform().id BEFORE dispatch; absent override + claude-only method →\n// aborted 'harness-mismatch' (honest skip; superpowers / gstack use this).\nconst HarnessOverride = Type.Object(\n {\n install: Type.Unsafe<Install>(InstallSchema),\n verify: Type.Optional(Verify),\n },\n { additionalProperties: false },\n)\n\nconst HarnessOverrides = Type.Object(\n {\n codex: Type.Optional(HarnessOverride),\n },\n { additionalProperties: false },\n)\n\nexport const SpecSchema = Type.Object(\n {\n type: TypeEnum,\n component_type: ComponentType,\n install: Type.Unsafe<Install>(InstallSchema),\n verify: Verify,\n uninstall: Uninstall,\n upstream_health: UpstreamHealth,\n signed_by: Type.String({ pattern: '^[a-zA-Z0-9-]+$', minLength: 1 }),\n signature: Type.Optional(Signature),\n platforms: Type.Array(Platform, { minItems: 1, uniqueItems: true }),\n tested_with_versions: Type.Optional(TestedWithVersions),\n mutually_exclusive_with: Type.Optional(Type.Array(Type.String())),\n category: Category,\n install_type: InstallType,\n decision_rules: Type.Optional(DecisionRules),\n // ADR 0009 errata (phase 1.5 T5.5) — mattpocock phase routing schema.\n phase: Type.Optional(Phase),\n triggers: Type.Optional(Triggers),\n // ADR 0010 errata (phase 2.1 T1.3) — bundle-install `provides` field.\n provides: Type.Optional(Type.Array(ProvidedUnit, { minItems: 2, uniqueItems: true })),\n // v4.14.0 — per-harness install/verify overrides (codex only for now).\n harness_overrides: Type.Optional(HarnessOverrides),\n },\n { additionalProperties: false },\n)\n","// Manifest schema v1 — main entry per ADR 0001.\n// Top-level: { apiVersion, kind, metadata, spec } with strict additionalProperties: false.\n//\n// Type × install.method matrix (ADR 0001 § 4.5) is enforced via top-level `allOf`\n// with `if/then` clauses. Without this, the install discriminator only validates\n// the chosen method's structure but allows e.g. `type: cli-npm` paired with\n// `method: cc-plugin-marketplace` (matrix violation). Rule 2 enforcement.\n\nimport { Type } from '@sinclair/typebox'\nimport { ApiVersion, Kind, MetadataSchema } from './metadata.js'\nimport { SpecSchema } from './spec.js'\n\n// TypeBox-typed base — drives Static<typeof ManifestBase> for the inferred\n// Manifest TS type (re-exported via ./types.js).\nexport const ManifestBase = Type.Object(\n {\n apiVersion: ApiVersion,\n kind: Kind,\n metadata: MetadataSchema,\n spec: SpecSchema,\n },\n { additionalProperties: false },\n)\n\n// Per-type allowed install.method whitelist per ADR 0001 line 104-113.\nconst matrix: Record<string, string[]> = {\n 'cc-plugin': ['cc-plugin-marketplace'],\n 'cc-skill-pack': ['cc-plugin-marketplace', 'git-clone-with-setup', 'npx-skill-installer'],\n 'mcp-npm': ['mcp-stdio-add', 'mcp-http-add'],\n 'cli-npm': ['npm-cli'],\n}\n\nconst matrixConstraints = Object.entries(matrix).map(([typeValue, allowedMethods]) => ({\n if: {\n type: 'object',\n properties: {\n spec: {\n type: 'object',\n properties: { type: { const: typeValue } },\n required: ['type'],\n },\n },\n required: ['spec'],\n },\n // biome-ignore lint/suspicious/noThenProperty: JSON Schema `then` keyword (conditional schemas), not a thenable.\n then: {\n type: 'object',\n properties: {\n spec: {\n type: 'object',\n properties: {\n install: {\n type: 'object',\n properties: { method: { enum: allowedMethods } },\n required: ['method'],\n },\n },\n required: ['install'],\n },\n },\n required: ['spec'],\n },\n}))\n\n// Runtime JSON Schema fed to Ajv: typed base + matrix allOf clauses + metadata.\n// We spread ManifestBase (a TypeBox object that is already a valid JSON Schema)\n// and append the cross-field constraints.\nexport const ManifestSchema = {\n ...(ManifestBase as unknown as Record<string, unknown>),\n $id: 'https://harnessed.dev/schemas/manifest.v1.schema.json',\n title: 'harnessed Manifest v1',\n description: 'Per ADR 0001. Strict mode (additionalProperties: false everywhere).',\n allOf: matrixConstraints,\n}\n","// Re-export schemas for third-party consumers via `harnessed/schemas` exports field.\n// Consumers can `import { ManifestSchema } from 'harnessed/schemas'` and feed it\n// to their own Ajv instance, OR consume the standalone JSON artifact at\n// `schemas/manifest.v1.schema.json` (built by `scripts/build-schema.mjs`).\n\nexport { ManifestSchema } from '../manifest/schema/index.js'\nexport const SCHEMA_VERSION = 'v1'\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
|
|
2
|
+
# T2.5 — opt-in commit-time documentation-discipline gate.
|
|
3
|
+
# Registers a PreToolUse(Bash) hook running `harnessed check-docs --hook`. The
|
|
4
|
+
# --hook mode reads the tool payload on stdin and returns immediately (exit 0)
|
|
5
|
+
# unless the command is a `git commit` — so every other Bash call is a no-op,
|
|
6
|
+
# and the check only runs at the commit boundary declared by
|
|
7
|
+
# workflows/disciplines/doc-discipline.yaml (enforcement_layer: commit).
|
|
8
|
+
# Exit codes ARE the gate: 2 = blocking violation (PreToolUse blocks the commit
|
|
9
|
+
# and hands stderr to the model), 1 = advisory only (stderr to the user), 0 =
|
|
10
|
+
# clean. `HARNESSED_ALLOW_LONG_STATE=1` is the documented single-run override.
|
|
11
|
+
# Opt-in (manifests/optional/) because it blocks a tool call on a doc rule; a
|
|
12
|
+
# repo with a different STATE cadence should set its own ceiling first
|
|
13
|
+
# (`harnessed check-docs --max-state-lines <n>`). Idempotent — re-install on an
|
|
14
|
+
# existing matching entry → skip.
|
|
15
|
+
apiVersion: harnessed/v1
|
|
16
|
+
kind: Manifest
|
|
17
|
+
metadata:
|
|
18
|
+
name: doc-discipline-gate
|
|
19
|
+
display_name: Documentation Discipline Gate (PreToolUse / git commit)
|
|
20
|
+
description: Opt-in PreToolUse hook blocking `git commit` when .planning/ breaches doc discipline (harnessed check-docs).
|
|
21
|
+
upstream:
|
|
22
|
+
source: doc-discipline-gate
|
|
23
|
+
homepage: https://github.com/easyinplay/harnessed
|
|
24
|
+
repository: https://github.com/easyinplay/harnessed.git
|
|
25
|
+
license: MIT
|
|
26
|
+
notice: First-party harnessed hook (T2.5, doc-discipline enforcement that ships).
|
|
27
|
+
spec:
|
|
28
|
+
type: cc-hook
|
|
29
|
+
component_type: command
|
|
30
|
+
category: meta
|
|
31
|
+
install_type: hook
|
|
32
|
+
install:
|
|
33
|
+
method: cc-hook-add
|
|
34
|
+
cmd: "harnessed check-docs --hook"
|
|
35
|
+
hook_event: PreToolUse
|
|
36
|
+
hook_matcher: Bash
|
|
37
|
+
hook_command: "harnessed check-docs --hook"
|
|
38
|
+
idempotent_check: "grep -q 'check-docs' ~/.claude/settings.json"
|
|
39
|
+
verify:
|
|
40
|
+
cmd: "grep -q 'check-docs' ~/.claude/settings.json"
|
|
41
|
+
timeout_ms: 5000
|
|
42
|
+
expected_exit_code: 0
|
|
43
|
+
uninstall:
|
|
44
|
+
cmd: "true"
|
|
45
|
+
upstream_health:
|
|
46
|
+
stability: beta
|
|
47
|
+
last_check: "2026-07-30"
|
|
48
|
+
last_known_good_version: "0.1.0"
|
|
49
|
+
fallback_action: warn
|
|
50
|
+
signed_by: easyinplay
|
|
51
|
+
platforms:
|
|
52
|
+
- linux
|
|
53
|
+
- darwin
|
|
54
|
+
- win32
|
package/messages/en.json
CHANGED
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
"doctor.summary.warn": "\nall checks ok (with warnings — see hints above)",
|
|
81
81
|
"doctor.summary.pass": "\nall checks passed",
|
|
82
82
|
|
|
83
|
+
"check_docs.clean": "documentation discipline: no violations",
|
|
84
|
+
"check_docs.state_line_limit": "STATE.md is {{lines}} lines > the {{limit}}-line digest limit — archive older phase narrative to RETROSPECTIVE.md (override for one run: HARNESSED_ALLOW_LONG_STATE=1)",
|
|
85
|
+
"check_docs.state_key_decisions": "{{count}} '关键决议 ship 总结' section(s) > {{limit}} — keep only the current one; move the rest to RETROSPECTIVE.md",
|
|
86
|
+
"check_docs.state_errata": "historical commentary '{{excerpt}}' belongs in RETROSPECTIVE.md, not in the STATE digest",
|
|
87
|
+
"check_docs.roadmap_narrative": "closing narrative inlined in an overview doc ({{signals}}) — ROADMAP carries one line + a pointer per phase; narrative goes to SUMMARY / VERIFICATION",
|
|
88
|
+
"check_docs.summary_halt": "\ndocumentation discipline: {{halt}} blocking + {{warn}} advisory violation(s)",
|
|
89
|
+
"check_docs.summary_warn": "\ndocumentation discipline: {{warn}} advisory violation(s) (non-blocking)",
|
|
90
|
+
|
|
83
91
|
"backup.no_backups": "no backups found ({{root}} absent)",
|
|
84
92
|
"backup.no_backups_empty": "no backups found ({{root}} empty)",
|
|
85
93
|
"backup.total_snapshots": "\n{{count}} snapshot(s) total",
|
package/messages/zh-Hans.json
CHANGED
|
@@ -80,6 +80,14 @@
|
|
|
80
80
|
"doctor.summary.warn": "\nall checks ok (with warnings — see hints above)",
|
|
81
81
|
"doctor.summary.pass": "\nall checks passed",
|
|
82
82
|
|
|
83
|
+
"check_docs.clean": "文档纪律检查通过:无违规",
|
|
84
|
+
"check_docs.state_line_limit": "STATE.md 当前 {{lines}} 行,超过 {{limit}} 行 digest 上限 —— 把更早的 phase 叙事归档到 RETROSPECTIVE.md(单次放行:HARNESSED_ALLOW_LONG_STATE=1)",
|
|
85
|
+
"check_docs.state_key_decisions": "'关键决议 ship 总结' section 有 {{count}} 个,超过 {{limit}} 个 —— 只留当前那个,其余移入 RETROSPECTIVE.md",
|
|
86
|
+
"check_docs.state_errata": "历史批注 '{{excerpt}}' 属于 RETROSPECTIVE.md,不该留在 STATE digest 里",
|
|
87
|
+
"check_docs.roadmap_narrative": "概览文档内联了收尾叙事({{signals}})—— ROADMAP 一 phase 一行结论 + 指针,叙事进 SUMMARY / VERIFICATION",
|
|
88
|
+
"check_docs.summary_halt": "\n文档纪律:{{halt}} 项阻断 + {{warn}} 项提示",
|
|
89
|
+
"check_docs.summary_warn": "\n文档纪律:{{warn}} 项提示(不阻断)",
|
|
90
|
+
|
|
83
91
|
"backup.no_backups": "no backups found ({{root}} absent)",
|
|
84
92
|
"backup.no_backups_empty": "no backups found ({{root}} empty)",
|
|
85
93
|
"backup.total_snapshots": "\n{{count}} snapshot(s) total",
|
package/package.json
CHANGED
|
@@ -191,7 +191,7 @@ rules:
|
|
|
191
191
|
|
|
192
192
|
# ─── engineering (phase 1.5 T4.1 — 5 specific rules) ─────────
|
|
193
193
|
# NOTE: engineering category base layer 已装 (gstack/GSD/superpowers/karpathy/
|
|
194
|
-
# mattpocock/
|
|
194
|
+
# mattpocock/planning-with-files), 不需 install routing;
|
|
195
195
|
# 下列 5 rules 按 discuss/plan/execute/verify 分阶段调度 mattpocock 23 招式
|
|
196
196
|
# (skills_overlay ref → mattpocock_phases 段, 见文件末). D1.5-3 真理 source:
|
|
197
197
|
# 用户笔记 ~/.claude/CLAUDE.md 工作流 4 阶段映射.
|
package/workflows/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
## v0.1 MVP Workflows
|
|
6
6
|
|
|
7
7
|
- `research/` — 多源调研路由(Tavily / Exa / ctx7) — v0.1.0
|
|
8
|
-
- `task/` — 子任务执行(superpowers + karpathy + mattpocock +
|
|
8
|
+
- `task/` — 子任务执行(superpowers + karpathy + mattpocock + harnessed 自有 completion gate) — v3.0.0
|
|
9
9
|
- `plan/` — 三层栈编排(gstack + GSD + planning-with-files) — v3.0.0
|
|
10
10
|
|
|
11
11
|
## Phases Schema
|
package/workflows/auto/SKILL.md
CHANGED
|
@@ -120,24 +120,28 @@ Do NOT pipe to `harnessed run auto` — that is the CI/headless path (in-process
|
|
|
120
120
|
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
121
121
|
|
|
122
122
|
1. FIRST run the discuss stage interactively in THIS session (spawned subagents cannot ask the user questions). Evaluate strategic / phase / subtask clarification criteria for "$ARGUMENTS"; dialogue with the user (AskUserQuestion) for each layer that fires, lock decisions, transparent-skip the rest. After locking blocking decisions, relay the deferrable set to the user in a single batched AskUserQuestion with each agent-recommended default pre-selected — deferrable defers scheduling, not user authority; only skip an item if the user explicitly defers it again. Produce a locked spec.
|
|
123
|
-
|
|
123
|
+
1b. Bash: `harnessed facts auto --out .harnessed-facts.json` → it lists ONLY the facts this stage’s gates actually read: deterministic ones already filled (change size / files touched / stage, from git), judgement calls left `null` with a one-line hint of what to judge. Edit the file and replace each `null` in `facts` with your honest answer from the locked spec — leave one null only if you genuinely cannot judge it (it then falls back to the built-in default). Do NOT skip this step and do NOT invent facts the command did not ask for.
|
|
124
|
+
2. Bash: `harnessed gates auto --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → parse the JSON `{fire, skip, parallelism}`. This is the plan SoT (no spawn). Keep the verbatim JSON. For a small self-contained task (single-file / single-page class), the sanctioned lite path is adding `--skip-sub verify --skip-sub retro` (repeatable / comma-separated) — skipped subs are still recorded in the ledger with reasons; lite ≠ freestyle (the ledger/evidence IS the difference).
|
|
124
125
|
3. Bash: `harnessed checkpoint start auto --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
125
|
-
4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team
|
|
126
|
-
- **
|
|
127
|
-
- **Headless never spawns teams**: in a headless session (`claude -p`) `harnessed gates` already returns `escalate_to_teams: false` (Agent Teams are session-scoped — lost on `/resume`, incompatible with `-p`). Do NOT
|
|
126
|
+
4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team. There is NO create step and no create tool — spawn one background teammate per fired sub with `Agent(name: <sub>, run_in_background: true, prompt: <that sub's `harnessed prompt <sub>` prompt>)` and the team forms implicitly on the FIRST spawn, with this session as lead (the `team_name` input is accepted but ignored — the name is session-derived). Coordinate via `SendMessage`; when a sub is finished, ask that teammate to shut down BY NAME (e.g. "ask the verify-qa teammate to shut down"). Still checkpoint each sub (`complete` / `fail`) as below.
|
|
127
|
+
- **Shut every teammate down before you finish — MUST-in-finally, not best-effort**: regardless of whether every sub reached COMPLETE, max_iterations was exhausted, or you consider the work done, ask each teammate to shut down by name before you end the run, and confirm it actually stopped. Shutdown is a REQUEST: the teammate finishes its current tool call first and may reject with a reason, so re-ask rather than assume. The team directory is removed automatically at session exit (there is no teardown tool), but a teammate you never stopped keeps consuming tokens and can hang the host (headless especially — issue #7: an 11h hang, work complete but the process never exited).
|
|
128
|
+
- **Headless never spawns teams**: in a headless session (`claude -p`) `harnessed gates` already returns `escalate_to_teams: false` (Agent Teams are session-scoped — lost on `/resume`, incompatible with `-p`). Do NOT spawn teammates or background-`Agent` in headless even if you think it would parallelize — run the fired subs sequentially in-session instead.
|
|
128
129
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
129
|
-
- **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
|
|
130
|
+
- **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed facts <sub> --out .harnessed-facts.json` (fill the nulls) → `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
|
|
130
131
|
- **Else (leaf sub):**
|
|
131
132
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
132
|
-
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
133
|
+
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
134
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete <sub> --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
135
|
+
- if it blocks, run `harnessed checkpoint fail <sub> --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
136
|
+
- respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
|
|
133
137
|
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
|
|
134
|
-
d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`.
|
|
135
|
-
e. If the
|
|
138
|
+
d. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. On a non-zero exit the sub is NOT done — re-spawn to close the gap, or pass `--force` only to deliberately override (records `evidence_status=overridden`, an audited override rather than a silent pass).
|
|
139
|
+
e. If the complete gate blocked: Bash `harnessed checkpoint fail <sub> --failing-tests <n>` to record the attempt (omit the flag when the sub has no tests — the evidence-artifact digest is the fallback progress metric). It prints `BUDGET-EXHAUSTED` (attempts spent vs `workflows/defaults.yaml ralph_max_iterations`), `NO-PROGRESS` (no improvement for N consecutive attempts) or `BREAK-LOOP` (this sub failed >= the threshold) once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope, fix the blocker, or escalate to the user, and report it.
|
|
136
140
|
6. After all fired subs are `done` (or recorded `failed`), Bash `harnessed status --recover` to confirm the ledger and report a per-sub fired/skipped/done/failed summary to the user. Then run the `retro` stage to capture lessons.
|
|
137
141
|
|
|
138
142
|
**If you lose context (compaction / resume):** run `harnessed status --recover` first — it reads the ledger and prints "you are here, this is next" so you resume at the first `pending` sub instead of restarting. If the ledger is empty, re-run steps 2-3.
|
|
139
143
|
|
|
140
|
-
<!-- harnessed-generated:v4.
|
|
144
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
141
145
|
|
|
142
146
|
## References
|
|
143
147
|
|
|
@@ -118,24 +118,28 @@ Sister `workflows/capabilities.yaml`:
|
|
|
118
118
|
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
119
119
|
|
|
120
120
|
1. 先在**本 session** 交互式跑 discuss 阶段(spawned subagent 无法向用户提问):对 "$ARGUMENTS" 评估 strategic / phase / subtask 澄清判据,对每个 fire 的层用 AskUserQuestion 与用户对话锁决策,其余透明 skip。blocking 集锁定后,把 deferrable 集以单轮批量 AskUserQuestion 转达给用户(各项 agent 推荐默认值预选)—— deferrable 推迟的是排期,不是用户决策权;仅当用户明确再次推迟才可跳过该项。产出 locked spec。
|
|
121
|
-
|
|
121
|
+
1b. Bash: `harnessed facts auto --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
122
|
+
2. Bash: `harnessed gates auto --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。自包含小任务(单文件/单页面级)的合规轻量路径:追加 `--skip-sub verify --skip-sub retro`(可重复/逗号分隔)——被 skip 的 sub 仍带原因进 ledger;lite ≠ freestyle(差别就在 ledger/evidence)。
|
|
122
123
|
3. Bash: `harnessed checkpoint start auto --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
123
|
-
4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team
|
|
124
|
-
-
|
|
125
|
-
- **headless 绝不 spawn team**:headless session(`claude -p`)下 `harnessed gates` 已返回 `escalate_to_teams: false`(Agent Teams 是 session-scoped —— `/resume` 即丢,与 `-p` 不兼容)。即使你认为能并行,headless 下也**不要**
|
|
124
|
+
4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team 驱动。**没有建团步骤、也没有建团工具** —— 对每个 fired sub 用 `Agent(name: <sub>, run_in_background: true, prompt: <该 sub 的 `harnessed prompt <sub>` prompt>)` spawn 一个后台 teammate,团在**第一个** spawn 时隐式形成,本 session 即 lead(`team_name` 入参被接受但忽略 —— 团名由 session 派生)。用 `SendMessage` 协调;某个 sub 完成后,**按名**请求该 teammate 关闭(例如「ask the verify-qa teammate to shut down」)。每个 sub 仍按下方 checkpoint(`complete` / `fail`)。
|
|
125
|
+
- **收尾前必须关闭每个 teammate —— finally 强制契约,非尽力而为**:无论是否每个 sub 都到达 COMPLETE、max_iterations 是否耗尽、或你是否认为工作已完成,收尾前都要**按名**请求每个 teammate 关闭,并确认它真的停了。关闭是**请求**:teammate 会先做完当前 tool call,也可能带理由拒绝 —— 所以要复查重发,不要假定。团目录在 session 退出时**自动**删除(没有 teardown 工具),但你没停掉的 teammate 会持续烧 token 并可能挂起宿主(headless 尤甚 —— issue #7:挂 11 小时,工作已完成但进程从不退出)。
|
|
126
|
+
- **headless 绝不 spawn team**:headless session(`claude -p`)下 `harnessed gates` 已返回 `escalate_to_teams: false`(Agent Teams 是 session-scoped —— `/resume` 即丢,与 `-p` 不兼容)。即使你认为能并行,headless 下也**不要** spawn teammate 或背景 `Agent` —— 改为在 session 内顺序驱动 fired subs。
|
|
126
127
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
127
|
-
- **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
|
|
128
|
+
- **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed facts <sub> --out .harnessed-facts.json`(填完 null)→ `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
|
|
128
129
|
- **否则(leaf sub):**
|
|
129
130
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
130
|
-
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
131
|
+
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
132
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
133
|
+
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
134
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
131
135
|
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
132
|
-
d. 命中 `<promise>COMPLETE</promise
|
|
133
|
-
e. 若
|
|
136
|
+
d. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。exit 非零即表示该 sub **未** done —— 重 spawn 补齐,或仅在刻意覆盖时传 `--force`(记录 `evidence_status=overridden`,是可审计的覆盖而非静默放行)。
|
|
137
|
+
e. 若 complete 闸门拦下:Bash `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试(该 sub 无测试时省略该 flag —— 回退用证据产物摘要作进展度量)。命中停机条件时它会打印 `BUDGET-EXHAUSTED`(已用尝试次数 vs `workflows/defaults.yaml ralph_max_iterations`)、`NO-PROGRESS`(连续 N 次无进展)或 `BREAK-LOOP`(该 sub 失败次数达阈值)。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
134
138
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。 然后跑 `retro` 阶段沉淀 lessons。
|
|
135
139
|
|
|
136
140
|
**若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
|
|
137
141
|
|
|
138
|
-
<!-- harnessed-generated:v4.
|
|
142
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
139
143
|
|
|
140
144
|
## 参考文档
|
|
141
145
|
|