Agent skill

Setup Dev

by relytcloud in relytcloud/pg_ducklake

Dev environment setup for build tools, PostgreSQL, submodules, and worktrees.

MITAuto-check: notesDevelopment

Install Setup Dev

skills CLI
$ npx skills add relytcloud/pg_ducklake --skill setup-dev -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install relytcloud/pg_ducklake setup-dev --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/relytcloud/pg_ducklake.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/setup-dev .claude/skills/setup-dev && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
setup-dev
GitHub stars
143
Token cost
~2k tokens
SKILL.md length
813 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Dev environment setup for build tools, PostgreSQL, submodules, and worktrees.

  • Works in 5 steps: Detect state → Build tools and compiler cache → PostgreSQL (build from source) → …
  • Entering a development worktree
  • SKILL.md covers Principles, Step 1: Detect state, Step 2: Build tools and… and Step 3: PostgreSQL (build from…, plus 3 more sections
  • Calls git, make and apt; reaches github.com

What it does

Setup Dev is an agent skill from relytcloud/pg_ducklake. Dev environment setup for build tools, PostgreSQL, submodules, and worktrees. Use when setting up or entering a development worktree.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with PostgreSQL, DuckDB, C++ and Git. The repository describes itself as: Native lakehouse experience in Postgres powered by DuckDB & Ducklake. The licence is MIT.

When your agent uses it

  • Entering a development worktree
  • Tasks that involve Git worktrees

Example prompts

  • “/setup-dev”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Detect state
  2. Build tools and compiler cache
  3. PostgreSQL (build from source)
  4. Submodules
  5. Build and test

What it can do on your machine

Read from SKILL.md and the folder at commit bc5d4b4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • make
    • apt
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Setup Dev loads about 2k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 813 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteRuns commands with sudoSKILL.md:51
    **brew/apt** | `brew install ccache` | `sudo apt install ccache` |
  • NoteRuns commands with sudoSKILL.md:56
    `dpkg -l build-essential` (if missing: `sudo apt install build-essential bison flex`)
  • NoteRuns commands with sudoSKILL.md:249
    - Ubuntu: `sudo apt install build-essential bison flex libreadline-dev zlib1g-dev`

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from relytcloud/pg_ducklake at commit bc5d4b4, republished under its MIT licence (© relytcloud). 813 words, ~2,048 tokens.

Download SKILL.mdSave it as .claude/skills/setup-dev/SKILL.md (or your agent's skills folder).
name
setup-dev
description
Dev environment setup for build tools, PostgreSQL, submodules, and worktrees. Use when setting up or entering a development worktree.

Setup Dev Environment

Interactive playbook -- follow steps in order, detect current state, skip what is already done, and ask the user when a choice is required.

Principles

  • Global build cache: ccache in ~/.ccache, shared across all worktrees.
  • Single clone per repo: one clone each for pg_ducklake and postgres; use git worktrees for parallel work.
  • Submodule sharing: git worktree add on each submodule's git repo to share the same object store across worktrees.

Step 1: Detect state

Run these checks silently to understand what is already set up:

bash
command -v ccache                          # compiler cache
ls pg-*/bin/pg_config 2>/dev/null          # local PG installs in workdir
ls ~/.dev/pg-*/configure 2>/dev/null       # PG source worktrees
ls "$(git rev-parse --show-toplevel)"/duckdb/Makefile 2>/dev/null  # duckdb submodule initialized?
git worktree list                          # current worktree situation

Skip any step below that is already satisfied.


Step 2: Build tools and compiler cache

Check
bash
command -v ccache && ccache --version
If missing, ask user

Present these options using the agent's available interaction mechanism:

OptionmacOSLinux (apt)
brew/aptbrew install ccachesudo apt install ccache
SkipContinue without cache (slow builds)

Also check for platform build tools:

  • macOS: xcode-select -p (if missing: xcode-select --install)
  • Linux: dpkg -l build-essential (if missing: sudo apt install build-essential bison flex)
Configure ccache for cmake

Check the user's shell profile:

bash
grep CMAKE_C_COMPILER_LAUNCHER ~/.zshrc ~/.bashrc 2>/dev/null

If not configured, tell the user to add this block to ~/.zshrc or ~/.bashrc:

bash
if command -v ccache >/dev/null; then
    export CC="ccache cc"
    export CXX="ccache c++"
    export CMAKE_C_COMPILER_LAUNCHER=ccache
    export CMAKE_CXX_COMPILER_LAUNCHER=ccache
fi

Why: duckdb and ducklake use cmake and ignore CC=ccache cc. Without CMAKE_C_COMPILER_LAUNCHER, these heavy builds (~1GB source) recompile from scratch in every worktree.

Note: if sccache is already installed (e.g. via Homebrew), cmake may pick it up automatically. That works fine -- just use sccache --show-stats instead of ccache -s to verify cache hits.


Step 3: PostgreSQL (build from source)

Always build from source, per-worktree. Uses a shared bare repo so multiple PG versions share one clone, and ccache makes rebuilds fast.

Ask the user which versions to install (usually the oldest and newest supported, e.g. 14 and 18).

One-time: clone PG source

Shared PG source lives at ~/.dev/pg-src (bare repo, ~200MB):

bash
git clone --bare https://github.com/postgres/postgres.git ~/.dev/pg-src

For each needed version, fetch the branch and create a source worktree:

bash
git -C ~/.dev/pg-src fetch --depth=1 origin refs/heads/REL_<VER>_STABLE:refs/heads/REL_<VER>_STABLE
git -C ~/.dev/pg-src worktree add ~/.dev/pg-<VER> REL_<VER>_STABLE
Build and install into current workdir
bash
WT=$(git rev-parse --show-toplevel)
NCPU=$(nproc 2>/dev/null || sysctl -n hw.ncpu)

for VER in 14 18; do
    pushd ~/.dev/pg-$VER
    ./configure --prefix="$WT/pg-$VER" \
        --without-icu --without-readline --without-libxml
    make -j"$NCPU" && make install
    popd
done

PG_CONFIG will be: $(pwd)/pg-<VER>/bin/pg_config

Add pg-*/ to .git/info/exclude to keep git status clean:

bash
exclude_file=$(git rev-parse --git-dir)/info/exclude
grep -qF 'pg-*/' "$exclude_file" 2>/dev/null || echo 'pg-*/' >> "$exclude_file"

Time: ~15-20 min per version on first run, ~1-2 min on reruns (ccache).


Step 4: Submodules

duckdb (submodule)

pg_ducklake lives in the libpgduckdb monorepo: the libpgddb kernel is plain in-repo source at libpgduckdb/ (repo root) -- nothing to initialize. The DuckDB source is a submodule at the repo root, duckdb/. Initialize it:

bash
git -C "$(git rev-parse --show-toplevel)" submodule update --init --depth=1 duckdb

Time: 5-10 min on first run (duckdb is large even with shallow clone).

ducklake (submodule + patches)

third_party/ducklake is a git submodule pinned to a community duckdb/ducklake commit. Our divergence from community lives as an ordered series of patch files third_party/ducklake-NNN-<desc>.patch, applied onto the pristine checkout at build time (apply-once, stamp-guarded -- see the DUCKLAKE_STAMP rule in Makefile). The build inits the submodule non-recursively (its inner duckdb / extension-ci-tools submodules are only for ducklake's own CI and are not needed) and applies the patches in numeric order; make clean drops the stamp so the next build re-applies from a clean reset. The submodule working tree is therefore intentionally left dirty (patched); the gitlink stays at the pinned community commit.

To inspect our customization, read the ducklake-NNN-*.patch files. To bump the community base: repoint the submodule gitlink, regenerate/rebase the patches against the new commit, and re-verify (make ... && make check-regression).

Show full SKILL.md (293 more words)Show less
Submodule worktrees (automated via hooks)

git worktree add on a submodule gitdir silently overwrites core.worktree to point at the new worktree instead of the main one. Stale worktree entries also break submodule foreach --recursive.

Two hooks in .claude/settings.json handle this automatically:

  • PostToolUse EnterWorktree (.claude/hooks/worktree-setup.sh): repairs broken gitdirs, then creates submodule worktrees with core.worktree preservation.
  • PreToolUse ExitWorktree (.claude/hooks/worktree-cleanup.sh): removes submodule worktree entries pointing to the current worktree, then repairs any core.worktree that got corrupted. Only runs when action is "remove".

If the main worktree's submodules are not initialized, the setup hook has nothing to iterate. Fall back to git submodule update --init --recursive --depth=1 in the main worktree first (slow, downloads from remote).

PG install for new worktree

The PG source worktrees at ~/.dev/pg-<VER> already have compiled object files from the initial build. Reconfigure with the new prefix and rebuild. make clean is required because PG bakes the --prefix path into binaries as rpaths — without it, old objects with the previous worktree's rpath get reused and executables fail at runtime with "Library not loaded".

bash
WT=$(git rev-parse --show-toplevel)
NCPU=$(nproc 2>/dev/null || sysctl -n hw.ncpu)

for VER in 14 18; do
    pushd ~/.dev/pg-$VER
    make clean
    ./configure --prefix="$WT/pg-$VER" \
        --without-icu --without-readline --without-libxml
    make -j"$NCPU" && make install
    popd
done

Time: ~2-5 min per version (ccache hits on recompilation).


Step 5: Build and test

bash
PG_CONFIG=<path_to_pg_config> make install
PG_CONFIG=<path_to_pg_config> make installcheck

Time: first build takes 15-30 min (duckdb cmake build dominates). Subsequent builds with ccache take 1-5 min.

A successful make install ends with PGXS installing pg_ducklake.so and the SQL files into the PG extension directory.


Troubleshooting

ccache not hitting -- ccache -s shows zero hits. Verify:

  • echo $CC contains ccache
  • echo $CMAKE_C_COMPILER_LAUNCHER is ccache
  • cmake is picking it up: check build logs for ccache in compiler command

Wrong submodule commit -- reset to what the branch expects:

bash
git -C "$(git rev-parse --show-toplevel)" submodule update duckdb pg_ducklake/third_party/ducklake

PG configure fails -- missing build deps:

  • macOS: xcode-select --install && brew install bison flex
  • Ubuntu: sudo apt install build-essential bison flex libreadline-dev zlib1g-dev

pg-*/ in git status -- re-run Step 3's exclude command.

© relytcloud, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/setup-dev of relytcloud/pg_ducklake.

Open the folder on GitHubat commit bc5d4b4

Compare with similar skills

Setup Dev next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Setup Dev compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Setup Dev this skillrelytcloud/pg_ducklake143—~2kAutomated safety check: NotesMIT
Create Worktreetimeplus-io/proton2.3k—~812Automated safety check: PassApache-2.0
DB AI GitHub Paper Weekly Newsdigoal/blog8.6k—~1.2kAutomated safety check: PassGPL-2.0
Stale Worktree Cleanuptrycompai/comp2k—~1.8kAutomated safety check: NotesAGPL-3.0
DB AI GitHub Paper Weekly Newsdigoal/blog8.6k—~2.4kAutomated safety check: PassGPL-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Create Worktree

    timeplus-io/proton

    Create a Proton git worktree with local submodule reuse. An agent skill from timeplus-io/proton.

    2.3k GitHub stars~812 tokensUpdated 17 days ago
    DevelopmentAuto-check passed
  • 抓取并汇总"数据库、AI、GitHub、AI 论文"近 1 周新闻,输出图文并茂(含 mermaid 图)的 markdown 周报到当前项目的 markdown/ 目录。覆盖 10 个数据源:postgresweekly.com/issues(自动解析最新 issue…

    8.6k GitHub stars~1.2k tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • A skill your agent uses when cleaning up old git worktrees, removing worktrees whose branches have merged or been abandoned, or dropping orphaned compdev Postgres databases.

    2k GitHub stars~1.8k tokensUpdated today
    DevelopmentAuto-check: notes
  • 抓取并分析"数据库、AI、GitHub、AI论文"相关的近1周内最新内容,分类汇总,输出图文并茂(含内置 Mermaid 图)的 Markdown 周报到当前项目的 markdown/ 目录。

    8.6k GitHub stars~2.4k tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for…

    5.6k GitHub starsUsed in 34 repos~1.8k tokens
    DevelopmentAuto-check passed

More from relytcloud/pg_ducklake

  • Bump Up Ducklake

    relytcloud/pg_ducklake

    Safely bump pgducklake's vendored DuckLake commit, rebase its patch series, account for newly added upstream SQLLogicTests, update mapped test schedules, and validate the result.

    143 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Commit And PR Guidelines

    relytcloud/pg_ducklake

    Commit message conventions and pull request description guidelines.

    143 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check: notes
  • Version Management

    relytcloud/pg_ducklake

    Versioning, branch, and release policy (semantic versioning, branch-per-minor, tag-per-patch).

    143 GitHub stars~455 tokensUpdated 1 mo ago
    Auto-check passed

Questions about Setup Dev

What does Setup Dev do?

Dev environment setup for build tools, PostgreSQL, submodules, and worktrees. Setup Dev is an agent skill from relytcloud/pg_ducklake. Dev environment setup for build tools, PostgreSQL, submodules, and worktrees.

When should I use Setup Dev?

Setup Dev fits situations like: entering a development worktree; tasks that involve Git worktrees.

How do I install Setup Dev in Claude Code?

Run `npx skills add relytcloud/pg_ducklake --skill setup-dev -a claude-code`. Or copy the skill folder (.agents/skills/setup-dev in relytcloud/pg_ducklake) into .claude/skills/setup-dev in your project. Claude Code loads it when a task matches its description.

How do I install Setup Dev in Codex?

Run `npx skills add relytcloud/pg_ducklake --skill setup-dev -a codex`. Or copy the skill folder (.agents/skills/setup-dev in relytcloud/pg_ducklake) into .agents/skills/setup-dev in your project. Codex loads it when a task matches its description.

Can I use Setup Dev in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add relytcloud/pg_ducklake --skill setup-dev -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/setup-dev, .gemini/skills/setup-dev, .github/skills/setup-dev and .opencode/skills/setup-dev in your project.

What does Setup Dev need to run?

Going by SKILL.md and its folder, Setup Dev needs the command-line tools its instructions call (git, make, apt and brew).

Does Setup Dev access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Setup Dev safe to install?

Our automated static check of SKILL.md found notes only (runs commands with sudo), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Setup Dev use?

Setup Dev is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Setup Dev use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Setup Dev?

Skills that share tags, products or a category with Setup Dev: Create Worktree (timeplus-io/proton, 2.3k stars), DB AI GitHub Paper Weekly News (digoal/blog, 8.6k stars), Stale Worktree Cleanup (trycompai/comp, 2k stars) and DB AI GitHub Paper Weekly News (digoal/blog, 8.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Setup Dev?

relytcloud (a GitHub organization) maintains it in relytcloud/pg_ducklake, which has 143 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on August 26, 2026.

Source: relytcloud/pg_ducklake on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.