@theglitchking/hit-em-with-the-docs 2.0.0

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.
Files changed (200) hide show
  1. package/.claude-plugin/marketplace.json +46 -0
  2. package/.claude-plugin/plugin.json +114 -0
  3. package/LICENSE +21 -0
  4. package/MIGRATION.md +255 -0
  5. package/README.backup.md +714 -0
  6. package/README.md +869 -0
  7. package/action.yml +56 -0
  8. package/dist/action/action/index.d.ts +2 -0
  9. package/dist/action/action/index.d.ts.map +1 -0
  10. package/dist/action/cli/index.d.ts +3 -0
  11. package/dist/action/cli/index.d.ts.map +1 -0
  12. package/dist/action/core/audit/auditor.d.ts +43 -0
  13. package/dist/action/core/audit/auditor.d.ts.map +1 -0
  14. package/dist/action/core/audit/rules.d.ts +37 -0
  15. package/dist/action/core/audit/rules.d.ts.map +1 -0
  16. package/dist/action/core/discover/antipatterns.d.ts +24 -0
  17. package/dist/action/core/discover/antipatterns.d.ts.map +1 -0
  18. package/dist/action/core/discover/dependencies.d.ts +57 -0
  19. package/dist/action/core/discover/dependencies.d.ts.map +1 -0
  20. package/dist/action/core/discover/patterns.d.ts +38 -0
  21. package/dist/action/core/discover/patterns.d.ts.map +1 -0
  22. package/dist/action/core/discover/standards.d.ts +58 -0
  23. package/dist/action/core/discover/standards.d.ts.map +1 -0
  24. package/dist/action/core/domains/classifier.d.ts +41 -0
  25. package/dist/action/core/domains/classifier.d.ts.map +1 -0
  26. package/dist/action/core/domains/constants.d.ts +40 -0
  27. package/dist/action/core/domains/constants.d.ts.map +1 -0
  28. package/dist/action/core/domains/detector.d.ts +35 -0
  29. package/dist/action/core/domains/detector.d.ts.map +1 -0
  30. package/dist/action/core/integrate/integrator.d.ts +35 -0
  31. package/dist/action/core/integrate/integrator.d.ts.map +1 -0
  32. package/dist/action/core/links/checker.d.ts +64 -0
  33. package/dist/action/core/links/checker.d.ts.map +1 -0
  34. package/dist/action/core/links/tracker.d.ts +69 -0
  35. package/dist/action/core/links/tracker.d.ts.map +1 -0
  36. package/dist/action/core/maintain/orchestrator.d.ts +39 -0
  37. package/dist/action/core/maintain/orchestrator.d.ts.map +1 -0
  38. package/dist/action/core/metadata/generator.d.ts +26 -0
  39. package/dist/action/core/metadata/generator.d.ts.map +1 -0
  40. package/dist/action/core/metadata/schema.d.ts +201 -0
  41. package/dist/action/core/metadata/schema.d.ts.map +1 -0
  42. package/dist/action/core/metadata/sync.d.ts +36 -0
  43. package/dist/action/core/metadata/sync.d.ts.map +1 -0
  44. package/dist/action/generators/index-generator.d.ts +19 -0
  45. package/dist/action/generators/index-generator.d.ts.map +1 -0
  46. package/dist/action/generators/registry-generator.d.ts +11 -0
  47. package/dist/action/generators/registry-generator.d.ts.map +1 -0
  48. package/dist/action/generators/scaffold.d.ts +30 -0
  49. package/dist/action/generators/scaffold.d.ts.map +1 -0
  50. package/dist/action/generators/templates/document.d.ts +14 -0
  51. package/dist/action/generators/templates/document.d.ts.map +1 -0
  52. package/dist/action/generators/templates/domain-index.d.ts +6 -0
  53. package/dist/action/generators/templates/domain-index.d.ts.map +1 -0
  54. package/dist/action/generators/templates/domain-registry.d.ts +6 -0
  55. package/dist/action/generators/templates/domain-registry.d.ts.map +1 -0
  56. package/dist/action/index.d.ts +31 -0
  57. package/dist/action/index.d.ts.map +1 -0
  58. package/dist/action/index.js +17 -0
  59. package/dist/action/index.js.map +1 -0
  60. package/dist/action/package.json +3 -0
  61. package/dist/action/reports/audit-report.d.ts +15 -0
  62. package/dist/action/reports/audit-report.d.ts.map +1 -0
  63. package/dist/action/reports/health-report.d.ts +15 -0
  64. package/dist/action/reports/health-report.d.ts.map +1 -0
  65. package/dist/action/reports/link-report.d.ts +15 -0
  66. package/dist/action/reports/link-report.d.ts.map +1 -0
  67. package/dist/action/utils/frontmatter.d.ts +50 -0
  68. package/dist/action/utils/frontmatter.d.ts.map +1 -0
  69. package/dist/action/utils/glob.d.ts +63 -0
  70. package/dist/action/utils/glob.d.ts.map +1 -0
  71. package/dist/action/utils/logger.d.ts +42 -0
  72. package/dist/action/utils/logger.d.ts.map +1 -0
  73. package/dist/action/utils/markdown.d.ts +89 -0
  74. package/dist/action/utils/markdown.d.ts.map +1 -0
  75. package/dist/cli/index.d.ts +3 -0
  76. package/dist/cli/index.d.ts.map +1 -0
  77. package/dist/cli/index.js +287 -0
  78. package/dist/cli/index.js.map +1 -0
  79. package/dist/core/audit/auditor.d.ts +43 -0
  80. package/dist/core/audit/auditor.d.ts.map +1 -0
  81. package/dist/core/audit/auditor.js +273 -0
  82. package/dist/core/audit/auditor.js.map +1 -0
  83. package/dist/core/audit/rules.d.ts +37 -0
  84. package/dist/core/audit/rules.d.ts.map +1 -0
  85. package/dist/core/audit/rules.js +223 -0
  86. package/dist/core/audit/rules.js.map +1 -0
  87. package/dist/core/discover/antipatterns.d.ts +24 -0
  88. package/dist/core/discover/antipatterns.d.ts.map +1 -0
  89. package/dist/core/discover/antipatterns.js +354 -0
  90. package/dist/core/discover/antipatterns.js.map +1 -0
  91. package/dist/core/discover/dependencies.d.ts +57 -0
  92. package/dist/core/discover/dependencies.d.ts.map +1 -0
  93. package/dist/core/discover/dependencies.js +311 -0
  94. package/dist/core/discover/dependencies.js.map +1 -0
  95. package/dist/core/discover/patterns.d.ts +38 -0
  96. package/dist/core/discover/patterns.d.ts.map +1 -0
  97. package/dist/core/discover/patterns.js +371 -0
  98. package/dist/core/discover/patterns.js.map +1 -0
  99. package/dist/core/discover/standards.d.ts +58 -0
  100. package/dist/core/discover/standards.d.ts.map +1 -0
  101. package/dist/core/discover/standards.js +359 -0
  102. package/dist/core/discover/standards.js.map +1 -0
  103. package/dist/core/domains/classifier.d.ts +41 -0
  104. package/dist/core/domains/classifier.d.ts.map +1 -0
  105. package/dist/core/domains/classifier.js +208 -0
  106. package/dist/core/domains/classifier.js.map +1 -0
  107. package/dist/core/domains/constants.d.ts +40 -0
  108. package/dist/core/domains/constants.d.ts.map +1 -0
  109. package/dist/core/domains/constants.js +252 -0
  110. package/dist/core/domains/constants.js.map +1 -0
  111. package/dist/core/domains/detector.d.ts +35 -0
  112. package/dist/core/domains/detector.d.ts.map +1 -0
  113. package/dist/core/domains/detector.js +176 -0
  114. package/dist/core/domains/detector.js.map +1 -0
  115. package/dist/core/integrate/integrator.d.ts +35 -0
  116. package/dist/core/integrate/integrator.d.ts.map +1 -0
  117. package/dist/core/integrate/integrator.js +216 -0
  118. package/dist/core/integrate/integrator.js.map +1 -0
  119. package/dist/core/links/checker.d.ts +64 -0
  120. package/dist/core/links/checker.d.ts.map +1 -0
  121. package/dist/core/links/checker.js +190 -0
  122. package/dist/core/links/checker.js.map +1 -0
  123. package/dist/core/links/tracker.d.ts +69 -0
  124. package/dist/core/links/tracker.d.ts.map +1 -0
  125. package/dist/core/links/tracker.js +184 -0
  126. package/dist/core/links/tracker.js.map +1 -0
  127. package/dist/core/maintain/orchestrator.d.ts +39 -0
  128. package/dist/core/maintain/orchestrator.d.ts.map +1 -0
  129. package/dist/core/maintain/orchestrator.js +372 -0
  130. package/dist/core/maintain/orchestrator.js.map +1 -0
  131. package/dist/core/metadata/generator.d.ts +26 -0
  132. package/dist/core/metadata/generator.d.ts.map +1 -0
  133. package/dist/core/metadata/generator.js +221 -0
  134. package/dist/core/metadata/generator.js.map +1 -0
  135. package/dist/core/metadata/schema.d.ts +201 -0
  136. package/dist/core/metadata/schema.d.ts.map +1 -0
  137. package/dist/core/metadata/schema.js +184 -0
  138. package/dist/core/metadata/schema.js.map +1 -0
  139. package/dist/core/metadata/sync.d.ts +36 -0
  140. package/dist/core/metadata/sync.d.ts.map +1 -0
  141. package/dist/core/metadata/sync.js +195 -0
  142. package/dist/core/metadata/sync.js.map +1 -0
  143. package/dist/generators/index-generator.d.ts +19 -0
  144. package/dist/generators/index-generator.d.ts.map +1 -0
  145. package/dist/generators/index-generator.js +191 -0
  146. package/dist/generators/index-generator.js.map +1 -0
  147. package/dist/generators/registry-generator.d.ts +11 -0
  148. package/dist/generators/registry-generator.d.ts.map +1 -0
  149. package/dist/generators/registry-generator.js +156 -0
  150. package/dist/generators/registry-generator.js.map +1 -0
  151. package/dist/generators/scaffold.d.ts +30 -0
  152. package/dist/generators/scaffold.d.ts.map +1 -0
  153. package/dist/generators/scaffold.js +213 -0
  154. package/dist/generators/scaffold.js.map +1 -0
  155. package/dist/generators/templates/document.d.ts +14 -0
  156. package/dist/generators/templates/document.d.ts.map +1 -0
  157. package/dist/generators/templates/document.js +305 -0
  158. package/dist/generators/templates/document.js.map +1 -0
  159. package/dist/generators/templates/domain-index.d.ts +6 -0
  160. package/dist/generators/templates/domain-index.d.ts.map +1 -0
  161. package/dist/generators/templates/domain-index.js +68 -0
  162. package/dist/generators/templates/domain-index.js.map +1 -0
  163. package/dist/generators/templates/domain-registry.d.ts +6 -0
  164. package/dist/generators/templates/domain-registry.d.ts.map +1 -0
  165. package/dist/generators/templates/domain-registry.js +59 -0
  166. package/dist/generators/templates/domain-registry.js.map +1 -0
  167. package/dist/index.d.ts +32 -0
  168. package/dist/index.d.ts.map +1 -0
  169. package/dist/index.js +39 -0
  170. package/dist/index.js.map +1 -0
  171. package/dist/reports/audit-report.d.ts +15 -0
  172. package/dist/reports/audit-report.d.ts.map +1 -0
  173. package/dist/reports/audit-report.js +150 -0
  174. package/dist/reports/audit-report.js.map +1 -0
  175. package/dist/reports/health-report.d.ts +15 -0
  176. package/dist/reports/health-report.d.ts.map +1 -0
  177. package/dist/reports/health-report.js +175 -0
  178. package/dist/reports/health-report.js.map +1 -0
  179. package/dist/reports/link-report.d.ts +15 -0
  180. package/dist/reports/link-report.d.ts.map +1 -0
  181. package/dist/reports/link-report.js +165 -0
  182. package/dist/reports/link-report.js.map +1 -0
  183. package/dist/utils/frontmatter.d.ts +50 -0
  184. package/dist/utils/frontmatter.d.ts.map +1 -0
  185. package/dist/utils/frontmatter.js +93 -0
  186. package/dist/utils/frontmatter.js.map +1 -0
  187. package/dist/utils/glob.d.ts +63 -0
  188. package/dist/utils/glob.d.ts.map +1 -0
  189. package/dist/utils/glob.js +128 -0
  190. package/dist/utils/glob.js.map +1 -0
  191. package/dist/utils/logger.d.ts +42 -0
  192. package/dist/utils/logger.d.ts.map +1 -0
  193. package/dist/utils/logger.js +118 -0
  194. package/dist/utils/logger.js.map +1 -0
  195. package/dist/utils/markdown.d.ts +89 -0
  196. package/dist/utils/markdown.d.ts.map +1 -0
  197. package/dist/utils/markdown.js +192 -0
  198. package/dist/utils/markdown.js.map +1 -0
  199. package/package.json +100 -0
  200. package/templates/claude/CLAUDE.md +204 -0
