|
| 1 | +--- |
| 2 | +name: create-estimation |
| 3 | +description: Create a three-point estimation when the user asks to estimate effort, scope a feature, size work, forecast timeline, or plan capacity for a project or feature |
| 4 | +owner: chalk |
| 5 | +version: "1.0.0" |
| 6 | +metadata-version: "1" |
| 7 | +allowed-tools: Read, Glob, Write, Grep |
| 8 | +argument-hint: "[feature or work item to estimate]" |
| 9 | +--- |
| 10 | + |
| 11 | +# Create Estimation |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +Create a structured three-point estimation using PERT-weighted averages. Breaks work into concrete tasks, estimates each with optimistic/likely/pessimistic bounds, identifies risk factors, and produces a total range with a recommended commitment point. |
| 16 | + |
| 17 | +## Workflow |
| 18 | + |
| 19 | +1. **Read project context** -- Read `.chalk/docs/` for PRDs, user stories, acceptance criteria, and architecture docs. Understanding scope and integration points is essential before estimating. |
| 20 | + |
| 21 | +2. **Determine the next estimation number** -- List files in `.chalk/docs/engineering/` matching the pattern `*_estimation_*.md`. Find the highest number and increment by 1. If none exist, start at `1`. |
| 22 | + |
| 23 | +3. **Understand the scope** -- From `$ARGUMENTS`, conversation context, and project docs, identify: |
| 24 | + - What exactly is being estimated (feature, epic, spike, migration) |
| 25 | + - Acceptance criteria or definition of done |
| 26 | + - Known integration points with existing systems |
| 27 | + - Whether this is greenfield or modification of existing code |
| 28 | + - If scope is unclear, ask the user before estimating -- estimation without scope understanding is guessing |
| 29 | + |
| 30 | +4. **Break into tasks** -- Decompose the work into concrete, estimatable tasks. Each task should be: |
| 31 | + - Small enough to estimate with reasonable confidence (ideally 0.5-3 days of effort) |
| 32 | + - Independent enough to estimate separately |
| 33 | + - Inclusive of all work types: implementation, testing, code review, documentation, deployment |
| 34 | + |
| 35 | +5. **Three-point estimate each task** -- For every task, provide: |
| 36 | + - **Optimistic (O)**: Best case if everything goes smoothly, no surprises, familiar territory |
| 37 | + - **Likely (L)**: Most probable duration given normal conditions, some minor friction |
| 38 | + - **Pessimistic (P)**: Worst reasonable case -- unfamiliar code, complex bugs, unclear requirements (not catastrophic, just hard) |
| 39 | + |
| 40 | +6. **Calculate PERT estimate** -- For each task: `Expected = (O + 4L + P) / 6`. Sum all task estimates for the total. |
| 41 | + |
| 42 | +7. **Identify risk factors** -- List specific risks that could push the estimate toward the pessimistic end. Assign each a probability (low/medium/high) and impact in time. |
| 43 | + |
| 44 | +8. **Calculate risk buffer** -- Add a percentage buffer based on cumulative risk: |
| 45 | + - Well-understood work, few unknowns: 10-20% buffer |
| 46 | + - Some unknowns, moderate integration complexity: 20-40% buffer |
| 47 | + - Significant unknowns, new technology, complex integrations: 40-70% buffer |
| 48 | + |
| 49 | +9. **Determine recommended commitment** -- The number the team should commit to externally. This is the PERT total + risk buffer, rounded to a sensible unit (half-days for small work, days for medium, weeks for large). |
| 50 | + |
| 51 | +10. **Write the file** -- Save to `.chalk/docs/engineering/<n>_estimation_<feature_slug>.md`. |
| 52 | + |
| 53 | +11. **Confirm** -- Tell the user the estimation was created with its path, the recommended commitment, and the confidence range. |
| 54 | + |
| 55 | +## Filename Convention |
| 56 | + |
| 57 | +``` |
| 58 | +<number>_estimation_<snake_case_feature>.md |
| 59 | +``` |
| 60 | + |
| 61 | +Examples: |
| 62 | +- `2_estimation_user_authentication.md` |
| 63 | +- `5_estimation_payment_integration.md` |
| 64 | +- `9_estimation_migrate_to_v2_api.md` |
| 65 | + |
| 66 | +## Estimation Format |
| 67 | + |
| 68 | +```markdown |
| 69 | +# Estimation: <Feature or Work Item Title> |
| 70 | + |
| 71 | +Last updated: <YYYY-MM-DD> |
| 72 | + |
| 73 | +## Scope |
| 74 | + |
| 75 | +<Brief description of what is being estimated. Link to PRD or user story if available. |
| 76 | +State any scope boundaries explicitly: "This estimate covers X but not Y."> |
| 77 | + |
| 78 | +## Assumptions |
| 79 | + |
| 80 | +- <Assumption 1, e.g., "API contracts are finalized and won't change"> |
| 81 | +- <Assumption 2, e.g., "Design mockups are complete before development starts"> |
| 82 | +- <Assumption 3, e.g., "One engineer working full-time on this"> |
| 83 | + |
| 84 | +## Task Breakdown |
| 85 | + |
| 86 | +| # | Task | Optimistic | Likely | Pessimistic | PERT Estimate | |
| 87 | +|---|------|-----------|--------|-------------|---------------| |
| 88 | +| 1 | <Task description> | <O> | <L> | <P> | <(O+4L+P)/6> | |
| 89 | +| 2 | <Task description> | <O> | <L> | <P> | <(O+4L+P)/6> | |
| 90 | +| 3 | <Task description> | <O> | <L> | <P> | <(O+4L+P)/6> | |
| 91 | +| ... | ... | ... | ... | ... | ... | |
| 92 | +| | **Subtotal** | **<sum O>** | **<sum L>** | **<sum P>** | **<sum PERT>** | |
| 93 | + |
| 94 | +All values in **engineer-days** unless otherwise noted (1 engineer-day = 1 person working 1 full day). |
| 95 | + |
| 96 | +## Commonly Forgotten Tasks |
| 97 | + |
| 98 | +The following are included in the breakdown above. If any were intentionally excluded, note why. |
| 99 | + |
| 100 | +- [ ] Unit and integration tests |
| 101 | +- [ ] Error handling and edge cases |
| 102 | +- [ ] Code review iterations (typically 1-2 rounds) |
| 103 | +- [ ] Documentation updates (API docs, README, runbook) |
| 104 | +- [ ] Migration scripts or data backfill |
| 105 | +- [ ] Deployment and rollout (feature flags, staged rollout) |
| 106 | +- [ ] Monitoring and alerting setup |
| 107 | +- [ ] Performance testing under realistic load |
| 108 | + |
| 109 | +## Risk Factors |
| 110 | + |
| 111 | +| Risk | Probability | Impact | Mitigation | |
| 112 | +|------|------------|--------|------------| |
| 113 | +| <Specific risk> | Low / Medium / High | +<N> days | <How to reduce likelihood or impact> | |
| 114 | +| <Specific risk> | Low / Medium / High | +<N> days | <How to reduce likelihood or impact> | |
| 115 | + |
| 116 | +## Summary |
| 117 | + |
| 118 | +| Metric | Value | |
| 119 | +|--------|-------| |
| 120 | +| **Optimistic total** | <sum of all O values> | |
| 121 | +| **PERT total** | <sum of all PERT values> | |
| 122 | +| **Pessimistic total** | <sum of all P values> | |
| 123 | +| **Risk buffer** | <X%> (<rationale>) | |
| 124 | +| **Recommended commitment** | **<PERT + buffer, rounded>** | |
| 125 | +| **Confidence range** | <Optimistic> to <Pessimistic + buffer> | |
| 126 | + |
| 127 | +## Recommended Commitment |
| 128 | + |
| 129 | +**<N> engineer-days** (<approximately N/5 weeks> for a single engineer) |
| 130 | + |
| 131 | +This is the number to communicate externally. It includes the PERT-weighted estimate plus |
| 132 | +a <X%> risk buffer for <brief rationale>. |
| 133 | + |
| 134 | +## Revisit Triggers |
| 135 | + |
| 136 | +- Scope changes that add or remove acceptance criteria |
| 137 | +- Discovery of unknown integration complexity during implementation |
| 138 | +- Actual velocity tracking shows >20% deviation from estimates after first 30% of work |
| 139 | +``` |
| 140 | + |
| 141 | +## Content Guidelines |
| 142 | + |
| 143 | +### Estimation Units |
| 144 | + |
| 145 | +Use **engineer-days** as the base unit. This measures effort, not calendar time. |
| 146 | + |
| 147 | +- 1 engineer-day = 1 person working 1 full day |
| 148 | +- To convert to calendar time, divide by the number of engineers and add coordination overhead (typically 10-20% per additional engineer) |
| 149 | +- For very small tasks (< 0.5 days), use hours but convert to days in the summary |
| 150 | + |
| 151 | +### Calibrating Optimistic vs. Pessimistic |
| 152 | + |
| 153 | +The spread between O and P reveals confidence level: |
| 154 | + |
| 155 | +| O:P Ratio | What It Means | |
| 156 | +|-----------|---------------| |
| 157 | +| 1:1.5 | Very well understood, done it before | |
| 158 | +| 1:2 | Mostly understood, some unknowns | |
| 159 | +| 1:3 | Significant unknowns, unfamiliar territory | |
| 160 | +| 1:5+ | Too uncertain to estimate -- recommend a spike first | |
| 161 | + |
| 162 | +If any single task has a ratio worse than 1:5, flag it as needing a timeboxed investigation spike before estimation is meaningful. |
| 163 | + |
| 164 | +### Breaking Down Tasks Well |
| 165 | + |
| 166 | +Good task breakdown follows these rules: |
| 167 | +- Each task has a clear deliverable (not "work on X" but "implement X endpoint with validation") |
| 168 | +- Tasks include the full cost: code + tests + review, not just the coding part |
| 169 | +- Integration tasks are explicit, not hidden inside implementation tasks |
| 170 | +- "Glue work" is accounted for: config changes, environment setup, CI pipeline updates |
| 171 | + |
| 172 | +### Setting Risk Buffer |
| 173 | + |
| 174 | +The buffer is not padding -- it is a quantified acknowledgment of uncertainty: |
| 175 | + |
| 176 | +| Scenario | Suggested Buffer | |
| 177 | +|----------|-----------------| |
| 178 | +| Mature codebase, well-defined requirements, experienced team | 10-20% | |
| 179 | +| Some new technology, requirements mostly stable | 20-40% | |
| 180 | +| New codebase or major refactor, evolving requirements | 40-70% | |
| 181 | +| Greenfield with unproven technology and unclear requirements | 70-100% (or recommend a spike) | |
| 182 | + |
| 183 | +### Effort vs. Duration |
| 184 | + |
| 185 | +Always clarify the distinction: |
| 186 | +- **Effort**: Total engineer-days of work (what you estimate) |
| 187 | +- **Duration**: Calendar time to complete (depends on team size, parallel work, interruptions) |
| 188 | +- Two engineers don't halve the duration -- coordination overhead adds 10-20% per person |
| 189 | +- Context switching between projects adds 20-30% to effective duration |
| 190 | + |
| 191 | +## Anti-patterns |
| 192 | + |
| 193 | +- **Single-point estimates**: "This will take 5 days" is a guess, not an estimate. Always provide the three-point range. The spread itself is valuable information about uncertainty. |
| 194 | +- **Anchoring bias**: The first number mentioned becomes the anchor. Break into tasks first, estimate each independently, then sum. Never start with a total and work backward. |
| 195 | +- **Not accounting for integration/testing time**: Implementation is typically 40-60% of total effort. The rest is testing, integration, review, deployment, and documentation. If your estimate only covers coding, it is 40-60% of the real number. |
| 196 | +- **Estimating without understanding scope**: If you don't have acceptance criteria or a clear definition of done, you cannot estimate. Push back and get clarity first, or estimate the spike to get clarity. |
| 197 | +- **Confusing effort with duration**: 10 engineer-days is not "2 weeks." It is 2 weeks for 1 engineer, but could be 1 week for 2 engineers (plus coordination overhead), or 3 weeks for 1 engineer with context switching. |
| 198 | +- **Planning fallacy**: People consistently underestimate by 30-50%. If the team has historical data, calibrate against it. If not, lean toward the pessimistic end for commitments. |
| 199 | +- **Precision theater**: Reporting "7.3 engineer-days" implies false precision. Round to the nearest 0.5 for small estimates, nearest whole day for medium, nearest week for large. |
| 200 | +- **Estimating in isolation**: If the work integrates with systems owned by other teams, account for coordination time, API negotiations, and blocked-waiting time. Cross-team dependencies are the most common source of estimation misses. |
0 commit comments