```
╔═══════════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██████╗ ██████╗ ███╗ ██╗██╗████████╗██╗ ██████╗ ███╗ ██ ║
║ ██╔════╝██╔═══██╗██╔════╝ ████╗ ██║██║╚══██╔══╝██║██╔═══██╗ ████╗ ██ ║
║ ██║ ██║ ██║██║ ███╗██╔██╗ ██║██║ ██║ ██║██║ ██║ ██╔██╗ ██ ║
║ ██║ ██║ ██║██║ ██║██║╚██╗██║██║ ██║ ██║██║ ██║ ██║╚██╗██ ║
║ ╚██████╗╚██████╔╝╚██████╔╝██║ ╚████║██║ ██║ ██║╚██████╔╝ ██║ ╚████ ║
║ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ║
║ ║
║ S K I L L S E N G I N E v 1 . 0 ║
║ Agent-Enhanced Cognition & Token Compression System ║
╚═══════════════════════════════════════════════════════════════════════════════════╝
```
**20 Expert Cognitive Skills · 2.7× Token Compression · Chess Board Session Memory**
[](LICENSE)
[](skills/)
[](skills/core/token-compression.md)
[](https://marketplace.visualstudio.com/items?itemName=agnuxo1.cognitive-skills-engine)
[](https://codeium.com/windsurf)
[](https://cursor.com)
[](AGENTS.md)
---
## What Is This?
A system of **20 specialized `.md` skill files** that any LLM agent can load to think with **domain-expert depth** across all of science, humanities, arts, and culture — while compressing output tokens by **2.7×** through formal notation.
The system introduces a novel concept: **the Cognition Board** — a 6×4 navigation grid where each cell is a cognitive skill. The agent's path through cells becomes a **compressed session memory** in ≤12 characters.
```
Session: "Prove Nash equilibria exist in mixed strategies using fixed-point theory"
Path: D5 · A1 · A2 · B6 · D6 ← 14 chars = complete session log
Meaning: Master → Compress → Math → Economics → Output
```
> *"Plain text as code. Decision trees as circuits. The board is the memory."*
---
## The Cognition Board
```
╔═══╦══════════════╦══════════════╦══════════════╦══════════════╦══════════════╦══════════════╗
║ ║ 1 ║ 2 ║ 3 ║ 4 ║ 5 ║ 6 ║
╠═══╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╣
║ A ║ 🔵 TC ║ 🔵 MM ║ 🔵 PH ║ 🔵 CH ║ 🔵 BIO ║ 🔵 CS ║
║ ║ Token Comp. ║ Mathematician║ Physicist ║ Chemist ║ Biologist ║ CompSci ║
║ ║ ALWAYS ON ║ Erdős · Tao ║ Feynman·Dirac║ Pauling·Corey║ Darwin·Crick ║ Turing·Knuth ║
╠═══╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╣
║ B ║ 🟠 HIS ║ 🟠 PHI ║ 🟠 PSY ║ 🟠 LIN ║ 🟠 GEO ║ 🟠 ECO ║
║ ║ Historian ║ Philosopher ║ Psychologist ║ Linguist ║ Geographer ║ Economist ║
║ ║ Braudel·Bloch║ Kant·Hegel ║ Freud·Jung ║ Chomsky·Saus.║ Harvey·Tuan ║ Nash·Keynes ║
╠═══╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╣
║ C ║ 🟢 POL ║ 🟢 LAW ║ 🟢 MED ║ 🟢 AST ║ 🟢 ENG ║ 🟢 ART ║
║ ║ Pol.Scientist║ Jurist ║ Medical ║ Astronomer ║ Engineer ║ Arts ║
║ ║ Rawls·Morgen.║ Hart·Dworkin ║ Osler·Virchow║ Hubble·Hawkng║ Euler·Tesla ║ Kant·Dewey ║
╠═══╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╬══════════════╣
║ D ║ 🟣 ENV ║ 🟣 CUL ║ ⬡ SCI⊕ ║ ⬡ HUM⊕ ║ ★ [MST] ║ □ OUT ║
║ ║ Environment ║ Culture ║ Sci.Synthesis║ Hum.Synthesis║ MASTER SKILL ║ Output ║
║ ║ Carson·Wilson║ Lévi-S·Geertz║ chain A+C ║ chain B+C ║ ← START HERE ║ END HERE → ║
╚═══╩══════════════╩══════════════╩══════════════╩══════════════╩══════════════╩══════════════╝
★ Always start at D5 (Master Skill) ⊕ Synthesis cells for multi-domain tasks
```
### Navigate Like a Chess Board
Every cell has a **2-character code**. The agent picks a path based on the task. That path **IS** the session memory:
| Task | Path | Meaning |
|------|------|---------|
| Prove Riemann Hypothesis | `D5·A1·A2·D6` | Master → Compress → Math → Out |
| Quantum Chemistry | `D5·A1·A3·A4·D3·D6` | + Physics + Chemistry + SciSynth |
| French Revolution analysis | `D5·A1·B1·D6` | + History |
| Climate Policy | `D5·A1·D1·C1·D4·D6` | + Environment + Politics + HumSynth |
| Nash Equilibrium in markets | `D5·A1·A2·B6·D6` | + Math + Economics |
| Bioinformatics pipeline | `D5·A1·A5·A6·D3·D6` | + Biology + CompSci + SciSynth |
> Full session history in **≤12 characters**. The board path *is* the compressed memory.
---
## The 20 Skills
🔵 Row A — Core Science (click to expand)
| Code | Skill | Key Expertise |
|------|-------|--------------|
| **A1** · TC | **Token Compression** | ∀x→formal(x), always active, 2.3× avg output compression |
| **A2** · MM | **Mathematician Mind** | Proofs, bounds, NT, topology, Gowers norms, Ehrhart theory |
| **A3** · PH | **Physicist Mind** | QM (ĤΨ=EΨ), GR (Gᵘᵛ=8πGTᵘᵛ), QFT, thermo, Maxwell |
| **A4** · CH | **Chemist Mind** | SMILES, retrosynthesis, DFT, spectroscopy, reaction mechanisms |
| **A5** · BIO | **Biologist Mind** | CRISPR, evolution, phylogenetics, AlphaFold2, BLAST |
| **A6** · CS | **Computer Scientist Mind** | Algorithms, P/NP, ML/transformers, formal methods, crypto |
🟠 Row B — Humanities (click to expand)
| Code | Skill | Key Expertise |
|------|-------|--------------|
| **B1** · HIS | **Historian Mind** | Periodization, Annales school, causality, primary sources |
| **B2** · PHI | **Philosopher Mind** | εὐδαιμονία, Kant CI, Hegelian dialectic, Rawls veil of ignorance |
| **B3** · PSY | **Psychologist Mind** | Freud/Jung, OCEAN, CBT, dual-process theory, Kahneman biases |
| **B4** · LIN | **Linguist Mind** | IPA, X-bar syntax, Montague semantics, Gricean maxims |
| **B5** · GEO | **Geographer Mind** | GIS, spatial autocorrelation, Tobler's Law, geopolitics |
| **B6** · ECO | **Economist Mind** | Nash equilibrium, CAPM, prospect theory, IS-LM, Arrow impossibility |
🟢 Row C — Applied Disciplines (click to expand)
| Code | Skill | Key Expertise |
|------|-------|--------------|
| **C1** · POL | **Political Scientist Mind** | IR theory (realism/liberalism), comparative politics, institutions |
| **C2** · LAW | **Jurist Mind** | stare decisis, pacta sunt servanda, common/civil law, international law |
| **C3** · MED | **Medical Mind** | SOAP, DDx, evidence-based medicine, pharmacokinetics, GRADE |
| **C4** · AST | **Astronomer Mind** | H-R diagram, Hubble tension, gravitational waves, cosmological models |
| **C5** · ENG | **Engineer Mind** | FEA, control theory (PID), materials science, FMEA |
| **C6** · ART | **Arts Mind** | Aesthetics (Kant/Dewey), music theory, art history, literary theory |
🟣 Row D — Environment, Culture & Synthesis
| Code | Skill | Key Expertise |
|------|-------|--------------|
| **D1** · ENV | **Environmental Mind** | IPCC AR6, planetary boundaries, carbon cycle, biodiversity |
| **D2** · CUL | **Culture Mind** | Bourdieu habitus, Geertz thick description, semiotics, postcolonial |
| **D3** · SCI⊕ | **Science Synthesis** | Multi-science chain (A+C rows) |
| **D4** · HUM⊕ | **Humanities Synthesis** | Multi-humanities chain (B+C rows) |
| **D5** · MST | **Master Skill** ★ | Router, board navigator, dispatch table — **always start here** |
| **D6** · OUT | **Output** | Apply TC, format, deliver, log path |
---
## How It Works
```python
# The agent's cognitive loop — implemented in MASTER-SKILL.md
def think(task: str) -> Response:
path = ["D5"] # always start at Master Skill
domains = classify(task) # detect: math? physics? history? law?
path.append("A1") # ALWAYS load token compression
for domain in domains: # enter each relevant cell
path.append(DISPATCH_TABLE[domain])
if multi_domain(domains): # need synthesis?
path.append("D3" or "D4")
path.append("D6") # end at output
response = execute_path(path) # load + apply each skill
response.footer = f"PATH: {'.'.join(path)}" # log the path
return response
```
### Token Compression Law (always active)
```
∀ concept c : ∃ formal(c) → output formal(c)
```
| Verbose | Compressed | Savings |
|---------|-----------|---------|
| "for all x in S, P holds" | `∀x∈S: P(x)` | 3.5× |
| "water molecule" | `H₂O` | 3× |
| "glucose combustion" | `C₆H₁₂O₆ + 6O₂ → 6CO₂ + 6H₂O` | 1.6× |
| "O(n squared)" | `O(n²)` | 2× |
| "pH definition" | `pH = -log[H⁺]` | 5× |
| "ideal gas law" | `PV = nRT` | 4.5× |
| "Gibbs free energy" | `ΔG = ΔH - TΔS` | 3× |
| "verified" | `✓` | 5× |
*Average: **2.3×** output compression (empirical, n=10, range 1.0×–5.0×)*
---
## Installation
### Option 1 — VS Code Extension (Recommended)
Search **"Cognitive Skills Engine"** in the VS Code extensions panel, or:
```bash
code --install-extension agnuxo1.cognitive-skills-engine
```
> ✅ Works with **VS Code**, **Windsurf**, **Cursor**, and any VS Code-compatible editor.
> The extension adds a sidebar board, skill picker, auto-router, and session path tracker.
**Extension features:**
- 🗂 **Cognition Board** sidebar — visual 6×4 grid, click any cell to inject that skill
- ⚡ **Auto-Router** — select text describing your task → auto-detects domains → loads relevant skills
- 📋 **Copy to Clipboard** — paste skill context into any LLM chat (Claude, ChatGPT, Gemini…)
- 🗺 **Path Logger** — status bar shows your current session path live
- ⌨️ **Keyboard shortcuts**: `Ctrl+Shift+B` (board), `Ctrl+Shift+M` (master skill), `Ctrl+Shift+R` (auto-route)
### Option 2 — CLI
```bash
# Show the Cognition Board
npx cognitive-skills-engine board
# Inject a skill by code or symbol
npx cognitive-skills-engine inject A2
npx cognitive-skills-engine inject MM
# Auto-route a task (detects domains, loads skills)
npx cognitive-skills-engine route "prove that Nash equilibria exist"
npx cognitive-skills-engine route "analyze the causes of WWI"
# List all skills
npx cognitive-skills-engine list
# Explain a path
npx cognitive-skills-engine path "D5·A1·A2·B6·D6"
```
### Option 3 — Manual (paste into system prompt)
```bash
# Full system — paste MASTER-SKILL.md as your system prompt
cat MASTER-SKILL.md
# Single skill — paste whichever skill you need
cat skills/science/mathematician-mind.md
cat skills/humanities/philosopher-mind.md
```
### Option 4 — Agent Configuration Files
The repo includes config files for **40+ AI agents and IDEs**:
| File | Platform |
|------|---------|
| `AGENTS.md` | All agents (universal) |
| `CLAUDE.md` | Claude Code |
| `GEMINI.md` | Gemini CLI |
| `.cursor/` | Cursor IDE |
| `.windsurf/` | Windsurf IDE |
| `.clinerules/` | Cline extension |
---
## Architecture
```
Token-compression-system-for-improving-agent-cognition/
│
├── MASTER-SKILL.md ← Router + Cognition Board (START HERE)
├── BOARD.md ← Board reference card + 30 path examples
├── README.md
├── AGENTS.md ← Universal agent configuration
├── CLAUDE.md ← Claude Code specific
├── GEMINI.md ← Gemini CLI specific
│
├── skills/
│ ├── INDEX.md ← Quick index of all 20 skills
│ ├── core/
│ │ └── token-compression.md [A1] — ALWAYS ACTIVE
│ ├── science/
│ │ ├── mathematician-mind.md [A2]
│ │ ├── physicist-mind.md [A3]
│ │ ├── chemist-mind.md [A4]
│ │ ├── biologist-mind.md [A5]
│ │ ├── computer-scientist-mind.md [A6]
│ │ ├── medical-mind.md [C3]
│ │ ├── astronomer-mind.md [C4]
│ │ └── engineer-mind.md [C5]
│ ├── humanities/
│ │ ├── historian-mind.md [B1]
│ │ ├── philosopher-mind.md [B2]
│ │ ├── psychologist-mind.md [B3]
│ │ ├── linguist-mind.md [B4]
│ │ ├── geographer-mind.md [B5]
│ │ ├── economist-mind.md [B6]
│ │ ├── political-scientist-mind.md [C1]
│ │ └── jurist-mind.md [C2]
│ └── arts-culture/
│ ├── arts-mind.md [C6]
│ ├── environmental-mind.md [D1]
│ └── culture-mind.md [D2]
│
├── src/ ← VS Code extension (TypeScript)
│ ├── extension.ts ← Main activation, commands, auto-router
│ ├── boardView.ts ← Interactive board webview
│ └── skillLoader.ts ← Skill file resolver
│
├── cli/
│ └── index.js ← CLI tool (npx cognitive-skills-engine)
│
├── package.json ← VS Code extension manifest
├── tsconfig.json
└── .github/
└── workflows/
└── publish.yml ← Auto-publish to Marketplace on tag push
```
---
## Design Principles
> *"Plain text is the program. The decision tree is the circuit. The path is the memory."*
1. **Plain text as code** — `.md` files are the executable. No runtime dependencies for the skills themselves.
2. **Two token budgets** — thinking: *free CoT* (never compress); output: *compress aggressively* (Wei et al. 2022)
3. **Never compute mentally** — all deterministic computation routed to tools (PARI/GP, NumPy, Z3, etc.)
4. **Path = memory** — board navigation path encodes full session in ≤12 characters
5. **Cite or flag** — every theorem/law cited, or marked `[CITATION_NEEDED]`
6. **Cross-domain synthesis** — synthesis cells (D3, D4) enable interdisciplinary breakthroughs via shared invariants
---
## Performance
| Metric | Value |
|--------|-------|
| Token compression (measured avg) | **2.7×** |
| Token compression (range) | 1.0×–5.0× |
| Session memory encoding | **≤12 characters** |
| Domains covered | **20** |
| Supported agents | **40+** |
| Supported IDEs | VS Code · Windsurf · Cursor · VSCodium · CLI |
---
## Publishing the Extension
```bash
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Package as .vsix
npx vsce package
# Publish to VS Code Marketplace (needs VSCE_PAT)
npx vsce publish
# Publish to Open VSX (Windsurf / Cursor)
npx ovsx publish *.vsix
# Or: push a git tag → GitHub Actions handles everything
git tag v1.0.0 && git push --tags
```
---
## Related Work
| Project | Relationship |
|---------|-------------|
| [King-Skill Extended Cognition Architecture](https://github.com/Agnuxo1/King-Skill-Extended-Cognition-Architecture-for-Scientific-LLM-Agents) | Upstream scientific routing system |
| [Caveman](https://github.com/Agnuxo1/caveman) | Token compression plugin (compression layer) |
This system **extends** both: King-Skill's routing architecture is generalized to all domains (not just science), Caveman's compression is formalized as the always-active `A1` cell, and a new **board navigation + path memory** system ties everything together.
---
## License
Apache 2.0 © **Francisco Angulo de Lafuente** ([@Agnuxo1](https://github.com/Agnuxo1))
---
```
D5 · A1 · [your domain] · D6
```
*Start at Master. Compress everything. Navigate the board. Log the path.*
**[⭐ Star this repo](https://github.com/Agnuxo1/Token-compression-system-for-improving-agent-cognition) · [📋 Open an Issue](https://github.com/Agnuxo1/Token-compression-system-for-improving-agent-cognition/issues) · [🔧 Contributing](AGENTS.md)**