mcpField
C
ce-agent-native-audit

ce-agent-native-audit

github.com/everyinc测试与质量25.8k1.7k 次安装今天更新
代码仓库

关于 ce-agent-native-audit

用于评估代码库是否符合 Agent 原生架构原则的审计技能,面向构建 Agent 功能的开发团队。它并行检查八项原则,并汇总评分、差距和优先级建议。

主要功能

  1. 01审计八项架构原则
  2. 02并行运行子 Agent 审查
  3. 03按原则评估合规度
  4. 04列出差距与建议
  5. 05支持单项原则审计

适用场景

  1. 01评估应用的 Agent 原生设计
  2. 02查找界面操作与 Agent 工具间的差距
  3. 03审查上下文注入与共享数据访问
  4. 04生成带评分的架构报告

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/everyinc/compound-engineering-plugin --skill ce-agent-native-audit

安装后在 Claude Code 中输入/ce-agent-native-audit确认已加载。

详细介绍

Agent-Native 架构审计

依据 Agent-Native 架构原则全面审查代码库,针对每项原则启动并行子 Agent,并生成评分报告。

核心审计原则

  1. 操作对等 - “用户能做的事,Agent 都能做”
  2. 工具即原语 - “工具提供能力,而非行为”
  3. 上下文注入 - “系统提示词包含有关应用状态的动态上下文”
  4. 共享工作区 - “Agent 和用户在同一数据空间中工作”
  5. CRUD 完整性 - “每个实体都具备完整的 CRUD(创建、读取、更新、删除)能力”
  6. UI 集成 - “Agent 的操作会立即反映在 UI 中”
  7. 能力发现 - “用户可以发现 Agent 能做什么”
  8. 提示词原生功能 - “功能是定义结果的提示词,而非代码”

工作流程

步骤 1:加载 Agent-Native 技能

首先,调用 Agent-Native 架构技能以了解所有原则:

/ce-agent-native-architecture

选择选项 7(操作对等)以加载完整参考资料。

步骤 2:启动并行子 Agent

使用平台的子 Agent 原语启动 8 个并行子 Agent(在 Claude Code 中使用 Agent 和 subagent_type: Explore,在 Codex 中使用 spawn_agent 和 agent_type: "explorer",在 Pi 中通过 pi-subagents 扩展使用 subagent 和 agent: "scout"),每项原则各启动一个。每个 Agent 都应:

  1. 枚举代码库中的所有实例(用户操作、工具、上下文、数据存储等)
  2. 根据对应原则检查合规情况
  3. 提供明确的分数,例如“X/Y(百分比)”
  4. 列出具体差距和建议

Agent 1:操作对等

Audit for ACTION PARITY - "Whatever the user can do, the agent can do."

Tasks:
1. Enumerate ALL user actions in frontend (API calls, button clicks, form submissions)
   - Search for API service files, fetch calls, form handlers
   - Check routes and components for user interactions
2. Check which have corresponding agent tools
   - Search for agent tool definitions
   - Map user actions to agent capabilities
3. Score: "Agent can do X out of Y user actions"

Format:
## Action Parity Audit
### User Actions Found
| Action | Location | Agent Tool | Status |
### Score: X/Y (percentage%)
### Missing Agent Tools
### Recommendations

Agent 2:工具即原语

Audit for TOOLS AS PRIMITIVES - "Tools provide capability, not behavior."

Tasks:
1. Find and read ALL agent tool files
2. Classify each as:
   - PRIMITIVE (good): read, write, store, list - enables capability without business logic
   - WORKFLOW (bad): encodes business logic, makes decisions, orchestrates steps
3. Score: "X out of Y tools are proper primitives"

Format:
## Tools as Primitives Audit
### Tool Analysis
| Tool | File | Type | Reasoning |
### Score: X/Y (percentage%)
### Problematic Tools (workflows that should be primitives)
### Recommendations

Agent 3:上下文注入

Audit for CONTEXT INJECTION - "System prompt includes dynamic context about app state"

Tasks:
1. Find context injection code (search for "context", "system prompt", "inject")
2. Read agent prompts and system messages
3. Enumerate what IS injected vs what SHOULD be:
   - Available resources (files, drafts, documents)
   - User preferences/settings
   - Recent activity
   - Available capabilities listed
   - Session history
   - Workspace state

Format:
## Context Injection Audit
### Context Types Analysis
| Context Type | Injected? | Location | Notes |
### Score: X/Y (percentage%)
### Missing Context
### Recommendations

Agent 4:共享工作区

Audit for SHARED WORKSPACE - "Agent and user work in the same data space"

Tasks:
1. Identify all data stores/tables/models
2. Check if agents read/write to SAME tables or separate ones
3. Look for sandbox isolation anti-pattern (agent has separate data space)

