@pareto4/pp-core 1.18.0 → 1.19.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.
Files changed (147) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/agents/pp-code-fixer.md +9 -5
  3. package/agents/pp-code-reviewer.md +1 -0
  4. package/agents/pp-codebase-mapper.md +3 -0
  5. package/agents/pp-debugger.md +3 -2
  6. package/agents/pp-executor.md +16 -7
  7. package/agents/pp-integration-checker.md +1 -0
  8. package/agents/pp-phase-researcher.md +3 -1
  9. package/agents/pp-plan-checker.md +3 -0
  10. package/agents/pp-planner.md +5 -1
  11. package/agents/pp-research-synthesizer.md +1 -1
  12. package/agents/pp-ui-auditor.md +1 -0
  13. package/agents/pp-ui-researcher.md +3 -1
  14. package/agents/pp-verifier.md +10 -2
  15. package/commands/pp-add-tests.md +1 -1
  16. package/commands/pp-debug.md +1 -0
  17. package/commands/pp-init.md +4 -3
  18. package/commands/pp-quick.md +3 -0
  19. package/commands/pp-review-backlog.md +2 -1
  20. package/gemini-extension.json +1 -1
  21. package/package.json +1 -1
  22. package/pp-core/bin/lib/capability-registry.cjs +2 -2
  23. package/pp-core/bin/lib/check-command-router.cjs +60 -20
  24. package/pp-core/bin/lib/commands.cjs +79 -4
  25. package/pp-core/bin/lib/compose-bindings.cjs +97 -14
  26. package/pp-core/bin/lib/discovery-rollup.cjs +9 -6
  27. package/pp-core/bin/lib/discovery-screens.cjs +20 -2
  28. package/pp-core/bin/lib/discovery-sweep.cjs +12 -3
  29. package/pp-core/bin/lib/discovery-vault-check.cjs +37 -3
  30. package/pp-core/bin/lib/init-contract.cjs +48 -7
  31. package/pp-core/bin/lib/vault-coordinates.cjs +1 -1
  32. package/pp-core/bin/lib/vault-index.cjs +18 -5
  33. package/pp-core/bin/lib/vault-update.cjs +4 -0
  34. package/pp-core/bin/lib/vault.cjs +2 -2
  35. package/pp-core/bin/pp-tools.cjs +10 -4
  36. package/pp-core/org-profile.json +1 -1
  37. package/pp-core/references/autonomous-best-effort.md +3 -2
  38. package/pp-core/references/autonomous-lifecycle.md +1 -0
  39. package/pp-core/references/autonomous-smart-discuss.md +5 -1
  40. package/pp-core/references/discovery-id-conventions.md +35 -2
  41. package/pp-core/references/execute-mvp-tdd.md +3 -3
  42. package/pp-core/references/git-integration.md +57 -33
  43. package/pp-core/references/git-planning-commit.md +31 -9
  44. package/pp-core/references/phase-argument-parsing.md +1 -0
  45. package/pp-core/references/planner-gap-closure.md +1 -0
  46. package/pp-core/references/planner-revision.md +3 -1
  47. package/pp-core/references/planner-tdd.md +4 -4
  48. package/pp-core/references/planning-config.md +3 -3
  49. package/pp-core/references/shell-portability.md +28 -0
  50. package/pp-core/references/tdd.md +20 -16
  51. package/pp-core/references/worktree-path-safety.md +1 -0
  52. package/pp-core/templates/milestone.md +5 -5
  53. package/pp-core/workflows/add-backlog.md +1 -1
  54. package/pp-core/workflows/add-tests.md +5 -2
  55. package/pp-core/workflows/add-todo.md +3 -1
  56. package/pp-core/workflows/ai-integration-phase.md +2 -1
  57. package/pp-core/workflows/audit-fix.md +4 -3
  58. package/pp-core/workflows/audit-milestone.md +1 -0
  59. package/pp-core/workflows/autonomous.md +6 -0
  60. package/pp-core/workflows/check-todos.md +2 -1
  61. package/pp-core/workflows/cleanup.md +3 -1
  62. package/pp-core/workflows/code-review-fix.md +12 -5
  63. package/pp-core/workflows/code-review.md +15 -1
  64. package/pp-core/workflows/complete-milestone.md +13 -3
  65. package/pp-core/workflows/debug.md +2 -0
  66. package/pp-core/workflows/diagnose-issues.md +1 -1
  67. package/pp-core/workflows/discovery-sprint/session-13-gates.md +1 -1
  68. package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +51 -7
  69. package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +5 -3
  70. package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +10 -8
  71. package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +11 -2
  72. package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +5 -5
  73. package/pp-core/workflows/discovery-sprint/sessions/06-security.md +3 -3
  74. package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +2 -2
  75. package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +14 -2
  76. package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +2 -2
  77. package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +10 -10
  78. package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +11 -8
  79. package/pp-core/workflows/discovery-sprint/sessions/12-delivery-model.md +21 -18
  80. package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +5 -3
  81. package/pp-core/workflows/discovery-sprint/templates/context-template.md +9 -3
  82. package/pp-core/workflows/discovery-sprint/vault-context.md +14 -3
  83. package/pp-core/workflows/discovery-sprint.md +11 -8
  84. package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +1 -0
  85. package/pp-core/workflows/discuss-phase-assumptions.md +5 -3
  86. package/pp-core/workflows/discuss-phase.md +8 -3
  87. package/pp-core/workflows/docs-update.md +1 -0
  88. package/pp-core/workflows/eval-review.md +2 -1
  89. package/pp-core/workflows/execute-phase/steps/check-query-gate.md +7 -6
  90. package/pp-core/workflows/execute-phase/steps/cross-ai-delegation.md +1 -0
  91. package/pp-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +1 -0
  92. package/pp-core/workflows/execute-phase/steps/vault-fetch.md +12 -0
  93. package/pp-core/workflows/execute-phase.md +19 -7
  94. package/pp-core/workflows/execute-plan.md +18 -7
  95. package/pp-core/workflows/explore.md +1 -1
  96. package/pp-core/workflows/forensics.md +4 -2
  97. package/pp-core/workflows/health.md +1 -0
  98. package/pp-core/workflows/import.md +2 -1
  99. package/pp-core/workflows/ingest-docs.md +1 -0
  100. package/pp-core/workflows/init/steps/client-context-capture.md +1 -0
  101. package/pp-core/workflows/init/steps/github-provisioning.md +145 -0
  102. package/pp-core/workflows/init/steps/gitlab-provisioning.md +18 -4
  103. package/pp-core/workflows/init/steps/reachability-outcome.md +3 -1
  104. package/pp-core/workflows/init.md +56 -66
  105. package/pp-core/workflows/map-codebase.md +5 -1
  106. package/pp-core/workflows/milestone-summary.md +2 -1
  107. package/pp-core/workflows/mvp-phase.md +1 -0
  108. package/pp-core/workflows/new-milestone.md +9 -5
  109. package/pp-core/workflows/new-project.md +9 -8
  110. package/pp-core/workflows/new-workspace.md +1 -0
  111. package/pp-core/workflows/next.md +2 -1
  112. package/pp-core/workflows/pause-work.md +6 -4
  113. package/pp-core/workflows/plan-milestone-gaps.md +3 -1
  114. package/pp-core/workflows/plan-phase/steps/chunked-planning.md +1 -1
  115. package/pp-core/workflows/plan-phase.md +21 -6
  116. package/pp-core/workflows/plan-review-convergence.md +2 -0
  117. package/pp-core/workflows/plant-seed.md +4 -2
  118. package/pp-core/workflows/pr-branch.md +2 -0
  119. package/pp-core/workflows/progress.md +5 -0
  120. package/pp-core/workflows/quick.md +11 -4
  121. package/pp-core/workflows/reapply-patches.md +3 -0
  122. package/pp-core/workflows/remove-phase.md +1 -1
  123. package/pp-core/workflows/resume-project.md +3 -0
  124. package/pp-core/workflows/review.md +7 -1
  125. package/pp-core/workflows/secure-phase.md +2 -1
  126. package/pp-core/workflows/session-report.md +1 -0
  127. package/pp-core/workflows/ship.md +8 -1
  128. package/pp-core/workflows/sketch-wrap-up.md +1 -1
  129. package/pp-core/workflows/sketch.md +3 -2
  130. package/pp-core/workflows/spec-phase.md +2 -1
  131. package/pp-core/workflows/spike-wrap-up.md +1 -1
  132. package/pp-core/workflows/spike.md +4 -3
  133. package/pp-core/workflows/sync-skills.md +5 -2
  134. package/pp-core/workflows/thread.md +3 -2
  135. package/pp-core/workflows/transition.md +6 -0
  136. package/pp-core/workflows/ui-phase.md +3 -1
  137. package/pp-core/workflows/ui-review.md +2 -1
  138. package/pp-core/workflows/ultraplan-phase.md +1 -0
  139. package/pp-core/workflows/undo.md +14 -10
  140. package/pp-core/workflows/update.md +5 -0
  141. package/pp-core/workflows/validate-phase.md +6 -3
  142. package/pp-core/workflows/vault-review.md +2 -1
  143. package/pp-core/workflows/vault-write-back.md +5 -0
  144. package/pp-core/workflows/verify-phase.md +5 -0
  145. package/pp-core/workflows/verify-work.md +8 -1
  146. package/scripts/prompt-injection-scan.sh +1 -1
  147. package/scripts/sync-runtime-launcher.cjs +115 -5
