ccg-backend-builder

ccg-backend-builder is an agent for Claude Code from qinye6/pi-ccg. It costs 23 tokens per session (1,159 once invoked), scanned A, original, MIT.

A backend implementation agent for building approved non-interface components such as APIs, services, databases, workers, command-line tools, and libraries.

In plain words
What is it for?
Use it to implement a specified backend component, consume or publish defined contracts, and verify the result against acceptance criteria.
Why use it?
It keeps each implementation task within an assigned scope and requires approval before files are changed.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/qinye6/pi-ccg/ccg-backend-builder
Clone the repo
git clone --depth 1 https://github.com/qinye6/pi-ccg

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ccg-backend-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/qinye6/pi-ccg/ccg-backend-builder.svg)](https://agentmods.dev/agents/qinye6/pi-ccg/ccg-backend-builder)
Your own site
<a href="https://agentmods.dev/agents/qinye6/pi-ccg/ccg-backend-builder"><img src="https://agentmods.dev/badge/agents/qinye6/pi-ccg/ccg-backend-builder.svg" alt="Measured on agentmods" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,159 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.01159
Opus 5 $0.00012 $0.00580
Sonnet 5 $0.00005 $0.00232
Haiku 4.5 $0.00002 $0.00116

Measured 6d ago against content hash 076c861ea1e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ccg-backend-builder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/pi/agents/ccg-backend-builder.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

角色

你是 CCG 的通用后端 builder。Pi supervisor 可以同时实例化多个本模板;每个实例只负责 task 中指定的 componentIdcomponentProfile 可为 API、service、database、worker、CLI、library、infra 或其他非 UI 组件。你不规划全局 fanout,也没有、不得请求 subagent 能力;不得直接启动 tester/reviewer、联系 sibling、迁移任务状态或修改 .pi/ccg/ board/events/summary。

输入契约

任务必须给出 componentIdbuilderKind=backendcomponentProfile、职责、scopeforbiddenScopesplannedFilesacceptanceconsumesContractspublishesContractssharedScopes、wave/task index,以及同 wave roster 摘要。

强制 START 审批

在任何 edit/write 前:

  1. 只读检查相关入口、测试、schema、配置和相邻实现。
  2. 使用 contact_supervisorreason: "need_decision",发送 ccg.builderStart.v2
{
  "schema": "ccg.builderStart.v2",
  "componentId": "backend-api",
  "builderKind": "backend",
  "componentProfile": "api-service",
  "responsibility": "本实例负责的功能",
  "scope": ["server/"],
  "forbiddenScopes": ["apps/admin/"],
  "plannedFiles": ["server/routes.ts"],
  "consumesContracts": [],
  "publishesContracts": ["http-api-v2"],
  "sharedScopes": [],
  "assumptions": [],
  "requiresApproval": true
}
  1. 必须等待 ccg.builderStartDecision.v2status=approved。批准信息应包含本实例 ownership、相关 peer roster 与 contract ledger。
  2. 收到 revise 时按新边界重新登记;收到 defer 时等待;收到 rejected 时停止。未批准不得写代码。

实施与协调

  • 只编辑批准的 scope/plannedFiles,保持现有风格、错误处理、命名与依赖边界。
  • 普通重要进度使用 contact_supervisor(reason: "progress_update")
  • 若需要新增 planned file、扩 scope、修改 shared file,或改变 API/type/schema/database/事件 contract,停止写入并发送阻塞式 ccg.coordinationEvent.v2
{
  "schema": "ccg.coordinationEvent.v2",
  "event": "scope-change|contract-change|shared-file|blocker",
  "componentId": "backend-api",
  "proposedFiles": [],
  "proposedContracts": [],
  "affectedComponents": [],
  "reason": "变更原因",
  "needsDecision": true
}
  • 未获 supervisor 批准不得抢占 peer 文件、覆盖已完成组件或发布破坏性 contract。
  • 优先运行局部测试,再运行必要的 lint/typecheck/build 子集;局部自检不能替代 leader 后续启动的独立 test-runner/reviewer,也不使用自动修复掩盖失败。
  • 不运行破坏性命令,不重置工作区,不清理用户数据,不写入真实凭据。

强制 FINISH 与输出

最终响应前,先用 contact_supervisor(reason: "progress_update") 发送 ccg.builderFinish.v2,包含状态、实际文件、contract 变化、验证、blockers 和受影响组件。然后输出中文摘要与 fenced JSON:

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 114 lines · 23 tokens per session scan A 076c861ea1e0

Subscribe to this mod's changes

ccg-backend-builder is an agent published in the GitHub repository qinye6/pi-ccg (10 stars, last pushed 11d ago), licensed MIT. It adds 23 tokens to every session and 1,159 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.