@@ -14,26 +14,35 @@ AI-powered system that transforms expert materials (videos, PDFs, transcriptions
1414
1515```
1616mega-brain/
17- ├── core/ -> Engine (Pedro pattern)
18- │ ├── tasks/ -> Atomic tasks (HO-TP-001 anatomy)
19- │ ├── workflows/ -> YAML orchestration
20- │ ├── intelligence/ -> Python scripts
21- │ ├── patterns/ -> YAML configs
22- │ ├── protocols/ -> Pipeline, conclave, DNA protocols
23- │ ├── schemas/ -> JSON schemas
24- │ ├── jarvis/ -> JARVIS Soul + DNA
25- │ ├── templates/ -> Log templates
26- │ └── glossary/ -> Domain glossaries
27- ├── agents/ -> AI agents (conclave, cargo, persons)
28- ├── .claude/ -> Claude Code integration
29- ├── docs/ -> Documentation, PRDs, plans
30- │ ├── prd/ -> Product requirements
31- │ └── plans/ -> Plan mode outputs
32- ├── bin/ -> CLI tools (npm)
33- ├── inbox/ -> Raw materials (L3)
34- ├── artifacts/ -> Pipeline stages (L3)
35- ├── knowledge/ -> Knowledge base (L3)
36- └── logs/ -> Session logs (L3)
17+ ├── .aiox/ -> AIOS Core (gitignored, local-only)
18+ │ ├── development/
19+ │ │ ├── agents/ -> 40+ agent definitions + mega-brain/
20+ │ │ └── skills/ -> 19 development skills (media-buyer, etc.)
21+ │ ├── core/protocols/ -> constitution.yaml, agent-index.yaml
22+ │ └── hooks/ -> 34 AIOS-exclusive hooks + _utils/
23+ ├── core/ -> Engine (Pedro pattern)
24+ │ ├── tasks/ -> Atomic tasks (HO-TP-001 anatomy)
25+ │ ├── workflows/ -> YAML orchestration
26+ │ ├── intelligence/ -> Python scripts
27+ │ ├── patterns/ -> YAML configs
28+ │ ├── protocols/ -> Pipeline, conclave, DNA protocols
29+ │ ├── schemas/ -> JSON schemas
30+ │ ├── jarvis/ -> JARVIS Soul + DNA
31+ │ ├── templates/ -> Log templates
32+ │ └── glossary/ -> Domain glossaries
33+ ├── agents/ -> AI agents (conclave, cargo, persons)
34+ ├── .claude/ -> Claude Code integration
35+ │ ├── agents/ -> 24 Claude Code agent types (gitignored)
36+ │ ├── hooks/ -> 30 hooks (tracked) + merged AIOS features
37+ │ ├── skills/ -> 59 skills (45 native + 14 AIOS, mixed gitignore)
38+ │ ├── commands/ -> 56 commands (39 native + 17 AIOS, mixed gitignore)
39+ │ └── rules/ -> 21 rules (16 native + 5 AIOS, mixed gitignore)
40+ ├── docs/ -> Documentation, PRDs, plans
41+ ├── bin/ -> CLI tools (npm)
42+ ├── inbox/ -> Raw materials (L3)
43+ ├── artifacts/ -> Pipeline stages (L3)
44+ ├── knowledge/ -> Knowledge base (L3)
45+ └── logs/ -> Session logs (L3)
3746```
3847
3948## Plan Mode
@@ -84,18 +93,65 @@ When in plan mode, save the plan file to: `docs/plans/YYYY-MM-DD-description.md`
8493| ` /resume ` | Resume previous session |
8594| ` /setup ` | Environment setup wizard |
8695
96+ ### AIOS Core Commands (migrated, gitignored)
97+
98+ | Command | Description |
99+ | ---------| -------------|
100+ | ` /AIOS/* ` | AIOS agent activation sub-commands |
101+ | ` /doc-master ` | Document pipeline orchestration |
102+ | ` /mmos-squad ` | MMOS mind cloning squad |
103+ | ` /map ` | MMOS mind mapping |
104+ | ` /Ralph ` | Ralph Wiggum completeness checker |
105+ | ` /synapse ` | SYNAPSE context engine management |
106+ | ` /extract-knowledge ` | Knowledge extraction from materials |
107+ | ` /bilhon-docs ` | BILHON document generation |
108+ | ` /merge-aios ` | Merge AIOS Core staging content to final locations |
109+
87110## Agents
88111
89- Defined in ` AGENT-INDEX.yaml ` , activated via slash commands.
112+ Defined in ` agents/ AGENT-INDEX.yaml` , activated via slash commands.
90113
91114| Type | Count | Purpose |
92115| ------| -------| ---------|
93- | CARGO | 29 | Functional roles (Sales, Marketing, Ops) |
94- | MINDS | 5 | Expert mind clones |
116+ | CARGO | 29+ | Functional roles (Sales, Marketing, Ops) |
117+ | MINDS | 5+ | Expert mind clones |
95118| CONCLAVE | 3 | Multi-perspective deliberation |
96119| SYSTEM | 2 | JARVIS, Agent-Creator |
120+ | AIOS Core | 11 | Dev squad (dev, qa, architect, pm, po, sm, analyst, devops, data-engineer, ux-design-expert, aios-master) |
121+ | Doc Pipeline | 9 | Document generation (doc-master thru doc-orchestrator) |
122+ | Media Buyer | 5 | Paid traffic (ad-midas, performance-analyst, creative-analyst, pixel-specialist) |
123+ | MMOS | 9 | Mind cloning (mind-mapper, cognitive-analyst, identity-analyst, etc.) |
124+ | Design | 3 | Design system (design-system, bilhon-design-agent, design-review) |
125+ | Fusion | 11 | Repo merging (fusion-commander, merge-arbiter, etc.) |
126+
127+ ### Agent Definitions Location
128+
129+ | Source | Path | Protected |
130+ | --------| ------| -----------|
131+ | AIOS Core agents | ` .aiox/development/agents/*.md ` | Gitignored (.aiox/) |
132+ | Mega-brain agents | ` .aiox/development/agents/mega-brain/ ` | Gitignored (.aiox/) |
133+ | Claude Code agent types | ` .claude/agents/*.md ` (24 files) | Gitignored (.claude/agents/) |
134+
135+ ### Agent Activation
136+
137+ Agents activated with ` @agent-name ` : ` @dev ` , ` @qa ` , ` @architect ` , ` @pm ` , ` @po ` , ` @sm ` , ` @analyst ` , ` @devops ` .
97138
98- ** Total Active Agents:** 37
139+ ### Agent Memory (NON-NEGOTIABLE)
140+
141+ Agent memory lives EXCLUSIVELY in ` .claude/agent-memory/{slug}/MEMORY.md ` .
142+
143+ - Agent definition (` .aiox/ ` ) \! = Runtime memory (` .claude/agent-memory/ ` )
144+ - NEVER store memory inside agent definition files
145+ - NEVER create CLAUDE.md for memory (guard hook blocks automatically)
146+
147+ ### Agent Authority Rules
148+
149+ | Agent | Exclusive Authority | Blocked for Others |
150+ | -------| --------------------| --------------------|
151+ | @devops (Gage) | Git Push, PR, CI/CD | ` git push ` , ` gh pr create ` |
152+ | @qa (Rex) | Quality Approval | Mark story Ready without QA |
153+ | @pm (Max) | PRD Approval | Approve requirements without PM |
154+ | @architect (Aria) | Architecture Decisions | Stack/infra without Architect |
99155## Configuration
100156
101157- ** ` .env ` ** is the ONLY source of truth for credentials
@@ -114,20 +170,26 @@ Defined in `AGENT-INDEX.yaml`, activated via slash commands.
114170
115171## Hooks System
116172
117- 20 + active hooks in ` .claude/hooks/ ` (Python 3, stdlib + PyYAML only).
118- Configured in ` settings.json ` (distributed) and ` settings.local.json ` (local overrides ).
173+ 30 + active hooks across two locations (Python 3, stdlib + PyYAML only).
174+ Configured in ` settings.json ` (gitignored ).
119175
120- | Event | Key Hooks |
121- | -------| -----------|
122- | SessionStart | ` session_start.py ` , ` inbox_age_alert.py ` , ` skill_indexer.py ` |
123- | UserPromptSubmit | ` skill_router.py ` , ` quality_watchdog.py ` , ` memory_updater.py ` |
124- | PreToolUse | ` creation_validator.py ` , ` claude_md_guard.py ` |
125- | PostToolUse | ` post_tool_use.py ` , ` enforce_dual_location.py ` |
126- | Stop | ` stop_hook_completeness.py ` , ` ralph_wiggum.py ` |
176+ | Location | Count | Protected |
177+ | ----------| -------| -----------|
178+ | ` .claude/hooks/ ` | 30 | Tracked (mega-brain native) |
179+ | ` .aiox/hooks/ ` | 34 | Gitignored (AIOS-exclusive) |
180+
181+ | Event | Key Hooks (.claude/) | AIOS Hooks (.aiox/) |
182+ | -------| ---------------------| --------------------------|
183+ | SessionStart | ` session_start.py ` , ` inbox_age_alert.py ` , ` skill_indexer.py ` | ` memory_bank_loader.py ` , ` elicitation_reset.py ` , ` token_monitor.py ` |
184+ | UserPromptSubmit | ` skill_router.py ` , ` quality_watchdog.py ` , ` memory_updater.py ` | ` elicitation_gate.py ` , ` document_trigger.py ` , ` council_logger.py ` |
185+ | PreToolUse | ` creation_validator.py ` , ` claude_md_guard.py ` | - |
186+ | PostToolUse | ` post_tool_use.py ` , ` enforce_dual_location.py ` | ` subagent_tracker.py ` , ` post_output_validator.py ` |
187+ | Stop | ` stop_hook_completeness.py ` , ` ralph_wiggum.py ` | - |
188+ | SessionEnd | ` session_end.py ` , ` agent_memory_persister.py ` | ` session_log.py ` , ` token_monitor.py ` |
127189
128190## Rules (Lazy Loading)
129191
130- Detailed rules are loaded on-demand via keyword matching from ` .claude/rules/ ` :
192+ Detailed rules loaded on-demand via keyword matching from ` .claude/rules/ ` :
131193
132194| Group | Topics | File |
133195| -------| --------| ------|
@@ -138,6 +200,79 @@ Detailed rules are loaded on-demand via keyword matching from `.claude/rules/`:
138200| VALIDATION | source-sync, integrity | RULE-GROUP-5.md |
139201| AUTO-ROUTING | skills, sub-agents, GitHub | RULE-GROUP-6.md |
140202
203+ ### AIOS Core Rules (migrated, gitignored)
204+
205+ | Rule | Purpose |
206+ | ------| ---------|
207+ | ` semantic-routing.md ` | Auto-routes user requests to correct agent via intent |
208+ | ` architecture-rules.md ` | Agent memory architecture, definition vs runtime |
209+ | ` agent-commands-rules.md ` | Agent command syntax and activation |
210+ | ` aios-native-knowledge.md ` | AIOS native knowledge base |
211+ | ` mcp-usage.md ` | MCP server governance and tool selection priority |
212+
213+ ## AIOS Core Integration
214+
215+ Content migrated from ` aios-core ` repo. All AIOS content is local-only (gitignored + npm-excluded).
216+
217+ ### Protection Layers
218+
219+ | Layer | Mechanism | Status |
220+ | -------| -----------| --------|
221+ | Git | ` .gitignore ` entries per file | Each migrated file individually listed |
222+ | npm | ` .npmignore ` + ` package.json ` negations | ` ! ` patterns exclude each file |
223+ | CI/CD | ` .aiox/ ` never in git = never in checkout | No workflow references |
224+ | Pre-publish | ` bin/pre-publish-gate.js ` blocks ` .aiox/ ` content | Physical block before npm publish |
225+
226+ ### Protocols
227+
228+ | Protocol | Path | Purpose |
229+ | ----------| ------| ---------|
230+ | Constitution | ` .aiox/core/protocols/constitution.yaml ` | Non-negotiable principles |
231+ | Agent Index | ` .aiox/core/protocols/agent-index.yaml ` | Agent catalog |
232+ | Orchestration | ` .aiox/core/protocols/orchestration-rules.yaml ` | Agent handoff rules |
233+
234+ ### Semantic Routing
235+
236+ User requests are automatically routed to the correct agent via intent matching.
237+ Rules: ` .claude/rules/semantic-routing.md `
238+
239+ Priority chain: ` @agent ` explicit > Intent semantic > Keyword matching > Skill matching > ` @aios-master ` (fallback)
240+
241+ ### Development Skills (AIOS)
242+
243+ Located in ` .aiox/development/skills/ ` :
244+
245+ | Skill | Purpose |
246+ | -------| ---------|
247+ | ` writing-plans ` | Exact implementation plans (2-5 min tasks) |
248+ | ` subagent-driven-development ` | Execute plans with @dev /@qa dispatch |
249+ | ` test-driven-development ` | RED-GREEN-REFACTOR enforced |
250+ | ` systematic-debugging ` | Root cause investigation (4-phase) |
251+ | ` media-buyer/ ` | 18 skills from 47 frameworks (5 experts) |
252+ | ` doc-generation/ ` | Document pipeline skills |
253+ | ` mmos-cognitive-analysis/ ` | Mind cloning analysis |
254+
255+ ## Teaching Mode (SEMPRE ATIVO)
256+
257+ Ao criar, modificar ou explicar qualquer elemento tecnico, OBRIGATORIAMENTE inclua:
258+
259+ 1 . TREE ARQUITETURAL COMPLETO mostrando ONDE o elemento mora (desde a raiz do projeto)
260+ 2 . RAIO-X COMPLETO com tabela: o que e, onde fica, dentro de que, ligado a que, quem aciona, o que tem dentro, formato e porque, o que quebra se apagar, alternativa possivel
261+ 3 . MAPA DE CONEXOES VISUAL com setas e verbos claros (chama, dispara, usa, le, escreve)
262+ 4 . ANALOGIA COM MUNDO REAL usando operacao de empresa (vendas, marketing, gestao, CRM)
263+ 5 . DECISOES TECNICAS EXPLICADAS: o que decidiu, por que, alternativa existente, consequencia da escolha
264+
265+ ### Regras de linguagem:
266+ - Nunca encurtar caminhos sem mostrar o contexto completo desde a raiz
267+ - Nunca usar termo tecnico sem traducao imediata entre parenteses
268+ - Nunca mencionar pasta sem mostrar o que tem dentro dela
269+ - Ir ate 2 niveis de profundidade no "porque". No 3o nivel, perguntar se quer aprofundar
270+ - Usar linguagem de negocios como analogia primaria
271+ - Sempre responder a pergunta antes que ela seja feita
272+
273+ ### Referencia completa da skill:
274+ Consultar ` .claude/skills/teaching/SKILL.md ` para exemplos e formato detalhado.
275+
141276## Security
142277
1432781 . ** NEVER** hardcode API keys or tokens in code
@@ -169,4 +304,5 @@ See `system/docs/CHANGELOG-ARCHITECTURE.md` for architectural evolution history.
169304
170305- Only 2 CLAUDE.md files are valid: root ` CLAUDE.md ` and ` .claude/CLAUDE.md ` (this file)
171306- NEVER create CLAUDE.md in data or code subdirectories
172- - Agent memory lives in ` .claude/jarvis/ ` and ` .claude/skills/ `
307+ - Agent memory lives EXCLUSIVELY in ` .claude/agent-memory/{slug}/MEMORY.md `
308+ - Guard hook (` claude_md_guard.py ` ) blocks unsanctioned CLAUDE.md creation
0 commit comments