Workflow scenarios ยท Expert panel review ยท Write safety ยท Claude Code model ยท Git strategy
Pat's real-world workflows and edge cases run against the proposed structure.
| Scenario | Walkthrough | Result | Notes |
|---|---|---|---|
| 1. Pat sends voice memo with 3 tasks in Slack Most common workflow |
1. OpenClaw receives โ Shogun transcribes via Whisper 2. task-capture classifies each task 3. Captures โ agents/shogun/memory/captures/2026-04-11.md4. If any task is Forge-routable โ mailbox to ops/mailbox/forge/inbox/5. Evening brief surfaces captures for Pat validation |
PASS | Clean path. All files land in predictable locations. |
| 2. Pat asks "what did Serge say last week?" Knowledge retrieval |
1. Shogun receives question 2. Query world-model API (:8081) for "Serge" + recent transcripts 3. API searches knowledge/transcripts/ + knowledge/people/serge-glushenko.md4. Returns relevant snippets (not full files) 5. Shogun synthesizes and responds |
PASS | Clean separation: knowledge/ is the data lake, world-model API is the query layer. |
| 3. Pat drops a PDF in staging File triage workflow |
1. PDF lands in ops/staging/from-pat/2. Shogun detects on triage pass (or Pat says "check staging") 3. Classify: Is this a project artifact? Knowledge? Reference? 4. Process: Extract text, summarize if needed 5. Move to knowledge/reference/ or projects/*/artifacts/6. Remove from staging |
PASS | But: PDFs are .gitignored. Need to decide: convert to MD before filing? Or keep PDFs in knowledge/ and gitignore that dir? |
| 4. Forge needs to deploy a code change Engineering workflow |
1. Forge (Claude Code) opens session at repo root 2. Reads root CLAUDE.md โ identifies as Forge3. Works in agents/forge/code/ or relevant project dir4. Writes to agents/forge/architecture/ for ADRs5. Logs to agents/forge/memory/6. Commits via git โ ๏ธ But where does actual code live? |
PARTIAL | Gap identified. Code (Python scripts, configs, LaunchAgents) isn't clearly placed. See Claude Code section. |
| 5. New agent "Dispatch" needs to be created Agent onboarding |
1. mkdir agents/dispatch/2. Create SOUL.md + CLAUDE.md from template 3. mkdir agents/dispatch/memory/ skills/4. mkdir ops/mailbox/dispatch/inbox/5. Add to governance/ roster 6. Update root CLAUDE.md routing table 7. Configure in openclaw.json |
PASS | Simple, repeatable process. 7 steps, all scripted. |
| 6. Pat says "update the Orcrist capture plan" Cross-agent project work |
1. Shogun receives โ checks projects/orcrist-capture/README.md for owner2. Reads current projects/orcrist-capture/plan.md3. If Shogun owns: updates directly 4. If Forge owns: mailbox to Forge 5. Updates logged to projects/orcrist-capture/logs/6. Decision captured in projects/orcrist-capture/history/
|
PASS | Project dir has all the context. No searching across vaults. |
| 7. Two agents edit the same project file simultaneously Concurrency edge case |
1. Shogun and Forge both open projects/orcrist/plan.md2. Both make changes 3. Second writer overwrites first writer's changes โ ๏ธ No lock mechanism exists |
RISK | Real problem. Mitigations: (1) ownership rule in README.md, (2) agents check before writing, (3) git history as safety net. See Write Safety section. |
| 8. Sentinel detects Shogun violated a constraint Audit workflow |
1. Sentinel reads gateway logs โ detects violation 2. Writes checkpoint to ops/logs/checkpoint-reviews/3. Posts alert to Slack #forge 4. Shogun reads alert on next heartbeat 5. Corrective action โ logged in agents/shogun/memory/
|
PASS | Clean separation of concerns. Sentinel writes to ops/, not to agents/shogun/. |
| 9. Pat says "what's the status of everything?" Status rollup |
1. Shogun reads all projects/*/README.md (status field)2. Reads agents/shogun/memory/captures/ for unchecked tasks3. Reads recent ops/mailbox/shogun/inbox/ for pending items4. Queries Linear API for ticket status 5. Synthesizes and responds |
PASS | All status info in predictable locations. ls projects/*/README.md gives the full portfolio. |
| 10. Obsidian Sync conflict on Cockpit Sync edge case |
1. Pat edits governance/DECISIONS.md on Cockpit2. Shogun appends to same file on Engine 3. Obsidian Sync creates conflict file 4. Need manual resolution |
PARTIAL | Mitigations: (1) governance/ changes go through ADR process (not ad-hoc edits), (2) Pat edits via Slack not Obsidian for governance, (3) Obsidian Sync conflict files are visible in Obsidian UI. |
| 11. Pat travels with Nomad โ needs project context Remote access |
1. Nomad has governance/ + agents/shogun/ via sparse checkout2. Pat opens Obsidian โ can read governance and Shogun notes 3. Needs a project file โ projects/ not synced4. Options: (a) SSH to Engine, (b) expand sparse checkout, (c) Obsidian Sync includes projects/ |
PARTIAL | Need to decide: does Nomad sync projects/? Active projects only? All projects? Recommend: sync active projects only. |
| 12. Knowledge gets stale โ CRM contact changed jobs Knowledge maintenance |
1. Network SME runs enrichment pass 2. Detects stale contact in knowledge/people/john-smith.md3. Updates file with new info 4. world-model API re-indexes on next cycle 5. Next time Shogun queries "John Smith" โ gets current data |
PASS | Pipeline handles this. One file per person makes updates atomic. |
| 13. Pat says "build me an investor portal" Major new project |
1. Shogun creates projects/dxd-investor-portal/2. Writes README.md (owner: Forge, participants: Shogun + Forge) 3. Mailbox to Forge with requirements 4. Forge creates plan.md, starts in artifacts/ 5. Code lives in... where? โ ๏ธ The code output isn't clearly addressed |
PARTIAL | Same gap as #4. A project that produces code needs a clear code location. See Claude Code & Git section. |
| 14. Morning brief fails to generate Service failure |
1. 6:15 AM cron fires โ Shogun starts brief generation 2. Linear API is down โ partial data 3. Shogun writes what it can to ops/briefs/4. Logs error to agents/shogun/memory/5. Next heartbeat: retry? |
PASS | Failure is logged, partial output still serves. Structure doesn't hinder recovery. |
| 15. Pat says "I told you about this last month" Historical recall |
1. Shogun checks agents/shogun/MEMORY.md (curated long-term)2. If not there: checks agents/shogun/memory/2026-03-*.md (daily logs)3. If not there: queries world-model API for transcripts 4. If not there: searches projects/*/history/ for Pat direction captures
|
PASS | Four-layer recall: curated memory โ daily logs โ knowledge API โ project history. Good coverage. |
Five independent expert lenses evaluating the architecture. Each expert flags landmines and proposes fixes.
Verdict: Sound foundation, two structural gaps.
agents/forge/code/, agents/forge/world-model/, ops/scripts/, and agents/shogun/scripts/. Need a clear code/ or src/ convention.code/ directory for executable code, or keep it in agents/forge/ with an explicit infra/ subfolder for configs.Verdict: Write safety is the biggest risk. Two critical recommendations.
governance/DECISIONS.md (append-only, multiple writers) and projects/*/plan.md (multiple agents).agents/shogun/ except the CLAUDE.md instruction. A confused or drifting agent could violate boundaries.Verdict: Operationally clean. Watch the knowledge/ size in Git.
Verdict: Excellent navigability. One UX concern.
System_OS / 01-Knowledge-Base.cat agents/*/SOUL.md or cat projects/*/README.md for a system overview.~/.openclaw/workspace/skills/. The agent workspace skills/ folder holds different content (lessons, protocol โ reference docs, not SKILL.md files). This could confuse agents that look for SKILL.md files.skills/ to playbook/ or reference/ to avoid collision with OpenClaw's skill system. Or keep it and add a README.md in skills/ clarifying it's operational reference, not SKILL.md skills.Verdict: Much better than current state. One gap for Pat's workflow.
ls projects/ to see all active work โ huge improvement over digging through 3 vaults.ops/staging/from-pat/ is a clear drop zone โ Pat knows exactly where to put files.ops/staging/from-pat/ or a dedicated knowledge/pat/notes/.knowledge/dxd/ instead? Or should entities/ be top-level?knowledge/ (where Pat would intuitively look). Keep only agent-specific entity stubs (CLAUDE.md) in agents/shogun/entities/.| Finding | Severity | Fix |
|---|---|---|
| Code has no explicit home | High | Add code/ or infra/ convention โ see Claude Code tab |
| Concurrent write risk | High | Write-access matrix + single-writer rules โ see Write Safety tab |
| knowledge/ too large for Git | Medium | Define Git-tracked boundary โ see Git tab |
| Agent skills/ naming ambiguity | Low | Add README.md to skills/ or rename to playbook/ |
| Entity contexts buried in agent dir | Medium | Move business context to knowledge/, keep agent stubs |
| Pat's quick notes have no home | Low | ops/staging/from-pat/ handles this |
How Forge (Claude Code) interacts with the vault. The CLAUDE.md chain. Where code lives.
When Claude Code opens a session, it reads CLAUDE.md files from the working directory upward:
~/ShogunOS/CLAUDE.md โ Currently says "You are Forge." This is the entry point for every Claude Code session.cds into agents/forge/, it reads that CLAUDE.md too (extends parent).Key insight: Claude Code almost always IS Forge. Pat launches Claude Code at the repo root โ it reads root CLAUDE.md โ it becomes Forge. This is correct and should be preserved.
| File | Contains | Who It Serves |
|---|---|---|
~/ShogunOS/CLAUDE.md | System overview + Forge identity + vault map + operating principles. This is the PRIMARY identity file for Claude Code. | Forge (Claude Code) |
agents/forge/CLAUDE.md | Forge-specific workspace details: project list, key files, current priorities | Forge when working in its own dir |
agents/shogun/CLAUDE.md | Shogun-specific orientation (for when Claude Code reviews Shogun's workspace) | Any agent reviewing Shogun's dir |
projects/*/CLAUDE.md | Optional: project-specific instructions for Claude Code sessions on that project | Forge when working on a specific project |
The repo contains multiple types of executable code with no clear placement:
agents/forge/world-model/)scripts/ dirs)Code is Forge's domain. Other agents don't write code. So code stays in Forge's workspace, organized by purpose:
| Code Type | Location | Example | Git-Tracked? |
|---|---|---|---|
| Service code (applications) | agents/forge/services/ | world-model app, brief server | Yes |
| Infrastructure configs | agents/forge/infra/ | LaunchAgent plists, nginx, Docker compose | Yes |
| Shared scripts | ops/scripts/ | mailbox_send.sh, log-rotate.sh | Yes |
| Agent-specific scripts | agents/*/scripts/ | Shogun's briefing generator | Yes |
| Project code outputs | projects/*/artifacts/ | Investor portal HTML | Yes (if text), No (if binary) |
| Runtime data (ChromaDB, venvs) | agents/forge/services/*/data/ | chromadb_store/, .venv/ | No (.gitignored) |
code/? Because code is Forge-owned. Putting it in agents/forge/ maintains the ownership principle. Shared scripts go in ops/scripts/ because any agent can use them. This matches the "who writes it?" principle throughout the system.| Step | What Happens | Files Touched |
|---|---|---|
| 1. Pat or Shogun requests work | Mailbox โ ops/mailbox/forge/inbox/ | Mailbox message |
| 2. Forge (Claude Code) starts session | Reads root CLAUDE.md โ becomes Forge | CLAUDE.md |
| 3. Forge reads the request | Checks inbox, reads project context | ops/mailbox/, projects/*/README.md |
| 4. Forge works | Writes code, configs, architecture docs | agents/forge/*, projects/*/artifacts/ |
| 5. Forge commits | git add + git commit with descriptive message | Git index |
| 6. Forge reports done | Writes DONE message to Shogun's mailbox | ops/mailbox/shogun/inbox/ |
| 7. Forge logs | Updates memory + changelog | agents/forge/memory/, agents/forge/CHANGELOG.md |
The concurrent-write problem is real. Here's the access matrix and mitigation strategy.
| Directory | Write Model | Who Writes | Concurrent Risk | Mitigation |
|---|---|---|---|---|
governance/ | Single-writer + approval | APEX proposes โ Pat approves. No ad-hoc edits. | Low | ADR process gates all changes. Sentinel monitors for unauthorized writes. |
governance/DECISIONS.md | Append-only, serialized | Any agent can append (via script) | Medium | Use decisions-append.sh with file locking (flock). Never edit existing entries. |
knowledge/ | Pipeline-owned | Network SME, Librarian, ingestion pipelines | Low | Each agent owns specific subdirs. Network SME โ people/. Transcript skill โ transcripts/. No overlap. |
agents/<name>/ | Owner-only | Only the named agent | None | Sentinel flags any write by non-owner. CLAUDE.md boundaries. |
projects/*/README.md | Owner-only | Only the project owner (listed in README.md) | Low | Owner updates status. Others read only. |
projects/*/plan.md | Owner-only | Only the project owner | Low | Same as README.md. |
projects/*/artifacts/ | Multi-writer, file-level ownership | Any participating agent writes their own files | Medium | Each agent creates their own files (no two agents edit the same file). Naming convention: agent-slug.md. |
projects/*/logs/ | Multi-writer, no overlap | Each agent writes YYYY-MM-DD-agentname.md | None | Filenames prevent collision by design. |
projects/*/history/ | Append-only | Any agent adds new files (never edits old) | None | New files only. Old history files are immutable. |
projects/*/memory/ | Owner-only | Project owner maintains context.md, open-questions.md | Low | Single maintainer. |
ops/mailbox/ | Multi-writer, no overlap | Any agent writes to any inbox, unique filenames (timestamped) | None | Timestamp + sender in filename prevents collision. |
ops/briefs/ | Single-writer | Shogun generates all briefs | None | One generator. |
ops/staging/ | Multi-writer intake, single-writer triage | Anyone drops files. Shogun triages exclusively. | Low | Intake is additive. Triage (move/delete) is Shogun only. |
ops/logs/ | Service-owned | Each service writes its own log file | None | One writer per log file by definition. |
ops/scripts/ | Forge-only | Forge maintains all shared scripts | None | Single maintainer. |
One agent owns the file/dir. Nobody else writes.
Used for: agent workspaces, project README/plan, governance files, ops/scripts
Enforcement: CLAUDE.md instructions + Sentinel monitoring
Multiple agents write, but file naming prevents collision.
Used for: mailbox (timestamped), project logs (agent-named), project history (date+slug), staging (intake)
Enforcement: Naming convention makes collision impossible
Multiple agents append to the same file. Requires locking script.
Used for: DECISIONS.md only
Enforcement: decisions-append.sh using flock for file-level locking. Never edit existing content โ only append new entries.
What's tracked, what's synced, how code ships.
| Directory | Git-Tracked? | Size | Rationale |
|---|---|---|---|
governance/ | โ Yes | ~1 MB | Constitutional docs need version history. Every change auditable. |
knowledge/ | โ No (.gitignored) | ~475 MB | Too large for Git. Synced via Obsidian Sync + rclone. World-model API is primary access. |
agents/ | โ Yes (except runtime data) | ~5 MB | Agent identity and skills need version history. .gitignore: chromadb_store/, .venv/, *.log |
projects/ | โ Yes | ~10 MB | Project decisions and artifacts need audit trail. |
ops/scripts/ | โ Yes | ~100 KB | Automation scripts are code โ need version control. |
ops/mailbox/ | โก Optional | Variable | Historical value but high churn. Could .gitignore and rely on filesystem. |
ops/briefs/ | โ No | Variable | Regenerated daily. No version history needed. |
ops/staging/ | โ No | Variable | Transient. Files move to final home. |
ops/logs/ | โ No | Variable | Rotated. Already .gitignored. |
archive/ | โก Selective | ~46 MB | Keep lightweight archives. .gitignore large binary archives. |
| Who | Commits | Branch Strategy | Push Cadence |
|---|---|---|---|
| Forge | Code changes, infra configs, architecture docs | Direct to main for routine. Feature branches for major changes. | After every significant work session |
| Shogun | Does NOT commit directly. Shogun runs on OpenClaw, not Claude Code. | N/A | N/A โ Shogun's writes are picked up in Forge's next commit, or auto-committed via a cron job |
| Auto-commit cron | Catches Shogun's memory writes, mailbox messages, captures | main | Every 30 min (if changes exist) |
| Pat (Obsidian) | Direct edits via Obsidian Sync โ Engine | Obsidian Sync handles. Git picks up on next auto-commit. | Passive |
Remote: github.com/patrickrmadden-byte/ShogunOS (private repo)
Issue: 34 local commits with no shared ancestry to GitHub. Forge flagged this as a pain point โ needs a sync reconciliation.
v2-restructure and mergeChanges to the v3 blueprint based on stress testing and MoE review.
| # | Change | Why | Impact |
|---|---|---|---|
| 1 | Add agents/forge/services/ for application code and agents/forge/infra/ for infrastructure configs | Code currently has no explicit home. Forge owns all code. | Resolves stress test scenarios #4 and #13 |
| 2 | Move business entity operating contexts (DxD, HoldCo) to knowledge/. Keep only CLAUDE.md stubs in agents/shogun/entities/ | MoE CEO expert: Pat looks for DxD info in the knowledge base, not inside Shogun's workspace | Better discoverability for Pat |
| 3 | Create ops/scripts/decisions-append.sh with file locking for DECISIONS.md | Only append-only multi-writer file in the system. Needs locking. | Eliminates concurrent-write risk |
| 4 | .gitignore knowledge/ entirely. Sync via Obsidian Sync + rclone. | 475MB is too large for Git. World-model API is primary access anyway. | Repo drops from ~525MB to ~16MB |
| 5 | Add auto-commit cron (every 30 min) for Shogun's writes | Shogun runs on OpenClaw (no Claude Code, no git access). Its writes need to be committed. | Shogun's memory, captures, and mailbox messages get version-tracked |
| 6 | Add README.md to agents/*/skills/ clarifying it's operational reference, not OpenClaw SKILL.md files | MoE Agent UX expert: naming ambiguity with OpenClaw's skill system | Prevents agent confusion |
| 7 | Add project log rotation: 30 days, then consolidate to single archive file | MoE Ops expert: project logs could accumulate without bounds | Prevents project dir bloat |
| 8 | Add Nomad sync rule: governance/ + agents/shogun/ + active projects/ (via Git sparse checkout) | Stress test #11: Pat needs project context on travel | Resolves Nomad access gap |
Changes from v3 shown with NEW tags:
ShogunOS/ โโโ CLAUDE.md โ Forge identity (Claude Code entry point) โโโ README.md โ Human onboarding โ โโโ governance/ โ Git-tracked. Read every session. โ โโโ SYSTEM.md โ โโโ DECISIONS.md โ append via decisions-append.sh (flock) โ โโโ SYSTEM_LESSONS.md โ โโโ THE_AGENT_DOCTRINE.md โ โโโ decisions/ โ โโโ frameworks/ โ โโโ integrations/ โ โโโ metrics/ โ โโโ knowledge/ โ .gitignored. Synced via Obsidian/rclone. โ โโโ people/ โ โโโ orgs/ โ โโโ transcripts/ โ โโโ digests/ โ โโโ reference/ โ โโโ pat/ โ โโโ dxd/ โ NEW: DxD business context (moved from entities) โ โโโ holdco/ โ NEW: HoldCo context (moved from entities) โ โโโ montauk/ โ NEW: Montauk context (moved from entities) โ โโโ graph/ โ โโโ staging/ โ โโโ agents/ โ Git-tracked. โ โโโ shogun/ โ โ โโโ SOUL.md, CLAUDE.md, MEMORY.md, HEARTBEAT.md โ โ โโโ memory/ โ โ โโโ skills/ โ โ โ โโโ README.md โ NEW: clarifies these aren't SKILL.md files โ โ โโโ entities/ โ CLAUDE.md stubs only (business context in knowledge/) โ โ โโโ scripts/ โ โ โ โโโ forge/ โ โ โโโ SOUL.md, CLAUDE.md, FORGE_DOCTRINE.md, CHANGELOG.md โ โ โโโ memory/ โ โ โโโ skills/ โ โ โโโ architecture/ โ โ โโโ services/ โ NEW: application code (world-model, brief-server) โ โ โโโ infra/ โ NEW: LaunchAgents, nginx, Docker configs โ โ โโโ specs/ โ โ โโโ code/ โ symlinks to service code if needed โ โ โ โโโ sentinel/ โ โโโ projects/ โ Git-tracked. โ โโโ <name>/ โ โโโ README.md, plan.md โ โโโ decisions/, artifacts/, research/ โ โโโ history/, memory/, logs/ โ โโโ archive/ โ โโโ ops/ โ scripts/ Git-tracked. Rest .gitignored. โ โโโ mailbox/ โ โโโ briefs/ โ โโโ staging/ โ โโโ logs/ โ โโโ scripts/ โ โโโ mailbox-send.sh โ โโโ decisions-append.sh โ NEW: flock-based append for DECISIONS.md โ โโโ auto-commit.sh โ NEW: 30-min cron for Shogun's writes โ โโโ log-rotate.sh โ โโโ archive/