agentleFS
garthcodesgarthcodes/claude-skills/skills/prd-worktree/SKILL.md

prd-worktree

Skill2 starsChanged 35 days agoMITView on GitHub

Create a bare git worktree for writing a PRD — no .env, certs, databases, or port — and open it in VSCode

  • Reads credentials

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create a lightweight worktree named "$1" for running /prd, then /build-feature, and open it in a new VSCode window.

    line 10
  2. Distinctive:

    If empty, ask for a name.

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

PRD Worktree

Create a lightweight worktree named "$1" for running /prd, then /build-feature, and open it in a new VSCode window. It takes seconds: /prd only reads code and writes .claude/prds/<slug>.md, so none of /worktree's dev setup is done here.

Do NOT copy .env or certs, create or seed databases, assign a port, or run bin/rails. /build-feature creates its own fully set-up pipeline worktree under the primary checkout's .claude/worktrees/ and copies .env/certs from the primary checkout.

Steps

  1. Location: a sibling directory ../<repo>-$1 (e.g. if the repo directory is myapp, use ../myapp-$1).
  2. Validate "$1": non-empty, a valid branch name (no spaces or special characters), and neither ../<repo>-$1 nor branch $1 exists (git worktree list, git branch --list "$1"). If empty, ask for a name.
  3. Create the worktree (from the primary checkout):
    git worktree add ../<repo>-$1 -b $1 main
  4. Mark it as a PRD worktree — the marker lives in the worktree's own git dir, so it is never committed and disappears with the worktree. /build-feature uses it to know it may delete this worktree once a PR opens:
    touch "$(git -C ../<repo>-$1 rev-parse --absolute-git-dir)/prd-worktree"
  5. Open in VSCode: open -a "Visual Studio Code" ../<repo>-$1

Success message

Report the path and branch, then:

  • Next: in the new window run /prd <idea>, then /build-feature .claude/prds/<slug>.md.
  • /build-feature removes this worktree and its $1 branch once a PR (or draft PR) opens, if it holds nothing but the PRD and contract. If the gate fails or the run stops early, the worktree is kept so the PRD can be revised here.
  • To remove it by hand: git worktree remove --force ../<repo>-$1 && git branch -D $1 (no databases to drop), or /worktree-sweep.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.