A production-grade skill for Claude Code that enforces CTO-level thinking in AI-native development. This skill moves beyond code generation to architectural design, resilience patterns, and systems thinking.
Branerail is triggered whenever you're building, reviewing, or thinking about complex systems. It:
- Forces design-first thinking before code generation
- Audits AI-generated code for architectural soundness
- Integrates Google's design.md standard for consistent visual design systems
- Guides resilience patterns (retry, circuit breaker, bulkhead isolation)
- Clarifies state ownership, observability, and dependencies
- Provides actionable checklists for code review and deployment
- Automates architectural audits via built-in CLI tools
Install the Branerail skill globally via NPM:
npm install -g @uditakhouri/branerailOr add it to your project:
npm install --save-dev @uditakhouri/branerailUse this skill whenever you encounter: architecture, scale, resilience, state ownership, blast radius, observability, distributed systems, design.md, code review.
This skill now includes active automation to enforce architectural rigor. Once installed, you can use these tools to audit your system:
branerail-audit: Scans your project root to ensure you have the requiredCLAUDE.md,/specs, andDESIGN.mdin place.branerail-chaos: Parses your architectural specs and generates testable "Chaos Prompts" to verify if your resilience logic actually works.DESIGN.mdIntegration: Uses Google's standard for visual tokens; compatible withnpx @google/design.md.
Before shipping any system, answer these three questions with certainty:
What is the single source of truth for each piece of mutable data?
- Prevents race conditions and data corruption
- Ensures consistency across replicas
- Makes rollback and recovery possible
How do you know if the system is working? What tells you when it's failing?
- Structured logging with context
- Metrics (latency, error rate, throughput)
- Alerts for SLO violations
- Queryable, actionable traces
Can you trace the blast radius of every component?
- Identifies single points of failure
- Reveals hidden dependencies
- Guides fallback strategies
- Prevents cascading failures
Branerail_skill/
├── SKILL.md # Main skill (27KB, comprehensive)
├── references/
│ ├── spec_template.md # Architectural specification template
│ ├── DESIGN_template.md # Visual design system template (DESIGN.md)
│ └── code_review_checklist.md # Code audit checklist for Claude Code
└── README.md # This file
Size: ~27KB Sections:
- The Three Pillars (state, feedback, blast radius)
- The Design Process Before Code (sketch, spec, deletion test, reimplementation)
- AI as a Probabilistic Collaborator (why you need to audit)
- Code Review Checklist (9 sections, ~100 items)
- Architectural Anti-Patterns (what not to do)
- Full Development Workflow (pre-code, generation, review, deployment)
- Concurrency and Distributed Systems
- Claude Code Integration Workflow
- Evaluation Rubric
Purpose: Template for writing architectural specifications before coding
Includes:
- Component overview
- Data model (inputs, outputs)
- State and ownership matrix
- Critical paths and performance targets
- Failure modes and recovery strategy
- Observability plan (logging, metrics, alerts)
- Dependencies (internal and external)
- Testing strategy
- Scaling plan
- Security requirements
- Sign-off checklist
Purpose: Google's DESIGN.md format for visual design system consistency
Includes:
- Color palette with semantic roles
- Typography scale (headings, body, labels, monospace)
- Spacing system (8px base units)
- Border radius conventions
- Shadow levels (elevation)
- Component patterns (buttons, inputs, cards, forms, modals)
- Responsive design breakpoints
- WCAG AA accessibility compliance
- Implementation guidelines (CSS variables, Tailwind, W3C DTCG)
Why DESIGN.md:
- DESIGN.md is a file format designed to describe an entire design system to AI agents, allowing any tool or model to read that file and generate interfaces that respect your brand without needing to explain it every time
- Validates against WCAG contrast ratios automatically
- Exports to Tailwind CSS, W3C Design Token Format
- Works across Claude Code, Cursor, GitHub Copilot
Purpose: Comprehensive checklist for auditing AI-generated code
Sections:
- Three Pillars (quick 3-minute check)
- Spec Compliance (does code match the spec?)
- State and Data Ownership (single source of truth?)
- Error Handling and Resilience (handles failures?)
- Observability (can you see what's happening?)
- Dependencies and Coupling (what is this coupled to?)
- Testing Coverage (happy path + failure modes?)
- Security (no obvious holes?)
- Performance and Scaling (will it scale?)
Usage: Run through this checklist when reviewing code generated by Claude Code.
You: "I need to build a checkout system. Where should I start?"
Claude (with Branerail):
1. Design before you code: "Sketch the architecture (boxes and arrows)"
2. Answer the three pillars
3. Write a spec (use references/spec_template.md)
4. Then ask Claude Code to generate code based on the spec
You: [Paste AI-generated code]
You: "Is this architecturally sound?"
Claude (with Branerail):
Runs through code_review_checklist.md:
- Spec compliance? ✓
- State ownership clear? ✗ [Issue found]
- Error handling? ✓
- Observability? ✓
- [Returns detailed audit with issues and fixes]
You: "We have user service → order service → payment gateway.
What happens if payment gateway goes down?"
Claude (with Branerail):
1. Analyzes blast radius
2. Identifies cascade failures
3. Suggests patterns (circuit breaker, queue, retry)
4. Provides implementation guidance
You: "Create our DESIGN.md to ensure all UI is on-brand"
Claude (with Branerail):
1. References DESIGN_template.md
2. Asks about brand colors, typography, components
3. Generates DESIGN.md with tokens and validation
4. Provides CLI commands to lint and export
# CLAUDE.md - Instructions for Claude Code
You are a CTO-level code generator with Branerail guidance.
When building new features:
1. Reference the architectural spec at /specs/[feature].md
2. Use the Branerail skill to audit your code
3. Verify the Three Pillars are answered
4. Include structured logging and metrics
5. Handle all failure modes listed in the spec
When building UI:
1. Reference /DESIGN.md for colors, typography, components
2. Ensure WCAG AA contrast ratios
3. Use design tokens consistently
4. Validate with: npx @google/design.md lint DESIGN.mdUse references/spec_template.md to create architectural specs for each major component.
Use references/DESIGN_template.md to define your visual design system. Export tokens to Tailwind.
Use references/code_review_checklist.md to audit code from Claude Code before merging.
Write to DB first → Update cache → Return result
(Ensures cache never has newer data than DB)
External service fails 5x in a row
→ Circuit opens
→ Fail fast (don't retry)
→ After 60 seconds, try again (half-open)
→ If success, close circuit
Don't store state; store events
→ Event: "Order created"
→ Event: "Payment charged"
→ Event: "Order shipped"
→ Replay events to reconstruct state
Separate read model from write model
→ Writes go to write DB (optimized for transactions)
→ Reads go to read DB (optimized for queries)
→ Eventual consistency between them
Scenario: Build a checkout system that handles 1000 orders/sec, resilient to payment gateway failures.
Using Branerail:
-
Design Phase
- Sketch architecture: Web → Order Service → Payment Service → Payment Gateway
- Answer Three Pillars:
- State: Order Service owns order status (DB); Payment Service owns receipt
- Feedback: Log every operation; alert on payment error rate > 5%
- Blast Radius: If Payment Gateway ↓, queue and retry; orders still process
- Write spec (references/spec_template.md)
-
Spec Contents
# Order Processing Spec ## Inputs - User ID, product IDs, amounts, currency ## Outputs - Order ID, status (pending/completed/failed), confirmation ## State Ownership - Order Service: order status (DB) - Payment Service: payment receipt (DB) ## Failure Modes - Payment timeout: Retry 3x with exponential backoff - Payment rejected: Alert user, order stays pending - Database down: Circuit breaker, fail fast
-
Code Generation (Claude Code)
Prompt: "Implement order processing per /specs/orders.md - Handle all failure modes - Log every operation with orderId, status, latency - Emit metrics: order count, payment latency p50/p95/p99, error rate - Add circuit breaker for payment gateway - Validate against DESIGN.md for UI" -
Code Review (Checklist)
- ✓ Spec compliance (all requirements met)
- ✓ State ownership (single source of truth)
- ✓ Error handling (retry, circuit breaker)
- ✓ Observability (logs, metrics, traces)
- ✓ Tests (happy path + failure modes)
- ✓ Performance (p99 < 2s, handles 1000/sec)
-
Deployment
- Alerts fire on error rate > 5% or latency > 10s
- Logs queryable: find orders by status, latency, errors
- Metrics dashboard shows order throughput and error rate
After using this skill, score yourself:
| Criterion | Score |
|---|---|
| State ownership is clear (single source of truth) | 0–3 |
| Observability is sufficient (logs, metrics, tracing) | 0–3 |
| Failure handling covers all modes (spec + extras) | 0–3 |
| Dependencies are explicit and documented | 0–3 |
| Blast radius is understood (no surprises) | 0–3 |
| Code is tested (happy path + failure modes) | 0–3 |
| Performance targets are met or on-track | 0–3 |
| Security is defensible (no obvious holes) | 0–3 |
Target: 2+ on all dimensions. Anything < 2 is a risk.
- Single owner for each data type
- Non-owners read from owner
- Replicas are explicit and versioned
- Conflicts are resolved deterministically
- Schema changes are migrations
- Every critical operation is logged
- Logs are structured (JSON, key-value)
- Metrics are emitted (latency, errors, throughput)
- Alerts are defined for SLO violations
- You can reconstruct a failure from logs
- Dependencies are explicit
- No circular dependencies
- Fallbacks exist for external services
- Cascade failures are prevented
- You can mentally trace impact
If you answer YES to all 15, your system is sound.
# Validate DESIGN.md against spec
npx @google/design.md lint DESIGN.md
# Check WCAG contrast ratios
npx @google/design.md lint DESIGN.md --wcag
# Compare two versions
npx @google/design.md diff DESIGN.md DESIGN-v2.md
# Export to Tailwind
npx @google/design.md export --format tailwind DESIGN.md > tailwind.theme.json
# Export to W3C DTCG
npx @google/design.md export --format dtcg DESIGN.md > tokens.json- Spec writing: Markdown + GitHub (version control)
- Architecture diagramming: Excalidraw, Miro, or ASCII art
- Code review: GitHub PRs with checklist
- Logging: Structured JSON (ELK, Datadog, Grafana Loki)
- Metrics: Prometheus, Grafana
- Tracing: Jaeger, DataDog APM
- Load testing: k6, JMeter
- Branerail Skill SKILL.md: Main guidance (27KB)
- Spec Template: /references/spec_template.md
- DESIGN.md Template: /references/DESIGN_template.md (Google's standard)
- Code Review Checklist: /references/code_review_checklist.md
- Google DESIGN.md: Udit Akhouri google-labs-code/design.md
- WCAG 2.1: https://www.w3.org/WAI/WCAG21/quickref/
- Distributed Systems: "Designing Data-Intensive Applications" by Martin Kleppmann
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | 2026-04-27 | Initial release. Complete skill with bundled templates and checklists. Integrated Google's design.md standard. CTO-level guidance for Claude Code integration. |
This skill is designed for builders who refuse to let their judgment atrophy. Use it to think deeply before coding. Use it to audit AI-generated code. Use it to build resilient systems that scale.
Questions? Feedback? Open an issue or PR on the skill repository.
Summary: Branerail is your CTO-level guide in an AI-native world. It moves you from "coding faster" to "architecting better." Use it to build systems that are resilient, observable, maintainable, and right.