FFFF GitHub - Zabaca/crux: Structured residue layer for product discovery thinking in Claude Code conversations — Bun+TS+libSQL CLI with enforced workflow invariants. · GitHub
[go: up one dir, main page]

Skip to content
ZabacaPublic

About

Structured residue layer for product discovery thinking in Claude Code conversations — Bun+TS+libSQL CLI with enforced workflow invariants.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

199 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crux

Structured residue for product discovery done in Claude Code conversations.

Why it exists

Product discovery inside a chat session is high-quality in the moment and lost by morning. Each new conversation restarts cold. Decisions fade, rationale fades, and across parallel engagements there's no way to see which ones have a defined direction vs. which are drifting.

Run a few engagements through Claude Code and the problem compounds. The mental overhead of re-deriving context starts eating more time than the work, and "file another scattered doc" becomes the path of least resistance. That's a self-imposed cap on how many projects you can actually hold.

Crux is a structured residue layer: capture the output of a discovery conversation as it happens, reload it into future sessions as model-shaped context rather than prose to re-parse, and make parallel workstreams comparable so drift becomes visible.

What it is

A typed entity model with workflow invariants enforced in code, fronted by a CLI designed for Claude Code to operate.

Entity Role
Principal The identity a client acts as: a token, not a person. Owns what it files.
Workstream A coherent area of focus (per client, per product).
Observation Atomic intake. Cheap to create, never deleted.
Problem Synthesized "there's a thing worth solving."
Evidence Links an Observation to a Problem with a why-note.
Attempt A pointer to work about a Problem happening in another tracker.
Abandonment Graveyard for Problems we gave up on, with reason.
Outcome What became of a Problem; recording one is what marks it done.

The entity model is the product. Workflow transitions — schedule a Problem, file an Attempt, close one with the judgment that ended it, record an Outcome — are plain functions with invariant checks. You can't close an Attempt twice. You can't record a second Outcome against a Problem the first one closed. You can't archive an Observation that is already archived. The rules are code, not documentation.

How it works

Claude Code is the primary surface. You discuss problems and the work against them in conversation, and Claude files entries inline through the crux CLI at natural pause points — not as end-of-session ceremony. The CLI is optimized for Claude to run and parse: JSON output by default on every read command — --json is still accepted and ignored, so do not reach for it — structured errors with stable codes, meaningful exit codes.

To reload context into a fresh session, walk three cheap reads rather than asking for one digest of everything:

crux workstream list                    # which corpora exist, by slug
crux problem list -w <slug>             # every Problem: id, stage, title
crux problem show <id>                  # the two or three that matter

A Problem is filed unscheduled and stays there until somebody stages it, so the middle read is deliberately unfiltered: --status now narrows it to the field, and narrowing by stage is what hides the newest synthesis. The six stages are unscheduled, now, next, later, done and abandoned; an unrecognised value is not refused, it simply matches nothing.

Each is flat in the size of the corpus, and the agent pays only for what it reads. crux evidence list <id> and crux attempt list <id> open the layer under a Problem when a Problem is worth that; crux observation list -w <slug> --unlinked is the intake nobody has synthesized yet. Anything that acts on a Workstream names it with -w and refuses without one — there is no current Workstream to inherit.

The honest cost of that shape: getting warm is several calls rather than one, and the cheapest thing an agent can do is no longer the complete thing. What it buys is that the cost stops growing with the corpus — the digest that used to answer this in one call inlined every Observation behind every Problem, which made the command whose whole purpose was to be cheaper than re-deriving context more expensive than re-deriving it.

For cross-project audit, crux queries across all workstreams in the same shape — the answer to "where do my active engagements actually stand?" is one command, not a doc hunt. "All workstreams" means all of yours: every read is scoped to the Principal that made the request, and one Principal's corpus is invisible to another's (ADR-0013).

A row that turns out to be wrong is corrected rather than left standing:

crux problem revise <id> --title "..." --description "..." --reason "..."
crux observation revise <id> --content "..." --reason "..."
crux attempt revise <id> --ref "..." --label "..." --note "..." --reason "..."
crux problem revisions <id>          # and `observation revisions`, `attempt revisions`

