go-crypto-wallet / pkg
AGENTS.md128 starsChanged 6 months agoMITView on GitHub
Guidelines for AI agents working on packages in the pkg/ directory. The pkg/ directory contains public packages that can be imported by external code. These packages provide shared utilities, configuration management, logging, and common functionality. Packages in pkg/ MUST NOT import from internal/ directory. This is non-negotiable:
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 62
Use context.Context for cancellation
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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
pkg/ Directory Guidelines
Guidelines for AI agents working on packages in the pkg/ directory.
Overview
The pkg/ directory contains public packages that can be imported by external code.
These packages provide shared utilities, configuration management, logging, and common functionality.
Directory Structure
pkg/
├── config/ # Configuration management (account, wallet, loader)
├── cryptocurrency/ # Crypto utilities (btc, bch, eth, xrp)
├── db/ # Database connections (mysql, sqlite)
├── debug/ # Debug utilities
├── decimal/ # Decimal number utilities
├── di/ # Legacy DI container (panic allowed)
├── grpc/ # gRPC client utilities
├── logger/ # Logging (global, slog, noop)
├── null/ # Null value converters
├── retry/ # Retry with exponential backoff
├── serializer/ # Serialization utilities
├── uuid/ # UUID generation
└── websocket/ # WebSocket clientCritical Rule
Packages in pkg/ MUST NOT import from internal/ directory.
This is non-negotiable:
pkg/= public APIs for external codeinternal/= internal implementation details- Mixing breaks encapsulation and creates circular dependencies
Common Commands
make go-lint # Lint and auto-fix
make check-build # Build verification
make go-test # Run unit tests
make tidy # go mod tidyPatterns
Avoid
- Importing from
internal/ - Using
panic(exceptpkg/dilegacy) - Commented-out code
- Ignoring errors
- Logging sensitive information
Recommended
- Self-contained utility functions
- Proper error wrapping with context
- Use
context.Contextfor cancellation - Unit tests for exported functions
Important Notes
- Financial project - make changes carefully
- Public APIs - consider backward compatibility
- DO NOT edit files with
DO NOT EDITcomments
References
Rules
.claude/rules/go/conventions.md- Go conventions
Guidelines
- Coding Conventions
- Security
- Testing
Other
- AGENTS.md - Root agent guidelines
- internal/AGENTS.md - Internal packages
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 28,693 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 repository62 other files it gives its agents.
- AGENTS.mdAGENTS.md
- internal/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- internal/CLAUDE.mdCLAUDE.md
- pkg/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/agent-files.mdcCursor rule
- .cursor/rules/apps/bun.mdcCursor rule
- .cursor/rules/apps/eth-contracts.mdcCursor rule
- .cursor/rules/apps/xrp-server.mdcCursor rule
- .cursor/rules/database/atlas-hcl.mdcCursor rule
- .cursor/rules/database/sqlc.mdcCursor rule
- .cursor/rules/documentation-language.mdcCursor rule
- .cursor/rules/general.mdcCursor rule
- .cursor/rules/github-actions.mdcCursor rule
- .cursor/rules/go/conventions.mdcCursor rule
- .cursor/rules/go/di.mdcCursor rule
- .cursor/rules/go/go-path.mdcCursor rule
- .cursor/rules/go/go-test.mdcCursor rule
- .cursor/rules/internal/application-layer.mdcCursor rule
- .cursor/rules/internal/btc-shared.mdcCursor rule
- .cursor/rules/internal/clean-architecture.mdcCursor rule
- .cursor/rules/internal/cli-structure.mdcCursor rule
- .cursor/rules/internal/domain-layer.mdcCursor rule
- .cursor/rules/internal/dto.mdcCursor rule
- .cursor/rules/internal/infrastructure-layer.mdcCursor rule
- .cursor/rules/internal/interface-adapters-layer.mdcCursor rule
- .cursor/rules/internal/internal-interface.mdcCursor rule
- .cursor/rules/internal/mockery.mdcCursor rule
- .cursor/rules/internal/repository.mdcCursor rule
- .cursor/rules/internal/usecase.mdcCursor rule
- .cursor/rules/proto.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/shell-script.mdcCursor rule
- .cursor/rules/ssot.mdcCursor rule
- .cursor/rules/task-context-loading.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- .cursor/rules/yaml.mdcCursor rule
- llms.txtllms.txt
- bch-developmentSkill
- btc-terminologySkill
- db-migrationSkill
- devopsSkill
- docs-ssotSkill
- docs-updateSkill
- fix-pr-reviewSkill
- github-issue-creationSkill
- git-workflowSkill
- go-developmentSkill
- knowledge-gapSkill
- label-context-mappingSkill
- makefile-updateSkill
- mockerySkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- shell-scriptsSkill
- solidity-developmentSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

