air-cryptographer
This skill should be used when the user asks about "AIR", "algebraic intermediate representation", "ZK constraints", "trace design", "constraint soundness", "polynomial commitments", "FRI", "STARK", "lookup arguments", "permutation arguments", "memory consistency", "transition constraints", "boundary constraints", "vanishing polynomial", "quotient polynomial", "Fiat-Shamir", or needs expert-level cryptographic review of constraint systems.
What this skill does
# AIR Cryptographer Expertise
Expert-level knowledge for designing, implementing, and auditing Algebraic Intermediate Representations (AIRs) in zero-knowledge proof systems.
## Core Mindset
**Soundness-first thinking**: Every constraint review starts with "how could a cheater slip through?" Think adversarially. Construct counterexample traces by hand. Exploit polynomial identity loopholes.
**Algebraic precision**: Constraints define solution spaces over finite fields. A missing constraint isn't just a bug—it's extra degrees of freedom for a malicious prover.
## Finite Field Foundations
Essential intuitions:
- **Characteristics and inverses**: Every non-zero element has a multiplicative inverse. No zero divisors.
- **Roots of unity**: Multiplicative subgroups of order 2^k enable FFT-friendly evaluation domains.
- **Extension fields**: When you need more algebraic structure (e.g., M31 → QM31 for Stwo).
- **Frobenius endomorphism**: The map x → x^p is field-linear; crucial for extension field arithmetic.
## Polynomial Mechanics
**Interpolation**: Given n points, unique polynomial of degree < n passes through them. Lagrange basis makes this explicit.
**Vanishing polynomials**: Z_H(x) = ∏(x - h) for h ∈ H vanishes exactly on domain H. This is the foundation of constraint enforcement.
**Degree behavior**:
- Multiplication: deg(f·g) = deg(f) + deg(g)
- Composition: deg(f∘g) = deg(f) · deg(g)
- Low-degree testing verifies a function is "close to" a low-degree polynomial
**Evaluation domains**: Multiplicative cosets for separation. Blowup factor determines security margin between trace degree and domain size.
## Trace Design Principles
### Column Classification
| Type | Definition | Example |
| ------------------- | ---------------------------- | ---------------------------- |
| **Source of truth** | Canonical witness data | PC, registers, memory values |
| **Derived** | Computed from source columns | Flags, decompositions |
| **Auxiliary** | Added to reduce degree | Intermediate products |
**Critical rule**: Every column must be constrained. An unconstrained column is a free variable for the prover.
### Row Semantics
Define precisely what each row represents:
- CPU cycle / instruction
- Memory operation
- Padding (must be distinguishable!)
Row types require selectors. Selectors must be:
- Boolean: `s(s-1) = 0`
- Mutually exclusive: `Σ s_i = 1` (or coverage proof)
- Actually constrained (not just documented)
### Minimal vs Redundant Columns
Start minimal. Add auxiliary columns only when:
- Degree reduction is necessary
- Soundness requires explicit intermediate values
- Verification cost dominates
## Constraint Categories
### Transition Constraints (Local)
Express correct step relation between row i and row i+1:
```text
next_pc = pc + instruction_size (when not branching)
next_register[k] = f(current_state, opcode)
```
**Danger**: Writing a relation instead of a function. Multiple valid next-states = unsound.
### Boundary Constraints
Pin specific rows to specific values:
- **Initial**: Row 0 state matches expected start
- **Final**: Last row satisfies termination condition
- **I/O**: Public inputs/outputs bound at known positions
**Danger**: "Final row" must be uniquely defined. Variable-length traces need explicit halt handling.
### Booleanity and Range Constraints
For boolean b: `b(b-1) = 0`
For k-bit value x with bits b*0...b*{k-1}:
```text
x = Σ b_i · 2^i
b_i(b_i - 1) = 0 for all i
```
**Danger**: Forgetting booleanity constraints on decomposition bits.
### Selector Discipline
Selectors gate which constraints apply to which rows.
**Checklist**:
- [ ] Each selector is boolean
- [ ] Exactly one selector active per row (or explicit coverage)
- [ ] No "ghost mode" where all selectors = 0
- [ ] Selector itself is constrained (not free)
**Classic bug**: All selectors zero makes all gated constraints vacuously true.
## Global Consistency Arguments
### Permutation / Multiset Equality
Prove two multisets are equal via grand product:
```text
∏(α - a_i) = ∏(α - b_i)
```
**Checklist**:
- Initial product = 1 (boundary constraint)
- Final products equal (boundary constraint)
- Challenge α bound to transcript after commitments
- Duplicates handled correctly
**Danger**: Product hitting zero, missing boundary constraints, challenge reuse.
### Lookup Arguments
Prove all values in column A appear in table T.
**Checklist**:
- Table is committed/fixed
- Compression is collision-resistant (sufficient randomness)
- Repeated lookups soundly counted
**Danger**: Weak compression allows out-of-table values.
### Memory Consistency
Memory operations form a log: (address, timestamp, value, is_write)
**Patterns**:
- Sort by address, then by timestamp
- Consecutive same-address ops: read sees last write
- Permutation links memory log to CPU trace
**Danger**:
- Address aliasing across different trace sections
- Timestamp not proven monotonic
- Read-before-write not enforced
## Quotient and Composition
Constraint polynomial C(x) should vanish on trace domain H.
Quotient: `Q(x) = C(x) / Z_H(x)`
If C doesn't vanish on H, Q has poles → not low-degree → FRI rejects.
### Row-Set Control
Constraints apply to different row sets:
- All rows: divide by Z_H(x)
- All but last: divide by Z_H(x) / (x - ω^{n-1})
- First only: multiply by Lagrange selector for row 0
- Last only: multiply by Lagrange selector for row n-1
**Danger**: Constraint meant for "all rows" accidentally only enforced on subset due to incorrect vanishing factor.
### Degree Accounting
Track degree of every constraint:
```text
Base constraint degree: d
After selector multiplication: d + deg(selector)
After boundary polynomial: d + deg(boundary)
```
Composition polynomial degree must stay below domain size with sufficient margin (blowup factor).
## Fiat-Shamir Hygiene
**Transcript must bind**:
- All commitments (trace, lookup tables, etc.)
- Public inputs
- Trace length / domain parameters
- Any prover messages
**Challenge separation**: Different arguments need independent challenges. Reusing challenges creates algebraic vulnerabilities.
**Danger**: Challenge derived before commitment → prover can adapt witness.
## Adversarial Witness Exercises
Before declaring an AIR sound, try to break it:
1. **All selectors = 0**: Do constraints still enforce anything?
2. **Corrupt one column**: Can it drift without detection?
3. **Attack last row**: Dump inconsistency into wrap-around?
4. **Duplicate/omit memory events**: Does global check catch it?
5. **Force product to zero**: Exploit grand product boundary?
6. **Exploit gating**: Make "if flag then X" vacuous by leaving flag unconstrained?
If you find a counterexample trace, you found a bug.
## Common Vulnerability Patterns
| Pattern | Symptom | Fix |
| -------------------- | -------------------------- | ---------------------------------- |
| Unconstrained column | Prover sets arbitrarily | Add constraint |
| Missing booleanity | Non-binary "boolean" | Add b(b-1)=0 |
| Selector leakage | Constraint bypassed | Enforce exclusivity |
| Last row escape | Inconsistency hidden | Proper terminal constraints |
| Product zero | Permutation argument fails | Boundary checks, domain separation |
| Challenge reuse | Algebraic cancellation | Separate challenges per argument |
| Weak compression | Lookup collision | Increase randomness |
## Performance-Aware Design
Understand tradeoffs without being an engineer:
| Choice | Prover Cost | Verifier Cost | Soundness |
| ----------------- | -------------------- | ------------- | ------------ |
| More columns | Higher memory | Unchanged | Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.