Token导航 LogoToken导航

Agent Skill · 开发

code-commenting(代码注释)

code-commenting 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

code-commenting 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 21,184。

总安装 194周安装 8GitHub Stars 公开资料未说明下载 63核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:code-commenting(代码注释)
来源仓库:https://github.com/marclelamy/skills
仓库路径:skills/code-commenting
安装命令:
npx skills add https://github.com/marclelamy/skills --skill code-commenting
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/marclelamy/skills --skill code-commenting

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

提供简洁分层注释规范,解释代码角色与上下文而非重复逻辑。每个新文件添加头部注释块,说明作用域与约束条件。强调纯函数、职责单一性等设计原则的文档化。适用于团队协作中统一注释风格与知识传递。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

code-commenting 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/code-commenting

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/marclelamy/skills --skill code-commenting;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

code-commenting 怎么安装?

在终端执行 npx skills add https://github.com/marclelamy/skills --skill code-commenting。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

code-commenting 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

code-commenting 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

code-commenting 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

code-commenting 用的人多吗?

公开数据是累计安装 194 次,近一周安装 8 次,下载 63 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

code-commenting 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
code-commenting

代码注释 · 本页

194—只读未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Commenting

Concise, layered commenting that explains *why* and *what role* code plays — never restates what the code already says.

File-level header

Every new file gets a /** */ block at the top, before imports. Two to four lines max.

Pattern:

/**
 * Short name or role of this file.
 *
 * One or two sentences of context: what it does, where it fits,
 * and any non-obvious constraints or scope limits.
 */

Good — concise, adds context:

/**
 * Reducer for node result state transitions.
 *
 * Pure function — takes the current result state and an action, returns the
 * next state. Used by `useWorkflowV2NodeTest` to update result state as
 * stream events arrive during a test run.
 */

Good — flags temporary / MVP scope:

/**
 * Creates the default in-memory document for the workflow v2 MVP.
 *
 * Returns a single `llm` node with default config — no persistence yet.
 * This will be replaced by a real load-from-database path in a future slice.
 */

Bad — too verbose, repeats what imports say:

/**
 * This file contains the createInitialWorkflowV2Document function.
 * It imports WorkflowV2Document from the types directory and
 * workflowV2LlmNodeDefinition from the definitions directory.
 * It creates a document with nodes and edges arrays...
 */

When to use a longer header

If a file has a catalog of variants (actions, event types, enum values), list them in the header so readers can scan without scrolling:

/**
 * Reducer for node result state transitions.
 *
 * Actions:
 *   node-start      — Appends a new "running" result entry
 *   node-status     — Updates the latest entry's status
 *   node-sync-parts — Replaces the latest entry's parts array (used for streaming)
 *   node-completed  — Marks the latest entry as completed
 *   node-failed     — Marks the latest entry as failed with an error
 */

'use client' files

Place the header after the directive, before imports:

'use client'

/**
 * Single-node test execution hook for workflow v2.
 * ...
 */

import { useCallback } from 'react'

Type & schema comments

Simple / self-documenting — single-line /** */

/** Lifecycle status of a single node execution: pending → running → completed | failed. */
export const workflowV2NodeResultStatusSchema = z.enum([...])
/** A directed edge connecting one node's output handle to another node's input handle. */
export const workflowV2DocumentEdgeSchema = z.object({...})

Complex / non-obvious — multi-line /** */

Use when the schema's role isn't clear from its name, or when it has runtime behavior worth calling out:

/**
 * Resolved inputs the node received at execution time, keyed by target handle.
 * Empty for single-node test runs; populated during multi-node workflow execution.
 */
export const workflowV2InputGroupsSchema = z.record(...)
/**
 * Per-node result state: an append-only results array plus an optional pointer
 * to which result is "active" (defaults to latest when undefined).
 */
export const workflowV2NodeResultStateSchema = z.object({...})

When NOT to comment a type/schema

  • If the name fully explains it (e.g. workflowV2NodeErrorSchema with message, code fields)
  • Inferred type exports — group them under a single section comment instead:
/**
 * Inferred types from Zod schemas.
 */
export type WorkflowV2NodeResultStatus = z.infer<typeof workflowV2NodeResultStatusSchema>
export type WorkflowV2NodeError = z.infer<typeof workflowV2NodeErrorSchema>

