writing-skills

द्वारा posthog

PostHog एजेंट कौशल लिखने के लिए मार्गदर्शिका — कार्य-से-किया जाने वाला टेम्पलेट जो एजेंटों को MCP टूल का उपयोग करके लक्ष्य प्राप्त करने का तरीका सिखाता है। नया उत्पाद जोड़ते समय उपयोग करें…

npx skills add https://github.com/posthog/posthog --skill writing-skills

Writing 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 Code 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.

Key rules

  • Name: lowercase kebab-case, prefer gerund form (analyzing-llm-traces, not llm-analytics). Never prefix with posthog-*.
  • Description: third person, specific, include trigger terms and when to use it. Max 1024 chars.
  • Structure: SKILL.md entry point + references/ for detailed content. Keep SKILL.md under 500 lines.
  • Frontmatter: name and description are 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 Schema
  • render_hogql_example({"kind": "TrendsQuery", ...}) — renders a query spec to HogQL SQL
  • hogql_functions() — returns all available HogQL function names

Good example: querying-posthog-data

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.

posthog की और Skills

error-tracking-go
posthog
PostHog द्वारा Go के लिए त्रुटि ट्रैकिंग
official
integration-laravel
posthog
PostHog का Laravel अनुप्रयोगों के लिए एकीकरण
official
integration-nextjs-app-router
posthog
PostHog का Next.js App Router अनुप्रयोगों के लिए एकीकरण
official
logs-other
posthog
PostHog लॉग्स अन्य भाषाओं के लिए
official
logs-python
posthog
PostHog लॉग्स फॉर पायथन
official
analyzing-experiment-session-replays
posthog
प्रयोग वेरिएंट में सत्र रीप्ले पैटर्न का विश्लेषण करें ताकि उपयोगकर्ता व्यवहार में अंतर को समझा जा सके। इसका उपयोग तब करें जब उपयोगकर्ता यह देखना चाहे कि उपयोगकर्ता कैसे इंटरैक्ट करते हैं...
official
auditing-experiments-flags
posthog
PostHog प्रयोगों और फीचर फ्लैग्स का ऑडिट करें, कॉन्फ़िगरेशन समस्याओं, पुरानेपन और सर्वोत्तम-अभ्यास उल्लंघनों के लिए। तब पढ़ें जब उपयोगकर्ता ऑडिट, स्वास्थ्य-जांच, ... के लिए पूछे।
official
auditing-warehouse-data-health
posthog
यह कौशल डेटा वेयरहाउस पाइपलाइन का एक प्रोजेक्ट-व्यापी ऑडिट तैयार करता है। इसका उपयोग तब करें जब उपयोगकर्ता सब कुछ खराब होने का सारांश चाहता है, न कि किसी एक सिंक की गहन जांच। व्यक्तिगत विफलताओं की गहन जांच diagnosing-failed-warehouse-syncs है; यह कौशल वह स्कैन है जो उन्हें बताता है कि पहले कहाँ देखना है।
official