This file serves as the authoritative reference for AI agents working on the
kabir-dohe-apicodebase.
Chrome extension that enhances npm package pages with an install-helper sidebar. Provides version selection, package manager choice (npm/yarn/pnpm), dependency type toggle, and one-click copy functionality.
React 19 · TypeScript (strict, verbatimModuleSyntax) · Bun · Vite (ES output) · Sass (component partials) · Vitest + RTL + jsdom
- Type: React 19
- Lang: TypeScript (strict, verbatimModuleSyntax)
- Bunlder: Vite (ES output)
- UI: Sass (component partials)
- Testing: Vitest + RTL + jsdom
- Package Manager: Bun
src/content/index.tsx # Content script entry point
src/content/SidebarApp.tsx # React UI component
src/ui/styles.scss # Main stylesheet (imports partials)
src/ui/components/ # SCSS partials (_card, _command, _controls, _copy, _hint)
src/ui/_variables.scss # SCSS variables
src/ui/_mixins.scss # SCSS mixins
src/manifest.json # Extension manifest (outputs to dist/)
dist/ # Build output (js/, ui/, assets/)
assets/ # Static icons (edit only if requested)
bun run dev # Start watch mode
bun run build # Production build
bun run lint # ESLint check
bun run lint:fix # ESLint auto-fix
bun run format # Prettier format
bun run format:check # Prettier check
bun run stylelint # SCSS linting
bun run stylelint:fix # SCSS auto-fix
bun run tsc # Type check
bun run test # Run tests
bun run test:watch # Test watch mode
bun run test:coverage # Coverage report- Components:
PascalCase - Functions/variables:
camelCase - Files:
kebab-case - Constants:
SCREAMING_SNAKE_CASE
- Use
interfacefor object shapes,typefor unions - Avoid
any(useunknowninstead) - Avoid non-null assertion
!(use?.or explicit checks)
- Remove unused
Reactimports (React 19 JSX transform) - Run
bun run lint && bun run tsc - Prefix intentionally unused variables with
_ - Add JSDoc for all exported functions
- Location:
src/**/__tests__ - Use
data-testidattributes for DOM queries - Setup file:
vitest.setup.ts
- Add JSDoc comments for exported functions and complex types only
Before preparing git.md (after each task):
- Run
bun run tsc— Type check - Run
bun run format:check— Format check - Run
bun run lint— ESLint check
After completing a task:
- Check unstaged changes:
git status --porcelain&&git diff - Stage files:
git add <files> - Create
.tmp/git.mdcontaining the staged files and commit command - Create separate commits for each logical change
- Do NOT run git commands directly — only write to
.tmp/git.md - Wait for user to verify and commit
- Do NOT restore
.tmp/git.mdafter it's cleared — clearing is intentional
Example .tmp/git.md:
git add src/app/api/couplets/route.ts src/lib/server/utils/response/response.ts
git commit -m "feat: add couplets endpoint with response caching
- implement GET handler for fetching all couplets
- add successCached response helper with cache headers"Format: <type>(<scope>): <summary>
Types: feat, fix, docs, test, refactor, style, build, chore
Rules: Subject line ≤50 chars, lowercase. Body: normal case, max 72 chars per line. Blank line after subject.