一键导入
port-feature
Assess a feature or set of functionality in an external project and produce a concrete porting plan for adapting it into the current project
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Assess a feature or set of functionality in an external project and produce a concrete porting plan for adapting it into the current project
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | port-feature |
| description | Assess a feature or set of functionality in an external project and produce a concrete porting plan for adapting it into the current project |
| category | planning |
| model | claude-opus-4-8 |
| effort | high |
| argument-hint | <absolute-path-to-source-project> <functionality description> |
| disable-model-invocation | false |
| user-invocable | true |
Always obey .docs/guides/mcp-tools.md. Read it now if not already in context.
Run /primer first if you have not already this session.
Assess a specific feature or area of functionality in an external (source) project and produce a concrete, step-by-step plan for porting it into the current project. The plan accounts for differences in architecture, tech stack, conventions, and dependencies between the two codebases.
Arguments: $ARGUMENTS
Parse $ARGUMENTS:
/) is the <source-path><functionality> description/home/user/other-app authentication with JWT → source path = /home/user/other-app, functionality = authentication with JWTValidate:
<source-path> is missing or not absolute: stop and ask the user for the absolute path to the source project<functionality> is empty: stop and ask the user what functionality to portmcp__serena__find_file or Bash ls <source-path> to verify it is accessibleClarifying questions (ask before proceeding if ambiguous):
wiki/work/tasks/, a report in .docs/port/, or both?Note: Serena is scoped to the current project. Use Read and Bash to explore the source project at <source-path>. Do NOT use Serena tools on the source project's files.
<source-path>/README.md (if present) for declared purpose, setup, and architecture<source-path>/package.json / <source-path>/pyproject.toml / <source-path>/go.mod / <source-path>/Cargo.toml (whichever is present) for declared dependencies, scripts, and tech stackls <source-path> and ls <source-path>/src (or equivalent source root) to understand the top-level structureCLAUDE.md, ARCHITECTURE.md, docs/, or similar for documented design decisionsSearch for the specific functionality described in <functionality>:
find <source-path> -type f -name "*.ts" | xargs grep -l "<keyword>" 2>/dev/null | head -20 (adapt extension to the detected language)lsProduce an internal summary documenting:
SOURCE FEATURE: <feature name>
Language / Runtime: <language + version if visible>
Frameworks / Libraries used by this feature:
- <lib>: <what role it plays>
Entry points:
- <file:line> — <description>
Core files:
- <file> — <responsibility>
Data models / types:
- <name> — <shape and purpose>
External dependencies (infra/services):
- <database / queue / 3rd-party API>
Configuration:
- <env var / config key> — <purpose>
Test coverage:
- <test file> — <what it covers>
Use Serena for all current-project exploration. Do NOT use Bash ls/cat/find/grep on the current project's code files.
mcp__serena__list_memories → scan for memories related to the feature area and any architectural decisionsmcp__serena__read_memory on relevant memorieswiki/work/decisions/ index (if present) for accepted architectural decisions that constrain the portmcp__serena__list_dir(".", recursive=false) — top-level shapemcp__serena__list_dir("<src-root>", recursive=false) — source structurepackage.json / equivalent for declared dependencies and scriptsmcp__serena__get_symbols_overview on main source directories — identify modules, services, key interfacesSearch for anything in the current project that overlaps with or is adjacent to the feature being ported:
mcp__serena__find_symbol with name patterns from the source feature inventorymcp__serena__search_for_pattern for key terms, library names, or data model names from the sourcewiki/work/tasks/, wiki/work/requirements/, and wiki/work/roadmaps/ for any planned or in-progress work in this areaProduce an internal summary:
TARGET PROJECT PROFILE
Language / Runtime: <language + version>
Primary frameworks:
- <framework>: <role>
Relevant existing modules:
- <module/file> — <what it does>
Existing analogous functionality:
- <description of overlap or adjacent features>
Conventions observed:
- File organisation: <pattern>
- Naming: <pattern>
- Error handling: <pattern>
- Testing: <pattern>
- State management / data access: <pattern>
Existing dependencies relevant to the port:
- <dep>: <why relevant>
Missing dependencies (source uses, target does not have):
- <dep>: <what source uses it for>
With both inventories in hand, perform a structured comparison.
For each component of the source feature, determine the target equivalent:
| Source Component | Source Technology | Target Equivalent | Notes |
|---|---|---|---|
| HTTP routing | express Router | fastify routes | pattern change needed |
| ORM | Sequelize | Prisma | schema migration required |
| Auth tokens | jsonwebtoken | jose | API differs |
| … |
Classify each source file or module by porting effort:
| File / Module | Effort | Reason |
|---|---|---|
<file> | Direct | Same language, same library, minimal changes |
<file> | Adapt | Same language, different library — logic preserved, API calls change |
<file> | Rewrite | Different patterns, framework mismatch, or significant architectural delta |
<file> | Skip | Already exists in target / out of scope |
Effort levels: Direct (copy + light edits) · Adapt (rework API calls, preserve logic) · Rewrite (logic must be re-expressed from scratch in target conventions)
For each dependency the source feature uses that the target project lacks:
| Missing Dependency | Source Role | Target Option | Decision |
|---|---|---|---|
<lib> | <target equivalent or "add <lib>"> | Add / Replace / Avoid |
Prefer using existing target project dependencies before recommending new ones.
Identify where the ported feature will need to connect with existing target code:
List risks that could complicate the port:
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Low/Med/High | Low/Med/High |
Write a structured port plan to .docs/port/<kebab-feature-name>.md:
---
source-project: <source-path>
feature: <feature name>
assessed: <YYYY-MM-DD>
effort: <Low / Medium / High / Very High>
status: draft
---
# Port Plan: <Feature Name>
> **Source**: `<source-path>`
> **Feature**: <functionality description>
> **Overall effort**: <Low / Medium / High / Very High>
> **Summary**: <One sentence on what this port involves.>
## Source Feature Summary
<Condensed version of the Source Feature Inventory from Phase 1c>
## Target Project Context
<Condensed version of the Target Project Profile from Phase 2d>
## Technology Mapping
<Table from 3a>
## Complexity Breakdown
<Table from 3b>
## Dependency Changes
<Table from 3c>
## Integration Points
<Bullet list from 3d>
## Risks
<Table from 3e>
## Porting Steps
Ordered, dependency-respecting steps. Each step is concrete and actionable.
### Step 1: <title>
**Effort**: <Direct / Adapt / Rewrite>
**Files affected**:
- `<target file path>` — <create / modify / delete>
**What to do**:
<Specific instructions: what to copy, what to change, how to adapt the API, what conventions to follow>
**Definition of done**: <How to know this step is complete>
---
### Step 2: <title>
… (repeat for each step)
---
## Suggested Next Actions
- To create a task from this plan: `/task-add "Port <feature name> from <source-path>" --roadmap <if applicable>`
- To explore the source further: use Read on `<most important source file>`
- If a dependency decision is needed: <frame the specific decision>
If the user requested a task file (or if the plan is actionable enough to execute), suggest:
/task-add "Port <feature name> from <source-project-name>"
And note what context from the port plan should be included in the task.
After writing the plan file:
.docs/port/<kebab-feature-name>.mdls/cat/find/grep on current project code filesRead and Bash to explore <source-path>File a new bug report in wiki/work/bugs/ with required-on-report fields and append it to the bug index
Audit all project functionality at a high level and produce a 2-3 minute demo run book plus a Marp slideshow
Orchestrator for parallel agent teams. When invoked with a roadmap file path, drives every item through the full tackle → uat-generate → uat-auto pipeline until complete. When invoked with a task file path, runs that pipeline once and stops.
Refresh codebase context via Serena memories
Append a new item (task link or inline) to an existing roadmap in wiki/work/roadmaps/, optionally under a named phase
Create a structured execution-plan roadmap in wiki/work/roadmaps/ via short Socratic Q&A — captures goal, phases, and the initial hybrid (task-link OR inline) checklist