@brainfish-ai/devdoc 0.1.28 → 0.1.29
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/bootstrap-docs/SKILL.md +102 -0
- package/ai-agents/.claude/skills/check-docs/SKILL.md +72 -0
- package/ai-agents/.claude/skills/create-doc-page/SKILL.md +57 -0
- package/ai-agents/.claude/skills/docs-from-code/SKILL.md +73 -0
- package/ai-agents/.claude/skills/generate-api-docs/SKILL.md +94 -0
- package/ai-agents/.claude/skills/import-api-spec/SKILL.md +114 -0
- package/ai-agents/.claude/skills/migrate-docs/SKILL.md +116 -0
- package/ai-agents/.claude/skills/sync-docs/SKILL.md +112 -0
- package/ai-agents/.claude/skills/update-docs-json/SKILL.md +60 -0
- package/ai-agents/.cursor/rules/devdoc-bootstrap.mdc +66 -0
- package/ai-agents/.cursor/rules/devdoc-migrate.mdc +62 -0
- package/ai-agents/.cursor/rules/devdoc-sync.mdc +70 -0
- package/ai-agents/.cursor/rules/devdoc.mdc +94 -0
- package/ai-agents/CLAUDE.md +194 -0
- package/dist/cli/commands/ai.js +9 -9
- package/package.json +3 -2
|
@@ -0,0 +1,112 @@
|
|
|
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
|
+
```
|
|
@@ -0,0 +1,60 @@
|
|
|
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)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for bootstrapping documentation from repository analysis
|
|
3
|
+
globs: ["**/README.md", "**/package.json", "**/src/**", "**/lib/**"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Repository Analysis for Documentation
|
|
7
|
+
|
|
8
|
+
When asked to bootstrap or generate initial documentation:
|
|
9
|
+
|
|
10
|
+
## Analysis Checklist
|
|
11
|
+
|
|
12
|
+
1. Read README.md for project overview
|
|
13
|
+
2. Check package.json for:
|
|
14
|
+
- Project name and description
|
|
15
|
+
- Dependencies (to understand tech stack)
|
|
16
|
+
- Scripts (for CLI documentation)
|
|
17
|
+
3. Scan source directory structure
|
|
18
|
+
4. Identify API endpoints or exported functions
|
|
19
|
+
5. Look for existing OpenAPI/GraphQL specs
|
|
20
|
+
6. Check for example files or tests
|
|
21
|
+
|
|
22
|
+
## Documentation Generation Order
|
|
23
|
+
|
|
24
|
+
1. index.mdx (homepage) - from README
|
|
25
|
+
2. quickstart.mdx - installation + basic usage
|
|
26
|
+
3. API reference - from specs or code analysis
|
|
27
|
+
4. Feature guides - from major modules
|
|
28
|
+
|
|
29
|
+
## Always Include
|
|
30
|
+
|
|
31
|
+
- Real code examples from the codebase
|
|
32
|
+
- Accurate installation commands
|
|
33
|
+
- Links between related pages
|
|
34
|
+
- TODO comments for sections needing review
|
|
35
|
+
|
|
36
|
+
## File Structure to Generate
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
docs/
|
|
40
|
+
├── docs.json # Navigation config
|
|
41
|
+
├── index.mdx # Homepage
|
|
42
|
+
├── quickstart.mdx # Getting started
|
|
43
|
+
├── guides/
|
|
44
|
+
│ └── overview.mdx # Architecture
|
|
45
|
+
├── api-reference/ # If API exists
|
|
46
|
+
│ ├── introduction.mdx
|
|
47
|
+
│ └── openapi.json
|
|
48
|
+
└── theme.json # Theme config
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Content Extraction
|
|
52
|
+
|
|
53
|
+
| Source | Documentation |
|
|
54
|
+
|--------|---------------|
|
|
55
|
+
| README.md | Homepage, overview |
|
|
56
|
+
| package.json | Name, version, scripts |
|
|
57
|
+
| src/index.ts | Main exports |
|
|
58
|
+
| tests/ | Usage examples |
|
|
59
|
+
| .env.example | Configuration options |
|
|
60
|
+
|
|
61
|
+
## Quality Guidelines
|
|
62
|
+
|
|
63
|
+
- Extract real examples, don't fabricate
|
|
64
|
+
- Note areas needing human review
|
|
65
|
+
- Generate SEO-friendly descriptions
|
|
66
|
+
- Include all installation steps
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for migrating documentation from other platforms to DevDoc
|
|
3
|
+
globs: ["**/mint.json", "**/docusaurus.config.js", "**/SUMMARY.md", "**/mkdocs.yml", "**/*.graphql", "**/openapi.*", "**/swagger.*"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Documentation Migration Rules
|
|
7
|
+
|
|
8
|
+
When asked to migrate documentation:
|
|
9
|
+
|
|
10
|
+
## Platform Detection
|
|
11
|
+
|
|
12
|
+
Check for these files to identify source platform:
|
|
13
|
+
- mint.json → Mintlify
|
|
14
|
+
- docusaurus.config.js → Docusaurus
|
|
15
|
+
- SUMMARY.md → GitBook
|
|
16
|
+
- mkdocs.yml → MkDocs
|
|
17
|
+
- .vuepress/ → VuePress
|
|
18
|
+
|
|
19
|
+
## Migration Priorities
|
|
20
|
+
|
|
21
|
+
1. Configuration files first (navigation structure)
|
|
22
|
+
2. Content files (preserve as much as possible)
|
|
23
|
+
3. Assets (images, logos)
|
|
24
|
+
4. API specs (copy and configure)
|
|
25
|
+
|
|
26
|
+
## Component Conversion
|
|
27
|
+
|
|
28
|
+
Always convert platform-specific components to DevDoc equivalents:
|
|
29
|
+
|
|
30
|
+
### Mintlify
|
|
31
|
+
- `<CodeGroup>` → `<Tabs>` with code blocks
|
|
32
|
+
- `<Frame>` → `<img>` or remove wrapper
|
|
33
|
+
- `<ResponseField>` → Markdown table
|
|
34
|
+
- `<ParamField>` → Markdown table
|
|
35
|
+
|
|
36
|
+
### Docusaurus
|
|
37
|
+
- `:::note` → `<Note>`
|
|
38
|
+
- `:::tip` → `<Tip>`
|
|
39
|
+
- `:::info` → `<Info>`
|
|
40
|
+
- `:::caution` → `<Warning>`
|
|
41
|
+
- `:::danger` → `<Warning>`
|
|
42
|
+
- `<TabItem>` → `<Tab>`
|
|
43
|
+
|
|
44
|
+
### GitBook
|
|
45
|
+
- `{% hint style="info" %}` → `<Info>`
|
|
46
|
+
- `{% hint style="warning" %}` → `<Warning>`
|
|
47
|
+
- `{% hint style="success" %}` → `<Tip>`
|
|
48
|
+
- `{% tabs %}` → `<Tabs>`
|
|
49
|
+
|
|
50
|
+
## Preserve Content
|
|
51
|
+
|
|
52
|
+
- Keep all prose and explanations
|
|
53
|
+
- Maintain heading hierarchy
|
|
54
|
+
- Preserve code examples exactly
|
|
55
|
+
- Keep frontmatter metadata
|
|
56
|
+
|
|
57
|
+
## Post-Migration
|
|
58
|
+
|
|
59
|
+
- Validate all internal links
|
|
60
|
+
- Check component rendering
|
|
61
|
+
- Verify navigation order
|
|
62
|
+
- Test API playground if applicable
|
|
@@ -0,0 +1,70 @@
|
|
|
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)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Rules for writing DevDoc documentation
|
|
3
|
+
globs: ["**/*.mdx", "**/docs.json", "**/theme.json"]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevDoc Documentation Rules
|
|
7
|
+
|
|
8
|
+
## MDX File Structure
|
|
9
|
+
|
|
10
|
+
All MDX files must have:
|
|
11
|
+
1. YAML frontmatter with `title` and `description`
|
|
12
|
+
2. Clear introduction paragraph (no heading)
|
|
13
|
+
3. Structured content with H2/H3 headings
|
|
14
|
+
4. Component usage for visual hierarchy
|
|
15
|
+
|
|
16
|
+
## Available Components
|
|
17
|
+
|
|
18
|
+
### Callouts
|
|
19
|
+
- `<Note>` - Additional information
|
|
20
|
+
- `<Tip>` - Helpful hints
|
|
21
|
+
- `<Warning>` - Important cautions
|
|
22
|
+
- `<Info>` - General information
|
|
23
|
+
|
|
24
|
+
### Layout
|
|
25
|
+
- `<CardGroup cols={n}>` - Grid of cards (n = 1-4)
|
|
26
|
+
- `<Card title="..." icon="..." href="...">` - Navigation card
|
|
27
|
+
- `<Steps>` with `<Step title="...">` - Numbered steps
|
|
28
|
+
- `<Tabs>` with `<Tab title="...">` - Tabbed content
|
|
29
|
+
- `<AccordionGroup>` with `<Accordion title="...">` - Collapsible
|
|
30
|
+
|
|
31
|
+
### Code
|
|
32
|
+
- Use fenced code blocks with language
|
|
33
|
+
- Add filename with `title` attribute when helpful
|
|
34
|
+
- Include copy button for terminal commands
|
|
35
|
+
|
|
36
|
+
## Style Guidelines
|
|
37
|
+
|
|
38
|
+
1. Write in second person ("you can", "your project")
|
|
39
|
+
2. Use active voice
|
|
40
|
+
3. Keep paragraphs short (2-4 sentences)
|
|
41
|
+
4. Include practical examples
|
|
42
|
+
5. Link to related documentation
|
|
43
|
+
6. End guides with "Next Steps" section
|
|
44
|
+
|
|
45
|
+
## docs.json Best Practices
|
|
46
|
+
|
|
47
|
+
1. Group related pages together
|
|
48
|
+
2. Use descriptive group names
|
|
49
|
+
3. Order pages from basic to advanced
|
|
50
|
+
4. Use Phosphor icons for groups
|
|
51
|
+
|
|
52
|
+
## Common Mistakes to Avoid
|
|
53
|
+
|
|
54
|
+
- Missing frontmatter
|
|
55
|
+
- Using H1 headings (title comes from frontmatter)
|
|
56
|
+
- Inconsistent component usage
|
|
57
|
+
- Missing code language tags
|
|
58
|
+
- Broken internal links
|
|
59
|
+
|
|
60
|
+
## Frontmatter Template
|
|
61
|
+
|
|
62
|
+
```yaml
|
|
63
|
+
---
|
|
64
|
+
title: "Page Title"
|
|
65
|
+
description: "Brief description for SEO (under 160 chars)"
|
|
66
|
+
---
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Page Template
|
|
70
|
+
|
|
71
|
+
```mdx
|
|
72
|
+
---
|
|
73
|
+
title: "Title"
|
|
74
|
+
description: "Description"
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
Introduction paragraph explaining what this page covers.
|
|
78
|
+
|
|
79
|
+
## Section One
|
|
80
|
+
|
|
81
|
+
Content with components as needed.
|
|
82
|
+
|
|
83
|
+
## Section Two
|
|
84
|
+
|
|
85
|
+
More content.
|
|
86
|
+
|
|
87
|
+
## Next Steps
|
|
88
|
+
|
|
89
|
+
<CardGroup cols={2}>
|
|
90
|
+
<Card title="Related" href="/path">
|
|
91
|
+
Description
|
|
92
|
+
</Card>
|
|
93
|
+
</CardGroup>
|
|
94
|
+
```
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# DevDoc Documentation Project
|
|
2
|
+
|
|
3
|
+
This is a DevDoc documentation project using MDX (Markdown + React components).
|
|
4
|
+
|
|
5
|
+
## Project Structure
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
├── docs.json # Navigation and site configuration
|
|
9
|
+
├── theme.json # Theme colors and styling
|
|
10
|
+
├── custom.css # Custom CSS overrides (optional)
|
|
11
|
+
├── index.mdx # Homepage
|
|
12
|
+
├── quickstart.mdx # Getting started guide
|
|
13
|
+
├── guides/ # Documentation guides
|
|
14
|
+
├── api-reference/ # API documentation
|
|
15
|
+
│ ├── openapi.json # OpenAPI specification
|
|
16
|
+
│ └── schema.graphql # GraphQL schema (if applicable)
|
|
17
|
+
└── public/ # Static assets (images, logos)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## MDX File Format
|
|
21
|
+
|
|
22
|
+
Every MDX file requires frontmatter:
|
|
23
|
+
|
|
24
|
+
```yaml
|
|
25
|
+
---
|
|
26
|
+
title: "Page Title"
|
|
27
|
+
description: "Brief description for SEO and navigation"
|
|
28
|
+
---
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Important**: Do NOT use H1 headings (`#`) in content - the title comes from frontmatter.
|
|
32
|
+
|
|
33
|
+
## Available Components
|
|
34
|
+
|
|
35
|
+
### Callouts
|
|
36
|
+
```mdx
|
|
37
|
+
<Note>Additional information the reader should know.</Note>
|
|
38
|
+
<Tip>Helpful hints and best practices.</Tip>
|
|
39
|
+
<Warning>Important cautions and potential issues.</Warning>
|
|
40
|
+
<Info>General informational content.</Info>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Cards & Navigation
|
|
44
|
+
```mdx
|
|
45
|
+
<CardGroup cols={2}>
|
|
46
|
+
<Card title="Title" icon="icon-name" href="/path">
|
|
47
|
+
Card description text
|
|
48
|
+
</Card>
|
|
49
|
+
</CardGroup>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Steps (for tutorials)
|
|
53
|
+
```mdx
|
|
54
|
+
<Steps>
|
|
55
|
+
<Step title="Step 1">
|
|
56
|
+
Step content here
|
|
57
|
+
</Step>
|
|
58
|
+
<Step title="Step 2">
|
|
59
|
+
More content
|
|
60
|
+
</Step>
|
|
61
|
+
</Steps>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Tabs
|
|
65
|
+
```mdx
|
|
66
|
+
<Tabs>
|
|
67
|
+
<Tab title="JavaScript">
|
|
68
|
+
```javascript
|
|
69
|
+
const x = 1;
|
|
70
|
+
```
|
|
71
|
+
</Tab>
|
|
72
|
+
<Tab title="Python">
|
|
73
|
+
```python
|
|
74
|
+
x = 1
|
|
75
|
+
```
|
|
76
|
+
</Tab>
|
|
77
|
+
</Tabs>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Accordions
|
|
81
|
+
```mdx
|
|
82
|
+
<AccordionGroup>
|
|
83
|
+
<Accordion title="Question 1">
|
|
84
|
+
Answer content
|
|
85
|
+
</Accordion>
|
|
86
|
+
</AccordionGroup>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Code Blocks
|
|
90
|
+
Use fenced code blocks with language tags:
|
|
91
|
+
````mdx
|
|
92
|
+
```javascript title="example.js"
|
|
93
|
+
const hello = "world";
|
|
94
|
+
```
|
|
95
|
+
````
|
|
96
|
+
|
|
97
|
+
## docs.json Configuration
|
|
98
|
+
|
|
99
|
+
The `docs.json` file controls navigation and site settings:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"name": "Project Name",
|
|
104
|
+
"navigation": {
|
|
105
|
+
"tabs": [
|
|
106
|
+
{
|
|
107
|
+
"tab": "Guides",
|
|
108
|
+
"type": "docs",
|
|
109
|
+
"groups": [
|
|
110
|
+
{
|
|
111
|
+
"group": "Getting Started",
|
|
112
|
+
"icon": "rocket-launch",
|
|
113
|
+
"pages": ["index", "quickstart"]
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"tab": "API Reference",
|
|
119
|
+
"type": "openapi",
|
|
120
|
+
"path": "/api-reference",
|
|
121
|
+
"spec": "api-reference/openapi.json"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Page paths**: Use relative paths without `.mdx` extension.
|
|
129
|
+
|
|
130
|
+
## Icons
|
|
131
|
+
|
|
132
|
+
Use Phosphor icons (https://phosphoricons.com/). Common icons:
|
|
133
|
+
- `rocket-launch` - Getting started
|
|
134
|
+
- `book-open` - Documentation
|
|
135
|
+
- `terminal` - CLI/Commands
|
|
136
|
+
- `gear` - Configuration
|
|
137
|
+
- `code` - Development
|
|
138
|
+
- `puzzle-piece` - Components
|
|
139
|
+
- `key` - Authentication
|
|
140
|
+
- `cloud-arrow-up` - Deployment
|
|
141
|
+
|
|
142
|
+
## Writing Guidelines
|
|
143
|
+
|
|
144
|
+
1. **Introduction**: Start each page with a brief paragraph (no heading) explaining the topic
|
|
145
|
+
2. **Structure**: Use H2 (`##`) for main sections, H3 (`###`) for subsections
|
|
146
|
+
3. **Code examples**: Always include practical, working code examples
|
|
147
|
+
4. **Navigation**: End guides with a `<CardGroup>` linking to related pages
|
|
148
|
+
5. **Tone**: Write in second person ("you can", "your project")
|
|
149
|
+
6. **Brevity**: Keep paragraphs short (2-4 sentences)
|
|
150
|
+
|
|
151
|
+
## Common Tasks
|
|
152
|
+
|
|
153
|
+
### Add a new page
|
|
154
|
+
1. Create `new-page.mdx` with frontmatter
|
|
155
|
+
2. Add to `docs.json` navigation in appropriate group
|
|
156
|
+
|
|
157
|
+
### Add API documentation
|
|
158
|
+
1. Place OpenAPI spec in `api-reference/openapi.json`
|
|
159
|
+
2. Add tab with `"type": "openapi"` to docs.json
|
|
160
|
+
|
|
161
|
+
### Customize theme
|
|
162
|
+
Edit `theme.json`:
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"colors": {
|
|
166
|
+
"primary": "#0066FF",
|
|
167
|
+
"background": "#FFFFFF"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## CLI Commands
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Start development server
|
|
176
|
+
npm run dev
|
|
177
|
+
|
|
178
|
+
# Build for production
|
|
179
|
+
npm run build
|
|
180
|
+
|
|
181
|
+
# Deploy to DevDoc hosting
|
|
182
|
+
npx devdoc deploy
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## DevDoc AI Agent Skills
|
|
186
|
+
|
|
187
|
+
If you have Claude Code skills installed (`devdoc ai`):
|
|
188
|
+
|
|
189
|
+
- `/bootstrap-docs` - Generate documentation from codebase
|
|
190
|
+
- `/migrate-docs` - Migrate from other platforms
|
|
191
|
+
- `/sync-docs` - Update outdated documentation
|
|
192
|
+
- `/check-docs` - Health check for docs
|
|
193
|
+
- `/create-doc-page` - Create new MDX page
|
|
194
|
+
- `/update-docs-json` - Update navigation
|