write-docblocks

在文档覆盖率较低时,或当 composer docs:coverage 报告存在遗漏,或需要跨多个文件批量编写 PHPDoc 块时使用的工具,用于生成或补充 PHPDoc 注释块以提高文档覆盖率。

仓库最近推送
GitHub Stars
131
Forks
18
Issues / PRs
3

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "write-docblocks":https://skillpi.com/zh/skills/deepskill-db665020bdede2421c86074077b718992124c9847dc148410d1a06428214336b。安装前核对上游来源和版本:https://github.com/aaddrick/claude-pipeline。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

在文档覆盖率较低时,或当 composer docs:coverage 报告存在遗漏,或需要跨多个文件批量编写 PHPDoc 块时使用的工具,用于生成或补充 PHPDoc 注释块以提高文档覆盖率。

0 下载

介绍来源: third_party · aaddrick · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: write-docblocks
description: Use when documentation coverage is low, after composer docs:coverage shows gaps, or when asked to batch-write PHPDoc blocks across multiple files

Write Docblocks

Overview

Batch-process PHPDoc documentation gaps by running composer docs:coverage:missing and dispatching parallel phpdoc-writer subagents.

Core principle: Process files in batches of 5 subagents for efficient parallel documentation without overwhelming the system.

When to Use

  • Documentation coverage below target (80% classes, 75% methods)
  • After creating multiple new services, controllers, or models
  • When composer docs:coverage:missing shows many files needing docs
  • User requests batch PHPDoc writing

Workflow

digraph write_docblocks {
    rankdir=TB;

    start [label="Run composer docs:coverage:missing" shape=box];
    parse [label="Parse output for file paths" shape=box];
    check [label="Files remaining?" shape=diamond];
    batch [label="Take next 5 files" shape=box];
    dispatch [label="Dispatch 5 phpdoc-writer\nsubagents in parallel" shape=box];
    wait [label="Wait for batch to complete" shape=box];
    done [label="Run composer docs:coverage\nto verify improvement" shape=box];

    start -> parse -> check;
    check -> batch [label="yes"];
    check -> done [label="no"];
    batch -> dispatch -> wait -> check;
}

Execution Steps

1. Get Missing Files

composer docs:coverage:missing 2>&1 | sed 's/\x1b\[[0-9;]*m//g' | grep '\.php$'

This strips ANSI codes and extracts just file paths like:

Console/Commands/ProcessDataCommand.php
Http/Controllers/AuthController.php
Services/AuthService.php

2. Process in Batches of 5

For each batch of 5 files, dispatch phpdoc-writer subagents in parallel using a single message with multiple Task tool calls:

Task(subagent_type="phpdoc-writer", prompt="Write PHPDoc blocks for app/Console/Commands/ProcessDataCommand.php - read the file, understand its purpose, and add comprehensive docblocks for the class and all undocumented methods.")

Task(subagent_type="phpdoc-writer", prompt="Write PHPDoc blocks for app/Http/Controllers/OAuthController.php - read the file, understand its purpose, and add comprehensive docblocks for the class and all undocumented methods.")

// ... 3 more in same message

CRITICAL: All 5 Task calls MUST be in a single assistant message to run in parallel.

3. Wait for Batch Completion

Wait for all 5 subagents to complete before starting the next batch. This prevents resource exhaustion while maintaining parallelism.

4. Repeat Until Done

Continue processing batches until all files are documented.

5. Verify Coverage

composer docs:coverage

Confirm improvement toward targets (80% classes, 75% methods).

Subagent Prompt Template

Write PHPDoc blocks for app/{PATH}

1. Read the file thoroughly to understand its purpose
2. Check what's already documented vs missing
3. Add comprehensive docblocks for:
   - Class-level documentation explaining purpose and context
   - All undocumented public methods with @param, @return, @throws
   - Protected/private methods with brief explanations
4. Follow project-specific conventions and domain terminology
5. Run pint after editing: ./vendor/bin/pint {file}

Target audience: New developer on their first day.

Common Mistakes

Dispatching sequentially: Each file one at a time wastes time. Use batches of 5 in parallel.

Not using single message: Multiple Task calls in separate messages run sequentially. Put all 5 in ONE message.

Skipping verification: Always run composer docs:coverage at the end to confirm improvement.

Forgetting pint: Subagents should run ./vendor/bin/pint after editing to maintain code style.

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值78/100

亮点

  • 针对 PHP 项目文档覆盖率低的实际痛点,提供批量自动化 PHPDoc 编写方案
  • 适用于开发团队维护代码文档,具有明确的实用价值和广泛受众
触发精准92/100

亮点

  • description 明确列出三种使用场景,覆盖合理,边界清晰,用户易于判断是否适用
结构规范95/100

亮点

  • 文档结构完整,包含流程图、执行步骤、子代理提示模板、常见错误等关键章节
  • frontmatter 完整,步骤清晰,有端到端示例,符合高质量文档规范
执行可靠88/100

待提升项

  • 未显式说明错误处理机制 原报告严重程度:轻微

    文档强调批处理和并行执行,但未显式说明当某个子代理失败时的处理策略

    改进建议:建议在 Execution Steps 或 Common Mistakes 中补充说明:若批次中某个文件处理失败,应记录错误并继续处理其余文件,最后汇总报告失败项

亮点

  • 工具来源明确(composer、phpdoc-writer subagent、pint),参数正确
  • 强调批处理机制和并行执行要点,覆盖 ANSI 码处理等关键细节,subagent 包含代码风格检查
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。