great-cto 1.0.103 → 1.0.105

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/dist/bootstrap.js CHANGED
@@ -24,10 +24,16 @@ export function bootstrap(dir, detection, archetype, compliance) {
24
24
  ## Project
25
25
 
26
26
  primary: ${archetype}
27
+ archetype: ${archetype}
28
+ project_size: medium
27
29
  stack: ${stackLine}
28
30
  languages: ${detection.languages.join(", ") || "to be defined"}
29
31
  package-manager: ${detection.packageManager ?? "none"}
30
32
 
33
+ > \`archetype:\` drives tier/gate selection (see references/security-tiers.md).
34
+ > \`project_size:\` is one of nano | small | medium | large | enterprise — agents
35
+ > scale gate depth accordingly. Edit either if auto-detection got it wrong.
36
+
31
37
  ## Phase
32
38
 
33
39
  phase: implementation
@@ -38,13 +44,18 @@ phase: implementation
38
44
 
39
45
  ## Team
40
46
 
41
- size: ${teamSize}
47
+ team-size: ${teamSize}
42
48
  mode: solo
43
49
  approval-level: ${approvalLevel}
44
50
 
51
+ > \`team-size:\` is read at root level (not nested) by /rfc and other commands.
52
+
45
53
  ## Compliance
46
54
 
47
- frameworks: [${complianceLine}]
55
+ compliance: [${complianceLine}]
56
+
57
+ > \`compliance:\` list drives which checklists security-officer runs.
58
+ > See ARCHETYPES.md "Parameter Values" for supported keys.
48
59
 
49
60
  ## Goals
50
61
 
package/dist/main.js CHANGED
@@ -175,6 +175,45 @@ async function runInit(args) {
175
175
  if (enableResult.alreadyEnabled) {
176
176
  log(` ${dim("already enabled in")} ${enableResult.settingsPath}`);
177
177
  }
178
+ // ── 4b. one-shot legacy cleanup ──────────────────────────
179
+ // Versions < 1.0.104 copied commands to ~/.claude/commands/ without a
180
+ // `great_cto-managed` marker; the SessionStart hook in 1.0.104+ can't
181
+ // safely delete them. If this looks like an upgrade from an older version,
182
+ // remove any unmarked copies of commands we used to ship so the new loop
183
+ // can drop its marker-tagged versions.
184
+ if (existing.length > 0) {
185
+ try {
186
+ const { existsSync, readFileSync, unlinkSync } = await import("node:fs");
187
+ const { homedir } = await import("node:os");
188
+ const { join } = await import("node:path");
189
+ const legacy = [
190
+ "triage", "gates", "dora", "investigate", "threat-model", "sbom",
191
+ "security-incident", "update", "status", "capture", "revisit",
192
+ "board-report", "burn", "cost", "poc", "promote", "sec",
193
+ ];
194
+ const cmdDir = join(homedir(), ".claude", "commands");
195
+ let cleaned = 0;
196
+ for (const name of legacy) {
197
+ const f = join(cmdDir, `${name}.md`);
198
+ if (!existsSync(f))
199
+ continue;
200
+ const head = readFileSync(f, "utf-8").slice(0, 4096);
201
+ // Only delete files that look like OUR old commands (contain great_cto
202
+ // references) AND lack the 1.0.104+ marker. Hand-written user files
203
+ // won't match the great_cto reference test.
204
+ const looksOurs = /great_cto|\.great_cto|Great CTO/.test(head);
205
+ const hasMarker = /great_cto-managed/.test(head);
206
+ if (looksOurs && !hasMarker) {
207
+ unlinkSync(f);
208
+ cleaned++;
209
+ }
210
+ }
211
+ if (cleaned > 0) {
212
+ log(` ${dim(`cleaned ${cleaned} legacy command file(s) from ~/.claude/commands (pre-1.0.104 unmarked)`)}`);
213
+ }
214
+ }
215
+ catch { /* best-effort — don't block install */ }
216
+ }
178
217
  // ── 5. bootstrap ─────────────────────────────────────────
179
218
  step(5, 5, "bootstrapping .great_cto/PROJECT.md");
180
219
  const bs = bootstrap(args.dir, detection, archetype, compliance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "great-cto",
3
- "version": "1.0.103",
3
+ "version": "1.0.105",
4
4
  "description": "One command install for the great_cto Claude Code plugin. Auto-detects your stack, picks the right archetype, bootstraps PROJECT.md.",
5
5
  "keywords": [
6
6
  "claude-code",