yurko-sapling/my-extension icon
public
Published on 5/24/2025
extension

Rules

Build & Development Commands

  • Use npm install to install all dependencies.
  • Use npm run dev to start the development server with hot reload (via Vite).
  • Use npm run build to build the extension for production into the dist/ directory.
  • Output must be compatible with Chrome Extension Manifest V3.

Testing Guidelines

  • Use manual browser testing by loading dist/ as an unpacked Chrome extension.
  • Test popup, content scripts, and background behavior in isolation.
  • All React components in src/components/ should have minimal unit test coverage (if applicable).
  • Use npm run lint to check for errors.

Code Style & Guidelines

  • Use React with functional components and hooks only.
  • Follow the Airbnb JavaScript style guide.
  • Prefer useEffect, useState, and custom hooks for logic control.
  • Keep components under 200 lines. Split logic into helper functions or hooks if needed.
  • Use ESM import/export syntax exclusively.
  • Use Tailwind CSS for styling. Prefer utility-first classes and avoid custom CSS when possible.

Documentation Guidelines

  • Each React component must include a JSDoc-style comment describing its purpose and props.
  • README.md should explain:
    • How to run and build the plugin
    • How the extension is structured (e.g., popup, background, content scripts)
    • Any limitations or manual testing notes
  • Prefer inline comments when logic is non-obvious.

Chrome Extension Guidelines

  • Manifest must follow v3 format (manifest_version: 3).
  • Use service worker for background logic (background.service_worker).
  • Content scripts should be modular and avoid polluting the global scope.
  • Use web_accessible_resources properly to expose only needed files.
  • Avoid using eval, inline scripts, or non-secure permissions.

Continue Plugin Agent-Specific Instructions

  • When generating code:
    • Respect existing folder and module structure (src/, public/, dist/)
    • Do not overwrite manifest.json unless explicitly requested.
    • When creating components, place them in src/components/
    • If modifying styles, use Tailwind classes only.
  • When debugging or suggesting fixes:
    • Check for correct manifest fields, React mount points, and dev build errors.
    • Suggest modular, readable improvements.