…
← Back to agents

code-agent

Coding-domain agent on Pi — explore, implement, review, debug, test, and refactor a repository through a standard I/O envelope.

engineering@community

Latest · MIT · 8.8 KB

Downloads
35
Installs
0
Stars
0
Versions
1

Latest 0.1.0 · MIT · 8.8 KB

Initial marketplace release.

AGENT.md

Code Agent

基于 Pi 的编码领域智能体,上架包遵循 AgentMarket 开发规范(包规范 1.1,I/O 信封 specVersion: "1.0")。

宿主从 stdin 或 --request 文件读入标准请求信封,向 stdout 写出标准响应信封。业务字段由 schemas/ 约束。multimodal: false:不得传入 attachments。

上架 zip:将本目录(agent-spec/)内文件打成 zip,不要再套一层无关文件夹。slug / name 为 code-agent。

Install

在仓库根目录(本包的上一级)安装运行时:

cd ..
npm install
npm run build

Node.js 20+。认证沿用 Pi,任选其一:

  • 环境变量:ANTHROPIC_API_KEY、OPENAI_API_KEY、GEMINI_API_KEY 等
  • ~/.pi/agent/auth.json(pi / /login)

通义 / Kimi 等 OpenAI 兼容供应商按 Pi 文档配置 ~/.pi/agent/models.json,本包不自研 provider。

Run

从仓库根目录执行信封入口:

# 文件
node agent-spec/src/run.mjs --request agent-spec/examples/request.json

# stdin
cat agent-spec/examples/request.json | node agent-spec/src/run.mjs

只校验信封与业务 Schema、不调用模型:

node agent-spec/src/run.mjs --request agent-spec/examples/request.json --validate-only

附件请求应返回 INVALID_INPUT:

node agent-spec/src/run.mjs --request agent-spec/examples/request-with-attachment.json

交互 TUI(非正式信封路径,便于本地开发):

npx tsx src/cli.ts
npx tsx src/cli.ts -p "总结这个仓库怎么跑测试"

Input / Output

  • multimodal: false
  • schemas: schemas/input.schema.json, schemas/output.schema.json
  • 信封字段:specVersion、requestId、agent、请求侧 input、响应侧 status + output(失败时 error.code)
  • 出现 attachments 时返回 status: "failed",error.code: "INVALID_INPUT"

Skills

按需加载(描述在 pi-package/skills/*/SKILL.md):

skill 用途
explore 只读探索仓库
implement 实现功能 / 修 bug
review 审 git diff
debug 复现并定位
test 补测 / 跑测
refactor 行为不变的重构

斜杠命令(TUI):/explore /implement /review /debug /test /commit /plan /go

License

MIT

Versions

  • v0.1.0 · latest

    Initial marketplace release.

    Download