# Spec Template

Structural template for generated design specifications. Fill each section based on project context.

---

```markdown
# Agent-Friendly Design Specification: [Project Name]

> Generated by Agentify · [Date]

## Table of Contents
[Auto-generated with anchor links]

---

## 1. Executive Summary (P0)
[2-3 paragraphs: what this covers, why agent-friendliness matters, expected outcome]

## 2. Semantic HTML Guidelines (P0)
### 2.1 Page Structure
[Landmark elements rules + code example]
### 2.2 Heading Hierarchy
[Rules + example]
### 2.3 Semantic Elements
[Table mapping UI patterns → semantic elements]
### 2.4 Anti-patterns

## 3. ARIA & Accessibility Patterns (P0)
### 3.1 Accessible Names
[Rules for buttons, links, inputs, images]
### 3.2 States and Properties
[aria-expanded, aria-selected, etc. per widget type]
### 3.3 Live Regions
[Dynamic content, notifications, errors]
### 3.4 Landmark Roles

## 4. Naming Conventions (P0)
### 4.1 data-testid Scheme
[Naming rules + examples table]
### 4.2 CSS Class Naming
[Convention + stability rules]
### 4.3 Component Naming
### 4.4 ID Naming

## 5. Structured Data (P1)
### 5.1 When to Add
[Which pages need JSON-LD]
### 5.2 Implementation
[Code per framework]
### 5.3 Required Properties
[Table: schema type → properties]
### 5.4 Validation

## 6. Form Design Patterns (P0)
### 6.1 Label Association
### 6.2 Field Grouping
### 6.3 Input Attributes
[Table: field → type, name, autocomplete]
### 6.4 Error Handling
### 6.5 Multi-step Forms

## 7. Navigation Patterns (P1)
### 7.1 Primary Navigation
### 7.2 Breadcrumbs
### 7.3 Skip Links
### 7.4 Footer Navigation
### 7.5 Pagination

## 8. API & Discoverability (P1)
### 8.1 Link Relations
### 8.2 OpenAPI / REST Conventions
### 8.3 HATEOAS Patterns

## 9. Meta Tags & Machine Signals (P1)
### 9.1 Essential Meta
### 9.2 Open Graph
### 9.3 robots.txt & Sitemap
### 9.4 Canonical URLs

## 10. Component Checklists (P2)
### 10.1 Button
### 10.2 Form Input
### 10.3 Navigation Menu
### 10.4 Modal/Dialog
### 10.5 Data Table
### 10.6 Card/List Item
### 10.7 Tabs
### 10.8 Accordion
### 10.9 Search
### 10.10 Notification/Toast

## 11. Testing for Agent-Friendliness (P2)
### 11.1 Manual Verification
### 11.2 Automated Checks
### 11.3 CI Integration

## 12. Migration Guide (P2)
### 12.1 Quick Wins (<5 min/file)
### 12.2 Medium Effort (component refactoring)
### 12.3 Large Effort (architectural)
### 12.4 Prioritization Strategy
```

Each section must include:
- **Why**: How this helps AI agents
- **Rules**: Clear, unambiguous guidelines
- **Examples**: Code for detected framework
- **Anti-patterns**: What to avoid
- **Verification**: How to check compliance
