🧠 Brain Initializer (init-brain.sh)
"A clean home for a clear mind." - Initializing the Cognitive State.
1. 🏛️ Purpose
Version: v4.1 (Root Aware)
Description: Safely initializes the .agents/brain directory and default artifacts (task.md, walkthrough.md) to ensure cognitive continuity for AI agents.
2. 🛡️ Safety Mechanisms
| Mechanism | Status | Description |
|---|---|---|
| Idempotency | ✅ Enforced | Checks if [ ! -d ] before creating. Skips existing files. |
| Exit-on-Error | ✅ Active | set -e injected for safety. |
| Root Check | ✅ Active | Fails if not a git repository. |
3. ⚙️ Usage
./tools/init-brain.sh
4. 🧠 Logic Flow
- Repo Check: Confirms execution within a valid Git repository.
- Directory Creation: Creates
.agents/brain/if missing. - Artifact Generation: Populates
task.md,walkthrough.md,implementation_plan.md, andDSOM_TEMPLATE.mdwith default boilerplate content only if they don't exist.
5. 📝 Extracted Comments
"Safely initializes the Deep State of Mind (DSOM) directory and artifacts at the repository root to ensure cognitive continuity for AI agents."
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-04 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0