squad-kit 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,84 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.0] — 2026-04-24
11
+
12
+ ### Why this release
13
+
14
+ squad-kit 0.2.2 stabilised rate-limit handling with retries and a softer `squad doctor` warning.
15
+ That made failures loud but didn't reduce the underlying token spend: every planning turn
16
+ re-sent the cumulative transcript, so costs scaled roughly quadratically with the number of
17
+ tool calls. On Anthropic Tier 1 with Opus, that made non-trivial plans structurally infeasible.
18
+
19
+ 0.3.0 adds **prompt caching end-to-end** across Anthropic, OpenAI, and Google. Expected savings
20
+ on a typical 10-turn run: ~70% fewer billed input tokens, and — critically on Anthropic —
21
+ cached reads don't count the same against your per-minute quota. Tier 1 Opus users should find
22
+ moderate plans work where they previously hit 429 from turn 7 onward.
23
+
24
+ ### Added
25
+
26
+ - Anthropic explicit prompt caching via `cache_control: { type: 'ephemeral' }` on the system
27
+ prompt and the most recent tool-result block each turn (cache TTL rolls forward).
28
+ - OpenAI and Google implicit prefix caching (no config required; activated by the stable-prefix
29
+ refactor below).
30
+ - `planner.cache.enabled` config knob (default `true`). Configure via `squad config set planner`.
31
+ - Run-summary line: `cache hit 68% (22.4k read / 32.9k total)` every `squad new-plan --api` run.
32
+ - `squad doctor` now checks `planner cache effectiveness`, reading `.squad/.last-run.json`.
33
+ - `.squad/.last-run.json` persistence of planner run stats (git-ignored, per-user).
34
+ - `Usage.cacheCreationTokens` and `Usage.cacheReadTokens` on every provider response.
35
+ - Deterministic request-body builders (`buildAnthropicBody`, `buildOpenAIBody`, `buildGoogleBody`)
36
+ exposed for testing; dev-mode warning when a turn mutates the cacheable prefix.
37
+ - Copy-paste mode (`squad new-plan --copy`) now writes the composed prompt to
38
+ `.squad/.last-copy-prompt.md` and prints a compact summary (mode · story · file · size · est
39
+ tokens · clipboard status) instead of dumping the full 5–10 KB prompt into the terminal.
40
+ - Clipboard fallbacks for Linux (`xsel` in addition to `xclip`) and Termux
41
+ (`termux-clipboard-set`). Headless Linux / SSH sessions now surface an actionable reason in
42
+ the summary ("no display server detected — install xclip or xsel, or use the saved file")
43
+ instead of silently skipping.
44
+ - `squad config set planner` and `squad config set tracker` print a "▸ Next:" block so users
45
+ know what to run next (`squad doctor` → `squad new-story` → `squad new-plan`).
46
+ - `squad tracker link` and `squad migrate` also print "▸ Next:" guidance.
47
+ - Managed `.gitignore` block now covers `.squad/.last-run.json` and `.squad/.last-copy-prompt.md`.
48
+
49
+ ### Changed
50
+
51
+ - System prompt no longer embeds timestamps, random IDs, or absolute host paths (these
52
+ cache-busted the prefix on every turn).
53
+ - `squad doctor` Anthropic Tier 1 Opus warning softened from "you will hit ITPM" to "tight but
54
+ viable with caching on."
55
+ - `squad config set planner` no longer prompts for `planner.modelOverride`. The interactive
56
+ flow is shorter and less intimidating; power users can still set the override directly in
57
+ `.squad/config.yaml` (documented in `docs/customization.md`).
58
+ - `copyToClipboard()` now returns a structured `{ ok, tool?, reason? }` result instead of a
59
+ bare boolean, so callers can explain failures to the user.
60
+
61
+ ### Known limitations
62
+
63
+ - Google `cachedContents` explicit API not implemented (implicit caching is sufficient for
64
+ single-run CLI use).
65
+ - No cross-run persistence of cache stats yet — doctor only reads the most recent run.
66
+ - No automatic context compression when transcripts exceed ~50 KB. Caching helps but doesn't
67
+ solve the long-horizon case. 0.4.0 candidate.
68
+ - Anthropic 1-hour cache TTL (`ttl: "1h"`) not used — default 5-minute TTL covers single-run.
69
+
70
+ ### Migration
71
+
72
+ See `docs/migrating-from-0.1.md` §9 "Upgrading from 0.2.x to 0.3.0" for the full path. Short
73
+ version: `squad upgrade` and you're done. Caching is on by default; no config edits required.
74
+
75
+ ## [0.2.2] - 2026-04-22
76
+
77
+ ### Fixed
78
+
79
+ - **Rate-limit retry no longer burns a doomed request.** 0.2.1 capped the auto-retry wait at 30 s. When a provider asked for longer than that (common on Anthropic Tier 1, which regularly asks for 60–180 s), squad-kit would retry *inside the same throttle window* and fail a second time. 0.2.2:
80
+ - Raises the retry cap from 30 s to **90 s**, which comfortably covers the provider-suggested wait for most Tier 1 / free-tier 429s.
81
+ - **Skips the retry entirely** when `Retry-After` is longer than the 90 s cap, and surfaces a dedicated message explaining the decision (`squad-kit did not auto-retry: the provider's 132s wait is longer than our 90s cap, so retrying would just burn another request inside the same throttle window.`) instead of wasting a request and showing the "already retried" variant.
82
+
83
+ ### Added
84
+
85
+ - **`squad doctor` now reports planner tier vs. model awareness** (check id `planner-tier`). When `planner.provider === 'anthropic'` and the resolved plan model id contains `opus`, the check emits a **warn** with a fix hint suggesting `squad config set planner` to pick Sonnet or Haiku, which live in separate per-model rate-limit buckets on Anthropic Tier 1 (10 k input tokens / minute). For non-Anthropic providers and non-Opus models, the check is `skip` or `ok` — no noise for users who aren't affected.
86
+ - `rateLimitMessage` gained a `retrySkippedReason` + `maxRetrySec` field, so the error text can distinguish "we retried and got throttled again" (firm over-quota) from "we did not retry because your wait is longer than our cap" (retry would be pointless). Both cases still surface the same four recovery options.
87
+
10
88
  ## [0.2.1] - 2026-04-22
