Technical Specifications for Development | Writing Specs
Write technical specs that prevent rework: API design, edge cases, and testing strategy. GitScrum links specs to implementation tasks for traceability.
9 min read
Good specifications prevent rework. GitScrum helps teams create and track technical specs that guide implementation effectively.
When to Write Specs
Spec Decision Tree
DO YOU NEED A TECHNICAL SPEC?
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Is this work significant? β
β (> 1 week of work, multiple components, risky) β
β β
β YES NO β
β β β β
β Is cross-team coordination Is it well-understood? β
β needed? β
β YES β Task description β
β YES β FULL SPEC NO β Mini-spec or RFC β
β NO β Is it architecturally β
β significant? β
β β
β YES β DESIGN DOC / ADR β
β NO β MINI-SPEC β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β FULL SPEC: New features, system redesigns, integrations β
β MINI-SPEC: Smaller changes needing clarity β
β ADR: Architecture decisions β
β TASK DESC: Well-understood, small work β
β β
β WHEN IN DOUBT: β
β If you'd need to explain it to someone for > 5 minutes, β
β write it down. β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Spec Structure
Technical Spec Template
TECHNICAL SPECIFICATION TEMPLATE:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SPEC: User Export Feature β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Author: @alex β
β Status: Draft β Review β Approved β
β Date: 2024-01-15 β
β Related Task: PROJ-123 β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β 1. OVERVIEW β
β βββββββββββ β
β Brief summary of what this feature does and why. β
β β
β 2. BACKGROUND β
β ββββββββββββ β
β Context: Why are we building this? β
β Current state: How does it work today? β
β Requirements source: Link to product requirements β
β β
β 3. GOALS & NON-GOALS β
β βββββββββββββββββββ β
β Goals: β
β β’ What we're solving β
β β
β Non-goals: β
β β’ What we're explicitly NOT solving β
β β’ Future considerations β
β β
β 4. PROPOSED SOLUTION β
β ββββββββββββββββββββ β
β High-level approach and architecture β
β β
β 5. DETAILED DESIGN β
β βββββββββββββββββ β
β API changes, data models, component interactions β
β β
β 6. EDGE CASES β
β βββββββββββββ β
β What happens when...? β
β β
β 7. TESTING STRATEGY β
β ββββββββββββββββββ β
β How will this be tested? β
β β
β 8. ROLLOUT PLAN β
β ββββββββββββββ β
β How will this be deployed and monitored? β
β β
β 9. OPEN QUESTIONS β
β ββββββββββββββββ β
β Decisions still needed β
β β
β 10. APPENDIX β
β βββββββββββ β
β Diagrams, API examples, references β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Detailed Design Section
DETAILED DESIGN EXAMPLE:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 5. DETAILED DESIGN β
β β
β 5.1 API DESIGN β
β β
β New endpoint: β
β POST /api/v1/exports β
β β
β Request: β
β { β
β "type": "users", β
β "format": "csv", β
β "filters": { β
β "created_after": "2024-01-01" β
β } β
β } β
β β
β Response (202 Accepted): β
β { β
β "export_id": "exp_abc123", β
β "status": "processing", β
β "estimated_time": 30 β
β } β
β β
β 5.2 DATA MODEL β
β β
β New table: exports β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β id | UUID | Primary key ββ
β β user_id | UUID | FK to users ββ
β β type | VARCHAR(50) | Export type ββ
β β format | VARCHAR(10) | csv, xlsx ββ
β β status | VARCHAR(20) | pending, processing, doneββ
β β file_url | TEXT | S3 URL when complete ββ
β β expires_at | TIMESTAMP | Auto-delete after 7 days ββ
β β created_at | TIMESTAMP | ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β 5.3 COMPONENT FLOW β
β β
β User request β
β β β
β API validates and queues job β
β β β
β Background worker processes export β
β β β
β Upload to S3, update status β
β β β
β Email user with download link β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Edge Cases
Documenting What-Ifs
EDGE CASE DOCUMENTATION:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 6. EDGE CASES β
β β
β LARGE DATASETS β
β βββββββββββββ β
β Scenario: User has 100K+ records to export β
β Handling: Streaming export, chunked processing β
β Limit: Max 500K records per export β
β If exceeded: Return error, suggest filtering β
β β
β CONCURRENT EXPORTS β
β ββββββββββββββββββ β
β Scenario: User requests multiple exports simultaneously β
β Handling: Queue all, process in order β
β Limit: Max 5 pending exports per user β
β If exceeded: Return 429 Too Many Requests β
β β
β EXPORT IN PROGRESS β
β ββββββββββββββββββ β
β Scenario: User logs out while export is processing β
β Handling: Export continues, email sent when done β
β β
β DATA CHANGES DURING EXPORT β
β βββββββββββββββββββββββββββ β
β Scenario: Data changes while export is processing β
β Handling: Snapshot at start of export (eventual consistency)β
β Note: Document that export represents point-in-time β
β β
β EMPTY RESULTS β
β βββββββββββββ β
β Scenario: Filter returns zero records β
β Handling: Return empty file with headers β
β UI: Show "No records match your criteria" β
β β
β SPECIAL CHARACTERS β
β ββββββββββββββββββ β
β Scenario: Data contains commas, quotes, newlines β
β Handling: Proper CSV escaping per RFC 4180 β
β Test: Include test cases for special characters β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Review Process
Spec Review Workflow
SPEC REVIEW PROCESS:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β LIFECYCLE: β
β β
β [Draft] β [Review] β [Approved] β [Implemented] β
β β
β DRAFT: β
β Author writes initial spec β
β Share early, get feedback on direction β
β β
β REVIEW: β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Reviewers: ββ
β β β’ Tech lead (architecture) ββ
β β β’ Security (if relevant) ββ
β β β’ PM (requirements alignment) ββ
β β β’ Anyone who'll implement ββ
β β ββ
β β Review checklist: ββ
β β β Solves the right problem? ββ
β β β Approach makes sense? ββ
β β β Edge cases covered? ββ
β β β Security considered? ββ
β β β Scalability addressed? ββ
β β β Testing strategy adequate? ββ
β β β Rollout plan reasonable? ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β APPROVED: β
β Major concerns addressed β
β Minor issues can be fixed during implementation β
β Approval recorded in spec document β
β β
β IMPLEMENTED: β
β Spec becomes documentation β
β Update if implementation differs significantly β
β β
β GITSCRUM: β
β Link spec to implementation tasks β
β Subtask: "Write technical spec" (done before coding) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Linking to GitScrum
Specs and Tasks
SPEC β TASK RELATIONSHIP:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β EPIC: User Export Feature (PROJ-120) β
β βββ PROJ-121: Write technical specification β
β β βββ Link: docs/specs/user-export.md β
β β β
β βββ PROJ-122: Implement export API β
β β βββ See spec section 5.1 for API design β
β β β
β βββ PROJ-123: Background worker for export β
β β βββ See spec section 5.3 for component flow β
β β β
β βββ PROJ-124: Email notification on complete β
β β βββ See spec section 5.3 β
β β β
β βββ PROJ-125: Test edge cases β
β βββ See spec section 6 for test cases β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β TASK DESCRIPTION PATTERN: β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β PROJ-122: Implement export API ββ
β β ββ
β β Spec: [link to spec section 5.1] ββ
β β ββ
β β Implementation notes: ββ
β β β’ POST /api/v1/exports endpoint ββ
β β β’ Validate request, queue background job ββ
β β β’ Return 202 with export_id ββ
β β ββ
β β See spec for detailed API contract and error handling ββ
β β ββ
β β Acceptance: ββ
β β β API matches spec ββ
β β β Error cases handled ββ
β β β Tests written ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Living Documents
Keeping Specs Updated
SPEC MAINTENANCE:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β DURING IMPLEMENTATION: β
β β
β If implementation differs from spec: β
β β’ Minor differences: Note in PR, update spec after merge β
β β’ Major differences: Pause, discuss, update spec first β
β β
β Update spec when: β
β β’ Design changed during implementation β
β β’ Edge cases discovered β
β β’ API contract modified β
β β’ New constraints found β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β AFTER IMPLEMENTATION: β
β β
β Spec becomes documentation: β
β β’ Mark status as "Implemented" β
β β’ Note any deviations from original β
β β’ Link to actual code/docs β
β β’ Keep for historical context β
β β
β SPEC HEADER UPDATE: β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β Status: Implemented ββ
β β Implemented: 2024-02-01 ββ
β β Implementation PRs: #456, #467, #478 ββ
β β Notes: Removed XLSX support (deferred to v2) ββ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β Specs are valuable historical record of decisions β
β Don't delete - they explain why things are the way they areβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