MCP HubMCP Hub
스킬 목록으로 돌아가기

chrysopoeia

pjt222
업데이트됨 Yesterday
17
2
17
GitHub에서 보기
디자인api

정보

크리소포이아는 기존의 작동하는 코드베이스를 최적화하고 정제하는 Claude 스킬입니다. 이는 성능을 체계적으로 향상시키고, API를 개선하며, 데드 코드를 제거하여 전체 재작성 없이 최대 가치를 추출합니다. 느린 코드를 다듬고, 번들 크기를 줄이거나, 최상의 패턴을 강화하여 릴리스를 위한 코드를 준비하는 데 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/chrysopoeia

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Chrysopoeia

Systematically extract maximum value from existing code — identify what's golden (high-value, well-designed), what's lead (resource-heavy, poorly optimized), and what's dross (dead weight). Then amplify the gold, transmute the lead, and remove the dross.

When to Use

  • Optimizing a working but sluggish codebase for performance
  • Refining an API surface that has accumulated cruft over iterations
  • Reducing bundle size, memory footprint, or startup time
  • Preparing code for open-source release (extracting the valuable core)
  • When code works correctly but doesn't shine — it 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)

Procedure

Step 1: Assay — Classify the Material

Systematically classify every element by its value contribution.

  1. Define the value metric from Inputs (performance, clarity, size, etc.)
  2. Inventory the codebase elements (functions, modules, exports, dependencies)
  3. Classify each element:
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.                                        |
+--------+---------------------------------------------------------+
  1. For performance optimization, profile first:
    • Identify hot paths (where time is spent)
    • Identify cold paths (rarely executed code that may be dross)
    • Measure memory allocation patterns
  2. Produce the Assay Report: element-by-element classification with evidence

Got: Every significant element classified with evidence. Gold elements are identified for protection during optimization. Lead elements are prioritized by impact.

If fail: If profiling tools aren't available, use static analysis: function complexity (cyclomatic), dependency count, and code size as proxies. If the codebase is too large, focus on the critical path first.

Step 2: Refine — Amplify the Gold

Protect and enhance the highest-value elements.

  1. For each Gold element:
    • Ensure it has comprehensive tests (these are your most valuable assets)
    • Document its interface clearly if not already done
    • Consider whether it could be extracted as a reusable module
  2. For each Silver element:
    • Apply targeted improvements (better naming, clearer types, minor optimizations)
    • Bring test coverage to Gold-level
    • Resolve minor code smells without restructuring
  3. Do not modify Gold/Silver behavior — only improve their polish and protection

Got: Gold and Silver elements are better tested, documented, and protected. No behavioral changes, only quality improvements.

If fail: If a "Gold" element reveals hidden problems during closer inspection, reclassify it. Better to be honest about value than to protect flawed code.

Step 3: Transmute — Convert Lead to Gold

Transform heavy, inefficient elements into optimized equivalents.

  1. Prioritize Lead elements by impact (highest resource consumption first)
  2. For each Lead element, choose a transmutation strategy:
    • Algorithm optimization: Replace O(n^2) with O(n log n), eliminate redundant computation
    • Caching/memoization: Store expensive results that are requested repeatedly
    • Lazy evaluation: Defer computation until results are needed
    • Batch processing: Combine many small operations into fewer large ones
    • Structural simplification: Reduce cyclomatic complexity, flatten deep nesting
  3. Apply the strategy and measure the improvement:
    • Before/after benchmarks for performance changes
    • Before/after line counts for complexity changes
    • Before/after dependency counts for coupling changes
  4. Verify behavioral equivalence after each transmutation

Got: Measurable improvement on the target value metric. Each transmuted element performs better than its Lead predecessor while maintaining identical behavior.

If fail: If a Lead element resists optimization within its current interface, consider whether the interface itself is the problem. Sometimes the transmutation requires changing how the element is called, not how it's implemented.

Step 4: Purge — Remove the Dross

Eliminate dead weight systematically.

  1. For each Dross element, verify it's truly unused:
    • Search for all references (grep, IDE find-usages)
    • Check for dynamic references (string-based dispatch, reflection)
    • Check for external consumers (if the code is a library)
  2. Remove confirmed dross:
    • Delete dead code, unused exports, vestigial features
    • Remove unused dependencies from package manifests
    • Clean up configuration for removed features
  3. Verify nothing breaks after each removal (run tests)
  4. Document what was removed and why (in commit messages, not in code)

Got: The codebase is lighter. Bundle size, dependency count, or code volume measurably reduced. All tests still pass.

If fail: If removing an element breaks something, it wasn't dross — reclassify it. If dynamic references make it hard to verify usage, add temporary logging before deletion to confirm no runtime access.

Step 5: Verify — Weigh the Gold

Measure the overall improvement.

  1. Run the same benchmarks/metrics used in Step 1
  2. Compare before/after on the target value metric
  3. Document the chrysopoeia results:
    • Elements refined (Gold/Silver improvements)
    • Elements transmuted (Lead → Gold conversions 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 the target value metric. The codebase is demonstrably more valuable than before.

If fail: If overall improvement is marginal, the original code may have been better than assumed. Document what was learned — knowing that code is already near-optimal is itself valuable.

Validation Checklist

  • 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 are satisfied

Pitfalls

  • Premature optimization: Optimizing without profiling. Always measure first, optimize the hot paths
  • Polishing dross: Spending effort improving code that should be deleted. Classify before refining
  • Breaking Gold: Optimization that degrades the best code. Gold elements should only get better, never worse
  • Unmeasured claims: "It feels faster" is not chrysopoeia. Every improvement must be quantified
  • Optimizing cold paths: Spending effort on code that runs once at startup when the bottleneck is the request loop

Related Skills

  • athanor — Full four-stage transformation when chrysopoeia reveals the code needs restructuring, not optimization
  • transmute — Targeted conversion when a Lead element needs a paradigm shift
  • review-software-architecture — Architecture-level evaluation that complements code-level chrysopoeia
  • review-data-analysis — Data pipeline optimization parallels code optimization

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-lite/skills/chrysopoeia
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

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 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.

스킬 보기