Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .factory-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
"description": "Pull request lifecycle skills: create PRs with consistent conventions and follow up on them until merge-ready",
"source": "./plugins/code-review",
"category": "productivity"
},
{
"name": "correct",
"description": "Find the mistakes agents keep repeating in a repo and make each one impossible, enforced at the highest level that works",
"source": "./plugins/correct",
"category": "quality"
}
]
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ Skills for continuous learning and improvement.

Autonomous experiment loop for optimization research. Try an idea, measure it, keep what works, discard what doesn't, repeat. Works standalone or as a mission worker.

### correct

Find the mistakes agents keep repeating in a repo and make each one impossible.

**Skills:**

- `correct` - Architecture first, then types, then a lint whose error names the fix, then a test, docs last

## Plugin Structure

Each plugin follows the Factory plugin format:
Expand Down
8 changes: 8 additions & 0 deletions plugins/correct/.factory-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "correct",
"description": "Find the mistakes agents keep repeating in a repo and make each one impossible, enforced at the highest level that works",
"author": {
"name": "yifu zuo",
"email": "yzuo.2019@gmail.com"
}
}
9 changes: 9 additions & 0 deletions plugins/correct/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# correct

Find the mistakes agents keep repeating in a repo and make each one impossible.

**Skills:**

- `correct` - Architecture first, then types, then a lint whose error names the fix, then a test, docs last; prove each check fails on a real past mistake

Adapted from the pstack skills by Lauren Tan ([cursor/plugins](https://github.com/cursor/plugins), MIT License), with Cursor-specific tooling removed and Droid conventions applied.
31 changes: 31 additions & 0 deletions plugins/correct/skills/correct/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: correct
description: "Find the mistakes agents keep repeating in this repo and make each one impossible. Try architecture first, then types, then a lint whose error names the fix, then a test, and write docs last. Prove each check fails on a real past mistake. Repeat this each time the operator corrects you."
---

# Correct

The operator keeps correcting agents in this repo for the same mistakes. Change the repo so the next agent can't make them.

Assume every contributor is an agent that sees only the files it opened, copies the nearest example, and takes the shortest path that compiles. Design the repo so a change that looks right from one file is right for the whole repo.

## Find the mistake classes

First, read recent commits, reverts, review comments, agent instruction files, and comments that explain workarounds. Group the mistakes into classes. A class counts once it has happened twice.

## Fix each class at the highest level that works

1. **Eliminate it with architecture.** Give each piece of state one owner and each task one supported way. Hide internals so the wrong import fails. Replace hand-synced lists with one source of truth. Delete old ways and dead code an agent would copy.
2. **Enforce it with types so the bad state can't be written.** If bad code still compiles, add a lint or CI check whose error names the file, type, or function to use instead. If the pattern is already common, fail only when a change adds more.
3. **Test the behavior.** Fix or delete any test that still passes when the behavior it checks breaks, or that fails when only the internals change.
4. **Write docs or agent rules last, only for judgment calls.** Nothing fails when an agent skips them.

## Fix and prove

Then fix the most frequent classes now, one commit each. Prove each new check fails on a real past mistake. Run the same command locally and in CI. Exceptions go on the offending line with a reason, an expiry date, and a human's approval.

## Keep the rule table

Last, keep a table in the agent instruction file that pairs each rule with what enforces it. When the operator corrects you, fix the mistake and add the rule. If the rule was already there and nothing enforces it, that's a repeat, so fix it at the highest level in the same change. Drop a rule once its mistake can't happen.

**Reply:** each class with its evidence, the level you picked, and why a higher level didn't work.
1 change: 1 addition & 0 deletions skills/correct