You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AI_CONTEXT.md
+39-19Lines changed: 39 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,13 @@ We operate on a **"Detached Docs"** strategy to ensure security:
19
19
20
20
3.**Secret Redaction:** When embedding code blocks, ALWAYS replace `!secret wifi_password` with `!secret [REDACTED]`.
21
21
22
-
4. Person names reduction: When you find names from anywhere replace them as follows:
23
-
24
-
* 'Jukka' -> 'Evis'
25
-
26
-
* 'Alisa' -> 'Daughter'
27
-
28
-
* 'Piia' -> 'Grandma'
29
-
30
-
* 'Elias' -> 'Grandpa'
31
-
32
-
* 'Anton' -> 'Guest'
22
+
4.**Privacy & Name Redaction (STRICT):** You must replace ALL occurrences of family names, **including lowercase variants** found in code variables or entity IDs.
23
+
24
+
* 'Jukka' OR 'jukka' -> 'Evis'
25
+
* 'Alisa' OR 'alisa' -> 'Daughter'
26
+
* 'Piia' OR 'piia' -> 'Grandma'
27
+
* 'Elias' OR 'elias' -> 'Grandpa'
28
+
* 'Anton' OR 'anton' -> 'Guest'
33
29
34
30
## 3. Documentation Style Guide
35
31
@@ -45,21 +41,26 @@ We operate on a **"Detached Docs"** strategy to ensure security:
45
41
46
42
***Format:**
47
43
48
-
***YAML Conversion:** When converting JSON (dashboards) to YAML, ensure **multi-line formatting** with 2-space indentation. NEVER output single-line object dumps or PowerShell artifacts (e.g. `@{...}`).
44
+
***YAML Conversion:** When converting JSON (dashboards) to YAML, ensure **multi-line formatting** with 2-space indentation. NEVER output single-line object dumps.
49
45
50
46
* Use Standard YAML code blocks for configuration.
51
47
52
48
* Use Admonitions (`!!! info`) for architectural notes.
53
49
54
-
## 4. Standard Operating Procedures (SOPs)
55
-
56
-
Refer to **`docs/system_manual/setup_guide.md`** for the specific prompts to run for:
57
-
58
-
* Generating Package Documentation.
50
+
## 4. Coding Standards for Scripts
59
51
60
-
* Converting Dashboards to YAML.
52
+
When creating Python or Shell scripts for this project:
61
53
62
-
* Updating the System Structure.
54
+
1.**Naming Convention:** All helper tools must start with `ag_` (e.g., `ag_regenerate_dashboards.py`).
55
+
2.**File Headers:** Every script must begin with a standard comment block:
@@ -68,3 +69,22 @@ Refer to **`docs/system_manual/setup_guide.md`** for the specific prompts to run
68
69
* We must push changes from the `docs_site/` directory to trigger a build.
69
70
70
71
***CNAME:** Ensure `docs/CNAME` exists and contains `www.evishome.com`.
72
+
73
+
## 6. Project History & Architectural Decisions (ADRs)
74
+
75
+
*This section captures 'Silent Knowledge' and lessons learned.*
76
+
77
+
1.**ADR-001: Detached Documentation:**
78
+
***Decision:** We use two separate Git repositories. The root `/config` is local-only to prevent accidental secret leakage. Only `docs_site/` is pushed to GitHub.
79
+
***Why:** Home Assistant config contains too many sensitive files (secrets, logs, backups) to safely manage in a public repo without complex git-crypt setups.
80
+
81
+
2.**ADR-002: Dashboard Generation via Python:**
82
+
***Failure:** Using LLMs to "rewrite" JSON dashboards often results in broken YAML or single-line dumps.
83
+
***Decision:** We rely on `ag_regenerate_dashboards.py`. This script forces `default_flow_style=False` to ensure readable, block-style YAML output. It also enforces privacy redaction programmatically.
84
+
85
+
3.**ADR-003: Samba & Git Ownership:**
86
+
***Issue:** Windows clients accessing HA via Samba see "Dubious Ownership" errors because the files are owned by `root` on the server.
87
+
***Fix:** We enforce `git config --global --add safe.directory '*'` on all dev machines.
88
+
89
+
4.**ADR-004: MkDocs Material Features:**
90
+
***Decision:** We explicitly enable `navigation.indexes` (folders act as pages) and `admonition` extensions to support high-quality CMDB layouts.
> 2.**Parse & Convert:** Convert JSON to **Block-Style YAML** (`default_flow_style=False`).
191
-
> 3.**Redact:** Apply name redaction rules (e.g., Jukka -> Evis) as per `AI_CONTEXT.md`.
192
-
> 4.**Write Output:** Create headers for each view and embed the clean YAML code blocks."
193
-
194
-
### Task: Update Structure Documentation
195
-
196
-
**Use when:** You have added new top-level folders or changed `configuration.yaml`.
208
+
**Task: Convert Dashboard to YAML (Python Method)**
209
+
> "Run `python ag_regenerate_dashboards.py` in the terminal.
210
+
> This script will read the raw JSON dashboards, apply strict privacy redaction (Jukka->Evis, etc.), convert everything to clean YAML, and update `dashboards.md`."
0 commit comments