Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .claude/skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ Run preflight first. It validates your environment and tells you what to do next
| `/lading-optimize-find-target` | Select and analyze an optimization target |
| `/lading-optimize-hunt` | Baseline, implement, review, and record optimizations |
| `/lading-optimize-review` | 5-persona peer review before merge |
| `/lading-optimize-validate` | Bug validation with Kani proofs or property tests |
| `/lading-optimize-submit` | Git branch, commits, and optional PR for optimizations |
| `/lading-optimize-rescue` | Salvage optimization work lacking benchmarks |

## Workflow

Expand Down
14 changes: 4 additions & 10 deletions .claude/skills/lading-optimize-hunt/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: lading-optimize-hunt
description: Systematic optimization hunter for lading. Finds memory optimizations AND bugs - both are valuable. Run /lading-optimize-validate when bugs are discovered.
allowed-tools: Bash(cat:*) Bash(sample:*) Bash(samply:*) Bash(cargo:*) Bash(ci/*:*) Bash(hyperfine:*) Bash(*/payloadtool:*) Bash(tee:*) Read Write Edit Glob Grep Skill Task
description: Coordinates optimization attempts. Captures baselines, implements changes, invokes review, and records outcomes.
allowed-tools: Bash(cat:*) Bash(cargo:*) Bash(ci/*:*) Bash(hyperfine:*) Bash(*/payloadtool:*) Bash(tee:*) Read Write Edit Glob Grep Skill
---

# Optimization Hunt

Systematically explores the lading codebase, implements optimizations, validates with benchmarks. **Finding bugs is equally valuable as finding optimizations.**
Coordinates optimization attempts: captures baselines, implements changes, invokes review, and records all outcomes.

## Role: Coordinator and Recorder

Expand Down Expand Up @@ -98,13 +98,7 @@ ci/validate

**No exceptions. If ci/validate fails, fix the issue before continuing.**

If `ci/validate` repeatedly fails on what appears to be a **pre-existing bug** (not caused by your change), invoke validation:

```
/lading-optimize-validate
```

After validation completes, return here and select the next target.
If `ci/validate` repeatedly fails on a **pre-existing bug** (not caused by your change), document it and stop.

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ entries:
target: <file:function>
technique: <technique>
status: <success|failure>
verdict: <approved|rejected|duplicate|bug_found>
verdict: <approved|rejected>
file: assets/db/<name>.yaml
196 changes: 0 additions & 196 deletions .claude/skills/lading-optimize-rescue/SKILL.md

This file was deleted.

50 changes: 8 additions & 42 deletions .claude/skills/lading-optimize-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
name: lading-optimize-review
description: Reviews optimization patches for lading using a 5-persona peer review system. Requires unanimous approval backed by benchmarks. Bugs discovered during review are valuable - invoke /lading-optimize-validate to validate them.
description: Reviews optimization patches using a 5-persona peer review system. Requires unanimous approval backed by benchmarks.
argument-hint: "[bench] [fingerprint] [file] [target] [technique]"
allowed-tools: Bash(cat:*) Bash(sample:*) Bash(samply:*) Bash(cargo:*) Bash(ci/*:*) Bash(hyperfine:*) Bash(*/payloadtool:*) Bash(tee:*) Read Write Edit Glob Grep Skill
allowed-tools: Bash(cat:*) Bash(sample:*) Bash(samply:*) Bash(cargo:*) Bash(ci/*:*) Bash(hyperfine:*) Bash(*/payloadtool:*) Bash(tee:*) Read Glob Grep
context: fork
---

Expand All @@ -16,15 +16,12 @@ A rigorous 5-persona peer review system for optimization patches in lading. Requ

Review judges using benchmarks and 5-persona review, then returns a structured report.

## Valuable Outcomes
## Outcomes

| Outcome | Value | Action |
| Outcome | Votes | Action |
|---------|-------|--------|
| **Optimization APPROVED** | Improvement validated | Merge |
| **Optimization REJECTED** | Learned where NOT to optimize | Record lesson |
| **Bug DISCOVERED** | Found correctness issue | Invoke `/lading-optimize-validate` |

