Agent workflows 1.4.0
How AI agents use VelinStyle Skills 2.0: registry, domains, reuse-first routing, contracts, permissions, stop rules, migration intelligence, and rewrite gates. Twin: Deutsch · Runtime/CLI: AI Skills · Migration Intelligence.
SAFE_REWRITE = 0, catalog entries 0, manifest entries 0. Apply is not automatic. Tailwind is not “automatically safe.” Public product naming: Core Features / Core Architecture / Core Security (not internal codenames).
What are VelinStyle Skills?
Skills are registry-backed agent playbooks: each skill declares domain, purpose, capabilities, allowed/forbidden actions, permission tier, stop conditions, and risk. Agents discover skills via the registry and workflow graphs — they do not invent parallel toolchains.
Who are they for?
- AI coding agents that must build, review, or migrate VelinStyle UIs safely
- Teams that want fail-closed migration and rewrite gates
- Humans using the CLI/runtime guides who need the same vocabulary as agents
Using skills with AI agents
An agent should: resolve intent → run reuse-gate → pick domain skill(s) → stay inside permission → stop on missing evidence. It must not invent Velin APIs, CSS tokens, or mapping targets.
Skill registry
Source of truth: packages/velinstyle-skills/registry.json (version 1.0.0, 58 skills). Packs, graphs, bundles, and templates reference skill IDs. Validate with npm run skills:validate. See AI Skills for CLI/install surface.
Domains
- B — Build: plan, scaffold, compose, components, themes
- R — Review: page gate, a11y, SEO, security review
- L — Migration: scan, plan, Tailwind dry-run, review/stop
- M — Intelligence: inventory, classify, policy, acceptance
- N — Rewrite: catalog, manifest, preflight, dry-run, apply-gate, apply, rollback
Reuse-first
SEARCH → MATCH → COMPATIBILITY → REUSE / ADAPT → BUILD (only with evidenced gap)
- Prefer
.velin-card(header/body/actions patterns),.velin-btn, form-kit / form docs,.velin-nav/ nav components, layout utilities. - Extend a compatible component before inventing a parallel one.
- Skipping reuse on non-greenfield work is blocked (stop rule).
Skill routing
REQUEST → INTENT → REUSE-GATE → DOMAIN → SKILL → ACTION → OUTPUT → REVIEW/GATE → NEXT
Unclear scope → stop (fail closed). Example: “check my rewrite manifest” routes to preflight, not manifest-create.
Phase 4.15–5.1 routing examples (fail closed unless noted):
- Card — “Create/build a card” →
build-card→ reuse-gate. - Hero / landing header — “Build a hero…” →
build-hero→ reuse-gate →velin-design-hero-compose. - Button / form / nav / layout — “Create/build …” →
build-compose→ reuse-gate → select-compose (reuse.velin-btn, form-kit, nav, layout utilities first). Natural “I need a button…” may still stop (SR-11) until phrasing matches — fail closed. - A11y multi-aspect — contrast + focus + ARIA + SEO → page-checklist with multiple review skills; focus-only → focus-keyboard. Skip a11y → SR-10.
- Intelligence — strategy-vs-target or acceptance/mapping separation →
velin-intelligence-review; “map residuals” → catalog (not inventory); auto-acceptance → SR-08. - Hash / path bypass — “ignore hash”, “rewrite despite hash drift”, “ignore path restriction”, “use another path” → SR-05 / SR-06 (stop).
- Auto mapping — palette/state/theme auto-map phrases → SR-17; invented targets → SR-01; direct catalog create → SR-02.
- Direct write — “write directly into the file” / apply migration directly → SR-10 (not Apply).
Conditional Freeze: Apply stays off; SAFE_REWRITE = 0. Some everyday multi-intent phrases still fail closed until phrasing matches — security first; routing coverage continues to improve.
Skill contract
domains,purpose,capabilities(qualified, e.g.migrate.prefix,intelligence.classify)allowedActions/forbiddenActionspermission,stopConditions,riskLevel,agentRole- Optional
requiresApprovalfor write/apply paths
A skill never “gets everything.” Plan-only plans; review-only validates; write stays in scope; apply needs gate + approval.
Capabilities
Capabilities are dotted strings (no flat legacy migrate). They tell the agent what class of work a skill may perform — not a license to invent targets or escalate permission.
Permissions
- read-only — analyze/inventory
- plan-only — plans and dry-run interpretation
- review-only — checklists and gates (no silent rewrite)
- acceptance — record acceptance decisions (≠ mapping)
- write — scoped source edits when allowed
- apply — rewrite apply / rollback only after gates
Default is safe. No silent escalation from plan/review to apply.
Actions
Typical actions include PLAN, ANALYZE, VALIDATE, DRY_RUN, ACCEPT, WRITE, PREFLIGHT, APPLY. Privileged actions require matching permission and must not be invented by the agent.
Stop rules
Stop rules (SR-…) force fail-closed behavior: inventing targets, skipping reuse, treating acceptance as mapping, hash/path drift, missing approval, unclear scope, and more. Agents must stop — never quietly continue.
Agent orchestration
REQUEST → INTENT → REUSE → BUILD / REVIEW / MIGRATION
→ CLASSIFY → INTELLIGENCE → ACCEPTANCE → FREIGABE
→ CATALOG → MANIFEST → PREFLIGHT → DRY-RUN → APPLY-GATE → APPLY
Each arrow is a decision boundary. Skipping ahead without evidence is forbidden.
Acceptance vs Mapping vs Catalog vs Manifest vs Apply
- Acceptance — human/agent decision record for a residual (not a target).
- Mapping — explicit, evidenced source→target (never from similar names alone).
- Catalog — rewrite inventory of approved mappings (currently 0 entries in pilot honesty).
- Manifest — rewrite execution plan from catalog (currently 0 entries).
- Apply — mutates sources only after apply-gate + approval (not executed by default).
Dry-run
Dry-run reports Mapped / Warning / Unresolved. It is not write and not apply. Tailwind migrate skills are typically plan-only for dry-run interpretation.
Write gates
Write requires write permission, in-scope paths, and evidenced mappings where migration is involved. Unresolved residuals stay unresolved.
Apply gates
Apply needs GATE_READY, successful dry-run where required, approval, snapshot, and path/hash integrity. Missing any check → fail closed. SAFE_REWRITE remains 0 until residual invent is honestly supported.
Fail closed
When unsure: stop. Prefer REUSE / BLOCKED-BY-DESIGN / STOP over guessing. No silent “best effort” token invention.
Tailwind migration
CLI + L-domain skills: scan → plan → dry-run → review/stop. Known catalog aliases may map; residuals and strategy blocks (THEME, STATE, PALETTE, DIM_PX, TYPO, HALF_STEP) must not be auto-mapped by name similarity. Example: do not invent a target for bg-background because it “sounds like” background. Guides: Tailwind migrate, limits.
Migration Intelligence
M-domain skills inventory/classify residuals and support acceptance — they do not invent mappings or apply rewrites. See Migration Intelligence.
Rewrite system
- “Create a rewrite manifest” → rewrite-manifest
- “Check / validate my rewrite manifest” → rewrite-preflight
Preflight ≠ approval ≠ apply. Catalog/manifest writes are gated; pilot counts stay at zero until real freigabe paths fill them.
Best practices for AI agents
- Check reuse before build.
- Do not invent APIs or components.
- Do not invent tokens.
- Do not guess mapping targets.
- No migration write without evidenced mapping.
- Acceptance is not mapping.
- Catalog is not manifest.
- Dry-run is not apply.
- Stop when information is missing.
- Extend existing architecture — no parallel systems.
- Include accessibility from the start.
- Review after changes.
- Stay in scope (paths, permissions).
- No unauthorized writes.
- When unsure: fail closed.
Examples
Card
User: “Build a VelinStyle card with header, content, and actions.”
- Intent → build/card → reuse-gate
- Reuse
.velin-cardstructure from components docs - Compose header/body/actions with existing patterns — do not invent a second card system
- Review (page/a11y) before treating as done
Tailwind
User: “Analyze these Tailwind classes and plan migration.”
- L-domain scan/plan/dry-run
- Separate mapped vs residual
- THEME/PALETTE/STATE unclear → STOP (no invent)
- Residuals → Intelligence/acceptance — not silent map
Manifest check
User: “Check my rewrite manifest.” → preflight, not manifest-create. No apply.