Files
ar9av__obsidian-wiki/.github/copilot-instructions.md
Arnav 77d74e0261 feat(config): XDG-style config location, with legacy fallback (#172) (#173)
* feat(config): resolve global config from an XDG-style location (#172)

The global config lived at ~/.obsidian-wiki, which isn't XDG-compliant.
It now resolves to $XDG_CONFIG_HOME/obsidian-wiki (default
~/.config/obsidian-wiki).

Existing installs are unaffected: if ~/.obsidian-wiki is present and the
XDG path is not, the legacy directory is used as-is. No migration is
required, and nothing moves on upgrade. Once the XDG path exists it wins,
so `mv ~/.obsidian-wiki ~/.config/obsidian-wiki` is all a migration takes.

Resolution is implemented identically in Python (cli.py), bash (setup.sh,
scripts/daily-update.sh, scripts/wiki-notify.sh), and the Config
Resolution Protocol that every skill defers to, so vault-scoped state and
named `config.<name>` profiles stay in one place.

* fix(config): stop setup from wiping user-added config keys

`write_config` rewrote the global config with only the three setup-managed
keys, so every `obsidian-wiki setup` — including the one a pip upgrade
prompts for — silently destroyed anything else in the file:
OBSIDIAN_LINK_FORMAT, QMD_WIKI_COLLECTION, WIKI_SKIP_PROJECTS, sync
settings, and comments.

Setup now owns only OBSIDIAN_VAULT_PATH, OBSIDIAN_WIKI_REPO and
OBSIDIAN_WIKI_VERSION, updating those in place and carrying every other
line over untouched. Duplicate definitions of a managed key collapse to
one.

Predates the XDG change (same behavior on main) but is fixed here because
this branch already touches config writing, and the XDG work makes
re-running setup more likely.

Also pins PYTHONPATH in both new test files so they exercise this
checkout rather than whatever obsidian_wiki happens to be installed.
2026-08-16 20:40:09 -07:00

45 lines
2.8 KiB
Markdown

# Obsidian Wiki — Copilot Context
This project is a **skill-based framework** for building and maintaining an Obsidian knowledge base using AI coding agents. There are no scripts or dependencies — everything is markdown instructions that the agent executes directly.
## Project Overview
- **Purpose:** Build and maintain an Obsidian wiki using the LLM Wiki pattern (Andrej Karpathy).
- **Tech Stack:** Markdown only. No code, no dependencies. The AI agent IS the runtime.
- **Key Config:** Resolve config via `AGENTS.md`: inline `@name` vault override first, then `.env`, then the global config (`~/.config/obsidian-wiki/config`, XDG-style; legacy `~/.obsidian-wiki/config` still honored). The resolved config supplies `OBSIDIAN_VAULT_PATH`.
- **Skills:** `.skills/` contains skill folders, each with a `SKILL.md` defining a workflow.
## Key Concepts
- The wiki is a **compiled artifact** — knowledge distilled from raw sources into interconnected pages.
- Every wiki page has YAML frontmatter: `title`, `category`, `tags`, `sources`, `created`, `updated`.
- Pages are connected with Obsidian `[[wikilinks]]`.
- A `.manifest.json` in the vault root tracks all ingested sources for delta-based updates.
- `index.md` and `log.md` must be updated after every operation.
## Skills Reference
| Skill | Folder | Purpose |
|---|---|---|
| Setup | `.skills/wiki-setup/` | Initialize vault structure |
| Ingest | `.skills/wiki-ingest/` | Distill documents into wiki pages, plus any text data — chat exports, logs, transcripts |
| History Router | `.skills/wiki-history-ingest/` | Route `/wiki-history-ingest <claude|copilot|codex|hermes|openclaw|pi>` to the right history skill |
| Claude History | `.skills/claude-history-ingest/` | Mine `~/.claude` conversations |
| Codex History | `.skills/codex-history-ingest/` | Mine `~/.codex` sessions and rollout logs |
| Status | `.skills/wiki-status/` | Audit ingestion state and delta |
| Query | `.skills/wiki-query/` | Answer questions from wiki |
| Context Pack | `.skills/wiki-context-pack/` | Compile bounded vault context for another agent |
| Lint | `.skills/wiki-lint/` | Find broken links, orphans |
| Rebuild | `.skills/wiki-rebuild/` | Archive and rebuild |
| Cross-Linker | `.skills/cross-linker/` | Auto-discover and insert missing wikilinks |
| Tag Taxonomy | `.skills/tag-taxonomy/` | Enforce consistent tag vocabulary |
| LLM Wiki | `.skills/llm-wiki/` | Core architecture pattern |
| Skill Creator | `.skills/skill-creator/` | Create new skills |
## Coding Conventions
- When creating wiki pages, always use YAML frontmatter.
- Use `[[wikilinks]]` syntax for cross-references — NOT markdown links.
- Project-specific knowledge goes in `projects/<name>/`. Global knowledge goes in top-level categories.
- Never modify the `.obsidian/` directory.