Skip to content

Realign clify around copy-exemplar + validation-gate model (v0.2) - #1

Merged
codeyogi911 merged 1 commit into
mainfrom
realign-v0.2
Apr 25, 2026
Merged

Realign clify around copy-exemplar + validation-gate model (v0.2)#1
codeyogi911 merged 1 commit into
mainfrom
realign-v0.2

Conversation

@codeyogi911

Copy link
Copy Markdown
Owner

Summary

Realigns clify from "LLM reads commented skeletons and writes most of the CLI from scratch" to "copy hand-crafted exemplar + mechanically substitute + run validation gate" — modeled on google/agents-cli. Quality now comes from a tested exemplar in the repo; the LLM does a smaller, more verifiable transformation; the binary does deterministic verification.

The plan in `plan.md` was reviewed by Codex pre-implementation; the v0.2 scope here adopts its top simplifications:

  • Hard-fail nuances narrowed to pagination, idempotency, multipart, deprecated; the rest are soft-warns. Avoids prose-detection brittleness.
  • `sync-check` narrowed to hash-diff/advisory only; semantic regeneration stays in the skill.
  • Mock-server contract pinned for Node 20/22 determinism (port=0, awaited close, lowercase headers).
  • Doc work deferred (no `exemplar-walkthrough.md`); nuance heuristics folded into `validation-gate.md`.
  • One exemplar (auth-free JSONPlaceholder) for v0.2; auth-bearing exemplar flagged as v0.3 gap.

What's in the box

  • `bin/clify.mjs` — verb binary: `validate`, `scaffold-init`, `sync-check`, `scaffold` (info), `--version`, `--help`
  • `lib/{validate,scaffold-init,sync-check}.mjs` — deterministic, pure-JS phases
  • `skills/{clify-scaffold,clify-validate,clify-sync}/SKILL.md` — LLM-driven phases (13-step scaffold pipeline)
  • `examples/jsonplaceholder-cli/` — canonical A+ exemplar: full CRUD over 6 resources, smoke + integration tests, mock HTTP server, CI on Node 20/22
  • `references/{conventions,validation-gate}.md` — single-source contracts
  • `test/clify.test.mjs` — unit + deliberate-break tests for the validator
  • `.github/workflows/test.yml` — clify CI (runs unit tests, validates exemplar, runs exemplar tests on Node 20 + 22)

Removed: `skills/clify/` skeletons (`cli-skeleton.mjs`, `skill-skeleton.md`, `smoke-test-skeleton.mjs`). Salvaged: error taxonomy, `.env` loader, three-level help, knowledge schema, `.clify.json` shape, manifest cross-check rules.

Test plan

  • `npm test` (clify unit + deliberate-break) → 15/15 pass
  • `cd examples/jsonplaceholder-cli && npm test` → 47/47 pass on Node 22
  • `node bin/clify.mjs validate examples/jsonplaceholder-cli` → 19/19 checks pass, 0 warnings
  • Round-trip: `clify scaffold-init demo --target /tmp` → `cd /tmp/demo-cli && npm test` passes, `clify validate /tmp/demo-cli` 19/19 pass
  • Live: `jsonplaceholder-cli posts get --id 1` returns real API data
  • CI matrix on Node 20 + 22 (validate when this PR runs)
  • Manual end-to-end: in a fresh Claude Code session, `/clify-scaffold https://jsonplaceholder.typicode.com\` should produce output equivalent to the bundled exemplar

🤖 Generated with Claude Code

Inspired by google/agents-cli. Replaces "skeleton + LLM adapts" codegen with
"copy hand-crafted exemplar + mechanically substitute + run validation gate."

Architecture:
- bin/clify.mjs — verb-based binary: validate, scaffold-init, sync-check, scaffold (info)
- lib/{validate,scaffold-init,sync-check}.mjs — pure-JS deterministic phases
- skills/{clify-scaffold,clify-validate,clify-sync}/SKILL.md — LLM-driven phases
- examples/jsonplaceholder-cli/ — A+ exemplar (47 tests, full CRUD, mock server)
- references/{conventions,validation-gate}.md — single-source contracts

Validation gate (8 categories, deterministic):
  manifest, coverage, structural, nuances, secrets, ci, tests, schema
Hard-fail nuances limited to pagination, idempotency, multipart, deprecated
to avoid prose-detection brittleness; soft-warn for the rest.

Verification:
- 15/15 clify unit + deliberate-break tests pass
- 47/47 exemplar smoke + integration tests pass on Node 22
- Round-trip: scaffold-init demo --target /tmp produces a repo where
  npm test passes and clify validate passes
- Live: jsonplaceholder-cli posts get --id 1 hits real API
- CI matrix: Node 20 + 22

Throws out: skills/clify/ skeletons (cli-skeleton.mjs, skill-skeleton.md,
smoke-test-skeleton.mjs). Salvages: error taxonomy, .env loader, three-level
help, knowledge schema, .clify.json shape, manifest cross-check rules.

Plan in plan.md; codex pre-mortem incorporated into v0.2 narrowing decisions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codeyogi911
codeyogi911 merged commit eb9eb9b into main Apr 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant