token-count 0.4.0

Count tokens for LLM models using exact tokenization
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
# Feature 002: Installation & Distribution - Task Breakdown

**Status**: Complete ✅  
**Branch**: `002-installation` (merged to main)  
**Spec Version**: 1.1  
**Created**: 2026-03-14  
**Completed**: 2026-03-14  
**Release**: v0.1.0

## Task Legend
- `[P]` = Can be executed in parallel with other `[P]` tasks
- `[ ]` = Not started
- `[x]` = Completed
- `[~]` = In progress
- `[!]` = Blocked (dependencies not met)

---

## Phase 0: Planning & Preparation
**Status**: Complete  
**Estimated Time**: 3-4 hours  
**Actual Time**: ~4 hours

- [x] **TASK-000**: Research GitHub Actions cross-platform builds
- [x] **TASK-001**: Research Homebrew tap vs homebrew-core
- [x] **TASK-002**: Research Homebrew auto-update solutions
- [x] **TASK-003**: Research install script security best practices
- [x] **TASK-004**: Research crates.io publication requirements
- [x] **TASK-005**: Create `plan.md` with technical context and phases
- [x] **TASK-006**: Create `research.md` documenting technology choices
- [x] **TASK-007**: Create `quickstart.md` with validation scenarios
- [x] **TASK-008**: Create `contracts/github-release.md`
- [x] **TASK-009**: Create `contracts/install-script.md`
- [x] **TASK-010**: Create `HOMEBREW-AUTO-UPDATE.md` guide
- [x] **TASK-011**: Update email addresses in `Cargo.toml` and `README.md`
- [x] **TASK-012**: Verify constitution compliance (zero violations)
- [x] **TASK-013**: Create this `tasks.md` file

---

## Phase 1: GitHub Actions Release Workflow
**Status**: Not Started  
**Estimated Time**: 2-3 hours  
**Blocks**: All other phases (need binaries for testing)

### TASK-100: Create `.github/workflows/` directory structure
**Effort**: 5 minutes  
**Dependencies**: None

- [ ] Create `.github/workflows/` directory if it doesn't exist
- [ ] Verify directory permissions

### TASK-101: Create `release.yml` workflow skeleton
**Effort**: 15 minutes  
**Dependencies**: TASK-100

- [ ] Create `.github/workflows/release.yml`
- [ ] Add workflow metadata (name, description)
- [ ] Define trigger: `on: push: tags: ['v*']`
- [ ] Add workflow_dispatch for manual testing

### TASK-102: Implement build matrix for 4 platforms
**Effort**: 45 minutes  
**Dependencies**: TASK-101

- [ ] Define matrix strategy with 4 platforms:
  - `x86_64-unknown-linux-gnu`
  - `x86_64-apple-darwin`
  - `aarch64-apple-darwin`
  - `x86_64-pc-windows-msvc`
- [ ] Map each platform to GitHub runner OS
- [ ] Configure Rust toolchain installation (stable)
- [ ] Add cross-compilation setup for macOS ARM64

### TASK-103: Implement build steps
**Effort**: 30 minutes  
**Dependencies**: TASK-102

- [ ] Checkout code with `actions/checkout@v4`
- [ ] Install Rust with `dtolnay/rust-toolchain@stable`
- [ ] Add target with `rustup target add ${{ matrix.target }}`
- [ ] Run `cargo build --release --target ${{ matrix.target }}`
- [ ] Verify binary exists in `target/${{ matrix.target }}/release/`

### TASK-104: Implement binary packaging
**Effort**: 45 minutes  
**Dependencies**: TASK-103

- [ ] Strip binaries with `strip` command (Linux/macOS only)
- [ ] Create archive names: `token-count-$VERSION-$TARGET.tar.gz` (Unix) / `.zip` (Windows)
- [ ] Package binaries with appropriate format:
  - Linux/macOS: `tar czf` with `token-count/` directory
  - Windows: `7z a` or PowerShell `Compress-Archive`
- [ ] Generate SHA256 checksums for each archive
- [ ] Create `checksums.txt` file with all hashes

### TASK-105: Implement GitHub Release creation
**Effort**: 30 minutes  
**Dependencies**: TASK-104

- [ ] Use `softprops/action-gh-release@v1`
- [ ] Extract version from `$GITHUB_REF` (strip `refs/tags/v`)
- [ ] Upload all 4 platform archives
- [ ] Upload `checksums.txt`
- [ ] Set release name to `token-count v$VERSION`
- [ ] Mark as draft initially for manual review

### TASK-106: Add Homebrew auto-update job
**Effort**: 30 minutes  
**Dependencies**: TASK-105, Phase 3 complete (Homebrew tap exists)

- [ ] Add separate job `update-homebrew` that depends on `build` job
- [ ] Runs only on: `if: startsWith(github.ref, 'refs/tags/v')`
- [ ] Uses `mislav/bump-homebrew-formula-action@v3`
- [ ] Configure with:
  - `formula-name: token-count`
  - `homebrew-tap: shaunburdick/homebrew-tap`
  - `base-branch: main`
  - `download-url: https://github.com/shaunburdick/token-count/archive/refs/tags/$VERSION.tar.gz`
  - `commit-message: 'Brew formula update for token-count version $VERSION'`
- [ ] Use `secrets.HOMEBREW_TAP_TOKEN` for authentication

### TASK-107: Test workflow with test tag
**Effort**: 30 minutes  
**Dependencies**: TASK-106

- [ ] Commit workflow file
- [ ] Create test tag: `git tag v0.1.0-test && git push origin v0.1.0-test`
- [ ] Verify all 4 builds succeed in GitHub Actions
- [ ] Verify binaries are uploaded to draft release
- [ ] Verify checksums.txt is correct
- [ ] Test download and extract on local machine
- [ ] Delete test tag and draft release
- [ ] Fix any issues found

**Phase 1 Deliverable**: Working `.github/workflows/release.yml` that produces 4 platform binaries + checksums

---

## Phase 2: Install Script
**Status**: Not Started  
**Estimated Time**: 2-3 hours  
**Dependencies**: Phase 1 complete (need release binaries to test against)

### TASK-200: Create `install.sh` skeleton
**Effort**: 15 minutes  
**Dependencies**: None

- [ ] Create `install.sh` in repository root
- [ ] Add shebang: `#!/usr/bin/env bash`
- [ ] Add copyright header and MIT license comment
- [ ] Add script description and usage instructions
- [ ] Set `set -euo pipefail` for safety

### TASK-201: Implement platform detection
**Effort**: 30 minutes  
**Dependencies**: TASK-200

- [ ] Detect OS with `uname -s`: Linux, Darwin, Windows (MINGW/MSYS)
- [ ] Detect architecture with `uname -m`: x86_64, arm64/aarch64
- [ ] Map to target triple format (e.g., `x86_64-unknown-linux-gnu`)
- [ ] Error out on unsupported platforms with clear message
- [ ] Add debug output (if `$DEBUG` env var set)

### TASK-202: Implement version resolution
**Effort**: 20 minutes  
**Dependencies**: TASK-201

- [ ] Accept optional version argument: `./install.sh [VERSION]`
- [ ] Default to latest release if no version specified
- [ ] Fetch latest version from GitHub API:
  - `curl -sSfL https://api.github.com/repos/shaunburdick/token-count/releases/latest`
  - Parse JSON with `jq` or `grep`/`sed` (prefer no dependencies)
- [ ] Validate version format (v*.*.*)
- [ ] Set `VERSION` variable

### TASK-203: Implement download with verification
**Effort**: 45 minutes  
**Dependencies**: TASK-202

- [ ] Construct download URLs:
  - Binary: `https://github.com/shaunburdick/token-count/releases/download/v$VERSION/token-count-$VERSION-$TARGET.tar.gz`
  - Checksums: `https://github.com/shaunburdick/token-count/releases/download/v$VERSION/checksums.txt`
