litclaude-ai 0.2.2
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 +155 -0
- package/LICENSE +21 -0
- package/README.md +369 -0
- package/README_ko-KR.md +374 -0
- package/RELEASE_CHECKLIST.md +165 -0
- package/bin/litclaude-ai.js +643 -0
- package/cover.png +0 -0
- package/docs/agents.md +67 -0
- package/docs/hooks.md +134 -0
- package/docs/lsp.md +40 -0
- package/docs/migration.md +209 -0
- package/docs/workflow-compatibility-audit.md +119 -0
- package/generate_cover.py +123 -0
- package/package.json +48 -0
- package/plugins/litclaude/.claude-plugin/plugin.json +25 -0
- package/plugins/litclaude/.lsp.json +13 -0
- package/plugins/litclaude/.mcp.json +9 -0
- package/plugins/litclaude/agents/boulder-executor.md +12 -0
- package/plugins/litclaude/agents/librarian-researcher.md +15 -0
- package/plugins/litclaude/agents/oracle-verifier.md +16 -0
- package/plugins/litclaude/agents/prometheus-planner.md +13 -0
- package/plugins/litclaude/agents/qa-runner.md +16 -0
- package/plugins/litclaude/agents/quality-reviewer.md +17 -0
- package/plugins/litclaude/bin/litclaude-hook.js +110 -0
- package/plugins/litclaude/bin/litclaude-hud.js +271 -0
- package/plugins/litclaude/bin/litclaude-lsp-doctor.js +15 -0
- package/plugins/litclaude/bin/litclaude-mcp.js +70 -0
- package/plugins/litclaude/commands/deep-interview.md +21 -0
- package/plugins/litclaude/commands/dynamic-workflow.md +36 -0
- package/plugins/litclaude/commands/lit-loop.md +40 -0
- package/plugins/litclaude/commands/lit-plan.md +35 -0
- package/plugins/litclaude/commands/litgoal.md +30 -0
- package/plugins/litclaude/commands/review-work.md +35 -0
- package/plugins/litclaude/commands/start-work.md +36 -0
- package/plugins/litclaude/hooks/hooks.json +54 -0
- package/plugins/litclaude/lib/context-pressure.mjs +25 -0
- package/plugins/litclaude/lib/hud-accent-palette.mjs +58 -0
- package/plugins/litclaude/lib/litgoal/cli.mjs +266 -0
- package/plugins/litclaude/lib/litgoal/ledger.mjs +16 -0
- package/plugins/litclaude/lib/litgoal/paths.mjs +7 -0
- package/plugins/litclaude/lib/litgoal/state.mjs +67 -0
- package/plugins/litclaude/lib/mutated-file-paths.mjs +63 -0
- package/plugins/litclaude/lib/start-work-continuation.mjs +99 -0
- package/plugins/litclaude/lib/workflow-check.mjs +83 -0
- package/plugins/litclaude/skills/ai-slop-remover/SKILL.md +142 -0
- package/plugins/litclaude/skills/comment-checker/SKILL.md +55 -0
- package/plugins/litclaude/skills/debugging/SKILL.md +70 -0
- package/plugins/litclaude/skills/debugging/references/methodology/00-setup.md +108 -0
- package/plugins/litclaude/skills/debugging/references/methodology/02-investigate.md +126 -0
- package/plugins/litclaude/skills/debugging/references/methodology/04-oracle-triple.md +106 -0
- package/plugins/litclaude/skills/debugging/references/methodology/05-escalate.md +69 -0
- package/plugins/litclaude/skills/debugging/references/methodology/06-fix.md +116 -0
- package/plugins/litclaude/skills/debugging/references/methodology/08-qa.md +94 -0
- package/plugins/litclaude/skills/debugging/references/methodology/09-cleanup.md +164 -0
- package/plugins/litclaude/skills/debugging/references/methodology/partial-runtime-evidence.md +228 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/go.md +252 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/native-binary.md +484 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/node.md +260 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/python.md +248 -0
- package/plugins/litclaude/skills/debugging/references/runtimes/rust.md +234 -0
- package/plugins/litclaude/skills/debugging/references/tools/ghidra.md +212 -0
- package/plugins/litclaude/skills/debugging/references/tools/playwright-cli.md +194 -0
- package/plugins/litclaude/skills/debugging/references/tools/pwndbg.md +263 -0
- package/plugins/litclaude/skills/debugging/references/tools/pwntools.md +265 -0
- package/plugins/litclaude/skills/deep-interview/SKILL.md +323 -0
- package/plugins/litclaude/skills/deep-interview/scripts/render_progress.py +193 -0
- package/plugins/litclaude/skills/frontend-ui-ux/SKILL.md +62 -0
- package/plugins/litclaude/skills/lit-loop/SKILL.md +144 -0
- package/plugins/litclaude/skills/lit-plan/SKILL.md +125 -0
- package/plugins/litclaude/skills/litgoal/SKILL.md +219 -0
- package/plugins/litclaude/skills/lsp/SKILL.md +63 -0
- package/plugins/litclaude/skills/programming/SKILL.md +106 -0
- package/plugins/litclaude/skills/programming/references/go/README.md +90 -0
- package/plugins/litclaude/skills/programming/references/go/backend-stack.md +641 -0
- package/plugins/litclaude/skills/programming/references/go/bootstrap.md +328 -0
- package/plugins/litclaude/skills/programming/references/go/bubbletea-v2.md +360 -0
- package/plugins/litclaude/skills/programming/references/go/cobra-stack.md +468 -0
- package/plugins/litclaude/skills/programming/references/go/concurrency.md +362 -0
- package/plugins/litclaude/skills/programming/references/go/data-modeling.md +329 -0
- package/plugins/litclaude/skills/programming/references/go/error-handling.md +359 -0
- package/plugins/litclaude/skills/programming/references/go/golangci-strict.md +236 -0
- package/plugins/litclaude/skills/programming/references/go/grpc-connect.md +375 -0
- package/plugins/litclaude/skills/programming/references/go/libraries.md +337 -0
- package/plugins/litclaude/skills/programming/references/go/one-liners.md +202 -0
- package/plugins/litclaude/skills/programming/references/go/sqlc-pgx.md +471 -0
- package/plugins/litclaude/skills/programming/references/go/testing.md +467 -0
- package/plugins/litclaude/skills/programming/references/go/type-patterns.md +298 -0
- package/plugins/litclaude/skills/programming/references/python/README.md +314 -0
- package/plugins/litclaude/skills/programming/references/python/async-anyio.md +442 -0
- package/plugins/litclaude/skills/programming/references/python/data-modeling.md +233 -0
- package/plugins/litclaude/skills/programming/references/python/data-processing.md +133 -0
- package/plugins/litclaude/skills/programming/references/python/error-handling.md +218 -0
- package/plugins/litclaude/skills/programming/references/python/fastapi-stack.md +316 -0
- package/plugins/litclaude/skills/programming/references/python/httpx2-optimization.md +360 -0
- package/plugins/litclaude/skills/programming/references/python/libraries.md +307 -0
- package/plugins/litclaude/skills/programming/references/python/one-liners.md +268 -0
- package/plugins/litclaude/skills/programming/references/python/orjson-stack.md +378 -0
- package/plugins/litclaude/skills/programming/references/python/pydantic-ai.md +285 -0
- package/plugins/litclaude/skills/programming/references/python/pyproject-strict.md +232 -0
- package/plugins/litclaude/skills/programming/references/python/textual-tui.md +201 -0
- package/plugins/litclaude/skills/programming/references/python/type-patterns.md +176 -0
- package/plugins/litclaude/skills/programming/references/rust/README.md +317 -0
- package/plugins/litclaude/skills/programming/references/rust/async-tokio.md +299 -0
- package/plugins/litclaude/skills/programming/references/rust/axum-stack.md +467 -0
- package/plugins/litclaude/skills/programming/references/rust/cargo-strict.md +317 -0
- package/plugins/litclaude/skills/programming/references/rust/clap-stack.md +409 -0
- package/plugins/litclaude/skills/programming/references/rust/concurrency.md +375 -0
- package/plugins/litclaude/skills/programming/references/rust/libraries.md +439 -0
- package/plugins/litclaude/skills/programming/references/rust/one-liners.md +291 -0
- package/plugins/litclaude/skills/programming/references/rust/proptest-insta.md +429 -0
- package/plugins/litclaude/skills/programming/references/rust/type-state.md +354 -0
- package/plugins/litclaude/skills/programming/references/rust/unsafe-discipline.md +250 -0
- package/plugins/litclaude/skills/programming/references/rust/zero-cost-safety.md +527 -0
- package/plugins/litclaude/skills/programming/references/rust-ub/README.md +289 -0
- package/plugins/litclaude/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
- package/plugins/litclaude/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
- package/plugins/litclaude/skills/programming/references/typescript/README.md +195 -0
- package/plugins/litclaude/skills/programming/references/typescript/backend-hono.md +672 -0
- package/plugins/litclaude/skills/programming/references/typescript/bootstrap.md +199 -0
- package/plugins/litclaude/skills/programming/references/typescript/data-modeling.md +202 -0
- package/plugins/litclaude/skills/programming/references/typescript/error-handling.md +169 -0
- package/plugins/litclaude/skills/programming/references/typescript/tsconfig-strict.md +152 -0
- package/plugins/litclaude/skills/programming/references/typescript/type-patterns.md +196 -0
- package/plugins/litclaude/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
- package/plugins/litclaude/skills/programming/scripts/go/new-project.py +138 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/.editorconfig +13 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/.golangci.yml +95 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/ci.yml +37 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/config.go +24 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/gitignore +15 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
- package/plugins/litclaude/skills/programming/scripts/go/templates/run.go +15 -0
- package/plugins/litclaude/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
- package/plugins/litclaude/skills/programming/scripts/python/new-project.py +172 -0
- package/plugins/litclaude/skills/programming/scripts/python/new-script.py +116 -0
- package/plugins/litclaude/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
- package/plugins/litclaude/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
- package/plugins/litclaude/skills/programming/scripts/rust/new-project.py +175 -0
- package/plugins/litclaude/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
- package/plugins/litclaude/skills/programming/scripts/typescript/new-project.ts +177 -0
- package/plugins/litclaude/skills/refactor/SKILL.md +73 -0
- package/plugins/litclaude/skills/remove-ai-slops/SKILL.md +52 -0
- package/plugins/litclaude/skills/review-work/SKILL.md +331 -0
- package/plugins/litclaude/skills/rules/SKILL.md +66 -0
- package/plugins/litclaude/skills/start-work/SKILL.md +132 -0
- package/scripts/audit-plan-checkboxes.mjs +37 -0
- package/scripts/doctor.mjs +41 -0
- package/scripts/inspect-agent-tools.mjs +27 -0
- package/scripts/postinstall.mjs +50 -0
- package/scripts/qa-claude-plugin-smoke.sh +60 -0
- package/scripts/qa-portable-install.sh +136 -0
- package/scripts/validate-plugin.mjs +72 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lit-loop
|
|
3
|
+
description: Evidence-bound LitClaude execution loop with goal/workflow/worktree bootstrap, RED->GREEN tests, manual QA artifacts, cleanup receipts, and continuation ledgers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Lit Loop
|
|
7
|
+
|
|
8
|
+
Use this skill when the user asks for `lit`, `litwork`, `$lit-loop`, or an
|
|
9
|
+
evidence-bound implementation loop. It is the Claude Code port of LitClaude
|
|
10
|
+
Litwork/Litgoal discipline.
|
|
11
|
+
|
|
12
|
+
When the request is still underspecified, pause execution and route to
|
|
13
|
+
`/litclaude:deep-interview` or a completed `deep-interview/<slug>-spec.md`
|
|
14
|
+
before planning or editing. Lit-loop execution should not invent non-goals, decision
|
|
15
|
+
boundaries, or acceptance criteria.
|
|
16
|
+
|
|
17
|
+
## Role
|
|
18
|
+
|
|
19
|
+
Deliver the user's objective end-to-end. Convert the objective into explicit
|
|
20
|
+
success criteria before editing. Keep decisions, evidence, cleanup receipts,
|
|
21
|
+
and remaining work in a durable notepad, plan, or ledger when the task spans
|
|
22
|
+
multiple steps.
|
|
23
|
+
|
|
24
|
+
## Bootstrap
|
|
25
|
+
|
|
26
|
+
Before implementation:
|
|
27
|
+
|
|
28
|
+
1. Read the relevant files and existing plans/handoffs.
|
|
29
|
+
2. PIN the objective, non-goals, commit/push boundary, publish boundary, and
|
|
30
|
+
any dirty worktree files that must not be reverted.
|
|
31
|
+
3. Define 3+ success criteria covering happy path, edge/regression, and
|
|
32
|
+
adversarial risk.
|
|
33
|
+
4. Pair each criterion with a failing automated test or reproduction.
|
|
34
|
+
5. Pair each criterion with one real Manual-QA channel.
|
|
35
|
+
6. Register cleanup for every tmux session, process, port, browser context, or
|
|
36
|
+
temp directory as soon as it is created.
|
|
37
|
+
7. Reread stale state before action: plans, handoffs, package metadata,
|
|
38
|
+
registry facts, test output, and resumed ledgers can drift between turns.
|
|
39
|
+
|
|
40
|
+
## Native Goal + Dynamic Workflow
|
|
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.
|
|
52
|
+
|
|
53
|
+
Dynamic workflow orchestration is mandatory for broad, risky, parallel, or
|
|
54
|
+
long-running work: call `Workflow` when exposed instead of merely mentioning it.
|
|
55
|
+
Dynamic worktree isolation is mandatory for risky edit lanes: call
|
|
56
|
+
`EnterWorktree` when exposed. If only the CLI surface is available, use or
|
|
57
|
+
recommend `claude --worktree <short-name> --tmux`.
|
|
58
|
+
|
|
59
|
+
## Subagent Assignment Contract
|
|
60
|
+
|
|
61
|
+
When Claude Code subagents or Dynamic workflow lanes are available, delegate
|
|
62
|
+
work as executable assignments, not as loose context handoffs. Each child-agent
|
|
63
|
+
message starts with `TASK:` and includes `DELIVERABLE`, `SCOPE`, and `VERIFY`.
|
|
64
|
+
Keep the scope small, name exact files or directories, include the required
|
|
65
|
+
test/reproduction, and name the Manual-QA channel plus cleanup receipt.
|
|
66
|
+
|
|
67
|
+
Run independent child work in the background only when lanes do not touch the
|
|
68
|
+
same files. Use short wait cycles for mailbox updates, and treat a timeout as
|
|
69
|
+
"no update yet", not as a pass or fail. If a child returns no deliverable,
|
|
70
|
+
stays silent after a targeted follow-up, or reports `BLOCKED:`, record the
|
|
71
|
+
missing deliverable and use a smaller fallback assignment. Review fallback must
|
|
72
|
+
preserve a reviewer role; it is not a generic worker task.
|
|
73
|
+
|
|
74
|
+
## Manual-QA Channels
|
|
75
|
+
|
|
76
|
+
Pick one channel per criterion and run it:
|
|
77
|
+
|
|
78
|
+
- HTTP: `curl -i <url>` with status, headers, and body captured.
|
|
79
|
+
- tmux: `tmux new-session -d -s <name> '<command>'`, capture pane output, then
|
|
80
|
+
kill the session and prove cleanup.
|
|
81
|
+
- Browser: drive the real page, capture action log and screenshot.
|
|
82
|
+
- Computer use: automate the actual desktop app and capture action log.
|
|
83
|
+
|
|
84
|
+
Tests are the floor. Manual QA is the ceiling.
|
|
85
|
+
|
|
86
|
+
## Execution Loop
|
|
87
|
+
|
|
88
|
+
For each criterion:
|
|
89
|
+
|
|
90
|
+
1. PIN: restate the criterion, non-goal, stale state to reread, and rollback
|
|
91
|
+
limits before editing.
|
|
92
|
+
2. RED: write the failing test first and capture the failing output.
|
|
93
|
+
3. GREEN: implement the smallest correct change.
|
|
94
|
+
4. VERIFY: run targeted tests and relevant full suite.
|
|
95
|
+
5. SURFACE: run the manual QA scenario through the chosen channel.
|
|
96
|
+
6. REVIEW: run the reviewer gate or request a review when the change is broad,
|
|
97
|
+
risky, security-sensitive, or release-facing.
|
|
98
|
+
7. CLEAN: tear down every spawned resource and record the cleanup receipt.
|
|
99
|
+
Cleanup must be bounded: include timeout/kill commands for long-running
|
|
100
|
+
tmux sessions, servers, child processes, and browser contexts.
|
|
101
|
+
8. RECORD: update the notepad/ledger with PASS, FAIL, or BLOCKED.
|
|
102
|
+
|
|
103
|
+
Repeat the same criterion after a fix; do not jump to a new criterion while the
|
|
104
|
+
current one has missing evidence.
|
|
105
|
+
|
|
106
|
+
Use the shorthand `PIN -> RED -> GREEN -> VERIFY -> SURFACE -> REVIEW -> CLEAN
|
|
107
|
+
-> RECORD` when writing plans or ledgers. The SURFACE step must include a
|
|
108
|
+
Manual-QA artifact, not only automated tests.
|
|
109
|
+
|
|
110
|
+
## Adversarial Classes
|
|
111
|
+
|
|
112
|
+
Probe relevant classes:
|
|
113
|
+
|
|
114
|
+
- malformed input
|
|
115
|
+
- prompt injection
|
|
116
|
+
- cancel/resume
|
|
117
|
+
- stale state
|
|
118
|
+
- dirty worktree
|
|
119
|
+
- hung or long commands
|
|
120
|
+
- flaky tests
|
|
121
|
+
- misleading success output
|
|
122
|
+
- repeated interruptions
|
|
123
|
+
|
|
124
|
+
If a class does not apply, record the one-line reason.
|
|
125
|
+
|
|
126
|
+
## Stop rules
|
|
127
|
+
|
|
128
|
+
Stop only when all criteria have green automated evidence, real channel
|
|
129
|
+
artifacts, cleanup receipts, and the required commit/push or publish instruction
|
|
130
|
+
has been handled. If blocked, record the exact blocker and the next executable
|
|
131
|
+
command.
|
|
132
|
+
|
|
133
|
+
Stop immediately before remote mutations unless the user has requested the
|
|
134
|
+
commit/push or publish action in this session. On resume, reread the ledger and
|
|
135
|
+
latest git status before continuing. Never revert dirty worktree changes you did
|
|
136
|
+
not make; either work around them or ask when they block the task.
|
|
137
|
+
|
|
138
|
+
## Porting Note
|
|
139
|
+
|
|
140
|
+
LitClaude original Litwork text is intentionally demanding. LitClaude keeps
|
|
141
|
+
that pressure but replaces source-specific mechanics with Claude Code surfaces. If a
|
|
142
|
+
future Claude release exposes native goal tools directly, keep the same
|
|
143
|
+
evidence gate and simply swap the local ledger bootstrap for the native tool
|
|
144
|
+
calls.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lit-plan
|
|
3
|
+
description: Strategic LitClaude planner for decision-complete plans with goal/workflow/worktree guidance, tests, manual QA, cleanup, and publish guardrails.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Lit Plan
|
|
7
|
+
|
|
8
|
+
You are a planner, not an implementer. Explore first, resolve discoverable
|
|
9
|
+
facts, and write one execution-ready plan under `plans/`. The plan should let a
|
|
10
|
+
fresh Claude Code session execute without re-solving the architecture.
|
|
11
|
+
|
|
12
|
+
## Planning Contract
|
|
13
|
+
|
|
14
|
+
Every plan must include:
|
|
15
|
+
|
|
16
|
+
- objective and non-goals
|
|
17
|
+
- Bootstrap instructions that PIN mutable facts, dirty worktree boundaries,
|
|
18
|
+
commit/push approval, publish approval, stale state checks, and resume points
|
|
19
|
+
- current evidence from files, docs, or external source links
|
|
20
|
+
- ordered TODOs with top-level checkboxes
|
|
21
|
+
- acceptance criteria for each meaningful deliverable
|
|
22
|
+
- test commands and expected failure/success observables
|
|
23
|
+
- one Manual-QA channel per user-facing criterion
|
|
24
|
+
- cleanup receipt requirements for spawned resources
|
|
25
|
+
- reviewer gate criteria for risky, shared, security-sensitive, or
|
|
26
|
+
release-facing changes
|
|
27
|
+
- commit/push and publish guardrails
|
|
28
|
+
- handoff expectations if the plan is long-running
|
|
29
|
+
|
|
30
|
+
## Exploration
|
|
31
|
+
|
|
32
|
+
Read code before planning. Use search tools and read-only subagents when the
|
|
33
|
+
surface is broad. For private workflow references, inspect primary
|
|
34
|
+
source files and pin the source URL or local clone path in the plan.
|
|
35
|
+
|
|
36
|
+
If the user's brief lacks non-goals, decision boundaries, or testable
|
|
37
|
+
acceptance criteria, recommend `/litclaude:deep-interview` first instead of
|
|
38
|
+
inventing requirements. Treat a completed `deep-interview/<slug>-spec.md` as
|
|
39
|
+
the requirements source of truth for the plan.
|
|
40
|
+
|
|
41
|
+
Do not invent API behavior. If Claude Code exposes a model-facing tool, plan to
|
|
42
|
+
use it. If it only exposes a UI slash command, write the user-visible command
|
|
43
|
+
and do not pretend the skill can silently execute it.
|
|
44
|
+
|
|
45
|
+
## Native Goal + Dynamic Workflow
|
|
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.
|
|
57
|
+
|
|
58
|
+
For broad, risky, parallel, or long-running implementation, include Dynamic workflow
|
|
59
|
+
and Dynamic worktree instructions:
|
|
60
|
+
|
|
61
|
+
- call `Workflow` when Claude Code exposes it
|
|
62
|
+
- call `EnterWorktree` for isolated model-facing edit lanes when available
|
|
63
|
+
- otherwise recommend `claude --worktree <short-name> --tmux` for explicit
|
|
64
|
+
operator-managed isolation
|
|
65
|
+
|
|
66
|
+
## Subagent Assignment Contract
|
|
67
|
+
|
|
68
|
+
When a plan calls for child agents or Dynamic workflow lanes, write assignments
|
|
69
|
+
as executable work orders. Each lane starts with `TASK:` and names
|
|
70
|
+
`DELIVERABLE`, `SCOPE`, and `VERIFY`. The scope must be small enough for one
|
|
71
|
+
worker or reviewer to finish without guessing, and it must name exact files,
|
|
72
|
+
tests, Manual-QA channel, artifact path, and cleanup receipt.
|
|
73
|
+
|
|
74
|
+
Plan independent lanes so they can run in the background, but document where
|
|
75
|
+
serialization is required. Require short wait cycles for mailbox updates; a
|
|
76
|
+
timeout only means no new update arrived. If a lane has a missing deliverable,
|
|
77
|
+
returns only acknowledgement, or reports `BLOCKED:`, the executor should use a
|
|
78
|
+
targeted follow-up once, then a smaller fallback assignment. Reviewer fallback
|
|
79
|
+
must keep a reviewer role and is not a generic worker.
|
|
80
|
+
|
|
81
|
+
## Plan Structure
|
|
82
|
+
|
|
83
|
+
Use this shape:
|
|
84
|
+
|
|
85
|
+
1. TL;DR with status, deliverables, effort, and risk.
|
|
86
|
+
2. Scope: must-have and must-not-have.
|
|
87
|
+
3. Bootstrap: PIN facts to reread, dirty worktree constraints, stale state
|
|
88
|
+
risks, resume ledger path, and bounded cleanup rules.
|
|
89
|
+
4. Current evidence and source references.
|
|
90
|
+
5. Execution waves with dependency matrix.
|
|
91
|
+
6. TODOs with acceptance criteria and QA scenario per task.
|
|
92
|
+
7. TDD loop per task: `PIN -> RED -> GREEN -> VERIFY -> SURFACE -> REVIEW ->
|
|
93
|
+
CLEAN -> RECORD`.
|
|
94
|
+
8. Verification commands.
|
|
95
|
+
9. Release/commit/publish instructions.
|
|
96
|
+
|
|
97
|
+
## QA Scenario Requirements
|
|
98
|
+
|
|
99
|
+
Each scenario must name:
|
|
100
|
+
|
|
101
|
+
- exact tool: `curl`, `tmux`, browser action, or desktop automation
|
|
102
|
+
- exact command or steps
|
|
103
|
+
- binary PASS/FAIL observable
|
|
104
|
+
- artifact path
|
|
105
|
+
- cleanup command and cleanup receipt path
|
|
106
|
+
- bounded timeout or kill strategy for long-running sessions, servers, ports,
|
|
107
|
+
browser contexts, temp directories, and child processes
|
|
108
|
+
|
|
109
|
+
`--dry-run` alone is not enough for final user-facing proof, but it is useful
|
|
110
|
+
for package/install smoke when paired with real command output.
|
|
111
|
+
|
|
112
|
+
## Planner Restraints
|
|
113
|
+
|
|
114
|
+
Do not edit production files. Do not mark tasks complete. Do not publish. Do
|
|
115
|
+
not open-endedly brainstorm when the user asked for an executable plan. If the
|
|
116
|
+
task is too vague, ask the smallest clarifying question or write assumptions
|
|
117
|
+
explicitly.
|
|
118
|
+
|
|
119
|
+
## Stop rules
|
|
120
|
+
|
|
121
|
+
The plan must tell the executor to stop before commit/push or publish unless
|
|
122
|
+
the user has approved that remote mutation. It must also tell the executor to
|
|
123
|
+
stop and reread state on resume, repeated interruption, stale registry/package
|
|
124
|
+
facts, dirty worktree conflicts, malformed plan sections, or misleading success
|
|
125
|
+
output without artifacts plus STATUS lines.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: litgoal
|
|
3
|
+
description: Durable LitClaude goal orchestration with CLI-backed state, explicit success criteria, evidence ledgers, checkpoints, steering, quality gates, and cleanup receipts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Litgoal
|
|
7
|
+
|
|
8
|
+
Use this skill when work must survive turns, compaction, interrupted sessions,
|
|
9
|
+
or handoff to another agent. The core rule is strict: a goal is not complete
|
|
10
|
+
until every success criterion has observable evidence from a real surface and a
|
|
11
|
+
cleanup receipt.
|
|
12
|
+
|
|
13
|
+
LitClaude ships a local runtime for this workflow. Use the package CLI as the
|
|
14
|
+
source of durable state:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
litclaude-ai litgoal create-goals --brief "<brief>" --json
|
|
18
|
+
litclaude-ai litgoal status --json
|
|
19
|
+
litclaude-ai litgoal criteria --json
|
|
20
|
+
litclaude-ai litgoal record-evidence --criterion <id> --status pass --json '{"artifact":"...","cleanup":"..."}'
|
|
21
|
+
litclaude-ai litgoal checkpoint --status complete --note "<summary>" --json
|
|
22
|
+
litclaude-ai litgoal steer --kind scope --note "<evidence-backed steering>" --json
|
|
23
|
+
litclaude-ai litgoal record-review-blockers --blocker "<finding>" --json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The executable runtime lives in `plugins/litclaude/lib/litgoal/`. Runtime
|
|
27
|
+
state lives under `.litclaude/litgoal/` in the active working directory:
|
|
28
|
+
|
|
29
|
+
- `.litclaude/litgoal/brief.md` stores the original brief.
|
|
30
|
+
- `.litclaude/litgoal/goals.json` stores the durable objective, status, criteria,
|
|
31
|
+
blockers, steering decisions, and checkpoints.
|
|
32
|
+
- `.litclaude/litgoal/ledger.jsonl` is the append-only evidence ledger.
|
|
33
|
+
|
|
34
|
+
The runtime uses atomic JSON writes and a lock-safe mutation path so concurrent
|
|
35
|
+
recording attempts do not corrupt `goals.json` or `ledger.jsonl`. Never hand-edit
|
|
36
|
+
these files as a substitute for CLI commands.
|
|
37
|
+
|
|
38
|
+
## Goal Shape
|
|
39
|
+
|
|
40
|
+
Represent every litgoal run as:
|
|
41
|
+
|
|
42
|
+
- objective
|
|
43
|
+
- non-goals and user constraints
|
|
44
|
+
- success criteria
|
|
45
|
+
- expected evidence per criterion
|
|
46
|
+
- Manual-QA channel per criterion
|
|
47
|
+
- current state
|
|
48
|
+
- blockers
|
|
49
|
+
- cleanup receipts
|
|
50
|
+
- checkpoint history
|
|
51
|
+
- final quality gate
|
|
52
|
+
|
|
53
|
+
If model-facing goal tools are exposed, inspect them before creating a new
|
|
54
|
+
active goal. Treat `/goal` as a user-visible Claude Code slash command. Never
|
|
55
|
+
auto-type `/goal`, never claim slash-command activation without evidence, and
|
|
56
|
+
never mark a goal complete through native goal tooling until the local
|
|
57
|
+
litgoal criteria have passed.
|
|
58
|
+
|
|
59
|
+
## Bootstrap
|
|
60
|
+
|
|
61
|
+
Do these steps before implementation edits:
|
|
62
|
+
|
|
63
|
+
1. Read `HANDOFF.md`, the active plan, and `.litclaude/litgoal/ledger.jsonl` when
|
|
64
|
+
they exist.
|
|
65
|
+
2. Run `litclaude-ai litgoal status --json`.
|
|
66
|
+
3. If no state exists for the current objective, run
|
|
67
|
+
`litclaude-ai litgoal create-goals --brief "<brief>" --json`.
|
|
68
|
+
4. Run `litclaude-ai litgoal criteria --json` and inspect the criterion ids.
|
|
69
|
+
5. Refine the working checklist so each criterion has exact expected evidence
|
|
70
|
+
and one Manual-QA channel.
|
|
71
|
+
|
|
72
|
+
Do not start production edits when the objective, constraints, or evidence
|
|
73
|
+
surface is ambiguous. Resolve the ambiguity or record a blocker first.
|
|
74
|
+
|
|
75
|
+
## Success Criteria Refinement
|
|
76
|
+
|
|
77
|
+
Each criterion must have:
|
|
78
|
+
|
|
79
|
+
- `id`
|
|
80
|
+
- scenario
|
|
81
|
+
- exact expected evidence
|
|
82
|
+
- pass/fail boundary
|
|
83
|
+
- adversarial classes to probe
|
|
84
|
+
- Manual-QA channel: HTTP call, tmux, browser use, or computer use
|
|
85
|
+
- cleanup receipt requirement
|
|
86
|
+
|
|
87
|
+
Tests are supporting evidence. They are not sufficient completion proof for
|
|
88
|
+
user-facing behavior. A criterion can pass only when its real-surface artifact
|
|
89
|
+
exists and the cleanup receipt proves no QA resource remains alive.
|
|
90
|
+
|
|
91
|
+
## Execution Loop
|
|
92
|
+
|
|
93
|
+
Work one criterion at a time:
|
|
94
|
+
|
|
95
|
+
1. PLAN: read the criterion, prior ledger entries, constraints, and blockers.
|
|
96
|
+
2. PIN: when touching existing behavior, capture the current observable behavior
|
|
97
|
+
with a characterization test or transcript before changing it.
|
|
98
|
+
3. RED: add a failing test or reproduction for the desired behavior.
|
|
99
|
+
4. GREEN: implement the smallest change that satisfies the criterion.
|
|
100
|
+
5. SURFACE: run the criterion's Manual-QA channel.
|
|
101
|
+
6. CAPTURE: save the artifact path, command, status, and observable result.
|
|
102
|
+
7. CLEAN: tear down every spawned process, tmux session, browser context, port,
|
|
103
|
+
temp directory, container, worktree, or QA file.
|
|
104
|
+
8. RECORD: call `record-evidence` with pass, fail, or blocked.
|
|
105
|
+
9. CHECKPOINT: call `checkpoint` when a criterion, blocker, or steering change
|
|
106
|
+
alters durable state.
|
|
107
|
+
|
|
108
|
+
Do not batch unrelated criteria. If discovery changes the goal, use steering
|
|
109
|
+
instead of silently changing the plan.
|
|
110
|
+
|
|
111
|
+
## Recording Evidence
|
|
112
|
+
|
|
113
|
+
Use `record-evidence` for exactly one criterion result:
|
|
114
|
+
|
|
115
|
+
```sh
|
|
116
|
+
litclaude-ai litgoal record-evidence \
|
|
117
|
+
--criterion criterion-1 \
|
|
118
|
+
--status pass \
|
|
119
|
+
--json '{"artifact":".litclaude/lit-loop/evidence/criterion-1.txt","manualQa":"tmux transcript","cleanup":"tmux kill-session ...; HAS_SESSION_STATUS:1","adversarial":["malformed_input","stale_state"]}'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Allowed statuses are `pass`, `fail`, and `blocked`. A malformed evidence JSON
|
|
123
|
+
payload must fail with a controlled CLI error. A missing criterion id must fail
|
|
124
|
+
with a controlled state error. Never record `pass` while a QA resource is still
|
|
125
|
+
alive or while the artifact is only a dry-run claim.
|
|
126
|
+
|
|
127
|
+
## Manual-QA Channels
|
|
128
|
+
|
|
129
|
+
Manual-QA channels are required for criterion completion.
|
|
130
|
+
|
|
131
|
+
Pick one real channel per criterion:
|
|
132
|
+
|
|
133
|
+
- HTTP call: `curl -i` against the live endpoint.
|
|
134
|
+
- tmux: create a named session, drive the command, capture the pane transcript,
|
|
135
|
+
kill the session, and verify `HAS_SESSION_STATUS:1`.
|
|
136
|
+
- Browser use: drive the real page, capture an action log and screenshot, then
|
|
137
|
+
close the context.
|
|
138
|
+
- Computer use: automate the desktop surface, capture an action log and
|
|
139
|
+
screenshot, then close the app/session.
|
|
140
|
+
|
|
141
|
+
Auxiliary CLI output can prove data-shaped behavior, but it does not replace
|
|
142
|
+
the selected Manual-QA channel for user-visible behavior.
|
|
143
|
+
|
|
144
|
+
## Checkpoints
|
|
145
|
+
|
|
146
|
+
Use checkpoints for resumability:
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
litclaude-ai litgoal checkpoint --status active --note "<progress>" --json
|
|
150
|
+
litclaude-ai litgoal checkpoint --status blocked --note "<blocker>" --json
|
|
151
|
+
litclaude-ai litgoal checkpoint --status complete --note "<evidence summary>" --json
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The runtime must reject `--status complete` until every criterion in
|
|
155
|
+
`.litclaude/litgoal/goals.json` is `pass`. If completion is rejected, inspect
|
|
156
|
+
`criteria --json`, fix or record the pending criterion, and retry.
|
|
157
|
+
|
|
158
|
+
## Steering
|
|
159
|
+
|
|
160
|
+
Use `steer` only for evidence-backed changes in direction:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
litclaude-ai litgoal steer --kind scope --note "<what changed and why>" --json
|
|
164
|
+
litclaude-ai litgoal steer --kind priority --note "<new order evidence>" --json
|
|
165
|
+
litclaude-ai litgoal steer --kind blocker --note "<blocking evidence>" --json
|
|
166
|
+
litclaude-ai litgoal steer --kind quality --note "<quality gate adjustment>" --json
|
|
167
|
+
litclaude-ai litgoal steer --kind handoff --note "<handoff update>" --json
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Normal prose does not mutate durable state. Steering must explain the observed
|
|
171
|
+
evidence and the exact next action. Invalid steering kinds must fail with a
|
|
172
|
+
controlled CLI error.
|
|
173
|
+
|
|
174
|
+
## Final Quality Gate
|
|
175
|
+
|
|
176
|
+
Before final completion:
|
|
177
|
+
|
|
178
|
+
1. All criteria are `pass` in `litclaude-ai litgoal criteria --json`.
|
|
179
|
+
2. Targeted tests for changed behavior pass.
|
|
180
|
+
3. The relevant full validation suite passes for the blast radius.
|
|
181
|
+
4. Manual-QA artifacts exist for every user-facing criterion.
|
|
182
|
+
5. Cleanup receipts exist for every QA resource.
|
|
183
|
+
6. Review has no blocking findings for broad or risky changes.
|
|
184
|
+
7. Commit, push, tag, and publish actions match the user's explicit request.
|
|
185
|
+
|
|
186
|
+
Only after this gate may you call:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
litclaude-ai litgoal checkpoint --status complete --note "<final evidence>" --json
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Recovery
|
|
193
|
+
|
|
194
|
+
When resuming:
|
|
195
|
+
|
|
196
|
+
1. Read the handoff and ledger before doing new work.
|
|
197
|
+
2. Run `litclaude-ai litgoal status --json`.
|
|
198
|
+
3. Run `litclaude-ai litgoal criteria --json`.
|
|
199
|
+
4. Reproduce the latest blocker or verify the latest pass before proceeding.
|
|
200
|
+
5. Continue from the first pending or failed criterion.
|
|
201
|
+
|
|
202
|
+
Do not create a second parallel goal for the same objective just because the old
|
|
203
|
+
state is inconvenient. If state is corrupt, capture the controlled error and
|
|
204
|
+
record a blocker or steering note instead of inventing state.
|
|
205
|
+
|
|
206
|
+
## Stop Rules
|
|
207
|
+
|
|
208
|
+
Stop and surface the state when:
|
|
209
|
+
|
|
210
|
+
- All criteria pass and the final quality gate is complete.
|
|
211
|
+
- The same criterion fails three times with the same cause.
|
|
212
|
+
- Five cycles on one goal do not produce all-pass criteria.
|
|
213
|
+
- A safety boundary appears: destructive command, secret exposure, production
|
|
214
|
+
write, or unapproved publish/push.
|
|
215
|
+
- Required external access, credentials, hardware, or user approval is missing.
|
|
216
|
+
- A QA process, tmux session, browser context, bound port, container, temp dir,
|
|
217
|
+
or worktree cannot be cleaned up.
|
|
218
|
+
|
|
219
|
+
Leftover runtime state means `blocked`, not `pass`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lsp
|
|
3
|
+
description: Claude Code language-server workflow for diagnostics, definitions, references, rename safety, and post-edit checks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# LSP
|
|
7
|
+
|
|
8
|
+
Use this skill when edits touch code where language-server feedback is useful.
|
|
9
|
+
LitClaude ships `.lsp.json` to describe plugin-local TypeScript/JavaScript LSP
|
|
10
|
+
settings, and this skill uses LitClaude LSP habit into Claude Code wording.
|
|
11
|
+
|
|
12
|
+
## First Checks
|
|
13
|
+
|
|
14
|
+
1. Identify the edited language and whether a configured server exists.
|
|
15
|
+
2. Run diagnostics after the edit, preferably on the changed file first.
|
|
16
|
+
3. If diagnostics fail because the language server is missing, report the setup
|
|
17
|
+
command or controlled skip rather than inventing a pass.
|
|
18
|
+
4. Do not block docs-only work on language-server availability.
|
|
19
|
+
|
|
20
|
+
## Claude Code Tool Surface
|
|
21
|
+
|
|
22
|
+
When Claude Code exposes LSP tools, prefer those model-facing tools for:
|
|
23
|
+
|
|
24
|
+
- diagnostics for one file or directory
|
|
25
|
+
- go-to-definition before editing a referenced symbol
|
|
26
|
+
- find-references before rename or API removal
|
|
27
|
+
- document/workspace symbols for large files
|
|
28
|
+
- prepare-rename before rename
|
|
29
|
+
- apply rename only when the server validates it
|
|
30
|
+
|
|
31
|
+
If the LSP tool is not exposed, use project commands such as `npm test`,
|
|
32
|
+
`tsc --noEmit`, `biome check`, `eslint`, `pyright`, `ruff`, `cargo check`, or
|
|
33
|
+
`go test` according to the repo's stack.
|
|
34
|
+
|
|
35
|
+
## LitClaude Defaults
|
|
36
|
+
|
|
37
|
+
The MVP `.lsp.json` declares TypeScript and JavaScript support through
|
|
38
|
+
`typescript-language-server`. `scripts/validate-plugin.mjs` and
|
|
39
|
+
`plugins/litclaude/bin/litclaude-lsp-doctor.js` should explain missing
|
|
40
|
+
language-server binaries as actionable setup, not as mysterious failures.
|
|
41
|
+
|
|
42
|
+
## Editing Rules
|
|
43
|
+
|
|
44
|
+
- For public API changes, inspect references before editing.
|
|
45
|
+
- For rename, prefer LSP rename or a structured search/replace with tests.
|
|
46
|
+
- For generated files, avoid direct edits unless the generator is unavailable
|
|
47
|
+
and the handoff marks the file as generated.
|
|
48
|
+
- For prompt/markdown-only changes, LSP may not apply; use docs tests instead.
|
|
49
|
+
|
|
50
|
+
## Evidence
|
|
51
|
+
|
|
52
|
+
Record the command or tool used and the diagnostic result. Good examples:
|
|
53
|
+
|
|
54
|
+
- `npm test` passed all Node tests.
|
|
55
|
+
- `node scripts/validate-plugin.mjs` reported `VALIDATE_PLUGIN_PASS`.
|
|
56
|
+
- `lsp.diagnostics` returned no errors for `bin/litclaude-ai.js`.
|
|
57
|
+
- `typescript-language-server` missing; controlled skip documented by doctor.
|
|
58
|
+
|
|
59
|
+
## Failure Handling
|
|
60
|
+
|
|
61
|
+
Diagnostics are signals, not noise. Do not suppress them. If an LSP failure is
|
|
62
|
+
unrelated to the change, label it as pre-existing with the exact output and
|
|
63
|
+
continue only when the task can be safely completed without hiding it.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: programming
|
|
3
|
+
description: "Strict Claude Code implementation discipline adapted for LitClaude: TDD, typed boundaries, parse-once input, small files, real integration checks, and no silent lint/type escapes."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Programming
|
|
7
|
+
|
|
8
|
+
Use this skill for implementation work in JavaScript, TypeScript, Python, Rust,
|
|
9
|
+
Go, shell glue, plugin manifests, and test harnesses. It is the Claude-native
|
|
10
|
+
port of LitClaude programming discipline: strong types, small units, explicit
|
|
11
|
+
boundaries, and tests that prove behavior before code is accepted.
|
|
12
|
+
|
|
13
|
+
## Phase 0: Language Gate
|
|
14
|
+
|
|
15
|
+
Before editing, identify the language and the project-local conventions. Prefer
|
|
16
|
+
the repository's existing tools over introducing a new stack. If the task spans
|
|
17
|
+
multiple languages, write down the boundary between them before coding.
|
|
18
|
+
|
|
19
|
+
- JavaScript/TypeScript: keep ESM when the package is ESM, use `node:test` or
|
|
20
|
+
the repo's configured runner, avoid `any`, `as` narrowing, and hidden globals.
|
|
21
|
+
- Python: prefer typed dataclasses/Pydantic boundaries, `pathlib`, explicit
|
|
22
|
+
exception types, and deterministic scripts.
|
|
23
|
+
- Rust: prefer typed errors, exhaustive matches, `?`, and no `unwrap` outside
|
|
24
|
+
tests or tiny `main` wrappers.
|
|
25
|
+
- Go: use `context.Context` at I/O boundaries, typed errors, no unchecked
|
|
26
|
+
`err`, and focused packages.
|
|
27
|
+
- Shell: quote variables, use `set -euo pipefail` in scripts, and make cleanup
|
|
28
|
+
explicit.
|
|
29
|
+
|
|
30
|
+
## Parse, don't validate
|
|
31
|
+
|
|
32
|
+
Parse untrusted input exactly once at the boundary. After parsing, pass typed or
|
|
33
|
+
structured values inward. Repeated ad-hoc validation inside the core is a smell:
|
|
34
|
+
it means the boundary did not create a useful value.
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
|
|
38
|
+
- CLI args become a command object or option record before command dispatch.
|
|
39
|
+
- JSON from hooks is parsed once; malformed input exits with a controlled error.
|
|
40
|
+
- Plugin manifests are loaded as structured JSON, then checked by named fields.
|
|
41
|
+
- Environment variables are read at the edge and converted into explicit paths,
|
|
42
|
+
booleans, or enums.
|
|
43
|
+
|
|
44
|
+
## TDD DISCIPLINE
|
|
45
|
+
|
|
46
|
+
For production behavior, use red -> green -> refactor.
|
|
47
|
+
|
|
48
|
+
1. Red: add a failing test that names the missing behavior and fails for the
|
|
49
|
+
right reason.
|
|
50
|
+
2. Green: write the smallest change that passes that test.
|
|
51
|
+
3. Refactor: simplify with the tests still green.
|
|
52
|
+
|
|
53
|
+
Tests should follow Given / When / Then:
|
|
54
|
+
|
|
55
|
+
- Given: exact fixture and preconditions.
|
|
56
|
+
- When: one action.
|
|
57
|
+
- Then: one observable outcome or one assertion class.
|
|
58
|
+
|
|
59
|
+
For prompt and skill text, assert on behavior-bearing rules and structure, not
|
|
60
|
+
on fragile full-string snapshots. A good prompt test checks that a required
|
|
61
|
+
decision, tool boundary, or safety rule is present.
|
|
62
|
+
|
|
63
|
+
## Test Shape
|
|
64
|
+
|
|
65
|
+
Use the fastest truthful surface:
|
|
66
|
+
|
|
67
|
+
- Unit tests for pure parsing and decision logic.
|
|
68
|
+
- Integration tests for file-system state, plugin manifests, and CLI behavior.
|
|
69
|
+
- Manual QA for the user-facing surface: tmux transcript, HTTP status/body,
|
|
70
|
+
browser screenshot, or desktop automation log.
|
|
71
|
+
|
|
72
|
+
Tests alone are not completion proof when the change affects user workflows.
|
|
73
|
+
Pair green tests with one real scenario artifact.
|
|
74
|
+
|
|
75
|
+
## Type and Error Discipline
|
|
76
|
+
|
|
77
|
+
- Make illegal states difficult to represent.
|
|
78
|
+
- Use semantic names for IDs, paths, versions, plugin keys, and command names.
|
|
79
|
+
- Return or throw typed errors at boundaries; do not rely on vague strings.
|
|
80
|
+
- Never suppress lint/type errors with comments unless a local policy explicitly
|
|
81
|
+
allows it and the reason is documented next to the suppression.
|
|
82
|
+
- Avoid defensive code that checks impossibilities. If a case is possible, name
|
|
83
|
+
it and test it. If it is impossible, encode that in parsing or types.
|
|
84
|
+
|
|
85
|
+
## 250 LOC Ceiling
|
|
86
|
+
|
|
87
|
+
Treat 250 non-comment lines in a source file as a design warning. If a touched
|
|
88
|
+
file is already too large and the change adds logic, split the cohesive unit you
|
|
89
|
+
are modifying before adding more. Keep orchestrators thin, parsing isolated,
|
|
90
|
+
and command implementations focused.
|
|
91
|
+
|
|
92
|
+
## Resource and State Hygiene
|
|
93
|
+
|
|
94
|
+
Every spawned process, tmux session, temp directory, port, browser context, or
|
|
95
|
+
container needs a cleanup receipt. Register cleanup when the resource is
|
|
96
|
+
created, not after the test passes. A leftover process means the work is not
|
|
97
|
+
done.
|
|
98
|
+
|
|
99
|
+
## Claude Code Adaptation
|
|
100
|
+
|
|
101
|
+
Prefer Claude Code's available tools and project conventions. If a Private reference
|
|
102
|
+
instruction names a Codex-only tool, translate the principle instead of copying
|
|
103
|
+
the tool name. For example, goal tools become conditional `get_goal` /
|
|
104
|
+
`create_goal` / `update_goal` guidance only when exposed; workflow isolation
|
|
105
|
+
uses `Workflow`, `EnterWorktree`, or an explicit `claude --worktree ...`
|
|
106
|
+
operator path when that is the available Claude surface.
|