/hyprlayer_doctor
Verify the configured thoughts storage backend is ready
Verify that the user’s hyprlayer environment is wired up correctly for whichever storage backend is configured (git, obsidian, notion, or anytype). Backend-agnostic concerns (config resolution, per-repo mapping, dispatch) are checked centrally; backend-specific checks live alongside.
/hyprlayer_doctorNo arguments. Idempotent — safe to re-run.
When it runs
Section titled “When it runs”The skill is invoked in three situations:
| Trigger | What kicks it off |
|---|---|
| First backend touch per session | A slash command that needs to read or write a thought calls the skill once, then caches the green result against the config-file content hash. Subsequent calls in the same session skip. |
| User request | You ran /hyprlayer_doctor directly, or said something like “verify hyprlayer setup” or “is my notion backend connected”. |
| Unexpected failure | A backend operation returned a 401, 404, schema mismatch, lock, or permission error. The skill runs once to diagnose; it does not loop. |
The cache key is a content hash of ~/Library/Application Support/hyprlayer/config.json (or its XDG_CONFIG_HOME / %APPDATA% equivalent). Any edit to the config — backend swap, vault path change, new profile — invalidates the cache and re-runs the doctor on the next backend touch.
What it checks
Section titled “What it checks”Backend-agnostic steps run for all four backends:
- Config resolution. Reads the hyprlayer config from the OS config dir. Errors if the file is missing, malformed JSON, or has no
thoughtssection. - Per-repo mapping. Resolves which storage profile is active for the current working repository.
- Cache freshness. Computes the config-content hash and compares it against the doctor’s cache file.
Then it dispatches into a backend-specific procedure:
| Backend | Verifies |
|---|---|
| git | The thoughts repo exists, is a git repo, has a remote, and git fetch / git status succeed. |
| obsidian | The vault path exists, the configured subfolder is writable, and the YAML frontmatter schema parses. |
| notion | The Notion connector is reachable through the agent tool’s MCP, the configured database_id (if any) still exists, and the unified schema is present on it. |
| anytype | The Anytype desktop app is running, the MCP server registered, the ANYTYPE_API_KEY resolves, and the configured space + type still exist. |
For notion and anytype, missing database / type IDs are not an error — the doctor confirms the lazy-create path will work on the first write.
Exit conditions
Section titled “Exit conditions”- ✅ Green. Backend is ready; the green result is cached against the config hash and the caller proceeds.
- ❌ Red. Prints a remediation step (e.g. “run
hyprlayer thoughts init”, “start the Anytype desktop app”, “connect Notion in your agent tool’s MCP settings”) and stops. No state is mutated.
The doctor never modifies hyprlayer config, never writes to the backend, and never calls the network outside the backend it’s diagnosing.