← Blog

Graft v5.7: First npm Publish — 설치하고 돌려볼 수 있다

4 min read
graftcompilerllmnpmclaudeproductization

Graft is a domain-specific language for defining LLM agent pipelines. The compiler takes .gft files and generates Claude Code harness structures. v5.0 wrapped up the adversarial debate era. v5.1-v5.7 is the productization phase — making it something anyone can install and run.

v5.7 marks the M1 milestone: "설치하고 돌려볼 수 있다" (You can install it and run it). First npm publish, deep debugging pass, and end-to-end Claude Code verification.

What Happened

npm Publish

npm install -g @jsleekr/graft
graft init my-pipeline
cd my-pipeline
graft compile pipeline.gft

@jsleekr/graft — 73 kB, 95 files. The CLI provides compile, check, run, and init commands. Published under @jsleekr scope (npm org graft-lang pending).

Deep Debugging: 9 Bugs Fixed

Ran 6 parallel debugging agents across the entire codebase — parser, codegen, runtime, LSP. 225 new edge-case tests written. Found and fixed 9 bugs:

High severity:

  • Import path stripping — CLI passed path.basename(file) instead of full path, breaking import resolution when CWD differs from source directory. Affected compile, check, and run commands.
  • done rejected in conditional edges — parser's expectIdentifier() didn't accept the done keyword token as a conditional edge target.
  • compact transform was a no-op in hooks — generated hooks only minified JSON. Now properly removes nulls, empty strings, empty arrays, and empty objects (matching runtime behavior).
  • Wrong input paths for non-edge reads — agent markdown pointed to .graft/session/ (context dir) for produces-type reads instead of .graft/session/node_outputs/{producer}.json.

Medium severity:

  • Non-compact hooks identical to compact — both produced minified JSON. Non-compact now outputs pretty-printed JSON.stringify(result, null, 2).
  • truncate transform silently dropped — hook codegen had a bare break for truncate. Now generates proportional truncation logic.
  • Runtime/codegen naming mismatch — runtime wrote _transformed_for_, codegen expected _to_. Aligned to _to_.
  • Missing orchestration inputs — nodes reading produces types without edges weren't listed in the execution plan.
  • Parallel block edge transforms lost — sequential→parallel edge transforms weren't shown in orchestration output.

End-to-End Claude Code Verification

The real test: does the compiled output actually work?

graft init demo && cd demo
graft compile pipeline.gft
echo '{"question": "What are the differences between TypeScript and JavaScript?"}' > .graft/session/input.json
claude

Then in Claude Code: ".claude/CLAUDE.md의 실행 계획을 따라서 파이프라인을 실행해줘."

Result: Claude Code read the orchestration plan, ran the Analyst agent (sonnet), applied the edge transform (select + compact), ran the Reviewer agent (haiku), and produced a final approved review. The full pipeline executed without manual intervention.

Version Jump: v5.0 → v5.7

For context on what happened between v5.0 and v5.7:

| Version | What | |---------|------| | v5.1 | Claude Code compatibility, graft init, CI/CD setup | | v5.2 | Parallel→sequential edge transforms, agent input overrides, graceful hooks | | v5.3 | Parallel codegen test coverage, hook entry merging | | v5.4 | tsc timeout fix, test infrastructure | | v5.5 | VS Code extension packaging | | v5.6 | 3 practical examples (content-pipeline, data-analysis, pr-summarizer), full CLI workflow verification | | v5.7 | npm publish, 9 bug fixes, e2e verification, README rewrite |

M1 Milestone Status

The productization milestone "설치하고 돌려볼 수 있다" is complete:

  • ✅ npm publish (@jsleekr/graft@5.7.2)
  • ✅ Claude Code output verification (e2e pass)
  • ✅ README rewrite (10-minute Getting Started)
  • ✅ e2e demo recorded
  • graft init scaffolding
  • ➡️ VS Code extension marketplace (moved to M2)

Numbers

  • 1,574 tests across 101 test files (up from 1,349 at v5.6)
  • 225 new edge-case tests from 6 parallel debugging agents
  • 73 kB published package size
  • 7 compilable examples — all pass compile + dry-run
  • 0 known blockers for basic usage

What's Next: M2

M2 focuses on real-world usage and ecosystem:

  • VS Code extension on marketplace
  • More real-world pipeline examples
  • Hook auto-execution verification (PostToolUse if pattern validation)
  • Conditional edge codegen (parses correctly, routing logic not yet generated)
  • npm org graft-lang setup for proper scoping