feat(skills): PostHog cloud team skills — read path#2609
Merged
Conversation
This was referenced Jun 11, 2026
Contributor
Author
This was referenced Jun 11, 2026
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/ui/src/features/skills/SkillsView.tsx:116-131
**Orphaned tab state when `teamAvailable` flips**
The "Team" `TabsTrigger` is only rendered when `teamAvailable` is true, but `tab` state is never reset if `teamAvailable` becomes false while the user is already on the team tab (e.g., after the 60-second stale refetch returns a 403). The content branch `tab === "team" && teamAvailable` then silently falls through to the installed-skills view with no tab appearing active, leaving the user seeing one view but no highlighted tab label to indicate what they're looking at. Consider resetting `tab` to `"installed"` when `teamAvailable` transitions from `true` to `false`, or at minimum ensuring the guard also resets `tab` state.
### Issue 2 of 2
packages/core/src/skills/teamSkillsService.test.ts:25-29
**Mock uses `as unknown` cast instead of typed partial**
`makeClient` casts with `as unknown as PostHogAPIClient`, bypassing TypeScript checks entirely. The project convention is to include all required properties so the compiler still validates the mock's shape. For a class this large, a typed helper like `Partial<PostHogAPIClient>` cast to the type, or using a library utility (e.g., `vi.mocked`), keeps the intent clearer and avoids future drift if `PostHogAPIClient` changes its method signatures.
Reviews (1): Last reviewed commit: "feat(skills): PostHog cloud team skills ..." | Re-trigger Greptile |
jonathanlab
approved these changes
Jun 11, 2026
829fa8e to
ee58852
Compare
26e5ccb to
1f13739
Compare
ee58852 to
a397721
Compare
1f13739 to
7853c15
Compare
Contributor
Author
Merge activity
|
7853c15 to
c949c44
Compare
a397721 to
db84e11
Compare
Uses the existing LLMSkill API (products/ai_observability); no posthog-side code changes are required. The llm-analytics-skills flag already gates the endpoints server-side per-request, and llm_skill:read /llm_skill:write are valid self-serve scopes that a *-scoped desktop OAuth token passes. - api-client: listLlmSkills (403 -> null, meaning "feature off"), getLlmSkillByName, resolveLlmSkill, getLlmSkillFile, with handwritten interfaces following the existing api-client convention (this package deliberately has no Zod). - core: TeamSkillsService owns the merged listing decision — feature availability (flag off -> group absent, no errors) and marking team skills that already exist locally by name. Bound via skillsCoreModule in the renderer composition. - UI: "Team" group in SkillsView with read-only detail view rendering the skill body + companion files through the PR 1 components; files fetch lazily on selection. Search filters the team group too. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
… the client mock Review feedback on #2609: the active tab is derived so a mid-session 403 cannot leave the view on a Team tab whose trigger no longer renders; the test client mock is validated against the real method signature via satisfies + a typed vi.fn. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
db84e11 to
f478aff
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Users have no way to browse or inspect skills that their team has published to PostHog cloud. Without visibility into team-shared skills, there's no path to discovering and installing them locally.
Changes
Adds a Team Skills tab to the Skills view that surfaces skills published by the team to PostHog cloud. The tab is conditionally shown only when the org has the team-skills feature enabled (gated server-side via a 403 response).
LlmSkill,LlmSkillListItem,LlmSkillResolveResponse, etc.) and four new methods:listLlmSkills,getLlmSkillByName,resolveLlmSkill, andgetLlmSkillFile.TeamSkillsService(injectable singleton) that fetches the team skill listing, filters to latest versions only, and cross-references local skill names to mark which skills are already installed.skillsCoreModulein the desktop DI container.useTeamSkills,useTeamSkillDetail, anduseTeamSkillFileReact Query hooks.TeamSkillsTab,TeamSkillsSection, andTeamSkillDetailPanelcomponents. The detail panel shows theSKILL.mdbody rendered as Markdown, a file tree for companion files, and a read-only code editor for non-Markdown files. Skills already installed locally are badged as Installed.How did you test this?
Unit tests were added for
TeamSkillsService.listTeamSkillscovering: feature unavailability (API returnsnull), correct mapping and local-install marking, and filtering out non-latest versions.Automatic notifications