@tidyfactor/doc 1.3.0 → 1.9.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.
- package/.tidyfactor +3 -3
- package/CHANGELOG.md +103 -4
- package/README.ar.md +34 -8
- package/README.de.md +1 -1
- package/README.es.md +1 -1
- package/README.fa.md +1 -1
- package/README.fr.md +1 -1
- package/README.md +34 -8
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/SKILL.md +28 -5
- package/bin/add-skill.js +44 -6
- package/brand.json +1 -1
- package/brand.yaml +10 -0
- package/manifest.json +216 -0
- package/package.json +4 -2
- package/references/commands/adr.md +25 -0
- package/references/commands/audit.md +15 -0
- package/references/commands/brief.md +16 -0
- package/references/commands/generate.md +7 -6
- package/references/commands/site.md +25 -23
- package/references/commands/vitepress.md +20 -0
- package/references/memory/20-brain-baas-integration.md +83 -0
- package/references/memory/adr-template.md +84 -0
- package/references/memory/changelog-rules.md +58 -0
- package/references/memory/collection-sources.md +48 -47
- package/references/memory/decision-points.md +72 -0
- package/references/memory/doc-templates.md +102 -73
- package/references/memory/doc-tree.md +38 -37
- package/references/memory/docsify-config.md +274 -273
- package/references/memory/git-doc-sync-hook.md +54 -0
- package/references/memory/mkdocs-config.md +171 -170
- package/references/memory/naming-conventions.md +40 -0
- package/references/memory/project-mindmap.md +66 -0
- package/references/memory/site-engines.md +32 -34
- package/references/memory/stacks/js-ts.md +47 -45
- package/references/memory/stacks/php.md +35 -33
- package/references/memory/stacks/react-vue-next.md +52 -50
- package/references/memory/tone-of-voice.md +31 -0
- package/references/memory/vitepress-config.md +174 -0
- package/references/workflows/audit.md +42 -0
- package/references/workflows/brief.md +105 -0
- package/references/workflows/collect.md +60 -25
- package/references/workflows/generate-adr.md +41 -0
- package/references/workflows/generate-changelog.md +52 -0
- package/references/workflows/init-docs.md +44 -18
- package/references/workflows/vitepress.md +57 -0
- package/scripts/audit_docs.py +190 -0
- package/scripts/clean_orphaned_assets.py +185 -0
- package/tools/build-skill.js +3 -0
- package/assets/og-default.png +0 -0
|
@@ -1,273 +1,274 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<link rel="stylesheet" href="https://
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
font-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
padding-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
font-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
color: #
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
border:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
border:
|
|
149
|
-
border
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
color: #
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
</
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<script src="https://cdn.jsdelivr.net/npm/docsify
|
|
203
|
-
<script src="https://cdn.jsdelivr.net/npm/docsify
|
|
204
|
-
<script src="https://cdn.jsdelivr.net/npm/
|
|
205
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-
|
|
206
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-
|
|
207
|
-
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-
|
|
208
|
-
|
|
209
|
-
</
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
- **CRITICAL**:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
- [دليل
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
- [
|
|
251
|
-
- [
|
|
252
|
-
- [
|
|
253
|
-
- [Architecture &
|
|
254
|
-
- [
|
|
255
|
-
- [
|
|
256
|
-
- [
|
|
257
|
-
- [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
1
|
+
<!-- last-verified: 2026-09-02 -->
|
|
2
|
+
# Memory: docsify-config
|
|
3
|
+
|
|
4
|
+
Fixed Docsify setup used by the `docsify` workflow. Not a menu of options — locked, production-tested config for TidyFactor documentation web portals.
|
|
5
|
+
|
|
6
|
+
## `docs/index.html` Template
|
|
7
|
+
|
|
8
|
+
```html
|
|
9
|
+
<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="UTF-8">
|
|
13
|
+
<title><PROJECT_NAME> Documentation</title>
|
|
14
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
|
15
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
|
|
16
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap">
|
|
17
|
+
<style>
|
|
18
|
+
:root {
|
|
19
|
+
--theme-color: #0A2540;
|
|
20
|
+
--sidebar-width: 300px;
|
|
21
|
+
}
|
|
22
|
+
body {
|
|
23
|
+
font-family: 'Inter', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
24
|
+
color: #1e293b;
|
|
25
|
+
background-color: #ffffff;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Header & Brand styling */
|
|
29
|
+
.app-name-link {
|
|
30
|
+
font-weight: 800 !important;
|
|
31
|
+
font-size: 1.25rem !important;
|
|
32
|
+
color: #0A2540 !important;
|
|
33
|
+
letter-spacing: -0.02em;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Fixed Floating Sidebar Toggle Hamburger Button */
|
|
37
|
+
.sidebar-toggle {
|
|
38
|
+
position: fixed !important;
|
|
39
|
+
top: 14px !important;
|
|
40
|
+
left: 14px !important;
|
|
41
|
+
bottom: auto !important;
|
|
42
|
+
z-index: 1000 !important;
|
|
43
|
+
background: #0A2540 !important;
|
|
44
|
+
padding: 10px 12px !important;
|
|
45
|
+
border-radius: 8px !important;
|
|
46
|
+
box-shadow: 0 4px 12px rgba(10, 37, 64, 0.25) !important;
|
|
47
|
+
border: none !important;
|
|
48
|
+
cursor: pointer !important;
|
|
49
|
+
width: auto !important;
|
|
50
|
+
height: auto !important;
|
|
51
|
+
transition: transform 0.2s ease, background 0.2s ease !important;
|
|
52
|
+
}
|
|
53
|
+
.sidebar-toggle:hover {
|
|
54
|
+
background: #081C30 !important;
|
|
55
|
+
transform: scale(1.04);
|
|
56
|
+
}
|
|
57
|
+
.sidebar-toggle .sidebar-toggle-button {
|
|
58
|
+
display: flex !important;
|
|
59
|
+
flex-direction: column !important;
|
|
60
|
+
justify-content: center !important;
|
|
61
|
+
align-items: center !important;
|
|
62
|
+
gap: 4px !important;
|
|
63
|
+
background: transparent !important;
|
|
64
|
+
padding: 0 !important;
|
|
65
|
+
margin: 0 !important;
|
|
66
|
+
border: none !important;
|
|
67
|
+
width: auto !important;
|
|
68
|
+
height: auto !important;
|
|
69
|
+
}
|
|
70
|
+
.sidebar-toggle span {
|
|
71
|
+
display: block !important;
|
|
72
|
+
background-color: #ffffff !important;
|
|
73
|
+
height: 2px !important;
|
|
74
|
+
width: 20px !important;
|
|
75
|
+
margin: 0 !important;
|
|
76
|
+
border-radius: 2px !important;
|
|
77
|
+
float: none !important;
|
|
78
|
+
position: relative !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Sidebar Layout */
|
|
82
|
+
.sidebar {
|
|
83
|
+
padding-top: 60px !important;
|
|
84
|
+
padding-bottom: 40px !important;
|
|
85
|
+
background-color: #f8fafc !important;
|
|
86
|
+
border-right: 1px solid #e2e8f0 !important;
|
|
87
|
+
}
|
|
88
|
+
.sidebar ul li a {
|
|
89
|
+
font-weight: 500;
|
|
90
|
+
color: #475569;
|
|
91
|
+
transition: all 0.15s ease;
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
}
|
|
94
|
+
.sidebar ul li a:hover {
|
|
95
|
+
color: #0A2540;
|
|
96
|
+
background-color: #e2e8f0/50;
|
|
97
|
+
}
|
|
98
|
+
.sidebar ul li.active > a {
|
|
99
|
+
color: #0A2540 !important;
|
|
100
|
+
font-weight: 700 !important;
|
|
101
|
+
border-left: 3px solid #0A2540;
|
|
102
|
+
padding-left: 8px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Content Styling & Typography */
|
|
106
|
+
.markdown-section {
|
|
107
|
+
max-width: 900px !important;
|
|
108
|
+
padding: 40px 45px !important;
|
|
109
|
+
}
|
|
110
|
+
.markdown-section h1, .markdown-section h2, .markdown-section h3, .markdown-section h4 {
|
|
111
|
+
font-family: 'Inter', 'Cairo', sans-serif;
|
|
112
|
+
color: #0F172A;
|
|
113
|
+
font-weight: 700;
|
|
114
|
+
letter-spacing: -0.02em;
|
|
115
|
+
}
|
|
116
|
+
.markdown-section h1 {
|
|
117
|
+
border-bottom: 1px solid #e2e8f0;
|
|
118
|
+
padding-bottom: 12px;
|
|
119
|
+
font-size: 2.1rem;
|
|
120
|
+
}
|
|
121
|
+
.markdown-section h2 {
|
|
122
|
+
font-size: 1.5rem;
|
|
123
|
+
margin-top: 2rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* Code Blocks */
|
|
127
|
+
.markdown-section pre {
|
|
128
|
+
border-radius: 8px !important;
|
|
129
|
+
background-color: #0f172a !important;
|
|
130
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
131
|
+
}
|
|
132
|
+
.markdown-section code {
|
|
133
|
+
font-family: 'Fira Code', monospace !important;
|
|
134
|
+
font-size: 0.9em;
|
|
135
|
+
}
|
|
136
|
+
.markdown-section p code {
|
|
137
|
+
background-color: #f1f5f9 !important;
|
|
138
|
+
color: #0f172a !important;
|
|
139
|
+
padding: 3px 6px !important;
|
|
140
|
+
border-radius: 4px !important;
|
|
141
|
+
border: 1px solid #cbd5e1 !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Table Styling */
|
|
145
|
+
.markdown-section table {
|
|
146
|
+
display: table !important;
|
|
147
|
+
width: 100% !important;
|
|
148
|
+
border-collapse: collapse !important;
|
|
149
|
+
border: 1px solid #e2e8f0 !important;
|
|
150
|
+
border-radius: 6px !important;
|
|
151
|
+
overflow: hidden !important;
|
|
152
|
+
margin: 20px 0 !important;
|
|
153
|
+
}
|
|
154
|
+
.markdown-section th {
|
|
155
|
+
background-color: #f8fafc !important;
|
|
156
|
+
color: #0f172a !important;
|
|
157
|
+
font-weight: 700 !important;
|
|
158
|
+
border-bottom: 2px solid #e2e8f0 !important;
|
|
159
|
+
padding: 10px 14px !important;
|
|
160
|
+
}
|
|
161
|
+
.markdown-section td {
|
|
162
|
+
border-bottom: 1px solid #e2e8f0 !important;
|
|
163
|
+
padding: 10px 14px !important;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Scrollbars */
|
|
167
|
+
::-webkit-scrollbar {
|
|
168
|
+
width: 8px;
|
|
169
|
+
height: 8px;
|
|
170
|
+
}
|
|
171
|
+
::-webkit-scrollbar-track {
|
|
172
|
+
background: #f1f5f9;
|
|
173
|
+
}
|
|
174
|
+
::-webkit-scrollbar-thumb {
|
|
175
|
+
background: #cbd5e1;
|
|
176
|
+
border-radius: 4px;
|
|
177
|
+
}
|
|
178
|
+
::-webkit-scrollbar-thumb:hover {
|
|
179
|
+
background: #94a3b8;
|
|
180
|
+
}
|
|
181
|
+
</style>
|
|
182
|
+
</head>
|
|
183
|
+
<body>
|
|
184
|
+
<div id="app"></div>
|
|
185
|
+
<script>
|
|
186
|
+
window.$docsify = {
|
|
187
|
+
name: '<PROJECT_NAME>',
|
|
188
|
+
repo: '<REPO_URL>',
|
|
189
|
+
loadSidebar: true,
|
|
190
|
+
alias: {
|
|
191
|
+
'/.*/_sidebar.md': '/_sidebar.md'
|
|
192
|
+
},
|
|
193
|
+
subMaxLevel: 2,
|
|
194
|
+
auto2top: true,
|
|
195
|
+
search: {
|
|
196
|
+
placeholder: 'Search documentation...',
|
|
197
|
+
noData: 'No results found',
|
|
198
|
+
depth: 3
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
</script>
|
|
202
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
|
|
203
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
|
|
204
|
+
<script src="https://cdn.jsdelivr.net/npm/docsify-copy-code@2"></script>
|
|
205
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-bash.min.js"></script>
|
|
206
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-php.min.js"></script>
|
|
207
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-typescript.min.js"></script>
|
|
208
|
+
<script src="https://cdn.jsdelivr.net/npm/prismjs@1/components/prism-json.min.js"></script>
|
|
209
|
+
</body>
|
|
210
|
+
</html>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Replace `<PROJECT_NAME>` from `docs/.doc-manifest.json`'s `project` field, and `<REPO_URL>` with project repository or developer link (`https://github.com/alwkala/TidyFactor-Go`).
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Critical Rules & Lessons Learned
|
|
218
|
+
|
|
219
|
+
### 1. Subfolder Navigation Sidebar Alias
|
|
220
|
+
- **CRITICAL**: Always configure `alias: { '/.*/_sidebar.md': '/_sidebar.md' }` in `window.$docsify`. Without this alias, opening subfolder guides (e.g. `/#/guides/architecture-and-setup`) causes Docsify to look for `guides/_sidebar.md` and hide the sidebar menu!
|
|
221
|
+
- **CRITICAL**: Use leading slashes `/` for all links in `_sidebar.md` (`/guides/admin-user-guide.md`, `/api/project.md`) so links resolve relative to the `/docs` root from any route depth.
|
|
222
|
+
|
|
223
|
+
### 2. Localized Pages Inside Docs Root
|
|
224
|
+
- **CRITICAL**: Docsify web root is `/docs`. Never link out of `/docs` using relative `../` paths (e.g. `../README.ar.md`), as Docsify SPA routing will throw `404 - Not Found`.
|
|
225
|
+
- Always place localized landing pages inside `/docs` (e.g. `docs/README.ar.md`), rendering smoothly at `/#/README.ar.md`.
|
|
226
|
+
|
|
227
|
+
### 3. Hamburger Toggle Button (`.sidebar-toggle`) Styling
|
|
228
|
+
- Always style `.sidebar-toggle` and `.sidebar-toggle-button` with fixed positioning (`top: 14px; left: 14px; z-index: 1000`) and explicit `<span>` lines (`width: 20px; height: 2px; display: block`) so the hamburger button remains accessible without collapsing or overlapping sidebar text items.
|
|
229
|
+
|
|
230
|
+
### 4. Cross-Platform Emojis & Typography
|
|
231
|
+
- Country flag emojis (`🇸🇦`, `🇺🇸`) render as 2-letter codes (`SA`, `US`) on Windows Chrome/Edge. Use clean text badges (`[عربي]`, `[EN]`) in `_sidebar.md`.
|
|
232
|
+
- Always load Google Fonts (`Cairo` for Arabic RTL, `Inter` for English LTR, `Fira Code` for code blocks) in `docs/index.html`.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## `_sidebar.md` Generation Rule
|
|
237
|
+
|
|
238
|
+
Group by audience/purpose, root docs first, using leading slashes `/`:
|
|
239
|
+
|
|
240
|
+
```markdown
|
|
241
|
+
- 🌐 [Overview / النظرة العامة](/README.md)
|
|
242
|
+
- 📖 [المقدمة بالعربية](/README.ar.md)
|
|
243
|
+
- 💡 [رؤية المنظومة والشركة](/guides/vision-and-ecosystem.md)
|
|
244
|
+
|
|
245
|
+
- [عربي] أدلة المستخدم (User Guides - AR)
|
|
246
|
+
- [دليل مالك الموقع (Admin User Guide)](/guides/admin-user-guide.md)
|
|
247
|
+
- [دليل تحرير المحتوى (Editing Pages Content)](/guides/pages-editing-guide.md)
|
|
248
|
+
|
|
249
|
+
- [EN] Developer & Technical Guides
|
|
250
|
+
- [Quick Start Guide](/guides/quick-start.md)
|
|
251
|
+
- [Platform & System Specifications](/guides/system-specifications.md)
|
|
252
|
+
- [AI Coding & Agent Workflows](/guides/ai-agent-workflows.md)
|
|
253
|
+
- [Content Engine Architecture & API](/guides/content-engine.md)
|
|
254
|
+
- [Architecture & Setup Guide](/guides/architecture-and-setup.md)
|
|
255
|
+
- [Database & Storage Architecture](/guides/database-and-storage.md)
|
|
256
|
+
- [Security & System Hardening](/guides/security-and-hardening.md)
|
|
257
|
+
- [Production Deployment & Hosting](/guides/deployment-and-hosting.md)
|
|
258
|
+
- [CMS Content Engine & Backups](/guides/cms-content-engine-and-backups.md)
|
|
259
|
+
|
|
260
|
+
- 📚 REST API Reference
|
|
261
|
+
- [API Endpoints Specifications](/api/project.md)
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
- 👨💻 Developed by [Alwkala](https://github.com/alwkala)
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Regenerate the whole file each run so it never drifts from what's actually in `/docs`.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## Preview
|
|
273
|
+
|
|
274
|
+
Local static server: `php -S localhost:3001 -t docs` or `npx docsify-cli serve docs`.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<!-- last-verified: 2026-09-09 -->
|
|
2
|
+
# Memory: git-doc-sync-hook
|
|
3
|
+
|
|
4
|
+
Specification and configuration guide for pre-commit documentation synchronization hooks.
|
|
5
|
+
|
|
6
|
+
## 1. Objective
|
|
7
|
+
|
|
8
|
+
Prevent drift between code changes and documentation by verifying that when core functions, endpoints, or public APIs are modified in staged git commits, their corresponding documentation files in `/docs` or root `README.md` / `CHANGELOG.md` are also staged.
|
|
9
|
+
|
|
10
|
+
## 2. Husky / Git Hook Implementation (`.husky/pre-commit` or `.git/hooks/pre-commit`)
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
#!/usr/bin/env bash
|
|
14
|
+
# TidyFactor Doc Pre-Commit Guard
|
|
15
|
+
set -e
|
|
16
|
+
|
|
17
|
+
# 1. Check staged files
|
|
18
|
+
STAGED_CODE=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(php|ts|js|py|go|rs)$' || true)
|
|
19
|
+
STAGED_DOCS=$(git diff --cached --name-only --diff-filter=ACM | grep -E '(^docs/|README\.md|CHANGELOG\.md)' || true)
|
|
20
|
+
|
|
21
|
+
# 2. If core code changed, verify documentation activity or bypass flag
|
|
22
|
+
if [ -n "$STAGED_CODE" ]; then
|
|
23
|
+
# Check if core services / interfaces were modified
|
|
24
|
+
CORE_CHANGES=$(echo "$STAGED_CODE" | grep -E '(Core/|Services/|Controllers/|api/|interfaces/)' || true)
|
|
25
|
+
|
|
26
|
+
if [ -n "$CORE_CHANGES" ] && [ -z "$STAGED_DOCS" ]; then
|
|
27
|
+
if [ "$DOC_OVERRIDE" != "1" ]; then
|
|
28
|
+
echo ""
|
|
29
|
+
echo "❌ [TidyFactor Doc Guard] Core code modified without documentation update!"
|
|
30
|
+
echo "Staged core files:"
|
|
31
|
+
echo "$CORE_CHANGES"
|
|
32
|
+
echo ""
|
|
33
|
+
echo "Please update corresponding files under /docs or CHANGELOG.md."
|
|
34
|
+
echo "To bypass intentionally for hotfixes, run: DOC_OVERRIDE=1 git commit -m '...'"
|
|
35
|
+
echo ""
|
|
36
|
+
exit 1
|
|
37
|
+
fi
|
|
38
|
+
fi
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# 3. Run audit_docs on staged docs
|
|
42
|
+
if [ -n "$STAGED_DOCS" ]; then
|
|
43
|
+
echo "🔍 [TidyFactor Doc Guard] Auditing staged documentation quality..."
|
|
44
|
+
python scripts/audit_docs.py docs/
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
exit 0
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 3. Benefits
|
|
51
|
+
|
|
52
|
+
- Enforces the Single Source of Truth rule.
|
|
53
|
+
- Eliminates stale documentation where APIs evolve but docs remain outdated.
|
|
54
|
+
- Runs sub-second link and secret checks before commit creation.
|