From e3377004a2642d664e97cc4d1030a15bca8bc5ec Mon Sep 17 00:00:00 2001 From: Mike Thicke Date: Fri, 6 Feb 2026 13:20:35 -0500 Subject: [PATCH] Add test vault and development docs Add a test vault with sample content and a script to build and open it in Obsidian for manual plugin testing. Add development section to README. Co-Authored-By: Claude Opus 4.6 --- README.md | 29 +++++++++++++++++++++ scripts/open-test-vault.sh | 23 ++++++++++++++++ test-vault/.gitignore | 7 +++++ test-vault/.obsidian/community-plugins.json | 1 + test-vault/coi/prompts/Code reviewer.md | 1 + test-vault/coi/prompts/Helpful assistant.md | 1 + test-vault/notes/Sample note.md | 13 +++++++++ 7 files changed, 75 insertions(+) create mode 100755 scripts/open-test-vault.sh create mode 100644 test-vault/.gitignore create mode 100644 test-vault/.obsidian/community-plugins.json create mode 100644 test-vault/coi/prompts/Code reviewer.md create mode 100644 test-vault/coi/prompts/Helpful assistant.md create mode 100644 test-vault/notes/Sample note.md diff --git a/README.md b/README.md index 925cd88..6711cf8 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,35 @@ I am an idependent software developer. If you find Co-Intelligence to be useful, [Buy Me a Coffee at ko-fi.com](https://ko-fi.com/X8X71G7YSI) +## Development + +### Setup + +```bash +npm install +npm run dev # Watch mode — rebuilds on file changes +npm run build # Production build (also validates TypeScript types) +npm test # Run tests with Vitest +``` + +### Manual Testing + +A test vault is included at `test-vault/` so you can test the plugin in Obsidian without affecting your personal vault. To build and open it: + +```bash +./scripts/open-test-vault.sh +``` + +The first time you open the vault, you'll need to enable community plugins in Settings > Community plugins. After that, the Co-Intelligence AI plugin will be pre-enabled. + +The script symlinks the build output (`dist/`) into the test vault's plugin directory, so rebuilds are picked up automatically. For a live development workflow: + +1. Run `npm run dev` in one terminal +2. Run `./scripts/open-test-vault.sh` to open the vault +3. After changes rebuild, reload Obsidian (Cmd/Ctrl+P > "Reload app without saving") + +The test vault includes sample folders and system prompts for exercising plugin features. + ## Contributing, Feedback, and Help This is an open source project, using the [MIT License](LICENSE). Pull requests for bug fixes or small improvements are welcome. If you want to get involved in a more substantial way, please [Contact me](https://epistemic.technology/contact/). diff --git a/scripts/open-test-vault.sh b/scripts/open-test-vault.sh new file mode 100755 index 0000000..0830e33 --- /dev/null +++ b/scripts/open-test-vault.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +PROJECT_DIR="$(dirname "$SCRIPT_DIR")" +VAULT_DIR="$PROJECT_DIR/test-vault" +PLUGIN_DIR="$VAULT_DIR/.obsidian/plugins/co-intelligence" + +# Create plugin directory and symlinks +mkdir -p "$PLUGIN_DIR" +ln -sf "$PROJECT_DIR/dist/main.js" "$PLUGIN_DIR/main.js" +ln -sf "$PROJECT_DIR/dist/styles.css" "$PLUGIN_DIR/styles.css" +ln -sf "$PROJECT_DIR/manifest.json" "$PLUGIN_DIR/manifest.json" + +# Build latest +echo "Building plugin..." +npm --prefix "$PROJECT_DIR" run build + +# Open the test vault in Obsidian +echo "Opening test vault in Obsidian..." +open "obsidian://open?path=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$VAULT_DIR'))")" + +echo "Done. If this is the first time, enable the plugin in Settings > Community plugins." diff --git a/test-vault/.gitignore b/test-vault/.gitignore new file mode 100644 index 0000000..f1a2c56 --- /dev/null +++ b/test-vault/.gitignore @@ -0,0 +1,7 @@ +# Obsidian generates config files when the vault is opened. +# Only community-plugins.json is checked in (to pre-enable the plugin). +.obsidian/* +!.obsidian/community-plugins.json + +# Plugin symlinks are machine-specific; the script recreates them. +.obsidian/plugins/ diff --git a/test-vault/.obsidian/community-plugins.json b/test-vault/.obsidian/community-plugins.json new file mode 100644 index 0000000..77287c3 --- /dev/null +++ b/test-vault/.obsidian/community-plugins.json @@ -0,0 +1 @@ +["co-intelligence"] diff --git a/test-vault/coi/prompts/Code reviewer.md b/test-vault/coi/prompts/Code reviewer.md new file mode 100644 index 0000000..8866cc5 --- /dev/null +++ b/test-vault/coi/prompts/Code reviewer.md @@ -0,0 +1 @@ +You are a code reviewer. Review code for bugs, style issues, and potential improvements. Be constructive and specific. diff --git a/test-vault/coi/prompts/Helpful assistant.md b/test-vault/coi/prompts/Helpful assistant.md new file mode 100644 index 0000000..c6c13ce --- /dev/null +++ b/test-vault/coi/prompts/Helpful assistant.md @@ -0,0 +1 @@ +You are a helpful assistant. Be concise and clear in your responses. diff --git a/test-vault/notes/Sample note.md b/test-vault/notes/Sample note.md new file mode 100644 index 0000000..20aec49 --- /dev/null +++ b/test-vault/notes/Sample note.md @@ -0,0 +1,13 @@ +This is a sample note for testing context linking in Co-Intelligence AI. + +## Key points + +- First point with **bold** and *italic* formatting +- Second point with a `code snippet` +- Third point with a [[link to nowhere]] + +```javascript +function hello() { + console.log("Hello from a code block"); +} +```