Imported from punassuming/obsidian-ranger (
AGENTS.md). Install upstream withnpx skills add punassuming/obsidian-ranger. Copyright stays with the author.
AGENTS.md
Guidance for coding agents working in obsidian-ranger (File Nav - Ranger for Obsidian).
Scope and Goal
- Keep the plugin keyboard-first, minimal, fast, and Obsidian-native.
- Prefer focused changes with clear behavior and low regression risk.
Repository Snapshot
- Main source:
src/main.ts - Built output:
main.js(generated) - Styles:
styles.css - Plugin metadata:
manifest.json - Version compatibility map:
versions.json - Build tooling:
build.mjs,esbuild.config.mjs - Lint config:
eslint.config.mts - Docs:
README.md,docs/quick-reference.md,docs/contributing.md,docs/changelog.md
Environment and Commands
- Install deps:
npm ci - Dev watch build:
npm run dev - Production build:
npm run build - Lint:
npm run lint - Sync manifest/versions to package version:
npm run version
Notes:
npm run buildruns TypeScript checks (tsc -noEmit -skipLibCheck) and bundles tomain.js.main.jsis generated fromsrc/main.ts; do not hand-editmain.jsunless explicitly required.npm run versionupdatesmanifest.jsonandversions.jsonand stages those files.
Coding Conventions
- Language: TypeScript (strict settings enabled in
tsconfig.json). - Keep
no-explicit-anyandno-unsafe-assignmentconstraints in mind (enforced by ESLint). - Match existing style: concise functions, clear naming, minimal comments, 2-space indentation.
- Prefer existing Obsidian APIs and current plugin patterns over introducing abstractions.
Change Workflow
- Read related code paths in
src/main.tsand relevant docs before editing. - Make minimal, targeted edits.
- Run
npm run buildandnpm run lintafter substantial changes. - For behavior changes, update user docs (
README.mdand/ordocs/quick-reference.md). - Add a changelog entry in
docs/changelog.mdfor user-visible changes.
Manual Validation Checklist
- Open plugin in Obsidian desktop and verify:
-opens File Nav.- Core navigation keys still work (
hjkl,gg,G,/,f). - File operations (copy/move/delete/rename/duplicate/create) still function.
- Preview/details toggles (
zd,zp,zm) behave correctly. - Search/filter state and selection state are stable after operations.
Release and CI Notes
- CI runs build + lint on Node 20 and 22 (
.github/workflows/lint.yml). - Release assets are
manifest.json,main.js,styles.css(.github/workflows/release.yml). - Version bumps are automated on merged PRs to
main(.github/workflows/auto-version-bump.yml).
AGENTS.md Maintenance Rule
- Treat this file as a living contract.
- Update
AGENTS.mdin the same PR whenever any of these change: - Build/lint/version commands
- Source layout or major architecture
- CI/release workflow behavior
- Coding/testing conventions used by contributors