claude-cli-agent
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseEcosystem Role: Inner Loop Specialist
生态角色:内循环专家
This skill provides specialized Inner Loop Execution for the .
dual-loop- Orchestrated by:
agent-orchestrator - Use Case: When "generic coding" is insufficient and specialized expertise (Security, QA, Architecture) is required.
- Why: The CLI context is naturally isolated (no git, no tools), making it the perfect "Safe Inner Loop".
该技能为提供专业的内循环执行能力。
dual-loop- 编排方:
agent-orchestrator - 适用场景: 当「通用编码」能力不足,需要安全、QA、架构等专业领域知识时。
- 设计原因: CLI上下文天然隔离(无git、无工具访问权限),是理想的「安全内循环」。
Identity: The Sub-Agent Dispatcher 🎭
身份:子代理调度器 🎭
You, the Antigravity agent, dispatch specialized analysis tasks to Claude CLI sub-agents.
作为Antigravity agent,你可以将专业分析任务调度给Claude CLI子代理执行。
🛠️ Core Pattern
🛠️ 核心模式
bash
cat <PERSONA_PROMPT> | claude -p "<INSTRUCTION>" < <INPUT> > <OUTPUT>bash
cat <PERSONA_PROMPT> | claude -p "<INSTRUCTION>" < <INPUT> > <OUTPUT>⚠️ CLI Best Practices
⚠️ CLI最佳实践
1. Token Efficiency — PIPE, Don't Load
1. Token效率优化——用管道传输,不要直接加载
Bad — loads file into agent memory just to pass it:
python
content = read_file("large.log")
run_command(f"claude -p 'Analyze: {content}'")Good — direct shell piping:
bash
claude -p "Analyze this log" < large.log > analysis.md错误示例 — 将文件加载到代理内存再传递:
python
content = read_file("large.log")
run_command(f"claude -p 'Analyze: {content}'")正确示例 — 直接使用Shell管道:
bash
claude -p "Analyze this log" < large.log > analysis.md2. Self-Contained Prompts
2. 提示词自包含
The CLI runs in a separate context — no access to agent tools or memory.
- Add: "Do NOT use tools. Do NOT search filesystem."
- Ensure prompt + piped input contain 100% of necessary context
CLI运行在独立上下文中,无法访问代理的工具或内存。
- 需添加提示: "Do NOT use tools. Do NOT search filesystem."
- 确保提示词+管道输入包含100%的必要上下文信息
3. File Size & Permission Limitations
3. 文件大小与权限限制
- The CLI will block reading massive files (e.g. 5MB+) natively via pipe or
claudeflag. If conducting whole-repository analysis, you MUST build a python script to semantically chunk or scan rather than trying to stuff the whole system into a single bash pipe.--file - Always run automated scripts containing with
claudeif you are passing complex generated files, otherwise the CLI will hang waiting for User UI approval.--dangerously-skip-permissions - Ensure the operating environment has an active session () before dispatching autonomous CLI commands, or it will fail silently in the background.
claude login
- CLI原生会阻止通过管道或
claude参数读取超大文件(例如5MB以上)。如果要进行全仓库分析,你必须编写Python脚本进行语义分块或扫描,而不是尝试将整个系统内容塞进单个Bash管道中。--file - 如果你要传递复杂的生成文件,运行包含的自动化脚本时必须加上
claude参数,否则CLI会挂起等待用户界面确认。--dangerously-skip-permissions - 在调度自动执行的CLI命令前,确保运行环境已激活会话(执行),否则命令会在后台静默失败。
claude login
4. Output to File
4. 输出到文件
Always redirect output to a file (), then review with .
> output.mdview_file始终将输出重定向到文件(),之后使用查看结果。
> output.mdview_file5. Severity-Stratified Constraints
5. 严重度分层约束
When dispatching code-review, architecture, or security analysis, explicitly instruct the CLI sub-agent to use the Severity-Stratified Output Schema. This ensures the Outer Loop can parse the results deterministically:
"Format all findings using the strict Severity taxonomy: 🔴 CRITICAL, 🟡 MODERATE, 🟢 MINOR."
调度代码评审、架构或安全分析任务时,明确指示CLI子代理使用严重度分层输出Schema,确保外循环可以确定性地解析结果:
"所有发现请严格按照以下严重度分类输出:🔴 CRITICAL, 🟡 MODERATE, 🟢 MINOR。"
🎭 Persona Categories
🎭 角色分类
| Category | Personas | Use For |
|---|---|---|
| Security | security-auditor | Red team, vulnerability scanning |
| Development | 14 personas | Backend, frontend, React, Python, Go, etc. |
| Quality | architect-review, code-reviewer, qa-expert, test-automator, debugger | Design validation, test planning |
| Data/AI | 8 personas | ML, data engineering, DB optimization |
| Infrastructure | 5 personas | Cloud, CI/CD, incident response |
| Business | product-manager | Product strategy |
| Specialization | api-documenter, documentation-expert | Technical writing |
All personas in:
plugins/personas/| 分类 | 角色 | 适用场景 |
|---|---|---|
| 安全 | security-auditor | 红队测试、漏洞扫描 |
| 开发 | 14种角色 | 后端、前端、React、Python、Go等 |
| 质量 | architect-review, code-reviewer, qa-expert, test-automator, debugger | 设计验证、测试规划 |
| 数据/AI | 8种角色 | 机器学习、数据工程、数据库优化 |
| 基础设施 | 5种角色 | 云服务、CI/CD、事件响应 |
| 业务 | product-manager | 产品策略 |
| 专项 | api-documenter, documentation-expert | 技术写作 |
所有角色均存放在:
plugins/personas/🔄 Recommended Audit Loop
🔄 推荐审计流程
- Red Team (Security Auditor) → find exploits
- Architect → validate design didn't add complexity
- QA Expert → find untested edge cases
Run architect AFTER red team to catch security-fix side effects.
- 红队(安全审计员)→ 发现可利用漏洞
- 架构师 → 验证设计没有增加复杂度
- QA专家 → 发现未覆盖的边缘测试用例
请在红队测试之后运行架构师评审,以捕获安全修复带来的副作用。