cc-codeconductor 0.4.3 → 0.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.
Files changed (141) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +2642 -226
  3. package/package.json +1 -1
  4. package/presets/agy/skills/evaluation/SKILL.md +6 -0
  5. package/presets/agy/skills/openspec/SKILL.md +32 -0
  6. package/presets/agy/workflows/cc-openspec.md +62 -0
  7. package/presets/agy/workflows/cc-scorecard.md +17 -0
  8. package/presets/claude/commands/cc/openspec.md +144 -0
  9. package/presets/claude/commands/cc/review.md +13 -2
  10. package/presets/claude/commands/cc/scorecard.md +65 -0
  11. package/presets/claude/skills/evaluation/SKILL.md +42 -0
  12. package/presets/claude/skills/openspec/SKILL.md +54 -0
  13. package/presets/codex/AGENTS.md +57 -0
  14. package/presets/cursor/.cursorignore +15 -0
  15. package/presets/cursor/AGENTS.md +504 -0
  16. package/presets/cursor/agents/architect.md +211 -0
  17. package/presets/cursor/agents/complexity-auditor.md +76 -0
  18. package/presets/cursor/agents/contract-builder.md +75 -0
  19. package/presets/cursor/agents/docs.md +180 -0
  20. package/presets/cursor/agents/goal-planner.md +71 -0
  21. package/presets/cursor/agents/implementer.md +161 -0
  22. package/presets/cursor/agents/orchestrator.md +377 -0
  23. package/presets/cursor/agents/repo-explorer.md +100 -0
  24. package/presets/cursor/agents/reviewer.md +237 -0
  25. package/presets/cursor/agents/security-reviewer.md +113 -0
  26. package/presets/cursor/agents/task-coach.md +145 -0
  27. package/presets/cursor/agents/tester.md +241 -0
  28. package/presets/cursor/commands/cc/api-contract.md +58 -0
  29. package/presets/cursor/commands/cc/db-migration.md +58 -0
  30. package/presets/cursor/commands/cc/feature.md +115 -0
  31. package/presets/cursor/commands/cc/fix.md +121 -0
  32. package/presets/cursor/commands/cc/openspec.md +144 -0
  33. package/presets/cursor/commands/cc/pagespeed.md +103 -0
  34. package/presets/cursor/commands/cc/refactor.md +148 -0
  35. package/presets/cursor/commands/cc/review.md +137 -0
  36. package/presets/cursor/commands/cc/scorecard.md +65 -0
  37. package/presets/cursor/commands/cc/tdd-cycle.md +226 -0
  38. package/presets/cursor/commands/cc/test-plan.md +138 -0
  39. package/presets/cursor/rules/behavioral-discipline.mdc +14 -0
  40. package/presets/cursor/rules/context-budget.mdc +12 -0
  41. package/presets/cursor/rules/orchestration.mdc +12 -0
  42. package/presets/cursor/rules/yagni-stdlib.mdc +11 -0
  43. package/presets/cursor/skills/android/SKILL.md +122 -0
  44. package/presets/cursor/skills/api-versioning/SKILL.md +394 -0
  45. package/presets/cursor/skills/astro/SKILL.md +322 -0
  46. package/presets/cursor/skills/auth-token-inspector/SKILL.md +33 -0
  47. package/presets/cursor/skills/code-review/SKILL.md +208 -0
  48. package/presets/cursor/skills/conductor-setup/SKILL.md +127 -0
  49. package/presets/cursor/skills/django-orm/SKILL.md +463 -0
  50. package/presets/cursor/skills/django-testing/SKILL.md +417 -0
  51. package/presets/cursor/skills/django-uv/SKILL.md +409 -0
  52. package/presets/cursor/skills/drizzle-schema-architect/SKILL.md +54 -0
  53. package/presets/cursor/skills/evaluation/SKILL.md +8 -0
  54. package/presets/cursor/skills/fastapi-pydantic-strict/SKILL.md +46 -0
  55. package/presets/cursor/skills/find-skills/SKILL.md +144 -0
  56. package/presets/cursor/skills/jpa-nplusone-detector/SKILL.md +49 -0
  57. package/presets/cursor/skills/jpa-postgres/SKILL.md +626 -0
  58. package/presets/cursor/skills/laravel-specialist/SKILL.md +267 -0
  59. package/presets/cursor/skills/laravel-specialist/references/eloquent.md +351 -0
  60. package/presets/cursor/skills/laravel-specialist/references/livewire.md +512 -0
  61. package/presets/cursor/skills/laravel-specialist/references/queues.md +423 -0
  62. package/presets/cursor/skills/laravel-specialist/references/routing.md +362 -0
  63. package/presets/cursor/skills/laravel-specialist/references/testing.md +522 -0
  64. package/presets/cursor/skills/livewire-alpine-bridge/SKILL.md +39 -0
  65. package/presets/cursor/skills/multi-agent-orchestration/README.md +144 -0
  66. package/presets/cursor/skills/multi-agent-orchestration/SKILL.md +579 -0
  67. package/presets/cursor/skills/multi-agent-orchestration/examples/framework_implementations.py +362 -0
  68. package/presets/cursor/skills/multi-agent-orchestration/examples/orchestration_patterns.py +411 -0
  69. package/presets/cursor/skills/multi-agent-orchestration/scripts/agent_communication.py +334 -0
  70. package/presets/cursor/skills/multi-agent-orchestration/scripts/benchmarking.py +341 -0
  71. package/presets/cursor/skills/multi-agent-orchestration/scripts/workflow_management.py +334 -0
  72. package/presets/cursor/skills/nextjs-typescript/SKILL.md +394 -0
  73. package/presets/cursor/skills/openspec/SKILL.md +52 -0
  74. package/presets/cursor/skills/pagespeed-insights/SKILL.md +445 -0
  75. package/presets/cursor/skills/pagespeed-insights/reference.md +50 -0
  76. package/presets/cursor/skills/pagespeed-perf/SKILL.md +281 -0
  77. package/presets/cursor/skills/php-pro/SKILL.md +210 -0
  78. package/presets/cursor/skills/php-pro/references/async-patterns.md +412 -0
  79. package/presets/cursor/skills/php-pro/references/laravel-patterns.md +377 -0
  80. package/presets/cursor/skills/php-pro/references/modern-php-features.md +323 -0
  81. package/presets/cursor/skills/php-pro/references/symfony-patterns.md +466 -0
  82. package/presets/cursor/skills/php-pro/references/testing-quality.md +466 -0
  83. package/presets/cursor/skills/python/SKILL.md +613 -0
  84. package/presets/cursor/skills/python-django-stack/SKILL.md +500 -0
  85. package/presets/cursor/skills/python-fastapi-stack/SKILL.md +464 -0
  86. package/presets/cursor/skills/security/SKILL.md +384 -0
  87. package/presets/cursor/skills/seo-analytics-injector/SKILL.md +44 -0
  88. package/presets/cursor/skills/spring-auth-auditor/SKILL.md +33 -0
  89. package/presets/cursor/skills/spring-boot-feature/SKILL.md +566 -0
  90. package/presets/cursor/skills/spring-boot-kotlin/SKILL.md +408 -0
  91. package/presets/cursor/skills/spring-boot-testing-strategy/SKILL.md +479 -0
  92. package/presets/cursor/skills/sqlalchemy/SKILL.md +473 -0
  93. package/presets/cursor/skills/tailwind-responsive-auditor/SKILL.md +32 -0
  94. package/presets/cursor/skills/tdd-mutation-tester/SKILL.md +28 -0
  95. package/presets/cursor/skills/testing-tdd/SKILL.md +592 -0
  96. package/presets/cursor/skills/workflow-orchestration-patterns/SKILL.md +98 -0
  97. package/presets/cursor/skills/workflow-orchestration-patterns/references/details.md +223 -0
  98. package/presets/opencode/agents/architect.md +1 -2
  99. package/presets/opencode/agents/complexity-auditor.md +1 -0
  100. package/presets/opencode/agents/contract-builder.md +93 -0
  101. package/presets/opencode/agents/docs.md +1 -2
  102. package/presets/opencode/agents/goal-planner.md +82 -0
  103. package/presets/opencode/agents/implementer.md +9 -2
  104. package/presets/opencode/agents/orchestrator.md +50 -12
  105. package/presets/opencode/agents/repo-explorer.md +0 -1
  106. package/presets/opencode/agents/reviewer.md +23 -2
  107. package/presets/opencode/agents/security-reviewer.md +129 -0
  108. package/presets/opencode/agents/task-coach.md +1 -2
  109. package/presets/opencode/agents/tester.md +1 -2
  110. package/presets/opencode/commands/cc-openspec.md +61 -0
  111. package/presets/opencode/commands/cc-scorecard.md +16 -0
  112. package/presets/opencode/prompts/v0.5.0/architect.md +222 -0
  113. package/presets/opencode/prompts/v0.5.0/complexity-auditor.md +91 -0
  114. package/presets/opencode/prompts/v0.5.0/contract-builder.md +84 -0
  115. package/presets/opencode/prompts/v0.5.0/docs.md +190 -0
  116. package/presets/opencode/prompts/v0.5.0/goal-planner.md +80 -0
  117. package/presets/opencode/prompts/v0.5.0/implementer.md +171 -0
  118. package/presets/opencode/prompts/v0.5.0/orchestrator.md +388 -0
  119. package/presets/opencode/prompts/v0.5.0/repo-explorer.md +111 -0
  120. package/presets/opencode/prompts/v0.5.0/reviewer.md +248 -0
  121. package/presets/opencode/prompts/v0.5.0/security-reviewer.md +123 -0
  122. package/presets/opencode/prompts/v0.5.0/task-coach.md +156 -0
  123. package/presets/opencode/prompts/v0.5.0/tester.md +252 -0
  124. package/presets/opencode/skills/evaluation/SKILL.md +6 -0
  125. package/presets/opencode/skills/openspec/SKILL.md +50 -0
  126. package/presets/templates/BACKLOG.md +33 -0
  127. package/presets/templates/execution-profile.yml +6 -0
  128. package/presets/templates/model-comparison.md +11 -0
  129. package/presets/templates/regression-checklist.yml +10 -0
  130. package/src/presets/manifests/agy.yml +2 -2
  131. package/src/presets/manifests/claude.yml +2 -2
  132. package/src/presets/manifests/codex.yml +2 -2
  133. package/src/presets/manifests/cursor.yml +19 -3
  134. package/src/presets/manifests/gemini.yml +2 -2
  135. package/src/presets/manifests/opencode.yml +2 -2
  136. package/src/presets/models/agy.yml +21 -0
  137. package/src/presets/models/claude.yml +18 -0
  138. package/src/presets/models/codex.yml +18 -0
  139. package/src/presets/models/cursor.yml +39 -9
  140. package/src/presets/models/gemini.yml +18 -0
  141. package/src/presets/models/opencode.yml +18 -0
