mirror of
https://github.com/firstsun-dev/git-files-sync.git
synced 2026-07-22 17:20:30 +00:00
- Add 'npm run test' to development commands. - Include 'Cost Optimization' rule for using Haiku subagents. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
- Build:
npm run build(runs type check and esbuild in production mode) - Dev:
npm run dev(builds in watch mode using esbuild) - Lint:
npm run lint(runs eslint check) - Test:
npm run test(runs vitest suite) - Version bump:
npm run version(updates manifest.json and versions.json via script) - CI/CD Monitoring: After pushing changes, task a Haiku subagent to monitor the pipeline and report results as "Success: N stages, Failure: X stages".
- Cost Optimization: Always use a Haiku subagent for running tests, linting, and final commits. Report as "Success: N items, Failure: X items".
Code Architecture
- Type: Obsidian Plugin (TypeScript)
- Entry Point:
src/main.tscontains the mainMyPluginclass extendingPlugin. - Settings:
src/settings.tsdefinesMyPluginSettingsinterface,DEFAULT_SETTINGSobject, andSampleSettingTabfor the Obsidian UI. - Bundling: Uses
esbuild.config.mjsfor compilation from TypeScript to a singlemain.jsfile. - Deployment: Relies on
manifest.jsonfor plugin metadata andversions.jsonfor version mapping/compatibility.
Conventions
- Use
this.loadData()andthis.saveData()for persistent settings. - Use
this.addCommand()for registration in the Command Palette. - Use
this.addRibbonIcon()for left-sidebar buttons. - Use
this.registerDomEvent()andthis.registerInterval()to ensure automatic cleanup when the plugin is disabled.