@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.
- package/ai-agents/.claude/skills/blame-doc/SKILL.md +171 -0
- package/ai-agents/.claude/skills/bootstrap-docs/SKILL.md +519 -64
- package/ai-agents/.claude/skills/check-docs/SKILL.md +107 -12
- package/ai-agents/.claude/skills/commit-doc/SKILL.md +214 -0
- package/ai-agents/.claude/skills/create-doc/SKILL.md +198 -0
- package/ai-agents/.claude/skills/delete-doc/SKILL.md +164 -0
- package/ai-agents/.claude/skills/update-doc/SKILL.md +219 -0
- package/ai-agents/.cursor/rules/devdoc-blame.mdc +114 -0
- package/ai-agents/.cursor/rules/devdoc-bootstrap.mdc +207 -41
- package/ai-agents/.cursor/rules/devdoc-commit.mdc +103 -0
- package/ai-agents/.cursor/rules/devdoc-create.mdc +89 -0
- package/ai-agents/.cursor/rules/devdoc-delete.mdc +101 -0
- package/ai-agents/.cursor/rules/devdoc-update.mdc +95 -0
- package/ai-agents/.devdoc/context.json +66 -0
- package/ai-agents/.devdoc/templates/api-reference.md +211 -0
- package/ai-agents/.devdoc/templates/guide.md +133 -0
- package/ai-agents/.devdoc/templates/quickstart.md +179 -0
- package/ai-agents/.devdoc/templates/troubleshooting.md +215 -0
- package/ai-agents/.devdoc/templates/tutorial.md +212 -0
- package/ai-agents/CLAUDE.md +15 -3
- package/ai-agents/schemas/context.schema.json +259 -0
- package/dist/cli/commands/ai.d.ts +1 -0
- package/dist/cli/commands/ai.js +115 -46
- package/dist/cli/commands/create.d.ts +12 -0
- package/dist/cli/commands/create.js +110 -62
- package/dist/cli/commands/init.js +11 -7
- package/dist/cli/index.js +4 -2
- package/package.json +1 -1
- package/renderer/components/docs-viewer/sidebar/index.tsx +118 -87
- package/ai-agents/.claude/skills/create-doc-page/SKILL.md +0 -57
- package/ai-agents/.claude/skills/docs-from-code/SKILL.md +0 -73
- package/ai-agents/.claude/skills/generate-api-docs/SKILL.md +0 -94
- package/ai-agents/.claude/skills/sync-docs/SKILL.md +0 -112
- package/ai-agents/.claude/skills/update-docs-json/SKILL.md +0 -60
- package/ai-agents/.cursor/rules/devdoc-sync.mdc +0 -70
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: docs-from-code
|
|
3
|
-
description: Generate documentation from specific code files, functions, or modules
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Instructions
|
|
7
|
-
|
|
8
|
-
When generating docs from specific code:
|
|
9
|
-
|
|
10
|
-
1. Analyze the code structure and purpose
|
|
11
|
-
2. Identify:
|
|
12
|
-
- Public API/exports
|
|
13
|
-
- Function signatures and parameters
|
|
14
|
-
- Return types and values
|
|
15
|
-
- Usage patterns from tests or examples
|
|
16
|
-
3. Generate documentation with:
|
|
17
|
-
- Overview of the module/function
|
|
18
|
-
- Parameter descriptions
|
|
19
|
-
- Code examples
|
|
20
|
-
- Common use cases
|
|
21
|
-
|
|
22
|
-
## Output Format
|
|
23
|
-
|
|
24
|
-
```mdx
|
|
25
|
-
---
|
|
26
|
-
title: "{Module/Function Name}"
|
|
27
|
-
description: "{Brief purpose}"
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
{Overview paragraph}
|
|
31
|
-
|
|
32
|
-
## Installation
|
|
33
|
-
|
|
34
|
-
{If applicable}
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
37
|
-
|
|
38
|
-
<Steps>
|
|
39
|
-
<Step title="Import">
|
|
40
|
-
```typescript
|
|
41
|
-
import { function } from 'package';
|
|
42
|
-
```
|
|
43
|
-
</Step>
|
|
44
|
-
<Step title="Basic Usage">
|
|
45
|
-
{Example code}
|
|
46
|
-
</Step>
|
|
47
|
-
</Steps>
|
|
48
|
-
|
|
49
|
-
## API Reference
|
|
50
|
-
|
|
51
|
-
### `functionName(params)`
|
|
52
|
-
|
|
53
|
-
{Description}
|
|
54
|
-
|
|
55
|
-
**Parameters:**
|
|
56
|
-
| Name | Type | Description |
|
|
57
|
-
|------|------|-------------|
|
|
58
|
-
| param1 | `type` | Description |
|
|
59
|
-
|
|
60
|
-
**Returns:** `type` - Description
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
{Practical examples with code blocks}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Best Practices
|
|
68
|
-
|
|
69
|
-
1. Extract real code examples - don't fabricate
|
|
70
|
-
2. Include TypeScript types when available
|
|
71
|
-
3. Show common use cases
|
|
72
|
-
4. Document edge cases and error handling
|
|
73
|
-
5. Link to related functions/modules
|
|
@@ -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,112 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: sync-docs
|
|
3
|
-
description: Analyze existing documentation against codebase and identify/fix outdated content
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Instructions
|
|
7
|
-
|
|
8
|
-
When syncing documentation with the codebase:
|
|
9
|
-
|
|
10
|
-
### Step 1: Build Documentation Inventory
|
|
11
|
-
|
|
12
|
-
Scan all MDX files and extract:
|
|
13
|
-
- Documented functions, classes, components
|
|
14
|
-
- Code examples and their imports
|
|
15
|
-
- API endpoints referenced
|
|
16
|
-
- Package versions mentioned
|
|
17
|
-
- CLI commands documented
|
|
18
|
-
|
|
19
|
-
### Step 2: Analyze Current Codebase
|
|
20
|
-
|
|
21
|
-
Compare documentation against source code:
|
|
22
|
-
- Check if documented functions still exist
|
|
23
|
-
- Verify function signatures match (parameters, return types)
|
|
24
|
-
- Confirm API endpoints are still valid
|
|
25
|
-
- Check if package versions are current
|
|
26
|
-
- Identify new exports not yet documented
|
|
27
|
-
|
|
28
|
-
### Step 3: Generate Sync Report
|
|
29
|
-
|
|
30
|
-
Output a report categorizing issues:
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
## Documentation Sync Report
|
|
34
|
-
|
|
35
|
-
### Outdated (Breaking Changes)
|
|
36
|
-
- `docs/api/users.mdx`: `createUser()` signature changed
|
|
37
|
-
- Documented: `createUser(name: string)`
|
|
38
|
-
- Current: `createUser(data: UserInput)`
|
|
39
|
-
|
|
40
|
-
### Outdated (Minor Changes)
|
|
41
|
-
- `docs/quickstart.mdx`: Package version outdated
|
|
42
|
-
- Documented: `v1.2.0`
|
|
43
|
-
- Current: `v1.5.0`
|
|
44
|
-
|
|
45
|
-
### Missing Documentation
|
|
46
|
-
- `src/utils/validator.ts` - New export, not documented
|
|
47
|
-
- `POST /api/v2/webhooks` - New endpoint, not documented
|
|
48
|
-
|
|
49
|
-
### Up to Date
|
|
50
|
-
- `docs/guides/authentication.mdx`
|
|
51
|
-
- `docs/components/button.mdx`
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Step 4: Update Options
|
|
55
|
-
|
|
56
|
-
Ask user preference:
|
|
57
|
-
1. **Auto-fix all** - Update all outdated docs automatically
|
|
58
|
-
2. **Interactive** - Review each change before applying
|
|
59
|
-
3. **Report only** - Just show the report, don't change anything
|
|
60
|
-
|
|
61
|
-
### Step 5: Apply Updates
|
|
62
|
-
|
|
63
|
-
When updating:
|
|
64
|
-
- Preserve existing prose and explanations
|
|
65
|
-
- Update code examples to match current signatures
|
|
66
|
-
- Add TODO markers for sections needing human review
|
|
67
|
-
- Update version numbers
|
|
68
|
-
- Add stubs for missing documentation
|
|
69
|
-
|
|
70
|
-
## Detection Patterns
|
|
71
|
-
|
|
72
|
-
| Documentation Pattern | Codebase Check |
|
|
73
|
-
|----------------------|----------------|
|
|
74
|
-
| `import { X } from 'pkg'` | Verify X is exported from pkg |
|
|
75
|
-
| `function X(a, b)` | Check X signature in source |
|
|
76
|
-
| `v1.2.3` version strings | Compare with package.json |
|
|
77
|
-
| `POST /api/users` | Verify route exists |
|
|
78
|
-
| `<Component prop={x}>` | Check component props interface |
|
|
79
|
-
|
|
80
|
-
## Update Strategies
|
|
81
|
-
|
|
82
|
-
### For Changed Function Signatures
|
|
83
|
-
```mdx
|
|
84
|
-
// Before (outdated)
|
|
85
|
-
createUser(name: string, email: string)
|
|
86
|
-
|
|
87
|
-
// After (updated)
|
|
88
|
-
createUser(data: UserInput)
|
|
89
|
-
// Where UserInput = { name: string, email: string, role?: string }
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### For Removed Features
|
|
93
|
-
```mdx
|
|
94
|
-
<Warning>
|
|
95
|
-
**Deprecated**: This feature was removed in v2.0.
|
|
96
|
-
See [migration guide](/guides/v2-migration) for alternatives.
|
|
97
|
-
</Warning>
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### For New Features (stub)
|
|
101
|
-
```mdx
|
|
102
|
-
---
|
|
103
|
-
title: "New Feature"
|
|
104
|
-
description: "Description"
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
{/* TODO: Document this feature */}
|
|
108
|
-
|
|
109
|
-
## Overview
|
|
110
|
-
|
|
111
|
-
Coming soon...
|
|
112
|
-
```
|
|
@@ -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,70 +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
|
-
## Analysis Process
|
|
11
|
-
|
|
12
|
-
1. Compare documented APIs against source code exports
|
|
13
|
-
2. Verify code examples compile/run correctly
|
|
14
|
-
3. Check version numbers match package.json
|
|
15
|
-
4. Validate all internal links resolve
|
|
16
|
-
5. Identify new features needing documentation
|
|
17
|
-
|
|
18
|
-
## Common Outdated Patterns
|
|
19
|
-
|
|
20
|
-
- Function signatures that changed
|
|
21
|
-
- Removed or renamed exports
|
|
22
|
-
- Changed configuration options
|
|
23
|
-
- Updated CLI commands
|
|
24
|
-
- New required parameters
|
|
25
|
-
- Deprecated features still documented
|
|
26
|
-
|
|
27
|
-
## Update Guidelines
|
|
28
|
-
|
|
29
|
-
- Preserve existing explanations and prose
|
|
30
|
-
- Only update technical details (code, signatures, versions)
|
|
31
|
-
- Add TODO comments for sections needing human review
|
|
32
|
-
- Create stubs for undocumented new features
|
|
33
|
-
- Mark deprecated features with Warning callout
|
|
34
|
-
|
|
35
|
-
## Detection Checklist
|
|
36
|
-
|
|
37
|
-
| Check | How to Verify |
|
|
38
|
-
|-------|---------------|
|
|
39
|
-
| Function exists | Search source for export |
|
|
40
|
-
| Signature matches | Compare params and return type |
|
|
41
|
-
| Version current | Check package.json |
|
|
42
|
-
| Route exists | Search API routes |
|
|
43
|
-
| Component props | Check TypeScript interface |
|
|
44
|
-
|
|
45
|
-
## Update Patterns
|
|
46
|
-
|
|
47
|
-
### Changed Signature
|
|
48
|
-
Update the documented signature to match source.
|
|
49
|
-
|
|
50
|
-
### Removed Feature
|
|
51
|
-
Add deprecation warning:
|
|
52
|
-
```mdx
|
|
53
|
-
<Warning>
|
|
54
|
-
This feature was removed in vX.X.
|
|
55
|
-
</Warning>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### New Feature
|
|
59
|
-
Create stub with TODO:
|
|
60
|
-
```mdx
|
|
61
|
-
{/* TODO: Document this feature */}
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Report Format
|
|
65
|
-
|
|
66
|
-
When checking docs, report:
|
|
67
|
-
- Outdated items (with specific file:line)
|
|
68
|
-
- Missing documentation
|
|
69
|
-
- Broken links
|
|
70
|
-
- Up-to-date items (summary)
|