Estimation Expertise
When to Use This Skill
Load this skill when you need to:
- Estimate effort for a Linear issue, feature, or mini-PRD
- Decompose work into functional areas and role-based effort
- Convert hour estimates to Linear story points
- Write a structured estimate into a Linear issue comment
- Review or refine existing estimates
Common triggers:
- During Refinement phase when refining effort estimates
- When creating or updating Linear features with story points
- When a PM or SE asks "how long will this take?"
Quick Reference
Constants
| Parameter |
Value |
| Productive hours per day |
6 |
| Hours per story point |
3 |
| Story point scale (fibonacci) |
0, 1, 2, 3, 5, 8, 13, 21, 34 |
| Maximum story points |
34 |
Points-to-Hours Mapping
| Points |
Hours |
Days |
Guideline |
| 0 |
0 |
0 |
Trivial — config change, typo fix |
| 1 |
3 |
0.5 |
Small — single-file change, simple bug fix |
| 2 |
6 |
1 |
Moderate — a few files, straightforward logic |
| 3 |
9 |
1.5 |
Medium — multiple files, some complexity |
| 5 |
15 |
2.5 |
Large — cross-cutting change, new component |
| 8 |
24 |
4 |
Very large — significant feature, ~1 week |
| 13 |
39 |
6.5 |
Epic-sized — multi-component, ~1.5 weeks |
| 21 |
63 |
10.5 |
Very epic — major system change, ~2 weeks |
| 34 |
102 |
17 |
Maximum — consider decomposing further |
Functional Areas
| Area |
Abbreviation |
Typical Work |
| Frontend |
FE |
UI components, pages, styling, client-side logic |
| Backend |
BE |
API endpoints, business logic, data models, Lambda |
| Infrastructure |
INFRA |
AWS setup, CI/CD, environments, DNS, secrets |
| Testing |
TEST |
Unit, integration, E2E tests, test infrastructure |
| Design |
UX |
Storybook stories, component specs, design tokens |
| Documentation |
DOCS |
Feature docs, API docs, README updates |
Roles
| Role |
Abbreviation |
Primary Areas |
| Software Engineer |
SE |
FE, BE, INFRA, TEST |
| UX Designer |
UX |
UX, FE (component specs) |
| QA Engineer |
QA |
TEST (E2E, acceptance) |
| Product Manager |
PM |
DOCS (PRDs, requirements) |
Parent and Sub-issue Estimation
The Model
When a parent issue has specification sub-issues ([Behaviour], [UX]):
Parent estimate = total effort (specs + implementation)
Sub-issue estimates = breakdown of the parent total (not additions)
Example
Issue: Login Flow (8 pts total)
├── [Behaviour] Login scenarios (2 pts) — part of the 8
├── [UX] Login Storybook (2 pts) — part of the 8
└── Implementation (4 pts) — implicit remainder, not a sub-issue
Velocity Calculation
When calculating velocity:
- Count the parent issue points (8 pts)
- Do NOT add sub-issue points on top (that would double-count to 12 pts)
Sub-issues exist for assignment and scheduling, not for inflating totals.
Estimation Timing
Discovery Estimate (on parent):
- Created during Discovery phase
- Rough total for the whole capability (specs + implementation)
- Confidence: Low/Medium
- No sub-issues exist yet
Refined Estimate (during Refinement):
- Sub-issues created with individual estimates
- Parent estimate updated if scope changed during refinement
- Verify: parent estimate ≥ sum of sub-issue estimates
- Confidence: Medium/High
Zero-Point Issues and Batching
The Problem
The 1-point minimum (3 hours) includes overhead for code + test + docs. For trivial changes (typo fix, config tweak), this overhead is disproportionate and inflates velocity.
The Solution
For genuinely trivial changes:
- Assign 0 points if it needs tracking
- Or batch into a "Housekeeping" parent issue
For batches of trivial changes:
- Create a "Housekeeping" or "Polish" parent issue
- Add trivial items as sub-issues (titles only, no individual estimates)
- Estimate the parent collectively (e.g., 2-3 points for 10-15 items)
Example
Issue: Housekeeping — Week of Feb 10 (3 pts)
├── Sub-issue: Fix typo in login button
├── Sub-issue: Update copyright year in footer
├── Sub-issue: Remove unused import in auth.ts
├── Sub-issue: Add missing alt text to logo
└── ... (10-15 trivial items)
Decision Guide
| Situation |
Approach |
| Single trivial change, needs tracking |
0-point standalone issue |
| Single trivial change, no tracking needed |
Just do it, no issue |
| Multiple trivial changes accumulating |
Batch into Housekeeping parent |
| Small but non-trivial change |
Normal 1-3 point issue |
Avoid
- Estimating each trivial change at 1 point (inflates velocity)
- Creating issues for changes that don't need tracking
- Letting trivial changes accumulate without batching them
Two-Tier Estimation
Estimation happens in two phases with increasing precision:
Discovery Estimate (Feature-Level)
- When: During Discovery phase, when creating Linear features
- Granularity: Feature-level only (sub-issues don't exist yet)
- Confidence: Typically Low or Medium
- Purpose: Rough order-of-magnitude for planning and prioritisation
- Tag:
[Discovery Estimate] in Linear comment
Refined Estimate (Atomic with Roll-Up)
- When: During Refinement phase, after Behaviour scenarios and mini-PRD are written
- Granularity: Per sub-issue, with hours and points rolling up to the parent feature
- Confidence: Typically Medium or High
- Purpose: Detailed breakdown for sprint planning and delivery
- Tag:
[Refined Estimate] in Linear comment
Roll-up rule: Both hours AND points roll up from sub-issues to the parent feature. Do not rely solely on Linear's points roll-up — explicitly track total hours in the parent feature's estimate comment and mini-PRD.
Small feature exception: Features estimated at 3 points or fewer can stay as a single issue without sub-issue decomposition.
Sub-issue size policy: Other than [Behaviour] and [UX] sub-issues (which are exempt), sub-issues should only be created when the parent exceeds 2 days (12 hours) of human effort, and each sub-issue must itself represent at least 2 days (12 hours) of work. The work must also be genuinely independent (different person, different phase, or independently deliverable). Prefer checklists in the parent description over small sub-issues.
Rules
- Always decompose before estimating. Never assign a single number without breaking work into functional areas first.
- Estimate in hours, convert to points. Hours are the base unit. Convert to the nearest fibonacci point value using the mapping table.
- Round up to the next fibonacci value. If total hours fall between two values, always round up (e.g., 20 hours rounds to 8 points, not 5).
- Issues over 34 points must be decomposed. If an estimate exceeds 34 points, split the work into smaller issues.
- Include all functional areas. Don't forget testing, documentation, and infrastructure — they are often 30-50% of total effort.
- Estimate for a single competent human. Assume one person working at normal pace, not a team in parallel.
- State confidence level. Every estimate must include a confidence indicator based on requirement clarity.
- Use the structured output format. All estimates posted to Linear must use the standard format below.
- Roll up both hours and points. When estimating sub-issues, always sum total hours in the parent feature — do not rely solely on Linear's points roll-up.
- Tag estimates by phase. Use
[Discovery Estimate] or [Refined Estimate] to differentiate in Linear comments.
Workflow: Estimate a Task
When: You need to estimate a Linear issue or feature.
Procedure:
Read the requirements. Read the issue description, comments, mini-PRD, and any BDD scenarios. If requirements are vague, flag this in the confidence level.
Identify functional areas. List which areas are involved (FE, BE, INFRA, TEST, UX, DOCS). Not every task touches all areas.
Estimate hours per area. For each functional area, estimate the hours a single competent person would need:
- What specific work is required?
- What's the complexity? (new code vs. modification, known vs. unknown patterns)
- Are there dependencies or integration points?
Assign roles. Map each functional area to the role that would do the work. Some areas may involve multiple roles.
Sum total hours. Add up all area estimates.
Convert to points. Find the nearest fibonacci value at or above the total hours using the mapping table.
Assess confidence. Rate confidence based on requirement clarity:
- High — Clear requirements, BDD scenarios exist, known patterns
- Medium — Refinement understood but some ambiguity, partially specified
- Low — Vague requirements, unknown technical approach, significant unknowns
Write the estimate. Use the structured output format and post to the Linear issue.
Workflow: Update Linear with Estimate
When: You have completed an estimate and need to record it.
Procedure:
Set the story points on the issue:
curl -s -X POST https://api.linear.app/graphql \
-H "Content-Type: application/json" \
-H "Authorization: $LINEAR_API_KEY" \
-d '{
"query": "mutation { issueUpdate(id: \"ISSUE-ID\", input: { estimate: POINTS }) { success } }"
}'
Or via linearis if the CLI supports it in future versions.
Post the detailed breakdown as a comment:
linearis issues comment ISSUE-ID "ESTIMATE_MARKDOWN"
Structured Output Format
Use this format when posting estimates to Linear issue comments:
## [Discovery Estimate] or [Refined Estimate]
**Total: X points (Y hours / Z days)**
**Confidence: High | Medium | Low**
### Breakdown
| Area | Work | Hours | Role |
|------|------|-------|------|
| FE | [description] | X | SE |
| BE | [description] | X | SE |
| TEST | [description] | X | SE/QA |
| DOCS | [description] | X | PM/SE |
| **Total** | | **X** | |
### Assumptions
- [Key assumption 1]
- [Key assumption 2]
### Risks
- [Risk that could increase estimate]
Example: Discovery Estimate (Feature-Level)
## [Discovery Estimate]
**Total: 8 points (24 hours / 4 days)**
**Confidence: Medium**
### Breakdown
| Area | Work | Hours | Role |
|------|------|-------|------|
| BE | Auth API endpoints, JWT middleware, user model | 8 | SE |
| FE | Login page, auth context, protected routes | 6 | SE |
| INFRA | Cognito setup, env vars, CORS | 2 | SE |
| TEST | Unit + E2E tests | 5 | SE/QA |
| DOCS | Auth flow docs, API docs | 2 | SE |
| UX | Login form Storybook story | 1 | UX |
| **Total** | | **24** | |
### Assumptions
- Using AWS Cognito (not custom auth)
- Email/password auth only (no social login)
### Risks
- Cognito config complexity could add 4-8 hours
Example: Refined Estimate (Atomic with Roll-Up)
## [Refined Estimate]
**Feature Total: 10 points (30 hours / 5 days)**
**Confidence: High**
### Sub-Issue Breakdown
| Sub-Issue | Area | Hours | Points |
|-----------|------|-------|--------|
| AF-50a: Backend API + data model | BE | 9 | 3 |
| AF-50b: Frontend UI components | FE, UX | 9 | 3 |
| AF-50c: E2E tests + integration | TEST | 6 | 2 |
| AF-50d: Documentation + infra | DOCS, INFRA | 6 | 2 |
| **Total** | | **30** | **10** |
### Change from Discovery
- Discovery estimate: 8 points (24 hours)
- Refined estimate: 10 points (30 hours)
- Reason: BDD scenarios revealed additional error handling and edge cases
### Assumptions
- Using AWS Cognito (not custom auth)
- Email/password auth only (no social login)
- SSO not required
### Risks
- Cognito configuration complexity could add 4-8 hours
Estimation Heuristics
Use these rules of thumb when detailed decomposition isn't practical:
By Change Type
| Change Type |
Typical Points |
Notes |
| Config/typo fix |
0 |
No testing impact |
| Single bug fix |
1-2 |
Depends on diagnosis time |
| Simple UI change |
1-2 |
Styling, copy, layout tweaks |
| New API endpoint |
2-3 |
CRUD with tests |
| New UI component |
2-3 |
With Storybook + tests |
| New page/feature |
5-8 |
FE + BE + tests + docs |
| Cross-cutting refactor |
5-13 |
Depends on blast radius |
| New integration |
8-13 |
External API, error handling, tests |
| New system/service |
13-34 |
Consider decomposing |
Testing Multiplier
Testing typically adds 30-50% to implementation time:
| Implementation Hours |
Add for Testing |
| 1-3 |
+1-2 hours |
| 4-8 |
+2-4 hours |
| 9-15 |
+4-8 hours |
| 16+ |
+8-12 hours |
Documentation Overhead
| Scope |
Documentation Hours |
| Bug fix |
0-1 |
| Small feature |
1-2 |
| Major feature |
2-4 |
| New system |
4-8 |
Common Pitfalls
- Forgetting testing effort. Testing is 30-50% of total work. Always include TEST in your breakdown.
- Ignoring infrastructure. New features often need env vars, CI changes, or AWS resources.
- Underestimating integration. Connecting to external APIs or services takes longer than expected.
- Not accounting for review cycles. Code review and feedback rounds add time. Include 1-2 hours for non-trivial PRs.
- Estimating for the best case. Estimate for normal pace, not "if everything goes perfectly."
- Skipping documentation. Docs are part of "done." Include them in every estimate.
- Over-precision in large estimates. A 34-point issue doesn't need hour-level precision — focus on getting the right order of magnitude and flag that it should be decomposed.
- Estimating Epic parents that have estimated children. When an issue is labelled "Epic" and has sub-issues that carry estimates, the parent should have estimate = 0. Carrying estimates on both parent and children causes double-counting in project totals. Always check: does this issue have estimated children? If so, zero the parent estimate.
- Missing delivery by-products. Issues created during delivery as follow-on work ("what's left to do" breakdowns) bypass the estimation workflow. These need an estimation sweep — either via a recurring task (like AGV-85) or as part of cycle planning.
- Not checking for overlapping scope. Before estimating, check if the issue's scope overlaps with existing issues. If two issues cover the same work, one should be marked as a duplicate or made a sub-issue of the other. Estimating both inflates the project total.
Integration Points
Discovery phase (af-discover-scope):
- Feature-level estimates when creating Linear features in Phase 4
- Tag as
[Discovery Estimate] in Linear comment
- Set story points on the feature issue directly
- Confidence is typically Low or Medium
Refinement phase (af-refine-specifications):
- Refined estimates after Behaviour scenarios and mini-PRD are complete
- Tag as
[Refined Estimate] in Linear comment
- For features > 3 points: create specification sub-issues ([Behaviour], [UX]) with individual estimates
- Sub-issue estimates are a breakdown of the parent total (not additions)
- Hours AND points roll up to the parent feature
- Document final estimate in mini-PRD Section 7 (Effort Estimation)
- Story points must be set before moving to "Approved"
Mini-PRD (templates/mini-prd-template.md):
- Section 7 captures the refined estimate with full breakdown
- Becomes the permanent record of how the estimate was calculated
Work management (af-manage-work-state):
- Story points drive sprint planning and velocity tracking
- Use
issueUpdate mutation to set estimate field on Linear issues
Linear API (af-query-linear-api):
- Set estimates via GraphQL:
issueUpdate(id: "...", input: { estimate: N })
- Query estimates:
issue(id: "...") { estimate }
Database (agents.db tasks table):
- After producing an estimate, persist it to the
tasks table
- Discovery estimates: update
discovery_points, discovery_hours, discovery_confidence, discovery_breakdown
- Refined estimates: update
refined_points, refined_hours, refined_confidence, refined_breakdown
- Use this command after each estimate:
sqlite3 /var/lib/claude-agents/agents.db "
INSERT INTO tasks (issue_id, issue_title, project, team_key, created_at, updated_at)
VALUES ('<ISSUE_ID>', '<TITLE>', '<PROJECT>', '<TEAM_KEY>', datetime('now'), datetime('now'))
ON CONFLICT(issue_id) DO UPDATE SET updated_at = datetime('now');
UPDATE tasks SET
discovery_points = <POINTS>,
discovery_hours = <HOURS>,
discovery_confidence = '<CONFIDENCE>',
discovery_breakdown = '<JSON_BREAKDOWN>',
discovery_estimated_at = datetime('now'),
updated_at = datetime('now')
WHERE issue_id = '<ISSUE_ID>';
"
For refined estimates, replace discovery_* columns with refined_*.
Remember:
- Decompose first, estimate second — never guess a single number
- Hours are the base unit, points are for Linear
- 1 point = 3 hours = half a productive day
- Always include testing, docs, and infrastructure
- Round up to the next fibonacci value, never down
- Roll up BOTH hours and points from sub-issues to parent feature
- Tag estimates:
[Discovery Estimate] or [Refined Estimate]
- Persist estimates to the
tasks table in agents.db after setting on Linear
1---2name: af-estimate-effort3description: Estimate effort for tasks or features in hours with role-based decomposition. Use when assessing complexity, breaking down effort by functional area, or converting estimates to Linear story points.4---5
6# Estimation Expertise
7
8## When to Use This Skill
9
10Load this skill when you need to:
11- Estimate effort for a Linear issue, feature, or mini-PRD
12- Decompose work into functional areas and role-based effort
13- Convert hour estimates to Linear story points
14- Write a structured estimate into a Linear issue comment
15- Review or refine existing estimates
16
17**Common triggers:**
18- During Refinement phase when refining effort estimates
19- When creating or updating Linear features with story points
20- When a PM or SE asks "how long will this take?"
21
22## Quick Reference
23
24### Constants
25
26| Parameter | Value |
27|-----------|-------|
28| Productive hours per day | 6 |
29| Hours per story point | 3 |
30| Story point scale (fibonacci) | 0, 1, 2, 3, 5, 8, 13, 21, 34 |
31| Maximum story points | 34 |
32
33### Points-to-Hours Mapping
34
35| Points | Hours | Days | Guideline |
36|--------|-------|------|-----------|
37| 0 | 0 | 0 | Trivial — config change, typo fix |
38| 1 | 3 | 0.5 | Small — single-file change, simple bug fix |
39| 2 | 6 | 1 | Moderate — a few files, straightforward logic |
40| 3 | 9 | 1.5 | Medium — multiple files, some complexity |
41| 5 | 15 | 2.5 | Large — cross-cutting change, new component |
42| 8 | 24 | 4 | Very large — significant feature, ~1 week |
43| 13 | 39 | 6.5 | Epic-sized — multi-component, ~1.5 weeks |
44| 21 | 63 | 10.5 | Very epic — major system change, ~2 weeks |
45| 34 | 102 | 17 | Maximum — consider decomposing further |
46
47### Functional Areas
48
49| Area | Abbreviation | Typical Work |
50|------|-------------|--------------|
51| Frontend | FE | UI components, pages, styling, client-side logic |
52| Backend | BE | API endpoints, business logic, data models, Lambda |
53| Infrastructure | INFRA | AWS setup, CI/CD, environments, DNS, secrets |
54| Testing | TEST | Unit, integration, E2E tests, test infrastructure |
55| Design | UX | Storybook stories, component specs, design tokens |
56| Documentation | DOCS | Feature docs, API docs, README updates |
57
58### Roles
59
60| Role | Abbreviation | Primary Areas |
61|------|-------------|---------------|
62| Software Engineer | SE | FE, BE, INFRA, TEST |
63| UX Designer | UX | UX, FE (component specs) |
64| QA Engineer | QA | TEST (E2E, acceptance) |
65| Product Manager | PM | DOCS (PRDs, requirements) |
66
67---
68
69## Parent and Sub-issue Estimation
70
71### The Model
72
73When a parent issue has specification sub-issues ([Behaviour], [UX]):
74
75**Parent estimate = total effort** (specs + implementation)
76
77**Sub-issue estimates = breakdown** of the parent total (not additions)
78
79### Example
80
81```
82Issue: Login Flow (8 pts total)
83 ├── [Behaviour] Login scenarios (2 pts) — part of the 8
84 ├── [UX] Login Storybook (2 pts) — part of the 8
85 └── Implementation (4 pts) — implicit remainder, not a sub-issue
86```
87
88### Velocity Calculation
89
90When calculating velocity:
91- Count the **parent issue points** (8 pts)
92- Do NOT add sub-issue points on top (that would double-count to 12 pts)
93
94Sub-issues exist for assignment and scheduling, not for inflating totals.
95
96### Estimation Timing
97
98**Discovery Estimate (on parent):**
99- Created during Discovery phase
100- Rough total for the whole capability (specs + implementation)
101- Confidence: Low/Medium
102- No sub-issues exist yet
103
104**Refined Estimate (during Refinement):**
105- Sub-issues created with individual estimates
106- Parent estimate updated if scope changed during refinement
107- Verify: parent estimate ≥ sum of sub-issue estimates
108- Confidence: Medium/High
109
110---
111
112## Zero-Point Issues and Batching
113
114### The Problem
115
116The 1-point minimum (3 hours) includes overhead for code + test + docs. For trivial changes (typo fix, config tweak), this overhead is disproportionate and inflates velocity.
117
118### The Solution
119
120**For genuinely trivial changes:**
121- Assign 0 points if it needs tracking
122- Or batch into a "Housekeeping" parent issue
123
124**For batches of trivial changes:**
125- Create a "Housekeeping" or "Polish" parent issue
126- Add trivial items as sub-issues (titles only, no individual estimates)
127- Estimate the parent collectively (e.g., 2-3 points for 10-15 items)
128
129### Example
130
131```
132Issue: Housekeeping — Week of Feb 10 (3 pts)
133 ├── Sub-issue: Fix typo in login button
134 ├── Sub-issue: Update copyright year in footer
135 ├── Sub-issue: Remove unused import in auth.ts
136 ├── Sub-issue: Add missing alt text to logo
137 └── ... (10-15 trivial items)
138```
139
140### Decision Guide
141
142| Situation | Approach |
143|-----------|----------|
144| Single trivial change, needs tracking | 0-point standalone issue |
145| Single trivial change, no tracking needed | Just do it, no issue |
146| Multiple trivial changes accumulating | Batch into Housekeeping parent |
147| Small but non-trivial change | Normal 1-3 point issue |
148
149### Avoid
150
151- Estimating each trivial change at 1 point (inflates velocity)
152- Creating issues for changes that don't need tracking
153- Letting trivial changes accumulate without batching them
154
155---
156
157## Two-Tier Estimation
158
159Estimation happens in two phases with increasing precision:
160
161### Discovery Estimate (Feature-Level)
162
163- **When:** During Discovery phase, when creating Linear features
164- **Granularity:** Feature-level only (sub-issues don't exist yet)
165- **Confidence:** Typically Low or Medium
166- **Purpose:** Rough order-of-magnitude for planning and prioritisation
167- **Tag:** `[Discovery Estimate]` in Linear comment
168
169### Refined Estimate (Atomic with Roll-Up)
170
171- **When:** During Refinement phase, after Behaviour scenarios and mini-PRD are written
172- **Granularity:** Per sub-issue, with hours and points rolling up to the parent feature
173- **Confidence:** Typically Medium or High
174- **Purpose:** Detailed breakdown for sprint planning and delivery
175- **Tag:** `[Refined Estimate]` in Linear comment
176
177**Roll-up rule:** Both hours AND points roll up from sub-issues to the parent feature. Do not rely solely on Linear's points roll-up — explicitly track total hours in the parent feature's estimate comment and mini-PRD.
178
179**Small feature exception:** Features estimated at 3 points or fewer can stay as a single issue without sub-issue decomposition.
180
181**Sub-issue size policy:** Other than [Behaviour] and [UX] sub-issues (which are exempt), sub-issues should only be created when the parent exceeds 2 days (12 hours) of human effort, and each sub-issue must itself represent at least 2 days (12 hours) of work. The work must also be genuinely independent (different person, different phase, or independently deliverable). Prefer checklists in the parent description over small sub-issues.
182
183---
184
185## Rules
186
1871. **Always decompose before estimating.** Never assign a single number without breaking work into functional areas first.
1882. **Estimate in hours, convert to points.** Hours are the base unit. Convert to the nearest fibonacci point value using the mapping table.
1893. **Round up to the next fibonacci value.** If total hours fall between two values, always round up (e.g., 20 hours rounds to 8 points, not 5).
1904. **Issues over 34 points must be decomposed.** If an estimate exceeds 34 points, split the work into smaller issues.
1915. **Include all functional areas.** Don't forget testing, documentation, and infrastructure — they are often 30-50% of total effort.
1926. **Estimate for a single competent human.** Assume one person working at normal pace, not a team in parallel.
1937. **State confidence level.** Every estimate must include a confidence indicator based on requirement clarity.
1948. **Use the structured output format.** All estimates posted to Linear must use the standard format below.
1959. **Roll up both hours and points.** When estimating sub-issues, always sum total hours in the parent feature — do not rely solely on Linear's points roll-up.
19610. **Tag estimates by phase.** Use `[Discovery Estimate]` or `[Refined Estimate]` to differentiate in Linear comments.
197
198---
199
200## Workflow: Estimate a Task
201
202**When:** You need to estimate a Linear issue or feature.
203
204**Procedure:**
205
2061. **Read the requirements.** Read the issue description, comments, mini-PRD, and any BDD scenarios. If requirements are vague, flag this in the confidence level.
207
2082. **Identify functional areas.** List which areas are involved (FE, BE, INFRA, TEST, UX, DOCS). Not every task touches all areas.
209
2103. **Estimate hours per area.** For each functional area, estimate the hours a single competent person would need:
211 - What specific work is required?
212 - What's the complexity? (new code vs. modification, known vs. unknown patterns)
213 - Are there dependencies or integration points?
214
2154. **Assign roles.** Map each functional area to the role that would do the work. Some areas may involve multiple roles.
216
2175. **Sum total hours.** Add up all area estimates.
218
2196. **Convert to points.** Find the nearest fibonacci value at or above the total hours using the mapping table.
220
2217. **Assess confidence.** Rate confidence based on requirement clarity:
222 - **High** — Clear requirements, BDD scenarios exist, known patterns
223 - **Medium** — Refinement understood but some ambiguity, partially specified
224 - **Low** — Vague requirements, unknown technical approach, significant unknowns
225
2268. **Write the estimate.** Use the structured output format and post to the Linear issue.
227
228---
229
230## Workflow: Update Linear with Estimate
231
232**When:** You have completed an estimate and need to record it.
233
234**Procedure:**
235
2361. **Set the story points on the issue:**
237 ```bash
238 curl -s -X POST https://api.linear.app/graphql \
239 -H "Content-Type: application/json" \
240 -H "Authorization: $LINEAR_API_KEY" \
241 -d '{
242 "query": "mutation { issueUpdate(id: \"ISSUE-ID\", input: { estimate: POINTS }) { success } }"
243 }'
244 ```
245
246 Or via `linearis` if the CLI supports it in future versions.
247
2482. **Post the detailed breakdown as a comment:**
249 ```bash
250 linearis issues comment ISSUE-ID "ESTIMATE_MARKDOWN"
251 ```
252
253---
254
255## Structured Output Format
256
257Use this format when posting estimates to Linear issue comments:
258
259```markdown
260## [Discovery Estimate] or [Refined Estimate]
261
262**Total: X points (Y hours / Z days)**
263**Confidence: High | Medium | Low**
264
265### Breakdown
266
267| Area | Work | Hours | Role |
268|------|------|-------|------|
269| FE | [description] | X | SE |
270| BE | [description] | X | SE |
271| TEST | [description] | X | SE/QA |
272| DOCS | [description] | X | PM/SE |
273| **Total** | | **X** | |
274
275### Assumptions
276- [Key assumption 1]
277- [Key assumption 2]
278
279### Risks
280- [Risk that could increase estimate]
281```
282
283### Example: Discovery Estimate (Feature-Level)
284
285```markdown
286## [Discovery Estimate]
287
288**Total: 8 points (24 hours / 4 days)**
289**Confidence: Medium**
290
291### Breakdown
292
293| Area | Work | Hours | Role |
294|------|------|-------|------|
295| BE | Auth API endpoints, JWT middleware, user model | 8 | SE |
296| FE | Login page, auth context, protected routes | 6 | SE |
297| INFRA | Cognito setup, env vars, CORS | 2 | SE |
298| TEST | Unit + E2E tests | 5 | SE/QA |
299| DOCS | Auth flow docs, API docs | 2 | SE |
300| UX | Login form Storybook story | 1 | UX |
301| **Total** | | **24** | |
302
303### Assumptions
304- Using AWS Cognito (not custom auth)
305- Email/password auth only (no social login)
306
307### Risks
308- Cognito config complexity could add 4-8 hours
309```
310
311### Example: Refined Estimate (Atomic with Roll-Up)
312
313```markdown
314## [Refined Estimate]
315
316**Feature Total: 10 points (30 hours / 5 days)**
317**Confidence: High**
318
319### Sub-Issue Breakdown
320
321| Sub-Issue | Area | Hours | Points |
322|-----------|------|-------|--------|
323| AF-50a: Backend API + data model | BE | 9 | 3 |
324| AF-50b: Frontend UI components | FE, UX | 9 | 3 |
325| AF-50c: E2E tests + integration | TEST | 6 | 2 |
326| AF-50d: Documentation + infra | DOCS, INFRA | 6 | 2 |
327| **Total** | | **30** | **10** |
328
329### Change from Discovery
330- Discovery estimate: 8 points (24 hours)
331- Refined estimate: 10 points (30 hours)
332- Reason: BDD scenarios revealed additional error handling and edge cases
333
334### Assumptions
335- Using AWS Cognito (not custom auth)
336- Email/password auth only (no social login)
337- SSO not required
338
339### Risks
340- Cognito configuration complexity could add 4-8 hours
341```
342
343---
344
345## Estimation Heuristics
346
347Use these rules of thumb when detailed decomposition isn't practical:
348
349### By Change Type
350
351| Change Type | Typical Points | Notes |
352|-------------|---------------|-------|
353| Config/typo fix | 0 | No testing impact |
354| Single bug fix | 1-2 | Depends on diagnosis time |
355| Simple UI change | 1-2 | Styling, copy, layout tweaks |
356| New API endpoint | 2-3 | CRUD with tests |
357| New UI component | 2-3 | With Storybook + tests |
358| New page/feature | 5-8 | FE + BE + tests + docs |
359| Cross-cutting refactor | 5-13 | Depends on blast radius |
360| New integration | 8-13 | External API, error handling, tests |
361| New system/service | 13-34 | Consider decomposing |
362
363### Testing Multiplier
364
365Testing typically adds 30-50% to implementation time:
366
367| Implementation Hours | Add for Testing |
368|---------------------|----------------|
369| 1-3 | +1-2 hours |
370| 4-8 | +2-4 hours |
371| 9-15 | +4-8 hours |
372| 16+ | +8-12 hours |
373
374### Documentation Overhead
375
376| Scope | Documentation Hours |
377|-------|-------------------|
378| Bug fix | 0-1 |
379| Small feature | 1-2 |
380| Major feature | 2-4 |
381| New system | 4-8 |
382
383---
384
385## Common Pitfalls
386
3871. **Forgetting testing effort.** Testing is 30-50% of total work. Always include TEST in your breakdown.
3882. **Ignoring infrastructure.** New features often need env vars, CI changes, or AWS resources.
3893. **Underestimating integration.** Connecting to external APIs or services takes longer than expected.
3904. **Not accounting for review cycles.** Code review and feedback rounds add time. Include 1-2 hours for non-trivial PRs.
3915. **Estimating for the best case.** Estimate for normal pace, not "if everything goes perfectly."
3926. **Skipping documentation.** Docs are part of "done." Include them in every estimate.
3937. **Over-precision in large estimates.** A 34-point issue doesn't need hour-level precision — focus on getting the right order of magnitude and flag that it should be decomposed.
3948. **Estimating Epic parents that have estimated children.** When an issue is labelled "Epic" and has sub-issues that carry estimates, the parent should have estimate = 0. Carrying estimates on both parent and children causes double-counting in project totals. Always check: does this issue have estimated children? If so, zero the parent estimate.
3959. **Missing delivery by-products.** Issues created during delivery as follow-on work ("what's left to do" breakdowns) bypass the estimation workflow. These need an estimation sweep — either via a recurring task (like AGV-85) or as part of cycle planning.
39610. **Not checking for overlapping scope.** Before estimating, check if the issue's scope overlaps with existing issues. If two issues cover the same work, one should be marked as a duplicate or made a sub-issue of the other. Estimating both inflates the project total.
397
398---
399
400## Integration Points
401
402**Discovery phase** (af-discover-scope):
403- Feature-level estimates when creating Linear features in Phase 4
404- Tag as `[Discovery Estimate]` in Linear comment
405- Set story points on the feature issue directly
406- Confidence is typically Low or Medium
407
408**Refinement phase** (af-refine-specifications):
409- Refined estimates after Behaviour scenarios and mini-PRD are complete
410- Tag as `[Refined Estimate]` in Linear comment
411- For features > 3 points: create specification sub-issues ([Behaviour], [UX]) with individual estimates
412- Sub-issue estimates are a breakdown of the parent total (not additions)
413- Hours AND points roll up to the parent feature
414- Document final estimate in mini-PRD Section 7 (Effort Estimation)
415- Story points must be set before moving to "Approved"
416
417**Mini-PRD** (templates/mini-prd-template.md):
418- Section 7 captures the refined estimate with full breakdown
419- Becomes the permanent record of how the estimate was calculated
420
421**Work management** (af-manage-work-state):
422- Story points drive sprint planning and velocity tracking
423- Use `issueUpdate` mutation to set `estimate` field on Linear issues
424
425**Linear API** (af-query-linear-api):
426- Set estimates via GraphQL: `issueUpdate(id: "...", input: { estimate: N })`
427- Query estimates: `issue(id: "...") { estimate }`
428
429**Database** (agents.db `tasks` table):
430- After producing an estimate, persist it to the `tasks` table
431- Discovery estimates: update `discovery_points`, `discovery_hours`, `discovery_confidence`, `discovery_breakdown`
432- Refined estimates: update `refined_points`, `refined_hours`, `refined_confidence`, `refined_breakdown`
433- Use this command after each estimate:
434
435```bash
436sqlite3 /var/lib/claude-agents/agents.db "
437 INSERT INTO tasks (issue_id, issue_title, project, team_key, created_at, updated_at)
438 VALUES ('<ISSUE_ID>', '<TITLE>', '<PROJECT>', '<TEAM_KEY>', datetime('now'), datetime('now'))
439 ON CONFLICT(issue_id) DO UPDATE SET updated_at = datetime('now');
440
441 UPDATE tasks SET
442 discovery_points = <POINTS>,
443 discovery_hours = <HOURS>,
444 discovery_confidence = '<CONFIDENCE>',
445 discovery_breakdown = '<JSON_BREAKDOWN>',
446 discovery_estimated_at = datetime('now'),
447 updated_at = datetime('now')
448 WHERE issue_id = '<ISSUE_ID>';
449"
450```
451
452For refined estimates, replace `discovery_*` columns with `refined_*`.
453
454---
455
456**Remember:**
4571. Decompose first, estimate second — never guess a single number
4582. Hours are the base unit, points are for Linear
4593. 1 point = 3 hours = half a productive day
4604. Always include testing, docs, and infrastructure
4615. Round up to the next fibonacci value, never down
4626. Roll up BOTH hours and points from sub-issues to parent feature
4637. Tag estimates: `[Discovery Estimate]` or `[Refined Estimate]`
4648. Persist estimates to the `tasks` table in agents.db after setting on Linear