Skip to content

Add Claude and OpenCode Cognitive Infrastructure with Knowledge Packs#5

Open
stephanchenette wants to merge 5 commits intoRunMaestro:mainfrom
stephanchenette:add-claude-cognitive-infrastructure
Open

Add Claude and OpenCode Cognitive Infrastructure with Knowledge Packs#5
stephanchenette wants to merge 5 commits intoRunMaestro:mainfrom
stephanchenette:add-claude-cognitive-infrastructure

Conversation

@stephanchenette
Copy link

@stephanchenette stephanchenette commented Jan 4, 2026

Summary

This PR adds comprehensive cognitive infrastructure setup playbooks for both Claude Code and OpenCode AI coding assistants, along with knowledge packs for extending agent capabilities.

What's Included

Claude Cognitive Infrastructure (Setup/Claude-Cognitive-Infrastructure/)

  • Hook System with 10-tier security validation
  • Memory System (three-tier: hot/warm/cold)
  • Skills Framework with USE WHEN activation
  • Complete 6-phase playbook (0_INITIALIZE through 5_VERIFY)
  • Knowledge Pack: Codebase-Expert for RAG-powered code understanding

OpenCode Cognitive Infrastructure (Setup/OpenCode-Cognitive-Infrastructure/)

  • Plugin System (TypeScript-based event handling)
  • Memory System (three-tier architecture)
  • Skills Framework (lowercase naming convention per OpenCode spec)
  • Complete 6-phase playbook
  • Knowledge Pack: codebase-expert for RAG-powered code understanding

Structure

Setup/
├── Claude-Cognitive-Infrastructure/
│   ├── 0_INITIALIZE.md ... 5_VERIFY.md
│   ├── README.md
│   ├── assets/
│   └── Knowledge-Packs/
│       └── Codebase-Expert/
└── OpenCode-Cognitive-Infrastructure/
    ├── 0_INITIALIZE.md ... 5_VERIFY.md
    ├── README.md
    └── Knowledge-Packs/
        └── codebase-expert/

Key Features

Feature Claude OpenCode
Config Directory .claude/ .opencode/
Identity File CLAUDE.md AGENTS.md
Hooks/Plugins Shell commands TypeScript plugins
Skill Naming TitleCase lowercase-with-hyphens
Security 10-tier validator 10-tier validator

Test plan

  • Run Claude playbook on test agent directory
  • Run OpenCode playbook on test agent directory
  • Verify all directories and files created correctly
  • Test hook/plugin functionality
  • Verify skill discovery works

🤖 Generated with Claude Code

Adds two new playbooks to the Setup category:

1. Claude Cognitive Infrastructure - Deploys the complete .claude/ directory
   structure enabling persistent memory, modular skills, context management,
   and event-driven hooks for any Claude-based agent.

2. Codebase Expert Knowledge Pack - Installs RAG-powered code understanding
   with semantic search across the codebase.

Also includes shared Knowledge Pack utilities (_Core) for embeddings,
vector storage, and RAG retrieval hooks.

Inspired by Daniel Miessler's Personal AI Infrastructure project:
https://github.com/danielmiessler/Personal_AI_Infrastructure

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@pedramamini
Copy link
Collaborator

Review Feedback

@stephanchenette - Great contribution! The playbooks are well-structured and the documentation is thorough. A few suggestions to consider before merging:

Key Items

  1. Placeholder embedding implementation - The _Core/lib/embeddings.ts returns random values as a placeholder. The README should clarify that users need to configure an actual embedding provider (OpenAI, local models, etc.) for the Codebase Expert pack to function.

  2. Hook registration mechanism - The RAG hook (rag-retrieval.ts) is written but there's no mechanism in Claude Code to actually execute these hooks. Could you clarify: is the intent that users manually integrate these, or is there a planned hook execution system?

  3. Skill activation documentation - The SKILL.md frontmatter assumes a trigger-based activation system (triggers: [identity, who are you]). It would help to document:

    • How skills get activated (manual/automatic?)
    • What consumes the context_budget field
    • Whether this integrates with Claude Code's existing systems
  4. Gitignore guidance - Should users commit .claude/context/memory/? These files may contain sensitive session data. Consider adding a note about this.

Minor Suggestions

  • Add migration guidance for future version upgrades (VERSION file starts at 1.1.0)
  • Consider adding a JSON schema for settings.json validation
  • The manual "Generate embeddings" step in 4_IMPLEMENT.md needs an actual embedding provider to work

Overall

This is solid work that adds real value. The main gap is clarifying what's automated vs. what requires user configuration. Happy to approve once the documentation addresses the embedding provider requirement and skill/hook activation mechanisms.

Stephan Chenette and others added 4 commits January 9, 2026 19:12
- Clarify embedding provider requirement in _Core/README.md
- Add prominent warnings in embeddings.ts that it's a placeholder
- Document hook execution mechanisms (manual, MCP, wrapper script)
- Explain skill activation system (triggers, context_budget, manual vs future auto)
- Add gitignore guidance for .claude/context/memory/ files
- Add version migration documentation
- Add JSON schema for settings.json validation
- Update 4_IMPLEMENT.md with embedding provider setup instructions
- Add troubleshooting section for common issues

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Move non-markdown files to assets/ subfolders as documented
- Claude-Cognitive-Infrastructure: Move settings.schema.json to assets/
- Codebase-Expert: Move lib/*.ts, hooks/*.ts, templates/ to assets/
- Remove _Core shared folder (assets bundled per playbook now)
- Update playbook docs to use {{AUTORUN_FOLDER}}/assets/ paths
- Document assets in README files
- Merge latest main (Mobile-Polish, markdownlint config)

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Expanded 4_IMPLEMENT.md from ~280 lines to ~970 lines
- Added Part 2: Hook System with 5 TypeScript hooks:
  - security-validator.ts (10-tier attack pattern blocking)
  - initialize-session.ts (SessionStart handler)
  - load-core-context.ts (CORE skill loader)
  - event-logger.ts (PostToolUse logger)
  - session-summary.ts (Stop handler)
- Added Part 3: Memory System with three-tier architecture:
  - CAPTURE (hot) - Work/
  - SYNTHESIS (warm) - Learning/
  - APPLICATION (cold) - sessions/, etc.
- Added Part 4: Skills System with:
  - CORE skill with USE WHEN activation
  - SYSTEM/ documentation directory
  - USER/ personal configuration
  - CreateSkill skill for generating new skills
- Updated README with comprehensive feature documentation

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changes:
- Move Knowledge-Packs inside Claude-Cognitive-Infrastructure
  (Knowledge packs are Claude-specific, not independent)
- Add OpenCode-Cognitive-Infrastructure playbook with:
  - Plugin system (TypeScript plugins vs shell hooks)
  - Memory system (three-tier architecture)
  - Skills system (lowercase naming convention)
  - Full documentation
- Add codebase-expert knowledge pack for OpenCode
  (adapted from Claude's Codebase-Expert pack)

Structure:
- Setup/Claude-Cognitive-Infrastructure/
  - Knowledge-Packs/Codebase-Expert/
- Setup/OpenCode-Cognitive-Infrastructure/
  - Knowledge-Packs/codebase-expert/

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@stephanchenette stephanchenette changed the title Add Claude Cognitive Infrastructure and Knowledge Packs setup playbooks Add Claude and OpenCode Cognitive Infrastructure with Knowledge Packs Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants