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 +21 -0
- package/README.md +114 -65
- package/bin/docutrack.js +73 -67
- package/package.json +40 -38
- package/src/commands/init.js +245 -80
- package/src/commands/install-global.js +93 -0
- package/src/commands/scan.js +3 -15
- package/src/commands/setup.js +126 -0
- package/src/hooks/global-on-stop.js +18 -0
- package/src/hooks/global-post-tool-use.js +25 -0
- package/src/utils/daemon.js +48 -0
- package/src/utils/queue.js +11 -10
- package/src/utils/queue.test.js +54 -0
- package/src/viewer/index.html +1545 -1411
- package/src/viewer/server.js +383 -652
- package/src/viewer/server.test.js +50 -0
- package/templates/agents/documentalista.md +47 -28
- package/templates/claude-snippet.md +53 -39
- package/templates/hooks/on-stop.js +59 -11
- package/templates/hooks/post-tool-use.js +12 -8
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
|
-
**
|
|
5
|
+
**Your AI agent writes code. DocuTrack makes sure it documents what it builds.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/docutrack)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](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
|
|
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
|
-
##
|
|
25
|
+
## Install once, use everywhere
|
|
10
26
|
|
|
11
27
|
```bash
|
|
12
|
-
|
|
28
|
+
npm install -g docutrack
|
|
29
|
+
docutrack install-global
|
|
13
30
|
```
|
|
14
31
|
|
|
15
|
-
|
|
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
|
-
##
|
|
41
|
+
## How it works per project
|
|
20
42
|
|
|
21
|
-
|
|
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
|
-
|
|
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
|
-
|
|
33
|
-
|
|
59
|
+
cd my-project
|
|
60
|
+
docutrack init # interactive questionnaire in the terminal
|
|
61
|
+
```
|
|
34
62
|
|
|
35
|
-
|
|
36
|
-
docutrack serve
|
|
63
|
+
Then open Claude Code. It reads `CLAUDE.md`, sees pending files, and documents everything without being asked.
|
|
37
64
|
|
|
38
|
-
|
|
39
|
-
# → Usar el botón "Regenerar docs" en el visor
|
|
65
|
+
---
|
|
40
66
|
|
|
41
|
-
|
|
42
|
-
docutrack status
|
|
67
|
+
## The questionnaire
|
|
43
68
|
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
##
|
|
82
|
+
## What gets generated
|
|
51
83
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
##
|
|
96
|
+
## The web viewer
|
|
67
97
|
|
|
68
|
-
|
|
98
|
+
`docutrack serve` opens a local documentation browser at `http://localhost:4242`:
|
|
69
99
|
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
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
|
-
##
|
|
108
|
+
## Commands
|
|
79
109
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
##
|
|
131
|
+
## Stack templates
|
|
132
|
+
|
|
133
|
+
DocuTrack auto-detects your stack from `package.json`, `go.mod`, etc.
|
|
91
134
|
|
|
92
135
|
```bash
|
|
93
|
-
docutrack
|
|
94
|
-
#
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
-
##
|
|
156
|
+
## Requirements
|
|
107
157
|
|
|
108
158
|
- Node.js 18+
|
|
109
|
-
- Claude Code
|
|
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
|
-
##
|
|
163
|
+
## License
|
|
115
164
|
|
|
116
|
-
MIT
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
docutrack
|
|
28
|
-
docutrack
|
|
29
|
-
docutrack
|
|
30
|
-
docutrack
|
|
31
|
-
|
|
32
|
-
docutrack
|
|
33
|
-
docutrack
|
|
34
|
-
docutrack
|
|
35
|
-
docutrack
|
|
36
|
-
docutrack
|
|
37
|
-
docutrack
|
|
38
|
-
docutrack
|
|
39
|
-
docutrack
|
|
40
|
-
docutrack
|
|
41
|
-
docutrack
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
--
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
console.
|
|
61
|
-
process.exit(
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
handler
|
|
65
|
-
|
|
66
|
-
|
|
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.
|
|
4
|
-
"description": "Claude Code plugin
|
|
5
|
-
"keywords": [
|
|
6
|
-
"claude-code",
|
|
7
|
-
"claude",
|
|
8
|
-
"documentation",
|
|
9
|
-
"ai-agents",
|
|
10
|
-
"architecture",
|
|
11
|
-
"developer-tools"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
}
|