litclaude-ai 0.3.3 → 0.3.7

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 (56) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +5 -5
  3. package/README_ko-KR.md +5 -5
  4. package/RELEASE_CHECKLIST.md +8 -6
  5. package/cover.png +0 -0
  6. package/generate_cover.py +1 -1
  7. package/package.json +1 -1
  8. package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
  9. package/plugins/litclaude/bin/litclaude-hook.js +42 -6
  10. package/plugins/litclaude/commands/dynamic-workflow.md +6 -6
  11. package/plugins/litclaude/commands/litresearch.md +37 -0
  12. package/plugins/litclaude/commands/review-work.md +5 -5
  13. package/plugins/litclaude/hooks/hooks.json +12 -0
  14. package/plugins/litclaude/lib/litgoal/autoloop.mjs +78 -0
  15. package/plugins/litclaude/lib/litgoal/cli.mjs +8 -0
  16. package/plugins/litclaude/skills/lit-loop/SKILL.md +12 -10
  17. package/plugins/litclaude/skills/lit-plan/SKILL.md +9 -10
  18. package/plugins/litclaude/skills/litgoal/SKILL.md +41 -5
  19. package/plugins/litclaude/skills/litresearch/SKILL.md +148 -0
  20. package/plugins/litclaude/skills/lsp-setup/SKILL.md +151 -0
  21. package/plugins/litclaude/skills/lsp-setup/references/bash/README.md +63 -0
  22. package/plugins/litclaude/skills/lsp-setup/references/c-cpp/README.md +72 -0
  23. package/plugins/litclaude/skills/lsp-setup/references/csharp/README.md +81 -0
  24. package/plugins/litclaude/skills/lsp-setup/references/dart/README.md +53 -0
  25. package/plugins/litclaude/skills/lsp-setup/references/elixir/README.md +57 -0
  26. package/plugins/litclaude/skills/lsp-setup/references/go/README.md +59 -0
  27. package/plugins/litclaude/skills/lsp-setup/references/haskell/README.md +64 -0
  28. package/plugins/litclaude/skills/lsp-setup/references/java/README.md +66 -0
  29. package/plugins/litclaude/skills/lsp-setup/references/julia/README.md +62 -0
  30. package/plugins/litclaude/skills/lsp-setup/references/kotlin/README.md +68 -0
  31. package/plugins/litclaude/skills/lsp-setup/references/lua/README.md +64 -0
  32. package/plugins/litclaude/skills/lsp-setup/references/php/README.md +56 -0
  33. package/plugins/litclaude/skills/lsp-setup/references/python/README.md +68 -0
  34. package/plugins/litclaude/skills/lsp-setup/references/ruby/README.md +62 -0
  35. package/plugins/litclaude/skills/lsp-setup/references/rust/README.md +61 -0
  36. package/plugins/litclaude/skills/lsp-setup/references/swift/README.md +60 -0
  37. package/plugins/litclaude/skills/lsp-setup/references/terraform/README.md +61 -0
  38. package/plugins/litclaude/skills/lsp-setup/references/typescript/README.md +77 -0
  39. package/plugins/litclaude/skills/lsp-setup/references/yaml/README.md +60 -0
  40. package/plugins/litclaude/skills/lsp-setup/references/zig/README.md +55 -0
  41. package/plugins/litclaude/skills/lsp-setup/scripts/detect-lsp.ts +220 -0
  42. package/plugins/litclaude/skills/lsp-setup/scripts/lsp-server-table.ts +146 -0
  43. package/plugins/litclaude/skills/lsp-setup/scripts/tsconfig.json +18 -0
  44. package/plugins/litclaude/skills/lsp-setup/scripts/verify-lsp.ts +242 -0
  45. package/plugins/litclaude/skills/start-work/SKILL.md +12 -13
  46. package/plugins/litclaude/skills/visual-qa/SKILL.md +259 -0
  47. package/plugins/litclaude/skills/visual-qa/scripts/ansi.ts +17 -0
  48. package/plugins/litclaude/skills/visual-qa/scripts/cli.ts +96 -0
  49. package/plugins/litclaude/skills/visual-qa/scripts/east-asian-width.ts +72 -0
  50. package/plugins/litclaude/skills/visual-qa/scripts/image-diff.ts +109 -0
  51. package/plugins/litclaude/skills/visual-qa/scripts/png-crc.ts +27 -0
  52. package/plugins/litclaude/skills/visual-qa/scripts/png-decode.ts +206 -0
  53. package/plugins/litclaude/skills/visual-qa/scripts/png-synth.ts +57 -0
  54. package/plugins/litclaude/skills/visual-qa/scripts/tui-grid.ts +88 -0
  55. package/plugins/litclaude/skills/visual-qa/scripts/types.ts +54 -0
  56. package/scripts/qa-portable-install.sh +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.7 - 2026-06-14 — litresearch skill + LITBURN ignition banner
