ECC
ECC 架构:围绕代理循环组织 Skills、Hooks、Memory 与客户端适配器
分析可复用目录、策略文件、生命周期钩子、记忆、MCP 和跨客户端适配层。

你将学会
- Trace ECC's catalog, policy, lifecycle, memory, and adapter layers
- Threat-model hooks and persisted context
- Build a cross-client compatibility and rollback matrix
开始前需要
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
先看结论
- ECC wraps a plan-to-memory loop with reusable catalog, policy, lifecycle, and adapter layers.
- Hooks, MCP, and persisted memory are executable state and need threat-model review.
- Cross-client parity must be tested as a compatibility matrix, not assumed from shared filenames.
The loop is the product
ECC 把计划、测试、实现、审查、验证、记忆组成循环,并由 skills/agents、commands/rules、hooks、memory、MCP 与客户端适配器共同实现。钩子和持久化上下文属于可执行状态,需要像代码一样做威胁建模。
The loop also creates observability questions. For every task, an operator should be able to tell which instruction or hook shaped a command, which files were changed, which tests ran, and what memory was persisted. If that path is opaque, the harness becomes difficult to debug even when the generated code looks plausible.
Map the layers and lifecycle
The reusable-catalog layer contains skills and agents that describe how to perform a class of work. Commands and rules form the policy layer: they ask for plans, TDD, review, or security checks. Hooks attach automation to lifecycle events such as session start, tool use, or completion. Memory and instincts persist selected lessons across tasks. MCP and provider adapters extend the capability surface, while platform adapters translate the catalog for Claude Code, Codex, Cursor, OpenCode, Gemini, Zed, and Copilot with different parity.
A useful trace is: user request → planning command → specialist skill/agent → tool or MCP call → post-tool hook → tests/review → memory write. Capture the event IDs and file paths for a harmless task so you can see which layers are active before granting them production permissions.
Security is an architectural boundary
ECC's README treats hooks, MCP servers, and project instructions as executable configuration. AgentShield scans those surfaces—prompts, hooks, permissions, secrets, and agent files—rather than limiting security review to application source. GateGuard and related safeguards can block destructive shell actions, but a block is only useful when the human knows why the command was refused and how to approve a safe alternative.
Persisted memory deserves the same treatment. Define what can be written, where it lives, how long it remains, and who can edit it. Never let a stale instinct silently widen permissions or leak a private prompt into a future repository. Keep credentials in host-managed stores and redact event logs before sharing them.
Design for feature parity and change
The catalog can be shared across clients, but lifecycle hooks, agent delegation, and plugin formats differ. Treat each adapter as an explicit compatibility layer with its own test matrix. A rule that is enforceable in Claude Code may be advisory in Copilot, and an OpenCode plugin may expose events without importing the full command catalog.
For upgrades, compare the generated manifest, hook events, context size, memory writes, and test outcomes. Version the catalog and adapter together, run a canary repository, and keep a rollback that removes generated files cleanly. The architecture succeeds when a team can explain both the normal path and the safe failure path to a new maintainer.
如何选择
| 比较维度 | 方案 A | 方案 B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
实施步骤
- 1
Trace a harmless task from plan through tools, hooks, tests, review, and memory.
- 2
Inventory skills, agents, rules, MCP entries, permissions, and persistence paths.
- 3
Run AgentShield and define ownership/retention for generated state.
- 4
Canary adapter upgrades and verify rollback removes every generated surface.
可复制示例
request
-> plan/command
-> skill + specialist agent
-> tool or MCP
-> lifecycle hook
-> tests + fresh-context review
-> verified artifact + scoped memory常见问题
Is ECC a replacement for the underlying coding model?
No. It is an orchestration and policy layer around an agent host, model, tools, and repository; those dependencies remain independently configured.
Why can two clients behave differently with the same ECC catalog?
Hook events, permissions, plugin formats, and delegation support differ by host. Use the README's support matrix and test the exact adapter before relying on a behavior.
资料来源
- ECC README (captured 2026-08-31)来源核查 2026-08-31
- ECC repository来源核查 2026-08-31