@@ -120,15 +120,24 @@ Read every frontend standard that passes these checks, also one the session's ow
120
120
  | Primary | | | | |
121
121
  | Secondary | | | | |
122
122
 
123
+ **Content and Communication**
124
+
125
+ | Aspect | Decision | Notes |
126
+ |--------|----------|-------|
127
+ | Tone of voice | | |
128
+ | Notifications and alerts | | |
129
+ | Tooltips, help text and inline guidance | | |
130
+ | Languages | | |
131
+
123
132
  **Key Decisions**
124
133
 
125
- | # | Decision | Rationale | Owner | Date |
134
+ | ID | Decision | Rationale | Owner | Date |
126
135
  |---|----------|-----------|-------|------|
127
136
  | | | | | |
128
137
 
129
138
  **Action Items**
130
139
 
131
- | # | Action | Owner | Due Date | Status |
140
+ | ID | Action | Owner | Due Date | Status |
132
141
  |---|--------|-------|----------|--------|
133
142
  | | | | | |
134
143
 
@@ -20,8 +20,8 @@
20
20
  *Why it matters: the stack choice determines team skills, hosting (Session 10), and integration patterns (Session 8). Skip when: the stack is fixed by client mandate.*
21
21
  - What is the preferred frontend technology (React, Angular, Vue, Mendix, etc.)?
22
22
  - What is the preferred backend technology (Node.js, .NET, Java, Python)?
