redline
CLAUDE.md0 starsChanged 4 months agoMITView on GitHub
Read docs/ first. Start with docs/architecture.md, then the doc that matches your task. The seam contract between build agents is docs/build/INTERFACES.md and it is authoritative. The Zod types in packages/contracts/src/* are the source of truth for every shape; import them from @redline/contracts, never redefine them. A statistical-rigor auditor for single-cell RNA-seq. A scientist hands it their data (an AnnData .h5ad) and the analysis they ran. Redline re-runs the load-bearing statistics itself and marks the false discoveries on the scientist's own…
In this repositoryOne other file it gives its agents.
- pr-loopSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 3
Read
docs/first: Start with docs/architecture.md, then the doc that matches your task. - Distinctive: line 68
Every finding is numbers, prose, and correction that meet in the contract:
- Distinctive: line 99
Pillar 2 is evidence,: not a certified FDR correction.
- Very specific: line 101
The grouping variable is configurable,: never hardcoded to "cell type." Pillars operate on resolved FieldRoles.
- Distinctive: line 103
The Marson scenario audits a naive foil,: never the authors' rigorous analysis.
- Distinctive: line 112
No em dashes: Use commas, periods, parentheses, or "and."
- Distinctive: line 131
Open source, no hidden paths: No hardcoded credentials, no environment-specific secrets, no surface-specific paths.
- Distinctive: line 156
Do not commit unless asked.
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Redline: Claude Code project guide
Read docs/ first. Start with docs/architecture.md, then the doc that matches your
task. The seam contract between build agents is docs/build/INTERFACES.md and it is
authoritative. The Zod types in packages/contracts/src/* are the source of truth for
every shape; import them from @redline/contracts, never redefine them.
What Redline is
A statistical-rigor auditor for single-cell RNA-seq. A scientist hands it their data (an
AnnData .h5ad) and the analysis they ran. Redline re-runs the load-bearing statistics
itself and marks the false discoveries on the scientist's own figures, before the
analysis becomes a paper. Every finding names the failure mode, cites the method paper
that fixes it, and rewrites the conclusion in defensible language.
It is not QC (solved and commoditized) and not a generic manuscript reviewer (reads finished papers). It is the specialized layer that catches the statistical reasoning errors nothing else does: pseudoreplication, double dipping, clustering fragility, and technical-biological confounding. Positioning line: break your own analysis before Reviewer 2 does.
One engine, every surface. The same core runs as a plots-first web workbench
(apps/web), an MCP server (services/rigor), and a Claude Skill (services/skill) that
drops into Claude Science.
Layout
apps/web Next.js 16 App Router (React 19). The demo workbench. Deploys to Vercel.
packages/contracts @redline/contracts: the Zod shapes every surface speaks. Built. Import, don't edit.
packages/ui @redline/ui: tokens (C, FONT, stateColor, stateLabel) + primitives. Built. Import, don't edit.
packages/engine @redline/engine: the ComputeTarget seam (inferFields + inspect + computeCheck), fixtures, inventories, per-scenario claims, DEFAULT_CONFIG, SCENARIOS.
packages/reasoning @redline/reasoning: Claude (first-party API or Bedrock) + curated fallback; narrate, proposeFields, extractClaims, mapClaim.
services/rigor Python engine (scanpy / decoupler / PyDESeq2 / numpy) + the thin inspect step: MCP server + GCP Cloud Run job.
redline/modules/ The CheckModule registry: eight checks, each with detect/prove/correct/
preview/recommend. Single source of truth for the check set.
redline/correction/ The corrected-code emitter: static per-check templates, the render/slot
machinery, the BH stats fallback, and the downloadable bundle builder.
services/skill The same engine packaged as a Claude Skill.
docs/ Architecture, the front door (intake + claims), honesty rules, correction layer, dataset, storyboard, deploy. Read first.The eight checks: 1 pseudoreplication, 2 double dipping, 3 fragility, 4 confounding (the
founding pillars, group core); 5 multiple testing, 6 unmodeled covariate, 7 resolution
choice, 8 test assumptions (the rigor checks on the same interface, group rigor). The
correction shapes (CorrectedCode, Recommendation, PreviewArtifact, CorrectedBundle,
Knob) live in packages/contracts/src/correction.ts, mirrored in
services/rigor/redline/contracts.py.
The docs/ index:
| Want to | Read |
| Understand the system | docs/architecture.md |
| Get the analysis in and extract auditable claims (the front door) | docs/intake-and-claims.md |
| Not break an honesty invariant | docs/honesty-rules.md |
| Add a rigor check, or emit corrected code | docs/correction-layer.md |
| Know the hero dataset and its framing rule | docs/dataset.md |
| Manufacture naive foils on any dataset (fixtures, prevalence study) | docs/foil-generator.md |
| Read a repeat interval on a stochastic check | docs/confidence-intervals.md |
| Run the three-minute demo | docs/demo-storyboard.md |
| Add a step to the guided tour, or run it hands-free | docs/guided-tour.md |
| Deploy the app or point at the real engine | docs/deploy.md |
| Integrate with the other build agents | docs/build/INTERFACES.md |
The finding shape (internalize this)
Every finding is numbers, prose, and correction that meet in the contract:
ComputeResult={ checkId, state, headline, stats, chart }. The statistics, from aComputeTarget(the locked fixture or the real Python engine). Deterministic.Narrative={ error, citation, original, corrected, missing? }. The prose, from the reasoning layer (Claude via Bedrock) or its curated fallback.Correction={ correctedCode?, recommendations?, preview? }. The correction half, from the same deterministic module. AComputeTargetreturnsEngineResult = ComputeResult.extend(Correction.shape).CheckResult = ComputeResult.merge(Narrative).extend(Correction.shape)is what the UI renders per check.stateisflagged | clean | flag_only | hard_stop.readyandrunningare UI-only and are not part of the engine's return contract.
The ComputeTarget seam decides where the statistics run (fixture default, then
local, cloudrun, endpoint) behind one return shape. The UI never changes when the
target changes. A target that is not wired reports available: false and its control
renders disabled and labeled.
Honesty invariants (enforce in code and copy)
These are the product. Full detail in docs/honesty-rules.md.
- Correct, and show your work. Redline corrects the analysis and previews the
corrected result. Everything it asserts, recommends, or corrects is shown,
reproducible, and cited: the code is downloadable and runs, the preview is its output,
the recommendation names the method. No fabricated fixes: an unsalvageable finding
shows no corrected result anywhere (
PreviewArtifactrefuses anafterwhenunsalvageable). - Never cry wolf. A passed check reports clean, confidently, in green. Never manufacture a flag.
- Pillar 2 is evidence, not a certified FDR correction. Name ClusterDE as the stronger method.
- The grouping variable is configurable, never hardcoded to "cell type." Pillars
operate on resolved
FieldRoles. - The Marson scenario audits a naive foil, never the authors' rigorous analysis. Copy must never imply the authors erred.
- A compute control only renders live once its target is wired. Configurable is honest; unwired targets stay disabled and clearly labeled.
Prose voice rules (any user-facing English)
This includes report copy, reasoning lines, headlines, captions, and these docs.
- No em dashes. Use commas, periods, parentheses, or "and."
- No "not X, but Y" reframes.
- No AI-tell vocabulary. Direct and concrete. Say the thing.
- Accessibility is part of the voice: real semantic elements,
aria-labelon icon buttons, focus-visible rings, keyboard-operable controls,prefers-reduced-motionrespected for therl-*animations.
Build rules
- Bedrock only for Claude calls. Via
@aws-sdk/client-bedrock-runtime, model id fromREDLINE_BEDROCK_MODEL_ID, region fromAWS_REGION. Never the direct Anthropic API. On any missing credential or error, fall back to curated copy so the app always renders. - Import conventions.
@redline/contractsfor shapes,@redline/uifor tokens and primitives,@/…insideapps/web. ESM everywhere. Inpackages/*use explicit.jsextensions on relative imports andimport typefor type-only imports (verbatimModuleSyntaxis on).apps/webrelaxes both. - Pixel-faithful design. Match the design source: same spacing, radii, fonts (IBM
Plex Sans and Mono, Source Serif 4), colors (cream desk, one editorial red at
#CE2A1E, quiet green and amber for clean and needs-input), and copy. - Open source, no hidden paths. No hardcoded credentials, no environment-specific secrets, no surface-specific paths. Everything configurable through env vars.
- Portable as a Skill from day one.
Build order
- Design resolution (the foundation; everything depends on it).
- Pillar 1 (the keystone; the one that can assert; validate against the pseudobulk
oracle in
docs/dataset.md). - Pillar 2 (highest-impact catch; most implementation risk in the re-test).
- Pillar 4 (cheap once the design is resolved; legible).
- Pillar 3 (cheapest; best interactive surface).
- The reasoning layer and report assembly, including the clean-verdict path.
The four founding pillars come first. The rigor checks (5 to 8) and the correction
capabilities (corrected code, recommendations, fix-and-preview) hang off the same
CheckModule interface and the registry, so they are added as modules without touching the
driver. See docs/correction-layer.md.
The UI is built last, but every check exposes its knobs so the UI can surface and tune each one.
Git
- No
Co-Authored-Bylines on commits. None. - Do not commit unless asked. The main session integrates and commits; parallel build agents write only the files they own and leave verification and commits to the integrator.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

