@guiho/xdocs 0.1.0 → 0.1.3
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/README.md +347 -0
- package/jsr.json +1 -1
- package/library/guiho-xdocs-bin.js +0 -0
- package/package.json +2 -1
- package/prompts/agents.md +21 -0
- package/prompts/generate.md +26 -0
- package/prompts/update.md +31 -0
- package/prompts/write.md +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# XDocs
|
|
2
|
+
|
|
3
|
+
**Structured documentation system for codebases. Helps AI make sense of projects.**
|
|
4
|
+
|
|
5
|
+
xdocs is a CLI and TypeScript library that places structured documentation files throughout your project so that AI agents (and humans) can navigate, understand, and work within a codebase without reading every file. Each xdocs file describes the directory it lives in -- its purpose, its files, and how it fits into the project hierarchy.
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
codebase -> xdocs files -> AI understands the project
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
xdocs runs on **Bun** and **Node >= 20**. It ships as a compiled binary, a thin JS loader for `npx`/`bunx`, and a fully-typed TypeScript library.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -D @guiho/xdocs
|
|
21
|
+
# or
|
|
22
|
+
bun add -d @guiho/xdocs
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Initializing
|
|
26
|
+
|
|
27
|
+
Set up xdocs in your project:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
xdocs init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This creates:
|
|
34
|
+
- `XDOCS.md` -- the root documentation file for the project
|
|
35
|
+
- `xdocs.config.toml` -- configuration with sensible defaults
|
|
36
|
+
- Updates `AGENTS.md` with instructions for AI agents
|
|
37
|
+
- Installs agent skill files for your AI tool
|
|
38
|
+
|
|
39
|
+
### Typical Workflow
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Scan the project for existing xdocs files
|
|
43
|
+
xdocs scan
|
|
44
|
+
|
|
45
|
+
# Generate documentation for a specific module
|
|
46
|
+
xdocs generate ./src/auth
|
|
47
|
+
|
|
48
|
+
# View the project hierarchy
|
|
49
|
+
xdocs tree
|
|
50
|
+
|
|
51
|
+
# Get a ready-made prompt for AI to write documentation
|
|
52
|
+
xdocs prompt --name=write
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
### The Problem
|
|
60
|
+
|
|
61
|
+
When AI works on a codebase, most of the structural knowledge lives in the head of the person who built it. The AI has no understanding of _why_ files exist, _what purpose_ a directory serves, or _how_ modules relate to each other. To figure this out, it must read every file and piece things together -- slow, expensive, and error-prone.
|
|
62
|
+
|
|
63
|
+
### The Solution
|
|
64
|
+
|
|
65
|
+
xdocs solves this by placing documentation files throughout the project. Each xdocs file describes the directory it lives in, acting as a self-contained map of that module. Instead of opening every file to understand a directory, the AI reads its xdocs file.
|
|
66
|
+
|
|
67
|
+
### File Format
|
|
68
|
+
|
|
69
|
+
xdocs files are Markdown with YAML frontmatter. A file is recognized as an xdocs file if it ends with one of the configured extensions (default: `.docs.md`, `.xdocs.md`).
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
---
|
|
73
|
+
subject: authentication
|
|
74
|
+
description: Handles user login, registration, password reset, and session management.
|
|
75
|
+
parent: domain-core
|
|
76
|
+
children:
|
|
77
|
+
- login
|
|
78
|
+
- registration
|
|
79
|
+
- password-reset
|
|
80
|
+
files:
|
|
81
|
+
authenticate.ts: Validates credentials and returns a session token.
|
|
82
|
+
register.ts: Creates a new user account with email verification.
|
|
83
|
+
session.ts: Manages session creation, validation, and expiration.
|
|
84
|
+
tags: []
|
|
85
|
+
flags: []
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Overview
|
|
89
|
+
|
|
90
|
+
The authentication module handles all identity verification flows...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Metadata Fields
|
|
94
|
+
|
|
95
|
+
| Field | Type | Required | Description |
|
|
96
|
+
| ------------- | --------------------- | -------- | ------------------------------------------------------------- |
|
|
97
|
+
| `subject` | `string` | Yes | The name of this module/subject. |
|
|
98
|
+
| `description` | `string` | Yes | A short description the AI reads first to understand the module. |
|
|
99
|
+
| `parent` | `string \| null` | Yes | The parent subject in the hierarchy. `null` for the root. |
|
|
100
|
+
| `children` | `string[]` | Yes | Child subjects (submodules) contained within this module. |
|
|
101
|
+
| `files` | `map<string, string>` | Yes | Files in this directory. Key = filename, value = description. |
|
|
102
|
+
| `tags` | `string[]` | Yes | Tags for categorization and search. |
|
|
103
|
+
| `flags` | `string[]` | Yes | Flags for marking attributes or states. |
|
|
104
|
+
| `status` | `string` | No | Module status (e.g., `active`, `deprecated`, `experimental`). |
|
|
105
|
+
|
|
106
|
+
### The Tree
|
|
107
|
+
|
|
108
|
+
xdocs files form a hierarchy through their `subject`, `parent`, and `children` fields. The tree represents containment -- not dependencies -- and is computed by scanning all xdocs files.
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
project (root)
|
|
112
|
+
domain-core
|
|
113
|
+
authentication
|
|
114
|
+
login
|
|
115
|
+
registration
|
|
116
|
+
password-reset
|
|
117
|
+
user
|
|
118
|
+
profile
|
|
119
|
+
preferences
|
|
120
|
+
domain-supply
|
|
121
|
+
supply
|
|
122
|
+
product
|
|
123
|
+
catalog
|
|
124
|
+
inventory
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The CLI validates tree integrity: no orphan subjects, no missing parents, no cycles.
|
|
128
|
+
|
|
129
|
+
### CLI Commands
|
|
130
|
+
|
|
131
|
+
#### `xdocs init`
|
|
132
|
+
|
|
133
|
+
Initializes xdocs in a project. Creates the root `XDOCS.md`, the `xdocs.config.toml` configuration, updates `AGENTS.md`, and installs agent skills.
|
|
134
|
+
|
|
135
|
+
#### `xdocs scan`
|
|
136
|
+
|
|
137
|
+
Scans the project for xdocs files. Reports which directories have coverage and which are missing documentation.
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
xdocs scan
|
|
141
|
+
xdocs scan --format json
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### `xdocs generate [path]`
|
|
145
|
+
|
|
146
|
+
Generates documentation for a directory or the entire project.
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Generate docs for a specific module
|
|
150
|
+
xdocs generate ./src/auth
|
|
151
|
+
|
|
152
|
+
# Generate docs for the entire project
|
|
153
|
+
xdocs generate
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `xdocs prompt --name=<name>`
|
|
157
|
+
|
|
158
|
+
Outputs a ready-made prompt for AI agents. Each prompt is a self-contained instruction for a specific xdocs task. Prompts are selected by the `--name` flag, not by subcommand.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
xdocs prompt --name=write # How to write xdocs documentation
|
|
162
|
+
xdocs prompt --name=update # How to update existing xdocs files
|
|
163
|
+
xdocs prompt --name=agents # How to update AGENTS.md
|
|
164
|
+
xdocs prompt --name=generate # How to generate comprehensive docs
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### `xdocs merge [path]`
|
|
168
|
+
|
|
169
|
+
Merges xdocs files from a directory into a single consolidated document.
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
xdocs merge ./src/domain
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### `xdocs tree`
|
|
176
|
+
|
|
177
|
+
Displays the project hierarchy tree assembled from xdocs metadata.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
xdocs tree
|
|
181
|
+
xdocs tree --format markdown --output tree.md
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### `xdocs list [path]`
|
|
185
|
+
|
|
186
|
+
Lists files in a scope with descriptions pulled from xdocs metadata.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
xdocs list ./src/auth
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### Global Flags
|
|
193
|
+
|
|
194
|
+
All commands accept:
|
|
195
|
+
|
|
196
|
+
| Flag | Description |
|
|
197
|
+
| ----------------- | -------------------------------------------- |
|
|
198
|
+
| `-h`, `--help` | Show help for a command |
|
|
199
|
+
| `-v`, `--version` | Show the xdocs version |
|
|
200
|
+
| `--cwd <path>` | Run as if started in the given directory |
|
|
201
|
+
| `--config <path>` | Path to `xdocs.config.toml` |
|
|
202
|
+
| `--format <fmt>` | Output format: `text`, `json`, or `markdown` |
|
|
203
|
+
| `--verbose` | Show detailed output |
|
|
204
|
+
|
|
205
|
+
### Configuration (`xdocs.config.toml`)
|
|
206
|
+
|
|
207
|
+
xdocs looks for configuration at `./xdocs.config.toml`, `./config/xdocs.config.toml`, or the path given by `--config`.
|
|
208
|
+
|
|
209
|
+
```toml
|
|
210
|
+
schema = 1
|
|
211
|
+
|
|
212
|
+
[extensions]
|
|
213
|
+
# File extensions recognized as xdocs files.
|
|
214
|
+
# Default: [".docs.md", ".xdocs.md"]
|
|
215
|
+
supported = [".docs.md", ".xdocs.md"]
|
|
216
|
+
|
|
217
|
+
[ai]
|
|
218
|
+
# How the AI handles documentation updates.
|
|
219
|
+
# "prompt" = AI announces updates needed, waits for user to confirm.
|
|
220
|
+
# "auto" = AI updates documentation automatically on any change.
|
|
221
|
+
# Default: "prompt"
|
|
222
|
+
mode = "prompt"
|
|
223
|
+
|
|
224
|
+
[scan]
|
|
225
|
+
# Directories to exclude from scanning.
|
|
226
|
+
# Default: ["node_modules", ".git", "dist", "build", "library", "bin", "bundle"]
|
|
227
|
+
exclude = ["node_modules", ".git", "dist", "build", "library", "bin", "bundle"]
|
|
228
|
+
|
|
229
|
+
[project]
|
|
230
|
+
# Project name. Used in the root XDOCS.md and tree output.
|
|
231
|
+
name = "my-project"
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Agent Skills and Plugins
|
|
235
|
+
|
|
236
|
+
xdocs ships agent skill files that teach AI tools how to work with xdocs -- when to create, update, or regenerate documentation, how to use the CLI, and how to respect the configured AI behavior mode.
|
|
237
|
+
|
|
238
|
+
Supported tools:
|
|
239
|
+
|
|
240
|
+
| Tool | Plugin Format |
|
|
241
|
+
| ---------------- | ------------------------------------------------- |
|
|
242
|
+
| **OpenCode** | `SKILL.md` in the skills directory |
|
|
243
|
+
| **Claude Code** | `CLAUDE.md` in the project root or `.claude/` |
|
|
244
|
+
| **OpenAI Codex** | Instructions file in the tool's expected location |
|
|
245
|
+
| **Google Jules** | Instructions file in the tool's expected location |
|
|
246
|
+
|
|
247
|
+
`xdocs init` generates the correct file for your chosen tool. Multiple tools can be supported simultaneously.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## API Reference
|
|
252
|
+
|
|
253
|
+
xdocs exposes a fully-typed TypeScript API for programmatic use.
|
|
254
|
+
|
|
255
|
+
### Configuration
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
import { loadConfig, loadConfigOrDefaults, defaultConfig } from '@guiho/xdocs'
|
|
259
|
+
|
|
260
|
+
// Load config from xdocs.config.toml (throws if not found)
|
|
261
|
+
const config = await loadConfig({ cwd: process.cwd(), format: 'text', verbose: false })
|
|
262
|
+
|
|
263
|
+
// Load config or fall back to defaults
|
|
264
|
+
const configOrDefaults = await loadConfigOrDefaults({ cwd: process.cwd(), format: 'text', verbose: false })
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Discovery and Scanning
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
import { scanProject, scanDirectory, isXDocsFile } from '@guiho/xdocs'
|
|
271
|
+
|
|
272
|
+
// Scan the entire project
|
|
273
|
+
const result = await scanProject(config)
|
|
274
|
+
console.log(result.totalFiles) // Total files found
|
|
275
|
+
console.log(result.xdocsFiles) // Array of XDocsFile objects
|
|
276
|
+
console.log(result.uncoveredPaths) // Directories without xdocs coverage
|
|
277
|
+
|
|
278
|
+
// Check if a file is an xdocs file
|
|
279
|
+
isXDocsFile('auth.xdocs.md', ['.docs.md', '.xdocs.md']) // true
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Metadata Parsing
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
import { parseXDocsFile, extractFrontmatter, validateMetadata } from '@guiho/xdocs'
|
|
286
|
+
|
|
287
|
+
// Parse an xdocs file from disk
|
|
288
|
+
const file = await parseXDocsFile('/path/to/auth.xdocs.md', process.cwd())
|
|
289
|
+
console.log(file.metadata?.subject) // "authentication"
|
|
290
|
+
console.log(file.metadata?.description) // "Handles user login..."
|
|
291
|
+
console.log(file.valid) // true if metadata is complete
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Tree Operations
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
import { buildTree, renderTree, renderTreeMarkdown, validateTree } from '@guiho/xdocs'
|
|
298
|
+
|
|
299
|
+
// Build the hierarchy tree from scanned files
|
|
300
|
+
const tree = buildTree(result.xdocsFiles)
|
|
301
|
+
|
|
302
|
+
// Render as indented text
|
|
303
|
+
console.log(renderTree(tree))
|
|
304
|
+
|
|
305
|
+
// Render as Markdown
|
|
306
|
+
console.log(renderTreeMarkdown(tree))
|
|
307
|
+
|
|
308
|
+
// Validate tree integrity
|
|
309
|
+
const validation = validateTree(result.xdocsFiles)
|
|
310
|
+
console.log(validation.valid) // true if no orphans or cycles
|
|
311
|
+
console.log(validation.errors) // Array of error messages
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Prompts
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { getPrompt, getPromptNames } from '@guiho/xdocs'
|
|
318
|
+
|
|
319
|
+
// List all available prompt names
|
|
320
|
+
console.log(getPromptNames()) // ["write", "update", "agents", "generate"]
|
|
321
|
+
|
|
322
|
+
// Get a specific prompt
|
|
323
|
+
const prompt = getPrompt('write')
|
|
324
|
+
console.log(prompt?.description)
|
|
325
|
+
console.log(prompt?.body)
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Development
|
|
331
|
+
|
|
332
|
+
Development requires Bun. Run from the `xdocs/` directory:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
cd xdocs
|
|
336
|
+
bun install
|
|
337
|
+
bun run typecheck
|
|
338
|
+
bun test
|
|
339
|
+
bun run build
|
|
340
|
+
bun run binary
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
## License
|
|
346
|
+
|
|
347
|
+
MIT -- see [LICENSE.md](xdocs/LICENSE.md).
|
package/jsr.json
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiho/xdocs",
|
|
3
3
|
"description": "Structured documentation system for codebases. Helps AI make sense of projects.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./library/guiho-xdocs.js",
|
|
7
7
|
"types": "./library/guiho-xdocs.d.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
"README.md",
|
|
19
19
|
"library/",
|
|
20
|
+
"prompts/",
|
|
20
21
|
"docs/",
|
|
21
22
|
"jsr.json",
|
|
22
23
|
"CHANGELOG.md",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agents
|
|
3
|
+
description: Update AGENTS.md with xdocs instructions for AI agents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# xdocs: Update AGENTS.md
|
|
7
|
+
|
|
8
|
+
You are an AI assistant tasked with updating the AGENTS.md file to include xdocs instructions.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Read the existing AGENTS.md file.
|
|
13
|
+
2. Check if there is already an xdocs section (between `<!-- BEGIN XDOCS -->` and `<!-- END XDOCS -->` markers).
|
|
14
|
+
3. If the section exists, update it with the current xdocs configuration.
|
|
15
|
+
4. If the section does not exist, add it at the end of the file.
|
|
16
|
+
5. The xdocs section should instruct AI agents to:
|
|
17
|
+
- Read XDOCS.md and xdocs files when entering the project
|
|
18
|
+
- Respect the configured AI behavior mode (prompt or auto)
|
|
19
|
+
- Use the xdocs CLI for documentation operations
|
|
20
|
+
- Maintain xdocs files when modifying code
|
|
21
|
+
- Follow the metadata schema for frontmatter
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generate
|
|
3
|
+
description: Generate comprehensive documentation for a domain or entire project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# xdocs: Generate Comprehensive Documentation
|
|
7
|
+
|
|
8
|
+
You are an AI assistant tasked with generating comprehensive documentation for a domain or the entire project.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Scan all xdocs files in the target scope (directory or project).
|
|
13
|
+
2. Read every source file in the scope.
|
|
14
|
+
3. Build a complete understanding of:
|
|
15
|
+
- The module hierarchy
|
|
16
|
+
- The purpose of each module
|
|
17
|
+
- How modules relate to each other
|
|
18
|
+
- What each file does
|
|
19
|
+
4. Generate a single comprehensive Markdown document that includes:
|
|
20
|
+
- Project or domain overview
|
|
21
|
+
- Complete hierarchy tree
|
|
22
|
+
- Detailed description of each module
|
|
23
|
+
- File listings with descriptions
|
|
24
|
+
- Cross-references between related modules
|
|
25
|
+
5. The output should be a self-contained document that fully describes the scope.
|
|
26
|
+
6. Use clear headings, consistent formatting, and concise language.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update
|
|
3
|
+
description: Update existing xdocs files after code changes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# xdocs: Update Documentation
|
|
7
|
+
|
|
8
|
+
You are an AI assistant tasked with updating existing xdocs documentation after code changes.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Identify which files have changed in the recent modifications.
|
|
13
|
+
2. Find the xdocs files that document the directories containing those changes.
|
|
14
|
+
3. For each affected xdocs file:
|
|
15
|
+
a. Re-read the files listed in the metadata to check if descriptions are still accurate.
|
|
16
|
+
b. Check if new files were added that need to be listed.
|
|
17
|
+
c. Check if files were removed that should be unlisted.
|
|
18
|
+
d. Update the description if the module's purpose has changed.
|
|
19
|
+
e. Update children if subdirectories were added or removed.
|
|
20
|
+
f. Update the body content if significant changes occurred.
|
|
21
|
+
4. Preserve the existing structure and style of the xdocs file.
|
|
22
|
+
5. Do not remove information that is still accurate.
|
|
23
|
+
|
|
24
|
+
## Checklist
|
|
25
|
+
|
|
26
|
+
- [ ] All new files are listed in the files metadata
|
|
27
|
+
- [ ] Removed files are no longer listed
|
|
28
|
+
- [ ] File descriptions are accurate
|
|
29
|
+
- [ ] Module description reflects current state
|
|
30
|
+
- [ ] Children list matches actual subdirectories
|
|
31
|
+
- [ ] Parent reference is still correct
|
package/prompts/write.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: write
|
|
3
|
+
description: Scan a directory and write a new xdocs documentation file for it.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# xdocs: Write Documentation
|
|
7
|
+
|
|
8
|
+
You are an AI assistant tasked with writing xdocs documentation for a directory/module.
|
|
9
|
+
|
|
10
|
+
## Instructions
|
|
11
|
+
|
|
12
|
+
1. Scan the target directory and all its subdirectories.
|
|
13
|
+
2. Read every source file to understand what it does.
|
|
14
|
+
3. Identify the purpose of this module/directory.
|
|
15
|
+
4. Create an xdocs file with YAML frontmatter containing:
|
|
16
|
+
- subject: A short identifier for this module
|
|
17
|
+
- description: A concise description of what this module does
|
|
18
|
+
- parent: The parent module's subject (or null if this is a root module)
|
|
19
|
+
- children: List of child module subjects
|
|
20
|
+
- files: Map of filename to short description for each file
|
|
21
|
+
- tags: Relevant tags (empty array if none)
|
|
22
|
+
- flags: Relevant flags (empty array if none)
|
|
23
|
+
5. Write a Markdown body below the frontmatter with:
|
|
24
|
+
- An overview section explaining the module in more detail
|
|
25
|
+
- Usage examples if relevant
|
|
26
|
+
- Any important notes or caveats
|
|
27
|
+
6. Name the file as `<module-name>.xdocs.md` in the target directory.
|
|
28
|
+
|
|
29
|
+
## Frontmatter Template
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
---
|
|
33
|
+
subject: module-name
|
|
34
|
+
description: What this module does in one sentence.
|
|
35
|
+
parent: parent-module
|
|
36
|
+
children:
|
|
37
|
+
- child-a
|
|
38
|
+
- child-b
|
|
39
|
+
files:
|
|
40
|
+
- file-a.ts: What file-a does.
|
|
41
|
+
- file-b.ts: What file-b does.
|
|
42
|
+
tags: []
|
|
43
|
+
flags: []
|
|
44
|
+
---
|
|
45
|
+
```
|