360 Secure SkillHub
360 安全技能中心

README Env Table Sync

核心功能:解析环境模板文件(如.env.example)的变量生成Markdown表格,检测README标记块内的文档偏差,支持报告偏差或直接同步更新。典型场景:CI流程检测文档与配置不一致,日常维护同步文档与环境配置。输入可指定环境文件、README文件、同步模式等参数;输出返回同步状态,不同退出码表示结果,打印操作摘要。

daniellummis
daniellummis
热度 51.80
最近更新 2026-05-11 17:28:58
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / DevOps / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add readme-env-table-sync
Metadata
name
readme-env-table-sync
description
Generate and sync a README environment-variable table from .env.example using marker blocks, with drift detection for CI.
version
1.0.0
metadata
{"openclaw":{"requires":{"bins":["bash","python3"]}}}

README Env Table Sync

Use this skill to keep README environment-variable docs aligned with the real .env.example file.

What this skill does

  • Parses env keys from .env.example (or another env template file)
  • Generates a markdown table with key/default values
  • Detects doc drift by comparing generated table with the README marker block
  • Optionally applies the update directly into README

Inputs

Optional:

  • ENV_FILE (default: .env.example)
  • README_FILE (default: README.md)
  • SYNC_MODE (report or apply, default: report)
  • TABLE_START_MARKER (default: <!-- ENV_TABLE_START -->)
  • TABLE_END_MARKER (default: <!-- ENV_TABLE_END -->)

Run

Drift report (CI-friendly):

ENV_FILE=.env.example \
README_FILE=README.md \
bash skills/readme-env-table-sync/scripts/sync-readme-env-table.sh

Apply sync:

ENV_FILE=.env.example \
README_FILE=README.md \
SYNC_MODE=apply \
bash skills/readme-env-table-sync/scripts/sync-readme-env-table.sh

Run against included fixtures:

ENV_FILE=skills/readme-env-table-sync/fixtures/.env.sample \
README_FILE=skills/readme-env-table-sync/fixtures/README.sample.md \
SYNC_MODE=apply \
bash skills/readme-env-table-sync/scripts/sync-readme-env-table.sh

Output contract

  • Exit 0 when table is already in sync (report) or update is applied (apply)
  • Exit 1 on invalid inputs, missing markers, parse errors, or detected drift in report mode
  • Prints a short summary with key count and mode