ma-agents 1.3.0 → 1.5.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.
@@ -0,0 +1,105 @@
1
+ # Vercel React Best Practices
2
+
3
+ A thorough performance optimization framework for React and Next.js projects. Contains 57 actionable rules organized into 8 categories, ranked by potential impact.
4
+
5
+ ## When to Apply
6
+
7
+ Reference these guidelines when:
8
+ - Writing new React components
9
+ - Implementing data fetching
10
+ - Reviewing code for performance concerns
11
+ - Refactoring existing applications
12
+ - Reducing bundle sizes and load times
13
+
14
+ ## Rule Categories (Priority-Ordered)
15
+
16
+ ### 1. Eliminating Waterfalls (CRITICAL)
17
+ Prefix: `async-`
18
+
19
+ - Avoid sequential data fetching — use parallel requests (`Promise.all`, `Promise.allSettled`)
20
+ - Prefetch data at the layout/page level rather than in deeply nested components
21
+ - Use `loading.tsx` and `Suspense` boundaries to stream content progressively
22
+ - Avoid `await` chains where requests don't depend on each other
23
+ - Colocate data fetching with the component that uses the data, but fetch in parallel at the route level
24
+ - Use React Server Components to move data fetching to the server and eliminate client-server waterfalls
25
+
26
+ ### 2. Bundle Size Optimization (CRITICAL)
27
+ Prefix: `bundle-`
28
+
29
+ - Prefer `next/dynamic` or `React.lazy` for heavy components not needed on initial load
30
+ - Audit dependencies with `@next/bundle-analyzer` — remove or replace bloated packages
31
+ - Use tree-shakeable libraries and import only what you need (`import { x } from 'lib'` not `import lib from 'lib'`)
32
+ - Mark client components with `'use client'` only at the lowest necessary level
33
+ - Avoid importing server-only code into client components
34
+ - Use `next/image` instead of raw `<img>` tags for automatic optimization
35
+ - Use `next/font` to self-host fonts and eliminate external font requests
36
+
37
+ ### 3. Server-Side Performance (HIGH)
38
+ Prefix: `server-`
39
+
40
+ - Default to React Server Components — only add `'use client'` when interactivity is needed
41
+ - Use the `cache()` function to deduplicate identical requests within a single render
42
+ - Leverage `unstable_cache` or `fetch` cache options for cross-request caching
43
+ - Set proper `revalidate` values — avoid `revalidate: 0` unless data truly changes on every request
44
+ - Use `generateStaticParams` for static generation of dynamic routes
45
+ - Move database queries and API calls to Server Components or Route Handlers
46
+ - Use streaming (`loading.tsx`, `Suspense`) to avoid blocking the entire page on slow data
47
+
48
+ ### 4. Client-Side Data Fetching (MEDIUM-HIGH)
49
+ Prefix: `client-`
50
+
51
+ - Use SWR or React Query for client-side data fetching with caching, revalidation, and deduplication
52
+ - Implement optimistic updates for mutations to improve perceived performance
53
+ - Set appropriate `staleTime` and `cacheTime` to avoid unnecessary refetches
54
+ - Use `prefetchQuery` or `preload` to start fetching before navigation
55
+ - Avoid `useEffect` + `fetch` patterns — prefer dedicated data fetching libraries
56
+ - Paginate or infinitely scroll large datasets instead of loading everything at once
57
+
58
+ ### 5. Re-render Optimization (MEDIUM)
59
+ Prefix: `rerender-`
60
+
61
+ - Lift state up only as far as necessary — keep state close to where it's used
62
+ - Split contexts to avoid triggering unnecessary re-renders on unrelated state changes
63
+ - Use `useMemo` and `useCallback` only for expensive computations or stable references passed to memoized children
64
+ - Avoid creating new objects/arrays in render — extract them as constants or memoize them
65
+ - Use `React.memo` for pure components that re-render often with the same props
66
+ - Prefer `useRef` over `useState` for values that don't need to trigger re-renders
67
+ - Avoid prop drilling — use composition (`children` prop) instead of deep prop chains
68
+
69
+ ### 6. Rendering Performance (MEDIUM)
70
+ Prefix: `rendering-`
71
+
72
+ - Virtualize long lists with `react-window` or `@tanstack/virtual`
73
+ - Debounce rapid user inputs (search, resize, scroll handlers)
74
+ - Use CSS for animations and transitions instead of JS-driven re-renders
75
+ - Use `content-visibility: auto` for off-screen content
76
+ - Avoid layout thrashing — batch DOM reads and writes
77
+ - Use `will-change` sparingly and only on elements that will actually animate
78
+ - Prefer `transform` and `opacity` for GPU-accelerated animations
79
+
80
+ ### 7. JavaScript Performance (LOW-MEDIUM)
81
+ Prefix: `js-`
82
+
83
+ - Avoid blocking the main thread — use `requestIdleCallback` or Web Workers for heavy computation
84
+ - Use `Map` and `Set` for frequent lookups instead of arrays
85
+ - Minimize closures in hot paths
86
+ - Prefer `for...of` or `Array.prototype` methods over manual loops for readability, but use manual loops in performance-critical sections
87
+ - Avoid deep cloning — use structural sharing (Immer) or shallow copies where possible
88
+ - Use `AbortController` to cancel stale requests and avoid race conditions
89
+
90
+ ### 8. Advanced Patterns (LOW)
91
+ Prefix: `advanced-`
92
+
93
+ - Use the `Offscreen` API (when stable) for pre-rendering hidden UI
94
+ - Implement route-level code splitting with parallel route segments
95
+ - Use Edge Runtime for latency-sensitive API routes
96
+ - Implement partial prerendering (PPR) for hybrid static/dynamic pages
97
+ - Use `Server Actions` for form mutations to avoid manual API routes
98
+ - Profile with React DevTools Profiler and Chrome Performance tab before optimizing
99
+
100
+ ## General Principles
101
+
102
+ - **Measure before optimizing** — use Lighthouse, Web Vitals, and React DevTools
103
+ - **Higher-priority categories yield larger gains** — focus on waterfalls and bundle size first
104
+ - **Don't prematurely optimize** — only apply lower-priority rules after addressing critical ones
105
+ - **Test performance changes** — verify improvements with real metrics, not just intuition
@@ -1,8 +1,3 @@
1
- ---
2
- name: verify-hardened-docker
3
- description: Comprehensive security verification for Docker configurations. Checks Dockerfile, docker-compose.yml, and running containers against CIS Docker Benchmark, OWASP, and NIST SP 800-190 standards. Scans for vulnerabilities, leaked secrets, insecure configurations, and missing hardening controls.
4
- ---
5
-
6
1
  # Verify Hardened Docker
7
2
 
8
3
  ## Overview