Nice I use something similar after watching this.
Use $poteto-mode on this repository. Find recurring mistakes in its actual history, then remove the conditions that permit them. Deliver one verifiable PR per step and get its required CI checks green.
Start with evidence
- Read the repository instructions and applicable skills.
- Inspect git history, original bug-fix diffs, review comments, and failed CI evidence. Trace fixes back to the broken revisions and affected callers.
- Group incidents by shared root cause. For each group, record the source links or SHAs, observable failure, violated invariant, prior repair, and evidence of recurrence. Distinguish confirmed causes from hypotheses.
- Rank the groups by demonstrated harm and recurrence. Start with the smallest change that eliminates a proven class of mistakes. Do not manufacture findings to justify a sweep.
Choose the strongest practical constraint
For each selected group, try these in order:
1. Architecture that removes the invalid operation or shared mutable state.
2. Domain types and boundary validation that prevent invalid states.
3. A narrowly scoped lint whose error explains the concrete fix.
4. A behavioral test when the earlier options cannot enforce the constraint.
Explain why weaker layers remain necessary. Preserve required public compatibility. Prototype alternatives whenever an experiment can settle the choice, state the decision criterion first, and recommend the option supported by the observations. Leave genuine product or preference choices to me.
Prove the constraint
Before trusting any new enforcement, demonstrate that it catches the actual historical mistake:
- Replay the relevant broken revision, or introduce a faithful mutation of that defect when direct replay is impractical.
- Show failure for the intended invariant, then success with the correction.
- Check representative valid behavior so a rule that rejects everything cannot pass.
- Keep exact commands, revisions, failure output, and reproducible evidence with the PR.
Comments
Apply $no-comments
Scope this work to each selected change. Delete comments that restate code. Encode meaningful constraints in structure, types, validation, lint, or tests before removing their explanation. This request authorizes those encodings within scope. Preserve required legal notices and mandated public documentation. Report constraints that remain unenforced.
Formal verification
Where historical evidence identifies concurrency, retry, or state-machine defects, invoke /create-formal-verification-skill. Locate and read it first; report if it is unavailable rather than claiming to have used it.
Model the actual actors, state, transitions, failures, and environmental assumptions. State the safety properties and any relevant liveness properties separately. Reproduce the historical defect as a counterexample, correct the model, and run the checker in CI with explicit exploration bounds.
Map model transitions to production operations. Add concrete trace replay or real integration tests so an accurate model of inaccurate code cannot establish success. State what the model does and does not prove.
Tests
Replace implementation-pinning unit tests only after identifying their protected behavior and demonstrating replacement coverage through the model, real database tests, or end-to-end tests. Retain useful behavioral unit tests. Keep every test that guards security or legal behavior. Do not weaken gates or use skipped work as evidence of success.
Delivery
Use <task-slug> branches and one independently reviewable PR per step. Record dependencies between PRs. Follow the repositoryโs package-manager, formatting, service, and verification rules.
For each PR, include the historical evidence, invariant, chosen enforcement, red/green demonstration, runtime verification, and remaining limits. Run the required checks and resolve CI failures until green. PR delivery is the endpoint; merging and deployment require separate authorization.
Continue through the evidence-backed findings. Maintain a short decision log and report genuine access or capability blockers. Do not claim repository-wide prevention or formal correctness beyond the behavior and state space actually checked.