# copying-endpoints-across-projects

copying-endpoints-across-projects duplicates PostHog API endpoints across projects in the same organization or clones them under a new name. Useful for promoting HogQL endpoints between environments.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 183 installs · ★ 101 repo stars
- Author: PostHog
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/copying-endpoints-across-projects/SKILL.md
- Updated: 2026-10-24
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/copying-endpoints-across-projects

## What it does

PostHog does not provide a native server-side endpoint cloning action. Moving an endpoint requires pulling its configuration through `endpoint-get` and recreating the route with `endpoint-create`.

Both MCP tools only touch the currently active project. The agent must switch active projects between the read and write stages. To avoid silent conflicts, it checks for existing names using `endpoints-get-all` and leaves materialization turned off (`is_materialized: false`) by default so fresh endpoints do not incur background computation fees.

The routine requires editor access in both workspaces within the same organization. Copying endpoints between distinct organizations is unsupported, and bulk-duplicating entire projects at once is excluded.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill copying-endpoints-across-projects -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/copying-endpoints-across-projects/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/copying-endpoints-across-projects/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill copying-endpoints-across-projects -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/copying-endpoints-across-projects/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill copying-endpoints-across-projects -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/copying-endpoints-across-projects/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/copying-endpoints-across-projects
```

2. **Manually: put the files in place**
- File: `.github/skills/copying-endpoints-across-projects/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill copying-endpoints-across-projects -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/copying-endpoints-across-projects
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/copying-endpoints-across-projects/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill copying-endpoints-across-projects -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/ai-plugin/tree/HEAD/skills/copying-endpoints-across-projects/SKILL.md

## When to use it
- promote a PostHog API endpoint from staging to production
- duplicate an endpoint under a new name for local query iteration
- replicate HogQL queries and query variables into another project
- validate the new endpoint payload with `endpoint-run`

## Example prompts
- Copy the retention_metric endpoint from staging to production
- Duplicate the daily_active_users endpoint as daily_active_users_v2 in this project

## Similar
- [copying-flags-across-projects](https://affpapa.org/en/nevibecode/skills/copying-flags-across-projects.md) — skill · 392 installs
- [posthog-webhooks-events](https://affpapa.org/en/nevibecode/skills/posthog-webhooks-events.md) — skill · 1 install
- [consuming-endpoints-from-client-code](https://affpapa.org/en/nevibecode/skills/consuming-endpoints-from-client-code.md) — skill · 322 installs
- [seo-posthog](https://affpapa.org/en/nevibecode/skills/seo-posthog.md) — skill · 141 installs
- [posthog](https://affpapa.org/en/nevibecode/skills/posthog.md) — skill · ★ 8052 repo stars
- [posthog-cost-tuning](https://affpapa.org/en/nevibecode/skills/posthog-cost-tuning.md) — skill · 1 install

From the same set: [posthog/ai-plugin](https://affpapa.org/en/nevibecode/by/posthog/ai-plugin.md) — 82 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
