Skip to content

/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_doctor

No arguments. Idempotent — safe to re-run.

The skill is invoked in three situations:

TriggerWhat kicks it off
First backend touch per sessionA 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 requestYou ran /hyprlayer_doctor directly, or said something like “verify hyprlayer setup” or “is my notion backend connected”.
Unexpected failureA 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.

Backend-agnostic steps run for all four backends:

  1. Config resolution. Reads the hyprlayer config from the OS config dir. Errors if the file is missing, malformed JSON, or has no thoughts section.
  2. Per-repo mapping. Resolves which storage profile is active for the current working repository.
  3. Cache freshness. Computes the config-content hash and compares it against the doctor’s cache file.

Then it dispatches into a backend-specific procedure:

BackendVerifies
gitThe thoughts repo exists, is a git repo, has a remote, and git fetch / git status succeed.
obsidianThe vault path exists, the configured subfolder is writable, and the YAML frontmatter schema parses.
notionThe 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.
anytypeThe 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.

  • 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.