Files
daffy0208 ee6ea5d1ec feat: Implement Repository Brain (Phase 1: Foundation)
Implement the first phase of the Repository Brain - a 4-layer intelligence
system that manages, understands, and orchestrates all 108 resources.

Phase 1 Complete (Foundation):
- ✅ Layer 1: Knowledge Layer (registry queries)
- ✅ Brain Core (central orchestration class)
- ✅ Full CLI interface (12 commands)
- ✅ TypeScript implementation
- ✅ Decision rules documentation

Features Implemented:
• Query repository state (40 skills, 36 MCPs, 108 resources)
• Search across all resources
• Validate registry consistency
• Get skill/MCP relationships
• Reverse dependency lookup
• Intelligent skill selection
• Workflow recommendations
• MCP dependency resolution

CLI Commands:
  brain status              - Current repository state
  brain health              - Health check with validation
  brain validate            - Validate registries
  brain list skills/mcps    - List resources
  brain search <query>      - Search
  brain show skill <name>   - Show details
  brain relationships <skill> - Show dependencies
  brain reverse-deps mcp <name> - Reverse lookup
  brain select-skills <task> - Skill recommendations
  brain select-mcps <skills> - MCP dependencies
  brain decide <scenario>   - Workflow recommendations

Architecture:
- Layer 1: Knowledge (registries + mappings) ✅
- Layer 2: Enforcement (validation + drift prevention) 🏗️ planned
- Layer 3: Decision (workflow engine + pattern matching) 🏗️ planned
- Layer 4: Management (Archon integration) 🏗️ planned

Files Added:
• scripts/brain/knowledge-layer.ts (361 lines) - Registry queries
• scripts/brain/brain-core.ts (415 lines) - Core brain class
• scripts/brain/brain.ts (473 lines) - CLI interface
• scripts/brain/DECISION-RULES.md (411 lines) - Codified logic
• scripts/brain/README.md (330 lines) - Documentation
• scripts/brain/package.json - Dependencies
• scripts/brain/tsconfig.json - TypeScript config

Testing:
✓ Successfully compiles TypeScript
✓ Loads all registries (40 skills, 36 MCPs)
✓ Validates relationships
✓ Detects missing MCPs (shows planned vs implemented)
✓ Provides accurate search results
✓ Generates workflow recommendations

Documentation:
• Updated README.md with brain section
• Created comprehensive brain/README.md
• Documented decision rules in DECISION-RULES.md
• See META/REPOSITORY-BRAIN.md for architecture

Next Phase (In Progress):
- Layer 2: Enforcement (git hooks, validation scripts, CI/CD)
- Layer 3: Advanced Decision Making (workflow engine, pattern matcher)
- Layer 4: Full Archon Integration (task orchestration)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 22:04:48 +00:00

28 lines
567 B
JSON

{
"name": "@ai-dev-standards/brain",
"version": "1.0.0",
"description": "Repository Brain - Intelligence system for ai-dev-standards",
"main": "dist/brain-core.js",
"bin": {
"brain": "./dist/brain.js"
},
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"brain": "ts-node brain.ts"
},
"keywords": [
"ai-dev",
"brain",
"intelligence",
"automation"
],
"author": "AI Dev Standards",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.0.0",
"ts-node": "^10.9.0",
"typescript": "^5.0.0"
}
}