luciazero 2.0.2 → 2.1.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/CHANGELOG.md +30 -0
- package/README.md +20 -11
- package/README.th.md +19 -11
- package/agents/reviewer.md +49 -0
- package/bin/discipline-report.js +35 -0
- package/claude/hooks/hooks.json +36 -0
- package/claude/hooks/luciazero-statusline.sh +17 -2
- package/claude/hooks/luciazero-verify.sh +157 -18
- package/claude/luciazero.md +2 -2
- package/install-codex.sh +6 -2
- package/install.sh +17 -7
- package/package.json +3 -2
- package/skills/aliases.txt +2 -0
- package/skills/catalog.txt +2 -1
- package/skills/debug/SKILL.md +1 -1
- package/skills/discipline-report/SKILL.md +3 -1
- package/skills/done/SKILL.md +1 -1
- package/skills/done/scripts/revert-probe.sh +1 -1
- package/skills/luciazero-bootstrap/SKILL.md +5 -104
- package/skills/plan/SKILL.md +1 -1
- package/skills/ready/SKILL.md +109 -0
- package/skills/{luciazero-bootstrap → ready}/scripts/detect.sh +1 -1
- package/skills/show/SKILL.md +133 -0
- package/skills/show/agents/openai.yaml +4 -0
- package/uninstall-codex.sh +5 -1
- package/uninstall.sh +6 -2
- /package/skills/{luciazero-bootstrap → ready}/references/smart-verification.md +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ready
|
|
3
|
+
description: Make a repository agentic-ready so an agent can run its own plan→change→verify→fix loop without a human checking each step. Use when entering an unfamiliar repo, when the user asks to "set up agentic engineering", "make this repo agent-friendly", "add a verify command", "add smoke tests so you can check your own work", "set up hooks/CLAUDE.md/allowlist" — or when a change was requested but no automated way exists to prove it works.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ready
|
|
7
|
+
|
|
8
|
+
Goal: leave the repo with **one command that returns an exit code** and enough guardrails that future agent work self-verifies. Nothing here is language-specific — detect, don't assume.
|
|
9
|
+
|
|
10
|
+
Bootstrapping is itself work: verify each artifact you add actually runs before reporting it.
|
|
11
|
+
|
|
12
|
+
## Phase 1 — Detect (never assume)
|
|
13
|
+
|
|
14
|
+
Run the bundled evidence scan first — it replaces a dozen manual reads with one call:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
<this-skill-dir>/scripts/detect.sh <repo-root>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
(The skill directory is wherever this SKILL.md lives, e.g. `~/.claude/skills/ready/` or `~/.codex/skills/ready/`.) The script surfaces candidates — **you still decide**. It cannot parse CI matrices or exotic build systems; open anything it flags and read the CI config yourself.
|
|
21
|
+
|
|
22
|
+
Sources, in order of trust:
|
|
23
|
+
|
|
24
|
+
1. CI config — the most honest source of truth: `.github/workflows/*`, `.gitlab-ci.yml`, `.circleci/`. **Whatever CI runs is the verify command.**
|
|
25
|
+
2. Manifests: `package.json` scripts, `pyproject.toml` / `tox.ini` / `noxfile.py`, `Makefile`, `justfile`, `Cargo.toml`, `go.mod`, `build.gradle`, `composer.json`
|
|
26
|
+
3. Repo docs: `README*`, `CONTRIBUTING*`, `AGENTS.md`, `CLAUDE.md`, `docs/` — docs go stale; cross-check any doc-claimed command against CI when CI exists. A docs/CI mismatch is itself a finding to record in Phase 5.
|
|
27
|
+
4. Existing test dirs: `tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `test_*.*`
|
|
28
|
+
|
|
29
|
+
Report what was found as a short table: run / test / lint / typecheck / build / git repo — command or `MISSING`.
|
|
30
|
+
|
|
31
|
+
**If the directory is not under version control**, propose `git init` early (ask first — some dirs are deliberately not repos): without git there is no smallest reversible step, no safe break-and-restore in Phase 6, and no bisect.
|
|
32
|
+
|
|
33
|
+
## Phase 2 — Establish the verify command
|
|
34
|
+
|
|
35
|
+
If a verify path exists, **use it** — do not invent a parallel one.
|
|
36
|
+
|
|
37
|
+
If none exists, create the smallest real one. Order of preference:
|
|
38
|
+
|
|
39
|
+
1. The project's native runner, already installed (`pytest`, `vitest`, `go test`, `cargo test`, `dotnet test`)
|
|
40
|
+
2. A single entrypoint that chains them, matching the repo's existing convention (`Makefile` target, `package.json` script, `justfile` recipe) — e.g. `make verify` running lint then tests
|
|
41
|
+
|
|
42
|
+
Rules:
|
|
43
|
+
- Must exit non-zero on failure. A script that always exits 0 is worse than nothing.
|
|
44
|
+
- Must run to completion unattended: disable watch/interactive modes (e.g. `CI=1`, `--run`, `--watch=false`) — a command that waits for input or watches files hangs the loop.
|
|
45
|
+
- Must run offline, with no credentials. Anything needing GPU/network/secrets belongs in a separate slow target.
|
|
46
|
+
- Time the suite once (`time <cmd>`); the measurement, not a guess, decides one tier or two.
|
|
47
|
+
- On success, output should be near-silent — prefer quiet flags in the fast tier so failures, not progress spam, fill the context.
|
|
48
|
+
- Add it to the repo's own docs so humans find it too.
|
|
49
|
+
|
|
50
|
+
**Two tiers when the repo has slow checks.** One `verify` command forces a bad trade: either the loop crawls or coverage gets cut. Split it:
|
|
51
|
+
|
|
52
|
+
- `verify` — fast (<~60s), offline: lint, typecheck, unit/smoke tests. Run on **every** loop iteration.
|
|
53
|
+
- `verify-full` — everything else: full suite, integration, build, slow checks. Run **before declaring done** and before a PR — "done" means `verify-full` green, not just `verify`.
|
|
54
|
+
|
|
55
|
+
Name them by the repo's convention (`make verify` / `make verify-full`, npm scripts, just recipes). A small repo whose whole suite runs in seconds needs only the single tier — do not add ceremony it does not need.
|
|
56
|
+
|
|
57
|
+
**Monorepos:** detect the workspace layout (`package.json` `workspaces`, `pnpm-workspace.yaml`, turbo/nx config, `go.work`, Cargo `[workspace]`). Prefer a repo-owned `verify-changed` target backed by the workspace's native dependency graph; `verify-full` remains the root suite. Never make a global hook guess package mappings from path prefixes. Read [references/smart-verification.md](references/smart-verification.md) before creating the target, and record its base-revision/fallback contract in Phase 5 notes.
|
|
58
|
+
|
|
59
|
+
**Enforcement pack users (Claude Code, ask first):** if the verify-tracking hooks are active — classic install: `~/.claude/hooks/luciazero-verify.sh` exists; plugin install: the `luciazero` plugin is enabled — offer to record the established command in the repo's *personal* settings so the tracker matches it exactly instead of by broad regex — `.claude/settings.local.json` (gitignored, never committed): `{"env": {"LUCIAZERO_VERIFY_CMD": "<the fast-tier command>"}}`. Derive it from CI (the honest source); it is a cache of that truth, so note it must be updated if CI changes. Show the exact JSON before writing anything.
|
|
60
|
+
|
|
61
|
+
## Phase 3 — Smoke tests, if there are none
|
|
62
|
+
|
|
63
|
+
Do **not** attempt coverage. Write 3–6 tests that would catch a catastrophic break. Pick by this heuristic:
|
|
64
|
+
|
|
65
|
+
- **Contract shape** — the core data structure in/out: dimensions, keys, types, no NaN/null where impossible
|
|
66
|
+
- **Round trip** — serialize→deserialize, encode→decode, save→load returns equal
|
|
67
|
+
- **Import/boot** — every package imports, the app answers one request, the CLI runs `--help`. Prefer the framework's test client over binding a real port; any test that starts a process needs a hard timeout and must kill what it started.
|
|
68
|
+
- **Artifact loads** — trained model / migration / config parses and does one forward pass or one query
|
|
69
|
+
- **The bug you were sent to fix** — a regression test reproducing it, written *before* the fix
|
|
70
|
+
|
|
71
|
+
Use fixtures small enough to commit. Never depend on the user's real data paths.
|
|
72
|
+
|
|
73
|
+
State plainly that these are smoke tests, not a suite.
|
|
74
|
+
|
|
75
|
+
## Phase 4 — Guardrails (only ones that pay for themselves)
|
|
76
|
+
|
|
77
|
+
Hooks, `.claude/settings.json`, and `/fewer-permission-prompts` are **Claude Code mechanisms**. On a harness without them (Codex CLI), skip the hook items and encode the same guardrails as instructions in the project's `AGENTS.md` instead: which files are untouchable, which derived file must be regenerated after editing which source.
|
|
78
|
+
|
|
79
|
+
Prefer few and deterministic. Candidates, in value order:
|
|
80
|
+
|
|
81
|
+
- **Auto-format/lint on write** — `PostToolUse` hook matching `Edit|Write`, running the repo's own formatter. Only if the repo already has one configured.
|
|
82
|
+
- **Regenerate derived files** — if editing source X requires regenerating Y (protobuf, OpenAPI clients, migrations, lockfiles), hook it, scoped inside the command to the relevant paths. This is the highest-value hook in most repos because humans forget it.
|
|
83
|
+
- **Protect the untouchables** — `PreToolUse` deny on production config, secrets, live model/deploy pointers.
|
|
84
|
+
- **Permission allowlist** — put the repo's read-only and verify commands into `.claude/settings.json` so the loop is not interrupted. `/fewer-permission-prompts` derives this from real transcripts.
|
|
85
|
+
|
|
86
|
+
Put project-scoped settings in the repo's `.claude/settings.json` (shared) or `.claude/settings.local.json` (personal, gitignored) — **not** in global settings.
|
|
87
|
+
|
|
88
|
+
Hooks execute automatically on the user's machine. Show the exact command before installing it, and never install one that pushes, deploys, deletes, or writes outside the repo.
|
|
89
|
+
|
|
90
|
+
## Phase 5 — Project notes file (`CLAUDE.md` / `AGENTS.md`)
|
|
91
|
+
|
|
92
|
+
Extend the notes file the repo already uses; if neither exists, create the one matching the current harness and add a one-line pointer from the other name so both find it. Write only what reading the code cannot tell you:
|
|
93
|
+
|
|
94
|
+
- How to run / test / verify — the commands from Phase 2
|
|
95
|
+
- Architecture facts that are load-bearing and non-obvious (what serves what, which file is source of truth)
|
|
96
|
+
- **Footguns and null results**: "X looks right but breaks Y", "tried A, measured no gain, do not retry", "always rebuild Z after W"
|
|
97
|
+
- Where the real docs live
|
|
98
|
+
|
|
99
|
+
Do not restate the directory tree, git history, or anything a `grep` answers. Keep it dense; every line costs context on every future session.
|
|
100
|
+
|
|
101
|
+
## Phase 6 — Prove it and report
|
|
102
|
+
|
|
103
|
+
1. **Flake check** — run the fast verify tier twice. A green that does not repeat is a flake, and a flaky verify makes every future red ambiguous; fixing or quarantining the flake comes before relying on the loop. (Skip the double run only when the repo has a single slow tier — say so.)
|
|
104
|
+
2. **Red check** — break a line a smoke test actually covers (flip an expected value or a return), confirm verify goes red, then restore. The break is one deliberate edit: **record file, line, and original text before making it, and restore by reverting exactly that edit.** Only use `git checkout -- <file>` if the file was committed before the break — on a file carrying uncommitted work it silently discards that work too, and it cannot restore the untracked test files this skill just wrote. Never use bare `git stash` here (it sweeps the whole tree and skips untracked files). Breaking an uncovered line and staying green proves nothing. A verify command that cannot fail is not a verify command.
|
|
105
|
+
|
|
106
|
+
Report:
|
|
107
|
+
- The one command to run (both tiers if split)
|
|
108
|
+
- What it does and does not cover
|
|
109
|
+
- What was added, and what was deliberately left out
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Read-only evidence scan for
|
|
2
|
+
# Read-only evidence scan for ready Phase 1.
|
|
3
3
|
# Prints what exists in a repo — docs, manifests, script/target names, CI run
|
|
4
4
|
# lines, test dirs, workspace markers. It surfaces candidates only; it never
|
|
5
5
|
# picks the verify command. Judgment stays with the agent.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: show
|
|
3
|
+
description: Turn code structure, changes, and verification evidence into the smallest useful visual. Use when the user invokes /show, asks what connects to what, what changed, how a flow works, or what proves a result; use for compact pseudocode, call or component trees, file maps, structural diffs, Mermaid diagrams, and evidence maps, with focused HTML only when simpler forms cannot carry the information.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Show — make the evidence visible
|
|
7
|
+
|
|
8
|
+
Answer three questions at a glance:
|
|
9
|
+
|
|
10
|
+
1. What connects to what?
|
|
11
|
+
2. What changed?
|
|
12
|
+
3. What proves it?
|
|
13
|
+
|
|
14
|
+
Build an evidence view, not a decorative diagram. The view summarizes reality;
|
|
15
|
+
source files, diffs, and command results remain the ground truth.
|
|
16
|
+
|
|
17
|
+
## 1. Set the focus
|
|
18
|
+
|
|
19
|
+
Use the user's question and current task context as the input. Do not ask for
|
|
20
|
+
details that can be discovered from the repository. Narrow broad requests to
|
|
21
|
+
the smallest boundary that answers the question, and state that boundary.
|
|
22
|
+
|
|
23
|
+
Gather only the relevant evidence:
|
|
24
|
+
|
|
25
|
+
- definitions, callers, consumers, configuration, and ownership;
|
|
26
|
+
- the current diff or before/after revisions;
|
|
27
|
+
- verification command, exit code, shortest decisive output, and coverage gaps.
|
|
28
|
+
|
|
29
|
+
Never expose private chain-of-thought. Show observable structure, evidence, and
|
|
30
|
+
concise conclusions instead.
|
|
31
|
+
|
|
32
|
+
## 2. Normalize the evidence
|
|
33
|
+
|
|
34
|
+
Reduce what was found to five kinds of information:
|
|
35
|
+
|
|
36
|
+
- **Entities** — files, functions, components, services, states, or commands;
|
|
37
|
+
- **Relations** — calls, owns, reads, writes, emits, depends on, or verifies;
|
|
38
|
+
- **Changes** — added, removed, or modified entities and relations;
|
|
39
|
+
- **Proof** — commands and observations that confirm or refute a claim;
|
|
40
|
+
- **Gaps** — unknown, inferred, or unverified parts.
|
|
41
|
+
|
|
42
|
+
Label inference as `? inferred`; never draw a guessed edge as fact.
|
|
43
|
+
|
|
44
|
+
## 3. Choose the smallest useful view
|
|
45
|
+
|
|
46
|
+
Prefer the first form that carries the relationship clearly:
|
|
47
|
+
|
|
48
|
+
| Question | View |
|
|
49
|
+
|---|---|
|
|
50
|
+
| What does this logic decide? | Compact pseudocode |
|
|
51
|
+
| Who calls what at runtime? | Call tree |
|
|
52
|
+
| Who owns or contains what? | Component or shallow file tree |
|
|
53
|
+
| How do 3+ parts exchange control or data? | Mermaid flow or sequence |
|
|
54
|
+
| What changed structurally? | Before/after structural diff |
|
|
55
|
+
| Why is this considered complete? | Requirement-to-proof evidence map |
|
|
56
|
+
| Is prose already clearer? | One sentence or a short list; draw nothing |
|
|
57
|
+
|
|
58
|
+
Use one primary view. Add a second only when it answers a different question.
|
|
59
|
+
Use focused HTML only for dense UI, layout, or interactive state that text and
|
|
60
|
+
Mermaid cannot show clearly. Keep HTML temporary unless the user asks to keep
|
|
61
|
+
it, and open it only when the harness and user permissions allow.
|
|
62
|
+
|
|
63
|
+
## 4. Render with a stable grammar
|
|
64
|
+
|
|
65
|
+
Use these marks consistently in text views:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
A --> B calls or moves data to
|
|
69
|
+
A --owns--> B named relationship
|
|
70
|
+
+ item added
|
|
71
|
+
- item removed
|
|
72
|
+
~ item changed
|
|
73
|
+
[+] proven verification passed
|
|
74
|
+
[x] disproven verification failed
|
|
75
|
+
[?] unknown not verified
|
|
76
|
+
[path/to/file:line] source pointer
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Keep labels concrete and short. Omit unrelated files, helper calls, props,
|
|
80
|
+
states, and branches. A reader should not need a legend beyond the grammar
|
|
81
|
+
above.
|
|
82
|
+
|
|
83
|
+
For Mermaid, keep node IDs simple, quote labels containing punctuation, and
|
|
84
|
+
put source pointers outside the diagram when they would make nodes noisy.
|
|
85
|
+
|
|
86
|
+
## 5. Attach evidence
|
|
87
|
+
|
|
88
|
+
Every important node or edge must be traceable to at least one of:
|
|
89
|
+
|
|
90
|
+
- `path/to/file:line` for source structure;
|
|
91
|
+
- a diff hunk or revision for a change;
|
|
92
|
+
- an exact command, exit code, and shortest decisive output for proof.
|
|
93
|
+
|
|
94
|
+
Do not use a green-looking diagram as verification. If no command ran, write
|
|
95
|
+
`not run`. If a check does not cover a shown claim, mark that claim `[?]` and
|
|
96
|
+
name the missing coverage. Failed proof remains visible as `[x]`; do not hide it
|
|
97
|
+
to make the view look complete.
|
|
98
|
+
|
|
99
|
+
## Output contract
|
|
100
|
+
|
|
101
|
+
Return, in this order:
|
|
102
|
+
|
|
103
|
+
1. **Answer** — one or two sentences naming the focus and conclusion.
|
|
104
|
+
2. **View** — the smallest useful visual.
|
|
105
|
+
3. **Sources** — compact file/line or revision pointers.
|
|
106
|
+
4. **Proof** — command, exit code, and decisive output; or `not run`.
|
|
107
|
+
5. **Unknowns** — uncovered or inferred parts; omit only when there are none.
|
|
108
|
+
|
|
109
|
+
For a completed change, an evidence map may look like:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
request
|
|
113
|
+
--> ~ skills/catalog.txt
|
|
114
|
+
--> + skills/show/SKILL.md
|
|
115
|
+
--> ~ README.md / README.th.md
|
|
116
|
+
|
|
|
117
|
+
+--verified by--> [+] ./test.sh (exit 0)
|
|
118
|
+
`PASS all checks green`
|
|
119
|
+
|
|
120
|
+
[?] Real invocation in a fresh agent session was not exercised.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Fit into the Luciazero loop
|
|
124
|
+
|
|
125
|
+
- With `/ready`, show the path from CI to the repository verify command.
|
|
126
|
+
- With `/plan`, show the proposed before/after boundary and acceptance proof.
|
|
127
|
+
- With `/debug`, show hypothesis → observation → conclusion without replacing
|
|
128
|
+
the reproduction or hypothesis ledger.
|
|
129
|
+
- With `/done`, show requirement → changed artifact → verification evidence.
|
|
130
|
+
- With `/lucia-relay`, show current state → next action → blocker.
|
|
131
|
+
|
|
132
|
+
The lifecycle skill owns the work and verification. `/show` only makes its
|
|
133
|
+
structure and evidence easier to inspect.
|
package/uninstall-codex.sh
CHANGED
|
@@ -14,6 +14,10 @@ END='<!-- luciazero:end -->'
|
|
|
14
14
|
MANAGED_DIR="${CODEX_DIR}/.luciazero-managed"
|
|
15
15
|
|
|
16
16
|
catalog() { sed '/^[[:space:]]*#/d; /^[[:space:]]*$/d' "$1"; }
|
|
17
|
+
skill_inventory() {
|
|
18
|
+
catalog "${SRC}/skills/catalog.txt"
|
|
19
|
+
catalog "${SRC}/skills/aliases.txt"
|
|
20
|
+
}
|
|
17
21
|
|
|
18
22
|
# collision-proof backup path for $1 (two runs in the same second must not overwrite)
|
|
19
23
|
bakpath() {
|
|
@@ -48,7 +52,7 @@ rm -f "${CODEX_DIR}/.luciazero-version"
|
|
|
48
52
|
while IFS= read -r SKILL; do
|
|
49
53
|
remove_managed_tree "${CODEX_DIR}/skills/${SKILL}" \
|
|
50
54
|
"${MANAGED_DIR}/skills/${SKILL}" "${SRC}/skills/${SKILL}" "skills/${SKILL}"
|
|
51
|
-
done < <(
|
|
55
|
+
done < <(skill_inventory)
|
|
52
56
|
|
|
53
57
|
AGENT_STAGE_ROOT="$(mktemp -d)"
|
|
54
58
|
trap 'rm -rf "${AGENT_STAGE_ROOT}"' EXIT
|
package/uninstall.sh
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# Remove the Luciazero doctrine +
|
|
2
|
+
# Remove the Luciazero doctrine + skills from ~/.claude/
|
|
3
3
|
set -euo pipefail
|
|
4
4
|
|
|
5
5
|
for ARG in "$@"; do
|
|
@@ -14,6 +14,10 @@ GLOBAL_MD="${CLAUDE_DIR}/CLAUDE.md"
|
|
|
14
14
|
MANAGED_DIR="${CLAUDE_DIR}/.luciazero-managed"
|
|
15
15
|
|
|
16
16
|
catalog() { sed '/^[[:space:]]*#/d; /^[[:space:]]*$/d' "$1"; }
|
|
17
|
+
skill_inventory() {
|
|
18
|
+
catalog "${SRC}/skills/catalog.txt"
|
|
19
|
+
catalog "${SRC}/skills/aliases.txt"
|
|
20
|
+
}
|
|
17
21
|
|
|
18
22
|
# collision-proof backup path for $1 (two runs in the same second must not overwrite)
|
|
19
23
|
bakpath() {
|
|
@@ -66,7 +70,7 @@ rm -f "${CLAUDE_DIR}/.luciazero-version"
|
|
|
66
70
|
while IFS= read -r SKILL; do
|
|
67
71
|
remove_managed_tree "${CLAUDE_DIR}/skills/${SKILL}" \
|
|
68
72
|
"${MANAGED_DIR}/skills/${SKILL}" "${SRC}/skills/${SKILL}" "skills/${SKILL}"
|
|
69
|
-
done < <(
|
|
73
|
+
done < <(skill_inventory)
|
|
70
74
|
|
|
71
75
|
while IFS= read -r AGENT_NAME; do
|
|
72
76
|
remove_managed_file "${CLAUDE_DIR}/agents/${AGENT_NAME}.md" \
|
|
File without changes
|