AI Coding Tool Migration: A Dual-Compatibility Approach Without Configuration Forks
When teams switch or run multiple AI coding tools in parallel, copying configuration directories creates divergent project context within weeks. This article explains how to separate tool-agnostic project assets from tool-specific adapters, using a single shared source of truth, thin entry files, localized rule overrides, single-write memory, shared skills with per-tool triggers, and least-privilege execution. It includes a target directory structure, a migration checklist, and common pitfalls to avoid.
1. The Problem Is Not Switching Tools, It Is Avoiding Cognitive Forks
After using an AI coding tool for a while, most teams hit the same issue: the project has accumulated more than code. It has a full set of “context assets,” including architecture conventions, long-term memory, task state, notes on past mistakes, custom skills, and automation hooks. When the team needs to switch tools or run a second tool in parallel, the most intuitive move is to copy the entire configuration directory and rename it.
That approach looks fine on day one. By week two, small discrepancies appear. A month later, the two configurations have different understandings of the same project. A rule is updated on one side and forgotten on the other. One side records the latest API contract while the other still follows the old version. On the surface this is “dual compatibility.” In reality, it is configuration divergence.
So the first principle of migration is not copying but splitting: keep a single source of truth for tool-agnostic project assets, and turn tool-specific loading, discovery, and permission models into a thin adapter layer.
2. Separate Two Categories First: Project Assets and Tool Adapters
A mature AI coding project usually mixes two kinds of content.
The first is project assets, which belong to the project itself:
- Project standards and architecture conventions, such as directory layering, naming rules, and commit requirements;
- Long-term memory and task context, such as the current iteration goal, completed items, and open questions;
- Business knowledge and reference docs, such as domain terminology, API descriptions, and data dictionaries;
- Repeatable workflows and scripts, such as build, validation, and data initialization.
The second is tool adaptation, which belongs to the tool itself:
- Which entry file is read automatically at startup;
- Which directory skills or plugins are discovered from;
- Where extension configuration lives and what format it uses;
- Which events and output protocol lifecycle hooks use;
- What permission and approval model command execution follows.
Without this distinction, the easiest action is a full directory copy, and the most expensive consequence is maintaining two sets of semantics over the long term.
3. Target Architecture: One Asset Set Plus Two Thin Adapters
The recommended target structure can be abstracted as:
project/shared/ # single source of truthcontext/ # long-term memory, task state, notes on past mistakesknowledge/ # business knowledge, terminology, reference docsworkflows/ # reusable process descriptionsscripts/ # Shell / Python / Node scriptsadapters/toolA/ # entry and discovery config for tool AtoolB/ # entry and discovery config for tool B
There is only one hard constraint: the shared directory exists exactly once. No tool may copy its contents; tools may only reference it through the adapter layer.
This yields three direct benefits:
- One rule set: change it once and both tools pick it up;
- Low migration cost: adding a third tool means adding one adapter directory;
- Auditability: all changes land in shared assets, so history stays clear.
4. Unified Entry: Replace the Giant Protocol With a Thin Launcher
Tools differ in their entry file conventions, but the design idea is the same: the entry file does only three things.
First, it states the project’s purpose and current phase. Second, it points to the absolute or relative path of the shared assets. Third, it declares load priority and conflict handling rules.
Example:
# Project Startup NotesThis project uses a shared context architecture.- Conventions and architecture: see shared/context/conventions.md- Current task: see shared/context/current-task.md- Prohibited actions: see shared/context/guardrails.mdThis file is only an entry point and carries no specific rules.
Two points deserve emphasis: the entry file is not a place for a long protocol. Most tools impose a default length limit on instruction chains, and long text dilutes the weight of critical constraints. Keeping the entry thin and moving rules into shared assets is the more robust engineering choice.
5. Rule Loading Chain: Make “Nearest Wins” a Feature, Not a Hazard
Most tools read instruction files level by level from the repository root down to the current working directory, and rules closer to the current directory take higher priority. Left unmanaged, this becomes a hazard: a stale rule file left in a subdirectory silently overrides a new convention at the root.
Recommended practice:
- Do not place rule files in subdirectories by default;
- When a local rule is truly needed, write only the delta and state its scope;
- State explicitly in the shared conventions file that the root directory wins on conflict and subdirectories only supplement.
Example:
# Supplement only, do not overrideThis directory only adds frontend build constraints; everything else follows the root conventions.
6. Memory and Task State: Single Write Point, Read-Only on Both Sides
Long-term memory is the easiest thing to fork. The fix is to make memory a single-write resource:
- All memory writes go to
shared/context/; - Both tools treat that directory as read-only;
- Updates go through one unified process with a stated reason for the change;
- At the start of each session, the adapter only says where to read, and never copies anything.
A minimal field set keeps things readable:
task: current iteration goaldone: completed itemspending: open itemsrisks: known risksupdated_at: 2025-01-01T00:00:00Z
The number of fields does not matter; what matters is that they are unique and stable.
7. Skills and Hooks: Share Capabilities, Adapt the Protocol
Custom skills and automation hooks are the most frequently mis-copied content. The correct approach: share the capability implementation, adapt the trigger protocol per tool.
- Keep the skill body in
shared/workflows/, describing “what to do” in plain text or a script; - Each tool’s adapter only declares “when to trigger” and “how to discover”;
- Hook logic lives in shared scripts, and the tool side only configures event binding and output parsing.
Example:
{"event": "before_commit","action": "run","target": "shared/scripts/check_guardrails.sh"}
Even if the two tools have different event models, the logic that actually runs still exists in only one copy.
8. Permission and Execution Model: Converge by Tool Capability, Not by Habit
Tools differ in approval policies for command execution, file writes, and network access. During migration, do not copy the old policy; redesign around least privilege:
- Read-only operations are allowed by default;
- Writes and deletes require explicit confirmation;
- Script execution is restricted to a
shared/scripts/allowlist; - Sensitive directories (such as secrets and release configuration) are denied by default.
The permission model is a typical tool adaptation concern. It belongs in each adapter layer, not in shared assets.
9. Migration Checklist
- Inventory: list every configuration and context file in the project;
- Classify: mark each as “asset” or “adapter”;
- Build the library: create the
shareddirectory and move assets in; - Thin the entries: write one launcher per tool that only points to shared assets;
- Clean up leftovers: delete duplicate rule files in subdirectories;
- Align hooks: share capabilities, bind events per tool;
- Converge permissions: rewrite execution policy around least privilege;
- Verify: run the same set of tasks on both tools and compare outputs;
- Lock in the process: write “single write point” into team standards.
10. Common Pitfalls and How to Avoid Them
Pitfall 1: Treating copying as compatibility. Copying only creates a second source of truth.
Pitfall 2: Assuming a longer entry file is safer. Excessive length triggers length limits and dilutes critical constraints.
Pitfall 3: Assuming subdirectory rules are more convenient. The nearest-wins mechanism lets stale rules take effect silently.
Pitfall 4: Assuming memory can be written on both sides. Once memory is dual-written, divergence is only a matter of time.
Pitfall 5: Treating migration as one-time work. Tools get upgraded, so the adapter layer needs maintenance across versions.
11. Conclusion
The key to dual compatibility is never making two tools “look the same.” It is giving the project a single source of truth. Collapse assets into one copy and push differences into a thin adapter layer, and migration turns from “copying a directory” into “adding one layer of configuration.” When rules, memory, and workflows each exist in only one copy, tools can be replaced without the project’s understanding drifting.
