gsd-pi 2.35.0-dev.4bbf377 → 2.35.0-dev.6179610

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.
Files changed (62) hide show
  1. package/dist/resources/extensions/gsd/auto-loop.js +2 -7
  2. package/dist/resources/extensions/gsd/auto-model-selection.js +3 -15
  3. package/dist/resources/extensions/gsd/commands.js +1 -37
  4. package/dist/resources/extensions/gsd/guided-flow.js +1 -7
  5. package/dist/resources/skills/core-web-vitals/SKILL.md +1 -1
  6. package/dist/resources/skills/create-gsd-extension/workflows/debug-extension.md +1 -1
  7. package/dist/resources/skills/github-workflows/SKILL.md +2 -0
  8. package/dist/resources/skills/swiftui/SKILL.md +208 -0
  9. package/dist/resources/skills/swiftui/references/animations.md +921 -0
  10. package/dist/resources/skills/swiftui/references/architecture.md +1561 -0
  11. package/dist/resources/skills/swiftui/references/layout-system.md +1186 -0
  12. package/dist/resources/skills/swiftui/references/navigation.md +1492 -0
  13. package/dist/resources/skills/swiftui/references/networking-async.md +214 -0
  14. package/dist/resources/skills/swiftui/references/performance.md +1706 -0
  15. package/dist/resources/skills/swiftui/references/platform-integration.md +204 -0
  16. package/dist/resources/skills/swiftui/references/state-management.md +1443 -0
  17. package/dist/resources/skills/swiftui/references/swiftdata.md +297 -0
  18. package/dist/resources/skills/swiftui/references/testing-debugging.md +247 -0
  19. package/dist/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
  20. package/dist/resources/skills/swiftui/workflows/add-feature.md +191 -0
  21. package/dist/resources/skills/swiftui/workflows/build-new-app.md +311 -0
  22. package/dist/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
  23. package/dist/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
  24. package/dist/resources/skills/swiftui/workflows/ship-app.md +203 -0
  25. package/dist/resources/skills/swiftui/workflows/write-tests.md +235 -0
  26. package/dist/resources/skills/web-quality-audit/SKILL.md +2 -0
  27. package/package.json +1 -1
  28. package/packages/pi-agent-core/dist/agent.d.ts +2 -10
  29. package/packages/pi-agent-core/dist/agent.d.ts.map +1 -1
  30. package/packages/pi-agent-core/dist/agent.js +8 -19
  31. package/packages/pi-agent-core/dist/agent.js.map +1 -1
  32. package/packages/pi-agent-core/src/agent.ts +10 -31
  33. package/packages/pi-coding-agent/dist/core/agent-session.d.ts.map +1 -1
  34. package/packages/pi-coding-agent/dist/core/agent-session.js +4 -20
  35. package/packages/pi-coding-agent/dist/core/agent-session.js.map +1 -1
  36. package/packages/pi-coding-agent/src/core/agent-session.ts +12 -36
  37. package/src/resources/extensions/gsd/auto-loop.ts +1 -11
  38. package/src/resources/extensions/gsd/auto-model-selection.ts +2 -23
  39. package/src/resources/extensions/gsd/commands.ts +1 -36
  40. package/src/resources/extensions/gsd/guided-flow.ts +1 -7
  41. package/src/resources/skills/core-web-vitals/SKILL.md +1 -1
  42. package/src/resources/skills/create-gsd-extension/workflows/debug-extension.md +1 -1
  43. package/src/resources/skills/github-workflows/SKILL.md +2 -0
  44. package/src/resources/skills/swiftui/SKILL.md +208 -0
  45. package/src/resources/skills/swiftui/references/animations.md +921 -0
  46. package/src/resources/skills/swiftui/references/architecture.md +1561 -0
  47. package/src/resources/skills/swiftui/references/layout-system.md +1186 -0
  48. package/src/resources/skills/swiftui/references/navigation.md +1492 -0
  49. package/src/resources/skills/swiftui/references/networking-async.md +214 -0
  50. package/src/resources/skills/swiftui/references/performance.md +1706 -0
  51. package/src/resources/skills/swiftui/references/platform-integration.md +204 -0
  52. package/src/resources/skills/swiftui/references/state-management.md +1443 -0
  53. package/src/resources/skills/swiftui/references/swiftdata.md +297 -0
  54. package/src/resources/skills/swiftui/references/testing-debugging.md +247 -0
  55. package/src/resources/skills/swiftui/references/uikit-appkit-interop.md +218 -0
  56. package/src/resources/skills/swiftui/workflows/add-feature.md +191 -0
  57. package/src/resources/skills/swiftui/workflows/build-new-app.md +311 -0
  58. package/src/resources/skills/swiftui/workflows/debug-swiftui.md +192 -0
  59. package/src/resources/skills/swiftui/workflows/optimize-performance.md +197 -0
  60. package/src/resources/skills/swiftui/workflows/ship-app.md +203 -0
  61. package/src/resources/skills/swiftui/workflows/write-tests.md +235 -0
  62. package/src/resources/skills/web-quality-audit/SKILL.md +2 -0