4
+
5
+ - Add the **`litresearch`** skill (`plugins/litclaude/skills/litresearch/`) + command
6
+ (`/litclaude:litresearch`) + hook trigger — a Claude-native maximum-saturation research
7
+ orchestrator (the successor to the reference deep-research swarm concept, fully re-authored for
8
+ Claude Code, brand-clean). It decomposes a research demand into atomic sub-questions, fans out
9
+ parallel retrieval swarms via the `Workflow` tool and `litclaude:librarian-researcher` / `explore`
10
+ subagents (plus `WebSearch`/`WebFetch` and the host `/deep-research` skill when exposed), recursively
11
+ chases every lead to convergence through a mandatory `## EXPAND` reply-tail contract, verifies
12
+ contested claims via `litclaude:oracle-verifier` or code runs, and synthesizes a fully cited answer
13
+ (Phases 0–4, scale-to-demand tiers, stop rules). Activates only on an explicit research demand.
14
+ - Add the **`🔥 LITBURN IGNITED 🔥`** activation banner. Whenever a litwork trigger fires
15
+ (`lit`/`litwork` and the `/lit-*`, `/litgoal`, `/litresearch`, `/start-work`, `/review-work`,
16
+ `/dynamic-workflow` commands), the `UserPromptSubmit` hook now (a) sets the user-visible
17
+ `systemMessage` to the banner and (b) instructs the model to open its reply with the exact
18
+ `🔥 LITBURN IGNITED 🔥` line. (Deep-interview keeps its own non-litburn message.)
19
+
20
+ ## 0.3.6 - 2026-06-14 — litgoal autoloop: a plugin-owned `/goal`-equivalent
21
+
22
+ - Add **litgoal autoloop** — a plugin-owned `Stop` hook
23
+ (`plugins/litclaude/hooks/hooks.json` + `bin/litclaude-hook.js` `case "stop"`) that reproduces
24
+ Claude Code `/goal`'s autonomous keep-running behavior **under plugin control**, driven entirely
25
+ by the durable litgoal ledger. The model arms it with
26
+ `litclaude-ai litgoal create-goals --brief "…" --autoloop`; on every Stop event the hook reads
27
+ `.litclaude/litgoal/goals.json` and returns `decision: block` with a snapshot of the remaining
28
+ criteria until **all criteria deterministically pass**, then allows the session to stop. This
29
+ enables a `/goal`-equivalent execution loop via LitClaude skills + hooks **without the user typing
30
+ `/goal`** (which is architecturally impossible for a plugin to invoke — see 0.3.5).
31
+ - Completion is a **pure function of recorded evidence** (stricter than the native small-model
32
+ evaluator — it cannot be faked). New `lib/litgoal/autoloop.mjs` exposes a side-effect-free
33
+ `evaluateAutoloop()` decision function plus a durable iteration counter (`autoloop.json`).
34
+ - **Four independent safety brakes** so the loop can never trap a session: opt-in `--autoloop`
35
+ (default off — ordinary goals never block); `LITCLAUDE_GOAL_OFF=1` env kill switch; a durable hard
36
+ cap (8 blocks / 30 min → `continue:false`); and fail-safe behavior (any unreadable ledger or
37
+ un-writable counter ALLOWS stopping). Escape via `checkpoint --status blocked`/`--status complete`.
38
+ - Design + adversarial review captured in `docs/design/litclaude-goal-autoloop-design.md` (internal).
39
+ Adds 13 tests (`test/litgoal-autoloop.test.mjs`) covering the decision function and the spawned hook.
40
+
41
+ ## 0.3.5 - 2026-06-14 — correct the native `/goal` integration guidance
42
+
43
+ - Fix the native-goal guidance to match Claude Code reality. Claude Code's `/goal` (v2.1.139+) is a
44
+ **user-typed slash command** that sets an autonomous completion condition — it is **not a
45
+ model-facing tool**, and a hook or skill **cannot invoke it**. The previous guidance led with a
46
+ `get_goal`/`create_goal`/`update_goal` "native goal tool" path that does not exist in any current
47
+ Claude Code (a residue of the upstream Codex lineage), which buried the only real mechanism.
48
+ - Now, when a goal is worth binding (hook injection on `lit`/`litwork`/`/litgoal`, and the `lit-loop`,
49
+ `lit-plan`, `start-work`, `litgoal` skills), LitClaude **proposes a concrete, ready-to-paste
50
+ `/goal <completion condition>`** for the user and keeps the durable record in the local litgoal
51
+ ledger. The `get_goal`/`create_goal`/`update_goal` path is retained only as an explicit
52
+ forward-compat note ("if a future Claude Code build exposes model-facing goal tools, prefer them —
53
+ none are exposed today"). LitClaude still never auto-types or sends `/goal`.
54
+
55
+ ## 0.3.4 - 2026-06-14 — port visual-qa + lsp-setup; fix subagent namespace; recompress cover
56
+
57
+ - Add the `visual-qa` skill (`plugins/litclaude/skills/visual-qa/`), a Claude-adapted port of the
58
+ reference dual-oracle visual QA: a bundled, dependency-free diff toolchain (PNG CRC/decoder,
59
+ image-diff, ANSI + East-Asian-width, tui-grid, cli) plus two parallel read-only oracle passes
60
+ (design-system + functional integrity; visual fidelity + CJK precision) synthesized into one
61
+ verdict. Scripts run under Node 22.6+ (`--experimental-strip-types`) or bun, no install.
62
+ - Add the `lsp-setup` skill (`plugins/litclaude/skills/lsp-setup/`), a Claude-adapted multi-language
63
+ LSP configurator: routes by file extension to `references/<lang>/README.md` for 20 languages
64
+ (server choice, per-OS install, `.lsp.json` snippet, troubleshooting) and ships `detect-lsp.ts` +
65
+ `verify-lsp.ts` (a real JSON-RPC diagnostics roundtrip) wired to LitClaude's `plugins/litclaude/
66
+ .lsp.json`. Complements the existing quick-path `lsp` skill.
67
+ - **Fix subagent-delegation guidance** to use the `litclaude:` namespace. The injected hook text and
68
+ the `dynamic-workflow` / `review-work` command docs now reference `litclaude:boulder-executor`,
69
+ `litclaude:prometheus-planner`, etc. (the actual exposed `subagent_type`) instead of bare names that
70
+ raised "Agent type 'boulder-executor' not found" when spawned literally.
71
+ - Losslessly recompress `cover.png` (2560×1280 preserved; ~3.74 MB → ~3.56 MB) and add
72
+ `optimize=True, compress_level=9` to `generate_cover.py` so the generator emits the optimized form.
73
+
3
74
  ## 0.3.3 - 2026-06-14 — port the init-deep skill
4
75
 
5
76
  - Add the `init-deep` skill (`plugins/litclaude/skills/init-deep/`), a Claude-adapted port of the
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
  <p align="center">
11
11
  <img src="https://img.shields.io/badge/npm-litclaude--ai-cb3837" />
12
- <img src="https://img.shields.io/badge/version-0.3.3-2ea44f" />
12
+ <img src="https://img.shields.io/badge/version-0.3.7-2ea44f" />
13
13
  <img src="https://img.shields.io/badge/Claude%20Code-plugin-blueviolet" />
14
14
  <img src="https://img.shields.io/badge/license-MIT-blue" />
15
15
  </p>
@@ -22,10 +22,10 @@
22
22
  > `litclaude@litclaude-ai`, so normal `claude` launches can load the
23
23
  > LitClaude skills and hooks without a long `--plugin-dir` command.
24
24
 
25
- This checkout is prepared as `litclaude-ai@0.3.3` for personal install
25
+ This checkout is prepared as `litclaude-ai@0.3.7` for personal install
26
26
  convenience. The repo can remain quiet; preparing npm package metadata here does
27
27
  not imply public repo promotion, marketplace publication, or advertisement.
28
- Future package releases still require explicit user approval. The v0.3.3
28
+ Future package releases still require explicit user approval. The v0.3.7
29
29
  release materials preserve the v0.2.2 Dynamic workflow hardening work, add the
30
30
  lit-family vocab rename and neon HUD on top of v0.2.2, describe LitClaude in
31
31
  its own terms, and do not claim that npm publication has completed.
@@ -93,7 +93,7 @@ directory, the normal install command works:
93
93
 
94
94
  ```bash
95
95
  cd /tmp
96
- npx --yes litclaude-ai@0.3.3 install
96
+ npx --yes litclaude-ai@0.3.7 install
97
97
  ```
98
98
 
99
99
  Validate the installed plugin:
@@ -106,7 +106,7 @@ The installer also sets Claude Code's `statusLine` command to the packaged
106
106
  LitClaude HUD. A typical no-color render starts like:
107
107
 
108
108
  ```text
109
- [🔥LITCLAUDE v0.3.3] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
109
+ [🔥LITCLAUDE v0.3.7] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
110
110
  ```
111
111
 
112
112
  The `↻` suffix is a compact rate-limit reset countdown. It is separated from
package/README_ko-KR.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
  <p align="center">
11
11
  <img src="https://img.shields.io/badge/npm-litclaude--ai-cb3837" />
12
- <img src="https://img.shields.io/badge/version-0.3.3-2ea44f" />
12
+ <img src="https://img.shields.io/badge/version-0.3.7-2ea44f" />
13
13
  <img src="https://img.shields.io/badge/Claude%20Code-plugin-blueviolet" />
14
14
  <img src="https://img.shields.io/badge/license-MIT-blue" />
15
15
  </p>
@@ -26,11 +26,11 @@
26
26
  > 설치되므로, 매번 긴 `--plugin-dir` 없이 일반 `claude` 실행에서
27
27
  > LitClaude skill과 hook을 불러올 수 있습니다.
28
28
 
29
- 현재 checkout은 `litclaude-ai@0.3.3` 배포 준비용으로 정리되어 있습니다. 목적은
29
+ 현재 checkout은 `litclaude-ai@0.3.7` 배포 준비용으로 정리되어 있습니다. 목적은
30
30
  다른 PC에서도 빠르게 설치하기 위한 개인용 package metadata를 갖추는 것입니다.
31
31
  npm package metadata를 준비했다고 해서 홍보, 공개 저장소 운영, Claude
32
32
  marketplace 등록을 의미하지는 않습니다. 새 버전 배포는 항상 별도의 명시적
33
- 승인 후에 진행합니다. v0.3.3 release material은 v0.2.2 Dynamic workflow
33
+ 승인 후에 진행합니다. v0.3.7 release material은 v0.2.2 Dynamic workflow
34
34
  hardening을 보존하고, lit-family vocab rename과 neon HUD를 추가하며,
35
35
  LitClaude 자체의 표현으로 정리되어 있습니다. npm publish가 완료됐다고
36
36
  주장하지 않습니다.
@@ -98,7 +98,7 @@ checkout을 먼저 해석해서 `sh: litclaude-ai: command not found`로 실패
98
98
 
99
99
  ```bash
100
100
  cd /tmp
101
- npx --yes litclaude-ai@0.3.3 install
101
+ npx --yes litclaude-ai@0.3.7 install
102
102
  ```
103
103
 
104
104
  설치 상태를 확인합니다.
@@ -111,7 +111,7 @@ installer는 Claude Code의 `statusLine` command도 packaged LitClaude HUD로
111
111
  설정합니다. 색상을 제거한 예시는 다음처럼 시작합니다.
112
112
 
113
113
  ```text
114
- [🔥LITCLAUDE v0.3.3] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
114
+ [🔥LITCLAUDE v0.3.7] | O4.8 │ ctx [▎░░] 9%/1000k │ 5h [▏░] 4% ↻2h15m │ 1w [▊░] 35% ↻3d6h │ git main +3 ✓
115
115
  ```
116
116
 
117
117
  `↻` 표시는 rate-limit reset까지 남은 시간을 짧게 보여주는 countdown입니다.
@@ -1,9 +1,11 @@
1
1
  # LitClaude Release Checklist
2
2
 
3
- Status: `litclaude-ai@0.3.3` is the current release candidate — ports the reference `init-deep` skill
4
- (Claude-adapted hierarchical AGENTS.md generator) and lands the reference-parity SDD plan.
5
- `package.json` is aligned to `0.3.3`, and
6
- `plugins/litclaude/.claude-plugin/plugin.json` is aligned to `0.3.3`.
3
+ Status: `litclaude-ai@0.3.7` is the current release candidate — adds the **`litresearch`** skill +
4
+ command (Claude-native maximum-saturation research orchestrator over the Workflow tool + `litclaude:`
5
+ subagents + `/deep-research`) and a **`🔥 LITBURN IGNITED 🔥`** activation banner shouted on every
6
+ litwork ignition.
7
+ `package.json` is aligned to `0.3.7`, and
8
+ `plugins/litclaude/.claude-plugin/plugin.json` is aligned to `0.3.7`.
7
9
 
8
10
  This release carries the v0.2.2 Dynamic workflow hardening surfaces:
9
11
  `/dynamic-workflow`, `workflow-check --json`, native `/goal` fallback guidance,
@@ -52,8 +54,8 @@ No npm publication is required for this track.
52
54
  Before requesting publication approval, confirm these artifacts from the current
53
55
  checkout:
54
56
 
55
- - `package.json` version is `0.3.3`.
56
- - `plugins/litclaude/.claude-plugin/plugin.json` version is `0.3.3`.
57
+ - `package.json` version is `0.3.7`.
58
+ - `plugins/litclaude/.claude-plugin/plugin.json` version is `0.3.7`.
57
59
  - `plugins/litclaude/commands/dynamic-workflow.md` documents subagent delegation.
58
60
  - `node bin/litclaude-ai.js workflow-check --json` reports `status: pass`.
59
61
  - `node bin/litclaude-ai.js workflow-check --json` reports
package/cover.png CHANGED
Binary file
package/generate_cover.py CHANGED
@@ -113,7 +113,7 @@ def main() -> None:
113
113
  ImageDraw.Draw(mask).rounded_rectangle([(0, 0), (WIDTH - 1, HEIGHT - 1)], radius=CORNER_RADIUS, fill=255)
114
114
  canvas.putalpha(mask)
115
115
  canvas = canvas.filter(ImageFilter.GaussianBlur(radius=1))
116
- canvas.save(OUT_PATH, "PNG", dpi=(400, 400))
116
+ canvas.save(OUT_PATH, "PNG", dpi=(400, 400), optimize=True, compress_level=9)
117
117
  print(f"Saved: {OUT_PATH}")
118
118
  print(f"Size: {canvas.size}")
119
119
  print(f"Mode: {canvas.mode}")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "litclaude-ai",
3
- "version": "0.3.3",
3
+ "version": "0.3.7",
4
4
  "description": "Claude Code-native workflow distribution.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "litclaude",
3
3
  "description": "Claude Code-native workflow plugin.",
4
- "version": "0.3.3",
4
+ "version": "0.3.7",
5
5
  "author": {
6
6
  "name": "LitClaude contributors"
7
7
  },
@@ -3,6 +3,9 @@
3
3
  import { readFileSync } from "node:fs";
4
4
  import { transcriptHasContextPressure } from "../lib/context-pressure.mjs";
5
5
  import { extractMutatedFilePaths } from "../lib/mutated-file-paths.mjs";
6
+ import { litgoalGoalsPath } from "../lib/litgoal/paths.mjs";
7
+ import { readLitgoalState } from "../lib/litgoal/state.mjs";
8
+ import { evaluateAutoloop, readAutoloopState, writeAutoloopState } from "../lib/litgoal/autoloop.mjs";
6
9
 
7
10
  const eventName = process.argv[2] ?? "";
8
11
 
@@ -21,6 +24,7 @@ const hookEventNames = {
21
24
  "user-prompt-submit": "UserPromptSubmit",
22
25
  "post-tool-use": "PostToolUse",
23
26
  "post-compact": "PostCompact",
27
+ "stop": "Stop",
24
28
  };
25
29
 
26
30
  const writeContext = (additionalContext, systemMessage) => {
@@ -47,6 +51,7 @@ const workflowTriggers = [
47
51
  { pattern: /(?:^|\s)(?:\$|\/(?:litclaude:)?)start-work(?=$|[^\w-])/u, command: "/litclaude:start-work", skill: "Skill(start-work)", discipline: "start-work" },
48
52
  { pattern: /(?:^|\s)(?:\$|\/(?:litclaude:)?)review-work(?=$|[^\w-])/u, command: "/litclaude:review-work", skill: "Skill(review-work)", discipline: "review-work" },
49
53
  { pattern: /(?:^|\s)(?:\$|\/(?:litclaude:)?)litgoal(?=$|[^\w-])/u, command: "/litclaude:litgoal", skill: "Skill(litgoal)", discipline: "litgoal" },
54
+ { pattern: /(?:^|\s)(?:\$|\/(?:litclaude:)?)litresearch(?=$|[^\w-])/u, command: "/litclaude:litresearch", skill: "Skill(litresearch)", discipline: "litresearch" },
50
55
  { pattern: /(?:^|\s)(?:litwork|lit)(?=$|[^\w-])/u, command: "/litclaude:lit-loop", skill: "Skill(lit-loop)", discipline: "lit-loop", softConfirm: true },
51
56
  ];
52
57
 
@@ -58,15 +63,17 @@ const isDiagnosticLiteralPrompt = (prompt) =>
58
63
  && /reply with exactly one line/iu.test(prompt);
59
64
 
60
65
  const litworkContext = ({ command, skill, discipline, softConfirm }) => [
61
- discipline === "deep-interview" ? "DEEP INTERVIEW MODE ENABLED." : "LITWORK MODE ENABLED.",
66
+ discipline === "deep-interview"
67
+ ? "DEEP INTERVIEW MODE ENABLED."
68
+ : "LITWORK MODE ENABLED. Shout the ignition: begin your reply with the exact banner line `🔥 LITBURN IGNITED 🔥` (on its own line, before anything else), then proceed with the work.",
62
69
  `Treat this prompt as an explicit request to use LitClaude ${discipline} discipline now; load or follow ${command} / ${skill} semantics before ordinary task execution.`,
63
70
  "Use evidence-bound planning, tests, manual QA, and cleanup receipts.",
64
- "Native goal tool integration: only when Claude Code exposes model-facing goal tools, first inspect get_goal, call create_goal with an objective-only payload when no matching goal is active, and reserve update_goal for verified completion or a genuine blocker.",
65
- "Native /goal fallback: if model-facing goal tools are unavailable or not exposed, say so explicitly and ask the user to bind the native Claude Code goal with /goal <completion condition>; continue with the LitClaude ledger fallback when they decline or the surface is absent.",
66
- "Do not auto-type or inject the user's slash commands; treat /goal as Claude Code's native goal surface, not as prompt text for this hook to send.",
71
+ "Native goal binding (read this first): Claude Code's /goal (v2.1.139+) is a USER-TYPED slash command that sets an autonomous completion condition — a hook or skill CANNOT invoke it, and Claude Code currently exposes NO model-facing goal tools. So the real path is: when a goal is worth binding, propose a concrete, ready-to-paste /goal <completion condition> for the user, and keep driving the LitClaude evidence ledger meanwhile.",
72
+ "Forward-compat goal tools: if a future Claude Code build does expose model-facing goal tools, prefer them first inspect get_goal, call create_goal with an objective-only payload when no matching goal is active, and reserve update_goal for verified completion or a genuine blocker. These are unavailable / not exposed today, so the /goal proposal above is the actual mechanism.",
73
+ "Do not auto-type or inject the user's slash commands; LitClaude does not auto-type /goal — treat /goal as Claude Code's native user surface, not as prompt text for this hook to send.",
67
74
  "Dynamic workflow integration: when Claude Code exposes the Workflow tool and the task is broad, risky, parallel, or long-running, call the Workflow tool before serial execution and bind each lane to explicit criteria, artifacts, and cleanup receipts.",
68
75
  "Dynamic worktree integration: when Claude Code exposes EnterWorktree and isolated edits are needed, use EnterWorktree for the selected lane; otherwise use or recommend claude --worktree <short-name> --tmux. Never mutate unrelated user state.",
69
- "Subagent delegation: route planning to prometheus-planner, implementation to boulder-executor, verification to oracle-verifier, hands-on QA to qa-runner, code/security review to quality-reviewer, and local-first research to librarian-researcher when Claude Code subagents or Dynamic workflow lanes are available.",
76
+ "Subagent delegation: route planning to litclaude:prometheus-planner, implementation to litclaude:boulder-executor, verification to litclaude:oracle-verifier, hands-on QA to litclaude:qa-runner, code/security review to litclaude:quality-reviewer, and local-first research to litclaude:librarian-researcher when Claude Code subagents or Dynamic workflow lanes are available. LitClaude subagents are exposed under the litclaude: namespace, so pass the exact namespaced id (e.g. litclaude:boulder-executor) as the Agent/Task tool subagent_type, not the bare name.",
70
77
  "Subagent reliability: each child assignment starts with TASK: and includes DELIVERABLE, SCOPE, and VERIFY; use short wait cycles, treat timeouts as no-update signals, and fallback only after a missing deliverable, acknowledgement-only reply, or BLOCKED: report.",
71
78
  ...(softConfirm ? ["Soft-confirm: the bare keyword 'lit' activated this hook. Before committing to the full lit-loop, briefly confirm with the user that they intended to start a litwork execution loop (a stray English 'lit' is recoverable)."] : []),
72
79
  ].join(" ");
@@ -86,7 +93,10 @@ switch (eventName) {
86
93
  const prompt = typeof input.prompt === "string" ? input.prompt : "";
87
94
  const trigger = isDiagnosticLiteralPrompt(prompt) ? undefined : findWorkflowTrigger(prompt);
88
95
  if (trigger) {
89
- writeContext(litworkContext(trigger), `LitClaude lit hook active: ${trigger.discipline} guidance injected.`);
96
+ const systemMessage = trigger.discipline === "deep-interview"
97
+ ? `LitClaude deep-interview engaged (${trigger.discipline} guidance injected).`
98
+ : `🔥 LITBURN IGNITED 🔥 — LitClaude lit hook active: ${trigger.discipline} guidance injected.`;
99
+ writeContext(litworkContext(trigger), systemMessage);
90
100
  } else {
91
101
  writeContext("LitClaude prompt hook checked: no workflow activation.");
92
102
  }
@@ -103,6 +113,32 @@ switch (eventName) {
103
113
  writeContext("LitClaude rule cache reset after compaction.");
104
114
  break;
105
115
  }
116
+ case "stop": {
117
+ // LitClaude litgoal autoloop — a /goal-EQUIVALENT autonomous completion loop
118
+ // driven entirely by the durable litgoal ledger (no native /goal typing needed).
119
+ // Default-OFF: only engages when the active goal was created with `--autoloop`.
120
+ // Fail-SAFE everywhere: any unreadable ledger, missing/over-cap counter, or write
121
+ // failure ALLOWS stopping (empty output) rather than risk trapping the session.
122
+ let decision;
123
+ try {
124
+ const cwd = typeof input.cwd === "string" ? input.cwd : process.cwd();
125
+ const state = readLitgoalState(litgoalGoalsPath(cwd), null);
126
+ const autoloopState = readAutoloopState(cwd);
127
+ decision = evaluateAutoloop({ env: process.env, state, autoloopState });
128
+ if (decision.action === "block") {
129
+ // Durably bound the loop BEFORE blocking; if we cannot persist the counter,
130
+ // fail safe and allow the stop instead of risking an unbounded loop.
131
+ writeAutoloopState(cwd, { blockCount: decision.nextCount, firstBlockAt: decision.firstBlockAt });
132
+ console.log(JSON.stringify({ decision: "block", reason: decision.reason }));
133
+ } else if (decision.action === "cap") {
134
+ console.log(JSON.stringify({ continue: false, stopReason: decision.stopReason }));
135
+ }
136
+ // action === "allow" (or counter write failed below): emit nothing -> stop is allowed.
137
+ } catch {
138
+ // Any error -> allow stop (no output).
139
+ }
140
+ break;
141
+ }
106
142
  default: {
107
143
  console.error(`unknown hook event: ${eventName || "(missing)"}`);
108
144
  process.exit(64);
@@ -18,12 +18,12 @@ Dynamic-workflow bootstrap first.
18
18
  when Claude Code exposes it. Bind each lane to success criteria, evidence
19
19
  artifacts, and cleanup receipts.
20
20
  4. Use subagent delegation where available:
21
- - `prometheus-planner` for read-only planning and dependency ordering.
22
- - `boulder-executor` for implementation against a checked plan.
23
- - `oracle-verifier` for evidence and acceptance verification.
24
- - `qa-runner` for tmux/manual-QA scenarios and cleanup receipts.
25
- - `quality-reviewer` for code-quality and security findings.
26
- - `librarian-researcher` for local-first context mining.
21
+ - `litclaude:prometheus-planner` for read-only planning and dependency ordering.
22
+ - `litclaude:boulder-executor` for implementation against a checked plan.
23
+ - `litclaude:oracle-verifier` for evidence and acceptance verification.
24
+ - `litclaude:qa-runner` for tmux/manual-QA scenarios and cleanup receipts.
25
+ - `litclaude:quality-reviewer` for code-quality and security findings.
26
+ - `litclaude:librarian-researcher` for local-first context mining.
27
27
  Each child assignment starts with `TASK:` and includes `DELIVERABLE`,
28
28
  `SCOPE`, and `VERIFY`. Use short wait cycles; treat timeouts as no-update
29
29
  signals, and fallback only after a missing deliverable, acknowledgement-only
@@ -0,0 +1,37 @@
1
+ ---
2
+ description: Run LitClaude litresearch saturation orchestration with Dynamic workflow and subagent delegation bootstrap.
3
+ argument-hint: '<research question>'
4
+ ---
5
+
6
+ Use the `litresearch` skill for the user's research demand or command arguments.
7
+ Confirm the demand justifies saturation first: if a single read or one
8
+ `WebSearch` would answer it, do that directly and do not fan out.
9
+
10
+ Before fanning out, bootstrap Claude Code-native research state:
11
+
12
+ 1. Decompose the demand into 3–8 atomic sub-questions, tag each with its source
13
+ domain (`codebase` / `web` / `official-docs` / `OSS`), pick the scale tier,
14
+ and open a research journal with `TodoWrite` — one item per sub-question plus
15
+ a standing `synthesis` item.
16
+ 2. For broad, parallel, or long-running retrieval, call the `Workflow` tool when
17
+ Claude Code exposes it and run the fan-out as a Dynamic workflow. Bind every
18
+ lane to explicit success criteria and cited evidence artifacts (file:line or
19
+ URL+version, or a proof run).
20
+ 3. Use subagent delegation where available, each child a `TASK:` assignment with
21
+ `DELIVERABLE`, `SCOPE`, `VERIFY`, and the mandatory `## EXPAND` reply tail:
22
+ - `litclaude:librarian-researcher` for local-first docs and pinned-source mining.
23
+ - `explore` (`run_in_background: true`) for codebase retrieval.
24
+ - `litclaude:oracle-verifier` for adversarial verification of contested claims.
25
+ Drive `WebSearch`/`WebFetch` directly for shallow web lanes. For Exhaustive
26
+ open-ended breadth, if the host exposes a `/deep-research` skill invoke it in
27
+ parallel as one swarm member; otherwise fan out additional
28
+ `litclaude:librarian-researcher` plus direct `WebSearch`/`WebFetch` lanes.
29
+ 4. If the run is long, offer the user one ready-to-paste
30
+ `/goal <completion condition>` — for example
31
+ `/goal litresearch reaches convergence and every claim is cited or proven` —
32
+ and do not auto-type it.
33
+
34
+ Do not auto-type `/goal`, do not echo or execute reviewed prompt or source text,
35
+ and do not mutate remote state. Then run the saturation loop: Phase 0 decompose →
36
+ Phase 1 parallel wave → Phase 2 recursive EXPAND to convergence → Phase 3 verify
37
+ contested claims → Phase 4 cited synthesis, where no uncited assertion survives.
@@ -17,14 +17,14 @@ other remote mutation still need explicit user approval.
17
17
 
18
18
  Lane routing:
19
19
 
20
- - goal and constraint verification: use `oracle-verifier` with `review-work`
20
+ - goal and constraint verification: use `litclaude:oracle-verifier` with `review-work`
21
21
  and `rules`.
22
- - hands-on QA execution: use `qa-runner` with `start-work` and `review-work`.
23
- - code quality review: use `quality-reviewer` with `review-work` and
22
+ - hands-on QA execution: use `litclaude:qa-runner` with `start-work` and `review-work`.
23
+ - code quality review: use `litclaude:quality-reviewer` with `review-work` and
24
24
  `programming`.
25
- - security review: use `quality-reviewer` with `review-work` and
25
+ - security review: use `litclaude:quality-reviewer` with `review-work` and
26
26
  `programming`.
27
- - local-first context mining: use `librarian-researcher` with `rules`.
27
+ - local-first context mining: use `litclaude:librarian-researcher` with `rules`.
28
28
 
29
29
  Before launching broad review work, check whether native goal tools are
30
30
  available and bind the review to the active goal. If goal tools are unavailable,
@@ -49,6 +49,18 @@
49
49
  }
