# building-workflows

building-workflows is a Claude Code skill for building, patching, and testing PostHog automation graphs over MCP before publishing them in the visual editor.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 204 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/building-workflows/SKILL.md
- Updated: 2026-11-16
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/building-workflows

## What it does

The skill constructs PostHog workflows as directed graphs made of action nodes and edges starting from a single trigger. PostHog stores raw node JSON flexibly, but the visual editor enforces a strict structure. Any schema mistake breaks the entire canvas view in the browser.

Automation follows a gated workflow. It starts with a draft via `workflows-create`, moves into single-step simulation through `workflows-test-run`, and inspects issues with `workflows-logs`. Async actions stay mocked unless explicitly changed. Live activation requires direct user confirmation before `workflows-enable` touches real audiences.

Updates use targeted surgery via `workflows-patch-graph` instead of rewriting full graphs. The endpoint applies atomic node changes and immediately echoes the updated state. Email bodies and subjects use `workflows-patch-action-email`, which automatically recompiles the server-side HTML.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill building-workflows -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill building-workflows -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill building-workflows -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/ai-plugin skills/building-workflows
```

2. **Manually: put the files in place**
- File: `.github/skills/building-workflows/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill building-workflows -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/ai-plugin --path skills/building-workflows
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/ai-plugin --skill building-workflows -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/building-workflows/SKILL.md

## When to use it
- compose event-driven automation graphs for PostHog
- test workflow branches step by step with mock payloads
- patch individual action nodes without rewriting the full graph
- schedule recurring batch broadcasts with safety checks

## Example prompts
- Create a draft onboarding drip sequence triggered by user signups
- Step-test the trigger event payload against the first workflow action
- Patch the email subject in the notification node without modifying the edges

## Similar
- [bounce-monitoring-workflow](https://affpapa.org/en/nevibecode/skills/bounce-monitoring-workflow.md) — skill · ★ 81 repo stars
- [designing-email-templates](https://affpapa.org/en/nevibecode/skills/designing-email-templates.md) — skill · 332 installs
- [building-with-medusa](https://affpapa.org/en/nevibecode/skills/building-with-medusa.md) — skill · 5000 installs
- [building-tools](https://affpapa.org/en/nevibecode/skills/building-tools.md) — skill · 4000 installs
- [building-flows](https://affpapa.org/en/nevibecode/skills/building-flows.md) — skill · 4000 installs
- [n8n-mcp-tools-expert](https://affpapa.org/en/nevibecode/skills/n8n-mcp-tools-expert.md) — skill · 8800 installs

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
