feat(skills): Codex unification — bring your skills, use them anywhere#2611
Merged
Conversation
This was referenced Jun 11, 2026
Contributor
Author
2 tasks
|
React Doctor could not complete this scan.
Reviewed by React Doctor for commit |
Contributor
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
packages/workspace-server/src/services/skills/skills.test.ts:189-192
**Test silently passes without executing assertions**
When `~/.claude/skills/codex-only` already exists on the developer's machine or CI runner, the test returns at line 192 without running any `expect` calls — the test is marked passing while nothing was verified. The root cause is that `importCodexSkill` hardcodes `path.join(os.homedir(), ".claude", "skills", name)` as the target, unlike the source side where `getCodexSkillsDir()` was extracted specifically to be mockable. Adding a parallel `getUserSkillsDir()` helper (mocked in tests to the temp directory the same way `getCodexSkillsDir` already is) would let this test run fully against the isolated temp dir, remove the early-return guard, and avoid writing to the real user filesystem during every test run.
### Issue 2 of 3
packages/ui/src/features/skills/SkillDetailPanel.tsx:177
**Fragile string-match gate for overwrite confirmation**
`message.includes("already exists")` ties the UI's overwrite flow to the exact wording of a backend error message. If the string in `skills.ts` is ever rephrased (e.g., "A skill with this name already exists"), this check silently falls through to the generic `toast.error` path — users never see the overwrite dialog and can't complete the import. Since tRPC is already in play here, throwing a `TRPCError` with a stable code (`CONFLICT`) and checking `error.data?.httpStatus === 409` (or a custom `code` field in the error data) on the client would make this contract explicit and refactoring-safe.
### Issue 3 of 3
packages/workspace-server/src/services/skills/skills.ts:464-490
**`mirroredNames` set is checked against both `skill.name` (display name) and `dirName` (directory name)**
The mirror state file stores directory basenames (confirmed by `addMirroredName` using `path.basename(resolved)` and `mirrorUserSkillsToCodex` tracking `name` from `findSkillDirs`). The extra `!mirroredNames.has(skill.name)` guard checks the display name (from SKILL.md frontmatter) against a set of directory names. If a Codex-only skill's frontmatter title happens to equal any mirrored directory name, it will be incorrectly hidden from the UI. Since the canonical key is the directory name, the `skill.name` check appears to be redundant and creates a false-positive suppression path.
Reviews (1): Last reviewed commit: "feat(skills): Codex unification — bring ..." | Re-trigger Greptile |
tatoalo
reviewed
Jun 11, 2026
tatoalo
approved these changes
Jun 11, 2026
jonathanlab
approved these changes
Jun 11, 2026
jonathanlab
approved these changes
Jun 11, 2026
k11kirky
added a commit
that referenced
this pull request
Jun 12, 2026
…rt tests hermetic Review feedback on #2610/#2611: the "already exists" overwrite detection now keys off SKILL_EXISTS_MARKER in @posthog/shared, used verbatim by the server messages and the UI matcher, so a reword cannot silently break the overwrite dialog; getUserSkillsDir is mocked in skills.test.ts so the codex-import and team-install tests run fully against temp dirs instead of early-returning when the real home directory has a colliding skill. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
a72917a to
975d78b
Compare
17de255 to
24695c3
Compare
k11kirky
added a commit
that referenced
this pull request
Jun 12, 2026
…rt tests hermetic Review feedback on #2610/#2611: the "already exists" overwrite detection now keys off SKILL_EXISTS_MARKER in @posthog/shared, used verbatim by the server messages and the UI matcher, so a reword cannot silently break the overwrite dialog; getUserSkillsDir is mocked in skills.test.ts so the codex-import and team-install tests run fully against temp dirs instead of early-returning when the real home directory has a colliding skill. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
24695c3 to
bf96408
Compare
975d78b to
eb09670
Compare
Contributor
Author
Merge activity
|
k11kirky
added a commit
that referenced
this pull request
Jun 12, 2026
…rt tests hermetic Review feedback on #2610/#2611: the "already exists" overwrite detection now keys off SKILL_EXISTS_MARKER in @posthog/shared, used verbatim by the server messages and the UI matcher, so a reword cannot silently break the overwrite dialog; getUserSkillsDir is mocked in skills.test.ts so the codex-import and team-install tests run fully against temp dirs instead of early-returning when the real home directory has a colliding skill. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
eb09670 to
a188d67
Compare
bf96408 to
3f66898
Compare
Read (Codex -> tab): - ~/.agents/skills becomes a discovery source with the new "codex" SkillSource (read-only; import to edit). Copies we are responsible for are hidden: bundled skills synced by the official pipeline and user skills mirrored out — what remains is genuinely the user's Codex-only skills. - "Codex" group in the tab with an Import action that copies the directory into ~/.claude/skills (confirm-overwrite on collision). Import records the name in the mirror state, so future syncs carry the imported copy back without clobbering or duplicating. Write (your skills -> Codex): - mirrorUserSkillsToCodex one-way mirrors ~/.claude/skills into ~/.agents/skills next to the existing bundled sync (initialize + after each successful update; the update-skills saga itself is untouched). Mirrored names are tracked in ~/.agents/skills/.posthog-mirror.json. - Safety rule: a codex skill we didn't put there is never overwritten; the collision skips and surfaces in the tab as a shadowing warning (user precedence beats codex in analyzeSkills). Mirrors whose source skill is gone are removed. Unit tests cover the dedupe rules, mirror ownership/conflict/stale removal, import guards, and corrupt state files. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
…nks in the mirror Review feedback on #2611: marketplace/team installs and skill CRUD now trigger the Codex mirror immediately (fire-and-forget) instead of waiting for the next periodic sync — this also makes deletes disappear from Codex right away; mirror copies dereference symlinks so the mirrored skill is self-contained, and one unreadable skill no longer breaks the rest of the mirror. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
3f66898 to
7df61f0
Compare
k11kirky
added a commit
that referenced
this pull request
Jun 12, 2026
…rt tests hermetic Review feedback on #2610/#2611: the "already exists" overwrite detection now keys off SKILL_EXISTS_MARKER in @posthog/shared, used verbatim by the server messages and the UI matcher, so a reword cannot silently break the overwrite dialog; getUserSkillsDir is mocked in skills.test.ts so the codex-import and team-install tests run fully against temp dirs instead of early-returning when the real home directory has a colliding skill. Generated-By: PostHog Code Task-Id: f4e84f1a-19c9-490c-9b98-47787a7dddcf
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 who work in both PostHog Code and Codex have no way to access their Codex-authored skills from the Skills tab, and no way to bring those skills into their editable user skills collection. Similarly, skills created or installed in PostHog Code are invisible to Codex sessions.
Changes
New
codexskill source"codex"as a validSkillSourcetype and wired it through the Zod schema, precedence ordering, source labels, and UI display config (using aRoboticon).Codex skill deduplication
~/.agents/skillsthat were synced there by the official bundled pipeline, or mirrored out from the user's own skills, are hidden from the Codex section to avoid confusing duplicates. Only genuinely Codex-authored skills surface.Import Codex skill
~/.claude/skills, making it an ordinary editable user skill.importCodextRPC mutation anduseImportCodexSkillhook.User-to-Codex mirroring (
codex-mirror.ts)~/.agents/skillsso skills created, edited, or installed in PostHog Code are available in Codex sessions..posthog-mirror.jsonstate file tracks which skills were placed there by the mirror, ensuring the mirror never overwrites Codex-native skills it didn't create.How did you test this?
mirrorUserSkillsToCodexcovering: initial copy, collision avoidance, update propagation, deletion cleanup, and import ownership handoff.readCodexMirrorStatecovering missing and corrupt state files.skills.test.tscovering: listing codex skills with deduplication, importing a codex skill with mirror ownership, and rejection of paths outside the codex skills directory.Automatic notifications