@ludecker/aaac 1.1.3 → 1.1.5
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/README.md +1 -1
- package/package.json +1 -1
- package/src/run-engine/advance-phase.mjs +2 -5
- package/src/run-engine/debug-run.mjs +6 -0
- package/src/run-engine/lib.mjs +17 -0
- package/src/run-engine/log.mjs +1 -1
- package/src/run-engine/record-task.mjs +25 -4
- package/templates/cursor/aaac/enforcement.json +6 -0
- package/templates/cursor/aaac/graph.project.yaml +2 -0
- package/templates/cursor/aaac/run/schema.json +5 -0
- package/templates/cursor/aaac/scripts/run-engine/advance-phase.mjs +2 -5
- package/templates/cursor/aaac/scripts/run-engine/debug-run.mjs +6 -0
- package/templates/cursor/aaac/scripts/run-engine/lib.mjs +17 -0
- package/templates/cursor/aaac/scripts/run-engine/log.mjs +1 -1
- package/templates/cursor/aaac/scripts/run-engine/record-task.mjs +25 -4
- package/templates/cursor/aaac/scripts/run-engine/verify-website-build.mjs +1 -1
- package/templates/cursor/agents/fix-runtime-evidence.md +1 -1
- package/templates/cursor/policies/implementation.md +3 -0
- package/templates/cursor/policies/mcp-and-deploy.md +14 -0
- package/templates/cursor/policies/minimal-complexity.md +2 -2
- package/templates/cursor/policies/project-context.md +5 -0
- package/templates/cursor/policies/ui-design.md +5 -0
- package/templates/cursor/rules/aaac-enforcement.mdc +10 -5
- package/templates/cursor/skills/shared/_task-prompt-policy.md +18 -0
- package/templates/cursor/skills/shared/architecture/refactor-analysis.md +7 -7
- package/templates/cursor/skills/shared/check/SKILL.md +4 -0
- package/templates/cursor/skills/shared/discovery/SKILL.md +4 -0
- package/templates/cursor/skills/shared/execution/SKILL.md +2 -3
- package/templates/cursor/skills/shared/governance/implementation/SKILL.md +8 -5
- package/templates/cursor/skills/shared/integration/SKILL.md +2 -2
- package/templates/cursor/skills/shared/investigation/SKILL.md +1 -1
- package/templates/cursor/skills/shared/investigation-lite/SKILL.md +2 -0
- package/templates/cursor/skills/shared/platform-release/SKILL.md +4 -6
- package/templates/cursor/skills/shared/platform-release/orchestrator/SKILL.md +4 -4
- package/templates/cursor/skills/shared/platform-release/ship-procedure.md +14 -15
- package/templates/cursor/skills/shared/schema/SKILL.md +1 -1
- package/templates/cursor/skills/shared/testing/SKILL.md +3 -3
- package/templates/cursor/skills/shared/verbs/_dispatch-utils.md +5 -3
- package/templates/cursor/skills/shared/verbs/check/orchestrator/SKILL.md +1 -1
- package/templates/cursor/skills/shared/verbs/update/orchestrator/contract.yaml +3 -1
- package/templates/docs/agentic_architecture.md +2 -2
- package/templates/docs/master_rules.md +673 -20
- package/templates/docs/project_context.md +40 -0
- package/templates/docs/ui_design.md +206 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Project context — {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Project-specific layout, paths, and SSOT anchors. **Master rules stay generic** — see [master_rules.md](./master_rules.md).
|
|
4
|
+
|
|
5
|
+
Fill this in when your repo has a stable structure. Until then, agents use generic master rules only.
|
|
6
|
+
|
|
7
|
+
## Areas
|
|
8
|
+
|
|
9
|
+
| Area | Location | Responsibility |
|
|
10
|
+
|------|----------|----------------|
|
|
11
|
+
| Application | e.g. `src/` or `apps/web/` | User-facing app, routes, UI |
|
|
12
|
+
| Shared libraries | e.g. `packages/` or `lib/` | Reusable modules |
|
|
13
|
+
| Data / persistence | e.g. `db/migrations/` | Schema, seeds, adapters |
|
|
14
|
+
| Config | e.g. `config/` or env | Site name, URLs, feature flags |
|
|
15
|
+
|
|
16
|
+
## SSOT anchors (do not duplicate)
|
|
17
|
+
|
|
18
|
+
Document where each kind of truth lives in **your** repo:
|
|
19
|
+
|
|
20
|
+
- App/site name and URL → your constants or config module
|
|
21
|
+
- Brand label in UI → design system constants
|
|
22
|
+
- Design tokens → tokens file or theme config (see [ui_design.md](./ui_design.md) — tokens only when values repeat)
|
|
23
|
+
- Navigation items → shared types or config
|
|
24
|
+
- Published content → database table or CMS adapter
|
|
25
|
+
- API contracts (OpenAPI, Zod, GraphQL schema) → shared types or `contracts/` folder
|
|
26
|
+
- Auth/session configuration → auth module or env
|
|
27
|
+
- Cache keys, TTLs, and invalidation tags → cache config or adapter module
|
|
28
|
+
- Secret names (not values) → env var list documented here
|
|
29
|
+
|
|
30
|
+
## Tooling (optional)
|
|
31
|
+
|
|
32
|
+
When configured, record:
|
|
33
|
+
|
|
34
|
+
- Structured logger package or utility
|
|
35
|
+
- Test commands (unit, integration, E2E)
|
|
36
|
+
- Lint/size-budget tools
|
|
37
|
+
- Database MCP project ref (if used)
|
|
38
|
+
- Deploy service name and smoke URL (if used)
|
|
39
|
+
|
|
40
|
+
Add `.cursor/rules/` files for MCP and deploy when you connect external providers.
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# UI design and CSS — {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
Generic best practices for styling user interfaces. **Applies to all UI work** — read before writing or refactoring CSS.
|
|
4
|
+
|
|
5
|
+
Canonical rules summary: Master Rules §5 (no inline styling) and §41 (CSS discipline).
|
|
6
|
+
Project-specific tokens and component paths: [project_context.md](./project_context.md).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## The problem
|
|
11
|
+
|
|
12
|
+
Agents often treat CSS like backend architecture. They add abstractions too early: token systems, deep nesting, utility generators, theme layers, variants, wrappers, unnecessary JS, and defensive overrides.
|
|
13
|
+
|
|
14
|
+
Senior frontend CSS is usually the opposite:
|
|
15
|
+
|
|
16
|
+
1. Use normal CSS first.
|
|
17
|
+
2. Keep selectors shallow.
|
|
18
|
+
3. Avoid specificity fights.
|
|
19
|
+
4. Make the component own only its own styling.
|
|
20
|
+
5. Use modern CSS only when it removes code.
|
|
21
|
+
|
|
22
|
+
Modern CSS should **simplify**, not add ceremony:
|
|
23
|
+
|
|
24
|
+
- [Cascade layers](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers) — control priority without specificity wars
|
|
25
|
+
- [Custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascading_variables/Using_custom_properties) — repeated values, not a parallel design system
|
|
26
|
+
- [Container queries](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Containment/Container_queries) — components adapt to parent size, not only viewport breakpoints
|
|
27
|
+
- [`:where()`](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:where) — zero specificity; easier overrides when needed
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Bad agent CSS
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
.card-wrapper .card-container .card[data-variant="primary"] .card-content > div:first-child h3.title {
|
|
35
|
+
color: var(--semantic-color-heading-primary-default);
|
|
36
|
+
margin-bottom: var(--spacing-scale-component-card-title-bottom-md);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.card-container.theme-light.layout-grid.size-medium.state-default {
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-columns: repeat(12, 1fr);
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Problems:** too many layers, too much naming, too much specificity, unclear ownership.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Better senior CSS
|
|
50
|
+
|
|
51
|
+
```css
|
|
52
|
+
@layer base, components;
|
|
53
|
+
|
|
54
|
+
@layer base {
|
|
55
|
+
:root {
|
|
56
|
+
--space: 1rem;
|
|
57
|
+
--radius: 0.75rem;
|
|
58
|
+
--border: #ddd;
|
|
59
|
+
--text: #1f1f1f;
|
|
60
|
+
--muted: #666;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
* {
|
|
64
|
+
box-sizing: border-box;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
body {
|
|
68
|
+
margin: 0;
|
|
69
|
+
font-family: system-ui, sans-serif;
|
|
70
|
+
color: var(--text);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@layer components {
|
|
75
|
+
.card {
|
|
76
|
+
container-type: inline-size;
|
|
77
|
+
padding: var(--space);
|
|
78
|
+
border: 1px solid var(--border);
|
|
79
|
+
border-radius: var(--radius);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.card h2 {
|
|
83
|
+
margin: 0 0 0.5rem;
|
|
84
|
+
font-size: 1.1rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.card p {
|
|
88
|
+
margin: 0;
|
|
89
|
+
color: var(--muted);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@container (min-width: 32rem) {
|
|
93
|
+
.card {
|
|
94
|
+
display: grid;
|
|
95
|
+
grid-template-columns: 12rem 1fr;
|
|
96
|
+
gap: var(--space);
|
|
97
|
+
align-items: start;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```html
|
|
104
|
+
<article class="card">
|
|
105
|
+
<img src="/image.jpg" alt="">
|
|
106
|
+
<div>
|
|
107
|
+
<h2>Simple card</h2>
|
|
108
|
+
<p>Responsive because of its container, not the whole viewport.</p>
|
|
109
|
+
</div>
|
|
110
|
+
</article>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Agent checklist (before writing CSS)
|
|
116
|
+
|
|
117
|
+
Ask internally:
|
|
118
|
+
|
|
119
|
+
1. **Can this be solved with one class?**
|
|
120
|
+
2. **Can layout be handled by flex, grid, or container queries?**
|
|
121
|
+
3. **Can I avoid IDs, deep selectors, `!important`, and JS for styling?**
|
|
122
|
+
4. **Are these tokens actually reused, or am I inventing architecture?**
|
|
123
|
+
5. **Does this component own only its own styles?**
|
|
124
|
+
|
|
125
|
+
> The best CSS implementation is often boring, local, shallow, and easy to delete.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Rules
|
|
130
|
+
|
|
131
|
+
### Selectors and specificity
|
|
132
|
+
|
|
133
|
+
- Prefer single class on the component root; style descendants sparingly and shallowly
|
|
134
|
+
- No chains longer than **two** levels unless documented
|
|
135
|
+
- Avoid `!important` — fix layer order or structure instead
|
|
136
|
+
- Use `:where()` for resets and shared bases that should not win specificity wars
|
|
137
|
+
|
|
138
|
+
### Layers and ownership
|
|
139
|
+
|
|
140
|
+
- Use `@layer` to separate base, components, and utilities
|
|
141
|
+
- One CSS file (or clearly scoped block) per component when the project uses component CSS
|
|
142
|
+
- Do not style another component's internals from a parent — use composition or props
|
|
143
|
+
|
|
144
|
+
### Tokens and variables
|
|
145
|
+
|
|
146
|
+
- Custom properties for values that **repeat** in the same file or theme
|
|
147
|
+
- Do not build a semantic token tree (`--semantic-color-heading-primary-default`) until plain variables prove insufficient
|
|
148
|
+
- Project-wide token files live in one place — see [project_context.md](./project_context.md)
|
|
149
|
+
|
|
150
|
+
### Layout
|
|
151
|
+
|
|
152
|
+
- Flexbox and grid before custom positioning
|
|
153
|
+
- Container queries for component-level responsiveness; media queries for page-level breakpoints
|
|
154
|
+
- Avoid fixed heights unless the design requires them
|
|
155
|
+
|
|
156
|
+
### JavaScript and styling
|
|
157
|
+
|
|
158
|
+
- Do not use JS to set layout or colors that CSS can handle
|
|
159
|
+
- Class toggles for state are fine; inline `style` objects are not (Master Rules §5)
|
|
160
|
+
|
|
161
|
+
### Framework notes
|
|
162
|
+
|
|
163
|
+
- CSS Modules, scoped Vue/Svelte styles, and colocated `.css` files are all valid — same discipline applies
|
|
164
|
+
- Utility-first frameworks: use utilities at the markup layer; do not generate bespoke utility systems inside agent-written CSS unless the project already uses one
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Accessibility (see also Master Rules §37)
|
|
169
|
+
|
|
170
|
+
- Semantic HTML first (`button`, `nav`, `main`, `article`, headings in order)
|
|
171
|
+
- Visible focus styles — do not remove outlines without a replacement
|
|
172
|
+
- Color is not the only indicator of state
|
|
173
|
+
- Respect `prefers-reduced-motion`
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## When to escalate complexity
|
|
178
|
+
|
|
179
|
+
Add a design system layer (shared tokens, variants, themes) only when:
|
|
180
|
+
|
|
181
|
+
- The same values appear in **many** components and drift is causing bugs
|
|
182
|
+
- Multiple products share one UI package
|
|
183
|
+
- The team has documented ownership of that package in project context
|
|
184
|
+
|
|
185
|
+
Until then, prefer the senior CSS approach above.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Anti-patterns
|
|
190
|
+
|
|
191
|
+
| Anti-pattern | Why it fails |
|
|
192
|
+
|--------------|----------------|
|
|
193
|
+
| Wrapper divs only for styling hooks | DOM noise, unclear ownership |
|
|
194
|
+
| `data-variant` + five modifier classes on one node | State explosion |
|
|
195
|
+
| Global overrides with high specificity | Breaks other components silently |
|
|
196
|
+
| CSS-in-JS theme objects for static layout | Harder to delete, couples render to style |
|
|
197
|
+
| Inventing tokens before second use | YAGNI — violates minimal complexity |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## References
|
|
202
|
+
|
|
203
|
+
- [Cascade layers — MDN](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics/Cascade_layers)
|
|
204
|
+
- [Using CSS custom properties — MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascading_variables/Using_custom_properties)
|
|
205
|
+
- [CSS container queries — MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Containment/Container_queries)
|
|
206
|
+
- [`:where()` — MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:where)
|