@guiho/xdocs 0.1.2 → 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/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiho/xdocs",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "exports": "./source/guiho-xdocs.ts",
5
5
  "publish": {
6
6
  "include": [
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.2",
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
@@ -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
+ ```