AI-assisted MyBB development toolkit providing MCP tools for Claude Code to interact with MyBB installations.
ATTENTION!!!!
EDIT THE MCP_BRIDGE FROM install_files AND COPY IT INTO THE TESTFORUM.
NO AGENT SHOULD EVER EDIT ANYTHING INSIDE THE TESTFORUM.
SCRIBE PROTOCOL IS NOT OPTIONAL ALWAYS SCRIBE EVENTS, WHAT IS HAPPENING, WHAT ISN'T WORKING. ORCHESTRATOR IT IS YOUR DUTY TO ENSURE YOU MAINTAIN AN AUDITABLE LOG AS WELL. SUBAGENTS RELY ON EXTRA GUIDANCE FROM YOUR USE OF APPEND_ENTRY.
!!! ATTENTION ALL AGENTS - THIS IS NON-NEGOTIABLE !!!
You have MCP tools available. You MUST use them. They are tool calls, not bash commands.
HOW TO USE MCP TOOLS: MCP tools appear in your tool list just like Read, Edit, Write, Bash, Grep, Glob, etc. You call them the SAME WAY you call any other tool - as a tool invocation. They are NOT bash commands. They are NOT Python scripts. They are TOOL CALLS.
Example - CORRECT (tool call):
mcp__scribe__append_entry(agent="MyCoder", message="Did a thing", status="success")
This is a TOOL CALL. You invoke it like you invoke Read() or Edit().
Example - WRONG (bash):
# NEVER DO THIS
echo "logging..." | some_command
python3 -c "import mcp..."
curl localhost:8022/mcp/...RULES:
- ❌ NEVER use Bash to do what an MCP tool does
- ❌ NEVER use
cat,echo,python,curlto substitute for MCP tools - ❌ NEVER skip Scribe logging because "I don't have access" - YOU DO, it's in your tool list
- ❌ NEVER use
php -lvia Bash to check syntax - use the Read tool to read the file, that's sufficient - ✅ ALWAYS use
mcp__scribe__append_entryas a TOOL CALL to log your work - ✅ ALWAYS use
mcp__scribe__read_recentas a TOOL CALL to check context - ✅ ALWAYS use
mcp__mybb__*tools as TOOL CALLS for MyBB operations - ✅ Use the Edit tool for file edits, Read tool for reading files, Grep/Glob for searching
If you are a subagent and you think you don't have MCP tools: YOU ARE WRONG. Check your tool list. They are there. Use them.
MANDATORY STARTUP SEQUENCE FOR ALL AGENTS (NO EXCEPTIONS): Before doing ANY work - before reading files, before editing, before ANYTHING:
- Call
mcp__scribe__set_project(name="<project_name>", root="/home/austin/projects/MyBB_Playground") - Call
mcp__scribe__read_recent(n=5) - THEN and ONLY THEN start your actual work
If you skip steps 1 and 2, your work will be rejected. The orchestrator will tell you the project name in your prompt. Use it.
Failure to use MCP tools = rejection of your work.
ABSOLUTE PROHIBITION - NO EXCEPTIONS:
NEVER, EVER connect to the MyBB database directly. This includes:
- ❌ NO direct MySQL/MariaDB connections
- ❌ NO raw SQL queries outside of MCP tools
- ❌ NO database clients or connection attempts
- ❌ NO pymysql, mysql-connector, or any DB libraries
- ❌ NO reading
.envto get DB credentials for direct access
ONLY use MCP tools to interact with MyBB:
- ✅ Use
mybb_*MCP tools exclusively - ✅ All database operations go through the MCP server
- ✅ The MCP server handles all DB connections internally
- ✅ If an MCP tool doesn't exist for what you need, REQUEST ONE
This applies to:
- The main Claude Code orchestrator
- ALL subagents (research, architect, coder, review, etc.)
- ANY agent spawned for ANY purpose
- Testing, debugging, exploration - NO EXCEPTIONS
Why this rule exists:
- The MCP server manages connection pooling and safety
- Direct DB access bypasses cache invalidation
- Multiple connections cause race conditions
- This is a HARD BOUNDARY - violating it breaks the entire system
If you need database access that an MCP tool doesn't provide:
- Document what you need
- Ask the user
- Wait for a new MCP tool to be created
- DO NOT improvise with direct DB access
NEVER use destructive commands without explicit user confirmation:
rm -rfis BANNED. Period.rm -rrequires explicit user approval- Any directory deletion requires user confirmation
- If "delete and recreate" needed - ASK FIRST
Before deleting anything:
- State exactly what will be deleted
- Explain why deletion is necessary
- WAIT for user confirmation
- If any doubt, don't delete
Extraction means EXTRACTION: When told to "extract" code from File A to File B:
- Copy the code to File B
- REMOVE the code from File A
- Wire up imports/references
- End result: same total lines, just reorganized
- ALWAYS create or activate a Scribe project before starting work
- DELEGATE to subagents for complex tasks - don't browse files yourself
- NEVER send single coder on large scope - use bounded task packages
- Subagents DO NOT commit - orchestrator handles all commits at defined gates
NEVER create replacement files:
- No
*_v2,enhanced_*,*_newfiles to avoid integration - Edit/extend/refactor existing components
- If blocked, escalate with a plan - don't fork
You must log decisions and progress with append_entry. This is not optional.
BETWEEN EVERY SUBAGENT CALL, YOU MUST append_entry. This is how subagents get context about what happened before them. When a subagent calls read_recent, YOUR entries are what they see. If you don't log, they work blind.
Log after:
- User makes a decision in discussion
- You choose between approaches
- BEFORE spawning a subagent (what you're asking them to do and why)
- AFTER a subagent completes (what they accomplished, what's next)
- A phase completes
- Something unexpected happens
- Every 2-3 significant actions
- After every context compaction/reset (re-call
set_project+read_recentfirst)
Minimum logging:
mcp__scribe__append_entry(
agent="Orchestrator",
message="<what happened>",
status="info", # or success/warn/error/plan
meta={
"reasoning": {
"why": "<goal or decision point>",
"what": "<constraints or alternatives>",
"how": "<method or next steps>"
}
}
)NEVER read raw TaskOutput to check subagent results. Use read_recent or query_entries instead — all agent work is logged to the Scribe progress log. The progress log IS the shared communication channel between orchestrator and subagents.
If you're not logging, you're doing it wrong. The progress log is how we maintain context across sessions and audit our work. No excuses.
Context rehydration: After EVERY context compaction or session reset, you MUST:
mcp__scribe__set_project(name="<project>", root="/home/austin/projects/MyBB_Playground")mcp__scribe__read_recent(n=10)— to rehydrate what's been happening- THEN resume work
This is not optional. Skipping rehydration means you lose track of what subagents have done.
Use Chrome DevTools to identify which templates to edit. MyBB injects HTML comments marking template boundaries:
<!-- start: header_welcomeblock_member -->
...content...
<!-- end: header_welcomeblock_member -->Workflow:
- Navigate to the page in Chrome DevTools:
mcp__chrome-devtools__navigate_page(url="http://localhost:8022") - Get the raw HTML source:
mcp__chrome-devtools__evaluate_script(function="() => document.documentElement.outerHTML")
- Search the output for
<!-- start:markers to find template names - Edit the corresponding template in workspace:
plugin_manager/themes/public/{theme}/templates/{Group}/{template}.html - Sync changes:
mybb_workspace_sync(codename="theme_name", type="theme") - Reload in Chrome DevTools to see changes instantly
Why this matters:
- MyBB has 900+ templates across 65 groups - grepping is slow and imprecise
- The rendered HTML shows exactly which templates compose each page element
- Template markers reveal the injection hierarchy (parent → child relationships)
- Workspace sync provides instant feedback loop - edit, sync, reload, verify
Example: Finding where the <body> tag lives
// In rendered HTML:
<body>
<!-- start: header -->
<div id="container">
This tells you <body> is in the page template (e.g., index.html), and header is injected inside it.
| Action | Command |
|---|---|
| Start MyBB server | ./start_mybb.sh |
| Server status | mybb_server_status() |
| Run tests | pytest tests/ |
| MCP connection check | claude mcp get mybb |
| Directory | Purpose |
|---|---|
TestForum/ |
MyBB installation (DO NOT edit core files) |
TestForum/inc/plugins/ |
Installed plugins |
plugin_manager/plugins/ |
Plugin workspace (edit here) |
plugin_manager/themes/ |
Theme workspace |
mybb_sync/template_sets/ |
Template files (disk sync) |
mybb_mcp/ |
MCP server code |
docs/wiki/ |
Documentation |
- URL: http://localhost:8022
- Admin CP: http://localhost:8022/admin/
- Username: admin
- Password: admin
All config in .env at project root:
MYBB_ROOT=/home/austin/projects/MyBB_Playground/TestForumMYBB_URL=http://localhost:8022
Use mybb_workspace_sync for fast iteration during development.
Hash-based change detection ensures only modified files sync - even with 976+ templates, only changed files are written.
# Sync workspace changes TO database (default direction)
mybb_workspace_sync(codename="my_theme", type="theme")
mybb_workspace_sync(codename="my_plugin", type="plugin")
# Export FROM database to workspace (for existing themes/content)
mybb_workspace_sync(codename="my_theme", type="theme", direction="from_db")
# Preview what would sync
mybb_workspace_sync(codename="my_theme", type="theme", dry_run=True)
# Full reinstall when DB/lifecycle changes needed
mybb_workspace_sync(codename="my_theme", type="theme", full_pipeline=True)| Mode | When to Use |
|---|---|
| Incremental to_db (default) | CSS, template, PHP file edits - only changed files sync |
| Incremental from_db | Export templates/stylesheets from existing DB theme to workspace |
| Full Pipeline | Settings changes, new hooks, DB schema changes |
| Dry Run | Preview file counts before syncing |
Manifest files: Each workspace has .sync_manifest.json tracking file hashes and DB datelines. These are gitignored and auto-managed.
Rule: Use incremental sync for routine edits. Use full_pipeline=True only when you've changed plugin settings, added new hooks, or modified _install()/_activate() functions.
Invoke skills with /skillname in Claude Code.
| Skill | Purpose | When to Use |
|---|---|---|
/mybb-dev |
MyBB development workflow | Starting any MyBB plugin/theme work - loads full MCP toolkit context |
/migrate-plugin |
Import external plugins | IMPORTANT: Use when importing third-party plugins into Plugin Manager workspace |
Migration workflow: When importing an external plugin (from MyBB Mods site, GitHub, etc.):
- Run
/migrate-plugin - Follow the guided import process
- Plugin will be set up in workspace with proper
meta.json - Use
mybb_plugin_install()to deploy
| Component | Purpose | Documentation |
|---|---|---|
| MCP Server | 112 tools for MyBB interaction | MCP Tools |
| Plugin Manager | Workspace, deployment, PHP lifecycle | Plugin Manager |
| Disk Sync | Template/stylesheet file sync | Disk Sync |
| Scribe | Development tracking & audit | Scribe Protocol |
mybb_mcp/mybb_mcp/
├── server.py # Orchestration (116 lines)
├── tools_registry.py # 112 tool definitions
├── handlers/ # 15 handler modules
│ ├── dispatcher.py # Dictionary-based routing
│ ├── templates.py # Template operations
│ ├── themes.py # Theme operations
│ ├── plugins.py # Plugin lifecycle
│ └── ...
└── db/connection.py # Database wrapper
sid = -2 → Master templates (base, never delete)
sid = -1 → Global templates (shared)
sid >= 1 → Template set overrides (custom)
Custom templates override master. Always check for master first when writing.
MCP tools for managing the PHP development server:
# Check server status
mybb_server_status()
# Start server (auto-detects if already running)
mybb_server_start()
mybb_server_start(port=8022, force=True) # Force restart on specific port
# Stop server
mybb_server_stop()
mybb_server_stop(force=True) # Force kill if graceful shutdown fails
# Restart server
mybb_server_restart()
# Query server logs (essential for debugging)
mybb_server_logs() # Last 50 entries
mybb_server_logs(errors_only=True) # Only errors (PHP errors, 4xx/5xx)
mybb_server_logs(errors_only=True, limit=100) # More error entries
mybb_server_logs(exclude_static=True) # Filter out .css, .js, images
mybb_server_logs(since_minutes=5) # Last 5 minutes only
mybb_server_logs(filter_keyword="Fatal") # Search for keyword
mybb_server_logs(offset=50, limit=50) # Pagination (page 2)Log Features:
- Error categorization:
fatal,parse,warning,notice,http_5xx,http_4xx, etc. - Token guards: max 8000 chars output to prevent context bloat
- Pagination with offset/limit for large logs
- Error breakdown summary in output
Log file: logs/server.log (gitignored, rotates on server start)
Use Chrome DevTools MCP tools to test MyBB in a real browser:
Dev Credentials:
- URL: http://localhost:8022
- Admin CP: http://localhost:8022/admin/
- Username:
admin - Password:
admin
Common Browser Operations:
# List open pages
mcp__chrome-devtools__list_pages()
# Navigate to MyBB
mcp__chrome-devtools__navigate_page(url="http://localhost:8022", type="url")
# Take a snapshot (preferred over screenshot for understanding page structure)
mcp__chrome-devtools__take_snapshot()
# Click an element by uid from snapshot
mcp__chrome-devtools__click(uid="1_27") # e.g., Admin CP link
# Fill a form field
mcp__chrome-devtools__fill(uid="1_13", value="search term")
# Take a screenshot (for visual verification)
mcp__chrome-devtools__take_screenshot()
# Check for errors in console
mcp__chrome-devtools__list_console_messages()Testing Workflow:
- Ensure server is running:
mybb_server_status() - Navigate to the page you're testing
- Take snapshot to understand page structure
- Interact with elements using uid from snapshot
- Check console for JavaScript errors
- Check server logs for PHP errors:
mybb_server_logs(errors_only=True)
Notes:
- Snapshots give element uids for interaction (clicking, filling forms)
- Screenshots are required for visual verification (CSS, layout, styling issues)
- Use both: snapshot to understand structure, screenshot to see how it looks
- The MCP runs with
--isolatedflag to avoid profile conflicts - Admin is pre-logged-in during development
When working on specific tasks, read the appropriate documentation:
| Task Type | Primary Doc | What You'll Find |
|---|---|---|
| Plugin development | Plugin Development | Lifecycle, hooks, settings, templates |
| Theme development | Theme Development | Disk sync, stylesheets, set_default: true |
| Complex features | Scribe Protocol | Research → Architect → Code → Review |
| MCP tool usage | MCP Tools Index | 112 tools with parameters |
| Getting started | Installation | Setup, prerequisites |
- Simple bug fix: Implement directly with Scribe logging
- New feature: Follow Scribe PROTOCOL workflow
- Plugin work: Use Plugin Manager workflow (never create files directly)
- Theme work: Use disk sync workflow (edit files, watcher syncs)
- Template changes: Always via disk sync, never
mybb_write_template
You are the orchestrator. Your job is to coordinate subagents, not do all the work yourself.
ALWAYS create or activate a Scribe project before starting work:
# New feature/fix
mcp__scribe__set_project(name="feature-name", root="/home/austin/projects/MyBB_Playground", ...)
# Existing project
mcp__scribe__set_project(name="existing-project", root="/home/austin/projects/MyBB_Playground")- Every non-trivial task needs a project for tracking
- Pass the project name to ALL subagents in their prompts
- Check
mcp__scribe__list_projects()to find existing projects
set_project does NOT carry over to subagents. Each subagent runs in its own isolated session. They MUST call set_project themselves at startup. Your orchestrator set_project only applies to YOUR session. This is why every subagent prompt must include the project name — they need it to call set_project on their own.
For complex exploration, spawn research agents - don't waste your context browsing files:
| Situation | Action |
|---|---|
| Need to understand a system | Spawn mybb-research-analyst (haiku) |
| Need to find where something is | Spawn Explore agent |
| Trivial lookup (specific file/function) | Use Read/Grep yourself |
| Multiple areas to investigate | Spawn parallel research swarms |
Research swarms: When you need lots of context, spawn multiple research agents in parallel:
# Parallel research - one message, multiple Task calls
Task(subagent_type="mybb-research-analyst", model="haiku", prompt="Investigate area A...")
Task(subagent_type="mybb-research-analyst", model="haiku", prompt="Investigate area B...")| Situation | Agent | Model | Notes |
|---|---|---|---|
| Understand existing code | mybb-research-analyst |
haiku | Fast, cheap context gathering |
| Design architecture | mybb-architect |
opus | Critical decisions need strong reasoning |
| Pre/post-implementation review | mybb-review-agent |
sonnet | Catches issues others miss |
| Implement bounded task | mybb-coder |
sonnet | Quality implementation |
| Debug plugin/template issues | mybb-bug-hunter |
sonnet | Autonomous debugging |
| Deep plugin guidance | mybb-plugin-specialist |
sonnet | Consulting on hooks, lifecycle |
| Deep template guidance | mybb-template-specialist |
sonnet | Consulting on Cortex, inheritance |
For all MyBB development work, prefer these specialized agents over the generic Scribe agents. They have MyBB-specific knowledge baked in and know the Plugin Manager/disk sync workflows.
| Step | Agent | Purpose | When to Use |
|---|---|---|---|
| 1 | mybb-research-analyst |
Investigate MyBB internals using 112+ MCP tools | Analyzing plugins, hooks, templates before development |
| 2 | mybb-architect |
Design plugins/templates/themes | Creating architecture for new MyBB features |
| 3 | mybb-review-agent |
Review MyBB work for workflow compliance | Pre/post-implementation reviews |
| 4 | mybb-coder |
Implement plugins/templates | Writing PHP, editing templates via disk sync |
| 5 | mybb-review-agent |
Final validation and grading | Post-implementation verification |
| * | mybb-bug-hunter |
Diagnose plugin/template issues | Debugging MyBB-specific problems |
| Agent | Expertise | When to Use |
|---|---|---|
mybb-plugin-specialist |
Plugin lifecycle, hooks, settings, security patterns | Complex plugin architecture, hook selection, lifecycle debugging |
mybb-template-specialist |
Template inheritance, Cortex syntax, disk sync, find_replace | Template modification strategy, Cortex debugging, theme development |
| Use MyBB Agents When... | Use Generic Scribe Agents When... |
|---|---|
| Creating/modifying MyBB plugins | Working on MCP server Python code |
| Working with templates or themes | Working on non-MyBB infrastructure |
| Debugging plugin/template issues | General codebase exploration |
| Need MyBB-specific hook/API knowledge | Language-agnostic research |
NEVER send a single coder on a large scope. Break work into bounded task packages:
| Scope Size | Approach |
|---|---|
| 1-2 files, <100 lines | Single coder |
| 3-5 files, one component | Single coder with bounded scope |
| Multiple components | Multiple coders - one per component |
| Cross-cutting changes | Sequential coders - respect dependencies |
Coder Scoping Rules:
- Each coder gets ONE bounded task package from PHASE_PLAN.md
- Task package specifies exact files, line ranges, and verification criteria
- Concurrent coders CANNOT have overlapping file scopes
- Orchestrator waits for completion before spawning coders that touch same files
Every subagent prompt MUST include:
- Project name:
Project: feature-name— subagent MUST callset_projectwith this - Root path:
Root: /home/austin/projects/MyBB_Playground - Startup instruction: "Call
set_projectthenread_recent(n=10)before doing anything" - Clear scope: What files, what changes, what NOT to touch
- Verification criteria: How to know the task is complete
- Link to phase plan: Subagents need the full context
Orchestrator workflow around subagent calls:
1. append_entry("Dispatching <agent> to do <task>", status="plan")
2. Task(subagent_type="...", prompt="Project: X. Root: /path. Call set_project + read_recent first. Then do <task>...")
3. [subagent completes — it logged its work via append_entry]
4. read_recent(n=10) ← check what the subagent did via the progress log
5. append_entry("Agent completed: <summary of what happened>. Next: <what comes next>")
6. [continue to next subagent or phase]
read_recent or query_entries. This ensures all context is in one auditable place and available to future subagents.
Subagents DO NOT commit. The orchestrator handles all commits at defined gates:
| Gate | What to Commit | Where | How |
|---|---|---|---|
| After Research | Scribe research docs | Parent repo | CLI git commit |
| After Architecture | Scribe architecture docs | Parent repo | CLI git commit |
| After Code Phase | Plugin code changes | Plugin repo | MCP mybb_workspace_git_commit |
| After Review | Final cleanup | Both if needed | CLI + MCP |
Why orchestrator commits, not agents:
- Scribe docs are in parent repo, not plugin workspaces
- Multiple agents would commit each other's work
- Orchestrator has full visibility for atomic, meaningful commits
For context gathering, use haiku model with research agents:
Task(
subagent_type="mybb-research-analyst",
model="haiku", # Fast, cheap for research swarms
prompt="""
Investigate how the VSCode extension handles template sync.
Repo root: /home/austin/projects/MyBB_Playground
Focus on: vscode-mybbbridge/src/*.ts
"""
)When to use haiku swarms:
- Initial codebase exploration
- Gathering context from multiple files
- Pattern discovery across the codebase
- Producing research reports
When to use stronger models:
- Architecture decisions (opus)
- Code implementation (sonnet/opus)
- Complex reasoning tasks
# Research phase - use mybb-research-analyst
Task(
subagent_type="mybb-research-analyst",
model="haiku",
prompt="Analyze how reputation plugins work in MyBB..."
)
# Architecture phase - use mybb-architect
Task(
subagent_type="mybb-architect",
model="opus",
prompt="Design a karma plugin based on the research findings..."
)
# Implementation phase - MULTIPLE CODERS for large scope
# Coder 1: Phase 1 (must be first - creates settings)
Task(
subagent_type="mybb-coder",
model="sonnet",
prompt="Implement Phase 1 Task Packages 1.1-1.4: MyBB settings lifecycle..."
)
# After Phase 1 completes, spawn parallel coders for independent work:
# Coder 2, 3, 4 in parallel (independent components)
Task(subagent_type="mybb-coder", prompt="Implement Phase 2: SecurityPolicy...")
Task(subagent_type="mybb-coder", prompt="Implement Phase 3: Parser...")
Task(subagent_type="mybb-coder", prompt="Implement Phase 4: Cache...")
# After all complete, final integration coder
Task(subagent_type="mybb-coder", prompt="Implement Phase 5-6: Wiring and testing...")
# For deep guidance - use specialists
Task(
subagent_type="mybb-plugin-specialist",
model="sonnet",
prompt="Help me understand why my postbit hook isn't firing..."
)These rules are MANDATORY for all agents. Violations = rejection.
- Before ANY work: Call
set_projectthenread_recent(n=10)minimum,query_entriesfor targeted history - After EVERY context compaction/reset: Repeat
set_project+read_recent— your project context does not survive compaction - Subagents: Each subagent MUST call
set_projectindependently — it does NOT carry over from the orchestrator - Why: Progress log is source of truth. Skipping it causes hallucinated priorities and broken invariants
- Sentinel mode (no project):
read_recent/query_entriesoperate on global scope
- Rule: Work within existing system. NEVER create
enhanced_*,*_v2,*_newfiles - Why: Replacement files create tech debt, split code paths, destroy reliability
- Comply: Edit/extend/refactor existing components. If blocked, escalate with a plan
- Rule: Use
append_entryfor EVERY significant action - If not Scribed, it didn't happen — this is your audit trail
- Orchestrators: Always pass
project_nameto subagents - Orchestrators MUST log: decisions, important events, bugs encountered (
open_bugbefore dispatching bug hunter), before/after every subagent call, errors, phase transitions - NEVER read TaskOutput for subagent results — use
read_recent/query_entriesinstead. The progress log is the shared communication channel.
- Every
append_entryMUST includereasoningblock:why: goal / decision pointwhat: constraints / alternatives consideredhow: method / steps / remaining uncertainty
- Review enforcement: Missing why/what/how = reject
- If a tool exists, CALL IT DIRECTLY — no manual scripting or substitutes
- Log intent AFTER the tool call succeeds or fails
- File reads: Use
scribe.read_file— nocat/head/tail - File search: Use
scribe.search— nogrep/rg/find - File edits: Use
scribe.edit_file(requiresread_filefirst, defaults todry_run=True) - Managed docs: Use
manage_docs— direct Write/Edit on.scribe/docs/dev_plans/is blocked by hook - Why: Tool calls are the auditable execution layer
- Follow repo structure: Tests in
/testsusing existing layout - Don't clutter: No random files, mirror existing patterns
- When in doubt: Search existing code first
Every session — and every context compaction/reset — must follow this workflow:
# 1. Activate project
set_project(name="<project_name>", root="/home/austin/projects/MyBB_Playground")
# 2. Rehydrate context (read MORE if you need broader history)
read_recent(n=10)
# 3. Log session start (REQUIRED)
append_entry(
message="Starting <task>",
status="info",
agent="Orchestrator",
meta={
"task": "<task>",
"reasoning": {"why": "...", "what": "...", "how": "..."}
}
)This applies to context resets too. When your context compacts mid-session, repeat steps 1-2 to rehydrate before continuing work. The progress log is your memory.
If it's not Scribed, it didn't happen. The orchestrator MUST log:
- Decisions: User choices, approach selection, trade-off resolutions
- Important events: Phase transitions, unexpected discoveries, blockers
- Bugs encountered: Log with
open_bugBEFORE dispatching bug hunter - Before each subagent dispatch: What you're asking them to do and why
- After each subagent completes: Summary of results, what's next
- Errors and failures: What went wrong, what you're doing about it
The progress log is the single source of truth. Future agents, future sessions, and future you depend on it. Every decision, every event, every bug — Scribe it or it never happened.
All non-trivial development follows this 6-phase workflow:
SPEC → Research → Architect → Code → Review → Documentation
| Phase | Agent | Purpose |
|---|---|---|
| SPEC | User + Orchestrator | Define what we're building, create Scribe project |
| Research | mybb-research-analyst (haiku) |
Gather context, verify against code |
| Architect | mybb-architect (opus) |
Create ARCHITECTURE_GUIDE.md, PHASE_PLAN.md, CHECKLIST.md |
| Code | mybb-coder (sonnet) |
Execute bounded task packages |
| Review | mybb-review-agent (sonnet) |
Validate against plan (≥93% to pass) |
| Documentation | Coder/Orchestrator | Fill README, update wiki, no TODOs at release |
Critical Rules:
- Sequential coders if tasks touch same files; concurrent if different files
- No hacky workarounds — work within MyBB's systems
- Documentation is mandatory — README must have all sections filled
- Plugin Manager workflow required — never create files manually
- Work in the WORKSPACE — never editing files within TestForum, or using MCP to edit templates/stylesheets attached to plugins or themes.
For full details, see Scribe Protocol.
112 tools across 15 categories. Full documentation: MCP Tools Index
This section covers CRITICAL gotchas not in wiki documentation.
MCP tools are NOT Python module functions. They are handlers dispatched through the MCP server.
# WRONG - causes AttributeError
import mybb_mcp
result = mybb_mcp.mybb_list_stylesheets(tid=tid)
# WRONG - module has no such attribute
from mybb_mcp.handlers.templates import handle_template_batch_write
result = handle_template_batch_write(...)
# CORRECT - use database methods via dependency injection
result = self.mybb_db.list_stylesheets(tid=tid)
# CORRECT - for MCP tool calls, use the MCP interface
mcp__mybb__mybb_list_stylesheets(tid=tid)Non-handler code (like installer.py) must use MyBBDatabase methods directly, not MCP tool functions.
Lifecycle distinction:
_install()/_uninstall()- Database setup/teardown (settings, tables)_activate()/_deactivate()- Templates and runtime wiring
Template update gotcha:
mybb_plugin_install() alone does NOT update templates that already exist in the database.
For template changes, do a full reinstall cycle:
mybb_plugin_uninstall(codename, remove_files=True) # Remove from TestForum
mybb_plugin_install(codename) # Redeploy freshTheme installation order matters:
- Create theme record first (get new tid)
- THEN deploy stylesheets to that tid
- THEN set templateset property
- NEVER hardcode
tid=1(that's Master Style)
# WRONG - goes to Master Style
deploy_stylesheets(tid=1)
# CORRECT
new_tid = create_theme(name="MyTheme", parent=1)
deploy_stylesheets(tid=new_tid)Templateset property required:
Themes MUST have templateset in their properties or custom templates will not load:
// Without templateset, MyBB only loads sid=-2 (master)
// With templateset=1, MyBB loads sid=-2, sid=-1, AND sid=1Direct DB writes bypass cache invalidation. Always use disk sync workflow, or manually rebuild:
mybb_cache_rebuild('templates') # After template changes
mybb_cache_rebuild('themes') # After theme changesProtected caches - NEVER clear:
version- Contains MyBB version code (clearing breaks forum)internal_settings- Contains encryption keys
| SID | Meaning | Usage |
|---|---|---|
-2 |
Master templates | Base templates, never delete |
-1 |
Global templates | Shared across themes |
>= 1 |
Template set overrides | Theme-specific customizations |
- Forum/Thread/Post IDs: Always integers, never strings
- Template titles: Exact match required (case-sensitive)
- Codenames: Lowercase with underscores (
my_plugin) - Visibility:
"public"or"private"for workspace location
MANDATORY: Use Plugin Manager for all plugin development.
- Create plugin:
mybb_create_plugin(codename, name, description) - Edit in workspace:
plugin_manager/plugins/public/{codename}/orprivate/ - Deploy:
mybb_plugin_install(codename) - Test in browser: http://localhost:8022
- Iterate: Full uninstall/reinstall cycle for changes
NEVER:
- Create workspace files directly (use
mybb_create_plugin) - Copy files to TestForum manually (use
mybb_plugin_install) - Edit files in TestForum (edit workspace, then deploy)
Plugin workspace structure:
plugin_manager/plugins/public/{codename}/
├── {codename}.php # Main plugin file
├── meta.json # Plugin metadata
├── templates/ # Template files (.html)
│ └── {codename}_*.html # Syncs to sid=-2 (master)
├── inc/languages/english/ # Language files
│ └── {codename}.lang.php
└── jscripts/ # JavaScript files (deployed to TestForum)
For template and stylesheet development:
- Export templates:
mybb_sync_export_templates("Default Templates") - Edit files in:
mybb_sync/template_sets/ - Start watcher:
mybb_sync_start_watcher() - Changes auto-sync to database
ALWAYS edit via disk sync. NEVER use mybb_write_template during development.
The file watcher monitors disk changes and syncs to the database automatically. This is the primary development workflow.
Themes live in workspace: plugin_manager/themes/public/{codename}/
plugin_manager/themes/public/{codename}/
├── meta.json # Theme metadata (name, version, author)
├── stylesheets/ # CSS files (synced to database)
│ ├── global.css
│ └── custom.css
├── templates/ # Template overrides (organized by group)
│ ├── Header Templates/
│ │ └── header.html
│ └── Footer Templates/
│ └── footer.html
└── jscripts/ # JavaScript (deployed to TestForum filesystem)
└── theme-scripts.js
Full workflow (new theme or major changes):
mybb_theme_uninstall(codename, remove_from_db=True) # Clean slate
mybb_theme_install(codename, visibility="public", set_default=True) # MUST set_default!Fast iteration workflow (CSS/template edits):
# Edit files in workspace, then sync only changes
mybb_workspace_sync(codename="my_theme", type="theme") # Only changed files syncExport existing theme to workspace:
# Pull templates from DB to workspace (organized by groups)
mybb_workspace_sync(codename="my_theme", type="theme", direction="from_db")Theme install deploys:
- Stylesheets → Database (mybb_themestylesheets table)
- Templates → Database (mybb_templates at theme's templateset sid)
- jscripts/, images/ → TestForum filesystem (tracked for clean uninstall)
CRITICAL: set_default=True is mandatory. Without it, the templateset property isn't set and custom templates won't load (MyBB only loads master templates).
Location: inc/languages/english/{codename}.lang.php
Admin: inc/languages/english/admin/{codename}.lang.php
Format:
<?php
$l['myplugin_hello'] = 'Hello World';
$l['myplugin_settings'] = 'Plugin Settings';Usage:
- PHP:
$lang->myplugin_hello - Templates:
{$lang->myplugin_hello}
Validation:
mybb_lang_validate(codename) # Check for missing/unused keys
mybb_lang_generate_stub(codename) # Generate placeholders for missingALWAYS maintain language files alongside code changes.
Parent repo (MyBB Playground) - use CLI git:
- Scribe docs (
.scribe/) - MCP server code (
mybb_mcp/) - Wiki documentation (
docs/wiki/)
Plugin/Theme repos - use MCP workspace git tools:
mybb_workspace_git_init(codename="my_plugin", visibility="private")
mybb_workspace_git_commit(codename="my_plugin", message="Add feature", visibility="private")
mybb_workspace_git_push(codename="my_plugin", visibility="private")
# For themes, add type="theme"
mybb_workspace_git_commit(codename="my_theme", type="theme", message="Update styles")Mandatory documentation updates:
- New MCP tools → add to
docs/wiki/mcp_tools/appropriate category - Changed tool behavior → update tool documentation
- New Plugin Manager features → update
docs/wiki/plugin_manager/
Outdated docs are worse than no docs.
Session collision occurs when multiple agents with the same name work on different Scribe projects within the same repository concurrently.
Use scoped agent names:
# Safe - unique names
agent="CoderAgent-ProjectX"
agent="CoderAgent-ProjectY"
# Collision risk
agent="CoderAgent" # on both projects simultaneouslyNot affected: Sequential dispatches, different repositories, or single agent switching projects.
- MyBB is 15+ year old PHP forum software with mature but dated architecture
- Work within MyBB's hook/template system - don't try to modernize MyBB itself
- We're building tooling to make MyBB development easier and AI-accessible
- Set realistic expectations - some things are limited by MyBB's design
Never modify files in TestForum/ that are part of core MyBB.
All customization must be through:
- Plugins (
TestForum/inc/plugins/) - Templates (via MCP tools or Admin CP)
- Stylesheets (via MCP tools or Admin CP)
- Language files (
TestForum/inc/languages/*/)
Core files will be overwritten on MyBB upgrades. Hooks and plugins are the correct extension mechanism.
| Pitfall | Correct Approach |
|---|---|
| Editing TestForum files directly | Edit workspace, deploy via Plugin Manager |
Using mybb_write_template in development |
Use disk sync workflow |
Forgetting set_default=True for themes |
Always include when installing themes |
| Single coder on large scope | Break into bounded task packages |
| Direct database connections | Use MCP tools exclusively |
Creating *_v2 replacement files |
Edit/extend existing files |
| File | Purpose |
|---|---|
mybb_mcp/mybb_mcp/server.py |
MCP server orchestration |
mybb_mcp/mybb_mcp/tools_registry.py |
112 tool definitions |
mybb_mcp/mybb_mcp/handlers/ |
Tool handler modules |
mybb_mcp/mybb_mcp/db/connection.py |
Database operations |
plugin_manager/installer.py |
Plugin/theme deployment |
.env |
Database credentials (gitignored) |
These sections are meant to be updated as we work. Add discoveries here.
Use mcp__scribe__list_projects() to see current projects in this repo.
Recent projects:
claude-md-rewrite— This documentation overhaulflavor-theme-rebuild— Flavor theme with Alpine.js
2026-01-25 (Hash-based Sync):
- SyncManifest class tracks file hashes (MD5) and DB datelines for change detection
direction="from_db"exports templates organized by groups (Header Templates/, etc.)- Manifest files (
.sync_manifest.json) must be excluded from sync to avoid infinite loops WORKSPACE_ONLY_PREFIXEStuple catches manifest patterns via startswith()- Sync output now shows "Files unchanged: N" for clarity (not just "Files synced: 0")
2026-01-25 (Theme Manager v1):
- Theme
set_default=Trueparameter is mandatory for theme installation templatesetproperty required in theme properties for custom templates to load- Theme installer must deploy jscripts/images to TestForum filesystem, not just DB
- Stylesheets use
attachedtofield - empty string means "all pages" - Template overrides go to theme's templateset sid, not master (sid=-2)
2026-01-24:
- MCP tools are not importable as Python functions - use MyBBDatabase methods
- Protected caches (
version,internal_settings) must never be cleared - PHP serialized properties need proper type handling (int vs string for templateset)
- WSL2: File watcher may need
MYBB_SYNC_DISABLE_CACHE=1for reliability - PHP: Requires 8.0+ (installed via
setup_dev_env.sh) - Python: Requires 3.10+ with venv
- Port: MyBB runs on 8022 by default (configurable in start_mybb.sh)