Skill站外收录 @skilllib/skill-2014279364949520387
xp-practices
将极限编程核心实践融入软件开发全流程,通过结对与集体编程促进知识共享和质量保障,借助持续集成实现快速反馈,以测试驱动开发夯实代码可靠性,并在自动化协作中维持可持续开发节奏。
软件开发 AI 技能
Skills.MD
# Extreme Programming (XP) Practices
<default_to_action>
When applying XP practices:
1. START with practices that give immediate value
2. BUILD supporting practices gradually
3. ADAPT to your context
4. MEASURE results
**Core XP Practices (Prioritized):**
| Practice | Start Here | Why First |
|----------|------------|-----------|
| TDD | ✅ Yes | Foundation for everything |
| Continuous Integration | ✅ Yes | Fast feedback |
| Pair Programming | ✅ Yes | Knowledge sharing |
| Collective Ownership | After CI+TDD | Needs safety net |
| Small Releases | After CI | Infrastructure dependent |
**Pairing Quick Start:**
```
Driver-Navigator (Classic):
- Driver: Writes code
- Navigator: Reviews, thinks ahead
- Rotate every 20-30 min
Ping-Pong (with TDD):
A: Write failing test
B: Make test pass + refactor
B: Write next failing test
A: Make test pass + refactor
```
</default_to_action>
## Quick Reference Card
### The Five XP Values
| Value | Meaning | Practice |
|-------|---------|----------|
| **Communication** | Everyone knows what everyone does | Daily standups, pairing |
| **Simplicity** | Simplest thing that works | YAGNI, small design |
| **Feedback** | Get feedback early and often | TDD, CI, short iterations |
| **Courage** | Tell truth, adapt | Refactor, admit mistakes |
| **Respect** | Everyone contributes value | Sustainable pace, pairing |
### Core Practices
| Practice | Description | Benefit |
|----------|-------------|---------|
| **Pair Programming** | Two devs, one workstation | Quality + knowledge sharing |
| **TDD** | Red-Green-Refactor | Confidence + design |
| **CI** | Integrate multiple times/day | Fast feedback |
| **Collective Ownership** | Anyone can change anything | No bottlenecks |
| **Sustainable Pace** | 40-hour weeks | Long-term productivity |
| **Small Releases** | Ship frequently | Risk reduction |
---
## Pair Programming
### When to Pair
| Context | Pair? | Why |
|---------|-------|-----|
| Complex/risky code | ✅ Always | Needs multiple perspectives |
| New technology | ✅ Always | Learning accelerator |
| Onboarding | ✅ Always | Knowledge transfer |
| Critical bugs | ✅ Always | Two heads better |
| Simple tasks | ❌ Skip | Not worth overhead |
| Research spikes | ❌ Skip | Pair to discuss findings |
### Pairing Dos and Don'ts
**Do:**
- ✅ Switch roles every 20-30 min
- ✅ Take breaks together
- ✅ Think out loud
- ✅ Ask questions
- ✅ Keep sessions 2-4 hours max
**Don't:**
- ❌ Grab keyboard without asking
- ❌ Check phone while pairing
- ❌ Dominate conversation
- ❌ Pair all day (exhausting)
---
## Ensemble (Mob) Programming
**Setup:** 3+ developers, one screen, rotating driver
```
[Screen]
↓
[Driver] ← Directions from navigators
↑
[Navigator 1] [Navigator 2] [Navigator 3]
```
**Rotation:** Driver switches every 5-10 min
**Best for:**
- Complex problem solving
- Architectural decisions
- Learning new frameworks
- Resolving blockers
---
## Continuous Integration
**CI Workflow:**
```
1. Pull latest from main
2. Make small change (<2 hrs work)
3. Run tests locally (all pass)
4. Commit and push
5. CI runs tests automatically
6. If fail → fix immediately
```
**Best Practices:**
- Commit frequently (small changes)
- Keep build fast (<10 min)
- Fix broken builds immediately
- Never commit to broken build
---
## Four Rules of Simple Design
(In priority order)
1. **Passes all tests** - Works correctly
2. **Reveals intention** - Clear, expressive code
3. **No duplication** - DRY principle
4. **Fewest elements** - No speculative code
---
## Agent Integration
```typescript
// Agent-human pair testing
const charter = "Test payment edge cases";
const tests = await Task("Generate Tests", { charter }, "qe-test-generator");
const reviewed = await human.review(tests);
await Task("Implement", { tests: reviewed }, "qe-test-generator");
// Continuous integration with agents
await Task("Risk Analysis", { prDiff }, "qe-regression-risk-analyzer");
await Task("Generate Tests", { changes: prDiff }, "qe-test-generator");
await Task("Execute Tests", { scope: 'affected' }, "qe-test-executor");
// Sustainable pace: agents handle grunt work
const agentWork = ['regression', 'data-generation', 'coverage-analysis'];
const humanWork = ['exploratory', 'risk-assessment', 'strategy'];
```
---
## Agent Coordination Hints
### Memory Namespace
```
aqe/xp-practices/
├── pairing-sessions/* - Pair/ensemble session logs
├── ci-metrics/* - CI health metrics
├── velocity/* - Team velocity data
└── retrospectives/* - XP retrospective notes
```
### Fleet Coordination
```typescript
const xpFleet = await FleetManager.coordinate({
strategy: 'xp-workflow',
agents: [
'qe-test-generator', // TDD support
'qe-test-executor', // CI integration
'qe-code-reviewer' // Collective ownership
],
topology: 'parallel'
});
```
---
## Common Objections
| Objection | Response |
|-----------|----------|
| "Pairing is 2x slower" | 15% slower writing, 15% fewer bugs, net positive |
| "No time for TDD" | Debugging takes longer than testing |
| "CI is hard to setup" | Start simple: one action, one test |
| "Collective ownership = chaos" | Only without tests + CI |
---
## Related Skills
- [tdd-london-chicago](../tdd-london-chicago/) - TDD deep dive
- [refactoring-patterns](../refactoring-patterns/) - Safe refactoring
- [pair-programming](../pair-programming/) - AI-assisted pairing
---
## Remember
**XP practices work as a system.** Don't cherry-pick randomly:
- TDD enables collective ownership
- CI enables small releases
- Pairing enables collective ownership
- Sustainable pace enables everything
**With Agents:** Agents amplify XP. Pair humans with agents. Agents handle repetitive work, humans provide judgment and creativity.
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「xp-practices」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次