Date: 2025-10-29
Critical Correction: Agents MUST stay in tool-specific folders
AI tools expect agents/commands/tools in THEIR specific folders:
.opencode/agent/, .opencode/command/.cursor/prompts/, .cursor/rules/We CANNOT move agents to .nexusagent/
project/
├── .nexusagent/ # ONLY context & governance (shared)
│ ├── context/ # Domain knowledge (SHAREABLE)
│ │ ├── core/
│ │ ├── domain/
│ │ ├── processes/
│ │ └── standards/
│ │
│ └── governance/ # Data governance (SHAREABLE)
│ ├── metadata-index.json
│ ├── workflow-state.json
│ └── tmp/requests/
│
└── .opencode/ # OpenCode-specific (PRIMARY)
├── agent/ # MUST be here for OpenCode
│ ├── main-orchestrator.md
│ ├── context-provider.md
│ └── subagents/
│
└── command/ # MUST be here for OpenCode
├── workflow.md
└── plan-task.md
.nexusagent/ contains ONLY:
Each tool has its own folder with agents/commands that REFERENCE the shared context:
OpenCode Agent Example:
---
description: "Main orchestrator"
mode: primary
---
# Main Orchestrator
**Load shared context from:**
@../.nexusagent/context/core/essential-patterns.md
@../.nexusagent/context/domain/business-rules.md
**Load governance metadata from:**
Read: ../.nexusagent/governance/metadata-index.json
[Rest of agent logic here]
~/nexus/scripts/install.sh --profile governance
# Creates:
# 1. .nexusagent/ (shared context + governance)
# 2. .opencode/ (OpenCode agents + commands)
# Agents reference: @../.nexusagent/context/
project/
├── .nexusagent/ # Universal shared resources
│ ├── nexus.json # Configuration
│ │
│ ├── context/ # SHAREABLE context
│ │ ├── core/
│ │ │ └── essential-patterns.md
│ │ ├── domain/
│ │ │ ├── business-rules.md
│ │ │ └── data-models.md
│ │ ├── processes/
│ │ │ └── standard-workflow.md
│ │ └── standards/
│ │ └── quality-criteria.md
│ │
│ └── governance/ # SHAREABLE governance
│ ├── metadata-index.json
│ ├── workflow-state.json
│ ├── tmp/
│ │ └── requests/
│ └── logs/
│
└── .opencode/ # OpenCode integration
├── agent/
│ ├── main-orchestrator.md # References @../.nexusagent/context/
│ ├── context-provider.md # References @../.nexusagent/context/
│ └── subagents/
│ ├── quality-validator.md # References @../.nexusagent/governance/
│ └── lifecycle-manager.md
│
└── command/
├── workflow.md # References @../.nexusagent/context/
└── validate.md
.nexusagent/ (Shared)✅ Context files (markdown) ✅ Governance data (JSON) ✅ Metadata index ✅ Request files ✅ Workflow state ✅ Configuration
❌ Agents (they stay in tool folders) ❌ Commands (they stay in tool folders) ❌ Tool-specific anything
.opencode/ (Tool-Specific)✅ Agents (OpenCode format) ✅ Commands (OpenCode format) ✅ References to @../.nexusagent/context/ ✅ References to ../.nexusagent/governance/
.cursor/ (Optional, User-Created)✅ Prompts (Cursor format) ✅ Rules (Cursor format) ✅ Can reference ../.nexusagent/context/ ✅ Can reference ../.nexusagent/governance/
Respects Tool Conventions
Shares What Can Be Shared
Clean Separation
# Install NexusAgent
~/nexus/scripts/install.sh --profile governance
# What it creates:
# 1. .nexusagent/context/ (shared context)
# 2. .nexusagent/governance/ (shared governance)
# 3. .opencode/agent/ (OpenCode agents)
# 4. .opencode/command/ (OpenCode commands)
# OpenCode agents reference:
# @../.nexusagent/context/
# ../.nexusagent/governance/
---
description: "Main orchestrator with shared context"
mode: primary
temperature: 0.2
---
# Main Orchestrator
<context>
<system_context>
NexusAgent orchestration system with shared context from .nexusagent/
</system_context>
</context>
<!-- Load shared context -->
**Context files:**
@../.nexusagent/context/core/essential-patterns.md
@../.nexusagent/context/domain/business-rules.md
<!-- Access shared governance -->
**Governance data:**
Can read: ../.nexusagent/governance/metadata-index.json
<role>
Primary orchestrator that uses shared context and governance
</role>
<task>
Orchestrate tasks using shared context from .nexusagent/
</task>
[Rest of agent logic]
~/nexus/profiles/governance/)governance/
├── nexusagent/ # Goes to .nexusagent/
│ ├── context/
│ └── governance/
│
└── opencode/ # Goes to .opencode/
├── agent/
└── command/
Profile: governance/nexusagent/ → Project: .nexusagent/
Profile: governance/opencode/ → Project: .opencode/
This architecture: ✅ Respects tool conventions (agents stay in tool folders) ✅ Shares what can be shared (context + governance) ✅ Works with OpenCode (primary) ✅ Allows other tools to read shared resources (optional) ✅ No maintenance burden for multiple tools
Ready to build with this corrected structure.