Skip to content

Commit 3420933

Browse files
authored
Rewrite README around the ladder + validation pass (#30)
* docs: rewrite README around the mode ladder * docs: render routing table as a markdown table
1 parent 8d07198 commit 3420933

2 files changed

Lines changed: 305 additions & 48 deletions

File tree

README.md

Lines changed: 168 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# cldk-devtools
22

3-
> Formerly cldk-forge. Now being remodeled into a mode ladder — see [the epic](https://github.com/codellm-devkit/cldk-forge/issues/13) for progress.
4-
5-
The forge where [CodeLLM-DevKit (CLDK)](https://github.com/codellm-devkit) gets built: a
6-
[Claude Code](https://claude.com/claude-code) **plugin** of agent skills for extending CLDK —
7-
build a new language's backend analyzer, wire it into the SDKs, and grow it through the
8-
analysis levels: symbol table, call graph, and native dataflow.
3+
cldk-devtools (formerly cldk-forge) is a [Claude Code](https://claude.com/claude-code)
4+
**plugin** that turns [CodeLLM-DevKit (CLDK)](https://github.com/codellm-devkit) development
5+
into a **mode ladder**: one skill per stage of the work — design, build the backend analyzer,
6+
wire it into an SDK, maintain, finish — each with its own hard gates and a fixed handoff to the
7+
next rung. Structural work gets designed before it's built; upkeep work gets triaged and swept
8+
for propagation; nothing ships without passing through the same exit gate. Describe what you're
9+
doing and the matching skill takes over.
910

1011
## Install
1112

@@ -14,69 +15,188 @@ analysis levels: symbol table, call graph, and native dataflow.
1415
/plugin install cldk-devtools@codellm-devkit
1516
```
1617

17-
Then just describe the task — *"add Rust support to CLDK"*, *"build a codeanalyzer for Kotlin"*,
18-
*"wire the Go analyzer into python-sdk"*, *"add dataflow analysis to codeanalyzer-go"* — and the
19-
matching skill triggers.
18+
Then just describe the task — *"add Rust support to CLDK"*, *"build a codeanalyzer for
19+
Kotlin"*, *"wire the Go analyzer into python-sdk"*, *"fix this codeanalyzer-go issue"* — and the
20+
matching skill triggers. Inside any codellm-devkit repository, a `SessionStart` hook also injects
21+
the dispatcher automatically (see [How the hook behaves](#how-the-hook-behaves) below).
2022

21-
## Skills
23+
## The Ladder
2224

23-
### [`codeanalyzer-backend`](skills/codeanalyzer-backend/)
25+
The diagram and routing table below are copied verbatim from the dispatcher skill,
26+
[`using-cldk-devtools`](skills/using-cldk-devtools/SKILL.md) — the same ones an agent reads
27+
before acting on any codellm-devkit repo. Keep the two in sync; the consistency check in
28+
`tests/` diffs them.
2429

25-
Build and release the **backend analyzer** `codeanalyzer-<lang>` for a new language: a guided
26-
decision on the backend tooling (parser, resolver, packaging), then a **modular** analyzer
27-
scaffolded and verified stage by stage, shipped as a thin PyPI wheel + GitHub Release binaries +
28-
Homebrew formula via tag-triggered releases.
30+
```
31+
using-cldk-devtools (dispatcher)
32+
33+
structural work │ upkeep work
34+
▼ ▼
35+
designing-cldk-changes maintaining-cldk
36+
│ spec + GitHub epic │ HARD GATE: escalate to design mode
37+
▼ │ if the fix moves schema v2 / public API
38+
codeanalyzer-backend │
39+
▼ │
40+
cldk-sdk-frontend │
41+
▼ ▼
42+
finishing-cldk-work (verify → release → docs → close issues)
43+
44+
(future rung: cocoa)
45+
```
2946

30-
The analysis levels it owns:
47+
## Routing
3148

32-
| Level | What | Cost |
49+
| Work type | Entry point | Path |
3350
| --- | --- | --- |
34-
| 1 | Symbol table + resolver-based call graph → canonical `analysis.json` | Cheap, always built |
35-
| 2 | Framework-based call-graph enrichment (Joern/WALA/SVF) | Heavy, flag-gated |
36-
| 3 | **Native dataflow**: CFG/DFG/PDG/SDG built from the language's own AST, with slicing and taint as queries | Heavy, in-process, flag-gated |
51+
| New language for CLDK | designing-cldk-changes | design → backend → frontend → finishing |
52+
| Schema v2 evolution / migration | designing-cldk-changes | design → backend (all affected analyzers) → frontend (all affected SDKs) → finishing |
53+
| New analysis level (L2/L3/L4) for a language | designing-cldk-changes | design → backend → frontend (if surface changes) → finishing |
54+
| New facade surface / SDK feature | designing-cldk-changes | design → frontend → finishing |
55+
| Bug fix (analyzer or SDK), behavior-preserving | maintaining-cldk | maintain → finishing |
56+
| Small feature, no contract impact | maintaining-cldk | maintain → finishing |
57+
| Docs gap / README / agent-guide update | maintaining-cldk | maintain → finishing (docs path) |
58+
| Issue triage ("is this real?") | maintaining-cldk | maintain (may stop at triage verdict) |
59+
60+
## Skills
3761

38-
Also covered: the optional **Neo4j projection** (`--emit neo4j` — Cypher snapshot or live Bolt
39-
push, with the CPG as the level-3 overlay), deterministic parallelism (`-j`), testing gates and
40-
fixture design, and the analyzer README + `CLAUDE.md` agent guide as standing deliverables.
62+
### [`using-cldk-devtools`](skills/using-cldk-devtools/) — dispatcher
63+
64+
**Owns:** the routing rule itself — the ladder diagram and routing table above. **Triggers:**
65+
before any action on a codellm-devkit repo, including quick fixes, questions, and issue triage;
66+
in practice it is injected automatically by the `SessionStart` hook rather than invoked by name.
67+
**References:** none — it stays under 500 words by design and defers all workflow detail to the
68+
other five skills.
69+
70+
### [`designing-cldk-changes`](skills/designing-cldk-changes/)
71+
72+
**Owns:** contract evolution — a new language, schema v2 evolution/migration, a new analysis
73+
level, a new SDK facade surface, or any cross-repo structural feature — decided as a spec plus a
74+
GitHub epic (one child issue per rung) before any implementation rung runs. **Triggers:** the
75+
work is structural, or `maintaining-cldk`'s contract gate escalated a "small fix" here because it
76+
moved schema v2 output or the public API. **Key references:**
77+
[`canonical-schema.md`](skills/designing-cldk-changes/references/canonical-schema.md) (the
78+
keystone every other skill defers to),
79+
[`schema-design-loop.md`](skills/designing-cldk-changes/references/schema-design-loop.md),
80+
[`sdk-facade-design-loop.md`](skills/designing-cldk-changes/references/sdk-facade-design-loop.md),
81+
[`schema-migration.md`](skills/designing-cldk-changes/references/schema-migration.md),
82+
[`epic-and-issue-templates.md`](skills/designing-cldk-changes/references/epic-and-issue-templates.md).
83+
84+
### [`maintaining-cldk`](skills/maintaining-cldk/)
85+
86+
**Owns:** the upkeep path — triage → contract gate → fix loop → propagation sweep — for bug
87+
fixes, small features, and docs gaps. Most work enters here. **Triggers:** picking up an issue,
88+
bug report, small feature, or documentation gap on any codellm-devkit repository, or triaging
89+
whether a reported problem is real. **Key references:**
90+
[`repo-map.md`](skills/maintaining-cldk/references/repo-map.md) (where a fix lands, what pins to
91+
what), [`triage-playbook.md`](skills/maintaining-cldk/references/triage-playbook.md),
92+
[`propagation-checklist.md`](skills/maintaining-cldk/references/propagation-checklist.md) (the
93+
required propagation verdict).
4194

42-
Key references: [`backend-recipe.md`](skills/codeanalyzer-backend/references/backend-recipe.md),
95+
### [`codeanalyzer-backend`](skills/codeanalyzer-backend/)
96+
97+
**Owns:** building or growing a `codeanalyzer-<lang>` backend analyzer level by level — symbol
98+
table (L1), call graph (L2), intraprocedural dataflow (L3), interprocedural SDG (L4) — into the
99+
canonical schema v2, in both the `analysis.json` and Neo4j projections. **Triggers:** adding a
100+
language, growing an analyzer through the levels, or migrating an existing analyzer to schema
101+
v2 — only once a spec + GitHub epic exists from `designing-cldk-changes` (or a maintenance
102+
escalation arrives with its design decision already recorded). **Key references:**
103+
[`analyzer-architecture.md`](skills/codeanalyzer-backend/references/analyzer-architecture.md),
43104
[`tooling-menu.md`](skills/codeanalyzer-backend/references/tooling-menu.md),
44-
[`canonical-schema.md`](skills/codeanalyzer-backend/references/canonical-schema.md),
45-
[`dataflow-graphs.md`](skills/codeanalyzer-backend/references/dataflow-graphs.md) (+ its
46-
construction / substrate-menu / issue-template companions),
105+
[`level-1-symbol-table.md`](skills/codeanalyzer-backend/references/level-1-symbol-table.md),
106+
[`level-2-call-graph.md`](skills/codeanalyzer-backend/references/level-2-call-graph.md),
107+
[`level-3-intraprocedural-dataflow.md`](skills/codeanalyzer-backend/references/level-3-intraprocedural-dataflow.md),
108+
[`level-4-interprocedural-sdg.md`](skills/codeanalyzer-backend/references/level-4-interprocedural-sdg.md),
109+
[`cli-contract.md`](skills/codeanalyzer-backend/references/cli-contract.md),
110+
[`project-materialization.md`](skills/codeanalyzer-backend/references/project-materialization.md),
47111
[`neo4j-projection.md`](skills/codeanalyzer-backend/references/neo4j-projection.md),
48-
[`packaging-and-release.md`](skills/codeanalyzer-backend/references/packaging-and-release.md).
112+
[`testing-and-validation.md`](skills/codeanalyzer-backend/references/testing-and-validation.md).
113+
Packaging and release do **not** live here — that's `finishing-cldk-work`.
49114

50115
### [`cldk-sdk-frontend`](skills/cldk-sdk-frontend/)
51116

52-
Wire an existing analyzer into a CLDK **frontend SDK** — today the
53-
[Python SDK](https://github.com/codellm-devkit/python-sdk): the `CLDK.<lang>()` factory method, a
54-
per-language backend ABC with a local `codeanalyzer` backend and an optional read-only **Neo4j**
55-
backend, Pydantic models that validate against the analyzer's `analysis.json`, and mocked + E2E +
56-
backend-contract tests. The facade's query surface is designed interactively (every divergence
57-
decided with you), then encoded per SDK.
58-
59-
## Typical flow
60-
61-
1. **`codeanalyzer-backend`** → a working, released `codeanalyzer-<lang>` (level 1, optionally
62-
level 2) with a validated schema contract.
63-
2. **`cldk-sdk-frontend`** → the language reachable via `CLDK.<lang>(project_path=...)`.
64-
3. When ready for dataflow: instantiate
65-
[`dataflow-issue-template.md`](skills/codeanalyzer-backend/references/dataflow-issue-template.md)
66-
as the level-3 epic on the analyzer repo (worked example:
67-
[codeanalyzer-go#3](https://github.com/codellm-devkit/codeanalyzer-go/issues/3)) and build it
68-
stage by stage.
117+
**Owns:** wiring an existing, schema-conformant `codeanalyzer-<lang>` into a CLDK frontend SDK —
118+
today the [Python SDK](https://github.com/codellm-devkit/python-sdk)
119+
(`CLDK.<lang>(project_path=..., backend=...)`, with the legacy
120+
`CLDK(language="<lang>").analysis(...)` kept as a compat shim), the TypeScript SDK the same way,
121+
other SDKs as they come online — behind the **Iron Rule**: the public API never moves.
122+
**Triggers:** the analyzer already emits conformant output, and, for any change to the facade
123+
surface, a spec + epic already decided that surface in `designing-cldk-changes`. **Key
124+
references:** [`schema-contract.md`](skills/cldk-sdk-frontend/references/schema-contract.md) (the
125+
two-layer model: CPG models vs. the frozen public facade),
126+
[`python-sdk-wiring.md`](skills/cldk-sdk-frontend/references/python-sdk-wiring.md),
127+
[`typescript-sdk-wiring.md`](skills/cldk-sdk-frontend/references/typescript-sdk-wiring.md),
128+
[`neo4j-backend.md`](skills/cldk-sdk-frontend/references/neo4j-backend.md),
129+
[`sdk-testing.md`](skills/cldk-sdk-frontend/references/sdk-testing.md) (mocked + E2E +
130+
backend-contract tiers).
131+
132+
### [`finishing-cldk-work`](skills/finishing-cldk-work/)
133+
134+
**Owns:** the ladder's exit — every other rung terminates here. Verification gates, a real ship
135+
decision, release mechanics when warranted, and closeout (docs, issue/epic bookkeeping, filing
136+
follow-on issues for anything a propagation verdict listed). **Triggers:** implementation on a
137+
CLDK branch is complete and the work needs verification, merge, release, documentation updates,
138+
or issue closeout — before claiming any CLDK work is done. **Key references:**
139+
[`release-gates.md`](skills/finishing-cldk-work/references/release-gates.md) (the gate matrix by
140+
repo type), [`packaging-and-release.md`](skills/finishing-cldk-work/references/packaging-and-release.md)
141+
(tag-triggered analyzer releases, SDK pin bumps),
142+
[`docs-and-closeout.md`](skills/finishing-cldk-work/references/docs-and-closeout.md).
69143

70144
## Layout
71145

72146
```
73-
.claude-plugin/ # plugin + marketplace manifests
147+
.claude-plugin/ # plugin + marketplace manifests
148+
hooks/ # SessionStart hook: injects the dispatcher inside CLDK repos, silent elsewhere
74149
skills/
75-
codeanalyzer-backend/ # SKILL.md + references/ (the specs the skill reads on demand)
76-
cldk-sdk-frontend/ # SKILL.md + references/
150+
using-cldk-devtools/ # SKILL.md only — dispatcher, no references/
151+
designing-cldk-changes/ # SKILL.md + references/
152+
maintaining-cldk/ # SKILL.md + references/
153+
codeanalyzer-backend/ # SKILL.md + references/
154+
cldk-sdk-frontend/ # SKILL.md + references/
155+
finishing-cldk-work/ # SKILL.md + references/
156+
docs/schema/ # schema v2 preview artifacts
157+
tests/
158+
scenarios/ # per-skill prompts used to test routing and gates
159+
baselines/ # RED (no-skill) vs. GREEN (with-skill) evidence, ladder dry-runs
160+
hooks/ # hook behavior tests
77161
```
78162

163+
## How the hook behaves
164+
165+
`hooks/session-start.sh` fires on `SessionStart` (`startup|clear|compact`). It checks whether the
166+
session's working directory sits under a path containing `codellm-devkit`, or the repo's `origin`
167+
remote points at `codellm-devkit` — only then does it print the full
168+
`using-cldk-devtools` dispatcher skill into context, labeled so the agent knows to fetch every
169+
other skill through the `Skill` tool by name. Outside a codellm-devkit repo it prints nothing.
170+
Every path exits `0`: the hook is bash + git only, with no other runtime dependency, and it must
171+
never be the reason a session fails to start.
172+
173+
## Reference analyzers & typical flows
174+
79175
Reference analyzers this skillset anchors on:
80176
[`codeanalyzer-java`](https://github.com/codellm-devkit/codeanalyzer-java),
81177
[`codeanalyzer-python`](https://github.com/codellm-devkit/codeanalyzer-python),
82178
[`codeanalyzer-typescript`](https://github.com/codellm-devkit/codeanalyzer-typescript).
179+
180+
Two typical flows through the ladder:
181+
182+
- **"Add Rust support to CLDK"** (new language) — `designing-cldk-changes` produces the spec +
183+
epic (target level, schema decisions) → `codeanalyzer-backend` builds and releases
184+
`codeanalyzer-rust` (L1, optionally L2) → `cldk-sdk-frontend` wires `CLDK.rust(project_path=...)`
185+
into the Python SDK (and TypeScript when ready) → `finishing-cldk-work` runs the gates, decides
186+
and cuts the release, and closes out the epic.
187+
- **"Fix this codeanalyzer-go issue"** (bug fix) — `maintaining-cldk` reproduces the bug, checks
188+
the contract gate (escalating to `designing-cldk-changes` only if the fix would move schema v2
189+
output or a public API), fixes it, and runs the propagation sweep across sibling analyzers →
190+
`finishing-cldk-work` verifies, ships a release if the sweep or the fix itself warrants one, and
191+
closes the issue.
192+
193+
## Authoring method
194+
195+
Every skill in this plugin was built scenario-first, not asserted into existence: a **RED**
196+
baseline transcript (the same task, run without the skill) is captured before a **GREEN**
197+
transcript (the same task, with the skill's `SKILL.md` in context) shows the gate or handoff
198+
actually changing agent behavior. Scenario prompts live under `tests/scenarios/<skill>/`; their
199+
RED/GREEN evidence is under `tests/baselines/<skill>/`. Whole-ladder dry runs — walking multiple
200+
rungs end to end without implementing — are recorded in
201+
[`tests/baselines/ladder-dry-runs.md`](tests/baselines/ladder-dry-runs.md). A skill lands only
202+
once its scenarios pass GREEN.

0 commit comments

Comments
 (0)