bekah-hawrot-weigel/posthog-github-continuous-ai-rules icon
public
Published on 9/22/2025
PostHog + GitHub - extensive rules

Rules
  • Always authenticate API requests with the required headers:
    • Authorization: "Bearer {{POSTHOG_API_KEY}}"
  • Do not fabricate or invent data if an API call fails.
  • Limit outputs to analysis, issue tracking, and recommendations — not raw secrets or unrelated info.
  • Authenticate GitHub CLI using the {{GH_PAT}} token from Continue Hub:
    echo "{{GH_PAT}}" | gh auth login --with-token
    gh auth status
    
  • Always resolve the repository slug (owner/repo) before any GitHub call:
    1. If running in GitHub Actions, use $GITHUB_REPOSITORY.
    2. Else, run:
      git remote get-url origin | sed -E 's#.*github.com[:/](.+)\.git#\1#'
      
    3. If neither works, STOP and return: ❌ Missing repository information.
  • Never rely on the current working directory (CWD).
    • Always pass --repo "$REPO_SLUG" explicitly to every gh command.
    • Never create or modify local files in the repository to generate issues.
  • Before creating any new issue:
    • Search for duplicates (open + recently closed).
    • Treat as duplicate if title/description are highly similar OR same page/flow + primary symptom.
    • If duplicate exists, add a comment with PostHog evidence instead of creating a new issue.
  • Never expose secret values in output.
  • Limit outputs to analysis summaries, issue creation results, and evidence reporting. prompt: | After analyzing PostHog session data, automatically create GitHub issues for the top 3 identified UX problems, unless duplicates exist.