What is Codewright?

Codewright is a curated, versioned knowledge base of terminal workflows — recipes — for tasks developers repeat constantly: killing a process on a port, undoing a commit, cleaning up Docker disk usage, resetting a dev database, and more. Every recipe is written once and generated out to five surfaces, so humans and coding agents get the exact same safety net wherever they work.

It exists because the alternative is re-Googling the same command, pasting it from a chat model unverified, or letting a coding agent invent a shell command on the fly — with no risk classification, no undo path, and no way to confirm it actually worked.

Why this exists

Without Codewright
  • Re-Google the same fix every few weeks
  • Paste a command from a chat model, unverified
  • An agent invents a shell command on the fly
  • No idea if it's destructive, outdated, or right for your OS
With Codewright
  • One reviewed recipe per task, versioned in git
  • Risk classified before anything runs
  • A documented undo path and a verification step
  • The same recipe, on macOS, Linux, or Windows

Anatomy of a recipe

Every surface below is generated from documents that look like this one — an actual recipe from the library, in full.

Undo the last commit

git.undo_last_commit · v1 · category: git

Medium risk

Moves the current branch back one commit while keeping the removed commit's changes staged, so they can be amended or committed again.

Platforms

macOS · Linux · Windows — identical steps on all three

Steps

Read-only

Inspect the working tree before changing branch history

git status --short
Medium risk

Remove the last commit while keeping its changes staged

git reset --soft HEAD~1

Verify

git status --short

The previous commit's changes are staged in the working tree.

Undo

Restore the branch tip to its position before the reset

git reset --soft 'HEAD@{1}'

Pitfalls

Fails in a repository with only one commit, since HEAD~1 doesn't exist yet. Prefer git revert on a shared branch to avoid rewriting published history.

The safety system

Four risk levels, applied to every step of every recipe — not just the recipe as a whole. Anything above low can be gated behind explicit confirmation.

Read-only

Inspects state without changing anything.

Low risk

Reversible with a routine follow-up command.

Medium risk

Changes state; undo path documented.

Destructive

Deletes or overwrites; confirmation required.

  1. 01

    Inspect

    Read the recipe's risk level, platform, and parameters before anything runs.

  2. 02

    Act

    Render the exact command for your platform. Nothing executes without your say-so.

  3. 03

    Verify

    Run the recipe's own verification command and confirm the outcome.

  4. 04

    Undo

    If it went wrong and an undo path exists, it's documented on the same recipe.

One recipe, five surfaces

Whichever way you found Codewright — this website, an MCP config, an npm package, or a GitHub repo — it's the same reviewed recipe library underneath. A recipe is authored once and can never drift out of sync across the five.

Human use

Website

Browse and search every recipe: platform tabs, risk badges, copy buttons, undo instructions, and troubleshooting notes.

curl "https://codewright.tools/api/v1/recipes/search?q=undo%20last%20commit"
Browse the recipe library
Integrations

Public API

REST endpoints that return recipes as structured JSON — list, search, get, and render-with-parameters. No auth required, rate-limited per IP.

curl -X POST "https://codewright.tools/api/v1/recipes/git.undo_last_commit/render" -H "Content-Type: application/json" -d '{"platform": "macos"}'
Read the API docs
Claude · Cursor

MCP server

Every recipe exposed as an MCP tool — search_recipes, get_recipe, render_recipe — so an MCP-compatible agent host calls a curated workflow instead of inventing a shell command.

claude mcp add codewright -- npx -y @codewright/mcp
MCP server docs
Coding agents

Agent skill

Encodes the same policy an experienced engineer would apply: inspect before you act, ask before anything destructive, verify after acting.

pnpm --filter @codewright/agent-skill recipe render git.undo_last_commit macos
Agent skill docs
Terminal

Companion CLI

Preview a recipe, confirm if it's risky, execute, then verify the outcome — all from your terminal.

npx @codewright/cli run git.undo_last_commit
CLI docs

Don't know which surface you need yet? One command detects your agent harness and wires up the MCP server and skill.

npx @codewright/install

Under the hood

The stack the five surfaces run on, and the two pipelines that keep the recipe library — and the codebase itself — moving.

LayerChoiceRole
FrameworkNext.js, App Router, TypeScriptOne app serves the website and the /api/v1 routes
DatabaseSupabase (Postgres)Compiled recipe index, full-text search, favorites
Recipe sourceVersioned YAML in-repoReviewed like code; compiled to DB/JSON at build time
ValidationZodOne schema validates YAML in CI and API payloads at runtime
HostingVercelPersistent staging on staging, production on main
AuthClerkGates only personalization — favorites, saved runbooks

Recipe curation pipeline

New recipes move through a fixed sequence — AI draft → schema validation → deterministic risk-score → human or agent review — before they ever reach the library. Nothing is published on an AI's say-so alone.

The build loop

Codewright is built by an autonomous fleet of agent sessions, coordinated through GitHub Issues and PRs — this page included.

workerreviewerplannerfixer

Where it stands

Delivery runs in phases; issues within a phase run in parallel through the agent loop.

Phase 0Foundation & the loopShipped
  • pnpm + Turborepo monorepo
  • Next.js App Router scaffold
  • CI: lint, typecheck, test, build, recipes-validate
  • Recipe schema + validator CLI
  • Keyless agent-janitor workflow
Phase 1Recipe knowledge baseShipped
  • ~100 seed recipes across six categories
  • YAML → JSON compile step
  • Supabase index + full-text search sync
  • Recipe style guide
Phase 2SurfacesIn progress
  • Website: browse, search, recipe pages
  • Public API v1 + OpenAPI doc
  • MCP server, published to npm
  • Agent skill: risk policy + confirm/verify
  • Landing page with real product copy
  • Clerk sign-in + favorites (not yet shipped)
Phase 3Post-MVPNot yet groomed
  • User-submitted recipes + curation pipeline
  • Team runbooks, versioned workflows
  • Multi-step diagnostic workflow recipes
  • Licensing decision — open-source, no paid tiers

Where to go next