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