Format:
## Shared Workspace Audit
### Data Store Analysis
| Data Store | User Access | Agent Access | Shared? |
### Score: X/Y (percentage%)
### Isolated Data (anti-pattern)
### Recommendations

Agent 5:CRUD 完整性

Audit for CRUD COMPLETENESS - "Every entity has full CRUD"

Tasks:
1. Identify all entities/models in the codebase
2. For each entity, check if agent tools exist for:
   - Create
   - Read
   - Update
   - Delete
3. Score per entity and overall

Format:
## CRUD Completeness Audit
### Entity CRUD Analysis
| Entity | Create | Read | Update | Delete | Score |
### Overall Score: X/Y entities with full CRUD (percentage%)
### Incomplete Entities (list missing operations)
### Recommendations

Agent 6:UI 集成

Audit for UI INTEGRATION - "Agent actions immediately reflected in UI"

Tasks:
1. Check how agent writes/changes propagate to frontend
2. Look for:
   - Streaming updates (SSE, WebSocket)
   - Polling mechanisms
   - Shared state/services
   - Event buses
   - File watching
3. Identify "silent actions" anti-pattern (agent changes state but UI doesn't update)

Format:
## UI Integration Audit
### Agent Action → UI Update Analysis
| Agent Action | UI Mechanism | Immediate? | Notes |
### Score: X/Y (percentage%)
### Silent Actions (anti-pattern)
### Recommendations

Agent 7:能力发现

Audit for CAPABILITY DISCOVERY - "Users can discover what the agent can do"

Tasks:
1. Check for these 7 discovery mechanisms:
   - Onboarding flow showing agent capabilities
   - Help documentation
   - Capability hints in UI
   - Agent self-describes in responses
   - Suggested prompts/actions
   - Empty state guidance
   - Slash commands (/help, /tools)
2. Score against 7 mechanisms

Format:
## Capability Discovery Audit
### Discovery Mechanism Analysis
| Mechanism | Exists? | Location | Quality |
### Score: X/7 (percentage%)
### Missing Discovery
### Recommendations

Agent 8:提示词原生功能

Audit for PROMPT-NATIVE FEATURES - "Features are prompts defining outcomes, not code"

Tasks:
1. Read all agent prompts
2. Classify each feature/behavior as defined in:
   - PROMPT (good): outcomes defined in natural language
   - CODE (bad): business logic hardcoded
3. Check if behavior changes require prompt edit vs code change

Format:
## Prompt-Native Features Audit
### Feature Definition Analysis
| Feature | Defined In | Type | Notes |
### Score: X/Y (percentage%)
### Code-Defined Features (anti-pattern)
### Recommendations
步骤 3:汇总报告

所有 Agent 完成后,汇总报告,其中包含:

## Agent-Native Architecture Review: [Project Name]

### Overall Score Summary

| Core Principle | Score | Percentage | Status |
|----------------|-------|------------|--------|
| Action Parity | X/Y | Z% | ✅/⚠️/❌ |
| Tools as Primitives | X/Y | Z% | ✅/⚠️/❌ |
| Context Injection | X/Y | Z% | ✅/⚠️/❌ |
| Shared Workspace | X/Y | Z% | ✅/⚠️/❌ |
| CRUD Completeness | X/Y | Z% | ✅/⚠️/❌ |
| UI Integration | X/Y | Z% | ✅/⚠️/❌ |
| Capability Discovery | X/Y | Z% | ✅/⚠️/❌ |
| Prompt-Native Features | X/Y | Z% | ✅/⚠️/❌ |

**Overall Agent-Native Score: X%**

### Status Legend
- ✅ Excellent (80%+)
- ⚠️ Partial (50-79%)
- ❌ Needs Work (<50%)

### Top 10 Recommendations by Impact

| Priority | Action | Principle | Effort |
|----------|--------|-----------|--------|

### What's Working Excellently

[List top 5 strengths]

成功标准

  • 8 个子 Agent 均完成审计
  • 每项原则都有明确的数字评分(X/Y 格式)
  • 汇总表格显示所有分数和状态指标
  • 按影响优先级排列前 10 项建议
  • 报告指出优势和差距

可选:单项原则审计

如果 $ARGUMENTS 指定了单项原则(例如“操作对等”),则仅运行对应的子 Agent,并仅提供该原则的详细发现。

有效参数:

  • action parity 或 1
  • tools 或 primitives 或 2
  • context 或 injection 或 3
  • shared 或 workspace 或 4
  • crud 或 5
  • ui 或 integration 或 6
  • discovery 或 7
  • prompt 或 features 或 8

评论

支持 Markdown