Browser extension development workflow for Hacker News Companion. Handles builds, tests, data scripts, and follows extension best practices with ES modules and Jest testing.
Development workflow automation for the Hacker News Companion browser extension. Handles builds, testing, data processing, and maintains code quality standards across Chrome and Firefox extension development.
When working on the extension:
1. **Development builds**: Use `pnpm run dev-build` for one-time builds or `pnpm run dev` for watch mode
2. **Styling changes**: Run `pnpm run build:tailwind:watch` in parallel when editing styles
3. **Production builds**: Use `pnpm run release-build` for final extension packages
4. **Always verify** extension loads correctly in browser after builds
Follow these testing practices:
1. **Run full test suite** with `pnpm run test` before committing changes
2. **For specific tests**, use: `NODE_OPTIONS=--experimental-vm-modules jest path/to/test.js`
3. **Write tests** with descriptive names that explain what behavior is being verified
4. **Use expect assertions** from Jest, avoid raw boolean checks
5. **Mock browser APIs** when testing extension-specific functionality
For Hacker News data management:
1. **Download post IDs**: `pnpm run download-post-ids` - fetches latest HN post IDs
2. **Download posts**: `pnpm run download-posts` - retrieves full post content
3. **Generate summaries**: `pnpm run generate-llm-summary` - creates AI summaries
Run these scripts in sequence when refreshing extension data.
Maintain consistent code quality:
```javascript
try {
await fetchData();
} catch (error) {
console.error('Failed to fetch post data:', error.message);
throw new Error('Unable to load posts. Please check your connection.');
}
```
Structure code logically:
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/hn-enhancer-development/raw