@@ -0,0 +1,714 @@
1
+ # hit-em-with-the-docs
2
+
3
+ > Self-managing documentation system with hierarchical structure, intelligent automation, pattern discovery, and agent orchestration.
4
+
5
+ [![GitHub Action](https://img.shields.io/badge/GitHub-Action-blue?logo=github)](https://github.com/marketplace/actions/hit-em-with-the-docs)
6
+ [![npm version](https://img.shields.io/npm/v/hit-em-with-the-docs.svg)](https://www.npmjs.com/package/hit-em-with-the-docs)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Features
10
+
11
+ - **Hierarchical Architecture**: 15-domain structure with 85% token reduction
12
+ - **22-Field Metadata System**: Comprehensive YAML frontmatter with auto-generation
13
+ - **Intelligent Automation**: Metadata sync, link checking, auditing, and maintenance
14
+ - **Pattern Discovery**: Extract coding patterns, anti-patterns, and standards from your codebase
15
+ - **Self-Healing**: Auto-detect and fix documentation issues
16
+ - **GitHub Action**: Automate documentation health checks in CI/CD
17
+ - **CLI Tool**: Full-featured command-line interface
18
+
19
+ ## Quick Start
20
+
21
+ ### GitHub Action
22
+
23
+ ```yaml
24
+ name: Documentation Health Check
25
+
26
+ on:
27
+ push:
28
+ paths:
29
+ - '.documentation/**'
30
+ schedule:
31
+ - cron: '0 16 * * 5' # Weekly on Fridays
32
+
33
+ jobs:
34
+ docs-check:
35
+ runs-on: ubuntu-latest
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: Run Documentation Health Check
40
+ uses: username/hit-em-with-the-docs@v1
41
+ with:
42
+ command: maintain
43
+ mode: quick
44
+ fail-on-error: true
45
+
46
+ - name: Upload Report
47
+ uses: actions/upload-artifact@v4
48
+ with:
49
+ name: docs-health-report
50
+ path: .documentation/reports/
51
+ ```
52
+
53
+ ### CLI Installation
54
+
55
+ ```bash
56
+ # npm
57
+ npm install -g hit-em-with-the-docs
58
+
59
+ # Or use npx
60
+ npx hit-em-with-the-docs <command>
61
+ ```
62
+
63
+ ### Initialize Documentation
64
+
65
+ ```bash
66
+ # Create .documentation structure with all 15 domains
67
+ npx hit-em-with-the-docs init
68
+ ```
69
+
70
+ This creates:
71
+ ```
72
+ .documentation/
73
+ ├── INDEX.md # Navigation hub
74
+ ├── REGISTRY.md # Quick reference
75
+ ├── README.md # Overview
76
+ ├── security/ # Security domain
77
+ │ ├── INDEX.md
78
+ │ └── REGISTRY.md
79
+ ├── api/ # API domain
80
+ ├── devops/ # DevOps domain
81
+ ├── database/ # Database domain
82
+ ├── standards/ # Standards domain
83
+ └── ... (15 domains total)
84
+ ```
85
+
86
+ ## CLI Commands Reference
87
+
88
+ ### `init` - Initialize Documentation Structure
89
+
90
+ **When to use**: First-time setup when starting documentation in a new project.
91
+
92
+ **What it does**: Creates the complete 15-domain hierarchical structure with INDEX/REGISTRY files.
93
+
94
+ ```bash
95
+ # Initialize in current directory
96
+ hewtd init
97
+
98
+ # Initialize in specific path
99
+ hewtd init --path ./my-docs
100
+
101
+ # Choose template
102
+ hewtd init --template minimal
103
+ ```
104
+
105
+ **Output**: Creates 53 files/directories including:
106
+ - Root INDEX.md, REGISTRY.md, README.md
107
+ - 15 domain folders (security, api, devops, etc.)
108
+ - Each domain gets INDEX.md + REGISTRY.md
109
+ - Empty reports/ and drafts/ folders
110
+
111
+ **Use cases**:
112
+ - Starting documentation from scratch
113
+ - Migrating from flat documentation structure
114
+ - Setting up new projects with best practices
115
+
116
+ ---
117
+
118
+ ### `maintain` - Full Documentation Maintenance
119
+
120
+ **When to use**: Weekly/monthly maintenance, pre-release checks, or after major documentation updates.
121
+
122
+ **What it does**: Runs complete maintenance workflow (metadata sync + link check + audit) and generates health report.
123
+
124
+ ```bash
125
+ # Full maintenance (recommended weekly)
126
+ hewtd maintain
127
+
128
+ # Quick mode - skip link checking (faster for daily checks)
129
+ hewtd maintain --quick
130
+
131
+ # Auto-fix issues automatically
132
+ hewtd maintain --quick --fix
133
+
134
+ # Specific path
135
+ hewtd maintain --path ./docs
136
+ ```
137
+
138
+ **Output**:
139
+ - Health score (0-100)
140
+ - Fixed metadata issues
141
+ - Broken link detection
142
+ - Audit compliance report
143
+ - Saved to `.documentation/reports/`
144
+
145
+ **Use cases**:
146
+ - Weekly documentation health checks
147
+ - Pre-release validation
148
+ - After adding multiple new documents
149
+ - CI/CD pipeline integration
150
+ - Preparing for documentation review
151
+
152
+ **Recommended schedule**:
153
+ - Daily: `hewtd maintain --quick` (fast check)
154
+ - Weekly: `hewtd maintain --quick --fix` (auto-fix issues)
155
+ - Monthly: `hewtd maintain --fix` (full with link checking)
156
+
157
+ ---
158
+
159
+ ### `integrate` - Auto-Classify and Place Documents
160
+
161
+ **When to use**: Adding existing documents to the hierarchical structure.
162
+
163
+ **What it does**: Analyzes content, detects appropriate domain, generates metadata, adds frontmatter, and moves file.
164
+
165
+ ```bash
166
+ # Integrate a single document
167
+ hewtd integrate ./docs/my-guide.md
168
+
169
+ # Preview without changes
170
+ hewtd integrate ./docs/my-guide.md --dry-run
171
+
172
+ # Auto mode (no prompts)
173
+ hewtd integrate ./docs/my-guide.md --auto
174
+
175
+ # Force integration even with duplicates
176
+ hewtd integrate ./docs/my-guide.md --force
177
+ ```
178
+
179
+ **What it analyzes**:
180
+ - Content keywords (security, API, testing, etc.)
181
+ - Document structure (guide, reference, example)
182
+ - Audience level (developers, admin)
183
+ - Automatically generates 22-field metadata
184
+
185
+ **Output**:
186
+ - Detected domain with confidence %
187
+ - Generated metadata (title, tier, domains, status)
188
+ - Target path in .documentation structure
189
+ - File moved with frontmatter added
190
+
191
+ **Use cases**:
192
+ - Migrating existing documentation
193
+ - Adding new guides without manual classification
194
+ - Organizing scattered documentation files
195
+ - Bulk import from legacy systems
196
+
197
+ **Example workflow**:
198
+ ```bash
199
+ # Preview where documents will go
200
+ for file in docs/*.md; do
201
+ hewtd integrate "$file" --dry-run
202
+ done
203
+
204
+ # If happy with classification, integrate them
205
+ for file in docs/*.md; do
206
+ hewtd integrate "$file" --auto
207
+ done
208
+ ```
209
+
210
+ ---
211
+
212
+ ### `metadata-sync` - Sync Metadata Across Documents
213
+
214
+ **When to use**: After manual edits, when metadata is missing, or for bulk metadata updates.
215
+
216
+ **What it does**: Validates, generates missing fields, calculates read times, and ensures consistency.
217
+
218
+ ```bash
219
+ # Sync all metadata (dry-run by default)
220
+ hewtd metadata-sync
221
+
222
+ # Auto-fix missing fields
223
+ hewtd metadata-sync --fix
224
+
225
+ # Specific domain only
226
+ hewtd metadata-sync --domain security --fix
227
+
228
+ # Specific path
229
+ hewtd metadata-sync --path ./docs --fix
230
+ ```
231
+
232
+ **Auto-generates**:
233
+ - `word_count` - Character analysis
234
+ - `estimated_read_time` - Based on word count
235
+ - `last_validated` - Current date
236
+ - Missing required fields with sensible defaults
237
+
238
+ **Validates**:
239
+ - Required fields present (title, tier, domains, status)
240
+ - Date formats (YYYY-MM-DD)
241
+ - Domain names match available domains
242
+ - Tier values (guide|standard|example|reference|admin)
243
+
244
+ **Use cases**:
245
+ - After bulk document edits
246
+ - Standardizing metadata across team
247
+ - Fixing validation errors
248
+ - Preparing for audits
249
+
250
+ ---
251
+
252
+ ### `link-check` - Validate Internal Links
253
+
254
+ **When to use**: Before releases, after restructuring, or monthly maintenance.
255
+
256
+ **What it does**: Checks all internal markdown links, detects broken references, and generates topology report.
257
+
258
+ ```bash
259
+ # Check all links
260
+ hewtd link-check
261
+
262
+ # Specific domain
263
+ hewtd link-check --domain api
264
+
265
+ # Generate detailed link topology report
266
+ hewtd link-check --report
267
+
268
+ # Specific path
269
+ hewtd link-check --path ./docs
270
+ ```
271
+
272
+ **Detects**:
273
+ - Broken internal links
274
+ - Links to non-existent files
275
+ - Case-sensitivity issues
276
+ - Cross-domain link patterns
277
+
278
+ **Output**:
279
+ - Total links checked
280
+ - Broken links with file locations
281
+ - Link topology (cross-domain relationships)
282
+ - Saved to `.documentation/reports/`
283
+
284
+ **Use cases**:
285
+ - Pre-release validation
286
+ - After renaming/moving files
287
+ - Monthly documentation health checks
288
+ - Detecting orphaned documents
289
+
290
+ ---
291
+
292
+ ### `audit` - Documentation Compliance Audit
293
+
294
+ **When to use**: Code reviews, quality gates, or establishing baselines.
295
+
296
+ **What it does**: Audits against naming conventions, file placement, metadata completeness, and best practices.
297
+
298
+ ```bash
299
+ # Audit all documentation
300
+ hewtd audit
301
+
302
+ # Specific domain
303
+ hewtd audit --domain standards
304
+
305
+ # Show only failures
306
+ hewtd audit --issues-only
307
+
308
+ # Generate detailed audit report
309
+ hewtd audit --report
310
+ ```
311
+
312
+ **Checks**:
313
+ - File naming conventions (kebab-case)
314
+ - Correct domain placement
315
+ - Metadata completeness (required fields)
316
+ - Tier appropriateness
317
+ - Frontmatter formatting
318
+
319
+ **Scoring**:
320
+ - Overall health score (0-100)
321
+ - Per-domain compliance %
322
+ - Metadata completeness %
323
+ - Naming compliance %
324
+
325
+ **Use cases**:
326
+ - Establishing documentation quality baseline
327
+ - Pre-merge validation in PRs
328
+ - Quarterly documentation reviews
329
+ - Compliance reporting
330
+
331
+ ---
332
+
333
+ ### `discover` - Pattern Discovery from Codebase
334
+
335
+ **When to use**: Documenting existing patterns, creating style guides, or architectural documentation.
336
+
337
+ **What it does**: Analyzes codebase to extract patterns, anti-patterns, standards, and dependencies.
338
+
339
+ ```bash
340
+ # Discover coding patterns (singleton, factory, repository, etc.)
341
+ hewtd discover patterns
342
+
343
+ # Filter by language
344
+ hewtd discover patterns --language typescript
345
+
346
+ # Find anti-patterns and code smells
347
+ hewtd discover anti-patterns
348
+
349
+ # Extract implicit coding standards
350
+ hewtd discover standards
351
+
352
+ # Analyze package dependencies
353
+ hewtd discover dependencies
354
+
355
+ # Save to specific domain
356
+ hewtd discover patterns --output standards/
357
+ ```
358
+
359
+ **Pattern types detected**:
360
+ - **Patterns**: Singleton, Factory, Repository, Service Layer, etc.
361
+ - **Anti-patterns**: God objects, circular dependencies, etc.
362
+ - **Standards**: Naming conventions, file organization, etc.
363
+ - **Dependencies**: Package usage, version patterns, etc.
364
+
365
+ **Output**: Markdown files with:
366
+ - Pattern name and description
367
+ - Code examples
368
+ - Occurrence count
369
+ - File locations
370
+ - Recommendations
371
+
372
+ **Use cases**:
373
+ - Creating architecture documentation from code
374
+ - Generating style guides automatically
375
+ - Onboarding documentation
376
+ - Technical debt identification
377
+ - Code review guidelines
378
+
379
+ ---
380
+
381
+ ### `list` - List All Domains
382
+
383
+ **When to use**: Quick reference, exploring structure, or scripting.
384
+
385
+ **What it does**: Displays all 15 domains with descriptions, categories, and priorities.
386
+
387
+ ```bash
388
+ # List all domains
389
+ hewtd list
390
+
391
+ # JSON output for scripting
392
+ hewtd list --format json
393
+ ```
394
+
395
+ **Output**: Table with:
396
+ - Domain name
397
+ - Category (core, features, development, advanced)
398
+ - Load priority (1-10, higher = more important)
399
+ - Description
400
+
401
+ **Use cases**:
402
+ - Learning the domain structure
403
+ - Deciding where to place new documentation
404
+ - Quick reference during writing
405
+ - Scripting and automation
406
+
407
+ ---
408
+
409
+ ### `search` - Search Documentation
410
+
411
+ **When to use**: Finding specific information, cross-referencing, or validating coverage.
412
+
413
+ **What it does**: Full-text search across all documentation with relevance ranking.
414
+
415
+ ```bash
416
+ # Search all documentation
417
+ hewtd search "authentication"
418
+
419
+ # Search in specific domain
420
+ hewtd search "authentication" --domain security
421
+
422
+ # Case-sensitive search
423
+ hewtd search "Authentication" --case-sensitive
424
+
425
+ # Search in titles only
426
+ hewtd search "API" --titles-only
427
+ ```
428
+
429
+ **Output**:
430
+ - Matching documents with relevance score
431
+ - Context snippets
432
+ - File paths
433
+ - Domain classification
434
+
435
+ **Use cases**:
436
+ - Finding existing documentation on a topic
437
+ - Checking for duplicate content
438
+ - Researching before writing new docs
439
+ - Validating documentation coverage
440
+
441
+ ---
442
+
443
+ ### `report` - Generate Reports
444
+
445
+ **When to use**: Dashboards, metrics, or stakeholder updates.
446
+
447
+ **What it does**: Generates comprehensive reports in markdown or JSON format.
448
+
449
+ ```bash
450
+ # Health report (overall documentation health)
451
+ hewtd report health
452
+
453
+ # Audit report (compliance and issues)
454
+ hewtd report audit
455
+
456
+ # Link topology report
457
+ hewtd report links
458
+
459
+ # Export as JSON for dashboards
460
+ hewtd report health --format json
461
+ ```
462
+
463
+ **Report types**:
464
+
465
+ **Health Report**:
466
+ - Overall health score
467
+ - Domain statistics
468
+ - Document counts per tier
469
+ - Metadata completeness
470
+ - Recent changes
471
+
472
+ **Audit Report**:
473
+ - Compliance by domain
474
+ - Critical issues
475
+ - Warnings
476
+ - Recommendations
477
+ - Historical trends
478
+
479
+ **Link Report**:
480
+ - Total links analyzed
481
+ - Broken links by file
482
+ - Cross-domain link patterns
483
+ - Link topology visualization
484
+ - Orphaned documents
485
+
486
+ **Use cases**:
487
+ - Weekly documentation metrics
488
+ - Stakeholder reporting
489
+ - Trend analysis
490
+ - Quality dashboards
491
+ - CI/CD reporting
492
+
493
+ ---
494
+
495
+ ## Common Workflows
496
+
497
+ ### Daily Development
498
+ ```bash
499
+ # Quick health check before committing
500
+ hewtd maintain --quick
501
+ ```
502
+
503
+ ### Adding New Documentation
504
+ ```bash
505
+ # 1. Write your document
506
+ vim my-new-guide.md
507
+
508
+ # 2. Integrate it (auto-classifies and places)
509
+ hewtd integrate my-new-guide.md
510
+
511
+ # 3. Run quick check
512
+ hewtd maintain --quick --fix
513
+ ```
514
+
515
+ ### Weekly Maintenance
516
+ ```bash
517
+ # Auto-fix all issues
518
+ hewtd maintain --quick --fix
519
+
520
+ # Review the report
521
+ cat .documentation/reports/maintenance-*.md
522
+ ```
523
+
524
+ ### Pre-Release Checklist
525
+ ```bash
526
+ # 1. Full maintenance with link checking
527
+ hewtd maintain --fix
528
+
529
+ # 2. Generate health report
530
+ hewtd report health
531
+
532
+ # 3. Ensure health score > 80%
533
+ # 4. Review and commit
534
+ ```
535
+
536
+ ### Migrating Existing Docs
537
+ ```bash
538
+ # 1. Initialize structure
539
+ hewtd init
540
+
541
+ # 2. Preview integration (dry-run)
542
+ for file in old-docs/*.md; do
543
+ hewtd integrate "$file" --dry-run
544
+ done
545
+
546
+ # 3. Integrate all documents
547
+ for file in old-docs/*.md; do
548
+ hewtd integrate "$file" --auto
549
+ done
550
+
551
+ # 4. Run full maintenance
552
+ hewtd maintain --fix
553
+
554
+ # 5. Review health score
555
+ hewtd report health
556
+ ```
557
+
558
+ ### Creating Architecture Docs from Code
559
+ ```bash
560
+ # 1. Discover patterns
561
+ hewtd discover patterns
562
+
563
+ # 2. Extract standards
564
+ hewtd discover standards
565
+
566
+ # 3. Analyze dependencies
567
+ hewtd discover dependencies
568
+
569
+ # 4. Review generated docs in appropriate domains
570
+ cat .documentation/standards/*.md
571
+ cat .documentation/architecture/*.md
572
+ ```
573
+
574
+ ## Domain Structure
575
+
576
+ The system organizes documentation into 15 specialized domains:
577
+
578
+ | Domain | Description |
579
+ |--------|-------------|
580
+ | `security` | Security, auth, Vault, Keycloak, RLS |
581
+ | `devops` | Deployment, CI/CD, Docker, infrastructure |
582
+ | `database` | Schema, migrations, RLS, queries |
583
+ | `api` | API endpoints, routes, specifications |
584
+ | `standards` | Coding standards (backend, frontend, etc.) |
585
+ | `testing` | Test strategies, fixtures, patterns |
586
+ | `architecture` | System design, patterns, decisions |
587
+ | `features` | Feature implementation guides |
588
+ | `quickstart` | Setup guides, onboarding |
589
+ | `procedures` | Step-by-step operational procedures |
590
+ | `workflows` | Process documentation |
591
+ | `agents` | AI agent documentation |
592
+ | `backups` | Backup/restore guides |
593
+ | `troubleshooting` | Debug guides, common issues |
594
+ | `plans` | Planning documents, roadmaps |
595
+
596
+ ## Metadata Schema (22 Fields)
597
+
598
+ Every document uses a comprehensive YAML frontmatter:
599
+
600
+ ```yaml
601
+ ---
602
+ # Core Identity (Required)
603
+ title: "Document Title"
604
+ tier: guide|standard|example|reference|admin
605
+ domains: [primary-domain, secondary-domain]
606
+ audience: [all|developers|devops|admin]
607
+ tags: [tag1, tag2]
608
+
609
+ # Status & Lifecycle (Required)
610
+ status: draft|active|deprecated|archived
611
+ last_updated: 'YYYY-MM-DD'
612
+ version: '1.0.0'
613
+
614
+ # Discovery & Navigation (Optional)
615
+ purpose: "One-sentence purpose"
616
+ related_docs:
617
+ - path/to/related.md
618
+ load_priority: 1-10
619
+
620
+ # Ownership (Optional)
621
+ author: "Name"
622
+ maintainer: "Team"
623
+ review_frequency: monthly|quarterly|annually
624
+
625
+ # Implementation (Optional)
626
+ implementation_status: planned|in_progress|complete
627
+ tested: true|false
628
+ production_ready: true|false
629
+
630
+ # Auto-generated
631
+ estimated_read_time: "X minutes"
632
+ word_count: 1234
633
+ last_validated: 'YYYY-MM-DD'
634
+ backlinks: []
635
+ ---
636
+ ```
637
+
638
+ ## GitHub Action Inputs
639
+
640
+ | Input | Description | Required | Default |
641
+ |-------|-------------|----------|---------|
642
+ | `command` | Command to run | Yes | `maintain` |
643
+ | `mode` | Execution mode (quick/full/fix) | No | `quick` |
644
+ | `docs-path` | Path to documentation | No | `.documentation` |
645
+ | `domain` | Specific domain to operate on | No | - |
646
+ | `discover-type` | Discovery type | No | `patterns` |
647
+ | `fail-on-error` | Fail on critical errors | No | `false` |
648
+ | `fail-threshold` | Health score threshold | No | `50` |
649
+
650
+ ## GitHub Action Outputs
651
+
652
+ | Output | Description |
653
+ |--------|-------------|
654
+ | `health-score` | Documentation health score (0-100) |
655
+ | `total-documents` | Total number of documentation files |
656
+ | `issues-found` | Number of issues found |
657
+ | `issues-fixed` | Number of issues auto-fixed |
658
+ | `broken-links` | Number of broken links |
659
+ | `metadata-compliance` | Percentage with complete metadata |
660
+ | `report-path` | Path to generated report |
661
+
662
+ ## Configuration
663
+
664
+ Create `.hewtd.config.json` in your project root:
665
+
666
+ ```json
667
+ {
668
+ "docsPath": ".documentation",
669
+ "domains": {
670
+ "custom-domain": {
671
+ "description": "Custom domain description",
672
+ "keywords": ["keyword1", "keyword2"]
673
+ }
674
+ },
675
+ "metadata": {
676
+ "requiredFields": ["title", "tier", "domains", "status"],
677
+ "autoGenerate": ["word_count", "estimated_read_time"]
678
+ },
679
+ "audit": {
680
+ "namingConvention": "kebab-case",
681
+ "maxFileSize": 50000
682
+ },
683
+ "discover": {
684
+ "excludePaths": ["node_modules", "dist", "vendor"],
685
+ "languages": ["typescript", "python", "go"]
686
+ }
687
+ }
688
+ ```
689
+
690
+ ## Integration with Claude Code
691
+
692
+ This tool can be used as a Claude Code plugin. Add to your project:
693
+
694
+ ```markdown
695
+ # .claude/CLAUDE.md
696
+
697
+ ## Documentation System
698
+
699
+ Use hit-em-with-the-docs for documentation management:
700
+
701
+ - `/docs load <domain>` - Load domain documentation
702
+ - `/docs list` - List all domains
703
+ - `/docs search <query>` - Search documentation
704
+ - `/docs stats` - Show statistics
705
+ - `/docs maintain` - Run maintenance
706
+ ```
707
+
708
+ ## Contributing
709
+
710
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
711
+
712
+ ## License
713
+
714
+ MIT - see [LICENSE](LICENSE) for details.