codebyplan 1.5.1 → 1.8.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 (205) hide show
  1. package/dist/cli.js +4462 -748
  2. package/package.json +5 -1
  3. package/templates/.gitkeep +0 -0
  4. package/templates/README.md +20 -0
  5. package/templates/agents/cbp-cc-executor.md +213 -0
  6. package/templates/agents/cbp-database-agent.md +229 -0
  7. package/templates/agents/cbp-improve-claude.md +245 -0
  8. package/templates/agents/cbp-improve-round.md +284 -0
  9. package/templates/agents/cbp-mechanical-edits.md +111 -0
  10. package/templates/agents/cbp-research.md +282 -0
  11. package/templates/agents/cbp-round-executor.md +604 -0
  12. package/templates/agents/cbp-security-agent.md +134 -0
  13. package/templates/agents/cbp-task-check.md +213 -0
  14. package/templates/agents/cbp-task-planner.md +582 -0
  15. package/templates/agents/cbp-test-e2e-agent.md +363 -0
  16. package/templates/agents/cbp-testing-qa-agent.md +400 -0
  17. package/templates/context/mcp-docs.md +139 -0
  18. package/templates/hooks/README.md +236 -0
  19. package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
  20. package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
  21. package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
  22. package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
  23. package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
  24. package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
  25. package/templates/hooks/cbp-notify.sh +68 -0
  26. package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
  27. package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
  28. package/templates/hooks/cbp-statusline.sh +347 -0
  29. package/templates/hooks/cbp-subagent-statusline.sh +182 -0
  30. package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
  31. package/templates/hooks/cbp-test-hooks.sh +320 -0
  32. package/templates/hooks/hooks.json +85 -0
  33. package/templates/hooks/validate-context-usage.sh +59 -0
  34. package/templates/hooks/validate-git-commit.sh +78 -0
  35. package/templates/hooks/validate-git-stash-deny.sh +32 -0
  36. package/templates/hooks/validate-structure-lengths.sh +57 -0
  37. package/templates/hooks/validate-structure-lib.sh +104 -0
  38. package/templates/hooks/validate-structure-patterns.sh +54 -0
  39. package/templates/hooks/validate-structure-scope.sh +33 -0
  40. package/templates/hooks/validate-structure-smoke.sh +95 -0
  41. package/templates/hooks/validate-structure-templates.sh +34 -0
  42. package/templates/hooks/validate-structure.sh +69 -0
  43. package/templates/rules/.gitkeep +0 -0
  44. package/templates/rules/README.md +47 -0
  45. package/templates/rules/context-file-loading.md +52 -0
  46. package/templates/rules/scope-vocabulary.md +64 -0
  47. package/templates/rules/todo-backend.md +109 -0
  48. package/templates/settings.project.base.json +55 -0
  49. package/templates/settings.user.base.json +25 -0
  50. package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
  51. package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
  52. package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
  53. package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
  54. package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
  55. package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
  56. package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
  57. package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
  58. package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
  59. package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
  60. package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
  61. package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
  62. package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
  63. package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
  64. package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
  65. package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
  66. package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
  67. package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
  68. package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
  69. package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
  70. package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
  71. package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
  72. package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
  73. package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
  74. package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
  75. package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
  76. package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
  77. package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
  78. package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
  79. package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
  80. package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
  81. package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
  82. package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
  83. package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
  84. package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
  85. package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
  86. package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
  87. package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
  88. package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
  89. package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
  90. package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
  91. package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
  92. package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
  93. package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
  94. package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
  95. package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
  96. package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
  97. package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
  98. package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
  99. package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
  100. package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
  101. package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
  102. package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
  103. package/templates/skills/cbp-checkpoint-create/SKILL.md +287 -0
  104. package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
  105. package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
  106. package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
  107. package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
  108. package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
  109. package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
  110. package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
  111. package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
  112. package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
  113. package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
  114. package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
  115. package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
  116. package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
  117. package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
  118. package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
  119. package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
  120. package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
  121. package/templates/skills/cbp-git-commit/SKILL.md +278 -0
  122. package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
  123. package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
  124. package/templates/skills/cbp-merge-main/SKILL.md +228 -0
  125. package/templates/skills/cbp-round-check/SKILL.md +104 -0
  126. package/templates/skills/cbp-round-end/SKILL.md +183 -0
  127. package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
  128. package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
  129. package/templates/skills/cbp-round-execute/SKILL.md +211 -0
  130. package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
  131. package/templates/skills/cbp-round-input/SKILL.md +165 -0
  132. package/templates/skills/cbp-round-start/SKILL.md +222 -0
  133. package/templates/skills/cbp-round-update/SKILL.md +163 -0
  134. package/templates/skills/cbp-session-end/SKILL.md +187 -0
  135. package/templates/skills/cbp-session-start/SKILL.md +155 -0
  136. package/templates/skills/cbp-ship/SKILL.md +332 -0
  137. package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
  138. package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
  139. package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
  140. package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
  141. package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
  142. package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
  143. package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
  144. package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
  145. package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
  146. package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
  147. package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
  148. package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
  149. package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
  150. package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
  151. package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
  152. package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
  153. package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
  154. package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
  155. package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
  156. package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
  157. package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
  158. package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
  159. package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
  160. package/templates/skills/cbp-ship/reference/versioning.md +116 -0
  161. package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
  162. package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
  163. package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
  164. package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
  165. package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
  166. package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
  167. package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
  168. package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
  169. package/templates/skills/cbp-ship/templates/eas.json +66 -0
  170. package/templates/skills/cbp-ship/templates/railway.toml +15 -0
  171. package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
  172. package/templates/skills/cbp-ship/templates/vercel.json +19 -0
  173. package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
  174. package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
  175. package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
  176. package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
  177. package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
  178. package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
  179. package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
  180. package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
  181. package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
  182. package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
  183. package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
  184. package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
  185. package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
  186. package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
  187. package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
  188. package/templates/skills/cbp-ship-main/SKILL.md +65 -0
  189. package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
  190. package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
  191. package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
  192. package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
  193. package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
  194. package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
  195. package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
  196. package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
  197. package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
  198. package/templates/skills/cbp-task-check/SKILL.md +166 -0
  199. package/templates/skills/cbp-task-complete/SKILL.md +206 -0
  200. package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
  201. package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
  202. package/templates/skills/cbp-task-create/SKILL.md +167 -0
  203. package/templates/skills/cbp-task-start/SKILL.md +239 -0
  204. package/templates/skills/cbp-task-testing/SKILL.md +277 -0
  205. package/templates/skills/cbp-todo/SKILL.md +97 -0
