@event4u/agent-config 1.13.0 → 1.15.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 (291) hide show
  1. package/.agent-src/commands/agent-handoff.md +4 -1
  2. package/.agent-src/commands/agent-status.md +3 -0
  3. package/.agent-src/commands/agents-audit.md +4 -0
  4. package/.agent-src/commands/agents-cleanup.md +6 -1
  5. package/.agent-src/commands/agents-prepare.md +3 -0
  6. package/.agent-src/commands/analyze-reference-repo.md +4 -0
  7. package/.agent-src/commands/bug-fix.md +7 -3
  8. package/.agent-src/commands/bug-investigate.md +4 -0
  9. package/.agent-src/commands/chat-history-checkpoint.md +126 -0
  10. package/.agent-src/commands/chat-history-clear.md +6 -1
  11. package/.agent-src/commands/chat-history-resume.md +7 -2
  12. package/.agent-src/commands/chat-history.md +7 -2
  13. package/.agent-src/commands/check-current-md.md +137 -0
  14. package/.agent-src/commands/commit-in-chunks.md +118 -0
  15. package/.agent-src/commands/commit.md +4 -0
  16. package/.agent-src/commands/compress.md +37 -2
  17. package/.agent-src/commands/context-create.md +4 -0
  18. package/.agent-src/commands/context-refactor.md +4 -0
  19. package/.agent-src/commands/copilot-agents-init.md +3 -0
  20. package/.agent-src/commands/copilot-agents-optimize.md +3 -0
  21. package/.agent-src/commands/create-pr-description.md +4 -0
  22. package/.agent-src/commands/create-pr.md +4 -0
  23. package/.agent-src/commands/do-and-judge.md +4 -1
  24. package/.agent-src/commands/do-in-steps.md +3 -0
  25. package/.agent-src/commands/e2e-heal.md +4 -0
  26. package/.agent-src/commands/e2e-plan.md +4 -0
  27. package/.agent-src/commands/estimate-ticket.md +4 -1
  28. package/.agent-src/commands/feature-dev.md +4 -0
  29. package/.agent-src/commands/feature-explore.md +4 -0
  30. package/.agent-src/commands/feature-plan.md +4 -0
  31. package/.agent-src/commands/feature-refactor.md +4 -0
  32. package/.agent-src/commands/feature-roadmap.md +6 -0
  33. package/.agent-src/commands/fix-ci.md +4 -0
  34. package/.agent-src/commands/fix-portability.md +5 -2
  35. package/.agent-src/commands/fix-pr-bot-comments.md +4 -0
  36. package/.agent-src/commands/fix-pr-comments.md +4 -0
  37. package/.agent-src/commands/fix-pr-developer-comments.md +4 -0
  38. package/.agent-src/commands/fix-references.md +3 -0
  39. package/.agent-src/commands/fix-seeder.md +4 -0
  40. package/.agent-src/commands/implement-ticket.md +39 -13
  41. package/.agent-src/commands/jira-ticket.md +4 -0
  42. package/.agent-src/commands/judge.md +3 -0
  43. package/.agent-src/commands/memory-add.md +5 -3
  44. package/.agent-src/commands/memory-full.md +5 -2
  45. package/.agent-src/commands/memory-promote.md +7 -6
  46. package/.agent-src/commands/mode.md +3 -0
  47. package/.agent-src/commands/module-create.md +4 -0
  48. package/.agent-src/commands/module-explore.md +4 -0
  49. package/.agent-src/commands/onboard.md +33 -0
  50. package/.agent-src/commands/optimize-agents.md +4 -0
  51. package/.agent-src/commands/optimize-augmentignore.md +12 -0
  52. package/.agent-src/commands/optimize-rtk-filters.md +3 -0
  53. package/.agent-src/commands/optimize-skills.md +4 -0
  54. package/.agent-src/commands/override-create.md +4 -0
  55. package/.agent-src/commands/override-manage.md +4 -0
  56. package/.agent-src/commands/package-reset.md +3 -0
  57. package/.agent-src/commands/package-test.md +3 -0
  58. package/.agent-src/commands/prepare-for-review.md +4 -0
  59. package/.agent-src/commands/project-analyze.md +4 -0
  60. package/.agent-src/commands/project-health.md +4 -0
  61. package/.agent-src/commands/propose-memory.md +6 -8
  62. package/.agent-src/commands/quality-fix.md +4 -0
  63. package/.agent-src/commands/refine-ticket.md +12 -7
  64. package/.agent-src/commands/review-changes.md +39 -8
  65. package/.agent-src/commands/review-routing.md +4 -0
  66. package/.agent-src/commands/roadmap-create.md +18 -0
  67. package/.agent-src/commands/roadmap-execute.md +14 -1
  68. package/.agent-src/commands/rule-compliance-audit.md +4 -0
  69. package/.agent-src/commands/set-cost-profile.md +11 -0
  70. package/.agent-src/commands/sync-agent-settings.md +12 -0
  71. package/.agent-src/commands/sync-gitignore.md +3 -0
  72. package/.agent-src/commands/tests-create.md +4 -0
  73. package/.agent-src/commands/tests-execute.md +6 -3
  74. package/.agent-src/commands/threat-model.md +4 -0
  75. package/.agent-src/commands/update-form-request-messages.md +4 -0
  76. package/.agent-src/commands/upstream-contribute.md +4 -0
  77. package/.agent-src/commands/work.md +161 -0
  78. package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +2 -6
  79. package/.agent-src/guidelines/agent-infra/layered-settings.md +0 -1
  80. package/.agent-src/guidelines/agent-infra/memory-access.md +0 -7
  81. package/.agent-src/guidelines/agent-infra/role-contracts.md +2 -4
  82. package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +0 -1
  83. package/.agent-src/guidelines/php/patterns/strategy.md +180 -2
  84. package/.agent-src/personas/README.md +0 -1
  85. package/.agent-src/rules/artifact-drafting-protocol.md +7 -2
  86. package/.agent-src/rules/artifact-engagement-recording.md +133 -0
  87. package/.agent-src/rules/ask-when-uncertain.md +18 -13
  88. package/.agent-src/rules/augment-portability.md +64 -37
  89. package/.agent-src/rules/autonomous-execution.md +158 -0
  90. package/.agent-src/rules/chat-history-cadence.md +109 -0
  91. package/.agent-src/rules/chat-history-ownership.md +123 -0
  92. package/.agent-src/rules/chat-history-visibility.md +96 -0
  93. package/.agent-src/rules/cli-output-handling.md +27 -4
  94. package/.agent-src/rules/command-suggestion.md +134 -0
  95. package/.agent-src/rules/commit-policy.md +109 -0
  96. package/.agent-src/rules/direct-answers.md +114 -0
  97. package/.agent-src/rules/docs-sync.md +36 -0
  98. package/.agent-src/rules/downstream-changes.md +10 -9
  99. package/.agent-src/rules/improve-before-implement.md +9 -6
  100. package/.agent-src/rules/language-and-tone.md +85 -6
  101. package/.agent-src/rules/non-destructive-by-default.md +117 -0
  102. package/.agent-src/rules/package-ci-checks.md +4 -0
  103. package/.agent-src/rules/preservation-guard.md +20 -0
  104. package/.agent-src/rules/roadmap-progress-sync.md +159 -27
  105. package/.agent-src/rules/role-mode-adherence.md +1 -1
  106. package/.agent-src/rules/scope-control.md +42 -1
  107. package/.agent-src/rules/size-enforcement.md +2 -3
  108. package/.agent-src/rules/skill-quality.md +3 -8
  109. package/.agent-src/rules/ui-audit-before-build.md +106 -0
  110. package/.agent-src/rules/user-interaction.md +107 -51
  111. package/.agent-src/scripts/update_roadmap_progress.py +73 -9
  112. package/.agent-src/skills/blade-ui/SKILL.md +47 -3
  113. package/.agent-src/skills/command-routing/SKILL.md +32 -0
  114. package/.agent-src/skills/command-writing/SKILL.md +52 -2
  115. package/.agent-src/skills/description-assist/SKILL.md +21 -0
  116. package/.agent-src/skills/estimate-ticket/SKILL.md +0 -1
  117. package/.agent-src/skills/existing-ui-audit/SKILL.md +202 -0
  118. package/.agent-src/skills/fe-design/SKILL.md +78 -61
  119. package/.agent-src/skills/file-editor/SKILL.md +9 -0
  120. package/.agent-src/skills/finishing-a-development-branch/SKILL.md +4 -0
  121. package/.agent-src/skills/flux/SKILL.md +31 -4
  122. package/.agent-src/skills/guideline-writing/SKILL.md +24 -2
  123. package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +51 -9
  124. package/.agent-src/skills/livewire/SKILL.md +49 -4
  125. package/.agent-src/skills/md-language-check/SKILL.md +103 -0
  126. package/.agent-src/skills/php-coder/SKILL.md +24 -0
  127. package/.agent-src/skills/react-shadcn-ui/SKILL.md +121 -0
  128. package/.agent-src/skills/refine-prompt/SKILL.md +220 -0
  129. package/.agent-src/skills/refine-ticket/SKILL.md +32 -28
  130. package/.agent-src/skills/roadmap-management/SKILL.md +24 -11
  131. package/.agent-src/skills/rule-writing/SKILL.md +23 -1
  132. package/.agent-src/skills/skill-writing/SKILL.md +3 -5
  133. package/.agent-src/skills/upstream-contribute/SKILL.md +3 -3
  134. package/.agent-src/skills/using-git-worktrees/SKILL.md +3 -1
  135. package/.agent-src/templates/AGENTS.md +24 -6
  136. package/.agent-src/templates/agent-settings.md +149 -0
  137. package/.agent-src/templates/roadmaps.md +11 -4
  138. package/.agent-src/templates/scripts/implement_ticket/__init__.py +63 -26
  139. package/.agent-src/templates/scripts/implement_ticket/__main__.py +8 -2
  140. package/.agent-src/templates/scripts/memory_lookup.py +1 -1
  141. package/.agent-src/templates/scripts/telemetry/__init__.py +42 -0
  142. package/.agent-src/templates/scripts/telemetry/aggregator.py +154 -0
  143. package/.agent-src/templates/scripts/telemetry/boundary.py +171 -0
  144. package/.agent-src/templates/scripts/telemetry/engagement.py +238 -0
  145. package/.agent-src/templates/scripts/telemetry/report_renderer.py +170 -0
  146. package/.agent-src/templates/scripts/telemetry/settings.py +112 -0
  147. package/.agent-src/templates/scripts/telemetry_record.py +166 -0
  148. package/.agent-src/templates/scripts/telemetry_report.py +161 -0
  149. package/.agent-src/templates/scripts/telemetry_status.py +142 -0
  150. package/.agent-src/templates/scripts/work_engine/__init__.py +58 -0
  151. package/.agent-src/templates/scripts/work_engine/__main__.py +9 -0
  152. package/.agent-src/templates/scripts/work_engine/cli.py +195 -0
  153. package/.agent-src/templates/scripts/work_engine/cli_args.py +116 -0
  154. package/.agent-src/templates/scripts/{implement_ticket → work_engine}/delivery_state.py +10 -3
  155. package/.agent-src/templates/scripts/work_engine/directives/__init__.py +33 -0
  156. package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +98 -0
  157. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/analyze.py +1 -1
  158. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/implement.py +3 -3
  159. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/memory.py +2 -2
  160. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/plan.py +2 -2
  161. package/.agent-src/templates/scripts/work_engine/directives/backend/refine.py +396 -0
  162. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/report.py +37 -5
  163. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/test.py +2 -2
  164. package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/verify.py +2 -2
  165. package/.agent-src/templates/scripts/work_engine/directives/mixed/__init__.py +116 -0
  166. package/.agent-src/templates/scripts/work_engine/directives/mixed/contract.py +254 -0
  167. package/.agent-src/templates/scripts/work_engine/directives/mixed/stitch.py +229 -0
  168. package/.agent-src/templates/scripts/work_engine/directives/mixed/ui.py +231 -0
  169. package/.agent-src/templates/scripts/work_engine/directives/ui/__init__.py +113 -0
  170. package/.agent-src/templates/scripts/work_engine/directives/ui/_passthrough.py +44 -0
  171. package/.agent-src/templates/scripts/work_engine/directives/ui/apply.py +241 -0
  172. package/.agent-src/templates/scripts/work_engine/directives/ui/audit.py +414 -0
  173. package/.agent-src/templates/scripts/work_engine/directives/ui/design.py +335 -0
  174. package/.agent-src/templates/scripts/work_engine/directives/ui/polish.py +510 -0
  175. package/.agent-src/templates/scripts/work_engine/directives/ui/review.py +468 -0
  176. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/__init__.py +119 -0
  177. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/_skipped.py +37 -0
  178. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/apply.py +165 -0
  179. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/refine.py +66 -0
  180. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/report.py +62 -0
  181. package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/test.py +115 -0
  182. package/.agent-src/templates/scripts/work_engine/dispatcher.py +331 -0
  183. package/.agent-src/templates/scripts/work_engine/emitters.py +43 -0
  184. package/.agent-src/templates/scripts/work_engine/errors.py +19 -0
  185. package/.agent-src/templates/scripts/work_engine/hook_bootstrap.py +76 -0
  186. package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +54 -0
  187. package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +32 -0
  188. package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +103 -0
  189. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +44 -0
  190. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +42 -0
  191. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +50 -0
  192. package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +49 -0
  193. package/.agent-src/templates/scripts/work_engine/hooks/builtin/directive_set_guard.py +53 -0
  194. package/.agent-src/templates/scripts/work_engine/hooks/builtin/halt_surface_audit.py +50 -0
  195. package/.agent-src/templates/scripts/work_engine/hooks/builtin/state_shape_validation.py +52 -0
  196. package/.agent-src/templates/scripts/work_engine/hooks/builtin/trace.py +84 -0
  197. package/.agent-src/templates/scripts/work_engine/hooks/context.py +66 -0
  198. package/.agent-src/templates/scripts/work_engine/hooks/events.py +44 -0
  199. package/.agent-src/templates/scripts/work_engine/hooks/exceptions.py +79 -0
  200. package/.agent-src/templates/scripts/work_engine/hooks/registry.py +60 -0
  201. package/.agent-src/templates/scripts/work_engine/hooks/runner.py +73 -0
  202. package/.agent-src/templates/scripts/work_engine/hooks/settings.py +141 -0
  203. package/.agent-src/templates/scripts/work_engine/input_builders.py +163 -0
  204. package/.agent-src/templates/scripts/work_engine/intent/__init__.py +47 -0
  205. package/.agent-src/templates/scripts/work_engine/intent/classify.py +280 -0
  206. package/.agent-src/templates/scripts/work_engine/migration/__init__.py +8 -0
  207. package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +231 -0
  208. package/.agent-src/templates/scripts/{implement_ticket → work_engine}/persona_policy.py +1 -1
  209. package/.agent-src/templates/scripts/work_engine/resolvers/__init__.py +22 -0
  210. package/.agent-src/templates/scripts/work_engine/resolvers/diff.py +106 -0
  211. package/.agent-src/templates/scripts/work_engine/resolvers/file.py +113 -0
  212. package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +90 -0
  213. package/.agent-src/templates/scripts/work_engine/scoring/__init__.py +14 -0
  214. package/.agent-src/templates/scripts/work_engine/scoring/confidence.py +300 -0
  215. package/.agent-src/templates/scripts/work_engine/stack/__init__.py +31 -0
  216. package/.agent-src/templates/scripts/work_engine/stack/detect.py +187 -0
  217. package/.agent-src/templates/scripts/work_engine/state.py +641 -0
  218. package/.agent-src/templates/scripts/work_engine/state_io.py +202 -0
  219. package/.claude-plugin/marketplace.json +105 -2
  220. package/AGENTS.md +38 -8
  221. package/CHANGELOG.md +609 -0
  222. package/README.md +136 -14
  223. package/config/agent-settings.template.yml +45 -0
  224. package/config/gitignore-block.txt +4 -0
  225. package/docs/MIGRATION.md +122 -0
  226. package/docs/architecture.md +111 -35
  227. package/docs/contracts/STABILITY.md +95 -0
  228. package/docs/contracts/adr-chat-history-split.md +132 -0
  229. package/docs/contracts/adr-command-suggestion.md +146 -0
  230. package/docs/contracts/adr-implement-ticket-runtime.md +122 -0
  231. package/docs/contracts/adr-product-ui-track.md +384 -0
  232. package/docs/contracts/adr-prompt-driven-execution.md +187 -0
  233. package/docs/contracts/agent-memory-contract.md +149 -0
  234. package/docs/contracts/artifact-engagement-flow.md +262 -0
  235. package/docs/contracts/command-clusters.md +126 -0
  236. package/docs/contracts/command-suggestion-flow.md +148 -0
  237. package/docs/contracts/implement-ticket-flow.md +628 -0
  238. package/docs/contracts/linear-ai-rules-inclusion.md +143 -0
  239. package/docs/contracts/linear-ai-three-layers.md +131 -0
  240. package/docs/contracts/rule-interactions.md +107 -0
  241. package/docs/contracts/rule-interactions.yml +142 -0
  242. package/docs/contracts/ui-stack-extension.md +236 -0
  243. package/docs/contracts/ui-track-flow.md +338 -0
  244. package/docs/development.md +1 -1
  245. package/docs/getting-started.md +3 -3
  246. package/docs/installation.md +124 -2
  247. package/docs/migrations/commands-1.15.0.md +112 -0
  248. package/docs/showcase.md +204 -0
  249. package/docs/ui-track-mental-model.md +121 -0
  250. package/package.json +1 -1
  251. package/scripts/agent-config +199 -0
  252. package/scripts/audit_cloud_compatibility.py +288 -0
  253. package/scripts/build_cloud_bundle.py +458 -0
  254. package/scripts/build_linear_digest.py +263 -0
  255. package/scripts/chat_history.py +796 -7
  256. package/scripts/check_compression.py +139 -0
  257. package/scripts/check_iron_law_prominence.py +143 -0
  258. package/scripts/check_md_language.py +159 -0
  259. package/scripts/check_portability.py +38 -0
  260. package/scripts/check_public_links.py +185 -0
  261. package/scripts/check_references.py +1 -0
  262. package/scripts/check_reply_consistency.py +140 -0
  263. package/scripts/command_suggester/__init__.py +51 -0
  264. package/scripts/command_suggester/cooldown.py +132 -0
  265. package/scripts/command_suggester/loader.py +70 -0
  266. package/scripts/command_suggester/match.py +180 -0
  267. package/scripts/command_suggester/rank.py +120 -0
  268. package/scripts/command_suggester/render.py +86 -0
  269. package/scripts/command_suggester/sanitize.py +113 -0
  270. package/scripts/command_suggester/settings.py +125 -0
  271. package/scripts/command_suggester/types.py +78 -0
  272. package/scripts/hooks/augment-chat-history.sh +56 -0
  273. package/scripts/install-hooks.sh +67 -0
  274. package/scripts/install.py +150 -33
  275. package/scripts/lint_marketplace.py +27 -0
  276. package/scripts/lint_no_new_atomic_commands.py +179 -0
  277. package/scripts/lint_rule_interactions.py +149 -0
  278. package/scripts/memory_lookup.py +1 -1
  279. package/scripts/migrate_command_suggestions.py +151 -0
  280. package/scripts/release.py +297 -64
  281. package/scripts/schemas/command.schema.json +41 -0
  282. package/scripts/skill_linter.py +81 -0
  283. package/scripts/sync_agent_settings.py +42 -12
  284. package/scripts/update_counts.py +10 -0
  285. package/templates/consumer-settings/augment-cli-hooks.json +54 -0
  286. package/templates/consumer-settings/claude-settings.json +55 -1
  287. package/.agent-src/rules/chat-history.md +0 -171
  288. package/.agent-src/templates/scripts/implement_ticket/cli.py +0 -171
  289. package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +0 -134
  290. package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +0 -49
  291. package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +0 -140
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: existing-ui-audit
3
+ description: "Use BEFORE writing or editing any non-trivial UI — inventories components, design tokens, shadcn primitives, and reusable patterns into state.ui_audit. Hard gate for the ui directive set."
4
+ source: package
5
+ ---
6
+
7
+ # existing-ui-audit
8
+
9
+ ## When to use
10
+
11
+ Use this skill when:
12
+ - The dispatcher has routed work to `directive_set="ui"` (intent `ui-build` or `ui-improve`)
13
+ - A `mixed` flow is about to enter its UI phase
14
+ - The user asks "what UI do we already have for X?"
15
+
16
+ Do NOT use when:
17
+ - `directive_set="ui-trivial"` — the trivial path bypasses audit by precondition (≤1 file, ≤5 lines, no new component, no new state, no new dep)
18
+ - `directive_set="backend"` — no UI surface to inventory
19
+ - The audit findings already exist in `state.ui_audit` for this state-file (cached) — re-run only if `package.json` or `composer.json` mtime changed
20
+
21
+ ## Procedure: Audit the existing UI surface
22
+
23
+ ### 0. Inspect stack and input
24
+
25
+ 1. Read `state.stack.frontend` — set by `scripts/work_engine/stack/detect.py` (one of `blade-livewire-flux`, `react-shadcn`, `vue`, `plain`).
26
+ 2. Read `state.input` — the request being processed. The audit must answer: "what already exists that is similar to this request?"
27
+
28
+ ### 1. Enumerate components and templates
29
+
30
+ | Stack | Where to look |
31
+ |---|---|
32
+ | `blade-livewire-flux` | `resources/views/components/`, `resources/views/livewire/`, `resources/views/partials/`, `resources/views/layouts/`, `app/View/Components/`, `app/Livewire/` |
33
+ | `react-shadcn` | `components/`, `app/components/`, `src/components/`, `src/app/(routes)/`, plus any `app/**/page.tsx` for Next.js |
34
+ | `vue` | `resources/js/components/`, `src/components/`, `pages/` |
35
+ | `plain` | `resources/views/`, plus any `*.html` under `public/` |
36
+
37
+ Capture each component/template as: `{path, name, kind: page|partial|component|layout, exports?: [props]}`.
38
+
39
+ ### 2. Identify the design system
40
+
41
+ Detect markers, in order. **Stop at the first match** — projects rarely run more than one design system.
42
+
43
+ | Marker | Signal | Where |
44
+ |---|---|---|
45
+ | Flux | `livewire/flux` in `composer.json`, `<flux:*>` tags in views | `composer.json`, grep `resources/views` |
46
+ | shadcn/ui | `components.json` exists at repo root | `components.json` |
47
+ | Headless UI | `@headlessui/react` or `@headlessui/vue` in `package.json` | `package.json` |
48
+ | Radix | `@radix-ui/*` in `package.json` (without shadcn marker) | `package.json` |
49
+ | Material/Chakra/Mantine/Ant | their package names in `package.json` | `package.json` |
50
+ | Custom / none | none of the above match | — |
51
+
52
+ ### 3. Detect design tokens
53
+
54
+ Write into `state.ui_audit.design_tokens` (object, never null — empty object is fine):
55
+
56
+ | Source | What to extract |
57
+ |---|---|
58
+ | `tailwind.config.{js,ts,cjs,mjs}` | `theme.colors`, `theme.spacing`, `theme.fontFamily`, `theme.extend.*` |
59
+ | `:root { --... }` blocks in `resources/css/`, `app/globals.css`, `src/app/globals.css` | every `--token-name: value` pair |
60
+ | `theme.json` / `tokens.json` (any depth) | flat or nested token tree |
61
+ | `app/css/variables.css`, `assets/scss/_tokens.scss` | SCSS `$var: value` and CSS custom properties |
62
+
63
+ Group output by category: `colors`, `spacing`, `radius`, `font`, `shadow`, `breakpoint`, `other`.
64
+
65
+ ### 4. Detect shadcn inventory (only when `state.stack.frontend == "react-shadcn"`)
66
+
67
+ Read `components.json` for the registered style + base color, then read `package.json` for `@radix-ui/*` and any locally vendored `components/ui/*.tsx` files. Write into `state.ui_audit.shadcn_inventory`:
68
+
69
+ ```
70
+ {
71
+ version: <from package.json shadcn registry CLI version, or null>,
72
+ style: "default" | "new-york" | <other>,
73
+ base_color: "slate" | "zinc" | ...,
74
+ primitives: ["Button", "Dialog", "Form", "Table", ...], // names of files in components/ui/
75
+ installed_radix: ["@radix-ui/react-dialog", ...] // raw radix list
76
+ }
77
+ ```
78
+
79
+ ### 5. List reusable patterns
80
+
81
+ Categorize what already exists. Empty arrays are valid, never omit the keys.
82
+
83
+ ```
84
+ state.ui_audit.patterns = {
85
+ forms: [<component path:str>, ...], // any component with <form>, useForm, <flux:input>, <Input> + <Button type=submit>
86
+ tables: [...], // <table>, <flux:table>, DataTable, headless table primitives
87
+ modals: [...], // <flux:modal>, <Dialog>, AlertDialog, Sheet
88
+ empty_states: [...], // components matching grep "no results"|"empty"|"keine"|"nothing yet"
89
+ navigation: [...], // sidebar, breadcrumb, tabs
90
+ data_display: [...] // cards, lists, stat tiles
91
+ }
92
+ ```
93
+
94
+ ### 6. Match candidates for the current input
95
+
96
+ For each item in `state.ui_audit.components`, score similarity to `state.input.data` (fuzzy on filename + props/slots + co-occurring terms). Keep top 5 with `score >= 0.3`. Write into `state.ui_audit.candidates`:
97
+
98
+ ```
99
+ [{path, name, score, reason: "matches 'settings' + 'toggle' in props"}, ...]
100
+ ```
101
+
102
+ If `candidates` is empty, the user is building net-new. That is normal — record the empty list, do not halt.
103
+
104
+ ### 7. Greenfield branch
105
+
106
+ If **all** are true:
107
+ - `state.ui_audit.components` is empty
108
+ - `state.ui_audit.design_system == "custom-or-none"`
109
+ - `state.ui_audit.design_tokens` is empty (no Tailwind config customizations, no `:root`)
110
+
111
+ then set `state.ui_audit.greenfield = true` and emit a halt:
112
+
113
+ ```
114
+ > No existing UI surface detected — this looks like greenfield.
115
+ >
116
+ > 1. Scaffold a minimal token set + a base component primitive folder
117
+ > before building (recommended for projects with >1 planned screen)
118
+ > 2. Proceed bare with Tailwind defaults (recommended for one-off prototypes)
119
+ > 3. Point me at an external design-system reference (URL or file)
120
+
121
+ **Recommendation: 1 — Scaffold tokens + primitives** — even one extra screen
122
+ benefits from a shared base; the scaffold cost is ~10 min and saves
123
+ re-doing every primitive on screen 2. Caveat: flip to 2 if this is a
124
+ demo or single-page prototype that will not grow.
125
+ ```
126
+
127
+ Record the user's pick in `state.ui_audit.greenfield_decision` (`scaffold` | `bare` | `external_reference`). Re-running the skill on the same state-file with `greenfield_decision` set is a no-op for the halt (audit findings stay).
128
+
129
+ ### 8. (Optional) Capture an a11y baseline
130
+
131
+ The R4 visual-review-loop contract reads `state.ui_audit.a11y_baseline`
132
+ when present; the review gate then filters incoming
133
+ `state.ui_review.a11y.violations` against it so pre-existing
134
+ violations stay informational and only NEW or CHANGED entries block
135
+ the polish loop. Without a baseline the gate sees every violation as
136
+ actionable — fine for greenfield, noisy for legacy surfaces.
137
+
138
+ Capture the baseline when:
139
+
140
+ - The audit covers components with known a11y debt the project does
141
+ not intend to fix in this run (legacy templates, third-party
142
+ embeds, vendor widgets).
143
+ - The user says "don't block on existing a11y issues" or similar.
144
+
145
+ Skip the baseline (omit the key, leave `state.ui_audit.a11y_baseline`
146
+ unset) when:
147
+
148
+ - The surface is greenfield — the review gate should treat every
149
+ violation as new.
150
+ - The project's a11y posture is "zero known violations" and any
151
+ finding is by definition actionable.
152
+
153
+ Shape (each entry must carry at least `rule` + `selector`; severity
154
+ is optional but recommended so the review gate's severity-floor
155
+ filter behaves the same on replay):
156
+
157
+ ```
158
+ state.ui_audit.a11y_baseline = [
159
+ {rule: "color-contrast", selector: ".legacy-tab", severity: "moderate"},
160
+ {rule: "label", selector: "form#search input[type=search]"},
161
+ ...
162
+ ]
163
+ ```
164
+
165
+ Producer parity: the review skill that writes
166
+ `state.ui_review.a11y.violations` MUST use the same `(rule, selector)`
167
+ shape, otherwise the engine's de-dup will miss matches and pre-existing
168
+ violations will surface as new findings on every run.
169
+
170
+ ### 9. Validate and write findings
171
+
172
+ 1. Verify every key in the **Output format** below is present in `state.ui_audit` (empty arrays/objects allowed; `null` only for `shadcn_inventory` outside the react-shadcn stack).
173
+ 2. Verify `state.ui_audit.greenfield == true` implies `state.ui_audit.greenfield_decision` is set.
174
+ 3. Write the full object back into the state-file. Audit completes with outcome `done` — the dispatcher's audit gate now passes.
175
+
176
+ ## Output format
177
+
178
+ 1. **`state.ui_audit.components`** — array of component/template descriptors (path, name, kind, exports)
179
+ 2. **`state.ui_audit.design_system`** — single string identifying the dominant system or `custom-or-none`
180
+ 3. **`state.ui_audit.design_tokens`** — object grouped by category (colors, spacing, radius, font, shadow, breakpoint, other)
181
+ 4. **`state.ui_audit.shadcn_inventory`** — object with version, style, base_color, primitives (only when stack is `react-shadcn`; `null` otherwise)
182
+ 5. **`state.ui_audit.patterns`** — object with forms, tables, modals, empty_states, navigation, data_display arrays
183
+ 6. **`state.ui_audit.candidates`** — top-5 similarity matches for the current input (may be empty)
184
+ 7. **`state.ui_audit.greenfield`** — boolean; when true, `greenfield_decision` MUST also be set before the dispatcher advances
185
+ 8. **`state.ui_audit.a11y_baseline`** *(optional)* — array of `{rule, selector, severity?}` entries documenting pre-existing a11y violations the review gate should treat as informational. Omit the key entirely when no baseline applies; do not write `[]` for "I checked and there are none" — that disables the gate's filter for every future run.
186
+
187
+ ## Gotcha
188
+
189
+ - The model tends to skip the audit and start designing straight from the request — the dispatcher gate at `directives/ui/audit.py` enforces "no design without audit findings". Never treat this skill as optional for non-trivial UI.
190
+ - The model tends to misidentify a single Tailwind utility as a "design token" — tokens come from the config or `:root`, not from class strings in templates.
191
+ - Don't assume a Radix-only `package.json` means shadcn — shadcn requires `components.json` at repo root.
192
+ - `state.ui_audit.shadcn_inventory.version` is often missing; the shadcn CLI does not always pin itself in `package.json`. Record `null` rather than guessing.
193
+ - Greenfield is detected, not assumed — a project with one Blade layout and no components is still greenfield only if tokens AND design system markers AND components are all empty.
194
+ - Re-running the skill on a stale state-file: cache by `(composer.json mtime, package.json mtime)`; if either changed, re-audit and overwrite.
195
+
196
+ ## Do NOT
197
+
198
+ - Do NOT advance to `directives/ui/design.py` or `apply.py` if `state.ui_audit` is empty.
199
+ - Do NOT advance to design or apply if `state.ui_audit.greenfield == true` and `state.ui_audit.greenfield_decision` is unset.
200
+ - Do NOT silently skip the greenfield halt because "Tailwind has defaults" — the user picks the path explicitly.
201
+ - Do NOT write paths outside the project root into the inventory.
202
+ - Do NOT rewrite `state.ui_audit` once it is populated unless re-detection is triggered by mtime change — design and apply read from it.
@@ -1,73 +1,82 @@
1
1
  ---
