@el-j/magic-helix-core 4.0.0-beta.2 → 4.0.0-beta.4

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.
Files changed (165) hide show
  1. package/dist/index-B88j4AyE.js +13 -0
  2. package/dist/index-B88j4AyE.js.map +1 -0
  3. package/dist/index-CY-pQbuu.cjs +2 -0
  4. package/dist/index-CY-pQbuu.cjs.map +1 -0
  5. package/dist/index.cjs +75 -1
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +0 -1
  8. package/dist/index.mjs +2214 -51
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/pattern-combiner.d.ts +1 -1
  11. package/dist/plugin-loader.d.ts +2 -1
  12. package/package.json +4 -4
  13. package/dist/BasePlugin-6wv0hYJ9.js +0 -98
  14. package/dist/BasePlugin-6wv0hYJ9.js.map +0 -1
  15. package/dist/BasePlugin-odQJAKA-.cjs +0 -2
  16. package/dist/BasePlugin-odQJAKA-.cjs.map +0 -1
  17. package/dist/builtin-plugins/base/BasePlugin.d.ts +0 -69
  18. package/dist/builtin-plugins/cpp/index.d.ts +0 -46
  19. package/dist/builtin-plugins/csharp/index.d.ts +0 -20
  20. package/dist/builtin-plugins/go/index.d.ts +0 -23
  21. package/dist/builtin-plugins/index.d.ts +0 -16
  22. package/dist/builtin-plugins/java/index.d.ts +0 -22
  23. package/dist/builtin-plugins/nodejs/index.d.ts +0 -44
  24. package/dist/builtin-plugins/php/index.d.ts +0 -20
  25. package/dist/builtin-plugins/python/index.d.ts +0 -27
  26. package/dist/builtin-plugins/ruby/index.d.ts +0 -20
  27. package/dist/builtin-plugins/rust/index.d.ts +0 -53
  28. package/dist/builtin-plugins/swift/index.d.ts +0 -22
  29. package/dist/default_templates/angular/angular-core.md +0 -19
  30. package/dist/default_templates/architecture/codeowners.md +0 -123
  31. package/dist/default_templates/architecture/monorepo.md +0 -146
  32. package/dist/default_templates/architecture/nx.md +0 -122
  33. package/dist/default_templates/architecture/turborepo.md +0 -114
  34. package/dist/default_templates/ci/github-actions.md +0 -268
  35. package/dist/default_templates/ci/gitlab-ci.md +0 -330
  36. package/dist/default_templates/containers/docker-multistage.md +0 -120
  37. package/dist/default_templates/containers/kubernetes-deploy.md +0 -210
  38. package/dist/default_templates/devops/docker-compose.md +0 -111
  39. package/dist/default_templates/devops/docker-dockerfile.md +0 -94
  40. package/dist/default_templates/devops/github-actions.md +0 -160
  41. package/dist/default_templates/devops/gitlab-ci.md +0 -210
  42. package/dist/default_templates/dotnet/framework-aspnetcore.md +0 -205
  43. package/dist/default_templates/dotnet/framework-blazor.md +0 -271
  44. package/dist/default_templates/dotnet/lang-csharp.md +0 -162
  45. package/dist/default_templates/generic/lang-typescript.md +0 -57
  46. package/dist/default_templates/generic/state-redux.md +0 -21
  47. package/dist/default_templates/generic/state-rxjs.md +0 -6
  48. package/dist/default_templates/generic/style-mui.md +0 -23
  49. package/dist/default_templates/generic/style-tailwind.md +0 -76
  50. package/dist/default_templates/generic/test-cypress.md +0 -21
  51. package/dist/default_templates/generic/test-jest.md +0 -20
  52. package/dist/default_templates/generic/test-playwright.md +0 -21
  53. package/dist/default_templates/generic/test-vitest.md +0 -131
  54. package/dist/default_templates/go/lang-go.md +0 -571
  55. package/dist/default_templates/java/build-gradle.md +0 -102
  56. package/dist/default_templates/java/build-maven.md +0 -86
  57. package/dist/default_templates/java/framework-spring-boot.md +0 -179
  58. package/dist/default_templates/java/lang-java.md +0 -78
  59. package/dist/default_templates/java/lang-kotlin.md +0 -88
  60. package/dist/default_templates/meta/magic-helix-meta.md +0 -213
  61. package/dist/default_templates/meta/meta-debug.md +0 -459
  62. package/dist/default_templates/meta/meta-implement.md +0 -450
  63. package/dist/default_templates/meta/meta-roadmap.md +0 -265
  64. package/dist/default_templates/nestjs/nestjs-core.md +0 -7
  65. package/dist/default_templates/patterns/architecture/clean-architecture.md +0 -469
  66. package/dist/default_templates/patterns/architecture/dependency-injection.md +0 -517
  67. package/dist/default_templates/patterns/architecture/domain-driven-design.md +0 -621
  68. package/dist/default_templates/patterns/architecture/layered-architecture.md +0 -382
  69. package/dist/default_templates/patterns/architecture/repository-pattern.md +0 -408
  70. package/dist/default_templates/patterns/domain-expertise/nextjs-rules.md +0 -115
  71. package/dist/default_templates/patterns/domain-expertise/react-patterns.md +0 -181
  72. package/dist/default_templates/patterns/domain-expertise/server-components.md +0 -212
  73. package/dist/default_templates/patterns/domain-expertise/shadcn-ui.md +0 -52
  74. package/dist/default_templates/patterns/domain-expertise/tailwind-patterns.md +0 -52
  75. package/dist/default_templates/patterns/environment/container-awareness.md +0 -17
  76. package/dist/default_templates/patterns/environment/ide-features.md +0 -17
  77. package/dist/default_templates/patterns/environment/os-commands.md +0 -17
  78. package/dist/default_templates/patterns/organization/heading-hierarchy.md +0 -103
  79. package/dist/default_templates/patterns/organization/sequential-workflows.md +0 -102
  80. package/dist/default_templates/patterns/organization/xml-rule-groups.md +0 -64
  81. package/dist/default_templates/patterns/reasoning/agent-loop.md +0 -151
  82. package/dist/default_templates/patterns/reasoning/confirmation-gates.md +0 -141
  83. package/dist/default_templates/patterns/reasoning/dependency-analysis.md +0 -132
  84. package/dist/default_templates/patterns/reasoning/one-tool-per-iteration.md +0 -152
  85. package/dist/default_templates/patterns/reasoning/preview-before-action.md +0 -194
  86. package/dist/default_templates/patterns/reasoning/reflection-checkpoints.md +0 -166
  87. package/dist/default_templates/patterns/reasoning/result-verification.md +0 -157
  88. package/dist/default_templates/patterns/reasoning/subtask-breakdown.md +0 -131
  89. package/dist/default_templates/patterns/reasoning/thinking-tags.md +0 -100
  90. package/dist/default_templates/patterns/role-definition/capability-declarations.md +0 -72
  91. package/dist/default_templates/patterns/role-definition/expert-identity.md +0 -45
  92. package/dist/default_templates/patterns/role-definition/scope-boundaries.md +0 -61
  93. package/dist/default_templates/patterns/safety/code-safety-rules.md +0 -17
  94. package/dist/default_templates/patterns/safety/credential-handling.md +0 -17
  95. package/dist/default_templates/patterns/safety/destructive-warnings.md +0 -17
  96. package/dist/default_templates/patterns/safety/refusal-messages.md +0 -17
  97. package/dist/default_templates/patterns/tone/adaptive-tone.md +0 -17
  98. package/dist/default_templates/patterns/tone/concise-communication.md +0 -17
  99. package/dist/default_templates/patterns/tone/forbidden-phrases.md +0 -17
  100. package/dist/default_templates/patterns/tool-guidelines/function-schemas.md +0 -143
  101. package/dist/default_templates/patterns/tool-guidelines/parameter-examples.md +0 -137
  102. package/dist/default_templates/patterns/tool-guidelines/usage-policies.md +0 -105
  103. package/dist/default_templates/php/framework-laravel.md +0 -112
  104. package/dist/default_templates/php/lang-php.md +0 -94
  105. package/dist/default_templates/python/lang-python.md +0 -508
  106. package/dist/default_templates/react/react-core.md +0 -677
  107. package/dist/default_templates/react/react-zustand.md +0 -7
  108. package/dist/default_templates/ruby/framework-rails.md +0 -309
  109. package/dist/default_templates/ruby/framework-sinatra.md +0 -227
  110. package/dist/default_templates/ruby/lang-ruby.md +0 -216
  111. package/dist/default_templates/rust/lang-rust.md +0 -89
  112. package/dist/default_templates/swift/framework-vapor.md +0 -352
  113. package/dist/default_templates/swift/lang-swift.md +0 -291
  114. package/dist/default_templates/vue/style-primevue.md +0 -6
  115. package/dist/default_templates/vue/style-quasar.md +0 -22
  116. package/dist/default_templates/vue/vue-core.md +0 -108
  117. package/dist/default_templates/vue/vue-pinia.md +0 -5
  118. package/dist/index-0GK4RlUx.js +0 -1748
  119. package/dist/index-0GK4RlUx.js.map +0 -1
  120. package/dist/index-AkVwRl-r.js +0 -92
  121. package/dist/index-AkVwRl-r.js.map +0 -1
  122. package/dist/index-B6BeG1yT.cjs +0 -68
  123. package/dist/index-B6BeG1yT.cjs.map +0 -1
  124. package/dist/index-B8pyjKdF.js +0 -94
  125. package/dist/index-B8pyjKdF.js.map +0 -1
  126. package/dist/index-BQ6v041y.js +0 -13
  127. package/dist/index-BQ6v041y.js.map +0 -1
  128. package/dist/index-Baxb1vI_.js +0 -210
  129. package/dist/index-Baxb1vI_.js.map +0 -1
  130. package/dist/index-Bg8DD8ku.js +0 -216
  131. package/dist/index-Bg8DD8ku.js.map +0 -1
  132. package/dist/index-BqTqxCpG.cjs +0 -89
  133. package/dist/index-BqTqxCpG.cjs.map +0 -1
  134. package/dist/index-Bv4Q1Pr7.cjs +0 -33
  135. package/dist/index-Bv4Q1Pr7.cjs.map +0 -1
  136. package/dist/index-CN8J45Nc.cjs +0 -24
  137. package/dist/index-CN8J45Nc.cjs.map +0 -1
  138. package/dist/index-CPbv2Od1.js +0 -62
  139. package/dist/index-CPbv2Od1.js.map +0 -1
  140. package/dist/index-Cf-MC6Al.js +0 -63
  141. package/dist/index-Cf-MC6Al.js.map +0 -1
  142. package/dist/index-DDPXXXDy.cjs +0 -19
  143. package/dist/index-DDPXXXDy.cjs.map +0 -1
  144. package/dist/index-DO30AzDe.cjs +0 -19
  145. package/dist/index-DO30AzDe.cjs.map +0 -1
  146. package/dist/index-DkvW5yBY.js +0 -2249
  147. package/dist/index-DkvW5yBY.js.map +0 -1
  148. package/dist/index-Dn1ehjIj.cjs +0 -80
  149. package/dist/index-Dn1ehjIj.cjs.map +0 -1
  150. package/dist/index-DqHvgoXJ.cjs +0 -19
  151. package/dist/index-DqHvgoXJ.cjs.map +0 -1
  152. package/dist/index-K39pdw94.cjs +0 -31
  153. package/dist/index-K39pdw94.cjs.map +0 -1
  154. package/dist/index-OT2XAJkc.js +0 -117
  155. package/dist/index-OT2XAJkc.js.map +0 -1
  156. package/dist/index-TPAX4XKg.cjs +0 -30
  157. package/dist/index-TPAX4XKg.cjs.map +0 -1
  158. package/dist/index-WmVSB57y.js +0 -107
  159. package/dist/index-WmVSB57y.js.map +0 -1
  160. package/dist/index-mYXvc3Fs.js +0 -68
  161. package/dist/index-mYXvc3Fs.js.map +0 -1
  162. package/dist/index-nioXOg4m.cjs +0 -76
  163. package/dist/index-nioXOg4m.cjs.map +0 -1
  164. package/dist/index-okhY3fWD.cjs +0 -2
  165. package/dist/index-okhY3fWD.cjs.map +0 -1
