Rules — ejarbe's Working Principles
Decision Framework
Bayesian 80% Threshold
Every action must have P(correct) ≥ 80% before executing. If confidence is below threshold, ask — don't guess. Surface the probability and verdict (PASS/FAIL) for non-trivial decisions.
Pre-execution checklist:
- Platform check (macOS/Apple Silicon, not Linux)
- Existence check (does the file/tool/service exist?)
- Redundancy check (is this already built in manus-chatbot?)
- Surface P(correct) → PASS or FAIL
Think Before Changing
- Read actual files before modifying them
- Check persistent memory before asking questions
- Verify with
git log, git blame, or file reads — don't assume
- No speculative or exploratory actions without justification
Tool Hierarchy
Always Use manus-chatbot First
The manus-chatbot repo is the primary toolbox. Before reaching for system tools or external packages:
- Check repo tools:
~/manus-chatbot/tools/, ~/manus-chatbot/agents/job_tools/
- Check repo agents: 23 agents including CivicAIPolicyAgent, DataScientistAgent
- Check MCP servers: godmode (106 tools), ml-toolkit (14), intelligence (14)
- Check skills: 1,255 skills in
~/.claude/skills/
- Last resort: System tools,
pip install, brew install
Never run which <tool> when repo capabilities exist.
MCP Server Rules
- godmode + intelligence = SSE transport. Do NOT migrate to streamable-http (breaks Claude Code + Desktop)
- ml-toolkit = streamable-http (already migrated, works fine)
- For new Python clients, use stdio direct to
godmode_server.py / intelligence_server.py
- Launchd manages all 3 persistent servers — restart via
launchctl stop/start com.manus.*
Coding Standards
Bandit Variant System
The coding style is selected automatically by the bandit orchestrator:
- strict_tdd — Minimal, correct code. Edge cases first. No extras.
- balanced — Pragmatic, clean, readable. Brief comments where helpful.
- exploratory — Elegant, Pythonic, creative. Refactor for clarity.
Task type determines variant: greenfield = exploratory, refactor = balanced, test = strict_tdd.
Code Principles
- Smallest diffs. No drive-by refactors.
- Only change what's necessary for the task
- Don't add features that weren't requested
- Test before declaring done:
python3 -m pytest tests/ -v
- Format before committing:
black agents/ && isort agents/
What Not To Do
- Don't use
sed -i on critical files (wiped .env to 0 bytes on Mar 2)
- Don't read/write
.env files directly (blocked in settings)
- Don't install system tools when repo tools exist
- Don't ask project/priority questions at session start — check memory
- Don't tell me to restart things — do it yourself
Architecture Preferences
Intent-First, Not Keyword
- Route via IntentClassifierAgent, not string matching
- Track user behavior with UserIntentTracker
- Share context via message bus
Model Selection
- FREE local models first (deepseek-r1:32b, qwen3:32b, phi4)
- Cloud only when quality demands it (Claude Sonnet for research, GPT-4 for premium)
- Fallback chains: primary → fallback → never escalate to premium by default
Deployment
- senna-deploy handles Azure (dev/staging/prod via Pulumi)
- 5 CI/CD workflows in GitHub Actions
- 7 governance gates (PII, injection, toxicity, bias, groundedness, jailbreak, config)
Communication Preferences
- Be concise. Lead with the answer, not the reasoning.
- Don't summarize what you just did — I can read the diff.
- Don't use emojis unless I ask.
- Use
/think before risky decisions.
- Save session context to memory before ending — always.
- If unsure, surface the trade-offs and let me decide.
Projects & Context
| Project |
Location |
What It Is |
| manus-chatbot |
~/manus-chatbot/ |
My platform — 23 agents, 505 passing tests, civic AI |
| senna-deploy |
~/senna-deploy/ |
Deployment copy — 3 Azure environments |
| OpenManus |
~/OpenManus/ |
Fork — reference only, effectively stale upstream |
| Government AI |
~/Desktop/Government AI/ |
NIST, Maryland, San Jose, Manatee County docs |
| Bandit |
~/llm_bandit_orchestrator/ |
Coding style optimizer (Thompson sampling) |
MCP Transport Direction (March 2026)
Streamable HTTP is the transport that lets MCP servers run as remote services rather than local processes. It unlocked production deployments but surfaced gaps at scale: stateful sessions fight with load balancers, horizontal scaling requires workarounds, and there's no standard way for a registry or crawler to learn what a server does without connecting to it.
Two workstreams happening:
- Transport + session model evolution — Make servers horizontally scalable without holding state. Clear, explicit session mechanisms.
- Standard metadata format — Served via
.well-known, so server capabilities are discoverable without a live connection.
Critical constraint: No new official transports this cycle — only evolving the existing transport. Keeping the transport set small is a deliberate MCP design principle.
What this means for us:
- Don't build on SSE transport for new integrations — it's legacy
- Don't invent custom transports — wait for the spec to evolve
- Streamable HTTP is the path forward, but expect breaking changes around sessions and statefulness
- Watch for
.well-known metadata spec — will change how we discover and register MCP servers
- Our godmode/intelligence SSE servers will eventually need migration, but not until the spec stabilizes
Hard-Won Lessons
- Empty ≠ unused, stale ≠ unreferenced (Mar 15) — Deleted
~/mcp-store/ because it was empty; it was the --work-dir for a running MCP server. Before deleting or moving ANYTHING: check running processes, grep all configs (.zshrc, .mcp.json, launchd plists, desktop config), verify with process list. Never optimize for "looks unused" — only act on "verified unused."
- sed on macOS wiped .env (Mar 2) — Always
cp backup first, or use a verifiable method
- Ollama naming —
phi4 not phi-4, nemotron-3-nano not nemotron
- Open WebUI Gemini URL — NO trailing slash on
generativelanguage.googleapis.com/v1beta/openai
- MCP SSE vs streamable-http — Python MCP client 1.26.0 hangs on old SSE servers. Use stdio.
- NODE_OPTIONS with npx — Unreliable. Use bash wrapper scripts instead.
- Test stubs ≠ broken code — Tests for unimplemented features are specs, not regressions. Implement them.
- Config.toml with keys — Always gitignore. Check before every push.
1---2name: rules3description: Personal working rules, decision frameworks, and preferences for ejarbe. Invoke with /rules to surface these during any session. AUTO-TRIGGER when working with MCP servers, MCP transport, SSE, streamable HTTP, server migration, .well-known metadata, or MCP server discovery/registration.4---56# Rules — ejarbe's Working Principles78## Decision Framework910### Bayesian 80% Threshold11Every action must have P(correct) ≥ 80% before executing. If confidence is below threshold, ask — don't guess. Surface the probability and verdict (PASS/FAIL) for non-trivial decisions.1213**Pre-execution checklist:**141. Platform check (macOS/Apple Silicon, not Linux)152. Existence check (does the file/tool/service exist?)163. Redundancy check (is this already built in manus-chatbot?)174. Surface P(correct) → PASS or FAIL1819### Think Before Changing20- Read actual files before modifying them21- Check persistent memory before asking questions22- Verify with `git log`, `git blame`, or file reads — don't assume23- No speculative or exploratory actions without justification2425## Tool Hierarchy2627### Always Use manus-chatbot First28The manus-chatbot repo is the primary toolbox. Before reaching for system tools or external packages:29301. **Check repo tools:** `~/manus-chatbot/tools/`, `~/manus-chatbot/agents/job_tools/`312. **Check repo agents:** 23 agents including CivicAIPolicyAgent, DataScientistAgent323. **Check MCP servers:** godmode (106 tools), ml-toolkit (14), intelligence (14)334. **Check skills:** 1,255 skills in `~/.claude/skills/`345. **Last resort:** System tools, `pip install`, `brew install`3536Never run `which <tool>` when repo capabilities exist.3738### MCP Server Rules39- godmode + intelligence = SSE transport. Do NOT migrate to streamable-http (breaks Claude Code + Desktop)40- ml-toolkit = streamable-http (already migrated, works fine)41- For new Python clients, use stdio direct to `godmode_server.py` / `intelligence_server.py`42- Launchd manages all 3 persistent servers — restart via `launchctl stop/start com.manus.*`4344## Coding Standards4546### Bandit Variant System47The coding style is selected automatically by the bandit orchestrator:48- **strict_tdd** — Minimal, correct code. Edge cases first. No extras.49- **balanced** — Pragmatic, clean, readable. Brief comments where helpful.50- **exploratory** — Elegant, Pythonic, creative. Refactor for clarity.5152Task type determines variant: greenfield = exploratory, refactor = balanced, test = strict_tdd.5354### Code Principles55- Smallest diffs. No drive-by refactors.56- Only change what's necessary for the task57- Don't add features that weren't requested58- Test before declaring done: `python3 -m pytest tests/ -v`59- Format before committing: `black agents/ && isort agents/`6061### What Not To Do62- Don't use `sed -i` on critical files (wiped `.env` to 0 bytes on Mar 2)63- Don't read/write `.env` files directly (blocked in settings)64- Don't install system tools when repo tools exist65- Don't ask project/priority questions at session start — check memory66- Don't tell me to restart things — do it yourself6768## Architecture Preferences6970### Intent-First, Not Keyword71- Route via IntentClassifierAgent, not string matching72- Track user behavior with UserIntentTracker73- Share context via message bus7475### Model Selection76- FREE local models first (deepseek-r1:32b, qwen3:32b, phi4)77- Cloud only when quality demands it (Claude Sonnet for research, GPT-4 for premium)78- Fallback chains: primary → fallback → never escalate to premium by default7980### Deployment81- senna-deploy handles Azure (dev/staging/prod via Pulumi)82- 5 CI/CD workflows in GitHub Actions83- 7 governance gates (PII, injection, toxicity, bias, groundedness, jailbreak, config)8485## Communication Preferences8687- Be concise. Lead with the answer, not the reasoning.88- Don't summarize what you just did — I can read the diff.89- Don't use emojis unless I ask.90- Use `/think` before risky decisions.91- Save session context to memory before ending — always.92- If unsure, surface the trade-offs and let me decide.9394## Projects & Context9596| Project | Location | What It Is |97|---------|----------|-----------|98| manus-chatbot | `~/manus-chatbot/` | My platform — 23 agents, 505 passing tests, civic AI |99| senna-deploy | `~/senna-deploy/` | Deployment copy — 3 Azure environments |100| OpenManus | `~/OpenManus/` | Fork — reference only, effectively stale upstream |101| Government AI | `~/Desktop/Government AI/` | NIST, Maryland, San Jose, Manatee County docs |102| Bandit | `~/llm_bandit_orchestrator/` | Coding style optimizer (Thompson sampling) |103104## MCP Transport Direction (March 2026)105106Streamable HTTP is the transport that lets MCP servers run as remote services rather than local processes. It unlocked production deployments but surfaced gaps at scale: stateful sessions fight with load balancers, horizontal scaling requires workarounds, and there's no standard way for a registry or crawler to learn what a server does without connecting to it.107108**Two workstreams happening:**1091. **Transport + session model evolution** — Make servers horizontally scalable without holding state. Clear, explicit session mechanisms.1102. **Standard metadata format** — Served via `.well-known`, so server capabilities are discoverable without a live connection.111112**Critical constraint:** No new official transports this cycle — only evolving the existing transport. Keeping the transport set small is a deliberate MCP design principle.113114**What this means for us:**115- Don't build on SSE transport for new integrations — it's legacy116- Don't invent custom transports — wait for the spec to evolve117- Streamable HTTP is the path forward, but expect breaking changes around sessions and statefulness118- Watch for `.well-known` metadata spec — will change how we discover and register MCP servers119- Our godmode/intelligence SSE servers will eventually need migration, but not until the spec stabilizes120121## Hard-Won Lessons1221230. **Empty ≠ unused, stale ≠ unreferenced** (Mar 15) — Deleted `~/mcp-store/` because it was empty; it was the `--work-dir` for a running MCP server. Before deleting or moving ANYTHING: check running processes, grep all configs (.zshrc, .mcp.json, launchd plists, desktop config), verify with process list. Never optimize for "looks unused" — only act on "verified unused."1241. **sed on macOS wiped .env** (Mar 2) — Always `cp` backup first, or use a verifiable method1252. **Ollama naming** — `phi4` not `phi-4`, `nemotron-3-nano` not `nemotron`1263. **Open WebUI Gemini URL** — NO trailing slash on `generativelanguage.googleapis.com/v1beta/openai`1274. **MCP SSE vs streamable-http** — Python MCP client 1.26.0 hangs on old SSE servers. Use stdio.1285. **NODE_OPTIONS with npx** — Unreliable. Use bash wrapper scripts instead.1296. **Test stubs ≠ broken code** — Tests for unimplemented features are specs, not regressions. Implement them.1307. **Config.toml with keys** — Always gitignore. Check before every push.