@brainfish-ai/devdoc 0.1.31 → 0.1.33
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 +221 -64
- package/ai-agents/.claude/skills/check-docs/SKILL.md +21 -2
- package/ai-agents/.claude/skills/create-doc-page/SKILL.md +242 -25
- package/ai-agents/.claude/skills/docs-from-code/SKILL.md +9 -1
- package/ai-agents/.claude/skills/sync-docs/SKILL.md +36 -2
- package/ai-agents/.cursor/rules/devdoc-bootstrap.mdc +90 -36
- package/ai-agents/.cursor/rules/devdoc-sync.mdc +46 -11
- package/ai-agents/CLAUDE.md +9 -0
- package/dist/cli/commands/ai.d.ts +1 -0
- package/dist/cli/commands/ai.js +100 -35
- package/dist/cli/commands/domain.js +31 -10
- package/dist/cli/index.js +3 -2
- package/package.json +1 -1
- package/renderer/components/docs-viewer/sidebar/index.tsx +118 -87
|
@@ -1,77 +1,203 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bootstrap-docs
|
|
3
|
-
description: Analyze repository and generate
|
|
3
|
+
description: Analyze repository and generate documentation. Reads docType from docs.json config, or asks if not set.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
7
|
|
|
8
8
|
When bootstrapping documentation from a repository:
|
|
9
9
|
|
|
10
|
-
### Step 1:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
10
|
+
### Step 1: Detect Project Structure
|
|
11
|
+
|
|
12
|
+
Determine where you are:
|
|
13
|
+
|
|
14
|
+
**If `docs.json` exists in current directory:**
|
|
15
|
+
- You're in a DevDoc docs folder
|
|
16
|
+
- Source code is likely in `../` (parent directory)
|
|
17
|
+
|
|
18
|
+
**If `package.json` and `src/` exist:**
|
|
19
|
+
- You're at repo root
|
|
20
|
+
- Create docs in `./docs/` subfolder
|
|
21
|
+
|
|
22
|
+
**If neither matches:**
|
|
23
|
+
- Ask user for the source code path
|
|
24
|
+
|
|
25
|
+
### Step 2: Check for docType Configuration
|
|
26
|
+
|
|
27
|
+
**Read `docs.json` and check for `docType` field:**
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"name": "Project Name",
|
|
32
|
+
"docType": "api", // "internal" | "api" | "product"
|
|
33
|
+
...
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**If `docType` is set:**
|
|
38
|
+
- Use that value automatically
|
|
39
|
+
- Tell user: "Using docType: {type} from docs.json"
|
|
40
|
+
|
|
41
|
+
**If `docType` is NOT set, ask the user:**
|
|
42
|
+
|
|
43
|
+
"What type of documentation are you creating?
|
|
44
|
+
|
|
45
|
+
1. **internal** - For your team: setup guides, architecture, contribution guidelines
|
|
46
|
+
2. **api** - For developers using your product: API reference, SDKs, integration guides
|
|
47
|
+
3. **product** - For end users: feature guides, tutorials, FAQs"
|
|
48
|
+
|
|
49
|
+
**IMPORTANT: After user answers, immediately update docs.json:**
|
|
50
|
+
|
|
51
|
+
Add the `docType` field to docs.json so it's saved for future use:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"name": "Project Name",
|
|
56
|
+
"docType": "api", // Save their choice here
|
|
57
|
+
"navigation": { ... }
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Tell user: "Saved docType: {type} to docs.json - you won't be asked again."
|
|
62
|
+
|
|
63
|
+
### Step 3: Analyze Repository
|
|
64
|
+
|
|
65
|
+
Scan the source code for:
|
|
66
|
+
- `README.md` - Project overview
|
|
67
|
+
- `package.json` / `Cargo.toml` / `pyproject.toml` - Dependencies, metadata
|
|
68
|
+
- `src/` or `lib/` - Source code structure
|
|
69
|
+
- `api/` or `routes/` - API endpoints
|
|
70
|
+
- `openapi.json` / `swagger.yaml` - API specs
|
|
22
71
|
- `schema.graphql` - GraphQL schemas
|
|
23
72
|
|
|
24
|
-
### Step
|
|
73
|
+
### Step 4: Generate Based on docType
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## docType: "internal"
|
|
78
|
+
|
|
79
|
+
For internal team documentation, create:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
docs/
|
|
83
|
+
├── docs.json
|
|
84
|
+
├── index.mdx # Project overview
|
|
85
|
+
├── getting-started/
|
|
86
|
+
│ ├── setup.mdx # Dev environment setup
|
|
87
|
+
│ ├── prerequisites.mdx # Required tools/versions
|
|
88
|
+
│ └── first-contribution.mdx
|
|
89
|
+
├── architecture/
|
|
90
|
+
│ ├── overview.mdx # System architecture
|
|
91
|
+
│ ├── folder-structure.mdx
|
|
92
|
+
│ └── decisions.mdx # ADRs, design decisions
|
|
93
|
+
├── development/
|
|
94
|
+
│ ├── workflow.mdx # Git workflow, PR process
|
|
95
|
+
│ ├── testing.mdx # How to run/write tests
|
|
96
|
+
│ ├── debugging.mdx # Common issues, debugging tips
|
|
97
|
+
│ └── deployment.mdx # How to deploy
|
|
98
|
+
├── api/ # Internal API docs (if applicable)
|
|
99
|
+
│ └── ...
|
|
100
|
+
└── contributing.mdx # Contribution guidelines
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Content focus:**
|
|
104
|
+
- How to set up local development
|
|
105
|
+
- Codebase architecture and patterns
|
|
106
|
+
- Internal APIs and services
|
|
107
|
+
- Debugging and troubleshooting
|
|
108
|
+
- Team conventions and standards
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## docType: "api"
|
|
25
113
|
|
|
26
|
-
|
|
114
|
+
For external developers using your API/SDK, create:
|
|
27
115
|
|
|
28
116
|
```
|
|
29
117
|
docs/
|
|
30
|
-
├── docs.json
|
|
31
|
-
├── index.mdx #
|
|
32
|
-
├── quickstart.mdx #
|
|
33
|
-
├──
|
|
34
|
-
├── configuration.mdx # Environment/config setup
|
|
118
|
+
├── docs.json
|
|
119
|
+
├── index.mdx # Product intro, value prop
|
|
120
|
+
├── quickstart.mdx # 5-minute getting started
|
|
121
|
+
├── authentication.mdx # Auth setup (API keys, OAuth)
|
|
35
122
|
├── guides/
|
|
36
|
-
│ ├── overview.mdx #
|
|
37
|
-
│ └── {
|
|
123
|
+
│ ├── overview.mdx # Concepts overview
|
|
124
|
+
│ └── {use-case}.mdx # Common use case tutorials
|
|
38
125
|
├── api-reference/
|
|
39
|
-
│ ├── introduction.mdx # API overview
|
|
40
|
-
│ ├── authentication.mdx # Auth
|
|
41
|
-
│
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
126
|
+
│ ├── introduction.mdx # API overview, base URL, versioning
|
|
127
|
+
│ ├── authentication.mdx # Auth details
|
|
128
|
+
│ ├── errors.mdx # Error codes and handling
|
|
129
|
+
│ └── openapi.json # Full API spec
|
|
130
|
+
├── sdks/ # If SDKs exist
|
|
131
|
+
│ ├── javascript.mdx
|
|
132
|
+
│ ├── python.mdx
|
|
133
|
+
│ └── ...
|
|
134
|
+
├── webhooks.mdx # If webhooks exist
|
|
135
|
+
└── changelog.mdx # API changelog
|
|
45
136
|
```
|
|
46
137
|
|
|
47
|
-
|
|
138
|
+
**Content focus:**
|
|
139
|
+
- Quick time-to-first-API-call
|
|
140
|
+
- Authentication and authorization
|
|
141
|
+
- API reference with examples
|
|
142
|
+
- SDKs and client libraries
|
|
143
|
+
- Error handling and troubleshooting
|
|
144
|
+
- Rate limits and best practices
|
|
48
145
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## docType: "product"
|
|
149
|
+
|
|
150
|
+
For end users of your product, create:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
docs/
|
|
154
|
+
├── docs.json
|
|
155
|
+
├── index.mdx # Product overview
|
|
156
|
+
├── getting-started/
|
|
157
|
+
│ ├── quickstart.mdx # First steps
|
|
158
|
+
│ ├── account-setup.mdx # Account creation, onboarding
|
|
159
|
+
│ └── key-concepts.mdx # Core concepts explained
|
|
160
|
+
├── features/
|
|
161
|
+
│ ├── {feature-1}.mdx # Feature guides
|
|
162
|
+
│ ├── {feature-2}.mdx
|
|
163
|
+
│ └── ...
|
|
164
|
+
├── tutorials/
|
|
165
|
+
│ ├── {workflow-1}.mdx # Step-by-step tutorials
|
|
166
|
+
│ └── ...
|
|
167
|
+
├── integrations/ # If integrations exist
|
|
168
|
+
│ └── ...
|
|
169
|
+
├── troubleshooting/
|
|
170
|
+
│ ├── common-issues.mdx
|
|
171
|
+
│ └── faq.mdx
|
|
172
|
+
└── release-notes.mdx # What's new
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Content focus:**
|
|
176
|
+
- Non-technical language (minimal code)
|
|
177
|
+
- Screenshots and visual guides
|
|
178
|
+
- Step-by-step tutorials
|
|
179
|
+
- Use case focused
|
|
180
|
+
- FAQs and troubleshooting
|
|
181
|
+
- Feature explanations
|
|
182
|
+
|
|
183
|
+
---
|
|
54
184
|
|
|
55
|
-
|
|
185
|
+
## docs.json Templates (with docType)
|
|
56
186
|
|
|
57
|
-
|
|
187
|
+
### Internal Docs
|
|
58
188
|
```json
|
|
59
189
|
{
|
|
60
|
-
"name": "{Project Name
|
|
190
|
+
"name": "{Project Name}",
|
|
191
|
+
"docType": "internal",
|
|
61
192
|
"navigation": {
|
|
62
193
|
"tabs": [
|
|
63
194
|
{
|
|
64
|
-
"tab": "
|
|
65
|
-
"type": "docs",
|
|
195
|
+
"tab": "Documentation",
|
|
66
196
|
"groups": [
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
{
|
|
72
|
-
"group": "Guides",
|
|
73
|
-
"pages": ["guides/overview"]
|
|
74
|
-
}
|
|
197
|
+
{ "group": "Getting Started", "pages": ["index", "getting-started/setup", "getting-started/prerequisites"] },
|
|
198
|
+
{ "group": "Architecture", "pages": ["architecture/overview", "architecture/folder-structure"] },
|
|
199
|
+
{ "group": "Development", "pages": ["development/workflow", "development/testing", "development/deployment"] },
|
|
200
|
+
{ "group": "Contributing", "pages": ["contributing"] }
|
|
75
201
|
]
|
|
76
202
|
}
|
|
77
203
|
]
|
|
@@ -79,24 +205,55 @@ Create navigation structure:
|
|
|
79
205
|
}
|
|
80
206
|
```
|
|
81
207
|
|
|
82
|
-
|
|
208
|
+
### Customer API Docs
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"name": "{Product Name}",
|
|
212
|
+
"docType": "api",
|
|
213
|
+
"navigation": {
|
|
214
|
+
"tabs": [
|
|
215
|
+
{
|
|
216
|
+
"tab": "Guides",
|
|
217
|
+
"groups": [
|
|
218
|
+
{ "group": "Getting Started", "pages": ["index", "quickstart", "authentication"] },
|
|
219
|
+
{ "group": "Guides", "pages": ["guides/overview"] }
|
|
220
|
+
]
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"tab": "API Reference",
|
|
224
|
+
"type": "openapi",
|
|
225
|
+
"spec": "api-reference/openapi.json"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
83
231
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
232
|
+
### Product Docs
|
|
233
|
+
```json
|
|
234
|
+
{
|
|
235
|
+
"name": "{Product Name}",
|
|
236
|
+
"docType": "product",
|
|
237
|
+
"navigation": {
|
|
238
|
+
"tabs": [
|
|
239
|
+
{
|
|
240
|
+
"tab": "Documentation",
|
|
241
|
+
"groups": [
|
|
242
|
+
{ "group": "Getting Started", "pages": ["index", "getting-started/quickstart", "getting-started/key-concepts"] },
|
|
243
|
+
{ "group": "Features", "pages": ["features/..."] },
|
|
244
|
+
{ "group": "Tutorials", "pages": ["tutorials/..."] },
|
|
245
|
+
{ "group": "Help", "pages": ["troubleshooting/common-issues", "troubleshooting/faq"] }
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
|
95
252
|
|
|
96
|
-
##
|
|
253
|
+
## Quality Guidelines
|
|
97
254
|
|
|
98
255
|
- Extract real code examples, don't fabricate
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
256
|
+
- Match tone to audience (technical vs non-technical)
|
|
257
|
+
- Add TODO markers for sections needing human review
|
|
258
|
+
- Include relevant screenshots for product docs
|
|
259
|
+
- Test all code examples work
|
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: check-docs
|
|
3
|
-
description: Quick check for documentation issues without making changes
|
|
3
|
+
description: Quick health check for documentation issues without making changes. Reads docType from docs.json config.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
7
|
|
|
8
|
-
Run a quick audit of documentation health
|
|
8
|
+
Run a quick audit of documentation health.
|
|
9
|
+
|
|
10
|
+
### First: Get Documentation Type
|
|
11
|
+
|
|
12
|
+
**Read `docs.json` for `docType` field:**
|
|
13
|
+
```json
|
|
14
|
+
{ "docType": "api" } // "internal" | "api" | "product"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**If not set, detect from structure:**
|
|
18
|
+
- Has `architecture/`, `development/` → "internal"
|
|
19
|
+
- Has `api-reference/`, `sdks/` → "api"
|
|
20
|
+
- Has `features/`, `tutorials/` → "product"
|
|
21
|
+
|
|
22
|
+
This helps tailor the checks:
|
|
23
|
+
- **internal**: Should have setup guides, architecture docs
|
|
24
|
+
- **api**: Should have authentication, error handling, API reference
|
|
25
|
+
- **product**: Should have screenshots, tutorials, FAQs
|
|
26
|
+
|
|
27
|
+
### Checks to Run:
|
|
9
28
|
|
|
10
29
|
1. **Broken Links** - Check all internal href links resolve
|
|
11
30
|
2. **Missing Pages** - Pages in docs.json but file doesn't exist
|
|
@@ -1,57 +1,274 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: create-doc-page
|
|
3
|
-
description: Create a new
|
|
3
|
+
description: Create a new documentation page. Reads docType from docs.json config, then asks about page topic and type.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
7
|
|
|
8
8
|
When creating a new documentation page:
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
2. Generate MDX with:
|
|
12
|
-
- Proper frontmatter (title, description)
|
|
13
|
-
- Clear introduction paragraph
|
|
14
|
-
- Structured sections with H2/H3
|
|
15
|
-
- Appropriate components (Steps, Cards, Callouts)
|
|
16
|
-
- Navigation cards at the bottom
|
|
10
|
+
### Step 1: Get Documentation Type from Config
|
|
17
11
|
|
|
18
|
-
|
|
12
|
+
**Read `docs.json` for `docType` field:**
|
|
13
|
+
```json
|
|
14
|
+
{ "docType": "api" } // "internal" | "api" | "product"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
If set, use it automatically. If not set, ask user and then save their choice to docs.json.
|
|
18
|
+
|
|
19
|
+
### Step 2: Gather Requirements
|
|
20
|
+
|
|
21
|
+
Ask the user:
|
|
22
|
+
|
|
23
|
+
1. **What is this page about?** (topic/title)
|
|
24
|
+
|
|
25
|
+
2. **What kind of page?**
|
|
26
|
+
- Guide/Overview - Explains concepts
|
|
27
|
+
- Tutorial - Step-by-step walkthrough
|
|
28
|
+
- Reference - Technical specifications
|
|
29
|
+
- Troubleshooting - Problem/solution format
|
|
30
|
+
|
|
31
|
+
(If `docType` not in docs.json, also ask which type of docs)
|
|
32
|
+
|
|
33
|
+
### Step 2: Generate Based on Type
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Internal/Developer Docs Templates
|
|
38
|
+
|
|
39
|
+
### Setup/Configuration Page
|
|
40
|
+
```mdx
|
|
41
|
+
---
|
|
42
|
+
title: "{Feature} Setup"
|
|
43
|
+
description: "How to configure {feature} for local development"
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
This guide covers setting up {feature} in your local development environment.
|
|
47
|
+
|
|
48
|
+
## Prerequisites
|
|
49
|
+
|
|
50
|
+
- Node.js 18+
|
|
51
|
+
- Docker (optional)
|
|
52
|
+
- Access to {internal resource}
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
<Steps>
|
|
57
|
+
<Step title="Install dependencies">
|
|
58
|
+
```bash
|
|
59
|
+
npm install
|
|
60
|
+
```
|
|
61
|
+
</Step>
|
|
62
|
+
<Step title="Configure environment">
|
|
63
|
+
Copy `.env.example` to `.env` and set:
|
|
64
|
+
```bash
|
|
65
|
+
FEATURE_API_KEY=your-key
|
|
66
|
+
```
|
|
67
|
+
</Step>
|
|
68
|
+
</Steps>
|
|
69
|
+
|
|
70
|
+
## Configuration Options
|
|
19
71
|
|
|
72
|
+
| Variable | Description | Default |
|
|
73
|
+
|----------|-------------|---------|
|
|
74
|
+
| `OPTION_1` | Description | `value` |
|
|
75
|
+
|
|
76
|
+
## Troubleshooting
|
|
77
|
+
|
|
78
|
+
<Accordion title="Common issue">
|
|
79
|
+
Solution here
|
|
80
|
+
</Accordion>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Architecture Page
|
|
20
84
|
```mdx
|
|
21
85
|
---
|
|
22
|
-
title: "{
|
|
23
|
-
description: "{
|
|
86
|
+
title: "{System} Architecture"
|
|
87
|
+
description: "Technical overview of {system} design and components"
|
|
24
88
|
---
|
|
25
89
|
|
|
26
|
-
|
|
90
|
+
Overview of how {system} is architected.
|
|
91
|
+
|
|
92
|
+
## High-Level Design
|
|
93
|
+
|
|
94
|
+
{Diagram or description}
|
|
95
|
+
|
|
96
|
+
## Components
|
|
97
|
+
|
|
98
|
+
### Component A
|
|
99
|
+
{Description, responsibilities}
|
|
100
|
+
|
|
101
|
+
### Component B
|
|
102
|
+
{Description, responsibilities}
|
|
103
|
+
|
|
104
|
+
## Data Flow
|
|
105
|
+
|
|
106
|
+
<Steps>
|
|
107
|
+
<Step title="Step 1">Request comes in...</Step>
|
|
108
|
+
<Step title="Step 2">Processing...</Step>
|
|
109
|
+
</Steps>
|
|
110
|
+
|
|
111
|
+
## Design Decisions
|
|
112
|
+
|
|
113
|
+
<Note>
|
|
114
|
+
We chose X over Y because...
|
|
115
|
+
</Note>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Customer API Docs Templates
|
|
121
|
+
|
|
122
|
+
### API Guide Page
|
|
123
|
+
```mdx
|
|
124
|
+
---
|
|
125
|
+
title: "{Feature} Guide"
|
|
126
|
+
description: "Learn how to {action} using the {Product} API"
|
|
127
|
+
---
|
|
27
128
|
|
|
28
|
-
|
|
129
|
+
This guide shows you how to {action} using the {Product} API.
|
|
29
130
|
|
|
30
|
-
|
|
131
|
+
## Prerequisites
|
|
31
132
|
|
|
32
|
-
|
|
133
|
+
- A {Product} account ([sign up](https://...))
|
|
134
|
+
- An API key ([get one here](/authentication))
|
|
33
135
|
|
|
34
|
-
|
|
136
|
+
## Quick Example
|
|
137
|
+
|
|
138
|
+
```javascript
|
|
139
|
+
import { Client } from '{package}';
|
|
140
|
+
|
|
141
|
+
const client = new Client({ apiKey: 'your-key' });
|
|
142
|
+
const result = await client.feature.action();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Step-by-Step
|
|
146
|
+
|
|
147
|
+
<Steps>
|
|
148
|
+
<Step title="Initialize the client">
|
|
149
|
+
```javascript
|
|
150
|
+
const client = new Client({ apiKey: process.env.API_KEY });
|
|
151
|
+
```
|
|
152
|
+
</Step>
|
|
153
|
+
<Step title="Make your first request">
|
|
154
|
+
```javascript
|
|
155
|
+
const response = await client.feature.action({ param: 'value' });
|
|
156
|
+
```
|
|
157
|
+
</Step>
|
|
158
|
+
</Steps>
|
|
159
|
+
|
|
160
|
+
## Parameters
|
|
161
|
+
|
|
162
|
+
| Parameter | Type | Required | Description |
|
|
163
|
+
|-----------|------|----------|-------------|
|
|
164
|
+
| `param` | string | Yes | Description |
|
|
165
|
+
|
|
166
|
+
## Response
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"id": "123",
|
|
171
|
+
"status": "success"
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Error Handling
|
|
176
|
+
|
|
177
|
+
<Warning>
|
|
178
|
+
Always wrap API calls in try/catch blocks.
|
|
179
|
+
</Warning>
|
|
180
|
+
|
|
181
|
+
```javascript
|
|
182
|
+
try {
|
|
183
|
+
const result = await client.feature.action();
|
|
184
|
+
} catch (error) {
|
|
185
|
+
if (error.code === 'RATE_LIMITED') {
|
|
186
|
+
// Handle rate limiting
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
35
190
|
|
|
36
191
|
## Next Steps
|
|
37
192
|
|
|
38
193
|
<CardGroup cols={2}>
|
|
39
|
-
<Card title="
|
|
40
|
-
|
|
194
|
+
<Card title="API Reference" icon="code" href="/api-reference">
|
|
195
|
+
Full API documentation
|
|
196
|
+
</Card>
|
|
197
|
+
<Card title="Examples" icon="github-logo" href="/examples">
|
|
198
|
+
See more examples
|
|
41
199
|
</Card>
|
|
42
200
|
</CardGroup>
|
|
43
201
|
```
|
|
44
202
|
|
|
45
|
-
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Product/User Docs Templates
|
|
206
|
+
|
|
207
|
+
### Feature Guide Page
|
|
208
|
+
```mdx
|
|
209
|
+
---
|
|
210
|
+
title: "{Feature Name}"
|
|
211
|
+
description: "Learn how to use {feature} in {Product}"
|
|
212
|
+
---
|
|
46
213
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
214
|
+
{Feature} helps you {benefit}. This guide walks you through everything you need to know.
|
|
215
|
+
|
|
216
|
+
## Overview
|
|
217
|
+
|
|
218
|
+
{Screenshot or visual}
|
|
219
|
+
|
|
220
|
+
{Brief explanation of what the feature does}
|
|
221
|
+
|
|
222
|
+
## Getting Started
|
|
223
|
+
|
|
224
|
+
<Steps>
|
|
225
|
+
<Step title="Navigate to {Feature}">
|
|
226
|
+
Click on **Settings** → **{Feature}** in the sidebar.
|
|
227
|
+
</Step>
|
|
228
|
+
<Step title="Configure your preferences">
|
|
229
|
+
Select your preferred options...
|
|
230
|
+
</Step>
|
|
231
|
+
</Steps>
|
|
232
|
+
|
|
233
|
+
## Key Features
|
|
234
|
+
|
|
235
|
+
<CardGroup cols={2}>
|
|
236
|
+
<Card title="Feature A" icon="star">
|
|
237
|
+
Description of capability
|
|
238
|
+
</Card>
|
|
239
|
+
<Card title="Feature B" icon="lightning">
|
|
240
|
+
Description of capability
|
|
241
|
+
</Card>
|
|
242
|
+
</CardGroup>
|
|
243
|
+
|
|
244
|
+
## Tips & Best Practices
|
|
245
|
+
|
|
246
|
+
<Tip>
|
|
247
|
+
Pro tip for getting the most out of this feature.
|
|
248
|
+
</Tip>
|
|
249
|
+
|
|
250
|
+
## Frequently Asked Questions
|
|
251
|
+
|
|
252
|
+
<AccordionGroup>
|
|
253
|
+
<Accordion title="How do I...?">
|
|
254
|
+
Answer here
|
|
255
|
+
</Accordion>
|
|
256
|
+
<Accordion title="Can I...?">
|
|
257
|
+
Answer here
|
|
258
|
+
</Accordion>
|
|
259
|
+
</AccordionGroup>
|
|
260
|
+
|
|
261
|
+
## Need Help?
|
|
262
|
+
|
|
263
|
+
<Card title="Contact Support" icon="chat-circle" href="/support">
|
|
264
|
+
Reach out to our support team
|
|
265
|
+
</Card>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
53
269
|
|
|
54
270
|
## After Creating
|
|
55
271
|
|
|
56
272
|
1. Add the new page to `docs.json` navigation
|
|
57
273
|
2. Link to the page from related documentation
|
|
274
|
+
3. Verify all code examples work
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: docs-from-code
|
|
3
|
-
description: Generate documentation from specific code files, functions, or modules
|
|
3
|
+
description: Generate documentation from specific code files, functions, or modules. Can reference parent directory for source code.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Instructions
|
|
7
7
|
|
|
8
8
|
When generating docs from specific code:
|
|
9
9
|
|
|
10
|
+
### Step 0: Locate Source Code
|
|
11
|
+
|
|
12
|
+
If running from a docs folder (has `docs.json`), look for source code in:
|
|
13
|
+
- Parent directory: `../src/`, `../lib/`, `../app/`
|
|
14
|
+
- Or ask the user to specify the path
|
|
15
|
+
|
|
16
|
+
### Step 1: Analyze Code
|
|
17
|
+
|
|
10
18
|
1. Analyze the code structure and purpose
|
|
11
19
|
2. Identify:
|
|
12
20
|
- Public API/exports
|