@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
package/manifest.json ADDED
@@ -0,0 +1,216 @@
1
+ {
2
+ "manifest_schema_version": "1.1.0",
3
+ "skill_id": "tidyfactor-doc",
4
+ "skill_root_anchor": "self",
5
+ "tools": [
6
+ {
7
+ "name": "audit_docs",
8
+ "description": "Audits documentation files under /docs, root README.md, and CHANGELOG.md for sensitive data leaks, banned absolute URLs, relative link integrity, and Keep a Changelog compliance.",
9
+ "entrypoint": {
10
+ "runtime": "python3",
11
+ "script": "scripts/audit_docs.py"
12
+ },
13
+ "invocation": {
14
+ "cli_pattern": "{runtime} {skill_root}/{script} {target_path} {flags}",
15
+ "args": [
16
+ {
17
+ "name": "target",
18
+ "type": "path",
19
+ "required": false,
20
+ "default": "docs",
21
+ "description": "Directory or markdown file path to audit"
22
+ },
23
+ {
24
+ "name": "json",
25
+ "type": "boolean",
26
+ "required": false,
27
+ "default": false,
28
+ "flag": "--json",
29
+ "description": "Output structured JSON report"
30
+ }
31
+ ]
32
+ },
33
+ "output": {
34
+ "format": "json",
35
+ "channel": "stdout"
36
+ },
37
+ "runtime_requirements": {
38
+ "isolation_recommended": false,
39
+ "dependencies": []
40
+ },
41
+ "invoked_by_commands": ["generate", "site", "vitepress", "mkdocs", "docsify", "audit", "adr"]
42
+ },
43
+ {
44
+ "name": "clean_orphaned_assets",
45
+ "description": "Scans markdown files for image references, identifies unreferenced orphan assets in assets/, detects duplicate assets via SHA-256 hashing, and evaluates WebP compression savings.",
46
+ "entrypoint": {
47
+ "runtime": "python3",
48
+ "script": "scripts/clean_orphaned_assets.py"
49
+ },
50
+ "invocation": {
51
+ "cli_pattern": "{runtime} {skill_root}/{script} {repo_root} {flags}",
52
+ "args": [
53
+ {
54
+ "name": "repo_root",
55
+ "type": "path",
56
+ "required": false,
57
+ "default": ".",
58
+ "description": "Root directory of repository or skill"
59
+ },
60
+ {
61
+ "name": "assets_dir",
62
+ "type": "string",
63
+ "required": false,
64
+ "default": "assets",
65
+ "flag": "--assets-dir",
66
+ "description": "Relative path to assets folder"
67
+ },
68
+ {
69
+ "name": "delete_orphans",
70
+ "type": "boolean",
71
+ "required": false,
72
+ "default": false,
73
+ "flag": "--delete-orphans",
74
+ "description": "Delete unreferenced assets on disk"
75
+ },
76
+ {
77
+ "name": "json",
78
+ "type": "boolean",
79
+ "required": false,
80
+ "default": false,
81
+ "flag": "--json",
82
+ "description": "Output pure JSON report"
83
+ }
84
+ ]
85
+ },
86
+ "output": {
87
+ "format": "json",
88
+ "channel": "stdout"
89
+ },
90
+ "runtime_requirements": {
91
+ "isolation_recommended": false,
92
+ "dependencies": []
93
+ },
94
+ "invoked_by_commands": ["audit", "site"]
95
+ }
96
+ ],
97
+ "decision_gates": [
98
+ {
99
+ "command": "brief",
100
+ "aliases": ["init", "debate"],
101
+ "description": "Decision gate selecting documentation engine, target persona, hygiene policy, and extraction scope.",
102
+ "decisions": [
103
+ {
104
+ "key": "target_scope",
105
+ "description": "Scope of documentation generation (D1)",
106
+ "type": "enum",
107
+ "options": ["full_codebase", "api_surface_only", "internal_architecture", "end_user_docs"],
108
+ "default": "full_codebase",
109
+ "priority": 1,
110
+ "discovery": [
111
+ {
112
+ "source": "local_file",
113
+ "path": "docs/.doc-manifest.json"
114
+ }
115
+ ],
116
+ "persist_to": {
117
+ "local": { "path": ".tidyfactor/doc-brief.snapshot.yaml" }
118
+ }
119
+ },
120
+ {
121
+ "key": "doc_engine",
122
+ "description": "Target documentation publishing engine (D2)",
123
+ "type": "enum",
124
+ "options": ["vitepress_ssg", "mkdocs_material", "docsify_spa", "static_markdown"],
125
+ "default": "vitepress_ssg",
126
+ "priority": 2,
127
+ "discovery": [
128
+ {
129
+ "source": "local_file",
130
+ "path": "docs/.vitepress/config.mjs",
131
+ "track_staleness": true
132
+ },
133
+ {
134
+ "source": "local_file",
135
+ "path": "mkdocs.yml",
136
+ "track_staleness": true
137
+ },
138
+ {
139
+ "source": "local_file",
140
+ "path": "docs/index.html",
141
+ "track_staleness": true
142
+ },
143
+ {
144
+ "source": "brain_ki",
145
+ "ki_type": "project"
146
+ }
147
+ ],
148
+ "persist_to": {
149
+ "local": { "path": ".tidyfactor/doc-brief.snapshot.yaml" },
150
+ "brain_ki": {
151
+ "sync_direction": "outbound_push_only",
152
+ "requires_flag": "--sync-brain"
153
+ }
154
+ }
155
+ },
156
+ {
157
+ "key": "audience_persona",
158
+ "description": "Primary audience reading the documentation (D3)",
159
+ "type": "enum",
160
+ "options": ["bilingual_developer", "api_consumer", "internal_maintainer", "end_user"],
161
+ "default": "bilingual_developer",
162
+ "priority": 3,
163
+ "discovery": [
164
+ {
165
+ "source": "local_file",
166
+ "path": "brand.yaml",
167
+ "yaml_path": "audience"
168
+ },
169
+ {
170
+ "source": "local_file",
171
+ "path": "brand.json",
172
+ "json_path": "$.audience"
173
+ }
174
+ ],
175
+ "persist_to": {
176
+ "local": { "path": ".tidyfactor/doc-brief.snapshot.yaml" }
177
+ }
178
+ },
179
+ {
180
+ "key": "hygiene_policy",
181
+ "description": "Security redaction and sensitive data leak policy (D4)",
182
+ "type": "enum",
183
+ "options": ["strict_zero_leak", "public_sdk_redaction", "internal_audit_permissive"],
184
+ "default": "strict_zero_leak",
185
+ "priority": 4,
186
+ "discovery": [
187
+ {
188
+ "source": "brain_ki",
189
+ "ki_type": "security"
190
+ }
191
+ ],
192
+ "persist_to": {
193
+ "local": { "path": ".tidyfactor/doc-brief.snapshot.yaml" }
194
+ }
195
+ },
196
+ {
197
+ "key": "collection_depth",
198
+ "description": "Extraction dimensions depth for codebase collection (D5)",
199
+ "type": "enum",
200
+ "options": ["full_5_dimensions", "signatures_and_types", "architecture_and_rationale"],
201
+ "default": "full_5_dimensions",
202
+ "priority": 5,
203
+ "discovery": [
204
+ {
205
+ "source": "local_file",
206
+ "path": "docs/.doc-manifest.json"
207
+ }
208
+ ],
209
+ "persist_to": {
210
+ "local": { "path": ".tidyfactor/doc-brief.snapshot.yaml" }
211
+ }
212
+ }
213
+ ]
214
+ }
215
+ ]
216
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tidyfactor/doc",
3
- "version": "1.3.0",
4
- "description": "TidyFactor Doc — Code Documentation Builder & Dual-Engine Publishing Platform (MkDocs Material & Docsify) for AI Coding Agents",
3
+ "version": "1.9.0",
4
+ "description": "TidyFactor Doc — Code Documentation Builder, ADR Architect, Link Auditor & Triple-Engine Publishing Platform (VitePress, MkDocs Material & Docsify) for AI Coding Agents",
5
5
  "main": "SKILL.md",
6
6
  "bin": {
7
7
  "tidyfactor-doc": "bin/add-skill.js",
@@ -50,6 +50,8 @@
50
50
  "assets",
51
51
  "bin",
52
52
  "brand.json",
53
+ "brand.yaml",
54
+ "manifest.json",
53
55
  "memory",
54
56
  "references",
55
57
  "scripts",
@@ -0,0 +1,25 @@
1
+ # Command: adr
2
+
3
+ Runtime entry point for "Generate Architectural Decision Record (ADR)" / "وثق قرار معماري" / "قم بتوليد سجل قرار معماري يشرح سبب اختيار التقنية [X]".
4
+
5
+ ## Context-Aware Prompts & Auto-Sensing
6
+
7
+ 1. **Auto-Sense Project Context**:
8
+ - Inspect package manifests (`composer.json`, `package.json`, `go.mod`, `Cargo.toml`) and framework configs.
9
+ - Identify active language, runtime version, and primary dependencies.
10
+ - Check `docs/adr/` to discover existing records and determine the next sequence number (`NNNN`).
11
+
12
+ 2. **Extract Decision Parameters**:
13
+ - Technology / Decision subject: e.g. `[VitePress]`, `[Medoo ORM]`, `[SQLite Storage]`, `[TailAdmin]`.
14
+ - If not provided in the user prompt, evaluate recent commit history (`git log -n 10`) or prompt the user via the native modal question tool.
15
+
16
+ 3. **Dispatch to Workflow**:
17
+ - Load `../workflows/generate-adr.md` — the MADR decision-making workflow.
18
+ - Load `../memory/adr-template.md` — the authoritative Markdown ADR schema.
19
+ - Load `../memory/tone-of-voice.md` — technical objectivity and zero fluff policy.
20
+ - Run the workflow.
21
+
22
+ ## Does NOT
23
+
24
+ - Does not guess technical justifications: facts must trace to actual codebase constraints, benchmarks, or requirements.
25
+ - Does not edit application code: ADRs are purely architectural documentation saved under `docs/adr/`.
@@ -0,0 +1,15 @@
1
+ # Command: audit
2
+
3
+ Runtime entry point for "audit docs quality" / "scan documentation hygiene" / "check broken doc links" / "verify changelog structure."
4
+
5
+ ## Dispatch steps
6
+
7
+ 1. Identify the target path to audit (defaults to `docs/` and root `README.md`, `CHANGELOG.md` if not explicitly specified).
8
+ 2. Load `../workflows/audit.md` — the step-by-step documentation quality audit sequence.
9
+ 3. Run the workflow.
10
+
11
+ ## Does NOT
12
+
13
+ - Does not rewrite or author documentation files automatically without user review.
14
+ - Does not publish documentation sites (that's `site` / `mkdocs` / `docsify` / `vitepress`).
15
+ - Does not modify code or package configurations.
@@ -0,0 +1,16 @@
1
+ # Command: brief
2
+
3
+ Runtime entry point for establishing documentation context, running codebase interview, or conducting architectural debate ("brief", "interview", "debate", "استجوبني", "ناقشني في معمارية التوثيق").
4
+
5
+ ## Dispatch steps
6
+
7
+ 1. Load `../memory/decision-points.md` — the 5 core documentation decision dimensions (D1–D5), operational modes (Mode A / Mode B), and boolean skip conditions.
8
+ 2. Load `../workflows/brief.md` — the Context Delta Resolution, Dual Operational Mode execution, and persistence sequence.
9
+ 3. Run the workflow.
10
+
11
+ ## Does NOT
12
+
13
+ - Does not author actual documentation content (no API entries, no guides, no READMEs). That's `generate`.
14
+ - Does not scaffold `/docs` directory structure until baseline decisions are confirmed. That's `init`.
15
+ - Does not run code-level AST parsing or git history log collection. That's `collect`.
16
+ - Does not load `memory/stacks/*.md` or `memory/docsify-config.md` / `memory/mkdocs-config.md` — those are loaded only during generation or site compilation.
@@ -4,17 +4,18 @@ Runtime entry point for "write API docs" / "generate a README" / "add inline com
4
4
 
5
5
  ## Dispatch steps
6
6
 
7
- 1. **Identify the doc type.** If not obvious from the request, ask:
8
- > "Which one — API reference, README, inline code comments, or a technical guide (setup/architecture/workflow)?"
9
- 2. **Identify the stack** (PHP / JS / TS / React / Vue / Next). If not obvious from the project, ask or detect from file extensions / config files (`composer.json`, `package.json` + `tsconfig.json`, framework config files).
7
+ 1. **Identify the doc type.** If not obvious from the request, ask or detect:
8
+ - API reference, README, CHANGELOG, inline code comments, or a technical guide (setup/architecture/workflow).
9
+ 2. **Identify the stack** (PHP / JS / TS / React / Vue / Next). If not obvious from the project, ask or detect from file extensions / config files (`composer.json`, `package.json` + `tsconfig.json`, framework config files). (Note: CHANGELOG and README are stack-agnostic).
10
10
  3. Load the matching workflow — exactly one:
11
11
  - API reference → `../workflows/generate-api.md`
12
12
  - README → `../workflows/generate-readme.md`
13
+ - CHANGELOG → `../workflows/generate-changelog.md`
13
14
  - Inline comments → `../workflows/generate-inline.md`
14
15
  - Guide → `../workflows/generate-guide.md`
15
- 4. Load `../memory/doc-templates.md`.
16
- 5. Load the matching stack file under `../memory/stacks/` — `php.md`, `js-ts.md`, or `react-vue-next.md`. Never load more than the stacks actually present in the target.
17
- 6. Confirm `collect` has already run for this target (check for `docs/.collected/<target>.md`). If it hasn't, and the user hasn't supplied equivalent detail inline, stop and say so — do not generate from assumption. See constraint 2 in `SKILL.md`.
16
+ 4. Load `../memory/doc-templates.md` (and `../memory/changelog-rules.md` if generating a CHANGELOG).
17
+ 5. Load the matching stack file under `../memory/stacks/` — `php.md`, `js-ts.md`, or `react-vue-next.md` (if stack-dependent). Never load more than the stacks actually present in the target.
18
+ 6. For code/API docs, confirm `collect` has already run for this target (check for `docs/.collected/<target>.md`). For CHANGELOG, read git commit history (`git log`) and current `package.json` / version configs. If required detail is missing, stop and say so — do not generate from assumption. See constraint 2 in `SKILL.md`.
18
19
  7. Run the loaded workflow.
19
20
 
20
21
  ## Does NOT
@@ -1,23 +1,25 @@
1
- # Command: site
2
-
3
- Runtime entry point for "turn /docs into a doc site" / "publish documentation portal" / "set up documentation site".
4
-
5
- ## Dispatch steps
6
-
7
- 1. Load `../memory/site-engines.md` — comparison between MkDocs Material and Docsify.
8
- 2. Confirm `/docs` has real content (at least one generated doc beyond the scaffold).
9
- 3. **Interactive Engine Selection:**
10
- - Detect if Python is available via `python --version 2>&1`.
11
- - If the user explicitly requested a specific engine (e.g., "use mkdocs" or "use docsify"), route directly:
12
- - "mkdocs" → Dispatch `references/commands/mkdocs.md`.
13
- - "docsify" → Dispatch `references/commands/docsify.md`.
14
- - If no engine was specified:
15
- - Present the two options to the user with the summary from `memory/site-engines.md`:
16
- - **Option 1: MkDocs Material (Recommended for Production)**: Pre-compiled static HTML, 100/100 Core Web Vitals, bilingual (Arabic RTL + English LTR) parallel builds, offline search indexing, and Neo-Brutalist styling. Requires Python locally for building.
17
- - **Option 2: Docsify (Zero-Build Lightweight SPA)**: Client-side SPA, zero build step, single `index.html` + `_sidebar.md` over CDN. Recommended when Python is not available or for internal repo prototyping.
18
- - Prompt the user to pick their preference or proceed with the recommended engine based on detected toolchain.
19
- 4. Execute the chosen workflow (`workflows/mkdocs.md` or `workflows/docsify.md`).
20
-
21
- ## Does NOT
22
-
23
- - Does not author any new markdown content — it structures, configures, and publishes what's already in `/docs`.
1
+ # Command: site
2
+
3
+ Runtime entry point for "turn /docs into a doc site" / "publish documentation portal" / "set up documentation site".
4
+
5
+ ## Dispatch steps
6
+
7
+ 1. Load `../memory/site-engines.md` — comparison between VitePress, MkDocs Material, and Docsify.
8
+ 2. Confirm `/docs` has real content (at least one generated doc beyond the scaffold).
9
+ 3. **Interactive Engine Selection:**
10
+ - Detect available runtimes: `node --version 2>&1` and `python --version 2>&1`.
11
+ - If the user explicitly requested a specific engine (e.g., "use vitepress", "use mkdocs", or "use docsify"), route directly:
12
+ - "vitepress" → Dispatch `references/commands/vitepress.md`.
13
+ - "mkdocs" → Dispatch `references/commands/mkdocs.md`.
14
+ - "docsify" Dispatch `references/commands/docsify.md`.
15
+ - If no engine was specified:
16
+ - Present the options to the user with the summary from `memory/site-engines.md`:
17
+ - **Option 1: VitePress (Recommended for Modern Web, Monorepos & Luxury RTL)**: Vue 3 / Vite SSG, sub-second HMR, native multi-locale subdirectory routing (`/`, `/en/`, `/es/`), and bespoke luxury typography (`Alexandria` + `Cairo` + `JetBrains Mono`). Requires Node.js.
18
+ - **Option 2: MkDocs Material (Recommended for Python & Backend Services)**: Pre-compiled static HTML, 100/100 Core Web Vitals, parallel builds, offline search indexing, and Neo-Brutalist styling. Requires Python.
19
+ - **Option 3: Docsify (Zero-Build Lightweight SPA)**: Client-side SPA, zero build step, single `index.html` + `_sidebar.md` over CDN. Recommended when neither Node nor Python build workflows are available.
20
+ - Prompt the user to pick their preference or proceed with the recommended engine based on detected toolchain.
21
+ 4. Execute the chosen workflow (`workflows/vitepress.md`, `workflows/mkdocs.md`, or `workflows/docsify.md`).
22
+
23
+ ## Does NOT
24
+
25
+ - Does not author any new markdown content — it structures, configures, and publishes what's already in `/docs`.
@@ -0,0 +1,20 @@
1
+ # Command: vitepress
2
+
3
+ Runtime entry point for "Set up VitePress" / "build modern Vue-powered doc portal" / "vitepress".
4
+
5
+ ## Dispatch steps
6
+
7
+ 1. Load `../memory/vitepress-config.md` — complete ESM configuration schema, luxury CSS custom tokens, and script presets.
8
+ 2. Confirm `/docs` has real content (at least one generated doc beyond the scaffold).
9
+ 3. Verify Node.js toolchain (`node --version` >= 18).
10
+ 4. Dispatch `../workflows/vitepress.md`.
11
+
12
+ ## Injects
13
+
14
+ - `../workflows/vitepress.md`
15
+ - `../memory/vitepress-config.md`
16
+
17
+ ## Does NOT
18
+
19
+ - Does not author any new markdown content — it structures, configures, and publishes what's already in `/docs`.
20
+ - Does not use external unverified CSS frameworks; relies strictly on custom luxury design tokens (`Alexandria` + `Cairo` + `JetBrains Mono` + RTL logical properties).
@@ -0,0 +1,83 @@
1
+ # Brain BaaS & Sovereign Knowledge Base Integration
2
+
3
+ <!-- last-verified: 2026-09-02 -->
4
+
5
+ > **Tier**: Core Intelligence Layer Contract
6
+ > **Authority**: Sovereign Self-Hosted & Local Multi-Tenant Architecture
7
+ > **Protocol**: Model B (Fail-Open Sovereign Agent Protocol)
8
+
9
+ ---
10
+
11
+ ## 🏛️ Architectural Doctrine & Deployment Model
12
+
13
+ TidyFactor is strictly the **Intelligence, Context & Operating Layer** for AI agents. `tidyfactor-doc` operates under **Model B (Sovereign Self-Hosted Architecture)**:
14
+
15
+ 1. **Zero Centralized Data Exposure**: Codebase documentation, API schemas, and technical architectures are never transmitted to a centralized multi-tenant cloud service.
16
+ 2. **Local Multi-Tenant Isolation**: Each client or project maintains an isolated local SQLite knowledge base (`data/tenants/{tenant_id}_brain.sqlite`) or filesystem cache (`~/.gemini/knowledge/projects/{project_id}/`).
17
+ 3. **Fail-Open Invariant**: Brain MCP integration is completely optional at runtime. If `tidyfactor-brain` MCP is unavailable or disabled, `tidyfactor-doc` executes directly via local filesystem AST parsing and markdown generation with **0ms latency penalty** and zero connection errors.
18
+
19
+ ```
20
+ ┌────────────────────────────────────────────────────────┐
21
+ │ AI Coding Agent Session │
22
+ │ (Google Antigravity, Claude Code, Cursor) │
23
+ └───────────────────────────┬────────────────────────────┘
24
+
25
+ [1] Check Active Tool Manifest
26
+
27
+ ┌──────────────────┴──────────────────┐
28
+ │ │
29
+ [Brain MCP Active] [Brain MCP Absent]
30
+ │ │
31
+ [2] search_knowledge_base() │
32
+ (Doc Tree, APIs, Routes) │
33
+ │ │
34
+ (Found?) │
35
+ ├── YES ──► Ingest KI Context │
36
+ └── NO ──► Direct Codebase Scan ◄──────────┘ (0ms Fail-Open)
37
+
38
+ [3] Execute Doc Workflow
39
+ (init / collect / generate / site)
40
+
41
+ [4] Persist /docs/ Artifacts
42
+
43
+ (Optional: --sync-brain)
44
+
45
+ [5] extract_knowledge_item()
46
+ ```
47
+
48
+ ---
49
+
50
+ ## 📋 Documentation Knowledge Item (KI) Payload Schema
51
+
52
+ When persisting documentation structures or API contracts to the Brain via `--sync-brain`, payload objects MUST conform to the standard KI schema:
53
+
54
+ ```json
55
+ {
56
+ "title": "Documentation Architecture: [Project Name]",
57
+ "category": "technical_architecture",
58
+ "scope": "project",
59
+ "tags": ["documentation", "api-reference", "mkdocs", "docsify", "architecture"],
60
+ "content": "### Codebase Overview\n...",
61
+ "metadata": {
62
+ "skill": "tidyfactor-doc",
63
+ "version": "1.4.0",
64
+ "site_engine": "mkdocs|docsify|none",
65
+ "doc_root": "docs/",
66
+ "entry_point": "docs/index.md",
67
+ "sidebar_configured": true,
68
+ "api_endpoints_count": 14,
69
+ "stacks": ["php", "typescript", "python"],
70
+ "i18n_enabled": true
71
+ }
72
+ }
73
+ ```
74
+
75
+ ---
76
+
77
+ ## ⚡ Fail-Open Context Resolution Flow
78
+
79
+ Every documentation command (`init`, `collect`, `generate`, `site`) executes context resolution deterministically:
80
+
81
+ 1. **Local Filesystem Scan**: Inspect `docs/`, `mkdocs.yml`, `_sidebar.md`, and project manifest (`package.json`, `composer.json`, `pyproject.toml`).
82
+ 2. **Optional Brain MCP Query**: If `search_knowledge_base` is active, retrieve existing architecture KIs for cross-referencing.
83
+ 3. **Silent Bypass**: If no Brain tool exists, complete the documentation task directly without prompting the user about server status.
@@ -0,0 +1,84 @@
1
+ <!-- last-verified: 2026-09-09 -->
2
+ # Memory: adr-template
3
+
4
+ Authoritative MADR (Markdown Architectural Decision Records) schema for capturing significant architectural choices.
5
+
6
+ ## 1. Single Record Shape (`docs/adr/NNNN-<slug>.md`)
7
+
8
+ ```markdown
9
+ # ADR [NNNN]: [Short Title of Solved Problem and Decision]
10
+
11
+ - **Status**: [Proposed | Accepted | Rejected | Deprecated | Superseded by ADR-XXXX]
12
+ - **Date**: YYYY-MM-DD
13
+ - **Decision-Makers**: [Architect / Agent / Team]
14
+ - **Technical Story / Issue**: [Issue # or Feature Link]
15
+
16
+ ## Context and Problem Statement
17
+
18
+ [Describe the context and problem statement, e.g., in free form or using 2-3 sentences. What forces are at play, what constraints must be satisfied?]
19
+
20
+ ## Decision Drivers
21
+
22
+ - [Driver 1, e.g. sub-second build times]
23
+ - [Driver 2, e.g. strict RTL and Arabic typography support]
24
+ - [Driver 3, e.g. zero external runtime dependencies]
25
+
26
+ ## Considered Options
27
+
28
+ - **Option 1**: [Name of Option 1]
29
+ - **Option 2**: [Name of Option 2]
30
+ - **Option 3**: [Name of Option 3]
31
+
32
+ ## Pros and Cons of the Options
33
+
34
+ ### Option 1: [Name]
35
+
36
+ - Good, because [argument a]
37
+ - Good, because [argument b]
38
+ - Bad, because [argument c]
39
+
40
+ ### Option 2: [Name]
41
+
42
+ - Good, because [argument a]
43
+ - Bad, because [argument b]
44
+ - Bad, because [argument c]
45
+
46
+ ## Decision Outcome
47
+
48
+ **Chosen Option**: "[Option 1]", because [justification: e.g. it resolves Driver 1 and 2 while maintaining Driver 3].
49
+
50
+ ### Positive Consequences
51
+
52
+ - [e.g. 80% reduction in asset footprint]
53
+ - [e.g. Unified documentation deployment without Node.js runtime]
54
+
55
+ ### Negative Consequences / Trade-offs
56
+
57
+ - [e.g. Requires manual markdown authoring instead of automated GUI]
58
+ - [Mitigation: Automated pre-commit linting and link auditing]
59
+
60
+ ## Pros and Cons Matrix
61
+
62
+ | Option | Performance | RTL Support | Maintenance Overhead | Ecosystem Maturity |
63
+ |---|---|---|---|---|
64
+ | Option 1 | High | Native | Low | High |
65
+ | Option 2 | Medium | Partial | High | Very High |
66
+
67
+ ## References & Links
68
+
69
+ - [Official Documentation](https://example.com)
70
+ - [Related PR / Commit](https://github.com/org/repo/pull/1)
71
+ ```
72
+
73
+ ## 2. ADR Master Index Shape (`docs/adr/README.md`)
74
+
75
+ ```markdown
76
+ # Architectural Decision Records (ADRs)
77
+
78
+ This directory documents all significant architectural and technical decisions made in this project.
79
+
80
+ | Number | Date | Title | Status |
81
+ |---|---|---|---|
82
+ | [0001](./0001-record-architecture-decisions.md) | 2026-09-09 | Record Architecture Decisions | Accepted |
83
+ | [0002](./0002-triple-engine-publishing.md) | 2026-09-09 | Triple-Engine Publishing Platform | Accepted |
84
+ ```
@@ -0,0 +1,58 @@
1
+ <!-- last-verified: 2026-09-09 -->
2
+ # Memory: changelog-rules
3
+
4
+ Codified rules and governance standards for maintaining `CHANGELOG.md` as the Single Source of Truth (SSOT) across all software and skill repositories.
5
+
6
+ ## 1. Authoritative Standards
7
+
8
+ 1. **Keep a Changelog v1.1.0**:
9
+ - Humans read changelogs, machines read git logs. Changelogs are curated summaries of user-facing and architectural value, not raw commit dumps.
10
+ - Guiding principles:
11
+ - Group changes by version and release date.
12
+ - Group changes within a release by type.
13
+ - Newest release always appears at the top (reverse chronological).
14
+ - Each version must have a release date formatted as `YYYY-MM-DD`.
15
+
16
+ 2. **Semantic Versioning (SemVer 2.0.0)**:
17
+ - Given a version number `MAJOR.MINOR.PATCH`:
18
+ - **`MAJOR` (x.0.0)**: Incompatible API changes, breaking architectural shifts, or removed features.
19
+ - **`MINOR` (0.x.0)**: Backward-compatible new functionality, new commands, or new workflows.
20
+ - **`PATCH` (0.0.x)**: Backward-compatible bug fixes, link repairs, or documentation corrections.
21
+
22
+ ## 2. Standard Change Sections
23
+
24
+ Always classify changes into one of these 6 standardized buckets:
25
+
26
+ | Section | Icon | Purpose |
27
+ |---|---|---|
28
+ | `Added` | 🚀 | New features, commands, workflows, or platform engines |
29
+ | `Changed` | 🔄 | Modifications in existing functionality, refactors, or UI polish |
30
+ | `Deprecated` | ⚠️ | Soon-to-be removed features that remain functional for now |
31
+ | `Removed` | 🗑️ | Features, endpoints, or deprecated code deleted in this release |
32
+ | `Fixed` | 🐛 | Any bug fixes, broken link repairs, or error corrections |
33
+ | `Security` | 🔒 | Vulnerability fixes, credential redactions, or auth hardening |
34
+
35
+ ## 3. Conventional Commit Mapping
36
+
37
+ When parsing `git log`, automatically map commit prefixes to changelog sections:
38
+
39
+ | Git Commit Prefix | Changelog Section | SemVer Impact |
40
+ |---|---|---|
41
+ | `feat:` / `feat(*):` | `Added` | MINOR |
42
+ | `refactor:` / `style:` / `perf:` | `Changed` | MINOR or PATCH |
43
+ | `deprecate:` | `Deprecated` | MINOR |
44
+ | `remove:` / `drop:` | `Removed` | MAJOR (if breaking) or MINOR |
45
+ | `fix:` / `bug:` / `patch:` | `Fixed` | PATCH |
46
+ | `sec:` / `security:` | `Security` | PATCH or MINOR |
47
+ | `BREAKING CHANGE:` / `feat!:` | Any (`Added`/`Changed`) with breaking note | MAJOR |
48
+ | `docs:` / `chore:` / `test:` | `Changed` or `Fixed` (or omitted if purely internal) | PATCH |
49
+
50
+ ## 4. Invariants & Hygiene
51
+
52
+ - **Zero Undocumented Drift**: No production code or skill modification may be released without a corresponding dated entry in `CHANGELOG.md`.
53
+ - **Atomic Metadata Synchronization**: When updating `CHANGELOG.md`, update all corresponding metadata files synchronously:
54
+ - `package.json` (`"version": "x.y.z"`)
55
+ - `.tidyfactor` (`"version": "x.y.z"`)
56
+ - `brand.yaml` / `brand.json` (`"version": "x.y.z"`)
57
+ - `README.md` / `README.ar.md` (Title banners)
58
+ - **Zero Sensitive Data**: Never leak internal server paths, local absolute paths (`file:///C:`), or real API keys in changelogs.