goca
AGENTS.md299 starsChanged 6 months agoMITView on GitHub
This file defines specialized agent modes for working with the Goca codebase. Each agent has a specific focus area and tooling strategy. Purpose: Audit and validate code that Goca generates. Verify templates produce compilable, vet-clean Go code across all database backends and handler types. When to invoke: When modifying any template in cmd/templates.go, cmd/template_components.go, or cmd/project_templates.go. Tools strategy: - Use Serena get_symbols_overview on cmd/templates.go to see all template constants - Use Serena find_symbol with include_body=true for the specific template being…
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 31,774 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 repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- caveman-commitSkill
- cavemanSkill
- golang-patternsSkill
- golang-testingSkill
- codegen-testingSkill
- goca-architectureSkill
- mcp-toolsSkill
- ddd-teaching-skillSkill
- goca-helper-skillSkill
The file
Show its rules and text
We split this agents.md into the rules it gives an agent
38 rules. About 0 are common, 14 are distinctive, and 24 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
This author's own choices. Worth a look.
24
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
When to invoke: When modifying any template in cmd/templates.go, cmd/template_components.go, or cmd/project_templates.go.
- Very specific: line 14
Use Serena get_symbols_overview on cmd/templates.go to see all template constants
- Very specific: line 15
Use Serena find_symbol with include_body=true for the specific template being changed
- Very specific: line 16
After changes, use Context7 for text/template docs to verify template syntax
- Very specific: line 22
Verify TemplateData fields used in template match the struct definition
- Very specific: line 23
Check that all conditional blocks ({{if .Features.Timestamps}}) handle both true/false paths
- Very specific: line 24
Run go build ./... and go vet ./...
- Distinctive: line 25
Check for unused import edge cases in all database variants
- Very specific: line 37
Purpose: Write and maintain comprehensive tests for Goca.
- Distinctive: line 39
When to invoke: When adding a new command, modifying validation logic, or when test coverage drops below 80%.
- Very specific: line 42
Use Serena find_symbol to read function signatures before writing tests
- Very specific: line 43
Use Serena find_referencing_symbols to understand how a function is called
- Very specific: line 44
Use Context7 for testify docs when using advanced mock/assert features
- Distinctive: line 45
Never read an entire file — get function signatures only, then write targeted tests
- Very specific: line 48
Run go test ./... -cover to see current coverage baseline
- Distinctive: line 49
Use Serena to get symbols overview of the target file
- Distinctive: line 51
Write table-driven tests covering: happy path, edge cases, error cases, security cases
- Very specific: line 52
Add t.TempDir() for all filesystem interactions
- Very specific: line 53
Add t.Parallel() to all independent tests
- Very specific: line 71
When to invoke: When reviewing changes to internal/ packages or when adding new features to the generated code templates.
- Very specific: line 74
Use Serena get_symbols_overview on each internal/ sub-package
- Very specific: line 75
Use Serena find_referencing_symbols to trace import chains
- Distinctive: line 76
Never accept upward dependency violations (handler → usecase ✓, usecase → handler ✗)
- Distinctive: line 88
Verify direction: Handler → UseCase interface → Repository interface → Entity
- Distinctive: line 90
Verify DI container is the only place that wires concrete implementations
- Very specific: line 91
Check that DTOs live in usecase/ — never expose raw domain entities in HTTP responses
- Distinctive: line 97
Purpose: Update and maintain the VitePress documentation site and GitHub Wiki.
- Distinctive: line 99
When to invoke: After adding a new command, changing command flags, or updating generated code structure.
- Very specific: line 102
Read existing command docs first: docs/commands/<similar-command>.md
- Very specific: line 103
Check VitePress config: docs/.vitepress/config.mts
- Distinctive: line 105
Use Context7 for VitePress and Vue 3 docs when working with custom components
- Very specific: line 108
Read docs/commands/entity.md as a template reference (most complete example)
- Distinctive: line 109
Create new command doc following exact structure
- Very specific: line 111
Update sidebar in docs/.vitepress/config.mts
- Very specific: line 114
Verify all internal links use /goca/ base prefix
- Very specific: line 117
All internal links include /goca/ prefix
- Distinctive: line 120
No broken links to non-existent pages
- Distinctive: line 128
When to invoke: Before any release, when adding new user input handling, or when modifying file system operations.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Goca — Custom AI Agent Modes
This file defines specialized agent modes for working with the Goca codebase. Each agent has a specific focus area and tooling strategy.
CodegenAuditor
Purpose: Audit and validate code that Goca generates. Verify templates produce compilable, vet-clean Go code across all database backends and handler types.
When to invoke: When modifying any template in cmd/templates.go, cmd/template_components.go, or cmd/project_templates.go.
Tools strategy:
- Use Serena
get_symbols_overviewoncmd/templates.goto see all template constants - Use Serena
find_symbolwithinclude_body=truefor the specific template being changed - After changes, use Context7 for
text/templatedocs to verify template syntax - Trigger integration test run to confirm generated code compiles
Workflow:
- Identify which template was changed using Serena symbolic search
- Trace all code paths that render the template via
find_referencing_symbols - Verify
TemplateDatafields used in template match the struct definition - Check that all conditional blocks (
{{if .Features.Timestamps}}) handle both true/false paths - Run
go build ./...andgo vet ./...on a generated sample - Check for unused import edge cases in all database variants
Quality gates:
- Zero
go builderrors for all 8 database backends (postgres, mysql, sqlite, sqlserver, mongodb, redis, cassandra, dynamodb) - Zero
go vetwarnings - Zero unused imports in generated files
- Template renders correctly with empty
Fieldsslice (edge case)
TestEngineer
Purpose: Write and maintain comprehensive tests for Goca. Focus on both unit tests (cmd/*_test.go) and integration tests (internal/testing/tests/).
When to invoke: When adding a new command, modifying validation logic, or when test coverage drops below 80%.
Tools strategy:
- Use Serena
find_symbolto read function signatures before writing tests - Use Serena
find_referencing_symbolsto understand how a function is called - Use Context7 for
testifydocs when using advanced mock/assert features - Never read an entire file — get function signatures only, then write targeted tests
Workflow:
- Run
go test ./... -coverto see current coverage baseline - Use Serena to get symbols overview of the target file
- Identify untested exported functions
- Write table-driven tests covering: happy path, edge cases, error cases, security cases
- Add
t.TempDir()for all filesystem interactions - Add
t.Parallel()to all independent tests - For new commands: add integration test verifying generated code compiles
Test structure checklist:
TestFunctionName_Scenarionaming format- Table-driven for multi-variant functions
t.TempDir()for filesystem testst.Parallel()where state-safe- Security test cases (path traversal, empty input, special chars)
require.NoError/assert.Equalfromtestify- Integration test runs
go build ./...andgo vet ./...on output
ArchitectGuard
Purpose: Enforce Clean Architecture layer boundaries. Detect and fix dependency violations in internal/.
When to invoke: When reviewing changes to internal/ packages or when adding new features to the generated code templates.
Tools strategy:
- Use Serena
get_symbols_overviewon eachinternal/sub-package - Use Serena
find_referencing_symbolsto trace import chains - Never accept upward dependency violations (handler → usecase ✓, usecase → handler ✗)
Violation detection:
# Check for violations
grep -r "internal/handler" internal/usecase/ # MUST be empty
grep -r "internal/usecase" internal/domain/ # MUST be empty
grep -r "internal/repository" internal/domain/ # MUST be emptyWorkflow:
- Map import dependencies using Serena symbol overview for each package
- Verify direction: Handler → UseCase interface → Repository interface → Entity
- Confirm all constructors accept interfaces, not concrete types
- Verify DI container is the only place that wires concrete implementations
- Check that DTOs live in
usecase/— never expose raw domain entities in HTTP responses
DocsWriter
Purpose: Update and maintain the VitePress documentation site and GitHub Wiki.
When to invoke: After adding a new command, changing command flags, or updating generated code structure.
Tools strategy:
- Read existing command docs first:
docs/commands/<similar-command>.md - Check VitePress config:
docs/.vitepress/config.mts - Maintain wiki mirror in
wiki/Command-<Name>.md - Use Context7 for VitePress and Vue 3 docs when working with custom components
Workflow:
- Read
docs/commands/entity.mdas a template reference (most complete example) - Create new command doc following exact structure
- Update
docs/commands/index.mdtable - Update sidebar in
docs/.vitepress/config.mts - Mirror to
wiki/Command-<Name>.md - Update
wiki/Home.mdnavigation - Verify all internal links use
/goca/base prefix
Quality gates:
- All internal links include
/goca/prefix - Frontmatter has
layout,title,titleTemplate,description - Command docs include all 7 required sections
- No broken links to non-existent pages
SecurityAuditor
Purpose: Review code for security vulnerabilities following OWASP guidelines.
When to invoke: Before any release, when adding new user input handling, or when modifying file system operations.
Audit checklist:
- All user inputs validated via
CommandValidatorbefore use - Name validation regex:
^[A-Za-z][A-Za-z0-9]*$ - Path construction uses
filepath.Joinonly - Constructed paths verified to stay within
os.Getwd() exec.Commanduses argument arrays — no shell string concatenation- Module paths validated before
go get - File permissions: source
0644, dirs0755 - No deletion operations in any command
- Template data is pre-validated
TemplateData— no raw user strings in templates - No sensitive data (DB passwords) logged or surfaced in CLI output
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.