11
89
 
12
90
  ### Fixed
@@ -115,6 +193,9 @@ First public release.
115
193
  - Plan-generation meta-prompt (`generate-plan.md`), intake template (`intake.md`), and plan skeleton reference (`story-skeleton.md`).
116
194
  - Documentation: `docs/philosophy.md`, `docs/getting-started.md`, `docs/customization.md`, `docs/vs-spec-kit.md`.
117
195
 
118
- [Unreleased]: https://github.com/AzmSquad/squad-kit/compare/v0.2.0...HEAD
196
+ [Unreleased]: https://github.com/AzmSquad/squad-kit/compare/v0.3.0...HEAD
197
+ [0.3.0]: https://github.com/AzmSquad/Squad-Kit/releases/tag/v0.3.0
198
+ [0.2.2]: https://github.com/AzmSquad/squad-kit/compare/v0.2.1...v0.2.2
199
+ [0.2.1]: https://github.com/AzmSquad/squad-kit/compare/v0.2.0...v0.2.1
119
200
  [0.2.0]: https://github.com/AzmSquad/squad-kit/compare/v0.1.0...v0.2.0
120
201
  [0.1.0]: https://github.com/AzmSquad/squad-kit/releases/tag/v0.1.0
package/README.md CHANGED
@@ -1,11 +1,17 @@
1
- # squad-kit
1
+ <p align="center">
2
+ <a href="https://squad-kit.com">
3
+ <img src="https://squad-kit.com/logo-wordmark.svg?v=2" alt="squad-kit logo" width="360">
4
+ </a>
5
+ </p>
2
6
 
