claude-clone
Claude Clone
Goal: produce the smallest possible new code that faithfully reproduces a chosen capability from a high-signal upstream repo, by reading the upstream deeply rather than guessing at the shape.
This is a meta-skill. The deep upstream archaeology is delegated to
build-vs-clone (prospect mode). The dev environment is delegated to the
sibling skillbox repo. This skill's job is the stitching: scoping the
clone, calling the right sub-skills, extracting the irreducible core, and
landing it in the target repo.
On Trigger
Start the first progress update with:
Using claude-clone ...
Then, in one short paragraph, name:
- The upstream repo (or candidate set) being cloned
- The specific capability (a verb + object, not a vague area)
- The target repo the port lands in
- Whether the clone is
INLINE(one file dropped in) orMODULE(a small subdirectory with its own boundary)
If any of those four is missing, ask once before proceeding. Do not ask about anything else.
Non-Goals
- Full forks, vendor-ins, or "let's just submodule it". Use
build-vs-cloneinADOPTmode for those. - Borrowing patterns without reading code. If the user wants conceptual
inspiration only, route to
build-vs-cloneBORROW. - Greenfield design. If no upstream is named or implied, route to
build-vs-cloneto find one first. - Style-only translations (e.g., "rewrite this Go file in Python verbatim"). This skill recreates capabilities, not files.
Modes
CLONE mode (default)
Use when the user has named both an upstream and a target. Five steps:
- Frame — pin the four things from "On Trigger" in writing.
- Archaeology — delegate to
build-vs-cloneprospect mode against the upstream. Ask it to map only the subgraph that implements the capability: entry points, core data structures, the 2–5 functions that do the real work, and the tests that pin the behavior. - Reduce — apply the extraction recipe in references/extraction-recipe.md to collapse the subgraph to its irreducible form.
- Port — write the minimal new code in the target repo. Match the target's language and idioms, not the upstream's. Inline what you can, drop what the target already provides.
- Validate — run the port inside the
skillboxdev container (see references/skillbox-devcontainer.md) so the toolchain (compilers, linters, fuzzers, hyperfine, etc.) is already there. Land at least one behavioral test that pins a non-trivial case from the upstream's own tests.
SCOUT mode
Use when the user has named a capability but no upstream ("I want fuzzy
matching like fzf does it, find me the right repo first"). Run
build-vs-clone ecosystem-fit mode to pick the upstream, then re-enter
CLONE mode at step 2.
EXTRACT mode
Use when the user already has the upstream cloned locally and wants the minimal extraction without re-discovery. Skip step 2's prospect call; go straight to reading the named files and applying the extraction recipe.
Hard Rules
- Read before writing. Do not write a single line of port code before you have named the exact upstream files and line ranges that justify it. If you cannot cite source, you are guessing.
- Smallest viable port. Every function, struct, flag, and dependency in the port must earn its place against a concrete behavior the user asked for. Cut everything else, even if "it might be useful later."
- No transitive imports. If the upstream pulls in three helper packages to do the job, prefer to inline the 20 lines you actually need over vendoring all three. Document the inlining at the top of the ported file.
- Match the target, not the upstream. Ported code obeys the target repo's language, formatter, error-handling style, and test framework. A faithful clone reads like the target wrote it themselves.
- One test that proves it. Land at least one behavioral test ported (not copied verbatim) from the upstream's own test suite. This is the contract that says "the clone is real."
Delegation Contract
claude-clone does not duplicate work that build-vs-clone already does.
| Question | Owner |
|---|---|
| Is this worth cloning vs adopting vs building? | build-vs-clone |
| Which upstream is the right one? | build-vs-clone (SCOUT) |
| What does the upstream's relevant subgraph look like? | build-vs-clone (prospect) |
| What is the minimum code to recreate it? | claude-clone |
| Where does the code physically live in the target? | claude-clone |
| Does it pass a behavioral test? | claude-clone (in skillbox) |
If build-vs-clone returns ADOPT or BORROW for the underlying question,
stop and report that result instead of forcing a clone.
Dev Container
All build/test/bench work for the port runs inside the sibling skillbox
repo's main workspace container. See
references/skillbox-devcontainer.md
for the exact entry commands and the assumed package surface. Do not
install language toolchains on the host to support a clone — that is the
entire reason skillbox exists.
Output Shape
When the clone is complete, report:
- Upstream + commit SHA read during archaeology
- Files cited (path + line range) that the port is derived from
- New files in the target with line counts
- Behavioral test(s) added and what upstream test they mirror
- Deliberately omitted upstream features and why
- skillbox commands the user can rerun to re-validate
More from build000r/skills
openclaw-client-bootstrap
Build a production-ready OpenClaw client setup for DigitalOcean, Tailscale, Telegram, and SPAPS using a reusable hardened template with read-only defaults and human approval. Use for "set up OpenClaw on a droplet", "create a first claw kit", "bootstrap client box", or approval-gated OpenClaw deployment work.
20unclawg-internet
Run self-service OpenClaw onboarding with browser device auth, agent machine-key provisioning, a soul interview, and discovery-mode setup. Use for "/unclawg-internet", "set me up", "connect to openclaw", "onboard me", "sign up for openclaw", or approval-gated setup.
15domain-scaffolder-backend
|
7unclawg-discover
Run multi-platform customer discovery across Reddit, Hacker News, Twitter/X, and LinkedIn, then output a ranked engagement feed for downstream workflows. Use for "/unclawg-discover", "find customers", "find leads", "find posts to reply to", "build engagement queue", or agent-builder prospecting.
3remotion-best-practices
Best practices for Remotion - Video creation in React. Use when working with Remotion compositions, animations, sequences, or video rendering. Covers project setup for a shared Remotion hub, animation patterns, timing/interpolation, audio, captions, and media handling.
3divide-and-conquer
Decompose complex work into independent parallel sub-agents with no write overlap, synthesize or consume a `WORKGRAPH.md` execution artifact, and launch describe-style worker briefs before review. Use before spawning multiple agents for multi-file, multi-domain, or naturally parallel tasks.
3