athanor
关于
The Athanor skill is a four-stage alchemical process for systematically transforming tangled or legacy code into optimized, modern output. It decomposes, purifies, illuminates, and then synthesizes code, using checkpoints between stages. Use it when incremental refactoring has failed and you need a full-cycle transformation for paradigms, deeply tangled modules, or stalled legacy conversions.
快速安装
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/athanor在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Athanor
Execute a four-stage alchemical transmutation of code or data — decomposing the prima materia, purifying its essence, illuminating its target form, and synthesizing the refined output. The athanor is the furnace that maintains steady heat across all stages.
When to Use
- Transforming legacy code into modern, well-structured equivalents
- Refactoring deeply tangled modules where incremental fixes keep failing
- Converting a codebase from one paradigm to another (procedural to functional, monolith to modular)
- Processing raw, messy data into clean analytical datasets
- When simpler refactoring approaches have stalled and a full-cycle transformation is needed
Inputs
- Required: The material to transform (file paths, module names, or data sources)
- Required: The desired end state (target architecture, paradigm, or format)
- Optional: Known constraints (must preserve API, can't change database schema, etc.)
- Optional: Prior failed transformation attempts and why they stalled
Procedure
Step 1: Nigredo — Decomposition
Break the prima materia into its constituent elements. Nothing is sacred; everything is cataloged.
- Inventory the material completely:
- List every function, class, module, or data entity
- Map all dependencies (imports, calls, data flows)
- Identify hidden coupling (shared globals, implicit state, side effects)
- Surface hidden assumptions:
- What undocumented behaviors does the code rely on?
- What error conditions are silently swallowed?
- What ordering dependencies exist?
- Catalog anti-patterns and technical debt:
- God objects, circular dependencies, copy-paste duplication
- Dead code paths, unreachable branches, vestigial features
- Hardcoded values, magic numbers, embedded configuration
- Produce the Nigredo Inventory: a structured catalog of every element, dependency, assumption, and anti-pattern
Got: A complete, unflinching inventory of the material. The inventory should feel uncomfortable — if it doesn't, the decomposition isn't thorough enough. Every hidden assumption is now explicit.
If fail: If the material is too large to inventory fully, decompose by module boundary and treat each module as a separate athanor run. If dependencies are too tangled to map, use grep/Grep to trace actual call sites rather than relying on documentation.
Step 2: Meditate — Calcination Checkpoint
Run the meditate skill to clear assumptions accumulated during nigredo.
- Set aside the nigredo inventory and clear mental context
- Anchor on the transformation goal stated in Inputs
- Observe what biases nigredo introduced — did the decomposition make certain approaches seem inevitable?
- Label any premature solution ideas as "tangent" and return to the goal
Got: A clear, unbiased state ready to evaluate the material without being anchored to its current form. The goal feels fresh rather than constrained by what was found.
If fail: If the nigredo findings keep pulling attention (a particularly bad anti-pattern, a clever hack that's tempting to preserve), write it down and explicitly set it aside. Proceed only when the goal is clearer than the current form.
Step 3: Albedo — Purification
Separate the essential from the accidental. Strip away everything that doesn't serve the target form.
- From the nigredo inventory, classify each element:
- Essential: Core business logic, irreplaceable algorithms, critical data transformations
- Accidental: Framework boilerplate, workarounds for old bugs, compatibility shims
- Toxic: Anti-patterns, security vulnerabilities, dead code
- Extract the essential elements into isolation:
- Pull core logic out of framework wrappers
- Separate data transformation from I/O
- Extract interfaces from implementations
- Remove toxic elements entirely — document what was removed and why
- For accidental elements, determine if equivalents exist in the target form
- Produce the Albedo Extract: purified essential logic with clean interfaces
Got: A set of pure, isolated functions/modules that represent the core value of the original material. Each piece is testable in isolation. The extract is significantly smaller than the original.
If fail: If essential and accidental are too intertwined to separate, introduce seam points (interfaces) first. If the material resists purification, it may need dissolve-form before the athanor can continue.
Step 4: Heal — Purification Assessment
Run the heal skill to assess whether the purification was thorough.
- Triage the albedo extract: is anything still carrying toxic residue?
- Check for drift: has the purification drifted from the original transformation goal?
- Assess completeness: are all essential elements accounted for, or were some discarded prematurely?
- Rebalance if needed: restore any essential elements that were incorrectly classified as accidental
Got: Confidence that the albedo extract is complete, clean, and ready for illumination. No essential logic was lost; no toxic patterns remain.
If fail: If the assessment reveals significant gaps, return to Step 3 with the specific gaps identified. Do not proceed to citrinitas with incomplete material.
Step 5: Citrinitas — Illumination
See the target form. Map the purified elements to their optimal structure.
- Pattern recognition: identify which design patterns serve the purified elements
- Does the data flow suggest pipes/filters, event sourcing, CQRS?
- Do the interfaces suggest strategy, adapter, facade?
- Does the module structure suggest hexagonal, layered, micro-kernel?
- Design the target architecture:
- Map each essential element to its new location
- Define the interfaces between components
- Specify the data flow through the new structure
- Identify what must be created new (has no equivalent in the original):
- New abstractions that unify duplicated logic
- New interfaces that replace implicit coupling
- New error handling that replaces silent failures
- Produce the Citrinitas Blueprint: a complete mapping from albedo extract to target form
Got: A clear, detailed blueprint where every essential element has a home and every interface is defined. The blueprint should feel inevitable — given the purified elements, this structure is the natural fit.
If fail: If multiple valid architectures compete, evaluate each against the constraints from Inputs. If no clear winner emerges, prefer the simplest option and document the alternatives as future options.
Step 6: Meditate — Pre-Synthesis Checkpoint
Run the meditate skill to prepare for the final synthesis.
- Clear the analytical context from citrinitas
- Anchor on the citrinitas blueprint as the synthesis guide
- Observe any anxiety about the transformation — is anything being rushed?
- Confirm readiness: the blueprint is clear, the material is purified, the constraints are known
Got: Calm clarity about what needs to be built. The synthesis phase should be execution, not design.
If fail: If doubt persists about the blueprint, revisit Step 5 with the specific concerns. Better to refine the blueprint than to begin synthesis with uncertainty.
Step 7: Rubedo — Synthesis
Compose the purified elements into their target form. The philosopher's stone: working, optimized code.
- Build the new structure following the citrinitas blueprint:
- Create files, modules, and interfaces as specified
- Migrate each essential element to its new location
- Implement new abstractions and interfaces
- Wire the components together:
- Connect data flows as designed
- Implement error propagation through new paths
- Configure dependency injection or module loading
- Verify the synthesis:
- Does each component work in isolation? (unit tests)
- Do the components compose correctly? (integration tests)
- Does the full system produce the same outputs as the original? (regression tests)
- Remove scaffolding:
- Delete temporary compatibility shims
- Remove migration aids
- Clean up any remaining references to the old structure
- Produce the Rubedo Output: the transmuted code, fully functional in its new form
Got: Working code that is measurably better than the original: fewer lines, clearer structure, better test coverage, fewer dependencies. The transformation is complete and the old form can be retired.
If fail: If synthesis reveals gaps in the blueprint, do not patch — return to Step 5 (citrinitas) to revise the design. If individual components fail, isolate and fix them before attempting full integration. The rubedo must not produce a half-transformed chimera.
Validation Checklist
- Nigredo inventory is complete (all elements, dependencies, assumptions cataloged)
- Meditate checkpoint passed between nigredo/albedo (assumptions cleared)
- Albedo extract contains only essential elements with clean interfaces
- Heal assessment confirms purification completeness
- Citrinitas blueprint maps every essential element to target form
- Meditate checkpoint passed between citrinitas/rubedo (ready for synthesis)
- Rubedo output passes regression tests against original behavior
- Rubedo output is measurably improved (complexity, coupling, test coverage)
- No toxic elements survived into the final output
- Transformation constraints from Inputs are satisfied
Pitfalls
- Skipping nigredo depth: Rushing decomposition means hidden coupling surfaces during synthesis. Invest fully in the inventory
- Preserving accidental complexity: Attachment to clever workarounds or "it works, don't touch it" code. If it's not essential, it goes
- Skipping meditate checkpoints: Cognitive momentum from one stage biases the next. The pauses are structural, not optional
- Blueprint-less synthesis: Starting to code before citrinitas is complete produces patchwork, not transmutation
- Incomplete regression testing: The rubedo must reproduce original behavior. Untested paths will break silently
- Scope creep during citrinitas: The illumination phase reveals opportunities for improvement beyond the original goal. Note them but don't pursue them — the athanor serves the stated transformation, not a hypothetical ideal
Related Skills
transmute— Lighter-weight transformation for single functions or small moduleschrysopoeia— Value extraction and optimization (turning base code into gold)meditate— Meta-cognitive clearing used as stage-gate checkpointsheal— Subsystem assessment used for purification validationdissolve-form— When material is too rigid for the athanor, dissolve firstadapt-architecture— Complementary approach for system-level migration patternsreview-software-architecture— Post-synthesis architecture review
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界面,并指导如何在两种环境间无缝迁移会话。它能分析任务复杂度、迭代需求等要素,推荐最优工作界面和工作流。关键特性包括会话状态管理、环境切换指导和上下文优化建议。
