@brainfish-ai/devdoc 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/ai-agents/.claude/skills/blame-doc/SKILL.md +171 -0
  2. package/ai-agents/.claude/skills/bootstrap-docs/SKILL.md +519 -64
  3. package/ai-agents/.claude/skills/check-docs/SKILL.md +107 -12
  4. package/ai-agents/.claude/skills/commit-doc/SKILL.md +214 -0
  5. package/ai-agents/.claude/skills/create-doc/SKILL.md +198 -0
  6. package/ai-agents/.claude/skills/delete-doc/SKILL.md +164 -0
  7. package/ai-agents/.claude/skills/update-doc/SKILL.md +219 -0
  8. package/ai-agents/.cursor/rules/devdoc-blame.mdc +114 -0
  9. package/ai-agents/.cursor/rules/devdoc-bootstrap.mdc +207 -41
  10. package/ai-agents/.cursor/rules/devdoc-commit.mdc +103 -0
  11. package/ai-agents/.cursor/rules/devdoc-create.mdc +89 -0
  12. package/ai-agents/.cursor/rules/devdoc-delete.mdc +101 -0
  13. package/ai-agents/.cursor/rules/devdoc-update.mdc +95 -0
  14. package/ai-agents/.devdoc/context.json +66 -0
  15. package/ai-agents/.devdoc/templates/api-reference.md +211 -0
  16. package/ai-agents/.devdoc/templates/guide.md +133 -0
  17. package/ai-agents/.devdoc/templates/quickstart.md +179 -0
  18. package/ai-agents/.devdoc/templates/troubleshooting.md +215 -0
  19. package/ai-agents/.devdoc/templates/tutorial.md +212 -0
  20. package/ai-agents/CLAUDE.md +15 -3
  21. package/ai-agents/schemas/context.schema.json +259 -0
  22. package/dist/cli/commands/ai.d.ts +1 -0
  23. package/dist/cli/commands/ai.js +115 -46
  24. package/dist/cli/commands/create.d.ts +12 -0
  25. package/dist/cli/commands/create.js +110 -62
  26. package/dist/cli/commands/init.js +11 -7
  27. package/dist/cli/index.js +4 -2
  28. package/package.json +1 -1
  29. package/renderer/components/docs-viewer/sidebar/index.tsx +118 -87
  30. package/ai-agents/.claude/skills/create-doc-page/SKILL.md +0 -57
  31. package/ai-agents/.claude/skills/docs-from-code/SKILL.md +0 -73
  32. package/ai-agents/.claude/skills/generate-api-docs/SKILL.md +0 -94
  33. package/ai-agents/.claude/skills/sync-docs/SKILL.md +0 -112
  34. package/ai-agents/.claude/skills/update-docs-json/SKILL.md +0 -60
  35. package/ai-agents/.cursor/rules/devdoc-sync.mdc +0 -70
@@ -0,0 +1,164 @@
1
+ ---
2
+ name: delete-doc
3
+ description: Delete documentation pages interactively with confirmation.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ When user wants to delete documentation:
9
+
10
+ ### Step 1: Understand What to Delete
11
+
12
+ Ask the user:
13
+
14
+ "What would you like to delete?
15
+
16
+ 1. **A specific page** - Tell me which page(s)
17
+ 2. **Find unused pages** - I'll identify orphan pages not in navigation
18
+ 3. **Deprecated content** - I'll find pages marked as deprecated
19
+ 4. **Clean up** - Describe what you want removed"
20
+
21
+ ### Step 2: Identify Pages
22
+
23
+ Based on their choice:
24
+
25
+ #### For Specific Page:
26
+ - "Which page(s)? (e.g., `guides/old-feature.mdx`)"
27
+ - Verify the file exists
28
+ - Check for incoming links from other pages
29
+
30
+ #### For Unused Pages:
31
+ Scan for orphan pages:
32
+ ```
33
+ Compare:
34
+ - All .mdx files in docs/
35
+ - Pages referenced in docs.json
36
+
37
+ Orphan pages (not in navigation):
38
+ - docs/drafts/unused.mdx
39
+ - docs/old/deprecated-guide.mdx
40
+ ```
41
+
42
+ #### For Deprecated Content:
43
+ Search for deprecation markers:
44
+ ```
45
+ Files with deprecation notices:
46
+ - docs/api/legacy-auth.mdx (marked deprecated in v1.5)
47
+ - docs/guides/old-workflow.mdx (marked deprecated in v2.0)
48
+ ```
49
+
50
+ ### Step 3: Analyze Impact
51
+
52
+ Before deletion, check for:
53
+
54
+ 1. **Incoming links** - Other pages linking to this page
55
+ 2. **Navigation** - Entry in docs.json
56
+ 3. **Redirects** - Should we redirect to a new page?
57
+
58
+ Show analysis:
59
+
60
+ "**Deletion Analysis for `guides/old-feature.mdx`:**
61
+
62
+ Incoming links (2 pages reference this):
63
+ - `quickstart.mdx:45` → links to `/guides/old-feature`
64
+ - `api/overview.mdx:23` → links to `/guides/old-feature#setup`
65
+
66
+ Navigation:
67
+ - Listed in docs.json under 'Guides' group
68
+
69
+ Recommended actions:
70
+ 1. Remove from docs.json
71
+ 2. Update or remove links in other pages
72
+ 3. Consider redirect to replacement page"
73
+
74
+ ### Step 4: Confirm Deletion
75
+
76
+ "Ready to delete `guides/old-feature.mdx`?
77
+
78
+ This will:
79
+ - ❌ Delete the file
80
+ - ❌ Remove from docs.json navigation
81
+ - ⚠️ Leave broken links in 2 pages (I can fix these)
82
+
83
+ Options:
84
+ 1. **Delete and fix links** - Remove file, update linking pages
85
+ 2. **Delete and redirect** - Remove file, add redirect to `{new-page}`
86
+ 3. **Delete only** - Just remove the file
87
+ 4. **Cancel** - Don't delete"
88
+
89
+ ### Step 5: Execute Deletion
90
+
91
+ Based on user choice:
92
+
93
+ #### Delete and Fix Links:
94
+ 1. Delete the MDX file
95
+ 2. Update docs.json (remove page entry)
96
+ 3. Find and update/remove links in other pages:
97
+ ```mdx
98
+ // Before
99
+ See the [old feature guide](/guides/old-feature).
100
+
101
+ // After
102
+ See the [new feature guide](/guides/new-feature).
103
+ // or remove the sentence entirely
104
+ ```
105
+
106
+ #### Delete and Redirect:
107
+ 1. Delete the MDX file
108
+ 2. Update docs.json
109
+ 3. Add redirect to docs.json or redirects file:
110
+ ```json
111
+ {
112
+ "redirects": [
113
+ { "from": "/guides/old-feature", "to": "/guides/new-feature" }
114
+ ]
115
+ }
116
+ ```
117
+
118
+ #### Delete Only:
119
+ 1. Delete the MDX file
120
+ 2. Update docs.json
121
+ 3. Warn about broken links
122
+
123
+ ### Step 6: Summary
124
+
125
+ "Deleted:
126
+ - ❌ `docs/guides/old-feature.mdx`
127
+ - ✓ Removed from docs.json navigation
128
+ - ✓ Updated links in `quickstart.mdx`, `api/overview.mdx`
129
+ - ✓ Added redirect: `/guides/old-feature` → `/guides/new-feature`
130
+
131
+ Want me to commit these changes? Use `/commit` when ready."
132
+
133
+ ---
134
+
135
+ ## Bulk Deletion
136
+
137
+ For multiple pages:
138
+
139
+ "Found 5 orphan pages not in navigation:
140
+
141
+ | File | Last Modified | Size |
142
+ |------|--------------|------|
143
+ | `drafts/test.mdx` | 6 months ago | 2kb |
144
+ | `old/legacy-api.mdx` | 1 year ago | 15kb |
145
+ | `temp/scratch.mdx` | 3 months ago | 1kb |
146
+ | `guides/draft-feature.mdx` | 2 months ago | 8kb |
147
+ | `archive/v1-docs.mdx` | 1 year ago | 20kb |
148
+
149
+ Options:
150
+ 1. **Delete all** - Remove all orphan pages
151
+ 2. **Select pages** - Choose which to delete
152
+ 3. **Review each** - Go through one by one
153
+ 4. **Cancel** - Keep all pages"
154
+
155
+ ---
156
+
157
+ ## Safety Guidelines
158
+
159
+ - **Always confirm** before deleting
160
+ - **Check for links** to prevent broken references
161
+ - **Offer redirects** for removed public pages
162
+ - **Show impact** before executing
163
+ - **Keep backup** by suggesting to commit before deletion
164
+ - **Never delete** docs.json or context.json without explicit confirmation
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: update-doc
3
+ description: Update existing documentation by analyzing codebase changes or user references.
4
+ ---
5
+
6
+ ## Instructions
7
+
8
+ When user wants to update documentation:
9
+
10
+ ### Step 0: Read Context Memory
11
+
12
+ **First, read `.devdoc/context.json` if it exists:**
13
+ - Use `product.name` for product references
14
+ - Apply `terminology.glossary` for correct terms
15
+ - Avoid `terminology.avoidTerms`
16
+ - Match `documentation.voice` for writing style
17
+
18
+ ### Step 1: Understand What to Update
19
+
20
+ Ask the user:
21
+
22
+ "What would you like to update?
23
+
24
+ 1. **A specific page** - Tell me which page to update
25
+ 2. **Sync with codebase** - I'll find outdated docs by comparing to code
26
+ 3. **Navigation structure** - Update docs.json organization
27
+ 4. **Multiple pages** - Describe the changes needed
28
+ 5. **Fix issues** - Point me to errors or problems"
29
+
30
+ ### Step 2: Analyze Current State
31
+
32
+ Based on their choice:
33
+
34
+ #### For Specific Page:
35
+ - "Which page? (e.g., `guides/authentication.mdx`)"
36
+ - Read the current page content
37
+ - "What changes do you want?
38
+ - Update code examples
39
+ - Add new sections
40
+ - Fix errors/outdated info
41
+ - Rewrite for clarity
42
+ - Other (describe)"
43
+
44
+ #### For Codebase Sync:
45
+ - Locate source code (from context or `../`)
46
+ - Compare documentation against code:
47
+ - Function signatures changed?
48
+ - New exports not documented?
49
+ - Removed features still documented?
50
+ - Version numbers outdated?
51
+ - Generate sync report (see below)
52
+
53
+ #### For Navigation:
54
+ - Read current `docs.json`
55
+ - "What navigation changes?
56
+ - Add new pages
57
+ - Reorganize groups
58
+ - Rename tabs
59
+ - Remove pages
60
+ - Other"
61
+
62
+ #### For Multiple Pages:
63
+ - "Which pages need updating?"
64
+ - "What's the common change across them?"
65
+
66
+ #### For Issues:
67
+ - "What's the problem you're seeing?"
68
+ - Analyze and propose fixes
69
+
70
+ ### Step 3: Generate Sync Report (if syncing)
71
+
72
+ ```
73
+ ## Documentation Sync Report
74
+
75
+ ### Outdated (Action Required)
76
+ - `docs/api/users.mdx`: Function signature changed
77
+ - Documented: `createUser(name, email)`
78
+ - Current: `createUser(options: CreateUserInput)`
79
+
80
+ - `docs/quickstart.mdx`: Package version outdated
81
+ - Documented: v1.2.0
82
+ - Current: v2.0.0
83
+
84
+ ### Terminology Issues
85
+ - `docs/guides/intro.mdx:15`: Uses "charge" instead of "payment"
86
+
87
+ ### Missing Documentation
88
+ - `src/utils/newFeature.ts` - New export, not documented
89
+ - `POST /api/v2/webhooks` - New endpoint
90
+
91
+ ### Up to Date ✓
92
+ - `docs/guides/authentication.mdx`
93
+ - `docs/api/errors.mdx`
94
+ ```
95
+
96
+ Ask: "How would you like to proceed?
97
+ 1. **Fix all** - Update everything automatically
98
+ 2. **Interactive** - Review each change
99
+ 3. **Specific items** - Tell me which to fix"
100
+
101
+ ### Step 4: Propose Changes
102
+
103
+ Before making changes, show what will be modified:
104
+
105
+ "I'll make these changes:
106
+
107
+ **`docs/api/users.mdx`**
108
+ - Update `createUser` signature and examples
109
+ - Add new `options` parameter documentation
110
+
111
+ **`docs/quickstart.mdx`**
112
+ - Update version from 1.2.0 to 2.0.0
113
+ - Update installation command
114
+
115
+ **`docs.json`**
116
+ - Add new page: `guides/webhooks.mdx`
117
+
118
+ Proceed with these changes?"
119
+
120
+ ### Step 5: Apply Updates
121
+
122
+ When updating:
123
+
124
+ 1. **Preserve prose** - Keep explanations, update technical details
125
+ 2. **Update code examples** - Match current signatures
126
+ 3. **Fix terminology** - Apply context.json rules
127
+ 4. **Add deprecation notices** for removed features:
128
+ ```mdx
129
+ <Warning>
130
+ **Deprecated in v2.0**: This feature was removed.
131
+ See [migration guide](/guides/v2-migration).
132
+ </Warning>
133
+ ```
134
+ 5. **Create stubs** for new features:
135
+ ```mdx
136
+ {/* TODO: Document this new feature */}
137
+ ## New Feature
138
+ Coming soon...
139
+ ```
140
+
141
+ ### Step 6: Update Navigation (if needed)
142
+
143
+ If pages were added/removed/moved:
144
+
145
+ 1. Read current `docs.json`
146
+ 2. Propose navigation changes
147
+ 3. Apply after user confirms
148
+
149
+ ### Step 7: Summary
150
+
151
+ "Updated:
152
+ - `docs/api/users.mdx` - Updated function signatures
153
+ - `docs/quickstart.mdx` - Updated to v2.0.0
154
+ - `docs.json` - Added webhooks page
155
+
156
+ Changes ready for review. Run `npx @brainfish-ai/devdoc dev` to preview.
157
+
158
+ Want me to commit these changes? Use `/commit` when ready."
159
+
160
+ ---
161
+
162
+ ## Update Patterns
163
+
164
+ ### Changed Function Signature
165
+ ```mdx
166
+ // Before
167
+ `createUser(name: string, email: string)`
168
+
169
+ // After
170
+ `createUser(options: CreateUserInput)`
171
+
172
+ Where `CreateUserInput`:
173
+ ```typescript
174
+ interface CreateUserInput {
175
+ name: string;
176
+ email: string;
177
+ role?: 'admin' | 'user';
178
+ }
179
+ ```
180
+ ```
181
+
182
+ ### Removed Feature
183
+ ```mdx
184
+ <Warning>
185
+ **Removed in v2.0**: The `legacyAuth` method was removed.
186
+ Use `authenticate()` instead. See [migration guide](/migrate-v2).
187
+ </Warning>
188
+ ```
189
+
190
+ ### New Feature Stub
191
+ ```mdx
192
+ ---
193
+ title: "Webhooks"
194
+ description: "Receive real-time notifications"
195
+ ---
196
+
197
+ {/* TODO: Complete this documentation */}
198
+
199
+ ## Overview
200
+
201
+ Documentation coming soon.
202
+
203
+ ## Quick Start
204
+
205
+ ```typescript
206
+ // Example placeholder
207
+ ```
208
+ ```
209
+
210
+ ---
211
+
212
+ ## Quality Guidelines
213
+
214
+ - Always show changes before applying
215
+ - Preserve existing prose and explanations
216
+ - Update only technical details (code, versions, signatures)
217
+ - Add TODO markers for human review
218
+ - Apply terminology from context.json
219
+ - Create stubs rather than skip new features
@@ -0,0 +1,114 @@
1
+ ---
2
+ description: Analyze documentation for duplicates, outdated content, and discrepancies
3
+ globs: ["**/*.mdx", "**/docs.json", "**/src/**", "**/lib/**"]
4
+ ---
5
+
6
+ # Blame Documentation
7
+
8
+ When asked to analyze, audit, or blame documentation:
9
+
10
+ ## Step 0: Read Context
11
+
12
+ Read `.devdoc/context.json` for terminology and conventions.
13
+
14
+ ## Step 1: Understand Scope
15
+
16
+ Ask: "What should I analyze?
17
+ 1. **Full audit** - Check everything
18
+ 2. **Specific area** - Focus on one section
19
+ 3. **Duplicates only** - Find redundant content
20
+ 4. **Outdated only** - Find stale docs
21
+ 5. **Discrepancies only** - Find code/doc mismatches"
22
+
23
+ ## Step 2: Scan Sources
24
+
25
+ **For Codebase:**
26
+ - Read exported functions and types
27
+ - Check API routes and endpoints
28
+ - Find configuration options
29
+ - Note version numbers
30
+
31
+ **For Documentation:**
32
+ - Read all MDX files
33
+ - Extract code examples
34
+ - List documented features
35
+ - Check terminology usage
36
+
37
+ ## Step 3: Generate Report
38
+
39
+ ### Finding Duplicates
40
+
41
+ Look for:
42
+ - Same paragraphs in multiple files
43
+ - Nearly identical code examples
44
+ - Repeated setup instructions
45
+ - Overlapping topic coverage
46
+
47
+ Report format:
48
+ ```
49
+ ## Duplicate Content
50
+
51
+ ### Topic: [name]
52
+ Found in: file1.mdx, file2.mdx, file3.mdx
53
+ Recommendation: Consolidate to [primary], link from others
54
+
55
+ Details:
56
+ - file1.mdx:15-30 ≈ file2.mdx:45-60 (90% similar)
57
+ ```
58
+
59
+ ### Finding Outdated Content
60
+
61
+ Compare docs to code:
62
+ - Function signatures changed?
63
+ - New parameters not documented?
64
+ - Return types updated?
65
+ - Versions outdated?
66
+
67
+ Report format:
68
+ ```
69
+ ## Outdated Documentation
70
+
71
+ ### file.mdx
72
+ Line 23: `getUser(id)`
73
+ Current: `getUser(id, options?)`
74
+ Action: Update signature and add options table
75
+ ```
76
+
77
+ ### Finding Discrepancies
78
+
79
+ Check for mismatches:
80
+ - Documented vs actual return values
81
+ - Stated vs real requirements
82
+ - Described vs implemented behavior
83
+
84
+ Report format:
85
+ ```
86
+ ## Discrepancies
87
+
88
+ ### api/auth.mdx vs src/auth.ts
89
+ Documented: Returns { token }
90
+ Actual: Returns { token, expiresAt, refreshToken }
91
+ Impact: Users won't know about refresh tokens
92
+ ```
93
+
94
+ ## Step 4: Prioritize Issues
95
+
96
+ Rank by severity:
97
+ 1. **Critical** - Wrong information misleading users
98
+ 2. **High** - Missing important features
99
+ 3. **Medium** - Outdated but still works
100
+ 4. **Low** - Style/consistency issues
101
+
102
+ ## Step 5: Suggest Fixes
103
+
104
+ "Found X issues. I can:
105
+ 1. Fix the critical issues now
106
+ 2. Create a detailed fix plan
107
+ 3. Fix specific category only"
108
+
109
+ ## Quick Commands
110
+
111
+ - "blame docs" → Full analysis
112
+ - "find duplicates" → Duplicate content only
113
+ - "find outdated" → Stale docs only
114
+ - "compare code to docs" → Discrepancy analysis