Skip to main content
skill CX Codex

porting-another-repository — Claude Code skill: plan a code port

Reads a feature in your current repo and the target repo's conventions, then writes a porting plan into tmp/ as files you apply yourself.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dyoshikawa/rulesync --skill porting-another-repository -a claude-code
Open on GitHub

What porting-another-repository does

The skill takes two inputs: target_repo (where you port into — owner/repo, a URL, or a local path) and scope (what you port — a feature name, directory, file, or rough description). Direction is fixed. The source is the repository you run the skill in, the target is target_repo. It never edits the target repo; it only leaves a plan on disk.

Work happens in steps. First the source: entry points, in-repo dependencies, build and test wiring, external packages. Then the target — language, package manager, directory layout, naming style, and existing code that overlaps with what you are moving. A local path is inspected directly; a remote one goes through gh repo view, gh api repos/<owner/repo>/contents/<path>, and the deepwiki MCP server. After that come a source-to-target mapping table, an ordered list of changes, and copy-paste diffs.

Output lands in tmp/porting-another-repository-{YYYYMMDD-HHmm}/. 00-overview.md is written last and acts as the index, next to 01-source-analysis.md, 02-target-analysis.md, 03-porting-plan.md, and 04-diff.md. For a remote target you need gh set up and deepwiki reachable, otherwise the target analysis is limited to what is visible from outside. The timestamp is computed once per run, so every file shares one directory.

What it helps with

  • move a feature from one repo into another without tracing dependencies by hand
  • learn a target repo's conventions before writing code into it
  • get ready-to-paste diffs for the target project
  • surface risks and open questions before the port starts
  • find everything that travels with a feature: helpers, types, configs

Example prompts for the agent

  • Port the JWT auth flow from this repo into acme/backend
  • Plan a port of the src/queue directory into /home/me/worker
  • What has to come along with the report export feature when porting it to owner/repo?

How to install porting-another-repository

1Skills CLI (Vercel)

npx skills add dyoshikawa/rulesync --skill porting-another-repository -a claude-code

2Manually: put the files in place

~/.claude/skills/porting-another-repository/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/porting-another-repository/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about porting-another-repository

How do I install porting-another-repository in Claude?

Run npx skills add dyoshikawa/rulesync --skill porting-another-repository -a claude-code. The skill lands in ~/.claude/skills/porting-another-repository/SKILL.md.

What does porting-another-repository do?

It analyzes the chosen part of your current repo and the target repo's conventions, then writes a porting plan and concrete diffs into tmp/porting-another-repository-{YYYYMMDD-HHmm}/. The target repo is left untouched — you apply the changes.

What do I need to analyze a remote target repo?

For an owner/repo or a URL the skill uses gh repo view, gh api, and the deepwiki MCP server. Without them it can only work from what is publicly visible.

Source text

