Conventions
Naming Conventions
File, function, and type naming across all languages
| Context | Convention | Example |
|---|
| Rust source | snake_case.rs | capture_manager.rs |
| Protobuf | snake_case.proto | exfil.proto |
| TypeScript/React | kebab-case.tsx | threat-card.tsx |
| Hooks | use-<name>.ts | use-threats.ts |
| Zustand stores | <name>-store.ts | threat-store.ts |
| YAML rules | snake_case.yaml | suspicious_headers.yaml |
| Shell scripts | snake_case.sh | build.sh |
| MDX docs | index.mdx in folder | architecture/index.mdx |
| Element | Convention | Example |
|---|
| Crate names | kebab-case | exfil-engine |
| Modules | snake_case | layer2_protocol |
| Functions | snake_case | parse_dns_query() |
| Element | Convention | Example |
|---|
| Structs | PascalCase | ThreatEvent |
| Enums | PascalCase | Severity::Critical |
| Traits | PascalCase | ProtocolParser |
| Element | Convention | Example |
|---|
| Constants | SCREAMING_SNAKE_CASE | MAX_PACKET_SIZE |
| Element | Convention | Example |
|---|
| Messages | PascalCase | NetworkPacket |
| Fields | snake_case | remote_ip |
| Services | PascalCase | ExfilService |
| RPCs | PascalCase | StreamPackets |
| Element | Convention | Example |
|---|
| Components | PascalCase | ThreatCard |
| Hooks | useCamelCase | useThreats() |
| Stores | use<Name>Store | useThreatStore |
| Element | Convention | Example |
|---|
| Functions | camelCase | formatTimestamp() |
| Constants | SCREAMING_SNAKE_CASE | API_BASE_URL |
| Types | PascalCase | ThreatEvent |