Skip to content
Back to skills

Docstring

ASecurity

- 默认用Google风格docstring,项目已有NumPy风格则跟随 - 一行摘要用祈使句("计算xxx"而非"这个函数计算xxx") - Args段:每个参数一行,格式 `name (type): 描述` - Returns段:写明类型和含义,多返回值用tuple说明各元素 - Raises段:只列主动raise的异常,不列底层传播的 - 示例(Examples):给出可直接运行的doctest片段 - 类docstring写在class行下方,描述职责而非实现 - 中文项目用中文写docstring,英文项目用英文,混合项目跟随已有风格 - 私有方法(_前缀)可省略docstring,公开API必须有 - 装饰器不影响docstring位置,始终写在def下一行

  • 687 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added June 5, 2026
documentationgoapi

Works with

  • api

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add val1813/kwcode --skill docstring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docstring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docstring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/val1813-docstring/badge)](https://www.skillsdirectory.com/skills/val1813-docstring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: DocstringExpert
version: 1.0.0
trigger_keywords: [docstring, 注释, comment, 代码注释, 函数注释]
trigger_min_confidence: 0.7
pipeline: [locator, generator]
lifecycle: mature
---

## 领域知识

- 默认用Google风格docstring,项目已有NumPy风格则跟随
- 一行摘要用祈使句("计算xxx"而非"这个函数计算xxx")
- Args段:每个参数一行,格式 `name (type): 描述`
- Returns段:写明类型和含义,多返回值用tuple说明各元素
- Raises段:只列主动raise的异常,不列底层传播的
- 示例(Examples):给出可直接运行的doctest片段
- 类docstring写在class行下方,描述职责而非实现
- 中文项目用中文写docstring,英文项目用英文,混合项目跟随已有风格
- 私有方法(_前缀)可省略docstring,公开API必须有
- 装饰器不影响docstring位置,始终写在def下一行

## 经验规则(自动生成)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.