Vibemin
Prefer the smallest maintainable patch that proves the requested behavior. Do not optimize
for compressed syntax or line count alone.
Minimize production changes
- Read the diff and repository instructions.
- Before reduction, consolidate AI-authored tests deliberately into the minimum integration
suite: one high-information golden path plus one case per independent security or failure
boundary. Do this by review, not by letting a passing suite delete its own assertions.
- Perform a security pass over authentication, authorization, tenant isolation, secrets,
caching, input limits, logging, and dependencies. Add the resulting focused integration
checks before minimization.
- Identify the narrowest focused test plus the repository's non-mutating lint, format-check,
strict typecheck, and security commands. Checks run in a disposable worktree where ignored
files such as
.venv and node_modules are absent, so reference tools by absolute path.
When one check takes more than a few seconds, add --time-budget SECONDS so the run ends
on time with the best verified candidate instead of being killed with nothing.
- Leave tests, manifests/lockfiles, and visual files protected. Validate lock consistency and
clean installation once with
--final-check; do not spend every candidate on unchanged
generated files.
- Preview, review, then apply:
vibemin src/changed_area \
--dry-run \
--check "<focused test>" \
--check "<lint/format/strict type check>" \
--security-check "<focused security check>" \
--final-check "<lock consistency or clean-install check>"
vibemin src/changed_area \
--check "<focused test>" \
--check "<lint/format/strict type check>" \
--security-check "<focused security check>" \
--final-check "<lock consistency or clean-install check>"
For a feature spanning several commits, use --feature-base origin/main. Vibemin reduces the
complete diff since the merge-base and leaves the result as working-tree changes to review
before amending or squashing the feature.
Never claim global minimality. Report the removed and retained diff units and the checks used.
Refactor an existing test suite
First propose structure; vibemin only removes lines already present in the diff.
- Prefer flat, isolated test functions when no shared object state is required.
- Build files and payloads in memory.
- Keep one high-information golden-path test covering interacting output rules.
- Keep one additional test per independent failure mode or boundary.
- Remove framework behavior tests, private-helper tests, mock choreography, and cases already
implied by a stronger test.
- Preserve readability: do not create dense one-liners merely to reduce LOC.
Before editing, record the passing suite and its mutation result. Coverage is only a fallback;
executing a line does not prove an assertion checks it.
Preserve the same test cases
When simplifying fixtures or bodies without merging cases, preserve deterministic collection
output:
vibemin tests/area \
--reduce-tests \
--check "pytest -q tests/area" \
--preserve-output "pytest --collect-only -q tests/area | sed '/collected in/d'"
Condense or merge test cases
Do not preserve collection output when test IDs are intentionally changing. Require the same
killed-mutant set or an agreed mutation threshold instead:
vibemin tests/area \
--reduce-tests \
--check "pytest -q tests/area" \
--test-strength-check "<command that verifies the mutation baseline>"
Every retained test must catch a distinct plausible defect. Explain that defect in the review,
not necessarily as a comment in the code.
Guardrails
- Never minimize test files with ordinary test success as the sole oracle.
- Never minimize manifests or lockfiles merely because an existing environment still runs.
- Never minimize CSS or visual assets without deterministic screenshot/DOM preservation.
- Never relax or omit strict TypeScript checks to obtain a smaller diff.
- Require a separate security oracle for auth, tenant, session, token, or secret changes.
- Never weaken assertions, remove boundary coverage, or lower mutation thresholds to pass.
- Never include mutating formatters in
--check; use formatter check mode.
- Stop if the original candidate fails, checks are flaky, or required ignored files are absent
from the disposable worktree.
- Review the resulting diff and rerun the full relevant suite in the real checkout.
1---2name: vibemin3description: Minimize AI-authored code and test changes while preserving behavior, style, and test strength. Use after implementing or refactoring code, when a diff is larger than necessary, when tests contain verbose classes/fixtures/mocks, or when asked to simplify, reduce LOC, reduce complexity, condense tests, or keep a patch minimal.4---56# Vibemin78Prefer the smallest maintainable patch that proves the requested behavior. Do not optimize9for compressed syntax or line count alone.1011## Minimize production changes12131. Read the diff and repository instructions.142. Before reduction, consolidate AI-authored tests deliberately into the minimum integration15 suite: one high-information golden path plus one case per independent security or failure16 boundary. Do this by review, not by letting a passing suite delete its own assertions.173. Perform a security pass over authentication, authorization, tenant isolation, secrets,18 caching, input limits, logging, and dependencies. Add the resulting focused integration19 checks before minimization.204. Identify the narrowest focused test plus the repository's non-mutating lint, format-check,21 strict typecheck, and security commands. Checks run in a disposable worktree where ignored22 files such as `.venv` and `node_modules` are absent, so reference tools by absolute path.23 When one check takes more than a few seconds, add `--time-budget SECONDS` so the run ends24 on time with the best verified candidate instead of being killed with nothing.255. Leave tests, manifests/lockfiles, and visual files protected. Validate lock consistency and26 clean installation once with `--final-check`; do not spend every candidate on unchanged27 generated files.286. Preview, review, then apply:2930```sh31vibemin src/changed_area \32 --dry-run \33 --check "<focused test>" \34 --check "<lint/format/strict type check>" \35 --security-check "<focused security check>" \36 --final-check "<lock consistency or clean-install check>"3738vibemin src/changed_area \39 --check "<focused test>" \40 --check "<lint/format/strict type check>" \41 --security-check "<focused security check>" \42 --final-check "<lock consistency or clean-install check>"43```4445For a feature spanning several commits, use `--feature-base origin/main`. Vibemin reduces the46complete diff since the merge-base and leaves the result as working-tree changes to review47before amending or squashing the feature.4849Never claim global minimality. Report the removed and retained diff units and the checks used.5051## Refactor an existing test suite5253First propose structure; `vibemin` only removes lines already present in the diff.5455- Prefer flat, isolated test functions when no shared object state is required.56- Build files and payloads in memory.57- Keep one high-information golden-path test covering interacting output rules.58- Keep one additional test per independent failure mode or boundary.59- Remove framework behavior tests, private-helper tests, mock choreography, and cases already60 implied by a stronger test.61- Preserve readability: do not create dense one-liners merely to reduce LOC.6263Before editing, record the passing suite and its mutation result. Coverage is only a fallback;64executing a line does not prove an assertion checks it.6566### Preserve the same test cases6768When simplifying fixtures or bodies without merging cases, preserve deterministic collection69output:7071```sh72vibemin tests/area \73 --reduce-tests \74 --check "pytest -q tests/area" \75 --preserve-output "pytest --collect-only -q tests/area | sed '/collected in/d'"76```7778### Condense or merge test cases7980Do not preserve collection output when test IDs are intentionally changing. Require the same81killed-mutant set or an agreed mutation threshold instead:8283```sh84vibemin tests/area \85 --reduce-tests \86 --check "pytest -q tests/area" \87 --test-strength-check "<command that verifies the mutation baseline>"88```8990Every retained test must catch a distinct plausible defect. Explain that defect in the review,91not necessarily as a comment in the code.9293## Guardrails9495- Never minimize test files with ordinary test success as the sole oracle.96- Never minimize manifests or lockfiles merely because an existing environment still runs.97- Never minimize CSS or visual assets without deterministic screenshot/DOM preservation.98- Never relax or omit strict TypeScript checks to obtain a smaller diff.99- Require a separate security oracle for auth, tenant, session, token, or secret changes.100- Never weaken assertions, remove boundary coverage, or lower mutation thresholds to pass.101- Never include mutating formatters in `--check`; use formatter check mode.102- Stop if the original candidate fails, checks are flaky, or required ignored files are absent103 from the disposable worktree.104- Review the resulting diff and rerun the full relevant suite in the real checkout.