cortex-agents 4.0.4 → 4.0.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.
|
@@ -178,7 +178,7 @@ Before creating a plan, load relevant skills to inform your analysis. Use the `s
|
|
|
178
178
|
| Security requirements, threat models | `security-hardening` |
|
|
179
179
|
| CI/CD pipeline design, deployment strategy | `deployment-automation` |
|
|
180
180
|
| Frontend architecture, component design | `frontend-development` |
|
|
181
|
-
| UI design, visual design, page layouts | `ui-design` |
|
|
181
|
+
| UI design, visual design, page layouts | `ui-design` (**must check `.cortex/design-spec.md` first** — create if missing) |
|
|
182
182
|
| Backend service design, middleware, auth | `backend-development` |
|
|
183
183
|
| Mobile app architecture | `mobile-development` |
|
|
184
184
|
| Desktop app architecture | `desktop-development` |
|
|
@@ -22,7 +22,7 @@ You are a fullstack developer. You implement complete features spanning frontend
|
|
|
22
22
|
| Layer | Skill to Load |
|
|
23
23
|
|-------|--------------|
|
|
24
24
|
| Frontend (React, Vue, Svelte, Angular, etc.) | `frontend-development` |
|
|
25
|
-
| UI/visual design (new pages, layouts, polish) | `ui-design` |
|
|
25
|
+
| UI/visual design (new pages, layouts, polish) | `ui-design` (**must check `.cortex/design-spec.md` first** — create if missing) |
|
|
26
26
|
| Backend (Express, Fastify, Django, Go, etc.) | `backend-development` |
|
|
27
27
|
| API contracts (REST, GraphQL, gRPC) | `api-design` |
|
|
28
28
|
| Database (schema, migrations, queries) | `database-design` |
|
package/.opencode/agents/fix.md
CHANGED
|
@@ -150,7 +150,7 @@ Before fixing, load relevant skills. Use the `skill` tool.
|
|
|
150
150
|
| API errors | `api-design` + `backend-development` |
|
|
151
151
|
| Database issues | `database-design` |
|
|
152
152
|
| Frontend rendering issues | `frontend-development` |
|
|
153
|
-
| UI visual bugs, layout issues, design inconsistencies | `ui-design` |
|
|
153
|
+
| UI visual bugs, layout issues, design inconsistencies | `ui-design` (**must check `.cortex/design-spec.md` first** — create if missing) |
|
|
154
154
|
| Deployment or CI/CD failures | `deployment-automation` |
|
|
155
155
|
|
|
156
156
|
## Debugging Quick Reference
|
|
@@ -344,7 +344,7 @@ Detect the project's technology stack and load relevant skills BEFORE writing co
|
|
|
344
344
|
| Signal | Skill to Load |
|
|
345
345
|
|--------|--------------|
|
|
346
346
|
| `package.json` has react/next/vue/nuxt/svelte/angular | `frontend-development` |
|
|
347
|
-
| UI work: new pages, components, visual design, layout | `ui-design` |
|
|
347
|
+
| UI work: new pages, components, visual design, layout | `ui-design` (**must check `.cortex/design-spec.md` first** — create if missing) |
|
|
348
348
|
| `package.json` has express/fastify/hono/nest OR Python with flask/django/fastapi | `backend-development` |
|
|
349
349
|
| Database files: `migrations/`, `schema.prisma`, `models.py`, `*.sql` | `database-design` |
|
|
350
350
|
| API routes, OpenAPI spec, GraphQL schema | `api-design` |
|
|
@@ -21,6 +21,182 @@ Use this skill when:
|
|
|
21
21
|
> For accessibility (WCAG, ARIA, keyboard navigation), see `frontend-development`.
|
|
22
22
|
> For component implementation patterns (React, Vue, Svelte), see `frontend-development`.
|
|
23
23
|
|
|
24
|
+
## Design Spec (MANDATORY — before ANY UI work)
|
|
25
|
+
|
|
26
|
+
**Every project with a UI MUST have a design spec.** Before making any visual or layout changes, you must check for and use the project's design spec. All UI work must be consistent with this spec.
|
|
27
|
+
|
|
28
|
+
### Step 1: Check for Existing Spec
|
|
29
|
+
|
|
30
|
+
Look for `.cortex/design-spec.md` in the project root. If it exists, **read it and follow it** — every color, font, spacing value, and component pattern you use must align with the spec.
|
|
31
|
+
|
|
32
|
+
### Step 2: Create Spec if Missing
|
|
33
|
+
|
|
34
|
+
If `.cortex/design-spec.md` does NOT exist, you **MUST create one before writing any UI code**:
|
|
35
|
+
|
|
36
|
+
1. **Analyze the existing app** — scan all frontend files (components, pages, layouts, stylesheets, Tailwind config, theme files, CSS variables) to extract the current visual identity
|
|
37
|
+
2. **Identify existing patterns** — colors in use, font families, spacing conventions, border radii, shadow usage, component styles
|
|
38
|
+
3. **Synthesize into a spec** — consolidate findings into a coherent design spec, resolving any inconsistencies by choosing the dominant or best pattern
|
|
39
|
+
4. **Save to `.cortex/design-spec.md`** using the template below
|
|
40
|
+
|
|
41
|
+
If the project has no existing UI (greenfield), generate a design spec based on the project type (SaaS, marketing, developer tool, etc.) and ask the user to confirm key branding choices (primary color, font family, overall feel) before proceeding.
|
|
42
|
+
|
|
43
|
+
### Step 3: Reference the Spec During Implementation
|
|
44
|
+
|
|
45
|
+
For every UI change:
|
|
46
|
+
- Use **only** the colors defined in the spec
|
|
47
|
+
- Use **only** the typography scale from the spec
|
|
48
|
+
- Follow the spacing system in the spec
|
|
49
|
+
- Match the component patterns (border radius, shadows, button styles) from the spec
|
|
50
|
+
- Maintain the overall look & feel described in the spec
|
|
51
|
+
|
|
52
|
+
If a task requires something not covered by the spec (e.g., a new component type, a new color for a new feature), **extend the spec first**, then implement.
|
|
53
|
+
|
|
54
|
+
### Design Spec Template
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# Design Spec — [Project Name]
|
|
58
|
+
|
|
59
|
+
> Auto-generated from codebase analysis. Keep this file updated as the design evolves.
|
|
60
|
+
> Location: `.cortex/design-spec.md`
|
|
61
|
+
|
|
62
|
+
## Brand Identity
|
|
63
|
+
|
|
64
|
+
### Brand Personality
|
|
65
|
+
- **Tone**: [e.g., Professional & approachable / Bold & playful / Minimal & technical]
|
|
66
|
+
- **Feel**: [e.g., Modern SaaS / Enterprise / Developer tool / Consumer app]
|
|
67
|
+
- **Keywords**: [3-5 adjectives, e.g., clean, trustworthy, fast, friendly]
|
|
68
|
+
|
|
69
|
+
### Logo & Assets
|
|
70
|
+
- Logo location: [path or "not yet defined"]
|
|
71
|
+
- Favicon: [path or "not yet defined"]
|
|
72
|
+
- Brand mark usage notes: [any constraints]
|
|
73
|
+
|
|
74
|
+
## Color Palette
|
|
75
|
+
|
|
76
|
+
### Primary
|
|
77
|
+
- **Primary**: [hex] — [Tailwind class, e.g., `blue-600`]
|
|
78
|
+
- **Primary hover**: [hex] — [Tailwind class]
|
|
79
|
+
- **Primary light** (backgrounds): [hex] — [Tailwind class]
|
|
80
|
+
- **Primary dark** (text on light): [hex] — [Tailwind class]
|
|
81
|
+
|
|
82
|
+
### Accent (if applicable)
|
|
83
|
+
- **Accent**: [hex] — [Tailwind class]
|
|
84
|
+
|
|
85
|
+
### Neutrals
|
|
86
|
+
- **Background**: [hex] — [Tailwind class]
|
|
87
|
+
- **Surface** (cards, panels): [hex] — [Tailwind class]
|
|
88
|
+
- **Border**: [hex] — [Tailwind class]
|
|
89
|
+
- **Text primary**: [hex] — [Tailwind class]
|
|
90
|
+
- **Text secondary**: [hex] — [Tailwind class]
|
|
91
|
+
- **Text muted**: [hex] — [Tailwind class]
|
|
92
|
+
|
|
93
|
+
### Semantic Colors
|
|
94
|
+
- **Success**: [hex] — [Tailwind class]
|
|
95
|
+
- **Warning**: [hex] — [Tailwind class]
|
|
96
|
+
- **Error**: [hex] — [Tailwind class]
|
|
97
|
+
- **Info**: [hex] — [Tailwind class]
|
|
98
|
+
|
|
99
|
+
### Dark Mode (if applicable)
|
|
100
|
+
[Repeat the above structure for dark mode overrides, or note "N/A"]
|
|
101
|
+
|
|
102
|
+
## Typography
|
|
103
|
+
|
|
104
|
+
### Font Families
|
|
105
|
+
- **Headings**: [font name] — [source, e.g., Google Fonts / system / @fontsource]
|
|
106
|
+
- **Body**: [font name] — [source]
|
|
107
|
+
- **Monospace** (code): [font name] — [source]
|
|
108
|
+
|
|
109
|
+
### Type Scale
|
|
110
|
+
| Level | Size | Weight | Line Height | Tailwind |
|
|
111
|
+
|-------|------|--------|-------------|----------|
|
|
112
|
+
| Display | [px] | [weight] | [lh] | [classes] |
|
|
113
|
+
| H1 | [px] | [weight] | [lh] | [classes] |
|
|
114
|
+
| H2 | [px] | [weight] | [lh] | [classes] |
|
|
115
|
+
| H3 | [px] | [weight] | [lh] | [classes] |
|
|
116
|
+
| H4 | [px] | [weight] | [lh] | [classes] |
|
|
117
|
+
| Body | [px] | [weight] | [lh] | [classes] |
|
|
118
|
+
| Small | [px] | [weight] | [lh] | [classes] |
|
|
119
|
+
| Caption | [px] | [weight] | [lh] | [classes] |
|
|
120
|
+
|
|
121
|
+
## Spacing & Layout
|
|
122
|
+
|
|
123
|
+
### Base Unit
|
|
124
|
+
- **Base**: [e.g., 8px / 4px]
|
|
125
|
+
- **Scale**: [list the spacing scale used, e.g., 4, 8, 12, 16, 24, 32, 48, 64]
|
|
126
|
+
|
|
127
|
+
### Container
|
|
128
|
+
- **Max width**: [e.g., max-w-7xl / 1280px]
|
|
129
|
+
- **Page padding**: [e.g., px-4 sm:px-6 lg:px-8]
|
|
130
|
+
|
|
131
|
+
### Content Density
|
|
132
|
+
- **Target**: [Spacious / Balanced / Dense]
|
|
133
|
+
|
|
134
|
+
## Component Patterns
|
|
135
|
+
|
|
136
|
+
### Border Radius
|
|
137
|
+
- **Cards / Modals**: [e.g., rounded-xl / 12px]
|
|
138
|
+
- **Buttons / Inputs**: [e.g., rounded-lg / 8px]
|
|
139
|
+
- **Badges / Pills**: [e.g., rounded-full]
|
|
140
|
+
|
|
141
|
+
### Shadows
|
|
142
|
+
- **Cards**: [e.g., shadow-sm]
|
|
143
|
+
- **Dropdowns**: [e.g., shadow-md]
|
|
144
|
+
- **Modals**: [e.g., shadow-lg]
|
|
145
|
+
|
|
146
|
+
### Buttons
|
|
147
|
+
| Variant | Classes |
|
|
148
|
+
|---------|---------|
|
|
149
|
+
| Primary | [full Tailwind classes] |
|
|
150
|
+
| Secondary | [full Tailwind classes] |
|
|
151
|
+
| Ghost | [full Tailwind classes] |
|
|
152
|
+
| Destructive | [full Tailwind classes] |
|
|
153
|
+
|
|
154
|
+
### Inputs
|
|
155
|
+
- **Height**: [e.g., h-10 / 40px]
|
|
156
|
+
- **Border**: [e.g., border border-gray-300]
|
|
157
|
+
- **Focus**: [e.g., ring-2 ring-primary-500]
|
|
158
|
+
- **Error**: [e.g., border-red-500 + text-sm text-red-600 message below]
|
|
159
|
+
|
|
160
|
+
### Navigation Pattern
|
|
161
|
+
- **Type**: [Top navbar / Sidebar / Bottom tabs]
|
|
162
|
+
- **Active state**: [classes for active nav item]
|
|
163
|
+
|
|
164
|
+
## Look & Feel
|
|
165
|
+
|
|
166
|
+
### Overall Aesthetic
|
|
167
|
+
[1-2 sentences describing the visual identity, e.g., "Clean, minimal interface with generous whitespace, subtle shadows, and a blue-primary palette that conveys trust and professionalism."]
|
|
168
|
+
|
|
169
|
+
### Motion
|
|
170
|
+
- **Hover transitions**: [e.g., transition-colors duration-150]
|
|
171
|
+
- **Panel animations**: [e.g., transition-all duration-200 ease-in-out]
|
|
172
|
+
- **Respect reduced motion**: [yes/no]
|
|
173
|
+
|
|
174
|
+
### Iconography
|
|
175
|
+
- **Icon library**: [e.g., Lucide / Heroicons / Phosphor]
|
|
176
|
+
- **Default size**: [e.g., w-5 h-5 / 20px]
|
|
177
|
+
- **Style**: [e.g., outline / solid / duotone]
|
|
178
|
+
|
|
179
|
+
### Imagery
|
|
180
|
+
- **Style**: [e.g., illustrations / photos / abstract]
|
|
181
|
+
- **Source**: [e.g., in-house / Unsplash / none yet]
|
|
182
|
+
|
|
183
|
+
## Do's and Don'ts
|
|
184
|
+
|
|
185
|
+
### Do
|
|
186
|
+
- [e.g., Use the primary color for all main CTAs]
|
|
187
|
+
- [e.g., Maintain consistent padding inside cards (p-6)]
|
|
188
|
+
- [e.g., Use skeleton loaders for async content]
|
|
189
|
+
|
|
190
|
+
### Don't
|
|
191
|
+
- [e.g., Don't use arbitrary hex colors outside the palette]
|
|
192
|
+
- [e.g., Don't mix border radius values within the same context]
|
|
193
|
+
- [e.g., Don't skip hover/focus states on interactive elements]
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Updating the Spec
|
|
197
|
+
|
|
198
|
+
When you make intentional design changes (new component patterns, color additions, etc.), **update `.cortex/design-spec.md`** to reflect them. The spec is a living document that must stay in sync with the codebase.
|
|
199
|
+
|
|
24
200
|
## Visual Hierarchy & Layout
|
|
25
201
|
|
|
26
202
|
### Scanning Patterns
|
package/README.md
CHANGED
|
@@ -154,6 +154,17 @@ Implement Agent detects: package.json has React + Express + Prisma
|
|
|
154
154
|
-> implements with deep framework-specific knowledge
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
+
### Design Spec Enforcement
|
|
158
|
+
|
|
159
|
+
All UI work is governed by a **mandatory design spec** (`.cortex/design-spec.md`). When any agent loads the `ui-design` skill:
|
|
160
|
+
|
|
161
|
+
1. **Check** — looks for `.cortex/design-spec.md`
|
|
162
|
+
2. **Create if missing** — analyzes the entire app (components, styles, Tailwind config, theme files, CSS variables) and synthesizes a spec covering brand identity, color palette, typography, spacing, component patterns, and look & feel
|
|
163
|
+
3. **Follow it** — every color, font, spacing value, and component pattern must align with the spec
|
|
164
|
+
4. **Extend it** — if a task needs something not in the spec, the spec is updated first
|
|
165
|
+
|
|
166
|
+
This ensures visual consistency across all agents and sessions — no more one-off colors, mismatched radii, or inconsistent button styles.
|
|
167
|
+
|
|
157
168
|
---
|
|
158
169
|
|
|
159
170
|
## Tools
|
|
@@ -230,7 +241,7 @@ State persists to `.cortex/repl-state.json` — survives context compaction, ses
|
|
|
230
241
|
| Skill | Covers |
|
|
231
242
|
|-------|--------|
|
|
232
243
|
| `frontend-development` | React, Vue, Svelte, CSS architecture, accessibility |
|
|
233
|
-
| `ui-design` | Visual hierarchy, typography, color systems, spacing, motion, professional polish |
|
|
244
|
+
| `ui-design` | Visual hierarchy, typography, color systems, spacing, motion, professional polish. **Enforces a mandatory design spec** (`.cortex/design-spec.md`) — auto-creates from codebase analysis if missing, ensuring brand consistency across all UI work. |
|
|
234
245
|
| `backend-development` | API design, middleware, auth, caching, queue systems |
|
|
235
246
|
| `mobile-development` | React Native, Flutter, native iOS/Android patterns |
|
|
236
247
|
| `desktop-development` | Electron, Tauri, native desktop application patterns |
|
|
@@ -365,6 +376,7 @@ quality_gate_summary receives reports from 6 agents:
|
|
|
365
376
|
your-project/
|
|
366
377
|
.cortex/ Project context (auto-initialized)
|
|
367
378
|
config.json Configuration
|
|
379
|
+
design-spec.md UI design spec — branding, colors, typography, patterns
|
|
368
380
|
plans/ Implementation plans
|
|
369
381
|
sessions/ Session summaries
|
|
370
382
|
repl-state.json REPL loop progress (auto-managed)
|
package/package.json
CHANGED