docutrack 0.1.0 → 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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 novolabs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,116 +1,165 @@
1
+ <div align="center">
2
+
1
3
  # DocuTrack
2
4
 
3
- **Plugin de Claude Code que documenta automáticamente lo que construyes.**
5
+ **Your AI agent writes code. DocuTrack makes sure it documents what it builds.**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/docutrack?color=6366f1&label=npm)](https://www.npmjs.com/package/docutrack)
8
+ [![License: MIT](https://img.shields.io/badge/license-MIT-6366f1)](LICENSE)
9
+ [![Node.js](https://img.shields.io/badge/node-%3E%3D18-6366f1)](https://nodejs.org)
10
+
11
+ </div>
12
+
13
+ ---
14
+
15
+ ## The problem
16
+
17
+ Claude Code edits 30 files in a session. When it's done, none of them have updated documentation. You end up with a codebase that works but no one understands — including you, three months later.
18
+
19
+ ## The solution
4
20
 
5
- DocuTrack engancha los lifecycle hooks de Claude Code para registrar cada archivo modificado y generar documentación técnica en tiempo realsin interrumpir tu flujo de trabajo.
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.
6
22
 
7
23
  ---
8
24
 
9
- ## Instalación
25
+ ## Install once, use everywhere
10
26
 
11
27
  ```bash
12
- npx docutrack init
28
+ npm install -g docutrack
29
+ docutrack install-global
13
30
  ```
14
31
 
15
- Detecta tu stack automáticamente (Next.js, FastAPI, Express, Go, monorepo) y configura todo en segundos.
32
+ `install-global` does two things:
33
+
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
36
+
37
+ After this, you never think about DocuTrack again — Claude handles the rest.
16
38
 
17
39
  ---
18
40
 
19
- ## ¿Qué hace?
41
+ ## How it works per project
20
42
 
21
- - **Hook PostToolUse**cada vez que Claude edita un archivo, lo encola automáticamente
22
- - **Hook Stop** — al terminar la sesión, el subagente `documentalista` genera los docs de todo lo pendiente
23
- - **Visor web** — interfaz tipo Notion en `localhost:4242` con sidebar, renderizado Markdown, API Explorer interactivo y Health Check
24
- - **Generación con IA** — escanea proyectos existentes y genera toda la documentación con un clic desde el visor
25
- - **Sin dependencias** — llama a la API de Anthropic directo via `https` nativo de Node.js
43
+ ### The recommended flow let Claude do it
26
44
 
27
- ---
45
+ Open any project in Claude Code and ask:
46
+
47
+ > *"Build me an inventory API and use docutrack for documentation"*
28
48
 
29
- ## Uso rápido
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`
55
+
56
+ ### The manual flow — you control the init
30
57
 
31
58
  ```bash
32
- # Inicializar en tu proyecto
33
- npx docutrack init
59
+ cd my-project
60
+ docutrack init # interactive questionnaire in the terminal
61
+ ```
34
62
 
35
- # Abrir el visor de documentación
36
- docutrack serve
63
+ Then open Claude Code. It reads `CLAUDE.md`, sees pending files, and documents everything without being asked.
37
64
 
38
- # Escanear un proyecto existente y generar docs
39
- # → Usar el botón "Regenerar docs" en el visor
65
+ ---
40
66
 
41
- # Ver estado de cobertura
42
- docutrack status
67
+ ## The questionnaire
43
68
 
44
- # Health check completo (drift, complejidad, stale)
45
- docutrack check
46
- ```
69
+ Whether run interactively or via Claude, DocuTrack asks four questions before setting up:
70
+
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` |
77
+
78
+ These preferences are saved to `docutrack.config.json` and used by every documentation run.
47
79
 
48
80
  ---
49
81
 
50
- ## Comandos
82
+ ## What gets generated
51
83
 
52
- | Comando | Descripción |
53
- |---------|-------------|
54
- | `docutrack init` | Inicializa DocuTrack en el proyecto actual |
55
- | `docutrack serve` | Abre el visor web en el puerto 4242 |
56
- | `docutrack scan` | Encola todos los archivos fuente existentes |
57
- | `docutrack status` | Muestra cobertura, pendientes y docs desactualizados |
58
- | `docutrack check` | Health check: drift, complejidad, stale |
59
- | `docutrack analyze` | Detecta rutas y genera `docs/api/openapi.json` |
60
- | `docutrack onboard` | Genera `docs/ONBOARDING.md` |
61
- | `docutrack export` | Exporta a Mintlify o Docusaurus |
62
- | `docutrack badge` | Genera badge SVG de cobertura |
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
92
+ ```
63
93
 
64
94
  ---
65
95
 
66
- ## Templates soportados
96
+ ## The web viewer
67
97
 
68
- Detección automática o manual con `--template`:
98
+ `docutrack serve` opens a local documentation browser at `http://localhost:4242`:
69
99
 
70
- - `nextjs` Next.js App Router
71
- - `fastapi` Python FastAPI
72
- - `express` Node.js Express / Fastify
73
- - `monorepo` — Turborepo / pnpm workspaces
74
- - `go`Go modules
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
75
105
 
76
106
  ---
77
107
 
78
- ## Estructura generada
108
+ ## Commands
79
109
 
80
- ```
81
- docs/
82
- ├── modules/ ← un .md por módulo/componente
83
- ├── api/ ← docs de rutas API + openapi.json
84
- └── decisions/ ← Architecture Decision Records (ADRs)
85
- ARCHITECTURE.md ← vista general del proyecto (auto-generada con IA)
86
- ```
110
+ | Command | Description |
111
+ |---------|-------------|
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` |
117
+ | `docutrack scan` | Queue all existing source files for documentation |
118
+ | `docutrack scan --dry-run` | Preview what would be queued |
119
+ | `docutrack status` | Show coverage, pending files, and stale docs |
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 |
87
128
 
88
129
  ---
89
130
 
90
- ## Visor web
131
+ ## Stack templates
132
+
133
+ DocuTrack auto-detects your stack from `package.json`, `go.mod`, etc.
91
134
 
92
135
  ```bash
93
- docutrack serve
94
- # http://localhost:4242
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
95
141
  ```
96
142
 
97
- Incluye:
98
- - Sidebar con todos los módulos, decisiones y rutas API
99
- - **API Explorer** interactivo estilo Swagger
100
- - **Health Check**: drift de código vs docs, mapa de complejidad
101
- - **Generación desde la UI**: escanea y documenta sin abrir la terminal
102
- - Toggle de idioma Español / English
143
+ ---
144
+
145
+ ## How the hooks work
146
+
147
+ DocuTrack registers two hooks globally (via `install-global`) and per-project (via `init`):
148
+
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
151
+
152
+ The global hooks silently skip projects that haven't been initialized. No noise in other projects.
103
153
 
104
154
  ---
105
155
 
106
- ## Requisitos
156
+ ## Requirements
107
157
 
108
158
  - Node.js 18+
109
- - Claude Code CLI
110
- - `ANTHROPIC_API_KEY` en el entorno o en `.env.local` (solo para generación con IA)
159
+ - [Claude Code](https://claude.ai/code)
111
160
 
112
161
  ---
113
162
 
114
- ## Licencia
163
+ ## License
115
164
 
116
- MIT [mnovoaq](https://github.com/mnovoaq)
165
+ MIT © [novolabs](https://github.com/mnovoaq)
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,38 +1,40 @@
1
- {
2
- "name": "docutrack",
3
- "version": "0.1.0",
4
- "description": "Claude Code plugin that forces AI agents to document what they build automatically.",
5
- "keywords": [
6
- "claude-code",
7
- "claude",
8
- "documentation",
9
- "ai-agents",
10
- "architecture",
11
- "developer-tools"
12
- ],
13
- "license": "MIT",
14
- "type": "commonjs",
15
- "main": "./bin/docutrack.js",
16
- "bin": {
17
- "docutrack": "bin/docutrack.js"
18
- },
19
- "files": [
20
- "bin/",
21
- "src/",
22
- "templates/"
23
- ],
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/mnovoaq/docutrack.git"
27
- },
28
- "homepage": "https://github.com/mnovoaq/docutrack#readme",
29
- "bugs": {
30
- "url": "https://github.com/mnovoaq/docutrack/issues"
31
- },
32
- "engines": {
33
- "node": ">=18.0.0"
34
- },
35
- "scripts": {
36
- "test": "node --test src/**/*.test.js"
37
- }
38
- }
1
+ {
2
+ "name": "docutrack",
3
+ "version": "0.1.6",
4
+ "description": "Claude Code plugin your AI agent writes code, DocuTrack documents it automatically.",
5
+ "keywords": [
6
+ "claude-code",
7
+ "claude",
8
+ "documentation",
9
+ "ai-agents",
10
+ "architecture",
11
+ "developer-tools",
12
+ "living-docs",
13
+ "docutrack"
14
+ ],
15
+ "license": "MIT",
16
+ "type": "commonjs",
17
+ "main": "./bin/docutrack.js",
18
+ "bin": {
19
+ "docutrack": "bin/docutrack.js"
20
+ },
21
+ "files": [
22
+ "bin/",
23
+ "src/",
24
+ "templates/"
25
+ ],
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/mnovoaq/docutrack.git"
29
+ },
30
+ "homepage": "https://github.com/mnovoaq/docutrack#readme",
31
+ "bugs": {
32
+ "url": "https://github.com/mnovoaq/docutrack/issues"
33
+ },
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ },
37
+ "scripts": {
38
+ "test": "node --test src/utils/queue.test.js src/viewer/server.test.js"
39
+ }
40
+ }