Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 08:46:42 +08:00
commit d10d0cf406
7 changed files with 351 additions and 0 deletions

34
commands/list.md Normal file
View File

@@ -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, ...

102
commands/promote.md Normal file
View File

@@ -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 <owner/repo> --json name,description,url,stargazerCount,homepageUrl,repositoryTopics
```
Also fetch README for feature extraction:
```bash
gh repo view <owner/repo> --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 <weekly_repo> \
--title "<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

74
commands/search.md Normal file
View File

@@ -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"