ai-tool-tracker
ai-tool-tracker: a Claude Code panel for seeing and finding plugins and skills.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/newpy15--ai-tool-tracker)HTML
<a href="/listings/newpy15--ai-tool-tracker"><img src="/api/listings/newpy15--ai-tool-tracker/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Install it in Claude Code in a terminal:
/plugin install ai-tool-tracker --marketplace newpy15/ai-tool-tracker
Or in a shell (Command Prompt, PowerShell and so on):
claude plugin install ai-tool-tracker --marketplace newpy15/ai-tool-tracker
`/plugin` does not work in the desktop app, so there: click **+** next to the input box → **Plugins** → **Add marketplace**, enter `newpy15/ai-tool-tracker` → **Add plugin**.
- When asked "Add marketplace?" answer `y`. For the scope, the first one (user) is usually right. - Right after installing you may see a note that "3 settings (language, minimum stars, open at start) are not set yet". It works with the defaults (Korean, 10 stars, the panel opens at start), so you can leave them, and you can change all of them later in the **Environment** tab of the panel. - It becomes active as soon as it is installed. If you don't see the panel, type `/ai-tools` in the input box. If it still doesn't show up, quit Claude Code completely and start it again.
Say what you want to build
Make a video and a pdf for me.
The panel notices the topics (video, documents) and lists matching tools in the **Suggestions** tab. Replace the sentence with what you want to build.
Commands
| Input | What it does | | --- | --- | | `/ai-tools` | Opens the panel and re-reads the installed tools. Type it once after installing or removing a plugin. | | `/ai-find video production` | Finds tools for the feature you want. It searches both the directory on your PC and GitHub, checks the star counts for you, and shows the results in the **Suggestions** tab. With several topics (`video pdf`) it shows each topic separately. | | `/ai-log image-tool logo draft` | Records a tool you used outside Claude Code by hand. (Tools used outside cannot be detected automatically.) |
- If you say something with a topic in it during a normal conversation, like "make me a video" or "make a pdf", a notification appears and results pile up in the **Suggestions** tab. This reads only the directory on your PC. The same topic is announced at most once every 10 minutes, and nothing is announced if you already have everything that matched. - **Suggestions never install anything for you.** They only copy an install command. Every item shows its source tier and owner, so read "Can I trust the suggested links?" below and check the code and permissions yourself before installing.
Your first 5 minutes
1. **Install**: install it as described above. 2. **Open the panel**: the panel opens automatically when you start. If you don't see it, type `/ai-tools`. If it gets in the way (it opens in every project, because the plugin is installed for your whole user), turn off **Open the panel at start** in the **Environment** tab; then it opens only when you type `/ai-tools`. 3. **Look at the Tools tab**: switch between the `Plugins` and `Skills` buttons and read what is installed on your PC and what each item does. Click a name to expand what is inside. 4. **Work as usual**: while you work, open the **Live log** tab to see the tools that were just used, stacked by kind. 5. **Cut tokens**: in the **Tools** tab look at "always ~N tokens" under each plugin and at **Unused plugins**, and switch off what you don't need. The unused list fills in after the plugin has watched your work for 7, 14 or 30 days. 6. **Find tools**: say what you want to build (`make me a video`), or type `/ai-find video production`, then look at the **Suggestions** tab.
When you want to...
| What you want to do | How | | --- | --- | | See which tools were just used | the **Live log** tab | | Understand what a plugin does | the **Tools** tab, click its name to expand it | | See the plugins I installed in the Claude app (not in Claude Code) | the **Tools** tab → the `Claude app` button, next to `Plugins` and `Skills` (read only; the app manages them) |
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 12 lines
- {
- "name": "ai-tool-tracker",
- "owner": { "name": "newpy15" },
- "description": "ai-tool-tracker: a Claude Code panel for seeing and finding plugins and skills.",
- "plugins": [
- {
- "name": "ai-tool-tracker",
- "source": "./",
- "description": "Live panel of the plugins, skills and MCP tools used while you work, with suggestions for what to use next."
- }
- ]
- }
README.md · README · 343 lines
- <div align="center">
- **English** · [한국어](README.ko.md)
- # ai-tool-tracker
- ### See what is used. See what it costs. Switch off what you don't need.
- **A side panel for Claude Code that shows, in real time, which plugins and skills are used, roughly how many tokens each one costs just by being installed, and lets you switch off the ones you don't need with a button. It also suggests tools for what you want to build.**
- [](LICENSE)
- [](https://github.com/newpy15/ai-tool-tracker/commits/main)
- [](#quick-start)
- [What it does](#what-it-does) · [Quick start](#quick-start) · [How it works](#how-it-works) · [What you can see](#what-you-can-see) · [Can I trust the suggested links?](#can-i-trust-the-suggested-links) · [Cautions](#cautions) · [FAQ](#when-something-goes-wrong) · [Contributing](#contributing)
- </div>
- > [!IMPORTANT]
- > The official source is [newpy15/ai-tool-tracker](https://github.com/newpy15/ai-tool-tracker). A similar repository name or a copied README does not make a download official. Check the owner before you install anything, which is the same advice this plugin gives for every suggestion it shows.
- > [!NOTE]
- > **Platform**: so far this plugin has only been built and tried on **Windows** (the Claude desktop app). macOS and Linux were not taken into account and have never been tested. The code has branches for other systems, but they have never been run, and the list of plugins installed in the Claude app is read from a Windows-only location. If something does not work on macOS or Linux, please open an Issue and paste the **Detected environment** text from the Environment tab (hide your user name in any paths).
- ---
- ## Why I made it
- AI coding feels overwhelming at first. Three things bothered me:
- 1. It is hard to tell **which tool was used for which part** of what I built. I would like to look back and see "the video was made with Remotion", but there is no record.
- 2. Installed plugins and skills put their descriptions in front of the AI on every turn, even when you don't use them, and that costs tokens. I could not see **which plugins cost how much, or which ones I never use**, and I wanted to switch those off.
- 3. I don't really know **which plugins exist or what each one is for**. When I say "make me a video", I wished someone would point out tools worth trying first.
- So I built a panel that "shows what is used and what it costs, lets you switch off what you don't need, and helps you find the tools you do". I am publishing it on GitHub so that beginners can find plugins easily and we can share bugs and improvements. I built it in conversation with Claude Code and fixed things by checking on a real PC.
- ## What it does
- **The two main things**
- 1. **See what is used.** A live log of the plugins, skills, MCP tools and sub-agents used while you work, each with a one-line description, plus **Unused plugins**: enabled plugins you have not used for 7, 14 or 30 days.
- 2. **Cut what costs tokens.** Installed plugins load their descriptions into every conversation. The panel shows roughly how many tokens each plugin costs ("always ~N tokens"), your 5-hour and 7-day usage, and lets you switch plugins off one by one, by group or all at once, or pick a **work mode** that keeps on only what fits the job.
- **Also**: it suggests tools for what you want to build, showing stars, source tier and owner; it groups your plugins by purpose (video, captions, planning, dev ...); and it lists the plugins you installed in the **Claude app** in their own read-only `Claude app` section, apart from the Claude Code ones. The screens are available in Korean, English, Japanese and Chinese.
- **Advanced, off by default**: *Division of work* hands each group's work to its own sub-agent with its own model and token budget. It adds a little to every turn, so it is not part of the basic flow.
- ## What I paid attention to
- - **Beginner-friendly**: four languages (Korean, English, Japanese and Chinese), every screen sentence written by hand, a one-line description for every tool, and a glossary.
- - **Whether a suggested link can be trusted**: every suggestion shows its source tier and owner, and names, addresses and descriptions written by other people are never trusted as they are. (See "Can I trust the suggested links?" below.)
- - **Transparency**: everything it reads, sends over the internet and changes is written down. Nothing is sent or installed automatically.
- - **Tokens**: no model is used to scan files. A model is used only for translation and for turning a search word that is not in English into an English one (the lowest tier), and translations are saved so they are not repeated.
- - **Careful actions**: deleting and moving go through a confirmation. The plugin cannot switch itself off. It checks once more right before deleting.
- - **Different setups on different PCs**: it finds your config folder even if it lives somewhere else (`CLAUDE_CONFIG_DIR`, another drive). The **Environment** tab shows what it read.
- - **Tests**: the safety, ranking and category rules have their own tests (95 so far), and the safety rules were checked against all 3,700+ entries of the real directory.
- ## Quick start
- Install it in Claude Code in a terminal:
- ```
- /plugin install ai-tool-tracker --marketplace newpy15/ai-tool-tracker
- ```
- Or in a shell (Command Prompt, PowerShell and so on):
- ```
- claude plugin install ai-tool-tracker --marketplace newpy15/ai-tool-tracker
- ```
- `/plugin` does not work in the desktop app, so there: click **+** next to the input box → **Plugins** → **Add marketplace**, enter `newpy15/ai-tool-tracker` → **Add plugin**.
- - When asked "Add marketplace?" answer `y`. For the scope, the first one (user) is usually right.
- - Right after installing you may see a note that "3 settings (language, minimum stars, open at start) are not set yet". It works with the defaults (Korean, 10 stars, the panel opens at start), so you can leave them, and you can change all of them later in the **Environment** tab of the panel.
- - It becomes active as soon as it is installed. If you don't see the panel, type `/ai-tools` in the input box. If it still doesn't show up, quit Claude Code completely and start it again.
- ### Say what you want to build
- ```text
- Make a video and a pdf for me.
- ```
- The panel notices the topics (video, documents) and lists matching tools in the **Suggestions** tab. Replace the sentence with what you want to build.
- ### Commands
- | Input | What it does |
- | --- | --- |
- | `/ai-tools` | Opens the panel and re-reads the installed tools. Type it once after installing or removing a plugin. |
- | `/ai-find video production` | Finds tools for the feature you want. It searches both the directory on your PC and GitHub, checks the star counts for you, and shows the results in the **Suggestions** tab. With several topics (`video pdf`) it shows each topic separately. |
- | `/ai-log image-tool logo draft` | Records a tool you used outside Claude Code by hand. (Tools used outside cannot be detected automatically.) |
- - If you say something with a topic in it during a normal conversation, like "make me a video" or "make a pdf", a notification appears and results pile up in the **Suggestions** tab. This reads only the directory on your PC. The same topic is announced at most once every 10 minutes, and nothing is announced if you already have everything that matched.
- - **Suggestions never install anything for you.** They only copy an install command. Every item shows its source tier and owner, so read "Can I trust the suggested links?" below and check the code and permissions yourself before installing.
- ### Your first 5 minutes
- 1. **Install**: install it as described above.
- 2. **Open the panel**: the panel opens automatically when you start. If you don't see it, type `/ai-tools`. If it gets in the way (it opens in every project, because the plugin is installed for your whole user), turn off **Open the panel at start** in the **Environment** tab; then it opens only when you type `/ai-tools`.
- 3. **Look at the Tools tab**: switch between the `Plugins` and `Skills` buttons and read what is installed on your PC and what each item does. Click a name to expand what is inside.
- 4. **Work as usual**: while you work, open the **Live log** tab to see the tools that were just used, stacked by kind.
- 5. **Cut tokens**: in the **Tools** tab look at "always ~N tokens" under each plugin and at **Unused plugins**, and switch off what you don't need. The unused list fills in after the plugin has watched your work for 7, 14 or 30 days.
- 6. **Find tools**: say what you want to build (`make me a video`), or type `/ai-find video production`, then look at the **Suggestions** tab.
- ### When you want to...
- | What you want to do | How |
- | --- | --- |
- | See which tools were just used | the **Live log** tab |
- | Understand what a plugin does | the **Tools** tab, click its name to expand it |
- | See the plugins I installed in the Claude app (not in Claude Code) | the **Tools** tab → the `Claude app` button, next to `Plugins` and `Skills` (read only; the app manages them) |
- | See roughly how many tokens each plugin costs just by being switched on | the **Tools** tab: "always ~N tokens" under each plugin and a total at the top (an estimate; turning a plugin off removes it) |
- | Find plugins I installed but never use, and switch them off | the **Tools** tab → **Unused plugins**: enabled plugins not used for 7, 14 or 30 days, each with its always-loaded tokens and a `Turn off` button (after the plugin has been tracked for that long) |
- | Switch off plugins you don't use, to cut tokens | the **Tools** tab → the `Turn off` button on the plugin's row (see "Cautions" below) |
- | Switch off or on many plugins at once | the **Tools** tab → `Turn all off` / `Turn all on`, or `Turn this group off` on a group such as Video (it asks first) |
- | Turn on only what fits the job I am about to do (video, docs, web and dev, data) | the **Work modes** tab (it shows what will change and asks first). Make your own presets from what is on now, then edit which plugins they keep, rename or delete them (up to 6) |
- | Check how much of my usage limit is left before a big job | the line under the tabs: **Usage** (5-hour and 7-day bars with the time to reset); a note appears when you pass 80% |
- | Find tools for what you want to build | say it, or `/ai-find what you want` → the **Suggestions** tab |
- | Change the screen language | the language buttons at the top of the **Environment** tab |
- | The list didn't change after installing or removing a plugin | `/ai-tools` |
- | Record a tool you used outside Claude Code | `/ai-log tool-name what-you-did` |
- | (Advanced) Hand each group's work to its own sub-agent with its own model and token budget | the **Environment** tab → "Division of work" → `Turn on`, then, per group, pick a model (Haiku, Sonnet, Opus 5.5, Fable 5.2 ... or type any model ID) and type a token budget such as `150k` |
- ## How it works
- ai-tool-tracker is a Claude Code plugin made of one hooks module. It **watches** what Claude Code does, keeps a short record, and **draws** a panel. It never changes what Claude does: its hooks always pass the call or the prompt on unchanged, and if the plugin itself fails, Claude Code carries on as if it were not there.
- ```text
- Claude Code
- ┌────────────────────────────────────────────────────────────┐
- │ you type a request ───► prompt.submit ──┐ │
- │ Claude uses a tool ───► tool.call ──────┼──► panel state │
- │ you type /ai-tools … ─► command.run ────┘ │ │
- └───────────────────────────────────────────────────┼────────┘
- ▼
- read only ┌─────────────┐
- ~/.claude: installed plugins, skills, ───► │ ui.render │ ───► the panel (5 tabs)
- settings, plugin directory cache └─────────────┘
- ▲
- only when you press a button or type /ai-find │
- one search word ───► api.github.com ───► trust check ──► Suggestions
- ```
- ### The pieces
- | Piece | File | What it does |
- | --- | --- | --- |
- | Hooks module | `hooks/register.tsx` | Registers the hooks below, reads your installed tools, draws the panel and runs the buttons. |
- | Trust rules | `hooks/trust.ts` | Pure functions that clean text written by other people, make safe names, commands and links, decide the source tier, raise caution flags, and rank suggestions by relevance and stars. No Claude Code needed to test them. |
- | Division of work | `hooks/agents.ts` | Pure functions for the per-group sub-agents: settings checks, safe agent definitions (only verified plugin names, never text written by others), token counting and the budget rule. |
- | Work modes | `hooks/presets.ts` | Pure functions that plan a work mode: which plugins to turn on and which to turn off for a purpose, never touching the "Other" group or this plugin. It only plans; the panel does the switching after you confirm. |
- | Claude app plugins | `hooks/appstore.ts` | Pure functions that read the plugins the Claude app keeps in its own store: they clean names, descriptions and addresses written by other people and only take the owner from a `github.com` address. |
- | Usage history | `hooks/history.ts` | Pure functions for the "unused plugins" list: recording, merging and cleaning the history (plugin name, last use, count) and deciding what counts as unused. |
- | Usage | `hooks/usage.ts` | Pure functions for the usage bars: percentage clean-up, level (ok / over half / near the limit), the text bar, time to reset. |
- | Categories | `hooks/categories.ts` | Pure functions that group plugins and skills by purpose (video, captions & voice, planning & docs, ...) from the words in their names and descriptions. |
- | State types | `types/index.d.ts` | The shape of what the panel keeps (log, tabs, suggestions). |
- | Tests | `test/trust.test.mjs`, `test/categories.test.mjs`, `test/agents.test.mjs`, `test/usage.test.mjs`, `test/history.test.mjs`, `test/presets.test.mjs`, `test/appstore.test.mjs` | The safety, ranking, category, sub-agent, usage, history, work-mode and app-plugin rules, run with `node --test test/`. |
- | Install files | `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` | What `claude plugin install … --marketplace newpy15/ai-tool-tracker` reads. |
- ### What each hook does
- | Hook | When it runs | What it does | Passes the call on unchanged? |
- | --- | --- | --- | --- |
- | `session.start` | Claude Code starts | Registers `/ai-tools`, `/ai-find`, `/ai-log`, opens the panel, reads your installed plugins and skills, and starts any translation that is missing. | – |
- | `prompt.submit` | You send a message | Looks for topic words from a built-in dictionary (14 topics, at most 3 per message) and searches the local directory. **The text itself is not kept.** | Yes |
- | `tool.call` | Claude uses a tool or skill | Records the tool's name and a short detail in the log (for example a file name, a command description or a search word). Reading and searching tools such as `Read` and `Grep` are not recorded. | Yes |
- | `command.run` | You type one of the three commands | Re-reads the tools, searches directory and GitHub, or adds a hand-made log entry. | – |
- | `ui.render` | The panel needs drawing | Draws the five tabs from the saved state. If drawing fails it shows an error line instead of a blank panel. | – |
- ### Where the information comes from
- - **Installed tools**: the plugins' own files in Claude's config folder (`installed_plugins.json`, each `SKILL.md` header, `plugin.json`, agent and MCP files) and your `settings.json` for what is switched on. Nothing is guessed.
- - **Descriptions**: taken from each tool's own description. For a dozen popular tools (such as Remotion, Figma and Notion) there is also a short hand-written description in the log.
- - **Suggestions**: the plugin directory file stored on your PC and the marketplaces you added, plus GitHub search when you ask for it.
- - **Languages**: the screens in all four languages (Korean, English, Japanese, Chinese) are written by hand, so they do not depend on a model, and a test checks that the four tables have the same entries, keep every number and command, and use the right characters. Only the descriptions written by other plugins' authors are translated, once, by a model (the lowest tier), checked (right alphabet), and saved, so an unchanged description is never translated again. If an earlier setting named another language, the panel falls back to Korean.
- ### How one suggestion is made
- 1. A topic is recognized from a dictionary (for example "video", "pdf", "slides").
- 2. The directory on your PC and the marketplaces you added are searched. Each result is given a relevance score: 3 if the topic word is in its name, 2 if it is at the start of its description, 1 if it is mentioned only later.
- 3. Star counts are fetched from GitHub when you press `Check star counts` (or type `/ai-find`, which does it for you). One search asks for up to 6 repositories at a time, and only the public repository names (`owner/repo`) are sent.
- 4. Only if you press the GitHub button (or type `/ai-find`), GitHub is also searched by topic (`claude-code-plugin`, `claude-skills`, `claude-code`) with the best matches first, and results that do not mention the topic are dropped. Only one search word is sent.
- 5. Directory and GitHub results are merged by repository. The **2 picks with the most stars** are shown first, as "Recommended". Only candidates that are named or tagged for the topic (relevance 3) come first, then ones that mention it at the start of the description (relevance 2). Unreviewed repositories with fewer stars than the minimum (10 by default) are never picked and carry a warning. Everything else sits behind `Show the other N`.
- 6. Every result goes through the trust check (below): its source tier, owner and caution flags are decided, and its link and install command are rebuilt from verified parts. Nothing is installed.
- ### What is kept, and where
- - **The log and the panel's state** (which tab is open, the last suggestions) live in Claude Code's session state for this plugin. They are never sent anywhere.
- - **Translations** are cached across sessions so they are not repeated.
- - **Work modes switch plugins on and off for real.** They ask first, never touch the "Other" group or this plugin, and take effect the next time Claude Code starts. Your own presets store only a name and the names of the plugins to keep on, and can be edited, renamed and deleted.
- - **A small usage history** (the plugin's name, the time it was last used, and a count; nothing else) is kept across sessions so the panel can tell which plugins went unused. It is never sent anywhere, and it is only filled in for tools this plugin can see being called. Plugins that help without being called (themes, for example) can look unused.
- - **Your files change only through buttons you press.** Switching plugins on or off and installing use the `claude` command. "Move to global" copies a folder-only skill into `~/.claude/skills` (or a session-only mod into `~/.claude/local-mods`), and "Remove old cache" and "Delete original" delete folders, each after a confirmation.
- ## What you can see
- The panel has five tabs.
- | Tab | What it does |
- | --- | --- |
- | **Work modes** | Built-in modes (video, docs and planning, web and dev, data) and your own presets: apply, edit, rename, delete. |
- | **Tools** | Shows the **plugins** and **skills** installed on your PC with descriptions, **grouped by purpose** (Video, Captions & voice, Images & design, Planning & docs, Web & browser, Dev & deploy, Data & databases, Security, Files & cloud, Marketing & social, Other). Click a group name to fold it. Plugins can be turned on and off one by one, **by group, or all at once**, and clicking a name expands the skills, agents and MCP servers inside it. For skills it also shows how to call them with `/name`. |
- | **Live log** | Stacks the tools used while you work (skills, plugins, file edits, commands, subagents and so on) in time order, grouped by kind, with a one-line description of "what this tool is for". |
- | **Suggestions** | When you say something like "make a video and a pdf", it recognizes the topic (video, documents, ...) and shows matching tools per topic. It searches the plugin directory stored on your PC first, and when you press a button it checks star counts and searches GitHub live for more. For each topic it **recommends the 1–2 candidates with the most stars**; the rest are folded away. |
- | **Environment** | Language choice, the minimum stars needed to be recommended, what it read on your PC ("Detected environment"), translation progress, removing old cached versions, and moving tools that only work in one folder to global. |
- ### Example: "make a video and a pdf"
- What the **Suggestions** tab shows after the star counts are checked (an illustration made with the same ranking rules and real GitHub star counts on 2026-11-16; star counts change, it is not an endorsement, and the source tier and owner are shown on every row):
- ```text
- Video (search: video, remotion, animation, motion)
- Recommended · the 2 with the most stars
- Pick #1 heygen-com/hyperframes ★84,873 renders video from HTML
- Pick #2 latent-spaces/brag ★21,632 turns a project into a short launch video
- Show the other 13
- for example video-shotcraft ★20,245, Remotion ★83, and
- Motion Reel ★6 and AI Video Editor & Timeline ★0, which carry a "too few stars" warning
- Documents (search: pdf, docx, xlsx)
- Recommended · the 2 with the most stars
- Pick #1 PDF Viewer ★36,230 [Reviewed by Anthropic] views and annotates PDFs
- Pick #2 yusufkaraaslan/Skill_Seekers ★15,324 turns documentation sites and PDFs into skills
- Show the other 14
- for example Pdf To Excel ★0, which carries a "too few stars" warning
- ```
- For comparison, before star counts were used the second video suggestion was a repository with **0 stars**. Each row also has the owner, the description, caution flags, an `Open link` button and a `Copy install command` button that shows the exact command.
- ## Can I trust the suggested links?
- The names, descriptions and addresses in the suggestion list are all **text written by other people**. So this plugin shows how far each item can be trusted, and is built not to trust other people's text as it is. **Still, these labels are only a hint and do not guarantee safety.**
- **Source tier (shown on every item)**
- | Label | Meaning |
- | --- | --- |
- | Official marketplace | In Claude's official marketplace (`claude-plugins-official`) |
- | Reviewed by Anthropic / Reviewed (partner) | The plugin directory record says that review is done |
- | A marketplace you added | In a marketplace you added yourself |
- | Listed in directory · not reviewed | Listed in the directory but with no review record (most of the 3,700+ entries in the directory on my PC) |
- | Unverified source (GitHub search) | Came from a GitHub search. If it is also in the directory, it takes that tier |
- - **The owner (GitHub account) is always shown.** Look-alike names really exist. For example the owner of `Figma` is the official `figma`, but a name like "figma-suite" belongs to another individual account. Check that the owner is right first.
- - **GitHub results carry caution flags.** Not updated for over a year, less than 30 days old, no license, a fork of another repository, very few forks for its star count (star counts can be faked). Recommendations are ordered by how well they match the topic, then by star count (see "How one suggestion is made"); the source tier and caution flags are shown on every row.
- **Other people's text is not trusted as it is**
- - A link is not taken from the address in the list. It is built directly as `https://github.com/…` from a verified `owner/repo`. An address that is not `github.com` never becomes a link.
- - An install command is built only when the name consists of letters, digits, `.`, `_` and `-`. The real directory has 66 names such as `S&P Global` with special characters that are dangerous to paste into a command as they are. Those are turned into a command based on the repository address, and if that is not safe either, no command is built.
- - Before anything is drawn on screen, tricky characters such as line breaks, control characters and characters that flip the text direction are removed.
- - Nothing is installed for you. The command is copied, and shown on screen exactly as it is.
- These rules live in `hooks/trust.ts` and can be tested on their own, without Claude Code: `node --test test/` (Node 23.6 or newer). If you find a gap, please tell me in Issues.
- ## How many tokens does it use?
- - **The plugin itself adds nothing to the conversation (what the model reads).** The panel screen and the log never go to the model.
- - A model is called in only two cases: when translating descriptions into the chosen language (including when English descriptions are shown in Korean), and when turning a `/ai-find` search word that is not written in English (Korean, Japanese, Chinese ...) into an English search word. Both use the lowest tier (haiku), and translations are saved so they are not repeated. A model is not used to scan files.
- - **Other plugins you installed use tokens on their own.** The names and one-line descriptions of skills and subagents go to the AI on every turn. By a rough count from character counts (not real token counts), on the author's PC the descriptions of 9 plugins and 15 skills came to about 6,600 tokens per turn, and switching off the 3 biggest saved about 3,700 tokens. Switching off what you don't use is the surest saving.
- ## Cautions
- - **Turning plugins on or off takes effect right away, with no confirmation.** Switching off does not delete files, it only changes a setting, so you can turn it back on any time. It actually takes effect **the next time Claude Code starts**.
- - **Removing old cache cannot be undone.** It does not touch the installed version or folders marked as in use, and it asks for confirmation before deleting.
- - **"Move to global" is a copy.** The original stays, and deleting the original is a separate confirmation. If you edit the original after copying, the copy is not updated automatically.
- - **Suggestions do not guarantee safety.** Before installing, check that the owner is right, and read the repository code and the permissions it asks for.
- - **Be careful with `Turn off`.** If you switch off a plugin you are using, that feature is gone from the next start. Press `Turn on` to bring it back.
- - **Division of work protects your usage limit.** You choose the 5-hour and the weekly (7-day) thresholds separately (80% each by default, 10-100% in steps of 10, or "not used" for one of them, but not both); a new sub-agent is not started when a usage you chose is at or above its threshold, and at most 4 are started per request, so one "make a video" cannot launch many at once. Even so, a single run that is already going is not cut off, so keep the budget and max turns low. This lowers the risk of burning through your limit, it does not remove it.
- - **"always ~N tokens" is not what a plugin used.** It is Claude Code's estimate of the descriptions loaded into every conversation. What a plugin actually used while working cannot be separated out, because everything shares one conversation.
- - **The Usage bars are what Claude Code reports, as percentages.** The exact token count of your 5-hour limit is not published, so this plugin shows no token number for it. Past 60% it suggests handing light work to Haiku, and past 80% and 95% it warns once. It only reads the figures; it costs nothing and sends nothing.
- - **Claude app plugins are shown apart and cannot be switched here.** The Claude app (chat and Cowork) installs plugins into its own store, separate from Claude Code's. They have their own `Claude app` section in the Tools tab, next to `Plugins` and `Skills`, with an "app" label, their marketplace and owner, so they are not mixed up with the plugins from marketplaces or GitHub that Claude Code loads. Whether they are used in a Claude Code session has not been confirmed, so no token estimate is shown for them.
- - **Division of work is off by default.** Turning it on adds one line per group to the agent list the model reads every turn (a small token cost). Each model has its own default, minimum and maximum for the budget and max turns (the budget is at least 100k, because a sub-agent uses about 60k tokens just to start; pricier models have a lower maximum; "no limit" is not allowed), so one run cannot use up the whole budget. The token budget is checked when a new sub-agent starts; one that is already running is not cut off, its length is limited by "Max turns". Usage is counted for this session only, and only from the sub-agents this plugin defines.
- - **`Turn all off` and `Turn this group off` ask for confirmation first**, never switch off this plugin itself, and take effect the next time Claude Code starts. Turning plugins back on works the same way.
- - **Stars measure popularity, not quality.** Star counts can be inflated, and a popular tool can still be the wrong one for you. Read the description and check the owner. A repository with few stars is not necessarily bad, it just has little evidence behind it.
- - Turning on and off, moving, and install-related features use the `claude` command. They may fail where this command is missing (for example if you only use the desktop app). "Detected environment" in the Environment tab shows whether it is available.
- - This plugin uses a part of Claude Code's plugin features that is still early. If Claude Code is updated, the behavior may change.
- ## What does it do on my computer? (written out openly)
- **What it reads**: the install records, skill files, settings, the plugin directory cache and the list of known projects in Claude's config folder (`~/.claude`, or wherever `CLAUDE_CONFIG_DIR` points). On Windows it also reads, read only, the plugin list that the Claude app keeps in its own folder (`%LOCALAPPDATA%\Claude-Data\...\rpm`: the manifest, each plugin's `plugin.json`, skill descriptions and whether it has an MCP connection). Other systems keep that store elsewhere and have not been checked.
- **What goes out over the internet**
- - GitHub: **only when you press a button in the Suggestions tab or type `/ai-find`**, one search word such as `video` and, for the star check, the public names (`owner/repo`) of the repositories being suggested go to `api.github.com`. Your conversation and login information are not sent.
- - Model calls: only the two cases written in "How many tokens does it use?" above.
- - The original text of what you said is neither saved nor sent. Only the detected topic and search words are used.
- **What it changes (only when you press a button)**
- - Turning plugins on or off: runs `claude plugin enable|disable`.
- - Moving a folder-only tool to global: copies after confirmation. Deleting the original is confirmed separately once more.
- - Removing old cache: deletes after confirmation.
- - The plugin cannot switch itself off.
- ## Known limitations
- - **Only checked on the Claude Code desktop app on Windows.** I have not checked Mac, Linux, the terminal or VS Code. The code has Mac and Linux branches but I have never run them.
- - It is for Claude Code only. Tools you use outside Claude Code cannot be detected automatically, so record them by hand with `/ai-log` if you need to.
- - **Suggestions depend on the plugin directory file stored on your PC (`plugin-directory-cache-v2.json`).** If the file is missing or renamed, it searches only the marketplaces you added. GitHub search works either way.
- - Suggestions recognize topics with a word dictionary. A topic that is not in the dictionary can be missed (then use `/ai-find what you want`), and a high star count does not mean a good tool.
- - **The source tier and caution flags are decided only from values in the directory record and the GitHub response.** It does not read the repository code to check that it is safe. A correct owner name does not mean the code is safe.
- - GitHub search is used without logging in, so it is limited to 10 searches per minute. `/ai-find` uses up to 5 searches per topic (2 star checks and 3 topic searches), so with three topics at once you may have to wait a minute.
- - A topic is recognized by a dictionary and relevance is judged from the words in names, descriptions and repository topics. A repository that does the job but describes it in other words can be ranked lower.
- - Translation quality depends on the model. If you find an awkward translation, please tell me.
- ## When something goes wrong
- | Symptom | What to try |
- | --- | --- |
- | I can't see the panel | Type `/ai-tools`. If that doesn't work, quit Claude Code completely and start it again. |
- | The panel only says "Nothing to show yet" | It means the panel hit an error while drawing. Type `/ai-tools` again, and if it keeps happening, paste the error line shown in the chat (`ai-tool-tracker: … hook skipped`) into Issues. |
- | Descriptions show in English | A translation may still be in progress. If it is still the same after a few minutes, check "Translation" in the Environment tab and tell me. |
- | No suggestions appear | The topic may not be in the dictionary. Search directly with `/ai-find what you want`. |
- | GitHub search fails with "rate limit" | Searches without login are limited to 10 per minute. Try again after a minute. |
- | Turning on/off or moving fails | In the Environment tab, check "Detected environment" to see whether the `claude` command is available. |
- | Something is off on Mac or Linux | I have not been able to check those. Please tell me in Issues together with your environment details. |
- ## If you don't know the terms
- - **Plugin**: a bundle that adds features to Claude Code. It can hold skills, agents, MCP servers and hooks.
- - **Skill**: a written guide for how to do a particular task. It is read and followed only when it is called, or when Claude decides it is needed. While unused, only its name and one-line description are loaded.
- - **MCP server**: a tool that connects to an outside service (Notion, Figma and so on).
- - **Hook**: code that runs automatically when something happens. It keeps running while it is on, so switching it off has the biggest effect.
- ## Disclaimer
- This is an independent project. It is not affiliated with or endorsed by Anthropic. Suggestions are a convenience, not a recommendation or a guarantee, and the author takes no responsibility for what you install. The software is provided as is, under the MIT license.
- ## Contributing
- Bug reports, ideas and small, focused pull requests are welcome. Before you open a pull request, run the checks:
- ```
- node --test test/
- claude plugin validate .
- ```
- - **Bugs and ideas**: post them in [Issues](https://github.com/newpy15/ai-tool-tracker/issues). Forms are ready. For a bug, pasting the "Detected environment" text from the panel's **Environment** tab makes the cause easier to find (please hide any path that contains your user name). For an idea, an example such as "when I say this, I'd like this tool to be suggested" helps even more.
- - **Security**: if you find a way to make the plugin build an unsafe link or command, please open an Issue titled `[Security]` without the exploit details and I will follow up.
- - **Rules**: anything that handles text written by other people belongs in `hooks/trust.ts` with a test in `test/trust.test.mjs`.
- ## License
- [MIT](LICENSE)
hooks/appstore.ts · Bundled script · 98 lines · 1 finding marked
- // Claude 앱이 자기 저장소(rpm)에 설치해 둔 플러그인을 읽어 오기 위한 순수 함수 모음. Claude Code 없이 시험할 수 있다 (test/appstore.test.mjs).
- // 앱 저장소의 이름·설명·주소도 "남이 쓴 글"로 다룬다: 화면에 찍기 전에 정리하고, 주소는 github.com 의 owner만 뽑는다.
- //
- // 다른 파일에서 값을 불러오지 않는다. 아래 정리 규칙은 trust.ts와 같으며 시험이 같은지 확인한다.
- export type AppRef = { id: string; displayName: string; marketplace: string; owner: string }
- export type AppSkill = { name: string; summary: string }
- export type AppPlugin = AppRef & { version: string; summary: string; skills: AppSkill[]; hasMcp: boolean }
- export const MAX_APP_PLUGINS = 60
- // trust.ts의 clean과 같은 규칙: 제어 문자, 줄바꿈, 글자 방향을 뒤집는 문자, 보이지 않는 글자를 공백으로
- const INVISIBLE = /[\u0000-\u001f\u007f-\u009f----]/g
- Note: Usual in code (characters a sanitizer strips): Contains 4 bidirectional-override character(s), which make text display in a different order from how it's read
- Line 13 on GitHub
- export const cleanText = (s: unknown, max = 200): string => {
- const t = String(s ?? '').replace(INVISIBLE, ' ').replace(/\s+/g, ' ').trim()
- return t.length > max ? t.slice(0, max) + '…' : t
- }
- /** 폴더 이름으로 써도 안전한 한 토막 (경로를 거슬러 올라가는 글자 금지) */
- export const safeSegment = (n: unknown): string => {
- const s = typeof n === 'string' ? n : ''
- return /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(s) && !s.includes('..') ? s : ''
- }
- /** 앱이 정한 플러그인 id (plugin_ 뒤에 글자·숫자) */
- export const safePluginId = (n: unknown): string => {
- const s = typeof n === 'string' ? n : ''
- return /^plugin_[A-Za-z0-9]{1,40}$/.test(s) ? s : ''
- }
- /** https://github.com/<owner>/<repo> 주소에서 owner만 뽑는다. 그 밖의 주소는 빈 문자열 */
- export const ownerFromUrl = (u: unknown): string => {
- const m = String(u ?? '').match(/^https:\/\/github\.com\/([^/?#\s]+)\/([^/?#\s]+?)(?:\.git)?(?:[/?#].*)?$/i)
- if (!m) return ''
- const owner = /^[A-Za-z0-9][A-Za-z0-9-]{0,38}$/.test(m[1]) ? m[1] : ''
- const repo = /^[A-Za-z0-9_.][A-Za-z0-9._-]{0,99}$/.test(m[2]) && !m[2].includes('..') ? m[2] : ''
- return owner && repo ? owner : ''
- }
- /** manifest.json (글 또는 이미 읽은 값)에서 플러그인 목록을 안전하게 뽑는다 */
- export const parseManifest = (raw: unknown): AppRef[] => {
- let d: any = raw
- if (typeof raw === 'string') {
- try {
- d = JSON.parse(raw)
- } catch {
- return []
- }
- }
- const out: AppRef[] = []
- const seen = new Set<string>()
- for (const p of Array.isArray(d?.plugins) ? d.plugins : []) {
- const id = safePluginId(p?.id)
- const displayName = cleanText(p?.displayName ?? p?.name, 60)
- if (!id || !displayName || seen.has(id)) continue
- seen.add(id)
- out.push({
- id,
- displayName,
- marketplace: cleanText(p?.marketplaceName, 40),
- owner: ownerFromUrl(p?.upstreamRepoUrl),
- })
- if (out.length >= MAX_APP_PLUGINS) break
- }
- return out
- }
- /** 설명의 첫 문장만, 한 줄로 */
- export const firstSentence = (desc: unknown, max = 80): string => {
- const flat = cleanText(desc, 600)
- const first = flat.split(/(?<=[.。!?])\s/)[0] ?? flat
- return first.length > max ? first.slice(0, max) + '…' : first
- }
- /** .claude-plugin/plugin.json 글에서 버전과 설명을 안전하게 뽑는다 */
- export const parsePluginJson = (text: unknown): { version: string; summary: string } => {
- try {
- const d = JSON.parse(String(text ?? ''))
- return { version: cleanText(d?.version, 20), summary: firstSentence(d?.description) }
- } catch {
- return { version: '', summary: '' }
- }
- }
- /** 목록·설명·스킬을 합쳐 화면에 쓸 플러그인 한 건을 만든다 (스킬 이름과 설명도 정리한다) */
- export const buildAppPlugin = (ref: AppRef, pluginJson: unknown, skills: { name: unknown; summary: unknown }[], hasMcp: boolean): AppPlugin => {
- const pj = parsePluginJson(pluginJson)
- return {
- ...ref,
- version: pj.version,
- summary: pj.summary,
- skills: skills
- .map(s => ({ name: cleanText(s.name, 60), summary: firstSentence(s.summary, 80) }))
- .filter(s => s.name !== '')
- .slice(0, 40),
- hasMcp,
- }
- }
hooks/trust.ts · Bundled script · 230 lines · 1 finding marked
- // 추천 결과를 믿어도 되는지 가늠하고, 남이 쓴 글자를 안전하게 다루는 순수 함수 모음.
- // 이 파일은 Claude Code와 무관하게 단독으로 시험할 수 있다 (test/trust.test.mjs).
- //
- // 원칙: 목록의 이름·설명·주소는 모두 "남이 쓴 글"이다.
- // - 화면에 찍을 때는 눈속임 글자를 없앤다 (clean)
- // - 명령으로 만들 때는 허용한 글자만 통과시킨다 (safeName, safeRepo)
- // - 링크는 주소를 믿지 않고, 검증한 owner/repo로 github.com 주소를 직접 만든다 (repoFromUrl, githubLink)
- // - 표시는 "참고용"이다. 안전을 보장하지 않는다.
- /** 출처 등급: 위로 갈수록 확인된 정도가 높다 */
- export type Tier = 'official' | 'anthropic' | 'partner' | 'added' | 'listed' | 'github'
- /** GitHub 검색 결과에서 주의해야 할 신호 */
- export type Flag = 'stale' | 'fresh' | 'noLicense' | 'fork' | 'ratio'
- // 제어 문자, 줄바꿈, 글자 방향을 뒤집는 문자(Trojan Source), 보이지 않는 글자를 공백으로 바꾼다
- const INVISIBLE =
- /[\u0000-\u001f\u007f-\u009f----]/g
- Note: Usual in code (characters a sanitizer strips): Contains 4 bidirectional-override character(s), which make text display in a different order from how it's read
- Line 18 on GitHub
- /** 화면에 찍을 글자를 안전하게 정리하고 길이를 줄인다 */
- export const clean = (s: unknown, max = 200): string => {
- const t = String(s ?? '')
- .replace(INVISIBLE, ' ')
- .replace(/\s+/g, ' ')
- .trim()
- return t.length > max ? t.slice(0, max) + '…' : t
- }
- /** 플러그인·마켓플레이스 이름: 명령에 그대로 써도 안전한 글자만. 아니면 빈 문자열 */
- export const safeName = (n: unknown): string => {
- const s = typeof n === 'string' ? n : ''
- return /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/.test(s) ? s : ''
- }
- /**
- * 플러그인 안의 상대 경로("./.claude/skills/")를 안전한 "a/b/c" 꼴로. plugin.json이 정한 경로는 남이 쓴 글이므로
- * 플러그인 폴더 밖으로 나가거나(.., 절대 경로, 드라이브 글자), 이상한 글자가 있으면 빈 문자열로 거절한다.
- */
- export const safeRelPath = (p: unknown): string => {
- const s = typeof p === 'string' ? p.trim() : ''
- if (!s || s.length > 120 || /[\\:*?"<>|\u0000-\u001f]/.test(s) || s.startsWith('/') || s.startsWith('~')) return ''
- const segs = s.split('/').filter(x => x !== '' && x !== '.')
- if (segs.length === 0 || segs.length > 8) return ''
- if (segs.some(x => /^\.+$/.test(x) || !/^[A-Za-z0-9._ @-]{1,64}$/.test(x))) return ''
- return segs.join('/')
- }
- /** owner/repo: GitHub이 허용하는 글자만, 맨 앞이 '-'면 명령 옵션으로 읽힐 수 있어 거절. 아니면 빈 문자열 */
- export const safeRepo = (r: unknown): string => {
- const s = (typeof r === 'string' ? r : '').replace(/\.git$/i, '')
- return /^[A-Za-z0-9][A-Za-z0-9._-]{0,38}\/[A-Za-z0-9_.][A-Za-z0-9._-]{0,99}$/.test(s) && !s.includes('..') ? s : ''
- }
- /** 주소에서 owner/repo만 뽑는다. https://github.com/ 로 시작해야 하고, 그 밖의 호스트·주소 꼴은 모두 거절 */
- export const repoFromUrl = (u: unknown): string => {
- const m = String(u ?? '').match(/^https:\/\/github\.com\/([^/?#\s]+)\/([^/?#\s]+?)(?:\.git)?(?:[/?#].*)?$/i)
- return m ? safeRepo(`${m[1]}/${m[2]}`) : ''
- }
- /** 검증된 owner/repo로 직접 만든 GitHub 주소. 검증 실패면 빈 문자열 */
- export const githubLink = (repo: string): string => {
- const r = safeRepo(repo)
- return r ? `https://github.com/${r}` : ''
- }
- export const ownerOf = (repo: string): string => safeRepo(repo).split('/')[0] ?? ''
- /** 디렉터리의 검토 기록에서 등급을 정한다 */
- export const tierFromReview = (state: unknown, by: unknown): Tier => {
- if (state !== 'done') return 'listed'
- if (by === 'anthropic') return 'anthropic'
- if (by === 'partner') return 'partner'
- return 'listed' // 누가 검토했는지 모르면 높게 치지 않는다
- }
- /** 정렬에 쓰는 순위 (클수록 확인된 정도가 높다) */
- export const tierRank = (t: Tier): number =>
- ({ official: 5, anthropic: 5, partner: 4, added: 3, listed: 2, github: 1 })[t]
- /** 관련도 점수에 더하는 가산점. 관련 없는 것이 관련 높은 것을 밀어내지 않을 만큼만 */
- export const tierBonus = (t: Tier): number =>
- ({ official: 3, anthropic: 3, partner: 2, added: 1, listed: 0, github: 0 })[t]
- /** 디렉터리가 검토했거나 공식 마켓플레이스에 든 출처 (별이 적어도 별 기준으로 거르지 않는다) */
- export const isVerifiedTier = (t: string): boolean => t === 'official' || t === 'anthropic' || t === 'partner'
- /** 순위를 매기고 합치는 데 쓰는 추천 한 건의 값 */
- export type Reco = {
- id: string
- name: string
- summary: string
- repo: string
- owner: string
- tier: string
- flags: string[]
- installed: boolean
- stars?: number
- forks?: number
- pushed?: string
- lic?: string
- cmd: string
- source: 'dir' | 'github'
- /** 검색어와 얼마나 맞는지 (이름에 든 단어 3점, 설명에 든 단어 1점) */
- rel: number
- }
- /** 추천 1·2위 후보가 되려면 이 점수 이상이어야 한다: 이름·저장소 주제·설명 앞부분 중 어딘가에 검색어가 있어야 한다 */
- export const MIN_REL = 2
- /**
- * 검색어가 글 안에 있는지. 3글자 이하의 짧은 검색어(ui, ux, ai ...)는 낱말 전체로 맞아야 한다:
- * 그냥 "들어 있는지"로 보면 "guide", "build", "quick" 안의 "ui"까지 걸려 관련 없는 것이 잔뜩 앞에 선다.
- * 긴 검색어(design, video ...)는 "designer" 같은 변형도 맞아야 하므로 부분 일치로 둔다. 둘 다 소문자로 비교한다.
- */
- export const termHit = (text: string, term: string): boolean => {
- const t = term.toLowerCase()
- if (!t) return false
- const x = text.toLowerCase()
- return t.length <= 3 ? x.split(/[^a-z0-9]+/).includes(t) : x.includes(t)
- }
- /**
- * 검색어와 얼마나 맞는지:
- * - 3점: 이름이나 저장소가 스스로 붙인 주제(topics)에 검색어가 있다 (만든 사람이 그 일을 한다고 밝힌 것)
- * - 2점: 설명 앞부분(100자)에 있다
- * - 1점: 설명 뒤쪽에서만 언급된다 (곁다리일 때가 많다)
- * - 0점: 없다
- * 예: "PDF"를 입력 파일 형식 중 하나로만 언급하는 코드 분석 도구가, 별이 많다는 이유로 PDF 도구 1위가 되지 않게 한다.
- */
- export const relevance = (name: string, description: string, terms: string[], topics: string[] = []): number => {
- const d = description.toLowerCase()
- const ts = terms.map(t => t.toLowerCase()).filter(Boolean)
- if (ts.some(t => termHit(name, t) || topics.some(x => termHit(x, t)))) return 3
- if (ts.some(t => termHit(d.slice(0, 100), t))) return 2
- if (ts.some(t => termHit(d, t))) return 1
- return 0
- }
- /** 별이 있는데 기준(minStars)보다 적고, 검토된 출처도 아니라서 믿을 근거가 부족한 것 */
- export const isLowStars = (r: { tier: string; stars?: number }, minStars: number): boolean =>
- !isVerifiedTier(r.tier) && r.stars !== undefined && r.stars < minStars
- /**
- * 디렉터리 결과와 GitHub 결과를 저장소(owner/repo)별로 한 건으로 합친다.
- * 이름·설명·명령은 디렉터리 쪽을, 별·갈라 쓴 수·갱신일·라이선스 같은 실측값은 GitHub 쪽을 따르고, 출처 등급은 더 높은 쪽을 따른다.
- */
- export const mergeRecos = (local: Reco[], github: Reco[]): Reco[] => {
- const out = new Map<string, Reco>()
- const key = (r: Reco) => (r.repo ? r.repo.toLowerCase() : `id:${r.id}`)
- for (const r of local) out.set(key(r), { ...r })
- for (const g of github) {
- const k = key(g)
- const d = out.get(k)
- if (!d) {
- out.set(k, { ...g })
- continue
- }
- out.set(k, {
- ...d,
- stars: g.stars ?? d.stars,
- forks: g.forks ?? d.forks,
- pushed: g.pushed || d.pushed,
- lic: g.lic || d.lic,
- flags: g.flags.length > 0 ? g.flags : d.flags,
- tier: tierRank(g.tier as Tier) > tierRank(d.tier as Tier) ? g.tier : d.tier,
- installed: d.installed || g.installed,
- cmd: d.cmd || g.cmd,
- rel: Math.max(d.rel, g.rel),
- })
- }
- return [...out.values()]
- }
- /**
- * 별이 가장 많은 순으로 정하고, 위에서 topN개를 "추천"으로 뽑는다.
- * - 별을 아는 것이 먼저, 별이 같으면 출처가 확인된 것, 그다음 검색어와 더 맞는 것
- * - 추천 후보는 (검토된 출처이거나 별이 minStars 이상) 이면서 검색어와 충분히 맞는 것(rel ≥ MIN_REL)만.
- * 이름·주제로 밝힌 것(rel 3)이 설명 앞부분 언급(rel 2)보다 먼저다. 나머지는 아래로 내려간다
- * - 별을 하나도 모르면(아직 확인 전) 추천을 뽑지 않고 출처·관련도 순으로만 둔다
- */
- export const rankRecos = <T extends Reco>(
- items: T[],
- minStars: number,
- topN = 2,
- ): { top: T[]; rest: T[]; starsKnown: boolean } => {
- const starsKnown = items.some(i => i.stars !== undefined)
- const sorted = [...items].sort((a, b) => {
- const ka = a.stars !== undefined, kb = b.stars !== undefined
- if (ka !== kb) return ka ? -1 : 1
- if (ka && kb && a.stars !== b.stars) return (b.stars ?? 0) - (a.stars ?? 0)
- return tierRank(b.tier as Tier) - tierRank(a.tier as Tier) || b.rel - a.rel
- })
- if (!starsKnown) return { top: [], rest: sorted, starsKnown }
- const eligible = (i: T) => isVerifiedTier(i.tier) || (i.stars !== undefined && i.stars >= minStars)
- // 이름·주제로 그 일을 한다고 밝힌 것(3점)을 먼저, 모자라면 설명 앞부분에 언급한 것(2점)으로 채운다. 각각 별이 많은 순.
- const strong = sorted.filter(i => eligible(i) && i.rel >= 3)
- const weak = sorted.filter(i => eligible(i) && i.rel >= MIN_REL && i.rel < 3)
- const top = [...strong, ...weak].slice(0, topN)
- const picked = new Set(top)
- return { top, rest: sorted.filter(i => !picked.has(i)), starsKnown }
- }
- const DAY = 24 * 60 * 60 * 1000
- /** GitHub 검색 결과 한 건에서 주의 신호를 뽑는다. 호출 없이 응답에 든 값만 쓴다 */
- export const githubFlags = (
- g: {
- pushed_at?: string
- created_at?: string
- license?: { spdx_id?: string | null } | null
- fork?: boolean
- stargazers_count?: number
- forks_count?: number
- },
- now: number = Date.now(),
- ): Flag[] => {
- const out: Flag[] = []
- const pushed = Date.parse(g.pushed_at ?? '')
- const created = Date.parse(g.created_at ?? '')
- if (Number.isFinite(pushed) && now - pushed > 365 * DAY) out.push('stale')
- if (Number.isFinite(created) && now - created < 30 * DAY) out.push('fresh')
- const spdx = g.license?.spdx_id
- if (!g.license || !spdx || spdx === 'NOASSERTION') out.push('noLicense')
- if (g.fork === true) out.push('fork')
- const stars = g.stargazers_count ?? 0
- const forks = g.forks_count ?? 0
- // 별은 많은데 갈라 쓴 사람이 거의 없으면 별 수를 믿기 어렵다 (건강한 프로젝트는 보통 10~30배 안쪽)
- if (stars >= 500 && stars / Math.max(forks, 1) > 60) out.push('ratio')
- return out
- }
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.