2
2
  name: fe-design
3
- description: "Use when designing frontend interfaces — component architecture, layout patterns, form design, table patterns, responsive strategies, and UX principles for Blade/Livewire/Flux/Tailwind."
3
+ description: "Reference for frontend-design heuristics — component architecture, layout patterns, form/table design, responsive strategy, a11y, UX principles. Stack-agnostic; cited by directives/ui/design.py."
4
4
  source: package
5
5
  ---
6
6
 
7
- # Frontend Design Skill
7
+ # Frontend Design Skill (Reference)
8
+
9
+ ## Positioning — reference, not executor
10
+
11
+ `fe-design` is a **universal reference skill**, not an executor. It carries
12
+ stack-agnostic heuristics that the UI directive set cites; it does **not**
13
+ own the flow.
14
+
15
+ | Concern | Owner |
16
+ |---|---|
17
+ | Layout / states / microcopy lock | [`directives/ui/design.py`](../../templates/scripts/work_engine/directives/ui/design.py) |
18
+ | Stack-dispatched implementation | [`directives/ui/apply.py`](../../templates/scripts/work_engine/directives/ui/apply.py) → `blade-ui` / `livewire` / `flux` / `react-shadcn-ui` |
19
+ | Existing-component inventory + tokens | [`existing-ui-audit`](../existing-ui-audit/SKILL.md) (mandatory pre-step) |
20
+ | Design-review polish loop | [`directives/ui/review.py`](../../templates/scripts/work_engine/directives/ui/review.py) + [`directives/ui/polish.py`](../../templates/scripts/work_engine/directives/ui/polish.py) |
8
21
 
