feat(adapters): Superpowers skill evaluation adapter#134
Conversation
Add adapter to evaluate Superpowers skills against synthetic scenarios: - `skillopt_sleep/adapters/superpowers.py`: SuperpowersEvaluator class - Embedded scenarios for verification-before-completion skill - Rule-based judge (contains, regex, order, any_of ops) - Isolated HOME per scenario for clean state - Returns score compatible with SkillOpt gate - `tests/test_superpowers_scenarios.py`: Offline tests for judge logic Usage: from skillopt_sleep.adapters.superpowers import SuperpowersEvaluator evaluator = SuperpowersEvaluator(skill="verification-before-completion") results = evaluator.evaluate(candidate_skill_path) Refs microsoft#132 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 2 more scenarios: partial-pass-honest, flaky-verify-rerun - Add token_cap parameter to SuperpowersEvaluator - Add total_tokens and total_latency_ms to EvalResults - Estimate tokens from output length (~4 chars/token) Now 5 scenarios testing verification-before-completion skill. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Copy candidate skill into temp superpowers copy, not original checkout - Add assertion: resolved skill path must be under workspace - Stamp each scenario result with pinned_sha, candidate_hash, scenario_seed - Clone superpowers at pinned SHA per evaluation run - Add --sha CLI flag Addresses feedback from truongsontung on microsoft#132.
- Use is_relative_to() instead of string prefix for path check - Raise ValueError instead of assert (survives -O) - Use git init+fetch+checkout instead of clone-then-fetch (no wasted download) - Add check=True to all git subprocess calls
Yif-Yang
left a comment
There was a problem hiding this comment.
Thank you for picking up #132 and for iterating on the overlay/provenance ideas. There are tests here: we ran the 14 offline tests and the full suite (274 passed / 6 skipped). The current tests validate the rule matcher and scenario metadata, but they do not execute or validate the Superpowers integration path yet.
A clarification from our side: --target-skill-path is a SkillOpt-Sleep CLI option, not a Claude Code CLI option. The issue discussion did not make that distinction clearly enough. In the current adapter, Claude exits because it does not recognize that flag, so the candidate is not evaluated. The candidate is also copied to skills/SKILL.md rather than skills/verification-before-completion/SKILL.md, and the pinned Superpowers checkout is cloned but never loaded through its normal bootstrap/plugin/harness integration.
Before this can demonstrate Superpowers support, could you please add:
- A real, supported Superpowers harness path using the pinned checkout and normal bootstrap/plugin integration, with only
skills/verification-before-completion/SKILL.mdoverlaid in the temporary copy. - Fail-closed handling for non-zero Claude/git exits, timeout, malformed output, and missing scores. Please avoid inheriting unrelated host credentials and avoid unconditional
--dangerously-skip-permissions. - Deterministic mocked integration tests that exercise the actual runner/overlay path, prove the candidate file is the one loaded, and prove the source checkout remains unchanged.
- One opt-in real Claude Code smoke comparison (not public CI): baseline versus candidate with identical model/settings/tasks, raw outputs, and evidence that normal Superpowers behavior was active. A result showing no improvement is completely acceptable; the important part is proving the integration is real and reproducible.
- Corrections to the synthetic scenarios: the math tests currently reference
addwithout importing it, and the flaky helper setsTEST_RUN=1before its first run, so those scenarios do not test the intended behaviors. - Please remove the unrelated
CONTRIBUTING.mdpolicy change and the new 5,906-lineuv.lockunless a dependency change actually requires it, and update the PR description to match the current five scenarios/token fields.
As written in #132, testing a standalone skill-like prompt is not equivalent to running Superpowers. Once the real smoke and integration tests pass, we will be very happy to re-review and merge this through your original PR so your contribution is fully acknowledged.
- Use real harness path: skills/<name>/SKILL.md + HOME/.claude/skills symlink - Remove nonexistent --target-skill-path flag - Fail-closed on non-zero exit, timeout, missing claude binary - Fix scenarios: add missing imports, fix flaky test sentinel logic - Add 6 mocked integration tests proving overlay mechanism works - Add smoke_superpowers.sh for manual baseline/candidate comparison - Remove unrelated CONTRIBUTING.md change and 5.9k-line uv.lock Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks for the substantial update. The candidate overlay path, invalid CLI flag, fail-closed process handling, scenario fixtures, mocked integration coverage, and unrelated-file cleanup are all meaningful improvements. We re-ran the branch: the 20 focused tests pass, and the suite also passes when combined with current A few issues still block merging the adapter as a reliable Superpowers evaluator:
The feature direction remains valuable, and we would like to merge it through your PR so the contribution stays fully attributed. Once these focused correctness, live-integration, and safety points are addressed, we will re-review promptly. |
- Fix not_contains to split on pipe (all alternatives must be absent) - Add regression tests for false completion claim detection - Scrub host env: only PATH/TERM/LANG/ANTHROPIC_API_KEY, no credentials - Remove unconditional --dangerously-skip-permissions (opt-in via SKILLOPT_UNSAFE=1) - Include raw output in JSON for smoke test evidence - Fix smoke script: fail on errors, preserve raw output
Summary
Adds adapter to evaluate Superpowers skills against synthetic scenarios. Refs #132.
Changes
skillopt_sleep/adapters/superpowers.py:SuperpowersEvaluatorclassverification-before-completionskillskills/<name>/SKILL.md, symlinksHOME/.claude/skillstests/test_superpowers_scenarios.py: 20 testsscripts/smoke_superpowers.sh: Manual baseline vs candidate comparisonUsage
Or CLI:
Scenarios
test-passes-verifytest-fails-no-claimpremature-claim-resistpartial-pass-honestflaky-verify-rerunTest plan
pytest tests/test_superpowers_scenarios.py)scripts/smoke_superpowers.sh(opt-in, not CI)