Skip to content

Commit db6f649

Browse files
aspiersClaude Code
andcommitted
docs(ai): update lexicon sync guidance to prioritize method documentation
Without this patch, the lexicon sync skill and spec incorrectly emphasized documenting types rather than methods. This led to adding JSDoc on type aliases (which users don't directly interact with) instead of on the SDK methods that users actually call. This is a problem because: - Users call methods like createCollection(), not types like HypercertCollection - Method documentation is where users look for usage examples - Type documentation becomes redundant when methods are well-documented - Previous changes incorrectly marked type docs as complete when method docs weren't done This patch solves the problem by: - Updating sync-lexicons SKILL.md to emphasize method documentation over type docs - Clarifying that method JSDoc should include @example tags showing new features - Updating the spec to accurately reflect what documentation was actually completed - Marking Change 2 and 3 as partially complete (tests done, method docs still needed) - Adding notes explaining that Change 1 already has method docs with examples Changes to sync-lexicons skill: - Step 7 now focuses on documenting methods in HypercertOperationsImpl.ts - Added guidance to keep type documentation minimal - Updated example task list to mention method documentation explicitly - Added "IMPORTANT: Document methods, not types" callout Changes to spec: - Change 1: Removed type doc tasks, noted method docs already exist - Change 2: Marked method doc tasks as incomplete, added note - Change 3: Marked method doc tasks as incomplete, added note Spec: specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md Co-authored-by: Claude Code <claude-code@noreply.anthropic.com>
1 parent 320b428 commit db6f649

2 files changed

Lines changed: 30 additions & 16 deletions

File tree

.claude/skills/sync-lexicons/SKILL.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ Example plan structure:
153153

154154
**SDK Tasks**:
155155

156-
- [ ] Add/update documentation for X
157-
- [ ] Add type exports for Y
158-
- [ ] Add usage examples
156+
- [ ] Add/update JSDoc documentation to methods (e.g., createX(), updateX())
157+
- [ ] Add type exports for Y if needed
158+
- [ ] Add usage examples in method documentation
159+
- [ ] Add/update tests
159160
- [ ] Build and test
160161
- [ ] Create changeset (minor/major - reason)
161162

@@ -217,15 +218,18 @@ Present this plan to the user and ask:
217218

218219
For the current change (e.g., "Change 1: Collection Item Weights"):
219220

220-
1. **Update documentation** in `packages/sdk-core/src/services/hypercerts/types.ts`:
221-
- Add JSDoc comments for new/changed types
222-
- Add usage examples
221+
1. **Update method documentation** - Focus on documenting the methods users will call:
222+
- Add/update JSDoc comments on SDK methods (e.g., `createCollection()`, `updateCollection()`)
223+
- Add usage examples in method documentation showing new features
224+
- Document parameters, return values, and behavior
223225
- Document breaking changes if any
226+
- Location: `packages/sdk-core/src/repository/HypercertOperationsImpl.ts` and interfaces
224227

225228
2. **Add type exports** if needed:
226-
- Add type aliases for new lexicon types
227-
- Add helper types for SDK operations
229+
- Add type aliases for new lexicon types in `packages/sdk-core/src/services/hypercerts/types.ts`
230+
- Add helper types for SDK operations (CreateParams, UpdateParams, etc.)
228231
- Export from appropriate modules
232+
- Keep type documentation minimal - let method docs do the heavy lifting
229233

230234
3. **Update SDK code** if needed:
231235
- Modify operations to support new fields
@@ -325,9 +329,15 @@ The sync process focuses on making SDK changes visible and usable to developers.
325329

326330
### Documentation Updates
327331

328-
1. **Type documentation** - JSDoc comments explaining new features
329-
2. **Usage examples** - Code snippets showing how to use new fields/types
330-
3. **Breaking change notes** - Clear warnings about incompatible changes
332+
**IMPORTANT**: Document methods, not types. Users call methods, not types.
333+
334+
1. **Method documentation** - JSDoc comments on SDK methods explaining new features
335+
- Focus on `createX()`, `updateX()`, `getX()` methods in `HypercertOperationsImpl.ts`
336+
- Document parameters, return values, and behavior
337+
- Add `@example` tags showing how to use new fields
338+
2. **Usage examples** - Code snippets in method docs showing how to use new fields/types
339+
3. **Breaking change notes** - Clear warnings in method docs about incompatible changes
340+
4. **Type documentation** - Keep minimal; types should be self-explanatory from method docs
331341

332342
### Type System Updates
333343

specs/lexicon-sync/v0.10.0-beta.4-v0.10.0-beta.11.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ implemented, validated, and reviewed before proceeding to the next.
2525

2626
**SDK Tasks**:
2727

28-
- [x] Add documentation to `HypercertCollectionItem` type about the weight property
29-
- [x] Add usage examples in type documentation
28+
- [x] Add usage examples in method documentation showing weighted items (already has example in createCollection)
3029
- [x] Verify `CollectionItemInput` helper type is correct (already supports itemWeight)
3130
- [x] Verify CRUD operations support itemWeight (createCollection/updateCollection already pass items through)
3231
- [x] Add/update tests for collections with weighted items
@@ -60,13 +59,15 @@ implemented, validated, and reviewed before proceeding to the next.
6059
- [x] Import `AppBskyRichtextFacet` from `@atproto/api` in interfaces.ts
6160
- [x] Add `shortDescriptionFacets` and `descriptionFacets` fields to `CreateHypercertParams`
6261
- [x] Update `create()` method in `HypercertOperationsImpl` to handle facet fields
63-
- [x] Add comprehensive documentation to `HypercertClaim` type about facets
64-
- [x] Add usage examples showing how to create facets for mentions, links, and tags
62+
- [ ] Add JSDoc documentation to `create()` method about facets
63+
- [ ] Add usage examples in method documentation showing how to create facets for mentions, links, and tags
6564
- [x] Add tests for creating hypercerts with facets
6665
- [x] Verify facets are properly validated by lexicon validator
6766
- [x] Build and test
6867
- [x] Create changeset (minor - new feature available)
6968

69+
**Note**: Method documentation for facets is still needed but tests are complete.
70+
7071
**Validation**:
7172

7273
- [x] Format check passes (`pnpm format:check`)
@@ -93,11 +94,14 @@ implemented, validated, and reviewed before proceeding to the next.
9394

9495
- [x] Verify `CreateCollectionParams` already supports avatar/banner (already supports)
9596
- [x] Verify `createCollection()` and `updateCollection()` methods handle avatar/banner (already implemented)
96-
- [x] Add usage examples showing avatar/banner in collections and projects
97+
- [ ] Add JSDoc documentation to `createCollection()` and `updateCollection()` methods about avatar
98+
- [ ] Add usage examples in method documentation showing avatar in collections and projects
9799
- [x] Add/update tests for collections with avatar and banner
98100
- [x] Build and test
99101
- [x] Create changeset (minor - new feature available)
100102

103+
**Note**: Method documentation mentions banner but not avatar. Tests are complete.
104+
101105
**Validation**:
102106

103107
- [x] Format check passes (`pnpm format:check`)

0 commit comments

Comments
 (0)