commit d10d0cf4061bc28e8d76d0114623e4bbf7d74407 Author: Zhongwei Li Date: Sun Nov 30 08:46:42 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..9a4972e --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,15 @@ +{ + "name": "oss-promoter", + "description": "Batch promote open source projects to tech weeklies and communities. Auto-generate tailored submissions and create issues on multiple weeklies with one command.", + "version": "1.0.0", + "author": { + "name": "ourines", + "email": "github@ourines" + }, + "skills": [ + "./skills" + ], + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5af0ec --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# oss-promoter + +Batch promote open source projects to tech weeklies and communities. Auto-generate tailored submissions and create issues on multiple weeklies with one command. diff --git a/commands/list.md b/commands/list.md new file mode 100644 index 0000000..e595ebf --- /dev/null +++ b/commands/list.md @@ -0,0 +1,34 @@ +--- +description: List all configured weeklies +allowed-tools: Bash, Read +--- + +# List Configured Weeklies + +Show all weeklies in the config with their status. + +## Execution + +Read and display the weeklies config: + +```bash +cat ${CLAUDE_PLUGIN_ROOT}/config/weeklies.json +``` + +## Output Format + +Display as a formatted table: + +| ID | Name | Repo | Stars | Type | Enabled | +|----|------|------|-------|------|---------| +| ruanyf-weekly | 科技爱好者周刊 | ruanyf/weekly | 79.7k | issue | ✅ | +| ascoders-weekly | 前端精读周刊 | ascoders/weekly | 30.6k | comment | ✅ | +| ... | ... | ... | ... | ... | ... | + +## Summary Stats + +- Total configured: X +- Enabled: Y +- Disabled: Z +- By language: zh: A, en: B +- By category: tech: C, frontend: D, ... diff --git a/commands/promote.md b/commands/promote.md new file mode 100644 index 0000000..c7b95e2 --- /dev/null +++ b/commands/promote.md @@ -0,0 +1,102 @@ +--- +description: Promote an open source project to tech weeklies +allowed-tools: Bash, Read, WebSearch, WebFetch, TodoWrite +--- + +# Promote OSS Project + +Batch submit an open source project to multiple tech weeklies. + +## Input + +User provides a GitHub repo URL, e.g.: +- `https://github.com/ourines/worktree-task-plugin` +- `ourines/worktree-task-plugin` + +## Execution Steps + +### Step 1: Extract Repo Info + +```bash +gh repo view --json name,description,url,stargazerCount,homepageUrl,repositoryTopics +``` + +Also fetch README for feature extraction: +```bash +gh repo view --json readme +``` + +### Step 2: Load Weeklies Config + +Read the config file: +```bash +cat ${CLAUDE_PLUGIN_ROOT}/config/weeklies.json +``` + +### Step 3: Generate & Submit + +For each enabled weekly: + +1. Generate title from `title_template`: + - `{name}` → repo name + - `{short_description}` → first sentence of description + +2. Generate body (Chinese template): +```markdown +## 项目介绍 + +[{name}]({url}) - {description} + +## 核心功能 + +- Feature 1 (from README) +- Feature 2 +- Feature 3 + +## 使用示例 + +\`\`\`bash +# Example from README +\`\`\` + +## 链接 + +- GitHub: {url} +``` + +3. Submit based on type: + +For `type: "issue"`: +```bash +gh issue create --repo \ + --title "" \ + --body "<body>" +``` + +For `type: "comment"`: +```bash +gh issue comment <issue_number> --repo <weekly_repo> \ + --body "<body>" +``` + +### Step 4: Report Results + +Create a summary table: + +| Weekly | Status | Link | +|--------|--------|------| +| 科技爱好者周刊 | ✅ Created | https://github.com/... | +| 前端精读周刊 | ✅ Commented | https://github.com/... | +| ... | ... | ... | + +## Options + +- `--dry-run`: Show what would be submitted without actually creating issues +- `--filter <category>`: Only submit to weeklies matching the category +- `--skip <id>`: Skip specific weeklies by ID + +## Error Handling + +- If `gh` command fails, log the error and continue with next weekly +- If rate limited, wait and retry +- Track all results in TodoWrite for visibility diff --git a/commands/search.md b/commands/search.md new file mode 100644 index 0000000..ea60f17 --- /dev/null +++ b/commands/search.md @@ -0,0 +1,74 @@ +--- +description: Search for new tech weeklies to add to config +allowed-tools: Bash, WebSearch, WebFetch, Read, Write +--- + +# Search for Tech Weeklies + +Find new tech weeklies on GitHub that accept submissions. + +## Execution Steps + +### Step 1: Search GitHub + +Use `gh` to search for weekly repositories with >100 stars: + +```bash +# Search for "weekly" repos +gh search repos "weekly" --stars=">100" --limit=50 --json fullName,stargazersCount,description + +# Search for "周刊" repos +gh search repos "周刊" --stars=">100" --limit=50 --json fullName,stargazersCount,description +``` + +### Step 2: Filter Results + +Filter to find actual tech weeklies (not just repos with "weekly" in name): +- Must have issue submissions enabled +- Description mentions "周刊", "weekly", or "newsletter" +- Has recent activity + +### Step 3: Check Submission Format + +For each candidate, use WebFetch to check: +- Does the repo accept submissions via issues? +- What format do they expect? +- Are there any specific requirements? + +```bash +gh repo view <repo> --json hasIssuesEnabled,readme +``` + +### Step 4: Update Config + +If new weeklies are found, suggest additions to `weeklies.json`: + +```json +{ + "id": "new-weekly-id", + "name": "周刊名称", + "repo": "owner/repo", + "stars": 1000, + "language": "zh", + "type": "issue", + "title_template": "【推荐】{name} - {short_description}", + "categories": ["tech", "tools"], + "enabled": true +} +``` + +### Step 5: Report Findings + +Output a table of discovered weeklies: + +| Repo | Stars | Description | Accepts Issues | Added | +|------|-------|-------------|----------------|-------| +| owner/repo | 1000 | Description | ✅ | ❌ New | + +## Web Search Queries + +If GitHub search is insufficient, use WebSearch: + +- "GitHub 技术周刊 投稿" +- "开源项目周刊 issue 推荐" +- "tech weekly newsletter github submissions" diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..a85cc94 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,57 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:ourines/oss-promoter:", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "e7a61a7fcfc3b5702abf5c210aee9241924871be", + "treeHash": "dde866e24db5f3bb49779e005f4ad919aa17a8ece4fe90696ffe280e0aad6fcf", + "generatedAt": "2025-11-28T10:27:33.906464Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "oss-promoter", + "description": "Batch promote open source projects to tech weeklies and communities. Auto-generate tailored submissions and create issues on multiple weeklies with one command.", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "16accfddbebd12f31fe7358a4a80f9f1b790db2af1816bb10338cdfc1e9d9dfc" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "f9d49c3c3d47e4f26caa772ad3c76a4d5ea20ba5d8e1f5fc9d2993a9349ebdef" + }, + { + "path": "commands/search.md", + "sha256": "a1a94d256f8f038fbfa47ae13fe89532f83f4b50fa2991f18fd2b0268bf2a790" + }, + { + "path": "commands/list.md", + "sha256": "a5c4a5228180efee35bcc4f79ea226d18c915cfb28b846daad96e1194c6dd6e9" + }, + { + "path": "commands/promote.md", + "sha256": "2816fe0aadfe49de4d1e1666ac0c2a890f66a15cdacb57aa378e662ae85d10ff" + }, + { + "path": "skills/promote/SKILL.md", + "sha256": "94871dd35e93bda65268467e21662d2f45a35fded074407d84e7d5ba45bf3704" + } + ], + "dirSha256": "dde866e24db5f3bb49779e005f4ad919aa17a8ece4fe90696ffe280e0aad6fcf" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/promote/SKILL.md b/skills/promote/SKILL.md new file mode 100644 index 0000000..0031798 --- /dev/null +++ b/skills/promote/SKILL.md @@ -0,0 +1,66 @@ +# OSS Promoter Skill + +Batch promote open source projects to tech weeklies and communities. + +## What this skill does + +1. **Search for weeklies**: Use WebSearch to find new tech weeklies that accept submissions +2. **Extract project info**: Use `gh` to get repo description, README, stars, etc. +3. **Generate submissions**: Create tailored issue content for each weekly +4. **Batch submit**: Use `gh issue create` or `gh issue comment` to submit + +## Usage + +When the user wants to promote an open source project: + +1. First, ask for the GitHub repo URL if not provided +2. Load the weeklies config from `${CLAUDE_PLUGIN_ROOT}/config/weeklies.json` +3. Use `gh repo view <repo> --json name,description,url,stargazerCount,readme` to get project info +4. For each enabled weekly in the config: + - Generate title using the `title_template` + - Generate body using the project info + - If `type` is "issue": use `gh issue create --repo <weekly_repo> --title "<title>" --body "<body>"` + - If `type` is "comment": use `gh issue comment <issue_number> --repo <weekly_repo> --body "<body>"` +5. Track submissions and report results + +## Commands + +- `/oss-promoter:promote <repo-url>` - Promote a project to all enabled weeklies +- `/oss-promoter:search` - Search for new weeklies to add to config +- `/oss-promoter:list` - List all configured weeklies and their status + +## Submission Template + +For Chinese weeklies, use this template: + +```markdown +## 项目介绍 + +[{name}]({url}) - {description} + +## 核心功能 + +{features_from_readme} + +## 使用示例 + +{usage_example} + +## 链接 + +- GitHub: {url} +- Stars: {stars} +``` + +## Tools Available + +- `WebSearch` - Search for new weeklies +- `Bash` with `gh` - GitHub CLI for repo info and issue creation +- `Read` - Read config files + +## Important Notes + +- Always check if an issue already exists before creating a new one +- Respect rate limits - add delays between submissions if needed +- Some weeklies require specific formats - check their README first +- Set `enabled: false` for weeklies that are language/topic specific and don't match the project