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

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 +2234 -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,291 +0,0 @@
1
- # Swift Language Instructions
2
-
3
- ## Project Type
4
- - Language: Swift
5
- - Package Manager: Swift Package Manager (SPM)
6
- - Platform: {iOS|macOS|Linux|Server}
7
-
8
- ## Build Commands
9
-
10
- ### Swift Package Manager
11
- ```bash
12
- swift build # Build project
13
- swift test # Run tests
14
- swift run # Run executable
15
- swift package update # Update dependencies
16
- swift package clean # Clean build artifacts
17
- ```
18
-
19
- ### Xcode
20
- ```bash
21
- xcodebuild -scheme MyApp -destination 'platform=iOS Simulator,name=iPhone 15'
22
- xcodebuild test -scheme MyApp
23
- ```
24
-
25
- ## Code Conventions
26
-
27
- ### Swift Basics
28
- ```swift
29
- // Variables and constants
30
- var mutableValue = 42
31
- let constantValue = 100
32
-
33
- // Optionals
34
- var name: String? = "John"
35
- if let unwrappedName = name {
36
- print(unwrappedName)
37
- }
38
-
39
- // Nil coalescing
40
- let displayName = name ?? "Anonymous"
41
-
42
- // Optional chaining
43
- let length = user?.name?.count
44
- ```
45
-
46
- ### Structs and Classes
47
- ```swift
48
- struct User {
49
- let id: UUID
50
- var name: String
51
- var email: String
52
-
53
- func fullProfile() -> String {
54
- "\(name) <\(email)>"
55
- }
56
- }
57
-
58
- class UserRepository {
59
- private var users: [User] = []
60
-
61
- func add(_ user: User) {
62
- users.append(user)
63
- }
64
-
65
- func find(by id: UUID) -> User? {
66
- users.first { $0.id == id }
67
- }
68
- }
69
- ```
70
-
71
- ### Protocols and Extensions
72
- ```swift
73
- protocol Identifiable {
74
- var id: UUID { get }
75
- }
76
-
77
- extension User: Identifiable {}
78
-
79
- extension String {
80
- func toSnakeCase() -> String {
81
- // Implementation
82
- }
83
- }
84
- ```
85
-
86
- ### Async/Await (Concurrency)
87
- ```swift
88
- func fetchUser(id: UUID) async throws -> User {
89
- let (data, _) = try await URLSession.shared.data(from: url)
90
- return try JSONDecoder().decode(User.self, from: data)
91
- }
92
-
93
- // Usage
94
- Task {
95
- do {
96
- let user = try await fetchUser(id: userId)
97
- print(user.name)
98
- } catch {
99
- print("Error: \(error)")
100
- }
101
- }
102
- ```
103
-
104
- ### Error Handling
105
- ```swift
106
- enum UserError: Error {
107
- case notFound
108
- case invalidEmail
109
- }
110
-
111
- func getUser(id: UUID) throws -> User {
112
- guard let user = findUser(id) else {
113
- throw UserError.notFound
114
- }
115
- return user
116
- }
117
-
118
- // Usage
119
- do {
120
- let user = try getUser(id: userId)
121
- } catch UserError.notFound {
122
- print("User not found")
123
- } catch {
124
- print("Unknown error: \(error)")
125
- }
126
- ```
127
-
128
- ## Testing with XCTest
129
-
130
- ```swift
131
- import XCTest
132
- @testable import MyApp
133
-
134
- final class UserTests: XCTestCase {
135
- func testUserFullProfile() {
136
- let user = User(
137
- id: UUID(),
138
- name: "John",
139
- email: "john@example.com"
140
- )
141
-
142
- XCTAssertEqual(user.fullProfile(), "John <john@example.com>")
143
- }
144
-
145
- func testAsyncFunction() async throws {
146
- let user = try await fetchUser(id: testUserId)
147
- XCTAssertEqual(user.name, "John")
148
- }
149
- }
150
- ```
151
-
152
- ## Docker for Server-Side Swift
153
-
154
- ### Multi-stage Dockerfile
155
- ```dockerfile
156
- # Build stage
157
- FROM swift:5.9-jammy AS build
158
- WORKDIR /app
159
-
160
- COPY Package.swift Package.resolved ./
161
- RUN swift package resolve
162
-
163
- COPY . .
164
- RUN swift build -c release --static-swift-stdlib
165
-
166
- # Runtime stage
167
- FROM ubuntu:22.04
168
- WORKDIR /app
169
-
170
- RUN apt-get update && apt-get install -y \
171
- libcurl4 \
172
- libxml2 \
173
- && rm -rf /var/lib/apt/lists/*
174
-
175
- COPY --from=build /app/.build/release/MyApp ./
176
-
177
- RUN useradd -m -u 1000 swift
178
- USER swift
179
-
180
- EXPOSE 8080
181
- CMD ["./MyApp"]
182
- ```
183
-
184
- ### Docker Compose
185
- ```yaml
186
- services:
187
- app:
188
- build: .
189
- ports:
190
- - "8080:8080"
191
- environment:
192
- - DATABASE_URL=postgresql://postgres:password@db/myapp
193
- depends_on:
194
- - db
195
-
196
- db:
197
- image: postgres:15-alpine
198
- environment:
199
- POSTGRES_PASSWORD: password
200
- ```
201
-
202
- ## Package.swift Structure
203
-
204
- ```swift
205
- // swift-tools-version: 5.9
206
- import PackageDescription
207
-
208
- let package = Package(
209
- name: "MyApp",
210
- platforms: [
211
- .macOS(.v13),
212
- .iOS(.v16),
213
- .linux
214
- ],
215
- products: [
216
- .executable(name: "MyApp", targets: ["MyApp"]),
217
- .library(name: "MyLibrary", targets: ["MyLibrary"])
218
- ],
219
- dependencies: [
220
- .package(url: "https://github.com/vapor/vapor.git", from: "4.89.0")
221
- ],
222
- targets: [
223
- .executableTarget(
224
- name: "MyApp",
225
- dependencies: [
226
- .product(name: "Vapor", package: "vapor")
227
- ]
228
- ),
229
- .testTarget(
230
- name: "MyAppTests",
231
- dependencies: ["MyApp"]
232
- )
233
- ]
234
- )
235
- ```
236
-
237
- ## Memory Management
238
-
239
- ```swift
240
- // ARC (Automatic Reference Counting)
241
- class User {
242
- var name: String
243
- init(name: String) { self.name = name }
244
- }
245
-
246
- // Weak references to avoid retain cycles
247
- class ViewController {
248
- weak var delegate: UserDelegate?
249
- }
250
-
251
- // Unowned for guaranteed non-nil references
252
- class Order {
253
- unowned let customer: Customer
254
- }
255
- ```
256
-
257
- ## Performance Tips
258
-
259
- - Use value types (structs) for immutable data
260
- - Leverage copy-on-write for collections
261
- - Use `lazy` for expensive computations
262
- - Profile with Instruments
263
- - Use `@inlinable` for small, frequently-called functions
264
- - Prefer `async/await` over completion handlers
265
- - Use actors for thread-safe state
266
-
267
- ## Common Frameworks
268
-
269
- ### iOS/macOS
270
- - **SwiftUI**: Modern declarative UI
271
- - **Combine**: Reactive programming
272
- - **CoreData**: Persistence
273
- - **URLSession**: Networking
274
-
275
- ### Server-Side
276
- - **Vapor**: Web framework
277
- - **Fluent**: ORM
278
- - **PostgresNIO**: PostgreSQL driver
279
- - **AsyncHTTPClient**: HTTP client
280
-
281
- ## Best Practices
282
-
283
- - Use optionals appropriately
284
- - Prefer value types over reference types
285
- - Use guard statements for early returns
286
- - Implement proper error handling
287
- - Write unit tests
288
- - Use protocols for abstraction
289
- - Follow Swift naming conventions
290
- - Use type inference wisely
291
- - Leverage Swift's type safety
@@ -1,6 +0,0 @@
1
- # UI Library: PrimeVue
2
- - **ALWAYS** use PrimeVue components for UI elements (Button, InputText, DataTable).
3
- - **STYLING**: Use PrimeVue's "pass-through" (PT) properties to apply Tailwind classes for customization.
4
- - **NEVER** override PrimeVue styles with global CSS.
5
- - **ICONS**: Use the icon library configured with PrimeVue (e.g., PrimeIcons or MDI).
6
- - **FORMS**: Use `vee-validate` in combination with PrimeVue form components.
@@ -1,22 +0,0 @@
1
- # Styling: Quasar (Vue)
2
- - **ALWAYS** use Quasar v2+ with Vue 3 Composition API.
3
- - **ALWAYS** use `q-` prefixed classes for Quasar components.
4
- - **ALWAYS** use `QLayout`, `QHeader`, `QDrawer`, `QPage` for app structure.
5
- - **ALWAYS** use `QBtn` with appropriate color and size props.
6
- - **ALWAYS** use `QInput` and `QSelect` for form inputs.
7
- - **ALWAYS** use `QCard`, `QCardSection` for content containers.
8
- - **ALWAYS** use `QTable` for data tables with proper column definitions.
9
- - **ALWAYS** use `QDialog` for modals with `v-model` binding.
10
- - **ALWAYS** use `QMenu` for context menus and dropdowns.
11
- - **ALWAYS** use `QChip` for tags and status indicators.
12
- - **ALWAYS** use `QAvatar` for user profile displays.
13
- - **ALWAYS** use `QList` and `QItem` for navigation and lists.
14
- - **ALWAYS** use `QStepper` for multi-step processes.
15
- - **ALWAYS** use `QTabs` and `QTab` for tabbed interfaces.
16
- - **ALWAYS** use `QExpansionItem` for collapsible content.
17
- - **ALWAYS** use `QSpinner` for loading states.
18
- - **ALWAYS** use `QNotify` for toast notifications.
19
- - **ALWAYS** use `QLoading` for full-screen loading overlays.
20
- - **ALWAYS** use `Dark` plugin for dark mode support.
21
- - **ALWAYS** use `Quasar.lang` for internationalization.
22
- - **ALWAYS** use `Quasar.iconSet` for custom icon sets.
@@ -1,108 +0,0 @@
1
- # Framework: Vue 3
2
-
3
- ## Expert Identity
4
- You are an expert Vue 3 developer specializing in the Composition API, TypeScript integration, and scalable component architecture.
5
-
6
- ## Core Capabilities
7
- - Build reactive Vue 3 applications using Composition API
8
- - Design type-safe components with TypeScript
9
- - Create reusable composables following best practices
10
- - Implement clean separation between logic and presentation
11
- - Debug Vue applications using Vue DevTools
12
-
13
- ## Coding Standards
14
-
15
- ### Component Structure
16
- - **ALWAYS** use Vue 3 with the Composition API.
17
- - **NEVER** use the Options API.
18
- - **ALWAYS** use `<script setup lang="ts">`.
19
- - **WHEN POSSIBLE** use `<script setup lang="ts" generic="T">` with generic type interfaces.
20
- - **ALWAYS** use TypeScript.
21
-
22
- ### Component Design
23
- - **ALWAYS** Use single-file components (`.vue` files) but keep them logic-free
24
- - **ALWAYS** Use composables to create the vue reactivity "bridge" using logic from utils.
25
- - **ALWAYS** Use utility functions for **all** logic, without vue-dependency
26
- - **ALWAYS** Use templates only for rendering, avoid logic in templates.
27
-
28
- ### Composable Organization
29
- - **ALWAYS** create composable folders with the `composableName` and inside:
30
- - `index.ts` for main composable export
31
- - `types/` folder for types/interfaces with single files for each type and index.ts exporting them
32
- - `utils/` for helper functions with single files for each util and index.ts exporting them
33
- - `__tests__/` folder for unit tests with single test files for each unit test and index.ts exporting them
34
-
35
- ### Reactivity
36
- - **PREFER** `defineModel` where `defineProps` with `defineEmits` update is needed.
37
- - **ALWAYS** define Props and emits with `defineProps` and `defineEmits`
38
- - **ALWAYS** Use `ref()` for primitive values and `reactive()` for objects.
39
- - **ALWAYS** Use `computed` for derived state.
40
- - **ALWAYS** Use `watch` or `watchEffect` for side effects, but **AVOID** overusing them.
41
-
42
- ### Ecosystem
43
- - **ALWAYS** Use Vue Router for routing.
44
- - **AVOID** Use Pinia for state management. use singleton store imlpementations with composables instead.
45
- - **ALWAYS** Use Vitest for unit tests of all utils and composables.
46
- - **ALWAYS** Use Vue's built-in directives (`v-if`, `v-for`, `v-show`, etc.) for conditional rendering and list rendering.
47
- - **ALWAYS** Use slots for component composition.
48
-
49
- ## Examples
50
-
51
- ### Composable Structure
52
- ```typescript
53
- // composables/useCounter/index.ts
54
- import { ref, computed } from 'vue';
55
- import type { CounterState } from './types';
56
- import { increment, decrement } from './utils';
57
-
58
- export function useCounter(initialValue = 0) {
59
- const count = ref<number>(initialValue);
60
- const doubled = computed(() => count.value * 2);
61
-
62
- return {
63
- count,
64
- doubled,
65
- increment: () => count.value = increment(count.value),
66
- decrement: () => count.value = decrement(count.value),
67
- };
68
- }
69
- ```
70
-
71
- ### Component with Script Setup
72
- ```vue
73
- <script setup lang="ts">
74
- import { useCounter } from '@/composables/useCounter';
75
-
76
- interface Props {
77
- initialCount?: number;
78
- }
79
-
80
- const props = withDefaults(defineProps<Props>(), {
81
- initialCount: 0,
82
- });
83
-
84
- const { count, doubled, increment, decrement } = useCounter(props.initialCount);
85
- </script>
86
-
87
- <template>
88
- <div>
89
- <p>Count: {{ count }}</p>
90
- <p>Doubled: {{ doubled }}</p>
91
- <button @click="increment">+</button>
92
- <button @click="decrement">-</button>
93
- </div>
94
- </template>
95
- ```
96
-
97
- ## Tool Usage
98
- When creating or editing Vue files:
99
- - Use the `create_file` or `replace_string_in_file` tools
100
- - Always generate complete `.vue` files with proper `<script setup>`, `<template>`, and optional `<style>` blocks
101
- - Ensure TypeScript types are defined in separate `types/` files when complex
102
-
103
- ## Safety Guidelines
104
- - Never generate code that mixes Options API and Composition API
105
- - Refuse to create components without TypeScript when the project uses TypeScript
106
- - Always validate that reactive references are properly unwrapped in templates
107
- - Follow Vue's official style guide for naming and structure
108
- - Use Vue DevTools for debugging and performance monitoring
@@ -1,5 +0,0 @@
1
- # State: Pinia
2
- - **ALWAYS** use Pinia for global state management.
3
- - Define stores in the `src/stores` directory (e.g., `useUserStore.ts`).
4
- - **ALWAYS** use the `setup` store syntax (function-based) instead of the `options` store syntax.
5
- - **NEVER** access `localStorage` directly from a component. Encapsulate this logic within the Pinia store itself.