9
22
  ## When to use
10
23
 
11
- Use this skill when:
24
+ Cite this skill when:
25
+
12
26
  - Planning a new page or feature UI before implementing
13
27
  - Choosing between component patterns (modal vs. inline, table vs. cards)
14
28
  - Designing forms with complex validation or multi-step flows
15
29
  - Making responsive design decisions
16
30
  - Reviewing UI for accessibility and usability
17
- - Deciding how to structure Livewire components
18
-
19
- ## Procedure: Design a frontend interface
20
31
 
21
- 1. **Understand requirements** What data is shown? What actions are available? Who is the user?
22
- 2. **Choose technology** — Pick from the project stack (see table below).
23
- 3. **Design layout** — Mobile-first, component-based, consistent spacing.
24
- 4. **Implement** — Build with Blade components, Livewire for interactivity, Flux for UI primitives.
25
- 5. **Verify** — Check accessibility (labels, focus, contrast), responsive behavior, loading states.
32
+ Do NOT use this skill to:
26
33
 
27
- This project uses a server-rendered stack:
34
+ - Implement components that is the apply-step's stack-dispatched skill
35
+ - Audit an existing UI — that is `existing-ui-audit`
36
+ - Drive the full UI flow — that is the `directives/ui/` orchestrator
28
37
 
