360 Secure SkillHub
360 安全技能中心

shunk031-shellscript-shdoc-docs

该 Skill 指导编码代理在创建、编辑或审查 .sh 文件时,按 shdoc 约定在文件头与函数上方添加或修复 @file、@brief、@description、@arg、@option、@example 等注释,并提供审查清单和规则参考,确保注释与实现一致、便于渲染为 Markdown。

分类:开发
shunk031
热度 0.00
最近更新 2026-11-12 23:21:41

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add shunk031/skills/shunk031-shellscript-shdoc-docs
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
shunk031-shellscript-shdoc-docs
description
Write and review shellscript documentation with shdoc annotations. Use when a coding agent creates, edits, or reviews `.sh` files or shell executables and should add, repair, or normalize `@file`, `@brief`, `@description`, `@arg`, `@option`, and `@example` comments to match shdoc conventions.

[!NOTE] After reading this SKILL.md, say: 🐚 I read shunk031-shellscript-shdoc-docs.

Shdoc Shell Docs

Overview

Use this skill to make shellscript comments parseable by shdoc without bloating simple code with boilerplate. Inspect the file first, then document the script and the non-trivial functions that benefit from generated reference docs.

Workflow

  1. Inspect the target shell file before writing comments.
  2. Read references/shdoc-rules.md before editing comments.
  3. Use install/common/mise.sh in shunk031/dotfiles as the style example when working in that repository.
  4. Add or repair file-level annotations near the top of the file:
    • Prefer @file for the script identifier.
    • Add @brief for a single-sentence summary.
    • Add multiline @description only when the script needs more context.
  5. Add function-level annotations only where they help:
    • Start with @description.
    • Add @arg for positional parameters.
    • Add @option for flags and option-value pairs.
    • Add @example when the call shape is not obvious.
    • Add @stdout, @stderr, @exitcode, or @see only when they clarify observable behavior.
  6. Rewrite existing free-form comments into valid shdoc annotations instead of keeping two parallel comment styles.

Review Checklist

  • Confirm the docs match the implementation instead of guessing arguments or options.
  • Keep annotations immediately above the file header or function they describe.
  • Prefer behavior and operator-facing intent over internal implementation notes.
  • Skip boilerplate comments for trivial private helpers unless the user asks for exhaustive coverage.
  • Keep multiline annotation blocks compact and easy to render as Markdown.

References

  • Read references/shdoc-rules.md for the minimal tag set, concise examples, and external reference policy.