A production-ready technology expert agent framework for Claude Code (Opus 4.6). Build specialized AI assistants with domain knowledge, cross-session memory, and procedural skills.
- What It Is and Why Use It
- Quick Start
- System Architecture
- Technology Experts
- Skills System
- Memory System
- Hooks System
- Creating Your Own Expert
- Adapting to Your Project
Claude Code is a powerful tool, but:
- It doesn't know your project's technology specifics
- It doesn't remember context between sessions
- It lacks structure for complex, multi-step tasks
- It may guess instead of checking documentation
This template introduces a system of technology experts - specialized agents with:
- Domain Knowledge - each expert knows their technology deeply
- Cross-Session Memory - learnings, decisions, and preferences persist
- Procedural Skills - step-by-step workflows for complex tasks
- Automation Hooks - safety validators and session initialization
Skills = HOW to do things (procedures, workflows)
Agents = WHO does the work (technology expertise)
v4.2 Key Changes:
- No orchestrator - Claude Code handles routing natively
- 2 example experts - Security + Testing as templates (add your own)
- 3 procedural skills - Session init, documentation, git commits
- Memory system - Cross-session persistence with co-modification tracking
- Python hooks - Zero-dependency automation with automatic cleanup
- Opus 4.6 alignment - Simplified protocols, correct SDK format
# Clone the repository
git clone https://github.com/tbartel74/vigil-code.git
cd vigil-code
# Copy to your project
cp -r .claude /path/to/your/project/
# Optional: copy CLAUDE.md as template
cp CLAUDE.md /path/to/your/project/your-project/
βββ .claude/
β βββ agents/ # 2 example experts (add your own)
β βββ skills/ # 3 procedural skills
β βββ commands/ # Slash commands
β βββ hooks/ # Automation hooks
β βββ memory/ # Cross-session persistence
β βββ lib/ # Shared libraries
β βββ state/ # Session state (gitignore)
βββ CLAUDE.md # Your project instructions
βββ [rest of project]
/expert How do I configure rate limiting?
Invoking: security-expert
Use a rate limiting middleware with sliding window...
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TECHNOLOGY EXPERTS (2 examples) β
β β
β ββββββββββββββ ββββββββββββββ β
β β Security β β Testing β + add your own experts β
β β β β β β
β ββββββββββββββ ββββββββββββββ β
β β β
β βΌ β
β βββββββββββββββββββββββββββββββββ β
β β Context System β β
β β - memory/learnings.json β β
β β - memory/decisions.json β β
β β - memory/preferences.json β β
β βββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Component | Location | Description |
|---|---|---|
| Agents | .claude/agents/*/AGENT.md |
Technology experts with domain knowledge |
| Skills | .claude/skills/*/SKILL.md |
Procedural workflows and procedures |
| Commands | .claude/commands/*.md |
Slash commands (/expert, /test) |
| Hooks | .claude/hooks/ |
Automation (session init, safety guards) |
| Memory | .claude/memory/ |
Cross-session persistence |
Each expert is a .claude/agents/[name]/AGENT.md file with YAML frontmatter + Markdown content.
| Expert | Primary Focus | Use For |
|---|---|---|
security-expert |
Application Security | OWASP, vulnerabilities, audits, auth |
testing-expert |
Testing | Vitest, TDD workflow, fixtures, mocking, E2E |
These are provided as templates. Add your own experts for any technology your project uses (e.g., database, messaging, DevOps, frontend frameworks).
Single Expert:
/expert How do I configure rate limiting?
β security-expert responds
Force Specific Expert:
/expert [security] Review this authentication flow
/expert [testing] Create test for input validation
---
name: your-expert
description: |
Expert in [technology] for your project.
Deep knowledge of [specific areas].
tools:
- Read
- Edit
- Glob
- Grep
- Write
- Bash
- Task
- WebFetch
---
# Your Expert
Expert in [technology] for your project.
## Core Knowledge
[Technology fundamentals]
## Common Procedures
[Step-by-step procedures]
## Key Files
[Project-specific references]
## Critical Rules
[Do's and Don'ts]Skills are procedural workflows that guide Claude through multi-step tasks.
| Skill | Purpose |
|---|---|
session-initializer |
Auto-load context on session start |
documentation-specialist |
README, API docs, changelogs |
git-commit-helper |
Conventional commits, no AI attribution |
| Aspect | Agent | Skill |
|---|---|---|
| Focus | Technology expertise | Procedure/workflow |
| Knowledge | Deep domain knowledge | Step-by-step instructions |
| Invocation | /expert [query] |
/skill [name] |
| Example | "How to configure auth?" | "Run TDD workflow" |
Cross-session persistence in .claude/memory/:
memory/
βββ learnings.json # Lessons learned (patterns, gotchas)
βββ decisions.json # Architectural decisions
βββ preferences.json # User preferences
βββ co-modifications.json # File pairs frequently edited together
- SessionStart - Hook loads recent learnings + cleans old caches
- During Session - Use
/rememberto save learnings - Stop - Hook persists new learnings to storage
- Stop - Hook tracks files frequently edited together
/remember learning Always use parameterized queries for the database
/remember decision Use message queue for inter-service communication
/remember preference Prefer explicit error handling over try-catch
{
"entries": [
{
"lesson": "Always use parameterized queries for the database",
"category": "database",
"timestamp": "2026-02-01T10:00:00Z"
}
]
}Python-based automation hooks in .claude/hooks/:
| Hook | Event | Purpose |
|---|---|---|
session-init.sh |
SessionStart | Load context, clean old caches (7d tsc-cache, 30d audit logs) |
safety-validator.py |
PreToolUse | Block dangerous commands |
audit-logger.py |
All events | Audit trail in JSONL format |
auto-format.sh |
PostToolUse | Format files after Write/Edit |
doc-update-reminder.py |
PostToolUse | Suggest doc updates after code changes |
post-tool-use-tracker.py |
PostToolUse | Track modified files for TSC |
memory-writer.py |
Stop | Persist learnings |
co-modification-tracker.py |
Stop | Track files frequently edited together |
tsc-check.sh |
Stop | TypeScript build check |
self-check-reminder.sh |
Stop | Risky pattern analysis |
notification-sound.sh |
Stop | Completion notification |
pre-compact-flush.sh |
PreCompact | Flush learnings before compression |
Blocks dangerous patterns:
BLOCKED_PATTERNS = [
r'rm\s+-rf\s+/', # rm -rf with absolute path
r'git\s+push.*--force', # Force push
]mkdir -p .claude/agents/terraform-expert---
name: terraform-expert
description: |
Terraform and Infrastructure as Code expert.
Deep knowledge of providers, modules, state management.
tools:
- Read
- Edit
- Glob
- Grep
- Write
- Bash
- Task
- WebFetch
---
# Terraform Expert
Expert in Terraform and Infrastructure as Code.
## Core Knowledge
### Resource Definition
\`\`\`hcl
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
\`\`\`
### Common Commands
\`\`\`bash
terraform init # Initialize
terraform plan # Preview changes
terraform apply # Apply changes
\`\`\`
## Documentation Sources
| Source | URL |
|--------|-----|
| Terraform Docs | https://developer.hashicorp.com/terraform/docs |
## Critical Rules
- Always use remote state in production
- Never commit .tfstate files to git
- Use variables for sensitive dataThe system reads triggers from description and routes appropriate queries.
cp -r vigil-code/.claude /your/project/Create experts for technologies your project uses:
mkdir -p .claude/agents/my-database-expert
# Create AGENT.md with domain knowledgeAdd or remove skills as needed:
# Add your own
mkdir .claude/skills/my-workflow
# Create SKILL.md with proceduresUse the template in CLAUDE.md and customize for your project.
# Agent state (runtime)
.claude/state/
.claude/settings.local.json
.claude/audit_logs/
.claude/tsc-cache/| File | Description |
|---|---|
| .claude/README.md | Agent system documentation |
| CLAUDE.md | Project template |
MIT License - See LICENSE file.
Copyright (c) 2025-2026 Tomasz Bartel
Status: Production Ready Version: 4.2.0 Based on: Anthropic Context Engineering Best Practices (2025-2026) Last Updated: 2026-02-10