Skip to content

refactor(skills): share the project token and host bullets - #533

Draft
Silthus wants to merge 3 commits into
fix/skills-project-get-tokenfrom
refactor/shared-project-credentials
Draft

Silthus wants to merge 3 commits into
fix/skills-project-get-tokenfrom
refactor/shared-project-credentials

Conversation

@Silthus

@Silthus Silthus commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The eight omnibus/instrument-* skills each carried the same three bullets, word for word, telling the agent how to find the PostHog project token and host. #511 had to make the same edit in all eight files, and the copies could drift apart on the next change.

Changes

  • New shared partial context/shared/project-token-and-host.md holds the three bullets. Each of the eight skills now includes it with {{> project-token-and-host}}, so the next change to this guidance is one edit.
  • expandPartials indents every included line with the directive's leading whitespace. An indented include now nests under its list item instead of jumping to column 0. Column-0 includes, such as the existing mcp-tool-calling ones, build exactly as before.
  • In instrument-tracing, the phc_ / phx_ warning bullet sat between the token and host bullets. It now comes right after the include.
  • npm run dev now watches context/shared/ and rebuilds every skill when a partial changes. Before, it ignored that directory, so after this extraction an edit to the shared bullets would have left the eight skills stale until a restart. The router can't see which skills include which partial, so it rebuilds them all, which took about 3 seconds in a live run.

mcp-analytics words this guidance differently and is left alone. instrument-reverse-proxy, which landed on main after this branch started, has no copy of these bullets.

Stacked on #511, so it shares that PR's final bullet text. Retarget to main once #511 merges.

Note

🔵 Merge risk: low · two-way door

  • Every agent that runs an omnibus/instrument-* skill gets the same skill text as on the base, in both regions. A build of every skill before and after, unzipped and diffed, shows no change except the build timestamp and the moved bullet below.
  • instrument-tracing agents see the phc_ / phx_ warning one bullet later, after the host bullet instead of before it. The wording is unchanged.
  • expandPartials serves every skill that uses a partial. Column-0 includes, which are all the existing ones, are covered by the same build diff and a new unit test.
  • Contributors running npm run dev now get a rebuild of every skill when a file under context/shared/ changes, where before nothing rebuilt. A live run covers it; the released build doesn't use this code.
  • Switch-off: none: live on the next release, fix forward.
  • Tier: non-critical

How did you test this code?

  • Test-first through generateSkill: a new test in scripts/lib/tests/partial-includes.test.js builds a skill whose indented {{> ...}} sits inside a nested list and checks the SKILL.md it writes. It failed on the base (the bullets landed at column 0) and passes now. A second test pins column-0 includes as unchanged.
  • vitest run scripts: every test passes.
  • A router test for a change under context/shared/ failed on the first commit (the router returned null) and passes on the fix.
  • Live run of npm run dev: edited the shared partial and fetched omnibus-instrument-logs.zip from the running server. On the first commit, nothing rebuilt and the zip kept the old text. On the fix, every skill rebuilt and the zip carried the edit, nested under its list item.
  • Shadow diff: node scripts/build.js on the base and on HEAD, every dist/skills/*.zip unzipped, diff -r over the trees. The only differences are the manifest's buildTimestamp and the moved phx_ line in omnibus-instrument-tracing/SKILL.md and its two marketplace copies. Rerun on the final head with the same result.

🤖 Generated with Claude Code

The eight omnibus instrument skills carried the same three bullets for
finding the project token and host. Move them into the
context/shared/project-token-and-host.md partial and include it in each
skill, so the next change is one edit and the copies cannot drift.

expandPartials now indents every included line with the directive's
leading whitespace, so an indented include nests under its list item.
Column-0 includes build as before.

Built skills are byte-identical except instrument-tracing, where the
phc_/phx_ bullet now follows the host bullet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/go-sdk
  • /wizard-ci mcp-analytics/python-sdk
  • /wizard-ci mcp-analytics/ruby-sdk
  • /wizard-ci mcp-analytics/rust-sdk
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 73f4f01: 1 Should fix.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

The dev server watched only context/skills, context/agents and
example-apps, and routeChange ignored context/shared. Editing the
project-token-and-host partial during `npm run dev` left the eight
instrument skills stale until a restart, where editing the bullets in
place rebuilt them before.

Watch context/shared and route a change there to every skill. Any skill
may include a partial, and the router does no I/O to find which do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 8c23efd: no findings.

Replace the inline comment with an everySkillId helper, and say in the
dev-server header that an edit under context/shared/ rebuilds every
skill. The router does no I/O, so it cannot tell which skills include a
given partial; rebuilding them all took about 3 s in a live run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 57a8c1c: no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant