360 Secure SkillHub
360 安全技能中心

markdown-toc-generator

根据用户提供的 Markdown 路径运行 Python 脚本,从 # 至 ###### 标题生成嵌套目录并展示,用户确认后写回文档;仅用标准库,只读写给定路径,无网络访问,跳过围栏代码块中的标题。

hmahmadcs
hmahmadcs
热度 27.47
最近更新 2026-10-17 21:03:25
分类:效率依赖:代码执行 / 读写文件应用场景:工作流 / 模板

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add hmahmadcs/markdown-toc-generator
Metadata
name
markdown-toc-generator
description
Insert or refresh a table of contents for Markdown headings. Use when a long doc needs an up-to-date TOC under a marker comment.
metadata
{"clawdbot":{"emoji":"📑","requires":{"bins":["python3"]}}}

Markdown TOC Generator

Purpose / Overview

Builds a nested TOC from #–###### headings.

When to Use

  • README or design doc grew long
  • User asks to "update the TOC"

Usage / Instructions

  1. Take the Markdown path from the user.
  2. Run python3 scripts/make_toc.py <path>.
  3. Show the TOC; write back only if the user confirms.

Examples

python3 scripts/make_toc.py ./README.md

Requirements / Dependencies

python3 (stdlib).

Limitations / Caveats

Skips fenced code blocks when detecting headings (best-effort).

Security / Permissions

Reads (and optionally writes) only the path provided. No network.

Description

Insert or refresh a table of contents for Markdown headings.

License or terms

Business

Use case

For users and teams who want a concise assistant for: Insert or refresh a table of contents for Markdown headings.

Risks and mitigations

References

Ethical considerations

Illegal use of this skill is not allowed. The publisher will not be accountable for outcomes arising from unlawful use under country or international law. Prohibited examples include breaking into accounts without authorization, deploying ransomware, and trafficking in stolen personal data. Misuse against third-party systems without authorization is illegal.