29
- | Layer | Technology | Skill |
30
- |---|---|---|
31
- | Templates | Laravel Blade | `blade-ui` |
32
- | Interactivity | Livewire 3 | `livewire` |
33
- | Component library | Flux (by Laravel) | `flux` |
34
- | Styling | Tailwind CSS | `tailwind` |
35
- | Icons | Heroicons / custom | — |
38
+ ## How the directive set cites this skill
36
39
 
37
- **Key principle:** Server-first. Use Livewire for interactivity. Avoid JavaScript unless Livewire can't handle it (e.g., drag-and-drop, complex animations).
40
+ `directives/ui/design.py` produces the design brief (layout, components,
41
+ states, microcopy, a11y). The brief picks heuristics from this reference
42
+ when the audit doesn't already pin a project pattern. Stack-specific
43
+ choices come from the dispatched implementation skill, not from here.
38
44
 
39
45
  ## Component Architecture
40
46
 
41
- ### Page structure
47
+ ### Page structure (universal shape)
42
48
 
43
49
  ```
44
- Page (Blade layout)
45
- ├── Header (Blade partial)
46
- ├── Navigation (Livewire — active state)
50
+ Page layout
51
+ ├── Header (static)
52
+ ├── Navigation (interactive — active state)
47
53
  ├── Content area
48
- │ ├── Page heading + actions (Blade)
49
- │ ├── Filters (Livewire — reactive)
50
- │ ├── Data display (Livewire — table/cards)
51
- │ └── Pagination (Livewire)
52
- └── Footer (Blade partial)
54
+ │ ├── Page heading + actions (static)
55
+ │ ├── Filters (interactive — reactive)
56
+ │ ├── Data display (interactive — table / cards)
57
+ │ └── Pagination (interactive)
58
+ └── Footer (static)
53
59
  ```
