docutrack 0.1.1 → 0.1.6

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 CHANGED
@@ -7,7 +7,6 @@
7
7
  [![npm version](https://img.shields.io/npm/v/docutrack?color=6366f1&label=npm)](https://www.npmjs.com/package/docutrack)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-6366f1)](LICENSE)
9
9
  [![Node.js](https://img.shields.io/badge/node-%3E%3D18-6366f1)](https://nodejs.org)
10
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-6366f1)](CONTRIBUTING.md)
11
10
 
12
11
  </div>
13
12
 
@@ -19,139 +18,145 @@ Claude Code edits 30 files in a session. When it's done, none of them have updat
19
18
 
20
19
  ## The solution
21
20
 
22
- DocuTrack hooks into Claude Code's lifecycle events to automatically queue every modified file and generate technical documentation using AIwithout interrupting your workflow.
21
+ DocuTrack hooks into Claude Code's lifecycle to automatically track every file your AI agent touches. When the session ends, a specialized subagent documents everything in your language, at your preferred depth.
22
+
23
+ ---
24
+
25
+ ## Install once, use everywhere
23
26
 
24
27
  ```bash
25
- npx docutrack init
28
+ npm install -g docutrack
29
+ docutrack install-global
26
30
  ```
27
31
 
28
- That's it. From that point on, every file your AI agent touches gets documented.
32
+ `install-global` does two things:
29
33
 
30
- ---
34
+ 1. Registers global PostToolUse and Stop hooks in `~/.claude/settings.json` — active in every Claude Code session from now on
35
+ 2. Writes a `~/.claude/CLAUDE.md` snippet that teaches Claude how to set up DocuTrack for any project
31
36
 
32
- ## How it works
37
+ After this, you never think about DocuTrack again — Claude handles the rest.
33
38
 
34
- ```
35
- Claude edits a file
36
-
37
- PostToolUse hook fires → file added to .docutrack/queue.json
38
-
39
- Session ends → documentalista subagent runs
40
-
41
- Docs written to docs/modules/ and docs/api/
42
-
43
- docutrack serve → beautiful web viewer at localhost:4242
44
- ```
39
+ ---
45
40
 
46
- DocuTrack installs two hooks in your Claude Code settings:
41
+ ## How it works per project
47
42
 
48
- - **PostToolUse** fires after every file edit, queues the file
49
- - **Stop** — fires at end of session, triggers the documentalista subagent
43
+ ### The recommended flow let Claude do it
50
44
 
51
- ---
45
+ Open any project in Claude Code and ask:
52
46
 
53
- ## Web viewer
47
+ > *"Build me an inventory API and use docutrack for documentation"*
54
48
 
55
- Run `docutrack serve` to open a Notion-like documentation viewer at `http://localhost:4242`:
49
+ Claude will:
50
+ 1. Ask you four quick questions in the chat (in your language)
51
+ 2. Run `docutrack init --lang=… --description="…" --audience=… --depth=…`
52
+ 3. Build your project — every file created is queued automatically via the global hooks
53
+ 4. At session end, run the documentalista subagent to write all docs
54
+ 5. Start the viewer at `http://localhost:4242`
56
55
 
57
- - **Modules** auto-generated docs for every source file
58
- - **Architecture** — AI-generated overview of your tech stack, structure, and data flow
59
- - **API Explorer** — interactive Swagger-like explorer built from your route files
60
- - **Decisions** — Architecture Decision Records (ADRs)
61
- - **Health Check** — drift analysis, complexity heatmap, stale doc detection
62
- - **Multilingual** — generates docs in Spanish or English, switchable from the UI
56
+ ### The manual flow you control the init
63
57
 
64
- ### Bootstrapping an existing project
58
+ ```bash
59
+ cd my-project
60
+ docutrack init # interactive questionnaire in the terminal
61
+ ```
65
62
 
66
- Already have a codebase? No problem. Open the viewer and click **"✨ Regenerate docs"** — DocuTrack scans all your source files and generates documentation for everything, no terminal needed.
63
+ Then open Claude Code. It reads `CLAUDE.md`, sees pending files, and documents everything without being asked.
67
64
 
68
65
  ---
69
66
 
70
- ## Quick start
67
+ ## The questionnaire
71
68
 
72
- ```bash
73
- # Initialize in your project
74
- npx docutrack init
69
+ Whether run interactively or via Claude, DocuTrack asks four questions before setting up:
75
70
 
76
- # Open the documentation viewer
77
- docutrack serve
78
- # http://localhost:4242
71
+ | Question | Options |
72
+ |----------|---------|
73
+ | Documentation language | Spanish, English, or any other |
74
+ | Project description | One sentence |
75
+ | Who reads the docs | `team` · `onboarding` · `mixed` |
76
+ | Documentation depth | `concise` · `standard` · `detailed` |
79
77
 
80
- # Check documentation health
81
- docutrack check
82
- ```
78
+ These preferences are saved to `docutrack.config.json` and used by every documentation run.
79
+
80
+ ---
83
81
 
84
- To use AI generation, set your Anthropic API key:
82
+ ## What gets generated
85
83
 
86
- ```bash
87
- export ANTHROPIC_API_KEY=sk-ant-...
88
- # or add it to .env.local in your project
84
+ ```
85
+ docs/
86
+ ├── modules/ ← one .md per source file
87
+ │ responsibility · public API · dependencies · data shapes · notes
88
+ ├── api/ ← one .md per API router + openapi.json
89
+ ├── decisions/ ← Architecture Decision Records (ADRs)
90
+ └── ONBOARDING.md ← assembled guide for new team members
91
+ ARCHITECTURE.md ← tech stack · module map · data flow · env vars
89
92
  ```
90
93
 
91
94
  ---
92
95
 
96
+ ## The web viewer
97
+
98
+ `docutrack serve` opens a local documentation browser at `http://localhost:4242`:
99
+
100
+ - Browse modules, API docs, decisions, and architecture in one place
101
+ - Full-text search with `Cmd/Ctrl+K`
102
+ - Mermaid diagram rendering
103
+ - Dark/light mode
104
+ - Persistent URLs — reload lands on the same page
105
+
106
+ ---
107
+
93
108
  ## Commands
94
109
 
95
110
  | Command | Description |
96
111
  |---------|-------------|
97
- | `docutrack init` | Initialize DocuTrack in the current project |
98
- | `docutrack serve` | Open the web viewer at port 4242 |
112
+ | `docutrack install-global` | **One-time setup** registers global hooks and Claude instructions |
113
+ | `docutrack init` | Initialize DocuTrack in a project (interactive questionnaire) |
114
+ | `docutrack init --lang=es --description="…" --audience=team --depth=standard` | Non-interactive init (used by Claude Code) |
115
+ | `docutrack init --template <name>` | Init with a specific stack template |
116
+ | `docutrack serve` | Open the web viewer at `http://localhost:4242` |
99
117
  | `docutrack scan` | Queue all existing source files for documentation |
118
+ | `docutrack scan --dry-run` | Preview what would be queued |
100
119
  | `docutrack status` | Show coverage, pending files, and stale docs |
101
- | `docutrack check` | Full health check: drift, complexity, stale |
102
- | `docutrack analyze` | Auto-detect routes and generate `docs/api/openapi.json` |
103
- | `docutrack onboard` | Generate `docs/ONBOARDING.md` for new team members |
104
- | `docutrack export` | Export to Mintlify or Docusaurus format |
105
- | `docutrack badge` | Generate coverage badge SVG for your README |
120
+ | `docutrack status --json` | Machine-readable output for CI |
121
+ | `docutrack clear` | Clear the documentation queue |
122
+ | `docutrack check` | Full health check: drift, complexity, stale docs |
123
+ | `docutrack analyze` | Scan routes and generate `docs/api/openapi.json` |
124
+ | `docutrack onboard` | Generate `docs/ONBOARDING.md` |
125
+ | `docutrack badge` | Generate a coverage badge SVG |
126
+ | `docutrack export --format mintlify` | Export docs to Mintlify format |
127
+ | `docutrack export --format docusaurus` | Export docs to Docusaurus format |
106
128
 
107
129
  ---
108
130
 
109
131
  ## Stack templates
110
132
 
111
- DocuTrack auto-detects your stack from `package.json`, `go.mod`, etc. You can also specify it manually:
133
+ DocuTrack auto-detects your stack from `package.json`, `go.mod`, etc.
112
134
 
113
135
  ```bash
114
- docutrack init --template nextjs # Next.js App Router
115
- docutrack init --template fastapi # Python FastAPI
116
- docutrack init --template express # Node.js Express / Fastify
117
- docutrack init --template monorepo # Turborepo / pnpm workspaces
118
- docutrack init --template go # Go modules
136
+ docutrack init --template nextjs # Next.js App Router
137
+ docutrack init --template fastapi # Python FastAPI
138
+ docutrack init --template express # Node.js Express / Fastify / Koa
139
+ docutrack init --template monorepo # Turborepo / pnpm workspaces
140
+ docutrack init --template go # Go modules
119
141
  ```
120
142
 
121
- Each template ships with a stack-specific `documentalista` subagent that understands your framework's conventions.
122
-
123
143
  ---
124
144
 
125
- ## What gets generated
145
+ ## How the hooks work
126
146
 
127
- ```
128
- docs/
129
- ├── modules/ ← one .md per source file (responsibility, exports, dependencies)
130
- ├── api/ ← one .md per API route + openapi.json
131
- └── decisions/ ← Architecture Decision Records
132
- ARCHITECTURE.md ← AI-generated: tech stack, app structure, data flow, module map
133
- docs/ONBOARDING.md ← AI-generated: setup guide, conventions, key modules
134
- ```
135
-
136
- ---
147
+ DocuTrack registers two hooks globally (via `install-global`) and per-project (via `init`):
137
148
 
138
- ## Zero dependencies
149
+ - **PostToolUse** — fires after every Write/Edit, adds the file to `.docutrack/queue.json`
150
+ - **Stop** — fires when the session ends; scans for any files that were missed, then prompts Claude to run the documentalista
139
151
 
140
- DocuTrack calls the Anthropic API directly using Node.js built-in `https` no SDK, no extra packages to install, nothing added to your `node_modules`.
152
+ The global hooks silently skip projects that haven't been initialized. No noise in other projects.
141
153
 
142
154
  ---
143
155
 
144
156
  ## Requirements
145
157
 
146
158
  - Node.js 18+
147
- - [Claude Code](https://claude.ai/code) CLI
148
- - `ANTHROPIC_API_KEY` (only required for AI doc generation)
149
-
150
- ---
151
-
152
- ## Contributing
153
-
154
- Contributions are welcome. Read [CONTRIBUTING.md](CONTRIBUTING.md) to get started.
159
+ - [Claude Code](https://claude.ai/code)
155
160
 
156
161
  ---
157
162
 
package/bin/docutrack.js CHANGED
@@ -1,67 +1,73 @@
1
- #!/usr/bin/env node
2
-
3
- 'use strict'
4
-
5
- const [, , command, ...args] = process.argv
6
-
7
- const commands = {
8
- init: () => require('../src/commands/init'),
9
- serve: () => require('../src/commands/serve'),
10
- analyze: () => require('../src/commands/analyze'),
11
- status: () => require('../src/commands/status'),
12
- clear: () => require('../src/commands/clear'),
13
- badge: () => require('../src/commands/badge'),
14
- export: () => require('../src/commands/export'),
15
- check: () => require('../src/commands/check'),
16
- onboard: () => require('../src/commands/onboard'),
17
- scan: () => require('../src/commands/scan'),
18
- }
19
-
20
- if (!command || command === '--help' || command === '-h') {
21
- console.log(`
22
- docutrack Claude Code documentation plugin
23
-
24
- Usage:
25
- npx docutrack init Initialize DocuTrack in the current project
26
- docutrack init --template <name> Init with a specific stack template
27
- docutrack serve Start the documentation web viewer (port 4242)
28
- docutrack analyze Scan routes and generate docs/api/openapi.json
29
- docutrack status Show coverage, pending files, and stale docs
30
- docutrack status --json Machine-readable output for CI
31
- docutrack badge Generate docs/badge.svg for your README
32
- docutrack clear Clear the documentation queue
33
- docutrack export --format mintlify Export docs to Mintlify format
34
- docutrack export --format docusaurus Export docs to Docusaurus format
35
- docutrack export --format <f> --out <dir> Export to a custom output directory
36
- docutrack check Full health: drift, complexity, stale docs
37
- docutrack check --json Machine-readable health report for CI
38
- docutrack onboard Generate docs/ONBOARDING.md
39
- docutrack onboard --force Regenerate ONBOARDING.md
40
- docutrack scan Queue ALL existing source files for initial documentation
41
- docutrack scan --dry-run Preview what would be queued
42
-
43
- Templates (auto-detected from project files):
44
- nextjs, fastapi, express, monorepo, go
45
-
46
- Options:
47
- --help, -h Show this help message
48
- --version, -v Show version
49
- `)
50
- process.exit(0)
51
- }
52
-
53
- if (command === '--version' || command === '-v') {
54
- console.log(require('../package.json').version)
55
- process.exit(0)
56
- }
57
-
58
- const handler = commands[command]
59
- if (!handler) {
60
- console.error(`Unknown command: ${command}\nRun "docutrack --help" for usage.`)
61
- process.exit(1)
62
- }
63
-
64
- handler().run(args).catch(err => {
65
- console.error(`\nError: ${err.message}`)
66
- process.exit(1)
67
- })
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict'
4
+
5
+ const [, , command, ...args] = process.argv
6
+
7
+ const commands = {
8
+ 'install-global': () => require('../src/commands/install-global'),
9
+ setup: () => require('../src/commands/setup'),
10
+ init: () => require('../src/commands/init'),
11
+ serve: () => require('../src/commands/serve'),
12
+ analyze: () => require('../src/commands/analyze'),
13
+ status: () => require('../src/commands/status'),
14
+ clear: () => require('../src/commands/clear'),
15
+ badge: () => require('../src/commands/badge'),
16
+ export: () => require('../src/commands/export'),
17
+ check: () => require('../src/commands/check'),
18
+ onboard: () => require('../src/commands/onboard'),
19
+ scan: () => require('../src/commands/scan'),
20
+ }
21
+
22
+ if (!command || command === '--help' || command === '-h') {
23
+ console.log(`
24
+ docutrack — Claude Code documentation plugin
25
+
26
+ Usage:
27
+ docutrack install-global Install hooks globally run once after npm install
28
+ docutrack setup One-command setup: init + scan + start viewer
29
+ docutrack init Initialize DocuTrack (runs interactive questionnaire)
30
+ docutrack init --lang=es --description="<desc>" --audience=team --depth=standard
31
+ Non-interactive init (for Claude Code or CI)
32
+ docutrack init --template <name> Init with a specific stack template
33
+ docutrack serve Start the documentation web viewer (port 4242)
34
+ docutrack analyze Scan routes and generate docs/api/openapi.json
35
+ docutrack status Show coverage, pending files, and stale docs
36
+ docutrack status --json Machine-readable output for CI
37
+ docutrack badge Generate docs/badge.svg for your README
38
+ docutrack clear Clear the documentation queue
39
+ docutrack export --format mintlify Export docs to Mintlify format
40
+ docutrack export --format docusaurus Export docs to Docusaurus format
41
+ docutrack export --format <f> --out <dir> Export to a custom output directory
42
+ docutrack check Full health: drift, complexity, stale docs
43
+ docutrack check --json Machine-readable health report for CI
44
+ docutrack onboard Generate docs/ONBOARDING.md
45
+ docutrack onboard --force Regenerate ONBOARDING.md
46
+ docutrack scan Queue ALL existing source files for initial documentation
47
+ docutrack scan --dry-run Preview what would be queued
48
+
49
+ Templates (auto-detected from project files):
50
+ nextjs, fastapi, express, monorepo, go
51
+
52
+ Options:
53
+ --help, -h Show this help message
54
+ --version, -v Show version
55
+ `)
56
+ process.exit(0)
57
+ }
58
+
59
+ if (command === '--version' || command === '-v') {
60
+ console.log(require('../package.json').version)
61
+ process.exit(0)
62
+ }
63
+
64
+ const handler = commands[command]
65
+ if (!handler) {
66
+ console.error(`Unknown command: ${command}\nRun "docutrack --help" for usage.`)
67
+ process.exit(1)
68
+ }
69
+
70
+ handler().run(args).catch(err => {
71
+ console.error(`\nError: ${err.message}`)
72
+ process.exit(1)
73
+ })
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "docutrack",
3
- "version": "0.1.1",
4
- "description": "Claude Code plugin that forces AI agents to document what they build automatically.",
3
+ "version": "0.1.6",
4
+ "description": "Claude Code plugin your AI agent writes code, DocuTrack documents it automatically.",
5
5
  "keywords": [
6
6
  "claude-code",
7
7
  "claude",
8
8
  "documentation",
9
9
  "ai-agents",
10
10
  "architecture",
11
- "developer-tools"
11
+ "developer-tools",
12
+ "living-docs",
13
+ "docutrack"
12
14
  ],
13
15
  "license": "MIT",
14
16
  "type": "commonjs",