Athanor

From pjt222/agent-almanac · View interactive version

Athanor is an AI agent skill from the GitHub repository pjt222/agent-almanac. Four-stage alchemical code transmutation — nigredo (decomposition), albedo (purification), citrinitas (illumination), rubedo (synthesis) — with meditate and heal checkpoints between stages. Transforms tangled or legacy code into optimized, well-structured output through systematic material analysis.

How to use this skill

Skill file

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

Inputs

Procedure

Step 1: Nigredo — Decomposition

Break the prima materia into its constituent elements. Nothing is sacred; everything is cataloged.

  1. Inventory the material completely:
  1. Surface hidden assumptions:
  1. Catalog anti-patterns and technical debt:
  1. 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.

  1. Set aside the nigredo inventory and clear mental context
  2. Anchor on the transformation goal stated in Inputs
  3. Observe what biases nigredo introduced — did the decomposition make certain approaches seem inevitable?
  4. 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.

  1. From the nigredo inventory, classify each element:
  1. Extract the essential elements into isolation:
  1. Remove toxic elements entirely — document what was removed and why
  2. For accidental elements, determine if equivalents exist in the target form
  3. 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.

  1. Triage the albedo extract: is anything still carrying toxic residue?
  2. Check for drift: has the purification drifted from the original transformation goal?
  3. Assess completeness: are all essential elements accounted for, or were some discarded prematurely?
  4. 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.

  1. Pattern recognition: identify which design patterns serve the purified elements
  1. Design the target architecture:
  1. Identify what must be created new (has no equivalent in the original):
  1. 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.

  1. Clear the analytical context from citrinitas
  2. Anchor on the citrinitas blueprint as the synthesis guide
  3. Observe any anxiety about the transformation — is anything being rushed?
  4. 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.

  1. Build the new structure following the citrinitas blueprint:
  1. Wire the components together:
  1. Verify the synthesis:
  1. Remove scaffolding:
  1. 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

Pitfalls

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.