sync-ai-insights-readme

Synchronize AI insights article lists between _meta.json and README.md managed sections.

4.7k|260|Updated Dec 29, 2021
One-click install
npx skills add https://github.com/beatai-org/beatai --skill sync-ai-insights-readme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-ai-insights-readme
Source: https://github.com/beatai-org/beatai/tree/main/.claude/skills_bak/sync-ai-insights-readme
Command: npx skills add https://github.com/beatai-org/beatai --skill sync-ai-insights-readme

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

BeatAI README 的 AI 辣评文章列表需要与源数据 _meta.json 保持一致,但手工维护容易遗漏、顺序错乱,且容易误改 README 中不应被管理的内容。

Core Features & Use Cases

  • Deterministic managed section rendering:从 public/docs/ai-insights/_meta.json 生成 README 的两个受管段落(## 🔥 高能入口、## 🗂️ 全量航线),保证顺序与内容可复现。
  • Partial replacement only:仅替换 README 中这两个段落的边界内容,最大限度保留用户自定义内容不被覆盖。
  • Safe sync workflow:在写回前确保 README 仅发生受管段落的变化;必要时可在 push 模式下提交并推送到目标分支。

Quick Start

Run: python3 .claude/skills/sync-ai-insights-readme/scripts/sync_ai_insights_readme.py --repo-dir /Users/sunfei/development/BeatAI

Frequently Asked Questions about sync-ai-insights-readme

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync markdown content from a JSON metadata file into specific README sections?

To sync markdown content from a JSON metadata file into specific README sections, this script generates deterministic markdown from _meta.json and performs a partial replacement of two bounded sections in README.md, preserving all other custom content.

How does partial replacement work when updating a README file?

Partial replacement works by identifying strictly managed boundary markers in the README file, validating that only those two bounded sections change during the sync process, and writing updates without modifying any user-defined content outside those boundaries.

Can I use GITHUB_TOKEN to automatically push README updates to my repository?

Yes, you can use GITHUB_TOKEN or GH_TOKEN to automatically push README updates. The script supports an optional authenticated push mode and can perform a git pull --ff-only before writing changes to the target branch.

What is the best way to keep an article list in README sorted by time automatically?

The best way to keep an article list sorted automatically is to render the content from _meta.json in descending time order, ensuring the README's managed sections reflect a deterministic and reproducible sequence without manual intervention.

Does the README sync script support custom markdown rendering formats?

The script uses deterministic markdown rendering to update the managed sections, meaning the format is strictly controlled to ensure reproducible content lists rather than supporting arbitrary custom markdown rendering formats.

Why does my README content get overwritten when syncing from metadata?

If README content gets overwritten during a metadata sync, it indicates the strict validation failed or the affected content was within the managed boundaries. The tool is designed to only change two specific bounded sections and preserve everything else.