Nano Banana Pro
Agent skill for nano-banana-pro
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Pixel Banner is an Obsidian plugin that adds customizable banner images to notes. It supports AI-generated banners via Pixel Banner Plus, local images/videos, and integrations with multiple image APIs (Pexels, Pixabay, Flickr, Unsplash).
Target Obsidian Version: 1.6.0+ Language: JavaScript (no TypeScript)
# Install dependencies npm install # Build and copy to test vault (PRIMARY DEVELOPMENT COMMAND) npm run test-build # Full build (includes creating example-vault.zip) npm run build # Clean install dependencies npm run clean
# Run all tests (671+ tests) npm test # Run tests with UI npm test:ui # Run tests with coverage report npm test:coverage # Run a single test file npx vitest tests/unit/core/bannerUtils.test.js # Run tests matching a pattern npx vitest -t "getInputType" # Run tests in watch mode npx vitest --watch # Debug a specific test npx vitest tests/unit/core/bannerUtils.test.js --reporter=verbose
Test Environment:
tests/ directory (unit and integration).vault/pixel-banner-example/ for manual testing.vault/pixel-banner-example/.obsidian/plugins/pexels-banner/scripts/esbuild.config.mjs)UPDATE.md into release notes during buildscripts/copy-build.mjs to copy built files to test vaultsrc/core/pixelBannerPlugin.js extends Obsidian's Plugin classeventHandler.jsbannerManager.js determines what banner to display based on frontmatter, folder settings, or defaultsbannerUtils.js:getInputType() identifies whether input is a keyword, URL, vault path, wiki link, or markdown imageapiService.jsbannerManager.js:insertBanner() handles actual DOM manipulationcacheHelpers.js manages image caching for performanceSupported Input Formats (plugin can READ all):
image.jpg, folder/image.jpg (Make.md compatible)[[image.jpg]], ![[image.jpg]]https://example.com/image.jpgfile:///C:/path/image.jpgsunset beach (triggers API search)Image Property Format Setting (how plugin SAVES):
image - Plain format without brackets (Make.md compatible)[[image]] - Wiki link format![[image]] - Embedded wiki link formatimage (plain format)Path Resolution Logic (
bannerUtils.js:getInputType()):
All modals extend Obsidian's Modal class and follow a pattern:
onOpen() builds the UIonClose() handles cleanupKey modals:
selectPixelBannerModal.js - Main banner selection interfacepixelBannerStoreModal.js - Browse/download from collectiongenerateAIBannerModal.js - AI generation interfacetargetPositionModal.js - Position/style configurationsrc/core/settings.jssrc/settings/tabs/inventory.md when modifying files (required by .cursor/rules)UPDATE.md for user-facing changes (shown in plugin UI)CHANGELOG.md with technical changes.vault test environment before committingtests/unit/ - Test individual functions/componentstests/integration/ - Test workflows and component interactionstests/mocks/obsidian.js simulate Obsidian APIbannerUtils.test.js - Input type detection and path resolutionfrontmatterUtils.test.js - Frontmatter parsing and updates (includes Image Property Format tests)imagePropertyFormat.test.js - Make.md compatibility testsbannerWorkflow.test.js - Complete banner display workflowsmodalWorkflows.test.js - Modal interactionsapiService.test.js - External API integrationscacheHelpers.test.js - Image caching functionalitysrc/resources/constants.jssrc/services/apiService.jssrc/modal/modals/searchModal.jstests/unit/services/apiService.test.jssrc/core/bannerManager.jsinsertBanner() and related methodsstyles.csstests/integration/bannerWorkflow.test.jssrc/utils/frontmatterUtils.jssrc/core/bannerUtils.js:getInputType()getPathFromObsidianLink() and getPathFromMarkdownImage()imagePropertyFormat)tests/unit/utils/frontmatterUtils.test.jstests/unit/utils/imagePropertyFormat.test.jsWhen adding new formats, update:
src/settings/tabs/settingsTabGeneral.js - Add dropdown optionsrc/utils/frontmatterUtils.js - Handle format in updateNoteFrontmatter()src/core/settings.js - Add to DEFAULT_SETTINGS if neededtests/unit/utils/frontmatterUtils.test.js.vault directory's Obsidian instancebannerManager.js for banner insertion issuesbannerUtils.js:getInputType() for path resolution issuesmanifest.json and package.jsonCHANGELOG.md with technical release notesUPDATE.md for user-facing changes (shown in plugin UI)inventory.md if files were added/removed/modifiednpm run build to create release bundle and example-vault.zip.vault environment before releasingsrc/core/ - Main plugin logic, banner management, event handlingsrc/modal/ - UI modals for banner selection, AI generation, settingssrc/services/ - API integrations (Pexels, Pixabay, Flickr, Unsplash, AI)src/settings/ - Plugin settings and configuration UIsrc/utils/ - Utility functions (frontmatter, caching, constants)styles.css - Plugin CSS (banner styling, modal UI)Plugin class, uses Modal, Setting, workspace events