chrysopoeia
정보
크리소포이아는 기존의 기능적인 코드베이스를 완전히 재작성하지 않고 최적화하고 정제하는 Claude 스킬입니다. 성능을 체계적으로 개선하고, API를 정리하며, 데드 코드를 제거하여 번들 크기와 메모리 사용량을 줄입니다. 느리거나 복잡한 코드를 더 효율적이고 유지보수하기 쉬운 상태로 다듬을 때 사용하세요.
빠른 설치
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/chrysopoeiaClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Chrysopoeia
Extract max value from existing code. Identify gold (high-value, well-designed), lead (resource-heavy, poorly optimized), dross (dead weight). Amplify gold, transmute lead, remove dross.
When Use
- Optimizing working but sluggish codebase for performance
- Refining API surface with accumulated cruft
- Reducing bundle size, memory footprint, startup time
- Prepping code for open-source release (extract valuable core)
- Code works correctly but doesn't shine — needs polish, not rewrite
Inputs
- Required: Codebase or module to optimize (file paths)
- Required: Value metric (performance, API clarity, bundle size, readability)
- Optional: Profiling data or benchmarks showing current performance
- Optional: Budget or target (e.g., "reduce bundle by 40%", "sub-100ms response")
- Optional: Constraints (can't change public API, must maintain backward compat)
Steps
Step 1: Assay — Classify the Material
Classify every element by value contribution.
- Define value metric from Inputs (performance, clarity, size, etc.)
- Inventory elements (functions, modules, exports, dependencies)
- Classify each:
Value Classification:
+--------+---------------------------------------------------------+
| Gold | High value, well-designed. Amplify and protect. |
| Silver | Good value, minor imperfections. Polish. |
| Lead | Functional but heavy — poor performance, complex API. |
| | Transmute into something lighter. |
| Dross | Dead code, unused exports, vestigial features. |
| | Remove entirely. |
+--------+---------------------------------------------------------+
- Performance optimization: profile first.
- Identify hot paths (where time spent)
- Identify cold paths (rarely-run code, may be dross)
- Measure memory allocation patterns
- Produce Assay Report: element-by-element classification with evidence
Got: Every significant element classified with evidence. Gold elements identified for protection. Lead elements prioritized by impact.
If fail: No profiling tools? Use static analysis — function complexity (cyclomatic), dependency count, code size as proxies. Codebase too large? Focus critical path first.
Step 2: Refine — Amplify the Gold
Protect and enhance highest-value elements.
- Each Gold element:
- Ensure comprehensive tests (most valuable assets)
- Document interface clearly if not already
- Consider extraction as reusable module
- Each Silver element:
- Apply targeted improvements (better naming, clearer types, minor optimizations)
- Bring test coverage to Gold level
- Resolve minor code smells without restructuring
- Do not modify Gold/Silver behavior. Only improve polish and protection.
Got: Gold and Silver elements better tested, documented, protected. No behavioral changes. Quality improvements only.
If fail: "Gold" element reveals hidden problems under closer inspection? Reclassify. Honest about value beats protecting flawed code.
Step 3: Transmute — Convert Lead to Gold
Transform heavy, inefficient elements into optimized equivalents.
- Prioritize Lead elements by impact (highest resource consumption first)
- Each Lead element, choose transmutation strategy:
- Algorithm optimization: Replace O(n^2) with O(n log n). Eliminate redundant computation.
- Caching/memoization: Store expensive results requested repeatedly
- Lazy evaluation: Defer computation until results actually needed
- Batch processing: Combine many small operations into fewer large ones
- Structural simplification: Reduce cyclomatic complexity, flatten deep nesting
- Apply strategy. Measure improvement.
- Before/after benchmarks for performance changes
- Before/after line counts for complexity changes
- Before/after dependency counts for coupling changes
- Verify behavioral equivalence after each transmutation.
Got: Measurable improvement on target value metric. Each transmuted element performs better than Lead predecessor. Identical behavior maintained.
If fail: Lead element resists optimization within current interface? Interface itself may be problem. Transmutation may require changing how element is called, not just implementation.
Step 4: Purge — Remove the Dross
Eliminate dead weight.
- Each Dross element, verify truly unused:
- Search all references (grep, IDE find-usages)
- Check dynamic references (string-based dispatch, reflection)
- Check external consumers (if library)
- Remove confirmed dross:
- Delete dead code, unused exports, vestigial features
- Remove unused dependencies from package manifests
- Clean up config for removed features
- Verify nothing breaks after each removal (run tests)
- Document what removed and why (commit messages, not code)
Got: Codebase lighter. Bundle size, dependency count, or code volume measurably reduced. All tests pass.
If fail: Removing element breaks something? Wasn't dross. Reclassify. Dynamic references make usage hard to verify? Add temp logging before deletion to confirm no runtime access.
Step 5: Verify — Weigh the Gold
Measure overall improvement.
- Run same benchmarks/metrics from Step 1
- Compare before/after on target value metric
- Document chrysopoeia results:
- Elements refined (Gold/Silver improvements)
- Elements transmuted (Lead → Gold, with measurements)
- Elements purged (Dross removed, with size/count impact)
- Overall metric improvement (e.g., "47% faster", "32% smaller bundle")
Got: Measurable, documented improvement on target value metric. Codebase demonstrably more valuable.
If fail: Overall improvement marginal? Original code may have been better than assumed. Document learnings — knowing code is near-optimal is itself valuable.
Checks
- Assay report classifies all significant elements with evidence
- Gold elements have comprehensive tests and documentation
- Lead transmutations show measurable before/after improvement
- Dross removal verified with reference checks before deletion
- All tests pass after each stage
- Overall improvement measured and documented
- No behavioral regressions introduced
- Constraints from Inputs satisfied
Pitfalls
- Premature optimization: Optimizing without profiling. Measure first. Optimize hot paths.
- Polishing dross: Effort on code that should be deleted. Classify before refining.
- Breaking Gold: Optimization that degrades best code. Gold should only get better, never worse.
- Unmeasured claims: "Feels faster" is not chrysopoeia. Every improvement quantified.
- Optimizing cold paths: Effort on code that runs once at startup when bottleneck is request loop.
See Also
athanor— Full four-stage transformation when chrysopoeia reveals code needs restructuring, not just optimizationtransmute— Targeted conversion when Lead element needs paradigm shiftreview-software-architecture— Architecture-level evaluation complementing code-level chrysopoeiareview-data-analysis— Data pipeline optimization parallels code optimization
GitHub 저장소
연관 스킬
executing-plans
디자인executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.
requesting-code-review
디자인이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.
connect-mcp-server
디자인이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.
web-cli-teleport
디자인이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.
