QuickAdd is an Obsidian community plugin that provides four choice types: templates, captures, macros, and multis.
QuickAdd is an Obsidian community plugin. Source code lives in src/: core logic under engine/, services/, and utils/; Svelte UI in src/gui; shared types in src/types; settings entry in src/quickAddSettingsTab.ts. Bundled artifacts main.js and styles.css stay at the repo root and should be generated, not hand-edited. Place tests and stubs in tests/, and keep user-facing docs in docs/.
- Use
bunfor package management and scripts. Avoid npm/yarn/pnpm. - Use the GitHub CLI (
gh) for issues, PRs, and releases. - When resolving a GitHub issue, use
gh issue develop <issue-number>to create/link the working branch before implementation. - GitHub does not allow approving your own PR from the same account; do not block merge waiting for self-approval.
bun run dev: watch-mode bundle viaesbuild.config.mjs, regeneratingmain.jsas you edit.bun run build: runtsc --noEmitthen produce the production bundle.bun run build-with-lint: run Biome (bun lint) before the production build; use for release packaging.bun run lint: apply ESLint to TypeScript sources to catch type and usage issues.bun run test: execute Vitest with--passWithNoTestsfor fast local verification.
Biome enforces tab indentation (width 2), LF endings, and an 80-character line guide; align editor settings. Use camelCase for variables and functions, PascalCase for classes and Svelte components, and kebab-case for directories and utilities. Preserve the hand-ordered imports in src/main.ts; disable auto-sorting there. Prefer type-only imports and route logging through the logger utilities for consistent output.
Vitest (configured in vitest.config.mts) runs under jsdom and cannot load real Obsidian modules. Structure production code so Obsidian dependencies are injected behind interfaces; unit tests target pure logic and swap in adapters or tests/obsidian-stub.ts. Co-locate specs with their source or group them under tests/feature-name. Use Testing Library helpers for Svelte components, add regression coverage for bug fixes, and ensure bun run test passes before pushing.
Follow Conventional Commits (feat:, fix:, test:, release(version): ...) so semantic-release can determine versions. Keep generated files in the same commit as the changes that produced them. Pull requests must include a concise summary, reproduction steps or screenshots for UI changes, linked issues when relevant, and explicit notes on release or migration impact. Request review from maintainers closest to the touched area.
Docs live in docs/ and use Docusaurus with versioned documentation. The current (unreleased) docs are in docs/docs/, while stable snapshots live in docs/versioned_docs/version-X.Y.Z/.
When releasing a new version:
cd docs && bun run docusaurus docs:version X.Y.ZThis snapshots docs/docs/ as the new stable version. Update docs/docusaurus.config.js to set lastVersion to the new version and add an entry under versions.
Structure:
docs/docs/→ "Next" (unreleased, shows warning banner)docs/versioned_docs/version-X.Y.Z/→ stable release docsdocs/versions.json→ list of versioned snapshotsdocs/versioned_sidebars/→ sidebar configs for each version
Keep docs in sync: update docs/docs/ when adding features, and snapshot when releasing.
Automation or scripted work should surface disruptive operations in the PR description and rerun bun run build-with-lint to keep main.js, manifest.json, and versions.json synchronized. Treat unexpected diffs in those artifacts as blockers until a maintainer approves.
Always use the obsidian cli to test changes in the dev vault.
Obsidian CLI is a command line interface that lets you control Obsidian from your terminal for scripting, automation, and integration with external tools.
Anything you can do in Obsidian can be done from the command line. Obsidian CLI even includes developer commands to access developer tools, inspect elements, take screenshots, reload plugins, and more.
- Always target the
devvault when using the Obsidian CLI by passingvault=devas a prefix argument before the command:obsidian vault=dev <command> .... - Critical: do not use suffix form (
obsidian <command> vault=dev ...). It may resolve to the wrong vault due to CLI parsing behavior. - Dev vault root path:
/Users/christian/Developer/dev_vault/dev/. - QuickAdd plugin path in the vault:
/Users/christian/Developer/dev_vault/dev/.obsidian/plugins/quickadd. - Run
bun run devin this repository to generate/updatemain.jsfor development. - Reload QuickAdd after build/deploy with:
obsidian vault=dev plugin:reload id=quickadd. - In this setup, the vault plugin
main.jsis symlinked to/Users/christian/Developer/quickadd/main.js, so rebuilding updates the active plugin code directly.
- Developer commands are available through
obsidian:devtools,dev:debug,dev:cdp,dev:errors,dev:screenshot,dev:console,dev:css,dev:dom,dev:mobile, andeval. - Keep
vault=devas a prefix argument on every developer command as well. dev:consoleanddev:errorsare only reliable while debugger capture is attached (obsidian vault=dev dev:debug on).- For non-trivial
obsidian evalcode, use a heredoc/file and pass it tocode=...to avoid shell-quoting corruption. - Standard log-inspection sequence:
obsidian vault=dev dev:debug onobsidian vault=dev dev:console clearobsidian vault=dev dev:errors clear- Trigger a QuickAdd action, for example:
obsidian vault=dev command id=quickadd:testQuickAdd - Read logs:
obsidian vault=dev dev:console limit=200 - Check runtime errors:
obsidian vault=dev dev:errors - Detach when done:
obsidian vault=dev dev:debug off
- Default bug workflow: reproduce in Obsidian first, then implement fix, then verify in Obsidian again, then add/adjust unit tests for regression coverage.
- Do not assume a reported bug still exists. Issues may already be fixed by unrelated changes; confirm current behavior before changing code.
- For reproduction, prefer real user conditions over synthetic tests (hotkeys, choice settings, workspace/tab layout, and platform specifics).
- When debugging command-triggered behavior, test both paths:
hotkey execution and direct command execution (
obsidian command ...). - Record evidence from
tabs,workspace,dev:console, anddev:errorsbefore and after the action being tested. - For pane/tab diagnostics, treat
workspace ... idsas authoritative layout evidence and usetabsas a quick summary. - If not reproducible after solid evidence gathering, respond with exact tested setup and ask for a fresh issue with versions, config, and repro artifacts.
- Verifiability is required: work is not complete until behavior can be checked
through the Obsidian CLI in the
devvault. - If a flow is UI-only (for example forms/modals), add a CLI-native verification seam first (command/API entrypoint, inspectable state, and deterministic logs).
- Prefer verification paths that can run both manually and scripted:
command execution,
eval,dev:console,dev:errors,tabs, andworkspace. - Add or update automated tests around the new seam so regressions are caught without depending on manual modal interaction.