@theglitchking/hit-em-with-the-docs 2.0.0 → 2.0.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +7 -100
- package/LICENSE +0 -0
- package/MIGRATION.md +0 -0
- package/README.backup.md +0 -0
- package/README.md +1197 -479
- package/action.yml +0 -0
- package/dist/action/action/index.d.ts +0 -0
- package/dist/action/action/index.d.ts.map +1 -1
- package/dist/action/cli/index.d.ts +0 -0
- package/dist/action/cli/index.d.ts.map +1 -1
- package/dist/action/core/audit/auditor.d.ts +0 -0
- package/dist/action/core/audit/auditor.d.ts.map +1 -1
- package/dist/action/core/audit/rules.d.ts +0 -0
- package/dist/action/core/audit/rules.d.ts.map +1 -1
- package/dist/action/core/discover/antipatterns.d.ts +0 -0
- package/dist/action/core/discover/antipatterns.d.ts.map +1 -1
- package/dist/action/core/discover/dependencies.d.ts +0 -0
- package/dist/action/core/discover/dependencies.d.ts.map +1 -1
- package/dist/action/core/discover/patterns.d.ts +0 -0
- package/dist/action/core/discover/patterns.d.ts.map +1 -1
- package/dist/action/core/discover/standards.d.ts +0 -0
- package/dist/action/core/discover/standards.d.ts.map +1 -1
- package/dist/action/core/domains/classifier.d.ts +0 -0
- package/dist/action/core/domains/classifier.d.ts.map +1 -1
- package/dist/action/core/domains/constants.d.ts +0 -0
- package/dist/action/core/domains/constants.d.ts.map +1 -1
- package/dist/action/core/domains/detector.d.ts +0 -0
- package/dist/action/core/domains/detector.d.ts.map +1 -1
- package/dist/action/core/integrate/integrator.d.ts +0 -0
- package/dist/action/core/integrate/integrator.d.ts.map +1 -1
- package/dist/action/core/links/checker.d.ts +0 -0
- package/dist/action/core/links/checker.d.ts.map +1 -1
- package/dist/action/core/links/tracker.d.ts +0 -0
- package/dist/action/core/links/tracker.d.ts.map +1 -1
- package/dist/action/core/maintain/orchestrator.d.ts +0 -0
- package/dist/action/core/maintain/orchestrator.d.ts.map +1 -1
- package/dist/action/core/metadata/generator.d.ts +0 -0
- package/dist/action/core/metadata/generator.d.ts.map +1 -1
- package/dist/action/core/metadata/schema.d.ts +4 -4
- package/dist/action/core/metadata/schema.d.ts.map +1 -1
- package/dist/action/core/metadata/sync.d.ts +0 -0
- package/dist/action/core/metadata/sync.d.ts.map +1 -1
- package/dist/action/generators/index-generator.d.ts +0 -0
- package/dist/action/generators/index-generator.d.ts.map +1 -1
- package/dist/action/generators/registry-generator.d.ts +0 -0
- package/dist/action/generators/registry-generator.d.ts.map +1 -1
- package/dist/action/generators/scaffold.d.ts +0 -0
- package/dist/action/generators/scaffold.d.ts.map +1 -1
- package/dist/action/generators/templates/document.d.ts +0 -0
- package/dist/action/generators/templates/document.d.ts.map +1 -1
- package/dist/action/generators/templates/domain-index.d.ts +0 -0
- package/dist/action/generators/templates/domain-index.d.ts.map +1 -1
- package/dist/action/generators/templates/domain-registry.d.ts +0 -0
- package/dist/action/generators/templates/domain-registry.d.ts.map +1 -1
- package/dist/action/index.d.ts +0 -0
- package/dist/action/index.d.ts.map +1 -1
- package/dist/action/index.js +0 -0
- package/dist/action/index.js.map +0 -0
- package/dist/action/package.json +0 -0
- package/dist/action/reports/audit-report.d.ts +0 -0
- package/dist/action/reports/audit-report.d.ts.map +1 -1
- package/dist/action/reports/health-report.d.ts +0 -0
- package/dist/action/reports/health-report.d.ts.map +1 -1
- package/dist/action/reports/link-report.d.ts +0 -0
- package/dist/action/reports/link-report.d.ts.map +1 -1
- package/dist/action/utils/frontmatter.d.ts +0 -0
- package/dist/action/utils/frontmatter.d.ts.map +1 -1
- package/dist/action/utils/glob.d.ts +0 -0
- package/dist/action/utils/glob.d.ts.map +1 -1
- package/dist/action/utils/logger.d.ts +0 -0
- package/dist/action/utils/logger.d.ts.map +1 -1
- package/dist/action/utils/markdown.d.ts +0 -0
- package/dist/action/utils/markdown.d.ts.map +1 -1
- package/dist/cli/index.d.ts +0 -0
- package/dist/cli/index.d.ts.map +0 -0
- package/dist/cli/index.js +0 -0
- package/dist/cli/index.js.map +0 -0
- package/dist/core/audit/auditor.d.ts +0 -0
- package/dist/core/audit/auditor.d.ts.map +0 -0
- package/dist/core/audit/auditor.js +0 -0
- package/dist/core/audit/auditor.js.map +0 -0
- package/dist/core/audit/rules.d.ts +0 -0
- package/dist/core/audit/rules.d.ts.map +0 -0
- package/dist/core/audit/rules.js +0 -0
- package/dist/core/audit/rules.js.map +0 -0
- package/dist/core/discover/antipatterns.d.ts +0 -0
- package/dist/core/discover/antipatterns.d.ts.map +0 -0
- package/dist/core/discover/antipatterns.js +0 -0
- package/dist/core/discover/antipatterns.js.map +0 -0
- package/dist/core/discover/dependencies.d.ts +0 -0
- package/dist/core/discover/dependencies.d.ts.map +0 -0
- package/dist/core/discover/dependencies.js +0 -0
- package/dist/core/discover/dependencies.js.map +0 -0
- package/dist/core/discover/patterns.d.ts +0 -0
- package/dist/core/discover/patterns.d.ts.map +0 -0
- package/dist/core/discover/patterns.js +0 -0
- package/dist/core/discover/patterns.js.map +0 -0
- package/dist/core/discover/standards.d.ts +0 -0
- package/dist/core/discover/standards.d.ts.map +0 -0
- package/dist/core/discover/standards.js +0 -0
- package/dist/core/discover/standards.js.map +0 -0
- package/dist/core/domains/classifier.d.ts +0 -0
- package/dist/core/domains/classifier.d.ts.map +0 -0
- package/dist/core/domains/classifier.js +0 -0
- package/dist/core/domains/classifier.js.map +0 -0
- package/dist/core/domains/constants.d.ts +0 -0
- package/dist/core/domains/constants.d.ts.map +0 -0
- package/dist/core/domains/constants.js +0 -0
- package/dist/core/domains/constants.js.map +0 -0
- package/dist/core/domains/detector.d.ts +0 -0
- package/dist/core/domains/detector.d.ts.map +0 -0
- package/dist/core/domains/detector.js +0 -0
- package/dist/core/domains/detector.js.map +0 -0
- package/dist/core/integrate/integrator.d.ts +0 -0
- package/dist/core/integrate/integrator.d.ts.map +0 -0
- package/dist/core/integrate/integrator.js +0 -0
- package/dist/core/integrate/integrator.js.map +0 -0
- package/dist/core/links/checker.d.ts +0 -0
- package/dist/core/links/checker.d.ts.map +0 -0
- package/dist/core/links/checker.js +0 -0
- package/dist/core/links/checker.js.map +0 -0
- package/dist/core/links/tracker.d.ts +0 -0
- package/dist/core/links/tracker.d.ts.map +0 -0
- package/dist/core/links/tracker.js +0 -0
- package/dist/core/links/tracker.js.map +0 -0
- package/dist/core/maintain/orchestrator.d.ts +0 -0
- package/dist/core/maintain/orchestrator.d.ts.map +0 -0
- package/dist/core/maintain/orchestrator.js +0 -0
- package/dist/core/maintain/orchestrator.js.map +0 -0
- package/dist/core/metadata/generator.d.ts +0 -0
- package/dist/core/metadata/generator.d.ts.map +0 -0
- package/dist/core/metadata/generator.js +0 -0
- package/dist/core/metadata/generator.js.map +0 -0
- package/dist/core/metadata/schema.d.ts +0 -0
- package/dist/core/metadata/schema.d.ts.map +0 -0
- package/dist/core/metadata/schema.js +0 -0
- package/dist/core/metadata/schema.js.map +0 -0
- package/dist/core/metadata/sync.d.ts +0 -0
- package/dist/core/metadata/sync.d.ts.map +0 -0
- package/dist/core/metadata/sync.js +0 -0
- package/dist/core/metadata/sync.js.map +0 -0
- package/dist/generators/index-generator.d.ts +0 -0
- package/dist/generators/index-generator.d.ts.map +0 -0
- package/dist/generators/index-generator.js +0 -0
- package/dist/generators/index-generator.js.map +0 -0
- package/dist/generators/registry-generator.d.ts +0 -0
- package/dist/generators/registry-generator.d.ts.map +0 -0
- package/dist/generators/registry-generator.js +0 -0
- package/dist/generators/registry-generator.js.map +0 -0
- package/dist/generators/scaffold.d.ts +0 -0
- package/dist/generators/scaffold.d.ts.map +0 -0
- package/dist/generators/scaffold.js +0 -0
- package/dist/generators/scaffold.js.map +0 -0
- package/dist/generators/templates/document.d.ts +0 -0
- package/dist/generators/templates/document.d.ts.map +0 -0
- package/dist/generators/templates/document.js +0 -0
- package/dist/generators/templates/document.js.map +0 -0
- package/dist/generators/templates/domain-index.d.ts +0 -0
- package/dist/generators/templates/domain-index.d.ts.map +0 -0
- package/dist/generators/templates/domain-index.js +0 -0
- package/dist/generators/templates/domain-index.js.map +0 -0
- package/dist/generators/templates/domain-registry.d.ts +0 -0
- package/dist/generators/templates/domain-registry.d.ts.map +0 -0
- package/dist/generators/templates/domain-registry.js +0 -0
- package/dist/generators/templates/domain-registry.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/reports/audit-report.d.ts +0 -0
- package/dist/reports/audit-report.d.ts.map +0 -0
- package/dist/reports/audit-report.js +0 -0
- package/dist/reports/audit-report.js.map +0 -0
- package/dist/reports/health-report.d.ts +0 -0
- package/dist/reports/health-report.d.ts.map +0 -0
- package/dist/reports/health-report.js +0 -0
- package/dist/reports/health-report.js.map +0 -0
- package/dist/reports/link-report.d.ts +0 -0
- package/dist/reports/link-report.d.ts.map +0 -0
- package/dist/reports/link-report.js +0 -0
- package/dist/reports/link-report.js.map +0 -0
- package/dist/utils/frontmatter.d.ts +0 -0
- package/dist/utils/frontmatter.d.ts.map +0 -0
- package/dist/utils/frontmatter.js +0 -0
- package/dist/utils/frontmatter.js.map +0 -0
- package/dist/utils/glob.d.ts +0 -0
- package/dist/utils/glob.d.ts.map +0 -0
- package/dist/utils/glob.js +0 -0
- package/dist/utils/glob.js.map +0 -0
- package/dist/utils/logger.d.ts +0 -0
- package/dist/utils/logger.d.ts.map +0 -0
- package/dist/utils/logger.js +0 -0
- package/dist/utils/logger.js.map +0 -0
- package/dist/utils/markdown.d.ts +0 -0
- package/dist/utils/markdown.d.ts.map +0 -0
- package/dist/utils/markdown.js +0 -0
- package/dist/utils/markdown.js.map +0 -0
- package/package.json +1 -1
- package/templates/claude/CLAUDE.md +0 -0
package/README.md
CHANGED
|
@@ -1,557 +1,769 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hit 'Em With The Docs
|
|
2
2
|
|
|
3
3
|
> A self-managing documentation system that keeps your docs organized, accurate, and easy to find.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/hit-em-with-the-docs)
|
|
5
|
+
[](https://www.npmjs.com/package/@theglitchking/hit-em-with-the-docs)
|
|
7
6
|
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
|
|
7
|
+
[](https://github.com/marketplace/actions/hit-em-with-the-docs)
|
|
9
8
|
|
|
10
9
|
> [!IMPORTANT]
|
|
11
|
-
> You
|
|
12
|
-
|
|
10
|
+
> You still need to remember to use this plugin when creating documentation! As projects grow, documentation needs to be created and maintained. You'll need to invoke this plugin or ask an LLM to create documentation for your features, workflows, or infrastructure. This plugin must be invoked to create, update, or maintain your docs.
|
|
13
11
|
|
|
12
|
+
---
|
|
14
13
|
|
|
15
14
|
## Summary
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
When projects get bigger, documentation becomes a mess. Important information gets lost across many files, links break when you move things around, and nobody knows if the docs are still correct. Hit 'Em With The Docs fixes these problems by organizing everything into 15 clear categories, automatically checking your links, and making sure every document has the right information tags. The system watches your docs and fixes common problems without you having to do it manually. Everything stays organized and up-to-date so your team can find what they need fast.
|
|
17
|
+
|
|
18
|
+
---
|
|
18
19
|
|
|
19
20
|
## Operational Summary
|
|
20
21
|
|
|
21
|
-
The plugin creates a special folder called `.documentation` in your project with 15 organized sections
|
|
22
|
+
The plugin creates a special folder called `.documentation` in your project with 15 organized sections called "domains" - things like security, API docs, database guides, and testing information. When you add a document, the system reads it and figures out which category it belongs in based on keywords and content. Each document gets special information tags (metadata) added to the top - things like the title, what category it's in, when it was last updated, and how long it takes to read. This metadata helps both you and the system understand what each document is about.
|
|
23
|
+
|
|
24
|
+
The system includes automated tools that check your documentation for problems. It scans through all your files looking for broken links between documents, makes sure the metadata is complete, checks that files are named correctly, and verifies they're in the right folders. You can run these checks yourself whenever you want, or set them up to run automatically in your build process using GitHub Actions. The plugin can also look through your actual source code to find patterns (like how you structure your classes or handle errors) and automatically create documentation from what it discovers. Everything works with markdown files and gives you a health score from 0 to 100 so you know how good your documentation is.
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
---
|
|
24
27
|
|
|
25
28
|
## Features
|
|
26
29
|
|
|
27
30
|
- **Organized Structure**: Automatically creates 15 specialized categories for different types of documentation
|
|
28
|
-
- **Smart Classification**:
|
|
29
|
-
- **Metadata Management**: Tracks 22 different pieces of information about each document (title, status, tags, etc.)
|
|
31
|
+
- **Smart Classification**: Reads your documents and automatically puts them in the right category
|
|
32
|
+
- **Metadata Management**: Tracks 22 different pieces of information about each document (title, status, tags, last update, etc.)
|
|
30
33
|
- **Link Checking**: Finds and reports broken links between documents
|
|
31
|
-
- **Auto-Fixing**:
|
|
34
|
+
- **Auto-Fixing**: Automatically repairs common problems like missing metadata
|
|
32
35
|
- **Pattern Discovery**: Scans your code to find and document coding patterns
|
|
33
|
-
- **Health Reports**: Generates reports showing the overall quality of your documentation
|
|
34
|
-
- **GitHub Integration**: Works as a GitHub Action for automated checks
|
|
36
|
+
- **Health Reports**: Generates reports showing the overall quality of your documentation with a 0-100 score
|
|
37
|
+
- **GitHub Integration**: Works as a GitHub Action for automated checks on every commit
|
|
35
38
|
- **CLI Tool**: Full command-line interface for all operations
|
|
36
39
|
- **Search Functionality**: Quick search across all documentation
|
|
40
|
+
- **Claude Code Plugin**: Integrates with Claude Code so AI can read and help maintain your docs
|
|
41
|
+
- **Sister Plugin Companion**: When [`semantic-pages`](https://github.com/TheGlitchKing/semantic-pages) is also installed, a **read-only** MCP server is auto-wired over `./.documentation/` so Claude can semantically search your docs without risking accidental writes (hewtd stays the sole writer of the tree)
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
---
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
## Sister Plugin: semantic-pages
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
`hit-em-with-the-docs` is the canonical **writer** of `./.documentation/` — it scaffolds the 15-domain structure, classifies incoming docs, maintains the 22-field metadata schema, checks links, and produces health reports. By design, it treats `./.documentation/` as a tree it owns.
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
[`semantic-pages`](https://github.com/TheGlitchKing/semantic-pages) is the canonical **reader**. It's a local MCP server that indexes any folder of markdown into a vector database + knowledge graph, exposing semantic search, wikilink traversal, and CRUD tools to Claude Code.
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
2. Type this command and press Enter:
|
|
48
|
-
```bash
|
|
49
|
-
npm install -g hit-em-with-the-docs
|
|
50
|
-
```
|
|
51
|
-
3. Wait for the installation to complete
|
|
52
|
-
4. Verify it worked by typing:
|
|
53
|
-
```bash
|
|
54
|
-
hewtd --version
|
|
55
|
-
```
|
|
56
|
-
5. You should see the version number
|
|
51
|
+
When both plugins are installed together, `semantic-pages` auto-detects hewtd via Claude Code's plugin registry and stands up a **second, read-only** MCP instance pointed at `./.documentation/`. The read-only mode suppresses all 7 write tools (`create_note`, `update_note`, `delete_note`, `move_note`, `update_frontmatter`, `manage_tags`, `rename_tag`) so Claude can search and read the docs tree but can't race hewtd over writes. Your personal scratch vault at `./.claude/.vault/` stays fully read/write.
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
### Behavior matrix
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
| `hit-em-with-the-docs` | `semantic-pages` | Result |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| ✗ | ✗ | nothing |
|
|
58
|
+
| ✓ | ✗ | hewtd CLI only; `.documentation/` managed but not indexed |
|
|
59
|
+
| ✗ | ✓ | single MCP at `./.claude/.vault` (read/write) |
|
|
60
|
+
| ✓ | ✓ | `./.claude/.vault` (r/w) **+** `./.documentation` (read-only) |
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
2. Type this command:
|
|
64
|
-
```bash
|
|
65
|
-
npm install --save-dev hit-em-with-the-docs
|
|
66
|
-
```
|
|
67
|
-
3. Add a script to your `package.json`:
|
|
68
|
-
```json
|
|
69
|
-
"scripts": {
|
|
70
|
-
"docs": "hewtd"
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
4. Use it with: `npm run docs`
|
|
62
|
+
### How it's wired
|
|
74
63
|
|
|
75
|
-
|
|
64
|
+
`semantic-pages` ships a `SessionStart` hook that runs at the start of every Claude Code session and reconciles the project's `.mcp.json`. If hewtd is enabled in `~/.claude/settings.json` **and** `./.documentation/` exists in the current project, it adds a `semantic-pages` MCP entry pointed at `./.documentation` with `--read-only`. If either condition stops being true, it idempotently cleans up. See the [semantic-pages Sister Plugin docs](https://github.com/TheGlitchKing/semantic-pages#sister-plugin-hit-em-with-the-docs) for the full auto-wiring behavior.
|
|
76
65
|
|
|
77
|
-
|
|
66
|
+
### Why we don't do it from hewtd's side
|
|
67
|
+
|
|
68
|
+
hewtd does **not** ship any MCP configuration, declare semantic-pages as a dependency, or write to `.mcp.json`. Installing hewtd alone gives you a CLI-only tool with no MCP server — your project stays clean. The auto-wire only kicks in when a user has explicitly installed both plugins, signaling they want Claude to semantically index the hewtd-managed tree. The wiring logic lives entirely on the semantic-pages side.
|
|
69
|
+
|
|
70
|
+
### Install both
|
|
78
71
|
|
|
79
72
|
```bash
|
|
80
|
-
|
|
73
|
+
# Inside a Claude Code session
|
|
74
|
+
/plugin marketplace add TheGlitchKing/hit-em-with-the-docs
|
|
75
|
+
/plugin install hit-em-with-the-docs@hit-em-with-the-docs-marketplace
|
|
76
|
+
|
|
77
|
+
/plugin marketplace add TheGlitchKing/semantic-pages
|
|
78
|
+
/plugin install semantic-pages@semantic-pages-marketplace
|
|
81
79
|
```
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
Next session start, `./.claude/.vault/` is created, `.mcp.json` is wired, and Claude has 14 read tools on `./.documentation/` plus 21 full tools on `./.claude/.vault/`.
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
---
|
|
86
84
|
|
|
87
|
-
|
|
88
|
-
name: Documentation Health Check
|
|
85
|
+
## Quick Start
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
push:
|
|
92
|
-
paths:
|
|
93
|
-
- '.documentation/**'
|
|
94
|
-
schedule:
|
|
95
|
-
- cron: '0 16 * * 5' # Every Friday at 4 PM
|
|
87
|
+
### 1. Installation Methods
|
|
96
88
|
|
|
97
|
-
|
|
98
|
-
docs-check:
|
|
99
|
-
runs-on: ubuntu-latest
|
|
100
|
-
steps:
|
|
101
|
-
- uses: actions/checkout@v4
|
|
89
|
+
#### Method A: NPM Installation
|
|
102
90
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
91
|
+
##### Global Installation (Recommended for regular use)
|
|
92
|
+
|
|
93
|
+
This installs the tool on your computer so you can use it in any project.
|
|
94
|
+
|
|
95
|
+
**Step 1**: Open your terminal or command prompt
|
|
96
|
+
|
|
97
|
+
**Step 2**: Type this command and press Enter:
|
|
98
|
+
```bash
|
|
99
|
+
npm install -g @theglitchking/hit-em-with-the-docs
|
|
109
100
|
```
|
|
110
101
|
|
|
111
|
-
|
|
102
|
+
**Step 3**: Wait for the installation to complete. You'll see some messages about downloading packages.
|
|
103
|
+
|
|
104
|
+
**Step 4**: Test that it worked by typing:
|
|
105
|
+
```bash
|
|
106
|
+
hewtd --version
|
|
107
|
+
```
|
|
112
108
|
|
|
113
|
-
|
|
109
|
+
**Step 5**: You should see a version number like `2.0.0`. If you do, it's installed correctly!
|
|
114
110
|
|
|
111
|
+
**To enable the plugin in your project**:
|
|
115
112
|
```bash
|
|
116
|
-
#
|
|
113
|
+
# Go to your project folder
|
|
114
|
+
cd /path/to/your/project
|
|
115
|
+
|
|
116
|
+
# Create the documentation structure
|
|
117
117
|
hewtd init
|
|
118
118
|
|
|
119
|
-
#
|
|
120
|
-
hewtd init --path ./docs
|
|
119
|
+
# You should see a new .documentation folder with 15 categories inside
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
|
|
122
|
+
##### NPX Method (No installation needed)
|
|
123
|
+
|
|
124
|
+
This lets you use the tool without installing it permanently.
|
|
125
|
+
|
|
126
|
+
**Step 1**: Open your terminal in your project folder
|
|
127
|
+
|
|
128
|
+
**Step 2**: Run any command by putting `npx @theglitchking/hit-em-with-the-docs` before it:
|
|
129
|
+
```bash
|
|
130
|
+
npx @theglitchking/hit-em-with-the-docs init
|
|
124
131
|
```
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
|
|
133
|
+
**Step 3**: The first time you run it, NPX will download the tool (this takes a few seconds)
|
|
134
|
+
|
|
135
|
+
**Step 4**: After that, it runs your command automatically
|
|
136
|
+
|
|
137
|
+
**Use this method when**: You want to try the tool without installing it, or you only need it occasionally.
|
|
138
|
+
|
|
139
|
+
##### Project Installation (For team projects)
|
|
140
|
+
|
|
141
|
+
This installs the tool only for one specific project.
|
|
142
|
+
|
|
143
|
+
**Step 1**: Open your terminal in your project folder
|
|
144
|
+
|
|
145
|
+
**Step 2**: Type this command:
|
|
146
|
+
```bash
|
|
147
|
+
npm install --save-dev @theglitchking/hit-em-with-the-docs
|
|
134
148
|
```
|
|
135
149
|
|
|
136
|
-
|
|
150
|
+
**Step 3**: Add a script to your `package.json` file:
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"scripts": {
|
|
154
|
+
"docs": "hewtd",
|
|
155
|
+
"docs:check": "hewtd maintain --quick",
|
|
156
|
+
"docs:fix": "hewtd maintain --quick --fix"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
137
160
|
|
|
138
|
-
|
|
161
|
+
**Step 4**: Now you can use it with npm commands:
|
|
162
|
+
```bash
|
|
163
|
+
npm run docs init # Create documentation structure
|
|
164
|
+
npm run docs:check # Check documentation health
|
|
165
|
+
npm run docs:fix # Fix documentation problems
|
|
166
|
+
```
|
|
139
167
|
|
|
140
|
-
|
|
168
|
+
**To enable the plugin**:
|
|
169
|
+
```bash
|
|
170
|
+
npm run docs init
|
|
171
|
+
```
|
|
141
172
|
|
|
142
|
-
|
|
143
|
-
|---------|-------------|
|
|
144
|
-
| `hewtd init` | Create the documentation structure |
|
|
145
|
-
| `hewtd maintain` | Run full health check and maintenance |
|
|
146
|
-
| `hewtd integrate <file>` | Add a document to the system |
|
|
147
|
-
| `hewtd list` | Show all documentation categories |
|
|
148
|
-
| `hewtd search <query>` | Search for content in documentation |
|
|
173
|
+
#### Method B: Claude Code Plugin Installation
|
|
149
174
|
|
|
150
|
-
|
|
175
|
+
This method installs it as a plugin for Claude Code so Claude can help manage your documentation.
|
|
151
176
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
177
|
+
**Step 1**: Open Claude Code
|
|
178
|
+
|
|
179
|
+
**Step 2**: Type this command in your conversation:
|
|
180
|
+
```
|
|
181
|
+
/plugin install TheGlitchKing/hit-em-with-the-docs
|
|
182
|
+
```
|
|
158
183
|
|
|
159
|
-
|
|
184
|
+
**Step 3**: Wait for Claude to confirm the installation
|
|
160
185
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
186
|
+
**Step 4**: The plugin is now installed! Claude can now use special `/docs` commands.
|
|
187
|
+
|
|
188
|
+
**To enable and initialize in your project**:
|
|
189
|
+
|
|
190
|
+
Ask Claude in conversation:
|
|
191
|
+
```
|
|
192
|
+
Please initialize hit-em-with-the-docs in this project
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Or use the command:
|
|
196
|
+
```
|
|
197
|
+
/docs init
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Claude will create the `.documentation` folder with all 15 categories for you.
|
|
167
201
|
|
|
168
202
|
---
|
|
169
203
|
|
|
170
|
-
###
|
|
204
|
+
### 2. How to Use
|
|
171
205
|
|
|
172
|
-
####
|
|
206
|
+
#### CLI Commands
|
|
173
207
|
|
|
174
|
-
|
|
208
|
+
These commands run in your terminal and manage your documentation.
|
|
175
209
|
|
|
176
|
-
|
|
210
|
+
| Command | Description |
|
|
211
|
+
|---------|-------------|
|
|
212
|
+
| `hewtd init` | Create the documentation structure with 15 categories |
|
|
213
|
+
| `hewtd maintain` | Run full health check and fix problems |
|
|
214
|
+
| `hewtd integrate <file>` | Add a document to the system |
|
|
215
|
+
| `hewtd list` | Show all 15 documentation categories |
|
|
216
|
+
| `hewtd search <query>` | Search for content in your docs |
|
|
217
|
+
| `hewtd metadata-sync` | Update document information tags |
|
|
218
|
+
| `hewtd link-check` | Find broken links between documents |
|
|
219
|
+
| `hewtd audit` | Check documentation quality and compliance |
|
|
220
|
+
| `hewtd report <type>` | Generate health, audit, or link reports |
|
|
221
|
+
| `hewtd discover` | Scan code for patterns and create docs |
|
|
177
222
|
|
|
178
|
-
|
|
223
|
+
##### Command Examples and Details
|
|
224
|
+
|
|
225
|
+
**`hewtd init` - Set up documentation**
|
|
226
|
+
|
|
227
|
+
**How to use it**:
|
|
179
228
|
```bash
|
|
180
|
-
# Basic
|
|
229
|
+
# Basic setup in current folder
|
|
181
230
|
hewtd init
|
|
182
231
|
|
|
183
|
-
#
|
|
184
|
-
hewtd init --path ./
|
|
232
|
+
# Set up in a custom location
|
|
233
|
+
hewtd init --path ./docs
|
|
185
234
|
|
|
186
|
-
#
|
|
235
|
+
# Replace existing structure
|
|
187
236
|
hewtd init --force
|
|
188
237
|
```
|
|
189
238
|
|
|
190
|
-
**
|
|
239
|
+
**When to use it**: First time setting up documentation in a project.
|
|
191
240
|
|
|
192
|
-
|
|
241
|
+
**What to use it on**: Your project root folder (it creates a `.documentation` folder there).
|
|
193
242
|
|
|
194
|
-
|
|
243
|
+
**What to expect**: Creates 53 files and folders organized into 15 categories like security, api, database, testing, etc. Each category gets an INDEX.md (table of contents) and REGISTRY.md (quick list).
|
|
195
244
|
|
|
196
|
-
|
|
245
|
+
---
|
|
197
246
|
|
|
198
|
-
|
|
247
|
+
**`hewtd maintain` - Check and fix your docs**
|
|
199
248
|
|
|
200
|
-
**
|
|
249
|
+
**How to use it**:
|
|
201
250
|
```bash
|
|
202
|
-
# Full
|
|
251
|
+
# Full check (looks at everything)
|
|
203
252
|
hewtd maintain
|
|
204
253
|
|
|
205
|
-
# Quick
|
|
254
|
+
# Quick check (skips link checking, much faster)
|
|
206
255
|
hewtd maintain --quick
|
|
207
256
|
|
|
208
|
-
# Quick
|
|
257
|
+
# Quick check and auto-fix problems
|
|
209
258
|
hewtd maintain --quick --fix
|
|
210
259
|
|
|
211
|
-
#
|
|
212
|
-
hewtd maintain --
|
|
260
|
+
# Full check with auto-fix
|
|
261
|
+
hewtd maintain --fix
|
|
213
262
|
```
|
|
214
263
|
|
|
215
|
-
**
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
264
|
+
**When to use it**:
|
|
265
|
+
- Before committing code changes
|
|
266
|
+
- Once a week for regular maintenance
|
|
267
|
+
- Before releasing a new version
|
|
268
|
+
- When you've added lots of new documentation
|
|
220
269
|
|
|
221
|
-
**
|
|
270
|
+
**What to use it on**: Your entire `.documentation` folder.
|
|
222
271
|
|
|
223
|
-
|
|
272
|
+
**What to expect**:
|
|
273
|
+
- You'll see a health score from 0 to 100 (aim for 80+)
|
|
274
|
+
- A list of issues found (broken links, missing metadata, misplaced files)
|
|
275
|
+
- If you use `--fix`, it automatically fixes what it can
|
|
276
|
+
- A detailed report saves to `.documentation/reports/maintenance-[date].md`
|
|
277
|
+
- Takes 5-30 seconds depending on how many docs you have
|
|
224
278
|
|
|
225
|
-
|
|
279
|
+
**Example output**:
|
|
280
|
+
```
|
|
281
|
+
✓ Metadata completeness: 95%
|
|
282
|
+
✓ Link health: 100%
|
|
283
|
+
✓ Naming compliance: 87%
|
|
284
|
+
⚠ Found 3 issues
|
|
285
|
+
✓ Fixed 3 issues
|
|
286
|
+
Health Score: 92/100
|
|
287
|
+
```
|
|
226
288
|
|
|
227
|
-
|
|
289
|
+
---
|
|
228
290
|
|
|
229
|
-
|
|
291
|
+
**`hewtd integrate <file>` - Add documents to the system**
|
|
230
292
|
|
|
231
|
-
**
|
|
293
|
+
**How to use it**:
|
|
232
294
|
```bash
|
|
233
|
-
# Add a single document
|
|
295
|
+
# Add a single document (it will ask which category)
|
|
234
296
|
hewtd integrate ./my-guide.md
|
|
235
297
|
|
|
236
|
-
# Preview where it would go
|
|
298
|
+
# Preview where it would go without moving it
|
|
237
299
|
hewtd integrate ./my-guide.md --dry-run
|
|
238
300
|
|
|
239
|
-
# Automatic mode (no questions
|
|
301
|
+
# Automatic mode (uses best guess, no questions)
|
|
240
302
|
hewtd integrate ./my-guide.md --auto
|
|
241
303
|
|
|
242
|
-
# Add multiple documents
|
|
304
|
+
# Add multiple documents at once
|
|
243
305
|
for file in old-docs/*.md; do
|
|
244
306
|
hewtd integrate "$file" --auto
|
|
245
307
|
done
|
|
246
308
|
```
|
|
247
309
|
|
|
248
|
-
**
|
|
310
|
+
**When to use it**: When you have markdown files outside the `.documentation` folder that you want to organize.
|
|
311
|
+
|
|
312
|
+
**What to use it on**: Individual markdown (.md) files or a folder of markdown files.
|
|
313
|
+
|
|
314
|
+
**What to expect**:
|
|
315
|
+
- The tool reads your document's content
|
|
316
|
+
- It suggests which category it belongs in (like "security" or "api")
|
|
317
|
+
- It adds metadata to the top of the file
|
|
318
|
+
- It moves the file to the correct folder
|
|
319
|
+
- In auto mode, it does this without asking questions
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
**`hewtd list` - Show all categories**
|
|
324
|
+
|
|
325
|
+
**How to use it**:
|
|
326
|
+
```bash
|
|
327
|
+
hewtd list
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**When to use it**: When you need a quick reminder of what categories are available.
|
|
249
331
|
|
|
250
|
-
**
|
|
332
|
+
**What to expect**: A table showing all 15 categories with descriptions:
|
|
333
|
+
```
|
|
334
|
+
┌─────────────────┬──────────┬────────────────────────────┐
|
|
335
|
+
│ Domain │ Priority │ Description │
|
|
336
|
+
├─────────────────┼──────────┼────────────────────────────┤
|
|
337
|
+
│ security │ 9 │ Security and auth docs │
|
|
338
|
+
│ api │ 8 │ API endpoints │
|
|
339
|
+
│ database │ 8 │ Database schema │
|
|
340
|
+
└─────────────────┴──────────┴────────────────────────────┘
|
|
341
|
+
```
|
|
251
342
|
|
|
252
343
|
---
|
|
253
344
|
|
|
254
|
-
|
|
345
|
+
**`hewtd search <query>` - Find information**
|
|
346
|
+
|
|
347
|
+
**How to use it**:
|
|
348
|
+
```bash
|
|
349
|
+
# Search all docs
|
|
350
|
+
hewtd search "authentication"
|
|
351
|
+
|
|
352
|
+
# Search only security docs
|
|
353
|
+
hewtd search "authentication" --domain security
|
|
354
|
+
|
|
355
|
+
# Search with multiple words
|
|
356
|
+
hewtd search "user login flow"
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**When to use it**: When you need to find where specific information is documented.
|
|
255
360
|
|
|
256
|
-
**
|
|
361
|
+
**What to use it on**: Any topic, concept, or keyword you want to find.
|
|
362
|
+
|
|
363
|
+
**What to expect**: A list of files containing your search term, showing:
|
|
364
|
+
- File path
|
|
365
|
+
- Number of matches
|
|
366
|
+
- Preview of matching lines
|
|
367
|
+
- Sorted by relevance
|
|
368
|
+
|
|
369
|
+
---
|
|
257
370
|
|
|
258
|
-
|
|
371
|
+
**`hewtd metadata-sync` - Fix document information**
|
|
259
372
|
|
|
260
|
-
**
|
|
373
|
+
**How to use it**:
|
|
261
374
|
```bash
|
|
262
|
-
# Check
|
|
375
|
+
# Check all documents (preview only)
|
|
263
376
|
hewtd metadata-sync
|
|
264
377
|
|
|
265
|
-
# Fix all
|
|
378
|
+
# Fix all missing metadata
|
|
266
379
|
hewtd metadata-sync --fix
|
|
267
380
|
|
|
268
|
-
#
|
|
381
|
+
# Fix only security documents
|
|
269
382
|
hewtd metadata-sync --domain security --fix
|
|
270
383
|
```
|
|
271
384
|
|
|
272
|
-
**
|
|
385
|
+
**When to use it**:
|
|
386
|
+
- After manually editing lots of files
|
|
387
|
+
- When documents are missing metadata
|
|
388
|
+
- As part of regular maintenance
|
|
273
389
|
|
|
274
|
-
**
|
|
390
|
+
**What to use it on**: The entire `.documentation` folder or specific categories.
|
|
275
391
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
392
|
+
**What to expect**:
|
|
393
|
+
- Checks every document for complete metadata
|
|
394
|
+
- Adds missing information like word count and reading time
|
|
395
|
+
- Shows you how many documents were updated
|
|
396
|
+
- With `--fix`, it automatically adds missing metadata
|
|
279
397
|
|
|
280
|
-
|
|
398
|
+
---
|
|
281
399
|
|
|
282
|
-
|
|
400
|
+
**`hewtd link-check` - Find broken links**
|
|
283
401
|
|
|
284
|
-
**
|
|
402
|
+
**How to use it**:
|
|
285
403
|
```bash
|
|
286
|
-
# Check all
|
|
404
|
+
# Check all documents
|
|
287
405
|
hewtd link-check
|
|
288
406
|
|
|
289
|
-
# Check
|
|
407
|
+
# Check only API docs
|
|
290
408
|
hewtd link-check --domain api
|
|
291
409
|
|
|
292
410
|
# Generate detailed report
|
|
293
411
|
hewtd link-check --report
|
|
294
412
|
```
|
|
295
413
|
|
|
296
|
-
**
|
|
297
|
-
|
|
298
|
-
|
|
414
|
+
**When to use it**:
|
|
415
|
+
- Before releasing a new version
|
|
416
|
+
- After moving or renaming files
|
|
417
|
+
- Monthly as part of regular maintenance
|
|
418
|
+
- When you suspect broken links
|
|
299
419
|
|
|
300
|
-
|
|
420
|
+
**What to use it on**: Your entire documentation or specific categories.
|
|
301
421
|
|
|
302
|
-
|
|
422
|
+
**What to expect**:
|
|
423
|
+
- List of all broken links found
|
|
424
|
+
- Which file contains each broken link
|
|
425
|
+
- What line number the link is on
|
|
426
|
+
- Saves detailed report to `.documentation/reports/links-[date].md`
|
|
303
427
|
|
|
304
|
-
|
|
428
|
+
---
|
|
305
429
|
|
|
306
|
-
|
|
430
|
+
**`hewtd audit` - Check quality**
|
|
307
431
|
|
|
308
|
-
**
|
|
432
|
+
**How to use it**:
|
|
309
433
|
```bash
|
|
310
434
|
# Audit everything
|
|
311
435
|
hewtd audit
|
|
312
436
|
|
|
313
|
-
#
|
|
437
|
+
# Show only problems
|
|
314
438
|
hewtd audit --issues-only
|
|
315
439
|
|
|
316
440
|
# Audit specific category
|
|
317
|
-
hewtd audit --domain
|
|
441
|
+
hewtd audit --domain database
|
|
318
442
|
|
|
319
443
|
# Generate full report
|
|
320
444
|
hewtd audit --report
|
|
321
445
|
```
|
|
322
446
|
|
|
323
|
-
**
|
|
447
|
+
**When to use it**:
|
|
448
|
+
- Establishing a baseline for your docs
|
|
449
|
+
- During code reviews
|
|
450
|
+
- Before important releases
|
|
324
451
|
|
|
325
|
-
**
|
|
452
|
+
**What to use it on**: The entire documentation system to measure quality.
|
|
453
|
+
|
|
454
|
+
**What to expect**:
|
|
455
|
+
- Quality score from 0-100
|
|
456
|
+
- List of issues:
|
|
457
|
+
- Files in wrong folders
|
|
458
|
+
- Incorrect file names (should be kebab-case)
|
|
459
|
+
- Missing required metadata
|
|
460
|
+
- Empty documents
|
|
461
|
+
- Recommendations for fixes
|
|
326
462
|
|
|
327
463
|
---
|
|
328
464
|
|
|
329
|
-
|
|
465
|
+
**`hewtd report <type>` - Generate reports**
|
|
330
466
|
|
|
331
|
-
**
|
|
467
|
+
**How to use it**:
|
|
468
|
+
```bash
|
|
469
|
+
# Health report (overall score and stats)
|
|
470
|
+
hewtd report health
|
|
332
471
|
|
|
333
|
-
|
|
472
|
+
# Audit report (quality issues)
|
|
473
|
+
hewtd report audit
|
|
334
474
|
|
|
335
|
-
|
|
475
|
+
# Links report (link topology and broken links)
|
|
476
|
+
hewtd report links
|
|
477
|
+
|
|
478
|
+
# JSON format for automation
|
|
479
|
+
hewtd report health --format json
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
**When to use it**:
|
|
483
|
+
- Weekly metrics for your team
|
|
484
|
+
- Dashboards showing documentation health
|
|
485
|
+
- Stakeholder updates
|
|
486
|
+
- Tracking improvement over time
|
|
487
|
+
|
|
488
|
+
**What to use it on**: Your documentation system.
|
|
489
|
+
|
|
490
|
+
**What to expect**: Detailed markdown or JSON report saved to `.documentation/reports/` with:
|
|
491
|
+
- Health score and trends
|
|
492
|
+
- Statistics (document count, word count, etc.)
|
|
493
|
+
- Issues found and severity
|
|
494
|
+
- Recommendations for improvement
|
|
495
|
+
|
|
496
|
+
---
|
|
497
|
+
|
|
498
|
+
**`hewtd discover` - Find code patterns**
|
|
499
|
+
|
|
500
|
+
**How to use it**:
|
|
336
501
|
```bash
|
|
337
|
-
# Find all patterns
|
|
502
|
+
# Find all patterns in your code
|
|
338
503
|
hewtd discover patterns
|
|
339
504
|
|
|
340
|
-
#
|
|
505
|
+
# Find problematic patterns
|
|
506
|
+
hewtd discover anti-patterns
|
|
507
|
+
|
|
508
|
+
# Extract coding standards
|
|
509
|
+
hewtd discover standards
|
|
510
|
+
|
|
511
|
+
# Analyze dependencies
|
|
512
|
+
hewtd discover dependencies
|
|
513
|
+
|
|
514
|
+
# Only scan TypeScript files
|
|
341
515
|
hewtd discover patterns --language typescript
|
|
342
516
|
|
|
343
517
|
# Scan specific folder
|
|
344
518
|
hewtd discover patterns --root ./src
|
|
345
519
|
```
|
|
346
520
|
|
|
347
|
-
**
|
|
521
|
+
**When to use it**:
|
|
522
|
+
- Creating architecture documentation
|
|
523
|
+
- Onboarding new developers
|
|
524
|
+
- Documenting coding standards
|
|
525
|
+
- Understanding project dependencies
|
|
348
526
|
|
|
349
|
-
**
|
|
527
|
+
**What to use it on**: Your source code folders (automatically skips node_modules, dist, and other build folders).
|
|
350
528
|
|
|
351
|
-
|
|
529
|
+
**What to expect**:
|
|
530
|
+
- Creates markdown files with discovered patterns
|
|
531
|
+
- Shows code examples with file locations
|
|
532
|
+
- Identifies common architectural patterns (Singleton, Factory, Repository, etc.)
|
|
533
|
+
- Lists anti-patterns to avoid
|
|
534
|
+
- Documents dependencies and their versions
|
|
352
535
|
|
|
353
|
-
|
|
536
|
+
---
|
|
354
537
|
|
|
355
|
-
|
|
538
|
+
#### Claude Code Commands
|
|
356
539
|
|
|
357
|
-
|
|
540
|
+
When the plugin is installed in Claude Code, these commands let Claude help manage your documentation.
|
|
358
541
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
542
|
+
| Command | Description |
|
|
543
|
+
|---------|-------------|
|
|
544
|
+
| `/docs load <domain>` | Load a specific category of docs so Claude can answer questions about it |
|
|
545
|
+
| `/docs list` | Show all 15 documentation categories |
|
|
546
|
+
| `/docs search <query>` | Search through all documentation |
|
|
547
|
+
| `/docs stats` | Display statistics (health score, doc count, recent updates) |
|
|
548
|
+
| `/docs maintain` | Run health check and fix issues |
|
|
549
|
+
| `/docs integrate <file>` | Add a document to the documentation system |
|
|
550
|
+
| `/discover` | Scan code for patterns and create documentation |
|
|
363
551
|
|
|
364
|
-
|
|
552
|
+
##### Claude Command Examples and Details
|
|
365
553
|
|
|
366
|
-
|
|
554
|
+
**`/docs load <domain>` - Give Claude access to specific docs**
|
|
367
555
|
|
|
368
|
-
|
|
556
|
+
**How to use it**:
|
|
557
|
+
```
|
|
558
|
+
/docs load security
|
|
559
|
+
```
|
|
369
560
|
|
|
370
|
-
**When to use**:
|
|
561
|
+
**When to use it**:
|
|
562
|
+
- Before asking Claude questions about a specific topic
|
|
563
|
+
- When you want Claude to reference your existing documentation
|
|
564
|
+
- Before asking Claude to update or create documentation in a category
|
|
371
565
|
|
|
372
|
-
**What it
|
|
566
|
+
**What to use it on**: Any of the 15 domain names (security, api, database, testing, etc.).
|
|
373
567
|
|
|
374
|
-
**
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
568
|
+
**What to expect**:
|
|
569
|
+
- Claude loads all documents from that category into its context
|
|
570
|
+
- Claude can now answer detailed questions about those docs
|
|
571
|
+
- Claude can reference specific files and sections
|
|
572
|
+
- Claude can suggest improvements or updates
|
|
378
573
|
|
|
379
|
-
|
|
380
|
-
hewtd search "authentication" --domain security
|
|
574
|
+
**Example conversation**:
|
|
381
575
|
```
|
|
576
|
+
You: /docs load security
|
|
577
|
+
Claude: I've loaded the security documentation. I can see you have 12 documents covering authentication, authorization, encryption, and security best practices. What would you like to know?
|
|
382
578
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
579
|
+
You: How do we handle OAuth tokens?
|
|
580
|
+
Claude: Based on your security docs, OAuth tokens are stored in httpOnly cookies and have a 1-hour expiration. The implementation is in security/oauth-implementation.md...
|
|
581
|
+
```
|
|
386
582
|
|
|
387
583
|
---
|
|
388
584
|
|
|
389
|
-
|
|
585
|
+
**`/docs list` - See what documentation exists**
|
|
390
586
|
|
|
391
|
-
**
|
|
587
|
+
**How to use it**:
|
|
588
|
+
```
|
|
589
|
+
/docs list
|
|
590
|
+
```
|
|
392
591
|
|
|
393
|
-
**
|
|
592
|
+
**When to use it**: When you want to know what documentation categories are available.
|
|
394
593
|
|
|
395
|
-
**
|
|
396
|
-
```bash
|
|
397
|
-
# Health report
|
|
398
|
-
hewtd report health
|
|
594
|
+
**What to expect**: Claude shows you all 15 categories with descriptions and document counts.
|
|
399
595
|
|
|
400
|
-
|
|
401
|
-
hewtd report audit
|
|
596
|
+
---
|
|
402
597
|
|
|
403
|
-
|
|
404
|
-
hewtd report links
|
|
598
|
+
**`/docs search <query>` - Find specific information**
|
|
405
599
|
|
|
406
|
-
|
|
407
|
-
|
|
600
|
+
**How to use it**:
|
|
601
|
+
```
|
|
602
|
+
/docs search "authentication flow"
|
|
408
603
|
```
|
|
409
604
|
|
|
410
|
-
**
|
|
411
|
-
|
|
412
|
-
|
|
605
|
+
**When to use it**:
|
|
606
|
+
- Before writing new documentation (check if it already exists)
|
|
607
|
+
- When you can't remember where something is documented
|
|
608
|
+
- To find all places a topic is mentioned
|
|
413
609
|
|
|
414
|
-
|
|
610
|
+
**What to expect**: Claude shows you which files contain your search term and can read those files for you.
|
|
415
611
|
|
|
416
|
-
|
|
612
|
+
**Example**:
|
|
613
|
+
```
|
|
614
|
+
You: /docs search "API rate limiting"
|
|
615
|
+
Claude: Found "API rate limiting" in 3 files:
|
|
616
|
+
1. api/rate-limiting.md (6 matches)
|
|
617
|
+
2. security/api-security.md (2 matches)
|
|
618
|
+
3. troubleshooting/api-errors.md (1 match)
|
|
417
619
|
|
|
418
|
-
|
|
620
|
+
Would you like me to load these files and explain the rate limiting implementation?
|
|
621
|
+
```
|
|
419
622
|
|
|
420
|
-
|
|
623
|
+
---
|
|
421
624
|
|
|
422
|
-
|
|
625
|
+
**`/docs stats` - Check documentation health**
|
|
423
626
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
| `/docs search <query>` | Search through documentation |
|
|
429
|
-
| `/docs stats` | Display documentation statistics |
|
|
430
|
-
| `/docs maintain` | Run maintenance checks |
|
|
627
|
+
**How to use it**:
|
|
628
|
+
```
|
|
629
|
+
/docs stats
|
|
630
|
+
```
|
|
431
631
|
|
|
432
|
-
|
|
632
|
+
**When to use it**:
|
|
633
|
+
- Quick health check before committing
|
|
634
|
+
- To see how much documentation exists
|
|
635
|
+
- To check recent changes
|
|
636
|
+
- Before starting a documentation cleanup session
|
|
433
637
|
|
|
434
|
-
|
|
638
|
+
**What to expect**: Claude shows you:
|
|
639
|
+
- Health score (0-100)
|
|
640
|
+
- Total number of documents
|
|
641
|
+
- Documents by category
|
|
642
|
+
- Recently updated files
|
|
643
|
+
- Issues found (broken links, missing metadata)
|
|
435
644
|
|
|
436
|
-
|
|
437
|
-
# Documentation System
|
|
645
|
+
---
|
|
438
646
|
|
|
439
|
-
|
|
647
|
+
**`/docs maintain` - Fix documentation problems**
|
|
440
648
|
|
|
441
|
-
|
|
649
|
+
**How to use it**:
|
|
650
|
+
```
|
|
651
|
+
/docs maintain
|
|
652
|
+
```
|
|
442
653
|
|
|
443
|
-
|
|
444
|
-
-
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
654
|
+
**When to use it**:
|
|
655
|
+
- Before committing changes
|
|
656
|
+
- Weekly maintenance
|
|
657
|
+
- After adding lots of new documentation
|
|
658
|
+
- When you notice issues
|
|
448
659
|
|
|
449
|
-
|
|
660
|
+
**What to expect**: Claude runs the maintenance system and reports:
|
|
661
|
+
- Issues found
|
|
662
|
+
- Issues automatically fixed
|
|
663
|
+
- Updated health score
|
|
664
|
+
- Suggestions for manual fixes
|
|
450
665
|
|
|
451
|
-
|
|
452
|
-
- security: Authentication, authorization, security practices
|
|
453
|
-
- api: API endpoints and specifications
|
|
454
|
-
- database: Database schema and queries
|
|
455
|
-
- testing: Test strategies and patterns
|
|
456
|
-
- And 11 more specialized categories
|
|
457
|
-
```
|
|
666
|
+
---
|
|
458
667
|
|
|
459
|
-
|
|
668
|
+
**`/docs integrate <file>` - Organize a document**
|
|
460
669
|
|
|
461
|
-
**
|
|
670
|
+
**How to use it**:
|
|
462
671
|
```
|
|
463
|
-
|
|
464
|
-
Claude: [Loads all security-related documentation and can answer questions about it]
|
|
672
|
+
/docs integrate ./new-guide.md
|
|
465
673
|
```
|
|
466
674
|
|
|
467
|
-
**
|
|
468
|
-
```
|
|
469
|
-
You: /docs search authentication
|
|
470
|
-
Claude: [Shows files containing "authentication"]
|
|
471
|
-
```
|
|
675
|
+
**When to use it**: When you have a markdown file that needs to be added to the documentation system.
|
|
472
676
|
|
|
473
|
-
**
|
|
474
|
-
```
|
|
475
|
-
You: /docs stats
|
|
476
|
-
Claude: [Shows health score, document counts, recent updates]
|
|
477
|
-
```
|
|
677
|
+
**What to expect**: Claude reads the file, determines the best category, adds metadata, and moves it to the correct location.
|
|
478
678
|
|
|
479
|
-
|
|
679
|
+
---
|
|
680
|
+
|
|
681
|
+
**`/discover` - Generate docs from code**
|
|
682
|
+
|
|
683
|
+
**How to use it**:
|
|
480
684
|
```
|
|
481
|
-
|
|
482
|
-
|
|
685
|
+
/discover patterns
|
|
686
|
+
/discover anti-patterns
|
|
687
|
+
/discover standards
|
|
688
|
+
/discover dependencies
|
|
483
689
|
```
|
|
484
690
|
|
|
485
|
-
**When to use
|
|
486
|
-
-
|
|
487
|
-
-
|
|
488
|
-
-
|
|
489
|
-
- Use `/docs maintain` before committing changes
|
|
691
|
+
**When to use it**:
|
|
692
|
+
- Creating architecture documentation
|
|
693
|
+
- Onboarding guides for new developers
|
|
694
|
+
- When you need to document existing patterns
|
|
490
695
|
|
|
491
|
-
**What to expect**: Claude
|
|
696
|
+
**What to expect**: Claude scans your code, identifies patterns, and creates documentation files with code examples.
|
|
492
697
|
|
|
493
698
|
---
|
|
494
699
|
|
|
495
700
|
## Common Workflows
|
|
496
701
|
|
|
497
|
-
### Daily
|
|
702
|
+
### Quick Daily Check (30 seconds)
|
|
498
703
|
```bash
|
|
499
|
-
#
|
|
704
|
+
# Before committing changes
|
|
500
705
|
hewtd maintain --quick
|
|
501
706
|
```
|
|
502
707
|
|
|
503
|
-
### Adding New Documentation
|
|
708
|
+
### Adding New Documentation (2 minutes)
|
|
504
709
|
```bash
|
|
505
|
-
# 1
|
|
710
|
+
# Step 1: Write your doc (use any editor)
|
|
506
711
|
vim my-new-guide.md
|
|
507
712
|
|
|
508
|
-
# 2
|
|
713
|
+
# Step 2: Add it to the system
|
|
509
714
|
hewtd integrate my-new-guide.md
|
|
510
715
|
|
|
511
|
-
# 3
|
|
716
|
+
# Step 3: Quick health check
|
|
512
717
|
hewtd maintain --quick --fix
|
|
513
718
|
```
|
|
514
719
|
|
|
515
|
-
### Weekly Maintenance
|
|
720
|
+
### Weekly Maintenance (5 minutes)
|
|
516
721
|
```bash
|
|
517
722
|
# Auto-fix all issues
|
|
518
723
|
hewtd maintain --quick --fix
|
|
519
724
|
|
|
520
725
|
# Review the report
|
|
521
726
|
cat .documentation/reports/maintenance-*.md
|
|
727
|
+
|
|
728
|
+
# Or just look at the health score
|
|
729
|
+
hewtd report health
|
|
522
730
|
```
|
|
523
731
|
|
|
524
|
-
### Before Releasing
|
|
732
|
+
### Before Releasing (10 minutes)
|
|
525
733
|
```bash
|
|
526
|
-
# 1
|
|
734
|
+
# Step 1: Full check with link validation
|
|
527
735
|
hewtd maintain --fix
|
|
528
736
|
|
|
529
|
-
# 2
|
|
737
|
+
# Step 2: Generate health report
|
|
530
738
|
hewtd report health
|
|
531
739
|
|
|
532
|
-
# 3
|
|
533
|
-
#
|
|
740
|
+
# Step 3: Make sure score is above 80
|
|
741
|
+
# If not, check the report for issues
|
|
742
|
+
|
|
743
|
+
# Step 4: Commit changes
|
|
744
|
+
git add .documentation
|
|
745
|
+
git commit -m "docs: update and fix documentation"
|
|
534
746
|
```
|
|
535
747
|
|
|
536
|
-
### Migrating Existing
|
|
748
|
+
### Migrating Existing Docs (30 minutes)
|
|
537
749
|
```bash
|
|
538
|
-
# 1
|
|
750
|
+
# Step 1: Create structure
|
|
539
751
|
hewtd init
|
|
540
752
|
|
|
541
|
-
# 2
|
|
753
|
+
# Step 2: Preview where files will go
|
|
542
754
|
for file in old-docs/*.md; do
|
|
543
755
|
hewtd integrate "$file" --dry-run
|
|
544
756
|
done
|
|
545
757
|
|
|
546
|
-
# 3
|
|
758
|
+
# Step 3: If preview looks good, integrate them all
|
|
547
759
|
for file in old-docs/*.md; do
|
|
548
760
|
hewtd integrate "$file" --auto
|
|
549
761
|
done
|
|
550
762
|
|
|
551
|
-
# 4
|
|
763
|
+
# Step 4: Fix any issues
|
|
552
764
|
hewtd maintain --fix
|
|
553
765
|
|
|
554
|
-
# 5
|
|
766
|
+
# Step 5: Check results
|
|
555
767
|
hewtd report health
|
|
556
768
|
```
|
|
557
769
|
|
|
@@ -561,309 +773,815 @@ hewtd report health
|
|
|
561
773
|
|
|
562
774
|
### Architecture Overview
|
|
563
775
|
|
|
564
|
-
The
|
|
776
|
+
Hit 'Em With The Docs is built with TypeScript and organized into several core modules:
|
|
565
777
|
|
|
566
778
|
```
|
|
567
779
|
src/
|
|
568
|
-
├── cli/
|
|
569
|
-
|
|
570
|
-
│
|
|
571
|
-
|
|
572
|
-
│ ├──
|
|
573
|
-
│ ├──
|
|
574
|
-
│ ├──
|
|
575
|
-
│
|
|
576
|
-
│
|
|
577
|
-
├──
|
|
578
|
-
├──
|
|
579
|
-
|
|
780
|
+
├── cli/ # Command-line interface
|
|
781
|
+
│ └── index.ts # Main CLI entry point and command definitions
|
|
782
|
+
│
|
|
783
|
+
├── core/ # Core business logic
|
|
784
|
+
│ ├── audit/ # Quality auditing
|
|
785
|
+
│ │ ├── auditor.ts # Main audit orchestrator
|
|
786
|
+
│ │ ├── naming.ts # File naming convention checks
|
|
787
|
+
│ │ └── placement.ts # Document placement validation
|
|
788
|
+
│ │
|
|
789
|
+
│ ├── discover/ # Code pattern discovery
|
|
790
|
+
│ │ ├── patterns.ts # Pattern detection (Singleton, Factory, etc.)
|
|
791
|
+
│ │ ├── anti-patterns.ts # Anti-pattern detection
|
|
792
|
+
│ │ ├── standards.ts # Coding standard extraction
|
|
793
|
+
│ │ └── dependencies.ts # Dependency analysis
|
|
794
|
+
│ │
|
|
795
|
+
│ ├── domains/ # Domain classification system
|
|
796
|
+
│ │ ├── definitions.ts # 15 domain definitions with keywords
|
|
797
|
+
│ │ ├── classifier.ts # Smart classification algorithm
|
|
798
|
+
│ │ └── loader.ts # Domain loading and caching
|
|
799
|
+
│ │
|
|
800
|
+
│ ├── integrate/ # Document integration
|
|
801
|
+
│ │ ├── integrator.ts # Main integration orchestrator
|
|
802
|
+
│ │ ├── analyzer.ts # Content analysis for classification
|
|
803
|
+
│ │ └── mover.ts # File movement and organization
|
|
804
|
+
│ │
|
|
805
|
+
│ ├── links/ # Link checking and tracking
|
|
806
|
+
│ │ ├── checker.ts # Link validation
|
|
807
|
+
│ │ ├── parser.ts # Markdown link extraction
|
|
808
|
+
│ │ ├── resolver.ts # Relative path resolution
|
|
809
|
+
│ │ └── topology.ts # Link graph and backlinks
|
|
810
|
+
│ │
|
|
811
|
+
│ ├── maintain/ # Maintenance orchestration
|
|
812
|
+
│ │ ├── orchestrator.ts # Main maintenance coordinator
|
|
813
|
+
│ │ ├── health.ts # Health score calculation
|
|
814
|
+
│ │ └── scheduler.ts # Maintenance scheduling
|
|
815
|
+
│ │
|
|
816
|
+
│ └── metadata/ # Metadata management
|
|
817
|
+
│ ├── sync.ts # Metadata synchronization
|
|
818
|
+
│ ├── validator.ts # Metadata validation
|
|
819
|
+
│ └── generator.ts # Auto-generation of computed fields
|
|
820
|
+
│
|
|
821
|
+
├── generators/ # Scaffold and template generation
|
|
822
|
+
│ ├── scaffold.ts # Documentation structure creation
|
|
823
|
+
│ └── templates/ # Document templates
|
|
824
|
+
│
|
|
825
|
+
├── reports/ # Report generation
|
|
826
|
+
│ ├── health.ts # Health reports
|
|
827
|
+
│ ├── audit.ts # Audit reports
|
|
828
|
+
│ ├── links.ts # Link topology reports
|
|
829
|
+
│ └── formatters/ # Output formatters (markdown, JSON)
|
|
830
|
+
│
|
|
831
|
+
└── utils/ # Shared utilities
|
|
832
|
+
├── files.ts # File system operations
|
|
833
|
+
├── markdown.ts # Markdown parsing and manipulation
|
|
834
|
+
└── logger.ts # Logging and output formatting
|
|
580
835
|
```
|
|
581
836
|
|
|
582
837
|
### File Structure
|
|
583
838
|
|
|
584
|
-
|
|
585
|
-
- `INDEX.md` - Main navigation hub with links to all domains
|
|
586
|
-
- `REGISTRY.md` - Quick reference list of all documents
|
|
587
|
-
- `README.md` - Overview and getting started guide
|
|
839
|
+
When you run `hewtd init`, it creates this structure:
|
|
588
840
|
|
|
589
|
-
**Domain Structure**:
|
|
590
|
-
Each of the 15 domains follows this pattern:
|
|
591
|
-
```
|
|
592
|
-
domain-name/
|
|
593
|
-
├── INDEX.md # Domain table of contents
|
|
594
|
-
├── REGISTRY.md # Quick reference for this domain
|
|
595
|
-
└── *.md # Individual documentation files
|
|
596
|
-
```
|
|
597
|
-
|
|
598
|
-
**Generated Files**:
|
|
599
841
|
```
|
|
600
842
|
.documentation/
|
|
601
|
-
├──
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
│
|
|
605
|
-
|
|
843
|
+
├── INDEX.md # Main navigation hub (links to all domains)
|
|
844
|
+
├── REGISTRY.md # Complete list of all documents (auto-generated)
|
|
845
|
+
├── README.md # Getting started guide for contributors
|
|
846
|
+
│
|
|
847
|
+
├── security/ # Security documentation (priority: 9)
|
|
848
|
+
│ ├── INDEX.md # Security domain table of contents
|
|
849
|
+
│ ├── REGISTRY.md # Quick reference for security docs
|
|
850
|
+
│ └── *.md # Individual security documents
|
|
851
|
+
│
|
|
852
|
+
├── api/ # API documentation (priority: 8)
|
|
853
|
+
│ ├── INDEX.md
|
|
854
|
+
│ ├── REGISTRY.md
|
|
855
|
+
│ └── *.md
|
|
856
|
+
│
|
|
857
|
+
├── database/ # Database documentation (priority: 8)
|
|
858
|
+
│ ├── INDEX.md
|
|
859
|
+
│ ├── REGISTRY.md
|
|
860
|
+
│ └── *.md
|
|
861
|
+
│
|
|
862
|
+
├── testing/ # Testing documentation (priority: 7)
|
|
863
|
+
├── architecture/ # Architecture docs (priority: 7)
|
|
864
|
+
├── standards/ # Coding standards (priority: 10)
|
|
865
|
+
├── devops/ # DevOps/infrastructure (priority: 8)
|
|
866
|
+
├── quickstart/ # Onboarding guides (priority: 9)
|
|
867
|
+
├── features/ # Feature docs (priority: 6)
|
|
868
|
+
├── procedures/ # Step-by-step procedures (priority: 6)
|
|
869
|
+
├── workflows/ # Process documentation (priority: 5)
|
|
870
|
+
├── troubleshooting/ # Debug guides (priority: 6)
|
|
871
|
+
├── agents/ # AI agent docs (priority: 5)
|
|
872
|
+
├── backups/ # Backup/recovery (priority: 4)
|
|
873
|
+
├── plans/ # Planning docs (priority: 3)
|
|
874
|
+
│
|
|
875
|
+
└── reports/ # Generated reports
|
|
876
|
+
├── maintenance-YYYYMMDD-HHMMSS.md
|
|
877
|
+
├── audit-YYYYMMDD-HHMMSS.md
|
|
878
|
+
└── links-YYYYMMDD-HHMMSS.md
|
|
606
879
|
```
|
|
607
880
|
|
|
608
881
|
### Domain System
|
|
609
882
|
|
|
610
|
-
The system organizes documentation into 15 specialized domains:
|
|
611
|
-
|
|
612
|
-
| Domain |
|
|
613
|
-
|
|
614
|
-
| `standards` |
|
|
615
|
-
| `security` |
|
|
616
|
-
| `quickstart` |
|
|
617
|
-
| `devops` |
|
|
618
|
-
| `database` |
|
|
619
|
-
| `api` |
|
|
620
|
-
| `testing` |
|
|
621
|
-
| `architecture` |
|
|
622
|
-
| `features` |
|
|
623
|
-
| `procedures` |
|
|
624
|
-
| `troubleshooting` |
|
|
625
|
-
| `workflows` |
|
|
626
|
-
| `agents` |
|
|
627
|
-
| `backups` |
|
|
628
|
-
| `plans` |
|
|
629
|
-
|
|
630
|
-
**Priority System**:
|
|
883
|
+
The system organizes documentation into 15 specialized domains with different priorities (1-10 scale, higher = more important):
|
|
884
|
+
|
|
885
|
+
| Domain | Priority | Category | Description | Keywords |
|
|
886
|
+
|--------|----------|----------|-------------|----------|
|
|
887
|
+
| `standards` | 10 | development | Coding standards and conventions | standards, conventions, style guide, best practices |
|
|
888
|
+
| `security` | 9 | core | Security, authentication, authorization | security, auth, encryption, oauth, jwt, permissions |
|
|
889
|
+
| `quickstart` | 9 | features | Setup and onboarding guides | quickstart, setup, installation, getting started |
|
|
890
|
+
| `devops` | 8 | core | Deployment and infrastructure | devops, deployment, ci/cd, docker, kubernetes |
|
|
891
|
+
| `database` | 8 | core | Database schema and queries | database, schema, sql, migrations, orm |
|
|
892
|
+
| `api` | 8 | core | API endpoints and specifications | api, endpoint, rest, graphql, http |
|
|
893
|
+
| `testing` | 7 | development | Test strategies and patterns | testing, unit test, integration, e2e |
|
|
894
|
+
| `architecture` | 7 | development | System design and patterns | architecture, design, patterns, structure |
|
|
895
|
+
| `features` | 6 | features | Feature implementation guides | features, implementation, functionality |
|
|
896
|
+
| `procedures` | 6 | features | Step-by-step operations | procedures, steps, operations, how-to |
|
|
897
|
+
| `troubleshooting` | 6 | advanced | Debugging guides | troubleshooting, debug, errors, solutions |
|
|
898
|
+
| `workflows` | 5 | features | Process documentation | workflows, process, pipelines |
|
|
899
|
+
| `agents` | 5 | advanced | AI agent documentation | agents, ai, automation, bots |
|
|
900
|
+
| `backups` | 4 | advanced | Backup and recovery | backups, recovery, restore |
|
|
901
|
+
| `plans` | 3 | advanced | Planning and roadmaps | plans, roadmap, future, planning |
|
|
902
|
+
|
|
903
|
+
**Priority System**: Claude Code and other integrations load higher-priority domains first. This ensures critical documentation (like security and API docs) is available before less-critical content.
|
|
631
904
|
|
|
632
905
|
**Categories**:
|
|
633
|
-
-
|
|
634
|
-
-
|
|
635
|
-
-
|
|
636
|
-
-
|
|
906
|
+
- **core**: Essential infrastructure (security, database, APIs, devops)
|
|
907
|
+
- **development**: Development practices (testing, standards, architecture)
|
|
908
|
+
- **features**: Feature-specific documentation (features, procedures, workflows, quickstart)
|
|
909
|
+
- **advanced**: Specialized content (troubleshooting, agents, backups, plans)
|
|
637
910
|
|
|
638
911
|
### Metadata Schema
|
|
639
912
|
|
|
640
913
|
Every document includes YAML frontmatter with up to 22 fields:
|
|
641
914
|
|
|
642
|
-
|
|
915
|
+
#### Required Fields (Must be present)
|
|
643
916
|
```yaml
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
917
|
+
---
|
|
918
|
+
title: "Document Title" # Human-readable title
|
|
919
|
+
tier: guide # guide|standard|example|reference|admin
|
|
920
|
+
domains: [primary-domain] # Which category/categories it belongs to
|
|
921
|
+
status: active # draft|active|deprecated|archived
|
|
922
|
+
---
|
|
648
923
|
```
|
|
649
924
|
|
|
650
|
-
|
|
925
|
+
#### Auto-Generated Fields (System fills these in)
|
|
651
926
|
```yaml
|
|
652
|
-
word_count: 1234
|
|
653
|
-
estimated_read_time: "5 minutes"
|
|
654
|
-
last_validated: '2024-01-15'
|
|
927
|
+
word_count: 1234 # Calculated from content
|
|
928
|
+
estimated_read_time: "5 minutes" # Based on 200 words/minute
|
|
929
|
+
last_validated: '2024-01-15' # Date of last metadata sync
|
|
930
|
+
backlinks: [] # Generated by link checker
|
|
655
931
|
```
|
|
656
932
|
|
|
657
|
-
|
|
933
|
+
#### Optional Fields (You can add these)
|
|
658
934
|
```yaml
|
|
659
|
-
# Discovery
|
|
660
|
-
purpose: "One-sentence description"
|
|
661
|
-
tags: [
|
|
662
|
-
audience: [developers
|
|
663
|
-
related_docs: [./other-doc.md]
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
935
|
+
# Discovery and Organization
|
|
936
|
+
purpose: "One-sentence description" # What this doc is about
|
|
937
|
+
tags: [security, auth, api] # Searchable tags
|
|
938
|
+
audience: [developers, devops] # Who should read this
|
|
939
|
+
related_docs: [./other-doc.md] # Related documentation
|
|
940
|
+
keywords: [keyword1, keyword2] # Search keywords
|
|
941
|
+
|
|
942
|
+
# Lifecycle Management
|
|
943
|
+
last_updated: '2024-01-15' # When content was last changed
|
|
944
|
+
version: '1.0.0' # Document version
|
|
945
|
+
review_frequency: monthly # How often to review (monthly|quarterly|annually)
|
|
669
946
|
|
|
670
947
|
# Ownership
|
|
671
|
-
author: "
|
|
672
|
-
maintainer: "Team
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
948
|
+
author: "John Doe" # Original author
|
|
949
|
+
maintainer: "Platform Team" # Current maintainer
|
|
950
|
+
contributors: ["Jane", "Bob"] # Additional contributors
|
|
951
|
+
|
|
952
|
+
# Implementation Tracking
|
|
953
|
+
implementation_status: complete # planned|in_progress|complete
|
|
954
|
+
tested: true # Whether examples are tested
|
|
955
|
+
production_ready: true # Ready for production use
|
|
956
|
+
load_priority: 8 # Override default domain priority (1-10)
|
|
957
|
+
|
|
958
|
+
# Additional Context
|
|
959
|
+
prerequisites: ["setup.md", "auth.md"] # Required reading
|
|
960
|
+
difficulty: intermediate # beginner|intermediate|advanced
|
|
680
961
|
```
|
|
681
962
|
|
|
682
963
|
### Classification Algorithm
|
|
683
964
|
|
|
684
|
-
The domain classifier uses keyword-based scoring with
|
|
965
|
+
The domain classifier uses a sophisticated keyword-based scoring system with fuzzy matching:
|
|
966
|
+
|
|
967
|
+
#### Step 1: Content Extraction
|
|
968
|
+
```typescript
|
|
969
|
+
// src/core/domains/classifier.ts
|
|
970
|
+
function extractKeywords(document: Document): string[] {
|
|
971
|
+
// Extract from title (weighted 3x)
|
|
972
|
+
const titleWords = tokenize(document.title);
|
|
973
|
+
|
|
974
|
+
// Extract from content (weighted 1x)
|
|
975
|
+
const contentWords = tokenize(document.content);
|
|
976
|
+
|
|
977
|
+
// Remove stop words (the, and, or, etc.)
|
|
978
|
+
return removeStopWords([...titleWords, ...contentWords]);
|
|
979
|
+
}
|
|
980
|
+
```
|
|
981
|
+
|
|
982
|
+
#### Step 2: Domain Scoring
|
|
983
|
+
```typescript
|
|
984
|
+
function scoreDomain(keywords: string[], domain: Domain): number {
|
|
985
|
+
let score = 0;
|
|
986
|
+
|
|
987
|
+
for (const keyword of keywords) {
|
|
988
|
+
for (const domainKeyword of domain.keywords) {
|
|
989
|
+
// Exact match: +10 points
|
|
990
|
+
if (keyword === domainKeyword) {
|
|
991
|
+
score += 10;
|
|
992
|
+
}
|
|
993
|
+
// Fuzzy match (Levenshtein distance < 3): +5 points
|
|
994
|
+
else if (levenshteinDistance(keyword, domainKeyword) < 3) {
|
|
995
|
+
score += 5;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
return score;
|
|
1001
|
+
}
|
|
1002
|
+
```
|
|
1003
|
+
|
|
1004
|
+
#### Step 3: Confidence Calculation
|
|
1005
|
+
```typescript
|
|
1006
|
+
function calculateConfidence(scores: Map<Domain, number>): Confidence {
|
|
1007
|
+
const topScore = Math.max(...scores.values());
|
|
1008
|
+
const totalScore = Array.from(scores.values()).reduce((a, b) => a + b, 0);
|
|
1009
|
+
|
|
1010
|
+
// Confidence = (top score / total score) * 100
|
|
1011
|
+
const confidence = (topScore / totalScore) * 100;
|
|
1012
|
+
|
|
1013
|
+
return {
|
|
1014
|
+
topDomain: getTopDomain(scores),
|
|
1015
|
+
confidence: Math.round(confidence),
|
|
1016
|
+
suggestions: getTopN(scores, 3) // Top 3 suggestions
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
**Example**:
|
|
1022
|
+
```
|
|
1023
|
+
Document title: "OAuth 2.0 Authentication Guide"
|
|
1024
|
+
Keywords extracted: [oauth, authentication, guide, security, token]
|
|
1025
|
+
|
|
1026
|
+
Scoring:
|
|
1027
|
+
- security domain: oauth(10) + authentication(10) + security(10) = 30
|
|
1028
|
+
- api domain: oauth(5) + authentication(5) = 10
|
|
1029
|
+
- quickstart domain: guide(10) = 10
|
|
1030
|
+
|
|
1031
|
+
Top domain: security (60% confidence)
|
|
1032
|
+
Suggestions: [security, api, quickstart]
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
### Link Tracking System
|
|
1036
|
+
|
|
1037
|
+
The link checker maintains a complete topology of your documentation:
|
|
1038
|
+
|
|
1039
|
+
#### Link Extraction
|
|
1040
|
+
```typescript
|
|
1041
|
+
// src/core/links/parser.ts
|
|
1042
|
+
function extractLinks(markdown: string): Link[] {
|
|
1043
|
+
// Matches: [text](./path.md) and [text](./path.md#anchor)
|
|
1044
|
+
const linkRegex = /\[([^\]]+)\]\(([^)]+)\)/g;
|
|
1045
|
+
|
|
1046
|
+
const links: Link[] = [];
|
|
1047
|
+
let match;
|
|
1048
|
+
|
|
1049
|
+
while ((match = linkRegex.exec(markdown)) !== null) {
|
|
1050
|
+
links.push({
|
|
1051
|
+
text: match[1], // Link text
|
|
1052
|
+
target: match[2], // Link target
|
|
1053
|
+
line: getLineNumber(markdown, match.index)
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
return links;
|
|
1058
|
+
}
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
#### Link Resolution
|
|
1062
|
+
```typescript
|
|
1063
|
+
// src/core/links/resolver.ts
|
|
1064
|
+
function resolveLink(sourceFile: string, target: string): ResolvedLink {
|
|
1065
|
+
// Handle relative paths
|
|
1066
|
+
if (target.startsWith('./') || target.startsWith('../')) {
|
|
1067
|
+
const absolute = path.resolve(path.dirname(sourceFile), target);
|
|
1068
|
+
|
|
1069
|
+
// Remove anchor
|
|
1070
|
+
const [filePath, anchor] = absolute.split('#');
|
|
1071
|
+
|
|
1072
|
+
return {
|
|
1073
|
+
sourceFile,
|
|
1074
|
+
targetFile: filePath,
|
|
1075
|
+
anchor,
|
|
1076
|
+
exists: fs.existsSync(filePath)
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// Handle absolute paths within .documentation
|
|
1081
|
+
if (target.startsWith('/')) {
|
|
1082
|
+
const absolute = path.join(DOCS_ROOT, target);
|
|
1083
|
+
return { /* ... */ };
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
// External links (http://, https://)
|
|
1087
|
+
return { isExternal: true, target };
|
|
1088
|
+
}
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
#### Topology Building
|
|
1092
|
+
```typescript
|
|
1093
|
+
// src/core/links/topology.ts
|
|
1094
|
+
interface LinkTopology {
|
|
1095
|
+
forward: Map<string, string[]>; // file -> [linked files]
|
|
1096
|
+
backward: Map<string, string[]>; // file -> [files that link to it]
|
|
1097
|
+
broken: BrokenLink[]; // List of broken links
|
|
1098
|
+
orphaned: string[]; // Files with no incoming links
|
|
1099
|
+
}
|
|
685
1100
|
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
1101
|
+
function buildTopology(documents: Document[]): LinkTopology {
|
|
1102
|
+
const topology: LinkTopology = {
|
|
1103
|
+
forward: new Map(),
|
|
1104
|
+
backward: new Map(),
|
|
1105
|
+
broken: [],
|
|
1106
|
+
orphaned: []
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
// Build forward links
|
|
1110
|
+
for (const doc of documents) {
|
|
1111
|
+
const links = extractLinks(doc.content);
|
|
1112
|
+
const resolved = links.map(link => resolveLink(doc.path, link.target));
|
|
1113
|
+
|
|
1114
|
+
topology.forward.set(doc.path, resolved.map(r => r.targetFile));
|
|
1115
|
+
|
|
1116
|
+
// Track broken links
|
|
1117
|
+
for (const link of resolved) {
|
|
1118
|
+
if (!link.exists) {
|
|
1119
|
+
topology.broken.push({ source: doc.path, target: link.target });
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
690
1123
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
1124
|
+
// Build backward links (backlinks)
|
|
1125
|
+
for (const [source, targets] of topology.forward) {
|
|
1126
|
+
for (const target of targets) {
|
|
1127
|
+
if (!topology.backward.has(target)) {
|
|
1128
|
+
topology.backward.set(target, []);
|
|
1129
|
+
}
|
|
1130
|
+
topology.backward.get(target)!.push(source);
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
695
1133
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
1134
|
+
// Find orphaned documents
|
|
1135
|
+
for (const doc of documents) {
|
|
1136
|
+
if (!topology.backward.has(doc.path)) {
|
|
1137
|
+
topology.orphaned.push(doc.path);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
700
1140
|
|
|
701
|
-
|
|
1141
|
+
return topology;
|
|
1142
|
+
}
|
|
1143
|
+
```
|
|
702
1144
|
|
|
703
|
-
|
|
1145
|
+
### Maintenance Orchestration
|
|
1146
|
+
|
|
1147
|
+
The maintenance system coordinates multiple checks and generates a comprehensive health score:
|
|
1148
|
+
|
|
1149
|
+
```typescript
|
|
1150
|
+
// src/core/maintain/orchestrator.ts
|
|
1151
|
+
async function runMaintenance(options: MaintenanceOptions): Promise<MaintenanceReport> {
|
|
1152
|
+
const report: MaintenanceReport = {
|
|
1153
|
+
timestamp: new Date(),
|
|
1154
|
+
healthScore: 0,
|
|
1155
|
+
issues: [],
|
|
1156
|
+
fixed: [],
|
|
1157
|
+
statistics: {}
|
|
1158
|
+
};
|
|
1159
|
+
|
|
1160
|
+
// Step 1: Metadata Sync (40% of health score)
|
|
1161
|
+
console.log('Step 1: Metadata Sync');
|
|
1162
|
+
const metadataResults = await syncMetadata(options);
|
|
1163
|
+
report.statistics.metadataCompliance = metadataResults.compliance;
|
|
1164
|
+
report.healthScore += metadataResults.compliance * 0.4;
|
|
1165
|
+
|
|
1166
|
+
// Step 2: Link Check (30% of health score) - optional in quick mode
|
|
1167
|
+
if (!options.quick) {
|
|
1168
|
+
console.log('Step 2: Link Check');
|
|
1169
|
+
const linkResults = await checkLinks(options);
|
|
1170
|
+
report.statistics.linkHealth = linkResults.health;
|
|
1171
|
+
report.healthScore += linkResults.health * 0.3;
|
|
1172
|
+
report.statistics.brokenLinks = linkResults.broken.length;
|
|
1173
|
+
}
|
|
704
1174
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
1175
|
+
// Step 3: Audit (30% of health score)
|
|
1176
|
+
console.log('Step 3: Audit');
|
|
1177
|
+
const auditResults = await runAudit(options);
|
|
1178
|
+
const namingScore = auditResults.namingCompliance;
|
|
1179
|
+
const placementScore = auditResults.placementAccuracy;
|
|
1180
|
+
report.statistics.namingCompliance = namingScore;
|
|
1181
|
+
report.statistics.placementAccuracy = placementScore;
|
|
1182
|
+
report.healthScore += (namingScore * 0.2) + (placementScore * 0.1);
|
|
710
1183
|
|
|
711
|
-
|
|
1184
|
+
// Step 4: Generate Report
|
|
1185
|
+
console.log('Step 4: Generate Report');
|
|
1186
|
+
await writeReport(report, options);
|
|
712
1187
|
|
|
713
|
-
|
|
1188
|
+
return report;
|
|
1189
|
+
}
|
|
1190
|
+
```
|
|
714
1191
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
1192
|
+
**Health Score Breakdown**:
|
|
1193
|
+
- **Metadata Completeness (40%)**: How many required fields are filled in
|
|
1194
|
+
- **Link Health (30%)**: Percentage of valid links (skipped in quick mode)
|
|
1195
|
+
- **Naming Compliance (20%)**: Files following kebab-case convention
|
|
1196
|
+
- **Placement Accuracy (10%)**: Files in correct domains
|
|
719
1197
|
|
|
720
|
-
|
|
721
|
-
-
|
|
722
|
-
-
|
|
723
|
-
-
|
|
724
|
-
-
|
|
1198
|
+
**Target Scores**:
|
|
1199
|
+
- 90-100: Excellent (production-ready)
|
|
1200
|
+
- 80-89: Good (acceptable for production)
|
|
1201
|
+
- 70-79: Fair (needs improvement)
|
|
1202
|
+
- Below 70: Poor (requires immediate attention)
|
|
725
1203
|
|
|
726
|
-
### GitHub Action
|
|
1204
|
+
### GitHub Action Integration
|
|
727
1205
|
|
|
728
|
-
The
|
|
1206
|
+
The GitHub Action wraps the CLI for automated checks:
|
|
729
1207
|
|
|
730
|
-
|
|
731
|
-
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
1208
|
+
```yaml
|
|
1209
|
+
# .github/workflows/docs-check.yml
|
|
1210
|
+
name: Documentation Health
|
|
1211
|
+
|
|
1212
|
+
on:
|
|
1213
|
+
push:
|
|
1214
|
+
paths:
|
|
1215
|
+
- '.documentation/**'
|
|
1216
|
+
pull_request:
|
|
1217
|
+
paths:
|
|
1218
|
+
- '.documentation/**'
|
|
1219
|
+
schedule:
|
|
1220
|
+
- cron: '0 16 * * 5' # Every Friday at 4 PM UTC
|
|
1221
|
+
|
|
1222
|
+
jobs:
|
|
1223
|
+
docs-health:
|
|
1224
|
+
runs-on: ubuntu-latest
|
|
1225
|
+
steps:
|
|
1226
|
+
- uses: actions/checkout@v4
|
|
1227
|
+
|
|
1228
|
+
- name: Check Documentation
|
|
1229
|
+
uses: TheGlitchKing/hit-em-with-the-docs@v2
|
|
1230
|
+
with:
|
|
1231
|
+
command: maintain # Command to run
|
|
1232
|
+
mode: quick # quick|full|fix
|
|
1233
|
+
docs-path: .documentation # Path to docs
|
|
1234
|
+
fail-on-error: true # Fail if issues found
|
|
1235
|
+
fail-threshold: 80 # Minimum health score
|
|
1236
|
+
|
|
1237
|
+
- name: Upload Report
|
|
1238
|
+
if: always()
|
|
1239
|
+
uses: actions/upload-artifact@v3
|
|
1240
|
+
with:
|
|
1241
|
+
name: docs-report
|
|
1242
|
+
path: .documentation/reports/
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
**Available Inputs**:
|
|
1246
|
+
- `command`: CLI command (maintain, audit, link-check, report)
|
|
1247
|
+
- `mode`: Execution mode (quick, full, fix)
|
|
1248
|
+
- `docs-path`: Path to documentation folder (default: .documentation)
|
|
1249
|
+
- `domain`: Filter by specific domain
|
|
1250
|
+
- `fail-on-error`: Whether to fail if issues found (default: false)
|
|
1251
|
+
- `fail-threshold`: Minimum health score to pass (0-100)
|
|
737
1252
|
|
|
738
1253
|
**Outputs**:
|
|
739
|
-
- `health-score`: Overall quality (0-100)
|
|
740
|
-
- `total-documents`:
|
|
741
|
-
- `issues-found`:
|
|
742
|
-
- `issues-fixed`:
|
|
743
|
-
- `broken-links`:
|
|
744
|
-
- `metadata-compliance`: Metadata completeness
|
|
745
|
-
- `report-path`:
|
|
1254
|
+
- `health-score`: Overall quality score (0-100)
|
|
1255
|
+
- `total-documents`: Number of documents found
|
|
1256
|
+
- `issues-found`: Number of problems detected
|
|
1257
|
+
- `issues-fixed`: Number of auto-fixed issues (only in fix mode)
|
|
1258
|
+
- `broken-links`: Number of broken links
|
|
1259
|
+
- `metadata-compliance`: Metadata completeness percentage
|
|
1260
|
+
- `report-path`: Path to generated report
|
|
746
1261
|
|
|
747
1262
|
### Edge Cases and Handling
|
|
748
1263
|
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
1264
|
+
#### Duplicate Documents
|
|
1265
|
+
```typescript
|
|
1266
|
+
// Detected during integration
|
|
1267
|
+
if (documentExists(targetPath)) {
|
|
1268
|
+
if (options.force) {
|
|
1269
|
+
// Overwrite existing
|
|
1270
|
+
overwriteDocument(targetPath, document);
|
|
1271
|
+
} else {
|
|
1272
|
+
// Prompt user
|
|
1273
|
+
const action = await prompt('Document exists. Merge or keep separate?');
|
|
1274
|
+
if (action === 'merge') {
|
|
1275
|
+
mergeDocuments(existing, document);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
```
|
|
753
1280
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
-
|
|
757
|
-
|
|
1281
|
+
#### Missing Metadata
|
|
1282
|
+
```typescript
|
|
1283
|
+
// Auto-generate with defaults
|
|
1284
|
+
const metadata = {
|
|
1285
|
+
title: inferTitleFromContent(document),
|
|
1286
|
+
tier: 'guide', // Default tier
|
|
1287
|
+
domains: [classifyDomain(document)],
|
|
1288
|
+
status: 'draft', // Default status
|
|
1289
|
+
word_count: countWords(document),
|
|
1290
|
+
estimated_read_time: calculateReadTime(document),
|
|
1291
|
+
last_validated: new Date().toISOString()
|
|
1292
|
+
};
|
|
1293
|
+
```
|
|
758
1294
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
1295
|
+
#### Circular Links
|
|
1296
|
+
```typescript
|
|
1297
|
+
// Not flagged as errors (useful for navigation)
|
|
1298
|
+
function detectCircularLinks(topology: LinkTopology): CircularPath[] {
|
|
1299
|
+
const circles = [];
|
|
1300
|
+
|
|
1301
|
+
for (const [source, targets] of topology.forward) {
|
|
1302
|
+
for (const target of targets) {
|
|
1303
|
+
if (topology.forward.get(target)?.includes(source)) {
|
|
1304
|
+
circles.push({ from: source, to: target, type: 'bidirectional' });
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
763
1308
|
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
1309
|
+
// Log for information only
|
|
1310
|
+
console.log(`Found ${circles.length} bidirectional links (not an error)`);
|
|
1311
|
+
return circles;
|
|
1312
|
+
}
|
|
1313
|
+
```
|
|
768
1314
|
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1315
|
+
#### Large Files
|
|
1316
|
+
```typescript
|
|
1317
|
+
// Warn about oversized documents
|
|
1318
|
+
const MAX_SIZE = 50_000; // 50 KB
|
|
1319
|
+
|
|
1320
|
+
if (document.size > MAX_SIZE) {
|
|
1321
|
+
console.warn(`⚠️ ${document.path} is ${formatSize(document.size)}`);
|
|
1322
|
+
console.warn(' Consider splitting into multiple documents');
|
|
1323
|
+
issues.push({
|
|
1324
|
+
type: 'oversized',
|
|
1325
|
+
file: document.path,
|
|
1326
|
+
size: document.size,
|
|
1327
|
+
suggestion: 'Split into smaller documents'
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
```
|
|
773
1331
|
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
1332
|
+
#### Empty Documents
|
|
1333
|
+
```typescript
|
|
1334
|
+
// Flag in audit, exclude from health score
|
|
1335
|
+
if (document.content.trim().length === 0) {
|
|
1336
|
+
issues.push({
|
|
1337
|
+
type: 'empty',
|
|
1338
|
+
file: document.path,
|
|
1339
|
+
severity: 'warning',
|
|
1340
|
+
suggestion: 'Add content or remove file'
|
|
1341
|
+
});
|
|
1342
|
+
|
|
1343
|
+
// Don't include in health score calculation
|
|
1344
|
+
excludeFromHealthScore(document);
|
|
1345
|
+
}
|
|
1346
|
+
```
|
|
778
1347
|
|
|
779
1348
|
### Configuration
|
|
780
1349
|
|
|
781
|
-
Create `.hewtd.config.json` for customization:
|
|
1350
|
+
Create `.hewtd.config.json` in your project root for customization:
|
|
782
1351
|
|
|
783
1352
|
```json
|
|
784
1353
|
{
|
|
785
1354
|
"docsPath": ".documentation",
|
|
1355
|
+
|
|
786
1356
|
"domains": {
|
|
787
1357
|
"custom-domain": {
|
|
788
|
-
"description": "Custom domain
|
|
789
|
-
"keywords": ["
|
|
1358
|
+
"description": "Custom domain for specific docs",
|
|
1359
|
+
"keywords": ["custom", "specific", "domain"],
|
|
790
1360
|
"loadPriority": 5,
|
|
791
1361
|
"category": "features"
|
|
792
1362
|
}
|
|
793
1363
|
},
|
|
1364
|
+
|
|
794
1365
|
"metadata": {
|
|
795
1366
|
"requiredFields": ["title", "tier", "domains", "status"],
|
|
796
|
-
"autoGenerate": ["word_count", "estimated_read_time", "last_validated"]
|
|
1367
|
+
"autoGenerate": ["word_count", "estimated_read_time", "last_validated"],
|
|
1368
|
+
"customFields": {
|
|
1369
|
+
"team": { "type": "string", "description": "Owning team" },
|
|
1370
|
+
"jira_ticket": { "type": "string", "pattern": "^[A-Z]+-\\d+$" }
|
|
1371
|
+
}
|
|
797
1372
|
},
|
|
1373
|
+
|
|
798
1374
|
"audit": {
|
|
799
1375
|
"namingConvention": "kebab-case",
|
|
800
1376
|
"maxFileSize": 50000,
|
|
801
|
-
"allowedTiers": ["guide", "standard", "example", "reference", "admin"]
|
|
1377
|
+
"allowedTiers": ["guide", "standard", "example", "reference", "admin"],
|
|
1378
|
+
"requiredDomains": ["security", "api", "testing"]
|
|
802
1379
|
},
|
|
1380
|
+
|
|
803
1381
|
"discover": {
|
|
804
|
-
"excludePaths": ["node_modules", "dist", "vendor", ".git"],
|
|
805
|
-
"languages": ["typescript", "javascript", "python", "go"],
|
|
1382
|
+
"excludePaths": ["node_modules", "dist", "build", "vendor", ".git"],
|
|
1383
|
+
"languages": ["typescript", "javascript", "python", "go", "java"],
|
|
806
1384
|
"patterns": {
|
|
807
1385
|
"enabled": true,
|
|
808
1386
|
"minOccurrences": 2
|
|
1387
|
+
},
|
|
1388
|
+
"antiPatterns": {
|
|
1389
|
+
"enabled": true,
|
|
1390
|
+
"severity": "warning"
|
|
809
1391
|
}
|
|
810
1392
|
},
|
|
1393
|
+
|
|
811
1394
|
"links": {
|
|
812
1395
|
"checkExternal": false,
|
|
813
|
-
"ignorePatterns": ["http://localhost", "*.example.com"]
|
|
1396
|
+
"ignorePatterns": ["http://localhost", "*.example.com", "*.test"],
|
|
1397
|
+
"allowedProtocols": ["http", "https", "mailto"],
|
|
1398
|
+
"checkAnchors": true
|
|
814
1399
|
},
|
|
1400
|
+
|
|
815
1401
|
"reports": {
|
|
816
1402
|
"outputPath": ".documentation/reports",
|
|
817
1403
|
"format": "markdown",
|
|
818
|
-
"includeTimestamp": true
|
|
1404
|
+
"includeTimestamp": true,
|
|
1405
|
+
"retention": {
|
|
1406
|
+
"days": 90,
|
|
1407
|
+
"maxReports": 50
|
|
1408
|
+
}
|
|
1409
|
+
},
|
|
1410
|
+
|
|
1411
|
+
"maintenance": {
|
|
1412
|
+
"autoFix": true,
|
|
1413
|
+
"quickMode": {
|
|
1414
|
+
"skipLinkCheck": true,
|
|
1415
|
+
"skipExternalLinks": true
|
|
1416
|
+
},
|
|
1417
|
+
"schedule": {
|
|
1418
|
+
"daily": "0 9 * * *", // 9 AM daily
|
|
1419
|
+
"weekly": "0 16 * * 5" // 4 PM Friday
|
|
1420
|
+
}
|
|
819
1421
|
}
|
|
820
1422
|
}
|
|
821
1423
|
```
|
|
822
1424
|
|
|
823
1425
|
### Performance Considerations
|
|
824
1426
|
|
|
825
|
-
|
|
826
|
-
-
|
|
827
|
-
- Parallel
|
|
828
|
-
- Configurable
|
|
829
|
-
- Quick
|
|
1427
|
+
#### Large Repositories
|
|
1428
|
+
- **Streaming**: Files read in chunks, not loaded entirely into memory
|
|
1429
|
+
- **Parallel Processing**: Uses worker threads for document processing
|
|
1430
|
+
- **Concurrency Limits**: Configurable max concurrent operations
|
|
1431
|
+
- **Quick Mode**: Skips expensive operations (link checking) for speed
|
|
1432
|
+
- **Caching**: Metadata cached during operations, invalidated on changes
|
|
830
1433
|
|
|
831
|
-
|
|
832
|
-
-
|
|
833
|
-
- Link
|
|
834
|
-
-
|
|
1434
|
+
#### Memory Usage
|
|
1435
|
+
- **Incremental Processing**: Documents processed one at a time
|
|
1436
|
+
- **Link Topology**: Built incrementally to avoid loading all links at once
|
|
1437
|
+
- **Report Streaming**: Large reports streamed to disk instead of buffered
|
|
1438
|
+
- **Garbage Collection**: Explicit cleanup after major operations
|
|
1439
|
+
|
|
1440
|
+
#### CI/CD Optimization
|
|
1441
|
+
```yaml
|
|
1442
|
+
# Fast checks (30-60 seconds)
|
|
1443
|
+
- name: Quick Check
|
|
1444
|
+
run: hewtd maintain --quick
|
|
1445
|
+
|
|
1446
|
+
# Thorough checks (2-5 minutes) - scheduled only
|
|
1447
|
+
- name: Full Check
|
|
1448
|
+
if: github.event.schedule
|
|
1449
|
+
run: hewtd maintain --fix
|
|
1450
|
+
|
|
1451
|
+
# Conditional failure
|
|
1452
|
+
- name: Check with Threshold
|
|
1453
|
+
run: hewtd maintain --fail-threshold 70
|
|
1454
|
+
```
|
|
835
1455
|
|
|
836
|
-
**
|
|
837
|
-
-
|
|
838
|
-
-
|
|
839
|
-
- Use
|
|
1456
|
+
**Recommended Strategies**:
|
|
1457
|
+
- **PR Checks**: Use `--quick` mode (fast, catches most issues)
|
|
1458
|
+
- **Daily Scheduled**: Use full mode with `--fix` (thorough)
|
|
1459
|
+
- **Release Checks**: Use full mode with strict threshold (80+)
|
|
1460
|
+
- **Use fail-threshold**: Allow gradual improvement (start at 60, increase over time)
|
|
840
1461
|
|
|
841
1462
|
---
|
|
842
1463
|
|
|
843
1464
|
## Requirements
|
|
844
1465
|
|
|
845
|
-
- Node.js
|
|
846
|
-
- npm or
|
|
847
|
-
-
|
|
1466
|
+
- **Node.js**: Version 20.0.0 or higher
|
|
1467
|
+
- **npm**: Version 8.0.0 or higher (comes with Node.js)
|
|
1468
|
+
- **Operating System**: Linux, macOS, or Windows (with WSL2)
|
|
1469
|
+
- **Git**: Version 2.0+ (for GitHub Action)
|
|
1470
|
+
|
|
1471
|
+
---
|
|
1472
|
+
|
|
1473
|
+
## Troubleshooting
|
|
1474
|
+
|
|
1475
|
+
### Installation Issues
|
|
1476
|
+
|
|
1477
|
+
**Problem**: `npm install` fails with permission errors
|
|
1478
|
+
|
|
1479
|
+
**Solution**:
|
|
1480
|
+
```bash
|
|
1481
|
+
# Don't use sudo! Instead, fix npm permissions:
|
|
1482
|
+
mkdir ~/.npm-global
|
|
1483
|
+
npm config set prefix '~/.npm-global'
|
|
1484
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
|
|
1485
|
+
source ~/.bashrc
|
|
1486
|
+
|
|
1487
|
+
# Now install again
|
|
1488
|
+
npm install -g @theglitchking/hit-em-with-the-docs
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
**Problem**: `hewtd: command not found` after installation
|
|
1492
|
+
|
|
1493
|
+
**Solution**:
|
|
1494
|
+
```bash
|
|
1495
|
+
# Check if npm bin is in your PATH
|
|
1496
|
+
npm config get prefix
|
|
1497
|
+
|
|
1498
|
+
# Add it to your PATH
|
|
1499
|
+
export PATH="$(npm config get prefix)/bin:$PATH"
|
|
1500
|
+
|
|
1501
|
+
# Add to your shell profile (~/.bashrc or ~/.zshrc)
|
|
1502
|
+
echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrc
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
### Usage Issues
|
|
1506
|
+
|
|
1507
|
+
**Problem**: "No .documentation folder found"
|
|
1508
|
+
|
|
1509
|
+
**Solution**: Run `hewtd init` to create the structure first
|
|
1510
|
+
|
|
1511
|
+
**Problem**: Health score is very low (below 50)
|
|
1512
|
+
|
|
1513
|
+
**Solution**:
|
|
1514
|
+
```bash
|
|
1515
|
+
# Auto-fix as much as possible
|
|
1516
|
+
hewtd maintain --fix
|
|
1517
|
+
|
|
1518
|
+
# Check the report for remaining issues
|
|
1519
|
+
cat .documentation/reports/maintenance-*.md
|
|
1520
|
+
|
|
1521
|
+
# Common issues:
|
|
1522
|
+
# - Missing metadata: hewtd metadata-sync --fix
|
|
1523
|
+
# - Broken links: hewtd link-check and fix manually
|
|
1524
|
+
# - Wrong file names: Rename to kebab-case (my-file.md)
|
|
1525
|
+
```
|
|
1526
|
+
|
|
1527
|
+
**Problem**: `hewtd integrate` doesn't put file in the right category
|
|
1528
|
+
|
|
1529
|
+
**Solution**:
|
|
1530
|
+
```bash
|
|
1531
|
+
# Don't use --auto, let it ask you
|
|
1532
|
+
hewtd integrate ./my-file.md
|
|
1533
|
+
|
|
1534
|
+
# Or move it manually after integration
|
|
1535
|
+
mv .documentation/wrong-domain/file.md .documentation/right-domain/
|
|
1536
|
+
```
|
|
1537
|
+
|
|
1538
|
+
---
|
|
1539
|
+
|
|
1540
|
+
## Migration from v1.x to v2.0
|
|
1541
|
+
|
|
1542
|
+
If you're upgrading from the old unscoped package, see [MIGRATION.md](./MIGRATION.md) for detailed instructions.
|
|
1543
|
+
|
|
1544
|
+
**Quick Migration Steps**:
|
|
1545
|
+
```bash
|
|
1546
|
+
# Uninstall old version
|
|
1547
|
+
npm uninstall -g hit-em-with-the-docs
|
|
1548
|
+
|
|
1549
|
+
# Install new scoped version
|
|
1550
|
+
npm install -g @theglitchking/hit-em-with-the-docs
|
|
1551
|
+
|
|
1552
|
+
# Verify
|
|
1553
|
+
hewtd --version # Should show 2.0.0 or higher
|
|
1554
|
+
|
|
1555
|
+
# Everything else works the same!
|
|
1556
|
+
```
|
|
1557
|
+
|
|
1558
|
+
---
|
|
848
1559
|
|
|
849
1560
|
## Contributing
|
|
850
1561
|
|
|
851
|
-
Contributions are welcome!
|
|
1562
|
+
Contributions are welcome! See [CONTRIBUTING.md](./CONTRIBUTING.md) for:
|
|
852
1563
|
- Setting up development environment
|
|
853
1564
|
- Running tests
|
|
854
1565
|
- Code style guidelines
|
|
855
1566
|
- Submitting pull requests
|
|
856
1567
|
|
|
1568
|
+
---
|
|
1569
|
+
|
|
857
1570
|
## License
|
|
858
1571
|
|
|
859
|
-
MIT - see [LICENSE](LICENSE) for details.
|
|
1572
|
+
MIT License - see [LICENSE](./LICENSE) file for details.
|
|
1573
|
+
|
|
1574
|
+
---
|
|
860
1575
|
|
|
861
1576
|
## Support
|
|
862
1577
|
|
|
863
|
-
- **Issues**: [
|
|
864
|
-
- **Discussions**: [
|
|
865
|
-
- **
|
|
1578
|
+
- **GitHub Issues**: [Report bugs or request features](https://github.com/TheGlitchKing/hit-em-with-the-docs/issues)
|
|
1579
|
+
- **GitHub Discussions**: [Ask questions or share ideas](https://github.com/TheGlitchKing/hit-em-with-the-docs/discussions)
|
|
1580
|
+
- **NPM Package**: [@theglitchking/hit-em-with-the-docs](https://www.npmjs.com/package/@theglitchking/hit-em-with-the-docs)
|
|
1581
|
+
- **Changelog**: [View version history](https://github.com/TheGlitchKing/hit-em-with-the-docs/releases)
|
|
1582
|
+
|
|
1583
|
+
---
|
|
866
1584
|
|
|
867
|
-
|
|
1585
|
+
**Made with ❤️ by TheGlitchKing**
|
|
868
1586
|
|
|
869
|
-
|
|
1587
|
+
[NPM](https://www.npmjs.com/package/@theglitchking/hit-em-with-the-docs) | [GitHub](https://github.com/TheGlitchKing/hit-em-with-the-docs) | [Issues](https://github.com/TheGlitchKing/hit-em-with-the-docs/issues)
|