agentic-stack-portable-brain
```markdown
What this skill does
```markdown
---
name: agentic-stack-portable-brain
description: Portable .agent/ folder (memory + skills + protocols) that plugs into Claude Code, Cursor, Windsurf, OpenCode, OpenClaw, Hermes, Pi, or DIY Python and keeps knowledge across harness switches.
triggers:
- set up agentic stack for this project
- install portable agent brain
- add agent memory to my project
- configure claude code with agentic stack
- switch my agent to a different harness
- set up persistent agent memory and skills
- run the dream cycle for agent lessons
- graduate or reject agent candidate lessons
---
# agentic-stack-portable-brain
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
## What agentic-stack does
`agentic-stack` gives any AI coding agent a **portable brain**: a `.agent/` folder containing four memory layers, a progressive-disclosure skill system, enforced permissions, and adapters for eight harnesses. When you switch from Claude Code to Cursor (or any other supported harness), the agent's accumulated knowledge travels with the project — no re-learning, no lost lessons.
### Core concepts
| Concept | Description |
|---|---|
| **Memory layers** | `working/` (session), `episodic/` (action log), `semantic/` (graduated lessons), `personal/` (preferences) |
| **Skills** | Markdown files with trigger matching; manifest always loads, full `SKILL.md` only when relevant |
| **Protocols** | Typed tool schemas, `permissions.md`, delegation contracts |
| **Review protocol** | `auto_dream.py` stages candidates mechanically; host agent reviews with CLI tools |
| **Harness adapters** | Thin shims per tool (CLAUDE.md, .windsurfrules, AGENTS.md, etc.) |
---
## Installation
### macOS / Linux (Homebrew)
```bash
brew tap codejunkie99/agentic-stack https://github.com/codejunkie99/agentic-stack
brew install agentic-stack
cd your-project
agentic-stack claude-code # or: cursor | windsurf | opencode | openclaw | hermes | pi | standalone-python
```
### Windows (PowerShell)
```powershell
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
.\install.ps1 claude-code C:\path\to\your-project
```
### Clone and install manually
```bash
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
# macOS / Linux / Git Bash
./install.sh claude-code /path/to/your-project
# Windows PowerShell
.\install.ps1 claude-code C:\path\to\your-project
```
### Supported harness names
```
claude-code | cursor | windsurf | opencode | openclaw | hermes | pi | standalone-python
```
### Upgrade
```bash
brew update && brew upgrade agentic-stack
```
---
## Onboarding wizard
The wizard runs automatically after adapter installation and writes:
- `.agent/memory/personal/PREFERENCES.md` — first file the AI reads each session
- `.agent/memory/.features.json` — feature toggles
```bash
# accept all defaults silently (CI / scripted environments)
agentic-stack claude-code --yes
# re-run wizard on an existing project
agentic-stack claude-code --reconfigure
```
### Wizard questions
| Question | Default |
|---|---|
| What should I call you? | *(skip)* |
| Primary language(s)? | `unspecified` |
| Explanation style? | `concise` |
| Test strategy? | `test-after` |
| Commit message style? | `conventional commits` |
| Code review depth? | `critical issues only` |
### Manual preference editing
```bash
# Edit preferences any time
$EDITOR .agent/memory/personal/PREFERENCES.md
# Toggle features
$EDITOR .agent/memory/.features.json
```
`.features.json` example:
```json
{
"fts_memory_search": false
}
```
---
## Key CLI commands
### Review protocol (host-agent tools)
```bash
# List pending candidate lessons, sorted by priority
python3 .agent/tools/list_candidates.py
# Accept a candidate (--rationale required — rubber-stamping is structurally impossible)
python3 .agent/tools/graduate.py <id> --rationale "evidence holds, matches PREFERENCES"
# Reject a candidate (--reason required; decision history preserved)
python3 .agent/tools/reject.py <id> --reason "too specific to this repo to generalize"
# Requeue a previously-rejected candidate
python3 .agent/tools/reopen.py <id>
```
### Memory search [BETA]
```bash
# Enable during onboarding or toggle manually in .features.json, then:
python3 .agent/memory/memory_search.py "deploy failure"
python3 .agent/memory/memory_search.py --status
python3 .agent/memory/memory_search.py --rebuild
```
Falls back to `ripgrep` → `grep` when FTS5 index is not enabled. Index stored at `.agent/memory/.index/` (gitignored).
### Nightly staging cycle (cron)
```bash
# Add to crontab: runs at 03:00 daily, safe to run unattended
crontab -e
# Paste:
0 3 * * * python3 /absolute/path/to/project/.agent/memory/auto_dream.py >> /absolute/path/to/project/.agent/memory/dream.log 2>&1
```
`auto_dream.py` only does mechanical work: cluster, stage, prefilter, decay. No git commits, no network calls, no LLM reasoning.
---
## Repository layout
```
.agent/
├── AGENTS.md # the map every harness reads
├── harness/ # conductor + hooks (standalone path)
├── memory/
│ ├── working/ # session-scoped scratch
│ ├── episodic/ # action log (all skill events)
│ ├── semantic/
│ │ ├── lessons.jsonl # source of truth for graduated lessons
│ │ └── LESSONS.md # rendered from lessons.jsonl
│ ├── personal/
│ │ └── PREFERENCES.md # loaded first every session
│ ├── auto_dream.py # nightly staging cycle
│ ├── cluster.py # Jaccard single-linkage clustering
│ ├── promote.py # stage candidates
│ ├── validate.py # heuristic prefilter
│ ├── review_state.py # candidate lifecycle + decision log
│ ├── render_lessons.py # lessons.jsonl → LESSONS.md
│ └── memory_search.py # [BETA] FTS5 search
├── skills/
│ ├── _index.md # always-loaded lightweight manifest
│ ├── _manifest.jsonl # trigger → skill mapping
│ └── *.SKILL.md # full skill files (lazy-loaded)
├── protocols/
│ ├── permissions.md # enforced by pre-tool-call hook
│ ├── tool-schemas/ # typed schemas per tool
│ └── delegation.md # sub-agent contract
└── tools/
├── list_candidates.py
├── graduate.py
├── reject.py
├── reopen.py
├── memory_reflect.py
└── skill_loader.py
adapters/
├── claude-code/ # CLAUDE.md + .claude/settings.json (PostToolUse, Stop hooks)
├── cursor/ # .cursor/rules/*.mdc
├── windsurf/ # .windsurfrules
├── opencode/ # AGENTS.md + opencode.json
├── openclaw/ # .openclaw-system.md
├── hermes/ # AGENTS.md
├── pi/ # AGENTS.md + .pi/skills symlink → .agent/skills
└── standalone-python/ # run.py DIY conductor
```
---
## Seed skills (shipped with every install)
| Skill | Purpose |
|---|---|
| `skillforge` | Creates new skills from recurring patterns |
| `memory-manager` | Runs reflection cycles, surfaces candidate lessons |
| `git-proxy` | All git ops with safety constraints |
| `debug-investigator` | Reproduce → isolate → hypothesize → verify loop |
| `deploy-checklist` | Gate between staging and production |
---
## Code examples
### Python: running the staging cycle programmatically
```python
import subprocess
import sys
from pathlib import Path
def run_dream_cycle(project_root: str) -> None:
dream_script = Path(project_root) / ".agent" / "memory" / "auto_dream.py"
log_path = Path(project_root) / ".agent" / "memory" / "dream.log"
if not dream_script.exists():
raise FileNotFoundError(f"auto_dream.py not found at {dream_script}")
with log_path.open("a") as log_file:
result = subprocess.run(
[sys.executable, str(dream_script)],
stdout=log_file,
stderr=log_file,
cwd=project_root,
)
if result.returncode != 0:
print(f"Dream cycle exited wRelated in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.