Project Transfer
Transfer proven developer and agent lessons from a completed project (SOURCE)
into a new or existing target project (TARGET), adapting across different
languages, frameworks, and agent harnesses.
Work proceeds in two discrete phases with a human-reviewable PACK file in between:
- Phase 1 (Harvest): Audits
SOURCE and agent session logs; writes only the PACK.
- Phase 2 (Adopt): Reads the reviewed PACK and adapts lessons into
TARGET.
Different agents or sessions can run Phase 1 and Phase 2 independently.
Inputs & Defaults
| Input |
Required |
Default |
Notes |
SOURCE path |
Yes (Phase 1) |
Prompt user if missing |
Path to completed codebase |
PACK path |
Optional |
<source-folder>-lessons.md next to SOURCE |
Intermediate review file |
TARGET path |
Yes (Phase 2) |
Prompt user before Phase 2 |
Destination repository |
Ask only for missing inputs. Never prompt for TARGET during Phase 1.
Ground Rules
- Zero Target Writes in Phase 1: Phase 1 reads
SOURCE and home agent folders, writing only to the PACK file.
- Strict Boundary in Phase 2: Phase 2 writes only inside
TARGET.
- Absolute Secret Exclusion: Never copy secrets, keys, or credentials. Skip
.env*, *.pem, *.key, auth.json, tokens.json, and cookies. Variable names are allowed. Scrub any credential-like string from session logs.
- Graceful Permission Degradation: If a folder cannot be read (sandbox, permissions), report the path and continue without aborting.
- Evidence Requirement: No evidence, no entry. Speculative or unverified rules must not be added to the PACK.
Phase 1: Harvest (in SOURCE)
1.1 Codebase & Dot-File Inventory
Inspect all files in SOURCE, including hidden dot-files and folders.
Skip node_modules/, .venv/, venv/, dist/, build/, target/, and .git/ internals.
Read in this prioritized order:
- Agent instructions & skills:
- Instruction files:
AGENTS.md, CLAUDE.md, GEMINI.md, QWEN.md, .cursorrules, .windsurfrules, .clinerules, .github/copilot-instructions.md.
- Tool/agent directories:
.agents/, .agent/, .claude/, .gemini/, .codex/, .opencode/, .cursor/, .kiro/, .windsurf/, .github/.
- Hooks & automation:
.claude/settings*.json (hooks), .husky/, .pre-commit-config.yaml.
- Build/task files:
Makefile, justfile, Taskfile, CI workflows (.github/workflows/), package.json scripts, pyproject.toml tool sections, scripts/.
- Quality & lint configuration:
- Linters, formatters, type checkers, strict compiler flags,
.editorconfig, test runner configurations.
- Docs, notes, & ADRs:
README.md, docs/, notes/, Architecture Decision Records (ADRs), TODO/FIXME trends, CHANGELOG.md.
- Environment & Editor configs:
.env.example (variable names only), .vscode/settings.json, .vscode/tasks.json.
1.2 Agent Session Logs (Home Folders)
Search agent session logs for mentions of SOURCE's absolute path or folder name.
Because session logs can be massive, use rg (ripgrep) or targeted file searches first.
Do not read entire log files into context without filtering.
Known Cross-Platform Locations
| Agent |
Linux / macOS |
Windows |
| Claude Code |
~/.claude/projects/ |
%USERPROFILE%\.claude\projects\ |
| Codex CLI |
~/.codex/sessions/ |
%USERPROFILE%\.codex\sessions\ |
| Gemini CLI / Antigravity |
~/.gemini/ |
%USERPROFILE%\.gemini\ |
| OpenCode |
~/.config/opencode/, ~/.local/share/opencode/ |
%APPDATA%\opencode\, %LOCALAPPDATA%\opencode\ |
| Other Agents |
~/.cursor/, ~/.kimi/, ~/.qwen/, ~/.windsurf/ |
%USERPROFILE%\.<agent>\ |
Fast Grep Patterns
# Linux / macOS
rg -l "SOURCE_NAME" ~/.claude/projects ~/.codex/sessions ~/.gemini -g "*.json" -g "*.jsonl" -g "*.md"
# Windows PowerShell
$logs = "$HOME\.claude\projects", "$HOME\.codex\sessions", "$HOME\.gemini"
rg -l "SOURCE_NAME" $logs -g "*.json" -g "*.jsonl" -g "*.md"
From matched logs, extract surrounding context (3-5 lines) focusing on:
- User corrections: "no", "don't", "instead", "again", "I told you", "stop doing".
- Recurring errors: The same compilation, lint, or runtime bug encountered multiple times.
- Loop-ending fixes: The key breakthrough or fix that resolved a prolonged debugging session.
- Repeated manual steps: Commands or setup steps the user repeatedly ran or asked the agent to execute.
1.3 Extract and Generalize
For every potential lesson, record four attributes:
- Intent: What this rule prevents or makes easy, stated purely in stack-agnostic terms. If the intent cannot be expressed without project-specific names or domain logic, drop it.
- Original Form: The concrete code snippet, config flag, script, or instruction from
SOURCE.
- Evidence: The file path, session timestamp, or recurrence count proving this was needed.
- Verification: How an agent or tool can verify adherence in a target repository.
1.4 Classification Rubric
Categorize each generalized item into one of six standard types:
| Category |
Definition |
Target Destination |
convention |
Style or architectural preference |
AGENTS.md guidelines |
procedure |
Step-by-step workflow used 2+ times |
Agent skill (.agents/skills/<name>/SKILL.md) |
rule |
Hard constraint that must never break |
Automated check script or strict linter rule |
hook |
Triggered event (pre-commit, tool hook) |
Check script wired to agent hook / git hook |
workflow |
CI, release, build, or review pipeline |
CI action, Makefile, or runner recipe |
mistake-to-avoid |
Recurrent trap or anti-pattern |
AGENTS.md "Avoid" bullet with rationale |
1.5 Write the PACK File
Write the output file (default <source-folder>-lessons.md next to SOURCE). Use this exact markdown structure:
# Lessons PACK: <SOURCE_NAME>
- **Date:** <YYYY-MM-DD>
- **Source Path:** `<SOURCE_PATH>`
- **Source Stack:** <Language, framework, tools>
- **Logs Inspected:** <List of agents whose logs were reviewed>
## Summary Table
| # | Item | Category | Evidence Count | Target Recommendation |
|---|---|---|---|---|
| 1 | <Short Name> | convention | 3 sessions | AGENTS.md |
| 2 | <Short Name> | rule | Pre-commit hook | checks/ |
## Harvested Lessons
### 1. <Item Title>
- **Category:** `convention` | `procedure` | `rule` | `hook` | `workflow` | `mistake-to-avoid`
- **Intent:** <Stack-agnostic purpose>
- **Original Form:**
```text
<Original code, config, or prompt snippet>
```
- **Evidence:** `<file-path-or-log-id>` (observed N times)
- **Verification:** <Concrete verification command or condition>
## Dropped Candidates
- `<Candidate Name>`: Dropped because <specific reason, e.g. project-specific domain logic, no reproducible evidence>.
Present the summary table to the user and prompt them to review, modify, or prune items before proceeding to Phase 2.
Phase 2: Adopt (in TARGET)
2.1 Inspect TARGET
Before making any modifications:
- Identify
TARGET stack: language, package managers, test runners, linters, CI systems, and task runners.
- Read existing instruction files:
AGENTS.md, CLAUDE.md, GEMINI.md, etc.
- Check existing scripts (
scripts/, checks/, bin/) and skills (.agents/skills/, .claude/skills/).
- Note which PACK items are already covered or partially addressed in
TARGET.
2.2 Decide for Each Item: Adopt, Adapt, or Skip
- adopt: Apply directly as-is (e.g. universal markdown guidelines, stack-independent git practices).
- adapt: Translate the item's intent and verification into
TARGET's native tooling (e.g. convert a Python flake8 rule to an ESLint plugin, or a bash script to a PowerShell / npm script).
- skip: Item is already satisfied by existing configuration or conflicts with
TARGET's explicit architecture. Document the reason.
Never copy raw syntax from SOURCE if TARGET uses a different paradigm. Translate the underlying intent.
2.3 Present Plan and Write
Present a decision table to the user:
| Item |
Decision |
Adaptation Details |
Target Location |
<Item> |
adapt |
Converted to Vitest check |
checks/check-api-contract.sh |
<Item> |
adopt |
Added to project rules |
AGENTS.md |
<Item> |
skip |
Already enforced by tsconfig |
- |
Wait for user approval before writing. Once approved:
- Rules & Conventions:
- Append under
## Lessons from <source-folder> in TARGET/AGENTS.md.
- If
CLAUDE.md or GEMINI.md exist, add a reference pointing to AGENTS.md rather than duplicating content.
- Skills (
procedure):
- Save to
TARGET/.agents/skills/<name>/SKILL.md.
- If Claude Code is used, notify the user that it reads
.claude/skills/, and offer to create a symlink or copy.
- Checks & Rules (
rule, hook):
- Place executable scripts in
TARGET/checks/ (or the existing script directory).
- Wire checks into
package.json, Makefile, or task runner.
- Add a notice to
TARGET/AGENTS.md: "Before finishing a task, run <check-command>."
- Hooks:
- Configure only for specific agents requested by the user, having the hook invoke the check script.
- Conflict Prevention:
- Never overwrite existing files without confirmation. Merge additions cleanly.
2.4 Verification
Execute each newly introduced check script once within TARGET:
- Confirm the script runs and reports pass/fail without syntax errors.
- Fix any environment setup issues.
- Do not modify existing codebase logic in
TARGET unless explicitly instructed.
2.5 Handoff Report
Conclude with a clear adoption summary:
- Files created and modified in
TARGET.
- Items adapted and their new locations.
- Items skipped and reasons.
- Next steps or manual decisions required from the user.
1---2name: project-transfer3description: >-4 One-time, on-demand transfer of proven lessons from a finished project (SOURCE)5 to another project (TARGET), even across different languages or stacks. Extracts6 rules, skills, lint/check intent, hooks and workflows from code, dot files, dot7 folders and agent session logs, then adapts them to the target. Trigger on8 "transfer lessons", "harvest this project", "reuse what worked from X".9license: MIT10metadata:11 source: https://skillmd.com/skills/hongyime/project-transfer12 author: Local setup13 version: "1.0.0"14 platform: "Codex, Antigravity (agy), OpenCode, Muse on Windows, macOS, Linux (Debian)"15---1617# Project Transfer1819Transfer proven developer and agent lessons from a completed project (`SOURCE`)20into a new or existing target project (`TARGET`), adapting across different21languages, frameworks, and agent harnesses.2223Work proceeds in two discrete phases with a human-reviewable PACK file in between:24- **Phase 1 (Harvest)**: Audits `SOURCE` and agent session logs; writes only the PACK.25- **Phase 2 (Adopt)**: Reads the reviewed PACK and adapts lessons into `TARGET`.2627Different agents or sessions can run Phase 1 and Phase 2 independently.2829## Inputs & Defaults3031| Input | Required | Default | Notes |32|---|---|---|---|33| `SOURCE` path | Yes (Phase 1) | Prompt user if missing | Path to completed codebase |34| `PACK` path | Optional | `<source-folder>-lessons.md` next to `SOURCE` | Intermediate review file |35| `TARGET` path | Yes (Phase 2) | Prompt user before Phase 2 | Destination repository |3637Ask only for missing inputs. Never prompt for `TARGET` during Phase 1.3839## Ground Rules4041- **Zero Target Writes in Phase 1**: Phase 1 reads `SOURCE` and home agent folders, writing *only* to the PACK file.42- **Strict Boundary in Phase 2**: Phase 2 writes *only* inside `TARGET`.43- **Absolute Secret Exclusion**: Never copy secrets, keys, or credentials. Skip `.env*`, `*.pem`, `*.key`, `auth.json`, `tokens.json`, and cookies. Variable names are allowed. Scrub any credential-like string from session logs.44- **Graceful Permission Degradation**: If a folder cannot be read (sandbox, permissions), report the path and continue without aborting.45- **Evidence Requirement**: No evidence, no entry. Speculative or unverified rules must not be added to the PACK.4647---4849## Phase 1: Harvest (in SOURCE)5051### 1.1 Codebase & Dot-File Inventory5253Inspect all files in `SOURCE`, including hidden dot-files and folders.54Skip `node_modules/`, `.venv/`, `venv/`, `dist/`, `build/`, `target/`, and `.git/` internals.5556Read in this prioritized order:57581. **Agent instructions & skills**:59 - Instruction files: `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `QWEN.md`, `.cursorrules`, `.windsurfrules`, `.clinerules`, `.github/copilot-instructions.md`.60 - Tool/agent directories: `.agents/`, `.agent/`, `.claude/`, `.gemini/`, `.codex/`, `.opencode/`, `.cursor/`, `.kiro/`, `.windsurf/`, `.github/`.612. **Hooks & automation**:62 - `.claude/settings*.json` (hooks), `.husky/`, `.pre-commit-config.yaml`.63 - Build/task files: `Makefile`, `justfile`, `Taskfile`, CI workflows (`.github/workflows/`), `package.json` scripts, `pyproject.toml` tool sections, `scripts/`.643. **Quality & lint configuration**:65 - Linters, formatters, type checkers, strict compiler flags, `.editorconfig`, test runner configurations.664. **Docs, notes, & ADRs**:67 - `README.md`, `docs/`, `notes/`, Architecture Decision Records (ADRs), `TODO`/`FIXME` trends, `CHANGELOG.md`.685. **Environment & Editor configs**:69 - `.env.example` (variable names only), `.vscode/settings.json`, `.vscode/tasks.json`.7071### 1.2 Agent Session Logs (Home Folders)7273Search agent session logs for mentions of `SOURCE`'s absolute path or folder name.74Because session logs can be massive, use `rg` (ripgrep) or targeted file searches first.75Do not read entire log files into context without filtering.7677#### Known Cross-Platform Locations7879| Agent | Linux / macOS | Windows |80|---|---|---|81| Claude Code | `~/.claude/projects/` | `%USERPROFILE%\.claude\projects\` |82| Codex CLI | `~/.codex/sessions/` | `%USERPROFILE%\.codex\sessions\` |83| Gemini CLI / Antigravity | `~/.gemini/` | `%USERPROFILE%\.gemini\` |84| OpenCode | `~/.config/opencode/`, `~/.local/share/opencode/` | `%APPDATA%\opencode\`, `%LOCALAPPDATA%\opencode\` |85| Other Agents | `~/.cursor/`, `~/.kimi/`, `~/.qwen/`, `~/.windsurf/` | `%USERPROFILE%\.<agent>\` |8687#### Fast Grep Patterns8889```bash90# Linux / macOS91rg -l "SOURCE_NAME" ~/.claude/projects ~/.codex/sessions ~/.gemini -g "*.json" -g "*.jsonl" -g "*.md"92```9394```powershell95# Windows PowerShell96$logs = "$HOME\.claude\projects", "$HOME\.codex\sessions", "$HOME\.gemini"97rg -l "SOURCE_NAME" $logs -g "*.json" -g "*.jsonl" -g "*.md"98```99100From matched logs, extract surrounding context (3-5 lines) focusing on:101- **User corrections**: "no", "don't", "instead", "again", "I told you", "stop doing".102- **Recurring errors**: The same compilation, lint, or runtime bug encountered multiple times.103- **Loop-ending fixes**: The key breakthrough or fix that resolved a prolonged debugging session.104- **Repeated manual steps**: Commands or setup steps the user repeatedly ran or asked the agent to execute.105106### 1.3 Extract and Generalize107108For every potential lesson, record four attributes:109110- **Intent**: What this rule prevents or makes easy, stated purely in stack-agnostic terms. If the intent cannot be expressed without project-specific names or domain logic, drop it.111- **Original Form**: The concrete code snippet, config flag, script, or instruction from `SOURCE`.112- **Evidence**: The file path, session timestamp, or recurrence count proving this was needed.113- **Verification**: How an agent or tool can verify adherence in a target repository.114115### 1.4 Classification Rubric116117Categorize each generalized item into one of six standard types:118119| Category | Definition | Target Destination |120|---|---|---|121| `convention` | Style or architectural preference | `AGENTS.md` guidelines |122| `procedure` | Step-by-step workflow used 2+ times | Agent skill (`.agents/skills/<name>/SKILL.md`) |123| `rule` | Hard constraint that must never break | Automated check script or strict linter rule |124| `hook` | Triggered event (pre-commit, tool hook) | Check script wired to agent hook / git hook |125| `workflow` | CI, release, build, or review pipeline | CI action, Makefile, or runner recipe |126| `mistake-to-avoid` | Recurrent trap or anti-pattern | `AGENTS.md` "Avoid" bullet with rationale |127128### 1.5 Write the PACK File129130Write the output file (default `<source-folder>-lessons.md` next to `SOURCE`). Use this exact markdown structure:131132````markdown133# Lessons PACK: <SOURCE_NAME>134135- **Date:** <YYYY-MM-DD>136- **Source Path:** `<SOURCE_PATH>`137- **Source Stack:** <Language, framework, tools>138- **Logs Inspected:** <List of agents whose logs were reviewed>139140## Summary Table141142| # | Item | Category | Evidence Count | Target Recommendation |143|---|---|---|---|---|144| 1 | <Short Name> | convention | 3 sessions | AGENTS.md |145| 2 | <Short Name> | rule | Pre-commit hook | checks/ |146147## Harvested Lessons148149### 1. <Item Title>150- **Category:** `convention` | `procedure` | `rule` | `hook` | `workflow` | `mistake-to-avoid`151- **Intent:** <Stack-agnostic purpose>152- **Original Form:**153 ```text154 <Original code, config, or prompt snippet>155 ```156- **Evidence:** `<file-path-or-log-id>` (observed N times)157- **Verification:** <Concrete verification command or condition>158159## Dropped Candidates160- `<Candidate Name>`: Dropped because <specific reason, e.g. project-specific domain logic, no reproducible evidence>.161````162163Present the summary table to the user and prompt them to review, modify, or prune items before proceeding to Phase 2.164165---166167## Phase 2: Adopt (in TARGET)168169### 2.1 Inspect TARGET170171Before making any modifications:1721. Identify `TARGET` stack: language, package managers, test runners, linters, CI systems, and task runners.1732. Read existing instruction files: `AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, etc.1743. Check existing scripts (`scripts/`, `checks/`, `bin/`) and skills (`.agents/skills/`, `.claude/skills/`).1754. Note which PACK items are already covered or partially addressed in `TARGET`.176177### 2.2 Decide for Each Item: Adopt, Adapt, or Skip178179- **adopt**: Apply directly as-is (e.g. universal markdown guidelines, stack-independent git practices).180- **adapt**: Translate the item's *intent* and *verification* into `TARGET`'s native tooling (e.g. convert a Python flake8 rule to an ESLint plugin, or a bash script to a PowerShell / npm script).181- **skip**: Item is already satisfied by existing configuration or conflicts with `TARGET`'s explicit architecture. Document the reason.182183Never copy raw syntax from `SOURCE` if `TARGET` uses a different paradigm. Translate the underlying intent.184185### 2.3 Present Plan and Write186187Present a decision table to the user:188189| Item | Decision | Adaptation Details | Target Location |190|---|---|---|---|191| `<Item>` | `adapt` | Converted to Vitest check | `checks/check-api-contract.sh` |192| `<Item>` | `adopt` | Added to project rules | `AGENTS.md` |193| `<Item>` | `skip` | Already enforced by tsconfig | - |194195Wait for user approval before writing. Once approved:1961971. **Rules & Conventions**:198 - Append under `## Lessons from <source-folder>` in `TARGET/AGENTS.md`.199 - If `CLAUDE.md` or `GEMINI.md` exist, add a reference pointing to `AGENTS.md` rather than duplicating content.2002. **Skills (`procedure`)**:201 - Save to `TARGET/.agents/skills/<name>/SKILL.md`.202 - If Claude Code is used, notify the user that it reads `.claude/skills/`, and offer to create a symlink or copy.2033. **Checks & Rules (`rule`, `hook`)**:204 - Place executable scripts in `TARGET/checks/` (or the existing script directory).205 - Wire checks into `package.json`, `Makefile`, or task runner.206 - Add a notice to `TARGET/AGENTS.md`: `"Before finishing a task, run <check-command>."`2074. **Hooks**:208 - Configure only for specific agents requested by the user, having the hook invoke the check script.2095. **Conflict Prevention**:210 - Never overwrite existing files without confirmation. Merge additions cleanly.211212### 2.4 Verification213214Execute each newly introduced check script once within `TARGET`:215- Confirm the script runs and reports pass/fail without syntax errors.216- Fix any environment setup issues.217- Do not modify existing codebase logic in `TARGET` unless explicitly instructed.218219### 2.5 Handoff Report220221Conclude with a clear adoption summary:222- Files created and modified in `TARGET`.223- Items adapted and their new locations.224- Items skipped and reasons.225- Next steps or manual decisions required from the user.