opencode-agent-kit 1.0.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.
- package/README.md +796 -0
- package/bin/commands/init.mjs +221 -0
- package/bin/init.mjs +21 -0
- package/package.json +22 -0
- package/template/.opencode/agent-docs/backend/README.md +0 -0
- package/template/.opencode/agent-docs/backend/node/BACKEND_PATTERNS.md +82 -0
- package/template/.opencode/agent-docs/backend/node/BACKEND_QUICK_START.md +49 -0
- package/template/.opencode/agent-docs/frontend/next/README.md +0 -0
- package/template/.opencode/agent-docs/frontend/nuxt/API_PATTERNS.md +807 -0
- package/template/.opencode/agent-docs/frontend/nuxt/CHEATSHEET.md +676 -0
- package/template/.opencode/agent-docs/frontend/nuxt/COMPLETION_REPORT.md +613 -0
- package/template/.opencode/agent-docs/frontend/nuxt/EXAMPLES.md +956 -0
- package/template/.opencode/agent-docs/frontend/nuxt/INDEX.md +596 -0
- package/template/.opencode/agent-docs/frontend/nuxt/MCP_GUIDE.md +881 -0
- package/template/.opencode/agent-docs/frontend/nuxt/MENTOR_CURRICULUM_30_DAYS.md +256 -0
- package/template/.opencode/agent-docs/frontend/nuxt/MENTOR_CURRICULUM_CHECKLIST.md +156 -0
- package/template/.opencode/agent-docs/frontend/nuxt/MENTOR_WEEKLY_ASSIGNMENTS.md +191 -0
- package/template/.opencode/agent-docs/frontend/nuxt/QUICK_START.md +509 -0
- package/template/.opencode/agent-docs/frontend/nuxt/README.md +506 -0
- package/template/.opencode/agent-docs/frontend/nuxt/README_AGENTS.md +140 -0
- package/template/.opencode/agent-docs/frontend/nuxt/README_DOCS.md +65 -0
- package/template/.opencode/agent-docs/frontend/nuxt/SUMMARY.md +474 -0
- package/template/.opencode/agent-docs/frontend/nuxt/TEAM_OPERATING_GUIDE.md +54 -0
- package/template/.opencode/agent-docs/frontend/nuxt/TESTING_GUIDE.md +904 -0
- package/template/.opencode/agent-docs/frontend/nuxt/WORKFLOWS.md +758 -0
- package/template/.opencode/agent-docs/frontend/react/API_PATTERNS.md +187 -0
- package/template/.opencode/agent-docs/frontend/react/CHEATSHEET.md +87 -0
- package/template/.opencode/agent-docs/frontend/react/INDEX.md +45 -0
- package/template/.opencode/agent-docs/frontend/react/QUICK_START.md +43 -0
- package/template/.opencode/agent-docs/frontend/react/README.md +159 -0
- package/template/.opencode/agent-docs/frontend/vue/README.md +0 -0
- package/template/.opencode/agent-docs/mobile/android/README.md +45 -0
- package/template/.opencode/agent-docs/mobile/flutter/README.md +44 -0
- package/template/.opencode/agents/android-developer.md +418 -0
- package/template/.opencode/agents/code-igniter-3-fullstack.md +345 -0
- package/template/.opencode/agents/code-reviewer.md +517 -0
- package/template/.opencode/agents/database-specialist.md +455 -0
- package/template/.opencode/agents/devops-specialist.md +562 -0
- package/template/.opencode/agents/flutter-developer.md +556 -0
- package/template/.opencode/agents/it-leader.md +911 -0
- package/template/.opencode/agents/laravel-advanced.md +691 -0
- package/template/.opencode/agents/node-backend-developer.md +343 -0
- package/template/.opencode/agents/nuxt-frontend-developer-mentor.md +402 -0
- package/template/.opencode/agents/nuxt-frontend-developer.md +1573 -0
- package/template/.opencode/agents/react-frontend-developer.md +1017 -0
- package/template/.opencode/agents/seo-specialist.md +681 -0
- package/template/.opencode/agents/ui-ux-designer.md +783 -0
- package/template/.opencode/commands/android-build/command.md +25 -0
- package/template/.opencode/commands/android-test/command.md +23 -0
- package/template/.opencode/commands/build-fix.md +29 -0
- package/template/.opencode/commands/checkpoint.md +74 -0
- package/template/.opencode/commands/code-review.md +40 -0
- package/template/.opencode/commands/e2e.md +363 -0
- package/template/.opencode/commands/eval.md +120 -0
- package/template/.opencode/commands/evolve.md +193 -0
- package/template/.opencode/commands/flutter-build/command.md +25 -0
- package/template/.opencode/commands/flutter-test/command.md +24 -0
- package/template/.opencode/commands/go-build.md +183 -0
- package/template/.opencode/commands/go-review.md +148 -0
- package/template/.opencode/commands/go-test.md +268 -0
- package/template/.opencode/commands/gpc-release/command.md +30 -0
- package/template/.opencode/commands/instinct-export.md +91 -0
- package/template/.opencode/commands/instinct-import.md +142 -0
- package/template/.opencode/commands/instinct-status.md +86 -0
- package/template/.opencode/commands/learn.md +70 -0
- package/template/.opencode/commands/multi-backend.md +158 -0
- package/template/.opencode/commands/multi-execute.md +310 -0
- package/template/.opencode/commands/multi-frontend.md +158 -0
- package/template/.opencode/commands/multi-plan.md +261 -0
- package/template/.opencode/commands/multi-workflow.md +183 -0
- package/template/.opencode/commands/orchestrate.md +172 -0
- package/template/.opencode/commands/plan.md +113 -0
- package/template/.opencode/commands/pm2.md +271 -0
- package/template/.opencode/commands/python-review.md +297 -0
- package/template/.opencode/commands/refactor-clean.md +28 -0
- package/template/.opencode/commands/sessions.md +305 -0
- package/template/.opencode/commands/setup-pm.md +80 -0
- package/template/.opencode/commands/skill-create.md +174 -0
- package/template/.opencode/commands/tdd.md +326 -0
- package/template/.opencode/commands/test-coverage.md +27 -0
- package/template/.opencode/commands/update-codemaps.md +17 -0
- package/template/.opencode/commands/update-docs.md +31 -0
- package/template/.opencode/commands/verify.md +59 -0
- package/template/.opencode/config.example.json +309 -0
- package/template/.opencode/config.json +341 -0
- package/template/.opencode/contexts/dev.md +20 -0
- package/template/.opencode/contexts/research.md +26 -0
- package/template/.opencode/contexts/review.md +22 -0
- package/template/.opencode/hooks/hooks.json +169 -0
- package/template/.opencode/instructions/INSTRUCTIONS.md +388 -0
- package/template/.opencode/package.json +5 -0
- package/template/.opencode/rules/README.md +82 -0
- package/template/.opencode/rules/android/gradle.md +62 -0
- package/template/.opencode/rules/android/testing.md +27 -0
- package/template/.opencode/rules/common/agents.md +49 -0
- package/template/.opencode/rules/common/coding-style.md +48 -0
- package/template/.opencode/rules/common/git-workflow.md +45 -0
- package/template/.opencode/rules/common/hooks.md +30 -0
- package/template/.opencode/rules/common/patterns.md +31 -0
- package/template/.opencode/rules/common/performance.md +55 -0
- package/template/.opencode/rules/common/security.md +29 -0
- package/template/.opencode/rules/common/testing.md +29 -0
- package/template/.opencode/rules/flutter/state-management.md +57 -0
- package/template/.opencode/rules/flutter/testing.md +42 -0
- package/template/.opencode/rules/golang/coding-style.md +26 -0
- package/template/.opencode/rules/golang/hooks.md +11 -0
- package/template/.opencode/rules/golang/patterns.md +39 -0
- package/template/.opencode/rules/golang/security.md +28 -0
- package/template/.opencode/rules/golang/testing.md +25 -0
- package/template/.opencode/rules/mobile/performance.md +36 -0
- package/template/.opencode/rules/python/coding-style.md +37 -0
- package/template/.opencode/rules/python/hooks.md +14 -0
- package/template/.opencode/rules/python/patterns.md +34 -0
- package/template/.opencode/rules/python/security.md +25 -0
- package/template/.opencode/rules/python/testing.md +33 -0
- package/template/.opencode/rules/typescript/coding-style.md +58 -0
- package/template/.opencode/rules/typescript/hooks.md +15 -0
- package/template/.opencode/rules/typescript/patterns.md +45 -0
- package/template/.opencode/rules/typescript/security.md +21 -0
- package/template/.opencode/rules/typescript/testing.md +11 -0
- package/template/.opencode/skills/api-documentation/SKILL.md +188 -0
- package/template/.opencode/skills/backend-patterns/SKILL.md +587 -0
- package/template/.opencode/skills/building-components/SKILL.md +37 -0
- package/template/.opencode/skills/building-components/references/accessibility.mdx +819 -0
- package/template/.opencode/skills/building-components/references/as-child.mdx +324 -0
- package/template/.opencode/skills/building-components/references/composition.mdx +239 -0
- package/template/.opencode/skills/building-components/references/data-attributes.mdx +413 -0
- package/template/.opencode/skills/building-components/references/definitions.mdx +258 -0
- package/template/.opencode/skills/building-components/references/design-tokens.mdx +57 -0
- package/template/.opencode/skills/building-components/references/docs.mdx +155 -0
- package/template/.opencode/skills/building-components/references/marketplaces.mdx +144 -0
- package/template/.opencode/skills/building-components/references/npm.mdx +166 -0
- package/template/.opencode/skills/building-components/references/polymorphism.mdx +583 -0
- package/template/.opencode/skills/building-components/references/principles.mdx +61 -0
- package/template/.opencode/skills/building-components/references/registry.mdx +169 -0
- package/template/.opencode/skills/building-components/references/state.mdx +99 -0
- package/template/.opencode/skills/building-components/references/styling.mdx +286 -0
- package/template/.opencode/skills/building-components/references/types.mdx +191 -0
- package/template/.opencode/skills/clickhouse-io/SKILL.md +429 -0
- package/template/.opencode/skills/coding-standards/SKILL.md +520 -0
- package/template/.opencode/skills/configure-ecc/SKILL.md +298 -0
- package/template/.opencode/skills/continuous-learning/SKILL.md +110 -0
- package/template/.opencode/skills/continuous-learning/config.json +18 -0
- package/template/.opencode/skills/continuous-learning/evaluate-session.sh +60 -0
- package/template/.opencode/skills/continuous-learning-v2/SKILL.md +284 -0
- package/template/.opencode/skills/continuous-learning-v2/agents/observer.md +137 -0
- package/template/.opencode/skills/continuous-learning-v2/agents/start-observer.sh +134 -0
- package/template/.opencode/skills/continuous-learning-v2/config.json +41 -0
- package/template/.opencode/skills/continuous-learning-v2/hooks/observe.sh +153 -0
- package/template/.opencode/skills/continuous-learning-v2/scripts/instinct-cli.py +489 -0
- package/template/.opencode/skills/continuous-learning-v2/scripts/test_parse_instinct.py +82 -0
- package/template/.opencode/skills/dart-add-unit-test/SKILL.md +122 -0
- package/template/.opencode/skills/dart-build-cli-app/SKILL.md +185 -0
- package/template/.opencode/skills/dart-collect-coverage/SKILL.md +141 -0
- package/template/.opencode/skills/dart-fix-runtime-errors/SKILL.md +166 -0
- package/template/.opencode/skills/dart-generate-test-mocks/SKILL.md +155 -0
- package/template/.opencode/skills/dart-migrate-to-checks-package/SKILL.md +126 -0
- package/template/.opencode/skills/dart-resolve-package-conflicts/SKILL.md +116 -0
- package/template/.opencode/skills/dart-run-static-analysis/SKILL.md +104 -0
- package/template/.opencode/skills/dart-use-pattern-matching/SKILL.md +146 -0
- package/template/.opencode/skills/django-patterns/SKILL.md +733 -0
- package/template/.opencode/skills/django-security/SKILL.md +592 -0
- package/template/.opencode/skills/django-tdd/SKILL.md +728 -0
- package/template/.opencode/skills/django-verification/SKILL.md +460 -0
- package/template/.opencode/skills/eval-harness/SKILL.md +227 -0
- package/template/.opencode/skills/firebase-basics/SKILL.md +103 -0
- package/template/.opencode/skills/firebase-basics/references/additional-skills.md +113 -0
- package/template/.opencode/skills/firebase-basics/references/cli-usage.md +31 -0
- package/template/.opencode/skills/firebase-basics/references/client-library-usage.md +45 -0
- package/template/.opencode/skills/firebase-basics/references/core-concepts.md +61 -0
- package/template/.opencode/skills/firebase-basics/references/iac-usage.md +40 -0
- package/template/.opencode/skills/firebase-basics/references/iam-security.md +74 -0
- package/template/.opencode/skills/firebase-basics/references/mcp-usage.md +63 -0
- package/template/.opencode/skills/flutter/SKILL.md +292 -0
- package/template/.opencode/skills/flutter-add-integration-test/SKILL.md +163 -0
- package/template/.opencode/skills/flutter-add-widget-preview/SKILL.md +145 -0
- package/template/.opencode/skills/flutter-add-widget-test/SKILL.md +154 -0
- package/template/.opencode/skills/flutter-apply-architecture-best-practices/SKILL.md +162 -0
- package/template/.opencode/skills/flutter-build-responsive-layout/SKILL.md +139 -0
- package/template/.opencode/skills/flutter-fix-layout-issues/SKILL.md +130 -0
- package/template/.opencode/skills/flutter-implement-json-serialization/SKILL.md +153 -0
- package/template/.opencode/skills/flutter-setup-declarative-routing/SKILL.md +255 -0
- package/template/.opencode/skills/flutter-setup-localization/SKILL.md +210 -0
- package/template/.opencode/skills/flutter-use-http-package/SKILL.md +174 -0
- package/template/.opencode/skills/frontend-design/SKILL.md +89 -0
- package/template/.opencode/skills/frontend-patterns/SKILL.md +631 -0
- package/template/.opencode/skills/golang-patterns/SKILL.md +673 -0
- package/template/.opencode/skills/golang-testing/SKILL.md +719 -0
- package/template/.opencode/skills/impeccable/SKILL.md +165 -0
- package/template/.opencode/skills/impeccable/agents/impeccable-asset-producer.md +101 -0
- package/template/.opencode/skills/impeccable/reference/adapt.md +190 -0
- package/template/.opencode/skills/impeccable/reference/animate.md +175 -0
- package/template/.opencode/skills/impeccable/reference/audit.md +133 -0
- package/template/.opencode/skills/impeccable/reference/bolder.md +113 -0
- package/template/.opencode/skills/impeccable/reference/brand.md +118 -0
- package/template/.opencode/skills/impeccable/reference/clarify.md +174 -0
- package/template/.opencode/skills/impeccable/reference/codex.md +105 -0
- package/template/.opencode/skills/impeccable/reference/cognitive-load.md +106 -0
- package/template/.opencode/skills/impeccable/reference/color-and-contrast.md +105 -0
- package/template/.opencode/skills/impeccable/reference/colorize.md +154 -0
- package/template/.opencode/skills/impeccable/reference/craft.md +123 -0
- package/template/.opencode/skills/impeccable/reference/critique.md +273 -0
- package/template/.opencode/skills/impeccable/reference/delight.md +302 -0
- package/template/.opencode/skills/impeccable/reference/distill.md +111 -0
- package/template/.opencode/skills/impeccable/reference/document.md +427 -0
- package/template/.opencode/skills/impeccable/reference/extract.md +69 -0
- package/template/.opencode/skills/impeccable/reference/harden.md +347 -0
- package/template/.opencode/skills/impeccable/reference/heuristics-scoring.md +234 -0
- package/template/.opencode/skills/impeccable/reference/interaction-design.md +195 -0
- package/template/.opencode/skills/impeccable/reference/layout.md +141 -0
- package/template/.opencode/skills/impeccable/reference/live.md +622 -0
- package/template/.opencode/skills/impeccable/reference/motion-design.md +109 -0
- package/template/.opencode/skills/impeccable/reference/onboard.md +234 -0
- package/template/.opencode/skills/impeccable/reference/optimize.md +258 -0
- package/template/.opencode/skills/impeccable/reference/overdrive.md +130 -0
- package/template/.opencode/skills/impeccable/reference/personas.md +179 -0
- package/template/.opencode/skills/impeccable/reference/polish.md +242 -0
- package/template/.opencode/skills/impeccable/reference/product.md +62 -0
- package/template/.opencode/skills/impeccable/reference/quieter.md +99 -0
- package/template/.opencode/skills/impeccable/reference/responsive-design.md +114 -0
- package/template/.opencode/skills/impeccable/reference/shape.md +165 -0
- package/template/.opencode/skills/impeccable/reference/spatial-design.md +100 -0
- package/template/.opencode/skills/impeccable/reference/teach.md +156 -0
- package/template/.opencode/skills/impeccable/reference/typeset.md +124 -0
- package/template/.opencode/skills/impeccable/reference/typography.md +159 -0
- package/template/.opencode/skills/impeccable/reference/ux-writing.md +107 -0
- package/template/.opencode/skills/impeccable/scripts/cleanup-deprecated.mjs +284 -0
- package/template/.opencode/skills/impeccable/scripts/command-metadata.json +94 -0
- package/template/.opencode/skills/impeccable/scripts/critique-storage.mjs +242 -0
- package/template/.opencode/skills/impeccable/scripts/design-parser.mjs +820 -0
- package/template/.opencode/skills/impeccable/scripts/detect-csp.mjs +198 -0
- package/template/.opencode/skills/impeccable/scripts/detect.mjs +21 -0
- package/template/.opencode/skills/impeccable/scripts/impeccable-paths.mjs +110 -0
- package/template/.opencode/skills/impeccable/scripts/is-generated.mjs +69 -0
- package/template/.opencode/skills/impeccable/scripts/live-accept.mjs +595 -0
- package/template/.opencode/skills/impeccable/scripts/live-browser-session.js +123 -0
- package/template/.opencode/skills/impeccable/scripts/live-browser.js +4860 -0
- package/template/.opencode/skills/impeccable/scripts/live-complete.mjs +75 -0
- package/template/.opencode/skills/impeccable/scripts/live-completion.mjs +18 -0
- package/template/.opencode/skills/impeccable/scripts/live-inject.mjs +446 -0
- package/template/.opencode/skills/impeccable/scripts/live-poll.mjs +200 -0
- package/template/.opencode/skills/impeccable/scripts/live-resume.mjs +48 -0
- package/template/.opencode/skills/impeccable/scripts/live-server.mjs +838 -0
- package/template/.opencode/skills/impeccable/scripts/live-session-store.mjs +254 -0
- package/template/.opencode/skills/impeccable/scripts/live-status.mjs +47 -0
- package/template/.opencode/skills/impeccable/scripts/live-wrap.mjs +632 -0
- package/template/.opencode/skills/impeccable/scripts/live.mjs +247 -0
- package/template/.opencode/skills/impeccable/scripts/load-context.mjs +141 -0
- package/template/.opencode/skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/template/.opencode/skills/impeccable/scripts/pin.mjs +214 -0
- package/template/.opencode/skills/iterative-retrieval/SKILL.md +202 -0
- package/template/.opencode/skills/java-coding-standards/SKILL.md +138 -0
- package/template/.opencode/skills/jetpack-compose/.skillfish.json +10 -0
- package/template/.opencode/skills/jetpack-compose/SKILL.md +420 -0
- package/template/.opencode/skills/jpa-patterns/SKILL.md +141 -0
- package/template/.opencode/skills/nutrient-document-processing/SKILL.md +165 -0
- package/template/.opencode/skills/nuxt-ui/SKILL.md +334 -0
- package/template/.opencode/skills/nuxt-ui/references/components.md +377 -0
- package/template/.opencode/skills/nuxt-ui/references/composables.md +127 -0
- package/template/.opencode/skills/nuxt-ui/references/layouts/chat.md +266 -0
- package/template/.opencode/skills/nuxt-ui/references/layouts/dashboard.md +220 -0
- package/template/.opencode/skills/nuxt-ui/references/layouts/docs.md +141 -0
- package/template/.opencode/skills/nuxt-ui/references/layouts/editor.md +168 -0
- package/template/.opencode/skills/nuxt-ui/references/layouts/page.md +260 -0
- package/template/.opencode/skills/nuxt-ui/references/theming.md +427 -0
- package/template/.opencode/skills/postgres-patterns/SKILL.md +146 -0
- package/template/.opencode/skills/project-guidelines-example/SKILL.md +345 -0
- package/template/.opencode/skills/python-patterns/SKILL.md +749 -0
- package/template/.opencode/skills/python-testing/SKILL.md +815 -0
- package/template/.opencode/skills/security-review/SKILL.md +494 -0
- package/template/.opencode/skills/security-review/cloud-infrastructure-security.md +361 -0
- package/template/.opencode/skills/shadcn-ui/README.md +248 -0
- package/template/.opencode/skills/shadcn-ui/SKILL.md +326 -0
- package/template/.opencode/skills/shadcn-ui/examples/auth-layout.tsx +177 -0
- package/template/.opencode/skills/shadcn-ui/examples/data-table.tsx +313 -0
- package/template/.opencode/skills/shadcn-ui/examples/form-pattern.tsx +177 -0
- package/template/.opencode/skills/shadcn-ui/resources/component-catalog.md +481 -0
- package/template/.opencode/skills/shadcn-ui/resources/customization-guide.md +516 -0
- package/template/.opencode/skills/shadcn-ui/resources/migration-guide.md +463 -0
- package/template/.opencode/skills/shadcn-ui/resources/setup-guide.md +412 -0
- package/template/.opencode/skills/shadcn-ui/scripts/verify-setup.sh +134 -0
- package/template/.opencode/skills/springboot-patterns/SKILL.md +304 -0
- package/template/.opencode/skills/springboot-security/SKILL.md +119 -0
- package/template/.opencode/skills/springboot-tdd/SKILL.md +157 -0
- package/template/.opencode/skills/springboot-verification/SKILL.md +100 -0
- package/template/.opencode/skills/strategic-compact/SKILL.md +63 -0
- package/template/.opencode/skills/strategic-compact/suggest-compact.sh +52 -0
- package/template/.opencode/skills/tdd-workflow/SKILL.md +409 -0
- package/template/.opencode/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/template/.opencode/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/template/.opencode/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/template/.opencode/skills/vercel-react-best-practices/AGENTS.md +2934 -0
- package/template/.opencode/skills/vercel-react-best-practices/SKILL.md +136 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/template/.opencode/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/template/.opencode/skills/verification-loop/SKILL.md +120 -0
- package/template/.opencode/skills/web-design-guidelines/SKILL.md +39 -0
- package/template/AGENTS.md +32 -0
- package/template/opencode.json +354 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Android Gradle Rules
|
|
2
|
+
|
|
3
|
+
## Version Catalog (libs.versions.toml)
|
|
4
|
+
- Use TOML version catalog in `gradle/` directory
|
|
5
|
+
- Group dependencies by category (compose, hilt, room, retrofit, testing)
|
|
6
|
+
- Pin Compose BOM version; never pin individual Compose artifacts separately
|
|
7
|
+
|
|
8
|
+
```toml
|
|
9
|
+
[versions]
|
|
10
|
+
compose-bom = "2025.01.00"
|
|
11
|
+
hilt = "2.51"
|
|
12
|
+
room = "2.6.1"
|
|
13
|
+
kotlin = "2.0.21"
|
|
14
|
+
|
|
15
|
+
[libraries]
|
|
16
|
+
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
|
|
17
|
+
ui = { group = "androidx.compose.ui", name = "ui" }
|
|
18
|
+
material3 = { group = "androidx.compose.material3", name = "material3" }
|
|
19
|
+
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
|
20
|
+
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
|
21
|
+
room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
|
22
|
+
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
|
23
|
+
|
|
24
|
+
[plugins]
|
|
25
|
+
android-application = { id = "com.android.application", version = "8.7.0" }
|
|
26
|
+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|
27
|
+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
28
|
+
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
|
|
29
|
+
ksp = { id = "com.google.devtools.ksp", version = "2.0.21-1.0.27" }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Build Variants
|
|
33
|
+
- Use `debug` / `release` build types
|
|
34
|
+
- Configure `applicationIdSuffix` for debug builds
|
|
35
|
+
- Separate signing config for release
|
|
36
|
+
- Enable R8/ProGuard for release builds
|
|
37
|
+
|
|
38
|
+
## Core Dependencies
|
|
39
|
+
```kotlin
|
|
40
|
+
// compose-bom
|
|
41
|
+
implementation(platform(libs.compose.bom))
|
|
42
|
+
implementation(libs.ui)
|
|
43
|
+
implementation(libs.material3)
|
|
44
|
+
implementation(libs.navigation.compose)
|
|
45
|
+
|
|
46
|
+
// DI
|
|
47
|
+
implementation(libs.hilt.android)
|
|
48
|
+
ksp(libs.hilt.compiler)
|
|
49
|
+
|
|
50
|
+
// Room
|
|
51
|
+
implementation(libs.room.runtime)
|
|
52
|
+
ksp(libs.room.compiler)
|
|
53
|
+
|
|
54
|
+
// Networking
|
|
55
|
+
implementation(libs.retrofit)
|
|
56
|
+
implementation(libs.okhttp)
|
|
57
|
+
implementation(libs.gson)
|
|
58
|
+
|
|
59
|
+
// Testing
|
|
60
|
+
testImplementation(libs.junit)
|
|
61
|
+
androidTestImplementation(libs.compose.ui.test)
|
|
62
|
+
```
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Android Testing Rules
|
|
2
|
+
|
|
3
|
+
## Unit Tests
|
|
4
|
+
- Use JUnit 5 + MockK for ViewModel/UseCase/Repository tests
|
|
5
|
+
- Each ViewModel must have a corresponding test file
|
|
6
|
+
- Test Loading → Success → Error state transitions
|
|
7
|
+
- Use `runTest` for coroutine-based ViewModels
|
|
8
|
+
|
|
9
|
+
```kotlin
|
|
10
|
+
@Test
|
|
11
|
+
fun `loadProducts emits loading then success`() = runTest {
|
|
12
|
+
val viewModel = ProductViewModel(mockGetProductsUseCase)
|
|
13
|
+
assertEquals(UiState.Loading, viewModel.uiState.value)
|
|
14
|
+
// ... assertions
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Compose UI Tests
|
|
19
|
+
- Use `createComposeRule()` for Jetpack Compose tests
|
|
20
|
+
- Test user interactions with `performClick()`, `performTextInput()`
|
|
21
|
+
- Test accessibility with `semantics()` assertions
|
|
22
|
+
- Use `onNodeWithText()`, `onNodeWithContentDescription()` for finding elements
|
|
23
|
+
|
|
24
|
+
## Instrumentation Tests
|
|
25
|
+
- Run on emulator or physical device via `./gradlew connectedAndroidTest`
|
|
26
|
+
- Use Espresso for mixed Compose + XML layouts
|
|
27
|
+
- Test navigation flows end-to-end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Agent Orchestration
|
|
2
|
+
|
|
3
|
+
## Available Agents
|
|
4
|
+
|
|
5
|
+
Located in `~/.claude/agents/`:
|
|
6
|
+
|
|
7
|
+
| Agent | Purpose | When to Use |
|
|
8
|
+
|-------|---------|-------------|
|
|
9
|
+
| planner | Implementation planning | Complex features, refactoring |
|
|
10
|
+
| architect | System design | Architectural decisions |
|
|
11
|
+
| tdd-guide | Test-driven development | New features, bug fixes |
|
|
12
|
+
| code-reviewer | Code review | After writing code |
|
|
13
|
+
| security-reviewer | Security analysis | Before commits |
|
|
14
|
+
| build-error-resolver | Fix build errors | When build fails |
|
|
15
|
+
| e2e-runner | E2E testing | Critical user flows |
|
|
16
|
+
| refactor-cleaner | Dead code cleanup | Code maintenance |
|
|
17
|
+
| doc-updater | Documentation | Updating docs |
|
|
18
|
+
|
|
19
|
+
## Immediate Agent Usage
|
|
20
|
+
|
|
21
|
+
No user prompt needed:
|
|
22
|
+
1. Complex feature requests - Use **planner** agent
|
|
23
|
+
2. Code just written/modified - Use **code-reviewer** agent
|
|
24
|
+
3. Bug fix or new feature - Use **tdd-guide** agent
|
|
25
|
+
4. Architectural decision - Use **architect** agent
|
|
26
|
+
|
|
27
|
+
## Parallel Task Execution
|
|
28
|
+
|
|
29
|
+
ALWAYS use parallel Task execution for independent operations:
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
# GOOD: Parallel execution
|
|
33
|
+
Launch 3 agents in parallel:
|
|
34
|
+
1. Agent 1: Security analysis of auth module
|
|
35
|
+
2. Agent 2: Performance review of cache system
|
|
36
|
+
3. Agent 3: Type checking of utilities
|
|
37
|
+
|
|
38
|
+
# BAD: Sequential when unnecessary
|
|
39
|
+
First agent 1, then agent 2, then agent 3
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Multi-Perspective Analysis
|
|
43
|
+
|
|
44
|
+
For complex problems, use split role sub-agents:
|
|
45
|
+
- Factual reviewer
|
|
46
|
+
- Senior engineer
|
|
47
|
+
- Security expert
|
|
48
|
+
- Consistency reviewer
|
|
49
|
+
- Redundancy checker
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Coding Style
|
|
2
|
+
|
|
3
|
+
## Immutability (CRITICAL)
|
|
4
|
+
|
|
5
|
+
ALWAYS create new objects, NEVER mutate existing ones:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
// Pseudocode
|
|
9
|
+
WRONG: modify(original, field, value) → changes original in-place
|
|
10
|
+
CORRECT: update(original, field, value) → returns new copy with change
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Rationale: Immutable data prevents hidden side effects, makes debugging easier, and enables safe concurrency.
|
|
14
|
+
|
|
15
|
+
## File Organization
|
|
16
|
+
|
|
17
|
+
MANY SMALL FILES > FEW LARGE FILES:
|
|
18
|
+
- High cohesion, low coupling
|
|
19
|
+
- 200-400 lines typical, 800 max
|
|
20
|
+
- Extract utilities from large modules
|
|
21
|
+
- Organize by feature/domain, not by type
|
|
22
|
+
|
|
23
|
+
## Error Handling
|
|
24
|
+
|
|
25
|
+
ALWAYS handle errors comprehensively:
|
|
26
|
+
- Handle errors explicitly at every level
|
|
27
|
+
- Provide user-friendly error messages in UI-facing code
|
|
28
|
+
- Log detailed error context on the server side
|
|
29
|
+
- Never silently swallow errors
|
|
30
|
+
|
|
31
|
+
## Input Validation
|
|
32
|
+
|
|
33
|
+
ALWAYS validate at system boundaries:
|
|
34
|
+
- Validate all user input before processing
|
|
35
|
+
- Use schema-based validation where available
|
|
36
|
+
- Fail fast with clear error messages
|
|
37
|
+
- Never trust external data (API responses, user input, file content)
|
|
38
|
+
|
|
39
|
+
## Code Quality Checklist
|
|
40
|
+
|
|
41
|
+
Before marking work complete:
|
|
42
|
+
- [ ] Code is readable and well-named
|
|
43
|
+
- [ ] Functions are small (<50 lines)
|
|
44
|
+
- [ ] Files are focused (<800 lines)
|
|
45
|
+
- [ ] No deep nesting (>4 levels)
|
|
46
|
+
- [ ] Proper error handling
|
|
47
|
+
- [ ] No hardcoded values (use constants or config)
|
|
48
|
+
- [ ] No mutation (immutable patterns used)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Git Workflow
|
|
2
|
+
|
|
3
|
+
## Commit Message Format
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
<type>: <description>
|
|
7
|
+
|
|
8
|
+
<optional body>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Types: feat, fix, refactor, docs, test, chore, perf, ci
|
|
12
|
+
|
|
13
|
+
Note: Attribution disabled globally via ~/.claude/settings.json.
|
|
14
|
+
|
|
15
|
+
## Pull Request Workflow
|
|
16
|
+
|
|
17
|
+
When creating PRs:
|
|
18
|
+
1. Analyze full commit history (not just latest commit)
|
|
19
|
+
2. Use `git diff [base-branch]...HEAD` to see all changes
|
|
20
|
+
3. Draft comprehensive PR summary
|
|
21
|
+
4. Include test plan with TODOs
|
|
22
|
+
5. Push with `-u` flag if new branch
|
|
23
|
+
|
|
24
|
+
## Feature Implementation Workflow
|
|
25
|
+
|
|
26
|
+
1. **Plan First**
|
|
27
|
+
- Use **planner** agent to create implementation plan
|
|
28
|
+
- Identify dependencies and risks
|
|
29
|
+
- Break down into phases
|
|
30
|
+
|
|
31
|
+
2. **TDD Approach**
|
|
32
|
+
- Use **tdd-guide** agent
|
|
33
|
+
- Write tests first (RED)
|
|
34
|
+
- Implement to pass tests (GREEN)
|
|
35
|
+
- Refactor (IMPROVE)
|
|
36
|
+
- Verify 80%+ coverage
|
|
37
|
+
|
|
38
|
+
3. **Code Review**
|
|
39
|
+
- Use **code-reviewer** agent immediately after writing code
|
|
40
|
+
- Address CRITICAL and HIGH issues
|
|
41
|
+
- Fix MEDIUM issues when possible
|
|
42
|
+
|
|
43
|
+
4. **Commit & Push**
|
|
44
|
+
- Detailed commit messages
|
|
45
|
+
- Follow conventional commits format
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Hooks System
|
|
2
|
+
|
|
3
|
+
## Hook Types
|
|
4
|
+
|
|
5
|
+
- **PreToolUse**: Before tool execution (validation, parameter modification)
|
|
6
|
+
- **PostToolUse**: After tool execution (auto-format, checks)
|
|
7
|
+
- **Stop**: When session ends (final verification)
|
|
8
|
+
|
|
9
|
+
## Auto-Accept Permissions
|
|
10
|
+
|
|
11
|
+
Use with caution:
|
|
12
|
+
- Enable for trusted, well-defined plans
|
|
13
|
+
- Disable for exploratory work
|
|
14
|
+
- Never use dangerously-skip-permissions flag
|
|
15
|
+
- Configure `allowedTools` in `~/.claude.json` instead
|
|
16
|
+
|
|
17
|
+
## TodoWrite Best Practices
|
|
18
|
+
|
|
19
|
+
Use TodoWrite tool to:
|
|
20
|
+
- Track progress on multi-step tasks
|
|
21
|
+
- Verify understanding of instructions
|
|
22
|
+
- Enable real-time steering
|
|
23
|
+
- Show granular implementation steps
|
|
24
|
+
|
|
25
|
+
Todo list reveals:
|
|
26
|
+
- Out of order steps
|
|
27
|
+
- Missing items
|
|
28
|
+
- Extra unnecessary items
|
|
29
|
+
- Wrong granularity
|
|
30
|
+
- Misinterpreted requirements
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Common Patterns
|
|
2
|
+
|
|
3
|
+
## Skeleton Projects
|
|
4
|
+
|
|
5
|
+
When implementing new functionality:
|
|
6
|
+
1. Search for battle-tested skeleton projects
|
|
7
|
+
2. Use parallel agents to evaluate options:
|
|
8
|
+
- Security assessment
|
|
9
|
+
- Extensibility analysis
|
|
10
|
+
- Relevance scoring
|
|
11
|
+
- Implementation planning
|
|
12
|
+
3. Clone best match as foundation
|
|
13
|
+
4. Iterate within proven structure
|
|
14
|
+
|
|
15
|
+
## Design Patterns
|
|
16
|
+
|
|
17
|
+
### Repository Pattern
|
|
18
|
+
|
|
19
|
+
Encapsulate data access behind a consistent interface:
|
|
20
|
+
- Define standard operations: findAll, findById, create, update, delete
|
|
21
|
+
- Concrete implementations handle storage details (database, API, file, etc.)
|
|
22
|
+
- Business logic depends on the abstract interface, not the storage mechanism
|
|
23
|
+
- Enables easy swapping of data sources and simplifies testing with mocks
|
|
24
|
+
|
|
25
|
+
### API Response Format
|
|
26
|
+
|
|
27
|
+
Use a consistent envelope for all API responses:
|
|
28
|
+
- Include a success/status indicator
|
|
29
|
+
- Include the data payload (nullable on error)
|
|
30
|
+
- Include an error message field (nullable on success)
|
|
31
|
+
- Include metadata for paginated responses (total, page, limit)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Performance Optimization
|
|
2
|
+
|
|
3
|
+
## Model Selection Strategy
|
|
4
|
+
|
|
5
|
+
**Haiku 4.5** (90% of Sonnet capability, 3x cost savings):
|
|
6
|
+
- Lightweight agents with frequent invocation
|
|
7
|
+
- Pair programming and code generation
|
|
8
|
+
- Worker agents in multi-agent systems
|
|
9
|
+
|
|
10
|
+
**Sonnet 4.5** (Best coding model):
|
|
11
|
+
- Main development work
|
|
12
|
+
- Orchestrating multi-agent workflows
|
|
13
|
+
- Complex coding tasks
|
|
14
|
+
|
|
15
|
+
**Opus 4.5** (Deepest reasoning):
|
|
16
|
+
- Complex architectural decisions
|
|
17
|
+
- Maximum reasoning requirements
|
|
18
|
+
- Research and analysis tasks
|
|
19
|
+
|
|
20
|
+
## Context Window Management
|
|
21
|
+
|
|
22
|
+
Avoid last 20% of context window for:
|
|
23
|
+
- Large-scale refactoring
|
|
24
|
+
- Feature implementation spanning multiple files
|
|
25
|
+
- Debugging complex interactions
|
|
26
|
+
|
|
27
|
+
Lower context sensitivity tasks:
|
|
28
|
+
- Single-file edits
|
|
29
|
+
- Independent utility creation
|
|
30
|
+
- Documentation updates
|
|
31
|
+
- Simple bug fixes
|
|
32
|
+
|
|
33
|
+
## Extended Thinking + Plan Mode
|
|
34
|
+
|
|
35
|
+
Extended thinking is enabled by default, reserving up to 31,999 tokens for internal reasoning.
|
|
36
|
+
|
|
37
|
+
Control extended thinking via:
|
|
38
|
+
- **Toggle**: Option+T (macOS) / Alt+T (Windows/Linux)
|
|
39
|
+
- **Config**: Set `alwaysThinkingEnabled` in `~/.claude/settings.json`
|
|
40
|
+
- **Budget cap**: `export MAX_THINKING_TOKENS=10000`
|
|
41
|
+
- **Verbose mode**: Ctrl+O to see thinking output
|
|
42
|
+
|
|
43
|
+
For complex tasks requiring deep reasoning:
|
|
44
|
+
1. Ensure extended thinking is enabled (on by default)
|
|
45
|
+
2. Enable **Plan Mode** for structured approach
|
|
46
|
+
3. Use multiple critique rounds for thorough analysis
|
|
47
|
+
4. Use split role sub-agents for diverse perspectives
|
|
48
|
+
|
|
49
|
+
## Build Troubleshooting
|
|
50
|
+
|
|
51
|
+
If build fails:
|
|
52
|
+
1. Use **build-error-resolver** agent
|
|
53
|
+
2. Analyze error messages
|
|
54
|
+
3. Fix incrementally
|
|
55
|
+
4. Verify after each fix
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Security Guidelines
|
|
2
|
+
|
|
3
|
+
## Mandatory Security Checks
|
|
4
|
+
|
|
5
|
+
Before ANY commit:
|
|
6
|
+
- [ ] No hardcoded secrets (API keys, passwords, tokens)
|
|
7
|
+
- [ ] All user inputs validated
|
|
8
|
+
- [ ] SQL injection prevention (parameterized queries)
|
|
9
|
+
- [ ] XSS prevention (sanitized HTML)
|
|
10
|
+
- [ ] CSRF protection enabled
|
|
11
|
+
- [ ] Authentication/authorization verified
|
|
12
|
+
- [ ] Rate limiting on all endpoints
|
|
13
|
+
- [ ] Error messages don't leak sensitive data
|
|
14
|
+
|
|
15
|
+
## Secret Management
|
|
16
|
+
|
|
17
|
+
- NEVER hardcode secrets in source code
|
|
18
|
+
- ALWAYS use environment variables or a secret manager
|
|
19
|
+
- Validate that required secrets are present at startup
|
|
20
|
+
- Rotate any secrets that may have been exposed
|
|
21
|
+
|
|
22
|
+
## Security Response Protocol
|
|
23
|
+
|
|
24
|
+
If security issue found:
|
|
25
|
+
1. STOP immediately
|
|
26
|
+
2. Use **security-reviewer** agent
|
|
27
|
+
3. Fix CRITICAL issues before continuing
|
|
28
|
+
4. Rotate any exposed secrets
|
|
29
|
+
5. Review entire codebase for similar issues
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Testing Requirements
|
|
2
|
+
|
|
3
|
+
## Minimum Test Coverage: 80%
|
|
4
|
+
|
|
5
|
+
Test Types (ALL required):
|
|
6
|
+
1. **Unit Tests** - Individual functions, utilities, components
|
|
7
|
+
2. **Integration Tests** - API endpoints, database operations
|
|
8
|
+
3. **E2E Tests** - Critical user flows (framework chosen per language)
|
|
9
|
+
|
|
10
|
+
## Test-Driven Development
|
|
11
|
+
|
|
12
|
+
MANDATORY workflow:
|
|
13
|
+
1. Write test first (RED)
|
|
14
|
+
2. Run test - it should FAIL
|
|
15
|
+
3. Write minimal implementation (GREEN)
|
|
16
|
+
4. Run test - it should PASS
|
|
17
|
+
5. Refactor (IMPROVE)
|
|
18
|
+
6. Verify coverage (80%+)
|
|
19
|
+
|
|
20
|
+
## Troubleshooting Test Failures
|
|
21
|
+
|
|
22
|
+
1. Use **tdd-guide** agent
|
|
23
|
+
2. Check test isolation
|
|
24
|
+
3. Verify mocks are correct
|
|
25
|
+
4. Fix implementation, not tests (unless tests are wrong)
|
|
26
|
+
|
|
27
|
+
## Agent Support
|
|
28
|
+
|
|
29
|
+
- **tdd-guide** - Use PROACTIVELY for new features, enforces write-tests-first
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Flutter State Management Rules
|
|
2
|
+
|
|
3
|
+
## Choice of Approach
|
|
4
|
+
|
|
5
|
+
| Approach | When to Use |
|
|
6
|
+
|----------|------------|
|
|
7
|
+
| Riverpod | Default for new projects; simpler API, no BuildContext needed |
|
|
8
|
+
| Bloc | Complex apps requiring strict unidirectional data flow |
|
|
9
|
+
| Provider | Legacy projects; not recommended for new apps |
|
|
10
|
+
| ValueNotifier + ListenableBuilder | Trivial local widget state only |
|
|
11
|
+
|
|
12
|
+
## Riverpod Patterns
|
|
13
|
+
|
|
14
|
+
### Provider Scoping
|
|
15
|
+
- Scoped providers via `family` modifier for parameterized repos
|
|
16
|
+
- Use `autoDispose` for ephemeral state (forms, search results)
|
|
17
|
+
- Use `keepAlive` for long-lived services (auth, API clients)
|
|
18
|
+
|
|
19
|
+
```dart
|
|
20
|
+
final productProvider = FutureProvider.family<Product, String>((ref, id) {
|
|
21
|
+
return ref.read(productRepositoryProvider).getProduct(id);
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### State Notifier
|
|
26
|
+
- Extend `AsyncNotifier` for async state with loading/error/data
|
|
27
|
+
- Use `Notifier` for synchronous state
|
|
28
|
+
- Never emit error states manually — let `AsyncNotifier` handle exceptions via `.when()`
|
|
29
|
+
|
|
30
|
+
## Bloc Patterns
|
|
31
|
+
|
|
32
|
+
### Event Design
|
|
33
|
+
- Use sealed classes for events with `const` constructors
|
|
34
|
+
- Events carry only primitive/immutable data
|
|
35
|
+
- One event per action type (avoid overloaded events with nullable fields)
|
|
36
|
+
|
|
37
|
+
### State Design
|
|
38
|
+
- Use sealed classes for states with `const` constructors
|
|
39
|
+
- Include user-friendly error messages in error states
|
|
40
|
+
- Never put mutable objects in state classes
|
|
41
|
+
|
|
42
|
+
### Testing
|
|
43
|
+
```dart
|
|
44
|
+
blocTest<CounterBloc, int>(
|
|
45
|
+
'emits [1] when increment is added',
|
|
46
|
+
build: () => CounterBloc(),
|
|
47
|
+
act: (bloc) => bloc.add(Increment()),
|
|
48
|
+
expect: () => [1],
|
|
49
|
+
);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Anti-Patterns to Avoid
|
|
53
|
+
- ❌ Storing BuildContext in state notifiers
|
|
54
|
+
- ❌ Calling Provider.of/ref.watch outside widget tree
|
|
55
|
+
- ❌ Mixing multiple state management libs in one project
|
|
56
|
+
- ❌ Putting UI-only state (selected tab, text field focus) in global providers
|
|
57
|
+
- ❌ Neglecting `autoDispose` / `close()` leading to memory leaks
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Flutter Testing Rules
|
|
2
|
+
|
|
3
|
+
## Unit Tests
|
|
4
|
+
- Test domain logic (entities, usecases, models) with pure Dart tests
|
|
5
|
+
- Mock dependencies with `mocktail` or `mockito`
|
|
6
|
+
- Test repository implementations with mocked datasources
|
|
7
|
+
- Test Bloc events/states with `bloc_test`:
|
|
8
|
+
```dart
|
|
9
|
+
blocTest<ProductBloc, ProductState>(
|
|
10
|
+
'emits [Loading, Loaded] when products are fetched',
|
|
11
|
+
build: () => ProductBloc(mockRepo),
|
|
12
|
+
act: (bloc) => bloc.add(LoadProducts()),
|
|
13
|
+
expect: () => [ProductLoading(), ProductLoaded(products)],
|
|
14
|
+
);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Widget Tests
|
|
18
|
+
- Use `WidgetTester` with `pumpWidget` and `pumpAndSettle`
|
|
19
|
+
- Verify widget existence with `Finder`:
|
|
20
|
+
- `find.text('Title')` — by text
|
|
21
|
+
- `find.byType(ProductCard)` — by type
|
|
22
|
+
- `find.byKey(Key('product_card'))` — by key
|
|
23
|
+
- Test loading, error, empty, and data states
|
|
24
|
+
- Scroll with `scrollUntilVisible`, `drag`
|
|
25
|
+
|
|
26
|
+
## Integration Tests
|
|
27
|
+
- Use `integration_test` package for full app flows
|
|
28
|
+
- Test critical user paths (login → browse → cart → checkout)
|
|
29
|
+
- Run on emulators and physical devices
|
|
30
|
+
|
|
31
|
+
## Golden Tests
|
|
32
|
+
- Use `golden_toolkit` or `alchemist` for visual regression
|
|
33
|
+
- Snapshot widgets at multiple screen sizes
|
|
34
|
+
- Store goldens in `test/goldens/` directory
|
|
35
|
+
|
|
36
|
+
## Command Reference
|
|
37
|
+
```bash
|
|
38
|
+
flutter test # Run all tests
|
|
39
|
+
flutter test --coverage # With coverage report
|
|
40
|
+
flutter test test/widget/ # Widget tests only
|
|
41
|
+
flutter test --name "product" # Filter by name
|
|
42
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Go Coding Style
|
|
2
|
+
|
|
3
|
+
> This file extends [common/coding-style.md](../common/coding-style.md) with Go specific content.
|
|
4
|
+
|
|
5
|
+
## Formatting
|
|
6
|
+
|
|
7
|
+
- **gofmt** and **goimports** are mandatory — no style debates
|
|
8
|
+
|
|
9
|
+
## Design Principles
|
|
10
|
+
|
|
11
|
+
- Accept interfaces, return structs
|
|
12
|
+
- Keep interfaces small (1-3 methods)
|
|
13
|
+
|
|
14
|
+
## Error Handling
|
|
15
|
+
|
|
16
|
+
Always wrap errors with context:
|
|
17
|
+
|
|
18
|
+
```go
|
|
19
|
+
if err != nil {
|
|
20
|
+
return fmt.Errorf("failed to create user: %w", err)
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Reference
|
|
25
|
+
|
|
26
|
+
See skill: `golang-patterns` for comprehensive Go idioms and patterns.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Go Hooks
|
|
2
|
+
|
|
3
|
+
> This file extends [common/hooks.md](../common/hooks.md) with Go specific content.
|
|
4
|
+
|
|
5
|
+
## PostToolUse Hooks
|
|
6
|
+
|
|
7
|
+
Configure in `~/.claude/settings.json`:
|
|
8
|
+
|
|
9
|
+
- **gofmt/goimports**: Auto-format `.go` files after edit
|
|
10
|
+
- **go vet**: Run static analysis after editing `.go` files
|
|
11
|
+
- **staticcheck**: Run extended static checks on modified packages
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Go Patterns
|
|
2
|
+
|
|
3
|
+
> This file extends [common/patterns.md](../common/patterns.md) with Go specific content.
|
|
4
|
+
|
|
5
|
+
## Functional Options
|
|
6
|
+
|
|
7
|
+
```go
|
|
8
|
+
type Option func(*Server)
|
|
9
|
+
|
|
10
|
+
func WithPort(port int) Option {
|
|
11
|
+
return func(s *Server) { s.port = port }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
func NewServer(opts ...Option) *Server {
|
|
15
|
+
s := &Server{port: 8080}
|
|
16
|
+
for _, opt := range opts {
|
|
17
|
+
opt(s)
|
|
18
|
+
}
|
|
19
|
+
return s
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Small Interfaces
|
|
24
|
+
|
|
25
|
+
Define interfaces where they are used, not where they are implemented.
|
|
26
|
+
|
|
27
|
+
## Dependency Injection
|
|
28
|
+
|
|
29
|
+
Use constructor functions to inject dependencies:
|
|
30
|
+
|
|
31
|
+
```go
|
|
32
|
+
func NewUserService(repo UserRepository, logger Logger) *UserService {
|
|
33
|
+
return &UserService{repo: repo, logger: logger}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Reference
|
|
38
|
+
|
|
39
|
+
See skill: `golang-patterns` for comprehensive Go patterns including concurrency, error handling, and package organization.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Go Security
|
|
2
|
+
|
|
3
|
+
> This file extends [common/security.md](../common/security.md) with Go specific content.
|
|
4
|
+
|
|
5
|
+
## Secret Management
|
|
6
|
+
|
|
7
|
+
```go
|
|
8
|
+
apiKey := os.Getenv("OPENAI_API_KEY")
|
|
9
|
+
if apiKey == "" {
|
|
10
|
+
log.Fatal("OPENAI_API_KEY not configured")
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Security Scanning
|
|
15
|
+
|
|
16
|
+
- Use **gosec** for static security analysis:
|
|
17
|
+
```bash
|
|
18
|
+
gosec ./...
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Context & Timeouts
|
|
22
|
+
|
|
23
|
+
Always use `context.Context` for timeout control:
|
|
24
|
+
|
|
25
|
+
```go
|
|
26
|
+
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
|
|
27
|
+
defer cancel()
|
|
28
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Go Testing
|
|
2
|
+
|
|
3
|
+
> This file extends [common/testing.md](../common/testing.md) with Go specific content.
|
|
4
|
+
|
|
5
|
+
## Framework
|
|
6
|
+
|
|
7
|
+
Use the standard `go test` with **table-driven tests**.
|
|
8
|
+
|
|
9
|
+
## Race Detection
|
|
10
|
+
|
|
11
|
+
Always run with the `-race` flag:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
go test -race ./...
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Coverage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
go test -cover ./...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Reference
|
|
24
|
+
|
|
25
|
+
See skill: `golang-testing` for detailed Go testing patterns and helpers.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Mobile Performance Rules
|
|
2
|
+
|
|
3
|
+
## App Startup
|
|
4
|
+
- Avoid synchronous initialization on main thread
|
|
5
|
+
- Use `SplashScreen` (Android) / launch screen (iOS/Flutter) while warming cache
|
|
6
|
+
- Lazy-initialize non-critical services
|
|
7
|
+
- Profile startup with Android Studio Profiler / Flutter DevTools
|
|
8
|
+
|
|
9
|
+
## Rendering Performance
|
|
10
|
+
- Keep widget tree shallow — avoid unnecessary nesting
|
|
11
|
+
- Use `const` constructors wherever possible
|
|
12
|
+
- Wrap expensive widgets in `RepaintBoundary`
|
|
13
|
+
- Use `ListView.builder` / `GridView.builder` for large lists
|
|
14
|
+
- Avoid `Opacity` and `ClipRect` in scrollables — prefer `AnimatedOpacity` with `visible:`
|
|
15
|
+
|
|
16
|
+
## Memory Management
|
|
17
|
+
- Dispose controllers, streams, subscriptions in `dispose()`
|
|
18
|
+
- Use `cached_network_image` for remote images
|
|
19
|
+
- Clear `ImageCache` when memory warning received
|
|
20
|
+
- Avoid retaining large Bitmaps in Activity/Fragment references
|
|
21
|
+
- Use `WeakReference` for long-lived caches
|
|
22
|
+
|
|
23
|
+
## Battery & Network
|
|
24
|
+
- Batch network requests with `connectivity_plus` checks
|
|
25
|
+
- Use `WorkManager` (Android) for deferrable background work
|
|
26
|
+
- Compress images server-side; never resize large bitmaps on-device
|
|
27
|
+
- Implement caching with `Room` (Android) / `Hive` (Flutter)
|
|
28
|
+
- Use `ETag` / `If-Modified-Since` headers for HTTP caching
|
|
29
|
+
|
|
30
|
+
## Tooling
|
|
31
|
+
```bash
|
|
32
|
+
flutter run --profile # Profile mode with DevTools
|
|
33
|
+
flutter run --release # Release mode for final perf testing
|
|
34
|
+
flutter build apk --split-per-abi # Smaller APK per architecture
|
|
35
|
+
./gradlew assembleRelease --stats # Android build stats
|
|
36
|
+
```
|