isolated-worktree-db
Skill0 starsChanged 9 days agoMITView on GitHub
Create, run, and safely clean up an isolated Git worktree with its own local database, Docker Compose project, ports, and runtime configuration. Use whenever experimental or parallel development must start from committed main without inheriting another agent's uncommitted changes, especially when the work needs database migrations, seeded/cloned data, a local server, or disposable containers.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- UsmanBuk/skillsword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- UsmanBuk/skills★ 0100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- bugfixSkill
- claude-fable-reviewSkill
- context7-docsSkill
- create-verification-skillSkill
- deslopSkill
- gauntletSkill
- leaderSkill
- maintain-verification-skillSkill
- old-coderSkill
- simplifySkill
- unslopSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Create a disposable development environment that cannot modify the primary worktree's uncommitted files or share its database accidentally.
- Distinctive: line 12
Read the repository's agent/project instructions before acting.
- Distinctive: line 15
Default the base to the committed main HEAD unless the user names another committed ref.
- Very specific: line 18
Use a sibling worktree path such as <repo>-<slug> and a branch such as experiment/<slug>.
- Distinctive: line 24
Do not force, overwrite, or delete an existing path or branch to make this command succeed.
- Very specific: line 32
Use a dedicated database name and dedicated volume or tmpfs.
- Distinctive: line 33
Keep the isolation configuration in the experimental worktree.
- Distinctive: line 35
Prefer migrations plus project seeds for an empty database.
- Distinctive: line 51
When serving the experiment, keep the process identifier in the manifest and use a separate application port.
- Distinctive: line 57
Keep the work local unless the user separately asks to commit, push, open a PR, or deploy.
- Distinctive: line 63
Stop only the server processes recorded for this worktree.
- Very specific: line 64
Run Compose down using the exact worktree Compose file and exact project name.
- Distinctive: line 65
Verify that no containers or volumes carrying that Compose project label remain.
- Very specific: line 67
Remove the exact absolute worktree path through git worktree remove.
- Distinctive: line 69
Keep the experiment branch by default.
- Distinctive: line 71
Never use broad recursive deletion, unresolved variables, globs, the repository root, or the home directory as cleanup targets.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Isolated Worktree and Database
Create a disposable development environment that cannot modify the primary worktree's uncommitted files or share its database accidentally. Adapt commands to the repository's existing tooling; isolation guarantees matter more than a particular Compose layout.
Establish the boundary
- Read the repository's agent/project instructions before acting.
- Resolve the primary worktree, repository common directory, current branch, requested base, and all existing worktrees with read-only Git commands.
- Inspect the primary worktree status. Treat every local modification there as belonging to someone else: do not stash, copy, commit, reset, or base the experiment on it.
- Default the base to the committed
mainHEAD unless the user names another committed ref. Resolve and record the exact commit SHA. - Choose unique, explicit identifiers for the worktree path, branch, Compose project, database name, container resources, and host ports. Never reuse the primary environment's identifiers.
Use a sibling worktree path such as <repo>-<slug> and a branch such as experiment/<slug>. Create it from the recorded commit, not from working-tree contents:
git worktree add -b experiment/<slug> /absolute/path/<repo>-<slug> <base-commit>Do not force, overwrite, or delete an existing path or branch to make this command succeed. Pick a new slug or stop and explain the collision.
Isolate the database
Inspect the project first, then use its native database tooling where possible.
- Give Docker Compose a unique project name. Avoid fixed
container_namevalues. - Bind database and application ports to
127.0.0.1on confirmed-free host ports. - Use a dedicated database name and dedicated volume or
tmpfs; never point the experimental app or tests at the primary database. - Keep the isolation configuration in the experimental worktree. Do not edit the primary worktree to support the experiment.
- Reuse local secrets only through an existing ignored environment mechanism. Never copy secrets into tracked files or print them.
- Prefer migrations plus project seeds for an empty database. If representative local data is required, clone only an authorized local development database with the database's dump/restore tooling. Never infer permission to copy production data.
- Set both application and test database URLs explicitly. Verify them before migrations, jobs, tests, or servers run.
Create a small untracked .codex-isolation.json manifest in the worktree containing the non-secret identifiers needed for exact cleanup: primary path, worktree path, branch, base commit, Compose file/project, service names, database name, host ports, and any server PID/session identifier. Do not store passwords or full credential-bearing URLs.
Verify before development
Confirm all of the following and report the useful endpoints to the user:
- the new worktree HEAD equals the recorded base commit;
- primary uncommitted files do not appear in the new worktree;
- the dedicated database is healthy and reachable only through its chosen local port;
- application and test configuration resolve to the dedicated database;
- the chosen application port is free before starting the server;
- repository instructions, migrations, and proportionate smoke tests pass.
When serving the experiment, keep the process identifier in the manifest and use a separate application port. Do not stop or replace an unknown process occupying a desired port; select another port.
Work safely
Make experimental edits only inside the new worktree. Before commands that can enqueue jobs or start workers, confirm they cannot consume the primary environment's queue, storage, or database. Disable background workers when they are unnecessary for review.
Keep the work local unless the user separately asks to commit, push, open a PR, or deploy. A request to experiment does not authorize publication.
Clean up exactly
Clean up only when the user asks. Read the manifest and independently verify each target before deletion.
- Stop only the server processes recorded for this worktree.
- Run Compose
downusing the exact worktree Compose file and exact project name. Include volumes only when the user has asked to discard the isolated database. - Verify that no containers or volumes carrying that Compose project label remain.
- Inspect the experimental worktree status and state clearly if uncommitted work will be irrecoverably discarded. Preserve or commit it only if the user requests that.
- Remove the exact absolute worktree path through
git worktree remove; use--forceonly when explicit deletion includes uncommitted experiment files. - Prune stale worktree metadata and verify the primary worktree status is unchanged.
- Keep the experiment branch by default. Delete it only when the user explicitly requests branch deletion.
Never use broad recursive deletion, unresolved variables, globs, the repository root, or the home directory as cleanup targets. Finish with a concise inventory of what was removed, what remains (especially the branch), and whether discarded data is recoverable.
Example requests
- “Try this in another worktree with a separate Docker database, based on committed main.”
- “Set up an isolated local environment so you do not include the other agent's edits.”
- “Remove the experiment worktree and its database container when you are done.”
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