@@ -0,0 +1,408 @@
1
+ ---
2
+ id: spring-boot-kotlin
3
+ version: 1.0.0
4
+ name: Spring Boot + Kotlin
5
+ description: >
6
+ Provides expert knowledge of Spring Boot conventions, Kotlin idioms, and MVC
7
+ patterns for backend API development.
8
+
9
+ user-invokable: true
10
+ license: MIT
11
+ metadata:
12
+ author: lgzarturo
13
+ category: spring
14
+
15
+ compatibility:
16
+ tools: [claude, codex, gemini, agy, opencode]
17
+ stacks:
18
+ languages: [kotlin]
19
+ frameworks: [spring-boot, spring-mvc, spring-data-jpa, spring-security]
20
+ databases: [postgresql, h2]
21
+
22
+ risk:
23
+ level: medium
24
+ can_execute_shell: false
25
+ can_modify_files: true
26
+ requires_network: false
27
+
28
+ inputs:
29
+ - source_files
30
+ - test_files
31
+ - build.gradle.kts
32
+ - application.yml
33
+
34
+ outputs:
35
+ - controller classes
36
+ - service classes
37
+ - repository interfaces
38
+ - domain entities
39
+ - DTO classes
40
+ - test classes
41
+
42
+ quality:
43
+ reviewed_by: codeconductor-core
44
+ version: 0.1.0
45
+ paths:
46
+ - "**/*.kt"
47
+ - "**/build.gradle.kts"
48
+ ---
49
+ # Spring Boot + Kotlin
50
+
51
+ ## Project Structure
52
+
53
+ Use feature-oriented MVC. One package per feature, not one package per layer.
54
+
55
+ ```
56
+ src/main/kotlin/{base-package}/{feature}/
57
+ controller/ # HTTP layer only — no business logic
58
+ service/ # Business logic
59
+ repository/ # Data access — extends JpaRepository or CrudRepository
60
+ domain/ # JPA entities
61
+ dto/ # Request/response objects — no @Entity here
62
+
63
+ src/test/kotlin/{base-package}/{feature}/
64
+ controller/ # MockMvc tests
65
+ service/ # Unit tests with MockK
66
+ repository/ # @DataJpaTest tests
67
+
68
+ src/main/resources/
69
+ application.yml
70
+ application-prod.yml # NOT in repo — use env vars
71
+ db/migration/ # Flyway scripts
72
+ ```
73
+
74
+ Never use `src/main/kotlin/controllers/`, `src/main/kotlin/services/`, etc. That
75
+ is layer-first structure and it does not scale.
76
+
77
+ ## Kotlin Idioms for Spring
78
+
79
+ **Data classes for DTOs.** No setters, no mutable state.
80
+
81
+ ```kotlin
82
+ data class CreateUserRequest(
83
+ @field:NotBlank val email: String,
84
+ @field:Size(min = 2, max = 100) val name: String
85
+ )
86
+
87
+ data class UserResponse(
88
+ val id: UUID,
89
+ val email: String,
90
+ val name: String
91
+ )
92
+ ```
93
+
94
+ **Sealed classes for domain results and errors.**
95
+
96
+ ```kotlin
97
+ sealed class UserResult {
98
+ data class Found(val user: User) : UserResult()
99
+ data class NotFound(val id: UUID) : UserResult()
100
+ data class Conflict(val email: String) : UserResult()
101
+ }
102
+ ```
103
+
104
+ **Null safety.** Never use `!!` unless you have already verified the value is
105
+ non-null and can document why. Prefer:
106
+
107
+ ```kotlin
108
+ // bad
109
+ val name = user!!.name
110
+
111
+ // good
112
+ val name = user?.name ?: throw UserNotFoundException(id)
113
+
114
+ // good — scoped null check
115
+ user?.let { sendWelcomeEmail(it.email) }
116
+ ```
117
+
118
+ **Extension functions** instead of utility classes.
119
+
120
+ ```kotlin
121
+ // bad — Java style utility class
122
+ object UserMapper {
123
+ fun toResponse(user: User): UserResponse { ... }
124
+ }
125
+
126
+ // good — extension function
127
+ fun User.toResponse(): UserResponse = UserResponse(
128
+ id = id,
129
+ email = email,
130
+ name = name
131
+ )
132
+ ```
133
+
134
+ **Coroutines**: do not introduce coroutines unless the project already uses
135
+ them. Adding coroutines requires a Task Card with explicit scope.
136
+
137
+ ## Spring Boot Patterns
138
+
139
+ ### Controller
140
+
141
+ ```kotlin
142
+ @RestController
143
+ @RequestMapping("/api/v1/users")
144
+ class UserController(private val userService: UserService) {
145
+
146
+ @GetMapping("/{id}")
147
+ fun getUser(@PathVariable id: UUID): ResponseEntity<UserResponse> {
148
+ return when (val result = userService.getById(id)) {
149
+ is UserResult.Found -> ResponseEntity.ok(result.user.toResponse())
150
+ is UserResult.NotFound -> ResponseEntity.notFound().build()
151
+ }
152
+ }
153
+
154
+ @PostMapping
155
+ fun createUser(
156
+ @Valid @RequestBody request: CreateUserRequest
157
+ ): ResponseEntity<UserResponse> {
158
+ val result = userService.create(request)
159
+ return ResponseEntity.status(HttpStatus.CREATED).body(result.toResponse())
160
+ }
161
+ }
162
+ ```
163
+
164
+ Rules:
165
+
166
+ - One controller per feature
167
+ - No business logic in controllers — delegate to service
168
+ - Use `@Valid` on request body params
169
+ - Return `ResponseEntity<T>` for explicit HTTP status control
170
+
171
+ ### Service
172
+
173
+ ```kotlin
174
+ @Service
175
+ @Transactional
176
+ class UserService(private val userRepository: UserRepository) {
177
+
178
+ @Transactional(readOnly = true)
179
+ fun getById(id: UUID): UserResult {
180
+ val user = userRepository.findById(id).orElse(null)
181
+ ?: return UserResult.NotFound(id)
182
+ return UserResult.Found(user)
183
+ }
184
+
185
+ fun create(request: CreateUserRequest): User {
186
+ if (userRepository.existsByEmail(request.email)) {
187
+ throw UserConflictException(request.email)
188
+ }
189
+ return userRepository.save(User(email = request.email, name = request.name))
190
+ }
191
+ }
192
+ ```
193
+
194
+ Rules:
195
+
196
+ - All business logic lives here
197
+ - `@Transactional` at class level, `readOnly = true` for queries
198
+ - Never `@Transactional` on private methods — Spring proxy does not intercept
199
+ them
200
+ - Never inject repositories into controllers
201
+
202
+ ### Repository
203
+
204
+ ```kotlin
205
+ @Repository
206
+ interface UserRepository : JpaRepository<User, UUID> {
207
+ fun findByEmail(email: String): User?
208
+ fun existsByEmail(email: String): Boolean
209
+
210
+ @Query("SELECT u FROM User u WHERE u.role = :role AND u.active = true")
211
+ fun findActiveByRole(@Param("role") role: UserRole): List<User>
212
+ }
213
+ ```
214
+
215
+ Rules:
216
+
217
+ - Extend `JpaRepository<Entity, IdType>` or `CrudRepository`
218
+ - Derived query methods for simple lookups
219
+ - `@Query` with JPQL for complex queries
220
+ - Native SQL only when JPQL cannot express it
221
+
222
+ ### Entity
223
+
224
+ ```kotlin
225
+ @Entity
226
+ @Table(
227
+ name = "users",
228
+ indexes = [Index(columnList = "email", unique = true)]
229
+ )
230
+ class User(
231
+ @Id
232
+ @GeneratedValue(strategy = GenerationType.UUID)
233
+ val id: UUID = UUID.randomUUID(),
234
+
235
+ @Column(name = "email", nullable = false, unique = true)
236
+ var email: String,
237
+
238
+ @Column(name = "name", nullable = false)
239
+ var name: String,
240
+
241
+ @Column(name = "created_at", nullable = false, updatable = false)
242
+ @CreatedDate
243
+ val createdAt: Instant = Instant.now()
244
+ )
245
+ ```
246
+
247
+ Rules:
248
+
249
+ - `@Table` with explicit name — never rely on inferred names
250
+ - `@Column(nullable = false)` always explicit
251
+ - UUIDs as PKs with `GenerationType.UUID`
252
+ - Kotlin data class with JPA requires the Kotlin JPA plugin (adds no-arg
253
+ constructor)
254
+ - `equals`/`hashCode` based only on `id`, not all fields — or omit and use
255
+ reference equality
256
+
257
+ ### DTO Separation
258
+
259
+ Never expose `@Entity` directly in API responses. Always map to a DTO.
260
+
261
+ ```kotlin
262
+ // bad
263
+ @GetMapping("/{id}")
264
+ fun getUser(@PathVariable id: UUID): User // exposes entity internals
265
+
266
+ // good
267
+ @GetMapping("/{id}")
268
+ fun getUser(@PathVariable id: UUID): UserResponse // controlled surface
269
+ ```
270
+
271
+ ## Validation
272
+
273
+ Validate at the DTO layer, not the service layer.
274
+
275
+ ```kotlin
276
+ data class CreateUserRequest(
277
+ @field:NotBlank(message = "Email is required")
278
+ @field:Email(message = "Email must be valid")
279
+ val email: String,
280
+
281
+ @field:NotBlank(message = "Name is required")
282
+ @field:Size(min = 2, max = 100, message = "Name must be between 2 and 100 characters")
283
+ val name: String
284
+ )
285
+ ```
286
+
287
+ Use `@field:` prefix on annotations — Kotlin applies annotations to the property
288
+ by default, not the backing field.
289
+
290
+ ## Error Handling
291
+
292
+ ```kotlin
293
+ @ControllerAdvice
294
+ class GlobalExceptionHandler {
295
+
296
+ @ExceptionHandler(UserNotFoundException::class)
297
+ fun handleUserNotFound(ex: UserNotFoundException): ResponseEntity<ErrorResponse> {
298
+ return ResponseEntity.status(HttpStatus.NOT_FOUND)
299
+ .body(ErrorResponse(error = ex.message ?: "User not found", code = "USER_NOT_FOUND"))
300
+ }
301
+
302
+ @ExceptionHandler(MethodArgumentNotValidException::class)
303
+ fun handleValidation(ex: MethodArgumentNotValidException): ResponseEntity<ErrorResponse> {
304
+ val message = ex.bindingResult.fieldErrors
305
+ .joinToString(", ") { "${it.field}: ${it.defaultMessage}" }
306
+ return ResponseEntity.badRequest()
307
+ .body(ErrorResponse(error = message, code = "VALIDATION_ERROR"))
308
+ }
309
+ }
310
+
311
+ data class ErrorResponse(val error: String, val code: String)
312
+ ```
313
+
314
+ Rules:
315
+
316
+ - One `@ControllerAdvice` — do not scatter `@ExceptionHandler` across
317
+ controllers
318
+ - Typed domain exceptions — never throw `RuntimeException` directly
319
+ - Consistent error body: `{ "error": "...", "code": "..." }`
320
+ - Never expose stack traces in responses
321
+
322
+ ## Testing
323
+
324
+ **Unit tests with MockK.**
325
+
326
+ ```kotlin
327
+ @ExtendWith(MockKExtension::class)
328
+ class UserServiceTest {
329
+
330
+ @MockK
331
+ private lateinit var userRepository: UserRepository
332
+
333
+ private lateinit var userService: UserService
334
+
335
+ @BeforeEach
336
+ fun setUp() {
337
+ userService = UserService(userRepository)
338
+ }
339
+
340
+ @Test
341
+ fun `should return NotFound when user does not exist`() {
342
+ // Arrange
343
+ val id = UUID.randomUUID()
344
+ every { userRepository.findById(id) } returns Optional.empty()
345
+
346
+ // Act
347
+ val result = userService.getById(id)
348
+
349
+ // Assert
350
+ assertThat(result).isInstanceOf(UserResult.NotFound::class.java)
351
+ verify(exactly = 1) { userRepository.findById(id) }
352
+ }
353
+ }
354
+ ```
355
+
356
+ **Integration tests with MockMvc.**
357
+
358
+ ```kotlin
359
+ @SpringBootTest
360
+ @AutoConfigureMockMvc
361
+ class UserControllerTest {
362
+
363
+ @Autowired
364
+ private lateinit var mockMvc: MockMvc
365
+
366
+ @Test
367
+ fun `should return 404 when user is not found`() {
368
+ mockMvc.perform(get("/api/v1/users/${UUID.randomUUID()}"))
369
+ .andExpect(status().isNotFound)
370
+ }
371
+ }
372
+ ```
373
+
374
+ **Repository tests.**
375
+
376
+ ```kotlin
377
+ @DataJpaTest
378
+ class UserRepositoryTest {
379
+
380
+ @Autowired
381
+ private lateinit var userRepository: UserRepository
382
+
383
+ @Test
384
+ fun `should find user by email`() {
385
+ val user = userRepository.save(User(email = "test@example.com", name = "Test"))
386
+ val found = userRepository.findByEmail("test@example.com")
387
+ assertThat(found).isEqualTo(user)
388
+ }
389
+ }
390
+ ```
391
+
392
+ Rules:
393
+
394
+ - Use MockK, not Mockito — the Kotlin API is cleaner and null-safe
395
+ - Do not use `@MockBean` where `mockk<T>()` is sufficient
396
+ - `@DataJpaTest` with H2 for repository tests (fast)
397
+ - `@SpringBootTest` + `@AutoConfigureMockMvc` for controller tests
398
+
399
+ ## Security Rules
400
+
401
+ - No stack traces in API responses — only `@ControllerAdvice` with controlled
402
+ messages
403
+ - Validate all input in DTO layer — service layer should receive
404
+ already-validated data
405
+ - `application-prod.yml` must not be committed — use environment variables or a
406
+ secrets manager
407
+ - Credentials, tokens, and keys are never hardcoded — use `@Value` with
408
+ externalized config