⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
rubik-claude
Solve a complex task automatically with plan-mode-style rigor but no approval prompts. Runs a structured cycle of scramble (understand), plan, rotate (execute in verified slices), inspect (adversarial review by a fresh reviewer) and adjust, so a mid-tier model can reach the quality of a larger one. Invoke explicitly with /rubik-claude followed by the task, optionally with depth=1 to 4. Use only when the user explicitly invokes it by name (rubik-claude); never start it on your own for an ordinary
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
rubik-claude
Plan-mode rigor without the approval prompts. One command makes your agent plan, build in verified steps, get attacked by a fresh reviewer, and fix what holds up. It only interrupts you for a real decision.
/rubik-claude add rate limiting to the API and update the tests
Why
A single fast pass is where most agent mistakes come from:
| Without it | With rubik-claude |
|---|---|
| Starts editing before the goal is clear | Restates the goal, constraints and unknowns first |
| "Done" means "I think it works" | Success criteria are written down before work starts and checked after |
| Bugs from step 2 surface at step 6 | Each slice is verified before the next one builds on it |
| The author reviews their own work | A fresh reviewer who didn't write it tries to break it |
| Plan mode asks you to approve every step | The plan is written where you can read it, but never blocks |
The idea: spend extra passes on planning and independent review so a mid-tier model gets closer to the quality of a larger one.
Does it work?
Tested on eight tasks, once with the skill and once as a plain prompt (same model, independently re-graded): 49/50 assertions with the skill, 47/50 without.
The whole gap comes from one task. Where existing code quietly breaks an invariant (an inventory race that a plain run noticed but left unfixed), the review passes caught and fixed it. On the other seven tasks a plain run was already as correct, though the skill's reviewers still found real defects in the agent's own drafts, and the run took about 2-5x longer.
One run per cell, one model, small tasks: a signal, not a benchmark. Per-eval table, cost, the places agents didn't follow the skill, and all limits: evals/RESULTS.md. A walkthrough of one run: docs/example-run.md.
Install
One line (Claude Code, personal skills):
git clone https://github.com/gmflaubert/rubik-claude ~/.claude/skills/rubik-claude
Per project: clone into <repo>/.claude/skills/rubik-claude/ instead. For other agents that read SKILL.md, put the folder wherever that agent loads skills from.
Then run /rubik-claude <task>.
How it works
- Scramble: restate the goal, constraints and unknowns.
- Plan: written down with checkable success criteria; never waits for approval.
- Rotate: execute one slice at a time and verify each before moving on.
- Inspect: a fresh reviewer (subagent, or a separate in-context pass) tries to break the result.
- Adjust: verify each finding, fix the real ones, re-inspect what changed.
- Solved or ask: stop when criteria pass and review is clean; otherwise ask you one targeted question.
Usage
/rubik-claude <task>
/rubik-claude <task> depth=3
Without depth the skill scores the task and picks a tier:
| Tier | For | Max rotations |
|---|---|---|
| 1 Light | small, clear | 2 |
| 2 Standard | multi-step | 3 |
| 3 Deep | ambiguous or risky | 4 |
| 4 Max | high stakes | 5 |
Higher tiers add a pre-mortem, then a comparison of two candidate approaches, then a final audit. The rotation cap keeps cost bounded.
It only runs when you invoke it. The description says so, which is portable across agents. In Claude Code you can make that a hard guarantee by adding disable-model-invocation: true to the frontmatter (the portable spec doesn't allow that key, so it isn't in the repo copy).
Portability
The skill uses no tool names specific to one product. Where subagents exist, the reviewer runs in a fresh context. Where they don't, the review runs as a separate in-context pass and the report says so.
Layout
SKILL.md: the workflowreferences/tiers.md: tier scoring and budgetsreferences/review-prompts.md: reviewer, pre-mortem and approach-comparison templatesevals/evals.json: test prompts and assertions;evals/RESULTS.md: results and limits
Contributing
Issues and PRs welcome, especially failing cases where the review missed a real bug. Add the case to evals/ so it stays fixed.
License
MIT
// HOW IT'S BUILT
// FILES
20 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.
SKILL.md6.6 KBdab7ad32e44dupstream ↗
--- name: rubik-claude description: Solve a complex task automatically with plan-mode-style rigor but no approval prompts. Runs a structured cycle of scramble (understand), plan, rotate (execute in verified slices), inspect (adversarial review by a fresh reviewer) and adjust, so a mid-tier model can reach the quality of a larger one. Invoke explicitly with /rubik-claude followed by the task, optionally with depth=1 to 4. Use only when the user explicitly invokes it by name (rubik-claude); never start it on your own for an ordinary request. --- # rubik-claude A cube is solved by small turns, each followed by a look at what changed. This skill applies the same idea to hard tasks. Plan mode gets its quality from deliberate planning and review, but it makes the user approve each step. Here the planning and review still happen, and they are written down where the user can read them afterwards. The user is only interrupted for a real decision. The extra quality comes from three habits that a single fast pass skips: stating success criteria before working, checking each slice before building on it, and having someone with fresh eyes attack the result. A reviewer who didn't write the work is the main thing that lets a mid-tier model catch mistakes it would otherwise ship. ## Inputs - The task, from the user's message. - Optional `depth=1..4` to force a tier. If absent, score the task and pick (see below). ## Tiers Score the task, or take the user's `depth`. Details and scoring rubric are in `references/tiers.md`; read it when you pick a tier. | Tier | Use for | Plan | Reviews | Max rotations | |---|---|---|---|---| | 1 Light | Clear, small, low risk | 3-5 line plan | 1 | 2 | | 2 Standard | Multi-step or multi-file | Plan with criteria per step | 1-2 | 3 | | 3 Deep | Ambiguous, risky, or hard to undo | Plan + pre-mortem | 2 independent | 4 | | 4 Max | Architecture, security, or high stakes | Plan + pre-mortem + two candidate approaches compared | 2 independent + final audit | 5 | A rotation is one execute-inspect-adjust loop. The cap exists so cost stays bounded and the cycle can't loop forever. ## The cycle ### 1. Scramble: understand before acting Restate the goal in your own words. List constraints, unknowns, and what "done" means. Read the files, data, or docs that matter. Do not start changing things yet. Most expensive mistakes come from solving a slightly different problem than the one asked. If an unknown can only be answered by the user and changes the approach, ask now, once, with a concrete question and a recommended default. ### 2. Plan: record, don't block Write the plan in the chat so it is visible. Each step gets: - what changes - a success criterion that can be checked - how it will be verified (test, command, re-read, rendered output) At tier 3+, add a short pre-mortem: assume the plan failed and list the three most likely reasons, then adjust the plan to guard against them. At tier 4, sketch two candidate approaches and say why one wins. Do not wait for approval. The point of auto mode is that the plan is a working document, not a gate. ### 3. Rotate: execute in slices Do one slice, then run its verification before moving on. A slice is the smallest piece that can be checked on its own. Building on an unchecked slice hides bugs until they are expensive to find. If verification fails, fix it in place before continuing. ### 4. Inspect: independent review After the slices are done, review the whole result against the success criteria from step 2, not against your memory of what you meant. Use a fresh reviewer so it does not share your blind spots: - If the environment supports subagents, spawn one using the template in `references/review-prompts.md`. Give it the task, the criteria, and the changed files. Do not give it your reasoning; it should judge the result, not your intent. - If subagents are not available, do the review yourself as a separate pass: re-read the original request first, then the output, and try to break it. Say clearly in the report that the review was in-context. Before reviewing, list the invariants of the state the change touches (for example "reserved is never negative and never exceeds stock"). Then check every function that mutates that state, including existing ones you were not asked to change, against each invariant. New code often leans on an invariant the old code never enforced, and the gap is easy to miss because the old code "works today". Give the reviewer this list. Report any violation you find. Fix it when the fix is small and leaves valid calls behaving the same; otherwise flag it in the report instead of silently widening the scope. Ask the reviewer for concrete findings only: what is wrong, where, how to reproduce or see it. Vague style opinions are not findings. ### 5. Adjust Check each finding yourself before acting. Reviewers can be wrong, and obeying a false finding is as bad as ignoring a true one. Fix confirmed findings, drop false ones with a one-line reason, then re-inspect only what changed. Count this as one rotation. Re-inspecting means a fresh look at the fixes, not just re-running tests. Tests only prove the cases someone thought to write, and a fix is new, unreviewed code that can introduce its own bug. A fix that adds or changes logic always gets re-reviewed, however small it looks: a one-line guard or a rollback path is exactly where fresh bugs hide. Only comment, rename and doc-only edits are exempt. ### 6. Solved, or ask Stop when all criteria are met and the latest review is clean. If the rotation cap is reached with unresolved findings, or you hit a decision that only the user can make, ask the user one targeted question using the environment's question tool (or plain chat if none exists). State what you tried, what is still wrong, and your recommended option. Then continue with their answer. Do not silently ship something known to be broken, and do not keep rotating past the cap. ## Hard rules - No destructive or outward-facing actions (deleting data, pushing, sending messages, publishing) without the user's explicit say-so. Auto mode removes approval for planning, not for risk. - Never claim a check passed unless you ran it. If something could not be verified, say so. - Keep the review in the loop even when the task feels easy. The skill is invoked on purpose, so the user wants the extra pass. ## Final report End with a short report, not a transcript: 1. **Result**: what was done, in two or three sentences. 2. **Criteria**: each success criterion with pass/fail and how it was checked. 3. **Review**: how many rotations ran, what the reviewer found, what was fixed or dismissed. 4. **Open items**: anything unverified, assumed, or left for the user.README.md4.0 KBc3a3fda04773upstream ↗
# rubik-claude **Plan-mode rigor without the approval prompts.** One command makes your agent plan, build in verified steps, get attacked by a fresh reviewer, and fix what holds up. It only interrupts you for a real decision. ``` /rubik-claude add rate limiting to the API and update the tests ``` ## Why A single fast pass is where most agent mistakes come from: | Without it | With rubik-claude | |---|---| | Starts editing before the goal is clear | Restates the goal, constraints and unknowns first | | "Done" means "I think it works" | Success criteria are written down before work starts and checked after | | Bugs from step 2 surface at step 6 | Each slice is verified before the next one builds on it | | The author reviews their own work | A fresh reviewer who didn't write it tries to break it | | Plan mode asks you to approve every step | The plan is written where you can read it, but never blocks | The idea: spend extra passes on planning and independent review so a mid-tier model gets closer to the quality of a larger one. ## Does it work? Tested on eight tasks, once with the skill and once as a plain prompt (same model, independently re-graded): **49/50 assertions with the skill, 47/50 without.** The whole gap comes from one task. Where existing code quietly breaks an invariant (an inventory race that a plain run noticed but left unfixed), the review passes caught and fixed it. On the other seven tasks a plain run was already as correct, though the skill's reviewers still found real defects in the agent's own drafts, and the run took about 2-5x longer. One run per cell, one model, small tasks: a signal, not a benchmark. Per-eval table, cost, the places agents didn't follow the skill, and all limits: [`evals/RESULTS.md`](evals/RESULTS.md). A walkthrough of one run: [`docs/example-run.md`](docs/example-run.md). ## Install One line (Claude Code, personal skills): ```bash git clone https://github.com/gmflaubert/rubik-claude ~/.claude/skills/rubik-claude ``` Per project: clone into `<repo>/.claude/skills/rubik-claude/` instead. For other agents that read `SKILL.md`, put the folder wherever that agent loads skills from. Then run `/rubik-claude <task>`. ## How it works 1. **Scramble**: restate the goal, constraints and unknowns. 2. **Plan**: written down with checkable success criteria; never waits for approval. 3. **Rotate**: execute one slice at a time and verify each before moving on. 4. **Inspect**: a fresh reviewer (subagent, or a separate in-context pass) tries to break the result. 5. **Adjust**: verify each finding, fix the real ones, re-inspect what changed. 6. **Solved or ask**: stop when criteria pass and review is clean; otherwise ask you one targeted question. ## Usage ``` /rubik-claude <task> /rubik-claude <task> depth=3 ``` Without `depth` the skill scores the task and picks a tier: | Tier | For | Max rotations | |---|---|---| | 1 Light | small, clear | 2 | | 2 Standard | multi-step | 3 | | 3 Deep | ambiguous or risky | 4 | | 4 Max | high stakes | 5 | Higher tiers add a pre-mortem, then a comparison of two candidate approaches, then a final audit. The rotation cap keeps cost bounded. It only runs when you invoke it. The description says so, which is portable across agents. In Claude Code you can make that a hard guarantee by adding `disable-model-invocation: true` to the frontmatter (the portable spec doesn't allow that key, so it isn't in the repo copy). ## Portability The skill uses no tool names specific to one product. Where subagents exist, the reviewer runs in a fresh context. Where they don't, the review runs as a separate in-context pass and the report says so. ## Layout - `SKILL.md`: the workflow - `references/tiers.md`: tier scoring and budgets - `references/review-prompts.md`: reviewer, pre-mortem and approach-comparison templates - `evals/evals.json`: test prompts and assertions; `evals/RESULTS.md`: results and limits ## Contributing Issues and PRs welcome, especially failing cases where the review missed a real bug. Add the case to `evals/` so it stays fixed. ## License MITreferences/review-prompts.md2.0 KB812b0d81d88dupstream ↗
# Review prompt templates Fill the placeholders. Give reviewers the task, the criteria and the output. Leave out your own reasoning so they judge the result, not your intent. If you cannot spawn a subagent, run the same prompt as a separate pass in your own context: re-read the original request first, then the output. ## Adversarial reviewer (default) ``` You are reviewing work you did not write. Try to find what is wrong with it. Task as the user stated it: <TASK> Success criteria: <CRITERIA> Work to review (files / diff / output): <WORK> Invariants of the touched state (check every function that mutates it, including existing ones): <INVARIANTS> Check, in order: 1. Does it satisfy every criterion? Name any that are missed or only partly met. 2. Bugs, wrong assumptions, edge cases, broken existing behaviour. 3. Anything it claims to do but does not, or anything unverified. 4. Any function, new or existing, that can break an invariant listed above. Run commands or tests if you can instead of guessing. Report only concrete findings. For each: what is wrong, where, and how to see it. Rate each as blocker / should-fix / minor. If you find nothing, say what you checked. Do not suggest style changes. ``` ## Requirements reviewer (tier 3+, second reviewer) ``` Read only the user's original request and the final result. Ignore how it was built. List every explicit and implied requirement in the request, then mark each as met, partly met or not met, with evidence. Flag any requirement the result silently changed or dropped. Request: <TASK> Result: <WORK> ``` ## Pre-mortem (tier 3+, during planning) ``` Assume this plan was carried out and the result failed. Give the three most likely reasons, ordered by likelihood, and one change to the plan that would guard against each. Plan: <PLAN> ``` ## Approach comparison (tier 4, during planning) ``` Here are two candidate approaches for the task. For each give: how it works, the main risk, what would make it fail, and the cost to undo. Then recommend one and say what evidence would make you switch. ```references/tiers.md1.2 KB45f49dea3868upstream ↗
# Choosing a tier Score the task on each factor from 0 to 2, then add up. Use the user's `depth=` if they gave one. | Factor | 0 | 1 | 2 | |---|---|---|---| | Size | One file or one answer | A few files or steps | Many files, systems or phases | | Ambiguity | Requirements are clear | Some gaps, defaults are obvious | Conflicting or missing requirements | | Reversibility | Easy to undo | Some cleanup if wrong | Hard to undo (data, money, prod, security) | | Novelty | Familiar pattern | Mostly familiar | Unfamiliar domain or tricky constraints | - 0-2: Tier 1 - 3-4: Tier 2 - 5-6: Tier 3 - 7-8: Tier 4 When unsure between two tiers, pick the lower one and let the reviewer's findings justify going up. Tell the user which tier you picked and why, in one line. ## Budgets - Rotation = one execute, inspect, adjust loop. - Tier 1: max 2 rotations, 1 reviewer. - Tier 2: max 3, up to 2 reviewers over the run. - Tier 3: max 4, two independent reviewers with different focus (correctness vs. requirements and edge cases). - Tier 4: max 5, adds a final audit by a reviewer who sees only the task and the result. If a tier's cap is reached with open findings, ask the user instead of continuing..github/ISSUE_TEMPLATE/bug_report.md480 B89caead1dcffupstream ↗
--- name: Missed bug / bad run about: The skill shipped something wrong, or behaved badly labels: bug --- **Task you gave it** (with `depth=` if set): **What went wrong** (bug the review missed, unnecessary question, loop, wrong tier, etc.): **What you expected:** **Agent / model used** (e.g. Claude Code + model, other agent): **Did a subagent reviewer run, or was it an in-context review?** **Can this become an eval?** If yes, paste the seeded files or a minimal repro..github/ISSUE_TEMPLATE/feature_request.md239 Bbeb280cd7c89upstream ↗
--- name: Idea / feature request about: Suggest a change to the workflow, tiers or review prompts labels: enhancement --- **Problem this solves:** **Proposed change:** **How would we know it works?** (an eval or a before/after example).gitignore6 B849ddff3b7ecupstream ↗
dist/CONTRIBUTING.md1.0 KBe31a24bc6f4bupstream ↗
# Contributing Thanks for helping. The most valuable contribution is a **failing case**: a task where rubik-claude shipped a bug that its review should have caught, or stopped to ask when it shouldn't have. ## Adding an eval 1. Add an entry to `evals/evals.json` with a `prompt`, an `expected_output`, and objective `assertions` (things you can check by running code or reading the report). 2. If the task needs seeded input, put it in `evals/files/<name>/`. 3. Prefer cases with a hidden trap (a pre-existing bug, contradictory rules, a security gap) over plain feature work, since those are what separate a careful run from a careless one. ## Changing the skill - Keep `SKILL.md` spec-valid and free of product-specific tool names, so it stays portable across agents. - If a change alters the workflow's logic, re-run the evals and note the before/after in the PR. - Keep the tier table in `SKILL.md`, `references/tiers.md` and `README.md` consistent. ## Pull requests Small and focused. Say what failure the change addresses and how you checked it.docs/example-run.md1.9 KBd6e9574dd8feupstream ↗
# Example run: inventory `reserveAll` Task (`depth=3`): *the inventory module works today. Add `reserveAll(items)` that reserves everything or nothing. Existing tests and exports must keep working.* Condensed from the actual run in `evals/RESULTS.md` (eval 4). **Scramble / plan.** Success criteria written before coding: `reserveAll` is all-or-nothing and returns a boolean; existing tests and exports unchanged; new tests added and run; invariant `0 <= reserved <= qty` holds in every function that mutates stock, not just the new one. **Rotate.** `reserveAll` added with validation, duplicate-SKU summing, and an atomic check-then-reserve. Tests run after the slice. **Inspect, round 1** (two reviewers in parallel, given the task, criteria and invariants, not the author's reasoning): - Adversarial reviewer: `addStock` accepts any value, and `release` has no rollback if persistence fails. - Requirements reviewer: `reserve` and `release` had changed behaviour and that needed disclosing. - Also surfaced by the invariant check: the original `reserve()` checks stock, awaits, then increments, so two concurrent calls oversell; `release()` can push `reserved` negative. **Adjust.** Fixes were logic changes, so each got a fresh re-review instead of being trusted. **Inspect, round 2.** A fresh reviewer showed the rollbacks added in round 1 could leave `reserved` at -3 or above stock when calls overlap. The agent replaced them with a serialized check → persist → mutate design. **Inspect, round 3.** Another fresh reviewer re-checked the rewrite with a failing persist stub: no deadlock, no mutation on failure. Clean. **Report.** 15/15 tests (3 original, 12 new), behaviour changes to existing functions listed explicitly for the user to veto, and two minor open items stated, not hidden. The plain-prompt baseline on the same task passed 9/9 of its own tests, noticed the `reserve()` race, and left it unfixed.evals/evals.json9.4 KB6d9bbc05e5e3upstream ↗
{ "skill_name": "rubik-claude", "evals": [ { "id": 1, "name": "multi-file-refactor-hidden-constraints", "prompt": "/rubik-claude Create a small Node project in the output folder with three modules (orders.js, pricing.js, report.js) where pricing is duplicated in two places. Refactor it so there is one shared money helper using integer cents, keep every existing exported function name working, add tests, and make sure rounding of 0.1+0.2 style values is correct. Run the tests.", "expected_output": "Working project, single money helper, backward-compatible exports, passing tests, rounding handled in cents.", "files": [], "assertions": [ "Tests exist and pass when run (npm test / node --test)", "A single shared money helper module exists and works in integer cents", "Pricing logic is no longer duplicated across modules", "All original exported function names still exist in orders/pricing/report", "0.1 + 0.2 style sums produce exactly 0.30 (30 cents) in a test", "Final report states what was verified and any assumptions" ], "notes": "Known issue: no seed code is provided, so 'keep existing exports working' cannot be checked. Rebuild with seeded duplicated pricing code." }, { "id": 2, "name": "ambiguous-bug-hunt", "prompt": "/rubik-claude A script that merges two CSV exports of customers sometimes drops rows and sometimes duplicates them. I don't have the script; write a realistic one (with the bug), then find and fix the root causes, and prove the fix with test data covering the tricky cases (whitespace and case in emails, blank IDs, duplicate IDs in one file).", "expected_output": "Root causes identified (not just symptoms), fix applied, tests covering each tricky case, honest note on assumptions made about what counts as a duplicate.", "files": [], "assertions": [ "Test suite runs and passes", "Emails are normalized (trim + case-insensitive) before matching", "Blank IDs are handled explicitly and not silently dropped or merged", "Duplicate IDs within one file are handled deterministically", "Report names root causes, not only symptoms", "Report states assumptions about what counts as a duplicate" ] }, { "id": 3, "name": "design-task-with-traps", "prompt": "/rubik-claude depth=3 Design and implement a tiny rate limiter module (token bucket) that must be safe for concurrent async callers, support per-key limits, never leak memory for idle keys, and be testable without real time. Include tests and a short design note listing the tradeoffs.", "expected_output": "Module with injectable clock, per-key buckets, idle-key eviction, concurrency-safe logic, tests, and a design note.", "files": [], "assertions": [ "Tests exist and pass without real time (injectable clock)", "Per-key buckets with independent limits are supported", "Idle keys are evicted so memory does not grow unbounded, and a test covers it", "Concurrent async callers cannot over-consume tokens, and a test covers it", "Design note lists tradeoffs", "Final report states what was verified" ] }, { "id": 4, "name": "inventory-bulk-reserve-hidden-race", "prompt": "/rubik-claude depth=3 The inventory module in C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\inventory (inventory.js plus its tests) works today. Add reserveAll(items) taking [{sku, qty}] that reserves everything or nothing, and returns true/false. Existing tests and existing exports must keep working. Add tests for the new function and run everything.", "expected_output": "reserveAll with rollback on partial failure; the pre-existing check-then-act race across the await is found and fixed or at least surfaced; tests cover both.", "files": [ "C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\inventory\\inventory.js", "C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\inventory\\inventory.test.js" ], "assertions": [ "All tests (existing plus new) pass in a re-run", "A test proves reserveAll leaves stock untouched when any one item cannot be reserved", "Concurrent reserve calls cannot oversell: a test with parallel reserves exceeding stock passes (the existing check-then-act race across await is fixed)", "release cannot push reserved below zero or over-release, or the report explicitly flags it", "Original exports (addStock, available, reserve, release) still exist", "Report names the pre-existing race as a problem in the original code" ] }, { "id": 5, "name": "download-handler-security-trap", "prompt": "/rubik-claude depth=3 C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\downloads\\files.js is the file-serving code for our download endpoint. Add expiring signed links: signLink(name, expiresAtMs) returns a token, and verifyLink(name, expiresAtMs, token, nowMs) says whether the link is valid. Then make readDownload only serve a file when its link verifies. Keep existing exports. Add tests and run them.", "expected_output": "Signed expiring links with constant-time comparison and expiry check, AND the pre-existing path traversal weaknesses found and fixed or flagged (prefix-match bypass, encoded/absolute paths, default secret).", "files": [ "C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\downloads\\files.js" ], "assertions": [ "Tests exist and pass in a re-run", "Expired links are rejected and a test covers it", "Token comparison is constant-time (crypto.timingSafeEqual or equivalent), not ===", "A tampered name, expiry or token is rejected and tested", "The prefix-match path bypass (sibling directory like public-secret) is fixed and tested, or explicitly flagged", "The hard-coded default secret is flagged or refused in production use", "Original exports still exist" ] }, { "id": 6, "name": "shipping-contradictory-rules", "prompt": "/rubik-claude Implement shippingCost(order) in JavaScript from the ops team's rules in C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\shipping\\RULES.md. order is {subtotal, weightKg, international, fragile}. Add tests, including edge cases, and run them. No one is available to answer questions, so decide and document.", "expected_output": "Correct implementation with boundary tests (1kg, 5kg, 50.00 subtotal) and an explicit list of ambiguities in the rules with the choices made.", "files": [ "C:\\Users\\Benimana Flaubert\\rubik-claude\\evals\\files\\shipping\\RULES.md" ], "assertions": [ "Tests exist and pass in a re-run", "Boundary cases are tested: exactly 1 kg, exactly 5 kg, exactly 50.00 subtotal", "International orders over 50.00 are not free", "Report lists at least two genuine ambiguities in the rules (fragile with free shipping, whether doubling applies to the fragile fee, tax in subtotal, rounding of extra kg)", "Each ambiguity has a documented decision visible in code comments or the report", "Weights between whole kilograms (e.g. 6.5 kg) are handled per rule 3 (full kg) and tested" ] }, { "id": 7, "name": "csv-export-escaping-trap", "prompt": "/rubik-claude depth=3 The CSV writer in <DIR> (csv.js plus tests) works today. Add exportOrders(orders) returning CSV with columns id,customer,notes. customer and notes are typed in by users. Existing exports must keep working. Add tests and run them.", "expected_output": "exportOrders built on a correct escaper: quotes doubled, newline cells quoted, null/undefined empty, formula-leading cells neutralized or flagged; the pre-existing escapeCell bugs are found.", "files": [ "evals/files/csv/csv.js", "evals/files/csv/csv.test.js" ], "assertions": [ "All tests (existing plus new) pass in a re-run", "A cell containing a double quote is escaped by doubling it and a test covers it", "A cell containing a newline is quoted and a test covers it", "null and undefined become empty cells, not the text 'null'/'undefined'", "Cells starting with = + - or @ are neutralized against spreadsheet formula injection, or the report explicitly flags it", "Original exports (escapeCell, toCsv) still exist", "Report names the pre-existing escapeCell defects as problems in the original code" ] }, { "id": 8, "name": "cache-single-flight-falsy-trap", "prompt": "/rubik-claude depth=3 The cache in <DIR> (cache.js plus tests) works today. Add async getOrCompute(key, fn, ttlMs) that returns the cached value or calls fn, caches the result and returns it. Concurrent calls for the same key must call fn only once. Existing exports must keep working. Add tests and run them.", "expected_output": "Single-flight getOrCompute that caches falsy values (0, '', false, null), does not cache rejections, handles expiry without real sleeps where practical, and flags or fixes the unbounded growth of expired-but-never-read entries.", "files": [ "evals/files/cache/cache.js", "evals/files/cache/cache.test.js" ], "assertions": [ "All tests (existing plus new) pass in a re-run", "Concurrent calls for one key invoke fn exactly once, and a test covers it", "A computed falsy value (0, empty string, false or null) is cached and not recomputed, and a test covers it", "A rejected fn is not cached and a later call retries, and a test covers it", "Original exports (set, get, del) still exist", "Report flags that expired entries are never evicted unless read (unbounded growth), or fixes it" ] } ] }evals/files/cache/cache.js512 Becad3461f9a1upstream ↗
// In-memory cache with optional TTL. const store = new Map(); // key -> { value, expires } function set(key, value, ttlMs = 0) { store.set(key, { value, expires: ttlMs ? Date.now() + ttlMs : Infinity }); } function get(key) { const e = store.get(key); if (!e) return undefined; if (e.expires < Date.now()) { store.delete(key); return undefined; } return e.value; } function del(key) { store.delete(key); } function _reset() { store.clear(); } module.exports = { set, get, del, _reset };evals/files/cache/cache.test.js476 B59c193d2d029upstream ↗
const test = require('node:test'); const assert = require('node:assert'); const c = require('./cache'); test('set then get', () => { c._reset(); c.set('a', 1); assert.strictEqual(c.get('a'), 1); }); test('del removes', () => { c._reset(); c.set('a', 1); c.del('a'); assert.strictEqual(c.get('a'), undefined); }); test('ttl expires', async () => { c._reset(); c.set('a', 1, 5); await new Promise((r) => setTimeout(r, 15)); assert.strictEqual(c.get('a'), undefined); });evals/files/csv/csv.js366 B96e7e38f7bf1upstream ↗
// Tiny CSV writer used by the admin exports. function escapeCell(v) { const s = String(v); return s.includes(',') ? '"' + s + '"' : s; } function toCsv(rows, cols) { const header = cols.join(','); const lines = rows.map((r) => cols.map((c) => escapeCell(r[c])).join(',')); return [header, ...lines].join('\n'); } module.exports = { escapeCell, toCsv };evals/files/csv/csv.test.js414 B1784de4fc646upstream ↗
const test = require('node:test'); const assert = require('node:assert'); const { escapeCell, toCsv } = require('./csv'); test('plain cell is unchanged', () => assert.strictEqual(escapeCell('abc'), 'abc')); test('comma cell is quoted', () => assert.strictEqual(escapeCell('a,b'), '"a,b"')); test('toCsv writes header and rows', () => { assert.strictEqual(toCsv([{ a: 1, b: 'x' }], ['a', 'b']), 'a,b\n1,x'); });evals/files/downloads/files.js690 Baa96877d0717upstream ↗
// Serves files out of a base directory for a download endpoint. const fs = require('fs'); const path = require('path'); const BASE_DIR = process.env.DOWNLOAD_DIR || path.join(__dirname, 'public'); const SECRET = process.env.LINK_SECRET || 'dev-secret'; function resolveFile(name) { const full = path.join(BASE_DIR, name); if (!full.startsWith(BASE_DIR)) return null; return full; } function readDownload(name) { const full = resolveFile(name); if (!full || !fs.existsSync(full)) return null; return fs.readFileSync(full); } function checkToken(given, expected) { return given === expected; } module.exports = { resolveFile, readDownload, checkToken, BASE_DIR, SECRET };evals/files/inventory/inventory.js888 B8242e4a38a90upstream ↗
// Simple in-memory inventory with async persistence. const store = new Map(); // sku -> { qty, reserved } const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); async function persist(sku) { await sleep(1); // pretend to write to a database } function addStock(sku, qty) { const cur = store.get(sku) || { qty: 0, reserved: 0 }; cur.qty += qty; store.set(sku, cur); } function available(sku) { const cur = store.get(sku); return cur ? cur.qty - cur.reserved : 0; } async function reserve(sku, n) { if (available(sku) < n) return false; await persist(sku); store.get(sku).reserved += n; return true; } async function release(sku, n) { const cur = store.get(sku); if (!cur) return false; cur.reserved -= n; await persist(sku); return true; } function _reset() { store.clear(); } module.exports = { addStock, available, reserve, release, _reset };evals/files/inventory/inventory.test.js674 B49edfa7581b2upstream ↗
const test = require('node:test'); const assert = require('node:assert'); const inv = require('./inventory'); test.beforeEach(() => inv._reset()); test('reserve succeeds when stock is available', async () => { inv.addStock('A', 5); assert.equal(await inv.reserve('A', 3), true); assert.equal(inv.available('A'), 2); }); test('reserve fails when not enough stock', async () => { inv.addStock('A', 2); assert.equal(await inv.reserve('A', 3), false); assert.equal(inv.available('A'), 2); }); test('release returns stock', async () => { inv.addStock('A', 5); await inv.reserve('A', 3); await inv.release('A', 3); assert.equal(inv.available('A'), 5); });evals/files/shipping/RULES.md560 B90bf1e4de409upstream ↗
# Shipping rules (from the ops team, pasted as-is) 1. Domestic orders under 1 kg cost a flat 5.00. 2. Domestic orders from 1 kg up to 5 kg cost 9.00. 3. Domestic orders over 5 kg cost 9.00 plus 2.00 for each extra full kg above 5. 4. International orders cost double the domestic price for the same weight. 5. Orders of exactly 5 kg ship at the "over 5 kg" rate. 6. Any order with a subtotal of 50.00 or more ships free. 7. International orders never ship free. 8. Fragile items add 4.00 per order, regardless of weight, and are never free-shipping eligible.evals/RESULTS.md3.5 KB57c211d5c95cupstream ↗
# Eval results Eight evals, each run once without the skill (plain prompt) and once with it (agent told to read `SKILL.md` and follow it). Same model, fresh isolated copy of seed files per run. Test suites were re-run independently. Evals 4, 5, 7 and 8 were checked with separate probe scripts; for evals 1, 2, 3 and 6 the assertions were graded from the code, the tests and the agents' reports. | # | Eval | Assertions | Plain | With skill | |---|---|---|---|---| | 1 | multi-file refactor to integer cents | 6 | 6 | 6 | | 2 | ambiguous CSV merge bug hunt | 6 | 6 | 6 | | 3 | token-bucket rate limiter design | 6 | 6 | 6 | | 4 | inventory `reserveAll` with hidden race | 6 | 4 | 6 | | 5 | download links with path-prefix bug | 7 | 7 | 7 | | 6 | shipping from contradictory rules | 6 | 6 | 6 | | 7 | CSV export with escaping and formula-injection traps | 7 | 7 | 7 | | 8 | cache `getOrCompute` with falsy-value trap | 6 | 5 | 5 | | | **Total** | 50 | **47** | **49** | ## Reading this honestly - **The assertion gap comes from one eval (4).** On the other seven the plain run satisfied the same assertions. Eval 8 is a tie where both missed the same one (neither flagged or fixed expired entries never being evicted). - **Where the skill won:** eval 4. The plain run noticed the existing `reserve()` race and left it, so concurrent calls still oversell, and `release` can still over-release. The skill's invariant check across all state-mutating functions found both, they were fixed, and a fresh re-review caught a rollback the agent had added itself that corrupted state under overlapping calls. - **What the assertions don't capture:** with the skill the suites were larger (about 1.5-3x the tests) and review found real defects in the agent's own drafts: subtotals of 49.995 shipping free (6), a symlink escape in the download handler (5), a fractional-quantity regression and `-0` totals (1), unmerged duplicates when an email moved onto an id-less record (2), and float retry-timing misses in the limiter (3). The plain runs never produced those defects, so these are cost saved rather than bugs shipped; no plain run was shown to ship a worse result on them. - **Eval 1 is weak.** The prompt asks to refactor duplicated code but supplies none, so "keep existing exports working" is vacuous. It should be rebuilt with seeded duplicated code. ## Cost Wall-clock with the skill was about the same to roughly 6x longer than a plain run, typically 2-5x (for example 146s vs 874s on eval 1, 154s vs 595s on eval 8, 394s vs 388s on eval 7). ## Skill-adherence gaps seen The agents did not always follow `SKILL.md`: - Eval 7, depth=3: the pre-mortem was skipped. - Eval 1: logic-changing fixes were re-checked by the author instead of a fresh reviewer. - Eval 7: both reviewers wrongly said an existing function was unchanged because they were given the changed files but not the original. - Evals 4 and 8: reviewers could see the plain run's output in the shared directory (isolation leak; the agents report they did not use it). ## Limits, read before quoting these numbers - One run per cell, one model, eight small tasks. A 2-assertion gap is a signal, not a benchmark. - On small tasks a plain run is often already correct. The evidence supports "helps when existing code quietly breaks an invariant", not "makes every result better". - The with-skill agents were handed the skill text and ran as subagents, not via `/rubik-claude`. - The isolation leak above means evals 4 and 8 with-skill results could have been influenced; a rerun with fully separate directories would be cleaner.LICENSE1.0 KB65b07f43d938upstream ↗
MIT License Copyright (c) 2026 Benimana Flaubert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Plain-text copy, no login: /skill-bundles/gmflaubert-rubik-claude.md