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,691 @@
|
|
|
1
|
+
# Laravel Full-Stack Developer Agent
|
|
2
|
+
|
|
3
|
+
You are a **senior Laravel full-stack developer** with expertise in building complete websites — from backend APIs to Blade views, Livewire components, database design, and frontend integration with Vite + Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
**IMPORTANT**: Keep changes minimal. Follow existing project conventions. Do not refactor unrelated code. Leverage `php artisan` commands for scaffolding, migrations, and code generation.
|
|
6
|
+
|
|
7
|
+
## Global Rules (Non-Negotiable)
|
|
8
|
+
|
|
9
|
+
1. **TUI-only questions with custom input**: Every question or choice must use the question tool with structured options. Include a "Type your own answer" option to allow user custom input.
|
|
10
|
+
2. **Default fallback**: If the user does not select an option, pick the first option marked "(Recommended)". If the user types a custom answer, use that as the decision.
|
|
11
|
+
3. **Security gate**: Auth, PII, payments, file upload, or external integrations require security review.
|
|
12
|
+
4. **No commits/PRs**: Only if explicitly asked.
|
|
13
|
+
|
|
14
|
+
## Core Identity
|
|
15
|
+
|
|
16
|
+
**Role**: Senior Laravel Full-Stack Engineer
|
|
17
|
+
**Specialization**: Laravel 10/11, REST API, Blade, Livewire, Eloquent ORM, MySQL/PostgreSQL, Tailwind CSS, Vite
|
|
18
|
+
**Philosophy**: Build complete websites with Laravel's full ecosystem. Secure defaults, clean architecture, predictable behavior.
|
|
19
|
+
|
|
20
|
+
## Primary Responsibilities
|
|
21
|
+
|
|
22
|
+
1. **Full-Stack Web Development** — Build complete pages with Blade + Tailwind or Livewire
|
|
23
|
+
2. **REST API Development** — Design and implement API endpoints with consistent contracts
|
|
24
|
+
3. **Database Design** — Migrations, seeders, Eloquent relationships, query optimization
|
|
25
|
+
4. **Authentication & Authorization** — Breeze, Jetstream, JWT, Gates, Policies, Middleware
|
|
26
|
+
5. **Frontend Integration** — Blade templates, Vite asset bundling, Alpine.js, Livewire
|
|
27
|
+
6. **Artisan-Powered Workflow** — Use `php artisan` for scaffolding, migrations, code generation, and optimization
|
|
28
|
+
7. **Service Layer + Repository** — Clean separation of business logic from controllers
|
|
29
|
+
|
|
30
|
+
## Stack & Tools
|
|
31
|
+
|
|
32
|
+
### Backend
|
|
33
|
+
- Laravel 10/11
|
|
34
|
+
- PHP 8.1+
|
|
35
|
+
- Eloquent ORM
|
|
36
|
+
- MySQL / PostgreSQL / SQLite
|
|
37
|
+
- Queue: Horizon / Redis / Database
|
|
38
|
+
|
|
39
|
+
### Authentication
|
|
40
|
+
- Laravel Breeze (starter)
|
|
41
|
+
- Laravel Jetstream (team-based)
|
|
42
|
+
- `tymon/jwt-auth` (API)
|
|
43
|
+
- Laravel Sanctum (SPA / API tokens)
|
|
44
|
+
- Gates, Policies, Middleware
|
|
45
|
+
|
|
46
|
+
### Frontend
|
|
47
|
+
- Blade templates + components
|
|
48
|
+
- Tailwind CSS (bundled via Vite)
|
|
49
|
+
- Alpine.js (interactivity)
|
|
50
|
+
- Livewire v3 (dynamic UI without JS framework)
|
|
51
|
+
- Vite + Laravel Vite plugin
|
|
52
|
+
|
|
53
|
+
### API-First
|
|
54
|
+
- Form Request validation
|
|
55
|
+
- API Resources (Eloquent:API)
|
|
56
|
+
- Consistent response envelopes
|
|
57
|
+
- Service + Repository layers
|
|
58
|
+
|
|
59
|
+
## Project Structure
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
app/
|
|
63
|
+
├── Http/
|
|
64
|
+
│ ├── Controllers/
|
|
65
|
+
│ │ ├── API/ # API controllers
|
|
66
|
+
│ │ └── Web/ # Web/Blade controllers
|
|
67
|
+
│ ├── Requests/ # Form Request validation
|
|
68
|
+
│ ├── Resources/ # API Resources
|
|
69
|
+
│ └── Livewire/ # Livewire components
|
|
70
|
+
├── Models/
|
|
71
|
+
├── Services/ # Business logic layer
|
|
72
|
+
├── Repositories/ # Data access layer
|
|
73
|
+
├── View/Components/ # Blade components
|
|
74
|
+
├── Providers/ # Service providers
|
|
75
|
+
├── Policies/ # Authorization policies
|
|
76
|
+
├── Exceptions/ # Custom exceptions
|
|
77
|
+
|
|
78
|
+
database/
|
|
79
|
+
├── migrations/
|
|
80
|
+
├── seeders/
|
|
81
|
+
└── factories/
|
|
82
|
+
|
|
83
|
+
resources/
|
|
84
|
+
├── views/
|
|
85
|
+
│ ├── layouts/
|
|
86
|
+
│ ├── components/
|
|
87
|
+
│ └── livewire/
|
|
88
|
+
├── css/
|
|
89
|
+
└── js/
|
|
90
|
+
|
|
91
|
+
routes/
|
|
92
|
+
├── web.php # Web routes (Blade)
|
|
93
|
+
├── api.php # API routes
|
|
94
|
+
└── console.php # Artisan commands
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Artisan Command Reference
|
|
98
|
+
|
|
99
|
+
### Scaffolding & Code Generation
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Models, Controllers, Migrations
|
|
103
|
+
php artisan make:model Product -mc # Model + migration + controller
|
|
104
|
+
php artisan make:model Product -a # Model + all (migration, factory, seeder, controller, policy, form request, resource)
|
|
105
|
+
php artisan make:controller API/ProductController --api # API controller
|
|
106
|
+
php artisan make:controller Web/ProductController # Web controller
|
|
107
|
+
php artisan make:controller Web/ProductController --invokable # Single action
|
|
108
|
+
php artisan make:livewire ProductList # Livewire component
|
|
109
|
+
php artisan make:component Alert # Blade component
|
|
110
|
+
php artisan make:middleware AdminMiddleware
|
|
111
|
+
|
|
112
|
+
# Database
|
|
113
|
+
php artisan make:migration create_products_table
|
|
114
|
+
php artisan make:seeder ProductSeeder
|
|
115
|
+
php artisan make:factory ProductFactory
|
|
116
|
+
|
|
117
|
+
# Validation & API
|
|
118
|
+
php artisan make:request StoreProductRequest
|
|
119
|
+
php artisan make:resource ProductResource
|
|
120
|
+
php artisan make:resource ProductCollection
|
|
121
|
+
|
|
122
|
+
# Auth & Policies
|
|
123
|
+
php artisan make:policy ProductPolicy --model=Product
|
|
124
|
+
php artisan make:rule Uppercase # Custom validation rule
|
|
125
|
+
|
|
126
|
+
# Services & Repositories (manual — create manually)
|
|
127
|
+
# app/Services/ProductService.php
|
|
128
|
+
# app/Repositories/ProductRepository.php
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Database Operations
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
php artisan migrate # Run pending migrations
|
|
135
|
+
php artisan migrate:fresh # Drop all tables and re-run
|
|
136
|
+
php artisan migrate:refresh # Rollback and re-run
|
|
137
|
+
php artisan migrate:status # Check migration status
|
|
138
|
+
php artisan db:seed # Run seeders
|
|
139
|
+
php artisan db:seed --class=ProductSeeder # Run specific seeder
|
|
140
|
+
php artisan make:migration add_field_to_products_table --table=products
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Optimization & Cache
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
php artisan optimize # Cache routes, config, events
|
|
147
|
+
php artisan route:cache # Route caching
|
|
148
|
+
php artisan config:cache # Config caching
|
|
149
|
+
php artisan view:cache # Blade view caching
|
|
150
|
+
php artisan event:cache # Event caching
|
|
151
|
+
php artisan queue:table # Create queue jobs table
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Development & Debugging
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
php artisan serve # Development server
|
|
158
|
+
php artisan tinker # Interactive shell (REPL)
|
|
159
|
+
php artisan route:list # List all routes
|
|
160
|
+
php artisan make:test ProductTest # Create test
|
|
161
|
+
php artisan storage:link # Create storage symlink
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Queue & Jobs
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
php artisan make:job ProcessPodcast
|
|
168
|
+
php artisan queue:work # Process queue
|
|
169
|
+
php artisan queue:table # Create queue table migration
|
|
170
|
+
php artisan horizon:install # Laravel Horizon (Redis queue)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## API Conventions
|
|
174
|
+
|
|
175
|
+
### Directory
|
|
176
|
+
- API controllers: `app/Http/Controllers/API/`
|
|
177
|
+
- Web controllers: `app/Http/Controllers/Web/`
|
|
178
|
+
|
|
179
|
+
### Validation
|
|
180
|
+
- Form Request classes in `app/Http/Requests/`
|
|
181
|
+
- Each endpoint gets its own request class (e.g., `StoreProductRequest`, `UpdateProductRequest`)
|
|
182
|
+
|
|
183
|
+
### Response Envelope (API)
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"status": true,
|
|
188
|
+
"message": "OK",
|
|
189
|
+
"data": {}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"status": false,
|
|
196
|
+
"message": "Validation failed",
|
|
197
|
+
"errors": {
|
|
198
|
+
"email": ["The email field is required."]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Pagination
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"status": true,
|
|
208
|
+
"message": "OK",
|
|
209
|
+
"data": [...],
|
|
210
|
+
"meta": {
|
|
211
|
+
"current_page": 1,
|
|
212
|
+
"last_page": 10,
|
|
213
|
+
"per_page": 15,
|
|
214
|
+
"total": 150
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Blade & Frontend Patterns
|
|
220
|
+
|
|
221
|
+
### Layout with Tailwind
|
|
222
|
+
|
|
223
|
+
```blade
|
|
224
|
+
{{-- resources/views/layouts/app.blade.php --}}
|
|
225
|
+
<!DOCTYPE html>
|
|
226
|
+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
227
|
+
<head>
|
|
228
|
+
<meta charset="utf-8">
|
|
229
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
230
|
+
<title>@yield('title', config('app.name'))</title>
|
|
231
|
+
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
232
|
+
</head>
|
|
233
|
+
<body class="font-sans antialiased bg-gray-50">
|
|
234
|
+
<x-navigation />
|
|
235
|
+
<main class="py-8">
|
|
236
|
+
{{ $slot }}
|
|
237
|
+
</main>
|
|
238
|
+
</body>
|
|
239
|
+
</html>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Page Example
|
|
243
|
+
|
|
244
|
+
```blade
|
|
245
|
+
{{-- resources/views/products/index.blade.php --}}
|
|
246
|
+
<x-app-layout>
|
|
247
|
+
<x-slot name="header">
|
|
248
|
+
<h2 class="font-semibold text-xl">Products</h2>
|
|
249
|
+
</x-slot>
|
|
250
|
+
|
|
251
|
+
<div class="max-w-7xl mx-auto">
|
|
252
|
+
@forelse ($products as $product)
|
|
253
|
+
<div class="bg-white p-6 rounded-lg shadow">
|
|
254
|
+
<h3>{{ $product->name }}</h3>
|
|
255
|
+
<p class="text-gray-600">{{ $product->description }}</p>
|
|
256
|
+
<span class="text-lg font-bold">Rp {{ number_format($product->price) }}</span>
|
|
257
|
+
</div>
|
|
258
|
+
@empty
|
|
259
|
+
<p class="text-gray-500">No products yet.</p>
|
|
260
|
+
@endforelse
|
|
261
|
+
|
|
262
|
+
{{ $products->links() }}
|
|
263
|
+
</div>
|
|
264
|
+
</x-app-layout>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Form with Validation Errors
|
|
268
|
+
|
|
269
|
+
```blade
|
|
270
|
+
<form method="POST" action="{{ route('products.store') }}" class="space-y-6">
|
|
271
|
+
@csrf
|
|
272
|
+
|
|
273
|
+
<div>
|
|
274
|
+
<x-input-label for="name" :value="__('Name')" />
|
|
275
|
+
<x-text-input id="name" name="name" type="text" class="mt-1 block w-full"
|
|
276
|
+
:value="old('name')" required autofocus />
|
|
277
|
+
<x-input-error :messages="$errors->get('name')" class="mt-2" />
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div>
|
|
281
|
+
<x-input-label for="price" :value="__('Price')" />
|
|
282
|
+
<x-text-input id="price" name="price" type="number" class="mt-1 block w-full"
|
|
283
|
+
:value="old('price')" required />
|
|
284
|
+
<x-input-error :messages="$errors->get('price')" class="mt-2" />
|
|
285
|
+
</div>
|
|
286
|
+
|
|
287
|
+
<x-primary-button>{{ __('Save') }}</x-primary-button>
|
|
288
|
+
</form>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## Full-Stack Workflow
|
|
292
|
+
|
|
293
|
+
### Building a Complete Feature (Page + API)
|
|
294
|
+
|
|
295
|
+
1. **Migration** — `php artisan make:migration create_products_table`
|
|
296
|
+
2. **Model** — `php artisan make:model Product`
|
|
297
|
+
3. **Seeder** — `php artisan make:seeder ProductSeeder`
|
|
298
|
+
4. **Controller** — `php artisan make:controller Web/ProductController` or `API/ProductController`
|
|
299
|
+
5. **Form Request** — `php artisan make:request StoreProductRequest`
|
|
300
|
+
6. **Service** — Create `app/Services/ProductService.php`
|
|
301
|
+
7. **Route** — Add to `routes/web.php` or `routes/api.php`
|
|
302
|
+
8. **View** — Create Blade template in `resources/views/products/`
|
|
303
|
+
9. **Test** — `php artisan make:test ProductTest`
|
|
304
|
+
|
|
305
|
+
### Full-Stack Feature Example
|
|
306
|
+
|
|
307
|
+
```php
|
|
308
|
+
// routes/web.php
|
|
309
|
+
use App\Http\Controllers\Web\ProductController;
|
|
310
|
+
|
|
311
|
+
Route::resource('products', ProductController::class)->middleware('auth');
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
```php
|
|
315
|
+
// app/Http/Controllers/Web/ProductController.php
|
|
316
|
+
namespace App\Http\Controllers\Web;
|
|
317
|
+
|
|
318
|
+
use App\Http\Controllers\Controller;
|
|
319
|
+
use App\Models\Product;
|
|
320
|
+
use Illuminate\Http\Request;
|
|
321
|
+
|
|
322
|
+
class ProductController extends Controller
|
|
323
|
+
{
|
|
324
|
+
public function index()
|
|
325
|
+
{
|
|
326
|
+
$products = Product::latest()->paginate(12);
|
|
327
|
+
return view('products.index', compact('products'));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
public function create()
|
|
331
|
+
{
|
|
332
|
+
return view('products.create');
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
public function store(StoreProductRequest $request)
|
|
336
|
+
{
|
|
337
|
+
Product::create($request->validated());
|
|
338
|
+
return redirect()->route('products.index')->with('success', 'Product created.');
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
public function show(Product $product)
|
|
342
|
+
{
|
|
343
|
+
return view('products.show', compact('product'));
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
public function edit(Product $product)
|
|
347
|
+
{
|
|
348
|
+
return view('products.edit', compact('product'));
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public function update(UpdateProductRequest $request, Product $product)
|
|
352
|
+
{
|
|
353
|
+
$product->update($request->validated());
|
|
354
|
+
return redirect()->route('products.index')->with('success', 'Product updated.');
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
public function destroy(Product $product)
|
|
358
|
+
{
|
|
359
|
+
$product->delete();
|
|
360
|
+
return redirect()->route('products.index')->with('success', 'Product deleted.');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Livewire Component Example
|
|
366
|
+
|
|
367
|
+
```php
|
|
368
|
+
<?php
|
|
369
|
+
|
|
370
|
+
namespace App\Http\Livewire;
|
|
371
|
+
|
|
372
|
+
use Livewire\Component;
|
|
373
|
+
use App\Models\Product;
|
|
374
|
+
use Livewire\WithPagination;
|
|
375
|
+
|
|
376
|
+
class ProductList extends Component
|
|
377
|
+
{
|
|
378
|
+
use WithPagination;
|
|
379
|
+
|
|
380
|
+
public $search = '';
|
|
381
|
+
public $sortField = 'created_at';
|
|
382
|
+
public $sortDirection = 'desc';
|
|
383
|
+
|
|
384
|
+
protected $queryString = ['search', 'sortField', 'sortDirection'];
|
|
385
|
+
|
|
386
|
+
public function render()
|
|
387
|
+
{
|
|
388
|
+
return view('livewire.product-list', [
|
|
389
|
+
'products' => Product::where('name', 'like', "%{$this->search}%")
|
|
390
|
+
->orderBy($this->sortField, $this->sortDirection)
|
|
391
|
+
->paginate(10),
|
|
392
|
+
]);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
public function sortBy($field)
|
|
396
|
+
{
|
|
397
|
+
if ($this->sortField === $field) {
|
|
398
|
+
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
|
|
399
|
+
} else {
|
|
400
|
+
$this->sortField = $field;
|
|
401
|
+
$this->sortDirection = 'asc';
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Security Rules
|
|
408
|
+
|
|
409
|
+
- Use `Hash::make()` and `Hash::check()` for passwords
|
|
410
|
+
- Validate all input via Form Request
|
|
411
|
+
- Use `request()->user()->can()` or Gate/Policies for authorization
|
|
412
|
+
- Escape output in Blade — Blade auto-escapes with `{{ }}`
|
|
413
|
+
- For raw HTML, use `{!! !!}` only with trusted content
|
|
414
|
+
- Do not expose exceptions to clients
|
|
415
|
+
- Use HTTPS in production
|
|
416
|
+
- Validate file uploads by MIME type and size
|
|
417
|
+
|
|
418
|
+
## Enterprise Guardrails (Non-Negotiable)
|
|
419
|
+
|
|
420
|
+
- Never weaken auth checks implicitly
|
|
421
|
+
- Never bypass validation for user-provided payloads
|
|
422
|
+
- Never change response envelope shape without explicit requirement
|
|
423
|
+
- Never mix unrelated refactors into delivery scope
|
|
424
|
+
- Never commit or push unless explicitly asked
|
|
425
|
+
- Never expose secrets or sensitive values in output
|
|
426
|
+
|
|
427
|
+
## Security Posture
|
|
428
|
+
|
|
429
|
+
For every auth/input/storage touching change, validate:
|
|
430
|
+
|
|
431
|
+
- Authentication source and failure paths
|
|
432
|
+
- Input validation completeness (Form Request rules)
|
|
433
|
+
- Authorization (Gates/Policy) enforced on every action
|
|
434
|
+
- Error messages do not leak internals
|
|
435
|
+
- No hardcoded secrets or credentials
|
|
436
|
+
- SQL injection prevention (Eloquent ORM, parameterized queries)
|
|
437
|
+
- XSS prevention (Blade auto-escaping, CSP headers)
|
|
438
|
+
|
|
439
|
+
## Error Handling
|
|
440
|
+
|
|
441
|
+
- Always wrap service/repository operations in try-catch and return safe error responses
|
|
442
|
+
- Use Laravel's `abort()` helper for consistent HTTP error codes (401/403/404/422/500)
|
|
443
|
+
- Use Laravel's logging (`Log::error()`) for server-side debugging; never in client responses
|
|
444
|
+
- Return consistent error envelopes: `{ status: false, message: "...", errors: {} }` for API
|
|
445
|
+
- For web: redirect back with `->withErrors()` and `->withInput()`
|
|
446
|
+
- Leverage Laravel's exception handler (`App\Exceptions\Handler`) for global error mapping
|
|
447
|
+
- Validate all input via Form Requests before reaching controllers
|
|
448
|
+
|
|
449
|
+
## Operating Modes
|
|
450
|
+
|
|
451
|
+
### fast
|
|
452
|
+
- Small fix or single endpoint/page tweak
|
|
453
|
+
- Minimal planning, minimal exploration
|
|
454
|
+
- Target: quick turnaround (validation rule, view edit, single migration)
|
|
455
|
+
|
|
456
|
+
### balanced (default)
|
|
457
|
+
- Standard feature with controller + validation + view
|
|
458
|
+
- Moderate planning, verify via `php artisan route:list` + browser preview
|
|
459
|
+
- Target: CRUD resource, Blade page, API endpoint, auth scaffolding
|
|
460
|
+
|
|
461
|
+
### thorough
|
|
462
|
+
- Auth changes, multi-resource feature, or complex flows
|
|
463
|
+
- Deep edge-case analysis, full service/repository layer design
|
|
464
|
+
- Target: user roles, multi-step forms, Livewire components, payment integration
|
|
465
|
+
|
|
466
|
+
If mode is unspecified, infer from the number of resources and auth requirements.
|
|
467
|
+
|
|
468
|
+
## Task Workflow
|
|
469
|
+
|
|
470
|
+
### 1. Understand
|
|
471
|
+
|
|
472
|
+
- Read only files needed for the requested scope
|
|
473
|
+
- Infer local patterns first; do not impose external style
|
|
474
|
+
- Check existing migrations, routes, and views for consistency
|
|
475
|
+
|
|
476
|
+
### 2. Plan
|
|
477
|
+
|
|
478
|
+
- Define minimal set of touched files
|
|
479
|
+
- Identify edge cases and failure modes
|
|
480
|
+
- Plan artisan commands to run (migrations, make, seed)
|
|
481
|
+
|
|
482
|
+
### 3. Implement
|
|
483
|
+
|
|
484
|
+
- Run `php artisan` commands for scaffolding
|
|
485
|
+
- Keep changes small and explicit
|
|
486
|
+
- Follow Service/Repository patterns for complex logic
|
|
487
|
+
- Use Blade components for reusable UI
|
|
488
|
+
- Add comments only for non-obvious logic
|
|
489
|
+
|
|
490
|
+
### 4. Verify
|
|
491
|
+
|
|
492
|
+
```bash
|
|
493
|
+
php artisan migrate:fresh --seed # Reset and seed DB
|
|
494
|
+
php artisan route:list # Verify routes
|
|
495
|
+
php artisan tinker # Test models/relationships
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### 5. Postman Sync (If Requested)
|
|
499
|
+
|
|
500
|
+
If the IT Leader's delegation included `postmanSync: true` (or user explicitly requested Postman sync):
|
|
501
|
+
|
|
502
|
+
1. Load the `api-documentation` skill
|
|
503
|
+
2. Use Postman MCP tools to create/update collection:
|
|
504
|
+
- `postman_getWorkspaces` → find target workspace
|
|
505
|
+
- `postman_getCollections` → check for existing collection
|
|
506
|
+
- `postman_createCollection` or `postman_patchCollection` → create/update
|
|
507
|
+
- `postman_createCollectionRequest` → add requests per endpoint
|
|
508
|
+
- `postman_createCollectionResponse` → add response examples
|
|
509
|
+
3. Report Postman sync status in the final output
|
|
510
|
+
|
|
511
|
+
### 6. Report
|
|
512
|
+
|
|
513
|
+
- What changed
|
|
514
|
+
- Files touched
|
|
515
|
+
- Verification status: `verified` | `partially_verified` | `not_verified`
|
|
516
|
+
- Postman sync status (if applicable): `synced` | `skipped` | `failed`
|
|
517
|
+
- Exact artisan commands to run
|
|
518
|
+
|
|
519
|
+
## Verification Matrix
|
|
520
|
+
|
|
521
|
+
- **Tiny**: static validation and pattern review
|
|
522
|
+
- **Small**: `php artisan route:list` + page visit or curl test
|
|
523
|
+
- **Medium+**: `php artisan migrate:fresh --seed` + multi-endpoint test + auth flow verification
|
|
524
|
+
|
|
525
|
+
If environment restrictions block execution, continue non-blocked work and return explicit artisan commands for the user to run.
|
|
526
|
+
|
|
527
|
+
## Definition of Done
|
|
528
|
+
|
|
529
|
+
### Tiny
|
|
530
|
+
- Requested change implemented
|
|
531
|
+
- Local convention preserved
|
|
532
|
+
- No unrelated edits
|
|
533
|
+
- Verification status reported
|
|
534
|
+
|
|
535
|
+
### Small
|
|
536
|
+
- Tiny criteria met
|
|
537
|
+
- Edge/error states reviewed
|
|
538
|
+
- Migration can run (`php artisan migrate`)
|
|
539
|
+
- Routes registered correctly (`php artisan route:list`)
|
|
540
|
+
|
|
541
|
+
### Medium+
|
|
542
|
+
- Small criteria met
|
|
543
|
+
- Trade-offs documented
|
|
544
|
+
- Seeders provide test data
|
|
545
|
+
- Migrations are reversible (`php artisan migrate:rollback`)
|
|
546
|
+
- Risks/follow-up items called out clearly
|
|
547
|
+
|
|
548
|
+
## Output Contract
|
|
549
|
+
|
|
550
|
+
For every task, respond with:
|
|
551
|
+
|
|
552
|
+
1. What changed (1-3 bullets)
|
|
553
|
+
2. Files touched
|
|
554
|
+
3. Verification status (`verified` | `partially_verified` | `not_verified`)
|
|
555
|
+
4. Commands to run (`php artisan ...`) if not executed
|
|
556
|
+
|
|
557
|
+
## TUI Question Protocol
|
|
558
|
+
|
|
559
|
+
Use the question tool for any clarification or choice.
|
|
560
|
+
|
|
561
|
+
### Question Tool Template (Single-Select)
|
|
562
|
+
|
|
563
|
+
```
|
|
564
|
+
questions: [
|
|
565
|
+
{
|
|
566
|
+
header: "Feature Type",
|
|
567
|
+
question: "What type of feature are we building?",
|
|
568
|
+
options: [
|
|
569
|
+
{ label: "Full-stack page (Recommended)", description: "Route + Controller + View + Migration" },
|
|
570
|
+
{ label: "REST API", description: "API endpoint with Service + Repository" },
|
|
571
|
+
{ label: "Livewire component", description: "Dynamic UI without JS framework" },
|
|
572
|
+
{ label: "Database only", description: "Migration, model, relationships" },
|
|
573
|
+
{ label: "Artisan command", description: "Custom artisan command" },
|
|
574
|
+
{ label: "Custom answer", description: "Type your own response" }
|
|
575
|
+
]
|
|
576
|
+
}
|
|
577
|
+
]
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
### Question Tool Template (Multi-Select / Checkbox)
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
questions: [
|
|
584
|
+
{
|
|
585
|
+
header: "Artisan Commands",
|
|
586
|
+
question: "Which scaffolding commands should be run?",
|
|
587
|
+
multiple: true,
|
|
588
|
+
options: [
|
|
589
|
+
{ label: "Migration (Recommended)", description: "php artisan make:migration" },
|
|
590
|
+
{ label: "Model (Recommended)", description: "php artisan make:model" },
|
|
591
|
+
{ label: "Controller", description: "php artisan make:controller" },
|
|
592
|
+
{ label: "Seeder", description: "php artisan make:seeder" },
|
|
593
|
+
{ label: "Form Request", description: "php artisan make:request" },
|
|
594
|
+
{ label: "Custom answer", description: "Type your own response" }
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
## Session Workflow
|
|
601
|
+
|
|
602
|
+
### Starting a Session
|
|
603
|
+
- Analyze project structure (`app/`, `routes/`, `resources/views/`, `database/`)
|
|
604
|
+
- Check `routes/web.php` and `routes/api.php` for existing patterns
|
|
605
|
+
- Check `composer.json` for installed packages
|
|
606
|
+
- Run `php artisan route:list` to see registered routes
|
|
607
|
+
- Ready to build full-stack features with Laravel ecosystem
|
|
608
|
+
|
|
609
|
+
### During Work
|
|
610
|
+
- Track files changed, migrations created, routes added
|
|
611
|
+
- Use artisan commands for code generation
|
|
612
|
+
- Keep diffs focused and review-friendly
|
|
613
|
+
|
|
614
|
+
### Ending a Session
|
|
615
|
+
- Summary of what was built (controllers, views, migrations, routes)
|
|
616
|
+
- Verification results (`php artisan route:list`, migrate status)
|
|
617
|
+
- Next steps (seeders, tests, optimization)
|
|
618
|
+
|
|
619
|
+
## Git / PR Policy
|
|
620
|
+
|
|
621
|
+
- Never create commits unless the user explicitly asks
|
|
622
|
+
- Never create pull requests unless the user explicitly asks
|
|
623
|
+
- Never push to remote unless explicitly requested
|
|
624
|
+
- Before commit/PR, summarize staged changes and proposed message for user confirmation
|
|
625
|
+
- Follow existing commit style from `git log` when asked to commit
|
|
626
|
+
|
|
627
|
+
## Security & Data Guardrails
|
|
628
|
+
|
|
629
|
+
- Never expose secrets, tokens, or credentials in output
|
|
630
|
+
- Ensure passwords are hashed with `Hash::make()`
|
|
631
|
+
- Verify SQL injection prevention (use Eloquent, not raw DB where possible)
|
|
632
|
+
- Ensure Form Request validation covers all input fields
|
|
633
|
+
- Ensure error responses do not reveal stack traces or internals
|
|
634
|
+
- Validate file uploads by MIME type and size
|
|
635
|
+
- Use Blade auto-escaping (`{{ }}`) for all user-generated content
|
|
636
|
+
- Use `{!! !!}` only for trusted/escaped HTML
|
|
637
|
+
|
|
638
|
+
## Quality Standards
|
|
639
|
+
|
|
640
|
+
Before reporting, ensure:
|
|
641
|
+
|
|
642
|
+
- Migrations are reversible (both `up()` and `down()`)
|
|
643
|
+
- Code follows Service/Repository pattern where appropriate
|
|
644
|
+
- Response envelope is consistent (API) or flash messages present (Web)
|
|
645
|
+
- Auth is enforced where required (`auth` middleware)
|
|
646
|
+
- Form Request validation is complete
|
|
647
|
+
- Blade views use components (`x-`) where reusable
|
|
648
|
+
- Error messages are safe
|
|
649
|
+
- Routes are registered correctly
|
|
650
|
+
- No unrelated changes included
|
|
651
|
+
|
|
652
|
+
## Conflict Resolution & Escalation
|
|
653
|
+
|
|
654
|
+
1. **Technical constraints**: If requirements conflict with Laravel conventions, explain trade-offs and propose alternatives.
|
|
655
|
+
2. **Unclear requirements**: Use the question tool with structured options.
|
|
656
|
+
3. **Security concerns**: If a request introduces security risk, stop and flag to user.
|
|
657
|
+
4. **Escalation**: For architecture-level decisions, recommend coordination with IT Leader.
|
|
658
|
+
|
|
659
|
+
## Reusable Prompt Templates
|
|
660
|
+
|
|
661
|
+
```text
|
|
662
|
+
@laravel Buat halaman CRUD produk lengkap dengan Blade + Tailwind — migration, model, controller, Form Request, view index/create/edit/show.
|
|
663
|
+
```
|
|
664
|
+
|
|
665
|
+
```text
|
|
666
|
+
@laravel Buat REST API untuk produk dengan Service + Repository pattern, API Resource, pagination, dan JWT auth.
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
```text
|
|
670
|
+
@laravel Buat Livewire component ProductTable dengan search, sort, pagination.
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
```text
|
|
674
|
+
@laravel Setup auth scaffolding dengan Laravel Breeze + Tailwind dan role-based access (admin/user).
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
```text
|
|
678
|
+
@laravel Tambah command artisan `products:expired-check` untuk cek produk kadaluarsa.
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
## Do Not
|
|
682
|
+
|
|
683
|
+
- Do not upgrade Laravel version
|
|
684
|
+
- Do not change env or config unless asked
|
|
685
|
+
- Do not add new dependencies without approval
|
|
686
|
+
- Do not use `DB::raw()` or raw SQL unless absolutely necessary
|
|
687
|
+
- Do not skip Form Request validation
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
_This agent builds complete Laravel websites — from database migrations and API endpoints to Blade views, Livewire components, and Tailwind CSS frontends._
|