23
- - What database technology is appropriate (relational e.g. Cloud SQL via pareto-platform-gcp, document, graph, time-series)?
24
- - What messaging or eventing technology will be used (Google Cloud Pub/Sub via pareto-platform-gcp, Kafka, RabbitMQ)?
23
+ - What database technology is appropriate (relational, document, graph, time-series), preferring the managed services of the platform Session 1 recorded?
24
+ - What messaging or eventing technology will be used (the platform's managed broker, Kafka, RabbitMQ)?
25
25
  - What caching strategy applies (Redis, in-memory, CDN)?
26
26
 
27
27
  3. **Key architectural components**
@@ -46,7 +46,7 @@
46
46
 
47
47
  **Notes Template:**
48
48
 
49
- > **Platform standard (D-08):** The Pareto platform standard is GCP / `pareto-platform-gcp`. Fill this table against that baseline unless the client has an overriding constraint.
49
+ > **Platform:** fill this table against the platform Session 1 recorded (its `D-01-<n>` platform decision, citing the vault's platform standard when there is one). A row that departs from that platform is a Key Decisions row `D-05-<n>`. When Session 1 recorded the platform as open, each row's Rationale says why the technology was chosen.
50
50
 
51
51
  **Technology Stack Decisions**
52
52
 
@@ -85,12 +85,12 @@
85
85
 
86
86
  **Key Decisions**
87
87
 
88
- | # | Decision | Rationale | Owner | Date |
88
+ | ID | Decision | Rationale | Owner | Date |
89
89
  |---|----------|-----------|-------|------|
90
90
  | | | | | |
91
91
 
92
92
  **Action Items**
93
93
 
94
- | # | Action | Owner | Due Date | Status |
94
+ | ID | Action | Owner | Due Date | Status |
95
95
  |---|--------|-------|----------|--------|
96
96
  | | | | | |
@@ -24,7 +24,7 @@
24
24
  - What are the audit requirements and cadence?
25
25
 
26
26
  3. **Encryption strategy**
27
- *Why it matters: key management choices here constrain infrastructure options in Session 10. Skip when: the platform standard (GCP KMS) already covers requirements with no exceptions.*
27
+ *Why it matters: key management choices here constrain infrastructure options in Session 10. Skip when: the key management service of the platform Session 1 recorded already covers requirements with no exceptions.*
28
28
  - What encryption is required at rest (AES-256, TDE)?
29
29
  - What encryption is required in transit (TLS 1.2+, mTLS)?
30
30
  - How will encryption keys be managed (HSM, KMS, Vault)?
@@ -94,12 +94,12 @@
94
94
 
95
95
  **Key Decisions**
96
96
 
97
- | # | Decision | Rationale | Owner | Date |
97
+ | ID | Decision | Rationale | Owner | Date |
98
98
  |---|----------|-----------|-------|------|
99
99
  | | | | | |
100
100
 
101
101
  **Action Items**
102
102
 
103
- | # | Action | Owner | Due Date | Status |
103
+ | ID | Action | Owner | Due Date | Status |
104
104
  |---|--------|-------|----------|--------|
105
105
  | | | | | |
@@ -85,12 +85,12 @@
85
85
 
86
86
  **Key Decisions**
87
87
 
88
- | # | Decision | Rationale | Owner | Date |
88
+ | ID | Decision | Rationale | Owner | Date |
89
89
  |---|----------|-----------|-------|------|
90
90
  | | | | | |
91
91
 
92
92
  **Action Items**
93
93
 
94
- | # | Action | Owner | Due Date | Status |
94
+ | ID | Action | Owner | Due Date | Status |
95
95
  |---|--------|-------|----------|--------|
96
96
  | | | | | |
@@ -72,12 +72,24 @@
72
72
 
73
73
  **Key Decisions**
74
74
 
75
- | # | Decision | Rationale | Owner | Date |
75
+ | ID | Decision | Rationale | Owner | Date |
76
76
  |---|----------|-----------|-------|------|
77
77
  | | | | | |
78
78
 
79
79
  **Action Items**
80
80
 
81
- | # | Action | Owner | Due Date | Status |
81
+ | ID | Action | Owner | Due Date | Status |
82
82
  |---|--------|-------|----------|--------|
83
83
  | | | | | |
84
+
85
+ **Mid-Sprint Cross-Reference**
86
+
87
+ Filled by the Closing Step below: the findings count by severity, each fix applied (file, what changed, why), and each finding left for Session 13.
88
+
89
+ ---
90
+
91
+ **Closing Step — mid-sprint cross-reference.** Run it after Step 7 and before Step 8, every time Session 8 completes, including a redo. Sessions 9–12 build on Sessions 1–8; an inconsistency found now costs one edit, while Session 13 finds it repeated in every later session.
92
+
93
+ 1. Read `${PP_TOOLS%/bin/pp-tools.cjs}/workflows/discovery-sprint/sessions/13-wrap-up.md` § **Step 0** and run 0a to 0e over Sessions 1–8 only: the **Business Functional** and **Technical** groups. Skip the engine gates and the checklist rows that need Sessions 9–12.
94
+ 2. Check every amended decision against the back-amend rule (Flow 2 Step 6): the original line carries `→ amended by D-<ss>-<n>`. Fix any line that does not.
95
+ 3. Record the results in this session's **Mid-Sprint Cross-Reference** notes. Session 13 re-checks the findings left open here.
@@ -96,12 +96,12 @@
96
96
 
97
97
  **Key Decisions**
98
98
 
99
- | # | Decision | Rationale | Owner | Date |
99
+ | ID | Decision | Rationale | Owner | Date |
100
100
  |---|----------|-----------|-------|------|
101
101
  | | | | | |
102
102
 
103
103
  **Action Items**
104
104
 
105
- | # | Action | Owner | Due Date | Status |
105
+ | ID | Action | Owner | Due Date | Status |
106
106
  |---|--------|-------|----------|--------|
107
107
  | | | | | |
@@ -10,24 +10,24 @@
10
10
  **What We Cover:**
11
11
 
12
12
  1. **Cloud / hosting strategy**
13
- *Why it matters: hosting choice constrains every deployment, monitoring, and DR decision below. Skip when: the platform standard (GCP/pareto-platform-gcp) applies with no client override.*
14
- - What cloud provider will be used (GCP / `pareto-platform-gcp` is the Pareto platform standard; or AWS, Azure, on-premises, hybrid)?
13
+ *Why it matters: hosting choice constrains every deployment, monitoring, and DR decision below. Skip when: Session 1 recorded a mandated platform and the client has no override.*
14
+ - What cloud provider will be used? Start from the platform Session 1 recorded; when it is open, choose between cloud providers, on-premises and hybrid.
15
15
  - What is the account and subscription structure?
16
16
  - What regions and availability zones are required?
17
17
  - Are there data sovereignty or residency requirements that constrain hosting?
18
18
  - What is the cost model and budget for infrastructure? [needs-business-input]
19
19
 
20
20
  2. **Deployment strategy**
21
- *Why it matters: deployment model determines rollback risk and go-live readiness criteria (Session 13). Skip when: the platform CI/CD pipeline already fixes this by default.*
21
+ *Why it matters: deployment model determines rollback risk and go-live readiness criteria (Session 13). Skip when: the mandated platform's CI/CD pipeline already fixes this by default.*
22
22
  - What deployment model will be used (blue-green, canary, rolling, immutable)?
23
23
  - How will the CI/CD pipeline be structured?
24
- - What tools will be used for CI/CD (GitLab CI is the Pareto platform pipeline; or GitHub Actions, Azure DevOps, Jenkins)?
24
+ - What tools will be used for CI/CD (GitHub Actions, GitLab CI, Azure DevOps, Jenkins)? Take the platform's pipeline when Session 1 recorded one.
25
25
  - How will infrastructure be managed (IaC with Terraform, Pulumi, CloudFormation)?
26
- - What is the approach to containerization (GKE or Cloud Run via pareto-platform-gcp; Docker/Kubernetes on-prem; or other cloud options)?
26
+ - What is the approach to containerization (the platform's managed container or Kubernetes service, Kubernetes on-premises, or none)?
27
27
 
28
28
  3. **Monitoring, logging, and alerting**
29
- *Why it matters: alerting design determines who gets paged and how incidents are caught pre-go-live. Skip when: a platform-standard observability stack already covers requirements.*
30
- - What monitoring platform will be used (Google Cloud Monitoring / Cloud Logging via pareto-platform-gcp; or Datadog, New Relic, CloudWatch)?
29
+ *Why it matters: alerting design determines who gets paged and how incidents are caught pre-go-live. Skip when: the mandated platform's observability stack already covers requirements.*
30
+ - What monitoring platform will be used (the platform's native monitoring and logging, or Datadog, New Relic, Grafana)?
31
31
  - What metrics will be tracked (latency, error rate, throughput, saturation)?
32
32
  - What is the alerting strategy (thresholds, escalation chains, on-call rotation)?
33
33
  - How will application logs be aggregated and queried?
@@ -48,7 +48,7 @@
48
48
 
49
49
  **Notes Template:**
50
50
 
51
- > **Platform standard (D-08):** The Pareto deployment platform is GCP / `pareto-platform-gcp` with GitLab CI as the CI/CD pipeline and Google Cloud Monitoring / Cloud Logging for observability. Fill the tables below against this baseline unless the client has an overriding constraint.
51
+ > **Platform:** fill the tables below against the platform Session 1 recorded (its `D-01-<n>` platform decision, citing the vault's platform standard when there is one): its cloud provider, CI/CD pipeline and observability stack. A choice that departs from it is a Key Decisions row `D-10-<n>`. When Session 1 recorded the platform as open, the choices are made here.
52
52
 
53
53
  **Infrastructure Architecture**
54
54
 
@@ -103,12 +103,12 @@
103
103
 
104
104
  **Key Decisions**
105
105
 
106
- | # | Decision | Rationale | Owner | Date |
106
+ | ID | Decision | Rationale | Owner | Date |
107
107
  |---|----------|-----------|-------|------|
108
108
  | | | | | |
109
109
 
110
110
  **Action Items**
111
111
 
112
- | # | Action | Owner | Due Date | Status |
112
+ | ID | Action | Owner | Due Date | Status |
113
113
  |---|--------|-------|----------|--------|
114
114
  | | | | | |
@@ -14,7 +14,7 @@
14
14
  - What are the major phases of the project (Discovery, Build, UAT, Go-Live, Hypercare)?
15
15
  - What is the overall timeline from build start to production go-live?
16
16
  - Are there hard deadlines driven by business events, regulatory dates, or contracts? [needs-business-input]
17
- - What is the sprint cadence (1-week, 2-week, 3-week)?
17
+ - What is the iteration model: calendar sprints (1, 2 or 3 weeks), or one iteration = one pp-core phase (discuss, plan, execute, verify), sized by scope rather than by the calendar? Record the choice as `D-11-<n>`; Session 12's cadence follows it.
18
18
 
19
19
  2. **MVP scope confirmation**
20
20
  *Why it matters: re-validates Session 3's MVP boundary before locking the build order below. Skip when: no time has passed since Session 3 and nothing has changed.*
@@ -24,7 +24,7 @@
24
24
  - What is the minimum viable product that demonstrates value to end-users?
25
25
 
26
26
  3. **Build order and dependencies**
27
- *Why it matters: this ordering becomes the literal sprint-by-sprint plan the delivery team executes. Skip when: only a single EPIC exists with no sequencing decision to make.*
27
+ *Why it matters: this ordering becomes the literal iteration-by-iteration plan the delivery team executes. Skip when: only a single EPIC exists with no sequencing decision to make.*
28
28
  - In what order should EPICs be built?
29
29
  - What are the technical dependencies between EPICs?
30
30
  - Are there infrastructure or integration prerequisites that must be ready first?
@@ -38,6 +38,7 @@
38
38
 
39
39
  5. **Risk register and mitigation**
40
40
  *Why it matters: risks captured here are what Session 13's go/no-go recommendation weighs most heavily. Skip when: never — always capture at least the top known risks.*
41
+ - Which risks from Session 1's **Constraints and Risks Register** are still open? They keep their `R-` IDs here.
41
42
  - What are the top project risks (technical, resourcing, scope, external)?
42
43
  - What is the likelihood and impact of each risk?
43
44
  - What mitigation strategies will be applied?
@@ -50,7 +51,7 @@
50
51
  | Phase | Start Date | End Date | Duration | Key Activities | Dependencies |
51
52
  |-------|-----------|----------|----------|---------------|--------------|
52
53
  | Discovery | | | | | |
53
- | Sprint 0 / Setup | | | | | |
54
+ | Setup (Sprint 0 or first phase) | | | | | |
54
55
  | Build -- MVP | | | | | |
55
56
  | UAT | | | | | |
56
57
  | Go-Live | | | | | |
@@ -58,10 +59,12 @@
58
59
 
59
60
  **EPIC Build Order**
60
61
 
61
- | Order | EPIC ID | EPIC Name | Sprint(s) | Dependencies | Critical Path? | Notes |
62
- |-------|---------|-----------|-----------|--------------|---------------|-------|
62
+ | Order | EPIC ID | EPIC Name | Iteration(s) | Dependencies | Critical Path? | Notes |
63
+ |-------|---------|-----------|--------------|--------------|---------------|-------|
63
64
  | 1 | | | | | | |
64
65
 
66
+ **Iteration(s)** names sprints (`S1–S2`) or pp-core phases (`Phase 3`), following the iteration model chosen in topic 1.
67
+
65
68
  **Milestone Plan**
66
69
 
67
70
  | Milestone | Target Date | Included EPICs / Features | Entry Criteria | Exit Criteria | Stakeholder Demo? |
@@ -74,17 +77,17 @@
74
77
  **Risk Register**
75
78
 
76
79
  | ID | Risk Description | Category | Likelihood (H/M/L) | Impact (H/M/L) | Risk Score | Mitigation | Owner | Status |
77
- |----|-----------------|----------|--------------------|-----------------|-----------|-----------:|-------|--------|
80
+ |----|-----------------|----------|--------------------|-----------------|-----------|------------|-------|--------|
78
81
  | R-01 | | | | | | | | |
79
82
 
80
83
  **Key Decisions**
81
84
 
82
- | # | Decision | Rationale | Owner | Date |
85
+ | ID | Decision | Rationale | Owner | Date |
83
86
  |---|----------|-----------|-------|------|
84
87
  | | | | | |
85
88
 
86
89
  **Action Items**
87
90
 
88
- | # | Action | Owner | Due Date | Status |
91
+ | ID | Action | Owner | Due Date | Status |
89
92
  |---|--------|-------|----------|--------|
90
93
  | | | | | |
@@ -5,34 +5,34 @@
5
5
 
6
6
  ### Session 12: Team & Delivery Model Definition
7
7
 
8
- **Goal:** Define the team structure and roles, establish governance and decision-making processes, agree on agile ceremonies, and plan the support model for post-go-live.
8
+ **Goal:** Define the team structure and roles, establish governance and decision-making processes, agree on the working rhythm, and plan the support model for post-go-live. The model fits the team shape Session 1 recorded, from a full delivery team to one person working with an AI assistant.
9
9
 
10
10
  **What We Cover:**
11
11
 
12
12
  1. **Team structure and roles**
13
13
  *Why it matters: role allocation is what the Session 11 build-order plan assumes has capacity to execute. Skip when: the team is already fully staffed and roles are fixed by contract.*
14
- - What roles are needed for the build phase (PO, Scrum Master, developers, QA, UX, architect)?
15
- - How many people are needed for each role?
14
+ - What roles are needed for the build phase (product owner, delivery lead, architect, developers, QA, UX)?
15
+ - How many people are needed for each role? In a small team one person holds several roles: list each role, with the same name against it. When an AI assistant does part of the work, give it its own row, with the person who reviews its output.
16
16
  - Which roles are filled by the client and which by the delivery partner? [needs-business-input]
17
17
  - Are there part-time or shared resources? What is their allocation?
18
18
 
19
19
  2. **Governance and decision-making**
20
20
  *Why it matters: governance structure determines how scope changes get approved mid-build, preventing later rework. Skip when: an existing PMO governance model already applies unchanged.*
21
- - What is the governance structure (steering committee, project board)?
21
+ - What is the governance structure (steering committee, project board, or a single sponsor)? Start from Session 1's **Approval Matrix**.
22
22
  - How often does the governance body meet?
23
23
  - What decisions require steering committee approval vs. team-level authority?
24
24
  - What is the escalation path for blockers or scope changes?
25
25
 
26
- 3. **Agile ceremonies and cadence**
27
- *Why it matters: cadence must match the sprint length assumed in Session 11's timeline. Skip when: the team already has an established ceremony rhythm from prior engagements.*
28
- - What agile framework will be followed (Scrum, Kanban, SAFe, hybrid)?
29
- - What is the sprint cadence and duration?
30
- - What ceremonies are planned (standup, sprint planning, review, retrospective, backlog refinement)?
26
+ 3. **Working rhythm and cadence**
27
+ *Why it matters: the rhythm must match the iteration model Session 11 chose. Skip when: the team already has an established rhythm from prior engagements.*
28
+ - What way of working will be followed (Scrum, Kanban, pp-core phases, hybrid)?
29
+ - What is the iteration cadence: the sprint length, or the pp-core phase rhythm Session 11 chose?
30
+ - Which meetings are held? For a pp-core phase rhythm, planning is `/pp-discuss-phase` plus `/pp-plan-phase` and review is `/pp-verify-work` with the client. A one-person team drops the meetings it has no one to hold; record each one dropped as `D-12-<n>`.
31
31
  - What tools will be used for backlog management (Jira, Azure DevOps, Linear)?
32
32
 
33
33
  4. **Communication and reporting**
34
34
  *Why it matters: reporting cadence sets stakeholder expectations for visibility into progress. Skip when: an existing status-reporting process already covers this project.*
35
- - How will progress be communicated to stakeholders (sprint review, status report, dashboard)?
35
+ - How will progress be communicated to stakeholders (iteration review, status report, dashboard)?
36
36
  - What is the reporting cadence (weekly, bi-weekly)?
37
37
  - What metrics will be tracked (velocity, burndown, defect rate, cycle time)?
38
38
 
@@ -50,12 +50,13 @@
50
50
  | Role | Name / TBD | Allocation (%) | Responsible Party (Client / Partner) | Start Date | Notes |
51
51
  |------|-----------|----------------|--------------------------------------|-----------|-------|
52
52
  | Product Owner | | | | | |
53
- | Scrum Master | | | | | |
53
+ | Delivery Lead (Scrum Master, or none) | | | | | |
54
54
  | Solution Architect | | | | | |
55
55
  | Frontend Developer | | | | | |
56
56
  | Backend Developer | | | | | |
57
57
  | QA Engineer | | | | | |
58
58
  | UX Designer | | | | | |
59
+ | AI assistant (reviewed by) | | | | | |
59
60
 
60
61
  **Governance Structure**
61
62
 
@@ -69,11 +70,13 @@
69
70
 
70
71
  | Ceremony | Cadence | Duration | Participants | Facilitator | Tool |
71
72
  |----------|---------|----------|--------------|-------------|------|
72
- | Daily standup | Daily | | | | |
73
- | Sprint planning | Per sprint | | | | |
74
- | Sprint review | Per sprint | | | | |
75
- | Retrospective | Per sprint | | | | |
76
- | Backlog refinement | Weekly | | | | |
73
+ | Daily sync | | | | | |
74
+ | Iteration planning | Per iteration | | | | |
75
+ | Iteration review / demo | Per iteration | | | | |
76
+ | Retrospective | Per iteration | | | | |
77
+ | Backlog refinement | | | | | |
78
+
79
+ An iteration is a sprint or a pp-core phase, as Session 11 chose. Write `—` in **Cadence** for a meeting the team does not hold.
77
80
 
78
81
  **Support Model**
79
82
 
@@ -85,12 +88,12 @@
85
88
 
86
89
  **Key Decisions**
87
90
 
88
- | # | Decision | Rationale | Owner | Date |
91
+ | ID | Decision | Rationale | Owner | Date |
89
92
  |---|----------|-----------|-------|------|
90
93
  | | | | | |
91
94
 
92
95
  **Action Items**
93
96
 
94
- | # | Action | Owner | Due Date | Status |
97
+ | ID | Action | Owner | Due Date | Status |
95
98
  |---|--------|-------|----------|--------|
96
99
  | | | | | |
@@ -68,7 +68,7 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
68
68
 
69
69
  | ID | Item | Source Session | Priority (H/M/L) | Must Resolve Before Build? | Owner | Target Date | Status |
70
70
  |----|------|---------------|-------------------|---------------------------|-------|-------------|--------|
71
- | OI-1 | | | | | | | |
71
+ | OI-01 | | | | | | | |
72
72
 
73
73
  **Cross-Reference Analysis Results**
74
74
 
@@ -103,13 +103,13 @@ Before facilitating any topics, execute the **Session 13: Cross-Reference Protoc
103
103
 
104
104
  **Key Decisions**
105
105
 
106
- | # | Decision | Rationale | Owner | Date |
106
+ | ID | Decision | Rationale | Owner | Date |
107
107
  |---|----------|-----------|-------|------|
108
108
  | | | | | |
109
109
 
110
110
  **Action Items**
111
111
 
112
- | # | Action | Owner | Due Date | Status |
112
+ | ID | Action | Owner | Due Date | Status |
113
113
  |---|--------|-------|----------|--------|
114
114
  | | | | | |
115
115
 
@@ -162,6 +162,8 @@ For each group: read all session files AND `.planning/discovery/_context.md`. Cr
162
162
  - [ ] **Test strategy:** S9 covers all S3 requirements and S5 components
163
163
  - [ ] **Timeline and capacity:** S11 roadmap feasible given S12 team and S9 test needs
164
164
  - [ ] **Action items:** No duplicates or contradictions in `_progress.md`
165
+ - [ ] **Back-amends:** every decision that changes an earlier record has `→ amended by D-<ss>-<n>` at the original line (Flow 2 Step 6)
166
+ - [ ] **Mid-sprint findings:** every finding `session-08.md` **Mid-Sprint Cross-Reference** left open is fixed or deferred again here
165
167
 
166
168
  #### 0d. Present Findings
167
169
 
@@ -28,6 +28,12 @@ _Populated after Session 1 completion_
28
28
  ### Stakeholders
29
29
  <!-- Key stakeholder list with roles -->
30
30
 
31
+ ### Approval Routes
32
+ <!-- Who approves scope, budget, architecture and security deviations, go-live -->
33
+
34
+ ### Platform and Team Shape
35
+ <!-- Mandated platform (D-01-n) or "open"; team shape for the build -->
36
+
31
37
  ### Discovery Sprint Scope
32
38
  **In Scope:**
33
39
  -
@@ -218,13 +224,13 @@ _Populated after Session 11 completion_
218
224
  <!-- Phase breakdown -->
219
225
 
220
226
  ### Timeline
221
- <!-- Sprint cadence and key dates -->
227
+ <!-- Iteration model (sprints or pp-core phases) and key dates -->
222
228
 
223
229
  ### MVP Scope (Confirmed)
224
230
  <!-- Must-have vs nice-to-have -->
225
231
 
226
232
  ### Build Order
227
- <!-- Sprint-by-sprint plan -->
233
+ <!-- Iteration-by-iteration plan -->
228
234
 
229
235
  ### Key Milestones
230
236
  <!-- Milestone dates -->
@@ -244,7 +250,7 @@ _Populated after Session 12 completion_
244
250
  <!-- Governance framework summary -->
245
251
 
246
252
  ### Ceremonies
247
- <!-- Sprint cadence and meetings -->
253
+ <!-- Iteration cadence and the meetings held -->
248
254
 
249
255
  ### Support Model
250
256
  <!-- Post-go-live support approach -->
@@ -109,7 +109,9 @@ needs no knowledge of the vault's folders (PBI 75336).
109
109
 
110
110
  - **If `.planning/vault/SUMMARY.md` lists `INDEX.md`**, Read `.planning/vault/INDEX.md`. The
111
111
  selection index is `INDEX.md`. Take only its list lines of the form
112
- `` - `<path>` — <description> `` as candidates and ignore everything else in it.
112
+ `` - `<path>` — <description> `` as candidates and ignore everything else in it. A line whose
113
+ description starts with `[cross-cutting]` is a rule that binds every session — approval routes,
114
+ folder layout, naming — and is selected by the rule below, not by topic.
113
115
  - **Otherwise** select from the listing in `SUMMARY.md` itself (each path with its first heading).
114
116
  The selection index is `SUMMARY.md`. Print `vault: the vault ships no INDEX.md; selecting from
115
117
  the cache index` and continue.
@@ -132,7 +134,14 @@ or reordered session cannot move out from under its selection (D-11-16). Take th
132
134
  - Select a document when its index line bears on a decision one of this session's topics asks the
133
135
  client to make. Note the topic number; it is the "why" of the record.
134
136
  - Select at most **8** documents. When more qualify, keep the ones that bear on the most topics.
135
- - Selecting nothing is a valid outcome. Kick-off and wrap-up sessions often have nothing to select.
137
+ - **Always select every `[cross-cutting]` document as well**, outside the cap of 8 and whatever
138
+ the session's topics. The cap stops topic documents crowding each other out; it must never drop
139
+ a rule every decision answers to. A session can sign a deviation only the vault's approval route
140
+ may sign, or place a folder the layout rule forbids, without any of its topics naming that
141
+ document. Its record line says why: `` - `<path>` — cross-cutting: <what it governs> ``.
142
+ - Selecting nothing is a valid outcome when the index marks nothing `[cross-cutting]`. Wrap-up
143
+ sessions often have nothing to select; Session 1 selects the documents that state approval rules
144
+ or mandate a platform.
136
145
 
137
146
  **Bounds — the engine index decides what may be read.** Read a selected document only if
138
147
  `.planning/vault/SUMMARY.md` lists its path. The engine builds that listing with `isSecretFile`
@@ -182,7 +191,9 @@ answer in the session notes. The vault does not answer for the client; it puts t
182
191
  prior answer on the table. A loaded document that turns out to bear on no answer gets
183
192
  `— not used: <reason>` appended to its record line before the session closes. Flow 2 Step 7 runs
184
193
  `pp_run query discovery.vault-check <N>`, which fails while a recorded document is neither cited nor
185
- marked not used.
194
+ marked not used, and, when the record's index is `INDEX.md`, while a `[cross-cutting]` document has
195
+ no record line (`cross_cutting_missing`). A cross-cutting document that no answer drew on still
196
+ gets its line, marked `— not used: <reason>`; that line is the record that it was checked.
186
197
 
187
198
  ## 5. Return
188
199
 
@@ -182,8 +182,9 @@ For each numbered topic in the session's "What We Cover" section:
182
182
 
183
183
  ### Step 6: Key Decisions and Action Items
184
184
 
185
- Ask: "Any key decisions made?" → populate Key Decisions table.
186
- Ask: "Any action items to track?" → populate Action Items table and update `_progress.md`. (Parked-topic Action Items rows were already added in Step 5.3b — do not duplicate them here.)
185
+ Ask: "Any key decisions made?" → populate Key Decisions table; each row's **ID** is `D-<ss>-<n>`.
186
+ **Back-amend rule:** when a decision changes something an earlier session recorded — a decision, a requirement, a risk, a table value — edit the original line in the same step: keep its text and append `→ amended by D-<ss>-<n>`. A reader of the earlier session then sees the change where they read the old answer.
187
+ Ask: "Any action items to track?" → populate Action Items table (**ID** `A-<ss>-<n>`) and update `_progress.md`. (Parked-topic Action Items rows were already added in Step 5.3b — do not duplicate them here.)
187
188
  Ask: "Any positions taken that aren't decisions yet?" → append or update an `SP-<nn>` position block in `.planning/discovery/_sparring.md` with all seven fields (`Position` / `Key point` / `To nail down` / `DECISION` / `Residual risk accepted` / `Feeds:` / `Status:`). Evolve a position **in place** — never a second block for the same question, not even on a reversal (D-39).
188
189
 
189
190
  ### Step 7: Complete the Session
@@ -193,7 +194,7 @@ Ask: "Any positions taken that aren't decisions yet?" → append or update an `S
193
194
  3. Update `.planning/discovery/_context.md`: populate the session's output section with concise summaries.
194
195
  4. If the session content file carries a **Closing Step**, run it now, before Step 8.
195
196
  5. If `_feedback.md` exists, run `pp_run query discovery.screen-check --require-processed`. Non-zero: process the `Open` rows as `prototype.md` Step 7 describes before the session counts as closed.
196
- 6. If `session-NN.md` carries a `## Vault Context` section, run `pp_run query discovery.vault-check <N>`. Non-zero: cite each named document `[vault: <path>]` beside the answer it informed, or append `— not used: <reason>` to its record line, then re-run.
197
+ 6. If `session-NN.md` carries a `## Vault Context` section, run `pp_run query discovery.vault-check <N>`. Non-zero: cite each named document `[vault: <path>]` beside the answer it informed, or append `— not used: <reason>` to its record line; for `cross_cutting_missing`, add the named document's record line, read it against this session's decisions, and cite or mark it the same way. Then re-run.
197
198
 
198
199
  ### Step 8: Show Summary
199
200
 
@@ -229,16 +230,18 @@ When facilitating sessions, reference prior session outputs from `.planning/disc
229
230
  | Session 2 | Session 1: project context, vision, stakeholders |
230
231
  | Session 3 | Session 2: pain points, processes, personas, systems, data flows |
231
232
  | Session 4 | Session 1: vision, constraints. Session 2: personas, pain points. Session 3: processes, requirements, EPICs |
232
- | Session 5 | Session 3: requirements, scope. Session 4: UX decisions |
233
- | Session 6 | Session 5: architecture, technology stack |
233
+ | Session 5 | Session 1: platform decision. Session 3: requirements, scope. Session 4: UX decisions |
234
+ | Session 6 | Session 1: platform decision, approval routes. Session 5: architecture, technology stack |
234
235
  | Session 7 | Session 5: architecture. Session 6: security requirements |
235
236
  | Session 8 | Session 5: architecture, integration points |
236
237
  | Session 9 | Session 3: requirements. Session 5: architecture |
237
- | Session 10 | Session 5: architecture. Session 9: test environments |
238
- | Session 11 | Session 3: EPICs, scope. Session 5: architecture. Session 9: QA |
239
- | Session 12 | Session 11: roadmap, phases, timeline |
238
+ | Session 10 | Session 1: platform decision. Session 5: architecture. Session 9: test environments |
239
+ | Session 11 | Session 1: risks. Session 3: EPICs, scope. Session 5: architecture. Session 9: QA |
240
+ | Session 12 | Session 1: team shape, approval routes. Session 11: roadmap, iteration model, timeline |
240
241
  | Session 13 | All previous sessions — full context review |
241
242
 
243
+ **Shell you write yourself** (not a fence from this workflow): start every multi-line command with `[ -z "${ZSH_VERSION:-}" ] || emulate -R sh`, never begin a word with `=`, and use no GNU-only flags — the user's shell may be zsh on macOS. Read `${PP_TOOLS%/bin/pp-tools.cjs}/references/shell-portability.md` for why.
244
+
242
245
  ---
243
246
 
244
247
  ## Edge Cases
@@ -240,6 +240,7 @@ Introduction & Goals section.
240
240
  ```bash
241
241
 
242
242
  _PP_SHIM_NAME="pp-tools.cjs"; _pp_root() { ( for _v in $(env | sed -n 's/^\(GIT_[A-Za-z0-9_]*\)=.*/\1/p'); do unset "$_v"; done; _c=$(git rev-parse --git-common-dir 2>/dev/null); if [ "${_c##*/}" = .git ] && cd "$_c/.." 2>/dev/null; then pwd -P; else git rev-parse --show-toplevel 2>/dev/null || pwd; fi ); }; pp_run() { case "$PP_TOOLS" in *.cjs) node "$PP_TOOLS" "$@";; *) "$PP_TOOLS" "$@";; esac; }; _PP_RUNTIME_ROOT="${RUNTIME_DIR:-$(_pp_root)}"; PP_TOOLS="${_PP_RUNTIME_ROOT}/pp-core/bin/${_PP_SHIM_NAME}"; if [ -f "$PP_TOOLS" ]; then :; elif [ -f "${_PP_RUNTIME_ROOT}/.claude/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${_PP_RUNTIME_ROOT}/.claude/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${_PP_RUNTIME_ROOT}/.codex/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${_PP_RUNTIME_ROOT}/.codex/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "$HOME/.claude/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="$HOME/.claude/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${HERMES_HOME:-$HOME/.hermes}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${HERMES_HOME:-$HOME/.hermes}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${CURSOR_CONFIG_DIR:-$HOME/.cursor}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${CODEX_HOME:-$HOME/.codex}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${CODEX_HOME:-$HOME/.codex}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${GEMINI_CONFIG_DIR:-$HOME/.gemini}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${COPILOT_CONFIG_DIR:-$HOME/.copilot}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${AUGMENT_CONFIG_DIR:-$HOME/.augment}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${TRAE_CONFIG_DIR:-$HOME/.trae}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${TRAE_CONFIG_DIR:-$HOME/.trae}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${QWEN_CONFIG_DIR:-$HOME/.qwen}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${QWEN_CONFIG_DIR:-$HOME/.qwen}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${CLINE_CONFIG_DIR:-$HOME/.cline}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${CLINE_CONFIG_DIR:-$HOME/.cline}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${GROK_AGENTS_HOME:-$HOME/.agents}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${GROK_AGENTS_HOME:-$HOME/.agents}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/pp-core/bin/${_PP_SHIM_NAME}"; elif [ -f "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/pp-core/bin/${_PP_SHIM_NAME}" ]; then PP_TOOLS="${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/pp-core/bin/${_PP_SHIM_NAME}"; elif command -v pp-tools >/dev/null 2>&1; then PP_TOOLS="$(command -v pp-tools)"; else echo "ERROR: pp-tools.cjs not found at $PP_TOOLS and pp-tools is not on PATH. Run: npx -y @pareto4/pp-core@latest --claude --local" >&2; exit 1; fi; if [ -n "${CLAUDE_ENV_FILE:-}" ] && [ -n "${PP_TOOLS:-}" ]; then printf "export PATH='%s':\"\$PATH\"\n" "${PP_TOOLS%/*}" >> "$CLAUDE_ENV_FILE" 2>/dev/null || true; fi
243
+ [ -z "${ZSH_VERSION:-}" ] || emulate -R sh
243
244
  FILES="docs/architecture/architecture.md"
244
245
  ls docs/architecture/adr/*.md >/dev/null 2>&1 && FILES="$FILES docs/architecture/adr/*.md"
245
246
  pp_run commit "docs: generate architect-grade handoff (arc42-lite architecture + ADRs)" --files $FILES
@@ -96,6 +96,7 @@ Exit workflow.
96
96
  Check if CONTEXT.md already exists using `has_context` from init.
97
97
 
98
98
  ```bash
99
+ [ -z "${ZSH_VERSION:-}" ] || emulate -R sh
99
100
  ls ${phase_dir}/*-CONTEXT.md 2>/dev/null || true
100
101
  ```
101
102
 
@@ -210,6 +211,7 @@ Lightweight scan of existing code to inform assumption generation.
210
211
 
211
212
  **Step 1: Check for existing codebase maps**
212
213
  ```bash
214
+ [ -z "${ZSH_VERSION:-}" ] || emulate -R sh
213
215
  ls .planning/codebase/*.md 2>/dev/null || true
214
216
  ```
215
217
 
@@ -553,10 +555,10 @@ Write file.
553
555
  Commit phase context and discussion log:
554
556
 
555
557
  ```bash
556
- pp_run query commit "docs(${padded_phase}): capture phase context (assumptions mode)" --files "${phase_dir}/${padded_phase}-CONTEXT.md" "${phase_dir}/${padded_phase}-DISCUSSION-LOG.md"
558
+ pp_run query commit "docs(planning): capture phase context (assumptions mode)" --phase "${padded_phase}" --files "${phase_dir}/${padded_phase}-CONTEXT.md" "${phase_dir}/${padded_phase}-DISCUSSION-LOG.md"
557
559
  ```
558
560
 
559
- Confirm: "Committed: docs(${padded_phase}): capture phase context (assumptions mode)"
561
+ Confirm: "Committed: docs(planning): capture phase context (assumptions mode) — Phase: ${padded_phase}"
560
562
  </step>
561
563
 
562
564
  <step name="update_state">
@@ -571,7 +573,7 @@ pp_run query state.record-session \
571
573
  Commit STATE.md:
572
574
 
573
575
  ```bash
574
- pp_run query commit "docs(state): record phase ${PHASE} context session" --files .planning/STATE.md
576
+ pp_run query commit "docs(planning): record phase ${PHASE} context session" --phase "${padded_phase}" --files .planning/STATE.md
575
577
  ```
576
578
  </step>
577
579