Repository navigation
Backend data for v0.2: usage, context cost, health, MCP status, moved/removed, risk flags - #5
Conversation
…/removed, risk flags - Mod tag: plugins whose hooks/hooks.json loads UI modules. - Context cost: a rough token estimate per item from the skill, command and agent listings Claude Code always sends. - Usage: counts skill, command, agent and plugin MCP uses from the local transcripts, reading only what was appended since the last run. No network. - Skill health: front matter, description, duplicate names, and skills CLI links that are missing (now listed instead of hidden) or replaced. - MCP status: parses `claude mcp list`, keeping only hosts and program names. - Skills that moved or were deleted upstream get their own status, with the new location or the deleting commit, and a Reinstall action. - What's new for skills CLI skills starts from the commit matching the installed folder hash instead of the install date. - Update risk flags (hooks, MCP servers, scripts, allowed tools) in the changelog, from the local marketplace copy or the GitHub compare API. - README/SKILL.md preview and the last run's output per item. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 481b906704
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| by_item: items | ||
| .iter() | ||
| .map(|i| (i.id.clone(), credit(i, &totals, today))) |
There was a problem hiding this comment.
Preserve project scope when attributing usage to items
When two configured projects contain skills with the same name, this credits both items with the combined usage from every project's transcripts. scan/skills.rs::project_skill gives these skills distinct IDs and records their project in meta["Project"], but the index merges all files into name-only totals before calling credit, which never checks that project metadata. Consequently, an unused project skill receives another project's usage count and last-used timestamp. Retain project identity during aggregation and filter counts to the item's applicable sessions.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 678647b: a project skill now only counts sessions from its project's transcript folder in ~/.claude/projects (the project path with every non-alphanumeric character turned into -, plus folders inside the project). Test: project_skills_count_only_their_projects_sessions.
| let pair = (raw_file(repo, base, &full).await, raw_file(repo, head, &full).await); | ||
| out.insert(rel.clone(), pair); |
There was a problem hiding this comment.
Distinguish failed risk-content fetches from absent files
If the compare API succeeds but the raw-file requests fail, raw_file returns None for each failed request and this stores those failures as though the files did not exist. For an update that changes only allowed-tools in SKILL.md or inline hooks/MCP configuration in plugin.json, failed before-and-after fetches therefore produce Some([]) risks rather than an unavailable assessment. The changelog is also cached without being marked retryable. Propagate fetch failures separately from genuine missing files so an incomplete check returns unknown risk status and can be retried.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 678647b: raw_file now returns Ok(None) only for a 404 and Err for a failed request or another status. A failed fetch leaves risks as None and marks the changelog retryable, for both the plugin compare path and skill_risks.
- Usage: a project skill only counts sessions in its project's transcript folder, so two projects with a same-named skill no longer share counts. - Risk flags: a raw file that couldn't be fetched is no longer read as a missing file. The risks stay unknown and the changelog is refetched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #4 (which is stacked on #3). Merge those first; GitHub will then retarget this to master.
M2 of the v0.2 plan: the data the new screens need. The UI for most of it lands in M3/M4. The new statuses show up already.
What's in it
Mod tag. A plugin whose
hooks/hooks.jsonhasmodulesis marked as a mod. On this machine that's always-skill.Context cost (
cost.rs). Estimated tokens per item: name + description of each listed skill, command and agent, at chars/4. MCP tool schemas and hook output aren't counted. This machine totals about 53k tokens with everything enabled.Usage (
usage.rs). Uses per item over the last 30 days, plus the last-used time, counted from~/.claude/projects/**/*.jsonl.Skill/Agenttool calls,mcp__plugin_*calls, and typed slash commands.api-request-shape) andwireToolInputsare ignored, so nothing is counted twice.Skill health (
health.rs). Flags:The scanner adds two more:
~/.claude/skillslink. These used to be hidden;find-skillshere is one.~/.agents/skills.MCP status (
mcp.rs,mcp_statuscommand).claude mcp listinto Connected / Needs sign-in / Failed / Not configured / Pending / Unknown, grouped by plugin or claude.ai.Moved / Removed upstream. New statuses with
Item.upstream:reinstallaction:npx skills@1 add <repo> -s <name> -g -a claude-code -y.What's new for skills CLI skills. It now finds the installed commit by matching
skillFolderHashagainst the folder's tree at each recent commit (up to 30), instead of using the install date.Risk flags (
updates/risk.rs). Flags hooks, MCP servers, scripts andallowed-toolschanges, returned in the changelog asrisks.nullwhen a check isn't possible, for example when GitHub truncates the file list at 300.item_readmereturns SKILL.md or README.md, at most 200 KB, without front matter.last_runsreturns the last job's output per item, persisted inlast-runs.json.types.ts,api.tsand the dev mock mirror all of the above. The mock adds a moved and a removed skill, usage data, MCP fixtures and risk samples.Checks
make checkpasses: tsc, fmt, clippy-D warnings, 56 tests. New tests cover:Not checked
🤖 Generated with Claude Code