**Finding bugs during optimization review is SUCCESS, not failure.**
| **APPROVED** | 5/5 APPROVE | Return APPROVED report |
| **REJECTED** | Any REJECT | Return REJECTED report |

---

Expand Down Expand Up @@ -126,7 +123,7 @@ hyperfine --warmup 3 --runs 30 --export-json /tmp/optimized.json \
- [ ] No semantic changes to output
- [ ] **Determinism preserved** (same seed -> same output)
- [ ] No `.unwrap()` or `.expect()` added (lading MUST NOT panic)
- [ ] **No bugs introduced** (if bug found -> `/lading-optimize-validate`)
- [ ] **No bugs introduced** (if bug found -> REJECT with bug details)
- [ ] Property tests exist for changed code

### 4. Rust Expert (Lading-Specific Patterns)
Expand Down Expand Up @@ -178,37 +175,8 @@ ci/kani lading_payload
|---------|-------|--------|
| **APPROVED** | 5/5 APPROVE | Return APPROVED report |
| **REJECTED** | Any REJECT | Return REJECTED report |
| **DUPLICATE** | Duplicate Hunter REJECT | Return DUPLICATE report |
| **BUG FOUND** | Correctness issue | Invoke `/lading-optimize-validate`, return BUG_FOUND report |

### Bug Triage

When issues are discovered, determine the correct action:

| Signal | Is It a Bug? | Action |
| --------------------------------------- | ------------ | ---------------------------------- |
| ci/validate fails after optimization | Possible bug | Invoke `/lading-optimize-validate` |
| Determinism broken | Possible bug | Invoke `/lading-optimize-validate` |
| Conservative finds correctness issue | Possible bug | Invoke `/lading-optimize-validate` |
| Benchmark regression but correct output | NOT a bug | REJECT optimization |
| No improvement but correct output | NOT a bug | REJECT optimization |

### When Bug Is Found

If review discovers a bug instead of an optimization:

```
/lading-optimize-validate
```

The validate skill will:
1. Confirm this is actually a bug (not just a failed optimization)
2. Attempt Kani proof (if feasible)
3. Create property test reproducing the bug
4. Verify the fix works
5. Record in `.claude/skills/lading-optimize-hunt/assets/db.yaml`

Then return here to return a BUG_FOUND report in Phase 6.
Duplicates, bugs, correctness issues, and missing benchmarks are all rejections. Describe the specific reason in the report's `reason` field.

---

Expand All @@ -222,8 +190,6 @@ Fill in the appropriate template and return the completed YAML:
| --------- | ---------------------------------------------------------------------- |
| approved | `.claude/skills/lading-optimize-review/assets/approved.template.yaml` |
| rejected | `.claude/skills/lading-optimize-review/assets/rejected.template.yaml` |
| duplicate | `.claude/skills/lading-optimize-review/assets/duplicate.template.yaml` |
| bug_found | `.claude/skills/lading-optimize-review/assets/bug-found.template.yaml` |

1. Read the appropriate template from the `.claude/skills/lading-optimize-review/assets/` directory
2. Fill in placeholders using argument values:
Expand Down

This file was deleted.

This file was deleted.

7 changes: 1 addition & 6 deletions .claude/skills/lading-optimize-submit/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
name: lading-optimize-submit
description: Full optimization workflow with git branch creation, commits, and optional PR. Wraps /lading-optimize-hunt with git automation.
allowed-tools: Bash(git:*) Bash(gh:*) Bash(cat:*) Read Write Edit Skill
allowed-tools: Bash(git:*) Bash(gh:*) Bash(cat:*) Read Skill
---

# Optimization Submit Workflow

**Complete optimization workflow with git automation.** This skill wraps `/lading-optimize-hunt` and handles:
- Git branch creation
- Baseline benchmarking
- Code changes
- Re-benchmarking with changes
- Git commit with formatted results
- Optional push and PR creation

Expand Down Expand Up @@ -136,8 +133,6 @@ gh pr create \
- [x] Kani proofs pass (or N/A: <reason>)
- [x] Determinism verified

Ready for `/lading-optimize-review`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Expand Down
Loading
Loading