dse-loop
Autonomous design space exploration loop for computer architecture and EDA. Runs a program, analyzes results, tunes parameters, and iterates until objective is met or timeout. Use when user says "DSE", "design space exploration", "sweep parameters", "optimize", "find best config", or wants iterative parameter tuning.
What this skill does
# DSE Loop: Autonomous Design Space Exploration
> π **Do not wrap this skill in `/loop` / `CronCreate`.** It already loops
> internally until its objective is met or it times out. Unlike the
> verdict-bearing review/audit skills, its stop gate is an **objective
> machine-checkable metric** (Type-A), so its self-termination is safe
> same-model β the reason not to wrap it is **scheduler duplication**, not the
> verdict fence. See
> [`shared-references/external-cadence.md`](../shared-references/external-cadence.md).
Autonomously explore a design space: run β analyze β pick next parameters β repeat, until the objective is met or timeout is reached. Designed for computer architecture and EDA problems.
## Context: $ARGUMENTS
## Safety Rules β READ FIRST
**NEVER do any of the following:**
- `sudo` anything
- `rm -rf`, `rm -r`, or any recursive deletion
- `rm` any file you did not create in this session
- Overwrite existing source files without reading them first
- `git push`, `git reset --hard`, or any destructive git operation
- Kill processes you did not start
**If a step requires any of the above, STOP and report to the user.**
## Constants (override via $ARGUMENTS)
| Constant | Default | Description |
|----------|---------|-------------|
| `TIMEOUT` | 2h | Total wall-clock budget. Stop exploring after this. |
| `MAX_ITERATIONS` | 50 | Hard cap on number of design points evaluated. |
| `PATIENCE` | 10 | Stop early if no improvement for this many consecutive iterations. |
| `OBJECTIVE` | minimize | `minimize` or `maximize` the target metric. |
Override inline: `/dse-loop "task desc β timeout: 4h, max_iterations: 100, patience: 15"`
## Typical Use Cases
| Problem | Program | Parameters | Objective |
|---------|---------|-----------|-----------|
| Microarch DSE | gem5 simulation | cache size, assoc, pipeline width, ROB size, branch predictor | maximize IPC or minimize areaΓdelay |
| Synthesis tuning | yosys/DC script | optimization passes, target freq, effort level | minimize area at timing closure |
| RTL parameterization | verilator sim | data width, FIFO depth, pipeline stages, buffer sizes | meet throughput target at min area |
| Compiler flags | gcc/llvm build + benchmark | -O levels, unroll factor, vectorization, scheduling | minimize runtime or code size |
| Placement/routing | openroad/innovus | utilization, aspect ratio, layer config | minimize wirelength / timing |
| Formal verification | abc/sby | bound depth, engine, timeout per property | maximize coverage in time budget |
| Memory subsystem | cacti / ramulator | bank count, row buffer policy, scheduling | optimize bandwidth/energy |
## Workflow
### Phase 0: Parse Task & Setup
1. **Parse $ARGUMENTS** to extract:
- **Program**: what to run (command, script, or Makefile target)
- **Parameter space**: which knobs to tune and their ranges/options (may be incomplete β see step 2)
- **Objective metric**: what to optimize (and how to extract it from output)
- **Constraints**: hard limits that must not be violated (e.g., timing must close)
- **Timeout**: wall-clock budget
- **Success criteria**: when is the result "good enough" to stop early?
2. **Infer missing parameter ranges** β If the user provides parameter names but NOT ranges/options, you MUST infer them before exploring:
a. **Read the source code** β search for the parameter names in the codebase:
- Look for argparse/click definitions, config files, Makefile variables, module parameters, `#define`, `parameter` (SystemVerilog), `localparam`, etc.
- Extract defaults, types, and any comments hinting at valid values
b. **Apply domain knowledge** to set reasonable ranges:
| Parameter type | Inference strategy |
|---------------|-------------------|
| Cache/memory sizes | Powers of 2, typically 1KBβ16MB |
| Associativity | Powers of 2: 1, 2, 4, 8, 16 |
| Pipeline width / issue width | Small integers: 1, 2, 4, 8 |
| Buffer/queue/FIFO depth | Powers of 2: 4, 8, 16, 32, 64 |
| Clock period / frequency | Based on technology node; try Β±50% from default |
| Bound depth (BMC/formal) | Geometric: 5, 10, 20, 50, 100 |
| Timeout values | Geometric: 10s, 30s, 60s, 120s, 300s |
| Boolean/enum flags | Enumerate all options found in source |
| Continuous (learning rate, threshold) | Log-scale sweep: 5 points spanning 2 orders of magnitude around default |
| Integer counts (threads, cores) | Linear: from 1 to hardware max |
c. **Start conservative** β begin with 3-5 values per parameter. Expand range later if the best result is at a boundary.
d. **Log inferred ranges** β write the inferred parameter space to `dse_results/inferred_params.md` so the user can review:
```markdown
# Inferred Parameter Space
| Parameter | Source | Default | Inferred Range | Reasoning |
|-----------|--------|---------|---------------|-----------|
| CACHE_SIZE | config.py:42 | 32768 | [8192, 16384, 32768, 65536, 131072] | powers of 2, Β±2x from default |
| ASSOC | config.py:43 | 4 | [1, 2, 4, 8] | standard associativities |
| BMC_DEPTH | run_bmc.py:15 | 10 | [5, 10, 20, 50] | geometric, common BMC depths |
```
e. **Boundary expansion** β during the search, if the best result is at the min or max of a range, automatically extend that range by one step in that direction (but log the extension).
3. **Read the project** to understand:
- How to run the program
- Where results are produced (stdout, log files, reports)
- How to parse the objective metric from output
- Current/baseline configuration (if any)
4. **Create working directory**: `dse_results/` in project root
- `dse_results/dse_log.csv` β one row per design point
- `dse_results/DSE_REPORT.md` β final report
- `dse_results/DSE_STATE.json` β state for recovery
- `dse_results/inferred_params.md` β inferred parameter space (if ranges were not provided)
- `dse_results/configs/` β config files for each run
- `dse_results/outputs/` β raw output for each run
5. **Write a parameter extraction script** (`dse_results/parse_result.py` or similar) that takes a run's output and returns the objective metric as a number. Test it on a baseline run first.
6. **Run baseline** (iteration 0): run the program with default/current parameters. Record the baseline metric. This is the point to beat.
### Phase 1: Initial Exploration
**Goal**: Quickly survey the space to understand which parameters matter most.
**Strategy**: Latin Hypercube Sampling or structured sweep of key parameters.
1. Pick 5-10 diverse design points that span the parameter ranges
2. Run them (in parallel if independent, via background processes or sequential)
3. Record all results in `dse_log.csv`:
```
iteration,param1,param2,...,metric,constraint_met,timestamp,notes
0,default,default,...,baseline_val,yes,2026-03-13T10:00:00,baseline
1,val1a,val2a,...,result1,yes,2026-03-13T10:05:00,initial sweep
...
```
4. Analyze: which parameters have the most impact on the objective?
5. Narrow the search to the most sensitive parameters
### Phase 2: Directed Search
**Goal**: Converge toward the optimum by making informed choices.
**Strategy**: Adaptive β pick the approach that fits the problem:
- **Few parameters (β€3)**: Fine-grained grid search around the best region from Phase 1
- **Many parameters (>3)**: Coordinate descent β optimize one parameter at a time, holding others at current best
- **Binary/categorical params**: Enumerate promising combinations
- **Continuous params**: Binary search or golden section between best neighbors
- **Multi-objective**: Track Pareto frontier, explore along the front
For each iteration:
1. **Select next design point** based on results so far:
- Look at the trend: which direction improves the metric?
- Avoid re-running configurations already evaluated
- Balance exploration (untested regions) vs exploitation (neRelated 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.