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