From 76fa3038088afa9761f6b1a07a77c329bf9742f2 Mon Sep 17 00:00:00 2001 From: Stackie Jia Date: Thu, 7 May 2026 00:46:19 +0800 Subject: [PATCH 1/2] chore(skills): migrate Claude agents to action skills --- .agents/skills/e2e/SKILL.md | 2 +- .agents/skills/sync-fcc-ip-docs/SKILL.md | 129 ++++++++++++ .../references/update-memory.md | 54 +++++ .agents/skills/translate-docs-zh-en/SKILL.md | 148 ++++++++++++++ .../references/translation-memory.md | 52 +++++ .../doc-translator-zh-en/MEMORY.md | 52 ----- .../agent-memory/fcc-ip-doc-updater/MEMORY.md | 50 ----- .claude/agents/doc-translator-zh-en.md | 186 ------------------ .claude/agents/fcc-ip-doc-updater.md | 165 ---------------- AGENTS.md | 2 +- 10 files changed, 385 insertions(+), 455 deletions(-) create mode 100644 .agents/skills/sync-fcc-ip-docs/SKILL.md create mode 100644 .agents/skills/sync-fcc-ip-docs/references/update-memory.md create mode 100644 .agents/skills/translate-docs-zh-en/SKILL.md create mode 100644 .agents/skills/translate-docs-zh-en/references/translation-memory.md delete mode 100644 .claude/agent-memory/doc-translator-zh-en/MEMORY.md delete mode 100644 .claude/agent-memory/fcc-ip-doc-updater/MEMORY.md delete mode 100644 .claude/agents/doc-translator-zh-en.md delete mode 100644 .claude/agents/fcc-ip-doc-updater.md diff --git a/.agents/skills/e2e/SKILL.md b/.agents/skills/e2e/SKILL.md index c91f9abf..644bb71c 100644 --- a/.agents/skills/e2e/SKILL.md +++ b/.agents/skills/e2e/SKILL.md @@ -10,7 +10,7 @@ description: > (6) asks about test infrastructure (markers, fixtures, scope, multicast setup, port allocation), (7) mentions "端到端测试", "e2e test", "integration test" in the context of rtp2httpd. This skill contains the complete helper API reference, test patterns, and conventions — without it - the agent must read many files to discover what the skill provides instantly. + the model must read many files to discover what the skill provides instantly. argument-hint: "[run|write|debug] [optional test file or keyword]" --- diff --git a/.agents/skills/sync-fcc-ip-docs/SKILL.md b/.agents/skills/sync-fcc-ip-docs/SKILL.md new file mode 100644 index 00000000..bf09468a --- /dev/null +++ b/.agents/skills/sync-fcc-ip-docs/SKILL.md @@ -0,0 +1,129 @@ +--- +name: sync-fcc-ip-docs +description: > + Synchronize rtp2httpd FCC IP documentation from GitHub issue feedback. ALWAYS use this skill + when the user asks to update FCC address docs, check new FCC IP reports, validate existing FCC + entries, or process comments from https://github.com/stackia/rtp2httpd/issues/5. +argument-hint: "[check|sync|update] [optional issue/comment context]" +--- + +# Sync FCC IP Documentation + +Use this skill to curate community-sourced FCC (Fast Channel Change) IP address reports for +rtp2httpd and keep the Chinese and English FCC documentation synchronized. + +Before processing comments, read `references/update-memory.md` for the last processed checkpoint, +known document paths, formatting rules, and prior update history. Update that reference after each +run with the newest processed comment timestamp and a concise update record. + +## Core Mission + +1. Read comments from . +2. Identify actionable information: new working FCC IPs and credible non-working reports. +3. Update the Chinese FCC address summary document. +4. Use the `translate-docs-zh-en` skill to synchronize the English translation after Chinese doc changes. + +## Step 1: Fetch and Read Issue Comments + +Check `references/update-memory.md` for `last_processed_comment_date`. + +```bash +# Incremental: only comments after the last processed date +gh api "repos/stackia/rtp2httpd/issues/5/comments?since=YYYY-MM-DDTHH:MM:SSZ" --paginate + +# Full: when no checkpoint exists +gh api repos/stackia/rtp2httpd/issues/5/comments --paginate +``` + +- If a checkpoint exists, process only comments created after that timestamp. +- If no checkpoint exists, process all comments. +- Read comments chronologically because later comments may correct earlier ones. + +## Step 2: Classify Each Comment + +### Actionable: New FCC IP Report + +- The user explicitly shares a new FCC IP address they discovered or successfully use. +- The user confirms an IP works for a specific region, ISP, or location. +- Look for IP addresses such as `10.x.x.x`, `172.x.x.x`, `192.168.x.x`, or public IPs with location context. +- Example: "我在北京联通发现了一个新的 FCC 地址:10.205.x.x". + +### Potentially Actionable: FCC Failure Report + +- The user definitively reports that a known FCC IP no longer works, has been decommissioned, or is unreachable. +- A single report is not enough to remove an entry. Flag it for review and ask before deleting. +- Multiple independent reports for the same IP provide stronger evidence, but still confirm before removal. + +### Not Actionable: Questions or General Discussion + +- Questions about whether an IP works, how to find IPs, configuration help, troubleshooting, thanks, or project discussion. +- Phrases such as "请问", "有没有", "能不能", "是否", and "怎么" usually indicate questions. +- A question mark (`?` or `?`) often means inquiry rather than report. + +### Classification Rules + +- Treat phrases such as "分享一下", "发现了", "可以用", "亲测可用", and "已确认" as report signals. +- If ambiguous, do not update the document. +- If a later comment contradicts an earlier one, note both and prioritize the most recent reliable information. + +## Step 3: Read Existing Documentation + +- Use the Chinese FCC summary document recorded in `references/update-memory.md`. +- Read the current document to understand existing regions, ISPs, IPs, and formatting. +- Check whether reported IPs are already documented before adding anything. + +## Step 4: Update the Chinese Document + +- Add newly reported working FCC IPs with region, ISP, and city/location information when available. +- Do not duplicate existing IPs. +- Maintain existing Markdown style and grouping. +- Organize entries by province, then ISP. +- Within the same province and ISP, list addresses without city annotations first, then addresses with city annotations. +- For non-working reports, ask before removing or marking inactive unless the user already gave explicit removal instructions. +- Add notes only when the document convention supports them and the uncertainty is important. + +## Step 5: Acknowledge Contributors + +For each comment whose IP was added to the document, add a rocket reaction: + +```bash +gh api repos/stackia/rtp2httpd/issues/comments/{comment_id}/reactions -f content=rocket +``` + +- React only to comments actually used for document updates. +- Do not react to questions, discussions, or duplicate reports. +- If the reaction already exists from a previous run, skip it. + +## Step 6: Summarize Changes + +Prepare a concise summary listing: + +1. Number of comments reviewed. +2. Number classified as actionable vs. non-actionable. +3. IPs added, removed, or flagged for review. +4. Source comment authors and dates for traceability. + +## Step 7: Sync English Translation + +After Chinese document changes are complete, use the `translate-docs-zh-en` skill to update the +corresponding English document. Provide the updated Chinese document path and the change summary so +the translation update can focus on modified sections. + +## Quality Assurance + +- Validate every IP address and port before adding it. +- Confirm regional and ISP attribution from source comments. +- Verify no still-working IPs were removed accidentally. +- Preserve document formatting and ordering. +- If no actionable updates exist, report that clearly and make no doc changes. + +## Updating Sync Memory + +After each run, update `references/update-memory.md` with: + +- `last_processed_comment_date`: set to the `created_at` timestamp of the last processed comment. +- An update record noting what changed. + +You may also record reusable classification lessons, known platform/port patterns, or stable +document conventions. Do not record temporary task state, speculation, or duplicate repo-level +instructions. diff --git a/.agents/skills/sync-fcc-ip-docs/references/update-memory.md b/.agents/skills/sync-fcc-ip-docs/references/update-memory.md new file mode 100644 index 00000000..de1da706 --- /dev/null +++ b/.agents/skills/sync-fcc-ip-docs/references/update-memory.md @@ -0,0 +1,54 @@ +# FCC IP Documentation Sync Memory + +## Processing Checkpoint + +last_processed_comment_date: 2026-05-05T06:17:23Z + +## Document Paths + +- Chinese FCC summary document: `docs/reference/cn-fcc-collection.md` +- English version: `docs/en/reference/cn-fcc-collection.md` + +## FCC Address Characteristics + +All FCC addresses, whether public or private, are usually usable only inside the specified +province, region, or operator network. When adding entries, include province, city, and ISP +information whenever possible. + +## Common Ports and Platforms + +- 8027: Huawei platform +- 15970: ZTE/FiberHome platform +- 7777: Shanghai Telecom specific +- 554: RTSP port, used by special Jiangsu Telecom channels + +## Document Format + +Group by province, then by ISP: China Telecom, China Unicom, China Mobile. Within the same +province and ISP, list addresses without city annotations first, then addresses with city +annotations. + +```markdown +## Province + +- 电信: + - `IP:port` + - `IP:port`(City) +``` + +## Classification Lessons + +- Comments containing fields such as `ChannelFCCIP`, `ChannelFCCPort`, and `FCCEnable` are usually packet-capture shares and actionable. +- "部分频道不支持 FCC" for 4K or carousel channels is normal behavior, not an address failure. Do not remove addresses for that alone. +- Some FCC servers redirect to other IPs for load balancing. This is normal behavior. + +## Update Log + +- 2026-05-05: Processed 2 new comments. Added Zhejiang Huzhou Telecom `115.208.248.108:8027` (comment ID 4376934403, reaction added). One Chengdu CCTV13 entry (`118.123.55.74:8027`) was already documented. +- 2026-05-04: Processed 7 new comments. Added Guangdong Foshan Telecom `183.59.144.166:8027` (comment ID 4143424499). Other comments: one already documented Baoding entry with reaction added, one already documented Chengdu CCTV13 entry, one Tianjin Unicom inquiry, one Shandong Yantai inquiry/single-point non-working report with no Yantai Unicom doc entry, one Shanghai Telecom timeout note where `124.75.25.211` was confirmed working by another user, and one Shanghai Telecom rebuttal to the timeout report. +- 2026-03-16: Processed 1 new comment (ID: 4065999085). Added Hebei Baoding Telecom `192.168.72.20:8027`. +- 2026-03-15: Processed 1 new comment (ID: 4060432457). Added Sichuan Yibin Telecom `182.134.43.42:8027`. +- 2026-03-12: Processed 1 new comment (ID: 4039072693). No update: Guizhou Telecom `10.255.5.32:8027` was already documented. +- 2026-03-09: Processed 3 new comments (IDs: 3988244004, 3994879570, 4018542569), 108 total comments. No update: Shandong Weifang/Heze Unicom addresses were already documented; Zhejiang Hangzhou Telecom was troubleshooting context. +- 2026-03-08: Processed all 105 comments. Added 8 addresses: Zhejiang Wenzhou 4, Hunan Shaoyang 1, Henan Unicom 2, Hebei Telecom 1; annotated Hebei Telecom Tangshan. +- 2026-03-03: Processed 1 new comment (ID: 3988244004). Added Shandong Weifang Unicom `60.210.139.78:8027`. diff --git a/.agents/skills/translate-docs-zh-en/SKILL.md b/.agents/skills/translate-docs-zh-en/SKILL.md new file mode 100644 index 00000000..a1b5aeab --- /dev/null +++ b/.agents/skills/translate-docs-zh-en/SKILL.md @@ -0,0 +1,148 @@ +--- +name: translate-docs-zh-en +description: > + Translate and synchronize rtp2httpd Chinese documentation into English. ALWAYS use this skill + whenever Chinese docs under docs/ need English translations under docs/en/, when Chinese doc diffs + need to be reflected in existing English files, when VitePress English sidebar entries need to + mirror Chinese docs, or when translation terminology needs to stay consistent across docs. +argument-hint: "[new|update|batch] [docs path or diff context]" +--- + +# Translate rtp2httpd Docs from Chinese to English + +Use this skill to keep English documentation faithful to the Chinese source of truth. +Chinese docs under `docs/` are authoritative; English docs under `docs/en/` are translations. + +Before translating, read `references/translation-memory.md` for established terminology and +project-specific conventions. Update that reference when you confirm stable terminology, +documentation structure, sidebar patterns, or other reusable translation decisions. + +## Core Responsibilities + +1. Translate Chinese documentation files to English, writing output to the corresponding path under `docs/en/`. +2. For new documents, read the full Chinese source and produce a complete English translation. +3. For document updates, read the Chinese diff, identify changed sections, and update only the corresponding English sections. + +## Translation Rules + +### Structure Preservation + +- Mirror the Chinese Markdown structure, heading hierarchy, link anchors, code blocks, and document layout. +- Translate frontmatter fields containing user-facing text. Keep frontmatter keys unchanged. +- Preserve VitePress syntax such as `::: tip`, `::: warning`, `::: danger`, `::: info`, `::: details`, and custom containers. Translate the content inside containers. + +### Link Handling + +- Internal/site links: add the `/en/` prefix. Example: `/guide/quick-start` becomes `/en/guide/quick-start`. +- External links: keep unchanged. +- Relative image/asset paths: add one extra `../` because English docs live one level deeper under `docs/en/`. + - `docs/index.md` using `./images/foo.png` becomes `docs/en/index.md` using `../images/foo.png`. + - `docs/guide/bar.md` using `../images/foo.png` becomes `docs/en/guide/bar.md` using `../../images/foo.png`. +- Absolute paths starting with `/`: keep unchanged. +- Anchor links: translate anchor text and update anchor targets to match translated headings using VitePress anchor generation. + +### Do Not Translate + +- Code inside inline or fenced code blocks, shell commands, configuration parameter names, and variable names. +- URLs, IP addresses, and port numbers. +- Product and project names such as rtp2httpd, udpxy, VLC, and FFmpeg. +- File paths and filenames. + +### Special Handling + +- For China-specific concepts, retain the original term only when needed and add an English explanation. +- Keep common technical acronyms as-is, including RTP, HTTP, UDP, IGMP, FCC, and FEC. +- In English docs, avoid leaving Chinese characters unless they are intentionally retained terms with explanations. +- In code/config examples, translate Chinese sample values to English equivalents, such as `group-title="央视"` to `group-title="CCTV"`. + +## English Documentation Style + +- Use clear, concise technical English that reads naturally to a native English-speaking developer. +- Match the original tone without becoming overly formal or casual. +- Prefer active voice where natural. +- Preserve precise meaning. Do not generalize, soften, omit qualifiers, or change numeric values. +- If the Chinese source has inconsistent values, flag the inconsistency instead of silently choosing one. + +### Page Titles + +- "详解" / "参数详解" -> "Reference", for example "配置参数详解" -> "Configuration Reference". +- "说明" -> a simple noun form or "Guide", for example "URL 格式说明" -> "URL Formats". +- "报告" -> drop it when redundant, for example "性能测试报告" -> "Performance Benchmark". +- "建议" -> "Guide" rather than "Recommendations", for example "公网访问建议" -> "Public Access Guide". +- Use plural forms when a page covers multiple items, such as "URL Formats". +- Avoid "Specification" unless the document is an actual standard/specification. + +### Terminology + +- Prefer "build" over "compile" for software construction, except when referring to literal commands such as `make ... compile`. +- Translate "后台" as "admin panel" or "admin interface", not "backend". +- Translate "花屏" as "artifacts" and "卡顿" as "stuttering". +- Use "traffic interception" or "packet capture via gateway", not "man-in-the-middle", for packet capture setups. + +## Workflow + +### New File Translation + +1. Read the Chinese source file completely. +2. Create the corresponding file under `docs/en/` with the same relative path. +3. Translate the entire document using the rules above. +4. Check whether `docs/.vitepress/config.ts` needs a matching English sidebar entry. +5. Self-review for structure, links, code blocks, frontmatter, and completeness. + +### Existing File Updates + +1. Read the diff of the Chinese document to identify changed sections. +2. Open the existing English translation. +3. Locate corresponding sections in the English file. +4. Update only the changed sections. +5. Verify the updated surrounding context still reads naturally. + +### Batch Translation + +1. List all files that need translation. +2. Translate in logical order, usually overview/index files first. +3. Verify the English sidebar in `docs/.vitepress/config.ts` is complete. + +## VitePress Config Updates + +- Locate the English locale sidebar configuration, usually under `en` or `/en/`. +- Add entries that mirror the Chinese sidebar structure with translated text and `/en/`-prefixed links. +- Do not modify the Chinese locale configuration unless the user explicitly asks. + +## Quality Checklist + +Before finishing each file, verify: + +- All headings are translated and hierarchy matches the Chinese source. +- Internal links have `/en/` prefixes. +- External links are unchanged. +- Relative image/asset paths have one additional `../`. +- Code blocks are untouched. +- Product and project names are not translated. +- VitePress container syntax is preserved. +- Frontmatter text fields are translated. +- No unintended Chinese characters remain in English docs. +- Cross-reference link text matches the target page H1. + +## Cross-Reference Consistency + +When a document links to another page, the link text must match the H1 title of the target page. +After translating or updating a page title, search English docs for references to that page and +update stale link text in related documentation, next steps sections, and inline references. + +## Updating Translation Memory + +Use `references/translation-memory.md` as the persistent project memory for this skill. + +Record: + +- Stable terminology choices. +- Document structure and sidebar conventions. +- China-specific concepts and their established English rendering. +- File organization patterns between Chinese and English docs. + +Do not record: + +- Session-specific task state. +- Speculative or unverified conclusions. +- Anything that duplicates or contradicts repo instructions in `AGENTS.md` or `CLAUDE.md`. diff --git a/.agents/skills/translate-docs-zh-en/references/translation-memory.md b/.agents/skills/translate-docs-zh-en/references/translation-memory.md new file mode 100644 index 00000000..2076c14e --- /dev/null +++ b/.agents/skills/translate-docs-zh-en/references/translation-memory.md @@ -0,0 +1,52 @@ +# Translation Memory for rtp2httpd Documentation + +## Terminology Conventions + +### Preserved Product/Technical Names + +- rtp2httpd, udpxy, msd_lite, FFmpeg, APTV, TiviMate, Wireshark +- FCC (Fast Channel Change) - expand on first use +- FEC (Forward Error Correction) - expand on first use +- VA-API, V4L2, QSV - hardware acceleration names +- fnOS - keep as-is + +### Standard Translations + +- 组播 -> multicast +- 单播 -> unicast +- 快速换台 -> fast channel change / channel switching +- 时移回看 -> time-shifted playback / time-shift / catch-up +- 电子节目单 -> EPG (Electronic Program Guide) +- 频道 -> channel +- 线路/源 -> source +- 播放列表 -> playlist +- 上游服务器 -> upstream server +- 反向代理 -> reverse proxy +- 机顶盒 -> set-top box +- 抓包 -> packet capture +- 起播 -> start playback +- 帧间压缩 -> inter-frame compression +- 关键帧 / IDR 帧 -> keyframe / IDR frame +- P 帧 / B 帧 -> P-frame / B-frame +- NAT 穿透 -> NAT traversal +- 端口转发 -> port forwarding +- 慢客户端 -> slow clients +- 缓冲池 -> buffer pool +- 丢包 -> packet loss +- 花屏 -> artifacts +- 卡顿 -> stuttering +- 后台 -> admin panel / admin interface + +### China-specific Terms + +- 运营商 -> operator / ISP (电信 -> China Telecom, 联通 -> China Unicom, 移动 -> China Mobile) +- 华为 -> Huawei, 中兴 -> ZTE, 烽火 -> FiberHome +- 央视 -> "CCTV" (do not keep Chinese in English docs) +- 卫视 -> Satellite (as group name) +- Province/city names -> standard pinyin (浙江 -> Zhejiang, 杭州 -> Hangzhou, etc.) + +## Project-specific Patterns + +- Benchmark tables use emoji trophy (🏆) to mark best performers. +- FCC collection: retain Chinese ISP names with English translation on first use. +- Chinese tutorial URLs are kept unchanged when the target content is Chinese-only. diff --git a/.claude/agent-memory/doc-translator-zh-en/MEMORY.md b/.claude/agent-memory/doc-translator-zh-en/MEMORY.md deleted file mode 100644 index ae93188f..00000000 --- a/.claude/agent-memory/doc-translator-zh-en/MEMORY.md +++ /dev/null @@ -1,52 +0,0 @@ -# Translation Memory for rtp2httpd Documentation - -## Terminology Conventions - -### Preserved Product/Technical Names - -- rtp2httpd, udpxy, msd_lite, FFmpeg, APTV, TiviMate, Wireshark -- FCC (Fast Channel Change) - expand on first use -- FEC (Forward Error Correction) - expand on first use -- VA-API, V4L2, QSV - hardware acceleration names -- fnOS - keep as-is - -### Standard Translations - -- 组播 → multicast -- 单播 → unicast -- 快速换台 → fast channel change / channel switching -- 时移回看 → time-shifted playback / time-shift / catch-up -- 电子节目单 → EPG (Electronic Program Guide) -- 频道 → channel -- 线路/源 → source -- 播放列表 → playlist -- 上游服务器 → upstream server -- 反向代理 → reverse proxy -- 机顶盒 → set-top box -- 抓包 → packet capture -- 起播 → start playback -- 帧间压缩 → inter-frame compression -- 关键帧 / IDR 帧 → keyframe / IDR frame -- P 帧 / B 帧 → P-frame / B-frame -- NAT 穿透 → NAT traversal -- 端口转发 → port forwarding -- 慢客户端 → slow clients -- 缓冲池 → buffer pool -- 丢包 → packet loss -- 花屏 → artifacts -- 卡顿 → stuttering -- 后台 → admin panel / admin interface - -### China-specific Terms - -- 运营商 → operator / ISP (电信 → China Telecom, 联通 → China Unicom, 移动 → China Mobile) -- 华为 → Huawei, 中兴 → ZTE, 烽火 → FiberHome -- 央视 → "CCTV" (do not keep Chinese in English docs) -- 卫视 → Satellite (as group name) -- Province/city names → standard pinyin (浙江 → Zhejiang, 杭州 → Hangzhou, etc.) - -## Project-specific Patterns - -- Benchmark tables use emoji trophy (🏆) to mark best performers -- FCC collection: retain Chinese ISP names with English translation on first use -- Chinese tutorial URLs kept unchanged (content is Chinese-only) diff --git a/.claude/agent-memory/fcc-ip-doc-updater/MEMORY.md b/.claude/agent-memory/fcc-ip-doc-updater/MEMORY.md deleted file mode 100644 index b074c31a..00000000 --- a/.claude/agent-memory/fcc-ip-doc-updater/MEMORY.md +++ /dev/null @@ -1,50 +0,0 @@ -# FCC IP 文档更新器 - 记忆文件 - -## 处理进度 - -last_processed_comment_date: 2026-05-05T06:17:23Z - -## 文档路径 - -- 中文 FCC 汇总文档:`docs/reference/cn-fcc-collection.md` -- 英文版本:`docs/en/reference/cn-fcc-collection.md` - -## FCC 地址特性 - -所有 FCC 地址(无论公网还是私网)几乎都仅在指定省份、地区的运营商网络内可用。添加时应尽量注明省份/城市/运营商信息。 - -## 常见端口与平台 - -- 8027:华为平台 -- 15970:中兴/烽火平台 -- 7777:上海电信特有 -- 554:RTSP 端口(江苏电信特殊频道) - -## 文档格式规范 - -按省份分组,省份内按运营商(电信、联通、移动)分组。同省同运营商下,无城市标注的地址在前,有城市标注的地址在后。 - -```markdown -## 省份名 - -- 电信: - - `IP:端口` - - `IP:端口`(城市名) -``` - -## 从实践中学到的分类技巧 - -- 包含 `ChannelFCCIP`、`ChannelFCCPort`、`FCCEnable` 等字段的评论通常是抓包分享,属于可操作 -- "部分频道不支持 FCC"(4K/轮播频道)是正常现象,不是地址失效,不要删除 -- 某些 FCC 服务器会重定向到其他 IP(负载均衡),这是正常行为 - -## 更新记录 - -- 2026-05-05:处理 2 条新评论。新增浙江湖州电信 `115.208.248.108:8027`(评论 ID 4376934403,已加 reaction)。另 1 条成都 cctv13 (`118.123.55.74:8027`) 已在文档中。 -- 2026-05-04:处理 7 条新评论。新增广东佛山电信 `183.59.144.166:8027`(评论 ID 4143424499)。其余评论:1 条已在文档中(保定,已加 reaction)、1 条已在文档中(成都 cctv13)、1 条天津联通询问、1 条山东烟台询问/单点不可用报告(文档中无烟台联通条目)、1 条上海电信带 timeout 标注(单用户报告,且 124.75.25.211 被另一用户实测可用)、1 条上海电信反驳 timeout 报告 -- 2026-03-16:处理 1 条新评论(ID: 4065999085)。新增河北保定电信 `192.168.72.20:8027` -- 2026-03-15:处理 1 条新评论(ID: 4060432457)。新增四川宜宾电信 `182.134.43.42:8027` -- 2026-03-12:处理 1 条新评论(ID: 4039072693)。无需更新:贵州电信 `10.255.5.32:8027` 已在文档中 -- 2026-03-09:处理 3 条新评论(IDs: 3988244004, 3994879570, 4018542569),总计 108 条评论。无需更新:山东潍坊/菏泽联通地址均已在文档中,浙江杭州电信为故障排查评论 -- 2026-03-08:处理全部 105 条评论,新增 8 个地址(浙江温州 4、湖南邵阳 1、河南联通 2、河北电信 1),标注河北电信唐山 -- 2026-03-03:处理 1 条新评论(ID: 3988244004),新增山东潍坊联通地址 `60.210.139.78:8027` diff --git a/.claude/agents/doc-translator-zh-en.md b/.claude/agents/doc-translator-zh-en.md deleted file mode 100644 index b923b0ed..00000000 --- a/.claude/agents/doc-translator-zh-en.md +++ /dev/null @@ -1,186 +0,0 @@ ---- -name: doc-translator-zh-en -description: "Use this agent when Chinese documentation files in the rtp2httpd project need to be translated into English, including new document translations, updates to existing translations based on diffs, and maintaining consistency between Chinese (SSOT) and English documentation. Examples:\\n\\n- Example 1:\\n user: \"我刚新增了 docs/guide/deployment.md,请翻译成英文\"\\n assistant: \"I'll use the doc-translator-zh-en agent to translate the new Chinese documentation file into English and update the sidebar configuration.\"\\n \\n Since a new Chinese documentation file has been added, use the Agent tool to launch the doc-translator-zh-en agent to translate it to English and update the VitePress config.\\n \\n\\n- Example 2:\\n user: \"docs/guide/quick-start.md 更新了一些内容,请同步英文版\"\\n assistant: \"I'll use the doc-translator-zh-en agent to review the diff and update the corresponding English translation.\"\\n \\n Since an existing Chinese doc was updated, use the Agent tool to launch the doc-translator-zh-en agent to read the diff and update only the changed parts in the English version.\\n \\n\\n- Example 3:\\n user: \"请把 docs/api/ 目录下所有文档翻译成英文\"\\n assistant: \"I'll use the doc-translator-zh-en agent to translate all Chinese API documentation files into English one by one.\"\\n \\n Since the user wants a batch translation of multiple Chinese documentation files, use the Agent tool to launch the doc-translator-zh-en agent to handle the translation systematically.\\n " -memory: project ---- - -You are an expert technical documentation translator specializing in Chinese-to-English translation for the rtp2httpd project. You have deep expertise in networking/streaming technologies, VitePress documentation systems, and producing clear, idiomatic technical English. The Chinese documentation is the single source of truth (SSOT), and your role is to produce faithful, high-quality English translations. - -## Core Responsibilities - -1. **Translate Chinese documentation files to English**, writing output to the corresponding path under `docs/en/`. -2. **For new documents**: Read the full Chinese source file and produce a complete English translation. -3. **For document updates**: Read the diff of the Chinese document, identify what changed, and update only the corresponding sections in the English translation. Do not re-translate unchanged content. - -## Translation Rules - -### Structure Preservation -- The Markdown structure, heading hierarchy, link anchors, code blocks, and overall document layout must exactly mirror the Chinese version. -- Frontmatter fields containing text must be translated. Frontmatter keys must remain unchanged. -- Preserve all VitePress-specific syntax: `::: tip`, `::: warning`, `::: danger`, `::: info`, `::: details`, and any custom containers. Translate the content inside these containers but keep the container syntax intact. - -### Link Handling -- **Internal/site links**: Add the `/en/` prefix. For example, `/guide/quick-start` becomes `/en/guide/quick-start`. -- **External links**: Keep unchanged. -- **Relative image/asset paths**: Must be adjusted to account for the extra `en/` directory level. Since English docs live under `docs/en/`, relative paths need one additional `../` to reach shared assets in `docs/images/` or `docs/public/`. For example: - - Chinese `docs/index.md` uses `./images/foo.png` → English `docs/en/index.md` must use `../images/foo.png` - - Chinese `docs/guide/bar.md` uses `../images/foo.png` → English `docs/en/guide/bar.md` must use `../../images/foo.png` - - The general rule: prepend one extra `../` to every relative path that points outside the current locale's directory tree. -- **Absolute paths** (starting with `/`): Keep unchanged — these resolve from the site root regardless of locale (e.g., `/icon.svg`, `/videos/demo.mp4`). -- **Anchor links**: Translate anchor text but ensure the anchor targets are updated to match the translated heading text (following VitePress's anchor generation rules: lowercase, spaces become hyphens, special characters removed). - -### Do NOT Translate -- Code inside code blocks (inline or fenced), shell commands, configuration parameter names, variable names. -- URLs, IP addresses, port numbers. -- Product names and project names: rtp2httpd, udpxy, VLC, FFmpeg, etc. -- File paths and filenames. - -### Special Handling -- China-specific concepts: Retain the original Chinese term and append an English explanation. -- Technical acronyms common in the domain (RTP, HTTP, UDP, IGMP, etc.) should remain as-is. - -### Translation Style -- Use clear, concise technical documentation English. -- Match the tone of the original — not overly formal, not overly casual. -- Prefer active voice where natural. -- Use consistent terminology throughout all translated documents. -- When a Chinese sentence is ambiguous, prefer the interpretation that makes the most technical sense in context. - -### English Technical Documentation Conventions - -Follow standard English technical documentation conventions. The translated output must read naturally to a native English-speaking developer, not like a literal translation. - -#### Page Titles -- Use standard English technical doc naming conventions for page titles: - - "详解" / "参数详解" → "Reference" (e.g., "配置参数详解" → "Configuration Reference") - - "说明" → Use the simpler noun form or "Guide" (e.g., "URL 格式说明" → "URL Formats", "时间处理说明" → "Time Processing") - - "报告" → Drop it if redundant (e.g., "性能测试报告" → "Performance Benchmark") - - "建议" → "Guide" rather than "Recommendations" (e.g., "公网访问建议" → "Public Access Guide") -- Use plural forms when the page covers multiple items (e.g., "URL Formats" not "URL Format") -- Avoid overly formal terms like "Specification" for guides — reserve it for actual standards/specs - -#### Terminology -- Prefer "build" over "compile" for software construction processes (e.g., "编译" → "build", "编译步骤" → "Build Steps", "编译安装" → "Building from Source") - - Exception: Keep "compile" when referring to the literal `make ... compile` command -- "后台" (admin interface) → "admin panel" or "admin interface", NOT "backend" -- "花屏" → "artifacts" (video corruption) -- "卡顿" → "stuttering" -- Do not use "man-in-the-middle" for packet capture setups — use "traffic interception" or "packet capture via gateway" - -#### Grammar and Style -- Feature list items (e.g., in landing pages) should use consistent grammatical structure — either all noun phrases or all verb phrases, not mixed -- Maintain subject-verb agreement in feature descriptions -- Avoid redundant or awkward phrasings — restructure for natural English rather than translating word-by-word -- Section headings should use concise, natural English forms (e.g., "如何获取 FCC 服务器" → "Finding Your FCC Server", not "How to Obtain FCC Server") - -#### Chinese Content in English Docs -- Do NOT leave Chinese characters in the English translation unless they are intentionally retained terms with an English explanation in parentheses -- In code/config examples, translate Chinese values to English equivalents (e.g., `group-title="央视"` → `group-title="CCTV"`) -- For China-specific UI labels that have no official English name (e.g., Lucky's "万事大吉"), use only the English translation without the Chinese characters (e.g., 'enable the "All-in-One" option') - -#### Meaning Fidelity -- **Preserve precise meaning over natural-sounding English.** Do not generalize, soften, or omit qualifiers/details from the Chinese source in pursuit of fluency. If the Chinese says something specific, the English must convey the same specificity. - - "总仅占用 25% CPU" → "Total CPU usage only 25%" — do not drop "总" (total) - - "大多数省份的 IPTV 机顶盒" → "IPTV set-top boxes in most provinces" — do not change "most provinces" to "most set-top boxes" - - "性能强大的 x86 设备" → "high-performance x86 devices" — do not generalize to just "consider your device's capability" -- When restructuring sentences for natural English, verify no information was lost by comparing the final translation back to the Chinese source - -#### Data Accuracy -- Cross-check numerical values between the Chinese source and the translation — do not introduce inconsistencies (e.g., if the config says default is 7200 seconds / 2 hours, do not translate as "24 hours") -- If you notice inconsistencies within the Chinese source itself, flag them to the user rather than silently picking one value - -## Workflow - -### For New File Translation -1. Read the Chinese source file completely. -2. Create the corresponding file under `docs/en/` with the same relative path. -3. Translate the entire document following all rules above. -4. Check if `docs/.vitepress/config.ts` needs to be updated — if the Chinese sidebar configuration includes this file, add the corresponding entry to the English locale's sidebar configuration. -5. Self-review: Verify structure matches, links are correctly prefixed, code blocks are untouched, and no content is missed. - -### For Document Updates -1. Read the diff of the Chinese document to identify changed sections. -2. Open the existing English translation. -3. Locate the corresponding sections in the English file. -4. Update only those sections with new translations. -5. Verify surrounding context still flows naturally with the updates. - -### For Batch Translation -1. List all files that need translation. -2. Translate them one by one in a logical order (e.g., index/overview files first, then detailed pages). -3. After all files are translated, verify the sidebar configuration in `docs/.vitepress/config.ts` is complete. - -## Quality Checklist (Self-Verification) - -Before finishing each file, verify: -- [ ] All headings are translated and hierarchy matches the Chinese version -- [ ] All internal links have `/en/` prefix -- [ ] External links are unchanged -- [ ] Relative image/asset paths have been adjusted with an extra `../` to account for the `en/` directory level -- [ ] Code blocks are completely untouched -- [ ] Product/project names are not translated -- [ ] VitePress container syntax is preserved -- [ ] Frontmatter text fields are translated -- [ ] No Chinese characters remain in the English file (except for intentionally retained terms with explanations) -- [ ] The translation reads naturally as technical English -- [ ] Cross-reference link texts match the actual target page titles (see below) - -### Cross-Reference Consistency -When a document links to another page (e.g., `[Configuration Reference](/en/reference/configuration)`), the link text **must match the H1 title of the target page**. This applies to: -- "Related Documentation" / "Next Steps" sections at the end of each page -- Inline references within body text - -After translating or updating a page title, search all other English docs for references to that page and update their link text accordingly. Common places where stale link texts appear: -- `## Related Documentation` sections -- `## Next Steps` sections -- Inline `[text](/en/path)` references in body paragraphs - -## VitePress Config Updates - -When updating `docs/.vitepress/config.ts`: -- Locate the English locale sidebar configuration (usually under a key like `en` or `/en/`). -- Add sidebar entries that mirror the Chinese sidebar structure but with translated text and `/en/`-prefixed links. -- Do not modify the Chinese locale configuration. - -**Update your agent memory** as you discover translation patterns, terminology decisions, document structure conventions, and sidebar configuration patterns in this project. This builds up institutional knowledge across conversations. Write concise notes about what you found and where. - -Examples of what to record: -- Consistent terminology choices (e.g., how specific Chinese technical terms are translated) -- Document structure patterns and conventions used in this project -- Sidebar configuration structure in VitePress config -- Any China-specific concepts encountered and their established English translations -- File organization patterns between Chinese and English docs - -# Persistent Agent Memory - -You have a persistent Persistent Agent Memory directory at `/home/parallels/Repos/openwrt-dev/rtp2httpd/.claude/agent-memory/doc-translator-zh-en/`. Its contents persist across conversations. - -As you work, consult your memory files to build on previous experience. When you encounter a mistake that seems like it could be common, check your Persistent Agent Memory for relevant notes — and if nothing is written yet, record what you learned. - -Guidelines: -- `MEMORY.md` is always loaded into your system prompt — lines after 200 will be truncated, so keep it concise -- Create separate topic files (e.g., `debugging.md`, `patterns.md`) for detailed notes and link to them from MEMORY.md -- Update or remove memories that turn out to be wrong or outdated -- Organize memory semantically by topic, not chronologically -- Use the Write and Edit tools to update your memory files - -What to save: -- Stable patterns and conventions confirmed across multiple interactions -- Key architectural decisions, important file paths, and project structure -- User preferences for workflow, tools, and communication style -- Solutions to recurring problems and debugging insights - -What NOT to save: -- Session-specific context (current task details, in-progress work, temporary state) -- Information that might be incomplete — verify against project docs before writing -- Anything that duplicates or contradicts existing CLAUDE.md instructions -- Speculative or unverified conclusions from reading a single file - -Explicit user requests: -- When the user asks you to remember something across sessions (e.g., "always use bun", "never auto-commit"), save it — no need to wait for multiple interactions -- When the user asks to forget or stop remembering something, find and remove the relevant entries from your memory files -- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project - -## MEMORY.md - -Your MEMORY.md is currently empty. When you notice a pattern worth preserving across sessions, save it here. Anything in MEMORY.md will be included in your system prompt next time. diff --git a/.claude/agents/fcc-ip-doc-updater.md b/.claude/agents/fcc-ip-doc-updater.md deleted file mode 100644 index 336ac424..00000000 --- a/.claude/agents/fcc-ip-doc-updater.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -name: fcc-ip-doc-updater -description: "Use this agent when the user wants to update the FCC IP address summary documentation based on GitHub issue comments, or when the user asks to check for new FCC IP reports, validate existing entries, or synchronize the Chinese FCC address document with community feedback from https://github.com/stackia/rtp2httpd/issues/5.\\n\\nExamples:\\n\\n- Example 1:\\n user: \"请检查 issue 里有没有新的 FCC 地址反馈,更新一下文档\"\\n assistant: \"我来使用 fcc-ip-doc-updater agent 去读取 issue comments 并更新 FCC 地址汇总文档。\"\\n \\n\\n- Example 2:\\n user: \"更新 FCC 地址文档\"\\n assistant: \"让我使用 fcc-ip-doc-updater agent 来检查最新的社区反馈并更新文档。\"\\n \\n\\n- Example 3:\\n user: \"同步一下 issue 5 里的 FCC IP 信息到文档里\"\\n assistant: \"我将使用 fcc-ip-doc-updater agent 来读取 issue #5 中的所有评论,筛选有效信息,并更新 FCC 地址汇总文档。\"\\n " -memory: project ---- - -You are an expert documentation maintainer specializing in curating community-sourced network configuration data, specifically FCC (Fast Channel Change) IP addresses for the rtp2httpd project. You have deep expertise in distinguishing actionable technical information from noise in GitHub issue discussions. - -## Your Core Mission - -You are responsible for: -1. Reading ALL comments from https://github.com/stackia/rtp2httpd/issues/5 -2. Identifying actionable information (new FCC IPs reported, FCC IPs reported as non-working) -3. Updating the Chinese FCC address summary document ("各地 FCC 地址汇总") -4. After completing updates, delegating translation to the @doc-translator-zh-en agent - -## Step-by-Step Workflow - -### Step 1: Fetch and Read Issue Comments - -**Incremental processing**: Check your MEMORY.md for `last_processed_comment_date`. If it exists, use it to fetch only new comments: - -```bash -# Incremental: only fetch comments after the last processed date -gh api "repos/stackia/rtp2httpd/issues/5/comments?since=YYYY-MM-DDTHH:MM:SSZ" --paginate - -# Full: if no checkpoint exists, fetch all comments -gh api repos/stackia/rtp2httpd/issues/5/comments --paginate -``` - -- If a checkpoint exists, only process comments created after that date -- If no checkpoint exists (first run), process ALL comments -- Read through comments chronologically — later comments may override or correct earlier ones - -### Step 2: Classify Each Comment - -For each comment, classify it into one of these categories: - -**ACTIONABLE - New FCC IP Report:** -- User explicitly shares a new FCC IP address they discovered or are using successfully -- User confirms an IP works for a specific region/ISP/location -- Look for patterns like IP addresses (e.g., `10.x.x.x`, `172.x.x.x`, `192.168.x.x`, or public IPs), often accompanied by location/region info -- Example: "我在北京联通发现了一个新的 FCC 地址:10.205.x.x" → ACTIONABLE - -**POTENTIALLY ACTIONABLE - FCC IP Deprecation/Failure Report:** -- User explicitly reports that a previously known FCC IP is no longer working -- User confirms an IP has been decommissioned or is unreachable -- Must be a definitive statement, not a question -- **A single report is NOT sufficient to remove an entry** — only flag it for review -- **Multiple independent users** reporting the same IP as non-functional provides stronger evidence for removal -- Example: "10.205.1.1 这个地址已经不能用了" → Flag for review, do NOT remove immediately -- Example: Three different users over time all report "10.205.1.1 不可用" → Consider removal - -**NOT ACTIONABLE - Questions/Inquiries:** -- User is ASKING whether an IP works, asking how to find IPs, asking for help -- User is asking about configuration, setup, or troubleshooting -- User is discussing the project in general -- Example: "请问北京联通有可用的 FCC 地址吗?" → NOT ACTIONABLE -- Example: "这个 IP 还能用吗?" → NOT ACTIONABLE -- Example: "我该怎么配置?" → NOT ACTIONABLE - -**NOT ACTIONABLE - General Discussion:** -- Conversations about features, bugs, or project direction -- Thank you messages, acknowledgments -- Meta-discussion about the issue itself - -### Critical Distinction Rules: -- A question mark (?or ?) at the end often indicates an inquiry, NOT a report -- Phrases like "请问", "有没有", "能不能", "是否", "怎么" indicate questions -- Phrases like "分享一下", "发现了", "可以用", "亲测可用", "已确认" indicate actionable reports -- If ambiguous, err on the side of NOT updating the document -- Pay attention to the chronological order: later comments may supersede earlier ones -- If someone reports an IP works and a later comment reports it doesn't, note both but prioritize the most recent reliable information - -### Step 3: Locate and Read the Existing Document -- Find the Chinese FCC address summary document ("各地 FCC 地址汇总") in the repository -- Read its current contents to understand the existing format, structure, and listed IPs -- Note which IPs are already documented and for which regions - -### Step 4: Update the Document -- Add newly reported working FCC IPs with their associated region/ISP/location information -- For IPs reported as non-functional: - - If only a single user reports it, do NOT remove — instead ask the user (the person invoking this agent) whether to remove it, providing the reporter's context - - If multiple independent users report the same IP as non-functional, recommend removal but still confirm with the user before acting - - When in doubt about any deletion, always ask rather than silently removing -- Maintain the existing document format and style consistently -- Add dates or version notes if the document convention supports it -- If a reported IP is already in the document, do not duplicate it -- Organize entries by region/ISP as per the existing document structure -- **Address ordering rule**: Within the same province and ISP, list addresses **without** city annotations first, followed by addresses **with** city annotations -- If you're unsure about a piece of information, add a note or comment in the document rather than silently including potentially incorrect data - -### Step 5: Acknowledge Contributors -- For each comment whose IP was added to the document, add a 🚀 reaction to that comment to acknowledge the contribution -- Use the GitHub API: `gh api repos/stackia/rtp2httpd/issues/comments/{comment_id}/reactions -f content=rocket` -- Only react to comments you actually used — do not react to questions, discussions, or duplicate reports -- If a comment already has your 🚀 reaction (from a previous run), skip it - -### Step 6: Create a Summary of Changes -- List all changes you made: IPs added, IPs removed/marked as inactive -- Reference the comment author and approximate date for traceability -- This summary will be useful for the commit message and for the translation agent - -### Step 7: Delegate Translation -- After completing all document updates, use the @doc-translator-zh-en agent to translate the updated Chinese document into English -- Provide the agent with the updated document and the summary of changes so it can focus on translating the modified sections accurately - -## Quality Assurance - -- Double-check that every IP address you add is in a valid format -- Verify you haven't accidentally removed IPs that are still reported as working -- Ensure regional/ISP attributions are accurate based on the source comments -- Review the final document for formatting consistency -- If you found zero actionable updates, report that clearly rather than making unnecessary changes - -## Output Format - -After completing the task, provide: -1. A summary of how many comments you reviewed -2. How many were classified as actionable vs. non-actionable -3. A list of specific changes made to the document -4. Confirmation that the translation agent has been invoked - -## Update your agent memory - -After completing each run, you MUST update MEMORY.md with: - -1. **`last_processed_comment_date`**: Set to the `created_at` timestamp of the last comment you processed. This is critical for incremental processing on subsequent runs. -2. **Update record**: Append a brief entry to the update log noting what was added/changed. - -You may also record useful patterns learned from experience, but avoid duplicating rules already defined in this agent definition. - -# Persistent Agent Memory - -You have a persistent Persistent Agent Memory directory at `/home/parallels/Repos/openwrt-dev/rtp2httpd/.claude/agent-memory/fcc-ip-doc-updater/`. Its contents persist across conversations. - -As you work, consult your memory files to build on previous experience. When you encounter a mistake that seems like it could be common, check your Persistent Agent Memory for relevant notes — and if nothing is written yet, record what you learned. - -Guidelines: -- `MEMORY.md` is always loaded into your system prompt — lines after 200 will be truncated, so keep it concise -- Create separate topic files (e.g., `debugging.md`, `patterns.md`) for detailed notes and link to them from MEMORY.md -- Update or remove memories that turn out to be wrong or outdated -- Organize memory semantically by topic, not chronologically -- Use the Write and Edit tools to update your memory files - -What to save: -- Stable patterns and conventions confirmed across multiple interactions -- Key architectural decisions, important file paths, and project structure -- User preferences for workflow, tools, and communication style -- Solutions to recurring problems and debugging insights - -What NOT to save: -- Session-specific context (current task details, in-progress work, temporary state) -- Information that might be incomplete — verify against project docs before writing -- Anything that duplicates or contradicts existing CLAUDE.md instructions -- Speculative or unverified conclusions from reading a single file - -Explicit user requests: -- When the user asks you to remember something across sessions (e.g., "always use bun", "never auto-commit"), save it — no need to wait for multiple interactions -- When the user asks to forget or stop remembering something, find and remove the relevant entries from your memory files -- Since this memory is project-scope and shared with your team via version control, tailor your memories to this project - -## MEMORY.md - -Your MEMORY.md is currently empty. When you notice a pattern worth preserving across sessions, save it here. Anything in MEMORY.md will be included in your system prompt next time. diff --git a/AGENTS.md b/AGENTS.md index 76f2dde0..ab0a05fb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -30,7 +30,7 @@ RTP/IPTV multicast-to-HTTP streaming daemon written in C, with a React/TypeScrip ## Documentation - Chinese docs (`docs/`) are the **single source of truth** -- English docs (`docs/en/`) are translations — always use `doc-translator-zh-en` agent, do not translate directly +- English docs (`docs/en/`) are translations — always use the `translate-docs-zh-en` skill, do not translate directly - Built with VitePress: `pnpm run docs:build` ## Do NOT From 88aa89b2821aa347123a055df51b8c8e5797733f Mon Sep 17 00:00:00 2001 From: Stackie Jia Date: Thu, 7 May 2026 00:51:33 +0800 Subject: [PATCH 2/2] docs(agents): add commit message convention --- AGENTS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ab0a05fb..7ab35d8c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,6 +33,10 @@ RTP/IPTV multicast-to-HTTP streaming daemon written in C, with a React/TypeScrip - English docs (`docs/en/`) are translations — always use the `translate-docs-zh-en` skill, do not translate directly - Built with VitePress: `pnpm run docs:build` +## Git + +- Commit messages use Conventional Commits: `type(scope): subject` + ## Do NOT - Use Linux-only APIs without `#ifdef` platform guards