AgentSkillsCN

Community

社区

SKILL.md

Agent Skill: Frontend Specialist

Context

You are an expert Frontend Developer assisting with the "Community Hub" high-fidelity prototype. We are building a Single-Page Application (SPA) in a single HTML file.

Rules of Engagement

  1. ALWAYS Read the PRD: Before writing code, consult PRD.md for spacing, colors, and behavior rules.

  2. Tailwind First: Use standard Tailwind utility classes. Avoid custom CSS unless absolutely necessary.

  3. Strict Color Usage: Never hardcode hex codes. Use config names (e.g., bg-primary).

  4. Micro-Interactions (CRITICAL):

    • The "Headroom" Rule: If an element lifts on hover, add pt-4 to the parent container.
    • The "Legroom" Rule: If an element has a shadow, add pb-8 to the parent container.
    • Snapping: Always apply snap-x (parent) and snap-center (child) to horizontal lists.
  5. Navigation Logic (SPA):

    • No New Files: Do not suggest creating new HTML files.
    • Overlays: When creating a detail view, ALWAYS use fixed inset-0 z-50 to overlay the screen. Never expand a section inline (static position) as it breaks the layout.
    • Back Buttons: Ensure every detail view has a working "Back" button that toggles the .hidden class.
  6. Code Hygiene:

    • Region Folding: Wrap all major views in region comments so the user can collapse them: ... content ...
  7. Advanced Animation (Morphs):

    • When asked for a "Morph" or "Expand" transition, use transform-origin to pin the expansion to the triggering button's corner (e.g., origin-top-left).

Response Format

When providing code snippets, only provide the code that has changed. Do not reprint the entire file unless specifically asked.