v0.5.0-prerelease — Phase 4: Agent-Loop + Skill-Korpus
Pre-releaseAgent-loop CLI primitives + skill-corpus (30 markdown files, 2854 lines)
encoding Samuel's vault anti-slop doctrine, UI-UX-Pro-Max corpus (MIT fork),
Huashu directions, and Open-design's 5 OKLCh presets as an integrated
discoverability surface.
Critical architectural insight: Claude Code's reasoning IS the agent.
src/agent/poll-loop.ts provides one-shot pollOnce and postEvent
primitives; the while-loop lives declaratively in
skills/wisp-design/SKILL.md. Restartable across Claude sessions because
the bridge holds the cursor, not the agent.
What landed
Contracts (src/contracts/agent.ts, 433 lines)
PollOnceOptions,PollOnceResult,PostEventOptions,PostEventResultVariantGenerationRequest/Responsewith 5 variant axes
(hierarchy/layout/typography/color/density)BrandSpec(9-section, name+oneLiner required, rest optional)DesignTokens,SyncSource,SkillsIndexResult- Constants:
POLL_LOOP_DEFAULT_TIMEOUT_MS=270000,
ALLOWED_VARIANT_ANCHORS(13),ALLOWED_VARIANT_COUNT({1,3,5,8}),
VARIANT_RATIONALE_MAX_LEN=180
Agent modules (src/agent/, 4 files / 1144 lines)
_helpers.ts(187) -readPortLockwith PID-liveness probe,parseFlags,
typedPortLockMissingError/PortLockStaleErrorpoll-loop.ts(366) -pollOnce+postEvent(Node 20+ fetch +
AbortController with 5s headroom),routeEventexhaustive switch,
runPollOnce+runPostEventCLI runnersskills-index.ts(309) -indexSkillsrecursive walk + namespace counting,
searchSkillsBM25-lite with sqrt-length-norm,runSkillsdispatcher
(index/search/--help)sync.ts(282) -syncFromVaultwith minimal glob compiler, SHA-256
idempotent skip, YAML attribution frontmatter,runSyncCLI
CLI lazy-load (src/index.ts + tsup.config.ts)
String-variable indirect import pattern bypasses TS module resolution at
compile time. tsup multi-entry now emits dist/agent/poll-loop.js,
dist/agent/skills-index.js, dist/agent/sync.js so the dispatcher's
runtime await import(...) resolves successfully.
Skill corpus (skills/, 30 files / 2854 markdown lines)
wisp-design/SKILL.md- auto-trigger skill with loop pseudocodereference/-live.md(KERN variant-generation prompt) + 5 themed
sub-prompts (polish,bolder,quieter,colorize,layout)policy/anti-slop.md- 7 Vault hard-bans (em-dash UI, gradient text,
default glassmorphism, hero-metric template, side-stripe, purple-blue
gradient, generic AI illustrations) + Huashu 5-dim self-critiquemethodology/narrative-questions.md- 4 Pre-Code questions
(Role / Distance / Temperature / Capacity)methodology/junior-designer-flow.md- 4-phase Stub > Checkpoint > Fill > Verifymethodology/brand-asset-5-10-2-8.md- 5min / 10min / 2h / 8w protocol
(opt-in via--brandflag per Open Decision #4)data/anchors/- 13 variant anchors (5 vault apps: Linear, Stripe,
Anthropic, Aceternity, Apple + 5 Open-design presets: editorial,
modern-minimal, tech-utility, brutalist, soft-warm + 3 vault-adjacents:
restrained-cool, committed-indigo, drenched-warm)data/directions/- 00-INDEX with 25-direction list + README with MIT
attribution to huashu-designdata/corpus/- INDEX + README (UI-UX-Pro-Max MIT attribution) +
30-row sample CSV demonstrating Quadruple shape
Open Decisions confirmed
- #4 Brand-Asset 5-10-2-8: opt-in via
--brandflag, default off - #5 UI-UX-Pro-Max: MIT-fork with attribution (Phase 4 ships INDEX +
sample; full 14-CSV fork deferred to Phase 7) - #6 Vault-sync: explicit
wisp-design synccommand only, no watcher
Doctor (now 9/9 OK)
Added checkSkillsLayout + checkSkillManifest as WARN (not FAIL) so Phase 0
checkouts don't trip the gate.
Tests (tests/agent/ + tests/skills/, 77 new in 5 files)
poll-loop.test.ts(20) - bridge integration on port 31370, pollOnce/
postEvent happy + error paths, routeEvent exhaustive, CLI runner I/Oskills-index.test.ts(19) - enumeration, search relevance, CLI dispatchsync.test.ts(15) - glob matcher, idempotent SHA skip, attributionskill-corpus.test.ts(15) - file existence, frontmatter, axis coverage,
hard-ban presence, anchor count, attribution presenceanti-slop-canary.test.ts(8) - mission-critical canary locks the 7
hard-bans + all 5 critique dimensions against silent removal
Cumulative: 347/347 tests green (77 agent/skills + 99 source + 94 browser
- 77 bridge + 2 smoke + extras).
Quality gates
typecheck: clean
test: 347/347 in ~4s (24 files)
build: index.js 11.92 kB + agent/poll-loop.js 21.40 kB +
agent/skills-index.js 16.27 kB + agent/sync.js 17.66 kB +
live.js 31.30 kB
doctor: 9/9 OK
Phase-4 deferred items (Phase 7 launch prep)
- Full UI-UX-Pro-Max 14-CSV fork with AgentDB HNSW indexing
- Full Huashu 20+ directions content fork (reconcile synthesized list with
upstream) - Real AgentDB pattern-store wiring (currently in-process BM25-lite, marked
agentDbController: "phase-4-stub"per Phase-4 contract)
Next
Phase 5 - Verification-Gate (USP). Anti-slop linter that enforces the 7
Vault hard-bans on generated CSS; axe-core a11y delta with AA-blocking
policy; multi-viewport screenshot (375 / 768 / 1280 / 1920 + light + dark);
console-clean scan; tab-order smoke; reduced-motion diff. Verification-Gate
runs PARALLEL to LLM generate, not sequentially. Total p95 budget <= 3s.
This is the central wisp-design differentiator - no other live-edit tool
gates accept on a11y + screenshot + anti-slop.