.claude/skills/new-router/SKILL.md
Scaffold a new tRPC router with proper types, imports, and registration in the app router
npx skillsauth add jrmatherly/1dev new-routerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ask the user for the router name if not provided as an argument.
Read the pattern: Read src/main/lib/trpc/routers/projects.ts as a template for a simple CRUD router.
Create the router file: Create src/main/lib/trpc/routers/{name}.ts following the pattern:
publicProcedure and router from ../indexz from zod for input validation{name}Router const using the router() functionRegister in index: Edit src/main/lib/trpc/routers/index.ts:
import { {name}Router } from "./{name}"router({}) call inside createAppRouter: {name}: {name}Router,Confirm: Run bun run ts:check to verify the new router compiles.
// In src/main/lib/trpc/routers/index.ts
import { {name}Router } from "./{name}";
// Inside createAppRouter():
return router({
// ... existing routers
{name}: {name}Router,
});
The AppRouter type is automatically inferred from the return type of createAppRouter, so the client gets type safety with no extra work.
development
Background knowledge for AI agents before editing any file that handles authentication tokens or spawn environment variables in the 1Code enterprise fork. Triggers when touching src/main/lib/trpc/routers/claude.ts, claude-code.ts, claude/env.ts, feature-flags.ts, or claude-token.ts. Reminds the agent to consult the frozen Envoy Gateway strategy doc (auth-strategy-envoy-gateway.md v2.1) sections that impose hard rules on credential handling.
tools
Background knowledge for safely bumping the pinned versions of Claude CLI binary, Codex CLI binary, Electron, Vite, Tailwind, or Shiki in this repo. Each pin is load-bearing for a different reason — this skill encodes the per-pin rationale and the regression test that must pass before the bump can land. Use proactively whenever editing package.json, scripts/download-claude-binary.mjs, scripts/download-codex-binary.mjs, or any file that mentions these versions. Claude-only (background knowledge, not user-invocable).
development
Use when reading or writing any file under src/renderer/ that calls remoteTrpc.* or fetch(${apiUrl}/...). Verifies the call site is documented in docs/enterprise/upstream-features.md and warns if a new upstream-backend dependency is being introduced without a corresponding F-entry. This skill enforces the enterprise-fork posture documented in CLAUDE.md.
development
End-of-task sync — update CLAUDE.md, rebuild code graph, sync Serena memories, check roadmap drift, and commit. Run after completing any significant work to ensure all drift surfaces are current.