Loading...
Loading...
Compare original and translation side by side
Skill by ara.so — AI Agent Skills collection.
由 ara.so 提供的Skill——AI Agent技能集合。
npx @cosmicstack/mercury-agentnpx @cosmicstack/mercury-agentnpm i -g @cosmicstack/mercury-agent
mercurynpm i -g @cosmicstack/mercury-agent
mercuryundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined~/.mercury/~/.mercury/
├── mercury.yaml # Main config
├── .env # API keys
├── permissions.yaml # Tool capabilities
├── token-usage.json # Budget tracking
├── schedules.yaml # Scheduled tasks
├── soul/ # Personality files
│ ├── soul.md
│ ├── persona.md
│ ├── taste.md
│ └── heartbeat.md
├── skills/ # Installed skills
├── memory/
│ ├── short-term/ # Conversation JSON
│ ├── long-term/ # Extracted facts (JSONL)
│ ├── episodic/ # Event log (JSONL)
│ └── second-brain/ # SQLite + FTS5
└── logs/~/.mercury/~/.mercury/
├── mercury.yaml # 主配置文件
├── .env # API密钥
├── permissions.yaml # 工具权限配置
├── token-usage.json # 预算跟踪
├── schedules.yaml # 定时任务
├── soul/ # 个性配置文件
│ ├── soul.md
│ ├── persona.md
│ ├── taste.md
│ └── heartbeat.md
├── skills/ # 已安装技能
├── memory/
│ ├── short-term/ # 对话记录JSON
│ ├── long-term/ # 提取的事实(JSONL格式)
│ ├── episodic/ # 事件日志(JSONL格式)
│ └── second-brain/ # SQLite + FTS5
└── logs/agentName: Mercury
soul:
path: ~/.mercury/soul
providers:
- type: openai
model: gpt-4o
apiKeyEnv: OPENAI_API_KEY
- type: anthropic
model: claude-3-5-sonnet-20241022
apiKeyEnv: ANTHROPIC_API_KEY
channels:
telegram:
enabled: true
tokenEnv: TELEGRAM_BOT_TOKEN
persistence: ~/.mercury/telegram.json
permissions:
defaultMode: ask
filesystem:
read: ask
write: ask
delete: ask
shell:
execute: ask
blocklist:
- sudo
- rm -rf /
- mkfs
- dd if=
budget:
daily: 200000
warningThreshold: 0.7
memory:
secondBrain:
enabled: true
dbPath: ~/.mercury/memory/second-brain/second-brain.dbagentName: Mercury
soul:
path: ~/.mercury/soul
providers:
- type: openai
model: gpt-4o
apiKeyEnv: OPENAI_API_KEY
- type: anthropic
model: claude-3-5-sonnet-20241022
apiKeyEnv: ANTHROPIC_API_KEY
channels:
telegram:
enabled: true
tokenEnv: TELEGRAM_BOT_TOKEN
persistence: ~/.mercury/telegram.json
permissions:
defaultMode: ask
filesystem:
read: ask
write: ask
delete: ask
shell:
execute: ask
blocklist:
- sudo
- rm -rf /
- mkfs
- dd if=
budget:
daily: 200000
warningThreshold: 0.7
memory:
secondBrain:
enabled: true
dbPath: ~/.mercury/memory/second-brain/second-brain.dbundefinedundefinedundefinedundefined/help # Show manual
/status # Config, budget, usage
/tools # List loaded tools
/skills # List installed skills
/budget # Token budget status
/budget override # Override budget once
/budget reset # Reset usage to zero
/budget set <n> # Change daily limit
/permissions # Toggle Ask Me / Allow All
/view # Toggle balanced/detailed progress
/stream # Toggle Telegram streaming
/code agent <task> # Delegate coding task to sub-agent
/ws exit # Exit workspace IDE mode
/tasks # List scheduled tasks
/memory # View/manage Second Brain
/unpair # Telegram: reset access/help # 显示手册
/status # 查看配置、预算和使用情况
/tools # 列出已加载工具
/skills # 列出已安装技能
/budget # 令牌预算状态
/budget override # 临时覆盖预算限制
/budget reset # 将使用量重置为零
/budget set <n> # 修改每日限额
/permissions # 切换"询问我"/"全部允许"模式
/view # 切换平衡/详细进度视图
/stream # 切换Telegram流式输出
/code agent <task> # 将编码任务委托给子代理
/ws exit # 退出工作区IDE模式
/tasks # 列出定时任务
/memory # 查看/管理第二大脑
/unpair # Telegram:重置访问权限// Mercury auto-requests permission for file operations
// Example conversation:
// User: "Read package.json"
// Mercury uses: read_file
// Approve folder scope for batch operations
// User: "Read all TypeScript files in src/"
// Mercury prompts: approve_scope for src/
// File operations
read_file({ path: "package.json" })
write_file({ path: "config.json", content: "{...}" })
create_file({ path: "new.ts", content: "export ..." })
edit_file({ path: "app.ts", operations: [...] })
list_dir({ path: "src/" })
delete_file({ path: "temp.txt" })
send_file({ path: "report.pdf" }) // Telegram only// Mercury会自动请求文件操作权限
// 对话示例:
// 用户:"读取package.json"
// Mercury调用:read_file
// 批准文件夹范围以进行批量操作
// 用户:"读取src/下所有TypeScript文件"
// Mercury提示:批准src/的访问范围
// 文件操作
read_file({ path: "package.json" })
write_file({ path: "config.json", content: "{...}" })
create_file({ path: "new.ts", content: "export ..." })
edit_file({ path: "app.ts", operations: [...] })
list_dir({ path: "src/" })
delete_file({ path: "temp.txt" })
send_file({ path: "report.pdf" }) # 仅Telegram支持// Blocklist prevents dangerous commands
// Blocked: sudo, rm -rf /, mkfs, dd if=, etc.
run_command({ command: "npm install" })
cd({ path: "/path/to/project" })
approve_command({ command: "git push" }) // Pre-approveundefinedgit_status()
git_diff({ staged: true })
git_log({ limit: 10 })
git_add({ files: ["src/app.ts"] })
git_commit({ message: "feat: add feature" })
git_push()undefinedfetch_url({ url: "https://api.example.com/data" })git_status()
git_diff({ staged: true })
git_log({ limit: 10 })
git_add({ files: ["src/app.ts"] })
git_commit({ message: "feat: add feature" })
git_push()// Send proactive messages
send_message({
channel: "telegram",
content: "Build complete!"
})fetch_url({ url: "https://api.example.com/data" })// Recurring task (cron syntax)
schedule_task({
name: "morning-standup",
cron: "0 9 * * *", // 9am daily
task: "Send standup reminder"
})
// One-shot delayed task
schedule_task({
name: "reminder",
delay_seconds: 900, // 15 minutes
task: "Check deployment status"
})
list_scheduled_tasks()
cancel_scheduled_task({ name: "morning-standup" })// 发送主动消息
send_message({
channel: "telegram",
content: "构建完成!"
})// Install community skill
install_skill({ name: "web-search" })
// List installed
list_skills()
// Execute skill
use_skill({
name: "web-search",
query: "latest TypeScript features"
})// 周期性任务(cron语法)
schedule_task({
name: "morning-standup",
cron: "0 9 * * *", // 每天上午9点
task: "发送站会提醒"
})
// 一次性延迟任务
schedule_task({
name: "reminder",
delay_seconds: 900, // 15分钟
task: "检查部署状态"
})
list_scheduled_tasks()
cancel_scheduled_task({ name: "morning-standup" })~/.mercury/skills/<skill-name>/SKILL.md// 安装社区技能
install_skill({ name: "web-search" })
// 列出已安装技能
list_skills()
// 执行技能
use_skill({
name: "web-search",
query: "最新TypeScript特性"
})mkdir -p ~/.mercury/skills/github-pr-review~/.mercury/skills/github-pr-review/SKILL.md---
name: github-pr-review
description: Review GitHub pull requests and provide feedback
triggers:
- "review this pull request"
- "check github pr"
- "analyze code changes"
---~/.mercury/skills/<skill-name>/SKILL.mdundefinedmkdir -p ~/.mercury/skills/github-pr-review~/.mercury/skills/github-pr-review/SKILL.md---
name: github-pr-review
description: Review GitHub pull requests and provide feedback
triggers:
- "review this pull request"
- "check github pr"
- "analyze code changes"
---undefinedundefinedgh pr diff <number>gh pr review <number> --comment -b "feedback"undefinedundefinedgh pr diff <number>gh pr review <number> --comment -b "feedback"undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined// Automatic after each conversation:
// 1. Extract 0-3 facts with confidence/importance/durability scores
// 2. Store in SQLite with FTS5 full-text search
// 3. Auto-consolidation every 60 minutes
// 4. Conflict resolution (higher confidence wins)
// 5. Auto-pruning (stale after 21 days for active-scope)undefined// 每次对话后自动执行:
// 1. 提取0-3个带有置信度/重要性/持久性评分的事实
// 2. 存储到带FTS5全文搜索的SQLite数据库
// 3. 每60分钟自动整合
// 4. 冲突解决(置信度高的内容优先)
// 5. 自动清理(活跃范围的内容超过21天视为过期)undefinedundefined// ~/.mercury/memory/second-brain/second-brain.db (SQLite)
// Tables:
// - memories: id, type, content, confidence, importance, durability
// - memories_fts: FTS5 index for full-text search
// - consolidations: profile summaries, active state, reflections
// Example memory record:
{
type: "preference",
content: "User prefers TypeScript over JavaScript for new projects",
confidence: 0.95,
importance: 0.8,
durability: "durable", // or "transient"
scope: "active", // or "background"
extractedAt: "2026-05-16T10:30:00Z",
lastAccessedAt: "2026-05-16T10:30:00Z"
}undefinedundefined// ~/.mercury/memory/second-brain/second-brain.db (SQLite)
// 表:
// - memories: id, type, content, confidence, importance, durability
// - memories_fts: FTS5全文搜索索引
// - consolidations: 个人资料摘要、活跃状态、反思内容
// 记忆记录示例:
{
type: "preference",
content: "User prefers TypeScript over JavaScript for new projects",
confidence: 0.95,
importance: 0.8,
durability: "durable", // 或 "transient"
scope: "active", // 或 "background"
extractedAt: "2026-05-16T10:30:00Z",
lastAccessedAt: "2026-05-16T10:30:00Z"
}undefinedundefined~/.mercury/permissions.yamlfilesystem:
read: ask # ask, allow, deny
write: ask
delete: ask
scopes:
- path: ~/projects/safe-dir
read: allow
write: allow
shell:
execute: ask
blocklist:
- sudo
- rm -rf /
- mkfs
- dd if=
- "> /dev/"
allowlist:
- npm
- git
- node
messaging:
send: allow
git:
read: allow # status, diff, log
write: ask # commit, push
web:
fetch: askundefinedundefined~/.mercury/permissions.yamlfilesystem:
read: ask # ask, allow, deny
write: ask
delete: ask
scopes:
- path: ~/projects/safe-dir
read: allow
write: allow
shell:
execute: ask
blocklist:
- sudo
- rm -rf /
- mkfs
- dd if=
- "> /dev/"
allowlist:
- npm
- git
- node
messaging:
send: allow
git:
read: allow # status, diff, log
write: ask # commit, push
web:
fetch: askundefinedundefined~/.mercury/.envTELEGRAM_BOT_TOKEN=123456:ABC-DEF...mercury.yamlchannels:
telegram:
enabled: true
tokenEnv: TELEGRAM_BOT_TOKEN
persistence: ~/.mercury/telegram.jsonundefinedundefined~/.mercury/.envTELEGRAM_BOT_TOKEN=123456:ABC-DEF...mercury.yamlchannels:
telegram:
enabled: true
tokenEnv: TELEGRAM_BOT_TOKEN
persistence: ~/.mercury/telegram.jsonundefinedundefinedundefinedundefinedundefinedundefined// HTML formatting (bold, italic, code)
// Editable streaming messages (live token updates)
// File uploads (send_file tool)
// Typing indicators
// Multi-user with role-based access (admin/member)
// Private chat only (groups ignored)
// Example interaction:
// User: "Show me the last commit"
// Mercury: git_log → formatted HTML response with code blocksundefinedundefined// HTML格式(粗体、斜体、代码块)
// 可编辑流式消息(实时令牌更新)
// 文件上传(send_file工具)
// 输入指示器
// 基于角色的多用户访问(管理员/成员)
// 仅支持私聊(忽略群组)
// 交互示例:
// 用户:"显示最后一次提交"
// Mercury调用git_log → 返回带代码块的格式化HTML响应undefinedundefinedundefinedundefinedundefinedundefined// When usage > 70%, Mercury automatically:
// 1. Switches to concise response mode
// 2. Notifies user: "⚠️ 75% of daily budget used. Responses will be concise."
// 3. Continues normally but shorter responses
// Usage tracked in:
// ~/.mercury/token-usage.json
{
"2026-05-16": {
"used": 150000,
"limit": 200000,
"requests": 42
}
}undefinedundefined// 当使用量超过70%时,Mercury自动:
// 1. 切换为简洁响应模式
// 2. 通知用户:"⚠️ 已使用每日预算的75%。响应将转为简洁模式。"
// 3. 继续正常响应,但内容更简短undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined// Built-in exponential backoff:
// - Max 10 restarts per minute
// - Delay doubles on each crash: 1s, 2s, 4s, 8s, ...
// - Resets after 60s of stable run
// Logs crash details to:
// ~/.mercury/logs/daemon.logundefinedundefinedundefinedundefinedundefined// Mercury's Second Brain remembers:
// - Current project: "Working on Mercury agent skills"
// - Preferences: "Prefers TypeScript, avoids any types"
// - Coding style: "Uses async/await, ESM imports"
// - Active goals: "Ship v1.2.0 by end of month"
// Example conversation:
// User: "Add a new skill for git operations"
// Mercury recalls project context, checks existing skills,
// suggests implementation that matches established patternsundefinedundefinedundefinedundefined// Use send_message for proactive updates:
// 1. Long-running build starts
// 2. Mercury sends: "Build started for v1.2.0"
// 3. Build completes
// 4. Mercury sends: "✅ Build complete in 3m 42s"
// Works in both CLI and Telegram
send_message({
channel: "telegram", // or "cli"
content: "Deployment to production successful!"
})undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined