# Autocoder app_spec.txt XML Format Complete reference for the XML structure expected by Autocoder's Initializer agent. ## Root Structure ```xml ... ... ... ... ... ... ... ... ... ... ... ... ``` ## Section Details ### project_name ```xml my-awesome-app ``` Simple string, typically from package.json name field. ### overview ```xml A brief 2-3 sentence description of what the project does, what problem it solves, and who it's for. ``` ### technology_stack ```xml React with Vite Tailwind CSS React hooks and context React Router 3000 Node.js with Express SQLite with better-sqlite3 3001 RESTful endpoints ``` ### prerequisites ```xml - Node.js 18+ installed - npm or pnpm package manager - Required API keys: OPENAI_API_KEY, etc. ``` ### core_features (CRITICAL) This is where features are defined. Each feature becomes a test case in features.db. ```xml - User can register with email/password - User can login and receive session token - User can logout and invalidate session - User can reset password via email link - System redirects unauthenticated users to login - User can view summary statistics on dashboard - Dashboard displays recent activity list - User can click items to navigate to detail view - Dashboard updates in real-time when data changes - User can create new items via form - User can view list of items with pagination - User can edit existing items - User can delete items with confirmation dialog - User can search items by keyword - User can filter items by category - User can sort items by date/name/status - API returns 401 for unauthenticated requests - API returns 403 for unauthorized actions - API validates input and returns 400 for invalid data - API returns paginated results for list endpoints - UI is responsive on mobile (375px width) - UI is responsive on tablet (768px width) - UI displays loading states during async operations - UI shows toast notifications for actions - UI handles errors gracefully with user feedback ``` **Feature Writing Rules:** 1. Start with action verb: "User can...", "System displays...", "API returns..." 2. Be specific and testable 3. One behavior per feature 4. Group by functional area ### database_schema ```xml - id (PRIMARY KEY) - email (UNIQUE, NOT NULL) - password_hash (NOT NULL) - name - created_at, updated_at - id (PRIMARY KEY) - user_id (FOREIGN KEY -> users.id) - title (NOT NULL) - description - status (enum: draft, active, archived) - created_at, updated_at ``` ### api_endpoints_summary ```xml - POST /api/auth/register - POST /api/auth/login - POST /api/auth/logout - GET /api/auth/me - GET /api/items (list with pagination) - POST /api/items (create) - GET /api/items/:id (get single) - PUT /api/items/:id (update) - DELETE /api/items/:id (delete) ``` ### ui_layout ```xml - Header with navigation and user menu - Sidebar for navigation (collapsible on mobile) - Main content area - Footer (optional) - Logo at top - Navigation links - User profile at bottom ``` ### design_system ```xml - Primary: #3B82F6 (blue) - Background: #FFFFFF (light), #1A1A1A (dark) - Text: #1F2937 (light), #E5E5E5 (dark) - Error: #EF4444 - Success: #10B981 - Font family: Inter, system-ui, sans-serif - Headings: font-semibold - Body: font-normal ``` ### key_interactions ```xml 1. User navigates to /login 2. User enters email and password 3. System validates credentials 4. On success: redirect to dashboard 5. On failure: show error message 1. User clicks "Create New" button 2. Modal form opens 3. User fills required fields 4. User clicks save 5. Item appears in list with success toast ``` ### implementation_steps ```xml Project Setup - Initialize frontend with Vite - Set up Express backend - Create database schema - Configure environment variables Authentication - Implement registration - Implement login/logout - Add session management - Create protected routes ``` ### success_criteria ```xml - All features work as specified - No console errors in browser - Data persists correctly in database - Responsive on all device sizes - Fast load times (< 2s) - Clear feedback for all actions - Clean code structure - Proper error handling - Secure authentication ``` ## Feature Count Guidelines The Initializer agent expects features distributed across categories: | Project Complexity | Total Features | Categories | |--------------------|----------------|------------| | Simple CLI/utility | 100-150 | 5-8 | | Medium web app | 200-250 | 10-15 | | Complex full-stack | 300-400 | 15-20 | ## GSD to Autocoder Mapping When converting from GSD codebase mapping: | GSD Document | Maps To | |--------------|---------| | STACK.md Languages | `` | | STACK.md Runtime | `` | | STACK.md Frameworks | ``, `` | | ARCHITECTURE.md Pattern | `` | | ARCHITECTURE.md Layers | `` categories | | ARCHITECTURE.md Data Flow | `` | | ARCHITECTURE.md Entry Points | `` | | STRUCTURE.md Layout | Informs feature organization | | INTEGRATIONS.md APIs | `` | | INTEGRATIONS.md Services | `` |