Layered System Design: OS Layer + Application Layer
- Overview
- Layered Architecture
- OS Layer (Navigator)
- Application Layer (Superpowers)
- Communication Layer (.agent/)
- Implicit Integration
- Data Flow
- Design Decisions
SuperNavigator uses a layered architecture to separate concerns:
- OS Layer: Manages WHEN and WHAT to load (context management)
- App Layer: Defines HOW to develop (workflows and patterns)
- Communication: Shared
.agent/data store with implicit triggers
This separation enables:
- Specialization (each layer does one thing well)
- Loose coupling (layers work independently)
- Tight integration (implicit triggers connect workflows)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERACTION β
β Natural Language β Skill Invocation β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β APPLICATION LAYER (Superpowers) β
β β
β ββββββββββββββ ββββββββββββββββ βββββββββββββββββ
β β Design β β Development β β Quality ββ
β β β β β β ββ
β β brainstorm β β TDD β β code-review ββ
β β write-plan β β worktrees β β debugging ββ
β ββββββββββββββ ββββββββββββββββ βββββββββββββββββ
β β
β Writes to: .agent/tasks/, .agent/system/ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββ
β .agent/ Data Store β β INTEGRATION
β (Shared Storage) β
βββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OS LAYER (Navigator) β
β β
β ββββββββββββββ ββββββββββββββββ βββββββββββββββββ
β β Session β β Context β β Memory ββ
β β β β β β ββ
β β nav-init β β nav-compact β β nav-marker ββ
β β nav-start β β nav-diagnose β β nav-profile ββ
β ββββββββββββββ ββββββββββββββββ βββββββββββββββββ
β β
β Reads from: .agent/DEVELOPMENT-README.md β
β Indexes: .agent/tasks/, .agent/system/ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Aspect | OS Layer | App Layer |
|---|---|---|
| Primary Concern | Context efficiency | Development quality |
| When Active | Every session | On-demand workflows |
| State Management | Persistent (.agent/) | Transient (per-workflow) |
| User Interaction | Session start/end | Throughout development |
| Integration | Reads .agent/, creates markers | Writes to .agent/ |
Manage context loading, session state, and memory to keep token usage efficient.
Session Management:
nav-init: Initialize .agent/ structurenav-start: Load documentation navigatornav-onboard: User onboardingnav-loop: Autonomous task completion
Context Optimization:
nav-compact: Prune context intelligentlynav-marker: Create restoration checkpointsnav-profile: Theory of Mind (user preferences)nav-diagnose: Detect collaboration quality issues
Documentation:
nav-task: Index implementation plansnav-sop: Standard Operating Proceduresnav-skill-creator: Create new skills
Project Management:
nav-stats: Session metricsnav-update-claude: Update CLAUDE.mdnav-release: Release managementnav-upgrade: Version upgradesnav-install-multi-claude: Multi-Claude workflows
Plugin:
plugin-slash-command: Slash command support
92% Token Reduction:
Without Navigator: Load entire .agent/ = 150k tokens
With Navigator: Load DEVELOPMENT-README.md = 12k tokens
Load on-demand = 3-5k per doc
Total = ~20k vs 150k (87% savings)
Theory of Mind (v5.0.0+):
- Bilateral modeling (nav-profile)
- Verification checkpoints
- Quality detection (nav-diagnose)
- Belief state anchors
Loop Mode (v5.1.0+):
- Structured completion signals
- Dual-condition exit gates
- Stagnation detection
- Autonomous task execution
Reads:
.agent/DEVELOPMENT-README.md(navigation index).agent/.nav-config.json(configuration).agent/markers/*.md(checkpoints).agent/profiles/*.json(user preferences)
Writes:
.agent/markers/(new checkpoints).agent/profiles/(updated preferences)- Updates to DEVELOPMENT-README.md
Provide structured development workflows from design to deployment.
Design:
brainstorming: Turn ideas into designswriting-plans: Create implementation plans
Development:
test-driven-development: RED-GREEN-REFACTORusing-git-worktrees: Isolated workspacesexecuting-plans: Task-by-task execution
Quality:
requesting-code-review: Validate workreceiving-code-review: Process feedbacksystematic-debugging: Root-cause analysis
Parallel:
dispatching-parallel-agents: Independent taskssubagent-driven-development: Complex features
Advanced:
verification-before-completion: Ensure it worksfinishing-a-development-branch: Merge/PR decisionswriting-skills: Create new skillsusing-superpowers: Skill usage guide
Test-Driven Development:
- Write failing test first
- Minimal code to pass
- Refactor with confidence
- 100% enforcement
Systematic Over Ad-Hoc:
- Brainstorming before coding
- Plans before implementation
- Debugging process before fixes
- Verification before completion
Simplicity:
- YAGNI ruthlessly
- No premature abstraction
- Solve the problem at hand
- Refactor when needed
Reads:
- Git repository state
- Test results
- Code review comments
- Plan files
Writes:
docs/plans/YYYY-MM-DD-*.md(designs).agent/tasks/TASK-*.md(plans).agent/sops/(procedures).agent/system/(architecture updates)
.agent/
βββ DEVELOPMENT-README.md # OS layer navigation index
βββ .nav-config.json # Configuration (both layers)
β
βββ tasks/ # App layer writes
β βββ TASK-XX-feature.md # writing-plans output
β
βββ system/ # App layer writes
β βββ project-architecture.md
β βββ patterns.md # brainstorming output
β
βββ sops/ # App layer writes
β βββ integrations/
β βββ debugging/ # systematic-debugging output
β βββ development/
β βββ deployment/
β
βββ markers/ # OS layer writes
β βββ checkpoint-*.md # nav-marker output
β
βββ profiles/ # OS layer writes
β βββ user-preferences.json # nav-profile output
β
βββ grafana/ # OS layer metrics
βββ navigator-dashboard.json
App Layer β OS Layer:
brainstorming writes design
β
.agent/system/architecture.md
β
nav-task indexes in DEVELOPMENT-README.md
β
nav-start loads index next session
OS Layer β App Layer:
nav-marker creates checkpoint
β
.agent/markers/before-brainstorming.md
β
If session crashes, nav-start offers restore
β
App layer continues from checkpoint
Defined in .nav-config.json:
{
"implicit_integration": {
"trigger_boundaries": [
"before_brainstorming",
"after_plan_complete",
"after_code_review",
"on_branch_finish"
]
}
}1. Before Brainstorming:
User: "Let's design authentication"
β
App Layer: brainstorming skill activates
β
OS Layer: nav-marker creates checkpoint
β
Checkpoint: .agent/markers/before-brainstorm-auth.md
2. After Plan Complete:
App Layer: writing-plans creates plan
β
Plan written to: .agent/tasks/TASK-12-auth.md
β
OS Layer: nav-task updates index
β
Index updated: .agent/DEVELOPMENT-README.md
3. After Code Review:
App Layer: requesting-code-review completes
β
OS Layer: Check context usage
β
If > 85%: nav-compact auto-triggers
4. On Branch Finish:
App Layer: finishing-a-development-branch
β
OS Layer: nav-marker creates completion checkpoint
β
OS Layer: nav-sop suggests documenting learnings
Enable/disable implicit integration:
{
"implicit_integration": {
"auto_save_markers": true, // Markers at boundaries
"auto_compact_threshold": 0.85, // Compact at 85%
"auto_update_nav_tasks": true, // Index plans
"trigger_boundaries": [...] // When to trigger
}
}1. User: "Start my SuperNavigator session"
β
2. nav-start (OS layer) executes
β
3. Loads: .agent/DEVELOPMENT-README.md (2k tokens)
β
4. Loads: .agent/.nav-config.json (config)
β
5. Checks: .agent/profiles/user.json (preferences)
β
6. Injects: using-superpowers context (App layer)
β
7. Both layers active
1. User: "Design new feature"
β
2. brainstorming (App) activates
β
3. nav-marker (OS) checkpoint created (implicit)
β
4. Design written to docs/plans/ and .agent/system/
β
5. nav-task (OS) indexes design (implicit)
β
6. Design accessible in future sessions
1. App layer workflow runs
β
2. Context usage grows
β
3. Reaches 85% threshold
β
4. nav-compact (OS) auto-triggers (implicit)
β
5. Context pruned intelligently
β
6. Workflow continues with <50% usage
Separation of Concerns:
- OS layer: Optimization (when/what to load)
- App layer: Execution (how to develop)
- Clean boundaries, independent evolution
Loose Coupling:
- Layers communicate via
.agent/files - No direct skill-to-skill dependencies
- Easy to add/remove skills
Tight Integration:
- Implicit triggers connect workflows
- No manual coordination needed
- Seamless user experience
Single Source of Truth:
- Both layers read/write same structure
- No data synchronization needed
- Consistent state
Observable:
- User can inspect .agent/ anytime
- Easy to debug integration issues
- Transparent operation
Simple:
- No complex event bus
- No message passing
- Just files
Better UX:
- No manual trigger commands
- Workflows feel natural
- Reduced cognitive load
Reliable:
- Triggers at consistent boundaries
- No user error possible
- Always synchronized
Optional:
- Can be disabled in config
- Explicit mode available
- User control maintained
Session Start:
OS Layer loads:
- DEVELOPMENT-README.md: 2k tokens
- .nav-config.json: 0.5k tokens
- using-superpowers: 3k tokens
Total: ~5.5k tokens
Typical Workflow:
Design phase:
- brainstorming dialogue: 10k tokens
- Design doc: 3k tokens
Implementation phase:
- test-driven-development: 5k tokens
- Code context: 20k tokens
Review phase:
- requesting-code-review: 8k tokens
Total: ~46k tokens (vs 150k without Navigator)
Without SuperNavigator:
- Crashes at exchange 5-7
- Context fills completely
- Must restart frequently
With SuperNavigator:
- 20+ exchanges common
- Context stays <50%
- Markers enable resume
- Sessions complete features
- Create skill in
skills/os-layer/{category}/ - Add to
.claude-plugin/plugin.json - Document in OS-LAYER-GUIDE.md
- Test with nav-start
- Create skill in
skills/app-layer/{category}/ - Add to
.claude-plugin/plugin.json - Add SuperNavigator integration section
- Document integration points
- Test workflow with OS layer
- Update
.nav-config.jsontemplate - Add trigger boundary to
trigger_boundaries - Update skill documentation
- Test implicit trigger behavior
- All Navigator skills work unchanged
- App layer is additive (new workflows)
- Existing .agent/ structure compatible
- Update .nav-config.json for new features
- All Superpowers skills work unchanged
- OS layer adds context optimization
- No workflow changes required
- Initialize .agent/ with nav-init
- Start fresh with nav-init
- Both layers available immediately
- Guided onboarding (nav-onboard)
- Progressive learning
- Visual dashboard for .agent/ structure
- Real-time context usage monitoring
- Skill marketplace integration
- Team collaboration features
- Remote .agent/ sync (multi-machine)
- AI-generated integration points
- Custom trigger boundaries
- Layer versioning
SuperNavigator's layered architecture provides:
β Separation of Concerns: OS vs App layers with clear boundaries β Implicit Integration: Layers work together automatically β Token Efficiency: 92% reduction via on-demand loading β Development Quality: TDD enforcement, systematic processes β Extensibility: Easy to add skills to either layer β User Control: Configure integration level β Transparency: Observable .agent/ state
The result: Sessions that finish what they start, with both efficiency and quality.