agentleFS
sazardevsazardev/goca/.github/agents.md

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…

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
  1. Very specific:

    When to invoke: When modifying any template in cmd/templates.go, cmd/template_components.go, or cmd/project_templates.go.

    line 11
  2. Very specific:

    Use Serena get_symbols_overview on cmd/templates.go to see all template constants

    line 14
  3. Very specific:

    Use Serena find_symbol with include_body=true for the specific template being changed

    line 15
  4. Very specific:

    After changes, use Context7 for text/template docs to verify template syntax

    line 16
  5. Very specific:

    Verify TemplateData fields used in template match the struct definition

    line 22
  6. Very specific:

    Check that all conditional blocks ({{if .Features.Timestamps}}) handle both true/false paths

    line 23
  7. Very specific:

    Run go build ./... and go vet ./...

    line 24
  8. Distinctive:

    Check for unused import edge cases in all database variants

    line 25
  9. Very specific:

    Purpose: Write and maintain comprehensive tests for Goca.

    line 37
  10. Distinctive:

    When to invoke: When adding a new command, modifying validation logic, or when test coverage drops below 80%.

    line 39
  11. Very specific:

    Use Serena find_symbol to read function signatures before writing tests

    line 42
  12. Very specific:

    Use Serena find_referencing_symbols to understand how a function is called

    line 43
  13. Very specific:

    Use Context7 for testify docs when using advanced mock/assert features

    line 44
  14. Distinctive:

    Never read an entire file — get function signatures only, then write targeted tests

    line 45
  15. Very specific:

    Run go test ./... -cover to see current coverage baseline

    line 48
  16. Distinctive:

    Use Serena to get symbols overview of the target file

    line 49
  17. Distinctive:

    Write table-driven tests covering: happy path, edge cases, error cases, security cases

    line 51
  18. Very specific:

    Add t.TempDir() for all filesystem interactions

    line 52
  19. Very specific:

    Add t.Parallel() to all independent tests

    line 53
  20. Very specific:

    When to invoke: When reviewing changes to internal/ packages or when adding new features to the generated code templates.

    line 71
  21. Very specific:

    Use Serena get_symbols_overview on each internal/ sub-package

    line 74
  22. Very specific:

    Use Serena find_referencing_symbols to trace import chains

    line 75
  23. Distinctive:

    Never accept upward dependency violations (handler → usecase ✓, usecase → handler ✗)

    line 76
  24. Distinctive:

    Verify direction: Handler → UseCase interface → Repository interface → Entity

    line 88
  25. Distinctive:

    Verify DI container is the only place that wires concrete implementations

    line 90
  26. Very specific:

    Check that DTOs live in usecase/ — never expose raw domain entities in HTTP responses

    line 91
  27. Distinctive:

    Purpose: Update and maintain the VitePress documentation site and GitHub Wiki.

    line 97
  28. Distinctive:

    When to invoke: After adding a new command, changing command flags, or updating generated code structure.

    line 99
  29. Very specific:

    Read existing command docs first: docs/commands/<similar-command>.md

    line 102
  30. Very specific:

    Check VitePress config: docs/.vitepress/config.mts

    line 103
  31. Distinctive:

    Use Context7 for VitePress and Vue 3 docs when working with custom components

    line 105
  32. Very specific:

    Read docs/commands/entity.md as a template reference (most complete example)

    line 108
  33. Distinctive:

    Create new command doc following exact structure

    line 109
  34. Very specific:

    Update sidebar in docs/.vitepress/config.mts

    line 111
  35. Very specific:

    Verify all internal links use /goca/ base prefix

    line 114
  36. Very specific:

    All internal links include /goca/ prefix

    line 117
  37. Distinctive:

    No broken links to non-existent pages

    line 120
  38. Distinctive:

    When to invoke: Before any release, when adding new user input handling, or when modifying file system operations.

    line 128

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
agents.md

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_overview on cmd/templates.go to see all template constants
  • Use Serena find_symbol with include_body=true for the specific template being changed
  • After changes, use Context7 for text/template docs to verify template syntax
  • Trigger integration test run to confirm generated code compiles

Workflow:

  1. Identify which template was changed using Serena symbolic search
  2. Trace all code paths that render the template via find_referencing_symbols
  3. Verify TemplateData fields used in template match the struct definition
  4. Check that all conditional blocks ({{if .Features.Timestamps}}) handle both true/false paths
  5. Run go build ./... and go vet ./... on a generated sample
  6. Check for unused import edge cases in all database variants

Quality gates:

  • Zero go build errors for all 8 database backends (postgres, mysql, sqlite, sqlserver, mongodb, redis, cassandra, dynamodb)
  • Zero go vet warnings
  • Zero unused imports in generated files
  • Template renders correctly with empty Fields slice (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_symbol to read function signatures before writing tests
  • Use Serena find_referencing_symbols to understand how a function is called
  • Use Context7 for testify docs when using advanced mock/assert features
  • Never read an entire file — get function signatures only, then write targeted tests

Workflow:

  1. Run go test ./... -cover to see current coverage baseline
  2. Use Serena to get symbols overview of the target file
  3. Identify untested exported functions
  4. Write table-driven tests covering: happy path, edge cases, error cases, security cases
  5. Add t.TempDir() for all filesystem interactions
  6. Add t.Parallel() to all independent tests
  7. For new commands: add integration test verifying generated code compiles

Test structure checklist:

  • TestFunctionName_Scenario naming format
  • Table-driven for multi-variant functions
  • t.TempDir() for filesystem tests
  • t.Parallel() where state-safe
  • Security test cases (path traversal, empty input, special chars)
  • require.NoError / assert.Equal from testify
  • Integration test runs go build ./... and go 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_overview on each internal/ sub-package
  • Use Serena find_referencing_symbols to 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 empty

Workflow:

  1. Map import dependencies using Serena symbol overview for each package
  2. Verify direction: Handler → UseCase interface → Repository interface → Entity
  3. Confirm all constructors accept interfaces, not concrete types
  4. Verify DI container is the only place that wires concrete implementations
  5. 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:

  1. Read docs/commands/entity.md as a template reference (most complete example)
  2. Create new command doc following exact structure
  3. Update docs/commands/index.md table
  4. Update sidebar in docs/.vitepress/config.mts
  5. Mirror to wiki/Command-<Name>.md
  6. Update wiki/Home.md navigation
  7. 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 CommandValidator before use
  • Name validation regex: ^[A-Za-z][A-Za-z0-9]*$
  • Path construction uses filepath.Join only
  • Constructed paths verified to stay within os.Getwd()
  • exec.Command uses argument arrays — no shell string concatenation
  • Module paths validated before go get
  • File permissions: source 0644, dirs 0755
  • 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.