PostHog / PostHog/context-mill

posthog-integration publishes the wrong skill under skills/all

Open
#309 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
60
Forks
17
Avg merge
1d 7h
Merged PRs (30d)
36

Description

Fix in #308.

posthog-integration currently ships omnibus-instrument-product-analytics under skills/all. The SDK-integration omnibus (omnibus-instrument-integration) is absent from the published plugin entirely — anyone installing the plugin gets the wrong skill and never receives the integration one.

Reproduce

Live, no clone needed:

gh api repos/PostHog/skills/contents/skills/posthog/integration/skills/all/SKILL.md \
  --jq '.content' | base64 -d | grep '^name:'
name: omnibus-instrument-product-analytics     # expected: omnibus-instrument-integration

Locally, the count mismatch is the tell:

pnpm build | grep 'posthog-integration'                          # ✓ posthog-integration (40 skills)
ls dist/marketplace/plugins/posthog-integration/skills | wc -l   # 39

Cause

shortId is a skill's variant id within its group (skill-generator.js:315-329), so it is unique only per-group. A plugin aggregates many groups, so marketplace-generator.js:181 puts a group-scoped key into a plugin-scoped namespace.

omnibus/instrument-integration and omnibus/instrument-product-analytics both declare category: integration with a single variant id: all, so both resolve to plugins/posthog-integration/skills/all.

The mega-plugin at :200 already keys by skill.id and is unaffected.

It is not a clean overwrite

copyDirSync (:50-61) does mkdirSync + copyFileSync with no clearing, so it merges file-by-file. The survivor keeps the loser's files that it does not itself have. The published all/ is a hybrid: product-analytics' SKILL.md over 8 orphan integration references — js.md, node.md, react.md, posthog-js.md, posthog-node.md, EXAMPLE-javascript-web.md, EXAMPLE-javascript-node.md, EXAMPLE-react-vite.md. All 8 are in the published tree today:

gh api repos/PostHog/skills/contents/skills/posthog/integration/skills/all/references \
  --jq '.[].name' | grep -E '^(js|node|react|posthog-js|posthog-node)\.md$'

Why it stayed silent

The build logs ✓ posthog-integration (40 skills) from the input count while writing 39 dirs, and marketplace-generator.js has no test coverage.

Only posthog-integration is affected — every other plugin's dir count already matches its log line.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in marketplace-generator.js around lines 181 and 200, then read skill-generator.js around lines 315-329 and copyDirSync around lines 50-61. Run pnpm build and inspect the generated posthog-integration directory and counts. Done means the integration and product-analytics skills publish separately, with no hybrid directory or count mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.