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,284 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: continuous-learning-v2
|
|
3
|
+
description: Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Continuous Learning v2 - Instinct-Based Architecture
|
|
8
|
+
|
|
9
|
+
An advanced learning system that turns your Claude Code sessions into reusable knowledge through atomic "instincts" - small learned behaviors with confidence scoring.
|
|
10
|
+
|
|
11
|
+
## What's New in v2
|
|
12
|
+
|
|
13
|
+
| Feature | v1 | v2 |
|
|
14
|
+
|---------|----|----|
|
|
15
|
+
| Observation | Stop hook (session end) | PreToolUse/PostToolUse (100% reliable) |
|
|
16
|
+
| Analysis | Main context | Background agent (Haiku) |
|
|
17
|
+
| Granularity | Full skills | Atomic "instincts" |
|
|
18
|
+
| Confidence | None | 0.3-0.9 weighted |
|
|
19
|
+
| Evolution | Direct to skill | Instincts → cluster → skill/command/agent |
|
|
20
|
+
| Sharing | None | Export/import instincts |
|
|
21
|
+
|
|
22
|
+
## The Instinct Model
|
|
23
|
+
|
|
24
|
+
An instinct is a small learned behavior:
|
|
25
|
+
|
|
26
|
+
```yaml
|
|
27
|
+
---
|
|
28
|
+
id: prefer-functional-style
|
|
29
|
+
trigger: "when writing new functions"
|
|
30
|
+
confidence: 0.7
|
|
31
|
+
domain: "code-style"
|
|
32
|
+
source: "session-observation"
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
# Prefer Functional Style
|
|
36
|
+
|
|
37
|
+
## Action
|
|
38
|
+
Use functional patterns over classes when appropriate.
|
|
39
|
+
|
|
40
|
+
## Evidence
|
|
41
|
+
- Observed 5 instances of functional pattern preference
|
|
42
|
+
- User corrected class-based approach to functional on 2025-01-15
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Properties:**
|
|
46
|
+
- **Atomic** — one trigger, one action
|
|
47
|
+
- **Confidence-weighted** — 0.3 = tentative, 0.9 = near certain
|
|
48
|
+
- **Domain-tagged** — code-style, testing, git, debugging, workflow, etc.
|
|
49
|
+
- **Evidence-backed** — tracks what observations created it
|
|
50
|
+
|
|
51
|
+
## How It Works
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
Session Activity
|
|
55
|
+
│
|
|
56
|
+
│ Hooks capture prompts + tool use (100% reliable)
|
|
57
|
+
▼
|
|
58
|
+
┌─────────────────────────────────────────┐
|
|
59
|
+
│ observations.jsonl │
|
|
60
|
+
│ (prompts, tool calls, outcomes) │
|
|
61
|
+
└─────────────────────────────────────────┘
|
|
62
|
+
│
|
|
63
|
+
│ Observer agent reads (background, Haiku)
|
|
64
|
+
▼
|
|
65
|
+
┌─────────────────────────────────────────┐
|
|
66
|
+
│ PATTERN DETECTION │
|
|
67
|
+
│ • User corrections → instinct │
|
|
68
|
+
│ • Error resolutions → instinct │
|
|
69
|
+
│ • Repeated workflows → instinct │
|
|
70
|
+
└─────────────────────────────────────────┘
|
|
71
|
+
│
|
|
72
|
+
│ Creates/updates
|
|
73
|
+
▼
|
|
74
|
+
┌─────────────────────────────────────────┐
|
|
75
|
+
│ instincts/personal/ │
|
|
76
|
+
│ • prefer-functional.md (0.7) │
|
|
77
|
+
│ • always-test-first.md (0.9) │
|
|
78
|
+
│ • use-zod-validation.md (0.6) │
|
|
79
|
+
└─────────────────────────────────────────┘
|
|
80
|
+
│
|
|
81
|
+
│ /evolve clusters
|
|
82
|
+
▼
|
|
83
|
+
┌─────────────────────────────────────────┐
|
|
84
|
+
│ evolved/ │
|
|
85
|
+
│ • commands/new-feature.md │
|
|
86
|
+
│ • skills/testing-workflow.md │
|
|
87
|
+
│ • agents/refactor-specialist.md │
|
|
88
|
+
└─────────────────────────────────────────┘
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Quick Start
|
|
92
|
+
|
|
93
|
+
### 1. Enable Observation Hooks
|
|
94
|
+
|
|
95
|
+
Add to your `~/.claude/settings.json`.
|
|
96
|
+
|
|
97
|
+
**If installed as a plugin** (recommended):
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"hooks": {
|
|
102
|
+
"PreToolUse": [{
|
|
103
|
+
"matcher": "*",
|
|
104
|
+
"hooks": [{
|
|
105
|
+
"type": "command",
|
|
106
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh pre"
|
|
107
|
+
}]
|
|
108
|
+
}],
|
|
109
|
+
"PostToolUse": [{
|
|
110
|
+
"matcher": "*",
|
|
111
|
+
"hooks": [{
|
|
112
|
+
"type": "command",
|
|
113
|
+
"command": "${CLAUDE_PLUGIN_ROOT}/skills/continuous-learning-v2/hooks/observe.sh post"
|
|
114
|
+
}]
|
|
115
|
+
}]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**If installed manually** to `~/.claude/skills`:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"hooks": {
|
|
125
|
+
"PreToolUse": [{
|
|
126
|
+
"matcher": "*",
|
|
127
|
+
"hooks": [{
|
|
128
|
+
"type": "command",
|
|
129
|
+
"command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh pre"
|
|
130
|
+
}]
|
|
131
|
+
}],
|
|
132
|
+
"PostToolUse": [{
|
|
133
|
+
"matcher": "*",
|
|
134
|
+
"hooks": [{
|
|
135
|
+
"type": "command",
|
|
136
|
+
"command": "~/.claude/skills/continuous-learning-v2/hooks/observe.sh post"
|
|
137
|
+
}]
|
|
138
|
+
}]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 2. Initialize Directory Structure
|
|
144
|
+
|
|
145
|
+
The Python CLI will create these automatically, but you can also create them manually:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
mkdir -p ~/.claude/homunculus/{instincts/{personal,inherited},evolved/{agents,skills,commands}}
|
|
149
|
+
touch ~/.claude/homunculus/observations.jsonl
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### 3. Use the Instinct Commands
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
/instinct-status # Show learned instincts with confidence scores
|
|
156
|
+
/evolve # Cluster related instincts into skills/commands
|
|
157
|
+
/instinct-export # Export instincts for sharing
|
|
158
|
+
/instinct-import # Import instincts from others
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Commands
|
|
162
|
+
|
|
163
|
+
| Command | Description |
|
|
164
|
+
|---------|-------------|
|
|
165
|
+
| `/instinct-status` | Show all learned instincts with confidence |
|
|
166
|
+
| `/evolve` | Cluster related instincts into skills/commands |
|
|
167
|
+
| `/instinct-export` | Export instincts for sharing |
|
|
168
|
+
| `/instinct-import <file>` | Import instincts from others |
|
|
169
|
+
|
|
170
|
+
## Configuration
|
|
171
|
+
|
|
172
|
+
Edit `config.json`:
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"version": "2.0",
|
|
177
|
+
"observation": {
|
|
178
|
+
"enabled": true,
|
|
179
|
+
"store_path": "~/.claude/homunculus/observations.jsonl",
|
|
180
|
+
"max_file_size_mb": 10,
|
|
181
|
+
"archive_after_days": 7
|
|
182
|
+
},
|
|
183
|
+
"instincts": {
|
|
184
|
+
"personal_path": "~/.claude/homunculus/instincts/personal/",
|
|
185
|
+
"inherited_path": "~/.claude/homunculus/instincts/inherited/",
|
|
186
|
+
"min_confidence": 0.3,
|
|
187
|
+
"auto_approve_threshold": 0.7,
|
|
188
|
+
"confidence_decay_rate": 0.05
|
|
189
|
+
},
|
|
190
|
+
"observer": {
|
|
191
|
+
"enabled": true,
|
|
192
|
+
"model": "haiku",
|
|
193
|
+
"run_interval_minutes": 5,
|
|
194
|
+
"patterns_to_detect": [
|
|
195
|
+
"user_corrections",
|
|
196
|
+
"error_resolutions",
|
|
197
|
+
"repeated_workflows",
|
|
198
|
+
"tool_preferences"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"evolution": {
|
|
202
|
+
"cluster_threshold": 3,
|
|
203
|
+
"evolved_path": "~/.claude/homunculus/evolved/"
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## File Structure
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
~/.claude/homunculus/
|
|
212
|
+
├── identity.json # Your profile, technical level
|
|
213
|
+
├── observations.jsonl # Current session observations
|
|
214
|
+
├── observations.archive/ # Processed observations
|
|
215
|
+
├── instincts/
|
|
216
|
+
│ ├── personal/ # Auto-learned instincts
|
|
217
|
+
│ └── inherited/ # Imported from others
|
|
218
|
+
└── evolved/
|
|
219
|
+
├── agents/ # Generated specialist agents
|
|
220
|
+
├── skills/ # Generated skills
|
|
221
|
+
└── commands/ # Generated commands
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Integration with Skill Creator
|
|
225
|
+
|
|
226
|
+
When you use the [Skill Creator GitHub App](https://skill-creator.app), it now generates **both**:
|
|
227
|
+
- Traditional SKILL.md files (for backward compatibility)
|
|
228
|
+
- Instinct collections (for v2 learning system)
|
|
229
|
+
|
|
230
|
+
Instincts from repo analysis have `source: "repo-analysis"` and include the source repository URL.
|
|
231
|
+
|
|
232
|
+
## Confidence Scoring
|
|
233
|
+
|
|
234
|
+
Confidence evolves over time:
|
|
235
|
+
|
|
236
|
+
| Score | Meaning | Behavior |
|
|
237
|
+
|-------|---------|----------|
|
|
238
|
+
| 0.3 | Tentative | Suggested but not enforced |
|
|
239
|
+
| 0.5 | Moderate | Applied when relevant |
|
|
240
|
+
| 0.7 | Strong | Auto-approved for application |
|
|
241
|
+
| 0.9 | Near-certain | Core behavior |
|
|
242
|
+
|
|
243
|
+
**Confidence increases** when:
|
|
244
|
+
- Pattern is repeatedly observed
|
|
245
|
+
- User doesn't correct the suggested behavior
|
|
246
|
+
- Similar instincts from other sources agree
|
|
247
|
+
|
|
248
|
+
**Confidence decreases** when:
|
|
249
|
+
- User explicitly corrects the behavior
|
|
250
|
+
- Pattern isn't observed for extended periods
|
|
251
|
+
- Contradicting evidence appears
|
|
252
|
+
|
|
253
|
+
## Why Hooks vs Skills for Observation?
|
|
254
|
+
|
|
255
|
+
> "v1 relied on skills to observe. Skills are probabilistic—they fire ~50-80% of the time based on Claude's judgment."
|
|
256
|
+
|
|
257
|
+
Hooks fire **100% of the time**, deterministically. This means:
|
|
258
|
+
- Every tool call is observed
|
|
259
|
+
- No patterns are missed
|
|
260
|
+
- Learning is comprehensive
|
|
261
|
+
|
|
262
|
+
## Backward Compatibility
|
|
263
|
+
|
|
264
|
+
v2 is fully compatible with v1:
|
|
265
|
+
- Existing `~/.claude/skills/learned/` skills still work
|
|
266
|
+
- Stop hook still runs (but now also feeds into v2)
|
|
267
|
+
- Gradual migration path: run both in parallel
|
|
268
|
+
|
|
269
|
+
## Privacy
|
|
270
|
+
|
|
271
|
+
- Observations stay **local** on your machine
|
|
272
|
+
- Only **instincts** (patterns) can be exported
|
|
273
|
+
- No actual code or conversation content is shared
|
|
274
|
+
- You control what gets exported
|
|
275
|
+
|
|
276
|
+
## Related
|
|
277
|
+
|
|
278
|
+
- [Skill Creator](https://skill-creator.app) - Generate instincts from repo history
|
|
279
|
+
- [Homunculus](https://github.com/humanplane/homunculus) - Inspiration for v2 architecture
|
|
280
|
+
- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - Continuous learning section
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
*Instinct-based learning: teaching Claude your patterns, one observation at a time.*
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: observer
|
|
3
|
+
description: Background agent that analyzes session observations to detect patterns and create instincts. Uses Haiku for cost-efficiency.
|
|
4
|
+
model: haiku
|
|
5
|
+
run_mode: background
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Observer Agent
|
|
9
|
+
|
|
10
|
+
A background agent that analyzes observations from Claude Code sessions to detect patterns and create instincts.
|
|
11
|
+
|
|
12
|
+
## When to Run
|
|
13
|
+
|
|
14
|
+
- After significant session activity (20+ tool calls)
|
|
15
|
+
- When user runs `/analyze-patterns`
|
|
16
|
+
- On a scheduled interval (configurable, default 5 minutes)
|
|
17
|
+
- When triggered by observation hook (SIGUSR1)
|
|
18
|
+
|
|
19
|
+
## Input
|
|
20
|
+
|
|
21
|
+
Reads observations from `~/.claude/homunculus/observations.jsonl`:
|
|
22
|
+
|
|
23
|
+
```jsonl
|
|
24
|
+
{"timestamp":"2025-01-22T10:30:00Z","event":"tool_start","session":"abc123","tool":"Edit","input":"..."}
|
|
25
|
+
{"timestamp":"2025-01-22T10:30:01Z","event":"tool_complete","session":"abc123","tool":"Edit","output":"..."}
|
|
26
|
+
{"timestamp":"2025-01-22T10:30:05Z","event":"tool_start","session":"abc123","tool":"Bash","input":"npm test"}
|
|
27
|
+
{"timestamp":"2025-01-22T10:30:10Z","event":"tool_complete","session":"abc123","tool":"Bash","output":"All tests pass"}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Pattern Detection
|
|
31
|
+
|
|
32
|
+
Look for these patterns in observations:
|
|
33
|
+
|
|
34
|
+
### 1. User Corrections
|
|
35
|
+
When a user's follow-up message corrects Claude's previous action:
|
|
36
|
+
- "No, use X instead of Y"
|
|
37
|
+
- "Actually, I meant..."
|
|
38
|
+
- Immediate undo/redo patterns
|
|
39
|
+
|
|
40
|
+
→ Create instinct: "When doing X, prefer Y"
|
|
41
|
+
|
|
42
|
+
### 2. Error Resolutions
|
|
43
|
+
When an error is followed by a fix:
|
|
44
|
+
- Tool output contains error
|
|
45
|
+
- Next few tool calls fix it
|
|
46
|
+
- Same error type resolved similarly multiple times
|
|
47
|
+
|
|
48
|
+
→ Create instinct: "When encountering error X, try Y"
|
|
49
|
+
|
|
50
|
+
### 3. Repeated Workflows
|
|
51
|
+
When the same sequence of tools is used multiple times:
|
|
52
|
+
- Same tool sequence with similar inputs
|
|
53
|
+
- File patterns that change together
|
|
54
|
+
- Time-clustered operations
|
|
55
|
+
|
|
56
|
+
→ Create workflow instinct: "When doing X, follow steps Y, Z, W"
|
|
57
|
+
|
|
58
|
+
### 4. Tool Preferences
|
|
59
|
+
When certain tools are consistently preferred:
|
|
60
|
+
- Always uses Grep before Edit
|
|
61
|
+
- Prefers Read over Bash cat
|
|
62
|
+
- Uses specific Bash commands for certain tasks
|
|
63
|
+
|
|
64
|
+
→ Create instinct: "When needing X, use tool Y"
|
|
65
|
+
|
|
66
|
+
## Output
|
|
67
|
+
|
|
68
|
+
Creates/updates instincts in `~/.claude/homunculus/instincts/personal/`:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
---
|
|
72
|
+
id: prefer-grep-before-edit
|
|
73
|
+
trigger: "when searching for code to modify"
|
|
74
|
+
confidence: 0.65
|
|
75
|
+
domain: "workflow"
|
|
76
|
+
source: "session-observation"
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
# Prefer Grep Before Edit
|
|
80
|
+
|
|
81
|
+
## Action
|
|
82
|
+
Always use Grep to find the exact location before using Edit.
|
|
83
|
+
|
|
84
|
+
## Evidence
|
|
85
|
+
- Observed 8 times in session abc123
|
|
86
|
+
- Pattern: Grep → Read → Edit sequence
|
|
87
|
+
- Last observed: 2025-01-22
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Confidence Calculation
|
|
91
|
+
|
|
92
|
+
Initial confidence based on observation frequency:
|
|
93
|
+
- 1-2 observations: 0.3 (tentative)
|
|
94
|
+
- 3-5 observations: 0.5 (moderate)
|
|
95
|
+
- 6-10 observations: 0.7 (strong)
|
|
96
|
+
- 11+ observations: 0.85 (very strong)
|
|
97
|
+
|
|
98
|
+
Confidence adjusts over time:
|
|
99
|
+
- +0.05 for each confirming observation
|
|
100
|
+
- -0.1 for each contradicting observation
|
|
101
|
+
- -0.02 per week without observation (decay)
|
|
102
|
+
|
|
103
|
+
## Important Guidelines
|
|
104
|
+
|
|
105
|
+
1. **Be Conservative**: Only create instincts for clear patterns (3+ observations)
|
|
106
|
+
2. **Be Specific**: Narrow triggers are better than broad ones
|
|
107
|
+
3. **Track Evidence**: Always include what observations led to the instinct
|
|
108
|
+
4. **Respect Privacy**: Never include actual code snippets, only patterns
|
|
109
|
+
5. **Merge Similar**: If a new instinct is similar to existing, update rather than duplicate
|
|
110
|
+
|
|
111
|
+
## Example Analysis Session
|
|
112
|
+
|
|
113
|
+
Given observations:
|
|
114
|
+
```jsonl
|
|
115
|
+
{"event":"tool_start","tool":"Grep","input":"pattern: useState"}
|
|
116
|
+
{"event":"tool_complete","tool":"Grep","output":"Found in 3 files"}
|
|
117
|
+
{"event":"tool_start","tool":"Read","input":"src/hooks/useAuth.ts"}
|
|
118
|
+
{"event":"tool_complete","tool":"Read","output":"[file content]"}
|
|
119
|
+
{"event":"tool_start","tool":"Edit","input":"src/hooks/useAuth.ts..."}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Analysis:
|
|
123
|
+
- Detected workflow: Grep → Read → Edit
|
|
124
|
+
- Frequency: Seen 5 times this session
|
|
125
|
+
- Create instinct:
|
|
126
|
+
- trigger: "when modifying code"
|
|
127
|
+
- action: "Search with Grep, confirm with Read, then Edit"
|
|
128
|
+
- confidence: 0.6
|
|
129
|
+
- domain: "workflow"
|
|
130
|
+
|
|
131
|
+
## Integration with Skill Creator
|
|
132
|
+
|
|
133
|
+
When instincts are imported from Skill Creator (repo analysis), they have:
|
|
134
|
+
- `source: "repo-analysis"`
|
|
135
|
+
- `source_repo: "https://github.com/..."`
|
|
136
|
+
|
|
137
|
+
These should be treated as team/project conventions with higher initial confidence (0.7+).
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Continuous Learning v2 - Observer Agent Launcher
|
|
3
|
+
#
|
|
4
|
+
# Starts the background observer agent that analyzes observations
|
|
5
|
+
# and creates instincts. Uses Haiku model for cost efficiency.
|
|
6
|
+
#
|
|
7
|
+
# Usage:
|
|
8
|
+
# start-observer.sh # Start observer in background
|
|
9
|
+
# start-observer.sh stop # Stop running observer
|
|
10
|
+
# start-observer.sh status # Check if observer is running
|
|
11
|
+
|
|
12
|
+
set -e
|
|
13
|
+
|
|
14
|
+
CONFIG_DIR="${HOME}/.claude/homunculus"
|
|
15
|
+
PID_FILE="${CONFIG_DIR}/.observer.pid"
|
|
16
|
+
LOG_FILE="${CONFIG_DIR}/observer.log"
|
|
17
|
+
OBSERVATIONS_FILE="${CONFIG_DIR}/observations.jsonl"
|
|
18
|
+
|
|
19
|
+
mkdir -p "$CONFIG_DIR"
|
|
20
|
+
|
|
21
|
+
case "${1:-start}" in
|
|
22
|
+
stop)
|
|
23
|
+
if [ -f "$PID_FILE" ]; then
|
|
24
|
+
pid=$(cat "$PID_FILE")
|
|
25
|
+
if kill -0 "$pid" 2>/dev/null; then
|
|
26
|
+
echo "Stopping observer (PID: $pid)..."
|
|
27
|
+
kill "$pid"
|
|
28
|
+
rm -f "$PID_FILE"
|
|
29
|
+
echo "Observer stopped."
|
|
30
|
+
else
|
|
31
|
+
echo "Observer not running (stale PID file)."
|
|
32
|
+
rm -f "$PID_FILE"
|
|
33
|
+
fi
|
|
34
|
+
else
|
|
35
|
+
echo "Observer not running."
|
|
36
|
+
fi
|
|
37
|
+
exit 0
|
|
38
|
+
;;
|
|
39
|
+
|
|
40
|
+
status)
|
|
41
|
+
if [ -f "$PID_FILE" ]; then
|
|
42
|
+
pid=$(cat "$PID_FILE")
|
|
43
|
+
if kill -0 "$pid" 2>/dev/null; then
|
|
44
|
+
echo "Observer is running (PID: $pid)"
|
|
45
|
+
echo "Log: $LOG_FILE"
|
|
46
|
+
echo "Observations: $(wc -l < "$OBSERVATIONS_FILE" 2>/dev/null || echo 0) lines"
|
|
47
|
+
exit 0
|
|
48
|
+
else
|
|
49
|
+
echo "Observer not running (stale PID file)"
|
|
50
|
+
rm -f "$PID_FILE"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
else
|
|
54
|
+
echo "Observer not running"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
|
|
59
|
+
start)
|
|
60
|
+
# Check if already running
|
|
61
|
+
if [ -f "$PID_FILE" ]; then
|
|
62
|
+
pid=$(cat "$PID_FILE")
|
|
63
|
+
if kill -0 "$pid" 2>/dev/null; then
|
|
64
|
+
echo "Observer already running (PID: $pid)"
|
|
65
|
+
exit 0
|
|
66
|
+
fi
|
|
67
|
+
rm -f "$PID_FILE"
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "Starting observer agent..."
|
|
71
|
+
|
|
72
|
+
# The observer loop
|
|
73
|
+
(
|
|
74
|
+
trap 'rm -f "$PID_FILE"; exit 0' TERM INT
|
|
75
|
+
|
|
76
|
+
analyze_observations() {
|
|
77
|
+
# Only analyze if we have enough observations
|
|
78
|
+
obs_count=$(wc -l < "$OBSERVATIONS_FILE" 2>/dev/null || echo 0)
|
|
79
|
+
if [ "$obs_count" -lt 10 ]; then
|
|
80
|
+
return
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
echo "[$(date)] Analyzing $obs_count observations..." >> "$LOG_FILE"
|
|
84
|
+
|
|
85
|
+
# Use Claude Code with Haiku to analyze observations
|
|
86
|
+
# This spawns a quick analysis session
|
|
87
|
+
if command -v claude &> /dev/null; then
|
|
88
|
+
claude --model haiku --max-turns 3 --print \
|
|
89
|
+
"Read $OBSERVATIONS_FILE and identify patterns. If you find 3+ occurrences of the same pattern, create an instinct file in $CONFIG_DIR/instincts/personal/ following the format in the observer agent spec. Be conservative - only create instincts for clear patterns." \
|
|
90
|
+
>> "$LOG_FILE" 2>&1 || true
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Archive processed observations
|
|
94
|
+
if [ -f "$OBSERVATIONS_FILE" ]; then
|
|
95
|
+
archive_dir="${CONFIG_DIR}/observations.archive"
|
|
96
|
+
mkdir -p "$archive_dir"
|
|
97
|
+
mv "$OBSERVATIONS_FILE" "$archive_dir/processed-$(date +%Y%m%d-%H%M%S).jsonl"
|
|
98
|
+
touch "$OBSERVATIONS_FILE"
|
|
99
|
+
fi
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Handle SIGUSR1 for on-demand analysis
|
|
103
|
+
trap 'analyze_observations' USR1
|
|
104
|
+
|
|
105
|
+
echo "$$" > "$PID_FILE"
|
|
106
|
+
echo "[$(date)] Observer started (PID: $$)" >> "$LOG_FILE"
|
|
107
|
+
|
|
108
|
+
while true; do
|
|
109
|
+
# Check every 5 minutes
|
|
110
|
+
sleep 300
|
|
111
|
+
|
|
112
|
+
analyze_observations
|
|
113
|
+
done
|
|
114
|
+
) &
|
|
115
|
+
|
|
116
|
+
disown
|
|
117
|
+
|
|
118
|
+
# Wait a moment for PID file
|
|
119
|
+
sleep 1
|
|
120
|
+
|
|
121
|
+
if [ -f "$PID_FILE" ]; then
|
|
122
|
+
echo "Observer started (PID: $(cat "$PID_FILE"))"
|
|
123
|
+
echo "Log: $LOG_FILE"
|
|
124
|
+
else
|
|
125
|
+
echo "Failed to start observer"
|
|
126
|
+
exit 1
|
|
127
|
+
fi
|
|
128
|
+
;;
|
|
129
|
+
|
|
130
|
+
*)
|
|
131
|
+
echo "Usage: $0 {start|stop|status}"
|
|
132
|
+
exit 1
|
|
133
|
+
;;
|
|
134
|
+
esac
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0",
|
|
3
|
+
"observation": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"store_path": "~/.claude/homunculus/observations.jsonl",
|
|
6
|
+
"max_file_size_mb": 10,
|
|
7
|
+
"archive_after_days": 7,
|
|
8
|
+
"capture_tools": ["Edit", "Write", "Bash", "Read", "Grep", "Glob"],
|
|
9
|
+
"ignore_tools": ["TodoWrite"]
|
|
10
|
+
},
|
|
11
|
+
"instincts": {
|
|
12
|
+
"personal_path": "~/.claude/homunculus/instincts/personal/",
|
|
13
|
+
"inherited_path": "~/.claude/homunculus/instincts/inherited/",
|
|
14
|
+
"min_confidence": 0.3,
|
|
15
|
+
"auto_approve_threshold": 0.7,
|
|
16
|
+
"confidence_decay_rate": 0.02,
|
|
17
|
+
"max_instincts": 100
|
|
18
|
+
},
|
|
19
|
+
"observer": {
|
|
20
|
+
"enabled": false,
|
|
21
|
+
"model": "haiku",
|
|
22
|
+
"run_interval_minutes": 5,
|
|
23
|
+
"min_observations_to_analyze": 20,
|
|
24
|
+
"patterns_to_detect": [
|
|
25
|
+
"user_corrections",
|
|
26
|
+
"error_resolutions",
|
|
27
|
+
"repeated_workflows",
|
|
28
|
+
"tool_preferences",
|
|
29
|
+
"file_patterns"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"evolution": {
|
|
33
|
+
"cluster_threshold": 3,
|
|
34
|
+
"evolved_path": "~/.claude/homunculus/evolved/",
|
|
35
|
+
"auto_evolve": false
|
|
36
|
+
},
|
|
37
|
+
"integration": {
|
|
38
|
+
"skill_creator_api": "https://skill-creator.app/api",
|
|
39
|
+
"backward_compatible_v1": true
|
|
40
|
+
}
|
|
41
|
+
}
|