-
Notifications
You must be signed in to change notification settings - Fork 77
feat: add pure-client snapshot skill foundation #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AmintaCCCP
wants to merge
3
commits into
main
Choose a base branch
from
feat/pure-client-cli-snapshot
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| --- | ||
| name: githubstars-snapshot | ||
| description: > | ||
| Query, categorize, and tag your GitHub starred repositories using a local | ||
| snapshot maintained by the GithubStarsManager desktop app. Use when: searching | ||
| your GitHub stars for specific topics, answering questions about your own | ||
| starred repos, organizing or labeling stars, finding repos by name/description/topic/language. | ||
| Trigger phrases: "哪些仓库…", "有没有…", "我的stars里", "搜一下我的仓库", any question | ||
| about the user's own GitHub starred repositories. | ||
| --- | ||
|
|
||
| # GitHub Stars Snapshot | ||
|
|
||
| Query and manage your GitHub starred repositories via a local snapshot file maintained by the desktop app. | ||
|
|
||
| ## Snapshot file location | ||
|
|
||
| The GithubStarsManager desktop app writes a snapshot to a fixed path. Pass this path to the tool with `--snapshot`: | ||
|
|
||
| **macOS:** `~/Library/Application Support/github-stars-manager-desktop/github-stars.snapshot.json` | ||
| **Linux:** `~/.config/github-stars-manager-desktop/github-stars.snapshot.json` | ||
| **Windows:** `%APPDATA%/github-stars-manager-desktop/github-stars.snapshot.json` | ||
|
|
||
| ## Tool | ||
|
|
||
| **Script:** `./scripts/githubstars-snapshot-tool.mjs` | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| # Search repositories (returns ranked results by relevance) | ||
| node ./scripts/githubstars-snapshot-tool.mjs search "mcp server" --snapshot ~/Library/Application\ Support/github-stars-manager-desktop/github-stars.snapshot.json | ||
|
|
||
| # Set a repository's category | ||
| node ./scripts/githubstars-snapshot-tool.mjs category set --repo owner/name --category ai-tools --snapshot <path> | ||
|
|
||
| # Add tags to a repository (comma-separated, duplicates are deduplicated) | ||
| node ./scripts/githubstars-snapshot-tool.mjs tags add --repo owner/name --tags mcp,agent --snapshot <path> | ||
|
|
||
| # Preview changes without writing (dry-run) | ||
| node ./scripts/githubstars-snapshot-tool.mjs tags add --repo owner/name --tags mcp,agent --snapshot <path> --dry-run | ||
| node ./scripts/githubstars-snapshot-tool.mjs category set --repo owner/name --category ai-tools --snapshot <path> --dry-run | ||
| ``` | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **Find the snapshot file** — the desktop app maintains it at the paths above. If multiple platforms are in use, the snapshot lives in the user home of whichever machine ran the desktop app most recently. | ||
| 2. **Search first** — always start with `search` to locate the target repository by name, topic, description, or language. | ||
| 3. **Act if needed** — use `category set` or `tags add` to organize. Prefer `--dry-run` first to preview. | ||
| 4. **Progressive disclosure** — if a search result's metadata is insufficient, the next step is reading the repository README, not the source code. Only escalate to code inspection when the question genuinely requires it. | ||
|
|
||
| ## Snapshot schema | ||
|
|
||
| ```json | ||
| { | ||
| "version": 1, | ||
| "exportedAt": "2026-03-29T00:00:00.000Z", | ||
| "repositories": [ | ||
| { | ||
| "id": 1, | ||
| "name": "repo-name", | ||
| "full_name": "owner/repo-name", | ||
| "description": "What this repo does", | ||
| "html_url": "https://github.com/owner/repo-name", | ||
| "stargazers_count": 1234, | ||
| "language": "TypeScript", | ||
| "topics": ["mcp", "ai"], | ||
| "ai_summary": "AI-generated description", | ||
| "ai_tags": ["server", "agent"], | ||
| "custom_tags": ["infra"], | ||
| "custom_category": "ai-tools" | ||
| } | ||
| ], | ||
| "categories": [] | ||
| } | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - If the snapshot file does not exist yet, the desktop app has not been run or no repositories have been synced. Ask the user to open the app and sync their stars first. | ||
| - The `--snapshot` flag is required unless running from the repo root with a default path configured. | ||
| - The tool writes changes directly to the snapshot file. Use `--dry-run` to preview without modifying. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n scripts/build-desktop.js | head -160Repository: AmintaCCCP/GithubStarsManager
Length of output: 5317
Gate these IPC channels by trusted renderer origin and use async file operations.
The new
ipcMain.handle()calls for snapshot read/write operations (lines 77-109) do not validate the sender viaevent.senderFrame, leaving them accessible to any code executing in the renderer context. AlthoughcontextIsolationand the preload bridge enforce basic isolation, an XSS vulnerability or injected content could reach these handlers. Per Electron security recommendations, validate that IPC calls originate from the expected frame origin. Additionally, lines 85 and 99 usefs.writeFileSync()andfs.readFileSync(), which block the main process; use async variants instead (or wrap insetImmediate).🤖 Prompt for AI Agents