Every prose-bearing row works the same way, through the same pair of verbs: crux evidence revise <EVD-###> --note, crux outcome revise <OUT-###> --observed-impact --learnings, crux abandonment revise <ABN-###> --rationale, and crux workstream revise -w <slug> --title --description. The last of those has no --slug, and asking for one is refused rather than quietly dropped: a slug is how a Workstream is addressed — by every -w, every URL and every reference an agent has stored — rather than something the row said, so crux workstream rename keeps it (ADR-0016).

Correcting an Outcome or an Abandonment rewrites a terminal judgment, which is deliberate. What it does not do is reopen anything: the Problem stays done or abandoned, it still has the one Outcome it is allowed, and the history is what makes that safe — a retracted measurement leaves a trace instead of quietly becoming a different claim.

Only the fields named change, naming none is a refusal rather than an empty write, and --reason is optional — the model demands one at terminal doors and leaves it optional at reversible ones, and a revision is reversible because you can revise again. The row itself stays the single source of current truth; what it used to say goes to a revisions table that no ordinary read touches. Every read that shows a revisable row carries a marker — that the row was revised, and how many times — resolved inside the wave that read already issues, and the history is the second read above: crux problem show, crux observation show, crux workstream show, crux outcome show, crux abandonment show, and every row crux attempt list and crux evidence list answer with (ADR-0017). The Problem page and the Observation page in the browser carry the same marker, on the same terms: it joins the wave those pages already issue, a row nobody has corrected shows nothing at all, and there is no diff viewer — what changed, and the optional reason it changed, are the revisions read and stay there. Correcting a row is not the same claim as archiving one: revision says what I wrote was wrong, archiving says what I wrote was right and has stopped being live.

An Observation is editable despite the model calling it a raw signal, because the freeze was always a proxy for durability — an edit with no record is indistinguishable from a fabrication — and the history now supplies that directly. An archived Observation is still revisable: it stays reachable by id and under any Problem's Evidence, so a falsehood in it still informs a live conclusion. Nothing under revise touches an Attempt's status: getting a ref wrong used to cost a terminal transition, since the only repair was to close it dropped and refile, which left a dropped Attempt representing no abandoned work. A closing note may only be corrected on an Attempt that has one.

Before a Problem gets synthesized, the one that already exists has to be findable:

crux search "<a few distinctive words>"

That searches Problem titles and descriptions and Observation content, every Workstream by default (--workstream <slug> narrows it, --show-archived widens it), and answers with the matching rows plus the slug of the Workstream each belongs to — enough to judge whether it is the same thing. Duplication is handled by finding, not by merging: Observations are deliberately cheap and duplication among them is by design, while a near-twin Problem splits one thing's Evidence across two rows. The skill requires the search and prefers attaching Evidence to the Problem it finds. Matching is a case-insensitive substring rather than FTS5 — that choice was settled by probing D1 inside workerd, where FTS5 works but tokenizes (MATCH 'auth' misses "reauthentication") and refuses raw user text as a query; the read's shape does not encode it, so it can be swapped at a larger corpus.

An archived Observation is out of that search, and out of crux observation list and the board, unless --show-archived asks for it. Archiving is the recorded judgment that a row has stopped being live (ADR-0017), and a listing that hands one back as though it still were is how a retired row silently informs a live conclusion. What is not filtered is naming a row — crux observation show OBS-17 still answers — or reaching one through Evidence: that link is a deliberate assertion that this Observation supports this Problem, so hiding it would gut the Problem's argument rather than protect it. The cost, taken knowingly, is a weaker duplicate hunt: a retired row no longer surfaces to the search run before filing, and re-filing a cheap Observation is the better of the two failures.

Install (Claude Code plugin)

The intended way to adopt Crux is as a Claude Code plugin. One command adds the skill, slash commands, and CLI to every session:

/plugin marketplace add Zabaca/crux
/plugin install crux

There is no account to create and no token to paste. The first command that touches the corpus mints a Principal against the public deployment — a token, not a person — writes it into config.toml, and everything you file belongs to it (ADR-0013). Every read is scoped to that Principal, so what you see is what you filed.

