Skip to content

/hyprlayer_doctor

Verify the configured thoughts storage backend is ready

Check that your hyprlayer environment is wired up for the storage backend you configured (git, obsidian, notion, or anytype). The doctor handles the backend-agnostic concerns first (config resolution, per-repo mapping, dispatch), then runs the checks specific to your backend.

/hyprlayer_doctor

No arguments. A re-run is safe; the only side effects are listed at the end of this page.

Three things invoke the skill:

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 a green result as a sentinel in $TMPDIR keyed on the config-file hash. Later backend touches within 4 hours 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). Edit the config in any way (swap the backend, change a vault path, add a profile) and the cache goes stale, so the doctor re-runs on the next backend touch. The sentinel also expires after 4 hours, since auth tokens drift even when the config doesn’t.

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:

Backend Verifies
git The thoughts repo exists and is mapped, the thoughts/ symlinks and directory layout resolve, the working tree is not mid-rebase; warns on a missing remote or unauthenticated gh.
obsidian The vault path and content root exist, the repo is mapped, symlinks and layout resolve, the root is writable; warns on a leftover .git/ or Obsidian running.
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 MCP server is registered with claude/codex, an authenticated call succeeds, the space exists, and the type (if configured) has the required relations; warns if the desktop app isn’t running.

On notion and anytype, a missing database or type ID is not an error. The doctor confirms the lazy-create path will work on the first write.

  • Green. The backend is ready. The skill caches the result 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 without touching any state.

The doctor never modifies hyprlayer config. Its write-permission probe creates a throwaway item (an archived __hyprlayer_doctor_* row on Notion, a deleted object on Anytype, a removed file on Obsidian) and it touches a cache sentinel in $TMPDIR; it calls no network outside the backend it’s diagnosing.