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.
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-discovery-process):
- 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-refinement-process):
- 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-work-management-expertise):
- Story points drive sprint planning and velocity tracking
- Use
issueUpdate mutation to set estimate field on Linear issues
Linear API (af-linear-api-expertise):
- 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-estimation-expertise3description: Use when estimating effort for tasks or features in hours, decomposed by functional area and role, with conversion 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---
182
183## Rules
184
1851. **Always decompose before estimating.** Never assign a single number without breaking work into functional areas first.
1862. **Estimate in hours, convert to points.** Hours are the base unit. Convert to the nearest fibonacci point value using the mapping table.
1873. **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).
1884. **Issues over 34 points must be decomposed.** If an estimate exceeds 34 points, split the work into smaller issues.
1895. **Include all functional areas.** Don't forget testing, documentation, and infrastructure — they are often 30-50% of total effort.
1906. **Estimate for a single competent human.** Assume one person working at normal pace, not a team in parallel.
1917. **State confidence level.** Every estimate must include a confidence indicator based on requirement clarity.
1928. **Use the structured output format.** All estimates posted to Linear must use the standard format below.
1939. **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.
19410. **Tag estimates by phase.** Use `[Discovery Estimate]` or `[Refined Estimate]` to differentiate in Linear comments.
195
196---
197
198## Workflow: Estimate a Task
199
200**When:** You need to estimate a Linear issue or feature.
201
202**Procedure:**
203
2041. **Read the requirements.** Read the issue description, comments, mini-PRD, and any BDD scenarios. If requirements are vague, flag this in the confidence level.
205
2062. **Identify functional areas.** List which areas are involved (FE, BE, INFRA, TEST, UX, DOCS). Not every task touches all areas.
207
2083. **Estimate hours per area.** For each functional area, estimate the hours a single competent person would need:
209 - What specific work is required?
210 - What's the complexity? (new code vs. modification, known vs. unknown patterns)
211 - Are there dependencies or integration points?
212
2134. **Assign roles.** Map each functional area to the role that would do the work. Some areas may involve multiple roles.
214
2155. **Sum total hours.** Add up all area estimates.
216
2176. **Convert to points.** Find the nearest fibonacci value at or above the total hours using the mapping table.
218
2197. **Assess confidence.** Rate confidence based on requirement clarity:
220 - **High** — Clear requirements, BDD scenarios exist, known patterns
221 - **Medium** — Refinement understood but some ambiguity, partially specified
222 - **Low** — Vague requirements, unknown technical approach, significant unknowns
223
2248. **Write the estimate.** Use the structured output format and post to the Linear issue.
225
226---
227
228## Workflow: Update Linear with Estimate
229
230**When:** You have completed an estimate and need to record it.
231
232**Procedure:**
233
2341. **Set the story points on the issue:**
235 ```bash
236 curl -s -X POST https://api.linear.app/graphql \
237 -H "Content-Type: application/json" \
238 -H "Authorization: $LINEAR_API_KEY" \
239 -d '{
240 "query": "mutation { issueUpdate(id: \"ISSUE-ID\", input: { estimate: POINTS }) { success } }"
241 }'
242 ```
243
244 Or via `linearis` if the CLI supports it in future versions.
245
2462. **Post the detailed breakdown as a comment:**
247 ```bash
248 linearis issues comment ISSUE-ID "ESTIMATE_MARKDOWN"
249 ```
250
251---
252
253## Structured Output Format
254
255Use this format when posting estimates to Linear issue comments:
256
257```markdown
258## [Discovery Estimate] or [Refined Estimate]
259
260**Total: X points (Y hours / Z days)**
261**Confidence: High | Medium | Low**
262
263### Breakdown
264
265| Area | Work | Hours | Role |
266|------|------|-------|------|
267| FE | [description] | X | SE |
268| BE | [description] | X | SE |
269| TEST | [description] | X | SE/QA |
270| DOCS | [description] | X | PM/SE |
271| **Total** | | **X** | |
272
273### Assumptions
274- [Key assumption 1]
275- [Key assumption 2]
276
277### Risks
278- [Risk that could increase estimate]
279```
280
281### Example: Discovery Estimate (Feature-Level)
282
283```markdown
284## [Discovery Estimate]
285
286**Total: 8 points (24 hours / 4 days)**
287**Confidence: Medium**
288
289### Breakdown
290
291| Area | Work | Hours | Role |
292|------|------|-------|------|
293| BE | Auth API endpoints, JWT middleware, user model | 8 | SE |
294| FE | Login page, auth context, protected routes | 6 | SE |
295| INFRA | Cognito setup, env vars, CORS | 2 | SE |
296| TEST | Unit + E2E tests | 5 | SE/QA |
297| DOCS | Auth flow docs, API docs | 2 | SE |
298| UX | Login form Storybook story | 1 | UX |
299| **Total** | | **24** | |
300
301### Assumptions
302- Using AWS Cognito (not custom auth)
303- Email/password auth only (no social login)
304
305### Risks
306- Cognito config complexity could add 4-8 hours
307```
308
309### Example: Refined Estimate (Atomic with Roll-Up)
310
311```markdown
312## [Refined Estimate]
313
314**Feature Total: 10 points (30 hours / 5 days)**
315**Confidence: High**
316
317### Sub-Issue Breakdown
318
319| Sub-Issue | Area | Hours | Points |
320|-----------|------|-------|--------|
321| AF-50a: Backend API + data model | BE | 9 | 3 |
322| AF-50b: Frontend UI components | FE, UX | 9 | 3 |
323| AF-50c: E2E tests + integration | TEST | 6 | 2 |
324| AF-50d: Documentation + infra | DOCS, INFRA | 6 | 2 |
325| **Total** | | **30** | **10** |
326
327### Change from Discovery
328- Discovery estimate: 8 points (24 hours)
329- Refined estimate: 10 points (30 hours)
330- Reason: BDD scenarios revealed additional error handling and edge cases
331
332### Assumptions
333- Using AWS Cognito (not custom auth)
334- Email/password auth only (no social login)
335- SSO not required
336
337### Risks
338- Cognito configuration complexity could add 4-8 hours
339```
340
341---
342
343## Estimation Heuristics
344
345Use these rules of thumb when detailed decomposition isn't practical:
346
347### By Change Type
348
349| Change Type | Typical Points | Notes |
350|-------------|---------------|-------|
351| Config/typo fix | 0 | No testing impact |
352| Single bug fix | 1-2 | Depends on diagnosis time |
353| Simple UI change | 1-2 | Styling, copy, layout tweaks |
354| New API endpoint | 2-3 | CRUD with tests |
355| New UI component | 2-3 | With Storybook + tests |
356| New page/feature | 5-8 | FE + BE + tests + docs |
357| Cross-cutting refactor | 5-13 | Depends on blast radius |
358| New integration | 8-13 | External API, error handling, tests |
359| New system/service | 13-34 | Consider decomposing |
360
361### Testing Multiplier
362
363Testing typically adds 30-50% to implementation time:
364
365| Implementation Hours | Add for Testing |
366|---------------------|----------------|
367| 1-3 | +1-2 hours |
368| 4-8 | +2-4 hours |
369| 9-15 | +4-8 hours |
370| 16+ | +8-12 hours |
371
372### Documentation Overhead
373
374| Scope | Documentation Hours |
375|-------|-------------------|
376| Bug fix | 0-1 |
377| Small feature | 1-2 |
378| Major feature | 2-4 |
379| New system | 4-8 |
380
381---
382
383## Common Pitfalls
384
3851. **Forgetting testing effort.** Testing is 30-50% of total work. Always include TEST in your breakdown.
3862. **Ignoring infrastructure.** New features often need env vars, CI changes, or AWS resources.
3873. **Underestimating integration.** Connecting to external APIs or services takes longer than expected.
3884. **Not accounting for review cycles.** Code review and feedback rounds add time. Include 1-2 hours for non-trivial PRs.
3895. **Estimating for the best case.** Estimate for normal pace, not "if everything goes perfectly."
3906. **Skipping documentation.** Docs are part of "done." Include them in every estimate.
3917. **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.
3928. **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.
3939. **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.
39410. **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.
395
396---
397
398## Integration Points
399
400**Discovery phase** (af-discovery-process):
401- Feature-level estimates when creating Linear features in Phase 4
402- Tag as `[Discovery Estimate]` in Linear comment
403- Set story points on the feature issue directly
404- Confidence is typically Low or Medium
405
406**Refinement phase** (af-refinement-process):
407- Refined estimates after Behaviour scenarios and mini-PRD are complete
408- Tag as `[Refined Estimate]` in Linear comment
409- For features > 3 points: create specification sub-issues ([Behaviour], [UX]) with individual estimates
410- Sub-issue estimates are a breakdown of the parent total (not additions)
411- Hours AND points roll up to the parent feature
412- Document final estimate in mini-PRD Section 7 (Effort Estimation)
413- Story points must be set before moving to "Approved"
414
415**Mini-PRD** (templates/mini-prd-template.md):
416- Section 7 captures the refined estimate with full breakdown
417- Becomes the permanent record of how the estimate was calculated
418
419**Work management** (af-work-management-expertise):
420- Story points drive sprint planning and velocity tracking
421- Use `issueUpdate` mutation to set `estimate` field on Linear issues
422
423**Linear API** (af-linear-api-expertise):
424- Set estimates via GraphQL: `issueUpdate(id: "...", input: { estimate: N })`
425- Query estimates: `issue(id: "...") { estimate }`
426
427**Database** (agents.db `tasks` table):
428- After producing an estimate, persist it to the `tasks` table
429- Discovery estimates: update `discovery_points`, `discovery_hours`, `discovery_confidence`, `discovery_breakdown`
430- Refined estimates: update `refined_points`, `refined_hours`, `refined_confidence`, `refined_breakdown`
431- Use this command after each estimate:
432
433```bash
434sqlite3 /var/lib/claude-agents/agents.db "
435 INSERT INTO tasks (issue_id, issue_title, project, team_key, created_at, updated_at)
436 VALUES ('<ISSUE_ID>', '<TITLE>', '<PROJECT>', '<TEAM_KEY>', datetime('now'), datetime('now'))
437 ON CONFLICT(issue_id) DO UPDATE SET updated_at = datetime('now');
438
439 UPDATE tasks SET
440 discovery_points = <POINTS>,
441 discovery_hours = <HOURS>,
442 discovery_confidence = '<CONFIDENCE>',
443 discovery_breakdown = '<JSON_BREAKDOWN>',
444 discovery_estimated_at = datetime('now'),
445 updated_at = datetime('now')
446 WHERE issue_id = '<ISSUE_ID>';
447"
448```
449
450For refined estimates, replace `discovery_*` columns with `refined_*`.
451
452---
453
454**Remember:**
4551. Decompose first, estimate second — never guess a single number
4562. Hours are the base unit, points are for Linear
4573. 1 point = 3 hours = half a productive day
4584. Always include testing, docs, and infrastructure
4595. Round up to the next fibonacci value, never down
4606. Roll up BOTH hours and points from sub-issues to parent feature
4617. Tag estimates: `[Discovery Estimate]` or `[Refined Estimate]`
4628. Persist estimates to the `tasks` table in agents.db after setting on Linear