feat(telemetry): record which agent skills init installed - #476
Closed
gabrielmeloc22 wants to merge 1 commit into
Closed
feat(telemetry): record which agent skills init installed#476gabrielmeloc22 wants to merge 1 commit into
gabrielmeloc22 wants to merge 1 commit into
Conversation
There is currently no way to tell whether a project has a given Clerk skill, so the return on any skill change is unmeasurable: every run looks the same whether the developer installed the skills, declined them, or had no package runner on PATH. The `skills` stage only proved init reached the step. Adds a `skills` field carrying the installed names and a `skills_outcome` union covering all four exits. Only a successful install populates `skills`, so filtering on a skill name means the project has it rather than that it was offered one. Names come from the CLI's own constants, so nothing unbounded reaches the payload. The disclosure notice names the new field.
🦋 Changeset detectedLatest commit: 4e7ec34 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
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
We ship agent skills with
clerk initbut can't measure whether they change anything. Nothing in telemetry says which skills a project has — or whether it has any. Every run looks identical whether the developer installed them, declined the prompt, or had no package runner on PATH. The existingskillsstage only proves init reached that step.That makes the return on any skill change unmeasurable, and it hides a number nobody currently knows: how often people decline the install. That decline rate is the ceiling on the reach of every skill we write.
What this adds
Two payload fields:
skills— the installed skill names, comma-joinedskills_outcome—installed|declined|runner_missing|failedOnly a successful install populates
skills, so a filter likeskills LIKE '%clerk-orgs%'means this project has that skill rather than it was offered one.skills_outcomeis what separates "the user said no" from "init never got that far".The names come from
DEFAULT_UPSTREAM_SKILLSandFRAMEWORK_SKILL_MAP, so only CLI constants reach the payload — same constraintflagsalready follows by recording names and never values.TelemetrySkillsOutcomeis a closed union for the same reasonTelemetryStageis: a renamed call site fails to compile instead of quietly splitting the funnel.installSkillsalready distinguished all four exits internally and threw that away by returningvoid; this records them.Disclosure
The telemetry notice enumerates what's collected, so it now names this field too. Worth checking whether clerk.com/docs/telemetry needs the same addition — that page is outside this repo.
Deliberately not included
Skill versions. The CLI doesn't know them: the external
skillsCLI resolvesclerk/skillsat HEAD and writes files into per-agent directories, so reading versions back means locating those dirs and parsing YAML frontmatter — fragile, and it breaks whenever that CLI changes layout. Since skills install at init and don't auto-update, event timestamp plus theclerk/skillshistory pins the version to within a commit, which is enough for cohorting.Testing
bun run test— 2697 pass, 0 fail. Typecheck, lint, and format clean.New coverage: the four
installSkillsexits each record the right outcome, a decline never probes for a runner, non-installed outcomes leaveskillsempty, and a command that never reaches the step reportsnull.Notes
clerk init. A manualnpx skills add clerk/skillsstays invisible.skills updatecan move a project between cohorts later. Rare, but it means the timestamp proxy degrades.