54
60
 
55
- ### When to use what
61
+ The stack-specific mapping (Blade partial vs. Livewire component vs.
62
+ React island vs. Vue SFC) is the apply-step's concern, not this skill's.
63
+
64
+ ### When to use what (kind, not framework)
56
65
 
57
- | Pattern | When | Example |
66
+ | Kind | When | Example |
58
67
  |---|---|---|
59
- | **Blade partial** | Static content, no interactivity | Header, footer, static info |
60
- | **Blade component** | Reusable UI element, props only | Button, badge, card shell |
61
- | **Livewire component** | Needs server interaction or state | Forms, tables, filters |
62
- | **Flux component** | Standard UI element from library | Modal, dropdown, input, toast |
63
- | **Alpine.js** | Client-only micro-interaction | Toggle, accordion, clipboard |
68
+ | **Static partial** | No interactivity, server-rendered only | Header, footer, static info |
69
+ | **Reusable UI component** | Props-only, no state | Button, badge, card shell |
70
+ | **Stateful component** | Needs server interaction or local state | Forms, tables, filters |
71
+ | **Library primitive** | Standard UI from a design system | Modal, dropdown, input, toast |
72
+ | **Client-only micro-interaction** | No server roundtrip needed | Toggle, accordion, clipboard |
64
73
 
