@mison/ag-kit-cn 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/.agent/ARCHITECTURE.md +285 -0
- package/.agent/agents/backend-specialist.md +268 -0
- package/.agent/agents/code-archaeologist.md +106 -0
- package/.agent/agents/database-architect.md +225 -0
- package/.agent/agents/debugger.md +225 -0
- package/.agent/agents/devops-engineer.md +242 -0
- package/.agent/agents/documentation-writer.md +104 -0
- package/.agent/agents/explorer-agent.md +73 -0
- package/.agent/agents/frontend-specialist.md +618 -0
- package/.agent/agents/game-developer.md +162 -0
- package/.agent/agents/mobile-developer.md +382 -0
- package/.agent/agents/orchestrator.md +438 -0
- package/.agent/agents/penetration-tester.md +188 -0
- package/.agent/agents/performance-optimizer.md +187 -0
- package/.agent/agents/product-manager.md +112 -0
- package/.agent/agents/product-owner.md +95 -0
- package/.agent/agents/project-planner.md +405 -0
- package/.agent/agents/qa-automation-engineer.md +103 -0
- package/.agent/agents/security-auditor.md +170 -0
- package/.agent/agents/seo-specialist.md +111 -0
- package/.agent/agents/test-engineer.md +158 -0
- package/.agent/mcp_config.json +12 -0
- package/.agent/rules/GEMINI.md +273 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/skills/api-patterns/SKILL.md +84 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +74 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +40 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +57 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/bash-linux/SKILL.md +201 -0
- package/.agent/skills/behavioral-modes/SKILL.md +264 -0
- package/.agent/skills/brainstorming/SKILL.md +164 -0
- package/.agent/skills/brainstorming/dynamic-questioning.md +359 -0
- package/.agent/skills/clean-code/SKILL.md +200 -0
- package/.agent/skills/code-review-checklist/SKILL.md +125 -0
- package/.agent/skills/database-design/SKILL.md +54 -0
- package/.agent/skills/database-design/database-selection.md +43 -0
- package/.agent/skills/database-design/indexing.md +39 -0
- package/.agent/skills/database-design/migrations.md +50 -0
- package/.agent/skills/database-design/optimization.md +36 -0
- package/.agent/skills/database-design/orm-selection.md +30 -0
- package/.agent/skills/database-design/schema-design.md +56 -0
- package/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/.agent/skills/frontend-design/SKILL.md +418 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +307 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +727 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1118 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/.agent/skills/game-development/SKILL.md +167 -0
- package/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/.agent/skills/geo-fundamentals/SKILL.md +155 -0
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/.agent/skills/lint-and-validate/SKILL.md +44 -0
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/mobile-design/SKILL.md +394 -0
- package/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/.agent/skills/mobile-design/mobile-design-thinking.md +355 -0
- package/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/.agent/skills/mobile-design/mobile-typography.md +432 -0
- package/.agent/skills/mobile-design/platform-android.md +666 -0
- package/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +311 -0
- package/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +241 -0
- package/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +489 -0
- package/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +263 -0
- package/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +431 -0
- package/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +683 -0
- package/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +149 -0
- package/.agent/skills/nextjs-react-expert/SKILL.md +286 -0
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/.agent/skills/parallel-agents/SKILL.md +194 -0
- package/.agent/skills/performance-profiling/SKILL.md +149 -0
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/.agent/skills/plan-writing/SKILL.md +152 -0
- package/.agent/skills/powershell-windows/SKILL.md +166 -0
- package/.agent/skills/python-patterns/SKILL.md +441 -0
- package/.agent/skills/red-team-tactics/SKILL.md +203 -0
- package/.agent/skills/rust-pro/SKILL.md +190 -0
- package/.agent/skills/seo-fundamentals/SKILL.md +135 -0
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +215 -0
- package/.agent/skills/server-management/SKILL.md +161 -0
- package/.agent/skills/systematic-debugging/SKILL.md +114 -0
- package/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/.agent/skills/vulnerability-scanner/checklists.md +131 -0
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +459 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +242 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +80 -0
- package/.agent/workflows/restore-localize-compat.md +525 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +295 -0
- package/AGENT_FLOW.md +609 -0
- package/CHANGELOG.md +68 -0
- package/LICENSE +21 -0
- package/README.md +260 -0
- package/bin/adapters/base.js +63 -0
- package/bin/adapters/codex.js +391 -0
- package/bin/adapters/gemini.js +137 -0
- package/bin/ag-kit.js +1336 -0
- package/bin/core/builder.js +80 -0
- package/bin/core/generator.js +59 -0
- package/bin/core/resource-loader.js +64 -0
- package/bin/core/transformer.js +208 -0
- package/bin/interactive.js +65 -0
- package/bin/utils/atomic-writer.js +97 -0
- package/bin/utils/git-helper.js +68 -0
- package/bin/utils/managed-block.js +65 -0
- package/bin/utils/manifest.js +241 -0
- package/bin/utils.js +82 -0
- package/docs/codex-rules-template.md +36 -0
- package/docs/mapping-spec.md +68 -0
- package/docs/multi-target-adapter.md +80 -0
- package/docs/official/README.md +53 -0
- package/docs/official/antigravity/agent-modes-settings.md +64 -0
- package/docs/official/antigravity/rules-workflows.md +96 -0
- package/docs/official/antigravity/skills.md +147 -0
- package/docs/official/codex/agents-md.md +119 -0
- package/docs/official/codex/config-advanced.md +358 -0
- package/docs/official/codex/config-basic.md +141 -0
- package/docs/official/codex/config-reference.md +223 -0
- package/docs/official/codex/config-sample.md +216 -0
- package/docs/official/codex/mcp.md +107 -0
- package/docs/official/codex/rules.md +79 -0
- package/docs/official/codex/skills.md +114 -0
- package/docs/official/sources-index.md +32 -0
- package/docs/operations.md +145 -0
- package/docs/terminology-style-guide.md +69 -0
- package/package.json +51 -0
- package/scripts/postinstall-check.js +112 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: parallel-agents
|
|
3
|
+
description: 多智能体(Multi-agent)编排模式。当多个独立任务需要不同领域的专业知识,或需要多视角的综合分析时使用。
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 原生并行智能体
|
|
8
|
+
|
|
9
|
+
> 通过 Antigravity 内置的智能体工具实现编排(Orchestration)。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 概览(Overview)
|
|
14
|
+
|
|
15
|
+
本技能旨在通过 Antigravity 的原生智能体系统协调多个专业化 Agent(智能体)。与外部脚本不同,这种方法将所有编排逻辑完全置于 Antigravity 的控制之下。
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 何时使用编排
|
|
20
|
+
|
|
21
|
+
✅ **适用场景:**
|
|
22
|
+
|
|
23
|
+
- 需要跨多个专业领域的复杂任务。
|
|
24
|
+
- 从安全、性能和代码质量等多维度进行代码分析。
|
|
25
|
+
- 综合评审(架构 + 安全 + 测试)。
|
|
26
|
+
- 需要后端 + 前端 + 数据库协同工作的需求实现。
|
|
27
|
+
|
|
28
|
+
❌ **不适用场景:**
|
|
29
|
+
|
|
30
|
+
- 简单的、仅涉及单一领域的任务。
|
|
31
|
+
- 快速修复或细微变动。
|
|
32
|
+
- 单个 Agent 即可胜任的任务。
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 原生 Agent 调用
|
|
37
|
+
|
|
38
|
+
### 调用单个 Agent
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
请使用 security-auditor 智能体来审阅身份认证逻辑。
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 顺序链式调用
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
首先,使用 explorer-agent 探索项目结构。
|
|
48
|
+
然后,使用 backend-specialist 审阅 API 端点。
|
|
49
|
+
最后,使用 test-engineer 识别测试缺口。
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 带上下文传递的调用
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
使用 frontend-specialist 分析 React 组件。
|
|
56
|
+
基于该分析结果,让 test-engineer 生成对应的组件测试。
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 恢复先前的工作
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
恢复智能体 [agentId] 并继续执行其他需求。
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## 编排模式
|
|
68
|
+
|
|
69
|
+
### 模式 1:全面分析
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
智能体流:explorer-agent → [领域专家级 Agents] → 综合汇总(Synthesis)
|
|
73
|
+
|
|
74
|
+
1. explorer-agent:绘制代码库结构图。
|
|
75
|
+
2. security-auditor:评估安全态势。
|
|
76
|
+
3. backend-specialist:评估 API 质量。
|
|
77
|
+
4. frontend-specialist:评估 UI/UX(界面/体验)模式。
|
|
78
|
+
5. test-engineer:评估测试覆盖率。
|
|
79
|
+
6. 综合汇总所有发现。
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 模式 2:功能评审
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
智能体流:[受影响领域的 Agents] → test-engineer
|
|
86
|
+
|
|
87
|
+
1. 识别受影响的领域(后端?前端?还是二者兼有?)。
|
|
88
|
+
2. 调用相关的领域 Agent。
|
|
89
|
+
3. 由 test-engineer 验证变更。
|
|
90
|
+
4. 综合汇总改进建议。
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 模式 3:安全审计
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
智能体流:security-auditor → penetration-tester → 综合汇总
|
|
97
|
+
|
|
98
|
+
1. security-auditor:进行配置与代码审计。
|
|
99
|
+
2. penetration-tester:执行主动漏洞测试。
|
|
100
|
+
3. 综合汇总并给出按优先级排列的补救方案。
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## 可用智能体清单
|
|
106
|
+
|
|
107
|
+
| 智能体(Agent) | 专业领域 | 触发词/场景 |
|
|
108
|
+
| -------------- | -------- | ---------- |
|
|
109
|
+
| `orchestrator` | 全局协调 | "全面的", "多维度的", "综合的" |
|
|
110
|
+
| `security-auditor` | 安全审计 | "安全", "认证", "漏洞" |
|
|
111
|
+
| `penetration-tester` | 渗透测试 | "渗透测试", "红队", "exploit(利用)" |
|
|
112
|
+
| `backend-specialist` | 后端开发 | "API(接口)", "服务器", "Node.js", "Express" |
|
|
113
|
+
| `frontend-specialist` | 前端开发 | "React", "UI(界面)", "组件", "Next.js" |
|
|
114
|
+
| `test-engineer` | 测试工程 | "测试", "覆盖率", "TDD(测试驱动开发)" |
|
|
115
|
+
| `devops-engineer` | 运维开发 | "部署", "CI/CD(持续集成/交付)", "基础设施" |
|
|
116
|
+
| `database-architect` | 数据库架构 | "模式(Schema)", "Prisma", "迁移" |
|
|
117
|
+
| `mobile-developer` | 移动端开发 | "React Native", "Flutter", "移动端" |
|
|
118
|
+
| `api-designer` | API 设计 | "REST(表述性状态转移)", "GraphQL(图查询语言)", "OpenAPI(开放 API 规范)" |
|
|
119
|
+
| `debugger` | 调试专家 | "Bug(缺陷)", "错误", "不工作" |
|
|
120
|
+
| `explorer-agent` | 探索发现 | "探索", "映射", "结构" |
|
|
121
|
+
| `documentation-writer` | 文档编写 | "写文档", "创建 README(说明文档)", "生成 API 文档" |
|
|
122
|
+
| `performance-optimizer` | 性能优化 | "慢", "优化", "分析(Profiling)" |
|
|
123
|
+
| `project-planner` | 项目策划 | "计划", "路线图", "里程碑" |
|
|
124
|
+
| `seo-specialist` | SEO 专家 | "SEO", "Meta(元)标签", "搜索排名" |
|
|
125
|
+
| `game-developer` | 游戏开发 | "游戏", "Unity", "Godot", "Phaser" |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Antigravity 内置智能体
|
|
130
|
+
|
|
131
|
+
这些智能体与自定义 Agent 协同工作:
|
|
132
|
+
|
|
133
|
+
| 智能体 | 模型(Model) | 用途 |
|
|
134
|
+
| ------ | ------------ | ---- |
|
|
135
|
+
| **Explore** | Haiku | 快速的只读代码库搜索 |
|
|
136
|
+
| **Plan** | Sonnet | 计划模式下的调研工作 |
|
|
137
|
+
| **通用型(General)** | Sonnet | 复杂的、跨步骤的代码修改 |
|
|
138
|
+
|
|
139
|
+
针对快速搜索,请使用 **Explore**;针对特定领域知识,请使用**自定义智能体**。
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 综合汇总协议
|
|
144
|
+
|
|
145
|
+
当所有 Agent 完成工作后,进行综合汇总:
|
|
146
|
+
|
|
147
|
+
```markdown
|
|
148
|
+
## 编排综合报告
|
|
149
|
+
|
|
150
|
+
### 任务总结
|
|
151
|
+
|
|
152
|
+
[已完成的工作内容]
|
|
153
|
+
|
|
154
|
+
### 各智能体贡献
|
|
155
|
+
|
|
156
|
+
| 智能体 | 主要发现 |
|
|
157
|
+
| ------ | -------- |
|
|
158
|
+
| security-auditor | 发现了 X 安全缺陷 |
|
|
159
|
+
| backend-specialist | 识别了 Y 优化点 |
|
|
160
|
+
|
|
161
|
+
### 整合建议
|
|
162
|
+
|
|
163
|
+
1. **紧急(Critical)**: [来自 Agent A 的问题]
|
|
164
|
+
2. **重要(Important)**: [来自 Agent B 的问题]
|
|
165
|
+
3. **建议(Nice-to-have)**: [来自 Agent C 的改进点]
|
|
166
|
+
|
|
167
|
+
### 待办动作
|
|
168
|
+
|
|
169
|
+
- [ ] 修复紧急安全问题
|
|
170
|
+
- [ ] 重构 API 端点
|
|
171
|
+
- [ ] 补全缺失的测试
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 最佳实践
|
|
177
|
+
|
|
178
|
+
1. **Agent 多样性** —— 共有 17 个专业 Agent 可供编排调用。
|
|
179
|
+
2. **逻辑顺序** —— 遵循“探索 → 分析 → 实现 → 测试”的链路。
|
|
180
|
+
3. **共享上下文** —— 将关键发现传递给后续的 Agent。
|
|
181
|
+
4. **统一汇总** —— 输出一份完整的综合报告,而非零散的结果。
|
|
182
|
+
5. **验证变更** —— 凡涉及代码修改,务必由 `test-engineer` 介入。
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 核心优势
|
|
187
|
+
|
|
188
|
+
- ✅ **单次会话** —— 所有 Agent 共享上下文。
|
|
189
|
+
- ✅ **AI 自控** —— Claude 自主进行编排协调。
|
|
190
|
+
- ✅ **原生集成** —— 与内置的 Explore 和 Plan 智能体无缝配合。
|
|
191
|
+
- ✅ **支持恢复** —— 可继续先前 Agent 未完成的工作。
|
|
192
|
+
- ✅ **上下文流转** —— 发现结果在 Agent 之间顺畅传递。
|
|
193
|
+
|
|
194
|
+
---
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: performance-profiling
|
|
3
|
+
description: 性能分析原则。测量、分析与优化技术。
|
|
4
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 性能分析
|
|
8
|
+
|
|
9
|
+
> 测量、分析、优化 —— 必须严格遵循此顺序。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🔧 运行脚本
|
|
14
|
+
|
|
15
|
+
**执行以下脚本进行自动化性能分析:**
|
|
16
|
+
|
|
17
|
+
| 脚本 | 用途 | 执行命令 |
|
|
18
|
+
| ----------------------------- | ------------------- | -------------------------------------------------------- |
|
|
19
|
+
| `scripts/lighthouse_audit.py` | Lighthouse(性能审计工具)审计 | `python scripts/lighthouse_audit.py https://example.com` |
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## 1. 核心 Web 指标
|
|
24
|
+
|
|
25
|
+
核心 Web 指标(Core Web Vitals)用于衡量加载与交互质量。
|
|
26
|
+
|
|
27
|
+
### 目标值
|
|
28
|
+
|
|
29
|
+
| 指标 | 优(Good) | 劣(Poor) | 衡量维度 |
|
|
30
|
+
| ------- | --------- | --------- | ---------- |
|
|
31
|
+
| **LCP** | < 2.5s | > 4.0s | 加载体验 |
|
|
32
|
+
| **INP** | < 200ms | > 500ms | 交互响应 |
|
|
33
|
+
| **CLS** | < 0.1 | > 0.25 | 视觉稳定性 |
|
|
34
|
+
|
|
35
|
+
### 何时进行测量
|
|
36
|
+
|
|
37
|
+
| 阶段 | 工具选择 |
|
|
38
|
+
| ---------------------- | --------------------------------------- |
|
|
39
|
+
| 开发环境(Development) | 本地 Lighthouse |
|
|
40
|
+
| CI/CD 流程 | Lighthouse CI(持续集成) |
|
|
41
|
+
| 生产环境(Production) | RUM(真实用户监控,Real User Monitoring) |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 2. 性能分析工作流
|
|
46
|
+
|
|
47
|
+
### 四步走流程
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
1. 建立基准(Baseline)→ 测量当前状态
|
|
51
|
+
2. 识别瓶颈(Identify)→ 找出性能卡点
|
|
52
|
+
3. 实施修复(Fix) → 进行针对性改动
|
|
53
|
+
4. 验证改进(Validate)→ 确认性能提升
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 分析工具选择建议
|
|
57
|
+
|
|
58
|
+
| 待解决问题 | 推荐工具 |
|
|
59
|
+
| ---------------------- | ------------------------- |
|
|
60
|
+
| 页面加载速度 | Lighthouse |
|
|
61
|
+
| 打包体积(Bundle size) | Bundle analyzer(包分析器) |
|
|
62
|
+
| 运行时性能 | DevTools(开发者工具)Performance(性能)面板 |
|
|
63
|
+
| 内存占用 | DevTools(开发者工具)Memory(内存)面板 |
|
|
64
|
+
| 网络请求 | DevTools(开发者工具)Network(网络)面板 |
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 3. 打包产物分析
|
|
69
|
+
|
|
70
|
+
### 观察重点
|
|
71
|
+
|
|
72
|
+
| 潜在问题 | 识别指标 |
|
|
73
|
+
| -------------------- | ---------------------------- |
|
|
74
|
+
| 巨大的外部依赖 | 位于打包产物顶部 |
|
|
75
|
+
| 冗余/重复代码 | 存在于多个 Chunk(代码块)中 |
|
|
76
|
+
| 未使用的代码 | 低覆盖率(Coverage) |
|
|
77
|
+
| 缺失分包(Splitting) | 产物呈现为一个巨大的单体文件 |
|
|
78
|
+
|
|
79
|
+
### 优化手段
|
|
80
|
+
|
|
81
|
+
| 发现的问题 | 对应动作 |
|
|
82
|
+
| -------------------- | ---------------------------------------- |
|
|
83
|
+
| 库文件过大 | 按需导入(Import specific modules) |
|
|
84
|
+
| 依赖项重复 | 去重(Dedupe)、更新版本 |
|
|
85
|
+
| 主包代码包含路由逻辑 | 实施代码分割(Code split) |
|
|
86
|
+
| 存在未引用的导出 | 启用 Tree shake(摇树优化) |
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 4. 运行时分析
|
|
91
|
+
|
|
92
|
+
### Performance 面板分析
|
|
93
|
+
|
|
94
|
+
| 模式 | 含义 |
|
|
95
|
+
| -------------------------- | -------------------------------- |
|
|
96
|
+
| 长任务(Long tasks > 50ms) | 会导致 UI 阻塞 |
|
|
97
|
+
| 密集的小任务 | 可能存在批处理(Batching)的机会 |
|
|
98
|
+
| 布局/绘制(Layout/paint) | 渲染层的瓶颈 |
|
|
99
|
+
| 脚本执行(Script) | JavaScript(脚本语言)执行开销过高 |
|
|
100
|
+
|
|
101
|
+
### Memory 面板分析
|
|
102
|
+
|
|
103
|
+
| 模式 | 含义 |
|
|
104
|
+
| ------------------------------- | ---------------- |
|
|
105
|
+
| 堆内存持续增长(Growing heap) | 可能存在内存泄漏 |
|
|
106
|
+
| 被持有的对象过多(Retained) | 检查引用关系 |
|
|
107
|
+
| Detached DOM(脱离文档树的 DOM,Document Object Model) | 未被正确清理 |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 5. 常见性能瓶颈
|
|
112
|
+
|
|
113
|
+
### 按症状分类
|
|
114
|
+
|
|
115
|
+
| 症状表现 | 可能的原因 |
|
|
116
|
+
| ------------------- | --------------------------------------- |
|
|
117
|
+
| 首次加载缓慢 | JS 体积过大、渲染阻塞(Render blocking) |
|
|
118
|
+
| 交互卡顿 | 事件处理器(Event handlers)逻辑过重 |
|
|
119
|
+
| 滚动时的掉帧(Jank) | 布局抖动(Layout thrashing) |
|
|
120
|
+
| 内存持续上升 | 内存泄漏、未释放的引用 |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 6. 优先实施的“速赢”方案
|
|
125
|
+
|
|
126
|
+
| 优先级 | 动作 | 预期影响 |
|
|
127
|
+
| ------ | -------------------------- | ----------------- |
|
|
128
|
+
| 1 | 开启资源压缩(Gzip/Brotli,压缩算法) | **高** |
|
|
129
|
+
| 2 | 图片懒加载(Lazy load) | **高** |
|
|
130
|
+
| 3 | 路由层级的代码分割 | **高** |
|
|
131
|
+
| 4 | 配置静态资源缓存 | 中 |
|
|
132
|
+
| 5 | 图片压缩与格式优化 | 中 |
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 7. 应避免的反模式
|
|
137
|
+
|
|
138
|
+
| ❌ 禁止(Don't) | ✅ 推荐(Do) |
|
|
139
|
+
| ------------------------------- | -------------------------------- |
|
|
140
|
+
| 凭空猜测性能问题 | 优先进行性能分析(Profile first,先分析) |
|
|
141
|
+
| 进行微比例优化(Micro-optimize) | 优先修复最大的性能卡点 |
|
|
142
|
+
| 过早优化 | 在真正需要的时候再优化 |
|
|
143
|
+
| 忽视真实用户的体验 | 参考 RUM 数据 |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
> **谨记:** 最快的代码是那些根本不需要运行的代码。在着手优化之前,先考虑是否可以移除。
|
|
148
|
+
|
|
149
|
+
---
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Skill: performance-profiling
|
|
4
|
+
Script: lighthouse_audit.py
|
|
5
|
+
Purpose: Run Lighthouse performance audit on a URL
|
|
6
|
+
Usage: python lighthouse_audit.py https://example.com
|
|
7
|
+
Output: JSON with performance scores
|
|
8
|
+
Note: Requires lighthouse CLI (npm install -g lighthouse)
|
|
9
|
+
"""
|
|
10
|
+
import subprocess
|
|
11
|
+
import json
|
|
12
|
+
import sys
|
|
13
|
+
import os
|
|
14
|
+
import tempfile
|
|
15
|
+
|
|
16
|
+
def run_lighthouse(url: str) -> dict:
|
|
17
|
+
"""Run Lighthouse audit on URL."""
|
|
18
|
+
try:
|
|
19
|
+
with tempfile.NamedTemporaryFile(suffix='.json', delete=False) as f:
|
|
20
|
+
output_path = f.name
|
|
21
|
+
|
|
22
|
+
result = subprocess.run(
|
|
23
|
+
[
|
|
24
|
+
"lighthouse",
|
|
25
|
+
url,
|
|
26
|
+
"--output=json",
|
|
27
|
+
f"--output-path={output_path}",
|
|
28
|
+
"--chrome-flags=--headless",
|
|
29
|
+
"--only-categories=performance,accessibility,best-practices,seo"
|
|
30
|
+
],
|
|
31
|
+
capture_output=True,
|
|
32
|
+
text=True,
|
|
33
|
+
timeout=120
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if os.path.exists(output_path):
|
|
37
|
+
with open(output_path, 'r') as f:
|
|
38
|
+
report = json.load(f)
|
|
39
|
+
os.unlink(output_path)
|
|
40
|
+
|
|
41
|
+
categories = report.get("categories", {})
|
|
42
|
+
return {
|
|
43
|
+
"url": url,
|
|
44
|
+
"scores": {
|
|
45
|
+
"performance": int(categories.get("performance", {}).get("score", 0) * 100),
|
|
46
|
+
"accessibility": int(categories.get("accessibility", {}).get("score", 0) * 100),
|
|
47
|
+
"best_practices": int(categories.get("best-practices", {}).get("score", 0) * 100),
|
|
48
|
+
"seo": int(categories.get("seo", {}).get("score", 0) * 100)
|
|
49
|
+
},
|
|
50
|
+
"summary": get_summary(categories)
|
|
51
|
+
}
|
|
52
|
+
else:
|
|
53
|
+
return {"error": "Lighthouse failed to generate report", "stderr": result.stderr[:500]}
|
|
54
|
+
|
|
55
|
+
except subprocess.TimeoutExpired:
|
|
56
|
+
return {"error": "Lighthouse audit timed out"}
|
|
57
|
+
except FileNotFoundError:
|
|
58
|
+
return {"error": "Lighthouse CLI not found. Install with: npm install -g lighthouse"}
|
|
59
|
+
|
|
60
|
+
def get_summary(categories: dict) -> str:
|
|
61
|
+
"""Generate summary based on scores."""
|
|
62
|
+
perf = categories.get("performance", {}).get("score", 0) * 100
|
|
63
|
+
if perf >= 90:
|
|
64
|
+
return "[OK] Excellent performance"
|
|
65
|
+
elif perf >= 50:
|
|
66
|
+
return "[!] Needs improvement"
|
|
67
|
+
else:
|
|
68
|
+
return "[X] Poor performance"
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
if len(sys.argv) < 2:
|
|
72
|
+
print(json.dumps({"error": "Usage: python lighthouse_audit.py <url>"}))
|
|
73
|
+
sys.exit(1)
|
|
74
|
+
|
|
75
|
+
result = run_lighthouse(sys.argv[1])
|
|
76
|
+
print(json.dumps(result, indent=2))
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan-writing
|
|
3
|
+
description: 结构化任务规划能力。强调清晰拆解、依赖关系与可验证标准。适用于功能实现、重构与多步骤工作。
|
|
4
|
+
allowed-tools: Read, Glob, Grep
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 计划编写
|
|
8
|
+
|
|
9
|
+
> 来源:obra/superpowers
|
|
10
|
+
|
|
11
|
+
## 概览
|
|
12
|
+
该技能提供一套框架,用于将工作拆解为清晰、可执行、可验证的任务。
|
|
13
|
+
|
|
14
|
+
## 任务拆解原则
|
|
15
|
+
|
|
16
|
+
### 1. 小而聚焦的任务
|
|
17
|
+
- 每个任务建议控制在 2-5 分钟内
|
|
18
|
+
- 每个任务只对应一个明确结果
|
|
19
|
+
- 每个任务都应可独立验证
|
|
20
|
+
|
|
21
|
+
### 2. 明确的验证标准
|
|
22
|
+
- 如何判断它已经完成?
|
|
23
|
+
- 可以检查/测试什么?
|
|
24
|
+
- 预期输出是什么?
|
|
25
|
+
|
|
26
|
+
### 3. 合理的执行顺序
|
|
27
|
+
- 识别任务依赖关系
|
|
28
|
+
- 尽可能并行执行
|
|
29
|
+
- 标出关键路径(Critical Path)
|
|
30
|
+
- **阶段 X:验证(Verification)永远放在最后**
|
|
31
|
+
|
|
32
|
+
### 4. 在项目根目录动态命名
|
|
33
|
+
- 计划文件保存为项目根目录下的 `{task-slug}.md`
|
|
34
|
+
- 文件名由任务语义派生(例如“添加鉴权” → `auth-feature.md`)
|
|
35
|
+
- **绝不能**放在 `.claude/`、`docs/` 或临时目录中
|
|
36
|
+
|
|
37
|
+
## 规划原则(不是模板)
|
|
38
|
+
|
|
39
|
+
> 🔴 **不要使用固定模板。每份计划都必须匹配当前任务。**
|
|
40
|
+
|
|
41
|
+
### 原则 1:保持简洁
|
|
42
|
+
|
|
43
|
+
| ❌ 错误 | ✅ 正确 |
|
|
44
|
+
|---------|---------|
|
|
45
|
+
| 50 个任务并含多层子任务 | 最多 5-10 个清晰任务 |
|
|
46
|
+
| 罗列所有微步骤 | 只保留可执行项 |
|
|
47
|
+
| 描述冗长 | 每个任务一行说明 |
|
|
48
|
+
|
|
49
|
+
> **规则:** 如果计划超过 1 页,通常就过长了。请继续精简。
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### 原则 2:具体,不要泛化
|
|
54
|
+
|
|
55
|
+
| ❌ 错误 | ✅ 正确 |
|
|
56
|
+
|---------|---------|
|
|
57
|
+
| “搭建项目” | “运行 `npx create-next-app`” |
|
|
58
|
+
| “添加鉴权” | “安装 next-auth,并创建 `/api/auth/[...nextauth].ts`” |
|
|
59
|
+
| “美化界面” | “为 `Header.tsx` 添加 Tailwind 类” |
|
|
60
|
+
|
|
61
|
+
> **规则:** 每个任务都要有清晰且可验证的完成结果。
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### 原则 3:按项目类型动态生成内容
|
|
66
|
+
|
|
67
|
+
**对于新项目(NEW PROJECT):**
|
|
68
|
+
- 技术栈是什么?(先决定)
|
|
69
|
+
- MVP(最小可行产品)是什么?(最小功能集合)
|
|
70
|
+
- 文件结构如何设计?
|
|
71
|
+
|
|
72
|
+
**对于功能新增(FEATURE ADDITION):**
|
|
73
|
+
- 会影响哪些文件?
|
|
74
|
+
- 需要哪些依赖?
|
|
75
|
+
- 如何验证功能可用?
|
|
76
|
+
|
|
77
|
+
**对于缺陷修复(BUG FIX):**
|
|
78
|
+
- 根因是什么?
|
|
79
|
+
- 需要改哪一个文件/哪一行?
|
|
80
|
+
- 如何验证修复有效?
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
### 原则 4:脚本必须与项目匹配
|
|
85
|
+
|
|
86
|
+
> 🔴 **不要复制粘贴脚本命令。必须按项目类型选择。**
|
|
87
|
+
|
|
88
|
+
| 项目类型 | 相关脚本 |
|
|
89
|
+
|----------|----------|
|
|
90
|
+
| Frontend/React(前端/React) | `ux_audit.py`, `accessibility_checker.py` |
|
|
91
|
+
| Backend/API(后端/API) | `api_validator.py`, `security_scan.py` |
|
|
92
|
+
| Mobile(移动端) | `mobile_audit.py` |
|
|
93
|
+
| Database(数据库) | `schema_validator.py` |
|
|
94
|
+
| Full-stack(全栈) | 根据修改范围组合上述脚本 |
|
|
95
|
+
|
|
96
|
+
**错误:** 每份计划都塞入所有脚本
|
|
97
|
+
**正确:** 仅保留与当前任务相关的脚本
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
### 原则 5:验证应简单直接
|
|
102
|
+
|
|
103
|
+
| ❌ 错误 | ✅ 正确 |
|
|
104
|
+
|---------|---------|
|
|
105
|
+
| “验证组件工作正常” | “运行 `npm run dev`,点击按钮,看到 toast” |
|
|
106
|
+
| “测试 API” | “`curl localhost:3000/api/users` 返回 200” |
|
|
107
|
+
| “检查样式” | “打开浏览器,确认深色模式切换可用” |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## 计划结构(灵活而非固定)
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
# [任务名称]
|
|
115
|
+
|
|
116
|
+
## 目标(Goal)
|
|
117
|
+
一句话:我们要构建/修复什么?
|
|
118
|
+
|
|
119
|
+
## 任务(Tasks)
|
|
120
|
+
- [ ] 任务 1:[具体动作] → 验证:[如何检查]
|
|
121
|
+
- [ ] 任务 2:[具体动作] → 验证:[如何检查]
|
|
122
|
+
- [ ] 任务 3:[具体动作] → 验证:[如何检查]
|
|
123
|
+
|
|
124
|
+
## 完成标准(Done When)
|
|
125
|
+
- [ ] [主要成功标准]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
> **就这些。** 除非确实必要,否则不要额外加阶段和子章节。
|
|
129
|
+
> 保持最小化,只有在需要时才增加复杂度。
|
|
130
|
+
|
|
131
|
+
## 备注(Notes)
|
|
132
|
+
[任何重要注意事项]
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## 最佳实践(速查)
|
|
138
|
+
|
|
139
|
+
1. **先写目标** - 明确构建/修复的对象
|
|
140
|
+
2. **最多 10 个任务** - 超过就拆为多份计划
|
|
141
|
+
3. **每个任务可验证** - 给出清晰“完成”标准
|
|
142
|
+
4. **与项目绑定** - 不使用复制粘贴模板
|
|
143
|
+
5. **边做边更新** - 完成后及时标记 `[x]`
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 适用场景
|
|
148
|
+
|
|
149
|
+
- 从零开始新项目
|
|
150
|
+
- 新增功能
|
|
151
|
+
- 修复复杂缺陷
|
|
152
|
+
- 涉及多文件的重构
|