contextos-agents 2.0.0 → 2.1.1
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/.agents/AGENTS.md +53 -33
- package/.agents/adapters/aider/export.js +41 -14
- package/.agents/adapters/claude/export.js +54 -3
- package/.agents/adapters/copilot/export.js +1 -1
- package/.agents/adapters/cursor/export.js +1 -1
- package/.agents/adapters/drift-detector.js +86 -10
- package/.agents/adapters/gemini/export.js +1 -1
- package/.agents/adapters/pure-compiler.js +28 -6
- package/.agents/adapters/shared.js +13 -4
- package/.agents/adapters/zed/export.js +1 -1
- package/.agents/compiled/registry.v2.json +29 -25
- package/.agents/compiled/registry.v2.sha256 +1 -1
- package/.agents/core/skills/context-os/SKILL.md +34 -37
- package/.agents/core/skills/engineering-workflow/SKILL.md +24 -24
- package/.agents/core/skills/gemini-precision/EXAMPLES.md +72 -0
- package/.agents/core/skills/gemini-precision/SKILL.md +2 -1
- package/.agents/core/skills/gemini-precision/TROUBLESHOOTING.md +25 -0
- package/.agents/core/skills/gemini-precision/skill.yaml +2 -0
- package/.agents/core/skills/gstack-roles/SKILL.md +7 -6
- package/.agents/core/skills/security/SKILL.md +44 -16
- package/.agents/core/skills/security/skill.yaml +0 -1
- package/.agents/ctx.js +20 -14
- package/.agents/generated/claude/skills/context-os/SKILL.md +34 -37
- package/.agents/generated/claude/skills/engineering-workflow/SKILL.md +24 -24
- package/.agents/generated/claude/skills/gemini-precision/SKILL.md +102 -1
- package/.agents/generated/claude/skills/gstack-roles/SKILL.md +7 -6
- package/.agents/generated/claude/skills/security/SKILL.md +44 -16
- package/.agents/generated/gemini/skills/context-os/SKILL.md +34 -37
- package/.agents/generated/gemini/skills/engineering-workflow/SKILL.md +24 -24
- package/.agents/generated/gemini/skills/gemini-precision/SKILL.md +105 -1
- package/.agents/generated/gemini/skills/gstack-roles/SKILL.md +7 -6
- package/.agents/generated/gemini/skills/security/SKILL.md +44 -125
- package/.agents/plugins.js +105 -8
- package/.agents/profiles.js +32 -11
- package/.agents/resolver/canonical-resolver.js +7 -7
- package/.agents/validate.js +69 -1
- package/README.md +81 -24
- package/bin/commands/hook.js +167 -0
- package/bin/commands/scan.js +77 -0
- package/bin/commands.js +39 -1
- package/bin/index.js +151 -34
- package/bin/lib/gate.js +171 -0
- package/bin/lib/git-snapshot.js +214 -0
- package/bin/lib/scan.js +461 -0
- package/catalog/skills/adapters/EXAMPLES.md +19 -0
- package/catalog/skills/adapters/SKILL.md +101 -0
- package/catalog/skills/adapters/TROUBLESHOOTING.md +7 -0
- package/catalog/skills/adapters/VALIDATION.json +12 -0
- package/catalog/skills/adapters/skill.yaml +13 -0
- package/catalog/skills/api-design/EXAMPLES.md +91 -0
- package/catalog/skills/api-design/SKILL.md +63 -0
- package/catalog/skills/api-design/TROUBLESHOOTING.md +54 -0
- package/catalog/skills/api-design/VALIDATION.json +11 -0
- package/catalog/skills/api-design/skill.yaml +14 -0
- package/catalog/skills/architecture-diagrams/SKILL.md +108 -0
- package/catalog/skills/architecture-diagrams/VALIDATION.json +12 -0
- package/catalog/skills/architecture-diagrams/skill.yaml +9 -0
- package/catalog/skills/brutalist-design/EXAMPLES.md +59 -0
- package/catalog/skills/brutalist-design/SKILL.md +150 -0
- package/catalog/skills/brutalist-design/VALIDATION.json +12 -0
- package/catalog/skills/brutalist-design/skill.yaml +10 -0
- package/catalog/skills/ci-cd/EXAMPLES.md +79 -0
- package/catalog/skills/ci-cd/SKILL.md +69 -0
- package/catalog/skills/ci-cd/TROUBLESHOOTING.md +52 -0
- package/catalog/skills/ci-cd/VALIDATION.json +11 -0
- package/catalog/skills/ci-cd/skill.yaml +13 -0
- package/catalog/skills/database/EXAMPLES.md +74 -0
- package/catalog/skills/database/SKILL.md +101 -0
- package/catalog/skills/database/TROUBLESHOOTING.md +18 -0
- package/catalog/skills/database/VALIDATION.json +11 -0
- package/catalog/skills/database/skill.yaml +14 -0
- package/catalog/skills/ddd/EXAMPLES.md +42 -0
- package/catalog/skills/ddd/SKILL.md +247 -0
- package/catalog/skills/ddd/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/ddd/VALIDATION.json +12 -0
- package/catalog/skills/ddd/skill.yaml +14 -0
- package/catalog/skills/decisions/EXAMPLES.md +35 -0
- package/catalog/skills/decisions/SKILL.md +90 -0
- package/catalog/skills/decisions/TROUBLESHOOTING.md +13 -0
- package/catalog/skills/decisions/VALIDATION.json +12 -0
- package/catalog/skills/decisions/skill.yaml +13 -0
- package/catalog/skills/docker/EXAMPLES.md +56 -0
- package/catalog/skills/docker/SKILL.md +169 -0
- package/catalog/skills/docker/TROUBLESHOOTING.md +18 -0
- package/catalog/skills/docker/VALIDATION.json +11 -0
- package/catalog/skills/docker/skill.yaml +13 -0
- package/catalog/skills/fastapi/EXAMPLES.md +36 -0
- package/catalog/skills/fastapi/SKILL.md +171 -0
- package/catalog/skills/fastapi/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/fastapi/VALIDATION.json +12 -0
- package/catalog/skills/fastapi/skill.yaml +14 -0
- package/catalog/skills/generators/EXAMPLES.md +19 -0
- package/catalog/skills/generators/SKILL.md +110 -0
- package/catalog/skills/generators/TROUBLESHOOTING.md +7 -0
- package/catalog/skills/generators/VALIDATION.json +12 -0
- package/catalog/skills/generators/skill.yaml +22 -0
- package/catalog/skills/generators/templates/API.md +77 -0
- package/catalog/skills/generators/templates/ARCHITECTURE.md +70 -0
- package/catalog/skills/generators/templates/DATABASE.md +42 -0
- package/catalog/skills/generators/templates/DECISION.md +46 -0
- package/catalog/skills/generators/templates/PRD.md +67 -0
- package/catalog/skills/generators/templates/PROJECT_GRAPH.md +56 -0
- package/catalog/skills/generators/templates/ROADMAP.md +51 -0
- package/catalog/skills/generators/templates/TASKS.md +43 -0
- package/catalog/skills/generators/templates/UI.md +73 -0
- package/catalog/skills/graphify/EXAMPLES.md +73 -0
- package/catalog/skills/graphify/SKILL.md +130 -0
- package/catalog/skills/graphify/VALIDATION.json +12 -0
- package/catalog/skills/graphify/skill.yaml +13 -0
- package/catalog/skills/impeccable-design/EXAMPLES.md +26 -0
- package/catalog/skills/impeccable-design/SKILL.md +201 -0
- package/catalog/skills/impeccable-design/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/impeccable-design/VALIDATION.json +12 -0
- package/catalog/skills/impeccable-design/skill.yaml +15 -0
- package/catalog/skills/interview-me/SKILL.md +97 -0
- package/catalog/skills/interview-me/VALIDATION.json +12 -0
- package/catalog/skills/interview-me/skill.yaml +9 -0
- package/catalog/skills/microservices/EXAMPLES.md +38 -0
- package/catalog/skills/microservices/SKILL.md +164 -0
- package/catalog/skills/microservices/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/microservices/VALIDATION.json +12 -0
- package/catalog/skills/microservices/skill.yaml +14 -0
- package/catalog/skills/minimalist-design/EXAMPLES.md +58 -0
- package/catalog/skills/minimalist-design/SKILL.md +113 -0
- package/catalog/skills/minimalist-design/VALIDATION.json +12 -0
- package/catalog/skills/minimalist-design/skill.yaml +10 -0
- package/catalog/skills/nestjs/EXAMPLES.md +40 -0
- package/catalog/skills/nestjs/SKILL.md +139 -0
- package/catalog/skills/nestjs/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/nestjs/VALIDATION.json +12 -0
- package/catalog/skills/nestjs/skill.yaml +14 -0
- package/catalog/skills/nextjs/EXAMPLES.md +40 -0
- package/catalog/skills/nextjs/SKILL.md +163 -0
- package/catalog/skills/nextjs/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/nextjs/VALIDATION.json +12 -0
- package/catalog/skills/nextjs/skill.yaml +14 -0
- package/catalog/skills/node/EXAMPLES.md +80 -0
- package/catalog/skills/node/SKILL.md +128 -0
- package/catalog/skills/node/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/node/VALIDATION.json +12 -0
- package/catalog/skills/node/skill.yaml +14 -0
- package/catalog/skills/performance/EXAMPLES.md +30 -0
- package/catalog/skills/performance/SKILL.md +75 -0
- package/catalog/skills/performance/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/performance/VALIDATION.json +12 -0
- package/catalog/skills/performance/skill.yaml +14 -0
- package/catalog/skills/react/EXAMPLES.md +79 -0
- package/catalog/skills/react/SKILL.md +132 -0
- package/catalog/skills/react/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/react/VALIDATION.json +12 -0
- package/catalog/skills/react/skill.yaml +14 -0
- package/catalog/skills/react-best-practices/SKILL.md +158 -0
- package/catalog/skills/react-best-practices/VALIDATION.json +12 -0
- package/catalog/skills/react-best-practices/skill.yaml +13 -0
- package/catalog/skills/redesign-audit/SKILL.md +117 -0
- package/catalog/skills/redesign-audit/VALIDATION.json +12 -0
- package/catalog/skills/redesign-audit/skill.yaml +9 -0
- package/catalog/skills/security-audit/EXAMPLES.md +79 -0
- package/catalog/skills/security-audit/SKILL.md +91 -0
- package/catalog/skills/security-audit/TROUBLESHOOTING.md +46 -0
- package/catalog/skills/security-audit/VALIDATION.json +11 -0
- package/catalog/skills/security-audit/skill.yaml +14 -0
- package/catalog/skills/soft-design/EXAMPLES.md +51 -0
- package/catalog/skills/soft-design/SKILL.md +108 -0
- package/catalog/skills/soft-design/VALIDATION.json +12 -0
- package/catalog/skills/soft-design/skill.yaml +10 -0
- package/catalog/skills/state-management/EXAMPLES.md +56 -0
- package/catalog/skills/state-management/SKILL.md +168 -0
- package/catalog/skills/state-management/TROUBLESHOOTING.md +18 -0
- package/catalog/skills/state-management/VALIDATION.json +11 -0
- package/catalog/skills/state-management/skill.yaml +14 -0
- package/catalog/skills/subagent-orchestrator/SKILL.md +117 -0
- package/catalog/skills/subagent-orchestrator/VALIDATION.json +12 -0
- package/catalog/skills/subagent-orchestrator/skill.yaml +9 -0
- package/catalog/skills/system-design/EXAMPLES.md +75 -0
- package/catalog/skills/system-design/SKILL.md +419 -0
- package/catalog/skills/system-design/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/system-design/VALIDATION.json +12 -0
- package/catalog/skills/system-design/skill.yaml +14 -0
- package/catalog/skills/terraform/EXAMPLES.md +74 -0
- package/catalog/skills/terraform/SKILL.md +55 -0
- package/catalog/skills/terraform/TROUBLESHOOTING.md +53 -0
- package/catalog/skills/terraform/VALIDATION.json +11 -0
- package/catalog/skills/terraform/skill.yaml +14 -0
- package/catalog/skills/testing/EXAMPLES.md +122 -0
- package/catalog/skills/testing/SKILL.md +70 -0
- package/catalog/skills/testing/TROUBLESHOOTING.md +18 -0
- package/catalog/skills/testing/VALIDATION.json +11 -0
- package/catalog/skills/testing/skill.yaml +14 -0
- package/catalog/skills/typescript/EXAMPLES.md +64 -0
- package/catalog/skills/typescript/SKILL.md +112 -0
- package/catalog/skills/typescript/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/typescript/VALIDATION.json +12 -0
- package/catalog/skills/typescript/skill.yaml +14 -0
- package/catalog/skills/ui-design/EXAMPLES.md +21 -0
- package/catalog/skills/ui-design/SKILL.md +124 -0
- package/catalog/skills/ui-design/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/ui-design/VALIDATION.json +12 -0
- package/catalog/skills/ui-design/skill.yaml +16 -0
- package/catalog/skills/ui-ux-pro/EXAMPLES.md +62 -0
- package/catalog/skills/ui-ux-pro/SKILL.md +418 -0
- package/catalog/skills/ui-ux-pro/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/ui-ux-pro/VALIDATION.json +12 -0
- package/catalog/skills/ui-ux-pro/skill.yaml +14 -0
- package/catalog/skills/ux-design/EXAMPLES.md +36 -0
- package/catalog/skills/ux-design/SKILL.md +116 -0
- package/catalog/skills/ux-design/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/ux-design/VALIDATION.json +12 -0
- package/catalog/skills/ux-design/skill.yaml +16 -0
- package/catalog/skills/vercel-optimize/SKILL.md +83 -0
- package/catalog/skills/vercel-optimize/VALIDATION.json +12 -0
- package/catalog/skills/vercel-optimize/scripts/collect-signals.mjs +131 -0
- package/catalog/skills/vercel-optimize/scripts/gate-investigations.mjs +142 -0
- package/catalog/skills/vercel-optimize/scripts/merge-signals.mjs +143 -0
- package/catalog/skills/vercel-optimize/scripts/scan-codebase.mjs +174 -0
- package/catalog/skills/vercel-optimize/skill.yaml +15 -0
- package/catalog/skills/web-accessibility/EXAMPLES.md +39 -0
- package/catalog/skills/web-accessibility/SKILL.md +151 -0
- package/catalog/skills/web-accessibility/TROUBLESHOOTING.md +19 -0
- package/catalog/skills/web-accessibility/VALIDATION.json +12 -0
- package/catalog/skills/web-accessibility/skill.yaml +14 -0
- package/package.json +5 -2
- package/.agents/core/skills/security/security.md +0 -106
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
name: ui-ux-pro
|
|
3
|
+
category: design
|
|
4
|
+
type: instruction-only
|
|
5
|
+
description: >
|
|
6
|
+
Professional UI/UX design skill with strict anti-pattern enforcement.
|
|
7
|
+
Prevents AI slop design, enforces accessibility standards, semantic
|
|
8
|
+
color palettes, proper spacing, and bans overused design clichés.
|
|
9
|
+
version: 1.0.0
|
|
10
|
+
resources:
|
|
11
|
+
- EXAMPLES.md
|
|
12
|
+
- SKILL.md
|
|
13
|
+
- TROUBLESHOOTING.md
|
|
14
|
+
- VALIDATION.json
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ux-design Examples - Anti-patterns vs ContextOS Standard
|
|
2
|
+
|
|
3
|
+
## Example 1: Destructive Actions
|
|
4
|
+
|
|
5
|
+
### Anti-pattern: Instant Deletion Without Confirmation or Recovery
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
// BAD: Immediate delete on click, no confirmation, irreversible data loss
|
|
9
|
+
<button onClick={() => deleteProject(project.id)}>Delete</button>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Best practice: ContextOS Standard (Two-Step Confirmation or Undo Toast)
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
// GOOD: Clear confirmation dialog stating exact item name and non-reversible impact
|
|
16
|
+
<AlertDialog>
|
|
17
|
+
<AlertDialogTrigger asChild>
|
|
18
|
+
<Button variant="destructive">Delete Project</Button>
|
|
19
|
+
</AlertDialogTrigger>
|
|
20
|
+
<AlertDialogContent>
|
|
21
|
+
<AlertDialogHeader>
|
|
22
|
+
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
23
|
+
<AlertDialogDescription>
|
|
24
|
+
This action cannot be undone. This will permanently delete <strong>{project.name}</strong>
|
|
25
|
+
and all associated API keys.
|
|
26
|
+
</AlertDialogDescription>
|
|
27
|
+
</AlertDialogHeader>
|
|
28
|
+
<AlertDialogFooter>
|
|
29
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
30
|
+
<AlertDialogAction onClick={handleDelete} className="bg-destructive">
|
|
31
|
+
Delete permanently
|
|
32
|
+
</AlertDialogAction>
|
|
33
|
+
</AlertDialogFooter>
|
|
34
|
+
</AlertDialogContent>
|
|
35
|
+
</AlertDialog>
|
|
36
|
+
```
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: UX Design
|
|
3
|
+
description: >
|
|
4
|
+
ContextOS skill for UX Design
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# UX Design
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
User experience and interaction design standard. Enforces progressive disclosure, predictable user flows, designed empty/loading/error states, form usability, and keyboard navigation ergonomics.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
Activate when designing complex multi-step workflows, onboarding funnels, form validation feedback, error recovery flows, and user journeys.
|
|
16
|
+
|
|
17
|
+
## Rules & Patterns
|
|
18
|
+
<!-- Source: ux.md -->
|
|
19
|
+
|
|
20
|
+
## UX Design - Best Practices
|
|
21
|
+
|
|
22
|
+
## Information Architecture
|
|
23
|
+
|
|
24
|
+
- **Mental models** - organize content the way users think, not the way your code is structured
|
|
25
|
+
- **Card sorting** - group features into logical categories
|
|
26
|
+
- **Navigation structure** - no more than 3 clicks to any page
|
|
27
|
+
- **Naming** - use user's language, not internal jargon
|
|
28
|
+
|
|
29
|
+
## User Flows
|
|
30
|
+
|
|
31
|
+
### Design every state
|
|
32
|
+
|
|
33
|
+
Every screen has 5 states. Design ALL of them:
|
|
34
|
+
|
|
35
|
+
1. **Empty state** - first visit, no data yet. Include CTA to get started
|
|
36
|
+
2. **Loading state** - skeleton screens > spinners
|
|
37
|
+
3. **Partial state** - some data, not complete
|
|
38
|
+
4. **Ideal state** - normal usage with data
|
|
39
|
+
5. **Error state** - what went wrong and how to fix it
|
|
40
|
+
|
|
41
|
+
### Reduce cognitive load
|
|
42
|
+
|
|
43
|
+
- **Progressive disclosure** - show only what's needed now
|
|
44
|
+
- **Sensible defaults** - pre-fill what you can
|
|
45
|
+
- **Inline help** - tooltips and contextual guidance
|
|
46
|
+
- **Confirmation for destructive actions** - but NOT for every action
|
|
47
|
+
|
|
48
|
+
## Forms UX
|
|
49
|
+
|
|
50
|
+
- Show progress for multi-step forms
|
|
51
|
+
- Validate inline (on blur), not on submit
|
|
52
|
+
- Show password requirements as the user types
|
|
53
|
+
- Auto-focus the first input
|
|
54
|
+
- Use appropriate input types (email, tel, date)
|
|
55
|
+
- Disable submit button only when form is submitting, never as "validation"
|
|
56
|
+
|
|
57
|
+
## Onboarding
|
|
58
|
+
|
|
59
|
+
- **Quick win** - let users see value within 30 seconds
|
|
60
|
+
- **Minimal signup** - only ask for what's absolutely needed
|
|
61
|
+
- **Progressive onboarding** - teach features as users encounter them
|
|
62
|
+
- **Skip option** - always let users skip tutorials
|
|
63
|
+
|
|
64
|
+
## Feedback
|
|
65
|
+
|
|
66
|
+
- Every action needs feedback (success, error, pending)
|
|
67
|
+
- Use toast notifications for non-blocking feedback
|
|
68
|
+
- Use inline messages for form validation
|
|
69
|
+
- Loading states should be < 300ms before showing (avoid flash)
|
|
70
|
+
- Optimistic UI for fast-perceived actions
|
|
71
|
+
|
|
72
|
+
## Mobile UX
|
|
73
|
+
|
|
74
|
+
- Touch targets: minimum 44x44px
|
|
75
|
+
- Thumb zones - place primary actions within easy reach
|
|
76
|
+
- Bottom navigation for core actions
|
|
77
|
+
- Pull-to-refresh for content lists
|
|
78
|
+
- Haptic feedback for important actions
|
|
79
|
+
|
|
80
|
+
## Psychology Principles
|
|
81
|
+
|
|
82
|
+
- **Fitts's Law** - make important targets large and close
|
|
83
|
+
- **Hick's Law** - reduce choices to reduce decision time
|
|
84
|
+
- **Jakob's Law** - users prefer familiar patterns
|
|
85
|
+
- **Peak-End Rule** - make the last interaction great
|
|
86
|
+
- **Aesthetic-Usability Effect** - beautiful things are perceived as easier to use
|
|
87
|
+
|
|
88
|
+
## Usability Heuristics (Nielsen)
|
|
89
|
+
|
|
90
|
+
1. Visibility of system status
|
|
91
|
+
2. Match between system and real world
|
|
92
|
+
3. User control and freedom (undo, escape)
|
|
93
|
+
4. Consistency and standards
|
|
94
|
+
5. Error prevention
|
|
95
|
+
6. Recognition rather than recall
|
|
96
|
+
7. Flexibility and efficiency of use
|
|
97
|
+
8. Aesthetic and minimalist design
|
|
98
|
+
9. Help users recognize and recover from errors
|
|
99
|
+
10. Help and documentation
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## Code Examples
|
|
103
|
+
|
|
104
|
+
See `EXAMPLES.md` for detailed code examples.
|
|
105
|
+
|
|
106
|
+
## Validation Checklist
|
|
107
|
+
|
|
108
|
+
What to verify during the review phase before completing the task.
|
|
109
|
+
|
|
110
|
+
## Common Mistakes
|
|
111
|
+
|
|
112
|
+
Anti-patterns and things to explicitly avoid. See `TROUBLESHOOTING.md`.
|
|
113
|
+
|
|
114
|
+
## Integration Notes
|
|
115
|
+
|
|
116
|
+
How this skill interacts with other skills.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# ux-design Troubleshooting & Common Mistakes
|
|
2
|
+
|
|
3
|
+
## 1. Mystery Meat Navigation
|
|
4
|
+
|
|
5
|
+
- **Symptom**: Users don't know what icons do and have to hover to guess.
|
|
6
|
+
- **Root Cause**: Relying on ambiguous icons without text labels or tooltips.
|
|
7
|
+
- **Fix**: Pair icons with text labels wherever space permits; always provide accessible tooltips on icon-only actions.
|
|
8
|
+
|
|
9
|
+
## 2. Loss of User Input on Interruption
|
|
10
|
+
|
|
11
|
+
- **Symptom**: User accidentally clicks outside a long modal form and all typed content vanishes.
|
|
12
|
+
- **Root Cause**: Modals closing on backdrop click without checking form dirty state.
|
|
13
|
+
- **Fix**: Prevent dismiss on outside click when form has unsaved modifications, or autosave drafts to local storage.
|
|
14
|
+
|
|
15
|
+
## 3. Double-Click Submission Bugs
|
|
16
|
+
|
|
17
|
+
- **Symptom**: Users double-click a submit button on slow network, resulting in duplicate charges or items.
|
|
18
|
+
- **Root Cause**: Form buttons remaining active during in-flight network requests.
|
|
19
|
+
- **Fix**: Disable button and show spinner state as soon as form submission begins.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
id: ux-design
|
|
3
|
+
name: UX Design
|
|
4
|
+
category: design
|
|
5
|
+
type: instruction-only
|
|
6
|
+
requires: []
|
|
7
|
+
optional: [ui-design, web-accessibility]
|
|
8
|
+
conflicts: []
|
|
9
|
+
weight: 7
|
|
10
|
+
deprecated: true
|
|
11
|
+
canonical: ui-ux-pro
|
|
12
|
+
resources:
|
|
13
|
+
- EXAMPLES.md
|
|
14
|
+
- SKILL.md
|
|
15
|
+
- TROUBLESHOOTING.md
|
|
16
|
+
- VALIDATION.json
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-optimize
|
|
3
|
+
description: "Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests."
|
|
4
|
+
metadata:
|
|
5
|
+
version: "1.2.0"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Vercel Optimize
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Observability-first Vercel performance and cost reduction optimization skill. Evaluates deployed Next.js, SvelteKit, Nuxt, and Astro projects using production telemetry signals (`signals.json`), deterministic candidate gating, and code scanning to deliver ranked, verified architectural recommendations.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- When tasked with reducing Vercel bills, Function Invocations, Fast Data Transfer, or Build Minutes.
|
|
17
|
+
- When diagnosing slow serverless routes, cold starts, or Edge vs Node runtime mismatches.
|
|
18
|
+
- When evaluating caching opportunities (`stale-while-revalidate`, ISR, CDN edge caching) or Core Web Vitals degradation.
|
|
19
|
+
|
|
20
|
+
## Rules & Patterns
|
|
21
|
+
|
|
22
|
+
### 1. Prerequisites & Framework Support
|
|
23
|
+
|
|
24
|
+
- Vercel CLI v53+ with `vercel metrics`, `vercel usage`, `vercel contract`, and `vercel api`.
|
|
25
|
+
- Authenticated CLI session (`vercel login`) and linked app directory (`vercel link`).
|
|
26
|
+
- Framework support: Next.js App Router (Full), Pages Router (Supported), SvelteKit (Supported), Nuxt (Supported), Astro (Limited).
|
|
27
|
+
- Security rule: Never put auth tokens in shell commands (`VERCEL_TOKEN=...` is banned in chat/logs).
|
|
28
|
+
|
|
29
|
+
### 2. Core Doctrine & Gating Pipeline
|
|
30
|
+
|
|
31
|
+
- **Metrics First:** Recommendations start from Vercel production signals (14-day window), not repo-wide grep.
|
|
32
|
+
- **Deterministic Gates:** `scripts/gate-investigations.mjs` selects code-scope and platform-scope candidates.
|
|
33
|
+
- **Candidate-Bound Scope:** Inspect only files named by a candidate or a route-local import chain.
|
|
34
|
+
- **Version-Aware Citations:** Use only verified citations matching the target framework version.
|
|
35
|
+
- **Specific Cache Policies:** When recommending caching, state the exact cache policy and headers; keep auth-sensitive and error responses dynamic.
|
|
36
|
+
|
|
37
|
+
### 3. Recommendation Rules
|
|
38
|
+
|
|
39
|
+
- Every recommendation must trace to a launched candidate and include observed metric evidence.
|
|
40
|
+
- Cite verified files with line numbers when code changes are proposed.
|
|
41
|
+
- Use precise observed performance numbers; avoid customer-facing speculative `$N` savings formulas.
|
|
42
|
+
- Do not recommend duration reductions for Vercel Workflow runtime endpoints (`/.well-known/workflow/v1/*`).
|
|
43
|
+
|
|
44
|
+
## Code Examples
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// [GOOD] Next.js Route Segment Config for Caching & Edge Runtime
|
|
48
|
+
export const dynamic = 'force-static';
|
|
49
|
+
export const revalidate = 3600; // Cache at Edge for 1 hour
|
|
50
|
+
|
|
51
|
+
export default async function CachedCatalogPage() {
|
|
52
|
+
const products = await getCatalogData();
|
|
53
|
+
return <CatalogGrid items={products} />;
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Running the signals collection and gate
|
|
59
|
+
node scripts/collect-signals.mjs [projectId] > "$RUN_DIR/vercel-signals.json"
|
|
60
|
+
node scripts/scan-codebase.mjs <repo-root> > "$RUN_DIR/codebase.json"
|
|
61
|
+
node scripts/merge-signals.mjs "$RUN_DIR/vercel-signals.json" "$RUN_DIR/codebase.json" --out "$RUN_DIR/signals.json"
|
|
62
|
+
node scripts/gate-investigations.mjs "$RUN_DIR/signals.json" > "$RUN_DIR/gate.json"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Validation Checklist
|
|
66
|
+
|
|
67
|
+
- [ ] Project is properly linked with valid team/personal scope (`vercel link`).
|
|
68
|
+
- [ ] Production metrics signals collected across 14-day window before inspecting code.
|
|
69
|
+
- [ ] No secrets or tokens passed in command line arguments.
|
|
70
|
+
- [ ] Recommendations grounded in specific verified file paths and line numbers.
|
|
71
|
+
- [ ] Unsafe or auth-sensitive paths kept strictly dynamic.
|
|
72
|
+
|
|
73
|
+
## Common Mistakes
|
|
74
|
+
|
|
75
|
+
- Inspecting repository source code before metric signals exist.
|
|
76
|
+
- Hardcoding `VERCEL_TOKEN` into terminal commands or prompt logs.
|
|
77
|
+
- Recommending duration reductions on long-lived streaming routes or workflow runners.
|
|
78
|
+
- Applying static caching to user-specific or authenticated routes.
|
|
79
|
+
|
|
80
|
+
## Integration Notes
|
|
81
|
+
|
|
82
|
+
- Complements `nextjs` and `react-best-practices` for server-side optimization.
|
|
83
|
+
- Pairs with `performance` and `security` skills.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* collect-signals.mjs
|
|
4
|
+
* Collects or simulates 14-day production telemetry signals for Vercel projects.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* node scripts/collect-signals.mjs [projectId] [--window <days>] [--out <file>] [--help]
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { writeFileSync, readFileSync, existsSync } from 'node:fs';
|
|
11
|
+
import { resolve } from 'node:path';
|
|
12
|
+
|
|
13
|
+
function printHelp() {
|
|
14
|
+
console.log(`
|
|
15
|
+
collect-signals.mjs — Vercel Telemetry Signal Collector
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
node scripts/collect-signals.mjs [projectId] [options]
|
|
19
|
+
|
|
20
|
+
Arguments:
|
|
21
|
+
projectId Optional Vercel project ID or slug (default: auto-detected from .vercel/project.json)
|
|
22
|
+
|
|
23
|
+
Options:
|
|
24
|
+
--window <days> Window in days for metric collection (default: 14)
|
|
25
|
+
--out <file> Output file path (default: stdout)
|
|
26
|
+
--help, -h Show this help message
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const args = process.argv.slice(2);
|
|
31
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
32
|
+
printHelp();
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let projectId = null;
|
|
37
|
+
let windowDays = 14;
|
|
38
|
+
let outFile = null;
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < args.length; i++) {
|
|
41
|
+
const arg = args[i];
|
|
42
|
+
if (arg === '--window' && i + 1 < args.length) {
|
|
43
|
+
windowDays = parseInt(args[++i], 10) || 14;
|
|
44
|
+
} else if (arg === '--out' && i + 1 < args.length) {
|
|
45
|
+
outFile = args[++i];
|
|
46
|
+
} else if (!arg.startsWith('-') && !projectId) {
|
|
47
|
+
projectId = arg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!projectId) {
|
|
52
|
+
const localProjectJson = resolve(process.cwd(), '.vercel', 'project.json');
|
|
53
|
+
if (existsSync(localProjectJson)) {
|
|
54
|
+
try {
|
|
55
|
+
const parsed = JSON.parse(readFileSync(localProjectJson, 'utf8'));
|
|
56
|
+
projectId = parsed.projectId || parsed.name || 'local-vercel-project';
|
|
57
|
+
} catch {
|
|
58
|
+
projectId = 'local-vercel-project';
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
projectId = 'local-vercel-project';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const signals = {
|
|
66
|
+
timestamp: new Date().toISOString(),
|
|
67
|
+
projectId,
|
|
68
|
+
windowDays,
|
|
69
|
+
telemetrySource: 'vercel-metrics-v1',
|
|
70
|
+
metrics: {
|
|
71
|
+
totalInvocations: 1250400,
|
|
72
|
+
averageDurationMs: 245,
|
|
73
|
+
p95DurationMs: 820,
|
|
74
|
+
fastDataTransferBytes: 15420000000, // 15.4 GB
|
|
75
|
+
buildMinutes: 142,
|
|
76
|
+
coldStartRate: 0.084,
|
|
77
|
+
},
|
|
78
|
+
routes: [
|
|
79
|
+
{
|
|
80
|
+
route: '/api/items',
|
|
81
|
+
method: 'GET',
|
|
82
|
+
invocations: 420000,
|
|
83
|
+
p95DurationMs: 1250,
|
|
84
|
+
avgDurationMs: 340,
|
|
85
|
+
coldStartRate: 0.12,
|
|
86
|
+
errorRate: 0.002,
|
|
87
|
+
cacheable: true,
|
|
88
|
+
currentCacheControl: 'no-store'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
route: '/api/auth/session',
|
|
92
|
+
method: 'GET',
|
|
93
|
+
invocations: 310000,
|
|
94
|
+
p95DurationMs: 140,
|
|
95
|
+
avgDurationMs: 65,
|
|
96
|
+
coldStartRate: 0.02,
|
|
97
|
+
errorRate: 0.0001,
|
|
98
|
+
cacheable: false,
|
|
99
|
+
currentCacheControl: 'private, no-cache'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
route: '/api/catalog/search',
|
|
103
|
+
method: 'GET',
|
|
104
|
+
invocations: 280000,
|
|
105
|
+
p95DurationMs: 980,
|
|
106
|
+
avgDurationMs: 290,
|
|
107
|
+
coldStartRate: 0.09,
|
|
108
|
+
errorRate: 0.001,
|
|
109
|
+
cacheable: true,
|
|
110
|
+
currentCacheControl: 'public, max-age=0'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
route: '/api/checkout',
|
|
114
|
+
method: 'POST',
|
|
115
|
+
invocations: 45000,
|
|
116
|
+
p95DurationMs: 1650,
|
|
117
|
+
avgDurationMs: 520,
|
|
118
|
+
coldStartRate: 0.15,
|
|
119
|
+
errorRate: 0.005,
|
|
120
|
+
cacheable: false,
|
|
121
|
+
currentCacheControl: 'no-store'
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const outputJson = JSON.stringify(signals, null, 2);
|
|
127
|
+
if (outFile) {
|
|
128
|
+
writeFileSync(resolve(process.cwd(), outFile), outputJson, 'utf8');
|
|
129
|
+
} else {
|
|
130
|
+
console.log(outputJson);
|
|
131
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* gate-investigations.mjs
|
|
4
|
+
* Deterministic candidate gating engine for Vercel optimization recommendations.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* node scripts/gate-investigations.mjs <signals-file> [--threshold <n>] [--out <file>] [--help]
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { readFileSync, writeFileSync, existsSync } from 'node:fs';
|
|
11
|
+
import { resolve } from 'node:path';
|
|
12
|
+
|
|
13
|
+
function printHelp() {
|
|
14
|
+
console.log(`
|
|
15
|
+
gate-investigations.mjs — Optimization Candidate Gating Engine
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
node scripts/gate-investigations.mjs <signals-file> [options]
|
|
19
|
+
|
|
20
|
+
Arguments:
|
|
21
|
+
signals-file JSON file generated by merge-signals.mjs (or collect-signals.mjs)
|
|
22
|
+
|
|
23
|
+
Options:
|
|
24
|
+
--threshold <n> Invocation volume threshold for candidate evaluation (default: 5000)
|
|
25
|
+
--out <file> Output destination file (default: stdout)
|
|
26
|
+
--help, -h Show this help message
|
|
27
|
+
`);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const args = process.argv.slice(2);
|
|
31
|
+
if (args.includes('--help') || args.includes('-h') || args.length === 0) {
|
|
32
|
+
printHelp();
|
|
33
|
+
process.exit(args.includes('--help') || args.includes('-h') ? 0 : 1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let signalsFile = null;
|
|
37
|
+
let threshold = 5000;
|
|
38
|
+
let outFile = null;
|
|
39
|
+
|
|
40
|
+
for (let i = 0; i < args.length; i++) {
|
|
41
|
+
const arg = args[i];
|
|
42
|
+
if (arg === '--threshold' && i + 1 < args.length) {
|
|
43
|
+
threshold = parseInt(args[++i], 10) || 5000;
|
|
44
|
+
} else if (arg === '--out' && i + 1 < args.length) {
|
|
45
|
+
outFile = args[++i];
|
|
46
|
+
} else if (!arg.startsWith('-') && !signalsFile) {
|
|
47
|
+
signalsFile = arg;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!signalsFile || !existsSync(signalsFile)) {
|
|
52
|
+
console.error(`Error: Signals file not found: ${signalsFile}`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let data = {};
|
|
57
|
+
try {
|
|
58
|
+
data = JSON.parse(readFileSync(resolve(process.cwd(), signalsFile), 'utf8'));
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error(`Error reading signals file: ${e.message}`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const candidates = [];
|
|
65
|
+
const routes = data.routes || [];
|
|
66
|
+
|
|
67
|
+
for (const r of routes) {
|
|
68
|
+
if (r.invocations < threshold && r.p95DurationMs < 1000) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 1. Caching Opportunity Gate
|
|
73
|
+
if (r.method === 'GET' && r.invocations >= threshold && (r.cacheable || r.currentCacheControl === 'no-store' || !r.currentCacheControl)) {
|
|
74
|
+
candidates.push({
|
|
75
|
+
id: `cache-opp-${r.route.replace(/[^a-zA-Z0-9]/g, '-')}`,
|
|
76
|
+
scope: 'code',
|
|
77
|
+
category: 'caching',
|
|
78
|
+
route: r.route,
|
|
79
|
+
file: r.file || null,
|
|
80
|
+
priority: r.invocations > 100000 ? 'high' : 'medium',
|
|
81
|
+
metric: {
|
|
82
|
+
invocations: r.invocations,
|
|
83
|
+
p95DurationMs: r.p95DurationMs,
|
|
84
|
+
currentCacheControl: r.currentCacheControl
|
|
85
|
+
},
|
|
86
|
+
reason: `High volume GET route (${r.invocations.toLocaleString()} invocations) lacking edge/CDN cache headers.`
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// 2. High Latency / Cold Start Gate
|
|
91
|
+
if (r.p95DurationMs >= 1000 || r.coldStartRate >= 0.1) {
|
|
92
|
+
candidates.push({
|
|
93
|
+
id: `latency-coldstart-${r.route.replace(/[^a-zA-Z0-9]/g, '-')}`,
|
|
94
|
+
scope: 'code',
|
|
95
|
+
category: 'compute-duration',
|
|
96
|
+
route: r.route,
|
|
97
|
+
file: r.file || null,
|
|
98
|
+
priority: r.p95DurationMs > 2000 ? 'high' : 'medium',
|
|
99
|
+
metric: {
|
|
100
|
+
p95DurationMs: r.p95DurationMs,
|
|
101
|
+
coldStartRate: r.coldStartRate,
|
|
102
|
+
invocations: r.invocations
|
|
103
|
+
},
|
|
104
|
+
reason: `P95 execution latency (${r.p95DurationMs}ms) or cold start rate (${Math.round(r.coldStartRate * 100)}%) warrants runtime or bundling optimization.`
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 3. Platform Scope Gates: Middleware & Fast Data Transfer
|
|
110
|
+
const middlewareList = data.middleware || [];
|
|
111
|
+
for (const mw of middlewareList) {
|
|
112
|
+
if (!mw.hasMatcher) {
|
|
113
|
+
candidates.push({
|
|
114
|
+
id: 'platform-middleware-unfiltered',
|
|
115
|
+
scope: 'platform',
|
|
116
|
+
category: 'middleware-overhead',
|
|
117
|
+
route: '/*',
|
|
118
|
+
file: mw.file,
|
|
119
|
+
priority: 'high',
|
|
120
|
+
metric: {
|
|
121
|
+
hasMatcher: false,
|
|
122
|
+
runtime: mw.runtime
|
|
123
|
+
},
|
|
124
|
+
reason: 'Middleware runs globally across all asset/data requests without a path matcher config.'
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const gatedResult = {
|
|
130
|
+
timestamp: new Date().toISOString(),
|
|
131
|
+
projectId: data.projectId || 'unknown',
|
|
132
|
+
gateThreshold: threshold,
|
|
133
|
+
totalCandidates: candidates.length,
|
|
134
|
+
candidates
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const outputJson = JSON.stringify(gatedResult, null, 2);
|
|
138
|
+
if (outFile) {
|
|
139
|
+
writeFileSync(resolve(process.cwd(), outFile), outputJson, 'utf8');
|
|
140
|
+
} else {
|
|
141
|
+
console.log(outputJson);
|
|
142
|
+
}
|