@@ -632,11 +632,6 @@ export async function autoLoop(ctx, pi, s, deps) {
632
632
  unitType,
633
633
  unitId,
634
634
  });
635
- // Detect retry and capture previous tier for escalation
636
- const isRetry = !!(s.currentUnit &&
637
- s.currentUnit.type === unitType &&
638
- s.currentUnit.id === unitId);
639
- const previousTier = s.currentUnitRouting?.tier;
640
635
  // Closeout previous unit
641
636
  if (s.currentUnit) {
642
637
  await deps.closeoutUnit(ctx, s.basePath, s.currentUnit.type, s.currentUnit.id, s.currentUnit.startedAt, deps.buildSnapshotOpts(s.currentUnit.type, s.currentUnit.id));
@@ -742,8 +737,8 @@ export async function autoLoop(ctx, pi, s, deps) {
742
737
  const msg = reorderErr instanceof Error ? reorderErr.message : String(reorderErr);
743
738
  process.stderr.write(`[gsd] prompt reorder failed (non-fatal): ${msg}\n`);
744
739
  }
745
- // Select and apply model (with tier escalation on retry)
746
- const modelResult = await deps.selectAndApplyModel(ctx, pi, unitType, unitId, s.basePath, prefs, s.verbose, s.autoModeStartModel, { isRetry, previousTier });
740
+ // Select and apply model
741
+ const modelResult = await deps.selectAndApplyModel(ctx, pi, unitType, unitId, s.basePath, prefs, s.verbose, s.autoModeStartModel);
747
742
  s.currentUnitRouting =
748
743
  modelResult.routing;
749
744
  // Start unit supervision
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { resolveModelWithFallbacksForUnit, resolveDynamicRoutingConfig } from "./preferences.js";
7
7
  import { classifyUnitComplexity, tierLabel } from "./complexity-classifier.js";
8
- import { resolveModelForComplexity, escalateTier } from "./model-router.js";
8
+ import { resolveModelForComplexity } from "./model-router.js";
9
9
  import { getLedger, getProjectTotals } from "./metrics.js";
10
10
  import { unitPhaseLabel } from "./auto-dashboard.js";
11
11
  /**
@@ -15,7 +15,7 @@ import { unitPhaseLabel } from "./auto-dashboard.js";
15
15
  *
16
16
  * Returns routing metadata for metrics tracking.
17
17
  */
18
- export async function selectAndApplyModel(ctx, pi, unitType, unitId, basePath, prefs, verbose, autoModeStartModel, retryContext) {
18
+ export async function selectAndApplyModel(ctx, pi, unitType, unitId, basePath, prefs, verbose, autoModeStartModel) {
19
19
  const modelConfig = resolveModelWithFallbacksForUnit(unitType);
20
20
  let routing = null;
21
21
  if (modelConfig) {
@@ -37,20 +37,8 @@ export async function selectAndApplyModel(ctx, pi, unitType, unitId, basePath, p
37
37
  const isHook = unitType.startsWith("hook/");
38
38
  const shouldClassify = !isHook || routingConfig.hooks !== false;
39
39
  if (shouldClassify) {
40
- let classification = classifyUnitComplexity(unitType, unitId, basePath, budgetPct);
40
+ const classification = classifyUnitComplexity(unitType, unitId, basePath, budgetPct);
41
41
  const availableModelIds = availableModels.map(m => m.id);
42
- // Escalate tier on retry when escalate_on_failure is enabled (default: true)
43
- if (retryContext?.isRetry &&
44
- retryContext.previousTier &&
45
- routingConfig.escalate_on_failure !== false) {
46
- const escalated = escalateTier(retryContext.previousTier);
47
- if (escalated) {
48
- classification = { ...classification, tier: escalated, reason: "escalated after failure" };
49
- if (verbose) {
50
- ctx.ui.notify(`Tier escalation: ${retryContext.previousTier} → ${escalated} (retry after failure)`, "info");
51
- }
52
- }
53
- }
54
42
  const routingResult = resolveModelForComplexity(classification, modelConfig, routingConfig, availableModelIds);
55
43
  if (routingResult.wasDowngraded) {
56
44
  effectiveModelConfig = {
@@ -36,7 +36,6 @@ import { computeProgressScore, formatProgressLine } from "./progress-score.js";
36
36
  import { runEnvironmentChecks } from "./doctor-environment.js";
37
37
  import { handleLogs } from "./commands-logs.js";
38
38
  import { handleStart, handleTemplates, getTemplateCompletions } from "./commands-workflow-templates.js";
39
- import { readSessionLockData, isSessionLockProcessAlive } from "./session-lock.js";
40
39
  /** Resolve the effective project root, accounting for worktree paths. */
41
40
  export function projectRoot() {
42
41
  const cwd = process.cwd();
@@ -55,38 +54,6 @@ export function projectRoot() {
55
54
  }
56
55
  return root;
57
56
  }
58
- /**
59
- * Check if another process holds the auto-mode session lock.
60
- * Returns the lock data if a remote session is alive, null otherwise.
61
- */
62
- function getRemoteAutoSession(basePath) {
63
- const lockData = readSessionLockData(basePath);
64
- if (!lockData)
65
- return null;
66
- if (lockData.pid === process.pid)
67
- return null;
68
- if (!isSessionLockProcessAlive(lockData))
69
- return null;
70
- return { pid: lockData.pid };
71
- }
72
- /**
73
- * Show a steering menu when auto-mode is running in another process.
74
- * Returns true if a remote session was detected (caller should return early).
75
- */
76
- function notifyRemoteAutoActive(ctx, basePath) {
77
- const remote = getRemoteAutoSession(basePath);
78
- if (!remote)
79
- return false;
80
- ctx.ui.notify(`Auto-mode is running in another process (PID ${remote.pid}).\n` +
81
- `Use these commands to interact with it:\n` +
82
- ` /gsd status — check progress\n` +
83
- ` /gsd discuss — discuss architecture decisions\n` +
84
- ` /gsd queue — queue the next milestone\n` +
85
- ` /gsd steer — apply an override to active work\n` +
86
- ` /gsd capture — fire-and-forget thought\n` +
87
- ` /gsd stop — stop auto-mode`, "warning");
88
- return true;
89
- }
90
57
  export function registerGSDCommand(pi) {
91
58
  pi.registerCommand("gsd", {
92
59
  description: "GSD — Get Shit Done: /gsd help|start|templates|next|auto|stop|pause|status|visualize|queue|quick|capture|triage|dispatch|history|undo|skip|export|cleanup|mode|prefs|config|keys|hooks|run-hook|skill-health|doctor|forensics|changelog|migrate|remote|steer|knowledge|new-milestone|parallel|update",
@@ -493,8 +460,6 @@ export async function handleGSDCommand(args, ctx, pi) {
493
460
  await handleDryRun(ctx, projectRoot());
494
461
  return;
495
462
  }
496
- if (notifyRemoteAutoActive(ctx, projectRoot()))
497
- return;
498
463
  const verboseMode = trimmed.includes("--verbose");
499
464
  const debugMode = trimmed.includes("--debug");
500
465
  if (debugMode)
@@ -850,8 +815,7 @@ Examples:
850
815
  return;
851
816
  }
852
817
  if (trimmed === "") {
853
- if (notifyRemoteAutoActive(ctx, projectRoot()))
854
- return;
818
+ // Bare /gsd defaults to step mode
855
819
  await startAuto(ctx, pi, projectRoot(), false, { step: true });
856
820
  return;
857
821
  }
@@ -17,7 +17,6 @@ import { resolveExpectedArtifactPath } from "./auto.js";
17
17
  import { gsdRoot, milestonesDir, resolveMilestoneFile, resolveSliceFile, resolveSlicePath, resolveGsdRootFile, relGsdRootFile, relMilestoneFile, relSliceFile, } from "./paths.js";
18
18
  import { join } from "node:path";
19
19
  import { readFileSync, existsSync, mkdirSync, readdirSync, unlinkSync } from "node:fs";
20
- import { readSessionLockData, isSessionLockProcessAlive } from "./session-lock.js";
21
20
  import { nativeIsRepo, nativeInit } from "./native-git-bridge.js";
22
21
  import { ensureGitignore, ensurePreferences, untrackRuntimeFiles } from "./gitignore.js";
23
22
  import { loadEffectiveGSDPreferences } from "./preferences.js";
@@ -427,12 +426,7 @@ export async function showDiscuss(ctx, pi, basePath) {
427
426
  // If all pending slices are discussed, notify and exit instead of looping
428
427
  const allDiscussed = pendingSlices.every(s => discussedMap.get(s.id));
429
428
  if (allDiscussed) {
430
- const lockData = readSessionLockData(basePath);
431
- const remoteAutoRunning = lockData && lockData.pid !== process.pid && isSessionLockProcessAlive(lockData);
432
- const nextStep = remoteAutoRunning
433
- ? "Auto-mode is already running — use /gsd status to check progress."
434
- : "Run /gsd to start planning.";
435
- ctx.ui.notify(`All ${pendingSlices.length} slices discussed. ${nextStep}`, "info");
429
+ ctx.ui.notify(`All ${pendingSlices.length} slices discussed. Run /gsd to start planning.`, "info");
436
430
  return;
437
431
  }
438
432
  // Find the first undiscussed slice to recommend
@@ -438,4 +438,4 @@ startTransition(() => setExpensiveState(newValue));
438
438
  - [web.dev LCP](https://web.dev/articles/lcp)
439
439
  - [web.dev INP](https://web.dev/articles/inp)
440
440
  - [web.dev CLS](https://web.dev/articles/cls)
441
- - [Code Optimizer skill](../code-optimizer/SKILL.md)
441
+ - [Performance skill](../performance/SKILL.md)
@@ -42,7 +42,7 @@ The file must `export default function(pi: ExtensionAPI) { ... }`.
42
42
 
43
43
  ## Step 4: Check for Common Mistakes
44
44
 
45
- Read `../references/key-rules-gotchas.md` and verify each rule against the extension code.
45
+ Read `references/key-rules-gotchas.md` and verify each rule against the extension code.
46
46
 
47
47
  ## Step 5: Add Debugging
48
48
 
@@ -88,3 +88,5 @@ EVIDENCE: [output from ci_monitor.cjs]
88
88
  ## References
89
89
 
90
90
  - `references/gh/SKILL.md` — gh CLI reference
91
+ - `scripts/ci_monitor.cjs` — CI monitoring tool
92
+ - `scripts/ci_monitor.md` — Tool usage documentation
@@ -0,0 +1,208 @@
1
+ ---
2
+ name: swiftui
3
+ description: SwiftUI apps from scratch through App Store. Full lifecycle - create, debug, test, optimize, ship.
4
+ ---
5
+
6
+ <essential_principles>
7
+ ## How We Work
8
+
9
+ **The user is the product owner. Claude is the developer.**
10
+
11
+ The user does not write code. The user does not read code. The user describes what they want and judges whether the result is acceptable. Claude implements, verifies, and reports outcomes.
12
+
13
+ ### 1. Prove, Don't Promise
14
+
15
+ Never say "this should work." Prove it:
16
+ ```bash
17
+ xcodebuild build 2>&1 | xcsift # Build passes
18
+ xcodebuild test # Tests pass
19
+ open .../App.app # App launches
20
+ ```
21
+ If you didn't run it, you don't know it works.
22
+
23
+ ### 2. Tests for Correctness, Eyes for Quality
24
+
25
+ | Question | How to Answer |
26
+ |----------|---------------|
27
+ | Does the logic work? | Write test, see it pass |
28
+ | Does it look right? | Launch app, user looks at it |
29
+ | Does it feel right? | User uses it |
30
+ | Does it crash? | Test + launch |
31
+ | Is it fast enough? | Profiler |
32
+
33
+ Tests verify *correctness*. The user verifies *desirability*.
34
+
35
+ ### 3. Report Outcomes, Not Code
36
+
37
+ **Bad:** "I refactored the view model to use @Observable with environment injection"
38
+ **Good:** "Fixed the state bug. App now updates correctly when you add items. Ready for you to verify."
39
+
40
+ The user doesn't care what you changed. The user cares what's different.
41
+
42
+ ### 4. Small Steps, Always Verified
43
+
44
+ ```
45
+ Change → Verify → Report → Next change
46
+ ```
47
+
48
+ Never batch up work. Never say "I made several changes." Each change is verified before the next. If something breaks, you know exactly what caused it.
49
+
50
+ ### 5. Ask Before, Not After
51
+
52
+ Unclear requirement? Ask now.
53
+ Multiple valid approaches? Ask which.
54
+ Scope creep? Ask if wanted.
55
+ Big refactor needed? Ask permission.
56
+
57
+ Wrong: Build for 30 minutes, then "is this what you wanted?"
58
+ Right: "Before I start, does X mean Y or Z?"
59
+
60
+ ### 6. Always Leave It Working
61
+
62
+ Every stopping point = working state. Tests pass, app launches, changes committed. The user can walk away anytime and come back to something that works.
63
+ </essential_principles>
64
+
65
+ <swiftui_principles>
66
+ ## SwiftUI Framework Principles
67
+
68
+ ### Declarative Mindset
69
+ Describe what the UI should look like for a given state, not how to mutate it. Let SwiftUI manage the rendering. Never force updates - change the state and let the framework react.
70
+
71
+ ### Single Source of Truth
72
+ Every piece of data has one authoritative location. Use the right property wrapper: @State for view-local, @Observable for shared objects, @Environment for app-wide. Derived data should be computed, not stored.
73
+
74
+ ### Composition Over Inheritance
75
+ Build complex UIs by composing small, focused views. Extract reusable components when patterns emerge. Prefer many small views over few large ones.
76
+
77
+ ### Platform-Adaptive Design
78
+ Write once but respect platform idioms. Use native navigation patterns, respect safe areas, adapt to screen sizes. Test on all target platforms.
79
+ </swiftui_principles>
80
+
81
+ <intake>
82
+ **What would you like to do?**
83
+
84
+ 1. Build a new SwiftUI app
85
+ 2. Debug an existing SwiftUI app
86
+ 3. Add a feature to an existing app
87
+ 4. Write/run tests
88
+ 5. Optimize performance
89
+ 6. Ship/release to App Store
90
+ 7. Something else
91
+
92
+ **Then read the matching workflow from `workflows/` and follow it.**
93
+ </intake>
94
+
95
+ <routing>
96
+ | Response | Workflow |
97
+ |----------|----------|
98
+ | 1, "new", "create", "build", "start" | `workflows/build-new-app.md` |
99
+ | 2, "broken", "fix", "debug", "crash", "bug" | `workflows/debug-swiftui.md` |
100
+ | 3, "add", "feature", "implement", "change" | `workflows/add-feature.md` |
101
+ | 4, "test", "tests", "TDD", "coverage" | `workflows/write-tests.md` |
102
+ | 5, "slow", "optimize", "performance", "fast" | `workflows/optimize-performance.md` |
103
+ | 6, "ship", "release", "deploy", "publish", "app store" | `workflows/ship-app.md` |
104
+ | 7, other | Clarify, then select workflow or references |
105
+ </routing>
106
+
107
+ <verification_loop>
108
+ ## After Every Change
109
+
110
+ ```bash
111
+ # 1. Does it build?
112
+ xcodebuild -scheme AppName build 2>&1 | xcsift
113
+
114
+ # 2. Do tests pass? (use Core scheme for SwiftUI apps to avoid @main hang)
115
+ xcodebuild -scheme AppNameCore test
116
+
117
+ # 3. Does it launch?
118
+ # macOS:
119
+ open ./build/Build/Products/Debug/AppName.app
120
+
121
+ # iOS Simulator:
122
+ xcrun simctl boot "iPhone 15 Pro" 2>/dev/null || true
123
+ xcrun simctl install booted ./build/Build/Products/Debug-iphonesimulator/AppName.app
124
+ xcrun simctl launch booted com.yourcompany.appname
125
+ ```
126
+
127
+ Note: If tests hang, the test target likely depends on the app target which has `@main`. Extract testable code to a framework target. See `../macos-apps/references/testing-tdd.md` for the pattern.
128
+
129
+ Report to the user:
130
+ - "Build: ✓"
131
+ - "Tests: 12 pass, 0 fail"
132
+ - "App launches, ready for you to check [specific thing]"
133
+ </verification_loop>
134
+
135
+ <cli_infrastructure>
136
+ ## CLI Workflow References
137
+
138
+ For building, debugging, testing, and shipping from CLI without opening Xcode, read these from `../macos-apps/references/`:
139
+
140
+ | Reference | Use For |
141
+ |-----------|---------|
142
+ | `cli-workflow.md` | Build, run, test commands; xcodebuild usage; code signing |
143
+ | `cli-observability.md` | Log streaming, crash analysis, memory debugging, LLDB |
144
+ | `project-scaffolding.md` | XcodeGen project.yml templates, file structure, entitlements |
145
+ | `testing-tdd.md` | Test patterns that work from CLI, avoiding @main hangs |
146
+
147
+ These docs are platform-agnostic. For iOS, change destinations:
148
+ ```bash
149
+ # iOS Simulator
150
+ xcodebuild -scheme AppName -destination 'platform=iOS Simulator,name=iPhone 15 Pro' build
151
+
152
+ # macOS
153
+ xcodebuild -scheme AppName build
154
+ ```
155
+ </cli_infrastructure>
156
+
157
+ <reference_index>
158
+ ## Domain Knowledge
159
+
160
+ All in `references/`:
161
+
162
+ **Core:**
163
+ - architecture.md - MVVM patterns, project structure, dependency injection
164
+ - state-management.md - Property wrappers, @Observable, data flow
165
+ - layout-system.md - Stacks, grids, GeometryReader, custom layouts
166
+
167
+ **Navigation & Animation:**
168
+ - navigation.md - NavigationStack, sheets, tabs, deep linking
169
+ - animations.md - Built-in animations, transitions, matchedGeometryEffect
170
+
171
+ **Data & Platform:**
172
+ - swiftdata.md - Persistence, @Model, @Query, CloudKit sync
173
+ - platform-integration.md - iOS/macOS/watchOS/visionOS specifics
174
+ - uikit-appkit-interop.md - UIViewRepresentable, hosting controllers
175
+
176
+ **Support:**
177
+ - networking-async.md - async/await, .task modifier, API clients
178
+ - testing-debugging.md - Previews, unit tests, UI tests, debugging
179
+ - performance.md - Profiling, lazy loading, view identity
180
+ </reference_index>
181
+
182
+ <workflows_index>
183
+ ## Workflows
184
+
185
+ All in `workflows/`:
186
+
187
+ | Workflow | Purpose |
188
+ |----------|---------|
189
+ | build-new-app.md | Create new SwiftUI app from scratch |
190
+ | debug-swiftui.md | Find and fix SwiftUI bugs |
191
+ | add-feature.md | Add functionality to existing app |
192
+ | write-tests.md | Write UI and unit tests |
193
+ | optimize-performance.md | Profile and improve performance |
194
+ | ship-app.md | App Store submission, TestFlight, distribution |
195
+ </workflows_index>
196
+
197
+ <canonical_terminology>
198
+ ## Terminology
199
+
200
+ Use these terms consistently:
201
+ - **view** (not: widget, component, element)
202
+ - **@Observable** (not: ObservableObject, @Published for new iOS 17+ code)
203
+ - **NavigationStack** (not: NavigationView - deprecated)
204
+ - **SwiftData** (not: Core Data for new projects)
205
+ - **@Environment** (not: @EnvironmentObject for new code)
206
+ - **modifier** (not: method/function when describing view modifiers)
207
+ - **body** (not: render/build when describing view body)
208
+ </canonical_terminology>