@@ -1,212 +0,0 @@
1
- # Server Components Pattern
2
-
3
- ## Purpose
4
- Guide usage of React Server Components (RSC) in Next.js. From **v0** pattern.
5
-
6
- ## Template
7
-
8
- ```markdown
9
- ## React Server Components (RSC)
10
-
11
- ### When to Use Server Components
12
- - {SCENARIO_1_FOR_SERVER}
13
- - {SCENARIO_2_FOR_SERVER}
14
- - {SCENARIO_3_FOR_SERVER}
15
-
16
- ### When to Use Client Components
17
- - {SCENARIO_1_FOR_CLIENT}
18
- - {SCENARIO_2_FOR_CLIENT}
19
- - {SCENARIO_3_FOR_CLIENT}
20
-
21
- ### Composition Patterns
22
- - {HOW_TO_MIX_SERVER_AND_CLIENT}
23
- - {PASSING_PROPS_BETWEEN_TYPES}
24
- - {HANDLING_SERIALIZATION}
25
- ```
26
-
27
- ## Examples
28
-
29
- ### v0 (Next.js App Router RSC Guidelines)
30
- ```markdown
31
- ## React Server Components (RSC) in Next.js
32
-
33
- ### When to Use Server Components (Default)
34
- - **Data Fetching**: When you need to fetch data from APIs or databases
35
- ```typescript
36
- // ✅ Server Component - fetch directly
37
- export default async function BlogPost({ params }: { params: { id: string } }) {
38
- const post = await fetch(`https://api.example.com/posts/${params.id}`)
39
- .then(r => r.json());
40
- return <article>{post.content}</article>;
41
- }
42
- ```
43
-
44
- - **Static Content**: Components that don't need interactivity
45
- ```typescript
46
- // ✅ Server Component - no hooks or events
47
- export function Footer() {
48
- return (
49
- <footer>
50
- <p>&copy; 2024 Company Name</p>
51
- <nav>
52
- <a href="/about">About</a>
53
- <a href="/contact">Contact</a>
54
- </nav>
55
- </footer>
56
- );
57
- }
58
- ```
59
-
60
- - **Sensitive Operations**: Backend logic that shouldn't be exposed to client
61
- ```typescript
62
- // ✅ Server Component - API key stays on server
63
- async function fetchData() {
64
- return await fetch('https://api.example.com/data', {
65
- headers: { 'Authorization': `Bearer ${process.env.API_KEY}` }
66
- }).then(r => r.json());
67
- }
68
- ```
69
-
70
- ### When to Use Client Components ('use client')
71
- - **Interactivity**: Components with event handlers or React hooks
72
- ```typescript
73
- 'use client';
74
- import { useState } from 'react';
75
-
76
- export function Counter() {
77
- const [count, setCount] = useState(0);
78
- return <button onClick={() => setCount(count + 1)}>Count: {count}</button>;
79
- }
80
- ```
81
-
82
- - **Browser APIs**: Components using window, document, localStorage, etc.
83
- ```typescript
84
- 'use client';
85
- import { useEffect } from 'react';
86
-
87
- export function Tracker() {
88
- useEffect(() => {
89
- console.log('Page viewed:', window.location.href);
90
- }, []);
91
- return null;
92
- }
93
- ```
94
-
95
- - **Third-Party Libraries**: Components using client-only libraries
96
- ```typescript
97
- 'use client';
98
- import { useFormik } from 'formik'; // Client-side form library
99
-
100
- export function SignupForm() {
101
- const formik = useFormik({ /* ... */ });
102
- return <form onSubmit={formik.handleSubmit}>...</form>;
103
- }
104
- ```
105
-
106
- ### Composition Patterns
107
- - **Server Component as Parent**: Client components can be children
108
- ```typescript
109
- // ✅ Server Component
110
- export default async function Page() {
111
- const data = await fetchData();
112
-
113
- return (
114
- <div>
115
- <h1>{data.title}</h1>
116
- <InteractiveWidget data={data} /> {/* Client Component */}
117
- </div>
118
- );
119
- }
120
- ```
121
-
122
- - **Pass Serializable Props**: Only JSON-serializable data between boundaries
123
- ```typescript
124
- // ✅ Serializable props (string, number, plain object)
125
- <ClientComponent title="Hello" count={5} data={{ id: 1 }} />
126
-
127
- // ❌ Non-serializable props (functions, class instances)
128
- <ClientComponent onClick={() => {}} instance={new Date()} />
129
- ```
130
-
131
- - **Workaround for Non-Serializable**: Use Server Actions or move logic to client
132
- ```typescript
133
- // ✅ Server Action (async function from server)
134
- async function updateData(formData: FormData) {
135
- 'use server';
136
- // Server-side logic
137
- }
138
-
139
- // Pass action to client component
140
- <ClientForm action={updateData} />
141
- ```
142
-
143
- - **Client Component as Wrapper**: Server components can be passed as children
144
- ```typescript
145
- // ✅ Client Component wrapper
146
- 'use client';
147
- export function AnimatedContainer({ children }: { children: React.ReactNode }) {
148
- return <motion.div>{children}</motion.div>;
149
- }
150
-
151
- // Usage: Server Component as child
152
- <AnimatedContainer>
153
- <ServerRenderedContent /> {/* Still a Server Component */}
154
- </AnimatedContainer>
155
- ```
156
-
157
- ### Performance Considerations
158
- - **Minimize Client Bundles**: Keep 'use client' boundary as low as possible
159
- ```typescript
160
- // ❌ Entire page is client component (large bundle)
161
- 'use client';
162
- export default function Page() {
163
- const [state, setState] = useState();
164
- return <div>...</div>;
165
- }
166
-
167
- // ✅ Only interactive part is client component
168
- export default function Page() {
169
- return (
170
- <div>
171
- <StaticHeader /> {/* Server Component */}
172
- <InteractiveWidget /> {/* Client Component - small bundle */}
173
- <StaticFooter /> {/* Server Component */}
174
- </div>
175
- );
176
- }
177
- ```
178
-
179
- - **Data Fetching Location**: Fetch in Server Component, not Client Component
180
- ```typescript
181
- // ✅ Fetch in Server Component (faster, no loading state)
182
- export default async function Page() {
183
- const data = await fetchData();
184
- return <ClientDisplay data={data} />;
185
- }
186
-
187
- // ❌ Fetch in Client Component (slower, needs loading state)
188
- 'use client';
189
- export default function Page() {
190
- const [data, setData] = useState(null);
191
- useEffect(() => { fetchData().then(setData); }, []);
192
- if (!data) return <Spinner />;
193
- return <div>{data}</div>;
194
- }
195
- ```
196
- ```
197
-
198
- ## Variables
199
- - `{SCENARIO_X_FOR_SERVER}`: When to use Server Component
200
- - `{SCENARIO_X_FOR_CLIENT}`: When to use Client Component
201
- - `{HOW_TO_MIX_SERVER_AND_CLIENT}`: Composition strategies
202
- - `{PASSING_PROPS_BETWEEN_TYPES}`: Serialization rules
203
- - `{HANDLING_SERIALIZATION}`: Workarounds for non-serializable data
204
-
205
- ## Best Practices
206
- 1. Default to Server Components (add 'use client' only when needed)
207
- 2. Explain serialization boundaries (common source of bugs)
208
- 3. Show composition patterns (client wrapping server, server wrapping client)
209
- 4. Highlight performance benefits (smaller bundles, faster data fetching)
210
- 5. Provide migration guide (Pages Router → App Router)
211
- 6. Address common mistakes ('use client' on entire page)
212
- 7. Benefits: Optimal performance, secure API calls, smaller JS bundles
@@ -1,52 +0,0 @@
1
- # shadcn/ui Component Library Pattern
2
-
3
- ## Purpose
4
- Guide usage of shadcn/ui components in Next.js/React projects. From **same.new**.
5
-
6
- ## Installation Pattern
7
- ```bash
8
- npx shadcn-ui@latest add button
9
- npx shadcn-ui@latest add card dialog input
10
- ```
11
-
12
- ## Component Usage
13
- ```tsx
14
- import { Button } from "@/components/ui/button"
15
- import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card"
16
-
17
- export function ProductCard({ product }: Props) {
18
- return (
19
- <Card>
20
- <CardHeader>
21
- <CardTitle>{product.name}</CardTitle>
22
- </CardHeader>
23
- <CardContent>
24
- <p>{product.description}</p>
25
- <Button>Add to Cart</Button>
26
- </CardContent>
27
- </Card>
28
- )
29
- }
30
- ```
31
-
32
- ## Customization
33
- ```tsx
34
- // ✅ Extend with custom variants using cva
35
- import { cva } from "class-variance-authority"
36
-
37
- const buttonVariants = cva("base-classes", {
38
- variants: {
39
- variant: {
40
- default: "bg-primary",
41
- outline: "border border-input",
42
- custom: "bg-gradient-to-r from-purple-500 to-pink-500"
43
- }
44
- }
45
- })
46
- ```
47
-
48
- ## Best Practices
49
- - Components are copied to your repo (not npm dependencies)
50
- - Customize in `components/ui/` as needed
51
- - Use Radix UI primitives for accessibility
52
- - Combine with Tailwind for styling
@@ -1,52 +0,0 @@
1
- # Tailwind CSS Patterns
2
-
3
- ## Purpose
4
- Enforce Tailwind CSS best practices and utility patterns. From **same.new** and **Loveable**.
5
-
6
- ## Key Patterns
7
-
8
- ### Utility-First Approach
9
- ```tsx
10
- // ✅ Use utility classes
11
- <button className="px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600">
12
- Click me
13
- </button>
14
-
15
- // ❌ Avoid custom CSS
16
- <button className="custom-button">Click me</button>
17
- ```
18
-
19
- ### Responsive Design
20
- ```tsx
21
- // ✅ Mobile-first responsive utilities
22
- <div className="w-full md:w-1/2 lg:w-1/3 xl:w-1/4">
23
- Responsive width
24
- </div>
25
- ```
26
-
27
- ### Dark Mode
28
- ```tsx
29
- // ✅ Dark mode variants
30
- <div className="bg-white dark:bg-gray-900 text-gray-900 dark:text-white">
31
- Content
32
- </div>
33
- ```
34
-
35
- ### Component Extraction
36
- ```tsx
37
- // When utilities get too long (>5 classes), extract to component
38
- // ✅ Extract reusable pattern
39
- function Card({ children }: { children: React.ReactNode }) {
40
- return (
41
- <div className="rounded-lg shadow-md p-6 bg-white dark:bg-gray-800">
42
- {children}
43
- </div>
44
- );
45
- }
46
- ```
47
-
48
- ## Best Practices
49
- - Use arbitrary values sparingly: `w-[137px]` (prefer standard scale)
50
- - Group related utilities: layout, spacing, typography, colors
51
- - Use @apply only for component styles (avoid in utility classes)
52
- - Configure theme in tailwind.config.js for brand colors
@@ -1,17 +0,0 @@
1
- # $(basename "$file" .md | tr '-' ' ' | sed 's/\b\(.\)/\u\1/g') Pattern
2
-
3
- ## Purpose
4
- [Pattern description from integration document]
5
-
6
- ## Template
7
- ```markdown
8
- [Key structure and variables]
9
- ```
10
-
11
- ## Examples
12
- [Concrete examples from v0, Claude, ChatGPT, Cline, etc.]
13
-
14
- ## Best Practices
15
- 1. [Guideline 1]
16
- 2. [Guideline 2]
17
- 3. Benefits: [Key advantages]
@@ -1,17 +0,0 @@
1
- # $(basename "$file" .md | tr '-' ' ' | sed 's/\b\(.\)/\u\1/g') Pattern
2
-
3
- ## Purpose
4
- [Pattern description from integration document]
5
-
6
- ## Template
7
- ```markdown
8
- [Key structure and variables]
9
- ```
10
-
11
- ## Examples
12
- [Concrete examples from v0, Claude, ChatGPT, Cline, etc.]
13
-
14
- ## Best Practices
15
- 1. [Guideline 1]
16
- 2. [Guideline 2]
17
- 3. Benefits: [Key advantages]
@@ -1,17 +0,0 @@
1
- # $(basename "$file" .md | tr '-' ' ' | sed 's/\b\(.\)/\u\1/g') Pattern
2
-
3
- ## Purpose
4
- [Pattern description from integration document]
5
-
6
- ## Template
7
- ```markdown
8
- [Key structure and variables]
9
- ```
10
-
11
- ## Examples
12
- [Concrete examples from v0, Claude, ChatGPT, Cline, etc.]
13
-
14
- ## Best Practices
15
- 1. [Guideline 1]
16
- 2. [Guideline 2]
17
- 3. Benefits: [Key advantages]
@@ -1,103 +0,0 @@
1
- # Heading Hierarchy Pattern
2
-
3
- ## Purpose
4
- Use Markdown headings to create scannable, nested instruction sections. From **v0**, **Claude**, and **Cline** patterns.
5
-
6
- ## Template
7
-
8
- ```markdown
9
- # {TOP_LEVEL_ROLE}
10
-
11
- ## {SECTION_1}
12
- {Content}
13
-
14
- ### {SUBSECTION_1_1}
15
- {Content}
16
-
17
- ### {SUBSECTION_1_2}
18
- {Content}
19
-
20
- ## {SECTION_2}
21
- {Content}
22
-
23
- ### {SUBSECTION_2_1}
24
- {Content}
25
-
26
- ## {SECTION_3}
27
- {Content}
28
- ```
29
-
30
- ## Examples
31
-
32
- ### v0 (Code Generation Instructions)
33
- ```markdown
34
- # v0 Code Generation Instructions
35
-
36
- ## Code Style
37
- Write modern, idiomatic TypeScript with proper typing.
38
-
39
- ### React Patterns
40
- - Use functional components with hooks
41
- - Prefer composition over inheritance
42
- - Extract reusable logic into custom hooks
43
-
44
- ### Naming Conventions
45
- - Components: PascalCase (e.g., UserProfile)
46
- - Files: kebab-case (e.g., user-profile.tsx)
47
- - Functions: camelCase (e.g., handleSubmit)
48
-
49
- ## Framework Requirements
50
-
51
- ### Next.js App Router
52
- - Use Server Components by default
53
- - Add 'use client' only when necessary
54
- - Leverage React Server Components for data fetching
55
-
56
- ### Routing
57
- - File-based routing in app/ directory
58
- - Use route groups (folders) for organization
59
- - Dynamic routes with [param] syntax
60
- ```
61
-
62
- ### Cline (Tool Usage Guidelines)
63
- ```markdown
64
- # Cline Tool Usage Guidelines
65
-
66
- ## File Operations
67
-
68
- ### Reading Files
69
- - Use read_file for examining code
70
- - Read large sections to minimize API calls
71
- - Parallelize reads when possible
72
-
73
- ### Writing Files
74
- - Show preview before making changes
75
- - Use replace_string_in_file for edits
76
- - Include 3-5 lines of context for accuracy
77
-
78
- ## Terminal Commands
79
-
80
- ### Command Execution
81
- - Run one command at a time (no parallel terminal calls)
82
- - Explain purpose of non-trivial commands
83
- - Use absolute paths to avoid navigation issues
84
-
85
- ### Output Management
86
- - Filter output with grep/awk for large results
87
- - Use --no-pager for git commands
88
- - Disable paging to avoid truncation
89
- ```
90
-
91
- ## Variables
92
- - `{TOP_LEVEL_ROLE}`: Main purpose (H1 - appears once)
93
- - `{SECTION_X}`: Major category (H2 - primary divisions)
94
- - `{SUBSECTION_X_Y}`: Sub-category (H3 - detailed breakdowns)
95
-
96
- ## Best Practices
97
- 1. Use only one H1 (main title)
98
- 2. H2 for major sections (5-10 max)
99
- 3. H3 for subsections within H2
100
- 4. Avoid going deeper than H3 (use lists instead)
101
- 5. Keep headings concise (3-7 words)
102
- 6. Use parallel structure (all H2s follow same pattern)
103
- 7. Benefits: Easy to navigate, works in Markdown viewers, hierarchical structure
@@ -1,102 +0,0 @@
1
- # Sequential Workflows Pattern
2
-
3
- ## Purpose
4
- Define step-by-step processes with clear ordering. From **Manus** agent loop pattern.
5
-
6
- ## Template
7
-
8
- ```markdown
9
- ## {WORKFLOW_NAME}
10
-
11
- Follow these steps in order:
12
-
13
- 1. **{STEP_1_NAME}**: {STEP_1_DESCRIPTION}
14
- - {SUBSTEP_1_1}
15
- - {SUBSTEP_1_2}
16
-
17
- 2. **{STEP_2_NAME}**: {STEP_2_DESCRIPTION}
18
- - {SUBSTEP_2_1}
19
- - {SUBSTEP_2_2}
20
-
21
- 3. **{STEP_3_NAME}**: {STEP_3_DESCRIPTION}
22
- - {SUBSTEP_3_1}
23
- - {SUBSTEP_3_2}
24
-
25
- Repeat until {COMPLETION_CONDITION}.
26
- ```
27
-
28
- ## Examples
29
-
30
- ### Manus (Agent Execution Loop)
31
- ```markdown
32
- ## Agent Execution Loop
33
-
34
- Follow these steps in order:
35
-
36
- 1. **Analyze Request**: Understand user intent and break down into subtasks
37
- - Read the user's message carefully
38
- - Identify required information and tools
39
- - Determine if clarification is needed
40
-
41
- 2. **Plan Actions**: Decide which tool(s) to use
42
- - Select one tool per iteration (no parallel tool calls)
43
- - Gather necessary parameters
44
- - Anticipate potential errors
45
-
46
- 3. **Execute Tool**: Call the selected tool and process results
47
- - Invoke tool with validated parameters
48
- - Parse output for relevant information
49
- - Update internal state with findings
50
-
51
- 4. **Reflect**: Evaluate progress and decide next action
52
- - Compare current state to goal
53
- - Identify remaining subtasks
54
- - Determine if another iteration is needed
55
-
56
- Repeat until all subtasks are completed or user goal is achieved.
57
- ```
58
-
59
- ### v0 (Code Generation Workflow)
60
- ```markdown
61
- ## Code Generation Workflow
62
-
63
- Follow these steps in order:
64
-
65
- 1. **Understand Requirements**: Parse user request for technical specs
66
- - Identify framework (React, Vue, etc.)
67
- - Determine styling approach (Tailwind, CSS modules)
68
- - Note any specific libraries requested
69
-
70
- 2. **Plan Structure**: Design component hierarchy
71
- - Break UI into logical components
72
- - Identify shared vs unique elements
73
- - Map out data flow
74
-
75
- 3. **Generate Code**: Write implementation
76
- - Start with outer container/layout
77
- - Add child components progressively
78
- - Include proper TypeScript types
79
-
80
- 4. **Verify Quality**: Check for common issues
81
- - Ensure accessibility (ARIA labels, semantic HTML)
82
- - Validate responsive design breakpoints
83
- - Confirm proper error handling
84
-
85
- Repeat for each component in the hierarchy.
86
- ```
87
-
88
- ## Variables
89
- - `{WORKFLOW_NAME}`: Process title (e.g., "Request Processing", "Error Recovery")
90
- - `{STEP_X_NAME}`: Phase name (e.g., "Analyze", "Execute", "Verify")
91
- - `{STEP_X_DESCRIPTION}`: What happens in this phase
92
- - `{SUBSTEP_X_Y}`: Granular actions within phase
93
- - `{COMPLETION_CONDITION}`: When to stop iterating
94
-
95
- ## Best Practices
96
- 1. Number steps explicitly (1, 2, 3...) for clarity
97
- 2. Use bold for step names to make them scannable
98
- 3. Limit to 5-7 main steps (sub-steps for detail)
99
- 4. Include decision points ("If X, then Y")
100
- 5. State iteration/termination conditions clearly
101
- 6. Use present tense imperative ("Analyze", not "You should analyze")
102
- 7. Benefits: Reproducible process, clear sequencing, easy to debug
@@ -1,64 +0,0 @@
1
- # XML Rule Groups Pattern
2
-
3
- ## Purpose
4
- Structure instructions using XML-like tags for hierarchical organization. From **same.new** pattern.
5
-
6
- ## Template
7
-
8
- ```xml
9
- <rules>
10
- <category name="{CATEGORY_NAME}">
11
- <rule>{RULE_1}</rule>
12
- <rule>{RULE_2}</rule>
13
- <rule>{RULE_3}</rule>
14
- </category>
15
-
16
- <category name="{CATEGORY_NAME_2}">
17
- <rule>{RULE_4}</rule>
18
- <rule>{RULE_5}</rule>
19
- </category>
20
- </rules>
21
- ```
22
-
23
- ## Examples
24
-
25
- ### same.new (Code Generation Rules)
26
- ```xml
27
- <rules>
28
- <category name="Code Style">
29
- <rule>Use functional components with hooks, not class components</rule>
30
- <rule>Prefer const over let, never use var</rule>
31
- <rule>Use descriptive variable names (e.g., userData not ud)</rule>
32
- </category>
33
-
34
- <category name="File Operations">
35
- <rule>Always show a preview before writing files</rule>
36
- <rule>Ask for confirmation before deleting or overwriting</rule>
37
- <rule>Use relative paths for imports within the project</rule>
38
- </category>
39
-
40
- <category name="Error Handling">
41
- <rule>Wrap async operations in try-catch blocks</rule>
42
- <rule>Return user-friendly error messages, not stack traces</rule>
43
- <rule>Log errors for debugging but don't expose internals</rule>
44
- </category>
45
- </rules>
46
- ```
47
-
48
- ## Variables
49
- - `{CATEGORY_NAME}`: Logical grouping (e.g., "Code Style", "Security", "Performance")
50
- - `{RULE_X}`: Specific instruction within category
51
-
52
- ## Best Practices
53
- 1. Keep categories focused (5-10 rules max per category)
54
- 2. Use parallel structure for rules within a category
55
- 3. Order categories by importance (most critical first)
56
- 4. Use nested tags for sub-categories if needed:
57
- ```xml
58
- <category name="React">
59
- <subcategory name="Hooks">
60
- <rule>Always declare hooks at top level</rule>
61
- </subcategory>
62
- </category>
63
- ```
64
- 5. Benefits: Easy to scan, clear hierarchy, simple to add/remove sections