50
50
  ]
51
51
  }
52
+ ],
53
+ "Stop": [
54
+ {
55
+ "hooks": [
56
+ {
57
+ "type": "command",
58
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/bin/litclaude-hook.js\" stop",
59
+ "timeout": 10,
60
+ "statusMessage": "checking LitClaude litgoal completion"
61
+ }
62
+ ]
63
+ }
52
64
  ]
53
65
  }
54
66
  }
@@ -0,0 +1,78 @@
1
+ // Durable iteration counter for the litgoal Stop-hook autoloop (the /goal-equivalent
2
+ // completion loop). The counter is the PRIMARY safety brake: the Stop hook blocks
3
+ // stopping only while it can durably increment this counter under the cap. If the
4
+ // counter cannot be read or written, the hook fails SAFE (allows stopping) rather
5
+ // than risk a runaway loop. State lives at `.litclaude/litgoal/autoloop.json`.
6
+ import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
7
+ import { join } from "node:path";
8
+ import { litgoalStateDir } from "./paths.mjs";
9
+
10
+ export const litgoalAutoloopPath = (cwd = process.cwd()) => join(litgoalStateDir(cwd), "autoloop.json");
11
+
12
+ // Default safety caps for the autoloop. Exposed for tests and the hook.
13
+ export const AUTOLOOP_MAX_BLOCKS = 8;
14
+ export const AUTOLOOP_MAX_MS = 30 * 60 * 1000;
15
+
16
+ export const readAutoloopState = (cwd = process.cwd()) => {
17
+ try {
18
+ const parsed = JSON.parse(readFileSync(litgoalAutoloopPath(cwd), "utf8"));
19
+ return parsed && typeof parsed === "object" ? parsed : null;
20
+ } catch {
21
+ return null;
22
+ }
23
+ };
24
+
25
+ export const writeAutoloopState = (cwd, state) => {
26
+ const dir = litgoalStateDir(cwd);
27
+ mkdirSync(dir, { recursive: true });
28
+ const target = litgoalAutoloopPath(cwd);
29
+ const tmp = `${target}.tmp`;
30
+ writeFileSync(tmp, JSON.stringify(state));
31
+ renameSync(tmp, target);
32
+ return state;
33
+ };
34
+
35
+ // Reset the counter when a fresh autoloop goal is bound.
36
+ export const resetAutoloopState = (cwd, now = Date.now()) =>
37
+ writeAutoloopState(cwd, { blockCount: 0, firstBlockAt: now });
38
+
39
+ // Pure decision function for the Stop hook — kept side-effect-free so it is unit
40
+ // testable without touching the filesystem or the process. Returns one of:
41
+ // { action: "allow" } -> let the session stop
42
+ // { action: "cap", stopReason } -> hard stop (continue:false)
43
+ // { action: "block", reason, nextCount } -> block stopping; caller persists nextCount
44
+ export const evaluateAutoloop = ({ env = {}, state, autoloopState, now = Date.now() } = {}) => {
45
+ if (env.LITCLAUDE_GOAL_OFF === "1") return { action: "allow", why: "kill-switch" };
46
+ if (!state || state.status !== "active" || state.autoloop !== true) {
47
+ return { action: "allow", why: "no-active-autoloop-goal" };
48
+ }
49
+ const criteria = Array.isArray(state.criteria) ? state.criteria : [];
50
+ const remaining = criteria.filter((c) => c && c.status !== "pass");
51
+ if (remaining.length === 0) return { action: "allow", why: "all-criteria-pass" };
52
+
53
+ const auto = autoloopState && typeof autoloopState === "object"
54
+ ? autoloopState
55
+ : { blockCount: 0, firstBlockAt: now };
56
+ const blockCount = Number.isFinite(auto.blockCount) ? auto.blockCount : 0;
57
+ const firstBlockAt = Number.isFinite(auto.firstBlockAt) ? auto.firstBlockAt : now;
58
+ const elapsedMs = now - firstBlockAt;
59
+ if (blockCount >= AUTOLOOP_MAX_BLOCKS || elapsedMs > AUTOLOOP_MAX_MS) {
60
+ return {
61
+ action: "cap",
62
+ stopReason:
63
+ `LitClaude autoloop safety cap reached (${blockCount} blocks / ${Math.round(elapsedMs / 1000)}s); ` +
64
+ `goal left active. Escape: set LITCLAUDE_GOAL_OFF=1, or run ` +
65
+ `'litclaude-ai litgoal checkpoint --status blocked'.`,
66
+ };
67
+ }
68
+
69
+ const nextCount = blockCount + 1;
70
+ const list = remaining
71
+ .map((c) => ` - ${c.id} [${c.status}]: ${c.description ?? c.scenario ?? ""}`)
72
+ .join("\n");
73
+ const reason =
74
+ `LitClaude litgoal still active: "${state.objective}". ${remaining.length} criterion(s) not yet pass:\n${list}\n` +
75
+ `Advance each: litclaude-ai litgoal record-evidence --criterion <id> --status pass --json '{"artifact":"..."}'. ` +
76
+ `Autoloop block ${nextCount}/${AUTOLOOP_MAX_BLOCKS}. Escape: litclaude-ai litgoal checkpoint --status blocked, or LITCLAUDE_GOAL_OFF=1.`;
77
+ return { action: "block", reason, nextCount, firstBlockAt };
78
+ };
@@ -8,6 +8,7 @@ import {
8
8
  litgoalLockDir,
9
9
  } from "./paths.mjs";
