Writing skills for PostHog agents
Read the full guide at docs/published/handbook/engineering/ai/writing-skills.md.
Choose a location
- Use
products/<product>/skills/for work through PostHog tools, APIs, or customer code. These skills are published. - Use
.agents/skills/for work that requires a checkout of the PostHog repository. These skills stay in the repository. - Staff-only access is not a reason to move a skill. An MCP workflow without a checkout stays published.
- For mixed skills, keep customer diagnosis published and move PostHog development steps into an existing internal skill or reference.
- Published workflows must not depend on internal skill files.
hogli lint:skills checks both locations. The scaffold, build, and sync commands below apply to published product skills.
Quick workflow
# 1. Scaffold
hogli init:skill
# 2. Write your skill in products/{product}/skills/{skill-name}/SKILL.md
# 3. Lint
hogli lint:skills
# 4. Build to verify
hogli build:skills
# 5. Test locally with PostHog Desktop or a coding agent
hogli sync:skill -- --name <skill-name>
# 6. Delete the test skill (optional)
hogli unsync:skill -- --name <skill-name>
Distribution is automatic after merge — CI publishes to PostHog/skills.