- [ ] Create temp directory: `mktemp -d`
- [ ] Download archive with `curl -sSfL -o`
- [ ] Download checksums file
- [ ] Verify SHA256 checksum:
  - Extract expected hash for current platform from checksums.txt
  - Compute actual hash with `shasum -a 256` or `sha256sum`
  - Compare hashes (case-insensitive)
  - Error out if mismatch with clear message
- [ ] Clean up temp directory on exit (trap)

### TASK-204: Implement extraction and installation
**Effort**: 30 minutes  
**Dependencies**: TASK-203

- [ ] Extract archive: `tar xzf` in temp directory
- [ ] Locate binary: `token-count/token-count` (or `.exe` on Windows)
- [ ] Determine install directory:
  - Default: `$HOME/.local/bin` (create if doesn't exist)
  - Allow override with `$INSTALL_DIR` env var
  - Require `sudo` if installing to system paths
- [ ] Copy binary to install directory with `install -m 755`
- [ ] Verify binary is executable
- [ ] Test binary: `$INSTALL_DIR/token-count --version`

### TASK-205: Implement user feedback and PATH guidance
**Effort**: 20 minutes  
**Dependencies**: TASK-204

- [ ] Print success message with installed version and location
- [ ] Check if install directory is in `$PATH`
- [ ] If not in PATH, print instructions to add it:
  - Bash: `export PATH="$INSTALL_DIR:$PATH"` in `~/.bashrc`
  - Zsh: Add to `~/.zshrc`
  - Fish: `fish_add_path $INSTALL_DIR`
- [ ] Print next steps: "Run `token-count --help` to get started"

### TASK-206: Add error handling and logging
**Effort**: 30 minutes  
**Dependencies**: TASK-205

- [ ] Add `error()` function that prints to stderr and exits
- [ ] Add `info()` and `debug()` functions for user feedback
- [ ] Wrap all external commands with error checks
- [ ] Add meaningful error messages for common failures:
  - Network errors (curl failed)
  - Checksum mismatch (possible corruption or MITM)
  - Unsupported platform
  - Permission denied
- [ ] Add cleanup on error (remove partial installs)

### TASK-207: Test install script on 3 platforms
**Effort**: 45 minutes  
**Dependencies**: TASK-206

- [ ] Test on Ubuntu 22.04 (Docker or VM):
  - Fresh install
  - Version override: `./install.sh v0.1.0-test`
  - Custom install dir: `INSTALL_DIR=/tmp/test ./install.sh`
- [ ] Test on macOS Intel (if available)
- [ ] Test on macOS ARM64 (if available)
- [ ] Test error cases:
  - Invalid version
  - Corrupted checksum file
  - No internet connection
  - Permission denied
- [ ] Document any platform-specific quirks

**Phase 2 Deliverable**: Working `install.sh` script with platform detection, checksum verification, and clear error messages

---

## Phase 3: Homebrew Formula
**Status**: Not Started  
**Estimated Time**: 2-3 hours  
**Dependencies**: Phase 1 complete (need real release for checksums)

### TASK-300: Create Homebrew tap repository
**Effort**: 20 minutes  
**Dependencies**: None

- [ ] Create new GitHub repository: `shaunburdick/homebrew-tap`
- [ ] Initialize with README explaining purpose
- [ ] Create `Formula/` directory
- [ ] Add MIT LICENSE file
- [ ] Set repository description: "Homebrew tap for shaunburdick's tools"

### TASK-301: Generate initial formula skeleton
**Effort**: 15 minutes  
**Dependencies**: TASK-300

- [ ] Create `Formula/token-count.rb`
- [ ] Add formula class: `class TokenCount < Formula`
- [ ] Add metadata:
  - `desc "Count tokens for OpenAI API requests"`
  - `homepage "https://github.com/shaunburdick/token-count"`
  - `license "MIT"`

### TASK-302: Add download URL and SHA256
**Effort**: 30 minutes  
**Dependencies**: TASK-301, Phase 1 complete

- [ ] Get SHA256 hash for macOS ARM64 archive from latest release
- [ ] Add `url` pointing to GitHub release tarball:
  - `url "https://github.com/shaunburdick/token-count/archive/refs/tags/v0.1.0.tar.gz"`
- [ ] Add `sha256` hash
- [ ] Add `version "0.1.0"` (will be auto-updated)

### TASK-303: Implement installation logic
**Effort**: 45 minutes  
**Dependencies**: TASK-302

- [ ] Add `depends_on "rust" => :build` (compile from source approach)
- [ ] Implement `install` method:
  - `system "cargo", "install", "--locked", "--root", prefix, "--path", "."`
- [ ] Alternative approach (pre-built binary):
  - Detect platform and download appropriate binary
  - Use `on_macos` and `on_linux` blocks
  - Install binary directly: `bin.install "token-count"`
- [ ] Choose approach based on Homebrew best practices research
- [ ] Add post-install message (optional):
  - `caveats` block with getting started instructions

### TASK-304: Add test block
**Effort**: 20 minutes  
**Dependencies**: TASK-303

- [ ] Implement `test` method:
  - `assert_match "token-count #{version}", shell_output("#{bin}/token-count --version")`
  - Test basic functionality: `echo "test" | #{bin}/token-count`
  - Verify exit code is 0

### TASK-305: Test formula locally
**Effort**: 45 minutes  
**Dependencies**: TASK-304

- [ ] Install formula from local path:
  - `brew install --build-from-source ./Formula/token-count.rb`
- [ ] Verify installation: `which token-count`
- [ ] Test binary: `token-count --version`
- [ ] Test formula test: `brew test token-count`
- [ ] Uninstall: `brew uninstall token-count`
- [ ] Test from tap: `brew tap shaunburdick/tap && brew install token-count`
- [ ] Fix any issues found

### TASK-306: Set up Personal Access Token for auto-updates
**Effort**: 15 minutes  
**Dependencies**: None (can be done in parallel)

- [ ] Go to https://github.com/settings/tokens/new
- [ ] Create token with name: "Homebrew Tap Auto-Update"
- [ ] Select scopes: `repo` and `workflow`
- [ ] Generate token and copy to clipboard
- [ ] Add to token-count repository secrets:
  - Name: `HOMEBREW_TAP_TOKEN`
  - Value: <generated token>
- [ ] Document token purpose in repository (without exposing value)

### TASK-307: Test Homebrew auto-update workflow
**Effort**: 30 minutes  
**Dependencies**: TASK-106 (auto-update job in release.yml), TASK-306

- [ ] Create test release: `v0.1.0-test2`
- [ ] Verify auto-update job runs successfully
- [ ] Check homebrew-tap repository for automatic commit
- [ ] Verify formula was updated:
  - Version number changed
  - URL changed
  - SHA256 hash updated
- [ ] Test installing updated formula
- [ ] Document any issues for troubleshooting guide

**Phase 3 Deliverable**: Working Homebrew tap with auto-updating formula

---

## Phase 4: Cargo Publish Preparation
**Status**: Not Started  
**Estimated Time**: 1 hour  
**Dependencies**: None (can be done in parallel with other phases)

### TASK-400: Verify `Cargo.toml` metadata completeness
**Effort**: 20 minutes  
**Dependencies**: None

- [ ] Verify all required fields present:
  - [x] `name = "token-count"`
  - [x] `version = "0.1.0"`
  - [x] `authors = ["Shaun Burdick <hello@burdick.dev>"]`
  - [x] `edition = "2021"`
  - [x] `description` (descriptive, <140 chars)
  - [x] `license = "MIT"`
  - [x] `repository = "https://github.com/shaunburdick/token-count"`
  - [ ] `readme = "README.md"`
  - [ ] `keywords` (max 5, relevant to discovery)
  - [ ] `categories` (from crates.io categories list)
  - [ ] `homepage` (optional, same as repository)
  - [ ] `documentation` (optional, auto-generated from docs.rs)
- [ ] Verify fields follow crates.io guidelines
- [ ] Update if needed

### TASK-401: Add crate-level documentation
**Effort**: 20 minutes  
**Dependencies**: TASK-400

- [ ] Add `//!` doc comments to `src/main.rs` or `src/lib.rs`
- [ ] Include crate overview and purpose
- [ ] Add usage examples
- [ ] Document main features
- [ ] Test documentation: `cargo doc --open`

### TASK-402: Verify README and LICENSE
**Effort**: 10 minutes  
**Dependencies**: None

- [ ] Verify README.md exists and is comprehensive
- [ ] Verify LICENSE file exists (MIT)
- [ ] Check that license identifier in Cargo.toml matches LICENSE file
- [ ] Ensure no broken links in README

### TASK-403: Create crates.io account and get API token
**Effort**: 10 minutes  
**Dependencies**: None

- [ ] Go to https://crates.io/ and log in with GitHub
- [ ] Go to Account Settings → API Tokens
- [ ] Create new token: "token-count releases"
- [ ] Copy token (one-time display)
- [ ] Store securely in GitHub Actions secrets:
  - Name: `CARGO_REGISTRY_TOKEN`
  - Value: <generated token>

### TASK-404: Add cargo publish to release workflow
**Effort**: 20 minutes  
**Dependencies**: TASK-403

- [ ] Add new job `publish-crate` to `.github/workflows/release.yml`
- [ ] Runs only on: `if: startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')`
  - Excludes test tags like `v0.1.0-test`
- [ ] Steps:
  - Checkout code
  - Install Rust
  - Run `cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}`
- [ ] Handle idempotency (publishing same version twice fails)

### TASK-405: Dry-run cargo publish
**Effort**: 15 minutes  
**Dependencies**: TASK-401, TASK-402

- [ ] Run `cargo publish --dry-run`
- [ ] Review all files that would be published
- [ ] Verify no sensitive files included (check `.gitignore` and `Cargo.toml` `exclude`)
- [ ] Fix any warnings or errors
- [ ] Verify package size is reasonable (<10 MB)

**Phase 4 Deliverable**: `Cargo.toml` ready for crates.io publication, cargo publish job in workflow

---

## Phase 5: Documentation Updates
**Status**: Not Started  
**Estimated Time**: 1-2 hours  
**Dependencies**: Phases 1-4 complete (need to document actual working methods)

### TASK-500: Create `INSTALL.md`
**Effort**: 45 minutes  
**Dependencies**: None

- [ ] Create `INSTALL.md` in repository root
- [ ] Add sections:
  - **Overview**: Brief intro to installation options
  - **Quick Install (Recommended)**: curl|bash one-liner
  - **Homebrew (macOS/Linux)**: `brew install shaunburdick/tap/token-count`
  - **Cargo (Any Platform)**: `cargo install token-count`
  - **Manual Download**: Link to GitHub Releases with instructions
  - **Verification**: How to verify checksums manually
  - **Building from Source**: `cargo build --release` instructions
  - **Troubleshooting**: Common issues and solutions
  - **Uninstallation**: How to remove for each method
- [ ] Include platform-specific notes
- [ ] Add examples and expected output

### TASK-501: Update `README.md` installation section
**Effort**: 20 minutes  
**Dependencies**: TASK-500

- [ ] Update "Installation" section in README.md
- [ ] Add quick install one-liner prominently
- [ ] Link to full `INSTALL.md` for details
- [ ] Keep README focused on essentials (defer details to INSTALL.md)
- [ ] Add badges (optional):
  - Crates.io version
  - GitHub release version
  - License
  - Build status

### TASK-502: Update `CHANGELOG.md` for v0.1.0
**Effort**: 20 minutes  
**Dependencies**: None

- [ ] Add entry for v0.1.0 release
- [ ] List features from Feature 001 and 002:
  - **Added**: CLI with 4 OpenAI models
  - **Added**: Fuzzy model name matching
  - **Added**: Installation via Homebrew, cargo, install.sh
  - **Added**: GitHub Releases with pre-built binaries
  - **Added**: Comprehensive documentation
- [ ] Follow Keep a Changelog format
- [ ] Include date of release

### TASK-503: Update `CONTRIBUTING.md` with release process
**Effort**: 15 minutes  
**Dependencies**: None

- [ ] Add "Release Process" section
- [ ] Document steps for maintainers:
  1. Update version in `Cargo.toml`
  2. Update `CHANGELOG.md`
  3. Commit changes: `git commit -m "chore: bump version to X.Y.Z"`
  4. Create tag: `git tag vX.Y.Z`
  5. Push: `git push origin main --tags`
  6. Monitor GitHub Actions for release workflow
  7. Verify all installation methods work
  8. Announce release
- [ ] Document manual fallback if automation fails

### TASK-504: [P] Add security policy
**Effort**: 15 minutes  
**Dependencies**: None

- [ ] Create `SECURITY.md` in repository root
- [ ] Document supported versions
- [ ] Add security contact: hello@burdick.dev
- [ ] Request private disclosure for vulnerabilities
- [ ] Link to GitHub Security Advisories
- [ ] Mention supply chain security (checksums, signed releases)

### TASK-505: [P] Update repository description and topics
**Effort**: 10 minutes  
**Dependencies**: None

- [ ] Update GitHub repository description
- [ ] Add topics/tags:
  - `tokenizer`
  - `openai`
  - `cli`
  - `rust`
  - `tiktoken`
  - `token-counting`
- [ ] Ensure repository has clear About section

**Phase 5 Deliverable**: Complete documentation suite with `INSTALL.md`, updated README, CHANGELOG, CONTRIBUTING, and SECURITY

---

## Phase 6: Testing & Release
**Status**: Not Started  
**Estimated Time**: 2-3 hours  
**Dependencies**: Phases 1-5 complete

### TASK-600: End-to-end test matrix
**Effort**: 90 minutes  
**Dependencies**: All previous phases

Test all combinations:

#### Linux (x86_64-unknown-linux-gnu)
- [ ] **Install Script**: `curl -sSfL https://raw.githubusercontent.com/shaunburdick/token-count/main/install.sh | bash`
  - Verify binary installed to `~/.local/bin/token-count`
  - Test: `token-count --version`
  - Test: `echo "hello world" | token-count`
- [ ] **Manual Download**: Download `.tar.gz`, verify checksum, extract, run
- [ ] **Cargo**: `cargo install token-count` (after publishing)

#### macOS Intel (x86_64-apple-darwin)
- [ ] **Install Script**: Same as Linux
- [ ] **Homebrew**: `brew install shaunburdick/tap/token-count`
  - Verify: `which token-count``/opt/homebrew/bin/token-count` (ARM) or `/usr/local/bin/token-count` (Intel)
  - Test: `token-count --help`
- [ ] **Manual Download**: Download `.tar.gz`, verify checksum, extract, run
- [ ] **Cargo**: `cargo install token-count`

#### macOS ARM64 (aarch64-apple-darwin)
- [ ] All tests same as macOS Intel
- [ ] Verify binary is native ARM64 (not x86_64 running under Rosetta)

#### Windows (x86_64-pc-windows-msvc)
- [ ] **Manual Download**: Download `.zip`, verify checksum, extract, run
- [ ] **Cargo**: `cargo install token-count`
- [ ] Note: Install script not supported on Windows (document in INSTALL.md)

### TASK-601: Verify automation workflows
**Effort**: 30 minutes  
**Dependencies**: TASK-600

- [ ] Create release candidate tag: `v0.1.0-rc1`
- [ ] Verify GitHub Actions workflow succeeds:
  - All 4 platform builds complete
  - Binaries uploaded to draft release
  - Checksums.txt present and correct
  - Homebrew formula auto-updated (if not test tag)
  - Cargo publish skipped (contains `-` in tag)
- [ ] Download and test one binary manually
- [ ] Delete RC tag and release

### TASK-602: Security review
**Effort**: 30 minutes  
**Dependencies**: None

- [ ] Review install script for security issues:
  - No arbitrary code execution
  - HTTPS-only downloads
  - Checksum verification mandatory
  - Safe temp directory handling
  - Proper error handling
- [ ] Review GitHub Actions workflow:
  - No exposure of secrets in logs
  - Minimal permissions
  - Trusted actions only (official or well-known)
- [ ] Check for any hardcoded credentials or tokens
- [ ] Verify LICENSE and copyright notices

### TASK-603: Final documentation review
**Effort**: 20 minutes  
**Dependencies**: Phase 5 complete

- [ ] Proofread all documentation files
- [ ] Test all commands in documentation
- [ ] Verify all links are working
- [ ] Check for typos and formatting issues
- [ ] Ensure consistent terminology throughout

### TASK-604: Create official v0.1.0 release
**Effort**: 30 minutes  
**Dependencies**: TASK-600, TASK-601, TASK-602, TASK-603

- [ ] Update version in `Cargo.toml` to `0.1.0` (already set)
- [ ] Commit version bump if needed: `git commit -m "chore: release v0.1.0"`
- [ ] Create tag: `git tag v0.1.0`
- [ ] Push: `git push origin 002-installation --tags`
- [ ] Monitor GitHub Actions workflow
- [ ] Verify draft release is created successfully
- [ ] Review release notes
- [ ] Publish release (remove draft status)

### TASK-605: Verify all installation methods post-release
**Effort**: 30 minutes  
**Dependencies**: TASK-604

- [ ] Test install script: `curl -sSfL https://raw.githubusercontent.com/shaunburdick/token-count/main/install.sh | bash`
- [ ] Test Homebrew (wait ~5 min for auto-update):
  - `brew tap shaunburdick/tap`
  - `brew install token-count`
  - Verify version: `token-count --version``0.1.0`
- [ ] Test cargo install:
  - `cargo install token-count`
  - Verify version
- [ ] Test manual download from GitHub Releases
- [ ] Fix any issues immediately (hotfix if critical)

### TASK-606: Merge feature branch to main
**Effort**: 15 minutes  
**Dependencies**: TASK-605

- [ ] Create PR from `002-installation` to `main`
- [ ] Add PR description summarizing feature
- [ ] Self-review changes
- [ ] Merge PR (squash or merge commit, per project convention)
- [ ] Delete feature branch: `git branch -d 002-installation`
- [ ] Verify `main` branch is up to date

### TASK-607: Announce release
**Effort**: 20 minutes  
**Dependencies**: TASK-606

- [ ] Post announcement on GitHub Discussions (if enabled)
- [ ] Update personal website/blog (if applicable)
- [ ] Share on social media (optional):
  - Twitter/X with `#rustlang` hashtag
  - LinkedIn
  - Reddit r/rust (Show and Tell thread)
- [ ] Consider Hacker News Show HN post
- [ ] Update documentation sites (if any)

**Phase 6 Deliverable**: Official v0.1.0 release with all installation methods verified and working

---

## Summary

**Total Estimated Time**: 11-15 hours across 6 phases  
**Actual Time**: ~12 hours (across multiple days)  
**Total Tasks**: 71 tasks (all complete ✅)  
**Final Status**: Feature 002 successfully delivered - v0.1.0 released on 2026-03-14

**Deliverables**:
- ✅ Multi-platform GitHub Actions release workflow (Linux, macOS Intel/ARM, Windows)
- ✅ Automated Homebrew formula updates via GitHub Actions
- ✅ Published to crates.io (https://crates.io/crates/token-count)
- ✅ curl|bash installer with SHA256 verification
- ✅ Comprehensive documentation (INSTALL.md, SECURITY.md, CONTRIBUTING.md)
- ✅ Official v0.1.0 release: https://github.com/shaunburdick/token-count/releases/tag/v0.1.0

**Follow-up**: 
- Issue #1 created to track Node.js 24 action updates (deadline: June 2, 2026)