AGENT SKILL

slopgate-eval-dataset

Use the slopdata eval corpus and Slopgate gold fixtures for rule research, calibration, FP/FN hunting, and offline testing. Activate when working with slopdata datasets/v1, gold_*.json fixtures, slopgate eval, L1/L2/L3 packs, holdout replay, mine_gold_fixtures, or when asked how to test rules against historical OpenCode/Slopgate telemetry.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 1
Forks
0

01 前言 Front Matter

name
slopgate-eval-dataset
description
Use the slopdata eval corpus and Slopgate gold fixtures for rule research, calibration, FP/FN hunting, and offline testing. Activate when working with slopdata datasets/v1, gold_*.json fixtures, slopgate eval, L1/L2/L3 packs, holdout replay, mine_gold_fixtures, or when asked how to test rules against historical OpenCode/Slopgate telemetry.

03 SKILL.md 正文

Slopgate eval dataset

Paired telemetry lives in ~/repos/slopdata. Slopgate vendors only gold + a tiny holdout. Full usage guide: ~/repos/slopdata/docs/USAGE.md (also docs/eval-dataset.md in this repo).

Choose the right artifact

Intent Artifact
Change a rule / adapter safely fixtures/gold_*.json + tests/test_eval_gold_fixtures.py
Prove eval plumbing slopgate eval --pack tests/fixtures/eval/l1_ci.jsonl (or l1_holdout_pilot.jsonl)
Current vs historical labels ~/repos/slopdata/datasets/v1/overlays/l1-positives-current.jsonl
Volume research on a rule ~/repos/slopdata/datasets/v1/by_rule/l1/<RULE>.jsonl
Deny-focused L1 (no TN flood) .../l1/eval-v1.positives.jsonl
Repair success exploration .../l2/episodes-v1.benchmark.jsonl
Post-deny agent trajectories .../l3/trajectories-v1.jsonl or confirmed sidecar .../overlays/l3-ground-truth.jsonl
Global histograms .../v1/reports/calibration.json

Never fail CI on historical holdout label overlap. Gold = quality gate; history = research.

Testing workflow

  1. Prefer existing gold fixtures before inventing new synthetic fixtures.
  2. After rule changes, run:
    uv run pytest tests/test_eval_gold_fixtures.py -q
    
  3. If a gold primary rule no longer fires, either fix the regression or deliberately remine/update _gold.current_rule_ids (document why).
  4. Expand coverage with:
    cd ~/repos/slopdata
    python3 scripts/mine_gold_fixtures.py --clear-existing --positives 150 --true-negatives 40
    
  5. For pack smoke (not quality):
    uv run slopgate eval --pack tests/fixtures/eval/l1_holdout_pilot.jsonl --pretty
    

Research workflow

  1. Open calibration.json → pick hot rule_id.
  2. Stream by_rule/l1/<RULE>.jsonl (do not load full eval-v1.jsonl into memory).
  3. Filter tier == replayable for anything you might replay.
  4. Replay via slopgate.eval.evaluate_pack or evaluate_payload on an enrolled temp repo (slopgate.toml present).
  5. For repair questions, use L2 benchmark states resolved / still_failing (legacy; not authoritative).
  6. For behavior-after-deny, use L3; quote overlays/l3-ground-truth.jsonl only for confirmed outcome_ground_truth rows.
  7. Promote survivors into gold fixtures; add pytest coverage.

Implementation checklist (wiring into Slopgate)

  • [ ] Rule change → gold test still passes (or gold updated intentionally)
  • [ ] New rule → at least one gold pos + one gold TN or clean near-miss
  • [ ] OpenCode-specific behavior → fixture under fixtures/opencode/
  • [ ] Docs: update docs/eval-dataset.md only if CLI/pack contracts change
  • [ ] Do not commit raw ~/repos/slopdata/raw or full v1 packs into the slopgate git repo

Anti-patterns

  • Loading 749k-row eval-v1.jsonl (mostly true negatives) in pytest
  • Asserting historical expected equals current findings on holdout
  • Quoting L3 heuristic outcome rates as product metrics
  • Weakening gold assertions to green a broken detector

04 同仓库更多 Skills

vasceannie
vasceannie/slopgate

type-strictness

