assimilate
Assimilate
Overview
Use this skill when the user asks the framework to improve itself, or when EVOLVE identifies a capability gap that should be benchmarked against other codebases.
When to Use
- User request: "improve the framework", "compare to competitor repos", "adopt best ideas"
- EVOLVE phase where external pattern benchmarking is needed before creating new artifacts
- Reflection/recommend-evolution output calls for concrete upgrade candidates
Iron Laws
- NEVER implement borrowed ideas directly — always produce a comparable feature map, explicit gap list, and TDD backlog with checkpoints before writing any code; direct copying without analysis creates undetected regressions.
- ALWAYS create workspace under
.claude/context/runtime/assimilate/<run-id>/— never clone repos to arbitrary or project-root locations; contained workspaces enable clean teardown and prevent accidental overwrites. - ALWAYS use shallow clones (
--depth=1) when possible — full history is unnecessary for feature analysis and wastes disk; only use full clone when commit history is part of the comparison surface. - NEVER execute external project scripts during assimilation — no
npm install,make, or./setup.shfrom cloned repos; analysis is read-only; untrusted scripts can modify the host environment. - ALWAYS score gaps by impact×feasibility before writing the TDD backlog — an unordered backlog wastes implementation effort on low-value items; prioritize by expected benefit divided by complexity.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Implementing external patterns without gap analysis | Blind copying introduces incompatible assumptions | Always produce feature map and gap list first |
| Cloning repos outside assimilate workspace | Leftover files pollute project root, hard to clean | Use .claude/context/runtime/assimilate/<run-id>/ |
Running npm install / project scripts from clones |
Untrusted scripts can modify host environment | Read-only analysis only; never execute external scripts |
| Writing TDD backlog items without acceptance criteria | Developers can't verify completion objectively | Every backlog item needs RED test + measurable GREEN criteria |
| Including gaps without complexity/risk scoring | Low-value work gets implemented over high-value gaps | Score all gaps: impact, complexity (S/M/L), risk (low/med/high) |
Four-Phase Execution
Default kickoff message:
I’ll do this in four phases: clone competitor repos into a temp workspace, extract comparable features/tooling surfaces, build a gap list against our repo, then convert that into a concrete TDD backlog with checkpoints to implement and validate improvements. I’m starting by creating the temp comparison workspace and cloning the repos.
Phase 1: Clone + Stage
- Create workspace under
.claude/context/runtime/assimilate/<run-id>/. - Clone target repos into
externals/<repo-name>/using shallow clones where possible. - Capture inventory:
- commit hash
- default branch
- top-level structure snapshot
- Never execute untrusted project scripts during assimilation.
Phase 2: Comparable Surface Extraction
Extract structured comparisons for each external repo and local repo across these surfaces:
- Memory model (tiers, retrieval APIs, persistence, indexing)
- Search stack (lexical, semantic, hybrid, daemon/prewarm, ranking)
- Agent communication/orchestration (task protocol, hooks, event/state flow)
- Creator system (templates, validators, CI gates, policy enforcement)
- Observability/quality (metrics, eval harnesses, state guards)
Output one normalized comparison table per surface.
Phase 3: Gap List
Build a local gap list with:
gap_id- current state
- reference pattern (external source + path)
- expected benefit
- complexity (
S|M|L) - risk (
low|medium|high) - recommended artifact type (
skill|workflow|hook|schema|tool|agent)
Prioritize by impact and implementation feasibility.
Phase 4: TDD Upgrade Backlog
Convert prioritized gaps into implementable TDD items:
- RED: failing test(s) and measurable acceptance criteria
- GREEN: minimal implementation path
- REFACTOR: hardening/cleanup
- VERIFY: integration checks, hook/CI gates, docs updates
Each backlog item must include:
- owner agent
- target files
- command-level validation steps
- rollback/safety notes
Alternative: Seven-Phase CLI Conversion Pipeline
When assimilating a CLI tool (rather than a full framework), use this streamlined pipeline inspired by CLI-Anything (HKUDS/CLI-Anything):
Phase A: Analyze
- Run
TOOL --help(andTOOL SUBCOMMAND --help) to auto-discover all flags, subcommands, and options. - Parse output into a structured capability map:
{ commands: [], flags: [], outputFormats: [] }. - Identify the tool's primary domain and interaction model (REPL, one-shot, daemon).
Phase B: Design
- Map CLI capabilities to agent-studio skill sections (When to Use, Workflow, Commands).
- Define the JSON output contract — all generated wrappers MUST support
--output jsonor equivalent structured output to eliminate parsing complexity for agents. - Identify which capabilities map to existing skills (dedup) vs. new skills (create).
Phase C: Implement
- Write the SKILL.md with workflow steps that invoke the CLI tool.
- Include concrete command examples with expected JSON output.
- Add error handling for common CLI failure modes (missing auth, network errors, invalid args).
Phase D: Plan Tests
- Define RED tests: expected CLI output for known inputs.
- Define boundary tests: invalid flags, missing required args, permission errors.
Phase E: Write Tests
- Create test fixtures with mock CLI output.
- Write assertions against the JSON output contract.
Phase F: Document
- Generate usage examples for each major workflow.
- Document environment requirements (tool installation, auth setup).
Phase G: Publish
- Register in skill index via
pnpm skills:index. - Update agent-registry if skill is assigned to a specialist agent.
Iterative Refinement Loop
After initial publication, run a refinement cycle:
- Compare the skill's coverage against the full
--helpoutput. - Identify uncovered subcommands or flags.
- Repeat Phases B-G for uncovered capabilities.
- Score coverage:
covered_commands / total_commands * 100%. - Target >80% coverage before marking skill as complete.
Output Contract
Return markdown with sections in this order:
## Repo Set## Comparable Surfaces## Gap List## TDD Backlog## Execution Checkpoints
If comparison repos are missing, return a blocked state with exact clone commands needed.
Tooling Notes
- Prefer
pnpm search:code/ripgrepin local repo for precise parity checks. - Use
research-synthesiswhen external research context is needed before scoring gaps. - Use
framework-contextbefore writing system-level recommendations. - Use
recommend-evolutionto record high-priority changes after backlog generation.
Memory Protocol (MANDATORY)
Before work:
cat .claude/context/memory/learnings.md
After work:
- Record assimilated patterns:
.claude/context/memory/learnings.md - Record adoption risks/tradeoffs:
.claude/context/memory/decisions.md - Record unresolved blockers:
.claude/context/memory/issues.md