Keep your codebase clean with farmwork audit and the Idea Garden
Run farmwork audit to refresh your health report, save security and performance audits, and use the Idea Garden to park ideas without growing scope.
Farmwork keeps a living report card for your project in _AUDIT/, so you and your AI tools always know what's healthy, what's slipping, and what ideas are waiting. You refresh it with farmwork audit, and you park future ideas in the Idea Garden instead of cramming them into today's changes.

What you can skip
- You don't need to run all four pillar audits. Pillar files are only created when you ask for them.
- Skip cleaning up the garden by hand. Old ideas are composted for you during each audit.
- Don't bother with a state-machine library. When Farmwork flags messy state code, it recommends the tools your language already has.
1. Run farmwork audit
farmwork audit
farmwork audit --json
One run does three things:
- Recalculates your health score and rewrites
_AUDIT/FARMHOUSE.md, adding a row to Audit History. - Ages the Idea Garden and composts ideas older than 60 days.
- Scans your code for warning signs and lists them under State & Code Hygiene Signals.
Your score adds up from 5 checks:
| Check | Max points |
|---|---|
Setup & Living Docs (.farmwork.json, AGENTS.md, .mcp.json, _AUDIT/) |
2 |
| Checklist Standards (% of active items done) | 3 |
| Automated Tests (1+ test file earns 1, 5+ earns 1.5) | 1.5 |
| Quality Gates (passing on the current commit) | 2.5 |
Planning & Garden Hygiene (_PLANS/ exists, no overdue ideas) |
1 |
A score of 8.5 or higher reads Thriving, 6.5 or higher Healthy, 4.5 or higher Needs tending, and anything lower Initial setup. Your agent can run the same audit with the farmwork_audit tool.
2. What the hygiene scan looks for
| Signal | What it means |
|---|---|
| Oversized file | A source file over 700 lines that should be split up |
| State machine hotspot | Lots of flags like isLoading, isSaving, isError, or loose status strings changed without guards |
| Debug noise | Leftover debugger, binding.pry, byebug, or breakpoint() lines |
| Context hygiene | AGENTS.md over 180 lines or pointing at missing files, a checklist over 30 items, or a justfile that's drifted from your gate commands |
For state hotspots, Farmwork suggests what's built into your language, like TypeScript discriminated unions, a Rails enum with guarded transitions, or a Rust, Python, or Go enum.
3. Save pillar audits
Pillar audits are deeper reviews your AI agent writes for you. Each one lands in its own file with a score out of 10, a summary, findings by severity (CRITICAL, HIGH, MEDIUM, LOW), and recommendations.
| Pillar | File | Easiest way to run it |
|---|---|---|
| Security | _AUDIT/SECURITY.md |
security prompt |
| Performance | _AUDIT/PERFORMANCE.md |
performance prompt |
| Accessibility | _AUDIT/ACCESSIBILITY.md |
inspect prompt |
| Code Quality | _AUDIT/CODE_QUALITY.md |
inspect prompt |
The inspect prompt runs a Team of Reviewers: 4 separate read-only passes, one per pillar, so each review stays focused. For a quick fact check without saving anything, ask your agent to call farmwork_audit with pillar: "security" or pillar: "code-quality" and no score.
4. Tend the Idea Garden

The Idea Garden (_AUDIT/GARDEN.md) is where "that'd be nice someday" ideas go, so your agent doesn't wander off and build them in the middle of a fix. There's no farmwork garden terminal command. You work with the garden through your agent:
- Plant: "Plant an idea called Dark mode in the garden." The agent calls
farmwork_gardenwithaction: "plant", a title, a short description, and a few detail bullets. - List: "What's in the garden?" (
action: "list") - Compost: "Compost Dark mode, we're not doing it." (
action: "compost"with a reason) - Brainstorm: The
new-ideasprompt suggests 8 ideas for your project, skips anything you already composted, and plants the ones you pick.
Ideas age on their own:
| Stage | Age | What happens |
|---|---|---|
| Fresh | 0–44 days | Nothing, it's waiting |
| Wilting | 45–60 days | Marked ⚠️ WILTING and listed after each audit |
| Composted | Over 60 days | Moved to _AUDIT/COMPOST.md on the next audit |
When you're ready to build one, graduate it into a plan. See Planning and launch checklists.
Troubleshooting
| If you see | Try this |
|---|---|
AUDIT · BLOCKED (LEGACY) |
This is an older Farmwork repo. Run farmwork init --reinstall to move it to v3 |
Provide a numeric score (0-10) |
Performance and Accessibility audits need a score to save. Use the performance or inspect prompt |
| Planning & Garden Hygiene below 1 point | Add a _PLANS/ folder, or compost ideas older than 60 days |
| An idea you wanted got composted | Copy it back from _AUDIT/COMPOST.md and plant it again |
Related guides
Frequently Asked Questions
Is there a farmwork garden terminal command?
No. You plant and compost ideas through your AI agent with the farmwork_garden tool, or by editing _AUDIT/GARDEN.md. Running farmwork audit is what ages the garden and composts old ideas.
Will an audit change my code?
No. farmwork audit only updates Markdown files in _AUDIT/. It points out oversized files and messy state code, but it never edits your source.
What happens to ideas I never build?
Ideas older than 45 days are marked Wilting. After 60 days, the next audit moves them to _AUDIT/COMPOST.md with the reason, so the garden stays short and you can still find them later.