SKILL.md · MIT
---
name: porting-another-repository
description: >-
  Plan how to port a feature, configuration, or implementation from this
  repository into another repository. Analyzes the source feature here and the
  target repo's conventions, then writes a multi-file porting plan (overview,
  source analysis, target analysis, plan, diff) to
  tmp/porting-another-repository-{YYYYMMDD-HHmm}/*.md for the user to review and
  apply manually.
targets:
  - "*"
---

arguments = the user's request

Parse `arguments` as:

- `target_repo`: the repository to port INTO, in `owner/repo` form, a URL, or a local path
- `scope`: what to port from THIS repository (a feature name, directory, file, or rough description)

If `target_repo` is not provided, ask the user which repository to port into.
If `scope` is not provided, ask the user what part of this repository they want to port.

The direction is fixed: the **source** is this repository, the **target** is `target_repo`. This skill never modifies the target repository directly — it only produces a porting plan on disk for the user to apply manually.

## Step 0: Prepare the Output Directory

Compute a single timestamp once and reuse it for every file:

```bash
ts="$(date +%Y%m%d-%H%M)"
out="tmp/porting-another-repository-${ts}"
mkdir -p "${out}"
```

All artifacts in this run go under `${out}/`. Do not recompute the timestamp per file — every file must share the same directory.

## Step 1: Analyze the Source (This Repository)

Understand exactly what is being ported. Prefer targeted symbol and search tools over reading whole files.

Identify, for the requested `scope`:

- The entry points and the files that implement it.
- Its dependencies within this repo (shared utilities, base classes, types, config) that would also need to come along.
- Any build/test/tooling wiring it relies on (scripts, configs, fixtures, CI steps).
- External package dependencies it pulls in.

Write the result to `${out}/01-source-analysis.md`.

## Step 2: Analyze the Target Repository

Understand the target's conventions so the port fits in naturally.

- If `target_repo` is a local path, inspect it directly (grep/read).
- If it is `owner/repo` or a URL, use `gh repo view`, `gh api repos/<owner/repo>/contents/<path>`, and the deepwiki MCP (`mcp__deepwiki__ask_question`, `mcp__deepwiki__read_wiki_contents`) to learn its structure.

Capture:

- Language, package manager, build/test tooling, and directory layout.
- Where the equivalent of the source feature would live in the target's structure.
- Naming, style, and architectural conventions the port must follow.
- Existing functionality that overlaps or conflicts with what is being ported.

Write the result to `${out}/02-target-analysis.md`.

## Step 3: Produce the Porting Plan

Map source concepts onto the target. Use a small mapping table (source path/symbol → target path/symbol) — it is far easier to read than prose for this.

Cover:

- A step-by-step sequence of changes, ordered so the target stays buildable.
- Required dependency additions (with versions) and tooling/config changes.
- Adaptations needed to match the target's conventions (renames, refactors, API shape changes).
- Risks, open questions, and anything deliberately out of scope.
- A short test/verification plan for the target.

Write the result to `${out}/03-porting-plan.md`.

## Step 4: Produce Concrete Diffs

For each step in the plan, write the concrete code/config the user should add to the target, in fenced blocks labeled with their target file paths. Where an existing target file changes, show a unified-diff-style snippet. Keep these ready to copy-paste.

Write the result to `${out}/04-diff.md`.

## Step 5: Write the Overview and Report

Write `${out}/00-overview.md` last, as the index for the run. It must contain:

- Source repo and `scope`, target repo, and the timestamp.
- A one-paragraph summary of what is being ported and the recommended approach.
- A links list to the other files (`01-source-analysis.md` … `04-diff.md`) with a one-line description of each.
- Top risks and open questions surfaced during the analysis.

Then report to the user:

- The absolute path of `${out}/`.
- A one-line summary of the port (what moves, where it lands).
- The top open questions the user needs to decide before applying the plan.

© dyoshikawa · MIT · dyoshikawa/rulesync

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set11

rulesync-feature-research Maps rulesync features against coding-agent docs: what is supported, where the gaps are, how clients differ. CX Codex +1 ★ 1,552repo stars resolve-scrap-issues This skill walks the newest GitHub issues labeled maintainer-scrap, validates each one, then either closes it or opens a single pull request that fixes the rest. CX Codex +1 ★ 1,552repo stars rebase-latest-main A skill that walks the agent through fetching origin/main, rebasing the current branch and resolving conflicts. Handy when your branch has drifted behind main. CX Codex +1 ★ 1,552repo stars prs-awaiting-author Lists open pull requests where the next move belongs to the author: failing CI, unaddressed review comments, or a maintainer question waiting on a reply. CX Codex +1 ★ 1,552repo stars goal-release Drives a release end to end: opens the PR, waits for green CI, merges it and updates the Homebrew formula. Handy when a version has to ship in one go. CX Codex +1 ★ 1,552repo stars git-worktree-runner A skill that teaches the agent to drive git worktrees through the gtr CLI: create, open in an editor, run commands, remove. CX Codex +1 ★ 1,552repo stars draft-issue-to-external-repository Drafts a GitHub issue for a repository you do not own: reads the project's templates and title style, settles scope with you, and saves the body to a file. CX Codex +1 ★ 1,552repo stars create-issue A skill that walks through issue creation step by step: gathers context, checks the codebase, drafts English text, and assigns labels. Handy when you want a tidy issue without doing it manually. CX Codex +1 ★ 1,552repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor