This document provides development guidelines and rules for AI Agents to ensure code quality and smooth CI/CD pipeline execution.
- Project Name: RustFS.com - Official Website
- Framework: Next.js 15.3.4 (App Router, Static Export)
- Language: TypeScript (ES2017+, Strict Mode)
- Package Manager: pnpm (recommended) or npm
- Styling: Tailwind CSS 4 + shadcn/ui
- CI/CD: GitHub Actions → Aliyun OSS
Before every code commit, ensure ALL of the following checks pass:
-
✅ TypeScript Type Checking
# Ensure no TypeScript errors npx tsc --noEmit -
✅ ESLint Code Checking
pnpm run lint # or npm run lint -
✅ Local Build Test
# Clean previous builds rm -rf .next out # Execute build pnpm run build # or npm run build # Ensure build succeeds without errors
-
✅ Dependency Lock File Synchronization
-
If using
npm installto update dependencies, must synchronizepnpm-lock.yaml:pnpm install
-
If using
pnpm installto update dependencies, ensurepnpm-lock.yamlis updated -
Important: CI uses pnpm. If dependencies are updated locally with npm but
pnpm-lock.yamlis not updated, CI will fail
-
-
✅ Build Artifact Verification
- Ensure
out/directory is generated - Ensure
out/sitemap.xmlis generated (automatically by postbuild script) - Check build artifacts are complete
- Ensure
According to .github/workflows/deploy.yml, the CI process includes:
-
Checkout: Check out code
-
Install dependencies:
npm install -g pnpm && pnpm install -
Install dependencies and build:
pnpm install --no-frozen-lockfile pnpm run build
-
Deploy: Deploy to Aliyun OSS
Before committing, it's recommended to simulate the complete CI process locally:
# 1. Clean environment
rm -rf node_modules .next out
# 2. Install dependencies (using pnpm, consistent with CI)
npm install -g pnpm
pnpm install
# 3. Build project
pnpm run build
# 4. Verify build artifacts
ls -la out/
ls -la out/sitemap.xml
# 5. Run lint
pnpm run lint- ✅ Use TypeScript strict mode
- ✅ Follow ESLint configuration rules
- ✅ Use functional components and Hooks
- ✅ Use Tailwind CSS for styling
- ✅ Client components must be marked with
'use client'
- ✅ Use
cn()function to merge class names - ✅ Support dark mode and responsive design
- ✅ Follow shadcn/ui component standards
- ✅ Maintain single responsibility principle
🚨 Absolute Rule: Do NOT modify styles or structure unless explicitly specified!
- ❌ Forbidden to modify existing CSS classes, layout structure, or component design
- ❌ Forbidden to simplify complex components or remove visual elements
- ❌ Forbidden to replace custom components with basic UI components
- ❌ Forbidden to modify animations, transitions, or interactive behaviors
- ❌ Forbidden to change responsive design or dark mode implementations
- ✅ Use Conventional Commits specification
- ✅ Commit messages must be in English
- ✅ Format:
<type>[optional scope]: <description> - ✅ Types:
feat,fix,docs,style,refactor,perf,test,chore
Examples:
feat: add contact form with hCaptcha
fix: update pnpm-lock.yaml after npm dependency changes
docs: update README with new featuresSymptoms: Install dependencies step fails
Causes:
- Dependencies updated locally with npm but
pnpm-lock.yamlnot updated pnpm-lock.yamlout of sync withpackage.json
Solution:
# Reinstall dependencies with pnpm to update lock file
pnpm install
# Commit updated pnpm-lock.yaml
git add pnpm-lock.yaml
git commit -m "fix: update pnpm-lock.yaml"Symptoms: TypeScript type errors during build
Solution:
# Check TypeScript errors locally
npx tsc --noEmit
# Fix all type errors before committingSymptoms: Lint check fails
Solution:
# Run lint check locally
pnpm run lint
# Fix all lint errors before committingSymptoms: Build passes but deployment step fails
Checklist:
- Ensure
out/directory exists - Ensure
out/sitemap.xmlis generated - Check build artifacts are complete
- Project README
- Next.js Documentation
- TypeScript Documentation
- Tailwind CSS Documentation
- ESLint Documentation
Before every code commit, confirm:
- TypeScript type check passes (
npx tsc --noEmit) - ESLint check passes (
pnpm run lint) - Local build succeeds (
pnpm run build) -
pnpm-lock.yamlis updated (if dependencies were modified) - Build artifacts
out/directory exists and is complete -
out/sitemap.xmlis generated - Commit message follows Conventional Commits specification
- Commit message is in English
Remember: If local build fails, CI will also fail. Do NOT commit code that cannot pass local build!
Last Updated: 2026-01-06