@event4u/agent-config 1.12.0 → 1.14.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.
- package/.agent-src/commands/agent-handoff.md +3 -0
- package/.agent-src/commands/agent-status.md +3 -0
- package/.agent-src/commands/agents-audit.md +4 -0
- package/.agent-src/commands/agents-cleanup.md +6 -1
- package/.agent-src/commands/agents-prepare.md +3 -0
- package/.agent-src/commands/analyze-reference-repo.md +4 -0
- package/.agent-src/commands/bug-fix.md +5 -1
- package/.agent-src/commands/bug-investigate.md +4 -0
- package/.agent-src/commands/chat-history-checkpoint.md +126 -0
- package/.agent-src/commands/chat-history-clear.md +5 -0
- package/.agent-src/commands/chat-history-resume.md +5 -0
- package/.agent-src/commands/chat-history.md +5 -0
- package/.agent-src/commands/check-current-md.md +126 -0
- package/.agent-src/commands/commit-in-chunks.md +98 -0
- package/.agent-src/commands/commit.md +4 -0
- package/.agent-src/commands/compress.md +3 -0
- package/.agent-src/commands/context-create.md +4 -0
- package/.agent-src/commands/context-refactor.md +4 -0
- package/.agent-src/commands/copilot-agents-init.md +3 -0
- package/.agent-src/commands/copilot-agents-optimize.md +3 -0
- package/.agent-src/commands/create-pr-description.md +4 -0
- package/.agent-src/commands/create-pr.md +4 -0
- package/.agent-src/commands/do-and-judge.md +4 -1
- package/.agent-src/commands/do-in-steps.md +3 -0
- package/.agent-src/commands/e2e-heal.md +4 -0
- package/.agent-src/commands/e2e-plan.md +4 -0
- package/.agent-src/commands/estimate-ticket.md +4 -1
- package/.agent-src/commands/feature-dev.md +4 -0
- package/.agent-src/commands/feature-explore.md +4 -0
- package/.agent-src/commands/feature-plan.md +4 -0
- package/.agent-src/commands/feature-refactor.md +4 -0
- package/.agent-src/commands/feature-roadmap.md +6 -0
- package/.agent-src/commands/fix-ci.md +4 -0
- package/.agent-src/commands/fix-portability.md +3 -0
- package/.agent-src/commands/fix-pr-bot-comments.md +4 -0
- package/.agent-src/commands/fix-pr-comments.md +4 -0
- package/.agent-src/commands/fix-pr-developer-comments.md +4 -0
- package/.agent-src/commands/fix-references.md +3 -0
- package/.agent-src/commands/fix-seeder.md +4 -0
- package/.agent-src/commands/implement-ticket.md +39 -13
- package/.agent-src/commands/jira-ticket.md +4 -0
- package/.agent-src/commands/judge.md +3 -0
- package/.agent-src/commands/memory-add.md +5 -3
- package/.agent-src/commands/memory-full.md +5 -2
- package/.agent-src/commands/memory-promote.md +7 -6
- package/.agent-src/commands/mode.md +3 -0
- package/.agent-src/commands/module-create.md +4 -0
- package/.agent-src/commands/module-explore.md +4 -0
- package/.agent-src/commands/onboard.md +24 -0
- package/.agent-src/commands/optimize-agents.md +4 -0
- package/.agent-src/commands/optimize-augmentignore.md +3 -0
- package/.agent-src/commands/optimize-rtk-filters.md +3 -0
- package/.agent-src/commands/optimize-skills.md +4 -0
- package/.agent-src/commands/override-create.md +4 -0
- package/.agent-src/commands/override-manage.md +4 -0
- package/.agent-src/commands/package-reset.md +3 -0
- package/.agent-src/commands/package-test.md +3 -0
- package/.agent-src/commands/prepare-for-review.md +4 -0
- package/.agent-src/commands/project-analyze.md +4 -0
- package/.agent-src/commands/project-health.md +4 -0
- package/.agent-src/commands/propose-memory.md +6 -8
- package/.agent-src/commands/quality-fix.md +4 -0
- package/.agent-src/commands/refine-ticket.md +4 -1
- package/.agent-src/commands/review-changes.md +4 -0
- package/.agent-src/commands/review-routing.md +4 -0
- package/.agent-src/commands/roadmap-create.md +7 -0
- package/.agent-src/commands/roadmap-execute.md +12 -1
- package/.agent-src/commands/rule-compliance-audit.md +4 -0
- package/.agent-src/commands/set-cost-profile.md +3 -0
- package/.agent-src/commands/sync-agent-settings.md +3 -0
- package/.agent-src/commands/sync-gitignore.md +3 -0
- package/.agent-src/commands/tests-create.md +4 -0
- package/.agent-src/commands/tests-execute.md +4 -0
- package/.agent-src/commands/threat-model.md +4 -0
- package/.agent-src/commands/update-form-request-messages.md +4 -0
- package/.agent-src/commands/upstream-contribute.md +4 -0
- package/.agent-src/commands/work.md +161 -0
- package/.agent-src/guidelines/agent-infra/engineering-memory-data-format.md +2 -6
- package/.agent-src/guidelines/agent-infra/layered-settings.md +0 -1
- package/.agent-src/guidelines/agent-infra/memory-access.md +0 -7
- package/.agent-src/guidelines/agent-infra/role-contracts.md +2 -4
- package/.agent-src/guidelines/agent-infra/self-improvement-pipeline.md +0 -1
- package/.agent-src/guidelines/php/patterns/strategy.md +180 -2
- package/.agent-src/personas/README.md +0 -1
- package/.agent-src/rules/artifact-drafting-protocol.md +7 -2
- package/.agent-src/rules/artifact-engagement-recording.md +133 -0
- package/.agent-src/rules/ask-when-uncertain.md +18 -13
- package/.agent-src/rules/augment-portability.md +8 -0
- package/.agent-src/rules/autonomous-execution.md +158 -0
- package/.agent-src/rules/chat-history.md +147 -118
- package/.agent-src/rules/cli-output-handling.md +26 -3
- package/.agent-src/rules/command-suggestion.md +133 -0
- package/.agent-src/rules/commit-policy.md +99 -0
- package/.agent-src/rules/direct-answers.md +114 -0
- package/.agent-src/rules/docs-sync.md +36 -0
- package/.agent-src/rules/downstream-changes.md +10 -9
- package/.agent-src/rules/improve-before-implement.md +9 -6
- package/.agent-src/rules/language-and-tone.md +81 -6
- package/.agent-src/rules/non-destructive-by-default.md +117 -0
- package/.agent-src/rules/package-ci-checks.md +4 -0
- package/.agent-src/rules/preservation-guard.md +20 -0
- package/.agent-src/rules/roadmap-progress-sync.md +103 -30
- package/.agent-src/rules/scope-control.md +42 -1
- package/.agent-src/rules/size-enforcement.md +1 -3
- package/.agent-src/rules/skill-quality.md +3 -8
- package/.agent-src/rules/ui-audit-before-build.md +106 -0
- package/.agent-src/rules/user-interaction.md +81 -3
- package/.agent-src/scripts/update_roadmap_progress.py +48 -6
- package/.agent-src/skills/blade-ui/SKILL.md +30 -5
- package/.agent-src/skills/command-routing/SKILL.md +32 -0
- package/.agent-src/skills/command-writing/SKILL.md +41 -2
- package/.agent-src/skills/description-assist/SKILL.md +21 -0
- package/.agent-src/skills/estimate-ticket/SKILL.md +0 -1
- package/.agent-src/skills/existing-ui-audit/SKILL.md +187 -0
- package/.agent-src/skills/fe-design/SKILL.md +72 -60
- package/.agent-src/skills/finishing-a-development-branch/SKILL.md +4 -0
- package/.agent-src/skills/flux/SKILL.md +31 -4
- package/.agent-src/skills/guideline-writing/SKILL.md +24 -2
- package/.agent-src/skills/learning-to-rule-or-skill/SKILL.md +51 -9
- package/.agent-src/skills/livewire/SKILL.md +30 -4
- package/.agent-src/skills/md-language-check/SKILL.md +103 -0
- package/.agent-src/skills/php-coder/SKILL.md +24 -0
- package/.agent-src/skills/react-shadcn-ui/SKILL.md +121 -0
- package/.agent-src/skills/refine-prompt/SKILL.md +220 -0
- package/.agent-src/skills/refine-ticket/SKILL.md +2 -4
- package/.agent-src/skills/roadmap-management/SKILL.md +10 -3
- package/.agent-src/skills/rule-writing/SKILL.md +23 -1
- package/.agent-src/skills/skill-writing/SKILL.md +1 -3
- package/.agent-src/skills/upstream-contribute/SKILL.md +1 -1
- package/.agent-src/skills/using-git-worktrees/SKILL.md +3 -1
- package/.agent-src/templates/AGENTS.md +24 -6
- package/.agent-src/templates/agent-settings.md +149 -0
- package/.agent-src/templates/github-workflows/roadmap-progress-check.yml +63 -0
- package/.agent-src/templates/hooks/pre-commit-roadmap-progress +60 -0
- package/.agent-src/templates/roadmaps.md +8 -2
- package/.agent-src/templates/scripts/implement_ticket/__init__.py +63 -26
- package/.agent-src/templates/scripts/implement_ticket/__main__.py +8 -2
- package/.agent-src/templates/scripts/memory_lookup.py +382 -21
- package/.agent-src/templates/scripts/memory_status.py +110 -9
- package/.agent-src/templates/scripts/telemetry/__init__.py +42 -0
- package/.agent-src/templates/scripts/telemetry/aggregator.py +154 -0
- package/.agent-src/templates/scripts/telemetry/boundary.py +171 -0
- package/.agent-src/templates/scripts/telemetry/engagement.py +238 -0
- package/.agent-src/templates/scripts/telemetry/report_renderer.py +170 -0
- package/.agent-src/templates/scripts/telemetry/settings.py +112 -0
- package/.agent-src/templates/scripts/telemetry_record.py +166 -0
- package/.agent-src/templates/scripts/telemetry_report.py +161 -0
- package/.agent-src/templates/scripts/telemetry_status.py +142 -0
- package/.agent-src/templates/scripts/work_engine/__init__.py +58 -0
- package/.agent-src/templates/scripts/work_engine/__main__.py +9 -0
- package/.agent-src/templates/scripts/work_engine/cli.py +592 -0
- package/.agent-src/templates/scripts/{implement_ticket → work_engine}/delivery_state.py +7 -0
- package/.agent-src/templates/scripts/work_engine/directives/__init__.py +33 -0
- package/.agent-src/templates/scripts/work_engine/directives/backend/__init__.py +98 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/analyze.py +1 -1
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/implement.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/memory.py +1 -1
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/plan.py +1 -1
- package/.agent-src/templates/scripts/work_engine/directives/backend/refine.py +396 -0
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/report.py +36 -4
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/test.py +2 -2
- package/.agent-src/templates/scripts/{implement_ticket/steps → work_engine/directives/backend}/verify.py +2 -2
- package/.agent-src/templates/scripts/work_engine/directives/mixed/__init__.py +116 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/contract.py +254 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/stitch.py +229 -0
- package/.agent-src/templates/scripts/work_engine/directives/mixed/ui.py +231 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/__init__.py +113 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/_passthrough.py +44 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/apply.py +241 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/audit.py +414 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/design.py +335 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/polish.py +510 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui/review.py +468 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/__init__.py +119 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/_skipped.py +37 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/apply.py +165 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/refine.py +66 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/report.py +62 -0
- package/.agent-src/templates/scripts/work_engine/directives/ui_trivial/test.py +115 -0
- package/.agent-src/templates/scripts/work_engine/dispatcher.py +331 -0
- package/.agent-src/templates/scripts/work_engine/hooks/__init__.py +54 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/__init__.py +32 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/_chat_history_base.py +103 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_append.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_halt_append.py +42 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_heartbeat.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/chat_history_turn_check.py +49 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/directive_set_guard.py +53 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/halt_surface_audit.py +50 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/state_shape_validation.py +52 -0
- package/.agent-src/templates/scripts/work_engine/hooks/builtin/trace.py +84 -0
- package/.agent-src/templates/scripts/work_engine/hooks/context.py +66 -0
- package/.agent-src/templates/scripts/work_engine/hooks/events.py +44 -0
- package/.agent-src/templates/scripts/work_engine/hooks/exceptions.py +79 -0
- package/.agent-src/templates/scripts/work_engine/hooks/registry.py +60 -0
- package/.agent-src/templates/scripts/work_engine/hooks/runner.py +73 -0
- package/.agent-src/templates/scripts/work_engine/hooks/settings.py +141 -0
- package/.agent-src/templates/scripts/work_engine/intent/__init__.py +47 -0
- package/.agent-src/templates/scripts/work_engine/intent/classify.py +280 -0
- package/.agent-src/templates/scripts/work_engine/migration/__init__.py +8 -0
- package/.agent-src/templates/scripts/work_engine/migration/v0_to_v1.py +199 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/__init__.py +22 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/diff.py +106 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/file.py +113 -0
- package/.agent-src/templates/scripts/work_engine/resolvers/prompt.py +90 -0
- package/.agent-src/templates/scripts/work_engine/scoring/__init__.py +14 -0
- package/.agent-src/templates/scripts/work_engine/scoring/confidence.py +300 -0
- package/.agent-src/templates/scripts/work_engine/stack/__init__.py +31 -0
- package/.agent-src/templates/scripts/work_engine/stack/detect.py +187 -0
- package/.agent-src/templates/scripts/work_engine/state.py +641 -0
- package/.claude-plugin/marketplace.json +105 -2
- package/AGENTS.md +36 -8
- package/CHANGELOG.md +558 -0
- package/README.md +146 -4
- package/composer.json +3 -0
- package/config/agent-settings.template.yml +45 -0
- package/config/gitignore-block.txt +4 -0
- package/docs/architecture.md +28 -1
- package/docs/development.md +1 -1
- package/docs/getting-started.md +3 -2
- package/docs/installation.md +86 -0
- package/docs/showcase.md +204 -0
- package/package.json +9 -1
- package/scripts/agent-config +274 -0
- package/scripts/audit_cloud_compatibility.py +288 -0
- package/scripts/build_cloud_bundle.py +458 -0
- package/scripts/build_linear_digest.py +263 -0
- package/scripts/chat_history.py +796 -7
- package/scripts/check_compression.py +139 -0
- package/scripts/check_iron_law_prominence.py +143 -0
- package/scripts/check_md_language.py +159 -0
- package/scripts/check_portability.py +36 -0
- package/scripts/check_reply_consistency.py +140 -0
- package/scripts/command_suggester/__init__.py +51 -0
- package/scripts/command_suggester/cooldown.py +132 -0
- package/scripts/command_suggester/loader.py +70 -0
- package/scripts/command_suggester/match.py +180 -0
- package/scripts/command_suggester/rank.py +120 -0
- package/scripts/command_suggester/render.py +86 -0
- package/scripts/command_suggester/sanitize.py +113 -0
- package/scripts/command_suggester/settings.py +125 -0
- package/scripts/command_suggester/types.py +78 -0
- package/scripts/hooks/augment-chat-history.sh +56 -0
- package/scripts/install-hooks.sh +67 -0
- package/scripts/install.py +150 -33
- package/scripts/lint_marketplace.py +27 -0
- package/scripts/memory_lookup.py +143 -7
- package/scripts/memory_status.py +76 -14
- package/scripts/migrate_command_suggestions.py +151 -0
- package/scripts/postinstall.sh +16 -0
- package/scripts/schemas/command.schema.json +41 -0
- package/scripts/skill_linter.py +67 -0
- package/scripts/sync_agent_settings.py +42 -12
- package/templates/consumer-settings/augment-cli-hooks.json +54 -0
- package/templates/consumer-settings/claude-settings.json +55 -1
- package/.agent-src/templates/scripts/implement_ticket/cli.py +0 -171
- package/.agent-src/templates/scripts/implement_ticket/dispatcher.py +0 -134
- package/.agent-src/templates/scripts/implement_ticket/steps/__init__.py +0 -49
- package/.agent-src/templates/scripts/implement_ticket/steps/refine.py +0 -140
- /package/.agent-src/templates/scripts/{implement_ticket → work_engine}/persona_policy.py +0 -0
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: flux
|
|
3
|
-
description: "
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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
|
|
173
|
-
handing to `upstream-contribute`. The
|
|
174
|
-
|
|
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
|
-
(`
|
|
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
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: livewire
|
|
3
|
-
description: "
|
|
3
|
+
description: "Stack-implementation skill for Livewire — dispatched by `directives/ui/apply.py` (and `review.py` / `polish.py`) when the project's frontend stack is Livewire. Covers reactive state, events, lifecycle hooks, and component/view separation."
|
|
4
4
|
source: package
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# livewire
|
|
8
8
|
|
|
9
|
+
## Positioning — dispatched, not standalone
|
|
10
|
+
|
|
11
|
+
`livewire` is the **apply-step executor** for the Livewire 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
|
+
| Static Blade partials inside the view | [`blade-ui`](../blade-ui/SKILL.md) |
|
|
19
|
+
| Flux primitives inside the view | [`flux`](../flux/SKILL.md) |
|
|
20
|
+
|
|
9
21
|
## When to use
|
|
10
22
|
|
|
11
|
-
|
|
23
|
+
Cite this skill when:
|
|
24
|
+
|
|
25
|
+
- `state.stack.frontend == "livewire"` and `directives/ui/apply.py` dispatches to this skill
|
|
26
|
+
- Editing or creating Livewire components — reactive state, forms, tables, real-time updates
|
|
12
27
|
|
|
13
28
|
Do NOT use when:
|
|
14
|
-
|
|
15
|
-
-
|
|
29
|
+
|
|
30
|
+
- Static Blade views with no interactivity (use `blade-ui` skill)
|
|
31
|
+
- Flux UI primitives (use `flux` skill — `livewire` composes Flux internally)
|
|
32
|
+
- Driving the full UI flow yourself — that is the `directives/ui/` orchestrator
|
|
16
33
|
|
|
17
34
|
## Procedure: Create a Livewire component
|
|
18
35
|
|
|
@@ -58,6 +75,15 @@ Do NOT use when:
|
|
|
58
75
|
1. Livewire component class with typed properties and actions
|
|
59
76
|
2. Blade view with wire: bindings and Flux components
|
|
60
77
|
|
|
78
|
+
### Review pass — a11y findings + preview envelope
|
|
79
|
+
|
|
80
|
+
When dispatched by `directives/ui/review.py` (test slot) or `directives/ui/polish.py` (verify slot) — review/polish run, not initial apply — also emits:
|
|
81
|
+
|
|
82
|
+
- `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.
|
|
83
|
+
- `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.
|
|
84
|
+
|
|
85
|
+
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.
|
|
86
|
+
|
|
61
87
|
## Gotcha
|
|
62
88
|
|
|
63
89
|
- Public properties serialize between requests — don't put large objects in state.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: md-language-check
|
|
3
|
+
description: "Use BEFORE saving any .md under .augment/, .agent-src*/, or agents/ — scans umlauts, German function words, and quoted German phrases outside DE:/EN: anchor blocks. Hard gate per language-and-tone."
|
|
4
|
+
source: package
|
|
5
|
+
execution:
|
|
6
|
+
type: assisted
|
|
7
|
+
handler: shell
|
|
8
|
+
timeout_seconds: 30
|
|
9
|
+
allowed_tools: []
|
|
10
|
+
command:
|
|
11
|
+
- python3
|
|
12
|
+
- scripts/check_md_language.py
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# md-language-check
|
|
16
|
+
|
|
17
|
+
## When to use
|
|
18
|
+
|
|
19
|
+
Fire **before** saving any `.md` file under:
|
|
20
|
+
|
|
21
|
+
- `.agent-src.uncompressed/` (source of truth)
|
|
22
|
+
- `.agent-src/` (compressed projection)
|
|
23
|
+
- `.augment/` (local agent projection)
|
|
24
|
+
- `agents/` (project roadmaps, contexts, sessions)
|
|
25
|
+
|
|
26
|
+
Per [`language-and-tone`](../../rules/language-and-tone.md) § "`.md`
|
|
27
|
+
files are ALWAYS English" + § Detection heuristic, every `.md` in
|
|
28
|
+
those trees must be English. Bilingual content lives only in labeled
|
|
29
|
+
`DE: … · EN: …` anchor blocks.
|
|
30
|
+
|
|
31
|
+
Do NOT use when:
|
|
32
|
+
|
|
33
|
+
- Editing project content outside the trees above
|
|
34
|
+
- Reviewing non-`.md` files (checker rejects them)
|
|
35
|
+
|
|
36
|
+
## Procedure
|
|
37
|
+
|
|
38
|
+
### 1. Identify the file(s) about to be saved
|
|
39
|
+
|
|
40
|
+
Collect every `.md` path the agent is about to create or modify this
|
|
41
|
+
turn. Multiple files → one invocation.
|
|
42
|
+
|
|
43
|
+
### 2. Run the checker
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python3 scripts/check_md_language.py <path> [<path> …] [--format json]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Exit codes: `0` clean, `1` violations (save **blocked** until fixed
|
|
50
|
+
or suppressed), `3` internal error.
|
|
51
|
+
|
|
52
|
+
### 3. Resolve findings
|
|
53
|
+
|
|
54
|
+
| Kind | Cause | Fix |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `umlaut` | German prose in body | Translate to English |
|
|
57
|
+
| `de_word` | German function word in unquoted prose | Translate; or move into `DE: … · EN: …` block |
|
|
58
|
+
|
|
59
|
+
Meta-doc that **must** quote German tokens (e.g. the heuristic in
|
|
60
|
+
`language-and-tone.md` itself) → append
|
|
61
|
+
`<!-- md-language-check: ignore -->` to that single line. Never as a
|
|
62
|
+
wholesale silencer.
|
|
63
|
+
|
|
64
|
+
### 4. Re-run and confirm
|
|
65
|
+
|
|
66
|
+
After every fix re-run on the same paths. Save proceeds only on `0`.
|
|
67
|
+
|
|
68
|
+
## Allowed escape hatches
|
|
69
|
+
|
|
70
|
+
- **Labeled anchor** — lines starting with `DE:` / `- DE:` / `* DE:`
|
|
71
|
+
(and the same for `EN:`) auto-skipped.
|
|
72
|
+
- **Fenced code blocks** — exempt; shell snippets, JSON fixtures,
|
|
73
|
+
quoted user input pass through.
|
|
74
|
+
- **Inline code** — backtick spans stripped before scanning.
|
|
75
|
+
- **Per-line marker** — `<!-- md-language-check: ignore -->` on lines
|
|
76
|
+
that genuinely quote German tokens (rare).
|
|
77
|
+
|
|
78
|
+
## Output format
|
|
79
|
+
|
|
80
|
+
1. One-line summary: `clean` or `N violation(s) found`
|
|
81
|
+
2. Per violation: `file:line — kind \`match\`` plus the offending line
|
|
82
|
+
3. Next action: translate, move into a `DE:`/`EN:` block, add the
|
|
83
|
+
per-line ignore marker, or revert
|
|
84
|
+
|
|
85
|
+
## Gotchas
|
|
86
|
+
|
|
87
|
+
- `.md` files only; non-`.md` paths emit a warning and skip
|
|
88
|
+
- Word list is short and conservative — clean run is **necessary
|
|
89
|
+
but not sufficient**; agent owns the final language judgement
|
|
90
|
+
- Frontmatter (`--- … ---`) is exempt
|
|
91
|
+
|
|
92
|
+
## Do NOT
|
|
93
|
+
|
|
94
|
+
- Do NOT silence by deleting trigger words from
|
|
95
|
+
`scripts/check_md_language.py`; extend the allow-list instead
|
|
96
|
+
- Do NOT use the ignore marker as a generic mute
|
|
97
|
+
- Do NOT skip the gate "because the file is small"
|
|
98
|
+
|
|
99
|
+
## Cloud Behavior
|
|
100
|
+
|
|
101
|
+
Cloud surfaces (Claude.ai Web, Skills API) ship without the script,
|
|
102
|
+
so this skill is **inert** there — apply the heuristic from
|
|
103
|
+
[`language-and-tone`](../../rules/language-and-tone.md) manually.
|
|
@@ -37,6 +37,30 @@ Do NOT use when:
|
|
|
37
37
|
→ See guideline `php/general.md` for detailed PHP conventions.
|
|
38
38
|
→ See guideline `php/controllers.md`, `php/eloquent.md`, etc. for domain-specific conventions.
|
|
39
39
|
|
|
40
|
+
### Step 3: Stop-gate — branching on a discriminator?
|
|
41
|
+
|
|
42
|
+
Before writing **a second** `match`/`switch` arm, **a second** `if/elseif`
|
|
43
|
+
branch, or **a second** class hardcoded to one enum/string value (e.g.
|
|
44
|
+
`Provider::FOO->value`, `'stripe'`, a `case Type::CSV`), STOP and run the
|
|
45
|
+
Strategy sniff test.
|
|
46
|
+
|
|
47
|
+
Trigger keywords in the task or surrounding code:
|
|
48
|
+
|
|
49
|
+
- enum/string used as a type-tag: `Provider`, `Type`, `Channel`, `Format`,
|
|
50
|
+
`Driver`, `Kind`
|
|
51
|
+
- repeated `match ($x)` / `switch ($x)` blocks on the same value
|
|
52
|
+
- class names that bake a single enum case in: `StripeImportService`,
|
|
53
|
+
`CsvExporter`, `Ks21Job` next to `GeoCaptureJob` with the same shape
|
|
54
|
+
- allowlist constants: `private const SUPPORTED_FOO = [Type::A, Type::B]`
|
|
55
|
+
|
|
56
|
+
→ Run the sniff test in
|
|
57
|
+
[`guidelines/php/patterns/strategy.md`](../../guidelines/php/patterns/strategy.md#sniff-test--when-an-enumstring-discriminator-wants-to-become-a-strategy).
|
|
58
|
+
Two "yes" answers → propose Strategy + Registry **before** adding the new
|
|
59
|
+
branch. Three "yes" → it is already overdue and the refactor is the change.
|
|
60
|
+
|
|
61
|
+
This gate fires **per task**, not per file — once you've passed the sniff
|
|
62
|
+
test for a given discriminator, do not re-ask on the next branch.
|
|
63
|
+
|
|
40
64
|
### Core principles
|
|
41
65
|
|
|
42
66
|
- **KISS** — simplest solution that works. No over-engineering.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: react-shadcn-ui
|
|
3
|
+
description: "Use when building React UI on shadcn/ui primitives + Tailwind — the apply/review/polish skill dispatched by `directives/ui/*` for the `react-shadcn` stack."
|
|
4
|
+
source: package
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# react-shadcn-ui
|
|
8
|
+
|
|
9
|
+
## Compatibility
|
|
10
|
+
|
|
11
|
+
- **Tested against:** `shadcn@2.1`, Tailwind CSS `3.x`, React `18+`.
|
|
12
|
+
- Audit step (`directives/ui/audit.py`) reads the line above and compares it with `state.ui_audit.shadcn_inventory.version`; major mismatch triggers a soft halt before this skill runs.
|
|
13
|
+
|
|
14
|
+
## When to use
|
|
15
|
+
|
|
16
|
+
Use when `state.stack.frontend == "react-shadcn"` and `directives/ui/apply.py`, `review.py`, or `polish.py` dispatches to this skill, or when a React project clearly uses shadcn/ui (presence of `components.json`, `@radix-ui/*` dependencies, a `components/ui/` folder of generated primitives).
|
|
17
|
+
|
|
18
|
+
Do NOT use when:
|
|
19
|
+
|
|
20
|
+
- Project is Blade + Livewire + Flux (use `flux` / `livewire` / `blade-ui`).
|
|
21
|
+
- Project is Vue (use the Vue stack skills).
|
|
22
|
+
- Plain React without shadcn/ui — fall back to manual composition; this skill assumes the primitive set exists.
|
|
23
|
+
|
|
24
|
+
## Gotcha
|
|
25
|
+
|
|
26
|
+
- shadcn/ui is **not** an npm package. Primitives are copied into `components/ui/` and edited in-place. Do not `npm install shadcn-ui`. Run `npx shadcn@latest add <primitive>` to scaffold; then edit.
|
|
27
|
+
- Major-version drift between this skill's `## Compatibility` line and the project's installed primitives is a real risk. Audit step writes `state.ui_audit.shadcn_inventory` with the detected version — when it diverges by a major, audit emits a soft halt before this skill runs.
|
|
28
|
+
- shadcn/ui composes Radix primitives. Accessibility built in via Radix but only when wrapper components used correctly (`asChild`, `<DialogTrigger>` instead of bare `<button>`).
|
|
29
|
+
- Tailwind tokens come from `tailwind.config.{js,ts}` (`theme.extend.colors`) and CSS custom properties on `:root` and `.dark` (`--background`, `--foreground`, `--primary`, `--ring`, …). Audit writes them into `state.ui_audit.design_tokens`. Use those tokens; do not hardcode values.
|
|
30
|
+
- Dark mode is class-based (`<html class="dark">`). Every color must come from `bg-background`, `text-foreground`, etc. — never raw `bg-white`.
|
|
31
|
+
- Every interactive primitive must declare a focus-visible state via `focus-visible:ring-2 focus-visible:ring-ring`; comes free with generated primitives but easy to remove during a refactor.
|
|
32
|
+
|
|
33
|
+
## Covered primitives
|
|
34
|
+
|
|
35
|
+
Validated against the following shadcn primitives at the declared version:
|
|
36
|
+
|
|
37
|
+
- **Form / inputs:** `Button`, `Input`, `Textarea`, `Checkbox`, `RadioGroup`, `Select`, `Switch`, `Label`, `Form` (react-hook-form wrapper + `zodResolver`).
|
|
38
|
+
- **Overlay:** `Dialog`, `Sheet`, `Popover`, `Tooltip`, `DropdownMenu`, `AlertDialog`.
|
|
39
|
+
- **Layout:** `Card`, `Separator`, `Tabs`, `Accordion`, `ScrollArea`.
|
|
40
|
+
- **Data display:** `Table` (with `@tanstack/react-table`), `Badge`, `Avatar`, `Skeleton`, `Progress`.
|
|
41
|
+
- **Feedback:** `Toast` (sonner), `Alert`.
|
|
42
|
+
|
|
43
|
+
## Not covered — fall back to manual composition
|
|
44
|
+
|
|
45
|
+
- Marketing-only components (Hero, Pricing, Features) — outside shadcn/ui.
|
|
46
|
+
- `Calendar` / `DatePicker` — composition skill required, not generated.
|
|
47
|
+
- `Combobox` — built from `Command` + `Popover`; case-by-case.
|
|
48
|
+
- Streaming / partial-prerender boundaries — use the project's framework patterns (Next.js / Remix), not shadcn/ui.
|
|
49
|
+
|
|
50
|
+
## Procedure: render a shadcn/ui component for the design brief
|
|
51
|
+
|
|
52
|
+
### Step 0: Inspect
|
|
53
|
+
|
|
54
|
+
1. Read `state.ui_audit.shadcn_inventory.version` and confirm it matches the version in `## Compatibility` within the same major. If audit flagged a mismatch, user already chose to proceed — note that in `state.changes`.
|
|
55
|
+
2. Read `state.ui_audit.design_tokens` — every color, spacing, and radius in rendered output must reference a token from this map.
|
|
56
|
+
3. Read `state.ui_design`:
|
|
57
|
+
- `components` → the primitive list to compose.
|
|
58
|
+
- `microcopy` → button labels, empty-state text, validation messages. **Lock — render verbatim.**
|
|
59
|
+
- `states` → empty / loading / error / success / disabled coverage.
|
|
60
|
+
- `a11y` → ARIA labels, keyboard nav, focus order.
|
|
61
|
+
|
|
62
|
+
### Step 1: Compose primitives
|
|
63
|
+
|
|
64
|
+
1. Import primitives from project's `components/ui/` path (`@/components/ui/button`, …) — never from `shadcn` or `radix-ui`.
|
|
65
|
+
2. Compose Radix-style: `<Dialog>` → `<DialogTrigger asChild>` → `<DialogContent>` → `<DialogHeader>` → `<DialogTitle>`. Never wrap `DialogTrigger` around a pre-styled `<button>`; pass `asChild`.
|
|
66
|
+
3. Use variant API of `Button` (`variant="default" | "destructive" | "outline" | "secondary" | "ghost" | "link"`); do not override with raw Tailwind for the variant set.
|
|
67
|
+
4. Forms: `useForm` (react-hook-form) + `zodResolver(schema)` → `<Form>` → `<FormField>` → `<FormItem>` → `<FormLabel>` → `<FormControl>` → `<FormMessage>`. Validation messages come from the zod schema, mirrored to design-brief microcopy.
|
|
68
|
+
|
|
69
|
+
### Step 2: Apply tokens, dark mode, a11y
|
|
70
|
+
|
|
71
|
+
1. Colors via semantic classes: `bg-background`, `text-foreground`, `bg-primary text-primary-foreground`, `text-muted-foreground`. No `bg-white` / `text-black` / hardcoded `#fff`.
|
|
72
|
+
2. Spacing / radius from theme tokens (`rounded-lg` mapped to `--radius` in `tailwind.config.{js,ts}`). Polish refactors hardcoded values when a token equivalent exists.
|
|
73
|
+
3. Dark mode: never branch on a `dark` prop; rely on `.dark` class on root and semantic tokens.
|
|
74
|
+
4. Every interactive primitive: keyboard trigger present (Enter/Space on buttons, Esc on dialogs — Radix free), visible focus ring, `aria-label` from `state.ui_design.a11y` when icon-only.
|
|
75
|
+
|
|
76
|
+
### Step 3: State coverage
|
|
77
|
+
|
|
78
|
+
1. Empty: render design-brief empty-state copy in a `Card` or inline placeholder; never `null`.
|
|
79
|
+
2. Loading: `Skeleton` rows for tables; `Button` `disabled` + `Loader2` icon for submit-in-flight.
|
|
80
|
+
3. Error: `Alert variant="destructive"` with design-brief message; `FormMessage` for field-level errors.
|
|
81
|
+
4. Success: `toast.success(...)` from `sonner` with design-brief confirmation copy.
|
|
82
|
+
5. Disabled: `disabled` prop on trigger plus design-brief reason as `aria-describedby` text.
|
|
83
|
+
|
|
84
|
+
### Step 4: Validate
|
|
85
|
+
|
|
86
|
+
1. No raw `<input>` / `<button>` / `<select>` outside the primitive set.
|
|
87
|
+
2. No hardcoded colors / spacing — every value is a token.
|
|
88
|
+
3. Microcopy matches `state.ui_design.microcopy` byte-for-byte.
|
|
89
|
+
4. Dark mode: toggle `.dark` on `<html>`, render the component, every surface still legible (no `text-white on bg-white`).
|
|
90
|
+
5. Keyboard: Tab through every focusable element; focus ring visible.
|
|
91
|
+
|
|
92
|
+
## Output format
|
|
93
|
+
|
|
94
|
+
1. React component file(s) under project's `components/` (or `app/`) tree, importing primitives from `@/components/ui/*`.
|
|
95
|
+
2. Per file, one entry recorded in `state.changes` with `kind="ui"`, `stack="react-shadcn"`, and the design-brief summary.
|
|
96
|
+
|
|
97
|
+
### Review pass — a11y findings + preview envelope
|
|
98
|
+
|
|
99
|
+
When dispatched by `directives/ui/review.py` (test slot) or `directives/ui/polish.py` (verify slot) — review/polish run, not initial apply — also emits:
|
|
100
|
+
|
|
101
|
+
- `state.ui_review.a11y` — `{violations: [{rule, selector, severity}, ...], severity_floor?, accepted_violations?}`. Run a11y tool against rendered output (e.g. `axe-core` via Playwright, `@axe-core/react`, `jest-axe`) and translate hits into this shape. 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.
|
|
102
|
+
- `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.
|
|
103
|
+
|
|
104
|
+
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.
|
|
105
|
+
|
|
106
|
+
## Do NOT
|
|
107
|
+
|
|
108
|
+
- Do NOT install `shadcn-ui` from npm — primitives are scaffolded.
|
|
109
|
+
- Do NOT hardcode colors / spacing / radii — use the token map.
|
|
110
|
+
- Do NOT branch on a `dark` prop — use semantic tokens + the `.dark` class.
|
|
111
|
+
- Do NOT rewrite microcopy — it is locked by `state.ui_design`.
|
|
112
|
+
- Do NOT skip `asChild` on `DialogTrigger` / `SheetTrigger` / similar Radix wrappers — breaks the accessibility contract.
|
|
113
|
+
- Do NOT introduce a non-shadcn UI library (MUI, Chakra) into the same surface — pick one system per surface.
|
|
114
|
+
|
|
115
|
+
## Auto-trigger keywords
|
|
116
|
+
|
|
117
|
+
- shadcn / shadcn ui / shadcn/ui
|
|
118
|
+
- React component (when project uses shadcn)
|
|
119
|
+
- Radix primitive
|
|
120
|
+
- Tailwind dark mode
|
|
121
|
+
- React Hook Form + zod
|