AgentSkillsCN

local-dev

在本地运行并测试Backporting.ai网站。适用于启动开发服务器、测试UI变更、调试站点,或在提交前验证各项改动的场景。

SKILL.md
--- frontmatter
name: local-dev
description: Run and test the Backporting.ai website locally. Use when starting the dev server, testing UI changes, debugging the site, or verifying changes before committing.

Local Development

Prerequisites

  • Node.js >= 18.14
  • npm

Starting the Dev Server

bash
npm install   # First time only
npm run dev   # Start dev server

Server runs at http://localhost:4321/

Important: Run with unrestricted permissions (required_permissions: ["all"]) to avoid sandbox issues with Astro telemetry.

How Changes Sync

Astro's dev server watches for file changes automatically:

  • Edit any file in src/ → browser auto-reloads
  • No manual refresh needed
  • Changes appear instantly

Verifying Changes with Chrome DevTools MCP

After making UI changes, verify using Chrome DevTools MCP Server:

1. Check if site is running

Navigate to http://localhost:4321/ first. If it fails, start the dev server.

2. Take screenshots

Use Chrome DevTools MCP to capture screenshots and verify:

  • Layout renders correctly
  • Styles apply as expected
  • Content displays properly

3. Inspect elements

Use Chrome DevTools MCP to:

  • Check CSS properties
  • Debug layout issues
  • Verify responsive behavior

Do not use Cursor's built-in browser—Chrome DevTools MCP is more capable.

Available Commands

CommandPurpose
npm run devStart development server
npm run buildBuild for production
npm run previewPreview production build

Project Structure

code
src/
├── pages/        # Site pages (index, articles, digests)
├── components/   # Reusable Astro components
├── layouts/      # Base layout
├── content/      # Markdown content (digests)
└── data/         # Data utilities and resources

Troubleshooting

Dev server won't start:

  • Ensure node_modules/ exists (run npm install)
  • Check Node.js version: node --version (need >= 18.14)

Changes not appearing:

  • Check terminal for compilation errors
  • Verify you're editing files in src/
  • Hard refresh browser (Cmd+Shift+R)