agentic-sdlc-wizard 1.32.0 → 1.34.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.
@@ -13,7 +13,7 @@
13
13
  "name": "sdlc-wizard",
14
14
  "source": ".",
15
15
  "description": "SDLC enforcement for AI agents — TDD, planning, self-review, CI shepherd",
16
- "version": "1.31.0",
16
+ "version": "1.34.0",
17
17
  "author": {
18
18
  "name": "Stefan Ayala"
19
19
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdlc-wizard",
3
- "version": "1.31.0",
3
+ "version": "1.34.0",
4
4
  "description": "SDLC enforcement for AI agents — TDD, planning, self-review, CI shepherd",
5
5
  "author": {
6
6
  "name": "Stefan Ayala",
package/CHANGELOG.md CHANGED
@@ -4,6 +4,62 @@ All notable changes to the SDLC Wizard.
4
4
 
5
5
  > **Note:** This changelog is for humans to read. Don't manually apply these changes - just run the wizard ("Check for SDLC wizard updates") and it handles everything automatically.
6
6
 
7
+ ## [1.34.0] - 2026-04-17
8
+
9
+ ### Added
10
+ - Memory Audit Protocol for promoting private-memory lessons to shared docs (#189)
11
+ - New `/sdlc` subsection under "After Session (Capture Learnings)" defines a three-bucket classifier (`promote` / `keep` / `manual-review`) with a rule-based privacy denylist (`type: user`/`reference` → keep, `project`/`feedback` → manual-review)
12
+ - YAML frontmatter parser in `tests/test-memory-audit-protocol.sh` normalizes inline comments, quoted values, and whitespace so variants like `type: "user" # external` still route to keep
13
+ - `SDLC.md` now has a `## Lessons Learned` section seeded with 7 verified technical gotchas (GH CLI stdout, `workflows` YAML scope, GITHUB_TOKEN workflow triggers, GHA `${{ }}` backtick substitution, macOS bash 3.x, stderr/stdout separation for JSON parsing, `continue-on-error` + `||` masking); each entry cites its originating PR or incident date and was re-verified with a runnable repro before promotion
14
+ - 10-fixture corpus at `tests/fixtures/memory-audit-corpus/` (6 promote / 2 keep / 2 manual-review) with `test_expected` frontmatter seeds the future LLM-gated quality runner
15
+ - 12-test protocol suite covers structure, rule-based denylist, YAML-variant hardening, corpus consistency (promote fixtures route to manual-review under rule-based), and corpus shape
16
+ - Codex xhigh 3-round code review: 4/10 → 8/10 → 10/10 CERTIFIED. Caught two false lessons in private memory (`${3:-{}}` brace-default claim and `--argjson result` jq-conflict claim) that were retracted with dated strikethroughs — the protocol's first real use prevented its own false claims from shipping
17
+ - CLI distributes skill updates + new SDLC.md section; CI wire-up in `.github/workflows/ci.yml` (validate job)
18
+ - API feature detection shepherd for Claude API release notes (#100, PRs #184, #186, #187)
19
+ - LLM-free weekly detector at `.github/workflows/weekly-api-update.yml` polls `platform.claude.com/docs/en/release-notes/api.md`
20
+ - `scripts/parse-api-changelog.py` parses ATX date headers with ordinal-date normalizer and bullet-summary capture (non-date sub-headers like `#### SDKs` no longer terminate bullet extraction); 200-char truncation with ellipsis; tab scrub
21
+ - `scripts/persist-api-state.sh` writes last-seen date with branch-protection-safe non-blocking push; opens/updates a single `api-review-needed` tracking issue with enriched bullet summaries (not just dates)
22
+ - `instructions-loaded-check.sh` nudges at session start when open issues exist; gated on local workflow presence so consumer forks see only their own detector's issues
23
+ - 33 tests including 8 fixture-based parser tests (bullet capture, subheader boundary, tab scrub, truncation, ordinal dates) and 2 integration tests
24
+ - Codex xhigh 5 rounds across 2 PRs: 9/10 CERTIFIED. Found-in-prod P0 hotfix in #187 — `gh api` writes JSON error bodies to stdout (not stderr), so the label-create `already_exists` check was broken after the first successful dispatch; pattern now captures both streams
25
+
26
+ ### Fixed
27
+ - `gh api` error handling in `weekly-api-update.yml` now captures stdout+stderr together for `already_exists` detection on label creation (#187). Added as portable lesson in `SDLC.md` Lessons Learned
28
+
29
+ ### Docs
30
+ - `/less-permission-prompts` Claude Code native skill surfaced in wizard and setup documentation (#183)
31
+ - README community section restyled with visual Discord badge for Automation Station
32
+
33
+ ## [1.33.0] - 2026-04-17
34
+
35
+ ### Added
36
+ - `opus[1m]` as the SDLC wizard default model (#182)
37
+ - CLI template ships `"model": "opus[1m]"` + `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` (tuned for 1M — compacts at ~300K)
38
+ - `cli/init.js` `mergeSettings` merges top-level `model` on fresh installs and when absent; respects user's explicit choice; `--force` overwrites
39
+ - Wizard doc "1M vs 200K Context Window" section flipped to recommend `opus[1m]` as default; pricing framed as "verify current rates at docs.anthropic.com" (no stale tier-specific claims)
40
+ - `/sdlc` skill: new "Recommended Model" section between auto-approval and Confidence Check
41
+ - `/setup` skill Step 9.5: 1M default, 200K fallback (inverted from before)
42
+ - SDLC.md baseline bumped to v2.1.111+ (Opus 4.7 minimum)
43
+ - Session-start hooks now recommend `opus[1m]` alias (matches the `/model` command users run)
44
+ - 9 new tests (5 CLI model merge, 4 doc consistency); 6 existing autocompact tests updated to expect `30`, fixtures bumped to `50` in tests 37/38 to preserve the no-overwrite proof
45
+ - Codex xhigh 2-round review: 9/10 CERTIFIED
46
+ - Dual-channel install drift guardrails (#181)
47
+ - `cli/init.js` detects plugin install paths (`~/.claude/plugins-local/sdlc-wizard-wrap/`, `~/.claude/plugins/cache/sdlc-wizard-local/`) and blocks init with a typed `err.pluginPaths` error; `--force` bypasses
48
+ - `instructions-loaded-check.sh` non-blocking nudge when both CLI skills and Claude plugin are present in the same project
49
+ - HOME isolation in test files (`mktemp -d` + `trap` cleanup) prevents dev-machine HOME from leaking into assertions
50
+ - `path.isAbsolute(home)` guard in `detectPluginInstall` — empty/relative HOME no longer causes false-positive block
51
+ - `run_init_split` test helper captures stdout/stderr separately with explicit exit code
52
+ - 9 new CLI tests, 5 new hook tests; Codex xhigh 4-round review: 9/10 CERTIFIED
53
+ - Model/effort upgrade detection at session start (#179, #180)
54
+ - SessionStart hook nudges when configured `effortLevel` is below `xhigh` recommendation
55
+ - Reads `.claude/settings.local.json` → `.claude/settings.json` → `$HOME/.claude/settings.json` precedence
56
+ - Non-blocking (`exit 0`); asks Claude to compare recommended model against its own system prompt
57
+ - `claude-opus-4-6` defaults bumped to `claude-opus-4-7` in `pr-review.yml`, `evaluate.sh`, `sdp-score.sh`, `pairwise-compare.sh`
58
+ - Hook added to `SDLC.md` hooks table + CLI distributes `model-effort-check.sh`
59
+
60
+ ### Fixed
61
+ - `cli/bin/sdlc-wizard.js` double-print: plugin-detect errors now suppress the outer `"Error:"` prefix since detection streams its own colored guidance block (#181)
62
+
7
63
  ## [1.32.0] - 2026-04-16
8
64
 
9
65
  ### Added
@@ -855,30 +855,31 @@ Override the default auto-compact threshold with environment variables. These ar
855
855
  | `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` | Trigger compaction at this % of context capacity (1-100) | ~95% |
856
856
  | `CLAUDE_CODE_AUTO_COMPACT_WINDOW` | Override context capacity in tokens (useful for 1M models) | Model default |
857
857
 
858
- **Recommended:** The SDLC Wizard CLI sets `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=75` in `.claude/settings.json` by default (200K model optimized). To customize, edit the `env` field in `.claude/settings.json`:
858
+ **Recommended:** The SDLC Wizard CLI sets `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` and `"model": "opus[1m]"` in `.claude/settings.json` by default (tuned for the 1M context window — compacts at ~300K). To customize, edit `.claude/settings.json`:
859
859
 
860
860
  ```json
861
861
  {
862
+ "model": "opus[1m]",
862
863
  "env": {
863
- "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
864
+ "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "30"
864
865
  }
865
866
  }
866
867
  ```
867
868
 
868
- Alternatively, set via shell profile (`~/.bashrc`, `~/.zshrc`) or per-project `.envrc`:
869
+ If you switch back to the 200K model (`opus`), raise the override to `75` — otherwise 30% of 200K = 60K compacts too early. Alternatively, set via shell profile (`~/.bashrc`, `~/.zshrc`) or per-project `.envrc`:
869
870
 
870
871
  ```bash
871
- export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=75
872
+ export CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30
872
873
  ```
873
874
 
874
875
  **Community-recommended thresholds by use case:**
875
876
 
876
877
  | Use Case | AUTOCOMPACT % | Why |
877
878
  |----------|--------------|-----|
878
- | General development (200K) | 75% | Leaves room for implementation after planning |
879
- | Complex refactors (200K) | 80% | Slightly more context before compaction |
879
+ | **SDLC default (`opus[1m]`)** | **30%** | **Fires at ~300K on 1M — right balance for plan + TDD + review sessions** |
880
+ | General development (200K `opus`) | 75% | Leaves room for implementation after planning |
881
+ | Complex refactors (200K `opus`) | 80% | Slightly more context before compaction |
880
882
  | CI pipelines | 60% | Short tasks, compact early to stay fast |
881
- | 1M context model | 30% | See "1M vs 200K" below — 95% on 1M wastes budget |
882
883
  | Short tasks | 60-70% | Less context needed, compact early |
883
884
 
884
885
  **Important:** Values above the default ~95% threshold have no effect — you can only trigger compaction *earlier*, not later. Noise (progress ticks, thinking blocks, stale reads) makes up 50-70% of session tokens, so threshold tuning matters less than noise reduction (scoped reads, subagents, `/compact` between phases).
@@ -891,27 +892,31 @@ The thresholds above are community consensus — not empirically validated. For
891
892
 
892
893
  ### 1M vs 200K Context Window
893
894
 
894
- Claude Code supports both 200K and 1M context windows. Choose based on your task:
895
+ Claude Code supports both 200K and 1M context windows. **Default to `opus[1m]` for SDLC work** — the 1M headroom is free until you actually use it.
895
896
 
896
- | | 200K Context | 1M Context |
897
+ | | 200K Context (`opus`) | 1M Context (`opus[1m]`) **← default** |
897
898
  |---|---|---|
898
- | **Best for** | Normal SDLC cycles (plan TDD review) | Multi-feature releases, deep codebase exploration |
899
- | **Typical usage** | 50-80K tokens per task | 200K+ tokens for complex workflows |
900
- | **Cost** | Lower total cost per session | ~5x more tokens consumed (cost scales linearly) |
901
- | **Auto-compact** | Default 95% works well | Reported to fire at ~76K ([issue #34332](https://github.com/anthropics/claude-code/issues/34332)) |
899
+ | **Best for** | Short one-off tasks | Normal SDLC cycles + multi-feature work |
900
+ | **Typical usage** | 50-80K tokens per task | 50-80K typical, up to 200K+ for complex workflows |
901
+ | **Cost** | Standard pricing | Anthropic currently lists the 1M window at standard pricing across the full context for supported Opus/Sonnet models — **verify current rates at [docs.anthropic.com/pricing](https://docs.anthropic.com/)** before assuming no premium |
902
+ | **Auto-compact** | Default 95% works well | Fires at ~76K by default ([issue #34332](https://github.com/anthropics/claude-code/issues/34332)) — **tune to 30%** |
902
903
  | **Suggested override** | `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=75` | `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` or `CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000` |
903
904
 
904
- **Default to 200K.** Normal SDLC tasks (single feature, bug fix, refactor) rarely exceed 80K tokens. The 200K window handles this with room to spare.
905
+ **Why `opus[1m]` as default:**
906
+ - **Long SDLC sessions accumulate context fast** — plan → TDD → review → CI shepherd on a single feature regularly crosses 100K tokens
907
+ - **Safety margin against autocompact loss** — cheaper to have headroom than to re-read files after a forced compact
908
+ - **At time of writing, Anthropic lists 1M context at standard pricing for supported Opus/Sonnet models.** Verify current rates for your plan before relying on this — see [docs.anthropic.com/pricing](https://docs.anthropic.com/)
905
909
 
906
- **Switch to 1M when:**
907
- - Implementing multiple related features in one session
908
- - Deep research across a large codebase (reading 20+ files)
909
- - Multi-agent workflows that accumulate context
910
- - Complex debugging sessions that need full history
910
+ **Set it up:** `/model opus[1m]` in your session, or set `"model": "opus[1m]"` in `.claude/settings.json`. The CLI template ships with this default. Requires Claude Code v2.1.111+ for Opus 4.7.
911
911
 
912
- **Cost awareness:** No per-token premium since March 2026, but total cost scales linearly with context consumed. A 900K-token session costs ~$4.50 in input alone. Use `/cost` to monitor.
912
+ **Fall back to `opus` (200K) when:**
913
+ - Your plan or organization charges higher rates for long-context prompts (check your billing)
914
+ - You're doing genuinely short one-off tasks and want slightly faster responses
915
+ - Your team has cost controls that flag >200K prompts
913
916
 
914
- **1M autocompact workaround:** On 1M models, the default auto-compact has been reported to fire too early (~76K, per [issue #34332](https://github.com/anthropics/claude-code/issues/34332)). Community workaround: set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` or `CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000` to use more of the window.
917
+ **Cost awareness:** Larger windows let you consume more tokens in one session, and total cost always scales with tokens consumed regardless of tier. Use `/cost` to monitor — a 900K-token session is meaningfully more expensive than an 80K one even at standard rates.
918
+
919
+ **Autocompact pairing (important):** If you default to `opus[1m]`, also set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` — otherwise CC's default autocompact fires at ~76K and destroys the headroom you're paying for. The CLI template sets this automatically.
915
920
 
916
921
  ---
917
922
 
@@ -2657,7 +2662,7 @@ If deployment fails or post-deploy verification catches issues:
2657
2662
 
2658
2663
  **SDLC.md:**
2659
2664
  ```markdown
2660
- <!-- SDLC Wizard Version: 1.31.0 -->
2665
+ <!-- SDLC Wizard Version: 1.34.0 -->
2661
2666
  <!-- Setup Date: [DATE] -->
2662
2667
  <!-- Completed Steps: step-0.1, step-0.2, step-0.4, step-1, step-2, step-3, step-4, step-5, step-6, step-7, step-8, step-9 -->
2663
2668
  <!-- Git Workflow: [PRs or Solo] -->
@@ -3130,6 +3135,8 @@ Want me to file these? (yes/no/not now)
3130
3135
 
3131
3136
  **`/revise-claude-md` scope:** Only updates CLAUDE.md. It does NOT touch feature docs, TESTING.md, hooks, or skills. Use it for general project context that applies across the codebase.
3132
3137
 
3138
+ **Memory Audit Protocol:** Per-user memory at `~/.claude/projects/<proj>/memory/` accumulates private learnings. Some are portable technical lessons that belong in shared docs. The `/sdlc` skill's **Memory Audit Protocol** section (under "After Session (Capture Learnings)") defines a three-bucket classifier (`promote` / `keep` / `manual-review`) with a type-based denylist that keeps `user`/`reference` entries private and routes `project`/`feedback` entries to human review. Run at end-of-release or after debugging-heavy sessions. Human approves every promotion chunk-by-chunk before apply.
3139
+
3133
3140
  **When to do mini-retro:** After features, tricky bugs, or discovering gotchas. Skip for one-line fixes or questions.
3134
3141
 
3135
3142
  **The SDLC evolves:** Weekly research, monthly deep-dives, and CI friction signals feed improvements. Human approves, the system gets better.
@@ -3716,7 +3723,7 @@ Walk through updates? (y/n)
3716
3723
  Store wizard state in `SDLC.md` as metadata comments (invisible to readers, parseable by Claude):
3717
3724
 
3718
3725
  ```markdown
3719
- <!-- SDLC Wizard Version: 1.31.0 -->
3726
+ <!-- SDLC Wizard Version: 1.34.0 -->
3720
3727
  <!-- Setup Date: 2026-01-24 -->
3721
3728
  <!-- Completed Steps: step-0.1, step-0.2, step-1, step-2, step-3, step-4, step-5, step-6, step-7, step-8, step-9 -->
3722
3729
  <!-- Git Workflow: PRs -->
@@ -4055,6 +4062,23 @@ When Anthropic provides official plugins that overlap with this SDLC:
4055
4062
 
4056
4063
  **Re-run `claude-code-setup` periodically** (quarterly, or when your project expands in scope) to catch new automations — MCP servers, hooks, subagents — that weren't relevant at initial setup but are now.
4057
4064
 
4065
+ **API feature shepherd (self-maintenance, roadmap #100):**
4066
+
4067
+ The wizard watches the **Anthropic API changelog** — not just Claude Code CLI releases — for new betas, tools, and agent features. The detector runs in `.github/workflows/weekly-api-update.yml`, is intentionally LLM-free, and only opens a tracking issue labeled `api-review-needed` when new entries appear at `platform.claude.com/docs/en/release-notes/api`.
4068
+
4069
+ When that issue is open, the session-start hook nudges you. The session (not the workflow) does the deep research + adoption via the full SDLC loop. This mirrors the "local shepherd" pattern used for CI fixes: cheap Action-layer detection + session-time analysis beats expensive Action-layer LLM calls.
4070
+
4071
+ The gap this closes: the advisor tool (API beta, `advisor-tool-2026-03-01`) shipped and was missed for several days before manual discovery. Detector would have flagged it on the next weekly tick.
4072
+
4073
+ **Complementary native skills worth knowing:**
4074
+
4075
+ | Native Skill | What It Does | When to Run |
4076
+ |--------------|--------------|-------------|
4077
+ | `/less-permission-prompts` | Scans transcripts for common read-only Bash/MCP calls and proposes a prioritized allowlist | After a few sessions — reduces permission friction without auto mode |
4078
+ | `/permissions` | Pre-allow specific commands and check them into `.claude/settings.json` | Anytime you want an auditable team allowlist |
4079
+
4080
+ These are shipped by Claude Code itself. The wizard doesn't reimplement them — it points you at them so you benefit from the native version's ongoing maintenance.
4081
+
4058
4082
  ### When Claude Code Improves
4059
4083
 
4060
4084
  Claude Code is actively improving. When they add built-in features:
package/README.md CHANGED
@@ -237,7 +237,17 @@ This isn't the only Claude Code SDLC tool. Here's an honest comparison:
237
237
 
238
238
  ## Community
239
239
 
240
- Come join **[Automation Station](https://discord.com/invite/fGPEF7GHrF)** — a community Discord packed with software engineers bringing 40+ years of combined experience across every area of the stack (frontend, backend, infra, embedded, data, QA, DevOps, you name it). Share patterns, ask questions, compare notes on AI agents, automation, and SDLC tooling.
240
+ <div align="center">
241
+
242
+ [![Discord](https://img.shields.io/badge/Discord-Automation%20Station-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.com/invite/fGPEF7GHrF)
243
+
244
+ **[Automation Station](https://discord.com/invite/fGPEF7GHrF)** — a community Discord packed with software engineers bringing 40+ years of combined experience across every area of the stack.
245
+
246
+ _Frontend · Backend · Infra · Embedded · Data · QA · DevOps_
247
+
248
+ Share patterns, ask questions, compare notes on AI agents, automation, and SDLC tooling.
249
+
250
+ </div>
241
251
 
242
252
  ## Contributing
243
253
 
@@ -42,7 +42,9 @@ if (command === 'init') {
42
42
  init(process.cwd(), flags);
43
43
  process.exit(0);
44
44
  } catch (err) {
45
- console.error(`Error: ${err.message}`);
45
+ // Plugin-detect errors already streamed a colored guidance block to stderr
46
+ // from init() — skip the redundant "Error:" prefix line.
47
+ if (!err.pluginPaths) console.error(`Error: ${err.message}`);
46
48
  process.exit(1);
47
49
  }
48
50
  } else if (command === 'check') {
package/cli/init.js CHANGED
@@ -23,6 +23,7 @@ const FILES = [
23
23
  { src: 'hooks/sdlc-prompt-check.sh', dest: '.claude/hooks/sdlc-prompt-check.sh', executable: true, base: REPO_ROOT },
24
24
  { src: 'hooks/tdd-pretool-check.sh', dest: '.claude/hooks/tdd-pretool-check.sh', executable: true, base: REPO_ROOT },
25
25
  { src: 'hooks/instructions-loaded-check.sh', dest: '.claude/hooks/instructions-loaded-check.sh', executable: true, base: REPO_ROOT },
26
+ { src: 'hooks/model-effort-check.sh', dest: '.claude/hooks/model-effort-check.sh', executable: true, base: REPO_ROOT },
26
27
  { src: 'skills/sdlc/SKILL.md', dest: '.claude/skills/sdlc/SKILL.md', base: REPO_ROOT },
27
28
  { src: 'skills/setup/SKILL.md', dest: '.claude/skills/setup/SKILL.md', base: REPO_ROOT },
28
29
  { src: 'skills/update/SKILL.md', dest: '.claude/skills/update/SKILL.md', base: REPO_ROOT },
@@ -35,6 +36,23 @@ const WIZARD_HOOK_MARKERS = FILES
35
36
 
36
37
  const GITIGNORE_ENTRIES = ['.claude/plans/', '.claude/settings.local.json'];
37
38
 
39
+ // Paths where the Claude plugin form of this wizard installs.
40
+ // If present, running `npx init` creates duplicate /update-wizard (#181).
41
+ const PLUGIN_INSTALL_PATHS = [
42
+ '.claude/plugins-local/sdlc-wizard-wrap',
43
+ '.claude/plugins/cache/sdlc-wizard-local',
44
+ ];
45
+
46
+ function detectPluginInstall(homeDir) {
47
+ const home = homeDir || os.homedir();
48
+ // Guard empty / non-absolute HOME: without this, path.join('', '.claude/...')
49
+ // produces a project-relative path and init falsely blocks on local dirs.
50
+ if (!home || !path.isAbsolute(home)) return [];
51
+ return PLUGIN_INSTALL_PATHS
52
+ .map((rel) => path.join(home, rel))
53
+ .filter((p) => fs.existsSync(p));
54
+ }
55
+
38
56
  // Paths from previous versions that should be removed on upgrade
39
57
  const OBSOLETE_PATHS = [
40
58
  '.claude/skills/testing', // consolidated into /sdlc in v1.17.0
@@ -52,6 +70,13 @@ function mergeSettings(existingPath, templatePath, force) {
52
70
  const existing = JSON.parse(fs.readFileSync(existingPath, 'utf8'));
53
71
  const template = JSON.parse(fs.readFileSync(templatePath, 'utf8'));
54
72
 
73
+ // Merge top-level model field (only set if missing, unless --force).
74
+ // Respects user's explicit model choice; adds the wizard default on fresh
75
+ // installs and for users upgrading from a pre-model template.
76
+ if (template.model && (!('model' in existing) || force)) {
77
+ existing.model = template.model;
78
+ }
79
+
55
80
  // Merge env field
56
81
  if (template.env) {
57
82
  if (!existing.env || typeof existing.env !== 'object' || Array.isArray(existing.env)) {
@@ -201,6 +226,24 @@ function printOps(ops) {
201
226
  }
202
227
 
203
228
  function init(targetDir, { force = false, dryRun = false } = {}) {
229
+ if (!dryRun && !force) {
230
+ const pluginPaths = detectPluginInstall();
231
+ if (pluginPaths.length > 0) {
232
+ console.error(`\n${YELLOW}Claude plugin install detected:${RESET}`);
233
+ for (const p of pluginPaths) console.error(` ${p}`);
234
+ console.error('\nInstalling via npm on top of the plugin creates duplicate /update-wizard commands.');
235
+ console.error('Pick one channel:');
236
+ console.error(` - Keep plugin: exit and use ${CYAN}/plugin update sdlc-wizard${RESET}`);
237
+ console.error(` - Switch to CLI: remove plugin dir above, then rerun ${CYAN}init${RESET}`);
238
+ console.error(` - Keep both: rerun with ${CYAN}--force${RESET} (duplicates expected)\n`);
239
+ const err = new Error(
240
+ `Plugin install detected at: ${pluginPaths.join(', ')}. Use --force to bypass.`
241
+ );
242
+ err.pluginPaths = pluginPaths;
243
+ throw err;
244
+ }
245
+ }
246
+
204
247
  const ops = planOperations(targetDir, { force });
205
248
 
206
249
  if (dryRun) {
@@ -408,4 +451,4 @@ function checkMarketplacePaths() {
408
451
  return results;
409
452
  }
410
453
 
411
- module.exports = { init, check, planOperations, GITIGNORE_ENTRIES };
454
+ module.exports = { init, check, planOperations, detectPluginInstall, GITIGNORE_ENTRIES };
@@ -1,6 +1,7 @@
1
1
  {
2
+ "model": "opus[1m]",
2
3
  "env": {
3
- "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
4
+ "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "30"
4
5
  },
5
6
  "hooks": {
6
7
  "UserPromptSubmit": [
@@ -34,6 +35,16 @@
34
35
  }
35
36
  ]
36
37
  }
38
+ ],
39
+ "SessionStart": [
40
+ {
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/model-effort-check.sh"
45
+ }
46
+ ]
47
+ }
37
48
  ]
38
49
  }
39
50
  }
package/hooks/hooks.json CHANGED
@@ -32,6 +32,16 @@
32
32
  }
33
33
  ]
34
34
  }
35
+ ],
36
+ "SessionStart": [
37
+ {
38
+ "hooks": [
39
+ {
40
+ "type": "command",
41
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/model-effort-check.sh"
42
+ }
43
+ ]
44
+ }
35
45
  ]
36
46
  }
37
47
  }
@@ -66,6 +66,61 @@ if command -v codex > /dev/null 2>&1 && [ -d "$PROJECT_DIR/.reviews" ]; then
66
66
  fi
67
67
  fi
68
68
 
69
+ # Model/effort upgrade check (non-blocking, best-effort)
70
+ RECOMMENDED_MODEL="opus[1m]"
71
+ RECOMMENDED_EFFORT="xhigh"
72
+ if command -v jq > /dev/null 2>&1; then
73
+ EFFORT=""
74
+ PROJ="${CLAUDE_PROJECT_DIR:-$PROJECT_DIR}"
75
+ for f in "$PROJ/.claude/settings.local.json" "$PROJ/.claude/settings.json" "$HOME/.claude/settings.json"; do
76
+ if [ -f "$f" ]; then
77
+ val=$(jq -r '.effortLevel // empty' "$f" 2>/dev/null)
78
+ if [ -n "$val" ]; then EFFORT="$val"; break; fi
79
+ fi
80
+ done
81
+ if [ -n "$EFFORT" ] && [ "$EFFORT" != "$RECOMMENDED_EFFORT" ]; then
82
+ echo "Upgrade available: effort $EFFORT → $RECOMMENDED_EFFORT (run: /effort $RECOMMENDED_EFFORT)"
83
+ echo "Recommended model: $RECOMMENDED_MODEL (run: /model $RECOMMENDED_MODEL)"
84
+ fi
85
+ fi
86
+
87
+ # Dual-channel install check (#181) — nudge when CLI skills + Claude plugin both present
88
+ if [ -d "$PROJECT_DIR/.claude/skills/update" ]; then
89
+ for plugin_path in "$HOME/.claude/plugins-local/sdlc-wizard-wrap" "$HOME/.claude/plugins/cache/sdlc-wizard-local"; do
90
+ if [ -d "$plugin_path" ]; then
91
+ echo "WARNING: dual-install detected — CLI skills in .claude/skills/ AND Claude plugin at:"
92
+ echo " $plugin_path"
93
+ echo " Duplicate /update-wizard commands come from running both channels. Pick one:"
94
+ echo " - Keep plugin: remove .claude/skills/ from this project"
95
+ echo " - Keep CLI: /plugin uninstall sdlc-wizard (or remove plugin dir)"
96
+ break
97
+ fi
98
+ done
99
+ fi
100
+
101
+ # API feature review nudge (#100) — surface open 'api-review-needed' issues
102
+ # opened by .github/workflows/weekly-api-update.yml so the session picks up
103
+ # new API features without waiting for manual discovery.
104
+ #
105
+ # Gated on LOCAL presence of the detector workflow: the CLI distributes this
106
+ # hook to consumer projects, and we don't want to pester those users with
107
+ # upstream-wizard issues. The nudge only fires when the current repo owns
108
+ # the detector (= the wizard repo or a fork of it).
109
+ if [ -f "$PROJECT_DIR/.github/workflows/weekly-api-update.yml" ] && \
110
+ command -v gh > /dev/null 2>&1; then
111
+ # Query the current repo (not hardcoded upstream) — in a fork, users see
112
+ # their own detector's issues, not ours.
113
+ API_REVIEW_COUNT=$(gh issue list \
114
+ --state open \
115
+ --label "api-review-needed" \
116
+ --limit 1 \
117
+ --json number \
118
+ --jq 'length' 2>/dev/null) || API_REVIEW_COUNT=""
119
+ if [[ "$API_REVIEW_COUNT" =~ ^[0-9]+$ ]] && [ "$API_REVIEW_COUNT" -gt 0 ]; then
120
+ echo "Anthropic API features pending review: ${API_REVIEW_COUNT} open issue(s) with label 'api-review-needed' (see .github/workflows/weekly-api-update.yml)"
121
+ fi
122
+ fi
123
+
69
124
  # Claude Code version check (non-blocking, best-effort)
70
125
  if command -v claude > /dev/null 2>&1 && command -v npm > /dev/null 2>&1; then
71
126
  CC_LOCAL=$(claude --version 2>/dev/null | grep -o '[0-9][0-9.]*' | head -1) || true
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # SessionStart hook — nudges user when effort level is below recommended
3
+ # and tells Claude the recommended model so it can compare against its own
4
+ # CC does NOT expose the model to hooks, so model nudge relies on Claude
5
+ # seeing this output and comparing against its system prompt
6
+ # Non-blocking: always exits 0
7
+
8
+ RECOMMENDED_MODEL="opus[1m]"
9
+ RECOMMENDED_EFFORT="xhigh"
10
+
11
+ # Drain stdin (SessionStart sends JSON but model field isn't in it)
12
+ cat > /dev/null
13
+
14
+ if ! command -v jq > /dev/null 2>&1; then
15
+ exit 0
16
+ fi
17
+
18
+ effort=""
19
+ project_dir="${CLAUDE_PROJECT_DIR:-.}"
20
+ for f in "$project_dir/.claude/settings.local.json" "$project_dir/.claude/settings.json" "$HOME/.claude/settings.json"; do
21
+ if [ -f "$f" ]; then
22
+ val=$(jq -r '.effortLevel // empty' "$f" 2>/dev/null)
23
+ if [ -n "$val" ]; then
24
+ effort="$val"
25
+ break
26
+ fi
27
+ fi
28
+ done
29
+
30
+ nudge=""
31
+
32
+ if [ -n "$effort" ] && [ "$effort" != "$RECOMMENDED_EFFORT" ]; then
33
+ nudge="effort: $effort → $RECOMMENDED_EFFORT (run: /effort $RECOMMENDED_EFFORT)"
34
+ fi
35
+
36
+ if [ -n "$nudge" ]; then
37
+ echo "Upgrade available:"
38
+ echo " $nudge"
39
+ echo " recommended model: $RECOMMENDED_MODEL (run: /model $RECOMMENDED_MODEL)"
40
+ echo " (Claude: compare recommended model against your current model — nudge user if different)"
41
+ fi
42
+
43
+ exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-sdlc-wizard",
3
- "version": "1.32.0",
3
+ "version": "1.34.0",
4
4
  "description": "SDLC enforcement for Claude Code — hooks, skills, and wizard setup in one command",
5
5
  "bin": {
6
6
  "sdlc-wizard": "./cli/bin/sdlc-wizard.js"
@@ -161,6 +161,21 @@ When auto-approving, still announce your approach — just don't wait for approv
161
161
 
162
162
  **When in doubt, wait for approval.** Auto-approval is for clear-cut cases only.
163
163
 
164
+ ## Recommended Model
165
+
166
+ **Default: `opus[1m]` (Opus 4.7 with 1M context window).** Run `/model opus[1m]` at the start of any non-trivial SDLC session.
167
+
168
+ **Why:**
169
+ - SDLC sessions (plan → TDD → review → CI shepherd) accumulate context fast — plans, test output, diffs, review artifacts. 200K fills up before you're done.
170
+ - Forced auto-compact mid-task loses your working state. Extra headroom is cheaper than re-reading files.
171
+ - At time of writing, Anthropic lists 1M context at standard pricing for supported Opus/Sonnet models — verify current rates for your plan before relying on this.
172
+
173
+ **Requires Claude Code v2.1.111+** for Opus 4.7.
174
+
175
+ **Pair with `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30`.** Without it, CC's default auto-compact on 1M fires at ~76K and defeats the purpose. The wizard's `cli/templates/settings.json` sets both defaults on install.
176
+
177
+ **Fall back to `opus` (200K) only when:** your plan charges a premium for long-context prompts, the task is genuinely short (<30K), or team cost controls flag >200K prompts. See the "1M vs 200K Context Window" section in `CLAUDE_CODE_SDLC_WIZARD.md` for details.
178
+
164
179
  ## Confidence Check (REQUIRED)
165
180
 
166
181
  Before presenting approach, STATE your confidence:
@@ -702,6 +717,40 @@ If this session revealed insights, update the right place:
702
717
  - **General project context** → `CLAUDE.md` (or `/revise-claude-md`)
703
718
  - **Plan files** → If this session's work came from a plan file, delete it or mark it complete. Stale plans mislead future sessions into thinking work is still pending
704
719
 
720
+ ### Memory Audit Protocol
721
+
722
+ Per-user memory at `~/.claude/projects/<proj>/memory/` accumulates private learnings. Some belong there (user preferences, external references). Others are portable technical lessons (tool quirks, platform gotchas, bash/GHA/macOS footguns) that would save the next contributor hours. Run this audit to promote the portable ones.
723
+
724
+ **When to run:**
725
+ - End-of-release (before cutting a tag)
726
+ - After a debugging-heavy session with multiple memory additions
727
+ - On explicit "audit my memory" request
728
+
729
+ **Classify each memory file in `~/.claude/projects/<proj>/memory/`:**
730
+
731
+ 1. **Rule-based denylist (deterministic, no LLM):**
732
+ - `type: user` → `keep` (user identity, preferences — never promote)
733
+ - `type: reference` → `keep` (external pointers to Discord/URL/etc — private by default)
734
+ - `type: project` → `manual-review` (often mixed state + portable lesson — human decides)
735
+ - `type: feedback` → `manual-review` (often mixed personal preference + portable rule — human decides)
736
+ - Parser must normalize YAML variants (`type: "user"`, `type: user # comment`, surrounding whitespace) — see `tests/test-memory-audit-protocol.sh::apply_denylist_rule` for the reference implementation
737
+ 2. **Remaining entries** (no type, or type outside the 4 above) fall through to human-gated review. An LLM-assisted classification runner is Prove-It-Gated: build it only after running this protocol 4+ times with manual classification. Until then, human review at promotion time IS the quality gate
738
+
739
+ **Destinations for `promote` entries (no new files — use existing wizard destinations):**
740
+
741
+ | Content | Target |
742
+ |---------|--------|
743
+ | Language/tool/platform gotchas (bash, gh CLI, GHA, macOS) | `SDLC.md` → `## Lessons Learned` section |
744
+ | Testing gotchas (flaky patterns, mock-vs-integration lessons) | `TESTING.md` |
745
+ | Tool-specific quirks tied to a skill | That skill's `SKILL.md` |
746
+ | Process rules that should govern the project | `CLAUDE.md` |
747
+
748
+ **Tracking:** When you promote an entry, add `promoted_to: <path>` to that memory file's YAML frontmatter. Subsequent audits skip already-promoted entries.
749
+
750
+ **Human gate is MANDATORY.** Protocol produces diffs; user approves chunk-by-chunk before apply. Never auto-apply — private memory touching public docs needs human judgement.
751
+
752
+ **Prove It Gate:** If you find yourself running this protocol 4+ times and manually doing the same classification work, that's evidence to build a `/memory-audit` slash command AND wire the LLM-gated quality tests (8/10 classification, 6/6 destination). Until then, protocol + human review is enough — and no stub tests that skip (they mislead reviewers into thinking a gate exists when it doesn't).
753
+
705
754
  ## Post-Mortem: When Process Fails, Feed It Back
706
755
 
707
756
  **Every process failure becomes an enforcement rule.** When you skip a step and it causes a problem, don't just fix the symptom — add a gate so it can't happen again.
@@ -183,16 +183,17 @@ Present suggestions and let the user confirm.
183
183
 
184
184
  ### Step 9.5: Context Window Configuration
185
185
 
186
- The CLI already sets `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=75` in `.claude/settings.json` `env` field (200K default). Ask the user which model context window they use:
186
+ The CLI ships `cli/templates/settings.json` with `"model": "opus[1m]"` and `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=30` (tuned for the 1M context window — compacts at ~300K). This is the SDLC wizard default. Confirm the installed values, or fall back to 200K if the user prefers:
187
187
 
188
- - **200K models (default):** Already configured. Confirm `75` is set in `settings.json` `env` field
189
- - **1M models:** Update `settings.json` `env` field: set `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to `"30"` the default fires at ~76K on 1M, wasting 92% of the window. Optionally also add `CLAUDE_CODE_AUTO_COMPACT_WINDOW` set to `"400000"`
188
+ - **1M default (`opus[1m]`):** Confirm `"model": "opus[1m]"` at top level and `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE: "30"` under `env`. Requires Claude Code v2.1.111+ for Opus 4.7.
189
+ - **200K fallback (`opus`):** Edit `.claude/settings.json` change `"model"` to `"opus"` and raise `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` to `"75"` (otherwise `30%` of 200K compacts too early at 60K).
190
190
 
191
- To update, edit `.claude/settings.json`:
191
+ To fall back to 200K, edit `.claude/settings.json`:
192
192
  ```json
193
193
  {
194
+ "model": "opus",
194
195
  "env": {
195
- "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "30"
196
+ "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "75"
196
197
  }
197
198
  }
198
199
  ```
@@ -223,10 +224,13 @@ Tell the user:
223
224
  > **Exit Claude Code and restart it** for the new configuration to take effect.
224
225
  > On restart, the SDLC hook will fire and you'll see the checklist in every response.
225
226
  >
226
- > **Optional next step:**
227
+ > **Optional next steps:**
227
228
  > - Run `/claude-automation-recommender` for stack-specific tooling suggestions (MCP servers, formatting hooks, type-checking hooks, plugins)
229
+ > - After a few sessions, run `/less-permission-prompts` — a native Claude Code skill
230
+ > that scans your transcripts for common read-only Bash/MCP calls and proposes a
231
+ > prioritized allowlist. Reduces permission friction without enabling auto mode.
228
232
  >
229
- > The recommender is complementary to the SDLC wizard — it adds tooling recommendations, not process enforcement.
233
+ > Both are complementary to the SDLC wizard — they add tooling and quality-of-life, not process enforcement.
230
234
 
231
235
  ## Rules
232
236
 
@@ -46,9 +46,12 @@ Parse all CHANGELOG entries between the user's installed version and the latest.
46
46
 
47
47
  ```
48
48
  Installed: 1.24.0
49
- Latest: 1.31.0
49
+ Latest: 1.34.0
50
50
 
51
51
  What changed:
52
+ - [1.34.0] API feature detection shepherd for Claude releases, Memory Audit Protocol with 7 verified lessons (+2 caught-and-retracted), /less-permission-prompts surfaced, ...
53
+ - [1.33.0] opus[1m] as SDLC default, dual-channel install drift guardrails, model/effort session-start nudge, ...
54
+ - [1.32.0] Opus 4.7 + xhigh support, model/effort upgrade detection, benchmark ceiling audit, ...
52
55
  - [1.31.0] Hook false-positive fix for non-SDLC dirs, ephemeral marketplace path warning, ...
53
56
  - [1.30.0] Firmware fixture, model A/B comparison workflow, CC degradation detection, ...
54
57
  - [1.29.0] Node 24 compliance, autocompact in settings.json, effectiveness scoreboard, ...