Capy cortex
Skill ComeOnOliver/skillshub/skills/happycapy-ai/Happycapy-skills/capy-cortex
Autonomous learning system - learns from mistakes, reflects on sessions, and gets smarter over time. The AI brain.From its SKILL.md
npx -y skills add ComeOnOliver/skillshub --skill capy-cortexAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
2.3 KB, 549 tokens by cl100k_base, as published. Nobody here has run it
Capy Cortex - Autonomous Learning System
You have a persistent learning brain powered by SQLite + FTS5 + sklearn TF-IDF. Knowledge is automatically loaded via hooks. This file describes manual operations.
Architecture
- Database:
~/.claude/skills/capy-cortex/cortex.db(SQLite + FTS5 + WAL) - Hooks (automatic, never call manually):
- SessionStart: Loads anti-patterns, preferences, principles
- UserPromptSubmit: Retrieves task-relevant rules via FTS5
- PreToolUse(Bash): Blocks known dangerous commands
- PostToolUseFailure: Records errors as anti-patterns
- Stop: Extracts corrections and preferences from conversation
- Scripts (for manual/scheduled use):
cortex.py: Core engine (retrieve, add rules, stats)reflect.py: Deep session analysisconsolidate.py: Cluster rules into principles (sklearn)bootstrap.py: Mine historical sessions
Manual Commands
# Check system health
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py stats
# Retrieve rules for a topic
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrieve "react typescript"
# Add a rule manually
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-rule "Always use TypeScript strict mode" "best_practice"
# Add an anti-pattern
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-ap "Never force push to main" "critical"
# Add a preference
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py add-pref "User prefers functional components over class components"
# Run consolidation (clusters rules into principles)
python3 ~/.claude/skills/capy-cortex/scripts/consolidate.py
# Retrain TF-IDF model
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py retrain
# Apply confidence decay
python3 ~/.claude/skills/capy-cortex/scripts/cortex.py decay
How It Learns
- Automatic (via hooks): Errors are captured, corrections noted, preferences extracted
- Reflection: Deep analysis of session transcripts extracts patterns
- Consolidation: sklearn clustering groups similar rules into principles
- Decay: Old, unreinforced rules fade; validated rules strengthen
- Retrieval: Two-stage FTS5 + TF-IDF returns only relevant knowledge (O(1) context)
What ships with it
332.7 KB alongside SKILL.md, 30 of them executable
GitHub clipped this repository’s file list, so this is at least 65 files and may be more.
dashboard/
- eslint.config.jsruns616 B
- .gitignore253 B
- index.html636 B
- package.json960 B
- public/favicon.svg9.3 KB
- public/icons.svg4.9 KB
- README.md2.4 KB
- src/App.tsx4.7 KB
- src/assets/hero.png43.9 KB
- src/assets/react.svg4.0 KB
- src/assets/vite.svg8.5 KB
- src/components/charts/CategoryDonut.tsx2.2 KB
- src/components/charts/ConfidenceBar.tsx1.6 KB
- src/components/charts/EventsTimeline.tsx1.8 KB
- src/components/charts/HealthGauge.tsx1.7 KB
- src/components/charts/SeverityBreakdown.tsx1.7 KB
- src/components/layout/Footer.tsx896 B
- src/components/layout/Header.tsx3.0 KB
- src/components/metrics/MetricCard.tsx1.3 KB
- src/components/metrics/MetricsGrid.tsx1.1 KB
- src/components/shared/StatusBadge.tsx709 B
- src/components/tables/AntiPatternsPanel.tsx1.7 KB
- src/components/tables/DiaryPanel.tsx1.2 KB
- src/components/tables/EventsFeed.tsx2.3 KB
- src/components/tables/PreferencesPanel.tsx1.1 KB
- src/components/tables/PrinciplesPanel.tsx1.5 KB
- src/components/tables/RulesPanel.tsx1.7 KB
- src/hooks/useAnimatedValue.tsruns923 B
- src/lib/api.tsruns445 B
- src/lib/types.tsruns1.1 KB
- src/lib/utils.tsruns1.4 KB
- src/main.tsx529 B
- src/styles/globals.css1.8 KB
- tsconfig.app.json732 B
- tsconfig.json119 B
- tsconfig.node.json653 B
- vite.config.tsruns384 B
embeddings/
- ids.json1.6 KB
- dashboard.pyruns6.8 KB
- .gitignore277 B
25 more files not listed here. See all 65 in the repository.