|
| 1 | +# Config Repo Reference |
| 2 | + |
| 3 | +The **config repo** (`lpb-stack/config`, cloned to `/home/lpb/.pi/agent/`) |
| 4 | +is the single source of truth for agent configuration, settings, skills, |
| 5 | +and subagent definitions. It is installed into the devstack container at |
| 6 | +boot by `start.sh`. |
| 7 | + |
| 8 | +## Directory Structure |
| 9 | + |
| 10 | +``` |
| 11 | +~/.pi/agent/ |
| 12 | +├── settings.json.template → template (generated at boot → settings.json) |
| 13 | +├── settings.json → runtime config (NOT git-tracked, on host volume) |
| 14 | +├── AGENTS.md → agent presets (model config, MCP servers, skills) |
| 15 | +├── CONTRIBUTING.md → contribution guidelines |
| 16 | +├── VALIDATION.md → validation rules for the stack |
| 17 | +├── skills/ |
| 18 | +│ └── localpibox-repo-workflow/ |
| 19 | +│ ├── SKILL.md → repository workflow skill |
| 20 | +│ └── ... |
| 21 | +├── agents/ |
| 22 | +│ ├── vision-analysis.md → visual analysis subagent |
| 23 | +│ ├── browser-automation.md → browser automation subagent |
| 24 | +│ ├── exa-search.md → web research subagent |
| 25 | +│ ├── researcher.md → researcher subagent |
| 26 | +│ ├── README.md → subagent registry |
| 27 | +│ └── _template.md → template for new subagents |
| 28 | +├── mcp.json → MCP server configuration |
| 29 | +├── .env → environment variables (promoted at boot) |
| 30 | +├── .env.example → template |
| 31 | +└── git/github.com/lpb-stack/ |
| 32 | + ├── lpb-memory/ → memory extension clone |
| 33 | + ├── pi-subagents/ → subagents extension clone |
| 34 | + └── lemonade-pi-plugin/ → lemonade provider extension clone |
| 35 | +``` |
| 36 | + |
| 37 | +## settings.json Lifecycle |
| 38 | + |
| 39 | +The settings file is **template-driven**, not git-tracked: |
| 40 | + |
| 41 | +1. **Template**: `settings.json.template` ships in the config repo with |
| 42 | + `__LPB_VERSION__` placeholders |
| 43 | +2. **Boot**: `start.sh` generates `settings.json` by replacing placeholders |
| 44 | +3. **No model preconfigured**: user runs `/login lemonade` to set up the provider |
| 45 | +4. **Persistence**: `settings.json` lives on the host volume — it survives |
| 46 | + container rebuilds |
| 47 | +5. **Validation**: `lpb-config validate` checks settings.json pins match |
| 48 | + the current stack version |
| 49 | + |
| 50 | +### Example pin format |
| 51 | + |
| 52 | +```json |
| 53 | +{ |
| 54 | + "extensions": { |
| 55 | + "@lpb-stack/pi-subagents": { |
| 56 | + "git": "github.com/lpb-stack/pi-subagents@0.0.46-lpb-dev" |
| 57 | + }, |
| 58 | + "@lpb-stack/lemonade-pi-plugin": { |
| 59 | + "git": "github.com/lpb-stack/lemonade-pi-plugin@0.0.46-lpb-dev" |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +Pins are synced by `lpb-config workspace sync --extensions`. |
| 66 | + |
| 67 | +## Extension Clones |
| 68 | + |
| 69 | +The `git/github.com/lpb-stack/` directory contains runtime clones of the |
| 70 | +Pi extensions. They are **not baked into Docker images** — they update at |
| 71 | +runtime via `pi update --extensions`. |
| 72 | + |
| 73 | +| Directory | Repo | Role | |
| 74 | +|---|---|---| |
| 75 | +| `lpb-memory/` | `lpb-stack/lpb-memory` | Persistent memory extension | |
| 76 | +| `pi-subagents/` | `lpb-stack/pi-subagents` | Subagent model registry | |
| 77 | +| `lemonade-pi-plugin/` | `lpb-stack/lemonade-pi-plugin` | Lemonade provider plugin | |
| 78 | + |
| 79 | +## Runtime State: lpb-memory Dir |
| 80 | + |
| 81 | +The directory `~/.pi/agent/lpb-memory/` holds **runtime state** for the |
| 82 | +memory extension — it is NOT in the config repo and NOT git-tracked: |
| 83 | + |
| 84 | +| File | Purpose | |
| 85 | +|---|---| |
| 86 | +| `USER.md` | User preferences extracted from sessions (by NPU review) | |
| 87 | +| `MEMORY.md` | Technical insights extracted from sessions | |
| 88 | +| `failures.md` | Lessons learned from mistakes (failure detection) | |
| 89 | + |
| 90 | +This data is created by the lpb-memory extension's subprocess review |
| 91 | +system and persists across sessions. It is backed up with the host volume. |
| 92 | + |
| 93 | +## Agents Directory |
| 94 | + |
| 95 | +The `agents/` directory defines **subagent model configurations**. Each |
| 96 | +`.md` file specifies: |
| 97 | +- The `agent_type` and `model` to use |
| 98 | +- The system prompt and tools available |
| 99 | +- How the subagent should behave |
| 100 | + |
| 101 | +For example, `vision-analysis.md` defines a subagent that uses the |
| 102 | +local Qwen3.6 vision model to analyze browser screenshots. |
| 103 | + |
| 104 | +## Skills Directory |
| 105 | + |
| 106 | +The `skills/` directory contains **reusable procedures** (Pi skills). |
| 107 | +Each skill is a directory with `SKILL.md` that defines: |
| 108 | +- When to use it |
| 109 | +- Step-by-step procedures |
| 110 | +- Pitfalls and verification |
| 111 | + |
| 112 | +The only skill shipped with the config repo is: |
| 113 | +- `localpibox-repo-workflow` — manage the 6 LocalPibox repos (versioning, |
| 114 | + release, workspace sync) |
| 115 | + |
| 116 | +## MCP Configuration |
| 117 | + |
| 118 | +`mcp.json` configures MCP servers available to the agent. It references |
| 119 | +servers like `exa`, `agent-browser`, and `context7-mcp` with their |
| 120 | +respective connection details and API key sources. |
| 121 | + |
| 122 | +## Quick Reference |
| 123 | + |
| 124 | +```bash |
| 125 | +# Check config repo state |
| 126 | +lpb-config status |
| 127 | + |
| 128 | +# Update config repo |
| 129 | +lpb-config update |
| 130 | + |
| 131 | +# Validate settings.json pins |
| 132 | +lpb-config validate |
| 133 | + |
| 134 | +# Sync extension pins to stack version |
| 135 | +lpb-config workspace sync --extensions |
| 136 | + |
| 137 | +# Reset config repo |
| 138 | +lpb-config reset |
| 139 | +``` |
0 commit comments