xiaohongshu
xiaohongshu
architecture-philosophy
Core architectural principles for StepLeague - modular design, system thinking, future-proofing, and maintenance reduction. Use when designing new features, refactoring code, considering implementation approaches, or making any architectural decisions. Keywords: architecture, design, modular, ref...
Full skill instructions
THE MOST IMPORTANT SKILL: This skill defines HOW we build everything. Every other skill references these principles.
Before implementing ANY solution:
Every solution in StepLeague must follow these principles:
Build systems, not one-off solutions.
If you're writing code that solves just ONE specific case, you're probably doing it wrong. Take 5 extra minutes to think: "How can I make this reusable?"
| ❌ One-Off (BAD) | ✅ Modular System (GOOD) |
|---|---|
| Hardcoded notification for leagues | Generic notification system with event types |
| Custom dropdown for one form | Reusable FormSelect component |
| Inline error handling | Centralized AppError system in src/lib/errors.ts |
Magic numbers (if (count > 50)) | Settings from app_settings table |
| Duplicate validation logic | Shared Zod schemas in /lib/schemas/ |
Questions to ask BEFORE writing code:
/lib/ or /components/ui/Design for tomorrow, implement for today.
app_settings table for configurable valuesuseFeatureFlag()// ❌ WRONG: Hardcoded limit
const MAX_PROXIES = 10;
// ✅ CORRECT: Configurable
const maxProxies = useAppSettings('proxy_max_per_user', 10);
Assume things will fail. Plan for it.
error-handling skill// ✅ Defensive pattern with fallback
const branding = await getCachedBranding().catch(() => DEFAULT_BRANDING);
Less code = less bugs = less maintenance.
| Principle | Example |
|---|---|
| Use existing libraries | shadcn/ui over custom components |
| Central configuration | badges.ts for all badge colors |
| Registry patterns | CacheRegistry for cache tags |
| Convention over configuration | File-based routing |
ALWAYS prefer shadcn over custom implementations.
// ✅ Use shadcn
import { Dialog } from "@/components/ui/dialog";
import { DropdownMenu } from "@/components/ui/dropdown-menu";
import { toast } from "@/hooks/use-toast";
// ❌ Don't create custom modals, dropdowns, or alerts
Installed shadcn components:
toast, dialog, dropdown-menu, input, labeltextarea, select, checkbox, tooltipconfirm-dialog (custom wrapper)Reference: src/components/ui/
Reference the form-components skill.
// ✅ Use form fields
import { FormInput, FormSelect, FormCheckbox } from "@/components/ui/form-fields";
// ❌ Don't use raw <input>, <select> elements
Reference the api-handler skill.
// ✅ Use withApiHandler
export const POST = withApiHandler({
auth: 'required',
schema: mySchema,
}, async ({ user, body, adminClient }) => {
return { success: true };
});
// ❌ Don't write boilerplate auth checks in every route
Reference the error-handling skill.
// ✅ Use AppError
throw new AppError({
code: ErrorCode.VALIDATION_FAILED,
message: 'Invalid input',
context: { field: 'email' },
recoverable: true,
});
// ❌ Don't throw generic Error objects
Reference the design-system skill.
// ✅ Semantic variables
<div className="bg-card text-foreground border-border">
// ❌ Hardcoded Tailwind colors
<div className="bg-slate-900 text-slate-300 border-slate-700">
When implementing any feature, follow this checklist:
.agent/skills/| When Working On | Reference Skill |
|---|---|
| New features | prd-creation |
| API routes | api-handler |
| Database queries | supabase-patterns |
| Error handling | error-handling |
| UI/Styling | design-system |
| Forms | form-components |
| After completion | project-updates |
"I'll just add this inline, it's faster"
Why it's bad: Creates tech debt, makes code harder to maintain.
Instead: Take 5 extra minutes to do it properly.
"This component is unique, it needs custom styling"
Why it's bad: Breaks consistency, harder to theme.
Instead: Use existing components, extend if needed.
if (count > 50) { ... }
Why it's bad: Unexplained, not configurable.
Instead: Use settings or named constants.
try { ... } catch { /* ignore */ }
Why it's bad: Hides bugs, makes debugging impossible.
Instead: Use normalizeError() and reportErrorClient().
Creating a new component that's 90% the same as existing one.
Why it's bad: Duplicated code, inconsistent behavior.
Instead: Extract shared logic, use props for variations.
If you do something 3 times, extract it.
| Count | Action |
|---|---|
| 1st time | Implement inline |
| 2nd time | Note the pattern |
| 3rd time | Extract to utility/component/skill |
| Area | File |
|---|---|
| Error handling | src/lib/errors.ts |
| API handler | src/lib/api/handler.ts |
| Form components | src/components/ui/form-fields.tsx |
| Badge config | src/lib/badges.ts |
| Cache registry | src/lib/cache/serverCache.ts |
| Menu config | src/lib/menuConfig.ts |
| Theme variables | src/app/globals.css |
| Settings hook | src/hooks/useAppSettings.ts |
Build systems, not solutions.
Every feature you implement should make the next feature easier to build.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience