mine-rs-architecture
Use this skill when designing or changing mine-rs repository architecture, crate boundaries, package layout, dependency direction, monorepo strategy, SDK layering, or module ownership. Applies to task
SKILL.md.github/skills/mine-rs-architecture/SKILL.md
GitHubmine-rs architecture skill
Use this skill when a task affects repository structure, crate boundaries, package boundaries, public APIs or dependency direction.
Source of truth
Read these files before making architectural changes:
docs/references/repository-strategy.mddocs/references/architecture.mddocs/references/roadmap.mddocs/backlog.mdAGENTS.md
Current decision
Keep mine-rs as a monorepo. Do not split into multiple repositories unless the user explicitly asks to reevaluate that decision.
Use internal separation by crate/package:
crates/
├─ mine-core/
├─ mine-blockmodel/
├─ mine-indexing/
├─ mine-validation/
├─ mine-reblock/
├─ mine-io/
├─ mine-economics/
├─ mine-planning/
├─ mine-sdk/
├─ mine-tools/
├─ mine-python/
└─ mine-cli/
python/
├─ miners/
└─ mine-agents/
Dependency direction
Maintain this direction:
mine-core
↓
domain crates
↓
mine-sdk
↓
mine-tools
↓
mine-python / mine-cli / python/mine-agents
Rules:
mine-coremust not depend on Python, agents, CLI or LLM runtimes.mine-sdkmust not depend onmine-pythonorpython/mine-agents.mine-toolsmay depend onmine-sdk, butmine-sdkmust not depend on agentic tools.mine-pythonmaps Rust types/errors into Python; it must not own core mining logic.python/mine-agentsconsumesminersand tool contracts; it must not define mining calculations.
Procedure
- Identify which layer owns the requested behavior.
- Check whether an existing crate/package boundary already covers it.
- Prefer adding code to the lowest correct deterministic layer.
- Expose through
mine-sdkif it is part of the public Rust API. - Expose through
mine-python/python/minersonly after Rust ownership is clear. - Expose through
mine-toolsif the operation needs structured tool input/output. - Keep agentic orchestration outside SDK logic.
- Update docs when changing a boundary or dependency rule.
Gotchas
- Do not create a new crate just because a concept has a name. Create one when it has a stable boundary, dependencies and tests.
- Do not place LangGraph/LangChain or LLM dependencies in Rust core or Python SDK.
- Do not make examples imply APIs are implemented unless they are.
- Do not split repos early; versioned contracts are still evolving.