3
- [![npm version](https://img.shields.io/npm/v/squad-kit.svg)](https://www.npmjs.com/package/squad-kit)
4
- [![CI](https://github.com/AzmSquad/Squad-Kit/actions/workflows/ci.yml/badge.svg)](https://github.com/AzmSquad/Squad-Kit/actions/workflows/ci.yml)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6
- [![Website](https://img.shields.io/badge/site-squad--kit.netlify.app-7cffa0?labelColor=0a0a0c)](https://squad-kit.netlify.app)
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/squad-kit"><img src="https://img.shields.io/npm/v/squad-kit.svg" alt="npm version"></a>
9
+ <a href="https://github.com/AzmSquad/Squad-Kit/actions/workflows/ci.yml"><img src="https://github.com/AzmSquad/Squad-Kit/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
10
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
11
+ <a href="https://squad-kit.com"><img src="https://img.shields.io/badge/site-squad--kit.com-7cffa0?labelColor=0a0a0c" alt="Website"></a>
12
+ </p>
7
13
 
8
- **Plan once, execute cheap.** A 3-step SDD-style workflow CLI for AI-assisted coding: **raw story → good plan → implementation**. Your expensive model plans once. A cheap model executes many times. Squad-kit owns the folder conventions, the plan meta-prompt, and the agent slash-commands so the token cost goes where it pays off. Deeper product notes live on **[squad-kit.netlify.app](https://squad-kit.netlify.app)** and in [`docs/`](docs/philosophy.md).
14
+ **Plan once, execute cheap.** A 3-step SDD-style workflow CLI for AI-assisted coding: **raw story → good plan → implementation**. Your expensive model plans once. A cheap model executes many times. Squad-kit owns the folder conventions, the plan meta-prompt, and the agent slash-commands so the token cost goes where it pays off. Deeper product notes live on **[squad-kit.com](https://squad-kit.com)** and in [`docs/`](docs/philosophy.md).
9
15
 
10
16
  ```
11
17
  .squad/
@@ -13,6 +19,11 @@
13
19
  └── plans/<feature>/ # NN-story-<slug>.md (one per executable plan)
14
20
  ```
15
21
 
22
+ ## What's new in 0.3.0
23
+
24
+ - **Prompt caching** across Anthropic, OpenAI, and Google — ~70% fewer billed input tokens on
25
+ a typical planning run, and Anthropic Tier 1 ITPM pressure roughly 5× lower.
26
+
16
27
  ## What's new in 0.2.0
17
28
 
18
29
  - **Direct planner.** `squad new-plan --api` runs Anthropic, OpenAI, or Google from your terminal and writes the plan file. Demand-driven context keeps tokens bounded.
@@ -39,7 +50,7 @@ cd your-project && squad migrate
39
50
 
40
51
  `squad migrate` deletes the now-unused `.squad/prompts/` directory, appends the managed `.gitignore` block, tightens `.squad/secrets.yaml` permissions to `0600`, and normalises `.squad/config.yaml`. It is idempotent but destructive — run it with `--dry-run` first if you forked the prompt files.
41
52
 
42
- Full upgrade walkthrough, including what-if scenarios and how to recover customised prompts: [migration guide (repo)](docs/migrating-from-0.1.md) · [migration guide (site)](https://squad-kit.netlify.app/docs/migrating-from-0.1).
53
+ Full upgrade walkthrough, including what-if scenarios and how to recover customised prompts: [migration guide (repo)](docs/migrating-from-0.1.md) · [migration guide (site)](https://squad-kit.com/docs/migrating-from-0.1).
43
54
 
44
55
  ## Install
45
56
 
@@ -108,6 +119,8 @@ Override the default plan-phase model without editing squad-kit:
108
119
  planner:
109
120
  enabled: true
110
121
  provider: anthropic
122
+ cache:
123
+ enabled: true # default; turn off via squad config set planner
111
124
  modelOverride:
112
125
  anthropic: claude-opus-5-0 # riding a newer provider release early
113
126
  ```
@@ -165,6 +178,7 @@ See [`docs/philosophy.md`](docs/philosophy.md) for the token math and [`docs/vs-
165
178
  - **Quality depends on the planning model.** squad-kit has no safety-net commands. Use a strong model for `new-plan`.
166
179
  - **Plans are project-coupled.** They reference real file paths. That is the point — do not expect portability between projects.
167
180
  - **Global `NN` can collide on parallel branches.** Rebase-and-renumber is the resolution. Documented in [`docs/customization.md`](docs/customization.md).
181
+ - **Anthropic Tier 1 + Opus** shares a tight input-token-per-minute bucket. **0.3.0** enables prompt caching by default so typical multi-turn plans stay viable; see [Prompt caching](docs/customization.md#prompt-caching) in the customization docs.
168
182
 
169
183
  ## Non-goals for 0.2
170
184