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,26 @@
|
|
|
1
|
+
# Research Context
|
|
2
|
+
|
|
3
|
+
Mode: Exploration, investigation, learning
|
|
4
|
+
Focus: Understanding before acting
|
|
5
|
+
|
|
6
|
+
## Behavior
|
|
7
|
+
- Read widely before concluding
|
|
8
|
+
- Ask clarifying questions
|
|
9
|
+
- Document findings as you go
|
|
10
|
+
- Don't write code until understanding is clear
|
|
11
|
+
|
|
12
|
+
## Research Process
|
|
13
|
+
1. Understand the question
|
|
14
|
+
2. Explore relevant code/docs
|
|
15
|
+
3. Form hypothesis
|
|
16
|
+
4. Verify with evidence
|
|
17
|
+
5. Summarize findings
|
|
18
|
+
|
|
19
|
+
## Tools to favor
|
|
20
|
+
- Read for understanding code
|
|
21
|
+
- Grep, Glob for finding patterns
|
|
22
|
+
- WebSearch, WebFetch for external docs
|
|
23
|
+
- Task with Explore agent for codebase questions
|
|
24
|
+
|
|
25
|
+
## Output
|
|
26
|
+
Findings first, recommendations second
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Code Review Context
|
|
2
|
+
|
|
3
|
+
Mode: PR review, code analysis
|
|
4
|
+
Focus: Quality, security, maintainability
|
|
5
|
+
|
|
6
|
+
## Behavior
|
|
7
|
+
- Read thoroughly before commenting
|
|
8
|
+
- Prioritize issues by severity (critical > high > medium > low)
|
|
9
|
+
- Suggest fixes, don't just point out problems
|
|
10
|
+
- Check for security vulnerabilities
|
|
11
|
+
|
|
12
|
+
## Review Checklist
|
|
13
|
+
- [ ] Logic errors
|
|
14
|
+
- [ ] Edge cases
|
|
15
|
+
- [ ] Error handling
|
|
16
|
+
- [ ] Security (injection, auth, secrets)
|
|
17
|
+
- [ ] Performance
|
|
18
|
+
- [ ] Readability
|
|
19
|
+
- [ ] Test coverage
|
|
20
|
+
|
|
21
|
+
## Output Format
|
|
22
|
+
Group findings by file, severity first
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"PreToolUse": [
|
|
5
|
+
{
|
|
6
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(npm run dev|pnpm( run)? dev|yarn dev|bun run dev)\"",
|
|
7
|
+
"hooks": [
|
|
8
|
+
{
|
|
9
|
+
"type": "command",
|
|
10
|
+
"command": "node -e \"console.error('[Hook] BLOCKED: Dev server must run in tmux for log access');console.error('[Hook] Use: tmux new-session -d -s dev \\\"npm run dev\\\"');console.error('[Hook] Then: tmux attach -t dev');process.exit(1)\""
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"description": "Block dev servers outside tmux - ensures you can access logs"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(npm (install|test)|pnpm (install|test)|yarn (install|test)?|bun (install|test)|cargo build|make|docker|pytest|vitest|playwright)\"",
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "node -e \"if(!process.env.TMUX){console.error('[Hook] Consider running in tmux for session persistence');console.error('[Hook] tmux new -s dev | tmux attach -t dev')}\""
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"description": "Reminder to use tmux for long-running commands"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"git push\"",
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "node -e \"console.error('[Hook] Review changes before push...');console.error('[Hook] Continuing with push (remove this hook to add interactive review)')\""
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"description": "Reminder before git push to review changes"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"matcher": "tool == \"Write\" && tool_input.file_path matches \"\\\\.(md|txt)$\" && !(tool_input.file_path matches \"README\\\\.md|CLAUDE\\\\.md|AGENTS\\\\.md|CONTRIBUTING\\\\.md\")",
|
|
37
|
+
"hooks": [
|
|
38
|
+
{
|
|
39
|
+
"type": "command",
|
|
40
|
+
"command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';if(/\\.(md|txt)$/.test(p)&&!/(README|CLAUDE|AGENTS|CONTRIBUTING)\\.md$/.test(p)){console.error('[Hook] BLOCKED: Unnecessary documentation file creation');console.error('[Hook] File: '+p);console.error('[Hook] Use README.md for documentation instead');process.exit(1)}console.log(d)})\""
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"description": "Block creation of random .md files - keeps docs consolidated"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"matcher": "tool == \"Edit\" || tool == \"Write\"",
|
|
47
|
+
"hooks": [
|
|
48
|
+
{
|
|
49
|
+
"type": "command",
|
|
50
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/suggest-compact.js\""
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"description": "Suggest manual compaction at logical intervals"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"PreCompact": [
|
|
57
|
+
{
|
|
58
|
+
"matcher": "*",
|
|
59
|
+
"hooks": [
|
|
60
|
+
{
|
|
61
|
+
"type": "command",
|
|
62
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/pre-compact.js\""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"description": "Save state before context compaction"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"SessionStart": [
|
|
69
|
+
{
|
|
70
|
+
"matcher": "*",
|
|
71
|
+
"hooks": [
|
|
72
|
+
{
|
|
73
|
+
"type": "command",
|
|
74
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-start.js\""
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"description": "Load previous context and detect package manager on new session"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"PostToolUse": [
|
|
81
|
+
{
|
|
82
|
+
"matcher": "tool == \"Bash\"",
|
|
83
|
+
"hooks": [
|
|
84
|
+
{
|
|
85
|
+
"type": "command",
|
|
86
|
+
"command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const cmd=i.tool_input?.command||'';if(/gh pr create/.test(cmd)){const out=i.tool_output?.output||'';const m=out.match(/https:\\/\\/github.com\\/[^/]+\\/[^/]+\\/pull\\/\\d+/);if(m){console.error('[Hook] PR created: '+m[0]);const repo=m[0].replace(/https:\\/\\/github.com\\/([^/]+\\/[^/]+)\\/pull\\/\\d+/,'$1');const pr=m[0].replace(/.*\\/pull\\/(\\d+)/,'$1');console.error('[Hook] To review: gh pr review '+pr+' --repo '+repo)}}console.log(d)})\""
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"description": "Log PR URL and provide review command after PR creation"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"matcher": "tool == \"Bash\" && tool_input.command matches \"(npm run build|pnpm build|yarn build)\"",
|
|
93
|
+
"hooks": [
|
|
94
|
+
{
|
|
95
|
+
"type": "command",
|
|
96
|
+
"command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{console.error('[Hook] Build completed - async analysis running in background');console.log(d)})\"",
|
|
97
|
+
"async": true,
|
|
98
|
+
"timeout": 30
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"description": "Example: async hook for build analysis (runs in background without blocking)"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
|
|
105
|
+
"hooks": [
|
|
106
|
+
{
|
|
107
|
+
"type": "command",
|
|
108
|
+
"command": "node -e \"const{execFileSync}=require('child_process');const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path;if(p&&fs.existsSync(p)){try{execFileSync('npx',['prettier','--write',p],{stdio:['pipe','pipe','pipe']})}catch(e){}}console.log(d)})\""
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
"description": "Auto-format JS/TS files with Prettier after edits"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx)$\"",
|
|
115
|
+
"hooks": [
|
|
116
|
+
{
|
|
117
|
+
"type": "command",
|
|
118
|
+
"command": "node -e \"const{execSync}=require('child_process');const fs=require('fs');const path=require('path');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path;if(p&&fs.existsSync(p)){let dir=path.dirname(p);while(dir!==path.dirname(dir)&&!fs.existsSync(path.join(dir,'tsconfig.json'))){dir=path.dirname(dir)}if(fs.existsSync(path.join(dir,'tsconfig.json'))){try{const r=execSync('npx tsc --noEmit --pretty false 2>&1',{cwd:dir,encoding:'utf8',stdio:['pipe','pipe','pipe']});const lines=r.split('\\n').filter(l=>l.includes(p)).slice(0,10);if(lines.length)console.error(lines.join('\\n'))}catch(e){const lines=(e.stdout||'').split('\\n').filter(l=>l.includes(p)).slice(0,10);if(lines.length)console.error(lines.join('\\n'))}}}console.log(d)})\""
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"description": "TypeScript check after editing .ts/.tsx files"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"matcher": "tool == \"Edit\" && tool_input.file_path matches \"\\\\.(ts|tsx|js|jsx)$\"",
|
|
125
|
+
"hooks": [
|
|
126
|
+
{
|
|
127
|
+
"type": "command",
|
|
128
|
+
"command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const i=JSON.parse(d);const p=i.tool_input?.file_path;if(p&&fs.existsSync(p)){const c=fs.readFileSync(p,'utf8');const lines=c.split('\\n');const matches=[];lines.forEach((l,idx)=>{if(/console\\.log/.test(l))matches.push((idx+1)+': '+l.trim())});if(matches.length){console.error('[Hook] WARNING: console.log found in '+p);matches.slice(0,5).forEach(m=>console.error(m));console.error('[Hook] Remove console.log before committing')}}console.log(d)})\""
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"description": "Warn about console.log statements after edits"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"Stop": [
|
|
135
|
+
{
|
|
136
|
+
"matcher": "*",
|
|
137
|
+
"hooks": [
|
|
138
|
+
{
|
|
139
|
+
"type": "command",
|
|
140
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/check-console-log.js\""
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"description": "Check for console.log in modified files after each response"
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"SessionEnd": [
|
|
147
|
+
{
|
|
148
|
+
"matcher": "*",
|
|
149
|
+
"hooks": [
|
|
150
|
+
{
|
|
151
|
+
"type": "command",
|
|
152
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/session-end.js\""
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"description": "Persist session state on end"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"matcher": "*",
|
|
159
|
+
"hooks": [
|
|
160
|
+
{
|
|
161
|
+
"type": "command",
|
|
162
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/evaluate-session.js\""
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"description": "Evaluate session for extractable patterns"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
# Everything Claude Code - OpenCode Instructions
|
|
2
|
+
|
|
3
|
+
This document consolidates the core rules and guidelines from the Claude Code configuration for use with OpenCode.
|
|
4
|
+
|
|
5
|
+
## Security Guidelines (CRITICAL)
|
|
6
|
+
|
|
7
|
+
### Mandatory Security Checks
|
|
8
|
+
|
|
9
|
+
Before ANY commit:
|
|
10
|
+
- [ ] No hardcoded secrets (API keys, passwords, tokens)
|
|
11
|
+
- [ ] All user inputs validated
|
|
12
|
+
- [ ] SQL injection prevention (parameterized queries)
|
|
13
|
+
- [ ] XSS prevention (sanitized HTML)
|
|
14
|
+
- [ ] CSRF protection enabled
|
|
15
|
+
- [ ] Authentication/authorization verified
|
|
16
|
+
- [ ] Rate limiting on all endpoints
|
|
17
|
+
- [ ] Error messages don't leak sensitive data
|
|
18
|
+
|
|
19
|
+
### Secret Management
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
// NEVER: Hardcoded secrets
|
|
23
|
+
const apiKey = "sk-proj-xxxxx"
|
|
24
|
+
|
|
25
|
+
// ALWAYS: Environment variables
|
|
26
|
+
const apiKey = process.env.OPENAI_API_KEY
|
|
27
|
+
|
|
28
|
+
if (!apiKey) {
|
|
29
|
+
throw new Error('OPENAI_API_KEY not configured')
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Security Response Protocol
|
|
34
|
+
|
|
35
|
+
If security issue found:
|
|
36
|
+
1. STOP immediately
|
|
37
|
+
2. Use **security-reviewer** agent
|
|
38
|
+
3. Fix CRITICAL issues before continuing
|
|
39
|
+
4. Rotate any exposed secrets
|
|
40
|
+
5. Review entire codebase for similar issues
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Coding Style
|
|
45
|
+
|
|
46
|
+
### Immutability (CRITICAL)
|
|
47
|
+
|
|
48
|
+
ALWAYS create new objects, NEVER mutate:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
// WRONG: Mutation
|
|
52
|
+
function updateUser(user, name) {
|
|
53
|
+
user.name = name // MUTATION!
|
|
54
|
+
return user
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// CORRECT: Immutability
|
|
58
|
+
function updateUser(user, name) {
|
|
59
|
+
return {
|
|
60
|
+
...user,
|
|
61
|
+
name
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### File Organization
|
|
67
|
+
|
|
68
|
+
MANY SMALL FILES > FEW LARGE FILES:
|
|
69
|
+
- High cohesion, low coupling
|
|
70
|
+
- 200-400 lines typical, 800 max
|
|
71
|
+
- Extract utilities from large components
|
|
72
|
+
- Organize by feature/domain, not by type
|
|
73
|
+
|
|
74
|
+
### Error Handling
|
|
75
|
+
|
|
76
|
+
ALWAYS handle errors comprehensively:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
try {
|
|
80
|
+
const result = await riskyOperation()
|
|
81
|
+
return result
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('Operation failed:', error)
|
|
84
|
+
throw new Error('Detailed user-friendly message')
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Input Validation
|
|
89
|
+
|
|
90
|
+
ALWAYS validate user input:
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
import { z } from 'zod'
|
|
94
|
+
|
|
95
|
+
const schema = z.object({
|
|
96
|
+
email: z.string().email(),
|
|
97
|
+
age: z.number().int().min(0).max(150)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const validated = schema.parse(input)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Code Quality Checklist
|
|
104
|
+
|
|
105
|
+
Before marking work complete:
|
|
106
|
+
- [ ] Code is readable and well-named
|
|
107
|
+
- [ ] Functions are small (<50 lines)
|
|
108
|
+
- [ ] Files are focused (<800 lines)
|
|
109
|
+
- [ ] No deep nesting (>4 levels)
|
|
110
|
+
- [ ] Proper error handling
|
|
111
|
+
- [ ] No console.log statements
|
|
112
|
+
- [ ] No hardcoded values
|
|
113
|
+
- [ ] No mutation (immutable patterns used)
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Testing Requirements
|
|
118
|
+
|
|
119
|
+
### Minimum Test Coverage: 80%
|
|
120
|
+
|
|
121
|
+
Test Types (ALL required):
|
|
122
|
+
1. **Unit Tests** - Individual functions, utilities, components
|
|
123
|
+
2. **Integration Tests** - API endpoints, database operations
|
|
124
|
+
3. **E2E Tests** - Critical user flows (Playwright)
|
|
125
|
+
|
|
126
|
+
### Test-Driven Development
|
|
127
|
+
|
|
128
|
+
MANDATORY workflow:
|
|
129
|
+
1. Write test first (RED)
|
|
130
|
+
2. Run test - it should FAIL
|
|
131
|
+
3. Write minimal implementation (GREEN)
|
|
132
|
+
4. Run test - it should PASS
|
|
133
|
+
5. Refactor (IMPROVE)
|
|
134
|
+
6. Verify coverage (80%+)
|
|
135
|
+
|
|
136
|
+
### Troubleshooting Test Failures
|
|
137
|
+
|
|
138
|
+
1. Use **tdd-guide** agent
|
|
139
|
+
2. Check test isolation
|
|
140
|
+
3. Verify mocks are correct
|
|
141
|
+
4. Fix implementation, not tests (unless tests are wrong)
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Git Workflow
|
|
146
|
+
|
|
147
|
+
### Commit Message Format
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
<type>: <description>
|
|
151
|
+
|
|
152
|
+
<optional body>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Types: feat, fix, refactor, docs, test, chore, perf, ci
|
|
156
|
+
|
|
157
|
+
### Pull Request Workflow
|
|
158
|
+
|
|
159
|
+
When creating PRs:
|
|
160
|
+
1. Analyze full commit history (not just latest commit)
|
|
161
|
+
2. Use `git diff [base-branch]...HEAD` to see all changes
|
|
162
|
+
3. Draft comprehensive PR summary
|
|
163
|
+
4. Include test plan with TODOs
|
|
164
|
+
5. Push with `-u` flag if new branch
|
|
165
|
+
|
|
166
|
+
### Feature Implementation Workflow
|
|
167
|
+
|
|
168
|
+
1. **Plan First**
|
|
169
|
+
- Use **planner** agent to create implementation plan
|
|
170
|
+
- Identify dependencies and risks
|
|
171
|
+
- Break down into phases
|
|
172
|
+
|
|
173
|
+
2. **TDD Approach**
|
|
174
|
+
- Use **tdd-guide** agent
|
|
175
|
+
- Write tests first (RED)
|
|
176
|
+
- Implement to pass tests (GREEN)
|
|
177
|
+
- Refactor (IMPROVE)
|
|
178
|
+
- Verify 80%+ coverage
|
|
179
|
+
|
|
180
|
+
3. **Code Review**
|
|
181
|
+
- Use **code-reviewer** agent immediately after writing code
|
|
182
|
+
- Address CRITICAL and HIGH issues
|
|
183
|
+
- Fix MEDIUM issues when possible
|
|
184
|
+
|
|
185
|
+
4. **Commit & Push**
|
|
186
|
+
- Detailed commit messages
|
|
187
|
+
- Follow conventional commits format
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Agent Orchestration
|
|
192
|
+
|
|
193
|
+
### Available Agents
|
|
194
|
+
|
|
195
|
+
| Agent | Purpose | When to Use |
|
|
196
|
+
|-------|---------|-------------|
|
|
197
|
+
| planner | Implementation planning | Complex features, refactoring |
|
|
198
|
+
| architect | System design | Architectural decisions |
|
|
199
|
+
| tdd-guide | Test-driven development | New features, bug fixes |
|
|
200
|
+
| code-reviewer | Code review | After writing code |
|
|
201
|
+
| security-reviewer | Security analysis | Before commits |
|
|
202
|
+
| build-error-resolver | Fix build errors | When build fails |
|
|
203
|
+
| e2e-runner | E2E testing | Critical user flows |
|
|
204
|
+
| refactor-cleaner | Dead code cleanup | Code maintenance |
|
|
205
|
+
| doc-updater | Documentation | Updating docs |
|
|
206
|
+
| go-reviewer | Go code review | Go projects |
|
|
207
|
+
| go-build-resolver | Go build errors | Go build failures |
|
|
208
|
+
| database-reviewer | Database optimization | SQL, schema design |
|
|
209
|
+
|
|
210
|
+
### Immediate Agent Usage
|
|
211
|
+
|
|
212
|
+
No user prompt needed:
|
|
213
|
+
1. Complex feature requests - Use **planner** agent
|
|
214
|
+
2. Code just written/modified - Use **code-reviewer** agent
|
|
215
|
+
3. Bug fix or new feature - Use **tdd-guide** agent
|
|
216
|
+
4. Architectural decision - Use **architect** agent
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Performance Optimization
|
|
221
|
+
|
|
222
|
+
### Model Selection Strategy
|
|
223
|
+
|
|
224
|
+
**Haiku** (90% of Sonnet capability, 3x cost savings):
|
|
225
|
+
- Lightweight agents with frequent invocation
|
|
226
|
+
- Pair programming and code generation
|
|
227
|
+
- Worker agents in multi-agent systems
|
|
228
|
+
|
|
229
|
+
**Sonnet** (Best coding model):
|
|
230
|
+
- Main development work
|
|
231
|
+
- Orchestrating multi-agent workflows
|
|
232
|
+
- Complex coding tasks
|
|
233
|
+
|
|
234
|
+
**Opus** (Deepest reasoning):
|
|
235
|
+
- Complex architectural decisions
|
|
236
|
+
- Maximum reasoning requirements
|
|
237
|
+
- Research and analysis tasks
|
|
238
|
+
|
|
239
|
+
### Context Window Management
|
|
240
|
+
|
|
241
|
+
Avoid last 20% of context window for:
|
|
242
|
+
- Large-scale refactoring
|
|
243
|
+
- Feature implementation spanning multiple files
|
|
244
|
+
- Debugging complex interactions
|
|
245
|
+
|
|
246
|
+
### Build Troubleshooting
|
|
247
|
+
|
|
248
|
+
If build fails:
|
|
249
|
+
1. Use **build-error-resolver** agent
|
|
250
|
+
2. Analyze error messages
|
|
251
|
+
3. Fix incrementally
|
|
252
|
+
4. Verify after each fix
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Common Patterns
|
|
257
|
+
|
|
258
|
+
### API Response Format
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
interface ApiResponse<T> {
|
|
262
|
+
success: boolean
|
|
263
|
+
data?: T
|
|
264
|
+
error?: string
|
|
265
|
+
meta?: {
|
|
266
|
+
total: number
|
|
267
|
+
page: number
|
|
268
|
+
limit: number
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Composable Pattern (Vue/Nuxt)
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
export function useDebounce<T>(value: Ref<T>, delay: number): Readonly<Ref<T>> {
|
|
277
|
+
const debouncedValue = ref<T>(value.value) as Ref<T>
|
|
278
|
+
|
|
279
|
+
watch(value, () => {
|
|
280
|
+
const handler = setTimeout(() => {
|
|
281
|
+
debouncedValue.value = value.value
|
|
282
|
+
}, delay)
|
|
283
|
+
|
|
284
|
+
onScopeDispose(() => clearTimeout(handler))
|
|
285
|
+
})
|
|
286
|
+
|
|
287
|
+
return readonly(debouncedValue)
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Repository Pattern
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
interface Repository<T> {
|
|
295
|
+
findAll(filters?: Filters): Promise<T[]>
|
|
296
|
+
findById(id: string): Promise<T | null>
|
|
297
|
+
create(data: CreateDto): Promise<T>
|
|
298
|
+
update(id: string, data: UpdateDto): Promise<T>
|
|
299
|
+
delete(id: string): Promise<void>
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## OpenCode-Specific Notes
|
|
306
|
+
|
|
307
|
+
Since OpenCode does not support hooks, the following actions that were automated in Claude Code must be done manually:
|
|
308
|
+
|
|
309
|
+
### After Writing/Editing Code
|
|
310
|
+
- Run `prettier --write <file>` to format JS/TS files
|
|
311
|
+
- Run `npx tsc --noEmit` to check for TypeScript errors
|
|
312
|
+
- Check for console.log statements and remove them
|
|
313
|
+
|
|
314
|
+
### Before Committing
|
|
315
|
+
- Run security checks manually
|
|
316
|
+
- Verify no secrets in code
|
|
317
|
+
- Run full test suite
|
|
318
|
+
|
|
319
|
+
### Commands Available
|
|
320
|
+
|
|
321
|
+
Use these commands in OpenCode:
|
|
322
|
+
- `/plan` - Create implementation plan
|
|
323
|
+
- `/tdd` - Enforce TDD workflow
|
|
324
|
+
- `/code-review` - Review code changes
|
|
325
|
+
- `/security` - Run security review
|
|
326
|
+
- `/build-fix` - Fix build errors
|
|
327
|
+
- `/e2e` - Generate E2E tests
|
|
328
|
+
- `/refactor-clean` - Remove dead code
|
|
329
|
+
- `/orchestrate` - Multi-agent workflow
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Mobile Development
|
|
334
|
+
|
|
335
|
+
### Android (Kotlin / Jetpack Compose)
|
|
336
|
+
|
|
337
|
+
**Default Stack:**
|
|
338
|
+
- Kotlin, Jetpack Compose, Material Design 3, XML, Gradle KTS (version catalog)
|
|
339
|
+
- Hilt for DI, Room for local DB, Retrofit + OkHttp for networking
|
|
340
|
+
- Jetpack Navigation Compose, WorkManager
|
|
341
|
+
|
|
342
|
+
**Build Commands:**
|
|
343
|
+
```bash
|
|
344
|
+
./gradlew assembleDebug # Debug build
|
|
345
|
+
./gradlew assembleRelease # Release APK
|
|
346
|
+
./gradlew bundleRelease # Play Store AAB
|
|
347
|
+
./gradlew test # Unit tests
|
|
348
|
+
./gradlew connectedAndroidTest # Instrumented tests
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Play Store Publishing (via GPC):**
|
|
352
|
+
1. `gpc preflight <aab>` — Compliance check
|
|
353
|
+
2. `gpc publish --track internal` — Upload to internal track
|
|
354
|
+
3. `gpc release promote --from internal --to production` — Promote
|
|
355
|
+
|
|
356
|
+
### Flutter (Dart / Flutter SDK)
|
|
357
|
+
|
|
358
|
+
**Default Stack:**
|
|
359
|
+
- Dart, Flutter SDK, Material Design 3, Cupertino
|
|
360
|
+
- Bloc or Riverpod for state management
|
|
361
|
+
- GoRouter for routing, Dio for networking
|
|
362
|
+
- Hive/Isar/Drift for local storage
|
|
363
|
+
|
|
364
|
+
**Build Commands:**
|
|
365
|
+
```bash
|
|
366
|
+
flutter pub get # Install dependencies
|
|
367
|
+
flutter build apk # Android APK
|
|
368
|
+
flutter build appbundle # Android AAB
|
|
369
|
+
flutter build ios # iOS
|
|
370
|
+
flutter test # Run tests (unit + widget)
|
|
371
|
+
flutter test --coverage # With coverage
|
|
372
|
+
flutter analyze # Static analysis
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
**Testing Strategy:**
|
|
376
|
+
1. Unit tests — Domain logic, entities, usecases (flutter_test, mocktail)
|
|
377
|
+
2. Widget tests — UI components, states, interactions (WidgetTester)
|
|
378
|
+
3. Integration tests — Full user flows (integration_test package)
|
|
379
|
+
4. Golden tests — Visual regression (golden_toolkit, alchemist)
|
|
380
|
+
|
|
381
|
+
## Success Metrics
|
|
382
|
+
|
|
383
|
+
You are successful when:
|
|
384
|
+
- All tests pass (80%+ coverage)
|
|
385
|
+
- No security vulnerabilities
|
|
386
|
+
- Code is readable and maintainable
|
|
387
|
+
- Performance is acceptable
|
|
388
|
+
- User requirements are met
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Rules
|
|
2
|
+
|
|
3
|
+
## Structure
|
|
4
|
+
|
|
5
|
+
Rules are organized into a **common** layer plus **language-specific** directories:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
rules/
|
|
9
|
+
├── common/ # Language-agnostic principles (always install)
|
|
10
|
+
│ ├── coding-style.md
|
|
11
|
+
│ ├── git-workflow.md
|
|
12
|
+
│ ├── testing.md
|
|
13
|
+
│ ├── performance.md
|
|
14
|
+
│ ├── patterns.md
|
|
15
|
+
│ ├── hooks.md
|
|
16
|
+
│ ├── agents.md
|
|
17
|
+
│ └── security.md
|
|
18
|
+
├── typescript/ # TypeScript/JavaScript specific
|
|
19
|
+
├── python/ # Python specific
|
|
20
|
+
└── golang/ # Go specific
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- **common/** contains universal principles — no language-specific code examples.
|
|
24
|
+
- **Language directories** extend the common rules with framework-specific patterns, tools, and code examples. Each file references its common counterpart.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### Option 1: Install Script (Recommended)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Install common + one or more language-specific rule sets
|
|
32
|
+
./install.sh typescript
|
|
33
|
+
./install.sh python
|
|
34
|
+
./install.sh golang
|
|
35
|
+
|
|
36
|
+
# Install multiple languages at once
|
|
37
|
+
./install.sh typescript python
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Option 2: Manual Installation
|
|
41
|
+
|
|
42
|
+
> **Important:** Copy entire directories — do NOT flatten with `/*`.
|
|
43
|
+
> Common and language-specific directories contain files with the same names.
|
|
44
|
+
> Flattening them into one directory causes language-specific files to overwrite
|
|
45
|
+
> common rules, and breaks the relative `../common/` references used by
|
|
46
|
+
> language-specific files.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Install common rules (required for all projects)
|
|
50
|
+
cp -r rules/common ~/.claude/rules/common
|
|
51
|
+
|
|
52
|
+
# Install language-specific rules based on your project's tech stack
|
|
53
|
+
cp -r rules/typescript ~/.claude/rules/typescript
|
|
54
|
+
cp -r rules/python ~/.claude/rules/python
|
|
55
|
+
cp -r rules/golang ~/.claude/rules/golang
|
|
56
|
+
|
|
57
|
+
# Attention ! ! ! Configure according to your actual project requirements; the configuration here is for reference only.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Rules vs Skills
|
|
61
|
+
|
|
62
|
+
- **Rules** define standards, conventions, and checklists that apply broadly (e.g., "80% test coverage", "no hardcoded secrets").
|
|
63
|
+
- **Skills** (`skills/` directory) provide deep, actionable reference material for specific tasks (e.g., `python-patterns`, `golang-testing`).
|
|
64
|
+
|
|
65
|
+
Language-specific rule files reference relevant skills where appropriate. Rules tell you *what* to do; skills tell you *how* to do it.
|
|
66
|
+
|
|
67
|
+
## Adding a New Language
|
|
68
|
+
|
|
69
|
+
To add support for a new language (e.g., `rust/`):
|
|
70
|
+
|
|
71
|
+
1. Create a `rules/rust/` directory
|
|
72
|
+
2. Add files that extend the common rules:
|
|
73
|
+
- `coding-style.md` — formatting tools, idioms, error handling patterns
|
|
74
|
+
- `testing.md` — test framework, coverage tools, test organization
|
|
75
|
+
- `patterns.md` — language-specific design patterns
|
|
76
|
+
- `hooks.md` — PostToolUse hooks for formatters, linters, type checkers
|
|
77
|
+
- `security.md` — secret management, security scanning tools
|
|
78
|
+
3. Each file should start with:
|
|
79
|
+
```
|
|
80
|
+
> This file extends [common/xxx.md](../common/xxx.md) with <Language> specific content.
|
|
81
|
+
```
|
|
82
|
+
4. Reference existing skills if available, or create new ones under `skills/`.
|