-
Scope and align. Read CLAUDE.md and locate the task in
docs/roadmap/current.md. Read the ADRs it touches
in docs/decisions/ and the relevant
docs/standards/ โ at minimum
code-style-typescript.md,
error-handling.md, and
testing.md. Confirm which package owns the work
and that the change stays within scope (engine logic in packages/core, never a
surface; desktop is agent-management, not an IDE).
-
Inspect before editing. Find the existing patterns and mirror them โ do not invent
a new shape next to an established one. Grep/Glob for the nearest analogue (an
existing adapter under packages/llm/src/adapters/*, a sibling node type, a Zod schema
in packages/shared). Note the error types, the test layout (*.test.ts beside the
code), the export surface (index.ts), and the seam types it depends on.
-
Plan โ confirm only when it matters. Write a short plan (files to touch, the
approach, the tests). Stop and confirm the plan with the maintainer if the change
touches any of: a package's public API / exported index.ts, an Accepted ADR's
decision, the @relavium/llm seam (llm-provider-seam.md),
the keychain/secrets path, or introduces a new surface or runtime dependency.
Otherwise proceed. A new runtime dependency is not a plan item โ it needs an
ADR first (see step 5).
-
Implement against the standards. Write strict TypeScript: no any (use unknown +
a Zod guard at boundaries), no unsafe as, no @ts-ignore. Typed, discriminated errors
per error-handling.md โ never throw "string",
no silent catches, no floating promises, thread the AbortSignal. Validate untrusted
input (YAML, IPC, provider responses) with Zod at the boundary. Keep side effects at the
edges so the engine stays pure. Add tests as you go โ engine logic in
packages/core/packages/llm, not only at a surface; a bug fix gets a regression test
that fails before the fix.
-
Self-check vs the standards and the seam rule. Before running the toolchain, walk
your own diff against the code-review checklist
and verify the non-negotiables hold:
- The seam holds: no vendor SDK type (
@anthropic-ai/sdk, openai, @google/genai)
imported outside packages/llm/src/adapters/*; the engine pattern-matches only on
Relavium/Zod types (ADR-0011).
grep -rn "@anthropic-ai/sdk\|from 'openai'\|@google/genai" packages apps | grep -v 'packages/llm/src/adapters/'
should be empty (same scope as the standards-check skill โ all packages + apps minus the adapters folder).
- Engine purity:
packages/core has zero platform-specific imports (no node:*,
no Tauri, no DOM) โ it runs in Node, the Tauri WebView, and the extension host alike.
- No new dependency without an ADR: check the
package.json diff.
- Secrets: no key in a log, an error message, an IPC payload to the WebView, a
Zustand store, or a
node:failed/run:failed event.
- Canonical names: colon-namespaced run events and
sequenceNumber, never the
legacy dotted names.
-
Run the toolchain. pnpm turbo run lint typecheck test, then pnpm turbo run build.
Fix every failure โ a red lint, type error, or test is a blocker, not a warning. The
author runs this before asking for review; review is not a substitute for the toolchain.
-
Update adjacent docs. If the change alters a spec (workflow/agent YAML, the SSE/run
event schema, the IPC contract, DB DDL, node types, tools, CLI commands), update its
one canonical home under docs/reference/ โ never paste a
copy elsewhere. A non-trivial decision gets a new append-only
ADR from
adr-template.md. Touch the
architecture/ page or
glossary.md if the change introduces or shifts a concept.
-
Commit. Use ../commit-and-pr/SKILL.md โ Conventional
Commits, one scope per package, Refs: ADR-XXXX when the change implements a decision,
body ending with Co-Authored-By: Claude <noreply@anthropic.com>. See
commit-style.md.
-
Summary. State what changed and why, which files moved, which standards/ADRs apply,
the toolchain result (lint/typecheck/test/build all green), and any docs updated. Call
out anything you deferred or any rule you had to flag.
-
Produce a review prompt. Emit a copy-paste block the maintainer can hand to the
relavium-reviewer agent (see ../../agents/relavium-reviewer.md),
naming the branch/diff, the package scope, the ADRs it implements, and any area you
want scrutinized (e.g. "verify the seam holds in the new adapter").