It says so when it happens, on stderr, because a credential written without being asked for is news. The file is owner-only — mode 600 in a mode 700 directory, chosen rather than left to umask, and an older config found looser has group and other taken off it on the next read — since anything that can read it owns the corpus. Narrowing only: a config you hardened further stays that way, and one that is a symlink is left alone rather than having its target re-moded. The deployment keeps only the token's hash, so it can neither reissue nor recover one: losing that file, or moving to a second machine, strands the corpus with nothing left that can prove it is yours. Claiming is the escape hatch, which makes it about durability before it is about the cap.

An unclaimed Principal files against a free allowance — two hundred Observations on the public deployment. Past it, a write refuses with CAPACITY_EXCEEDED, whose details carry the URL to claim the Principal and lift the cap. Reads are never gated by it: reloading context into a fresh session keeps working with the allowance spent, because refusing to show somebody the notes they already captured is the one refusal this product cannot make.

Claiming is what removes the wall, and it is one command:

crux claim you@example.com

That mails a link to the address you name; opening it is what attaches the address, so nothing is written until you do. An address nobody here has names the Principal — the row it already is becomes you. An address that already has an identity here links the Principal to it rather than merging the two, so an agent on a second machine joins the first without a single authored row being rewritten, and one person may hold many Principals (ADR-0013). Once claimed, every read resolves to "every Principal claimed by me" — one person, every corpus they own — and the allowance is metered over that whole set, so claiming cannot be used to pool free allowances.

