contextos-agents 2.1.0 → 2.2.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/.agents/adapters/aider/export.js +2 -2
- package/.agents/adapters/claude/export.js +53 -2
- package/.agents/adapters/drift-detector.js +6 -3
- package/.agents/adapters/pure-compiler.js +18 -6
- package/.agents/ctx.js +13 -8
- package/.agents/plugins.js +347 -26
- package/.agents/profiles.js +32 -11
- package/README.md +38 -3
- package/bin/commands/hook.js +50 -12
- package/bin/commands/scan.js +10 -3
- package/bin/index.js +165 -53
- package/bin/lib/git-snapshot.js +70 -43
- package/bin/lib/scan.js +108 -27
- package/bin/lib/ui.js +140 -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 +3 -2
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: vercel-react-best-practices
|
|
3
|
+
description: React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: vercel
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Vercel React Best Practices
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, prioritized by impact to guide automated refactoring, code generation, and production review.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
- When authoring new React functional components or Next.js App Router pages.
|
|
19
|
+
- When implementing data fetching (client or server-side Server Actions, RSC).
|
|
20
|
+
- When reviewing pull requests for rendering bottlenecks or memory leaks.
|
|
21
|
+
- When optimizing bundle size, eliminating network waterfalls, or improving Core Web Vitals (LCP, INP, CLS).
|
|
22
|
+
|
|
23
|
+
## Rules & Patterns
|
|
24
|
+
|
|
25
|
+
### Rule Categories by Priority
|
|
26
|
+
|
|
27
|
+
| Priority | Category | Impact | Prefix |
|
|
28
|
+
|----------|----------|--------|--------|
|
|
29
|
+
| 1 | Eliminating Waterfalls | CRITICAL | `async-` |
|
|
30
|
+
| 2 | Bundle Size Optimization | CRITICAL | `bundle-` |
|
|
31
|
+
| 3 | Server-Side Performance | HIGH | `server-` |
|
|
32
|
+
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | `client-` |
|
|
33
|
+
| 5 | Re-render Optimization | MEDIUM | `rerender-` |
|
|
34
|
+
| 6 | Rendering Performance | MEDIUM | `rendering-` |
|
|
35
|
+
| 7 | JavaScript Performance | LOW-MEDIUM | `js-` |
|
|
36
|
+
| 8 | Advanced Patterns | LOW | `advanced-` |
|
|
37
|
+
|
|
38
|
+
### 1. Eliminating Waterfalls (CRITICAL)
|
|
39
|
+
|
|
40
|
+
- `async-cheap-condition-before-await` - Check cheap sync conditions before awaiting flags or remote values.
|
|
41
|
+
- `async-defer-await` - Move await into branches where actually used.
|
|
42
|
+
- `async-parallel` - Use `Promise.all()` for independent asynchronous operations.
|
|
43
|
+
- `async-dependencies` - Use better-all for partial dependencies.
|
|
44
|
+
- `async-api-routes` - Start promises early, await late in API routes.
|
|
45
|
+
- `async-suspense-boundaries` - Use Suspense to stream content progressively.
|
|
46
|
+
|
|
47
|
+
### 2. Bundle Size Optimization (CRITICAL)
|
|
48
|
+
|
|
49
|
+
- `bundle-barrel-imports` - Import directly from specific modules, avoid broad barrel files (`index.ts`).
|
|
50
|
+
- `bundle-analyzable-paths` - Prefer statically analyzable import paths to avoid bloated traces.
|
|
51
|
+
- `bundle-dynamic-imports` - Use `next/dynamic` or `React.lazy()` for heavy interactive components.
|
|
52
|
+
- `bundle-defer-third-party` - Load analytics and logging scripts after hydration.
|
|
53
|
+
- `bundle-conditional` - Load modules only when feature flags or user actions require them.
|
|
54
|
+
- `bundle-preload` - Preload assets on hover or focus for perceived instant navigation.
|
|
55
|
+
|
|
56
|
+
### 3. Server-Side Performance (HIGH)
|
|
57
|
+
|
|
58
|
+
- `server-auth-actions` - Always authenticate server actions like API routes.
|
|
59
|
+
- `server-cache-react` - Use `React.cache()` for per-request deduplication.
|
|
60
|
+
- `server-cache-lru` - Use LRU cache for cross-request caching.
|
|
61
|
+
- `server-dedup-props` - Avoid duplicate serialization in RSC props.
|
|
62
|
+
- `server-hoist-static-io` - Hoist static I/O to module level.
|
|
63
|
+
- `server-no-shared-module-state` - Avoid module-level mutable request state in RSC/SSR.
|
|
64
|
+
- `server-serialization` - Minimize data passed across the server-client boundary.
|
|
65
|
+
- `server-parallel-fetching` - Restructure components to parallelize fetches.
|
|
66
|
+
- `server-after-nonblocking` - Use `after()` for non-blocking operations like analytics logging.
|
|
67
|
+
|
|
68
|
+
### 4. Client-Side Data Fetching (MEDIUM-HIGH)
|
|
69
|
+
|
|
70
|
+
- `client-swr-dedup` - Use SWR or TanStack Query for automatic request deduplication.
|
|
71
|
+
- `client-event-listeners` - Deduplicate global event listeners.
|
|
72
|
+
- `client-passive-event-listeners` - Use passive listeners for scroll and touch.
|
|
73
|
+
- `client-localstorage-schema` - Version and minimize data stored in localStorage.
|
|
74
|
+
|
|
75
|
+
### 5. Re-render Optimization (MEDIUM)
|
|
76
|
+
|
|
77
|
+
- `rerender-defer-reads` - Don't subscribe to state only used in callbacks.
|
|
78
|
+
- `rerender-memo` - Extract expensive work into memoized components.
|
|
79
|
+
- `rerender-memo-with-default-value` - Hoist default non-primitive props.
|
|
80
|
+
- `rerender-dependencies` - Use primitive dependencies in effects and callbacks.
|
|
81
|
+
- `rerender-derived-state` - Subscribe to derived booleans, not raw high-frequency values.
|
|
82
|
+
- `rerender-derived-state-no-effect` - Derive state during render, never in `useEffect`.
|
|
83
|
+
- `rerender-functional-setstate` - Use functional `setState` for stable callback references.
|
|
84
|
+
- `rerender-lazy-state-init` - Pass initializer functions to `useState` for expensive computations.
|
|
85
|
+
- `rerender-transitions` - Use `startTransition` for non-urgent state updates.
|
|
86
|
+
- `rerender-use-deferred-value` - Defer expensive renders to keep input responsive.
|
|
87
|
+
- `rerender-no-inline-components` - Never define subcomponents inside component render bodies.
|
|
88
|
+
|
|
89
|
+
### 6. Rendering Performance (MEDIUM)
|
|
90
|
+
|
|
91
|
+
- `rendering-content-visibility` - Use `content-visibility: auto` for long offscreen lists.
|
|
92
|
+
- `rendering-hoist-jsx` - Extract static JSX elements outside components.
|
|
93
|
+
- `rendering-conditional-render` - Use ternary (`condition ? <Comp /> : null`), not `&&` to avoid 0 rendering.
|
|
94
|
+
- `rendering-usetransition-loading` - Prefer `useTransition` for loading state indicators.
|
|
95
|
+
|
|
96
|
+
### 7. JavaScript Performance (LOW-MEDIUM)
|
|
97
|
+
|
|
98
|
+
- `js-index-maps` - Build `Map` for repeated lookups instead of repeated array searches.
|
|
99
|
+
- `js-cache-property-access` - Cache object properties in tight loops.
|
|
100
|
+
- `js-early-exit` - Return early from functions to avoid nested complexity.
|
|
101
|
+
- `js-hoist-regexp` - Hoist RegExp creation outside loops and functions.
|
|
102
|
+
- `js-set-map-lookups` - Use `Set` / `Map` for O(1) lookups.
|
|
103
|
+
|
|
104
|
+
### 8. Advanced Patterns (LOW)
|
|
105
|
+
|
|
106
|
+
- `advanced-effect-event-deps` - Don't put `useEffectEvent` results in effect deps.
|
|
107
|
+
- `advanced-event-handler-refs` - Store event handlers in refs for stable listener attachments.
|
|
108
|
+
- `advanced-init-once` - Initialize app singletons once per lifecycle.
|
|
109
|
+
- `advanced-compound-components` - Use React Context with compound components for composable sub-parts instead of monolithic prop bags.
|
|
110
|
+
- `advanced-error-boundary-colocation` - Colocate Error Boundaries and Suspense boundaries close to the fault-prone tree, preserving the rest of the UI.
|
|
111
|
+
|
|
112
|
+
## Code Examples
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
// [GOOD] Parallel server fetching without waterfall
|
|
117
|
+
import { cache } from 'react';
|
|
118
|
+
|
|
119
|
+
export const getUser = cache(async (id: string) => {
|
|
120
|
+
return db.user.findUnique({ where: { id } });
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export default async function UserPage({ params }: { params: { id: string } }) {
|
|
124
|
+
// Parallel dispatch
|
|
125
|
+
const userPromise = getUser(params.id);
|
|
126
|
+
const postsPromise = getPosts(params.id);
|
|
127
|
+
|
|
128
|
+
const [user, posts] = await Promise.all([userPromise, postsPromise]);
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<main>
|
|
132
|
+
<h1>{user.name}</h1>
|
|
133
|
+
<PostList posts={posts} />
|
|
134
|
+
</main>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Validation Checklist
|
|
140
|
+
|
|
141
|
+
- [ ] All independent async fetches use `Promise.all()` instead of sequential `await`.
|
|
142
|
+
- [ ] Direct imports used instead of barrel file imports for large libraries.
|
|
143
|
+
- [ ] No `useEffect` used for deriving computed state from props or state.
|
|
144
|
+
- [ ] Heavy interactive modals/drawers loaded dynamically via `next/dynamic`.
|
|
145
|
+
- [ ] Server actions perform authentication checks before data mutations.
|
|
146
|
+
- [ ] Zero subcomponents defined inside the body of parent components.
|
|
147
|
+
|
|
148
|
+
## Common Mistakes
|
|
149
|
+
|
|
150
|
+
- Writing sequential `await fetchA(); await fetchB();` creating avoidable network waterfalls.
|
|
151
|
+
- Importing from package root barrel files triggering full bundle inclusion.
|
|
152
|
+
- Setting state inside `useEffect` in response to prop changes.
|
|
153
|
+
- Serializing full database models with sensitive or unused fields to Client Components.
|
|
154
|
+
|
|
155
|
+
## Integration Notes
|
|
156
|
+
|
|
157
|
+
- Pairs with `react` and `nextjs` skills for idiomatic App Router patterns.
|
|
158
|
+
- Complements `performance` for Lighthouse and Core Web Vitals verification.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
name: react-best-practices
|
|
3
|
+
category: frontend
|
|
4
|
+
type: instruction-only
|
|
5
|
+
description: React and Next.js performance optimization guidelines from Vercel Engineering.
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
deprecated: true
|
|
8
|
+
canonical: react
|
|
9
|
+
requires:
|
|
10
|
+
- react
|
|
11
|
+
resources:
|
|
12
|
+
- SKILL.md
|
|
13
|
+
- VALIDATION.json
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: redesign-existing-projects
|
|
3
|
+
description: Upgrades existing websites and apps to premium quality. Audits current design, identifies generic AI patterns, and applies high-end design standards without breaking functionality. Works with any CSS framework or vanilla CSS.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Redesign Skill & UI Audit
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
A systematic redesign and auditing protocol designed to elevate existing websites, dashboards, and web applications to world-class agency quality. It diagnoses and eradicates generic AI design fingerprints, sloppy typography, inconsistent palettes, and absent interaction states without breaking business logic or underlying component contracts.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- When auditing an existing UI codebase for design quality, responsiveness, or accessibility.
|
|
15
|
+
- When modernizing a legacy application or uplifting generic templates.
|
|
16
|
+
- When tasked to "redesign", "clean up the layout", "audit UI", or "make it look expensive and modern".
|
|
17
|
+
|
|
18
|
+
## Rules & Patterns
|
|
19
|
+
|
|
20
|
+
### 1. Workflow: Scan → Diagnose → Fix
|
|
21
|
+
|
|
22
|
+
1. **Scan:** Read the codebase. Identify the framework, styling method (Tailwind v3/v4, vanilla CSS, CSS Modules), and established design tokens.
|
|
23
|
+
2. **Diagnose:** Run through the design audit categories. Catalog generic patterns, missing states, and optical alignment flaws.
|
|
24
|
+
3. **Fix:** Apply surgical, targeted upgrades working within the existing stack. Do not rewrite from scratch.
|
|
25
|
+
|
|
26
|
+
### 2. Design Audit Categories
|
|
27
|
+
|
|
28
|
+
#### Typography
|
|
29
|
+
|
|
30
|
+
- **Replace Browser Defaults:** Swap generic `Inter`, `Roboto`, or system fonts with expressive typefaces (`Geist`, `Outfit`, `Cabinet Grotesk`, `Satoshi`).
|
|
31
|
+
- **Presence & Scale:** Increase display text size, tighten letter-spacing (`-0.02em` to `-0.04em`), reduce line-height on headlines.
|
|
32
|
+
- **Reading Comfort:** Limit body text to 65 characters per line (`max-w-prose`), increase line-height to 1.6.
|
|
33
|
+
- **Figures:** Enable tabular figures (`font-variant-numeric: tabular-nums`) for numbers in tables and data readouts.
|
|
34
|
+
- **Orphan Prevention:** Apply `text-wrap: balance` on headlines and `text-wrap: pretty` on paragraphs.
|
|
35
|
+
|
|
36
|
+
#### Color and Surfaces
|
|
37
|
+
|
|
38
|
+
- **No Pure Black Backgrounds:** Replace `#000000` with tinted dark charcoal (`#0A0A0A`, `#121212`).
|
|
39
|
+
- **Desaturate Accents:** Keep accent saturation below 80% so it blends harmoniously with neutrals.
|
|
40
|
+
- **Single Accent Color:** Commit to one dominant accent hue; remove conflicting secondary tints.
|
|
41
|
+
- **Tinted Shadows:** Tint shadows to match the background hue rather than harsh black opacity.
|
|
42
|
+
- **Background Depth:** Prevent sterile flat sections by layering subtle noise overlays, ambient gradients, or masked imagery.
|
|
43
|
+
|
|
44
|
+
#### Layout and Space
|
|
45
|
+
|
|
46
|
+
- **Asymmetry & Bento Grids:** Break repetitive 3-column Bootstrap grids with asymmetrical spans or offset cards.
|
|
47
|
+
- **Mobile Viewport Bug Fix:** Never use `height: 100vh`; always use `min-height: 100dvh`.
|
|
48
|
+
- **Vertical Alignment:** Pin action buttons to the bottom of card groups (`mt-auto` or grid alignment) to maintain horizontal baseline harmony across differing text heights.
|
|
49
|
+
- **Optical Centering:** Adjust icons, badges, and play buttons optically by 1-2px rather than relying solely on pure mathematical centering.
|
|
50
|
+
|
|
51
|
+
#### Interactivity and States
|
|
52
|
+
|
|
53
|
+
- **Interactive Feedback:** Add 200-300ms transitions, distinct hover shifts, and physical active presses (`scale(0.98)`).
|
|
54
|
+
- **Visible Focus Rings:** Mandatory `:focus-visible` styling for keyboard navigation.
|
|
55
|
+
- **States Completeness:** Always provide designed skeleton loaders, empty states, and inline error messages.
|
|
56
|
+
|
|
57
|
+
#### Content & Code Quality
|
|
58
|
+
|
|
59
|
+
- **Eradicate AI Clichés:** Remove buzzwords ("Elevate", "Seamless", "Unleash", "Next-Gen") and placeholder latin text.
|
|
60
|
+
- **Semantic HTML:** Replace nested div containers with `<nav>`, `<main>`, `<article>`, `<section>`, `<aside>`.
|
|
61
|
+
- **Relative Units:** Use `rem`, `%`, and CSS Grid rather than hardcoded pixel widths.
|
|
62
|
+
|
|
63
|
+
### 3. Fix Priority
|
|
64
|
+
|
|
65
|
+
1. **Font Swap:** Biggest instant aesthetic elevation with lowest regression risk.
|
|
66
|
+
2. **Palette Cleanup:** Eliminate clashing or oversaturated colors.
|
|
67
|
+
3. **States & Feedback:** Add hover, active, focus, loading, and empty states.
|
|
68
|
+
4. **Layout & Alignment:** Fix container widths, baseline alignment, and mobile viewport heights.
|
|
69
|
+
5. **Component Polish:** Replace generic cards and accordion boxes with modern minimal equivalents.
|
|
70
|
+
|
|
71
|
+
## Code Examples
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
// [BEFORE] Generic, misaligned card with generic shadow
|
|
75
|
+
<div className="bg-white border rounded shadow p-4">
|
|
76
|
+
<h2>{title}</h2>
|
|
77
|
+
<p>{desc}</p>
|
|
78
|
+
<button className="bg-blue-500 text-white p-2">Click</button>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
// [AFTER] Polished card with optical baseline alignment, tinted surface, and micro-interaction
|
|
82
|
+
<div className="flex flex-col bg-[#FFFFFF] dark:bg-[#121212] border border-black/5 dark:border-white/10 rounded-2xl p-6 hover:shadow-[0_4px_20px_rgba(0,0,0,0.04)] transition-all duration-200">
|
|
83
|
+
<h3 className="font-semibold text-lg tracking-tight text-neutral-900 dark:text-neutral-100 text-balance mb-2">
|
|
84
|
+
{title}
|
|
85
|
+
</h3>
|
|
86
|
+
<p className="text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed text-pretty mb-6">
|
|
87
|
+
{desc}
|
|
88
|
+
</p>
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
className="mt-auto inline-flex items-center justify-center font-medium text-sm px-4 py-2.5 rounded-xl bg-neutral-900 dark:bg-neutral-100 text-white dark:text-black hover:bg-neutral-800 active:scale-[0.98] transition-transform duration-150 focus-visible:ring-2 focus-visible:ring-neutral-400"
|
|
92
|
+
>
|
|
93
|
+
Continue
|
|
94
|
+
</button>
|
|
95
|
+
</div>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Validation Checklist
|
|
99
|
+
|
|
100
|
+
- [ ] All headings have `text-wrap: balance` and appropriate negative letter tracking.
|
|
101
|
+
- [ ] No pure black `#000000` backgrounds or oversaturated accent colors (>80% saturation).
|
|
102
|
+
- [ ] All interactive elements include `:hover`, `:active`, and `:focus-visible` styles.
|
|
103
|
+
- [ ] Cards in side-by-side grids align primary CTA buttons along the same bottom baseline.
|
|
104
|
+
- [ ] Viewport containers use `100dvh` instead of `100vh`.
|
|
105
|
+
- [ ] All lists, tables, and feeds have a designed empty state.
|
|
106
|
+
|
|
107
|
+
## Common Mistakes
|
|
108
|
+
|
|
109
|
+
- Rewriting components from scratch and breaking existing prop contracts or unit tests.
|
|
110
|
+
- Forcing full-width sections without `max-w` constraints on ultra-wide screens.
|
|
111
|
+
- Leaving action buttons at random heights inside differing text content cards.
|
|
112
|
+
- Introducing external UI libraries without checking existing `package.json` dependencies.
|
|
113
|
+
|
|
114
|
+
## Integration Notes
|
|
115
|
+
|
|
116
|
+
- Complements `impeccable-design` for hard 50-rule QA verification.
|
|
117
|
+
- Works alongside `ui-ux-pro` for token generation and color theory.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
name: redesign-audit
|
|
3
|
+
category: design
|
|
4
|
+
type: instruction-only
|
|
5
|
+
description: Audits and upgrades existing web codebases with high-end typography, color, layout, and interaction polish.
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
resources:
|
|
8
|
+
- SKILL.md
|
|
9
|
+
- VALIDATION.json
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Security Audit - Examples & Verification Scenarios
|
|
2
|
+
|
|
3
|
+
## Example 1: Adversarial Validation of Path Traversal
|
|
4
|
+
|
|
5
|
+
### Hunter Report (Initial Finding)
|
|
6
|
+
```markdown
|
|
7
|
+
ID: CANDIDATE-01
|
|
8
|
+
Component: User Avatar Download
|
|
9
|
+
Location: src/routes/avatar.ts:18
|
|
10
|
+
Sink: fs.createReadStream(path.join(__dirname, '../../uploads', req.query.file))
|
|
11
|
+
Hypothesis: Attacker passes `?file=../../etc/passwd` to read arbitrary host files.
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Verifier Execution (Disproving Attempt)
|
|
15
|
+
The verifier inspects the middleware chain and creates an isolated reproduction test:
|
|
16
|
+
```typescript
|
|
17
|
+
import { describe, it } from 'node:test';
|
|
18
|
+
import assert from 'node:assert/strict';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
|
|
21
|
+
function resolveAvatarPath(baseDir: string, requestedFile: string): string {
|
|
22
|
+
const safePath = path.resolve(baseDir, requestedFile);
|
|
23
|
+
if (!safePath.startsWith(baseDir)) {
|
|
24
|
+
throw new Error('Access denied: directory traversal detected');
|
|
25
|
+
}
|
|
26
|
+
return safePath;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
describe('Avatar Path Resolution', () => {
|
|
30
|
+
const uploadsDir = path.resolve('/var/app/uploads');
|
|
31
|
+
|
|
32
|
+
it('rejects traversal attempts escaping uploads root', () => {
|
|
33
|
+
assert.throws(
|
|
34
|
+
() => resolveAvatarPath(uploadsDir, '../../etc/passwd'),
|
|
35
|
+
/Access denied: directory traversal detected/
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('allows safe filenames inside uploads root', () => {
|
|
40
|
+
const resolved = resolveAvatarPath(uploadsDir, 'user-123.png');
|
|
41
|
+
assert.equal(resolved, path.join(uploadsDir, 'user-123.png'));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Verifier Verdict
|
|
47
|
+
- If `resolveAvatarPath` was missing in source: Finding is **CONFIRMED** with source trace.
|
|
48
|
+
- If middleware sanitized input before the handler: Finding is **DISPROVEN** and logged as invalid candidate with reason.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Example 2: Minimal Remediated Code Block
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
// Vulnerable:
|
|
56
|
+
// app.get('/files', (req, res) => {
|
|
57
|
+
// res.sendFile(path.join(PUBLIC_DIR, req.query.path as string));
|
|
58
|
+
// });
|
|
59
|
+
|
|
60
|
+
// Remediated (Surgical Blast Radius):
|
|
61
|
+
import path from 'node:path';
|
|
62
|
+
|
|
63
|
+
app.get('/files', (req, res) => {
|
|
64
|
+
const rawPath = String(req.query.path ?? '');
|
|
65
|
+
const normalizedPath = path.normalize(rawPath).replace(/^(\.\.[\/\\])+/, '');
|
|
66
|
+
const resolved = path.resolve(PUBLIC_DIR, normalizedPath);
|
|
67
|
+
|
|
68
|
+
if (!resolved.startsWith(PUBLIC_DIR)) {
|
|
69
|
+
return res.status(403).json({
|
|
70
|
+
error: {
|
|
71
|
+
code: 'FORBIDDEN',
|
|
72
|
+
message: 'Path traversal attempted'
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
res.sendFile(resolved);
|
|
78
|
+
});
|
|
79
|
+
```
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: security-audit
|
|
3
|
+
description: Security guidance and vulnerability review for codebases, APIs, and services. Orchestrates adversarial hunting and independent verification with sandbox write isolation and evidence ledgers.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Security Audit
|
|
7
|
+
|
|
8
|
+
Find vulnerabilities that violate a real trust boundary, then give owners source evidence, safe reproduction, priority, and the smallest effective fix. This is a defensive, source-first workflow inspired by Cloudflare's security audit architecture.
|
|
9
|
+
|
|
10
|
+
## Operating Modes
|
|
11
|
+
|
|
12
|
+
This skill operates in two distinct modes:
|
|
13
|
+
|
|
14
|
+
- **Guidance Mode**: For security questions, focused reviews, threat modeling, or triage of specific components, use only the relevant parts of this skill. Do not automatically create audit directories or write audit artifacts.
|
|
15
|
+
- **Full Audit Mode**: Use the complete workflow when explicitly requested to audit, pen-test, or perform an end-to-end security review of a repository. Run all phases and generate structured artifacts.
|
|
16
|
+
|
|
17
|
+
## Adversarial Multi-Agent Audit Protocol
|
|
18
|
+
|
|
19
|
+
A core invariant of rigorous security auditing is adversarial verification:
|
|
20
|
+
|
|
21
|
+
1. **Separation of Hunter and Verifier**:
|
|
22
|
+
- The agent that discovers a candidate vulnerability (**Hunter**) must never be the same agent that validates it.
|
|
23
|
+
- The verifying agent (**Verifier**) starts with a fresh context and explicitly attempts to disprove each finding.
|
|
24
|
+
2. **Evidence-Based Standard**:
|
|
25
|
+
- A candidate vulnerability is confirmed only if it has a complete source trace from untrusted input to a sensitive sink, along with a bounded, observable defect.
|
|
26
|
+
- If an issue cannot be definitively reproduced or disproven locally, mark it as `needs_validation` rather than creating speculative findings.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
30
|
+
│ SECURITY AUDIT PIPELINE │
|
|
31
|
+
│ │
|
|
32
|
+
│ Phase 1: Reconnaissance (Map trust boundaries & inputs) │
|
|
33
|
+
│ ↓ │
|
|
34
|
+
│ Phase 2: Coverage Hunting (Hunter agents search surfaces) │
|
|
35
|
+
│ ↓ │
|
|
36
|
+
│ Phase 3: Candidate Validation (Verifier agents disprove) │
|
|
37
|
+
│ ↓ │
|
|
38
|
+
│ Phase 4: Structured Output (findings.json & ledger) │
|
|
39
|
+
│ ↓ │
|
|
40
|
+
│ Phase 5: Record Verification (Final attestation review) │
|
|
41
|
+
│ ↓ │
|
|
42
|
+
│ Phase 6: Target-Neutral Reporting (REPORT.md) │
|
|
43
|
+
└─────────────────────────────────────────────────────────────┘
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Universal Execution Safety & Sandbox Write Isolation
|
|
47
|
+
|
|
48
|
+
Target repositories must be audited without risking supply-chain compromise or data exfiltration:
|
|
49
|
+
|
|
50
|
+
- **Read-Only Target Code**: Source inspection is read-only. Target code must never be executed with write access to its own repository.
|
|
51
|
+
- **Dedicated Scratch Root**: All target-controlled builds, tests, or reproduction scripts execute inside an isolated sandbox writing strictly to `scratch/`.
|
|
52
|
+
- **Zero External Network**: Sandboxed processes must have no outbound internet access. Use isolated loopback namespaces if local client/server communication is needed.
|
|
53
|
+
- **Sanitized Environment**: Clear credentials, SSH keys, cloud tokens, and parent process environments before spawning reproduction commands.
|
|
54
|
+
- **Promotion to Artifacts**: Only trusted parent-side code may inspect and promote non-secret results from `scratch/` to retained `artifacts/`.
|
|
55
|
+
|
|
56
|
+
## Audit Artifacts & Findings Schema
|
|
57
|
+
|
|
58
|
+
Full audits produce machine-readable and human-readable artifacts:
|
|
59
|
+
|
|
60
|
+
### findings.json
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"audit_version": "1.0.0",
|
|
64
|
+
"target_repository": "example-repo",
|
|
65
|
+
"commit_hash": "a1b2c3d",
|
|
66
|
+
"findings": [
|
|
67
|
+
{
|
|
68
|
+
"id": "SEC-001",
|
|
69
|
+
"title": "Path Traversal in File Download Handler",
|
|
70
|
+
"severity": "HIGH",
|
|
71
|
+
"cwe": "CWE-22",
|
|
72
|
+
"source_trace": {
|
|
73
|
+
"source_file": "src/controllers/download.ts",
|
|
74
|
+
"source_line": 42,
|
|
75
|
+
"entry_point": "req.query.filename",
|
|
76
|
+
"sink_file": "src/services/storage.ts",
|
|
77
|
+
"sink_line": 88,
|
|
78
|
+
"sink_function": "fs.promises.readFile"
|
|
79
|
+
},
|
|
80
|
+
"verification_status": "CONFIRMED",
|
|
81
|
+
"verifier_notes": "Reproduction script proved escape from base directory using %2e%2e%2f traversal.",
|
|
82
|
+
"remediation": "Apply path.normalize and verify path.resolve starts with the designated root directory."
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Required Reports
|
|
89
|
+
- `REPORT.md`: Executive summary, risk score, vulnerability distribution, and remediation priorities.
|
|
90
|
+
- `FINDINGS-DETAIL.md`: Detailed technical breakdown of each confirmed finding with step-by-step reproduction and surgical diff recommendations.
|
|
91
|
+
- `NEEDS-VALIDATION.md`: Potential leads that could not be conclusively verified without live cloud infrastructure or out-of-scope permissions.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Security Audit - Troubleshooting & Common Edge Cases
|
|
2
|
+
|
|
3
|
+
## Common Diagnostic Scenarios
|
|
4
|
+
|
|
5
|
+
### 1. Hunter Agent Generates Speculative or Untraceable Findings
|
|
6
|
+
|
|
7
|
+
- **Symptom**: Candidate vulnerability report contains vague descriptions like "Potential SQL injection in database layer" without line numbers, parameters, or affected sinks.
|
|
8
|
+
- **Root Cause**: The Hunter agent skipped Step 1 (Reconnaissance) and performed heuristic keyword matching instead of taint tracking.
|
|
9
|
+
- **Fix Protocol**:
|
|
10
|
+
1. Reject candidate immediately: mark status as `INVALID_SPECULATION`.
|
|
11
|
+
2. Mandate the 3-point trace requirement:
|
|
12
|
+
- Entry Point (HTTP param, header, body field, CLI flag).
|
|
13
|
+
- Intermediate Propagation (functions, transforms, assignments).
|
|
14
|
+
- Sensitive Sink (database query, filesystem access, shell execution, reflection).
|
|
15
|
+
3. If any of the three points is missing, the candidate cannot be submitted to the Verifier.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
### 2. Sandbox File Promotion Failure (`scratch/` to `artifacts/`)
|
|
20
|
+
|
|
21
|
+
- **Symptom**: Parent process fails to copy verified findings or test outputs from `scratch/` to `artifacts/`, throwing an access violation or promotion blocker.
|
|
22
|
+
- **Root Cause**: Target-controlled code created symlinks, hardlinks, or unescaped nested paths attempting to escape the assigned scratch root.
|
|
23
|
+
- **Fix Protocol**:
|
|
24
|
+
1. Never perform recursive copy or glob promotion across boundaries.
|
|
25
|
+
2. Walk paths with `no-follow` directory descriptors.
|
|
26
|
+
3. Verify that the leaf is a regular file with link count exactly 1 and size within the byte allowance.
|
|
27
|
+
4. Discard any entry violating promotion bounds and log `PROMOTION_SECURITY_REJECT`.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
### 3. Loopback Port Collisions During Local Reproduction
|
|
32
|
+
|
|
33
|
+
- **Symptom**: Standalone verification script fails with `EADDRINUSE: address already in use 127.0.0.1:3000`.
|
|
34
|
+
- **Root Cause**: Fixed port numbers in reproduction tests collide with existing developer processes.
|
|
35
|
+
- **Fix Protocol**:
|
|
36
|
+
- Always bind reproduction servers to port `0` (`server.listen(0)`), allowing the OS to allocate an ephemeral free port.
|
|
37
|
+
- Read `server.address().port` dynamically in test fixtures.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### 4. False Positives Due to Upstream Middleware Sanitization
|
|
42
|
+
|
|
43
|
+
- **Symptom**: Hunter flags `req.query.path` passed to `res.sendFile`, but global Express middleware already calls `path.normalize` and rejects relative traversals.
|
|
44
|
+
- **Root Cause**: Single-file inspection without analyzing the global middleware chain.
|
|
45
|
+
- **Fix Protocol**:
|
|
46
|
+
- The Verifier agent must inspect the application entrypoint (`app.ts`, `server.ts`, router configuration) to verify active global filters before concluding the audit verdict.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "security-audit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"checks": [
|
|
5
|
+
"Hunter and verifier roles are strictly separated",
|
|
6
|
+
"Evidence-based verification requires complete source trace",
|
|
7
|
+
"Target code is executed in read-only sandbox writing only to scratch/",
|
|
8
|
+
"Findings are documented in structured findings.json format",
|
|
9
|
+
"Remediations adhere to surgical blast radius containment"
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
schemaVersion: 2
|
|
2
|
+
name: security-audit
|
|
3
|
+
description: Adversarial multi-agent security audit framework inspired by Cloudflare. Employs independent hunter and verifier roles, OS sandbox write isolation, and evidence-backed vulnerability verification.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
category: engineering
|
|
6
|
+
type: instruction-only
|
|
7
|
+
requires:
|
|
8
|
+
- engineering-workflow
|
|
9
|
+
- security
|
|
10
|
+
resources:
|
|
11
|
+
- EXAMPLES.md
|
|
12
|
+
- SKILL.md
|
|
13
|
+
- TROUBLESHOOTING.md
|
|
14
|
+
- VALIDATION.json
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Soft Design - Component & Layout Examples
|
|
2
|
+
|
|
3
|
+
## Example 1: Glassmorphic Elevated Panel
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
interface SoftPanelProps {
|
|
9
|
+
title: string;
|
|
10
|
+
category: string;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function SoftElevatedPanel({ title, category, children }: SoftPanelProps) {
|
|
15
|
+
return (
|
|
16
|
+
<div className="relative overflow-hidden rounded-3xl border border-white/40 bg-white/60 p-8 shadow-[0_20px_50px_rgba(8,_112,_184,_0.07)] backdrop-blur-xl transition-all duration-300 hover:shadow-[0_30px_60px_rgba(8,_112,_184,_0.12)]">
|
|
17
|
+
{/* Subtle ambient light gradient */}
|
|
18
|
+
<div className="pointer-events-none absolute -right-20 -top-20 h-56 w-56 rounded-full bg-gradient-to-br from-indigo-200/50 to-pink-200/30 blur-2xl" />
|
|
19
|
+
|
|
20
|
+
<div className="relative z-10">
|
|
21
|
+
<span className="inline-block rounded-full bg-indigo-50/80 px-3 py-1 text-xs font-medium text-indigo-600 backdrop-blur-sm">
|
|
22
|
+
{category}
|
|
23
|
+
</span>
|
|
24
|
+
<h2 className="mt-4 text-2xl font-normal tracking-tight text-slate-800">
|
|
25
|
+
{title}
|
|
26
|
+
</h2>
|
|
27
|
+
<div className="mt-6 text-slate-600 leading-relaxed">
|
|
28
|
+
{children}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Example 2: Soft Tactile Pill Button
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
export function SoftPillButton({ label, onClick }: { label: string; onClick: () => void }) {
|
|
42
|
+
return (
|
|
43
|
+
<button
|
|
44
|
+
onClick={onClick}
|
|
45
|
+
className="rounded-full bg-gradient-to-b from-indigo-500 to-indigo-600 px-6 py-3 text-sm font-medium text-white shadow-[0_10px_20px_-5px_rgba(79,_70,_229,_0.3)] transition-all duration-200 hover:scale-[1.02] hover:shadow-[0_15px_25px_-5px_rgba(79,_70,_229,_0.4)] active:scale-[0.98]"
|
|
46
|
+
>
|
|
47
|
+
{label}
|
|
48
|
+
</button>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|