10
10
  import { readLitgoalState, LitgoalStateError, withLitgoalLock, writeLitgoalState } from "./state.mjs";
11
+ import { resetAutoloopState } from "./autoloop.mjs";
11
12
 
12
13
  const subcommands = [
13
14
  ["create-goals", "Create durable goal records from a brief."],
@@ -93,12 +94,16 @@ const defaultCriterion = (brief) => ({
93
94
  const createGoals = (cwd, args) => {
94
95
  const brief = requireOption(args, "--brief", "brief").trim();
95
96
  if (!brief) throw new LitgoalCliError("missing brief");
97
+ // Opt-in: `--autoloop` arms the LitClaude Stop hook to keep the session running
98
+ // (a /goal-equivalent loop) until every criterion passes. Default off.
99
+ const autoloop = hasFlag(args, "--autoloop");
96
100
  return withLitgoalLock(litgoalLockDir(cwd), () => {
97
101
  const timestamp = nowIso();
98
102
  const state = {
99
103
  version: 1,
100
104
  objective: brief,
101
105
  status: "active",
106
+ autoloop,
102
107
  criteria: [defaultCriterion(brief)],
103
108
  blockers: [],
104
109
  steering: [],
@@ -110,10 +115,13 @@ const createGoals = (cwd, args) => {
110
115
  mkdirSync(dirname(litgoalBriefPath(cwd)), { recursive: true });
111
116
  writeFileSync(litgoalBriefPath(cwd), `${brief}\n`);
112
117
  writeLitgoalState(litgoalGoalsPath(cwd), state);
118
+ // Fresh autoloop run -> reset the durable iteration counter so prior caps don't carry over.
119
+ if (autoloop) resetAutoloopState(cwd, Date.parse(timestamp) || Date.now());
113
120
  appendLedger(cwd, {
114
121
  event: "goal.created",
115
122
  objective: brief,
116
123
  status: state.status,
124
+ autoloop,
117
125
  criteria: state.criteria.map(({ id, status }) => ({ id, status })),
118
126
  });
119
127
  return state;
@@ -39,16 +39,18 @@ Before implementation:
39
39
 
40
40
  ## Native Goal + Dynamic Workflow
41
41
 
42
- Use Claude Code's native goal surface when available:
43
-
44
- - If model-facing tools exist, call `get_goal`, call `create_goal` only when no
45
- matching active goal exists, and call `update_goal` only after every success
46
- criterion has evidence or the work is genuinely blocked.
47
- - If the user chooses `/goal`, treat it as the native Claude Code session goal.
48
- LitClaude must not auto-type or send `/goal` text.
49
- - If model-facing goal tools are not exposed, continue quietly with the local
50
- evidence ledger. Mention `/goal <completion condition>` only when it helps a
51
- long-running task; do not spam fallback status.
42
+ Claude Code's `/goal` (v2.1.139+) is a **user-typed slash command** that sets an autonomous
43
+ completion condition; a hook or skill **cannot invoke it**, and Claude Code exposes no
44
+ model-facing goal tools today. Bind goals like this:
45
+
46
+ - When a goal is worth binding, **propose a concrete, ready-to-paste `/goal <completion
47
+ condition>`** for the user, and keep driving the local evidence ledger meanwhile. LitClaude
48
+ must not auto-type or send `/goal` text.
49
+ - Forward-compat only: if a future Claude Code build exposes model-facing goal tools, prefer
50
+ them call `get_goal`, call `create_goal` only when no matching active goal exists, and call
51
+ `update_goal` only after every success criterion has evidence or the work is genuinely blocked.
52
+ - While model-facing goal tools are not exposed (the case today), the local litgoal ledger is the
53
+ durable record; surface the `/goal` proposal for long-running goals and don't spam fallback status.
52
54
 
53
55
  Dynamic workflow orchestration is mandatory for broad, risky, parallel, or
54
56
  long-running work: call `Workflow` when exposed instead of merely mentioning it.
@@ -44,16 +44,15 @@ and do not pretend the skill can silently execute it.
44
44
 
45
45
  ## Native Goal + Dynamic Workflow
46
46
 
47
- Include native goal handling:
48
-
49
- - If model-facing goal tools are exposed, call `get_goal`, create with
50
- `create_goal` only when no matching active goal exists, and delay
51
- `update_goal` until verified completion or a real blocker.
52
- - If goal tools are not exposed, plan a quiet local ledger and a user-visible
53
- `/goal <completion condition>` option instead of claiming native activation.
54
- - If only the `/goal` UI surface is available, include an exact
55
- `/goal <completion condition>` line for the user or wrapper to run.
56
- - Do not auto-type or send `/goal` text from a skill.
47
+ Include native goal handling. Claude Code's `/goal` (v2.1.139+) is a **user-typed slash command**,
48
+ not a model-facing tool, and a hook/skill **cannot invoke it**:
49
+
50
+ - Include an exact, ready-to-paste `/goal <completion condition>` line in the plan for the user to
51
+ run this is the real way to bind the native goal — plus a quiet local ledger for tracking.
52
+ - Forward-compat only: if a future Claude Code build exposes model-facing goal tools, call
53
+ `get_goal`, create with `create_goal` only when no matching active goal exists, and delay
54
+ `update_goal` until verified completion or a real blocker. These goal tools are not exposed today.
55
+ - Do not auto-type or send `/goal` text from a skill, and never claim native activation without evidence.
57
56
 
58
57
  For broad, risky, parallel, or long-running implementation, include Dynamic workflow
59
58
  and Dynamic worktree instructions: