@brainfish-ai/devdoc 0.1.33 → 0.1.35

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 (33) hide show
  1. package/ai-agents/.claude/skills/blame-doc/SKILL.md +171 -0
  2. package/ai-agents/.claude/skills/bootstrap-docs/SKILL.md +332 -34
  3. package/ai-agents/.claude/skills/check-docs/SKILL.md +89 -13
  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 +174 -62
  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 +6 -3
  21. package/ai-agents/schemas/context.schema.json +259 -0
  22. package/dist/cli/commands/ai.js +16 -12
  23. package/dist/cli/commands/create.d.ts +12 -1
  24. package/dist/cli/commands/create.js +135 -94
  25. package/dist/cli/commands/init.js +11 -7
  26. package/dist/cli/index.js +2 -2
  27. package/package.json +1 -1
  28. package/ai-agents/.claude/skills/create-doc-page/SKILL.md +0 -274
  29. package/ai-agents/.claude/skills/docs-from-code/SKILL.md +0 -81
  30. package/ai-agents/.claude/skills/generate-api-docs/SKILL.md +0 -94
  31. package/ai-agents/.claude/skills/sync-docs/SKILL.md +0 -146
  32. package/ai-agents/.claude/skills/update-docs-json/SKILL.md +0 -60
  33. package/ai-agents/.cursor/rules/devdoc-sync.mdc +0 -105
@@ -1,94 +0,0 @@
1
- ---
2
- name: generate-api-docs
3
- description: Generate API documentation pages from OpenAPI spec or code
4
- ---
5
-
6
- ## Instructions
7
-
8
- 1. Analyze the OpenAPI spec or API code
9
- 2. Create documentation pages for:
10
- - Introduction/Overview
11
- - Authentication guide
12
- - Error handling
13
- - Rate limiting (if applicable)
14
- 3. Update docs.json to include API reference tab
15
-
16
- ## OpenAPI Tab Configuration
17
-
18
- ```json
19
- {
20
- "tab": "API Reference",
21
- "type": "openapi",
22
- "path": "/api-reference",
23
- "spec": "api-reference/openapi.json",
24
- "groups": [
25
- {
26
- "group": "Overview",
27
- "pages": ["api-reference/introduction", "api-reference/authentication"]
28
- }
29
- ]
30
- }
31
- ```
32
-
33
- ## GraphQL Tab Configuration
34
-
35
- ```json
36
- {
37
- "tab": "GraphQL API",
38
- "type": "graphql",
39
- "path": "/graphql-api",
40
- "schema": "api-reference/schema.graphql",
41
- "endpoint": "https://api.example.com/graphql"
42
- }
43
- ```
44
-
45
- ## Generated Pages
46
-
47
- ### api-reference/introduction.mdx
48
- ```mdx
49
- ---
50
- title: "API Introduction"
51
- description: "Overview of the API"
52
- ---
53
-
54
- Brief overview of the API capabilities.
55
-
56
- ## Base URL
57
-
58
- \`\`\`
59
- https://api.example.com/v1
60
- \`\`\`
61
-
62
- ## Authentication
63
-
64
- All requests require authentication. See [Authentication](/api-reference/authentication).
65
- ```
66
-
67
- ### api-reference/authentication.mdx
68
- ```mdx
69
- ---
70
- title: "Authentication"
71
- description: "How to authenticate API requests"
72
- ---
73
-
74
- <Tabs>
75
- <Tab title="Bearer Token">
76
- Include the token in the Authorization header:
77
- \`\`\`bash
78
- curl -H "Authorization: Bearer YOUR_TOKEN" https://api.example.com/v1/users
79
- \`\`\`
80
- </Tab>
81
- <Tab title="API Key">
82
- Include the API key in the header:
83
- \`\`\`bash
84
- curl -H "X-API-Key: YOUR_KEY" https://api.example.com/v1/users
85
- \`\`\`
86
- </Tab>
87
- </Tabs>
88
- ```
89
-
90
- ## After Generating
91
-
92
- 1. Review and customize the generated content
93
- 2. Add real examples from your API
94
- 3. Update authentication details
@@ -1,146 +0,0 @@
1
- ---
2
- name: sync-docs
3
- description: Analyze existing documentation against codebase and identify/fix outdated content. Reads docType from docs.json config.
4
- ---
5
-
6
- ## Instructions
7
-
8
- When syncing documentation with the codebase:
9
-
10
- ### Step 0: Locate Source Code
11
-
12
- First, determine where the source code is relative to current directory:
13
- - If `docs.json` exists here → you're in docs folder, source code is in `../`
14
- - If `package.json` and `src/` exist here → you're at repo root
15
- - Check both current directory AND parent directory for source files
16
-
17
- ### Step 1: Get Documentation Type from Config
18
-
19
- **Read `docs.json` and check for `docType` field:**
20
-
21
- ```json
22
- {
23
- "docType": "api" // "internal" | "api" | "product"
24
- }
25
- ```
26
-
27
- **If `docType` is set:** Use that value automatically.
28
-
29
- **If `docType` is NOT set, detect from structure:**
30
- - Has `architecture/`, `development/` → "internal"
31
- - Has `api-reference/`, `sdks/` → "api"
32
- - Has `features/`, `tutorials/` → "product"
33
-
34
- **If still unclear, ask:**
35
- "What type of documentation is this?
36
- 1. internal - for your team
37
- 2. api - for developers using your product
38
- 3. product - for end users"
39
-
40
- **After user answers, save to docs.json:**
41
- Add `"docType": "{choice}"` to docs.json so it's remembered.
42
- Tell user: "Saved docType to docs.json - you won't be asked again."
43
-
44
- ### Step 2: Build Documentation Inventory
45
-
46
- Scan all MDX files and extract:
47
- - Documented functions, classes, components
48
- - Code examples and their imports
49
- - API endpoints referenced
50
- - Package versions mentioned
51
- - CLI commands documented
52
-
53
- ### Step 2: Analyze Current Codebase
54
-
55
- Compare documentation against source code:
56
- - Check if documented functions still exist
57
- - Verify function signatures match (parameters, return types)
58
- - Confirm API endpoints are still valid
59
- - Check if package versions are current
60
- - Identify new exports not yet documented
61
-
62
- ### Step 3: Generate Sync Report
63
-
64
- Output a report categorizing issues:
65
-
66
- ```
67
- ## Documentation Sync Report
68
-
69
- ### Outdated (Breaking Changes)
70
- - `docs/api/users.mdx`: `createUser()` signature changed
71
- - Documented: `createUser(name: string)`
72
- - Current: `createUser(data: UserInput)`
73
-
74
- ### Outdated (Minor Changes)
75
- - `docs/quickstart.mdx`: Package version outdated
76
- - Documented: `v1.2.0`
77
- - Current: `v1.5.0`
78
-
79
- ### Missing Documentation
80
- - `src/utils/validator.ts` - New export, not documented
81
- - `POST /api/v2/webhooks` - New endpoint, not documented
82
-
83
- ### Up to Date
84
- - `docs/guides/authentication.mdx`
85
- - `docs/components/button.mdx`
86
- ```
87
-
88
- ### Step 4: Update Options
89
-
90
- Ask user preference:
91
- 1. **Auto-fix all** - Update all outdated docs automatically
92
- 2. **Interactive** - Review each change before applying
93
- 3. **Report only** - Just show the report, don't change anything
94
-
95
- ### Step 5: Apply Updates
96
-
97
- When updating:
98
- - Preserve existing prose and explanations
99
- - Update code examples to match current signatures
100
- - Add TODO markers for sections needing human review
101
- - Update version numbers
102
- - Add stubs for missing documentation
103
-
104
- ## Detection Patterns
105
-
106
- | Documentation Pattern | Codebase Check |
107
- |----------------------|----------------|
108
- | `import { X } from 'pkg'` | Verify X is exported from pkg |
109
- | `function X(a, b)` | Check X signature in source |
110
- | `v1.2.3` version strings | Compare with package.json |
111
- | `POST /api/users` | Verify route exists |
112
- | `<Component prop={x}>` | Check component props interface |
113
-
114
- ## Update Strategies
115
-
116
- ### For Changed Function Signatures
117
- ```mdx
118
- // Before (outdated)
119
- createUser(name: string, email: string)
120
-
121
- // After (updated)
122
- createUser(data: UserInput)
123
- // Where UserInput = { name: string, email: string, role?: string }
124
- ```
125
-
126
- ### For Removed Features
127
- ```mdx
128
- <Warning>
129
- **Deprecated**: This feature was removed in v2.0.
130
- See [migration guide](/guides/v2-migration) for alternatives.
131
- </Warning>
132
- ```
133
-
134
- ### For New Features (stub)
135
- ```mdx
136
- ---
137
- title: "New Feature"
138
- description: "Description"
139
- ---
140
-
141
- {/* TODO: Document this feature */}
142
-
143
- ## Overview
144
-
145
- Coming soon...
146
- ```
@@ -1,60 +0,0 @@
1
- ---
2
- name: update-docs-json
3
- description: Add new pages to docs.json navigation configuration
4
- ---
5
-
6
- ## Instructions
7
-
8
- When updating docs.json:
9
-
10
- 1. Read the current docs.json structure
11
- 2. Identify the appropriate group for the new page
12
- 3. Add the page path (without .mdx extension)
13
- 4. Maintain consistent ordering (introductory pages first)
14
-
15
- ## Navigation Structure
16
-
17
- ```json
18
- {
19
- "navigation": {
20
- "tabs": [
21
- {
22
- "tab": "Tab Name",
23
- "type": "docs",
24
- "groups": [
25
- {
26
- "group": "Group Name",
27
- "icon": "phosphor-icon-name",
28
- "pages": ["page-path", "folder/page-path"]
29
- }
30
- ]
31
- }
32
- ]
33
- }
34
- }
35
- ```
36
-
37
- ## Page Path Format
38
-
39
- - Use relative paths from docs root
40
- - Omit the `.mdx` extension
41
- - Use forward slashes for nested paths
42
- - Examples: `"quickstart"`, `"guides/authentication"`
43
-
44
- ## Common Icons (Phosphor)
45
-
46
- - `rocket-launch` - Getting started
47
- - `book-open` - Documentation
48
- - `terminal` - CLI/Commands
49
- - `gear` - Configuration
50
- - `code` - Development
51
- - `puzzle-piece` - Components
52
- - `key` - Authentication
53
- - `cloud-arrow-up` - Deployment
54
-
55
- ## Best Practices
56
-
57
- 1. Group related pages together
58
- 2. Order pages from basic to advanced
59
- 3. Use descriptive group names
60
- 4. Keep navigation depth shallow (max 2 levels)
@@ -1,105 +0,0 @@
1
- ---
2
- description: Rules for syncing and updating documentation with codebase changes
3
- globs: ["**/*.mdx", "**/docs.json"]
4
- ---
5
-
6
- # Documentation Sync Rules
7
-
8
- When asked to sync, update, or check documentation:
9
-
10
- ## Step 1: Locate Source Code
11
-
12
- - If `docs.json` exists here → source code is in `../`
13
- - If `package.json` + `src/` exist → you're at repo root
14
- - Check both current directory AND parent for source files
15
-
16
- ## Step 2: Get Documentation Type from Config
17
-
18
- **Read `docs.json` for `docType` field:**
19
-
20
- ```json
21
- { "docType": "api" } // "internal" | "api" | "product"
22
- ```
23
-
24
- **If `docType` is set:** Use that value automatically.
25
-
26
- **If `docType` is NOT set, detect from structure:**
27
- - Has `architecture/`, `development/` → "internal"
28
- - Has `api-reference/`, `sdks/` → "api"
29
- - Has `features/`, `tutorials/` → "product"
30
-
31
- **If still unclear, ask:** "What type of documentation is this?"
32
-
33
- **After user answers, save to docs.json:**
34
- Add `"docType": "{choice}"` to docs.json.
35
- Tell user: "Saved docType to docs.json - you won't be asked again."
36
-
37
- ## Step 3: Analysis Process
38
-
39
- 1. Compare documented APIs against source code exports
40
- 2. Verify code examples compile/run correctly
41
- 3. Check version numbers match package.json
42
- 4. Validate all internal links resolve
43
- 5. Identify new features needing documentation
44
-
45
- ## Type-Specific Checks
46
-
47
- ### For docType: "internal"
48
- - Dev setup instructions still work
49
- - Architecture diagrams match current code
50
- - Internal tool versions are current
51
-
52
- ### For docType: "api"
53
- - API endpoints match OpenAPI spec
54
- - Auth examples are correct
55
- - SDK versions are current
56
- - Error codes are complete
57
-
58
- ### For docType: "product"
59
- - Screenshots match current UI
60
- - Feature descriptions are accurate
61
- - Tutorials still work
62
-
63
- ## Common Outdated Patterns
64
-
65
- - Function signatures that changed
66
- - Removed or renamed exports
67
- - Changed configuration options
68
- - Updated CLI commands
69
- - New required parameters
70
- - Deprecated features still documented
71
-
72
- ## Update Guidelines
73
-
74
- - Preserve existing explanations and prose
75
- - Only update technical details (code, signatures, versions)
76
- - Add TODO comments for sections needing human review
77
- - Create stubs for undocumented new features
78
- - Mark deprecated features with Warning callout
79
-
80
- ## Update Patterns
81
-
82
- ### Changed Signature
83
- Update the documented signature to match source.
84
-
85
- ### Removed Feature
86
- Add deprecation warning:
87
- ```mdx
88
- <Warning>
89
- This feature was removed in vX.X.
90
- </Warning>
91
- ```
92
-
93
- ### New Feature
94
- Create stub with TODO:
95
- ```mdx
96
- {/* TODO: Document this feature */}
97
- ```
98
-
99
- ## Report Format
100
-
101
- When checking docs, report:
102
- - Outdated items (with specific file:line)
103
- - Missing documentation
104
- - Broken links
105
- - Up-to-date items (summary)