65
74
  ### Component granularity
66
75
 
67
- - **One Livewire component per concern** — don't build mega-components
68
- - **Compose with Blade components** inside Livewire for reusable UI pieces
69
- - **Use Flux for standard elements** — don't rebuild what Flux provides
70
- - **Extract when used 3+ times** — DRY applies to UI too
76
+ - **One stateful component per concern** — don't build mega-components.
77
+ - **Compose with reusable UI components** for shared shells, headers, fields.
78
+ - **Use the project's library primitives first** — never rebuild what the design system already provides (audit findings tell you which).
79
+ - **Extract when used 3+ times** — DRY applies to UI too.
71
80
 
72
81
  ## Form Design
73
82
 
@@ -127,11 +136,11 @@ Step indicator (1 — 2 — 3)
127
136
  - Default: 25 rows per page
128
137
  - Show total count: "Showing 1–25 of 142"
129
138
  - Allow page size change (10, 25, 50, 100)
130
- - Use Livewire pagination (server-side)
139
+ - Prefer server-side pagination — avoid loading the full set client-side
131
140
 
132
141
  ## Responsive Strategy
133
142
 
134
- ### Breakpoints (Tailwind)
143
+ ### Breakpoints (Tailwind reference scale)
135
144
 
136
145
  | Prefix | Min width | Target |
137
146
  |---|---|---|
@@ -187,25 +196,40 @@ Step indicator (1 — 2 — 3)
187
196
  5. **Loading states** — Skeleton screens or spinners, never blank screens
188
197
  6. **Error recovery** — Clear error messages with suggested actions
189
198
 
190
- ## Related
199
+ ## Procedure
191
200
 
192
- - **Skill:** `blade-ui` Blade template implementation
193
- - **Skill:** `livewire` — Livewire component implementation
194
- - **Skill:** `flux` — Flux component library usage
195
- - **Skill:** `tailwind` — Tailwind CSS utility patterns
196
- - **Skill:** `dashboard-design` — Monitoring dashboard design (different domain)
201
+ When `directives/ui/design.py` (or any caller) cites this skill:
197
202
 
203
+ 1. **Confirm the audit ran first** — `state.ui_audit` from [`existing-ui-audit`](../existing-ui-audit/SKILL.md) is mandatory. Stop and request the audit if missing.
204
+ 2. **Pick the smallest matching section** — Component Architecture, Form Design, Table Design, Responsive Strategy, Accessibility, or UX Principles. Cite by H2/H3 heading, never paste the whole skill.
205
+ 3. **Defer to audit findings** — when the audit pins a project pattern (token, primitive, layout convention), use it. The heuristics here are fallbacks for gaps, not overrides.
206
+ 4. **Defer to the stack apply skill** — Blade vs. Livewire vs. Flux vs. React-shadcn choices come from the dispatched implementation skill, never from this reference.
207
+ 5. **Surface conflicts** — if a heuristic here contradicts an audit finding or stack convention, name both and let the caller decide; do not silently pick.
198
208
 
199
209
  ## Output format
200
210
 
201
- 1. Component structure with layout, data flow, and interaction patterns
202
- 2. Responsive behavior for mobile/tablet/desktop breakpoints
203
- 3. Accessibility annotations (ARIA, keyboard navigation)
211
+ When this skill's content is folded into a design brief or review:
212
+
213
+ 1. Quote the cited heuristic verbatim, with the H2/H3 heading and a one-line "why this applies" tie-back to the request.
214
+ 2. Map each heuristic to a concrete artifact in the brief (component, form section, table column, breakpoint rule, a11y check, UX state).
215
+ 3. Keep stack-agnostic — never name Blade/Livewire/Flux/React primitives in the cited prose; the apply step adds those.
216
+ 4. Mark anything overridden by audit findings as `[audit override]` and link to the audit entry.
217
+
218
+ ## Related
219
+
220
+ - **Orchestrator:** [`directives/ui/`](../../templates/scripts/work_engine/directives/ui/) — owns the UI flow
221
+ - **Pre-step (mandatory):** [`existing-ui-audit`](../existing-ui-audit/SKILL.md) — inventory before design
222
+ - **Stack apply skills (dispatched, not standalone):**
223
+ - [`blade-ui`](../blade-ui/SKILL.md) — Blade template implementation
224
+ - [`livewire`](../livewire/SKILL.md) — Livewire component implementation
225
+ - [`flux`](../flux/SKILL.md) — Flux component library usage
226
+ - [`react-shadcn-ui`](../react-shadcn-ui/SKILL.md) — React + shadcn primitives
227
+ - **Adjacent reference:** [`dashboard-design`](../dashboard-design/SKILL.md) — monitoring dashboard design (different domain)
204
228
 
