agentic-stack-portable-agent-memory
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseagentic-stack-portable-agent-memory
agentic-stack-portable-agent-memory
What It Does
功能介绍
agentic-stack creates a portable folder that maintains memory, skills, and protocols across different AI coding harnesses (Claude Code, Cursor, Windsurf, OpenCode, OpenClaw, Copilot CLI, Gemini, Hermes, Pi, Codex, Antigravity). When you switch tools, your agent keeps its knowledge, preferences, and accumulated context.
.agent/It includes:
- Memory layers: personal, semantic, episodic, working memory
- Skills system: reusable capabilities with manifest tracking
- Data layer: monitor harness activity, token/cost estimates, KPI summaries
- Data flywheel: turn approved runs into training artifacts
- Brain integration: optional git-backed long-term memory
- Harness manager: TUI for managing multiple adapters simultaneously
agentic-stack 创建一个可移植的文件夹,在不同AI编码工具(Claude Code、Cursor、Windsurf、OpenCode、OpenClaw、Copilot CLI、Gemini、Hermes、Pi、Codex、Antigravity)之间维护记忆、技能和协议。当你切换工具时,你的Agent会保留其知识、偏好和积累的上下文。
.agent/它包含以下组件:
- 记忆层:个人记忆、语义记忆、情景记忆、工作记忆
- 技能系统:可复用能力及清单追踪
- 数据层:监控工具活动、token/成本估算、KPI汇总
- 数据飞轮:将已批准的运行记录转化为训练工件
- Brain集成:可选的基于Git的长期记忆
- 工具管理器:用于同时管理多个适配器的TUI
Installation
安装方法
macOS / Linux
macOS / Linux
bash
undefinedbash
undefinedTap and install (both lines required)
点击并安装(两行都需要执行)
brew tap codejunkie99/agentic-stack https://github.com/codejunkie99/agentic-stack
brew install agentic-stack
brew tap codejunkie99/agentic-stack https://github.com/codejunkie99/agentic-stack
brew install agentic-stack
Install into your project
安装到你的项目中
cd your-project
agentic-stack claude-code
undefinedcd your-project
agentic-stack claude-code
undefinedWindows (PowerShell)
Windows(PowerShell)
powershell
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
.\install.ps1 claude-code C:\path\to\your-projectpowershell
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
.\install.ps1 claude-code C:\path\to\your-projectClone Method
克隆安装法
bash
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
./install.sh claude-codebash
git clone https://github.com/codejunkie99/agentic-stack.git
cd agentic-stack
./install.sh claude-codeUpgrade Existing Installation
升级现有安装
bash
brew update && brew upgrade agentic-stack
cd your-project
agentic-stack upgrade --dry-run
agentic-stack upgrade --yesbash
brew update && brew upgrade agentic-stack
cd your-project
agentic-stack upgrade --dry-run
agentic-stack upgrade --yesAvailable Adapters
可用适配器
- - Anthropic Claude Code
claude-code - - Cursor IDE
cursor - - Windsurf
windsurf - - OpenCode
opencode - - OpenClaw
openclaw - - GitHub Copilot CLI
copilot-cli - - Google Gemini CLI
gemini - - Hermes
hermes - - Pi Coding Agent
pi - - Codex
codex - - DIY Python loop
standalone-python - - Antigravity
antigravity
- - Anthropic Claude Code
claude-code - - Cursor IDE
cursor - - Windsurf
windsurf - - OpenCode
opencode - - OpenClaw
openclaw - - GitHub Copilot CLI
copilot-cli - - Google Gemini CLI
gemini - - Hermes
hermes - - Pi Coding Agent
pi - - Codex
codex - - DIY Python循环
standalone-python - - Antigravity
antigravity
Key Commands
核心命令
Project Management
项目管理
bash
undefinedbash
undefinedInteractive dashboard
交互式仪表盘
agentic-stack dashboard
agentic-stack dashboard
Web-based mission control (beta)
基于Web的任务控制(测试版)
agentic-stack mission-control
agentic-stack mission-control
Check adapter status
检查适配器状态
agentic-stack status
agentic-stack status
Audit installation health
检查安装健康状况
agentic-stack doctor
agentic-stack doctor
Interactive adapter manager
交互式适配器管理器
agentic-stack manage
agentic-stack manage
Add additional adapter
添加额外适配器
agentic-stack add cursor
agentic-stack add cursor
Remove adapter
移除适配器
agentic-stack remove cursor
undefinedagentic-stack remove cursor
undefinedUpgrade & Sync
升级与同步
bash
undefinedbash
undefinedPreview infrastructure updates
预览基础设施更新
agentic-stack upgrade --dry-run
agentic-stack upgrade --dry-run
Apply updates (preserves memory and custom skills)
应用更新(保留记忆和自定义技能)
agentic-stack upgrade --yes
agentic-stack upgrade --yes
Rebuild skill manifest
重建技能清单
agentic-stack sync-manifest
undefinedagentic-stack sync-manifest
undefinedBrain Integration (Optional)
Brain集成(可选)
bash
undefinedbash
undefinedInstall Brain CLI
安装Brain CLI
brew install codejunkie99/tap/brain
brew install codejunkie99/tap/brain
Check Brain status
检查Brain状态
agentic-stack brain status
agentic-stack brain status
Onboard project to Brain
将项目接入Brain
agentic-stack brain onboard --agents codex,cursor --yes
agentic-stack brain onboard --agents codex,cursor --yes
Query Brain memory
查询Brain记忆
agentic-stack brain ask "auth decisions"
agentic-stack brain ask "auth decisions"
Write to Brain memory
写入Brain记忆
agentic-stack brain note "Use PKCE for local OAuth flows."
agentic-stack brain note "Use PKCE for local OAuth flows."
Get MCP command
获取MCP命令
agentic-stack brain mcp-command
undefinedagentic-stack brain mcp-command
undefinedMemory Transfer
记忆迁移
bash
undefinedbash
undefinedExport/import memory between projects
在项目间导出/导入记忆
agentic-stack transfer
undefinedagentic-stack transfer
undefinedProject Structure
项目结构
After installation, your project will have:
.agent/
├── memory/
│ ├── personal/PREFERENCES.md # User preferences (read first)
│ ├── semantic/ # Conceptual knowledge
│ ├── episodic/ # Session history
│ ├── working/ # Active context
│ └── .features.json # Feature toggles
├── skills/
│ ├── _manifest.jsonl # Skill registry
│ ├── brain/ # Brain integration skill
│ ├── data-layer/ # Harness monitoring
│ ├── data-flywheel/ # Training artifact export
│ ├── design-md/ # DESIGN.md workflows
│ └── tldraw/ # Visual canvas (opt-in)
├── tools/
│ └── brain_bridge.py # Brain API wrapper
├── harness/
│ └── adapters/ # Adapter-specific configs
└── install.json # Installed adapters manifest安装完成后,你的项目将包含以下结构:
.agent/
├── memory/
│ ├── personal/PREFERENCES.md # 用户偏好(优先读取)
│ ├── semantic/ # 概念知识
│ ├── episodic/ # 会话历史
│ ├── working/ # 活跃上下文
│ └── .features.json # 功能开关
├── skills/
│ ├── _manifest.jsonl # 技能注册表
│ ├── brain/ # Brain集成技能
│ ├── data-layer/ # 工具监控
│ ├── data-flywheel/ # 训练工件导出
│ ├── design-md/ # DESIGN.md工作流
│ └── tldraw/ # 可视化画布(可选启用)
├── tools/
│ └── brain_bridge.py # Brain API包装器
├── harness/
│ └── adapters/ # 适配器专属配置
└── install.json # 已安装适配器清单Configuration
配置方法
Initial Setup (Onboarding Wizard)
初始设置(引导向导)
The wizard populates :
.agent/memory/personal/PREFERENCES.mdbash
undefined向导会填充文件:
.agent/memory/personal/PREFERENCES.mdbash
undefinedAccept all defaults (CI mode)
接受所有默认设置(CI模式)
agentic-stack claude-code --yes
agentic-stack claude-code --yes
Re-run wizard on existing project
在现有项目中重新运行向导
agentic-stack claude-code --reconfigure
Wizard questions:
1. What should I call you? *(optional)*
2. Primary language(s)? *(default: unspecified)*
3. Explanation style? *(default: concise)*
4. Test strategy? *(default: test-after)*
5. Commit message style? *(default: conventional commits)*
6. Code review depth? *(default: critical issues only)*
Optional features (off by default):
- FTS memory search `[BETA]`
- tldraw visual canvas `[BETA]`agentic-stack claude-code --reconfigure
向导问题:
1. 怎么称呼你?*(可选)*
2. 主要使用的语言?*(默认:未指定)*
3. 解释风格?*(默认:简洁)*
4. 测试策略?*(默认:事后测试)*
5. 提交信息风格?*(默认:规范提交)*
6. 代码审查深度?*(默认:仅关键问题)*
可选功能(默认关闭):
- FTS记忆搜索 `[BETA]`
- tldraw可视化画布 `[BETA]`Manual Preference Editing
手动编辑偏好
Edit directly:
.agent/memory/personal/PREFERENCES.mdmarkdown
---
name: Alex
languages: [Python, TypeScript]
explanation_style: detailed
test_strategy: test-first
commit_style: conventional commits
review_depth: thorough
---直接编辑:
.agent/memory/personal/PREFERENCES.mdmarkdown
---
name: Alex
languages: [Python, TypeScript]
explanation_style: detailed
test_strategy: test-first
commit_style: conventional commits
review_depth: thorough
---Personal Preferences
个人偏好
I prefer async/await over callbacks. Use descriptive variable names.
Always include error handling for network requests.
undefined我更喜欢async/await而非回调函数。使用描述性变量名。
网络请求始终包含错误处理。
undefinedFeature Toggles
功能开关
Edit :
.agent/memory/.features.jsonjson
{
"fts_search": false,
"tldraw": false
}编辑:
.agent/memory/.features.jsonjson
{
"fts_search": false,
"tldraw": false
}Working with Memory Layers
记忆层使用方法
Personal Memory
个人记忆
bash
undefinedbash
undefinedView preferences
查看偏好设置
cat .agent/memory/personal/PREFERENCES.md
cat .agent/memory/personal/PREFERENCES.md
Add personal context
添加个人上下文
echo "## Code Style\n\nPrefer functional composition over inheritance." >> .agent/memory/personal/PREFERENCES.md
undefinedecho "## 代码风格\n\n优先使用函数式组合而非继承。" >> .agent/memory/personal/PREFERENCES.md
undefinedSemantic Memory
语义记忆
python
undefinedpython
undefined.agent/memory/semantic/architecture_decisions.md
.agent/memory/semantic/architecture_decisions.md
"""
Document lasting project knowledge
"""
undefined"""
记录项目长期知识
"""
undefinedEpisodic Memory
情景记忆
Automatically managed by harness; tracks session history and decisions.
由工具自动管理;追踪会话历史和决策记录。
Working Memory
工作记忆
Active context during current session; cleared when appropriate.
当前会话的活跃上下文;在合适时机自动清除。
Creating Custom Skills
创建自定义技能
Skill Structure
技能结构
.agent/skills/my-custom-skill/
├── SKILL.md # Main skill definition
├── README.md # Documentation
└── tools/ # Optional tool scripts
└── helper.py.agent/skills/my-custom-skill/
├── SKILL.md # 主要技能定义
├── README.md # 文档说明
└── tools/ # 可选工具脚本
└── helper.pySKILL.md Format
SKILL.md格式
markdown
---
name: my-custom-skill
description: Does something specific for this project
version: 1.0.0
triggers:
- use my custom skill
- apply custom workflow
---markdown
---
name: my-custom-skill
description: 为该项目实现特定功能
version: 1.0.0
triggers:
- use my custom skill
- apply custom workflow
---My Custom Skill
我的自定义技能
What It Does
功能说明
Detailed explanation...
详细解释...
When to Use
使用场景
- Trigger condition 1
- Trigger condition 2
- 触发条件1
- 触发条件2
Examples
示例
```python
```python
Working code example
可运行代码示例
```
undefined```
undefinedSync Manifest After Adding Skills
添加技能后同步清单
bash
agentic-stack sync-manifestbash
agentic-stack sync-manifestMulti-Adapter Setup
多适配器设置
Install Multiple Harnesses
安装多个工具
bash
undefinedbash
undefinedInteractive multi-select
交互式多选
cd your-project
./install.sh
cd your-project
./install.sh
Or add individually
或单独添加
agentic-stack add claude-code
agentic-stack add cursor
agentic-stack add windsurf
undefinedagentic-stack add claude-code
agentic-stack add cursor
agentic-stack add windsurf
undefinedCheck Installed Adapters
检查已安装适配器
bash
agentic-stack statusOutput:
✓ claude-code (active)
✓ cursor (active)
✗ windsurf (not installed)bash
agentic-stack status输出示例:
✓ claude-code (已激活)
✓ cursor (已激活)
✗ windsurf (未安装)Manage via TUI
通过TUI管理
bash
agentic-stack managebash
agentic-stack manageData Layer Usage
数据层使用
Generate Dashboard
生成仪表盘
python
undefinedpython
undefinedFrom within agent session, trigger:
在Agent会话中触发:
"show me the harness dashboard"
"show me the harness dashboard"
"generate daily report"
"generate daily report"
Or manually:
或手动执行:
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "skills" / "data-layer"))
from dashboard import generate_dashboard
generate_dashboard()
undefinedfrom pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "skills" / "data-layer"))
from dashboard import generate_dashboard
generate_dashboard()
undefinedView Dashboard
查看仪表盘
bash
open .agent/data/dashboard.html
cat .agent/data/daily-report.mdbash
open .agent/data/dashboard.html
cat .agent/data/daily-report.mdData Flywheel Usage
数据飞轮使用
Export Approved Runs
导出已批准的运行记录
python
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "skills" / "data-flywheel"))
from export import export_runpython
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "skills" / "data-flywheel"))
from export import export_runExport specific run
导出特定运行记录
export_run(
run_id="2026-05-16-auth-refactor",
redact_secrets=True,
include_context=True
)
undefinedexport_run(
run_id="2026-05-16-auth-refactor",
redact_secrets=True,
include_context=True
)
undefinedArtifacts Generated
生成的工件
- - Execution traces
traces/ - - Contextual summaries
context-cards/ - - Test cases for evaluation
eval-cases/ - - Training-ready format
training.jsonl - - Flywheel readiness metrics
metrics.json
- - 执行追踪记录
traces/ - - 上下文摘要
context-cards/ - - 评估用测试用例
eval-cases/ - - 可用于训练的格式
training.jsonl - - 数据飞轮就绪指标
metrics.json
Brain Integration
Brain集成
Bridge from Agent Code
从Agent代码桥接
python
#!/usr/bin/env python3
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "tools"))
from brain_bridge import query_brain, write_brainpython
#!/usr/bin/env python3
from pathlib import Path
import sys
sys.path.insert(0, str(Path.cwd() / ".agent" / "tools"))
from brain_bridge import query_brain, write_brainQuery across projects
跨项目查询
results = query_brain("authentication patterns")
for hit in results:
print(f"{hit['project']}: {hit['content']}")
results = query_brain("authentication patterns")
for hit in results:
print(f"{hit['project']}: {hit['content']}")
Write durable note
写入持久化笔记
write_brain(
content="OAuth refresh tokens expire after 30 days",
tags=["auth", "security"]
)
undefinedwrite_brain(
content="OAuth refresh tokens expire after 30 days",
tags=["auth", "security"]
)
undefinedMCP Integration
MCP集成
bash
undefinedbash
undefinedGet MCP stdio command for harness config
获取用于工具配置的MCP标准输入输出命令
agentic-stack brain mcp-command
Add to `.claude/mcp.json` or equivalent:
```json
{
"mcpServers": {
"brain": {
"command": "brain",
"args": ["serve"]
}
}
}agentic-stack brain mcp-command
添加到`.claude/mcp.json`或等效文件:
```json
{
"mcpServers": {
"brain": {
"command": "brain",
"args": ["serve"]
}
}
}Troubleshooting
故障排除
Doctor Reports Issues
Doctor报告问题
bash
agentic-stack doctorCommon issues:
- Missing hooks: Re-run
agentic-stack add <adapter> - Orphaned files: Use then reinstall
agentic-stack remove <adapter> - Version drift: Run
agentic-stack upgrade --yes
bash
agentic-stack doctor常见问题:
- 缺少钩子:重新运行
agentic-stack add <adapter> - 孤立文件:使用然后重新安装
agentic-stack remove <adapter> - 版本偏移:运行
agentic-stack upgrade --yes
Manifest Out of Sync
清单不同步
bash
undefinedbash
undefinedRebuild from installed SKILL.md files
从已安装的SKILL.md文件重建
agentic-stack sync-manifest
undefinedagentic-stack sync-manifest
undefinedPython 3.9 Compatibility
Python 3.9兼容性
Ensure Python 3.9+ is available:
bash
python3 --versionIf using brew Python:
bash
brew install python@3.11确保Python 3.9+可用:
bash
python3 --version如果使用brew安装的Python:
bash
brew install python@3.11Migration from Pre-v0.9
从v0.9之前版本迁移
bash
undefinedbash
undefinedSynthesize install.json from on-disk adapters
从磁盘上的适配器合成install.json
./install.sh doctor
undefined./install.sh doctor
undefinedBrain Not Found
找不到Brain
bash
undefinedbash
undefinedInstall Brain CLI first
先安装Brain CLI
brew install codejunkie99/tap/brain
brew install codejunkie99/tap/brain
Verify installation
验证安装
brain --version
undefinedbrain --version
undefinedAdapter Conflicts
适配器冲突
bash
undefinedbash
undefinedRemove conflicting adapter
移除冲突的适配器
agentic-stack remove cursor
agentic-stack remove cursor
Clean reinstall
清理后重新安装
agentic-stack add cursor
undefinedagentic-stack add cursor
undefinedEnvironment Variables
环境变量
Common environment variables referenced:
bash
undefined常用环境变量:
bash
undefinedOptional: Custom Brain path
可选:自定义Brain路径
export BRAIN_PATH="$HOME/.config/brain"
export BRAIN_PATH="$HOME/.config/brain"
Optional: Override .agent directory
可选:覆盖.agent目录
export AGENTIC_STACK_DIR=".agent"
undefinedexport AGENTIC_STACK_DIR=".agent"
undefinedCommon Patterns
常见模式
Single Harness Setup
单工具设置
bash
cd my-project
agentic-stack claude-codebash
cd my-project
agentic-stack claude-codeWork exclusively in Claude Code
仅在Claude Code中工作
undefinedundefinedMulti-Harness Setup
多工具设置
bash
cd my-project
agentic-stack add claude-code
agentic-stack add cursor
agentic-stack add windsurfbash
cd my-project
agentic-stack add claude-code
agentic-stack add cursor
agentic-stack add windsurfSwitch between tools without losing context
切换工具时不丢失上下文
undefinedundefinedCI/Automation
CI/自动化
bash
undefinedbash
undefinedScripted install (no interactive prompts)
脚本化安装(无交互式提示)
agentic-stack claude-code --yes
agentic-stack claude-code --yes
Verify installation
验证安装
agentic-stack doctor || exit 1
undefinedagentic-stack doctor || exit 1
undefinedProject Migration
项目迁移
bash
undefinedbash
undefinedExport from old project
从旧项目导出
cd old-project
agentic-stack transfer
cd old-project
agentic-stack transfer
Follow export prompts, save curl command
按照导出提示操作,保存curl命令
Import to new project
导入到新项目
cd new-project
cd new-project
Paste and run curl command
粘贴并运行curl命令
undefinedundefinedSkill Development Workflow
技能开发工作流
bash
undefinedbash
undefined1. Create skill directory
1. 创建技能目录
mkdir -p .agent/skills/my-skill
mkdir -p .agent/skills/my-skill
2. Write SKILL.md with frontmatter
2. 编写带前置元数据的SKILL.md
cat > .agent/skills/my-skill/SKILL.md << 'EOF'
name: my-skill description: Custom skill for X version: 1.0.0 triggers: ["use my skill"]
cat > .agent/skills/my-skill/SKILL.md << 'EOF'
name: my-skill description: 为X场景定制的技能 version: 1.0.0 triggers: ["use my skill"]
My Skill
我的技能
...
EOF
...
EOF
3. Sync manifest
3. 同步清单
agentic-stack sync-manifest
agentic-stack sync-manifest
4. Verify
4. 验证
grep "my-skill" .agent/skills/_manifest.jsonl
undefinedgrep "my-skill" .agent/skills/_manifest.jsonl
undefinedSafe Upgrades
安全升级
bash
undefinedbash
undefined1. Preview changes
1. 预览变更
agentic-stack upgrade --dry-run
agentic-stack upgrade --dry-run
2. Review output
2. 查看输出
3. Apply if safe
3. 确认安全后应用
agentic-stack upgrade --yes
agentic-stack upgrade --yes
4. Verify
4. 验证
agentic-stack doctor
undefinedagentic-stack doctor
undefinedVersion History Highlights
版本历史亮点
- v0.18.0: External Brain memory integration
- v0.17.0: Adapters, Mission Control, lesson retraction
- v0.16.0: Safe project upgrades via command
upgrade - v0.12.0: tldraw visual canvas (opt-in beta)
- v0.11.0: Data layer + data flywheel
- v0.10.0: design-md skill, Python 3.9 fix
- v0.9.0: Manifest-driven harness manager
- v0.18.0:外部Brain记忆集成
- v0.17.0:适配器、任务控制、课程撤回功能
- v0.16.0:通过命令实现安全项目升级
upgrade - v0.12.0:tldraw可视化画布(可选测试版)
- v0.11.0:数据层 + 数据飞轮
- v0.10.0:design-md技能、Python 3.9修复
- v0.9.0:基于清单的工具管理器