generic-static-feature-developer
Guide feature development for static HTML/CSS/JS sites. Covers patterns, automation workflows, and content validation. Use when adding features, modifying automation, or planning changes.
What this skill does
# Static Site Feature Developer
Guide feature development for minimalist static sites.
**Extends:** [Generic Feature Developer](../generic-feature-developer/SKILL.md) - Read base skill for development workflow, scope assessment, and build vs integrate decisions.
## Static Site Architecture
### Typical Structure
```
project/
├── index.html # Main page
├── style.css # All styles
├── script.js # All interactions
├── assets/ # Images, icons
├── .github/workflows/ # Automation (optional)
└── docs/ # Documentation
```
### No Build Tools Philosophy
Edit → Save → Deploy (that's it)
- Pure HTML (no templating engines)
- Pure CSS (no Sass/Less/PostCSS)
- Pure JS (no bundling, no transpilation)
- No `node_modules` in production
## Development Workflow
### Local Testing
```bash
# Start local server (cross-platform options)
python -m http.server 8000 # Windows
python3 -m http.server 8000 # macOS/Linux
npx serve . # Node.js (recommended - all platforms)
# Visit http://localhost:8000
```
### Before Committing
1. Test in Chrome, Firefox, Safari
2. Test at 375px, 768px, 1024px
3. Run Lighthouse audit
4. Screenshot current state (for comparison)
## Progressive Enhancement
### Philosophy
1. **Content first** - Works without CSS/JS
2. **Enhance with CSS** - Better styling for capable browsers
3. **Enhance with JS** - Interactivity for JS-enabled browsers
### Example Pattern
```html
<!-- Works without JS -->
<details>
<summary>Menu</summary>
<nav>
<a href="#about">About</a>
<a href="#contact">Contact</a>
</nav>
</details>
```
```javascript
// Enhancement: Custom animation when JS available
if ("IntersectionObserver" in window) {
// Progressive enhancement
}
```
## Vanilla JavaScript Patterns
### Event Delegation
```javascript
// One listener for many elements
document.body.addEventListener("click", (e) => {
if (e.target.matches(".menu-toggle")) {
toggleMenu();
}
if (e.target.matches(".close-btn")) {
closeModal();
}
});
```
### DOM Ready
```javascript
// Modern approach
document.addEventListener("DOMContentLoaded", () => {
initApp();
});
// Or: script at end of body (no event needed)
```
### Class Toggling
```javascript
// Toggle visibility
element.classList.toggle("visible");
// Add/remove
element.classList.add("active");
element.classList.remove("active");
```
## Automation (GitHub Actions)
### Simple Deploy Workflow
```yaml
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./
```
### Image Optimization
```bash
# Optimize before committing
# PNG
pngquant --quality=65-80 image.png
# JPEG
jpegoptim --max=80 image.jpg
# WebP conversion
cwebp -q 80 image.png -o image.webp
```
## Feature Checklist
**Before Starting:**
- [ ] Read CLAUDE.md for project constraints
- [ ] Check existing patterns to reuse
- [ ] Understand performance budget
**During Development:**
- [ ] One change at a time
- [ ] Test in multiple browsers
- [ ] Test responsiveness
- [ ] Keep page weight in budget
**Before Completion:**
- [ ] Lighthouse 95+ Performance
- [ ] All breakpoints tested
- [ ] Screenshots for comparison
- [ ] Documentation updated
## Performance Targets
| Metric | Target |
| ---------------------- | ------ |
| Total weight | < 50KB |
| First Contentful Paint | < 1s |
| Lighthouse Performance | 95+ |
## See Also
- [Generic Feature Developer](../generic-feature-developer/SKILL.md) - Workflow, decisions
- [Code Review Standards](../_shared/CODE_REVIEW_STANDARDS.md) - Quality requirements
- [Design Patterns](../_shared/DESIGN_PATTERNS.md) - UI patterns
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.