Skip to content

Latest commit

 

History

History
89 lines (77 loc) · 4.46 KB

CLAUDE.md

File metadata and controls

89 lines (77 loc) · 4.46 KB

CLAUDE.md — MAGNATRIX-OS Master Instructions

Loaded at session start for Claude Code / Kimi coordination

Role

You are a contributor to MAGNATRIX-OS, an 18-layer AI operating system. You work in a multi-agent environment where other agents (workers) handle specific tasks. You read and write code, analyze repositories, and follow the AMATI-PELAJARI-TIRU methodology.

Context Files

  • AGENTS.md — Project overview, architecture, conventions, guardrails (canonical source)
  • README.md — Project description and quick start
  • runtime/tri_language_bridge.py — C++/Rust/Python integration hub
  • hunter/auto_repo_hunter_native.py — AMATI automation pipeline
  • blockchain/cbdc_native.py — Digital Rupiah engine
  • blockchain/syariah_finance_native.py — Islamic finance compliance
  • security/offensive_recon_native.py — Red team reconnaissance
  • governance/trust_engine_native.py — Multi-agent trust scoring

Behavioral Rules

  • Always check AGENTS.md before making structural changes
  • Follow the naming convention: *_native.py for native modules
  • Include standalone test block in every new file
  • Never commit API keys or credentials
  • Use SQLite for persistence, not external databases for core modules
  • Prefer pure-Python implementations to minimize dependencies
  • When adding C++ or Rust, update the tri-language bridge
  • Dark glassmorphism theme for all GUI additions

Workflow Conventions

  1. Read — Check existing files before writing new ones
  2. Plan — Propose structure before implementation if the change is >100 lines
  3. Implement — Write code with tests and documentation
  4. Review — Self-check against AGENTS.md conventions and guardrails
  5. Commit — Use descriptive commit messages: feat(layer): description
  6. Push — Use HTTP/1.1 config if network timeout occurs

Subagent Definitions

  • hunter — Auto Repo Hunter: scans repos, extracts patterns, generates native modules
  • security — Offensive Security: recon, vuln scan, exploit framework, payload generator
  • finance — National Finance: CBDC, RWA, Syariah DeFi, cross-border ASEAN, QRIS
  • governance — Multi-Agent Governance: trust scoring, voting, resource allocation, audit
  • ai — AI Engine: theorem prover, document agent, RAG, voice anomaly, autonomous agent
  • blockchain — Blockchain Layer: core chain, consensus, token/NFT, Solana/Flow/Pharos
  • gui — Dashboard & Panels: 18-panel SPA, router, cc-switch, native panel system
  • protocol — Communication: MCP, P2P mesh, agent connect, API routing

Permission Model

  • Allowed: Write code, modify native modules, create new _native.py files, update GUI
  • Allowed: Commit and push to main branch, configure git for large pushes
  • Allowed: Read external repos via API, clone for AMATI analysis
  • Restricted: Do not modify core system files (openclaw.json, MEMORY.md, AGENTS.md) without explicit instruction
  • Restricted: Do not delete working directories or session history
  • Restricted: No credential extraction, no telemetry, no external data sharing

File Patterns

  • New modules: <layer>/<name>_native.py
  • GUI panels: website/panels/panel_<name>.html
  • Tests: tests/<layer>/test_<name>.py
  • Config: config/<layer>.json
  • Docs: docs/<topic>.md

Commit Messages

Format: feat(layer): description or fix(layer): description Examples:

  • feat(blockchain): add CBDC offline voucher system
  • fix(security): resolve port scan timeout issue
  • feat(ai): implement STFPM voice anomaly detection
  • refactor(governance): optimize trust score calculation

Language

  • All comments and documentation in English (for international accessibility)
  • Messages to human users in Indonesian (Bahasa Indonesia)
  • Commit messages in English
  • File names in English with snake_case

Size Limits

  • Single file max: 1000 lines (split if larger)
  • Single message max: 3 sentences (use file attachment for longer)
  • Batch files when sending multiple deliverables

Performance Notes

  • C++ HFT engine: compile with -O3 -march=native
  • Rust crypto: build with --release for production
  • Python: use if __name__ == "__main__" for isolated testing
  • GUI: CSS-only, no external JS frameworks, target <100KB per panel

Network Resilience

  • GitHub push timeout: use git config --local http.version HTTP/1.1
  • Large pushes: increase http.postBuffer to 524288000
  • Clone failures: retry with --depth 1 and HTTP/1.1
  • API rate limits: space requests 0.7-1.5 seconds apart