@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,66 @@
1
+ {
2
+ "$schema": "https://devdoc.sh/schemas/context.json",
3
+ "version": "1.0",
4
+ "lastUpdated": null,
5
+ "product": {
6
+ "name": "",
7
+ "description": "",
8
+ "type": null,
9
+ "domain": "",
10
+ "targetAudience": "",
11
+ "keyFeatures": []
12
+ },
13
+ "terminology": {
14
+ "glossary": {},
15
+ "avoidTerms": [],
16
+ "brandNames": {}
17
+ },
18
+ "api": {
19
+ "style": null,
20
+ "baseUrl": "",
21
+ "authentication": {
22
+ "type": null,
23
+ "headerName": "",
24
+ "description": ""
25
+ },
26
+ "conventions": {
27
+ "pagination": "",
28
+ "errorFormat": "",
29
+ "dateFormat": "",
30
+ "idFormat": ""
31
+ },
32
+ "commonPatterns": []
33
+ },
34
+ "codebase": {
35
+ "language": "",
36
+ "framework": "",
37
+ "sourceLocation": "../",
38
+ "keyDirectories": {},
39
+ "namingConventions": {
40
+ "files": "",
41
+ "functions": "",
42
+ "classes": "",
43
+ "variables": ""
44
+ }
45
+ },
46
+ "documentation": {
47
+ "voice": "",
48
+ "perspective": null,
49
+ "codeExamples": {
50
+ "primaryLanguage": "",
51
+ "additionalLanguages": [],
52
+ "style": ""
53
+ },
54
+ "templates": {
55
+ "guide": ".devdoc/templates/guide.md",
56
+ "apiReference": ".devdoc/templates/api-reference.md",
57
+ "tutorial": ".devdoc/templates/tutorial.md",
58
+ "quickstart": ".devdoc/templates/quickstart.md",
59
+ "troubleshooting": ".devdoc/templates/troubleshooting.md"
60
+ }
61
+ },
62
+ "learned": {
63
+ "insights": [],
64
+ "corrections": []
65
+ }
66
+ }
@@ -0,0 +1,211 @@
1
+ # API Reference Template
2
+
3
+ Use this structure when creating API endpoint documentation.
4
+
5
+ ## Format
6
+
7
+ ```mdx
8
+ ---
9
+ title: [HTTP Method] [Endpoint Name]
10
+ description: [Brief description of what this endpoint does]
11
+ ---
12
+
13
+ ## Endpoint
14
+
15
+ <ParamField method="POST" path="/v1/resource">
16
+ Brief description of the endpoint's purpose.
17
+ </ParamField>
18
+
19
+ ## Request Flow
20
+
21
+ Visualize the API flow with a sequence diagram:
22
+
23
+ ```mermaid
24
+ sequenceDiagram
25
+ participant Client
26
+ participant API
27
+ participant Auth
28
+ participant Database
29
+
30
+ Client->>API: POST /v1/resource
31
+ API->>Auth: Validate token
32
+ Auth-->>API: Valid
33
+ API->>Database: Create resource
34
+ Database-->>API: resource_id
35
+ API-->>Client: 201 Created
36
+ ```
37
+
38
+ ## Authentication
39
+
40
+ <Note>
41
+ This endpoint requires [authentication type]. Include your API key in the `Authorization` header.
42
+ </Note>
43
+
44
+ ## Request
45
+
46
+ ### Headers
47
+
48
+ | Header | Required | Description |
49
+ |--------|----------|-------------|
50
+ | `Authorization` | Yes | Bearer token or API key |
51
+ | `Content-Type` | Yes | `application/json` |
52
+
53
+ ### Path Parameters
54
+
55
+ <ParamField path="id" type="string" required>
56
+ The unique identifier of the resource.
57
+ </ParamField>
58
+
59
+ ### Query Parameters
60
+
61
+ <ParamField query="limit" type="integer" default="20">
62
+ Maximum number of results to return.
63
+ </ParamField>
64
+
65
+ ### Request Body
66
+
67
+ <ParamField body="name" type="string" required>
68
+ The name of the resource.
69
+ </ParamField>
70
+
71
+ <ParamField body="metadata" type="object">
72
+ Optional metadata object.
73
+ </ParamField>
74
+
75
+ ## Response
76
+
77
+ ### Success Response (200)
78
+
79
+ ```json
80
+ {
81
+ "id": "res_123",
82
+ "name": "Example",
83
+ "created_at": "2026-01-24T10:00:00Z"
84
+ }
85
+ ```
86
+
87
+ ### Error Responses
88
+
89
+ | Status | Code | Description |
90
+ |--------|------|-------------|
91
+ | 400 | `invalid_request` | Request validation failed |
92
+ | 401 | `unauthorized` | Invalid or missing API key |
93
+ | 404 | `not_found` | Resource not found |
94
+
95
+ ## Error Flow
96
+
97
+ ```mermaid
98
+ flowchart TD
99
+ A[Request] --> B{Valid Auth?}
100
+ B -->|No| C[401 Unauthorized]
101
+ B -->|Yes| D{Valid Body?}
102
+ D -->|No| E[400 Bad Request]
103
+ D -->|Yes| F{Resource Exists?}
104
+ F -->|No| G[404 Not Found]
105
+ F -->|Yes| H[200 Success]
106
+ ```
107
+
108
+ ## Code Examples
109
+
110
+ <CodeGroup>
111
+ ```bash cURL
112
+ curl -X POST https://api.example.com/v1/resource \
113
+ -H "Authorization: Bearer YOUR_API_KEY" \
114
+ -H "Content-Type: application/json" \
115
+ -d '{"name": "Example"}'
116
+ ```
117
+
118
+ ```typescript TypeScript
119
+ const response = await client.resource.create({
120
+ name: "Example"
121
+ });
122
+ ```
123
+
124
+ ```python Python
125
+ response = client.resource.create(
126
+ name="Example"
127
+ )
128
+ ```
129
+ </CodeGroup>
130
+ ```
131
+
132
+ ## Mermaid Diagram Guidelines
133
+
134
+ ### Sequence Diagrams for API Flows
135
+
136
+ Show the complete request lifecycle:
137
+
138
+ ```mermaid
139
+ sequenceDiagram
140
+ participant C as Client
141
+ participant G as Gateway
142
+ participant A as Auth
143
+ participant S as Service
144
+ participant D as Database
145
+
146
+ C->>G: Request
147
+ G->>A: Validate
148
+ A-->>G: Token valid
149
+ G->>S: Forward
150
+ S->>D: Query
151
+ D-->>S: Data
152
+ S-->>G: Response
153
+ G-->>C: JSON
154
+ ```
155
+
156
+ ### Error Handling Flow
157
+
158
+ ```mermaid
159
+ flowchart TD
160
+ A[API Request] --> B{Rate Limited?}
161
+ B -->|Yes| C[429 Too Many Requests]
162
+ B -->|No| D{Authenticated?}
163
+ D -->|No| E[401 Unauthorized]
164
+ D -->|Yes| F{Authorized?}
165
+ F -->|No| G[403 Forbidden]
166
+ F -->|Yes| H{Valid Request?}
167
+ H -->|No| I[400 Bad Request]
168
+ H -->|Yes| J[Process Request]
169
+ J --> K{Success?}
170
+ K -->|Yes| L[200 OK]
171
+ K -->|No| M[500 Server Error]
172
+ ```
173
+
174
+ ### Webhook Flow
175
+
176
+ ```mermaid
177
+ sequenceDiagram
178
+ participant Your API
179
+ participant DevDoc
180
+ participant Your Server
181
+
182
+ Your API->>DevDoc: Event occurs
183
+ DevDoc->>Your Server: POST /webhook
184
+ Your Server->>Your Server: Verify signature
185
+ Your Server->>Your Server: Process event
186
+ Your Server-->>DevDoc: 200 OK
187
+ ```
188
+
189
+ ### State Transitions
190
+
191
+ ```mermaid
192
+ stateDiagram-v2
193
+ [*] --> pending
194
+ pending --> processing: start_processing
195
+ processing --> completed: success
196
+ processing --> failed: error
197
+ failed --> processing: retry
198
+ completed --> [*]
199
+ failed --> cancelled: cancel
200
+ cancelled --> [*]
201
+ ```
202
+
203
+ ## Guidelines
204
+
205
+ - Always show request and response examples
206
+ - Include all possible error codes
207
+ - Provide examples in multiple languages
208
+ - Document rate limits if applicable
209
+ - **Use sequence diagrams** for complex flows
210
+ - **Use flowcharts** for error handling logic
211
+ - **Use state diagrams** for resource lifecycles
@@ -0,0 +1,133 @@
1
+ # Guide Template
2
+
3
+ Use this structure when creating guide documentation.
4
+
5
+ ## Format
6
+
7
+ ```mdx
8
+ ---
9
+ title: [Action] + [Topic]
10
+ description: Learn how to [achieve specific outcome]
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ Brief introduction (2-3 sentences):
16
+ - What this guide covers
17
+ - Who it's for
18
+ - What you'll achieve
19
+
20
+ ## Prerequisites
21
+
22
+ <Note>
23
+ Before you begin, ensure you have:
24
+ - [Requirement 1]
25
+ - [Requirement 2]
26
+ </Note>
27
+
28
+ ## Architecture / Flow (if applicable)
29
+
30
+ Use mermaid diagrams to visualize:
31
+
32
+ ```mermaid
33
+ flowchart LR
34
+ A[Input] --> B[Process]
35
+ B --> C[Output]
36
+ ```
37
+
38
+ ## Steps
39
+
40
+ <Steps>
41
+ <Step title="Step name">
42
+ Explanation of what this step does.
43
+
44
+ ```language
45
+ // Code example
46
+ ```
47
+ </Step>
48
+
49
+ <Step title="Next step">
50
+ Continue with clear, actionable steps.
51
+ </Step>
52
+ </Steps>
53
+
54
+ ## Example
55
+
56
+ Complete working example showing the end result.
57
+
58
+ ```language
59
+ // Full example code
60
+ ```
61
+
62
+ ## Next Steps
63
+
64
+ <CardGroup cols={2}>
65
+ <Card title="Related Guide" href="/path">
66
+ Brief description
67
+ </Card>
68
+ </CardGroup>
69
+ ```
70
+
71
+ ## Mermaid Diagram Guidelines
72
+
73
+ ### When to Use Diagrams
74
+
75
+ - **Flowcharts**: For processes, decision trees, workflows
76
+ - **Sequence diagrams**: For API calls, request/response flows
77
+ - **Entity diagrams**: For data models, relationships
78
+ - **State diagrams**: For state machines, status transitions
79
+
80
+ ### Flowchart Example
81
+
82
+ ```mermaid
83
+ flowchart TD
84
+ A[Start] --> B{Decision?}
85
+ B -->|Yes| C[Action 1]
86
+ B -->|No| D[Action 2]
87
+ C --> E[End]
88
+ D --> E
89
+ ```
90
+
91
+ ### Sequence Diagram Example
92
+
93
+ ```mermaid
94
+ sequenceDiagram
95
+ participant Client
96
+ participant API
97
+ participant Database
98
+
99
+ Client->>API: POST /users
100
+ API->>Database: INSERT user
101
+ Database-->>API: user_id
102
+ API-->>Client: 201 Created
103
+ ```
104
+
105
+ ### Entity Relationship Example
106
+
107
+ ```mermaid
108
+ erDiagram
109
+ USER ||--o{ ORDER : places
110
+ ORDER ||--|{ LINE_ITEM : contains
111
+ PRODUCT ||--o{ LINE_ITEM : "ordered in"
112
+ ```
113
+
114
+ ### State Diagram Example
115
+
116
+ ```mermaid
117
+ stateDiagram-v2
118
+ [*] --> Pending
119
+ Pending --> Processing: start
120
+ Processing --> Completed: success
121
+ Processing --> Failed: error
122
+ Failed --> Processing: retry
123
+ Completed --> [*]
124
+ ```
125
+
126
+ ## Guidelines
127
+
128
+ - Start with the outcome, not the process
129
+ - Each step should be independently verifiable
130
+ - Include error handling in code examples
131
+ - Link to related guides at the end
132
+ - **Use mermaid diagrams** to visualize complex flows
133
+ - Keep diagrams simple - max 7-10 nodes
@@ -0,0 +1,179 @@
1
+ # Quickstart Template
2
+
3
+ Use this structure for getting-started documentation.
4
+
5
+ ## Format
6
+
7
+ ```mdx
8
+ ---
9
+ title: Quickstart
10
+ description: Get up and running with [Product] in 5 minutes
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ [Product] helps you [main value proposition]. This guide gets you from zero to [first success metric] in under 5 minutes.
16
+
17
+ ## How It Works
18
+
19
+ ```mermaid
20
+ flowchart LR
21
+ A[Install] --> B[Configure]
22
+ B --> C[First Request]
23
+ C --> D[Success!]
24
+ ```
25
+
26
+ ## 1. Install
27
+
28
+ <CodeGroup>
29
+ ```bash npm
30
+ npm install package-name
31
+ ```
32
+
33
+ ```bash yarn
34
+ yarn add package-name
35
+ ```
36
+
37
+ ```bash pnpm
38
+ pnpm add package-name
39
+ ```
40
+ </CodeGroup>
41
+
42
+ ## 2. Configure
43
+
44
+ Create a configuration file or set environment variables:
45
+
46
+ ```bash
47
+ export API_KEY=your_api_key_here
48
+ ```
49
+
50
+ Or create a config file:
51
+
52
+ ```json
53
+ {
54
+ "apiKey": "your_api_key_here"
55
+ }
56
+ ```
57
+
58
+ <Note>
59
+ Get your API key from the [dashboard](https://example.com/dashboard).
60
+ </Note>
61
+
62
+ ## 3. First Request
63
+
64
+ Make your first API call:
65
+
66
+ ```typescript
67
+ import { Client } from 'package-name';
68
+
69
+ const client = new Client({ apiKey: process.env.API_KEY });
70
+
71
+ const result = await client.doSomething({
72
+ input: "Hello, world!"
73
+ });
74
+
75
+ console.log(result);
76
+ ```
77
+
78
+ Expected output:
79
+
80
+ ```json
81
+ {
82
+ "success": true,
83
+ "data": "..."
84
+ }
85
+ ```
86
+
87
+ ## What Happens Behind the Scenes
88
+
89
+ ```mermaid
90
+ sequenceDiagram
91
+ participant You
92
+ participant SDK
93
+ participant API
94
+
95
+ You->>SDK: client.doSomething()
96
+ SDK->>API: POST /v1/action
97
+ API-->>SDK: Response
98
+ SDK-->>You: Result object
99
+ ```
100
+
101
+ ## Next Steps
102
+
103
+ <CardGroup cols={2}>
104
+ <Card title="Core Concepts" icon="book" href="/concepts">
105
+ Understand how [Product] works.
106
+ </Card>
107
+ <Card title="API Reference" icon="code" href="/api-reference">
108
+ Explore all available endpoints.
109
+ </Card>
110
+ <Card title="Examples" icon="folder" href="/examples">
111
+ See real-world use cases.
112
+ </Card>
113
+ <Card title="SDKs" icon="puzzle" href="/sdks">
114
+ Official client libraries.
115
+ </Card>
116
+ </CardGroup>
117
+ ```
118
+
119
+ ## Mermaid Diagram Guidelines
120
+
121
+ ### Simple Flow for Quickstart
122
+
123
+ Keep it simple - show the journey:
124
+
125
+ ```mermaid
126
+ flowchart LR
127
+ A["📦 Install"] --> B["⚙️ Configure"]
128
+ B --> C["🚀 Use"]
129
+ C --> D["✅ Done!"]
130
+ ```
131
+
132
+ ### SDK Architecture
133
+
134
+ ```mermaid
135
+ flowchart TB
136
+ subgraph "Your App"
137
+ A[Your Code]
138
+ end
139
+ subgraph "SDK"
140
+ B[Client]
141
+ C[Auth]
142
+ D[Retry Logic]
143
+ end
144
+ subgraph "Cloud"
145
+ E[API]
146
+ end
147
+ A --> B
148
+ B --> C
149
+ B --> D
150
+ B --> E
151
+ ```
152
+
153
+ ### Authentication Flow
154
+
155
+ ```mermaid
156
+ sequenceDiagram
157
+ participant App
158
+ participant SDK
159
+ participant Auth
160
+ participant API
161
+
162
+ App->>SDK: Initialize with API key
163
+ SDK->>Auth: Validate key
164
+ Auth-->>SDK: Valid
165
+ App->>SDK: Make request
166
+ SDK->>API: Authenticated request
167
+ API-->>SDK: Response
168
+ SDK-->>App: Data
169
+ ```
170
+
171
+ ## Guidelines
172
+
173
+ - Keep it under 5 minutes to complete
174
+ - Use the minimum viable example
175
+ - Show expected output at each step
176
+ - Link to deeper documentation at the end
177
+ - Include multiple installation methods
178
+ - **Use simple flowcharts** to show the process
179
+ - **Use sequence diagrams** to explain what happens