metalogica
- 14 skills
- 0 followers
- 17 hours ago last updated
- ▌ Init · metalogicaScaffold a new Substrate project in an empty directory. Drops a Vite + Convex + Clerk + TanStack Router + Tailwind v4 kernel that follows DDD, railway-oriented programming, and the testing pyramid. Runs product-focused Socratic Q&A, copies doctrines and SDD protocol into docs/, and generates the twin Gemini AI Studio scaffolding prompt plus runtime AI system prompt. Invoke in a blank folder before /substrate:migrate.
- ▌ Adopt · metalogicaInstall substrate's stack-agnostic docs/doctrine/gate kernel onto an existing repo of ANY language or framework — without scaffolding an opinionated stack. Drops in AGENTS.md (canonical, with a CLAUDE.md symlink), docs/doctrine/ (the enforced manifest + zero-dep doctrine-lint + the agents & parallel-execution meta-doctrines), docs/protocol/sdd/, docs/tasks/, a substrate.yaml gate block wired to YOUR compile/test/lint commands, a pre-commit hook, a CI workflow, an initialized tbd bead tracker, and generated ambient doctrine skills (.claude/skills/doctrine-*/, one pointer stub per manifest entry so every session self-loads relevant doctrine) — then leaves doctrine-lint green. This is the symmetric opposite of /substrate:migrate (which brings a Gemini prototype INTO the Convex kernel): adopt makes an already-bootstrapped repo satisfy substrate's artifact contract so /substrate:architect-spec, /substrate:execute, /substrate:quick-spec, /substrate:diagnose, and /substrate:add-doctrine work against it. Invoke in th
- ▌ Spool · metalogicaClose a big-context session and reopen it in a fresh one through a lightweight, verified pointer — cheaper and safer than /compact or /clear. `spool` is a store-and-forward context carrier at the campaign tier (a meta-brief governing N sequential specs): it re-derives live state from the repo (git head, branch, working-tree deltas, completed vs ongoing specs, open beads, gate commands, any project-specific head/version anchor), diffs that against what the chat believed, and at a SINGLE human-in-the-loop checkpoint surfaces every unverifiable claim and every conflict (repo contradicts a chat-held belief) for you to adjudicate — it never asserts past a conflict. It then writes a self-contained launcher to an out-of-repo, ID-keyed, TTL-swept store (`~/.substrate/spool/`), so producing a spool commits nothing. `/substrate:spool --resume <id>` unspools into a fresh session: it re-verifies the volatile anchors (which may have advanced since capture), confirms the reconstructed understanding, then deletes the spool
- ▌ Deploy · metalogicaStage 3 production deploy for substrate projects. Covers public *.vercel.app deploy, custom domain + 5 Clerk DNS CNAMEs + SSL, Clerk prod instance with domain-typo confirmation, prod Convex deployment, env sync via .env.prod, and optional GCP OAuth. Five phase markers (A–E) so you can stop or resume without redoing completed work. Invoke after /substrate:migrate once local sign-in is verified.
- ▌ Execute · metalogicaThe ATTENDED single-window execution mode: run a multi-phase SDD spec (produced by /substrate:architect-spec) with one implementing agent while a human co-pilots, pausing at each step/phase gate for approval. Invoke with a spec path (docs/tasks/ongoing/<feature>/<feature>-spec.md). Walks Phase N → Step N.M → Verify → Gate per docs/protocol/sdd/execution-format.md. This is the single-window (K=1, human-in-the-loop) alternative to the primary door /substrate:orchestrate, which runs K context-budget windows as an unattended parallel worktree fleet. Choose execute when you want to watch/adapt one window, or the spec fits one window and you prefer HIL. Best run in a fresh Claude session for a clean context window.
- ▌ Migrate · metalogicaMigrate a Gemini AI Studio prototype into the substrate kernel. Expects prototype/ (Gemini Build export) alongside a scaffolded substrate project. Spawns domain/backend/frontend architects in parallel to analyze the prototype against substrate doctrines, drafts Convex schema + functions from inferred data shapes, moves components into src/ with doctrine alignment, wires Clerk+Convex providers, and presents a migration plan for approval before executing. Invoke after /substrate:init + Gemini handoff, before /substrate:deploy.
- ▌ Diagnose · metalogicaDiagnose a specific error and ship the fix. Takes an explicit error message + optional file:line / timestamp / repro steps. Matches the failure to the relevant doctrine via a path-layer + manifest-trigger + symbol-search composite, generates ranked hypotheses with evidence, then dispositions the fix: patch inline (verify both the green gate AND that the original error no longer reproduces, then commit), or — when the root cause is known but the fix is multi-bead / crosses file-windows — graph it into a Spike→Fix bug epic under the canonical epic:<slug> label plus an additive kind:bug tag, ready for /substrate:orchestrate or /substrate:execute. Loops on failure with accumulated context. Use this when you have a known error and need root cause + fix; use /substrate:quick-spec when you already know what to change.
- ▌ Graph Spec · metalogicaGraph the Spec — decompose a written SDD spec into a directed acyclic graph of tbd beads so it can be executed in parallel. Invoke with a spec path (docs/tasks/ongoing/<slug>/<slug>-spec.md), or run with no args to discover the ongoing spec. Parses the spec's Prompt Execution Strategy (phases → steps), turns each unit into a bead, infers blocked-by edges from which files/symbols a step consumes vs. creates (folding behavior-invalidated tests into the changing bead's write-scope), cycle-checks via Kahn, partitions the DAG into context-budget windows by file-adjacency (group:<window-N> labels — the unit the orchestrator dispatches), stamps doctrine:<id> labels where a bead's write-scope intersects the doctrine manifest's paths: globs, and persists an epic + child beads under the canonical label epic:<slug>. Prints the wave shape via docs/scripts/bead-graph.sh. Called automatically as architect-spec's final step, or standalone to (re)graph any existing spec. Produces the DAG only — the parallel-execution doctrin
- ▌ Quick Spec · metalogicaLightweight single-feature iteration loop for substrate projects. Plan (skeleton-of-thought grounded in relevant doctrine) → implement → verify (compile + lint + test) → manual test → commit. Use this for small, well-scoped changes. For larger features that warrant a multi-phase spec with architect analysis, use /substrate:architect-spec instead.
- ▌ Serve Bead · metalogicaThe serve daemon's headless lane skill — what a `claude -p` session runs inside a freshly-cut worktree to execute ONE bead end to end. Assess the bead against the repo; if it is too under-specified to act on, say exactly what is missing and exit WITHOUT committing (the machine's equivalent of asking). Otherwise declare a write scope, implement inside it, run the repo's own substrate.yaml gate until green, and leave exactly one local commit. Never runs tbd. Never pushes in local mode. Invoked by `substrate serve` / `substrate triage`, not by a human at a keyboard — there is no one to approve a plan or answer a question, so this skill has no approval pauses.
- ▌ Orchestrate · metalogicaThe PRIMARY execution door: run a graphed bead DAG as a parallel git-worktree fleet, operationalizing agents-parallel-execution-doctrine.md. Invoke with an epic (epic:<slug>) or a spec path whose epic has been graphed by /substrate:graph-spec. Reads the context-budget partition (group:<window-N> labels), cuts a feat/<epic-slug> integration branch, walks the DAG wave-by-wave, dispatches one group-runner per file-disjoint ready WINDOW in its own worktree (off the current integration tip, one seed+install per window), gates each bead in sequence, merges on green, re-gates the integrated tip, pauses between waves (--auto to skip), writes .substrate/execution-state.json, and lands one signed squash commit on trunk. Single-writer tracker (only the orchestrator runs tbd/git push). Tool-agnostic: Agent tool on Claude Code, Task tool on OpenCode; a CC-only Workflow fast-path is layered over the same loop. Consumes the DAG — it does not re-derive it. /substrate:execute is the attended single-window alternative. Fail-sa
- ▌ Add Doctrine · metalogicaScaffold a new doctrine in a substrate project. Asks where the doctrine should live, what it governs, which trigger keywords activate it, which file globs it governs (`paths`, optional — the key graph-time doctrine binding reads), and what layer-hint it carries. Writes a doctrine stub with Scope / Binding Rules / Recommended Practices / Anti-patterns / Examples sections, and either appends an entry to the existing doctrine-manifest.yaml or offers to bootstrap a manifest from scratch (registering every existing *-doctrine.md plus the new one) so the manifest stays the single source of truth. Also retires a doctrine — `--retire <name>` confirms the blast radius, folds still-true rules into surviving doctrines, removes the manifest entry, git-mv's the file to docs/doctrine/archive/, and sweeps its now-orphaned ambient pointer stub, so a dead doctrine stops being binding. Does not commit — the user reviews first.
- ▌ Architect Spec · metalogicaTurn a manually written brief into an executable multi-phase spec with verification gates. Invoke with a brief path (docs/tasks/ongoing/<feature>/<feature>-brief.md). Runs Socratic Q&A inline, discovers the project's doctrines via manifest or glob, dispatches one `doctrine-architect` subagent per relevant doctrine in parallel, composes their structured recommendations into a spec following the SDD protocol, and writes docs/tasks/ongoing/<feature>/<feature>-spec.md. Then graphs the spec into a bead DAG (epic:<feature>) via /substrate:graph-spec so it can be executed in parallel. Hands off to /substrate:orchestrate (the primary door — a parallel worktree fleet) in a fresh session, with /substrate:execute as the attended single-window alternative.
- ▌ Synthesize Session · metalogicaTerminal phase of the SDD lifecycle — runs once per feature after /substrate:execute archives a spec, before the human moves on. Captures non-obvious session learning that the spec/commit format can't carry, and converts it into atomic doctrine fixes (capped at 5, leverage-ranked), session-filled draft doctrines for architectural axes the session introduced that no existing doctrine governs (coverage-map detection, capped at 3, per-candidate gated, own commit, written via /substrate:add-doctrine's writer), beads with state-transfer prompts so a fresh Claude Code agent can pick the work up cold, and parked open-design-questions filed as beads with `status: parked`. Reports per-epic doctrine bound-vs-cited telemetry (Step 6.5, report-only) off graph-spec's `doctrine:<id>` labels, flagging any doctrine bound to ≥3 beads and cited in none as a `paths:`-or-content audit. Does NOT queue doctrine amendments — ratify-only doctrine changes are applied in-epic by the executor's terminal Doctrine Reconciliation phase; n