mcpField
A
agent-native-audit

agent-native-audit

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

关于 agent-native-audit

用于依据八项 Agent 原生架构原则审查代码库的技能。它为各项原则分派并行子 Agent,汇总评分结果并给出优先级建议。

主要功能

  1. 01审查八项架构原则
  2. 02并行开展分项审查
  3. 03对结果进行数值评分
  4. 04汇总审查报告
  5. 05按优先级整理建议

适用场景

  1. 01检查应用中的 Agent 集成
  2. 02发现 Agent 能力缺口
  3. 03审查指定的一项架构原则

安装

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

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

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

详细介绍

Agent 原生架构审计

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

核心审计原则

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

工作流

步骤 1:加载 Agent 原生技能

首先,调用 agent-native-architecture 技能,了解所有原则:

/compound-engineering:agent-native-architecture

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

步骤 2:启动并行子 Agent

使用 Task 工具启动 8 个并行子 Agent,并将 subagent_type: Explore 用于每个 Agent,每项原则对应一个。每个 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 指定了单项原则(例如,“action parity”),则只运行相应的子 Agent,并仅针对该原则提供详细发现。

有效参数:

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

评论

支持 Markdown