10x Development Patterns (Meta-Skill)
Patterns that compress timelines, eliminate waste, and multiply output. These are the habits and systems that separate high-velocity teams from the rest.
Installation
OpenClaw / Moltbot / Clawbot
CODEBLOCK0
When to Use
- - Starting a new project — set up the right foundations from day one
- Planning sprints — prioritize work that compounds
- Optimizing workflow — identify and remove bottlenecks
- Reviewing velocity — measure and improve throughput
- Onboarding developers — teach high-leverage habits
- Retrospectives — diagnose why things are slow
Core Principles
| Principle | Description | Example |
|---|
| Parallel execution | Don't serialize independent tasks; run them concurrently | Run linting, tests, and type-checking in parallel CI jobs |
| Early validation |
Validate assumptions before building | Prototype the riskiest part first, not the easiest |
| Reuse over rebuild | Leverage existing solutions before writing custom code | Use shadcn/ui instead of building a component library |
| Automation first | Automate any repetitive task on the second occurrence | Script database seeding, not manual SQL inserts |
| Fail fast | Catch errors at the earliest possible stage | Strict TypeScript, pre-commit hooks, schema validation |
| Minimize context switching | Batch similar work together | Handle all PR reviews in one block, not scattered |
| Shortest feedback loop | Reduce time between change and feedback | Hot reload, preview deploys, co-located tests |
Development Velocity Patterns
| Pattern | What It Does | Speed Multiplier |
|---|
| Hot reload / fast refresh | See changes instantly without losing state | 3-5x faster UI iteration |
| Type-driven development |
Define types/interfaces first, then implement | Catches 40%+ of bugs at write time |
| Test-driven development | Write tests for complex logic before implementation | Fewer regressions, faster debugging |
| Feature flags | Ship incomplete features safely behind toggles | Continuous delivery without risk |
| Vertical slicing | Build full-stack thin slices end-to-end | Faster feedback, smaller PRs |
| Monorepo | Share code, types, and config across packages | Eliminates cross-repo sync overhead |
| Code generation | Generate boilerplate from schemas or templates | Minutes instead of hours for CRUD |
| AI-assisted development | Use Cursor, Copilot for acceleration | 2-5x faster for boilerplate and exploration |
| Template repositories | Start new projects from proven templates | Skip setup entirely |
| Shared component libraries | Reusable, tested UI building blocks | Consistent UI, no re-implementation |
| Preview deployments | Every PR gets a live URL (Vercel, Netlify) | Instant stakeholder feedback |
| Trunk-based development | Short-lived branches, frequent merges to main | Eliminates merge hell |
| Continuous deployment | Every merge to main auto-deploys | Zero manual deploy overhead |
| Database migrations as code | Version-controlled, repeatable schema changes | No manual DB modifications |
| Infrastructure as code | Terraform, Pulumi, SST for infra | Reproducible environments in minutes |
| API-first design | Define API contracts before implementation | Frontend and backend work in parallel |
| Storybook / component dev | Develop UI components in isolation | No need to navigate full app for UI work |
Leverage Points
High effort-to-impact ratio — small investments that pay dividends repeatedly.
| Leverage Point | Effort | Impact | Payoff Timeline |
|---|
| Automation scripts (seed, reset, deploy) | 1-2 hours | Saves 10+ min/day per developer | Days |
| Shared utilities (formatting, validation, logging) |
2-4 hours | Eliminates repeated code across services | Weeks |
| CI/CD pipelines | 4-8 hours | Removes all manual build/deploy steps | Immediately |
| Documentation (ADRs, onboarding, runbooks) | 2-3 hours | Cuts onboarding time by 50%+ | Weeks |
| Developer tooling (linters, formatters, git hooks) | 1-2 hours | Prevents entire categories of bugs | Immediately |
| Database seed scripts | 1-2 hours | Instant realistic local environments | Days |
| Error monitoring (Sentry, Axiom) | 1-2 hours | Find production bugs before users report them | Immediately |
Time Sink Detection
Common time wasters and how to eliminate them.
| Time Sink | Hours Wasted/Week | Solution |
|---|
| Manual testing | 3-8 hours | Automated tests, Playwright for E2E, CI checks |
| Environment setup |
2-5 hours (new devs) | Docker Compose, devcontainers, seed scripts |
| Manual deployment | 1-3 hours | CI/CD pipeline, one-click deploys |
| Code review bottlenecks | 2-6 hours waiting | Small PRs, async reviews, max 24h SLA |
| Meeting overload | 5-10 hours | Async standups, written updates, office hours |
| Debugging without logs | 2-4 hours | Structured logging, error tracking, source maps |
| Dependency conflicts | 1-3 hours | Lock files, renovate bot, monorepo tooling |
| Unclear requirements | 3-8 hours rework | Spike tickets, design docs, early prototypes |
Workflow Optimization
Daily Workflow Template
CODEBLOCK1
Essential IDE Shortcuts
| Action | macOS | Why It Matters |
|---|
| Go to file | INLINECODE0 | Never browse the file tree |
| Go to symbol |
Cmd+Shift+O | Jump directly to functions/classes |
| Find in project |
Cmd+Shift+F | Find anything across the codebase |
| Rename symbol |
F2 | Safe, project-wide renaming |
| Quick fix |
Cmd+. | Auto-import, auto-fix linter issues |
| Toggle terminal | `
Ctrl+ `
| Stay in the editor |
| Multi-cursor | Cmd+D
| Edit multiple occurrences at once |
| Move line | Alt+Up/Down
| Reorder code without cut/paste |
### CLI Aliases & Scripts
CODEBLOCK2
### Shell Scripts Worth Writing
| Script | Purpose | Time Saved |
|---|---|---|
| ./scripts/setup.sh
| One-command local environment setup | Hours per new dev |
| ./scripts/seed.sh
| Reset and seed database with test data | 10 min/day |
| ./scripts/deploy.sh
| Build, test, and deploy in sequence | 15 min/deploy |
| ./scripts/new-feature.sh
| Scaffold feature (route, component, test) | 20 min/feature |
| ./scripts/db-reset.sh` | Drop, recreate, migrate, seed database | 10 min/occurrence |
Anti-Patterns
Patterns that feel productive but destroy velocity.
| Anti-Pattern | What Happens | Instead Do |
|---|
| Over-engineering | Build abstractions for problems you don't have | Solve today's problem; refactor when patterns emerge |
| Premature optimization |
Optimize code that isn't a bottleneck | Profile first, optimize the measured bottleneck |
| Gold plating | Polish features beyond requirements | Ship the 80% solution, iterate based on feedback |
| Yak shaving | Fix tangential problems endlessly | Time-box tangents to 15 min, then create a ticket |
| Not-invented-here | Rebuild what open source already solved | Evaluate existing solutions before writing custom code |
| Bikeshedding | Debate trivial decisions at length | Set a 5-min timer; if no consensus, the proposer decides |
| Cargo culting | Copy patterns without understanding why | Understand the problem before adopting a solution |
Measurement — DORA Metrics
Track these four metrics to objectively measure engineering velocity.
| Metric | Elite | High | Medium | Low |
|---|
| Deployment frequency | On-demand (multiple/day) | Weekly | Monthly | Quarterly |
| Lead time for changes |
< 1 hour | < 1 week | < 1 month | > 1 month |
|
Change failure rate | < 5% | < 10% | < 15% | > 15% |
|
Mean time to recovery | < 1 hour | < 1 day | < 1 week | > 1 week |
How to Improve Each
- - Deployment frequency — CI/CD, feature flags, trunk-based development
- Lead time — Small PRs, automated testing, preview deploys
- Change failure rate — Type safety, comprehensive tests, canary deploys
- MTTR — Observability, runbooks, feature flag kill switches
NEVER Do
- 1. NEVER manually deploy to production — always use CI/CD pipelines
- NEVER merge without automated checks — require passing CI before merge
- NEVER keep long-lived feature branches — merge within 1-2 days or break it smaller
- NEVER skip writing types/interfaces — the 30 seconds you save costs hours later
- NEVER copy-paste code more than once — extract to a shared utility immediately
- NEVER ignore flaky tests — fix or delete them; flaky tests erode trust in the suite
- NEVER optimize without measuring — profile first, gut feelings are usually wrong
10倍开发模式(元技能)
能够压缩时间线、消除浪费并成倍提升产出的模式。这些习惯和系统将高效团队与其他团队区分开来。
安装
OpenClaw / Moltbot / Clawbot
bash
npx clawhub@latest install 10x-patterns
何时使用
- - 启动新项目——从第一天起建立正确的基础
- 规划冲刺——优先处理能产生复利效应的工作
- 优化工作流——识别并消除瓶颈
- 审查开发速度——衡量并提升吞吐量
- 新开发者入职——教授高杠杆习惯
- 回顾会议——诊断效率低下的原因
核心原则
| 原则 | 描述 | 示例 |
|---|
| 并行执行 | 不要串行化独立任务;让它们并发运行 | 在并行CI作业中同时运行代码检查、测试和类型检查 |
| 早期验证 |
在构建之前验证假设 | 先构建风险最高的部分,而不是最容易的部分 |
| 复用优于重建 | 在编写自定义代码前利用现有解决方案 | 使用shadcn/ui而不是构建组件库 |
| 自动化优先 | 重复性任务出现第二次就自动化 | 编写数据库种子脚本,而不是手动执行SQL插入 |
| 快速失败 | 在最早阶段捕获错误 | 严格TypeScript、预提交钩子、模式验证 |
| 最小化上下文切换 | 将相似工作批量处理 | 集中处理所有PR审查,而不是分散进行 |
| 最短反馈循环 | 缩短变更与反馈之间的时间 | 热重载、预览部署、同位置测试 |
开发速度模式
| 模式 | 作用 | 速度倍数 |
|---|
| 热重载/快速刷新 | 即时查看变更,不丢失状态 | UI迭代快3-5倍 |
| 类型驱动开发 |
先定义类型/接口,再实现 | 编写时捕获40%+的bug |
| 测试驱动开发 | 实现前为复杂逻辑编写测试 | 更少回归,更快调试 |
| 功能开关 | 在开关后安全地发布不完整功能 | 无风险的持续交付 |
| 垂直切片 | 端到端构建全栈薄切片 | 更快反馈,更小PR |
| 单体仓库 | 跨包共享代码、类型和配置 | 消除跨仓库同步开销 |
| 代码生成 | 从模式或模板生成样板代码 | CRUD从数小时缩短到数分钟 |
| AI辅助开发 | 使用Cursor、Copilot加速 | 样板代码和探索快2-5倍 |
| 模板仓库 | 从经过验证的模板启动新项目 | 完全跳过环境搭建 |
| 共享组件库 | 可复用、经过测试的UI构建块 | 一致UI,无需重新实现 |
| 预览部署 | 每个PR获得实时URL(Vercel、Netlify) | 即时利益相关者反馈 |
| 主干开发 | 短期分支,频繁合并到主分支 | 消除合并地狱 |
| 持续部署 | 每次合并到主分支自动部署 | 零手动部署开销 |
| 数据库迁移即代码 | 版本控制、可重复的模式变更 | 无需手动修改数据库 |
| 基础设施即代码 | Terraform、Pulumi、SST用于基础设施 | 数分钟内可复现的环境 |
| API优先设计 | 实现前定义API契约 | 前后端并行工作 |
| Storybook/组件开发 | 隔离开发UI组件 | 无需浏览完整应用即可进行UI工作 |
杠杆点
高投入产出比——小额投入带来重复回报。
| 杠杆点 | 投入 | 影响 | 回报时间线 |
|---|
| 自动化脚本(种子、重置、部署) | 1-2小时 | 每位开发者每天节省10+分钟 | 数天 |
| 共享工具(格式化、验证、日志) |
2-4小时 | 消除跨服务的重复代码 | 数周 |
| CI/CD流水线 | 4-8小时 | 消除所有手动构建/部署步骤 | 立即 |
| 文档(ADR、入职指南、操作手册) | 2-3小时 | 入职时间减少50%+ | 数周 |
| 开发者工具(代码检查、格式化、Git钩子) | 1-2小时 | 预防整类bug | 立即 |
| 数据库种子脚本 | 1-2小时 | 即时获得逼真的本地环境 | 数天 |
| 错误监控(Sentry、Axiom) | 1-2小时 | 在用户报告前发现生产环境bug | 立即 |
时间消耗检测
常见的时间浪费及消除方法。
| 时间消耗 | 每周浪费小时数 | 解决方案 |
|---|
| 手动测试 | 3-8小时 | 自动化测试、Playwright用于E2E、CI检查 |
| 环境搭建 |
2-5小时(新开发者) | Docker Compose、devcontainers、种子脚本 |
| 手动部署 | 1-3小时 | CI/CD流水线、一键部署 |
| 代码审查瓶颈 | 等待2-6小时 | 小PR、异步审查、最长24小时SLA |
| 会议过多 | 5-10小时 | 异步站会、书面更新、办公时间 |
| 无日志调试 | 2-4小时 | 结构化日志、错误追踪、源码映射 |
| 依赖冲突 | 1-3小时 | 锁定文件、renovate机器人、单体仓库工具 |
| 需求不明确 | 返工3-8小时 | 探索工单、设计文档、早期原型 |
工作流优化
每日工作流模板
上午(高能量)
1. 检查隔夜CI结果和告警
2. 先攻克最难的问题(深度工作)
3. 批量代码审查(集中处理,不分散)
中午
4. 会议和协作(如不可避免)
5. 回复异步消息
下午
6. 实现工作(心流状态)
7. 为今天的代码编写测试
8. 提交PR、更新工单、为明天编写上下文
必备IDE快捷键
| 操作 | macOS | 重要性 |
|---|
| 跳转到文件 | Cmd+P | 永远不用浏览文件树 |
| 跳转到符号 |
Cmd+Shift+O | 直接跳转到函数/类 |
| 在项目中查找 | Cmd+Shift+F | 在代码库中查找任何内容 |
| 重命名符号 | F2 | 安全的项目级重命名 |
| 快速修复 | Cmd+. | 自动导入、自动修复代码检查问题 |
| 切换终端 | Ctrl+ | 留在编辑器中 |
| 多光标 | Cmd+D | 同时编辑多个出现位置 |
| 移动行 | Alt+上/下 | 无需剪切/粘贴即可重排代码 |
CLI别名和脚本
bash
Git加速
alias gs=git status
alias gc=git commit
alias gp=git push
alias gl=git log --oneline -20
alias gco=git checkout
alias gcb=git checkout -b
alias gpr=gh pr create --fill
开发
alias dev=npm run dev
alias build=npm run build
alias lint=npm run lint
alias test=npm run test
Docker
alias dc=docker compose
alias dcu=docker compose up -d
alias dcd=docker compose down
alias dcl=docker compose logs -f
项目导航
alias repo=cd ~/dev/myproject
值得编写的Shell脚本
| 脚本 | 用途 | 节省时间 |
|---|
| ./scripts/setup.sh | 一键本地环境搭建 | 每位新开发者数小时 |
| ./scripts/seed.sh |
用测试数据重置和填充数据库 | 每天10分钟 |
| ./scripts/deploy.sh | 按顺序构建、测试和部署 | 每次部署15分钟 |
| ./scripts/new-feature.sh | 搭建功能脚手架(路由、组件、测试) | 每个功能20分钟 |
| ./scripts/db-reset.sh | 删除、重建、迁移、填充数据库 | 每次10分钟 |
反模式
看似高效但实际破坏速度的模式。
| 反模式 | 后果 | 应该这样做 |
|---|
| 过度设计 | 为不存在的问题构建抽象层 | 解决今天的问题;模式出现时再重构 |
| 过早优化 |
优化不是瓶颈的代码 | 先分析性能,优化测量到的瓶颈 |
| 镀金 | 超出需求打磨功能 | 交付80%的解决方案,基于反馈迭代 |
| 无谓折腾 | 无休止地修复旁支问题 | 给旁支问题设定15分钟时间盒,然后创建工单 |
| 非我发明 | 重新构建开源已解决的问题 | 编写自定义代码前评估现有解决方案 |
| 琐事争论 | 长时间争论琐碎决策 | 设定5分钟计时器;如无共识,由提议者决定 |
|