@cregis-dev/cckit 0.3.0 → 0.4.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 (316) hide show
  1. package/README.md +15 -3
  2. package/package.json +1 -1
  3. package/registry.json +234 -200
  4. package/src/commands/init.js +19 -15
  5. package/src/commands/update.js +9 -4
  6. package/src/core/plugin-installer.js +59 -13
  7. package/src/utils/fs.js +6 -1
  8. package/templates/bmad/_config/bmad-help.csv +2 -1
  9. package/templates/bmad/_config/files-manifest.csv +437 -431
  10. package/templates/bmad/_config/ides/claude-code.yaml +5 -5
  11. package/templates/bmad/_config/ides/trae.yaml +5 -5
  12. package/templates/bmad/_config/task-manifest.csv +7 -6
  13. package/templates/bmad/_config/workflow-manifest.csv +34 -34
  14. package/templates/bmad/bmm/agents/qa.md +1 -1
  15. package/templates/bmad/bmm/config.yaml +1 -1
  16. package/templates/bmad/bmm/module-help.csv +1 -1
  17. package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +1 -1
  18. package/templates/bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +1 -1
  19. package/templates/bmad/bmm/workflows/1-analysis/research/workflow-domain-research.md +1 -1
  20. package/templates/bmad/bmm/workflows/1-analysis/research/workflow-market-research.md +1 -1
  21. package/templates/bmad/bmm/workflows/1-analysis/research/workflow-technical-research.md +1 -1
  22. package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-12-complete.md +1 -1
  23. package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +1 -1
  24. package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-create-prd.md +1 -1
  25. package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-edit-prd.md +1 -1
  26. package/templates/bmad/bmm/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +1 -1
  27. package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +1 -1
  28. package/templates/bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +1 -1
  29. package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +1 -1
  30. package/templates/bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +1 -1
  31. package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +1 -1
  32. package/templates/bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +1 -1
  33. package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +1 -1
  34. package/templates/bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +1 -1
  35. package/templates/bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +1 -1
  36. package/templates/bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +1 -1
  37. package/templates/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +1 -1
  38. package/templates/bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +1 -1
  39. package/templates/bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +1 -1
  40. package/templates/bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +1 -1
  41. package/templates/bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +1 -1
  42. package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +1 -1
  43. package/templates/bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +1 -1
  44. package/templates/bmad/bmm/workflows/document-project/workflow.yaml +1 -1
  45. package/templates/bmad/bmm/workflows/generate-project-context/workflow.md +1 -1
  46. package/templates/bmad/bmm/workflows/qa-generate-e2e-tests/workflow.yaml +2 -2
  47. package/templates/bmad/commands/bmad-bmm-check-implementation-readiness.md +2 -2
  48. package/templates/bmad/commands/bmad-bmm-code-review.md +4 -4
  49. package/templates/bmad/commands/bmad-bmm-correct-course.md +4 -4
  50. package/templates/bmad/commands/bmad-bmm-create-architecture.md +2 -2
  51. package/templates/bmad/commands/bmad-bmm-create-epics-and-stories.md +2 -2
  52. package/templates/bmad/commands/bmad-bmm-create-prd.md +2 -2
  53. package/templates/bmad/commands/bmad-bmm-create-product-brief.md +2 -2
  54. package/templates/bmad/commands/bmad-bmm-create-story.md +4 -4
  55. package/templates/bmad/commands/bmad-bmm-create-ux-design.md +2 -2
  56. package/templates/bmad/commands/bmad-bmm-dev-story.md +4 -4
  57. package/templates/bmad/commands/bmad-bmm-document-project.md +4 -4
  58. package/templates/bmad/commands/bmad-bmm-domain-research.md +2 -2
  59. package/templates/bmad/commands/bmad-bmm-edit-prd.md +2 -2
  60. package/templates/bmad/commands/bmad-bmm-generate-project-context.md +2 -2
  61. package/templates/bmad/commands/bmad-bmm-market-research.md +2 -2
  62. package/templates/bmad/commands/bmad-bmm-qa-generate-e2e-tests.md +4 -4
  63. package/templates/bmad/commands/bmad-bmm-quick-dev.md +2 -2
  64. package/templates/bmad/commands/bmad-bmm-quick-spec.md +2 -2
  65. package/templates/bmad/commands/bmad-bmm-retrospective.md +4 -4
  66. package/templates/bmad/commands/bmad-bmm-sprint-planning.md +4 -4
  67. package/templates/bmad/commands/bmad-bmm-sprint-status.md +4 -4
  68. package/templates/bmad/commands/bmad-bmm-technical-research.md +2 -2
  69. package/templates/bmad/commands/bmad-bmm-validate-prd.md +2 -2
  70. package/templates/bmad/commands/bmad-brainstorming.md +2 -2
  71. package/templates/bmad/commands/bmad-editorial-review-prose.md +1 -1
  72. package/templates/bmad/commands/bmad-editorial-review-structure.md +1 -1
  73. package/templates/bmad/commands/bmad-help.md +1 -1
  74. package/templates/bmad/commands/bmad-index-docs.md +1 -1
  75. package/templates/bmad/commands/bmad-party-mode.md +2 -2
  76. package/templates/bmad/commands/bmad-review-adversarial-general.md +1 -1
  77. package/templates/bmad/commands/bmad-review-edge-case-hunter.md +10 -0
  78. package/templates/bmad/commands/bmad-shard-doc.md +1 -1
  79. package/templates/bmad/commands/bmad-tea-teach-me-testing.md +2 -2
  80. package/templates/bmad/commands/bmad-tea-testarch-atdd.md +4 -4
  81. package/templates/bmad/commands/bmad-tea-testarch-automate.md +4 -4
  82. package/templates/bmad/commands/bmad-tea-testarch-ci.md +4 -4
  83. package/templates/bmad/commands/bmad-tea-testarch-framework.md +4 -4
  84. package/templates/bmad/commands/bmad-tea-testarch-nfr.md +4 -4
  85. package/templates/bmad/commands/bmad-tea-testarch-test-design.md +4 -4
  86. package/templates/bmad/commands/bmad-tea-testarch-test-review.md +4 -4
  87. package/templates/bmad/commands/bmad-tea-testarch-trace.md +4 -4
  88. package/templates/bmad/core/config.yaml +1 -1
  89. package/templates/bmad/core/module-help.csv +1 -0
  90. package/templates/bmad/core/tasks/editorial-review-prose.xml +1 -1
  91. package/templates/bmad/core/tasks/editorial-review-structure.xml +1 -1
  92. package/templates/bmad/core/tasks/help.md +1 -1
  93. package/templates/bmad/core/tasks/index-docs.xml +1 -1
  94. package/templates/bmad/core/tasks/review-adversarial-general.xml +1 -1
  95. package/templates/bmad/core/tasks/review-edge-case-hunter.xml +63 -0
  96. package/templates/bmad/core/tasks/shard-doc.xml +1 -1
  97. package/templates/bmad/core/workflows/advanced-elicitation/workflow.xml +1 -1
  98. package/templates/bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +31 -18
  99. package/templates/bmad/core/workflows/brainstorming/steps/step-01b-continue.md +1 -1
  100. package/templates/bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +2 -2
  101. package/templates/bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +2 -2
  102. package/templates/bmad/core/workflows/brainstorming/workflow.md +4 -2
  103. package/templates/bmad/core/workflows/party-mode/workflow.md +1 -1
  104. package/templates/bmad/tea/config.yaml +5 -1
  105. package/templates/bmad/tea/testarch/knowledge/contract-testing.md +24 -2
  106. package/templates/bmad/tea/testarch/knowledge/pact-mcp.md +204 -0
  107. package/templates/bmad/tea/testarch/knowledge/pactjs-utils-consumer-helpers.md +211 -0
  108. package/templates/bmad/tea/testarch/knowledge/pactjs-utils-overview.md +210 -0
  109. package/templates/bmad/tea/testarch/knowledge/pactjs-utils-provider-verifier.md +315 -0
  110. package/templates/bmad/tea/testarch/knowledge/pactjs-utils-request-filter.md +224 -0
  111. package/templates/bmad/tea/testarch/tea-index.csv +5 -0
  112. package/templates/bmad/tea/workflows/testarch/README.md +1 -1
  113. package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-01-preflight-and-context.md +30 -0
  114. package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04-generate-tests.md +159 -57
  115. package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04a-subagent-api-failing.md +215 -0
  116. package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04b-subagent-e2e-failing.md +244 -0
  117. package/templates/bmad/tea/workflows/testarch/atdd/steps-c/step-04c-aggregate.md +31 -15
  118. package/templates/bmad/tea/workflows/testarch/atdd/validation-report-20260127-095021.md +1 -1
  119. package/templates/bmad/tea/workflows/testarch/atdd/validation-report-20260127-102401.md +3 -3
  120. package/templates/bmad/tea/workflows/testarch/atdd/workflow.yaml +2 -2
  121. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-01-preflight-and-context.md +32 -0
  122. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03-generate-tests.md +215 -101
  123. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03a-subagent-api.md +193 -0
  124. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03b-subagent-backend.md +246 -0
  125. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03b-subagent-e2e.md +213 -0
  126. package/templates/bmad/tea/workflows/testarch/automate/steps-c/step-03c-aggregate.md +38 -22
  127. package/templates/bmad/tea/workflows/testarch/automate/validation-report-20260127-095021.md +1 -1
  128. package/templates/bmad/tea/workflows/testarch/automate/validation-report-20260127-102401.md +3 -3
  129. package/templates/bmad/tea/workflows/testarch/automate/workflow.yaml +2 -2
  130. package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-02-generate-pipeline.md +124 -1
  131. package/templates/bmad/tea/workflows/testarch/ci/steps-c/step-03-configure-quality-gates.md +7 -0
  132. package/templates/bmad/tea/workflows/testarch/ci/validation-report-20260127-095021.md +1 -1
  133. package/templates/bmad/tea/workflows/testarch/ci/validation-report-20260127-102401.md +3 -3
  134. package/templates/bmad/tea/workflows/testarch/ci/workflow.yaml +2 -2
  135. package/templates/bmad/tea/workflows/testarch/framework/steps-c/step-03-scaffold-framework.md +126 -3
  136. package/templates/bmad/tea/workflows/testarch/framework/validation-report-20260127-095021.md +1 -1
  137. package/templates/bmad/tea/workflows/testarch/framework/validation-report-20260127-102401.md +3 -3
  138. package/templates/bmad/tea/workflows/testarch/framework/workflow.yaml +2 -2
  139. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04-evaluate-and-score.md +150 -36
  140. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04a-subagent-security.md +138 -0
  141. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04b-subagent-performance.md +84 -0
  142. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04c-subagent-reliability.md +85 -0
  143. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04d-subagent-scalability.md +88 -0
  144. package/templates/bmad/tea/workflows/testarch/nfr-assess/steps-c/step-04e-aggregate-nfr.md +27 -10
  145. package/templates/bmad/tea/workflows/testarch/nfr-assess/validation-report-20260127-095021.md +1 -1
  146. package/templates/bmad/tea/workflows/testarch/nfr-assess/validation-report-20260127-102401.md +3 -3
  147. package/templates/bmad/tea/workflows/testarch/nfr-assess/workflow.yaml +2 -2
  148. package/templates/bmad/tea/workflows/testarch/teach-me-testing/data/tea-resources-index.yaml +3 -3
  149. package/templates/bmad/tea/workflows/testarch/teach-me-testing/workflow-plan-teach-me-testing.md +6 -6
  150. package/templates/bmad/tea/workflows/testarch/teach-me-testing/workflow.md +1 -1
  151. package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-02-load-context.md +30 -0
  152. package/templates/bmad/tea/workflows/testarch/test-design/steps-c/step-05-generate-output.md +72 -1
  153. package/templates/bmad/tea/workflows/testarch/test-design/validation-report-20260127-095021.md +1 -1
  154. package/templates/bmad/tea/workflows/testarch/test-design/validation-report-20260127-102401.md +3 -3
  155. package/templates/bmad/tea/workflows/testarch/test-design/workflow.yaml +2 -2
  156. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-01-load-context.md +29 -1
  157. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03-quality-evaluation.md +147 -46
  158. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03a-subagent-determinism.md +214 -0
  159. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03b-subagent-isolation.md +125 -0
  160. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03c-subagent-maintainability.md +102 -0
  161. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03e-subagent-performance.md +117 -0
  162. package/templates/bmad/tea/workflows/testarch/test-review/steps-c/step-03f-aggregate-scores.md +10 -10
  163. package/templates/bmad/tea/workflows/testarch/test-review/validation-report-20260127-095021.md +1 -1
  164. package/templates/bmad/tea/workflows/testarch/test-review/validation-report-20260127-102401.md +3 -3
  165. package/templates/bmad/tea/workflows/testarch/test-review/workflow.yaml +2 -2
  166. package/templates/bmad/tea/workflows/testarch/trace/steps-c/step-04-analyze-gaps.md +92 -1
  167. package/templates/bmad/tea/workflows/testarch/trace/validation-report-20260127-095021.md +1 -1
  168. package/templates/bmad/tea/workflows/testarch/trace/validation-report-20260127-102401.md +3 -3
  169. package/templates/bmad/tea/workflows/testarch/trace/workflow.yaml +2 -2
  170. package/templates/ecc/agents/chief-of-staff.md +151 -0
  171. package/templates/ecc/commands/claw.md +79 -0
  172. package/templates/ecc/rules/README.md +23 -2
  173. package/templates/ecc/rules/common/development-workflow.md +37 -0
  174. package/templates/ecc/rules/common/git-workflow.md +2 -23
  175. package/templates/ecc/rules/swift/coding-style.md +47 -0
  176. package/templates/ecc/rules/swift/hooks.md +20 -0
  177. package/templates/ecc/rules/swift/patterns.md +66 -0
  178. package/templates/ecc/rules/swift/security.md +33 -0
  179. package/templates/ecc/rules/swift/testing.md +45 -0
  180. package/templates/ecc/skills/api-design/SKILL.md +1 -0
  181. package/templates/ecc/skills/article-writing/SKILL.md +85 -0
  182. package/templates/ecc/skills/backend-patterns/SKILL.md +1 -0
  183. package/templates/ecc/skills/clickhouse-io/SKILL.md +1 -0
  184. package/templates/ecc/skills/coding-standards/SKILL.md +1 -0
  185. package/templates/ecc/skills/configure-ecc/SKILL.md +32 -4
  186. package/templates/ecc/skills/content-engine/SKILL.md +88 -0
  187. package/templates/ecc/skills/content-hash-cache-pattern/SKILL.md +1 -0
  188. package/templates/ecc/skills/continuous-learning/SKILL.md +2 -1
  189. package/templates/ecc/skills/continuous-learning-v2/SKILL.md +4 -1
  190. package/templates/ecc/skills/continuous-learning-v2/hooks/observe.sh +14 -7
  191. package/templates/ecc/skills/cost-aware-llm-pipeline/SKILL.md +1 -0
  192. package/templates/ecc/skills/cpp-coding-standards/SKILL.md +1 -0
  193. package/templates/ecc/skills/cpp-testing/SKILL.md +1 -0
  194. package/templates/ecc/skills/database-migrations/SKILL.md +1 -0
  195. package/templates/ecc/skills/deployment-patterns/SKILL.md +1 -0
  196. package/templates/ecc/skills/django-patterns/SKILL.md +1 -0
  197. package/templates/ecc/skills/django-security/SKILL.md +1 -0
  198. package/templates/ecc/skills/django-tdd/SKILL.md +1 -0
  199. package/templates/ecc/skills/django-verification/SKILL.md +1 -0
  200. package/templates/ecc/skills/docker-patterns/SKILL.md +1 -0
  201. package/templates/ecc/skills/e2e-testing/SKILL.md +1 -0
  202. package/templates/ecc/skills/eval-harness/SKILL.md +1 -0
  203. package/templates/ecc/skills/foundation-models-on-device/SKILL.md +243 -0
  204. package/templates/ecc/skills/frontend-patterns/SKILL.md +1 -0
  205. package/templates/ecc/skills/frontend-slides/SKILL.md +184 -0
  206. package/templates/ecc/skills/frontend-slides/STYLE_PRESETS.md +330 -0
  207. package/templates/ecc/skills/golang-patterns/SKILL.md +1 -0
  208. package/templates/ecc/skills/golang-testing/SKILL.md +1 -0
  209. package/templates/ecc/skills/investor-materials/SKILL.md +96 -0
  210. package/templates/ecc/skills/investor-outreach/SKILL.md +76 -0
  211. package/templates/ecc/skills/iterative-retrieval/SKILL.md +1 -0
  212. package/templates/ecc/skills/java-coding-standards/SKILL.md +1 -0
  213. package/templates/ecc/skills/jpa-patterns/SKILL.md +1 -0
  214. package/templates/ecc/skills/liquid-glass-design/SKILL.md +279 -0
  215. package/templates/ecc/skills/market-research/SKILL.md +75 -0
  216. package/templates/ecc/skills/nutrient-document-processing/SKILL.md +1 -1
  217. package/templates/ecc/skills/postgres-patterns/SKILL.md +1 -0
  218. package/templates/ecc/skills/project-guidelines-example/SKILL.md +1 -0
  219. package/templates/ecc/skills/python-patterns/SKILL.md +1 -0
  220. package/templates/ecc/skills/python-testing/SKILL.md +1 -0
  221. package/templates/ecc/skills/regex-vs-llm-structured-text/SKILL.md +1 -0
  222. package/templates/ecc/skills/search-first/SKILL.md +3 -1
  223. package/templates/ecc/skills/security-review/SKILL.md +1 -0
  224. package/templates/ecc/skills/security-scan/SKILL.md +1 -0
  225. package/templates/ecc/skills/skill-stocktake/SKILL.md +176 -0
  226. package/templates/ecc/skills/skill-stocktake/scripts/quick-diff.sh +87 -0
  227. package/templates/ecc/skills/skill-stocktake/scripts/save-results.sh +56 -0
  228. package/templates/ecc/skills/skill-stocktake/scripts/scan.sh +170 -0
  229. package/templates/ecc/skills/springboot-patterns/SKILL.md +1 -0
  230. package/templates/ecc/skills/springboot-security/SKILL.md +1 -0
  231. package/templates/ecc/skills/springboot-tdd/SKILL.md +1 -0
  232. package/templates/ecc/skills/springboot-verification/SKILL.md +1 -0
  233. package/templates/ecc/skills/strategic-compact/SKILL.md +1 -0
  234. package/templates/ecc/skills/swift-actor-persistence/SKILL.md +1 -0
  235. package/templates/ecc/skills/swift-concurrency-6-2/SKILL.md +216 -0
  236. package/templates/ecc/skills/swift-protocol-di-testing/SKILL.md +1 -0
  237. package/templates/ecc/skills/swiftui-patterns/SKILL.md +259 -0
  238. package/templates/ecc/skills/tdd-workflow/SKILL.md +1 -0
  239. package/templates/ecc/skills/verification-loop/SKILL.md +1 -0
  240. package/templates/ecc/skills/visa-doc-translate/README.md +86 -0
  241. package/templates/ecc/skills/visa-doc-translate/SKILL.md +117 -0
  242. package/templates/ext-skills/pinchtab/SKILL.md +89 -486
  243. package/templates/ext-skills/pinchtab/TRUST.md +69 -0
  244. package/templates/ext-skills/pinchtab/references/api.md +297 -0
  245. package/templates/ext-skills/pinchtab/references/env.md +45 -0
  246. package/templates/ext-skills/pinchtab/references/profiles.md +107 -0
  247. package/templates/plugins/claude-code-setup/.claude-plugin/plugin.json +9 -0
  248. package/templates/plugins/claude-code-setup/LICENSE +202 -0
  249. package/templates/plugins/claude-code-setup/README.md +29 -0
  250. package/templates/plugins/claude-code-setup/automation-recommender-example.png +0 -0
  251. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/SKILL.md +288 -0
  252. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/references/hooks-patterns.md +226 -0
  253. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/references/mcp-servers.md +263 -0
  254. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/references/plugins-reference.md +98 -0
  255. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/references/skills-reference.md +408 -0
  256. package/templates/plugins/claude-code-setup/skills/claude-automation-recommender/references/subagent-templates.md +181 -0
  257. package/templates/plugins/claude-md-management/.claude-plugin/plugin.json +9 -0
  258. package/templates/plugins/claude-md-management/LICENSE +202 -0
  259. package/templates/plugins/claude-md-management/README.md +40 -0
  260. package/templates/plugins/claude-md-management/claude-md-improver-example.png +0 -0
  261. package/templates/plugins/claude-md-management/commands/revise-claude-md.md +54 -0
  262. package/templates/plugins/claude-md-management/revise-claude-md-example.png +0 -0
  263. package/templates/plugins/claude-md-management/skills/claude-md-improver/SKILL.md +179 -0
  264. package/templates/plugins/claude-md-management/skills/claude-md-improver/references/quality-criteria.md +109 -0
  265. package/templates/plugins/claude-md-management/skills/claude-md-improver/references/templates.md +253 -0
  266. package/templates/plugins/claude-md-management/skills/claude-md-improver/references/update-guidelines.md +150 -0
  267. package/templates/plugins/code-simplifier/.claude-plugin/plugin.json +9 -0
  268. package/templates/plugins/code-simplifier/LICENSE +202 -0
  269. package/templates/plugins/code-simplifier/agents/code-simplifier.md +52 -0
  270. package/templates/plugins/commit-commands/.claude-plugin/plugin.json +9 -0
  271. package/templates/plugins/commit-commands/LICENSE +202 -0
  272. package/templates/plugins/commit-commands/README.md +225 -0
  273. package/templates/plugins/commit-commands/commands/clean_gone.md +53 -0
  274. package/templates/plugins/commit-commands/commands/commit-push-pr.md +20 -0
  275. package/templates/plugins/commit-commands/commands/commit.md +17 -0
  276. package/templates/trae-bmad/rules/bmad-bmm-check-implementation-readiness.md +2 -2
  277. package/templates/trae-bmad/rules/bmad-bmm-code-review.md +4 -4
  278. package/templates/trae-bmad/rules/bmad-bmm-correct-course.md +4 -4
  279. package/templates/trae-bmad/rules/bmad-bmm-create-architecture.md +2 -2
  280. package/templates/trae-bmad/rules/bmad-bmm-create-epics-and-stories.md +2 -2
  281. package/templates/trae-bmad/rules/bmad-bmm-create-prd.md +2 -2
  282. package/templates/trae-bmad/rules/bmad-bmm-create-product-brief.md +2 -2
  283. package/templates/trae-bmad/rules/bmad-bmm-create-story.md +4 -4
  284. package/templates/trae-bmad/rules/bmad-bmm-create-ux-design.md +2 -2
  285. package/templates/trae-bmad/rules/bmad-bmm-dev-story.md +4 -4
  286. package/templates/trae-bmad/rules/bmad-bmm-document-project.md +4 -4
  287. package/templates/trae-bmad/rules/bmad-bmm-domain-research.md +2 -2
  288. package/templates/trae-bmad/rules/bmad-bmm-edit-prd.md +2 -2
  289. package/templates/trae-bmad/rules/bmad-bmm-generate-project-context.md +2 -2
  290. package/templates/trae-bmad/rules/bmad-bmm-market-research.md +2 -2
  291. package/templates/trae-bmad/rules/bmad-bmm-qa-generate-e2e-tests.md +4 -4
  292. package/templates/trae-bmad/rules/bmad-bmm-quick-dev.md +2 -2
  293. package/templates/trae-bmad/rules/bmad-bmm-quick-spec.md +2 -2
  294. package/templates/trae-bmad/rules/bmad-bmm-retrospective.md +4 -4
  295. package/templates/trae-bmad/rules/bmad-bmm-sprint-planning.md +4 -4
  296. package/templates/trae-bmad/rules/bmad-bmm-sprint-status.md +4 -4
  297. package/templates/trae-bmad/rules/bmad-bmm-technical-research.md +2 -2
  298. package/templates/trae-bmad/rules/bmad-bmm-validate-prd.md +2 -2
  299. package/templates/trae-bmad/rules/bmad-brainstorming.md +2 -2
  300. package/templates/trae-bmad/rules/bmad-editorial-review-prose.md +1 -1
  301. package/templates/trae-bmad/rules/bmad-editorial-review-structure.md +1 -1
  302. package/templates/trae-bmad/rules/bmad-help.md +1 -1
  303. package/templates/trae-bmad/rules/bmad-index-docs.md +1 -1
  304. package/templates/trae-bmad/rules/bmad-party-mode.md +2 -2
  305. package/templates/trae-bmad/rules/bmad-review-adversarial-general.md +1 -1
  306. package/templates/trae-bmad/rules/bmad-review-edge-case-hunter.md +10 -0
  307. package/templates/trae-bmad/rules/bmad-shard-doc.md +1 -1
  308. package/templates/trae-bmad/rules/bmad-tea-teach-me-testing.md +2 -2
  309. package/templates/trae-bmad/rules/bmad-tea-testarch-atdd.md +4 -4
  310. package/templates/trae-bmad/rules/bmad-tea-testarch-automate.md +4 -4
  311. package/templates/trae-bmad/rules/bmad-tea-testarch-ci.md +4 -4
  312. package/templates/trae-bmad/rules/bmad-tea-testarch-framework.md +4 -4
  313. package/templates/trae-bmad/rules/bmad-tea-testarch-nfr.md +4 -4
  314. package/templates/trae-bmad/rules/bmad-tea-testarch-test-design.md +4 -4
  315. package/templates/trae-bmad/rules/bmad-tea-testarch-test-review.md +4 -4
  316. package/templates/trae-bmad/rules/bmad-tea-testarch-trace.md +4 -4
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: content-engine
3
+ description: Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.
4
+ origin: ECC
5
+ ---
6
+
7
+ # Content Engine
8
+
9
+ Turn one idea into strong, platform-native content instead of posting the same thing everywhere.
10
+
11
+ ## When to Activate
12
+
13
+ - writing X posts or threads
14
+ - drafting LinkedIn posts or launch updates
15
+ - scripting short-form video or YouTube explainers
16
+ - repurposing articles, podcasts, demos, or docs into social content
17
+ - building a lightweight content plan around a launch, milestone, or theme
18
+
19
+ ## First Questions
20
+
21
+ Clarify:
22
+ - source asset: what are we adapting from
23
+ - audience: builders, investors, customers, operators, or general audience
24
+ - platform: X, LinkedIn, TikTok, YouTube, newsletter, or multi-platform
25
+ - goal: awareness, conversion, recruiting, authority, launch support, or engagement
26
+
27
+ ## Core Rules
28
+
29
+ 1. Adapt for the platform. Do not cross-post the same copy.
30
+ 2. Hooks matter more than summaries.
31
+ 3. Every post should carry one clear idea.
32
+ 4. Use specifics over slogans.
33
+ 5. Keep the ask small and clear.
34
+
35
+ ## Platform Guidance
36
+
37
+ ### X
38
+ - open fast
39
+ - one idea per post or per tweet in a thread
40
+ - keep links out of the main body unless necessary
41
+ - avoid hashtag spam
42
+
43
+ ### LinkedIn
44
+ - strong first line
45
+ - short paragraphs
46
+ - more explicit framing around lessons, results, and takeaways
47
+
48
+ ### TikTok / Short Video
49
+ - first 3 seconds must interrupt attention
50
+ - script around visuals, not just narration
51
+ - one demo, one claim, one CTA
52
+
53
+ ### YouTube
54
+ - show the result early
55
+ - structure by chapter
56
+ - refresh the visual every 20-30 seconds
57
+
58
+ ### Newsletter
59
+ - deliver one clear lens, not a bundle of unrelated items
60
+ - make section titles skimmable
61
+ - keep the opening paragraph doing real work
62
+
63
+ ## Repurposing Flow
64
+
65
+ Default cascade:
66
+ 1. anchor asset: article, video, demo, memo, or launch doc
67
+ 2. extract 3-7 atomic ideas
68
+ 3. write platform-native variants
69
+ 4. trim repetition across outputs
70
+ 5. align CTAs with platform intent
71
+
72
+ ## Deliverables
73
+
74
+ When asked for a campaign, return:
75
+ - the core angle
76
+ - platform-specific drafts
77
+ - optional posting order
78
+ - optional CTA variants
79
+ - any missing inputs needed before publishing
80
+
81
+ ## Quality Gate
82
+
83
+ Before delivering:
84
+ - each draft reads natively for its platform
85
+ - hooks are strong and specific
86
+ - no generic hype language
87
+ - no duplicated copy across platforms unless requested
88
+ - the CTA matches the content and audience
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: content-hash-cache-pattern
3
3
  description: Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Content-Hash File Cache Pattern
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: continuous-learning
3
3
  description: Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Continuous Learning Skill
