
Writing Skills for PostHog Agents
FreeStreamline the creation of PostHog agent skills.
Free · Opens the source repo
What Writing Skills for PostHog Agents does
The Writing Skills for PostHog Agents guide provides a structured approach to creating and managing skills for PostHog's AI agents. This skill is essential for developers and designers looking to enhance the functionality of PostHog products by teaching agents how to effectively utilize new features. By following the provided templates and workflows, users can ensure that their skills are not only well-defined but also coherent and easy for agents to understand.
The workflow involves several key steps: initializing a new skill, writing the skill in a specific directory structure, linting the content for errors, building to verify the skill, and testing it locally. This systematic process helps maintain high-quality standards and ensures that each skill is tailored to meet specific user needs. The guide emphasizes the importance of clarity and conciseness, allowing agents to adapt the information without being overloaded with unnecessary context.
Moreover, the guide outlines when to create a new skill versus when to add more detail to an existing one. This is crucial in managing the overall skill count effectively, as an excessive number of poorly defined skills can hinder agent performance. By consolidating related skills and focusing on distinct triggers, developers can create a more efficient and user-friendly experience for those interacting with PostHog agents.
Overall, this skill is targeted at developers and product teams who are involved in enhancing PostHog's capabilities. It provides the necessary resources to ensure that agents can perform tasks effectively and respond accurately to user queries, ultimately improving the overall user experience with PostHog products.
When to use it
Use this skill when adding new features to PostHog products that require agents to learn new workflows or processes.
When not to use it
This skill is not suitable for general-purpose coding tasks or when existing skills already cover the necessary functionality.
What you can build with it
Adding New Product Functionality
When a new feature is introduced in PostHog, use this skill to create a corresponding agent skill that teaches agents how to utilize it.
Updating Existing Skills
If an existing feature is enhanced or modified, this skill provides guidance on how to update the relevant agent skills accordingly.
Consolidating Skills
When you have multiple similar skills, use this skill to help consolidate them into a single, more effective skill that covers all necessary aspects.
How to install Writing Skills for PostHog Agents
View source1. Install with the skills CLI
npx skills add posthog/posthog/writing-skills --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by posthogWriting skills for PostHog agents
Read the full guide at docs/published/handbook/engineering/ai/writing-skills.md.
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.
When to write a skill
When new functionality is added to a product and agents need to know how to work with it. A skill is not about what tools exist (that's the MCP server) — it's about how an experienced person would approach a job using those tools.
Ask: "If a customer asked an agent to do X with my feature, would the agent know the right approach?" If not, write a skill.
How many is too many?
Skill count is a budgeted, shared resource — agents pick from a list of all skill descriptions, and many harnesses truncate that list once it grows long, so every extra skill makes the others less likely to fire.
Prefer a small set of focused skills, each with rich references/, over many thin ones:
- New trigger → new skill. A skill earns its own entry point only when its "when to use it" is clearly distinct from every existing skill.
- More detail →
references/, not a new skill. Another failure mode, SDK variant, or query catalog is depth on an existing job — add it to that skill'sreferences/instead of spending a new slot. - Consolidate near-duplicate siblings. Skills sharing a diagnosis, bug class, or trigger should be one skill with references, not two.
Key rules
- Name: lowercase kebab-case, prefer gerund form (
analyzing-llm-traces, notllm-analytics). Never prefix withposthog-*. - Description: third person, specific, include trigger terms and when to use it. Max 1024 chars.
- Structure:
SKILL.mdentry point +references/for detailed content. KeepSKILL.mdunder 500 lines. - Frontmatter:
nameanddescriptionare required. - Tone: describe the workflow and reasoning, not a rigid script. Trust the agent to adapt.
- Conciseness: the agent is smart — only include context it doesn't already have.
Skill structure
products/{product}/skills/{skill-name}/
SKILL.md # entry point (required)
references/ # optional
guidelines.md
models-foo.md
example-bar.md.j2 # Jinja2 template, rendered at build time
scripts/ # optional
setup.sh
Only references/ and scripts/ subdirectories are collected. Others are ignored.
Template functions
Files ending in .j2 are rendered with Jinja2 at build time
by products/posthog_ai/scripts/build_skills.py.
Extend the build pipeline so the monorepo stays the source of truth —
when domain knowledge lives in code (Pydantic models, query runners, function registries),
add a template function rather than duplicating it as static markdown that drifts.
Available functions:
pydantic_schema("dotted.path.to.Model")— renders a Pydantic model's JSON Schemarender_hogql_example({"kind": "TrendsQuery", ...})— renders a query spec to HogQL SQLhogql_functions()— returns all available HogQL function names
Good example: querying-posthog-data
- Clear entry point linking to 30+ reference files
- Progressive disclosure — agents load only what they need
- Mix of static
.mdand generated.md.j2content - See
products/posthog_ai/skills/querying-posthog-data/SKILL.md
Bad example: llm-analytics
An umbrella skill covering traces, experiments, evaluations, cost tracking, prompt management. Too broad — agents can't determine when to activate it. Break into focused skills instead.
Frequently asked questions about Writing Skills for PostHog Agents
Similar skills
Skill Creator
Efficiently create and manage skills for Gemini CLI.
Agent Development
Create and manage autonomous agents for Claude Code.
Math Olympiad Solver
Solve and verify competition math problems effectively.
Microsoft Skill Creator
Create specialized skills for Microsoft technologies.
Doublecheck
A verification pipeline for AI-generated claims.
Skill Development for Claude Code
Create and enhance skills for Claude Code plugins.