205
229
  ## Gotcha
206
230
 
207
- - Don't design components without checking existing Flux/Livewire components first avoid reinventing.
208
- - The model tends to use raw HTML instead of project component library always prefer existing components.
231
+ - Don't design components without running `existing-ui-audit` first — the audit's component/token inventory is the canonical source for "what already exists in this project". Reinventing is the #1 failure mode.
232
+ - Heuristics in this reference apply across stacks; do not promote them to project rules without checking the audit.
209
233
  - Mobile-first is not optional — every layout must work on 320px width.
210
234
 
211
235
  ## Do NOT
@@ -213,11 +237,4 @@ Step indicator (1 — 2 — 3)
213
237
  - Do NOT skip mobile viewport testing.
214
238
  - Do NOT use fixed pixel widths for responsive layouts.
215
239
  - Do NOT ignore accessibility requirements.
216
-
217
- ## Auto-trigger keywords
218
-
219
- - frontend design
220
- - component architecture
221
- - layout
222
- - form design
223
- - responsive
240
+ - Do NOT use this skill as an executor — it is a reference cited by `directives/ui/design.py`.
@@ -8,6 +8,8 @@ execution:
8
8
  allowed_tools: []
9
9
  ---
10
10
 
11
+ <!-- cloud_safe: noop -->
12
+
11
13
  # file-editor
12
14
 
13
15
  ## When to use
@@ -127,3 +129,10 @@ code app/Models/User.php
127
129
  - Do NOT prompt the user about IDE settings during normal work — suggest `/onboard` (for first-run) or editing `.agent-settings.yml` directly.
128
130
  - Do NOT open files that were only read, not edited.
129
131
  - Do NOT open more than 10 files at once — summarize instead.
132
+
133
+ ## Cloud Behavior
134
+
135
+ On cloud surfaces (Claude.ai Web, Skills API) this skill is **fully inert** —
136
+ there is no local IDE to open files in, no `.agent-settings.yml` to read, and
137
+ no shell handler available. The cloud agent simply finishes its edits and
138
+ reports back; file-opening is a local-agent concern.
@@ -31,6 +31,10 @@ become a PR. Never destroy work without explicit confirmation.
31
31
  NO MERGE, NO PR, NO DISCARD WITHOUT VERIFIED TESTS + EXPLICIT CHOICE.