@@ -91,7 +92,7 @@ Add to your `~/.claude/settings.json`:
91
92
 
92
93
  ## Comparison Notes (Research: Jan 2025)
93
94
 
94
- ### vs Homunculus (github.com/humanplane/homunculus)
95
+ ### vs Homunculus
95
96
 
96
97
  Homunculus v2 takes a more sophisticated approach:
97
98
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: continuous-learning-v2
3
3
  description: Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
4
+ origin: ECC
4
5
  version: 2.0.0
5
6
  ---
6
7
 
@@ -8,6 +9,8 @@ version: 2.0.0
8
9
 
9
10
  An advanced learning system that turns your Claude Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring.
10
11
 
12
+ Inspired in part by the Homunculus work from [humanplane](https://github.com/humanplane).
13
+
11
14
  ## When to Activate
12
15
 
13
16
  - Setting up automatic learning from Claude Code sessions
@@ -284,7 +287,7 @@ v2 is fully compatible with v1:
284
287
  ## Related
285
288
 
286
289
  - [Skill Creator](https://skill-creator.app) - Generate instincts from repo history
287
- - [Homunculus](https://github.com/humanplane/homunculus) - Inspiration for v2 architecture
290
+ - Homunculus - Community project that inspired the v2 instinct-based architecture (atomic observations, confidence scoring, instinct evolution pipeline)
288
291
  - [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - Continuous learning section
289
292
 
290
293
  ---
@@ -36,6 +36,9 @@
36
36
 
37
37
  set -e
38
38
 
39
+ # Hook phase from CLI argument: "pre" (PreToolUse) or "post" (PostToolUse)
40
+ HOOK_PHASE="${1:-post}"
41
+
39
42
  CONFIG_DIR="${HOME}/.claude/homunculus"
40
43
  OBSERVATIONS_FILE="${CONFIG_DIR}/observations.jsonl"
41
44
  MAX_FILE_SIZE_MB=10
@@ -57,15 +60,22 @@ if [ -z "$INPUT_JSON" ]; then
57
60
  fi
58
61
 
59
62
  # Parse using python via stdin pipe (safe for all JSON payloads)
60
- PARSED=$(echo "$INPUT_JSON" | python3 -c '
63
+ # Pass HOOK_PHASE via env var since Claude Code does not include hook type in stdin JSON
64
+ PARSED=$(echo "$INPUT_JSON" | HOOK_PHASE="$HOOK_PHASE" python3 -c '
61
65
  import json
62
66
  import sys
67
+ import os
63
68
 
64
69
  try:
65
70
  data = json.load(sys.stdin)
66
71
 
72
+ # Determine event type from CLI argument passed via env var.
73
+ # Claude Code does NOT include a "hook_type" field in the stdin JSON,
74
+ # so we rely on the shell argument ("pre" or "post") instead.
75
+ hook_phase = os.environ.get("HOOK_PHASE", "post")
76
+ event = "tool_start" if hook_phase == "pre" else "tool_complete"
77
+
67
78
  # Extract fields - Claude Code hook format
68
- hook_type = data.get("hook_type", "unknown") # PreToolUse or PostToolUse
69
79
  tool_name = data.get("tool_name", data.get("tool", "unknown"))
70
80
  tool_input = data.get("tool_input", data.get("input", {}))
71
81
  tool_output = data.get("tool_output", data.get("output", ""))
@@ -82,9 +92,6 @@ try:
82
92
  else:
83
93
  tool_output_str = str(tool_output)[:5000]
84
94
 
85
- # Determine event type
86
- event = "tool_start" if "Pre" in hook_type else "tool_complete"
87
-
88
95
  print(json.dumps({
89
96
  "parsed": True,
90
97
  "event": event,
@@ -137,9 +144,9 @@ observation = {
137
144
  'session': parsed['session']
138
145
  }
139
146
 
140
- if parsed['input']:
147
+ if parsed['input'] is not None:
141
148
  observation['input'] = parsed['input']
142
- if parsed['output']:
149
+ if parsed['output'] is not None:
143
150
  observation['output'] = parsed['output']
144
151
 
145
152
  print(json.dumps(observation))
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: cost-aware-llm-pipeline
3
3
  description: Cost optimization patterns for LLM API usage — model routing by task complexity, budget tracking, retry logic, and prompt caching.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Cost-Aware LLM Pipeline
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: cpp-coding-standards
3
3
  description: C++ coding standards based on the C++ Core Guidelines (isocpp.github.io). Use when writing, reviewing, or refactoring C++ code to enforce modern, safe, and idiomatic practices.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # C++ Coding Standards (C++ Core Guidelines)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: cpp-testing
3
3
  description: Use only when writing/updating/fixing C++ tests, configuring GoogleTest/CTest, diagnosing failing or flaky tests, or adding coverage/sanitizers.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # C++ Testing (Agent Skill)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: database-migrations
3
3
  description: Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate).
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Database Migration Patterns
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: deployment-patterns
3
3
  description: Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Deployment Patterns
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: django-patterns
3
3
  description: Django architecture patterns, REST API design with DRF, ORM best practices, caching, signals, middleware, and production-grade Django apps.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Django Development Patterns
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: django-security
3
3
  description: Django security best practices, authentication, authorization, CSRF protection, SQL injection prevention, XSS prevention, and secure deployment configurations.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Django Security Best Practices
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: django-tdd
3
3
  description: Django testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Django Testing with TDD
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: django-verification
3
3
  description: "Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR."
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Django Verification Loop
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: docker-patterns
3
3
  description: Docker and Docker Compose patterns for local development, container security, networking, volume strategies, and multi-service orchestration.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Docker Patterns
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: e2e-testing
3
3
  description: Playwright E2E testing patterns, Page Object Model, configuration, CI/CD integration, artifact management, and flaky test strategies.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # E2E Testing Patterns
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: eval-harness
3
3
  description: Formal evaluation framework for Claude Code sessions implementing eval-driven development (EDD) principles
4
+ origin: ECC
4
5
  tools: Read, Write, Edit, Bash, Grep, Glob
5
6
  ---
6
7
 
@@ -0,0 +1,243 @@
1
+ ---
2
+ name: foundation-models-on-device
3
+ description: Apple FoundationModels framework for on-device LLM — text generation, guided generation with @Generable, tool calling, and snapshot streaming in iOS 26+.
4
+ ---
5
+
6
+ # FoundationModels: On-Device LLM (iOS 26)
7
+
8
+ Patterns for integrating Apple's on-device language model into apps using the FoundationModels framework. Covers text generation, structured output with `@Generable`, custom tool calling, and snapshot streaming — all running on-device for privacy and offline support.
9
+
10
+ ## When to Activate
11
+
12
+ - Building AI-powered features using Apple Intelligence on-device
13
+ - Generating or summarizing text without cloud dependency
14
+ - Extracting structured data from natural language input
15
+ - Implementing custom tool calling for domain-specific AI actions
16
+ - Streaming structured responses for real-time UI updates
17
+ - Need privacy-preserving AI (no data leaves the device)
18
+
19
+ ## Core Pattern — Availability Check
20
+
21
+ Always check model availability before creating a session:
22
+
23
+ ```swift
24
+ struct GenerativeView: View {
25
+ private var model = SystemLanguageModel.default
26
+
27
+ var body: some View {
28
+ switch model.availability {
29
+ case .available:
30
+ ContentView()
31
+ case .unavailable(.deviceNotEligible):
32
+ Text("Device not eligible for Apple Intelligence")
33
+ case .unavailable(.appleIntelligenceNotEnabled):
34
+ Text("Please enable Apple Intelligence in Settings")
35
+ case .unavailable(.modelNotReady):
36
+ Text("Model is downloading or not ready")
37
+ case .unavailable(let other):
38
+ Text("Model unavailable: \(other)")
39
+ }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## Core Pattern — Basic Session
45
+
46
+ ```swift
47
+ // Single-turn: create a new session each time
48
+ let session = LanguageModelSession()
49
+ let response = try await session.respond(to: "What's a good month to visit Paris?")
50
+ print(response.content)
51
+
52
+ // Multi-turn: reuse session for conversation context
53
+ let session = LanguageModelSession(instructions: """
54
+ You are a cooking assistant.
55
+ Provide recipe suggestions based on ingredients.
56
+ Keep suggestions brief and practical.
57
+ """)
58
+
59
+ let first = try await session.respond(to: "I have chicken and rice")
60
+ let followUp = try await session.respond(to: "What about a vegetarian option?")
61
+ ```
62
+
63
+ Key points for instructions:
64
+ - Define the model's role ("You are a mentor")
65
+ - Specify what to do ("Help extract calendar events")
66
+ - Set style preferences ("Respond as briefly as possible")
67
+ - Add safety measures ("Respond with 'I can't help with that' for dangerous requests")
68
+
69
+ ## Core Pattern — Guided Generation with @Generable
70
+
71
+ Generate structured Swift types instead of raw strings:
72
+
73
+ ### 1. Define a Generable Type
74
+
75
+ ```swift
76
+ @Generable(description: "Basic profile information about a cat")
77
+ struct CatProfile {
78
+ var name: String
79
+
80
+ @Guide(description: "The age of the cat", .range(0...20))
81
+ var age: Int
82
+
83
+ @Guide(description: "A one sentence profile about the cat's personality")
84
+ var profile: String
85
+ }
86
+ ```
87
+
88
+ ### 2. Request Structured Output
89
+
90
+ ```swift
91
+ let response = try await session.respond(
92
+ to: "Generate a cute rescue cat",
93
+ generating: CatProfile.self
94
+ )
95
+
96
+ // Access structured fields directly
97
+ print("Name: \(response.content.name)")
98
+ print("Age: \(response.content.age)")
99
+ print("Profile: \(response.content.profile)")
100
+ ```
101
+
102
+ ### Supported @Guide Constraints
103
+
104
+ - `.range(0...20)` — numeric range
105
+ - `.count(3)` — array element count
106
+ - `description:` — semantic guidance for generation
107
+
108
+ ## Core Pattern — Tool Calling
109
+
110
+ Let the model invoke custom code for domain-specific tasks:
111
+
112
+ ### 1. Define a Tool
113
+
114
+ ```swift
115
+ struct RecipeSearchTool: Tool {
116
+ let name = "recipe_search"
117
+ let description = "Search for recipes matching a given term and return a list of results."
118
+
119
+ @Generable
120
+ struct Arguments {
121
+ var searchTerm: String
122
+ var numberOfResults: Int
123
+ }
124
+
125
+ func call(arguments: Arguments) async throws -> ToolOutput {
126
+ let recipes = await searchRecipes(
127
+ term: arguments.searchTerm,
128
+ limit: arguments.numberOfResults
129
+ )
130
+ return .string(recipes.map { "- \($0.name): \($0.description)" }.joined(separator: "\n"))
131
+ }
132
+ }
133
+ ```
134
+
135
+ ### 2. Create Session with Tools
136
+
137
+ ```swift
138
+ let session = LanguageModelSession(tools: [RecipeSearchTool()])
139
+ let response = try await session.respond(to: "Find me some pasta recipes")
140
+ ```
141
+
142
+ ### 3. Handle Tool Errors
143
+
144
+ ```swift
145
+ do {
146
+ let answer = try await session.respond(to: "Find a recipe for tomato soup.")
147
+ } catch let error as LanguageModelSession.ToolCallError {
148
+ print(error.tool.name)
149
+ if case .databaseIsEmpty = error.underlyingError as? RecipeSearchToolError {
150
+ // Handle specific tool error
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## Core Pattern — Snapshot Streaming
156
+
157
+ Stream structured responses for real-time UI with `PartiallyGenerated` types:
158
+
159
+ ```swift
160
+ @Generable
161
+ struct TripIdeas {
162
+ @Guide(description: "Ideas for upcoming trips")
163
+ var ideas: [String]
164
+ }
165
+
166
+ let stream = session.streamResponse(
167
+ to: "What are some exciting trip ideas?",
168
+ generating: TripIdeas.self
169
+ )
170
+
171
+ for try await partial in stream {
172
+ // partial: TripIdeas.PartiallyGenerated (all properties Optional)
173
+ print(partial)
174
+ }
175
+ ```
176
+
177
+ ### SwiftUI Integration
178
+
179
+ ```swift
180
+ @State private var partialResult: TripIdeas.PartiallyGenerated?
181
+ @State private var errorMessage: String?
182
+
183
+ var body: some View {
184
+ List {
185
+ ForEach(partialResult?.ideas ?? [], id: \.self) { idea in
186
+ Text(idea)
187
+ }
188
+ }
189
+ .overlay {
190
+ if let errorMessage { Text(errorMessage).foregroundStyle(.red) }
191
+ }
192
+ .task {
193
+ do {
194
+ let stream = session.streamResponse(to: prompt, generating: TripIdeas.self)
195
+ for try await partial in stream {
196
+ partialResult = partial
197
+ }
198
+ } catch {
199
+ errorMessage = error.localizedDescription
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ ## Key Design Decisions
206
+
207
+ | Decision | Rationale |
208
+ |----------|-----------|
209
+ | On-device execution | Privacy — no data leaves the device; works offline |
210
+ | 4,096 token limit | On-device model constraint; chunk large data across sessions |
211
+ | Snapshot streaming (not deltas) | Structured output friendly; each snapshot is a complete partial state |
212
+ | `@Generable` macro | Compile-time safety for structured generation; auto-generates `PartiallyGenerated` type |
213
+ | Single request per session | `isResponding` prevents concurrent requests; create multiple sessions if needed |
214
+ | `response.content` (not `.output`) | Correct API — always access results via `.content` property |
215
+
216
+ ## Best Practices
217
+
218
+ - **Always check `model.availability`** before creating a session — handle all unavailability cases
219
+ - **Use `instructions`** to guide model behavior — they take priority over prompts
220
+ - **Check `isResponding`** before sending a new request — sessions handle one request at a time
221
+ - **Access `response.content`** for results — not `.output`
222
+ - **Break large inputs into chunks** — 4,096 token limit applies to instructions + prompt + output combined
223
+ - **Use `@Generable`** for structured output — stronger guarantees than parsing raw strings
224
+ - **Use `GenerationOptions(temperature:)`** to tune creativity (higher = more creative)
225
+ - **Monitor with Instruments** — use Xcode Instruments to profile request performance
226
+
227
+ ## Anti-Patterns to Avoid
228
+
229
+ - Creating sessions without checking `model.availability` first
230
+ - Sending inputs exceeding the 4,096 token context window
231
+ - Attempting concurrent requests on a single session
232
+ - Using `.output` instead of `.content` to access response data
233
+ - Parsing raw string responses when `@Generable` structured output would work
234
+ - Building complex multi-step logic in a single prompt — break into multiple focused prompts
235
+ - Assuming the model is always available — device eligibility and settings vary
236
+
237
+ ## When to Use
238
+
239
+ - On-device text generation for privacy-sensitive apps
240
+ - Structured data extraction from user input (forms, natural language commands)
241
+ - AI-assisted features that must work offline
242
+ - Streaming UI that progressively shows generated content
243
+ - Domain-specific AI actions via tool calling (search, compute, lookup)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: frontend-patterns
3
3
  description: Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
4
+ origin: ECC
4
5
  ---
5
6
 
6
7
  # Frontend Development Patterns