← Back to Course Summary / 返回课程总结
WEEK 5

Agentic Development
Agent驱动开发

Multi-Agent AI Workflows for Software Development
多Agent AI软件工作流

Learn to create specialized AI agents that collaborate on development tasks, implement saved prompts, coding rules, and coordinate multi-agent workflows using Claude Code.

学习创建专门的AI Agent协作完成开发任务,实现保存的提示词、编码规则,并使用Claude Code协调多Agent工作流。

Core Concepts / 核心概念

💾 Saved Prompts

Reusable command templates for common tasks.

用于常见任务的可重用命令模板。

📋 Rules

Project-specific coding standards and best practices.

项目特定的编码标准和最佳实践。

🤖 Multi-Agent Workflows

Specialized AI agents collaborating on complex tasks.

专门的AI Agent协作完成复杂任务。

The Four Agents / 四个Agent

🔍
Parsing Specialist

ParserAgent

Expert in text parsing and regex patterns for extracting structured data.

文本解析和正则表达式专家,用于提取结构化数据。

Responsibilities:
• Hashtag extraction (#tag)
• Task extraction (- [ ] task)
• Edge case handling
⚙️
Backend Specialist

BackendAgent

Expert in FastAPI, database operations, and API endpoint implementation.

FastAPI、数据库操作和API端点实现专家。

Responsibilities:
• Create API endpoints
• Implement business logic
• Database integration
🧪
Testing Specialist

TestAgent

Expert in writing comprehensive tests and ensuring code quality.

编写全面测试和确保代码质量的专家。

Responsibilities:
• Unit tests
• Integration tests
• Coverage verification
📚
Documentation Specialist

DocsAgent

Expert in writing clear documentation and API references.

编写清晰文档和API参考的专家。

Responsibilities:
• API documentation
• Usage examples
• OpenAPI specs

Agent Workflow / Agent工作流

🔍 ParserAgent
Define Interfaces
⚙️ BackendAgent
Implement API
🧪 TestAgent
Verify
📚 DocsAgent
Document

Saved Prompts (Slash Commands) / 保存的提示词

/test-pagination <endpoint>
Generate comprehensive pagination tests for any endpoint.

为任何端点生成全面的分页测试。
Example: /test-pagination /notes
Output: Complete test suite with edge cases
/standardize-errors [--full]
Add standardized error handling to all endpoints.

为所有端点添加标准化错误处理。
Example: /standardize-errors --full
Output: Applied error envelope pattern

Coding Rules / 编码规则

📐 Pagination Pattern Rule

  • Request parameters: page, page_size
  • Response format: {items, total, page, page_size}
  • Validation: page ≥ 1, page_size between 1-100
  • SQLAlchemy helper functions for consistency

📦 Error Envelope Rule

  • Success: {ok: true, data: {...}}
  • Error: {ok: false, error: {code, message, details}}
  • Standard error codes: VALIDATION_ERROR, NOT_FOUND, CONFLICT
  • Custom exception classes

Efficiency Gains / 效率提升

30x
Test Generation
测试生成速度
12x
Error Handling
错误处理速度
2x
Full Feature
完整功能速度
95%
Test Coverage
测试覆盖率

Single vs Multi-Agent / 单Agent vs 多Agent

Aspect / 方面 Single Developer / 单人开发 Multi-Agent / 多Agent
Context Switching High context switching None (specialized)
Quality Assurance Depends on individual Expert-level
Test Coverage Often incomplete Comprehensive
Documentation Frequently missed Automatic
Time Required 4-6 hours 2-3 hours

Key Takeaways / 关键收获

Consistency

Rules ensure consistent code patterns across the project.

规则确保项目中一致的代码模式。

Reusability

Commands can be used repeatedly across different projects.

命令可以在不同项目中重复使用。

Specialization

Agents have focused expertise for specific tasks.

Agent具有特定任务的专业知识。