Enforce strict type compliance by eliminating `Any` types and `# type: ignore` comments. Use when: (1) Editing code that contains `Any` as a type annotation (2) Code has `# type: ignore` or `# pyright: ignore` comments (3) User requests type fixes or type strictness enforcement (4) Importing from untyped third-party libraries (5) User asks to "fix types", "remove Any", or "add proper typing" (6) Pyrefly or mypy reports type errors that need resolution (7) Code review reveals weak typing patterns Follows hierarchical resolution: codebase inference → type stubs → library inspection → type guards → casting (last resort).

★ 1
vasceannie
vasceannie/slopgate

slopgate-test-extender

Extend Python test suites with parametrization, fixture reuse, and quality enforcement. Use when asked to add tests, extend existing tests, improve test coverage, consolidate duplicate tests, fix test quality issues, or when Slopgate reports untested-production-code, missing test references, or coverage gaps. Triggers on requests like "add tests for X", "extend these tests", "parametrize tests", "consolidate tests", "fix test quality", "improve test coverage", "write tests for this function", "test this module", "behavior tests", "integration tests", "missing tests", "coverage holes", "untested code", or when a hook denies with test-related findings.

★ 1
vasceannie
vasceannie/slopgate

slopgate-intelligent-coding-patterns

Pattern-selection playbook for agents editing code with complex branching, stateful parsers/workflows, duplicated skeletons, policy checks, or ordered transforms. Load before refactoring if/elif dispatch chains, boolean-flag state machines, repeated validation predicates, parallel provider/language implementations, or regex/content transformation pipelines. Also load when asked to "apply a design pattern", "which pattern should I use here", "refactor this switch statement", "replace if-elif chain", "state machine pattern", "strategy pattern", "template method", "pipeline pattern", "specification pattern", "dispatch table", "guard clause refactor", "reduce cyclomatic complexity", or when Slopgate fires PY-CODE-014, PY-CODE-017, PY-CODE-018, QUALITY-LINT-001, or PY-QUALITY-010. Use with behavior-locking tests and avoid pattern theater for simple one-off code.

★ 1
vasceannie
vasceannie/slopgate

slopgate-hygiene-orchestrator

Orchestrate systematic elimination of linter warnings and errors across Python, TypeScript, and Rust codebases. Use when asked to "clean up lints", "fix all warnings", "run hygiene", "eliminate type errors", "orchestrate code quality fixes", "fix lint errors", "resolve quality gate failures", "pass CI checks", "reduce tech debt", "refactor to pass hooks", or when a Slopgate hook denies with QUALITY-LINT-001, PY-CODE-017, PY-CODE-018, or any collector finding. This skill coordinates multiple code-hygiene-enforcer agents working in parallel on non-conflicting file groupings, tracks progress persistently via JSON exports, and loops until all issues are resolved. CRITICAL: Never run linters directly—always use `slopgate lint check` as the primary gate, discover project-specific tools from config files, and export findings to JSON for tracking.

★ 1
vasceannie
vasceannie/slopgate

slopgate-code-smell-utility-locator

Autoactivate when code-smell hooks or reviews mention feature envy, thin wrappers, duplicate helpers, duplicate code, scattered helpers, builders/factories/config/constants/dataclass reuse, PY-CODE-012, PY-CODE-013, QUALITY-LINT-001, or repeated slopgate code-quality denials. Also load when asked to "find existing helpers", "consolidate utilities", "search for duplicate code", "where is this already implemented", "reuse existing logic", "don't duplicate this", "find similar functions", "utility inventory", "code smell radar", or before adding new helpers/wrappers so agents can find existing shared utilities and consolidate instead of duplicating.

★ 1
vasceannie
vasceannie/slopgate

slopgate-code-hygiene-refactor

Recovery playbook for Slopgate and project quality failures. Load after hook/lint denials such as PY-CODE-017 flat sibling modules, PY-CODE-018 oversized modules, QUALITY-LINT-001 post-edit quality backstops, PY-QUALITY-010 magic numbers / repeated literals, PY-CODE-012/PY-CODE-013 smell findings, type-suppression bans, duplicate helpers, or repeated hygiene retry loops. Also load when asked to "refactor this module", "split this file", "extract a class", "reduce complexity", "fix god class", "flatten module hierarchy", "move code to a package", "extract helpers", "consolidate duplicates", "replace magic numbers with constants", or when a hook blocks an edit with structural complaints. Focuses on preserving public APIs while refactoring toward packages, cohesive modules, typed seams, and focused tests.

★ 1