32
32
  ```
33
33
 
34
+ Skipping verification because "it worked a minute ago" is how broken
35
+ `main` happens. Discarding because "I assumed the user meant it" is
36
+ how work gets lost.
37
+
34
38
  ## Procedure
35
39
 
36
40
  ### 1. Inspect branch state
@@ -1,18 +1,36 @@
1
1
  ---
2
2
  name: flux
3
- description: "Use when writing Laravel Flux UI components the official Livewire component library by the Laravel team. Covers components, slots, and variants."
3
+ description: "Stack-implementation skill for Laravel Flux dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project uses `livewire/flux`. Covers Flux components, slots, variants, and form primitives."
4
4
  source: package
5
5
  ---
6
6
 
7
7
  # flux
8
8
 
9
+ ## Positioning — dispatched, not standalone
10
+
11
+ `flux` is the **primitive-library executor** for projects on the Livewire + Flux stack. Invoked by [`directives/ui/apply.py`](../../templates/scripts/work_engine/directives/ui/apply.py) once the design brief is locked, and revisited by `review.py` / `polish.py` during the design-review loop. Does **not** own the flow, drive the audit, or lock the design.
12
+
13
+ | Concern | Owner |
14
+ |---|---|
15
+ | Audit + token inventory (mandatory pre-step) | [`existing-ui-audit`](../existing-ui-audit/SKILL.md) |
16
+ | Design brief (layout / states / microcopy) | [`directives/ui/design.py`](../../templates/scripts/work_engine/directives/ui/design.py) |
17
+ | Universal design heuristics | [`fe-design`](../fe-design/SKILL.md) |
18
+ | Component logic / state / actions | [`livewire`](../livewire/SKILL.md) |
19
+ | Static Blade partials | [`blade-ui`](../blade-ui/SKILL.md) |
20
+
9
21
  ## When to use
10
22
 
11
- Use when building UI with Flux components in a project that uses `livewire/flux`.
23
+ Cite this skill when:
24
+
25
+ - Project depends on `livewire/flux` and `directives/ui/apply.py` dispatches Flux primitives
26
+ - Building forms, modals, dropdowns, toasts, or other standard UI elements Flux already provides
12
27
 
13
28
  Do NOT use when:
29
+
14
30
  - Raw Blade templates without Flux (use `blade-ui` skill)
15
- - Livewire component logic (use `livewire` skill)
31
+ - Livewire component logic / state (use `livewire` skill)
32
+ - React + shadcn (use `react-shadcn-ui` skill)
33
+ - Driving the full UI flow yourself — that is the `directives/ui/` orchestrator
16
34
 
17
35
  ## Procedure: Create a Flux view
18
36
 
@@ -44,9 +62,18 @@ Do NOT use when:
44
62
  1. Blade view using Flux components with correct props and slots
45
63
  2. Livewire component class if interactive behavior is needed
46
64
 
65
+ ### Review pass — a11y findings + preview envelope
66
+
67
+ When dispatched by `directives/ui/review.py` (test slot) or `directives/ui/polish.py` (verify slot) — review/polish run, not initial apply — also emits:
68
+
69
+ - `state.ui_review.a11y` — `{violations: [{rule, selector, severity}, ...], severity_floor?, accepted_violations?}`. Use same `(rule, selector)` shape as `state.ui_audit.a11y_baseline` so engine's de-dup matches pre-existing entries on replay. Omit envelope on apply passes; engine's `_apply_a11y_gate` only fires when baseline present.
70
+ - `state.ui_review.preview` — `{render_ok: bool, screenshot_path?, dom_dump_path?, error?, skipped?}`. `render_ok: false` with `error` populated triggers `preview_render_failed` halt; `render_ok: true` with `screenshot_path` threads screenshot into delivery report's `artifacts` list. Browser tooling (Playwright/Cypress/…) is consumer-project dependency — package does not ship one.
71
+
72
+ Polish dispatch: when dispatcher skips `review` because previous review pass returned `SUCCESS`, this skill MUST itself synthesise updated `state.ui_review.findings` (including remaining `a11y_violation` entries) so engine's gate sees current state on next polish round.
73
+
47
74
  ## Gotcha
48
75
 
49
- - The model tends to use old Flux API syntax — always check latest docs.
76
+ - Model tends to use old Flux API syntax — always check latest docs.
50
77
  - Flux has built-in validation display — don't add manual error rendering alongside it.
51
78
  - Don't mix Flux with raw HTML form elements in the same form.
52
79
 
@@ -4,6 +4,8 @@ description: "Use when creating or editing a guideline in .agent-src.uncompresse
4
4
  source: package
5
5
  ---
6
6
 
7
+ <!-- cloud_safe: degrade -->
8
+
7
9
  # guideline-writing
8
10
 
9
11
  ## When to use
@@ -109,8 +111,8 @@ Above the split signal, break by sub-topic into sibling files in the same folder
109
111
  → 0 FAIL (guidelines have relaxed linting but must still parse).
110
112
  * Run `bash scripts/compress.sh --sync` → regenerates `.agent-src/guidelines/`.
111
113
  * Run `python3 scripts/check_references.py` → no broken links.
112
- * Run the full CI pipeline locally each script directly must exit 0
113
- except for tolerated warnings.
114
+ * Run the full CI pipeline locally (see `Taskfile.yml` in this repo for
115
+ the script list) — must exit 0 except for tolerated warnings.
114
116
 
115
117
  ## Output format
116
118
 
@@ -135,6 +137,26 @@ Above the split signal, break by sub-topic into sibling files in the same folder
135
137
  * Do NOT create an orphan guideline with no inbound links
136
138
  * Do NOT edit `.agent-src/guidelines/` or `.augment/guidelines/` — generated
137
139
 
140
+ ## Cloud Behavior
141
+
142
+ On cloud surfaces (Claude.ai Web, Skills API) the package's
143
+ `scripts/check_references.py`, `scripts/skill_linter.py`, and `task`
144
+ runner are not reachable. The skill still applies — with prose-only
145
+ validation:
146
+
147
+ * Emit the full guideline file as a copyable Markdown block. Do not
148
+ attempt to write to disk.
149
+ * Self-check the frontmatter: `description` only, no `type`, no
150
+ `alwaysApply`.
151
+ * Self-check the body: reference material, no numbered procedures,
152
+ named in a topic folder.
153
+ * Tell the user to save under
154
+ `.agent-src.uncompressed/guidelines/{topic}/{name}.md` and run
155
+ `task sync && task lint-skills && task check-refs` locally before
156
+ committing.
157
+ * Do not call the linter, ref-checker, or compressor — they only
158
+ run on the user's machine.
159
+
138
160
  ## Examples
139
161
 
140
162
  Good guideline name + description:
@@ -68,7 +68,7 @@ Before proceeding, the learning MUST pass all gates:
68
68
  | Repetition | Occurred 2+ times OR clearly generalizable? |
69
69
  | Impact | Improves correctness, reliability, or consistency? |
70
70
  | Failure pattern | Prevents a real, observed failure? |
71
- | Non-duplication | No existing rule/skill/guideline covers this? |
71
+ | Non-duplication | No existing rule/skill/guideline/command covers this? **Verify via § 4 search protocol — a negative grep alone is not proof.** |
72
72
  | Scope fit | Fits rule, skill, or guideline? |
73
73
  | Minimal | Update existing preferred over creation? |
74
74
 
@@ -115,11 +115,53 @@ Choose one:
115
115
  * Update existing guideline
116
116
  * **Nothing** (baseline knowledge, standard tool usage, one-off)
117
117
 
118
- ### 4. Check for overlap
118
+ ### 4. Check for overlap — search protocol (mandatory)
119
119
 
120
- * Does a similar rule already exist?
121
- * Does a similar skill already exist?
122
- * Would a small update be better than a new file?
120
+ A grep that returns zero hits is **not** proof of no overlap. Knowledge in
121
+ this package is distributed across **four surfaces** — `skills/`, `rules/`,
122
+ `guidelines/`, `commands/`. Skip any of them and recall drops to ~25 %.
123
+ Run all four steps before declaring "no overlap":
124
+
125
+ **Step 1 — list all four surfaces.** Directory taxonomy is free evidence:
126
+
127
+ ```bash
128
+ ls .agent-src.uncompressed/skills/ \
129
+ .agent-src.uncompressed/rules/ \
130
+ .agent-src.uncompressed/guidelines/ \
131
+ .agent-src.uncompressed/commands/
132
+ ```
133
+
134
+ Sub-directories matter — `guidelines/php/patterns/`, `guidelines/agent-infra/`,
135
+ etc. carry topic taxonomies a flat file scan misses. Always descend one level.
136
+
137
+ **Step 2 — grep with both vocabularies.** Search for **solution-words** *and*
138
+ **problem-words**. Solution-only grep is confirmation bias — the existing
139
+ artifact may name the *symptom*, not the cure.
140
+
141
+ | Vocabulary | Example for "agents miss Strategy pattern, write switch chains" |
142
+ |---|---|
143
+ | Solution-words | `strategy`, `registry`, `polymorph`, `interface` |
144
+ | Problem-words | `discriminator`, `enum.*match`, `switch.*on`, `if.*else.*chain` |
145
+
146
+ ```bash
147
+ grep -rl -E "<solution-words>|<problem-words>" .agent-src.uncompressed/
148
+ ```
149
+
150
+ **Step 3 — taxonomy scan.** For any topic with a likely sub-folder
151
+ (`patterns/`, `php/`, `laravel/`, `agent-infra/`), `ls` that folder
152
+ *before* reading any file. Filename alone often answers the overlap question.
153
+
154
+ **Step 4 — sample, do not just list.** On *any* keyword overlap from
155
+ steps 2–3, **open and skim the 3 nearest matches** — read § headings, the
156
+ "When to use" / "Overview" block, and the examples list. Listing filenames
157
+ is not enough; semantic overlap hides behind unrelated keywords.
158
+
159
+ Only after all four steps return clean → declare "no overlap" and proceed.
160
+ Citation in the proposal: *"Reviewed before drafting: <files skimmed>"* —
161
+ this is the audit trail § 0's Non-duplication gate verifies against.
162
+
163
+ → When the parent task is "create a new artifact", `artifact-drafting-protocol`
164
+ Phase B (Research) requires this same protocol — single source of truth.
123
165
 
124
166
  ### 5. Draft the content
125
167
 
@@ -169,9 +211,9 @@ Mandatory fields the draft MUST fill:
169
211
  * `Success signal` (§7) — one metric, one baseline, one target, one
170
212
  evaluation date
171
213
 
172
- Run `python3 scripts/check_proposal.py agents/proposals/<id>.md` before
173
- handing to `upstream-contribute`. The
174
- script is a hard gate: non-zero exit = the proposal does not move
214
+ Run `./agent-config proposal:check agents/proposals/<id>.md`
215
+ before handing to `upstream-contribute`. The
216
+ gate is hard: non-zero exit = the proposal does not move
175
217
  to stage `gated`.
176
218
 
177
219
  ## Output format
@@ -183,7 +225,7 @@ For the **decision step** (what this skill prints to the user):
183
225
  3. Rationale in one to three lines
184
226
  4. If decision ≠ "no action": path of the written proposal
185
227
  (`agents/proposals/<proposal_id>.md`) and gate status
186
- (`check_proposal.py` exit 0 = ready for review)
228
+ (`./agent-config proposal:check` exit 0 = ready for review)
187
229
 
188
230
  The **proposal file itself** follows
189
231
  `proposal.example.md` verbatim — all ten sections, YAML frontmatter