The only check Claude still runs is the Bun runtime — command -v bun. If it is not installed, Claude surfaces the install command for your platform (curl -fsSL https://bun.sh/install | bash works on macOS and Linux; brew install oven-sh/bun/bun on Homebrew; PowerShell one-liner on Windows). Restart your shell afterwards so the new PATH takes effect.

To point at a deployment of your own instead, run crux init --url <deployment> --token <token>; CRUX_API_URL and CRUX_API_TOKEN override the file for one invocation.

The client-server split

There is no local database. Every crux command is an HTTP call to the deployment (ADR-0003): reads go to POST /v1/query as a named read, writes to POST /v1/dispatch as an action, and view-state lives in a Durable Object behind /v1/view, one per human — keyed by the root Principal, so every Principal a claim linked into one person pushes to and listens on the same object (ADR-0014). Both entry points are in core — query() beside dispatch() — so an invariant and a JSON shape each exist in exactly one place, which is the only arrangement that survives two people writing at once.

A read that is recorded — PROBLEM_SHOW is the only one — also appends to a recentQueries list in that object, which is two sequential hops the answer does not depend on and was measured at about 205ms in front of every such read. It now happens behind the response: query() takes an optional defer callback, and the Worker entry passes ctx.waitUntil. The callback is what keeps cloudflare:workers out of core (ADR-0003) — a caller with no execution context passes nothing and keeps the awaited behaviour, which is what makes the deferral assertable in a test at all. The write stays best-effort in both shapes: the promise handed over never rejects, so a Durable Object that cannot be reached still cannot fail a read.

What the CLI still owns is argument parsing, the request it sends, and the terminal: the server's {error:{code,message,details}} envelope is rebuilt into the same error objects as before, so codes and exit codes are unchanged.

Neither half of that configuration is required. A machine with no [api] section talks to the public deployment and mints itself a Principal on its first request, persisting the token — which is what makes "install the plugin and go" true again (ADR-0013). crux init writes [api] url / token into config.toml after checking they work, for pointing at a deployment of your own; CRUX_API_URL and CRUX_API_TOKEN override the file for one invocation.

Because the two halves move independently, a session is a client and a deployment, and which pair you are running is a fact worth being able to state:

crux version
# { "client": "0.4.0", "deployment": "0.4.0", "url": "https://crux.zabaca.com" }

That is the line an agent puts in an Observation about odd behaviour. A version rides in a refusal's details, but most odd behaviour does not refuse — a read comes back surprising, a page looks wrong — and no details ever arrive. It degrades rather than fails: a deployment that cannot be reached, or one too old to report a version, is deployment: null at exit 0, and nothing is minted to ask, because /health needs no Principal. crux --version answers the client half without touching the network at all, so the difference reads as the flag skipped the network rather than as two answers that disagree (ADR-0018).

Develop from source

For contributors working on Crux itself:

bun install
bun run crux user init --name "Your Name" --email "you@example.com"
bun run crux init --url https://<your-deployment> --token <token>
bun run crux problem list -w crux

bun run build derives the doc tree and runs astro build; bun run test does it for you, because the workerd suites run against the built bundle (ADR-0009).

The cloud schema is end-state DDL applied by applyD1Schema (ADR-0006) — there is no migrations directory and no drizzle-kit. To develop against a throwaway corpus rather than the real one, run the Worker locally (cd apps/cloud && bunx wrangler dev), whose D1 binding is a local file, and point CRUX_API_URL at it.

Deploy (cloud crux)

Cloud crux is one Cloudflare Worker with a D1 database, deployed through zbc (ADR-0004). Production only — there is no preview environment.

A merge to main deploys nothing. Production moves only when somebody runs /release, and nothing under .github/ holds a deploy credential or may ever be given one (ADR-0015). The release bumps the version, drafts a CHANGELOG.md entry for approval, runs the gate, deploys, asks /health what is now serving traffic, and tags only once that answers with the version it just built. The bump moves three files: the deployment package and, copied from it by bun run version:sync, both plugin manifests — Claude Code caches an installed plugin under its marketplace version string and will not move off one that never changes (ADR-0018). bun run verify fails when the three disagree, so a skipped copy stops a pull request rather than reaching an installed client. A tag on origin is therefore a release that reached production and was checked there — which is a stronger claim than any exit code can make, because the deploy failure this repository has actually met exits 0.

A pull request is verified before it can merge, and main enforces it. pull-request.yml runs bun run verify — lint, typecheck, docs:check, version:check, the suite — on every PR against main, and the main ruleset refuses a merge whose Verify has not passed. Verifying only on the merge made the merge itself the first verification, which is how main ended up ahead of production once already. The ruleset carries one bypass_actor — the repository admin role — for the one commit that does not go through a pull request: /release's version bump and changelog entry, which skips the review and not the CI (ADR-0015).

main.yml verifies the merge result, and that is all it does. It runs the same bun run verify on every push to main. That is not a duplicate of the pull request's job: the pull request judges the merge-base result, and this judges what main actually became, which differ exactly when two pull requests pass separately and conflict in meaning once both have landed. /release refuses unless the newest run of it is green for the exact commit being released, so this is also what makes a release possible at all.

The sequence lives in package.json, in one place, so the two CI gates and the release gate cannot drift apart. All of it works from an operator's machine:

bun run scripts/build-docs.ts   # derive the doc tree first on a fresh checkout
bun run verify                  # lint, typecheck, docs:check, version:check, test
bun run deploy                  # bunx @zabaca/zbc apply production — /release runs this

The derivation is the same step both workflows run before verifying: the doc tree is generated rather than committed (ADR-0005), and the Astro pages import it, so a checkout that has never built it cannot typecheck.

bun run deploy is the one step of /release worth running by hand, and only to recover a production the release left half-moved. Reaching for it as the normal way to ship is what ADR-0015 exists to stop: it skips the version, the changelog, and the check that the bundle now serving traffic is the one you built.

zbc apply converges the database and the code: the d1 instance applies the schema first, and the cloud instance — which imports it — then deploys the Worker that reads it. Deploying code ahead of its schema is how a Worker ends up 500ing on a column that does not exist yet, so that ordering is enforced by the import, not by convention.

Never run zbc with bunx --bun. zbc shells out to wrangler, and wrangler on the Bun runtime exits 0 after uploading a version while silently skipping the deploy. zbc's cloudflare module catches that — it fails unless wrangler prints its Deployed … triggers confirmation — but the clean path is to let bunx pick the Node runtime, which bun run deploy does.

  • apps/cloud is the Worker. Its topology lives in wrangler.jsonc, which is the source of truth for it — including the D1 binding. zbc builds first and then deploys from apps/cloud; astro build writes the resolved copy of that config into dist/server along with a redirect wrangler follows (ADR-0009).
  • packages/infra/environments/production/cloud.ts is the zbc instance: which package to deploy, into which account.
  • packages/infra/environments/production/d1.ts is the database: it adopts crux-production by name and applies the same D1_SCHEMA_STATEMENTS the Worker and the workerd tests use, so a table added to the schema module reaches production without a second edit.
  • CLOUDFLARE_API_TOKEN, BETTER_AUTH_SECRET and RESEND_API_KEY live SOPS/age-encrypted in secrets.yaml; the recipients are listed in .sops.yaml — two operator machines and CI, whose private half is the SOPS_AGE_KEY Actions secret. To add a machine, add its age public key there and run sops updatekeys packages/infra/environments/production/secrets.yaml from a machine that is already a recipient.

The Worker needs two secrets, both carried by zbc apply out of secrets.yaml: BETTER_AUTH_SECRET signs browser sessions, and RESEND_API_KEY sends the sign-in links that are the only way to get one (ADR-0010). EMAIL_FROM goes with the latter and is a plain var in wrangler.jsonc, since the address a mail comes from is public the moment one is sent; it must be on a domain the Resend account has verified. Missing any of them leaves /health, the /v1 API and the CLI working and turns off only the browser surfaces, which say which one is missing. CRUX_WORKSPACE_NAME optionally names the Workspace in the header; it defaults to the deployment's host.

Two plain vars tune the free allowance, so changing it is a deploy rather than a code change: CRUX_OBSERVATION_CAP is how many Observations an unclaimed Principal may file before writes refuse (200 by default; anything unparseable falls back to that rather than taking writes down), and CRUX_CLAIM_URL is the address quoted back in the refusal, defaulting to /claim on the deployment that answered.

The first-identity chicken-and-egg is closed: POST /v1/principals is unauthenticated and mints a users row plus a token, so a deployment with no rows creates its own on first contact (ADR-0013). A browser session follows from claiming one: crux claim <email> attaches an address to that Principal, and signing in mails a link to an address that has a row. So a freshly wiped deployment reaches its own browser without a row written by hand — bun run db:restore-identity remains for restoring a specific identity, which is what the runbook below uses.

Schema application only ever adds — with one stated exception. The DDL is an end state of CREATE TABLE IF NOT EXISTS plus additive ALTERs, so removing a table from the schema module does not drop it in production, and repointing a column at a different parent — or tightening a nullable one to NOT NULL, as workstreams.owner_id is — is a table rebuild that cannot be expressed at all. The escape hatch is to start the database over: the rebuild runbook covers the wipe (bun run db:wipe, which is a dry run until it is handed the database's own name), the deploy that reapplies the schema, and restoring the one identity that makes the browser reachable again. It is destructive and human-gated; nothing in CI runs it.

The exception is an index, which holds no rows and can be replaced in place: DROP INDEX IF EXISTS workstreams_slug_unique runs on every apply, because narrowing that slug index to (owner_id, slug) (ADR-0016) means nothing while the index it replaces is still enforcing the old rule. Dropping anything that holds rows stays out of the schema module and behind the runbook.

GET /health is the deployment's liveness check, and the answer to what is live. It round-trips the D1 binding rather than answering from memory, so a Worker that cannot read its corpus reports 503 degraded instead of a hollow ok, and it reports the version inlined into the bundle it is serving — read from apps/cloud/package.json, the only package in this workspace that becomes the deployment. That field is what /release polls to decide whether the deploy it just ran is the one now taking traffic (ADR-0015); an exit code describes an upload, and the failure worth catching is the one where the upload succeeded and the deploy did not.

Layout

  • .claude-plugin/ — plugin and marketplace manifests (this repo is itself a one-plugin marketplace).
  • skills/crux/ — the Crux skill that teaches Claude when and how to operate the CLI.
  • packages/core — the engine: schema, transitions, dispatch() and query(), identity, and the doc-tree walker. Nothing here is CLI-only.
  • packages/cli — crux binary, command dispatch via citty, the HTTP client every command goes through, the Zod schemas its JSON output and its typed arguments are checked against, and the config.toml loader.
  • packages/infra — zbc module instances and encrypted secrets, per environment.
  • scripts/ — seeding, the production database rebuild (bun run db:wipe / db:restore-identity), the doc-tree rot check, the plugin-manifest version sync /release runs (bun run version:sync, and version:check inside verify), and the favicon renderer (bun run favicon, after editing the mark in brand.ts — it needs rsvg-convert and magick, which is why it is not part of bun run build).
  • apps/cloud — the deployed Cloudflare Worker: /health, the /v1 JSON API, the page templates under src/web/, the view-state Durable Object, and the Astro site (astro/) whose React islands are the board and the action dialogs.

Docs

Documentation is whatever is reachable from this file: a walker starts here and follows internal links and @imports (ADR-0002). A doc that exists but isn't linked from the tree doesn't count — bun run docs:check reports it as rot. The walker has two callers and no third implementation: that check, and scripts/build-docs.ts, which runs it at build time so the deployment can serve the tree at /docs without a working tree to read (ADR-0005). Rot fails the build, naming the broken links and orphans.

Principles

  • Transitions are code, not documentation. Invariants live as plain functions in packages/core/src/transitions/.
  • No stateful crux use. Every command takes -w <slug> explicitly.
  • User identity in $CRUX_HOME/config.toml (~/.claude/.crux/config.toml). Not committed, not hardcoded, and owner-only: it holds a bearer token the deployment cannot reissue.
  • One corpus, reached over HTTP. No local database, no replicas — the transition layer runs in exactly one place (ADR-0003).
  • The Principal is the tenant. Every read and every id a write resolves is scoped to the Principal the server resolved from the request, never to one the client named (ADR-0013). Workstream slugs are unique per owner, so a refusal never reports what another tenant holds (ADR-0016).
  • Status columns only where a human judgment is recorded. Observation has no status — its state is derivable from related rows.
  • Claude is a tool, not an actor. The agent holds a Principal; a human owns Principals, and every attribution resolves to one (ADR-0013).

Status

MVP. One cloud deployment, many tenants: adoption is anonymous-first and the Principal is the boundary, so first use mints an identity and every read is scoped to it (ADR-0013). The Observation cap that makes claiming worth doing is enforced — writes refuse with CAPACITY_EXCEEDED and reads keep answering — and crux claim <email> lifts it, by mail: the link names a new address onto the Principal or links it to a human who already exists, never merging the two. In the browser: sign-in, inviting and removing Members, minting and revoking CLI tokens, pages for Problem and Observation, the Observation intake list at /w/<slug>/observations — grouped into linked, archived and waiting, all three read off related rows rather than a status column — the doc tree at /docs, and the write surfaces — a Workstream at /w/<slug> that is a drag-and-drop roadmap board, and contextual action dialogs that file entities and record transitions. The board shows all six Stages; the two terminal ones, done and abandoned, are read-only there because they are reached by an Outcome or an Abandonment rather than by dragging. Every one of those writes goes through POST /v1/dispatch, the CLI's endpoint, so there is no browser-only path where an invariant could be skipped; a refused transition shows its code and message rather than snapping the card back in silence. Live refresh is the ViewStateDO push stream, so a crux command in a terminal lands on the open page. Each frame names the Workstream the action touched — null when it touched none — so a page showing one Workstream ignores work in another rather than reloading on every action anywhere in the Principal's corpus. Every page showing corpus data carries it — the Workstream list, the board, the Problem, and both Observation pages — which is why all five are Astro routes; the account pages are not, because nothing an agent writes appears on them.

The site is Astro with React islands, wrapping the hand-written Worker entry rather than replacing it (ADR-0009). Transitions, reads, token auth and every browser surface are tested inside workerd against a real D1 and the built bundle (ADR-0006); the CLI is tested against a stub deployment. bun run test builds, then runs both runners.

See .claude/skills/dev-start/SKILL.md for new-machine onboarding.


name: karpathy-guidelines description: Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria. license: MIT

Guidelines

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

Before implementing:

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them - don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

When editing existing code:

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it - don't delete it.

When your changes create orphans:

  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

4. Goal-Driven Execution

Define success criteria. Loop until verified.

Transform tasks into verifiable goals:

  • "Add validation" → "Write tests for invalid inputs, then make them pass"
  • "Fix the bug" → "Write a test that reproduces it, then make it pass"
  • "Refactor X" → "Ensure tests pass before and after"

For multi-step tasks, state a brief plan:

1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]

Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.

Agent skills

Issue tracker

Issues are Fredrin tickets, operated via the fredrin CLI (not GitHub issues). See docs/agents/issue-tracker.md.

Domain docs

Single-context: one CONTEXT.md + docs/adr/ at the repo root. See docs/agents/domain.md.

About

Structured residue layer for product discovery thinking in Claude Code conversations — Bun+TS+libSQL CLI with enforced workflow invariants.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0