commandby sealablab
Customize Monorepo
Guide users through customizing this **Moku Instrument Forge** template for their specific probe hardware.
Installs: 0
Used in: 1 repos
Updated: 2d ago
$
npx ai-builder add command sealablab/customize-monorepoInstalls to .claude/commands/customize-monorepo.md
# Customize Monorepo
Guide users through customizing this **Moku Instrument Forge** template for their specific probe hardware.
---
## šÆ What This Command Does
Helps you add **YOUR probe models** to the FORGE ecosystem. The template is already configured for Moku platform development - you're customizing which probes you integrate with.
---
## ā ļø Pre-Flight Check
**Run this FIRST** to ensure setup is correct:
```bash
# Verify submodules initialized
git submodule status --recursive
# Initialize if needed (lines starting with '-')
git submodule update --init --recursive
# Install dependencies
uv sync
# Test imports
python -c "from moku_models import MOKU_GO_PLATFORM; print('ā
moku-models works')"
python -c "from riscure_models import DS1120A_PLATFORM; print('ā
riscure-models works')"
```
**If imports fail:** Run `uv pip install -e libs/moku-models/ -e libs/riscure-models/`
**Only proceed after these checks pass!**
---
## š Foundation (Already Configured)
This template provides everything you need for Moku FPGA development:
### ā
Core Platform (Required)
- **`libs/moku-models/`** - Moku platform specifications (Go/Lab/Pro/Delta)
- **`libs/platform/`** - FORGE foundational entities (MCC interface + wrapper)
- **`examples/basic-probe-driver/`** - Complete production reference
### ā
VHDL Development Tools
- **`tools/forge-codegen/`** - YAML ā VHDL code generator
- **`libs/forge-vhdl/`** - Reusable VHDL components
- **`libs/riscure-models/`** - Reference probe implementation
### ā
AI Development
- **`.claude/agents/cocotb-integration-test/`** - CocoTB test generation (tested)
- **`.claude/commands/`** - Development commands
**DO NOT modify these** - they're production-ready and tested.
---
## š§ Customization: Add Your Probes
### Typical Workflow
**Most common scenario:** You're adding YOUR probe models to work with Moku.
```
Template (as provided) Your Customization
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāā
libs/moku-models/ āāāāŗ libs/moku-models/ ā
Keep (Core!)
libs/riscure-models/ āāāāŗ libs/riscure-models/ ā
Keep (Reference)
āāāāŗ libs/YOUR-probe-models/ ā Add (Your probes!)
tools/forge-codegen/ āāāāŗ tools/forge-codegen/ ā
Keep (VHDL gen)
libs/forge-vhdl/ āāāāŗ libs/forge-vhdl/ ā
Keep (VHDL utils)
examples/ āāāāŗ examples/ ā
Keep (BPD reference)
libs/platform/ āāāāŗ libs/platform/ ā
Keep (FORGE entities)
```
**Result:** Template + your probe models = complete development environment
---
## Step-by-Step: Adding Your Probe Models
### Step 1: Create Your Probe Models Repository
Use `libs/riscure-models/` as template structure:
```bash
# Create new repo for your probe specs
# Example structure:
your-probe-models/
āāā your_probe_models/ # Python package
ā āāā __init__.py
ā āāā probes.py # Pydantic models
ā āāā validation.py # Voltage safety
āāā tests/ # Pytest tests
āāā llms.txt # Quick reference (copy from riscure-models)
āāā CLAUDE.md # Complete guide (copy from riscure-models)
āāā pyproject.toml # Package config
āāā README.md # Usage guide
```
**Key components to include:**
- **Pydantic models** - Probe electrical specifications
- **Voltage safety validation** - Range checking (see riscure-models example)
- **Port definitions** - Inputs, outputs, control signals
- **3-tier documentation** - llms.txt ā CLAUDE.md ā source
### Step 2: Add as Submodule
```bash
# Add your probe models as git submodule
git submodule add https://github.com/YOUR-USERNAME/your-probe-models.git libs/your-probe-models/
# Update workspace configuration
# Edit pyproject.toml and add to [tool.uv.workspace] members:
# "libs/your-probe-models",
# Sync dependencies
uv sync
# Test import
python -c "from your_probe_models import YOUR_PROBE; print('ā
Works!')"
```
### Step 3: Update Documentation
**Update `llms.txt`** - Add your probe models to component catalog:
```markdown
### Core Platform (git submodules)
| Component | Purpose | Quick Ref |
|-----------|---------|-----------|
| [moku-models](libs/moku-models/) | **REQUIRED** - Moku platform specifications | [llms.txt](libs/moku-models/llms.txt) |
| [riscure-models](libs/riscure-models/) | Example probe specs (reference) | [llms.txt](libs/riscure-models/llms.txt) |
| [your-probe-models](libs/your-probe-models/) | YOUR probe specifications | [llms.txt](libs/your-probe-models/llms.txt) |
```
**Update `CLAUDE.md`** - Add section about your probe integration
**Update `README.md`** - Replace Riscure examples with your probes (or keep both!)
### Step 4: Commit Changes
```bash
git add .gitmodules libs/your-probe-models/ pyproject.toml llms.txt CLAUDE.md README.md
git commit -m "feat: Add YOUR-probe-models for custom probe support"
git push
```
---
## šÆ Common Scenarios
### Scenario 1: "I'm using Moku + Riscure EMFI"
**Action:** NO customization needed! Use template as-is.
```bash
git clone --recurse-submodules <repo>
cd <repo>
uv sync
# Start developing!
```
### Scenario 2: "I'm using Moku + Custom Laser Probes" (MOST COMMON)
**Actions:**
1. ā
Keep everything in template (Riscure as reference)
2. ā Create `libs/laser-models/` (use riscure-models as template)
3. ā Add as submodule (follow steps above)
4. š Update documentation
### Scenario 3: "I'm using Moku + Multiple Probe Types"
**Actions:**
1. ā
Keep everything
2. ā Add `libs/laser-models/`
3. ā Add `libs/rf-models/`
4. ā Add `libs/whatever-models/`
5. š Update docs to reflect multi-probe setup
**All probes coexist** in `libs/` - no conflicts!
### Scenario 4: "I only need Python, no VHDL/FPGA" (RARE)
**Actions:**
1. ā
Keep `libs/moku-models/` + probe models
2. ā Remove `tools/forge-codegen/`
3. ā Remove `libs/forge-vhdl/`
**Note:** This is unusual for Moku development. Most custom instrument work involves FPGA!
---
## ā ļø What NOT to Remove
### Never Remove These:
- ā **`libs/moku-models/`** - This is the CORE! Without it, you're not developing for Moku
- ā **`libs/platform/`** - FORGE foundational entities (MCC interface required!)
- ā **`examples/basic-probe-driver/`** - Production reference (you'll need this!)
### Be Careful Removing These:
- ā ļø **`tools/forge-codegen/`** - Only remove if doing pure Python (no VHDL)
- ā ļø **`libs/forge-vhdl/`** - Only remove if doing pure Python (no VHDL)
### Safe to Remove (But Recommended to Keep):
- ā
**`libs/riscure-models/`** - Only if not using Riscure AND you're confident
- **Recommendation:** Keep as reference even if using different probes!
- Shows voltage safety patterns
- Good template for your own probe models
---
## š Reference Documentation
### Creating Probe Models
- **Template:** `libs/riscure-models/` - Copy this structure
- **Voltage safety:** See `riscure_models/validation.py`
- **3-tier docs:** llms.txt ā CLAUDE.md ā source (copy pattern from riscure-models)
### FORGE Architecture
- **Quick start:** `examples/basic-probe-driver/README.md`
- **Complete spec:** `examples/basic-probe-driver/vhdl/FORGE_ARCHITECTURE.md`
- **Templates:** `libs/platform/FORGE_App_Wrapper.vhd`
### Integration Patterns
- **Root guide:** `CLAUDE.md` - Complete architecture
- **Quick ref:** `llms.txt` - Component catalog
- **Manifest:** `.claude/manifest.json` - Programmatic structure
---
## š Next Steps After Customization
1. **Test everything:**
```bash
git submodule status --recursive # All submodules initialized?
uv sync # Dependencies installed?
pytest # Tests passing?
```
2. **Update project name:**
- GitHub repository name
- README.md title
- CLAUDE.md title
3. **Start building:**
- Study BPD example
- Copy patterns
- Adapt for your probes
- Test with CocoTB
4. **Share back:**
- Document patterns
- Consider contributing improvements
- Share probe models (if not proprietary)
---
## š” Philosophy
**This is YOUR template now!**
- You own it - customize freely
- FORGE patterns are proven - don't break them
- Keep the 3-tier documentation - helps AI agents
- Islands of authority - each submodule is self-contained
- Test after each change
**The template gives you:**
- ā
Proven FORGE architecture
- ā
Production-ready tools
- ā
Complete BPD reference
- ā
Clean foundation
**You add:**
- ā Your probe specifications
- ā Your instrument logic
- ā Your test cases
- ā Your innovations
**Result:** Production-ready custom Moku instruments! š
---
## Questions?
- **Documentation:** Start with `examples/basic-probe-driver/README.md`
- **Architecture:** See `CLAUDE.md` for complete details
- **FORGE patterns:** See `libs/platform/` and BPD example
- **Agent help:** Use `.claude/agents/cocotb-integration-test/` (tested)
**Welcome to the FORGE ecosystem!**
Quick Install
$
npx ai-builder add command sealablab/customize-monorepoDetails
- Type
- command
- Author
- sealablab
- Slug
- sealablab/customize-monorepo
- Created
- 6d ago