@hiromima/design-loom
v0.1.0
Published
Harness-neutral, agent-drivable design-generation pipeline. Drive from any agent (Claude Code, Codex, CI) with pure bash.
Maintainers
Readme
design-loom
Harness-neutral, agent-drivable design-generation pipeline. A small bash state machine that runs a design pipeline (clarify → generate → structure → score → bundle) and can be driven from any agent — Claude Code, Codex, or a CI job — because the orchestration is pure bash + python3 + jq with no tool/MCP dependency.
npx @hiromima/design-loom run myproj 5dim.jsonWhy
Most "AI design pipeline" tooling is welded to one harness (a specific tool/skill API). design-loom separates orchestration (a portable state machine) from phase execution (swappable). The state machine emits a JSON contract per step; your agent decides how to run each phase. Same pipeline, any harness.
Install
npm i -g @hiromima/design-loom # or: npx @hiromima/design-loom <cmd>Requires bash, python3, jq. The quality gate (score) additionally uses the
gemini CLI for vision scoring and a screenshot backend (browser-use or headless
Chrome) — both optional; without them, score degrades to a neutral default.
Quickstart
# 1. Describe the job (5 dimensions)
cat > 5dim.json <<'JSON'
{"output":"HTML","fidelity":"hi-fi","option_count":1,"constraints":[],"ds_uik_brands":[]}
JSON
# 2. Initialize
design-loom run myproj 5dim.json
# 3. Drive the loop: get next phase -> run it -> mark complete
while true; do
R=$(design-loom next myproj)
S=$(echo "$R" | python3 -c 'import json,sys;print(json.load(sys.stdin).get("status",""))')
[ "$S" = "all_completed" ] && break
PH=$(echo "$R" | python3 -c 'import json,sys;print(json.load(sys.stdin).get("phase",""))')
# Run the phase per phases/<name>/PHASE.md, write outputs.json, then:
design-loom complete myproj "$PH" completed outputs.json
done
# 4. Inspect
design-loom status myprojCommands
| Command | Purpose |
| --- | --- |
| design-loom run <project> <5dim.json> | Initialize plan + state |
| design-loom next <project> | Get the next phase as JSON ({phase, skill, args, expected_output, hint}) |
| design-loom complete <project> <phase> <status> [outputs.json] | Mark a phase done (completed/failed/skipped/pending) |
| design-loom status <project> | Progress table |
| design-loom score <html> | Visual quality gate — normalized JSON ({score, axes, slop_flags, violations}) |
Bring your own phases
The bundled phases/{clarify,generate,structure,bundle}/PHASE.md are minimal
reference phases. The only coupling point is the JSON contract — see
phases/PHASE_CONTRACT.md. Swap in your own phases
freely.
Quality gate
design-loom score <html> renders the HTML, scores it on 5 axes (visual hierarchy,
consistency, spacing, typography, color harmony, 0–10), and flags AI-slop tropes
and font/size violations. The vision API key is read from the environment only
(GEMINI_API_KEY) — never hardcode it.
License
MIT — see LICENSE.
