Repository navigation
Capture skill path in skill_key + platform as text + skill_name rename - #66
Merged
Merged
Conversation
Previously skill_key was always 'owner/repo', so every skill in a
monorepo (e.g. team-attention/hoyeon with skills/council, skills/foo,
skills/bar) collapsed to the same key. The download tracker uses the
full path; telemetry should match.
- trackInstall now accepts an optional 'path' arg (the path within the
repo). skill_key is built as 'owner/repo' for root skills or
'owner/repo/path' for sub-skills, matching the canonical format.
- Add 'path' to the payload as a separate field (null for root) so the
backend can slice without re-parsing skill_key.
- add.ts: derive path from skillPath ('SKILL.md' = root, else the dir).
- install.ts: pass entry.path from the parsed manifest entry.
- Normalize leading/trailing slashes on the path so '/sub/path/'
becomes 'sub/path' before it hits skill_key.
Smoke-tested against a local server:
root: skill_key="testany-io/testany-agent-skills" path=null
sub: skill_key="team-attention/hoyeon/skills/council" path="skills/council"
slashes: "/sub/path/" normalized to "sub/path"
Backend stores platform in a single text column, not a text[]. Sending
a JSON array would either fail to insert or get serialized awkwardly.
- platform is now a comma-separated string (e.g. 'Claude Code, Cursor').
De-duplicated. Empty string when no platforms are known. Agent names
contain no commas, so this round-trips cleanly.
- Drop the separate 'path' field from the payload — it's already
encoded in skill_key ('owner/repo/path'). The backend can split
skill_key on '/' if it needs path-level slicing.
One install still equals one row, preserving the existing download
count increment semantics.
Wire format now:
{"event_type":"install","command":"add",
"skill_key":"team-attention/hoyeon/skills/council",
"owner":"team-attention","repo":"hoyeon","skillName":"council",
"platform":"Claude Code, Cursor"}
…ency Every other field on telemetry_events uses snake_case (event_type, skill_key). skillName was the lone camelCase outlier — fixing it now so the DB column can be plain 'skill_name' without a translation layer.
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.
Summary
Three follow-up telemetry fixes after #65, driven by what's actually showing up (or not) in the
telemetry_eventstable.skill_keynow includes the in-repo path for monorepo skills. Previously every skill in a multi-skill repo collapsed toowner/repo. Nowteam-attention/hoyeon/skills/councilis distinct fromteam-attention/hoyeon/skills/marketing. Root-level skills still use plainowner/repo.platformis sent as a comma-separated text string, not a JSON array, to match thetextcolumn ontelemetry_events. One install still equals one row, so download-count semantics are unchanged. Agent names contain no commas, so this round-trips cleanly.skillNamefield renamed toskill_namefor snake_case consistency with the rest of the payload (event_type,skill_key). The earlier rename in fix: use snake_case field names to match telemetry_events table columns #36 missed this one.pathfield — it's already encoded insideskill_key.Wire payload after this change
Backend schema this expects
telemetry_eventscolumns (all snake_case, all nullable exceptevent_type):event_typetext'command'or'install'— requiredcommandtextskill_keytextownertextrepotextskill_nametextplatformtextTest plan
npm run typecheck,npm run lint,npm run buildcleannpm test— 235/235 passtelemetryendpoint:commandevent arrives as{event_type, command}team-attention/hoyeonwith pathskills/councilproducesskill_key=team-attention/hoyeon/skills/council,skill_name=council,platform="Claude Code, Cursor"skill_key=owner/repo(no path),skill_name=repoplatformis"Claude Code, Cursor"; single-agent:"Claude Code"; empty:""/sub/path/→sub/pathinskill_keyhttps://claude.ai/code/session_01NNWdGxePTFy2h67N4bFjNy
Generated by Claude Code