go-crypto-wallet / rules
Cursor rule128 starsChanged 6 months agoMITView on GitHub
TypeScript/JavaScript File Rules
- Installs packages
We split this typescript.mdc into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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 87
Never use nullish coalescing (??) with empty string for critical values like secrets or keys.
- Distinctive: line 88
Instead, throw an error to fail fast and prevent silent failures.
- Distinctive: line 103
Prefer named exports over default exports for consistency and better tooling support.
- Distinctive: line 152
No hardcoded secrets or API keys
- Distinctive: line 153
No sensitive data in logs
- Distinctive: line 155
Use environment variables for configuration
≈ “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: TypeScript/JavaScript File Rules
globs: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
alwaysApply: false
---
# TypeScript/JavaScript File Rules
## Overview
Rules for modifying TypeScript (`*.ts`, `*.tsx`) and JavaScript (`*.js`, `*.jsx`) files in go-crypto-wallet.
## Applicable Directories
| App | Language | Runtime | Path | Status |
| ---------------- | --------------------- | ------- | ------------------------ | -------------------------- |
| xrpl-grpc-server | TypeScript | **Bun** | `apps/xrpl-grpc-server/` | **READ-ONLY** (deprecated) |
| eth-contracts | JavaScript/TypeScript | Node.js | `apps/eth-contracts/` | Active |
## Verification Commands
**Navigate to app directory first:**
### xrpl-grpc-server (TypeScript + Bun) - Active Development
```bash
cd apps/xrpl-grpc-server
bun install # Install dependencies (if needed)
bun run lint # Lint with Biome
bun run format # Format with Biome
bun run typecheck # TypeScript type checking
bun run dev # Run dev server with hot reload
bun run build # Build for production
bun run proto # Generate protobuf code
```
> **Important**: See @.claude/rules/apps/bun.md for Bun runtime rules.
> **DO NOT** use `npm`/`npx` commands - always use `bun`/`bunx` instead.
### eth-contracts (JavaScript/Solidity)
```bash
cd apps/eth-contracts
npm install # Install dependencies (if needed)
npm run lint # Lint Solidity files
npm run lint-js # Lint JavaScript/TypeScript files
npm run fmt # Format all files with Prettier
npm run build # Compile contracts with Truffle
npm run test-all # Run all tests
```
## Command Summary
| App | Lint | Format | Build | Test |
| ---------------- | ----------------- | ---------------- | --------------- | ------------------- |
| xrpl-grpc-server | `bun run lint` | `bun run format` | `bun run build` | `bun run typecheck` |
| eth-contracts | `npm run lint-js` | `npm run fmt` | `npm run build` | `npm run test-all` |
## Code Style
### TypeScript Best Practices
```typescript
// Good: Explicit types
function getBalance(address: string): Promise<number> {
// ...
}
// Good: Async/await with error handling
async function fetchData(): Promise<Data> {
try {
const result = await api.call();
return result;
} catch (error) {
throw new Error(`Failed to fetch data: ${error.message}`);
}
}
// Avoid: any type (unless absolutely necessary)
// Bad: function process(data: any)
// Good: function process(data: TransactionData)
```
### Critical Value Handling
Never use nullish coalescing (`??`) with empty string for critical values like secrets or keys.
Instead, throw an error to fail fast and prevent silent failures.
```typescript
// Bad: Silently returns empty string if seed is undefined
const secret = wallet.seed ?? "";
// Good: Fail fast with explicit error
if (!wallet.seed) {
throw new Error("Failed to generate a wallet seed.");
}
const secret = wallet.seed;
```
### Module Exports
Prefer named exports over default exports for consistency and better tooling support.
```typescript
// Bad: Mixed exports cause inconsistent import styles
export const myService = { ... };
export default myService;
// Good: Named exports only
export const myService = { ... };
```
### Import Order
1. Node.js built-ins
2. External packages
3. Internal modules
#### xrpl-grpc-server (xrpl.js 4.5.0)
```typescript
import * as path from "path";
import { Client, Wallet, xrpToDrops, dropsToXrp } from "xrpl";
import { createConnectRouter } from "@connectrpc/connect";
import { AccountService } from "./services/account";
```
#### eth-contracts
```typescript
import * as path from "path";
import { ethers } from "ethers";
import { TokenService } from "./services/token";
```
## Auto-Generated Files
**DO NOT EDIT:**
| App | Generated Files |
| ---------------- | ---------------------------------------------------------------- |
| xrpl-grpc-server | `apps/xrpl-grpc-server/src/protogen/` (Buf/ConnectRPC generated) |
| eth-contracts | `apps/eth-contracts/build/` (Truffle build artifacts) |
## Security
- No hardcoded secrets or API keys
- No sensitive data in logs
- Input validation at boundaries
- Use environment variables for configuration
## Quick Checklist
### xrpl-grpc-server (Active)
- [ ] `bun run lint` passes
- [ ] `bun run format` applied
- [ ] `bun run typecheck` passes
- [ ] `bun run build` passes
- [ ] No `any` types (unless documented reason)
- [ ] Async errors properly handled
### eth-contracts
- [ ] `npm run lint-js` passes
- [ ] `npm run fmt` applied
- [ ] `npm run build` passes
- [ ] `npm run test-all` passes
## Related Documentation
- @apps/xrpl-grpc-server/README.md - xrpl-grpc-server documentation
- @apps/xrpl-grpc-server/docs/MIGRATION-GUIDE.md - Migration guide from ripple-lib
- @apps/xrpl-grpc-server/package.json - xrpl-grpc-server scripts
- @apps/eth-contracts/package.json - eth-contracts scripts
## Related Skills
- `typescript-development` - Full TypeScript workflow
- `solidity-development` - For Solidity contracts in eth-contracts
## Related Rules
- @.claude/rules/apps/bun.md - Bun runtime rules (use bun/bunx instead of npm/npx)
- @.claude/rules/apps/xrp-server.md - XRP server directory rules
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/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/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.

