Web development conventions for Adynato projects. Covers image optimization with img4web, asset management, component patterns, styling, and performance best practices. Use when building or modifying web applications, adding images/assets, or creating UI components.
Installation
Details
Usage
After installing, this skill will be available to your AI coding assistant.
Verify installation:
npx agent-skills-cli listSkill Instructions
name: adynato-web description: Web development conventions for Adynato projects. Covers image optimization with img4web, asset management, component patterns, styling, and performance best practices. Use when building or modifying web applications, adding images/assets, or creating UI components.
Web Development Skill
Use this skill for all Adynato web projects and frontend development.
Image & Asset Management
Always Use img4web
When adding images or visual assets to any Adynato project, use adynato/img4web.
# Install globally
npm install -g @adynato/img4web
# Or use npx
npx @adynato/img4web <input> [options]
When to Use img4web
- Adding any new image to a project
- Processing user-uploaded images
- Optimizing existing unoptimized images
- Converting images to modern formats (WebP, AVIF)
- Generating responsive image sets
img4web Usage
# Basic optimization
npx @adynato/img4web ./src/images
# With specific output formats
npx @adynato/img4web ./image.png --formats webp,avif
# Generate responsive sizes
npx @adynato/img4web ./hero.jpg --sizes 640,1024,1920
# Watch mode during development
npx @adynato/img4web ./src/images --watch
Image Requirements
| Use Case | Max Width | Formats | Quality |
|---|---|---|---|
| Hero/Banner | 1920px | WebP, AVIF, fallback JPG | 80-85 |
| Content Images | 1200px | WebP, AVIF | 80 |
| Thumbnails | 400px | WebP | 75 |
| Icons/Logos | Original | SVG preferred, else PNG | Lossless |
| OG Images | 1200x630 | PNG or JPG | 90 |
Image Component Pattern
Always use responsive images with modern format fallbacks:
// Next.js
import Image from 'next/image'
<Image
src="/images/hero.webp"
alt="Descriptive alt text"
width={1920}
height={1080}
priority // for above-fold images
placeholder="blur"
blurDataURL={blurDataUrl}
/>
<!-- Plain HTML with picture element -->
<picture>
<source srcset="/images/hero.avif" type="image/avif">
<source srcset="/images/hero.webp" type="image/webp">
<img src="/images/hero.jpg" alt="Descriptive alt text" loading="lazy">
</picture>
Asset Organization
public/
βββ images/
β βββ blog/
β β βββ [post-slug]/
β β βββ cover.webp
β β βββ cover.avif
β β βββ *.webp
β βββ og/
β β βββ [page-slug].png
β βββ icons/
β β βββ *.svg
β βββ hero/
β βββ *.webp
βββ fonts/
β βββ *.woff2
βββ videos/
βββ *.mp4
Component Patterns
File Naming
- Components:
PascalCase.tsx(e.g.,Button.tsx,NavBar.tsx) - Utilities:
camelCase.ts(e.g.,formatDate.ts) - Hooks:
useCamelCase.ts(e.g.,useAuth.ts) - Types:
types.tsor[feature].types.ts
Component Structure
// components/Button.tsx
import { type ReactNode } from 'react'
interface ButtonProps {
children: ReactNode
variant?: 'primary' | 'secondary'
onClick?: () => void
}
export function Button({ children, variant = 'primary', onClick }: ButtonProps) {
return (
<button
className={`btn btn-${variant}`}
onClick={onClick}
>
{children}
</button>
)
}
Export Pattern
Prefer named exports over default exports:
// Good
export function Button() { ... }
export function Input() { ... }
// Avoid
export default function Button() { ... }
Performance Checklist
Before deploying any web project:
- All images processed through img4web
- Images use WebP/AVIF with fallbacks
- Above-fold images have
priorityorfetchpriority="high" - Below-fold images have
loading="lazy" - Fonts are self-hosted as WOFF2
- Critical CSS is inlined
- JavaScript is code-split appropriately
- No layout shift (CLS) issues
Styling
Preferred Stack
- Tailwind CSS - utility-first styling
- CSS Modules - when component-scoped styles needed
- CSS Variables - for theming and dynamic values
Tailwind Conventions
// Use consistent ordering: layout, spacing, sizing, typography, colors, effects
<div className="flex items-center gap-4 p-4 w-full text-sm text-gray-700 bg-white rounded-lg shadow-md">
Dark Mode
Always support dark mode:
<div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100">
More by adynato
View allCloudflare Workers and Pages deployment for Adynato projects. Covers wrangler CLI, reading logs for debugging, KV/D1/R2 storage, environment variables, and common errors. Use when deploying to Cloudflare, debugging workers, or configuring edge functions.
Handles SEO requirements for all web content including blogs, landing pages, and documentation. Covers LD+JSON schema.org structured data, internal backlinks strategy, further reading sections, meta tags, and Open Graph. Use when creating or editing any public-facing web content, blog posts, or pages that need search visibility.
Vercel deployment and configuration for Adynato projects. Covers environment variables, vercel.json, project linking, common errors like VERCEL_ORG_ID/VERCEL_PROJECT_ID, and CI/CD setup. Use when deploying to Vercel, configuring builds, or troubleshooting deployment issues.
Mobile app development conventions for Adynato projects using React Native and Expo. Covers navigation patterns, native APIs, performance optimization, and platform-specific considerations. Use when building or modifying mobile applications.
