floop
AGENTS.md26 starsChanged 10 months agoApache-2.0View on GitHub
For floop contributors. If you're a user, see docs/integrations/ for setup guides. You have persistent memory via floop. Learned behaviors are loaded via MCP and, where supported, auto-injected via hooks. When corrected, IMMEDIATELY capture it: Do NOT wait for permission. Capture learnings proactively. The hooks will also auto-detect corrections, but explicit capture is more reliable. For non-Claude agents, see docs/integrations/agent-prompt-template.md. Available MCP tools: - floop_active - See currently active behaviors for this context - floop_learn - Capture a correction (USE…
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
30 rules. About 0 are common, 16 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Do NOT wait for permission.
- Very specific: line 36
Task start: Call floop_active with current file and task.
- Very specific: line 39
Behavior outcome: Call floop_feedback with confirmed or overridden.
- Distinctive: line 41
If MCP is unavailable, use CLI fallback immediately:
- Very specific: line 65
Use floop MCP tools proactively.
- Very specific: line 79
Run bv --robot-triage to find available tasks
- Very specific: line 80
Read the task with bd show <id>
- Distinctive: line 82
Check dependencies - some tasks block others
- Very specific: line 85
Read GO_GUIDELINES.md first: - follow the patterns
- Very specific: line 86
Write tests: - all packages need *_test.go files
- Distinctive: line 87
Test coverage: - test both success and error paths
- Very specific: line 88
Format code: - run go fmt ./... before committing
- Distinctive: line 92
Use conventional commit format:
- Very specific: line 103
If cmd/floop/ changed: verify docs/CLI_REFERENCE.md is current
- Very specific: line 105
Commit Dolt changes: bd dolt commit
- Distinctive: line 106
Commit changes on a feature branch
- Distinctive: line 108
Wait for review before merging
- Very specific: line 169
Use floop_learn to capture corrections immediately.
- Very specific: line 173
Check bd ready for current tasks.
- Very specific: line 185
CRITICAL: Use ONLY --robot-* flags. Bare bv launches an interactive TUI that blocks your session.
- Distinctive: line 248
Discover new work?: Create linked issue:
- Very specific: line 257
Use bd dolt push/bd dolt pull for remote sync
- Distinctive: line 258
No manual export/import needed!
- Distinctive: line 278
File issues for remaining work: - Create issues for anything that needs follow-up
- Distinctive: line 282
Commit and push on a branch: - Never commit directly to main:
- Distinctive: line 293
Verify: - All changes committed AND pushed
- Distinctive: line 297
NEVER: commit directly to main — always use a feature branch + PR
- Distinctive: line 300
NEVER stop before pushing - that leaves work stranded locally
- Distinctive: line 301
NEVER say "ready to push when you are" - YOU must push
- Distinctive: line 302
If push fails, resolve and retry until it succeeds
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Floop - Agent Instructions
For floop contributors. If you're a user, see docs/integrations/ for setup guides.
Floop Integration (REQUIRED)
You have persistent memory via floop. Learned behaviors are loaded via MCP and, where supported, auto-injected via hooks.
When corrected, IMMEDIATELY capture it:
mcp__floop__floop_learn(right="what to do instead")
# With optional context about what went wrong:
mcp__floop__floop_learn(right="what to do instead", wrong="what you did (optional)")
# With explicit tags (optional, for pack filtering):
mcp__floop__floop_learn(right="what to do instead", tags=["topic", "category"])Do NOT wait for permission. Capture learnings proactively. The hooks will also auto-detect corrections, but explicit capture is more reliable.
For non-Claude agents, see docs/integrations/agent-prompt-template.md.
Available MCP tools:
floop_active- See currently active behaviors for this contextfloop_learn- Capture a correction (USE PROACTIVELY)floop_feedback- Signal whether a behavior was helpful (confirmed) or contradicted (overridden)floop_list- List all stored behaviorsfloop_deduplicate- Merge duplicate behaviors
Codex Runtime Cadence (No Lifecycle Hooks)
In Codex environments, treat these as required pseudo-hooks:
- Task start: Call
floop_activewith currentfileandtask. - Context change (file/task/mode shift): Re-call
floop_active. - Correction received: Immediately call
floop_learn(no permission needed). - Behavior outcome: Call
floop_feedbackwithconfirmedoroverridden.
If MCP is unavailable, use CLI fallback immediately:
floop active --file <path> --task <task> --json
floop learn --right "what to do instead" --wrong "what happened" --file <path>
floop list --jsonProject Overview
floop is a CLI tool that enables AI agents to learn from corrections and maintain consistent behavior across sessions.
Tech stack: Go 1.25+, Cobra CLI, YAML, Beads (issue tracking)
Essential Reading
docs/GO_GUIDELINES.md- Go coding standards (read before writing code)
Quick Reference
Feedback Loop (Dogfooding) ⭐
Use floop MCP tools proactively. Capture corrections as they happen - don't wait for permission.
Development
go build ./cmd/floop # Build CLI
go install ./cmd/floop # Install globally
go test ./... # Run all tests
go test -v -cover ./... # Verbose with coverage
go fmt ./... # Format codeDevelopment Workflow
Starting Work
- Run
bv --robot-triageto find available tasks - Read the task with
bd show <id> - Claim it:
bd update <id> --claim - Check dependencies - some tasks block others
Writing Code
- Read GO_GUIDELINES.md first - follow the patterns
- Write tests - all packages need
*_test.gofiles - Test coverage - test both success and error paths
- Format code - run
go fmt ./...before committing
Making Commits
- Make small, incremental commits
- Use conventional commit format:
feat:new featuresfix:bug fixesdocs:documentationtest:test additionschore:maintenance
Completing Work
- Run quality gates (if code changed):
go test ./...— Run testsgo fmt ./...— Format code- If
cmd/floop/changed: verifydocs/CLI_REFERENCE.mdis current
- Close the issue:
bd close <id> --reason "..." - Commit Dolt changes:
bd dolt commit - Commit changes on a feature branch
- Push and create a PR — never commit directly to main
- Wait for review before merging
Project Structure
cmd/floop/— CLI entry pointinternal/— All application packages. Runls internal/for current list.docs/— Documentation (GO_GUIDELINES.md,FLOOP_USAGE.md,integrations/).floop/— Learned behaviors (JSONL + manifest tracked; DB + audit.jsonl gitignored).beads/— Issue tracking (Dolt backend, server at~/.dolt-data/beads)
Code Patterns
CLI Commands
func newXxxCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "xxx",
Short: "One line description",
RunE: func(cmd *cobra.Command, args []string) error {
jsonOut, _ := cmd.Flags().GetBool("json")
// Implementation
if jsonOut {
json.NewEncoder(os.Stdout).Encode(result)
}
return nil
},
}
return cmd
}Error Handling
result, err := doSomething()
if err != nil {
return fmt.Errorf("context for what failed: %w", err)
}Testing
func TestFunction(t *testing.T) {
tests := []struct {
name string
input Type
want Type
wantErr bool
}{
{"valid case", input, expected, false},
{"error case", badInput, nil, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// test implementation
})
}
}When You Make Mistakes
Use floop_learn to capture corrections immediately. This builds the dataset for the learning loop.
Current Phase
Check bd ready for current tasks.
Using bv as an AI Sidecar
For graph-aware issue triage, use bv with --robot-* flags. See docs/BV_SIDECAR.md for full documentation.
Quick start:
bv --robot-triage # Get ranked recommendations
bv --robot-next # Get single top pickCRITICAL: Use ONLY --robot-* flags. Bare bv launches an interactive TUI that blocks your session.
<!-- BEGIN BEADS INTEGRATION -->Issue Tracking with bd (beads)
IMPORTANT: This project uses bd (beads) for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
Why bd?
- Dependency-aware: Track blockers and relationships between issues
- Git-friendly: Dolt-powered version control with native sync
- Agent-optimized: JSON output, ready work detection, discovered-from links
- Prevents duplicate tracking systems and confusion
Quick Start
Check for ready work:
bd ready --jsonCreate new issues:
bd create "Issue title" --description="Detailed context" -t bug|feature|task -p 0-4 --json
bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --jsonClaim and update:
bd update <id> --claim --json
bd update bd-42 --priority 1 --jsonComplete work:
bd close bd-42 --reason "Completed" --jsonIssue Types
bug- Something brokenfeature- New functionalitytask- Work item (tests, docs, refactoring)epic- Large feature with subtaskschore- Maintenance (dependencies, tooling)
Priorities
0- Critical (security, data loss, broken builds)1- High (major features, important bugs)2- Medium (default, nice-to-have)3- Low (polish, optimization)4- Backlog (future ideas)
Workflow for AI Agents
- Check ready work:
bd readyshows unblocked issues - Claim your task atomically:
bd update <id> --claim - Work on it: Implement, test, document
- Discover new work? Create linked issue:
bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>
- Complete:
bd close <id> --reason "Done"
Auto-Sync
bd automatically syncs via Dolt:
- Each write auto-commits to Dolt history
- Use
bd dolt push/bd dolt pullfor remote sync - No manual export/import needed!
Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use
--jsonflag for programmatic use - ✅ Link discovered work with
discovered-fromdependencies - ✅ Check
bd readybefore asking "what should I work on?" - ❌ Do NOT create markdown TODO lists
- ❌ Do NOT use external issue trackers
- ❌ Do NOT duplicate tracking systems
For more details, see README.md and docs/QUICKSTART.md.
Landing the Plane (Session Completion)
When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.
MANDATORY WORKFLOW:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- Commit Dolt changes -
bd dolt commit - Commit and push on a branch - Never commit directly to main:
git checkout -b chore/session-cleanup # or use existing feature branch git add <specific files> git commit -m "chore: sync beads state" bd dolt push git push -u origin HEAD git status # MUST show "up to date with origin" - Create PR -
gh pr createand present to user for review - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- NEVER commit directly to main — always use a feature branch + PR
- NEVER merge PRs without user review — present PRs and wait for approval
- Work is NOT complete until
git pushsucceeds - NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds
Using bv as an AI Sidecar
For graph-aware issue triage, use bv with --robot-* flags. See docs/BV_SIDECAR.md for full documentation.
Quick start:
bv --robot-triage # Get ranked recommendations
bv --robot-next # Get single top pickCRITICAL: Use ONLY --robot-* flags. Bare bv launches an interactive TUI that blocks your session.
<!-- BEGIN BEADS INTEGRATION -->Issue Tracking with bd (beads)
IMPORTANT: This project uses bd (beads) for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
Why bd?
- Dependency-aware: Track blockers and relationships between issues
- Git-friendly: Dolt-powered version control with native sync
- Agent-optimized: JSON output, ready work detection, discovered-from links
- Prevents duplicate tracking systems and confusion
Quick Start
Check for ready work:
bd ready --jsonCreate new issues:
bd create "Issue title" --description="Detailed context" -t bug|feature|task -p 0-4 --json
bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --jsonClaim and update:
bd update <id> --claim --json
bd update bd-42 --priority 1 --jsonComplete work:
bd close bd-42 --reason "Completed" --jsonIssue Types
bug- Something brokenfeature- New functionalitytask- Work item (tests, docs, refactoring)epic- Large feature with subtaskschore- Maintenance (dependencies, tooling)
Priorities
0- Critical (security, data loss, broken builds)1- High (major features, important bugs)2- Medium (default, nice-to-have)3- Low (polish, optimization)4- Backlog (future ideas)
Workflow for AI Agents
- Check ready work:
bd readyshows unblocked issues - Claim your task atomically:
bd update <id> --claim - Work on it: Implement, test, document
- Discover new work? Create linked issue:
bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>
- Complete:
bd close <id> --reason "Done"
Auto-Sync
bd automatically syncs via Dolt:
- Each write auto-commits to Dolt history
- Use
bd dolt push/bd dolt pullfor remote sync - No manual export/import needed!
Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use
--jsonflag for programmatic use - ✅ Link discovered work with
discovered-fromdependencies - ✅ Check
bd readybefore asking "what should I work on?" - ❌ Do NOT create markdown TODO lists
- ❌ Do NOT use external issue trackers
- ❌ Do NOT duplicate tracking systems
For more details, see README.md and docs/QUICKSTART.md.
Landing the Plane (Session Completion)
When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.
MANDATORY WORKFLOW:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- PUSH TO REMOTE - This is MANDATORY:
git pull --rebase bd dolt push git push git status # MUST show "up to date with origin" - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- Work is NOT complete until
git pushsucceeds - NEVER stop before pushing - that leaves work stranded locally
- NEVER say "ready to push when you are" - YOU must push
- If push fails, resolve and retry until it succeeds
<!-- END BEADS INTEGRATION -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

