Skip to content

Commit e970545

Browse files
committed
.claude/commands/update-godocs: New command for Go doc updates
We have unit and other testing that ensures the code functions as intended, for covered situations. But there's not much back-pressure to keep comments accurate or accessible. This Claude command [1] is mostly a reminder to ourselves that it's worth periodically reviewing the API documentation, and if we do, it should make it easier for new contributors to onboard themselves. If it gets to the point that it's detailed enough to be very helpful, we might move it to a more central location for use in other projects, although I expect there are already many similar slash commands out there already. [1]: https://code.claude.com/docs/en/slash-commands
1 parent 7cebe65 commit e970545

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.claude/commands/update-godocs.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: update-godocs
3+
description: Update comments on functions, structures, and properties within a Go file.
4+
parameters:
5+
- name: path
6+
description: Path to the Go file to update. One path at a time to make it easy to spread out review load.
7+
required: true
8+
---
9+
10+
You are helping users update comments on functions, structures, and properties in Go files to make it easier for new users to understand package behavior.
11+
12+
## Context
13+
14+
15+
## Your Task
16+
17+
Based on the user's path: "{{path}}"
18+
19+
1. Read the Go code for that path and other Go files (with the `.go` suffix, excluding the `_test.go` suffix) in that directory to understand the package's functionality.
20+
2. Ensure that there is a Go file in the directory with the package-summary `// Package ...` comment.
21+
If there is not yet such a file, create one, including a comment that summarizes the overall package functionality.
22+
3. For {{path}}, update the Go comments describing API elements to improve accuracy and clarity.
23+
Prioritize public functions, structures, and properties.
24+
If all public APIs already have accurate, clear comments, update comments on the file's internal APIs.

0 commit comments

Comments
 (0)