adapt-architecture
关于
This skill provides a structured methodology for executing gradual, safe architectural transformations like monolith-to-microservices migrations. It uses patterns such as strangler fig migration and chrysalis phases to enable parallel running, progressive cutover, and rollback design. Use it when a system is ready for a controlled evolution, requiring minimal disruption to dependent systems.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/adapt-architecture在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Adapt Architecture
Structural metamorphosis → system transform current → target form. Strangler fig, chrysalis, interface preserve → never stops.
Use When
assess-form→ READY- Evolve architecture, no downtime
- Monolith ↔ microservices
- Replace core subsystem, dependents keep running
- Data model evolve w/ backward compat
- Gradual, not big-bang
In
- Required: Current form assessment (
assess-form) - Required: Target architecture
- Required: Operational continuity reqs
- Optional: Transform budget (time, people, compute)
- Optional: Rollback reqs
- Optional: Parallel run duration
Do
Step 1: Blueprint
Plan path current → target.
- Sequence of intermediate forms:
- Current → Intermediate 1 → ... → Target
- Each intermediate operationally viable
- No intermediate harder to maintain
- Seams:
- Where cut current to insert new?
- Natural: interfaces, module bounds, data partitions
- Artificial: anti-corruption layers
- Pattern:
- Strangler fig: new grows around old, replaces gradually
- Chrysalis: wrap old, replace internals, shell preserves external interface
- Budding: parallel, traffic shifts (see
scale-colony) - Metamorphic migration: phased in dep order (leaves→roots)
- Interface preservation layer:
- External consumers no disrupt
- API versioning, backward-compat, adapters
- Temp scaffold → plan removal
Metamorphosis Patterns:
┌───────────────┬───────────────────────────────────────────────────┐
│ Strangler Fig │ New code intercepts routes one by one; │
│ │ old code handles everything else until replaced │
│ │ ┌──────────┐ │
│ │ │ Old ████ │ → │ Old ██ New ██ │ → │ New ████ │ │
│ │ └──────────┘ │
├───────────────┼───────────────────────────────────────────────────┤
│ Chrysalis │ Wrap old system in new interface; replace │
│ │ internals while external shell stays stable │
│ │ ┌──────────┐ ┌──[new]───┐ ┌──[new]───┐ │
│ │ │ old core │ → │ old core │ → │ new core │ │
│ │ └──────────┘ └──────────┘ └──────────┘ │
├───────────────┼───────────────────────────────────────────────────┤
│ Budding │ New system runs in parallel; traffic shifts │
│ │ ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐ │
│ │ │ Old │ │ New │ → │ Old │ │ New │ │
│ │ │ 100% │ │ 0% │ │ 0% │ │ 100% │ │
│ │ └──────┘ └──────┘ └──────┘ └──────┘ │
└───────────────┴───────────────────────────────────────────────────┘
→ Blueprint: intermediate forms, seams, pattern, preservation strategy. Concrete + testable.
If err: No clean seam → preliminary dissolution (dissolve-form) first. Intermediates not viable → steps too large → decompose.
Step 2: Scaffold
Temp infra → supports metamorphosis.
- Anti-corruption layer:
- Thin translation old ↔ new
- Routes reqs → correct system per migration state
- Translates data formats
- "Cocoon" protects transform
- Parallel run infra:
- Both systems deployable simultaneously
- Feature flags → traffic routing
- Comparison validates equivalence
- Rollback checkpoints:
- Each intermediate → rollback possible
- Rollback faster than forward step
- Data migration reversible (or dual-write during transition)
- Valid. harness:
- Auto tests → operational continuity
- Perf benchmarks → regression detection
- Data integrity checks
→ Scaffold (anti-corruption, parallel, rollback, valid.) in place pre-transform. Scaffold itself tested.
If err: Too expensive → simplify. Minimum: feature flag + rollback proc. Anti-corruption + parallel optional for small transforms.
Step 3: Progressive Cutover
Migrate incrementally.
- Order components:
- Start least-coupled, lowest-risk → build confidence
- Progress → more critical
- Most coupled/critical last
- Per component: a. Impl new ver behind anti-corruption layer b. Parallel: both process same in c. Compare out → equivalent (or differences documented) d. Confident → flip feature flag → switch traffic e. Monitor anomalies (increased sensitivity) f. Stable → decommission old ver
- Continuous delivery:
- Each cutover = normal deploy, not event
- System always known, tested, operational
- Issue → rollback → prev state operational
→ Functionality migrates component-by-component w/ valid. at each step. System always operational.
If err: Parallel reveals discrepancies → new impl bug → fix before cutover. Perf degrade → optimize new or anti-corruption layer too heavy. Team loses confidence → pause + stabilize. Half-migrated known > rushed full.
Step 4: Chrysalis Phase
Manage most vulnerable period — system between forms.
- Chrysalis reality:
- Partly old + partly new during migration
- Hybrid more complex than pure state
- Complexity peaks at midpoint
- Discipline:
- No new features during chrysalis
- Freeze non-essential deploys
- Increased monitoring + on-call
- Daily check-ins
- Mid-chrysalis assessment:
- Halfway → target still right?
- Market/reqs/team change?
- Continue, pause, redirect?
- Protect:
- Rollback path clear always
- Doc hybrid state → future debuggers need
- Resist "clean up" scaffold pre-complete
→ Chrysalis = deliberate, time-bounded, increased discipline + monitoring. Temp complexity = cost of safe transform.
If err: Drags too long → hybrid = new normal = worse than either. Set time limit. Limit hit → accelerate or accept hybrid as "new form".
Step 5: Complete + Stabilize
Finish + remove scaffold.
- Final cutover:
- Migrate last components
- Full valid. against complete new system
- Perf test under prod load
- Remove scaffold:
- Decommission anti-corruption layer
- Remove migration feature flags
- Clean up parallel infra
- Archive (don't delete) old code
- Post-metamorphosis stabilization:
- Run new form 2-4 weeks w/ enhanced monitoring
- Address real-world issues
- Update docs → new architecture
- Retrospective:
- What went well?
- Harder than expected?
- Do differently next?
- Update playbook
→ Transform complete. System new form. Scaffold removed. Docs updated. Team captured learnings.
If err: New form unstable post-cutover → maintain rollback, continue stabilize. Stabilize > planned period → design issue → targeted fixes or partial rollback worst component.
Check
- Blueprint shows viable intermediates
- Scaffold in place pre-migration
- Components migrate low→high risk
- Parallel validates equivalence each step
- Chrysalis time-bounded + feature freeze
- All scaffold removed post-transform
- Post-metamorphosis stabilization passes
- Retro captures learnings
Traps
- Big-bang: Transform all at once → abandons incremental safety → max blast radius. Always incremental.
- Permanent scaffold: Never removed → tech debt. Plan removal part of transform.
- Chrysalis denial: Pretending hybrid normal → features on unstable foundation. Enforce discipline.
- Target fixation: Better alternative signs ignored. Mid-chrysalis assessment exists for this.
- Transform fatigue: Long migrations exhaust teams. Days, not weeks per step. Celebrate milestones.
→
assess-form— prereq assessmentdissolve-form— rigid systems → create seamsrepair-damage— recovery when transform damagesshift-camouflage— surface adapt may sufficecoordinate-swarm— swarm sequencing across distributedscale-colony— growth pressure triggers architectural adaptimplement-gitops-workflow— GitOps deploy infra for cutoverreview-software-architecture— evaluate target architecture
GitHub 仓库
相关推荐技能
executing-plans
设计该Skill用于当开发者提供完整实施计划时,以受控批次方式执行代码实现。它会先审阅计划并提出疑问,然后分批次执行任务(默认每批3个任务),并在批次间暂停等待审查。关键特性包括分批次执行、内置检查点和架构师审查机制,确保复杂系统实现的可控性。
requesting-code-review
设计该Skill可在完成任务、实现主要功能或合并代码前自动调度代码审查子代理,确保实现符合需求和计划。它支持通过指定git SHA范围进行精准的代码变更审查,帮助开发者在关键节点及时发现潜在问题。核心原则是"早审查、勤审查",适用于开发流程的各个关键阶段。
connect-mcp-server
设计这个Skill指导开发者如何将MCP服务器连接到Claude Code,支持HTTP、stdio和SSE三种传输协议。它涵盖了从安装配置到认证安全的完整流程,适用于集成GitHub、Notion、数据库等外部服务。当开发者需要添加集成、配置外部工具或提及MCP相关功能时,这个Skill能提供实用的操作指南。
web-cli-teleport
设计该Skill帮助开发者根据任务特性选择Claude Code的Web或CLI界面,并指导如何在两种环境间无缝迁移会话。它能分析任务复杂度、迭代需求等要素,推荐最优工作界面和工作流。关键特性包括会话状态管理、环境切换指导和上下文优化建议。