@@ -0,0 +1,181 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-frontend-ux
4
+ description: Interaction-quality self-review pass loaded by round-executor AFTER UI code is written. Catches navigation flow issues, missing feedback states, cognitive-load problems, form usability gaps, and accessibility violations. Auto-applies in-scope mechanical UX fixes within the round's files_changed. Replaces the post-implementation ux-agent spawn with an inline skill invocation.
5
+ effort: xhigh
6
+ ---
7
+
8
+ # Frontend UX (Post-Implementation Interaction Self-Review)
9
+
10
+ Loaded by `round-executor` Step 3.8 AFTER UI code is written. Inline counterpart of `frontend-design` (pre-implementation aesthetic) and sibling of `frontend-ui` (post-implementation visual review). This skill evaluates interaction quality and auto-applies mechanical UX fixes that fall inside the round's `files_changed`.
11
+
12
+ ## When this skill fires
13
+
14
+ Round-executor invokes when the round's `files_changed` contains ANY of:
15
+
16
+ - `*.tsx`, `*.jsx` (React, RN, RN-Web components)
17
+ - New page / screen / route / layout files
18
+ - Form / modal / interactive control files
19
+ - Plan deliverables explicitly mentioning interaction, navigation, form, feedback, error, loading
20
+
21
+ If none match, skip — proceed to Step 4 (Quality Checks).
22
+
23
+ ## Input Contract
24
+
25
+ ```yaml
26
+ input:
27
+ task_number: number
28
+ round_number: number
29
+ files_changed: [{path, action}]
30
+ context:
31
+ checkpoint_goal: string
32
+ round_requirements: string
33
+ ```
34
+
35
+ ## Output Contract
36
+
37
+ ```yaml
38
+ output:
39
+ status: 'completed'
40
+ findings:
41
+ - category: 'navigation' | 'interaction' | 'feedback' | 'cognitive_load' | 'form_usability' | 'error_handling'
42
+ severity: 'critical' | 'warning' | 'suggestion'
43
+ file: string
44
+ issue: string
45
+ suggestion: string
46
+ files_changed:
47
+ - path: string
48
+ action: 'modified'
49
+ fix_for: string # Which finding this fix addresses
50
+ summary:
51
+ total_issues: number
52
+ critical: number
53
+ warnings: number
54
+ suggestions: number
55
+ auto_fixed: number
56
+ out_of_scope_fixes: number # Findings whose fix would have edited a file not in files_changed
57
+ ```
58
+
59
+ The executor writes the output to `round.context.frontend_ux_review` and merges `files_changed` into the round's `files_changed` list.
60
+
61
+ ## Workflow
62
+
63
+ ### Phase 1: Read Changed Files
64
+
65
+ Read all `.tsx` and page/layout files from `files_changed`. Identify components, pages, and interaction handlers.
66
+
67
+ ### Phase 2: Navigation Flow
68
+
69
+ - Check page transitions and routing logic
70
+ - Verify breadcrumbs, back navigation, and deep links
71
+ - Check that navigation state is preserved across page changes
72
+ - Verify loading states during navigation
73
+
74
+ ### Phase 2.5: Mobile Density Check
75
+
76
+ For settings/configuration screens with multiple sections:
77
+
78
+ 1. **Scroll height vs viewport**: Estimate total content height. Flag if >3x viewport height
79
+ 2. **Compact layouts**: Verify list-type sections use chip rows, toggle rows, or horizontal selectors — not vertical block layouts
80
+ 3. **Conceptual clarity**: Check whether section groupings match user mental model (e.g., "schedule type" is clearer than separate "preferred days" + "time windows")
81
+ 4. **Touch targets**: Verify compact elements still meet minimum touch target (except when user explicitly requests smaller)
82
+
83
+ Report findings under `cognitive_load` category with `warning` severity.
84
+
85
+ ### Phase 3: Interaction Patterns
86
+
87
+ - Check click/touch target sizes (minimum 44x44px)
88
+ - Verify drag-and-drop has proper visual feedback
89
+ - Check hover states provide clear affordance
90
+ - Verify interactive elements have cursor changes
91
+ - Check that disabled states are visually distinct
92
+
93
+ ### Phase 4: User Feedback
94
+
95
+ - Verify loading states exist for async operations
96
+ - Check success/error messages after form submissions
97
+ - Verify progress indicators for multi-step processes
98
+ - Check that empty states have helpful messaging
99
+ - Verify optimistic updates where appropriate
100
+
101
+ ### Phase 5: Cognitive Load
102
+
103
+ - Check information density (not too much on screen)
104
+ - Verify visual hierarchy guides the eye
105
+ - Check that related items are grouped logically
106
+ - Verify progressive disclosure for complex interfaces
107
+ - Check that actions are clearly labeled
108
+
109
+ ### Phase 6: Form Usability
110
+
111
+ - Check input labels and placeholders
112
+ - Verify validation messages are clear and positioned near inputs
113
+ - Check tab order is logical
114
+ - Verify autofocus on primary input
115
+ - Check that required fields are marked
116
+
117
+ ### Phase 7: Error Handling UX
118
+
119
+ - Verify error messages are user-friendly (not technical)
120
+ - Check recovery paths from error states
121
+ - Verify network error handling (offline, timeout)
122
+ - Check that errors do not lose user input
123
+
124
+ ### Phase 8: Aggregate Findings
125
+
126
+ Categorize by severity:
127
+ - **Critical**: Missing feedback states, broken navigation, lost user input
128
+ - **Warning**: Suboptimal interaction patterns, unclear labels
129
+ - **Suggestion**: Enhanced micro-interactions, better copy
130
+
131
+ ### Phase 9: Auto-Fix In-Scope Findings
132
+
133
+ For every finding (critical, warning, and suggestion), apply the fix directly — but only when the file is in scope. The skill has Edit/Write capability via the executor's invocation; that capability requires a scope guard so the skill does not silently mutate files outside the round's contract (per `rules/workflow-discipline.md` "Agent Scope Boundary").
134
+
135
+ #### Pre-Edit Scope Gate (MANDATORY)
136
+
137
+ Before any Write/Edit:
138
+
139
+ 1. Build `allowed = new Set(input.files_changed.map(f => f.path))`.
140
+ 2. If the target path is in `allowed`, proceed to apply the fix.
141
+ 3. If the target path is NOT in `allowed`, do NOT edit. Instead:
142
+ - Emit the proposed fix as a `findings[]` entry with `severity: 'warning'` and a `suggestion` describing the change verbatim.
143
+ - Set `auto_fixed = false` for that finding.
144
+ - Increment `summary.out_of_scope_fixes`.
145
+
146
+ This rule applies to every file. The skill's auto-fix surface exists because in-scope mechanical fixes are part of its value, not because it should rewrite anything it sees worth improving.
147
+
148
+ **Specifically forbidden** (always out of scope, never edited regardless of `files_changed`):
149
+
150
+ - `.claude/**` — managed infrastructure under user-level governance
151
+ - Project test infrastructure (e.g., `playwright.config.*`, `e2e/**`) — governed by `test-e2e-agent`
152
+ - DB migrations (e.g., `supabase/migrations/**`) — governed by `database-agent`
153
+ - Vendor mirrors and read-only reference trees
154
+
155
+ If a UX-relevant change is needed in a forbidden path, raise it as a finding only.
156
+
157
+ #### In-Scope Auto-Fix Procedure
158
+
159
+ For findings whose target file IS in `allowed`:
160
+
161
+ 1. Read the file at the reported location
162
+ 2. Apply the fix (e.g., add missing loading state, add error feedback, fix tab order, improve labels, add empty states, enhance interaction patterns)
163
+ 3. Track in `files_changed` with `fix_for` referencing the finding
164
+ 4. Set `auto_fixed = true` on the finding
165
+
166
+ Go beyond fixing violations — actively improve user experience. If a form could have better validation feedback, add it. If a loading state is missing, add it. If labels are unclear, rewrite them. Deliver a comfortable, intuitive experience, not just a functional one.
167
+
168
+ **Do not change** business logic or data flow — only UX patterns (feedback, states, labels, interactions). The scope gate enforces *where* you may edit; this rule enforces *what kind* of edit is allowed.
169
+
170
+ ## Completion Criteria
171
+
172
+ - All changed page/component files reviewed
173
+ - Navigation, interaction, feedback patterns checked
174
+ - Critical/warning issues auto-fixed where possible (in-scope only)
175
+ - Findings categorized by severity
176
+
177
+ ## Integration
178
+
179
+ - **Loaded by**: `round-executor` Step 3.8 (mandatory when files_changed contains UI / interaction files)
180
+ - **Output written to**: `round.context.frontend_ux_review`
181
+ - **Paired with**: `frontend-design` (pre-implementation aesthetic), `frontend-ui` (visual self-review, also Step 3.8)
@@ -0,0 +1,115 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-git-branch-feat-create
4
+ description: Create feature branch from the production branch (main, config-driven)
5
+ argument-hint: "[name] e.g. add-user-auth"
6
+ effort: low
7
+ ---
8
+
9
+ # Git Branch Feat Create
10
+
11
+ Create a feature branch from the configured production branch (`main`).
12
+
13
+ ## Arguments
14
+
15
+ `$ARGUMENTS`: [name] - branch name without type prefix
16
+
17
+ Examples:
18
+ - `add-user-auth` → creates `feat/add-user-auth`
19
+ - `fix-login-bug` → creates `fix/fix-login-bug` (use fix prefix when fixing)
20
+
21
+ ## When to Use
22
+
23
+ - Starting work on new feature
24
+ - Triggered by `/cbp-checkpoint-create`
25
+ - Manual use for ad-hoc features
26
+
27
+ ## Prerequisites
28
+
29
+ - Repo must have the configured production branch (default `main`)
30
+ - Working tree must be clean
31
+
32
+ ## Instructions
33
+
34
+ ### Step 1: Read Branch Config
35
+
36
+ Read `.codebyplan/git.json` and extract `branch_config.production`:
37
+
38
+ ```
39
+ BASE = branch_config.production (default: "main")
40
+ ```
41
+
42
+ If `branch_config` is absent, fall back to `"main"`.
43
+
44
+ ### Step 2: Determine Repo Path
45
+
46
+ The repo path is the current working directory root:
47
+
48
+ ```bash
49
+ REPO_PATH="$(git rev-parse --show-toplevel)"
50
+ ```
51
+
52
+ ### Step 3: Verify Base Branch Exists
53
+
54
+ Check the base branch is present (exact match — local or remote):
55
+
56
+ ```bash
57
+ git rev-parse --verify "$BASE" >/dev/null 2>&1 || git ls-remote --exit-code --heads origin "$BASE" >/dev/null 2>&1
58
+ ```
59
+
60
+ **If the base branch is missing:**
61
+ ```
62
+ Base branch '$BASE' not found. Cannot create a feature branch.
63
+ ```
64
+ Stop here.
65
+
66
+ ### Step 4: Verify Clean State
67
+
68
+ ```bash
69
+ cd "$REPO_PATH" && git status --porcelain
70
+ ```
71
+
72
+ **If uncommitted changes:**
73
+ ```
74
+ Uncommitted changes exist. Commit your changes first.
75
+ ```
76
+ Stop here.
77
+
78
+ ### Step 5: Create Branch
79
+
80
+ ```bash
81
+ cd "$REPO_PATH" && git checkout "$BASE" && git checkout -b feat/$ARGUMENTS && git push -u origin feat/$ARGUMENTS
82
+ ```
83
+
84
+ ### Step 6: Show Result
85
+
86
+ ```
87
+ ## Branch Created
88
+
89
+ **Branch**: feat/[name]
90
+ **From**: [BASE]
91
+ **Pushed**: origin/feat/[name]
92
+
93
+ ---
94
+
95
+ Work on this branch. When done:
96
+ - Commit with `/cbp-git-commit`
97
+ - Ship via `/cbp-checkpoint-end` (feat → main, PR preview reviewed before merge)
98
+ ```
99
+
100
+ ## Branch Naming
101
+
102
+ *Branch type conventions follow GitFlow:*
103
+
104
+ | Type | When |
105
+ |------|------|
106
+ | `feat/` | New features (default) |
107
+ | `fix/` | Bug fixes |
108
+ | `chore/` | Maintenance |
109
+ | `refactor/` | Restructuring |
110
+
111
+ ## Integration
112
+
113
+ - **Triggered by**: `/cbp-checkpoint-create`
114
+ - **Followed by**: `/cbp-checkpoint-end` (ships feat → main via PR preview)
115
+ - **Config**: `branch_config.production` from `.codebyplan/git.json`
@@ -0,0 +1,278 @@
1
+ ---
2
+ scope: org-shared
3
+ name: cbp-git-commit
4
+ description: Create scoped commit with conventional format
5
+ argument-hint: "[--task|--all] [type]: [description]"
6
+ effort: low
7
+ ---
8
+
9
+ # Git Commit Command
10
+
11
+ Create a commit using conventional commits format, then push to origin.
12
+
13
+ ## When to Use
14
+
15
+ - Called by `/cbp-session-end` after files are staged
16
+ - Direct use when user provides explicit commit message
17
+
18
+ ## Arguments
19
+
20
+ `$ARGUMENTS`: [options] [type]: [description]
21
+
22
+ **Scope Flags (one optional):**
23
+ - `--task` - Commit all staged files (semantic: task context)
24
+ - `--all` - Commit all staged files (explicit, same as no scope flag)
25
+ - `--scope-task` - Commit ONLY files in the active task's `files_changed[]` (intersected with currently-staged files); leaves foreign-staged files alone
26
+
27
+ **Other Options:**
28
+ - `--files [file1] [file2] ...` - **Manual override**: commit ONLY these specific files
29
+ - `--no-push` - Skip push to remote
30
+
31
+ **Scope Flag Behavior:**
32
+
33
+ | Flag | File Source | Use Case |
34
+ |------|-------------|----------|
35
+ | `--task` | All staged files | `/cbp-task-complete` |
36
+ | `--all` | All staged files | Explicit full commit |
37
+ | `--scope-task` | Intersection of `task.files_changed[].path` and `git diff --cached --name-only` | Foreign-staged files exist alongside task work; user wants to commit only the task's files in this commit |
38
+ | (none) | All staged files | Default behavior |
39
+
40
+ When a scope flag is used:
41
+ - All staged files are committed (except `--scope-task`, which intersects with task files)
42
+ - Semantic distinction only (for context in calling commands)
43
+
44
+ **`--scope-task` Behavior:**
45
+
46
+ When `--scope-task` is used:
47
+ 1. Read `task.files_changed[].path` via MCP `get_current_task`
48
+ 2. Read currently-staged files via `git diff --cached --name-only`
49
+ 3. Compute intersection — only those paths are committed
50
+ 4. Foreign-staged files (in staged set but NOT in task) remain staged after the commit; user handles them in a separate commit
51
+ 5. If intersection is empty → error "No staged files belong to TASK-N. Either use --all to commit foreign-staged files, or stage task files first."
52
+
53
+ This is the right scope flag when `git status` shows foreign-staged batches alongside task work (e.g., a parallel `.claude/` sync staged simultaneously with TASK-N's work) and the commit narrative belongs to the task only.
54
+
55
+ **Manual Override: --files**
56
+
57
+ When `--files` is used (overrides scope flags):
58
+ - Only the specified files are committed
59
+ - Other staged files remain staged (not committed)
60
+ - Specified files MUST be staged, otherwise error
61
+ - This enables manual control when scoped flags don't fit
62
+
63
+ **Message formats:**
64
+ - `[type]: [description]`
65
+ - `[type](scope): [description]`
66
+
67
+ **Examples:**
68
+ - `feat: add user authentication` - Commit all staged, auto-push
69
+ - `--task feat(CHK-022): complete TASK-1` - Commit all staged in task context
70
+ - `--all fix(api): resolve timeout` - Explicit all-staged commit
71
+ - `--files path/to/file.md feat: add feature` - Manual specific file
72
+ - `--no-push chore: update deps` - Commit without pushing
73
+
74
+ If no message provided, analyze staged changes and generate message automatically.
75
+
76
+ ## Instructions
77
+
78
+ ### Step 1: Determine Repo Path
79
+
80
+ **CRITICAL**: The shell working directory may not match the session's repo.
81
+
82
+ Determine repo path from session context:
83
+
84
+ The repo path is the current working directory root:
85
+
86
+ ```bash
87
+ REPO_PATH="$(git rev-parse --show-toplevel)"
88
+ ```
89
+
90
+ ### Step 2: Parse Scope and Options
91
+
92
+ **Parse `$ARGUMENTS` for flags:**
93
+
94
+ 1. **Check for scope flag** (mutually exclusive):
95
+ - `--task` -> scope = "task" (commits all staged)
96
+ - `--all` -> scope = "all"
97
+ - `--scope-task` -> scope = "scope-task" (intersection of task.files_changed[] and staged)
98
+ - (none) -> scope = "all" (default)
99
+
100
+ 2. **Check for --files** (overrides scope):
101
+ - If `--files` present -> use manual file list, ignore scope
102
+
103
+ 3. **Check for --no-push**
104
+
105
+ 4. **Extract commit message** (remaining arguments after flags)
106
+
107
+ ### Step 2a: Collect Files (if --files or --scope-task used)
108
+
109
+ **If `--files` provided:** Use the manual file list.
110
+
111
+ **If `--scope-task`:** Resolve via MCP + intersection.
112
+
113
+ ```bash
114
+ # 1. Read task.files_changed[]
115
+ task_paths=$(mcp get_current_task | jq -r '.files_changed[].path')
116
+ # 2. Read staged paths
117
+ staged_paths=$(git diff --cached --name-only)
118
+ # 3. Compute intersection
119
+ intersect=$(comm -12 <(echo "$task_paths" | sort) <(echo "$staged_paths" | sort))
120
+ ```
121
+
122
+ If `intersect` is empty: emit error and STOP.
123
+
124
+ ```
125
+ ## Error: No Task Files Staged
126
+
127
+ Scope: --scope-task
128
+ TASK-N has [M] files in files_changed[]; none are currently staged.
129
+
130
+ Options:
131
+ - Stage task files: git add [path1] [path2] ...
132
+ - Or use --all to commit the foreign-staged files instead.
133
+ ```
134
+
135
+ If non-empty: use `intersect` as the file list for Step 5.
136
+
137
+ **If `--task`, `--all`, or no scope:** No filtering — all staged files committed.
138
+
139
+ ### Step 3: Check Staged Changes
140
+
141
+ ```bash
142
+ cd "$REPO_PATH" && git diff --cached --name-only
143
+ ```
144
+
145
+ **If nothing staged:**
146
+ - Show "No changes to commit."
147
+ - Stop here.
148
+
149
+ ### Step 4: Analyze Changes (if no message)
150
+
151
+ If no commit message provided:
152
+ 1. Read staged file diffs
153
+ 2. Determine commit type:
154
+ - New files with features -> `feat`
155
+ - Bug fixes -> `fix`
156
+ - Config/deps changes -> `chore`
157
+ - Documentation -> `docs`
158
+ - Refactoring -> `refactor`
159
+ 3. Generate message automatically
160
+
161
+ ### Step 4a: Verify Manual Files Are Staged
162
+
163
+ **If `--files`:** Verify each specified file is staged.
164
+
165
+ ```bash
166
+ cd "$REPO_PATH" && git diff --cached --name-only
167
+ ```
168
+
169
+ **If any specified files not staged:** Show error with missing files list and STOP.
170
+
171
+ **If `--task`, `--all`, or no scope:** Skip verification, use all staged.
172
+
173
+ ### Step 5: Create Commit
174
+
175
+ **For `--scope-task`:** commit only the intersection list from Step 2a:
176
+
177
+ ```bash
178
+ cd "$REPO_PATH" && git commit [intersect-file1] [intersect-file2] ... -m "$(cat <<'EOF'
179
+ [type]: [description]
180
+ EOF
181
+ )"
182
+ ```
183
+
184
+ Foreign-staged files remain in the index (not committed). The commit attribution covers only TASK-N's files.
185
+
186
+ **Determine commit mode:**
187
+
188
+ | Scope | Commit Command |
189
+ |-------|----------------|
190
+ | `--files [list]` | `git commit [file1] [file2] ...` |
191
+ | `--task` | `git commit` (all staged) |
192
+ | `--all` or (none) | `git commit` (all staged) |
193
+
194
+ **If --files (manual file list):**
195
+
196
+ Commit ONLY the specified files:
197
+
198
+ ```bash
199
+ cd "$REPO_PATH" && git commit [file1] [file2] ... -m "$(cat <<'EOF'
200
+ [type]: [description]
201
+ EOF
202
+ )"
203
+ ```
204
+
205
+ **If --task, --all, or no scope (commit all staged):**
206
+
207
+ ```bash
208
+ cd "$REPO_PATH" && git commit -m "$(cat <<'EOF'
209
+ [type]: [description]
210
+ EOF
211
+ )"
212
+ ```
213
+
214
+ ### Step 6: Push to Remote
215
+
216
+ **If `--no-push` option provided:**
217
+ - Skip this step
218
+ - Show "Push skipped (--no-push)"
219
+
220
+ **Otherwise:** push the current branch to origin.
221
+
222
+ ```bash
223
+ cd "$REPO_PATH" && BRANCH=$(git rev-parse --abbrev-ref HEAD) && git push origin "$BRANCH"
224
+ ```
225
+
226
+ **If push fails with "no upstream":** retry with `-u`.
227
+
228
+ ```bash
229
+ cd "$REPO_PATH" && git push -u origin "$BRANCH"
230
+ ```
231
+
232
+ **If push fails because remote is ahead:** report to user and stop — do not auto-pull. User resolves by running `git pull --rebase origin "$BRANCH"` and retrying.
233
+
234
+ ### Step 7: Show Result
235
+
236
+ Display output per Output Format section below.
237
+
238
+ ## Output Format
239
+
240
+ **Standard commit (all staged):**
241
+ ```
242
+ **Committed**: [short-hash]
243
+ **Message**: [type]: [description]
244
+ **Scope**: [--task / --all / --files]
245
+ **Files**: N files changed
246
+ **Pushed**: origin/[branch-name]
247
+ ```
248
+
249
+ **If no changes to commit:**
250
+ ```
251
+ No changes to commit.
252
+ ```
253
+
254
+ **If manual files not staged:**
255
+ ```
256
+ ## Error: Files Not Staged
257
+
258
+ Scope: --files
259
+ Missing: [N] files not staged
260
+
261
+ Stage the missing files or use --all.
262
+ ```
263
+
264
+ ## Integration
265
+
266
+ - **Called by**: `/cbp-session-end`, `/cbp-task-complete`, `/cbp-checkpoint-complete`, manual
267
+ - **Scope usage by commands**:
268
+ - `/cbp-task-complete` -> `--no-push` (commit all staged)
269
+ - `/cbp-checkpoint-complete` -> no scope needed
270
+ - `/cbp-session-end` -> `--all` or no scope (commit all staged)
271
+ - **Rules**: `/.claude/rules/git-workflow.md`
272
+
273
+ ## Key Points
274
+
275
+ 1. **Simplified scopes** - `--task` and `--all` both commit all staged files
276
+ 2. **Manual override** - `--files` takes precedence over scope flags
277
+ 3. **Verification** - Only `--files` needs staged verification
278
+ 4. **Default is --all** - No scope flag = commit all staged (backward compatible)