write-docblocks
Skill129 starsChanged 9 months agoMITView on GitHub
Use when documentation coverage is low, after composer docs:coverage shows gaps, or when asked to batch-write PHPDoc blocks across multiple files
In this repository21 other files it gives its agents.
- .claude/skills/bulletproof-frontend/CLAUDE.mdCLAUDE.md
- adapting-claude-pipelineSkill
- brainstormingSkill
- bulletproof-frontendSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- handle-issuesSkill
- implement-issueSkill
- improvement-loopSkill
- investigating-codebase-for-user-storiesSkill
- process-prSkill
- review-uiSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- ui-design-fundamentalsSkill
- using-git-worktreesSkill
- using-skillsSkill
- writing-agentsSkill
- writing-plansSkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
After creating multiple new services, controllers, or models
- Very specific: line 18
When composer docs:coverage:missing shows many files needing docs
- Distinctive: line 69
CRITICAL: All 5 Task calls MUST be in a single assistant message to run in parallel.
- Distinctive: line 73
Wait for all 5 subagents to complete before starting the next batch.
- Very specific: line 110
Skipping verification: Always run composer docs:coverage at the end to confirm improvement.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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:missingshows 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.php2. 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 messageCRITICAL: 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:coverageConfirm 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

