@dzhechkov/harness-cli 0.3.202 → 0.3.203

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 (2) hide show
  1. package/README.md +37 -0
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -582,6 +582,43 @@ worth asking for explicitly: **do not silence a finding by deleting the number**
582
582
  reproduce should be removed or downgraded, not hidden), and **do not weaken the rules** to make the
583
583
  gate green.
584
584
 
585
+ #### Authoring-time hook — catch a claim WHEN IT IS WRITTEN
586
+
587
+ The CLI and the `dz publish` gate both fire *after* a false claim is already on disk. The
588
+ authoring-time hook closes that gap: it is a Claude Code **`PreToolUse` hook** that runs the same
589
+ `claimCheck` engine over the Markdown text an agent is *about to write*, **before the `Write`/`Edit`
590
+ lands**, and surfaces the findings to the agent so it can self-correct in the same turn.
591
+
592
+ - **Scope.** It runs only on `Write` / `Edit` / `MultiEdit` whose `file_path` ends in `.md`.
593
+ Everything else exits immediately at zero cost.
594
+ - **Severity policy.** `medium` findings (untagged counts — the exact failure class the publish
595
+ gate misses, because publish defaults to `--fail-on high`) are surfaced as a **warning** the agent
596
+ sees; they never block. `high` findings (the `100%` / `perfect` framing) warn **loudly** — and the
597
+ message always teaches the escape below — but **do not block by default**.
598
+ - **Never blocks.** A broken, slow, or misfed hook can never stop you working: malformed input, a
599
+ missing field, an unresolvable engine, or any exception all resolve to a silent no-op. The default
600
+ policy has no code path that denies a write.
601
+ - **Opt-in strict mode.** Set `DZ_CLAIM_CHECK_HOOK=deny` to let a `high` finding actually block a
602
+ write — but even then it is doubly guarded: it fires only on a **new** claim line that is **not**
603
+ inside a fenced code block, so editing around pre-existing text is never blocked.
604
+
605
+ **The backtick escape (important when you write docs about honesty).** Honest documentation
606
+ sometimes has to *quote* a forbidden claim as an example of what not to write — this very section
607
+ does. Wrap the literal in backticks: a backticked `` `100% coverage` `` reads as a code literal, not
608
+ an assertion, and is not flagged. That is the sanctioned fix; **do not weaken the checker** to quiet
609
+ a quotation.
610
+
611
+ **Enable / disable.** The hook is wired via one additive `PreToolUse` group in
612
+ `.claude/settings.json` (command: `node ".../.claude/helpers/claim-check-hook.cjs"`). Remove that
613
+ group to disable it. It is also inert automatically if `@dzhechkov/harness-core` cannot be resolved,
614
+ so it never breaks a checkout that hasn't built the package.
615
+
616
+ > **Plain-language scenario.** You ask Claude to write this package's README and it drafts a line
617
+ > asserting a bare `100% coverage` claim. Before the `Write` lands, the hook runs `claimCheck` and
618
+ > you see a warning: this is the retracted all-passing framing — either state a `MEASURED` number
619
+ > against a baseline (naming a reproducer like `npx vitest run`), or, if you are only quoting it as
620
+ > an example, backtick the literal. Claude backticks it and the write proceeds — no block, no thrash.
621
+
585
622
  #### In CI
586
623
 
587
624
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/harness-cli",
3
- "version": "0.3.202",
3
+ "version": "0.3.203",
4
4
  "description": "The dz CLI — install AI skills for Claude Code, Codex, OpenCode, Hermes, OpenClaude, GitHub Copilot. 35 commands, 13 presets, 6 platform targets.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@
54
54
  "@dzhechkov/skills-reverse-engineering": "^0.1.0",
55
55
  "@dzhechkov/skills-presentation-storyteller": "^0.1.0",
56
56
  "@dzhechkov/skills-website-cloner": "^0.1.0",
57
- "@dzhechkov/harness-core": "0.3.101"
57
+ "@dzhechkov/harness-core": "0.3.102"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^25.6.0",