Never do @property lists for types

If the fields are named well, don't restate them:

// BAD — redundant
/**
 * @property modelId      — The model to use for generation
 * @property prompt        — The user prompt sent to the model
 * @property systemPrompt  — Optional system-level instructions
 * @property temperature   — Sampling temperature
 */
export const configSchema = z.object({
    modelId: z.string().min(1),
    prompt: z.string(),
    ...
})

// GOOD — one-liner is enough
/** User-editable config fields for an `llm` node. */
export const configSchema = z.object({...})

Function & helper comments

Exported functions — single-line /** */

/** Looks up a node definition by type. Throws if the type is not registered. */
export function getWorkflowV2NodeDefinition(nodeType: WorkflowV2NodeType) {...}

Private helpers — single-line /** */

/** Immutably updates the most recent result entry in the state. */
function patchLatestResult(state, updater) {...}
/** Maps result status → badge color variant. */
function getStatusBadgeVariant(status: string | null) {...}
/** Extracts a displayable string from any Part type for the result preview. */
function formatResultPart(part: Part) {...}

Small utility constructors

/** Helper to build a structured node error from message + optional metadata. */
function createNodeError(message: string, errorType?: string, code?: number) {...}

Inline comments (//)

Use sparingly — only when the *why* or *what happens next* isn't obvious from reading the code.

Good uses

Before a key callback or hook wiring:

// Dispatches a result action for a node and keeps the ref in sync with React state.
const applyNodeAction = useCallback(...)

// Wires into the shared SSE generation endpoint and maps stream events to result actions.
const { makeRequest, isStreaming } = useAIRequest(...)

// Validates config, builds a RequestV2, and kicks off the stream for a single node.
const runNodeTest = useCallback(async (nodeId: string) => {...})

Before a derived computation:

// Derive model dropdown options from the global models list; fall back to guest default.
const textModelOptions = useMemo(...)

// Map document nodes → React Flow nodes, attaching result state and handlers as data.
const nodes = useMemo(...)

Bad uses — don't comment the obvious

// BAD
// Set the state
setState(newValue)

// Check if node exists
if (!node) return

// Return the results
return { nodeResultStateById, runNodeTest }

Constants & module-level values

Only comment if the purpose isn't obvious:

// No comment needed — name says it all
const EMPTY_NODE_RESULT_STATE: WorkflowV2NodeResultState = { results: [] }

// Comment needed — explains a non-obvious registration
/** Register custom node types — React Flow uses this to resolve `type: 'workflowV2Node'`. */
const nodeTypes: NodeTypes = { workflowV2Node: WorkflowV2Node }

React component files

  1. File header — what the component renders, any scope limits
  2. Helper functions above the component — one-line /** */ each
  3. Key useMemo / useCallback blocks — inline // comment
  4. JSX — no comments unless there's a non-obvious workaround
/**
 * Workflow v2 node component — rendered by React Flow for each node on the canvas.
 *
 * Currently hardcoded for the `llm` node type. Will be generalized when
 * additional node types are added.
 */

/** Maps result status → badge color variant. */
function getStatusBadgeVariant(status: string | null) {...}

/** Joins all parts of the active result into a single string for display. */
function getResultText(resultState: WorkflowV2NodeResultState) {...}

export function WorkflowV2Node({ data }: NodeProps<WorkflowV2FlowNode>) {...}

Summary checklist

LayerFormatWhen
File header/** */ multi-lineEvery new file
Schema / type/** */ single or multiWhen name alone isn't enough
Inferred type group/** Inferred types... */Group of z.infer exports
Exported function/** */ single-lineAlways
Private helper/** */ single-lineWhen purpose isn't obvious from name
Inline callback/memo// single-lineBefore key wiring points
Constants/** */ single-lineOnly if non-obvious
JSXNoneUnless there's a workaround

Golden rule: If removing the comment would make a reader pause and re-read the code to understand its role, keep the comment. If the code already says the same thing, delete it.

平台分布

Codex

35.36%
按下载量换算22

Claude

31.01%
按下载量换算20

Cursor

17.51%
按下载量换算11

Gemini CLI

9.56%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills