mirror of
https://github.com/sandsaber/mdMenu.git
synced 2026-07-22 07:45:30 +00:00
3.2 KiB
3.2 KiB
AGENTS.md
This file is the canonical project guide for coding agents working on mdMenu.
Project
mdMenu is a clean-room Obsidian plugin that provides a compact, mini WYSIWYG-style Markdown formatting toolbar while keeping notes as plain Markdown.
The implementation is inspired by cMenu as a product idea, but it must not copy cMenu source files.
Commands
Install dependencies:
npm install
Run unit tests:
npm run test
Run lint checks:
npm run lint
Run TypeScript checks:
npm run typecheck
Build the root Obsidian plugin bundle:
npm run build
Build the copyable release folder:
npm run build:dist
Run the production dependency audit:
npm run audit
Run the full pre-release gate:
npm run check
Release Artifacts
npm run build:dist creates:
dist/mdmenu/main.js
dist/mdmenu/manifest.json
dist/mdmenu/styles.css
dist/mdmenu/LICENSE
dist/ is ignored by Git. Rebuild it whenever a fresh copyable plugin folder is needed.
Release Workflow
.github/workflows/release.ymlfollows the Grimoire-style tag release flow.- Release tags use
x.y.zwithout avprefix. - The workflow must verify that the tag matches
package.jsonanddist/mdmenu/manifest.json. - Release assets are
dist/mdmenu/main.js,dist/mdmenu/manifest.json, anddist/mdmenu/styles.css. - Keep
actions/attestenabled for release assets.
Community Plugin Review
manifest.jsondescription must not include the word "Obsidian"; the plugin directory context already implies it.- Preferred Lucide icon for plugin listing or community metadata:
file-pen-line. - GitHub release assets should include artifact attestations for
main.js,manifest.json, andstyles.cssso users can verify provenance from the source repository.
Architecture
src/main.ts: plugin lifecycle, command registration, toolbar execution, settings wiring.src/settings.ts: pure settings defaults and normalization.src/settingsTab.ts: Obsidian settings tab UI.src/commands/markdownCommands.ts: pure Markdown transforms and editor adapters.src/commands/registry.ts: built-in toolbar command definitions.src/toolbar/toolbar.ts: toolbar DOM controller.src/toolbar/events.ts: workspace and DOM event wiring.src/toolbar/positioning.ts: pure viewport positioning helpers.tests/: Vitest coverage for pure behavior and normalization.scripts/build-dist.mjs: release folder builder.
Development Notes
- Keep documentation and project-facing text in English.
- Keep
settings.tsfree of runtime Obsidian imports so tests can import it without resolving the Obsidian runtime package. - Prefer pure functions for Markdown transforms and positioning before wiring them into Obsidian APIs.
- Toolbar separators are settings items with
type: "separator"and nocommandId. - Manual toolbar placement stores
manualPosition; clamp positions at render time without overwriting the saved coordinates unless the user drags the handle. - Keep generated artifacts out of Git unless a release workflow explicitly requires them.
- Run
npm run checkbefore pushing release-related changes.
License
MIT License. Copyright (c) 2026 Michael Makarov.