go-crypto-wallet / rules
Cursor rule128 starsChanged 6 months agoMITView on GitHub
Protocol Buffer File Rules
We split this proto.mdc into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
NEVER use
protoccommand directly: Always use Make targets for code generation. - Distinctive: line 140
Use lowercase snake_case for field names
- Distinctive: line 141
Use PascalCase for message and service names
- Very specific: line 142
Use UPPER_SNAKE_CASE for enum values
- Very specific: line 147
Use make breaking-proto to detect breaking changes
- Distinctive: line 148
Consider field deprecation before removal
- Distinctive: line 152
Never reuse field numbers
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
---
description: Protocol Buffer File Rules
globs: ["**/*.proto"]
alwaysApply: false
---
# Protocol Buffer File Rules
> **⚠️ XRP Protocol Buffers DEPRECATED**
>
> **Status**: `proto/rippleapi/` is **DEPRECATED** and no longer used.
>
> **Reason**: XRP functionality migrated to native Go implementation. gRPC server (`apps/xrpl-grpc-server/`) has been replaced with native xrpl-go libraries.
## Overview
Rules for modifying Protocol Buffer files (`*.proto`) in go-crypto-wallet.
## Applicable Directories
| Directory | Description | Status |
|-----------|-------------|--------|
| `proto/rippleapi/` | Ripple API definitions | ❌ DEPRECATED |
## Verification Commands
| Command | Purpose | Required |
|---------|---------|----------|
| `make proto-lint` | Lint proto files (buf only, requires PROTO_TOOL=buf) | When buf supports Edition 2024 |
| `make proto-breaking` | Check for breaking changes | Recommended |
## Prohibited Actions
**NEVER use `protoc` command directly.** Always use Make targets for code generation.
```bash
# ❌ PROHIBITED - Never run protoc directly
protoc --go_out=... proto/*.proto
# ✅ CORRECT - Always use Make targets
make proto # Go only
make proto-ts # TypeScript only
make proto-all # Both
```
## Code Generation [DEPRECATED for XRP]
> **⚠️ Note**: Proto generation commands no longer needed for XRP.
| Command | Purpose | XRP Status |
|---------|---------|------------|
| `make proto` | Generate Go code from proto files | ⚠️ No longer generates XRP |
| `make proto-ts` | Generate TypeScript code from proto files | ❌ XRP TypeScript deprecated |
| `make proto-all` | Generate all proto files (Go + TypeScript) | ⚠️ XRP not included |
| `make proto-fmt` | Format proto files | ⚠️ XRP protos deprecated |
| `make clean-pb` | Clean all generated protobuf files | ⚠️ XRP files no longer generated |
### Generation Workflow
```bash
# 1. Edit proto files
# proto/rippleapi/*.proto
# 2. Format
make proto-fmt
# 3. Check breaking changes (optional)
make proto-breaking
# 4. Generate code
make proto # Go only
make proto-ts # TypeScript only
make proto-all # Both Go and TypeScript
# 5. Verify build
make check-build
```
## Buf Configuration
This project uses [Buf](https://buf.build/) for proto management.
### Configuration Files
| File | Description |
|------|-------------|
| `buf.yaml` | Module configuration and lint rules |
| `buf.gen.yaml` | Code generation configuration |
### Lint Rules
Using BASIC ruleset with exceptions for backward compatibility:
```yaml
lint:
use:
- BASIC
except:
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
- FIELD_LOWER_SNAKE_CASE
- PACKAGE_DIRECTORY_MATCH
- PACKAGE_SAME_DIRECTORY
- DIRECTORY_SAME_PACKAGE
```
## Proto File Structure
```protobuf
syntax = "proto3";
package rippleapi;
option go_package = "github.com/hiromaily/go-crypto-wallet/internal/infrastructure/api/xrp/xrp";
// Service definitions
service AccountService {
rpc GetAccountInfo(GetAccountInfoRequest) returns (GetAccountInfoResponse);
}
// Message definitions
message GetAccountInfoRequest {
string address = 1;
}
```
## Auto-Generated Files
**DO NOT EDIT** generated files:
- `internal/infrastructure/api/xrp/xrp/*.pb.go`
These are regenerated by `make proto`.
## Best Practices
### Naming
- Use lowercase snake_case for field names
- Use PascalCase for message and service names
- Use UPPER_SNAKE_CASE for enum values
### Versioning
- Maintain backward compatibility
- Use `make breaking-proto` to detect breaking changes
- Consider field deprecation before removal
### Field Numbers
- Never reuse field numbers
- Reserve removed field numbers
```protobuf
message Example {
reserved 1, 2; // Previously used field numbers
reserved "old_field"; // Previously used field names
}
```
## Quick Checklist
- [ ] `make proto-fmt` passes
- [ ] `make proto-breaking` passes (no unintended breaking changes)
- [ ] Field numbers are not reused
- [ ] Backward compatibility maintained
- [ ] Code regenerated after changes (`make proto` or `make proto-all`)
- [ ] `make check-build` passes after generation
## Related Documentation
- @buf.yaml - Buf configuration
- @buf.gen.yaml - Code generation configuration
- @proto/rippleapi/ - Proto source files
## Related Skills
- `go-development` - Go verification after generation
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 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
- pkg/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/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.
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.

