oneie 2.0.2 → 2.0.3
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/AGENTS.md +245 -0
- package/CLAUDE.md +534 -0
- package/one/.obsidian/app.json +1 -0
- package/one/.obsidian/appearance.json +1 -0
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/workspace.json +211 -0
- package/one/connections/a2a.md +551 -0
- package/one/connections/acp.md +761 -0
- package/one/connections/acps.md +731 -0
- package/one/connections/agui.md +767 -0
- package/one/connections/any-backend.md +1702 -0
- package/one/connections/ap2.md +998 -0
- package/one/connections/api-docs.md +1891 -0
- package/one/connections/api.md +2190 -0
- package/one/connections/architecture-diagram.md +94 -0
- package/one/connections/communications.md +449 -0
- package/one/connections/connections.md +339 -0
- package/one/connections/cryptonetworks.md +781 -0
- package/one/connections/documentation.md +1120 -0
- package/one/connections/effect.md +279 -0
- package/one/connections/elizaos.md +1290 -0
- package/one/connections/inference.md +58 -0
- package/one/connections/kyc.md +632 -0
- package/one/connections/mcp.md +842 -0
- package/one/connections/membership.md +1152 -0
- package/one/connections/middleware.md +1067 -0
- package/one/connections/multitenant.md +1341 -0
- package/one/connections/n8n.md +1015 -0
- package/one/connections/patterns.md +89 -0
- package/one/connections/protocols.md +279 -0
- package/one/connections/relationships.md +107 -0
- package/one/connections/schema.md +587 -0
- package/one/connections/service-layer.md +550 -0
- package/one/connections/structure.md +0 -0
- package/one/connections/vectors.md +207 -0
- package/one/connections/wordpress.md +1302 -0
- package/one/connections/workflow-copy.md +905 -0
- package/one/connections/workflow-examples.md +741 -0
- package/one/connections/workflow.md +905 -0
- package/one/connections/workflows/delegation.md +885 -0
- package/one/connections/workflows/frontend.md +1037 -0
- package/one/connections/workflows/strategy.md +903 -0
- package/one/connections/workflows/tasks.md +698 -0
- package/one/connections/x402.md +1249 -0
- package/one/events/events.md +545 -0
- package/one/knowledge/ai-platform.md +305 -0
- package/one/knowledge/architecture-diagram.md +94 -0
- package/one/knowledge/architecture-frontend.md +930 -0
- package/one/knowledge/architecture.md +2077 -0
- package/one/knowledge/crypto.md +960 -0
- package/one/knowledge/dsl.md +1660 -0
- package/one/knowledge/files.md +2471 -0
- package/one/knowledge/frontend.md +1038 -0
- package/one/knowledge/hono.md +2109 -0
- package/one/knowledge/implementation-examples.md +2536 -0
- package/one/knowledge/inference-score.md +159 -0
- package/one/knowledge/knowledge.md +642 -0
- package/one/knowledge/language.md +980 -0
- package/one/knowledge/lessons-learned.md +70 -0
- package/one/knowledge/ontology-6-dimensions.md +0 -0
- package/one/knowledge/ontology-documentation.md +356 -0
- package/one/knowledge/ontology-engineering-specification.md +1292 -0
- package/one/knowledge/ontology-engineering.md +1652 -0
- package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
- package/one/knowledge/ontology-frontend-copy.md +753 -0
- package/one/knowledge/ontology-frontend-specifications.md +2188 -0
- package/one/knowledge/ontology-frontend.md +2427 -0
- package/one/knowledge/ontology-minimal.yaml +299 -0
- package/one/knowledge/ontology.md +2819 -0
- package/one/knowledge/ontology.yaml +1165 -0
- package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
- package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
- package/one/knowledge/patterns/backend/mutation-template.md +231 -0
- package/one/knowledge/patterns/backend/query-template.md +267 -0
- package/one/knowledge/patterns/backend/service-template.md +237 -0
- package/one/knowledge/patterns/design/component-architecture.md +399 -0
- package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
- package/one/knowledge/patterns/design/wireframe-template.md +216 -0
- package/one/knowledge/patterns/frontend/component-template.md +195 -0
- package/one/knowledge/patterns/frontend/form-template.md +276 -0
- package/one/knowledge/patterns/frontend/page-template.md +178 -0
- package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
- package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
- package/one/knowledge/patterns/test/technical-test-template.md +544 -0
- package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
- package/one/knowledge/patterns/test/user-flow-template.md +254 -0
- package/one/knowledge/quality-loop.md +401 -0
- package/one/knowledge/readme.md +131 -0
- package/one/knowledge/rules.md +626 -0
- package/one/knowledge/score.md +67 -0
- package/one/knowledge/specifications.md +855 -0
- package/one/knowledge/tags.md +130 -0
- package/one/organisation/one.md +599 -0
- package/one/organisation/organisation.md +438 -0
- package/one/organisation/revenue.md +673 -0
- package/one/organisation/strategy.md +869 -0
- package/one/organisation/vision.md +98 -0
- package/one/people/anthony-o-connell.md +440 -0
- package/one/people/people.md +567 -0
- package/one/repomix-output.md +92634 -0
- package/one/things/agentkit.md +349 -0
- package/one/things/agents/agent-backend.md +1401 -0
- package/one/things/agents/agent-builder.md +955 -0
- package/one/things/agents/agent-clean.md +709 -0
- package/one/things/agents/agent-clone.md +1341 -0
- package/one/things/agents/agent-designer.md +2177 -0
- package/one/things/agents/agent-director.md +1508 -0
- package/one/things/agents/agent-documenter.md +1049 -0
- package/one/things/agents/agent-frontend.md +1119 -0
- package/one/things/agents/agent-integrator.md +1192 -0
- package/one/things/agents/agent-problem-solver.md +1379 -0
- package/one/things/agents/agent-quality.md +1353 -0
- package/one/things/agents/agent-sales.md +986 -0
- package/one/things/cascade/cascade.yaml +464 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
- package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
- package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
- package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
- package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
- package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
- package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
- package/one/things/cascade/docs/examples/readme.md +222 -0
- package/one/things/cascade/docs/getting-started.md +515 -0
- package/one/things/cascade/docs/workflow.md +1372 -0
- package/one/things/cascade/readme.md +336 -0
- package/one/things/cascade/templates/feature-template.md +267 -0
- package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
- package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
- package/one/things/claude/agents/analyst.md +483 -0
- package/one/things/claude/agents/architect.md +480 -0
- package/one/things/claude/agents/brand-identity-specialist.md +513 -0
- package/one/things/claude/agents/bstp-token-strategist.md +667 -0
- package/one/things/claude/agents/builder-repo.md +489 -0
- package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
- package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
- package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
- package/one/things/claude/agents/company-bullstamp-character.md +587 -0
- package/one/things/claude/agents/company-bullstamp-community.md +292 -0
- package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
- package/one/things/claude/agents/company-bullstamp-token.md +292 -0
- package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
- package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
- package/one/things/claude/agents/content-calendar-planner.md +448 -0
- package/one/things/claude/agents/content-chapter-formatter.md +488 -0
- package/one/things/claude/agents/content-formatter.md +546 -0
- package/one/things/claude/agents/content-hook-specialist.md +462 -0
- package/one/things/claude/agents/content-image-formatter.md +535 -0
- package/one/things/claude/agents/content-introduction-formatter.md +485 -0
- package/one/things/claude/agents/content-multiplication-engine.md +556 -0
- package/one/things/claude/agents/content-playbook-writer.md +448 -0
- package/one/things/claude/agents/content-team-manager.md +622 -0
- package/one/things/claude/agents/content-toc-formatter.md +522 -0
- package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
- package/one/things/claude/agents/core-manager.md +582 -0
- package/one/things/claude/agents/core-master.md +403 -0
- package/one/things/claude/agents/cross-functional-manager.md +471 -0
- package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
- package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
- package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
- package/one/things/claude/agents/crypto-community-analyst.md +298 -0
- package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
- package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
- package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
- package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
- package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
- package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
- package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
- package/one/things/claude/agents/crypto-market-researcher.md +292 -0
- package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
- package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
- package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
- package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
- package/one/things/claude/agents/crypto-team-manager.md +387 -0
- package/one/things/claude/agents/crypto-token-analyst.md +278 -0
- package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
- package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
- package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
- package/one/things/claude/agents/customer-journey-designer.md +481 -0
- package/one/things/claude/agents/customer-success-manager.md +581 -0
- package/one/things/claude/agents/dev.md +413 -0
- package/one/things/claude/agents/documenter.md +546 -0
- package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
- package/one/things/claude/agents/engagement-specialist.md +509 -0
- package/one/things/claude/agents/engineering-architect.md +387 -0
- package/one/things/claude/agents/engineering-business-analyst.md +537 -0
- package/one/things/claude/agents/engineering-developer.md +387 -0
- package/one/things/claude/agents/engineering-director.md +282 -0
- package/one/things/claude/agents/engineering-ingestor.md +649 -0
- package/one/things/claude/agents/engineering-product-manager.md +537 -0
- package/one/things/claude/agents/engineering-product-owner.md +537 -0
- package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
- package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
- package/one/things/claude/agents/engineering-team-manager.md +512 -0
- package/one/things/claude/agents/engineering-user-experience.md +387 -0
- package/one/things/claude/agents/framework-elevate-manager.md +294 -0
- package/one/things/claude/agents/improver.md +763 -0
- package/one/things/claude/agents/intelligence-team-manager.md +385 -0
- package/one/things/claude/agents/lead-capture-expert.md +466 -0
- package/one/things/claude/agents/lead-magnet-creator.md +453 -0
- package/one/things/claude/agents/market-research-analyst.md +412 -0
- package/one/things/claude/agents/marketing-brand-identity.md +314 -0
- package/one/things/claude/agents/marketing-content-hooks.md +450 -0
- package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
- package/one/things/claude/agents/marketing-content-poster.md +361 -0
- package/one/things/claude/agents/marketing-customer-journey.md +326 -0
- package/one/things/claude/agents/marketing-director.md +397 -0
- package/one/things/claude/agents/marketing-engagement.md +326 -0
- package/one/things/claude/agents/marketing-lead-capture.md +326 -0
- package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
- package/one/things/claude/agents/marketing-network-effects.md +326 -0
- package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
- package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
- package/one/things/claude/agents/marketing-team-manager.md +446 -0
- package/one/things/claude/agents/marketing-viral-growth.md +201 -0
- package/one/things/claude/agents/mission-commander.md +373 -0
- package/one/things/claude/agents/network-effect-analyst.md +587 -0
- package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
- package/one/things/claude/agents/npx.md +890 -0
- package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
- package/one/things/claude/agents/one-master.md +355 -0
- package/one/things/claude/agents/one-orchestrator.md +315 -0
- package/one/things/claude/agents/one.md +601 -0
- package/one/things/claude/agents/playbook-generator.md +503 -0
- package/one/things/claude/agents/pm.md +326 -0
- package/one/things/claude/agents/po.md +345 -0
- package/one/things/claude/agents/qa.md +336 -0
- package/one/things/claude/agents/research-foundation-analyst.md +307 -0
- package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
- package/one/things/claude/agents/research-market-analyst.md +307 -0
- package/one/things/claude/agents/research-team-manager.md +482 -0
- package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
- package/one/things/claude/agents/sales-team-manager.md +400 -0
- package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
- package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
- package/one/things/claude/agents/service-advocacy-manager.md +307 -0
- package/one/things/claude/agents/service-success-manager.md +307 -0
- package/one/things/claude/agents/service-team-manager.md +400 -0
- package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
- package/one/things/claude/agents/share-optimization-specialist.md +551 -0
- package/one/things/claude/agents/sm.md +327 -0
- package/one/things/claude/agents/story-teller.md +473 -0
- package/one/things/claude/agents/task-master.md +596 -0
- package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
- package/one/things/claude/agents/tester.md +556 -0
- package/one/things/claude/agents/the-bull-character-manager.md +580 -0
- package/one/things/claude/agents/tools-playbook-generator.md +489 -0
- package/one/things/claude/agents/turbo-repo-builder.md +316 -0
- package/one/things/claude/agents/upsell-strategist.md +480 -0
- package/one/things/claude/agents/ux-expert.md +335 -0
- package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
- package/one/things/claude/claude-code-hooks-development.json +21 -0
- package/one/things/claude/claude-code-hooks-production.json +21 -0
- package/one/things/claude/claude-code-hooks.json +25 -0
- package/one/things/claude/commands/agent.md +104 -0
- package/one/things/claude/commands/cascade-status.md +128 -0
- package/one/things/claude/commands/ingest.md +290 -0
- package/one/things/claude/commands/ingestor.md +136 -0
- package/one/things/claude/commands/mission.md +83 -0
- package/one/things/claude/commands/npx.md +133 -0
- package/one/things/claude/commands/one.md +440 -0
- package/one/things/claude/commands/quality-check.md +204 -0
- package/one/things/claude/commands/smart-route.md +220 -0
- package/one/things/claude/commands/start.md +121 -0
- package/one/things/claude/commands/story.md +83 -0
- package/one/things/claude/commands/task.md +173 -0
- package/one/things/claude/hook-bypass.json +32 -0
- package/one/things/claude/hooks/agent-hook-config.json +427 -0
- package/one/things/claude/hooks/agent-hook-manager.js +525 -0
- package/one/things/claude/hooks/agent-load-balancer.js +271 -0
- package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
- package/one/things/claude/hooks/build-hook.sh +156 -0
- package/one/things/claude/hooks/cascade-feedback.js +297 -0
- package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
- package/one/things/claude/hooks/cleanup-hook.sh +201 -0
- package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
- package/one/things/claude/hooks/file-organization-engine.js +427 -0
- package/one/things/claude/hooks/file-organization-hook.sh +80 -0
- package/one/things/claude/hooks/file-organization-monitor.js +269 -0
- package/one/things/claude/hooks/format-hook.sh +43 -0
- package/one/things/claude/hooks/hook-bypass.sh +293 -0
- package/one/things/claude/hooks/hook-config-manager.js +202 -0
- package/one/things/claude/hooks/hook-debouncer.sh +62 -0
- package/one/things/claude/hooks/hook-logger.sh +89 -0
- package/one/things/claude/hooks/hook-orchestrator.js +662 -0
- package/one/things/claude/hooks/hook-performance-report.js +120 -0
- package/one/things/claude/hooks/lint-hook.sh +140 -0
- package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
- package/one/things/claude/hooks/memory-optimizer.js +510 -0
- package/one/things/claude/hooks/notification-hook.sh +204 -0
- package/one/things/claude/hooks/ontology-compliance.js +394 -0
- package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
- package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
- package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
- package/one/things/claude/hooks/performance-metrics.json +25 -0
- package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
- package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
- package/one/things/claude/hooks/security-hook.sh +256 -0
- package/one/things/claude/hooks/simple-load-balancer.js +238 -0
- package/one/things/claude/hooks/startup-optimizer.js +625 -0
- package/one/things/claude/hooks/story-scoring-system.js +445 -0
- package/one/things/claude/hooks/story-validation-engine.js +473 -0
- package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
- package/one/things/claude/hooks/story-validation-hook.sh +145 -0
- package/one/things/claude/hooks/structure-synchronizer.js +194 -0
- package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
- package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
- package/one/things/claude/hooks/test-hook.sh +145 -0
- package/one/things/claude/hooks/test-story-validation.sh +170 -0
- package/one/things/claude/hooks/trinity-validation-system.js +392 -0
- package/one/things/claude/settings-local.json +86 -0
- package/one/things/cli-code.md +652 -0
- package/one/things/cli-compiler-code.md +652 -0
- package/one/things/cli.md +1045 -0
- package/one/things/components/card-shadcn.md +929 -0
- package/one/things/components/card.md +1050 -0
- package/one/things/components.md +1669 -0
- package/one/things/componets.md +4 -0
- package/one/things/copilotkit.md +1559 -0
- package/one/things/creator-diagram.md +166 -0
- package/one/things/examples/children/lemonade-stand.md +366 -0
- package/one/things/examples/enterprise/crm-saas.md +1429 -0
- package/one/things/features/1-1-agent-prompts/design.md +470 -0
- package/one/things/features/1-1-agent-prompts/tests.md +264 -0
- package/one/things/features/1-1-agent-prompts.md +486 -0
- package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
- package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
- package/one/things/features/1-2-yaml-orchestrator.md +516 -0
- package/one/things/features/1-3-event-coordination/design.md +544 -0
- package/one/things/features/1-3-event-coordination/tests.md +223 -0
- package/one/things/features/1-3-event-coordination.md +508 -0
- package/one/things/features/1-4-knowledge-management/design.md +609 -0
- package/one/things/features/1-4-knowledge-management/tests.md +195 -0
- package/one/things/features/1-4-knowledge-management.md +577 -0
- package/one/things/features/1-5-quality-loops/design.md +797 -0
- package/one/things/features/1-5-quality-loops/tests.md +212 -0
- package/one/things/features/1-5-quality-loops.md +641 -0
- package/one/things/features/1-6-numbering-structure/design.md +610 -0
- package/one/things/features/1-6-numbering-structure/tests.md +213 -0
- package/one/things/features/1-6-numbering-structure.md +575 -0
- package/one/things/features/2-cli.md +1235 -0
- package/one/things/features/use-one-backend.md +1180 -0
- package/one/things/ideas/1-create-workflow.md +189 -0
- package/one/things/plans/1-create-workflow-status.md +555 -0
- package/one/things/plans/1-create-workflow.md +713 -0
- package/one/things/plans/app.md +761 -0
- package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
- package/one/things/plans/better-auth-any-backend.md +1852 -0
- package/one/things/plans/better-auth-available-features.md +235 -0
- package/one/things/plans/big-plan.md +38 -0
- package/one/things/plans/convex-better-auth.md +1109 -0
- package/one/things/plans/convex-on-off.md +389 -0
- package/one/things/plans/desktop.md +1121 -0
- package/one/things/plans/effect-components.md +1669 -0
- package/one/things/plans/effect.md +973 -0
- package/one/things/plans/email.md +953 -0
- package/one/things/plans/enhance-auth.md +1669 -0
- package/one/things/plans/install-components.md +198 -0
- package/one/things/plans/landing.md +728 -0
- package/one/things/plans/layout.md +205 -0
- package/one/things/plans/mail-backend.md +1308 -0
- package/one/things/plans/mail.md +2624 -0
- package/one/things/plans/next-features.md +83 -0
- package/one/things/plans/one.md +658 -0
- package/one/things/plans/ontology-6-dimensions.md +2216 -0
- package/one/things/plans/ontology-driven-strategy.md +866 -0
- package/one/things/plans/ontology-ui-approach.md +357 -0
- package/one/things/plans/open-agent.md +785 -0
- package/one/things/plans/performace.md +90 -0
- package/one/things/plans/releases.md +809 -0
- package/one/things/plans/repos.md +76 -0
- package/one/things/plans/separate-copy-2.md +1293 -0
- package/one/things/plans/separate-copy-3.md +2458 -0
- package/one/things/plans/separate-copy.md +1293 -0
- package/one/things/plans/separate.md +1983 -0
- package/one/things/plans/shadcn-integration-summary.md +450 -0
- package/one/things/plans/sidebar.md +172 -0
- package/one/things/plans/small-fixes.md +5 -0
- package/one/things/plans/test-backend-connection.md +476 -0
- package/one/things/plans/workflow-files.md +1196 -0
- package/one/things/plans/workflow.md +1372 -0
- package/one/things/products/cascade-landing-page.md +737 -0
- package/one/things/products/cascade.md +1518 -0
- package/one/things/products/context-engineering.md +1427 -0
- package/one/things/products/onthology.md +0 -0
- package/one/things/products/ontology-ui-shadcn.md +1280 -0
- package/one/things/products/ontology-ui.md +1387 -0
- package/one/things/products/ontology.md +717 -0
- package/one/things/products/sdk.md +557 -0
- package/one/things/promptkit.md +903 -0
- package/one/things/service-providers-new.md +982 -0
- package/one/things/service-providers.md +1092 -0
- package/one/things/things.md +349 -0
- package/one/things/todo.md +1248 -0
- package/package.json +5 -2
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
# ONE Platform - AI Development Rules
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Last Updated:** 2025-01-15
|
|
5
|
+
**Purpose:** Golden rules for AI agents building the ONE platform
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Core Philosophy
|
|
10
|
+
|
|
11
|
+
**The ONE platform gets BETTER with scale because:**
|
|
12
|
+
1. Every new feature adds to the pattern library
|
|
13
|
+
2. Types prevent breaking changes automatically
|
|
14
|
+
3. The ontology constrains design space productively
|
|
15
|
+
4. Services compose rather than duplicate
|
|
16
|
+
5. Tests validate that new code works with existing code
|
|
17
|
+
|
|
18
|
+
**AI agents must read this file FIRST before any code generation.**
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## The 6-Dimension Ontology (MEMORIZE THIS)
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
┌─────────────┐
|
|
26
|
+
│ ENTITIES │ ← Everything is an entity (users, agents, content, tokens)
|
|
27
|
+
└──────┬──────┘
|
|
28
|
+
│
|
|
29
|
+
├──→ ┌──────────────┐
|
|
30
|
+
│ │ CONNECTIONS │ ← All relationships between entities
|
|
31
|
+
│ └──────────────┘
|
|
32
|
+
│
|
|
33
|
+
├──→ ┌──────────────┐
|
|
34
|
+
│ │ EVENTS │ ← All actions, changes, time-series data
|
|
35
|
+
│ └──────────────┘
|
|
36
|
+
│
|
|
37
|
+
└──→ ┌──────────────┐
|
|
38
|
+
│ TAGS │ ← Categorization and taxonomy
|
|
39
|
+
└──────────────┘
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Every feature you build MUST use this ontology. No exceptions.**
|
|
43
|
+
|
|
44
|
+
### Entities Table
|
|
45
|
+
- **What:** All nouns in the system
|
|
46
|
+
- **Examples:** creator, ai_clone, blog_post, token, course, message
|
|
47
|
+
- **Fields:** type, name, properties (JSON), status, timestamps
|
|
48
|
+
- **Rule:** If you're modeling a "thing", it's an entity
|
|
49
|
+
|
|
50
|
+
### Connections Table
|
|
51
|
+
- **What:** All relationships between entities
|
|
52
|
+
- **Examples:** creator owns token, user enrolled_in course, agent powers clone
|
|
53
|
+
- **Fields:** fromEntityId, toEntityId, relationshipType, metadata
|
|
54
|
+
- **Rule:** If you're modeling "X relates to Y", it's a connection
|
|
55
|
+
|
|
56
|
+
### Events Table
|
|
57
|
+
- **What:** All actions, state changes, metrics
|
|
58
|
+
- **Examples:** token_purchased, content_published, clone_interaction
|
|
59
|
+
- **Fields:** entityId, eventType, timestamp, metadata, actorId
|
|
60
|
+
- **Rule:** If you're modeling "X happened at time T", it's an event
|
|
61
|
+
|
|
62
|
+
### Tags Table
|
|
63
|
+
- **What:** Categorization, taxonomy, filtering
|
|
64
|
+
- **Examples:** industry:fitness, skill:video-editing, format:tutorial
|
|
65
|
+
- **Fields:** name, category, color, icon
|
|
66
|
+
- **Rule:** If you're modeling "categories", use tags + entityTags junction
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Technology Stack (MUST USE EXACTLY)
|
|
71
|
+
|
|
72
|
+
### Frontend
|
|
73
|
+
- **Astro 5.14+** - Pages and routing
|
|
74
|
+
- **React 19** - Interactive components
|
|
75
|
+
- **shadcn/ui** - UI components (50+ pre-installed)
|
|
76
|
+
- **Tailwind CSS v4** - Styling (utility-first)
|
|
77
|
+
- **TypeScript 5.9+** - Strict mode, no implicit any
|
|
78
|
+
|
|
79
|
+
### Backend
|
|
80
|
+
- **Convex** - Real-time database + backend functions
|
|
81
|
+
- **Effect.ts** - Service layer (typed errors, DI, composition)
|
|
82
|
+
- **Confect** - Bridge between Effect.ts and Convex
|
|
83
|
+
|
|
84
|
+
### Auth & Infrastructure
|
|
85
|
+
- **Better Auth** - Authentication (email/password + OAuth)
|
|
86
|
+
- **Resend** - Transactional emails
|
|
87
|
+
- **Stripe Connect** - Payments
|
|
88
|
+
- **Base L2** - Blockchain for tokens
|
|
89
|
+
- **ElevenLabs** - Voice cloning
|
|
90
|
+
- **OpenAI** - AI/LLM operations
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Code Generation Rules
|
|
95
|
+
|
|
96
|
+
### Rule 1: Read Context FIRST
|
|
97
|
+
Before generating ANY code, read these files in order:
|
|
98
|
+
1. `.ai/context/ontology.md` - Data model
|
|
99
|
+
2. `.ai/context/architecture.md` - System design
|
|
100
|
+
3. `.ai/context/patterns.md` - Code patterns
|
|
101
|
+
4. `.ai/specs/[relevant-feature].md` - Feature spec
|
|
102
|
+
5. `.ai/context/file-map.md` - Where files live
|
|
103
|
+
|
|
104
|
+
### Rule 2: Types Are Sacred
|
|
105
|
+
```typescript
|
|
106
|
+
// ✅ CORRECT: Explicit types
|
|
107
|
+
export const createClone = (creatorId: Id<"entities">): Effect.Effect<
|
|
108
|
+
{ cloneId: Id<"entities">; voiceId: string },
|
|
109
|
+
VoiceCloneError | InsufficientContentError,
|
|
110
|
+
AICloneService
|
|
111
|
+
> => { ... }
|
|
112
|
+
|
|
113
|
+
// ❌ WRONG: Implicit or any types
|
|
114
|
+
export const createClone = (creatorId: any) => { ... }
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Never use `any` unless:**
|
|
118
|
+
- Properties field in entities (stores arbitrary JSON)
|
|
119
|
+
- Interfacing with untyped external APIs
|
|
120
|
+
- Even then, add comment explaining why
|
|
121
|
+
|
|
122
|
+
### Rule 3: Effect.ts for ALL Business Logic
|
|
123
|
+
```typescript
|
|
124
|
+
// ✅ CORRECT: Effect.ts service
|
|
125
|
+
export class TokenService extends Effect.Service<TokenService>()(
|
|
126
|
+
"TokenService",
|
|
127
|
+
{
|
|
128
|
+
effect: Effect.gen(function* () {
|
|
129
|
+
const db = yield* ConvexDatabase;
|
|
130
|
+
const stripe = yield* StripeProvider;
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
purchaseTokens: (args) =>
|
|
134
|
+
Effect.gen(function* () {
|
|
135
|
+
// Typed errors, automatic rollback, composable
|
|
136
|
+
const payment = yield* stripe.charge(args.amount);
|
|
137
|
+
const tokens = yield* blockchain.mint(args.tokens);
|
|
138
|
+
return { payment, tokens };
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
}),
|
|
142
|
+
dependencies: [ConvexDatabase.Default, StripeProvider.Default]
|
|
143
|
+
}
|
|
144
|
+
) {}
|
|
145
|
+
|
|
146
|
+
// ❌ WRONG: Raw async/await with try/catch
|
|
147
|
+
export const purchaseTokens = async (args) => {
|
|
148
|
+
try {
|
|
149
|
+
const payment = await stripe.charge(args.amount);
|
|
150
|
+
// Silent failures, no rollback, hard to test
|
|
151
|
+
} catch (e) {
|
|
152
|
+
// Lost type information
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Rule 4: Convex Functions Are Thin Wrappers
|
|
158
|
+
```typescript
|
|
159
|
+
// ✅ CORRECT: Thin wrapper calling Effect.ts service
|
|
160
|
+
export const purchaseTokens = confect.mutation({
|
|
161
|
+
args: { userId: v.id("entities"), amount: v.number() },
|
|
162
|
+
handler: (ctx, args) =>
|
|
163
|
+
Effect.gen(function* () {
|
|
164
|
+
const tokenService = yield* TokenService;
|
|
165
|
+
return yield* tokenService.purchaseTokens(args);
|
|
166
|
+
}).pipe(Effect.provide(MainLayer))
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// ❌ WRONG: Business logic in Convex function
|
|
170
|
+
export const purchaseTokens = mutation({
|
|
171
|
+
handler: async (ctx, args) => {
|
|
172
|
+
// Lots of business logic here - should be in service!
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Rule 5: React Components Use Convex Hooks
|
|
178
|
+
```typescript
|
|
179
|
+
// ✅ CORRECT: Convex hooks + shadcn
|
|
180
|
+
import { useQuery, useMutation } from "convex/react";
|
|
181
|
+
import { api } from "@/convex/_generated/api";
|
|
182
|
+
import { Button } from "@/components/ui/button";
|
|
183
|
+
|
|
184
|
+
export function TokenPurchase({ tokenId }: { tokenId: Id<"entities"> }) {
|
|
185
|
+
const balance = useQuery(api.tokens.getBalance, { tokenId });
|
|
186
|
+
const purchase = useMutation(api.tokens.purchaseTokens);
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Button
|
|
190
|
+
onClick={() => purchase({ tokenId, amount: 100 })}
|
|
191
|
+
disabled={balance === undefined}
|
|
192
|
+
>
|
|
193
|
+
Purchase 100 Tokens
|
|
194
|
+
</Button>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ❌ WRONG: Direct fetch or manual state
|
|
199
|
+
export function TokenPurchase() {
|
|
200
|
+
const [balance, setBalance] = useState(null);
|
|
201
|
+
useEffect(() => {
|
|
202
|
+
fetch("/api/balance").then(r => setBalance(r.json()));
|
|
203
|
+
}, []);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Rule 6: Astro Pages Server-Side Render
|
|
208
|
+
```typescript
|
|
209
|
+
// ✅ CORRECT: SSR with Convex client
|
|
210
|
+
---
|
|
211
|
+
import { ConvexHttpClient } from "convex/browser";
|
|
212
|
+
import { api } from "@/convex/_generated/api";
|
|
213
|
+
import TokenPurchase from "@/components/features/tokens/TokenPurchase";
|
|
214
|
+
|
|
215
|
+
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
216
|
+
const token = await convex.query(api.tokens.get, { id: Astro.params.id });
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
<Layout>
|
|
220
|
+
<h1>{token.name}</h1>
|
|
221
|
+
<TokenPurchase client:load tokenId={token._id} />
|
|
222
|
+
</Layout>
|
|
223
|
+
|
|
224
|
+
// ❌ WRONG: Client-side only fetching
|
|
225
|
+
---
|
|
226
|
+
import TokenPurchase from "@/components/features/tokens/TokenPurchase";
|
|
227
|
+
---
|
|
228
|
+
<TokenPurchase client:load /> <!-- No SSR data -->
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Rule 7: File Naming Conventions
|
|
232
|
+
```
|
|
233
|
+
✅ CORRECT:
|
|
234
|
+
src/components/features/tokens/TokenPurchase.tsx
|
|
235
|
+
convex/services/tokens/purchase.ts
|
|
236
|
+
convex/mutations/tokens.ts
|
|
237
|
+
tests/integration/token-purchase.test.ts
|
|
238
|
+
|
|
239
|
+
❌ WRONG:
|
|
240
|
+
src/components/TokenPurchaseComponent.tsx (redundant "Component")
|
|
241
|
+
convex/tokenService.ts (not in services/ folder)
|
|
242
|
+
convex/mutations/token-mutations.ts (redundant "mutations")
|
|
243
|
+
tests/tokenPurchase.test.ts (not organized by type)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Rule 8: Error Classes Are Typed
|
|
247
|
+
```typescript
|
|
248
|
+
// ✅ CORRECT: Tagged error classes
|
|
249
|
+
export class InsufficientTokensError {
|
|
250
|
+
readonly _tag = "InsufficientTokensError";
|
|
251
|
+
constructor(
|
|
252
|
+
readonly userId: Id<"entities">,
|
|
253
|
+
readonly required: number,
|
|
254
|
+
readonly available: number
|
|
255
|
+
) {}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Usage
|
|
259
|
+
Effect.catchTag("InsufficientTokensError", (error) => {
|
|
260
|
+
// TypeScript knows error.required, error.available exist
|
|
261
|
+
return Effect.succeed({ message: "Buy more tokens" });
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
// ❌ WRONG: Generic errors
|
|
265
|
+
throw new Error("Insufficient tokens");
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Rule 9: Tests Define Behavior
|
|
269
|
+
```typescript
|
|
270
|
+
// ✅ CORRECT: Test defines expected behavior
|
|
271
|
+
describe("TokenService.purchaseTokens", () => {
|
|
272
|
+
it("should mint tokens and charge payment atomically", async () => {
|
|
273
|
+
const result = await Effect.runPromise(
|
|
274
|
+
tokenService.purchaseTokens({
|
|
275
|
+
userId: "user-123",
|
|
276
|
+
amount: 100,
|
|
277
|
+
usdAmount: 10
|
|
278
|
+
}).pipe(Effect.provide(TestLayer))
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
expect(result.tokens).toBe(100);
|
|
282
|
+
expect(mockStripe.charges).toHaveLength(1);
|
|
283
|
+
expect(mockBlockchain.minted).toBe(100);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("should rollback on payment failure", async () => {
|
|
287
|
+
mockStripe.shouldFail = true;
|
|
288
|
+
|
|
289
|
+
await expect(
|
|
290
|
+
Effect.runPromise(purchase.pipe(Effect.provide(TestLayer)))
|
|
291
|
+
).rejects.toThrow("PaymentFailedError");
|
|
292
|
+
|
|
293
|
+
expect(mockBlockchain.minted).toBe(0); // Rolled back
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
// ❌ WRONG: Test without clear assertions
|
|
298
|
+
it("works", async () => {
|
|
299
|
+
await purchaseTokens({ userId: "123", amount: 100 });
|
|
300
|
+
// No assertions about what "works" means
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Rule 10: Documentation Is Code
|
|
305
|
+
```typescript
|
|
306
|
+
// ✅ CORRECT: JSDoc with examples
|
|
307
|
+
/**
|
|
308
|
+
* Purchases tokens for a user, charging their payment method and minting
|
|
309
|
+
* tokens on the blockchain atomically.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* const result = yield* tokenService.purchaseTokens({
|
|
314
|
+
* userId: "user-123",
|
|
315
|
+
* amount: 100,
|
|
316
|
+
* usdAmount: 10
|
|
317
|
+
* });
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @throws {InsufficientTokensError} When user tries to buy more than available
|
|
321
|
+
* @throws {PaymentFailedError} When Stripe payment fails
|
|
322
|
+
* @throws {BlockchainError} When minting fails
|
|
323
|
+
*/
|
|
324
|
+
purchaseTokens: (args: PurchaseArgs) => Effect.Effect<...>
|
|
325
|
+
|
|
326
|
+
// ❌ WRONG: No documentation
|
|
327
|
+
purchaseTokens: (args) => { ... }
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Agent Specialization
|
|
333
|
+
|
|
334
|
+
### Frontend Agent
|
|
335
|
+
**Responsibilities:**
|
|
336
|
+
- Generate React components (TSX files)
|
|
337
|
+
- Create Astro pages
|
|
338
|
+
- Use shadcn/ui components
|
|
339
|
+
- Integrate Convex hooks (useQuery, useMutation)
|
|
340
|
+
- Handle loading/error states
|
|
341
|
+
- Responsive design with Tailwind
|
|
342
|
+
|
|
343
|
+
**Files you can modify:**
|
|
344
|
+
- `src/components/**/*`
|
|
345
|
+
- `src/pages/**/*`
|
|
346
|
+
- `src/layouts/**/*`
|
|
347
|
+
- `src/styles/**/*`
|
|
348
|
+
- `src/lib/hooks.ts`
|
|
349
|
+
|
|
350
|
+
**Files you CANNOT modify:**
|
|
351
|
+
- `convex/**/*` (backend agent's domain)
|
|
352
|
+
|
|
353
|
+
**Read before generating:**
|
|
354
|
+
1. `.ai/specs/[feature].md` - Feature spec
|
|
355
|
+
2. `convex/_generated/api.d.ts` - Available APIs
|
|
356
|
+
3. `src/components/ui/*` - Available shadcn components
|
|
357
|
+
|
|
358
|
+
### Backend Agent
|
|
359
|
+
**Responsibilities:**
|
|
360
|
+
- Generate Convex schema changes
|
|
361
|
+
- Create Effect.ts services
|
|
362
|
+
- Write mutations/queries/actions
|
|
363
|
+
- Implement workflows
|
|
364
|
+
- Handle external API integrations
|
|
365
|
+
|
|
366
|
+
**Files you can modify:**
|
|
367
|
+
- `convex/**/*`
|
|
368
|
+
|
|
369
|
+
**Files you CANNOT modify:**
|
|
370
|
+
- `src/**/*` (frontend agent's domain)
|
|
371
|
+
|
|
372
|
+
**Read before generating:**
|
|
373
|
+
1. `.ai/specs/[feature].md` - Feature spec
|
|
374
|
+
2. `.ai/context/ontology.md` - Data model rules
|
|
375
|
+
3. `convex/schema/types.ts` - Entity property types
|
|
376
|
+
|
|
377
|
+
### Ingestor Agent
|
|
378
|
+
**Responsibilities:**
|
|
379
|
+
- Migrate data from old sites (one.ie, bullfm)
|
|
380
|
+
- Transform data to 6-dimension ontology
|
|
381
|
+
- Preserve relationships
|
|
382
|
+
- Generate migration reports
|
|
383
|
+
|
|
384
|
+
**Files you can modify:**
|
|
385
|
+
- `scripts/migration/**/*`
|
|
386
|
+
|
|
387
|
+
**Read before generating:**
|
|
388
|
+
1. Old database schema
|
|
389
|
+
2. `.ai/context/ontology.md` - Target schema
|
|
390
|
+
3. Transformation rules
|
|
391
|
+
|
|
392
|
+
### Test Agent
|
|
393
|
+
**Responsibilities:**
|
|
394
|
+
- Generate unit tests for services
|
|
395
|
+
- Generate integration tests for workflows
|
|
396
|
+
- Generate E2E tests for user flows
|
|
397
|
+
- Mock services using Effect.ts Layer
|
|
398
|
+
|
|
399
|
+
**Files you can modify:**
|
|
400
|
+
- `tests/**/*`
|
|
401
|
+
|
|
402
|
+
**Read before generating:**
|
|
403
|
+
1. Implementation files
|
|
404
|
+
2. `.ai/specs/[feature].md` - Expected behavior
|
|
405
|
+
3. Existing test patterns
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Common Patterns Library
|
|
410
|
+
|
|
411
|
+
### Pattern: Create Entity with Relationships
|
|
412
|
+
```typescript
|
|
413
|
+
Effect.gen(function* () {
|
|
414
|
+
// 1. Create main entity
|
|
415
|
+
const entityId = yield* Effect.tryPromise(() =>
|
|
416
|
+
db.insert("entities", {
|
|
417
|
+
type: "course",
|
|
418
|
+
name: args.title,
|
|
419
|
+
properties: { /* ... */ },
|
|
420
|
+
status: "draft",
|
|
421
|
+
createdAt: Date.now(),
|
|
422
|
+
updatedAt: Date.now(),
|
|
423
|
+
})
|
|
424
|
+
);
|
|
425
|
+
|
|
426
|
+
// 2. Create ownership relationship
|
|
427
|
+
yield* Effect.tryPromise(() =>
|
|
428
|
+
db.insert("connections", {
|
|
429
|
+
fromEntityId: args.creatorId,
|
|
430
|
+
toEntityId: entityId,
|
|
431
|
+
relationshipType: "owns",
|
|
432
|
+
createdAt: Date.now(),
|
|
433
|
+
})
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
// 3. Log creation event
|
|
437
|
+
yield* Effect.tryPromise(() =>
|
|
438
|
+
db.insert("events", {
|
|
439
|
+
entityId,
|
|
440
|
+
eventType: "course_created",
|
|
441
|
+
actorId: args.creatorId,
|
|
442
|
+
timestamp: Date.now(),
|
|
443
|
+
actorType: "user",
|
|
444
|
+
metadata: { /* ... */ },
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
|
|
448
|
+
return entityId;
|
|
449
|
+
})
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Pattern: Query Relationships
|
|
453
|
+
```typescript
|
|
454
|
+
// Get all entities of type X owned by user Y
|
|
455
|
+
const courses = yield* Effect.tryPromise(() =>
|
|
456
|
+
db.query("connections")
|
|
457
|
+
.withIndex("from_type", q =>
|
|
458
|
+
q.eq("fromEntityId", userId)
|
|
459
|
+
.eq("relationshipType", "owns")
|
|
460
|
+
)
|
|
461
|
+
.collect()
|
|
462
|
+
.then(conns =>
|
|
463
|
+
Promise.all(
|
|
464
|
+
conns
|
|
465
|
+
.filter(c => c.toEntity.type === "course")
|
|
466
|
+
.map(c => c.toEntity)
|
|
467
|
+
)
|
|
468
|
+
)
|
|
469
|
+
);
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Pattern: Atomic Multi-Operation
|
|
473
|
+
```typescript
|
|
474
|
+
const result = yield* Effect.all(
|
|
475
|
+
[
|
|
476
|
+
operation1(),
|
|
477
|
+
operation2(),
|
|
478
|
+
operation3(),
|
|
479
|
+
],
|
|
480
|
+
{ concurrency: 3 }
|
|
481
|
+
).pipe(
|
|
482
|
+
Effect.tap(([r1, r2, r3]) =>
|
|
483
|
+
// All succeeded, save to DB
|
|
484
|
+
Effect.tryPromise(() => db.insert("events", { actorId: userId, /* ... */ }))
|
|
485
|
+
),
|
|
486
|
+
Effect.onError(() =>
|
|
487
|
+
// Any failed, rollback all
|
|
488
|
+
Effect.all([
|
|
489
|
+
rollback1(),
|
|
490
|
+
rollback2(),
|
|
491
|
+
rollback3(),
|
|
492
|
+
])
|
|
493
|
+
)
|
|
494
|
+
);
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Pattern: React Component with Convex
|
|
498
|
+
```typescript
|
|
499
|
+
import { useQuery, useMutation } from "convex/react";
|
|
500
|
+
import { api } from "@/convex/_generated/api";
|
|
501
|
+
|
|
502
|
+
export function FeatureComponent({ id }: { id: Id<"entities"> }) {
|
|
503
|
+
const data = useQuery(api.feature.get, { id });
|
|
504
|
+
const update = useMutation(api.feature.update);
|
|
505
|
+
|
|
506
|
+
if (data === undefined) {
|
|
507
|
+
return <Skeleton />; // Loading state
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
if (data === null) {
|
|
511
|
+
return <Alert>Not found</Alert>; // Error state
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
return (
|
|
515
|
+
<Card>
|
|
516
|
+
<CardHeader>
|
|
517
|
+
<CardTitle>{data.name}</CardTitle>
|
|
518
|
+
</CardHeader>
|
|
519
|
+
<CardContent>
|
|
520
|
+
<Button onClick={() => update({ id, /* ... */ })}>
|
|
521
|
+
Update
|
|
522
|
+
</Button>
|
|
523
|
+
</CardContent>
|
|
524
|
+
</Card>
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Pre-Generation Checklist
|
|
532
|
+
|
|
533
|
+
Before generating ANY code, verify:
|
|
534
|
+
|
|
535
|
+
- [ ] I have read `.ai/rules.md` (this file)
|
|
536
|
+
- [ ] I have read the relevant spec in `.ai/specs/`
|
|
537
|
+
- [ ] I have read `.ai/context/ontology.md`
|
|
538
|
+
- [ ] I understand which entities/connections/events are involved
|
|
539
|
+
- [ ] I know which agent I am (frontend/backend/test/ingestor)
|
|
540
|
+
- [ ] I am only modifying files in my domain
|
|
541
|
+
- [ ] I will use Effect.ts for business logic
|
|
542
|
+
- [ ] I will use explicit types everywhere
|
|
543
|
+
- [ ] I will write tests that define behavior
|
|
544
|
+
- [ ] I will update documentation after generating code
|
|
545
|
+
|
|
546
|
+
---
|
|
547
|
+
|
|
548
|
+
## Post-Generation Checklist
|
|
549
|
+
|
|
550
|
+
After generating code, verify:
|
|
551
|
+
|
|
552
|
+
- [ ] TypeScript compiles with no errors (`bunx astro check`)
|
|
553
|
+
- [ ] Tests pass (`bun test`)
|
|
554
|
+
- [ ] Code follows patterns in `.ai/context/patterns.md`
|
|
555
|
+
- [ ] No `any` types except in `properties` fields
|
|
556
|
+
- [ ] All errors are typed classes with `_tag`
|
|
557
|
+
- [ ] React components have loading/error states
|
|
558
|
+
- [ ] Convex functions are thin wrappers around services
|
|
559
|
+
- [ ] File is in correct location per `.ai/context/file-map.md`
|
|
560
|
+
- [ ] Updated `.ai/context/file-map.md` if new files created
|
|
561
|
+
- [ ] Added JSDoc comments with examples
|
|
562
|
+
|
|
563
|
+
---
|
|
564
|
+
|
|
565
|
+
## What Makes This Better Than Typical Codebases
|
|
566
|
+
|
|
567
|
+
**Typical codebase problems:**
|
|
568
|
+
1. No clear data model → AI doesn't know where to put things
|
|
569
|
+
2. Mixed concerns → AI breaks things unintentionally
|
|
570
|
+
3. Implicit types → AI generates buggy code
|
|
571
|
+
4. No composition → AI duplicates logic
|
|
572
|
+
5. No tests → AI doesn't know if it broke something
|
|
573
|
+
|
|
574
|
+
**ONE platform solutions:**
|
|
575
|
+
1. 6-dimension ontology → AI always knows data structure
|
|
576
|
+
2. Agent specialization → AI stays in its lane
|
|
577
|
+
3. Explicit types → AI catches errors at compile time
|
|
578
|
+
4. Effect.ts services → AI composes existing functions
|
|
579
|
+
5. Test-driven → AI validates behavior automatically
|
|
580
|
+
|
|
581
|
+
**The result:**
|
|
582
|
+
- Code quality INCREASES with codebase size
|
|
583
|
+
- Later features are EASIER than early features
|
|
584
|
+
- Refactoring is SAFE because types + tests catch breaks
|
|
585
|
+
- AI agents get SMARTER because they learn patterns
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Emergency: When AI Gets Confused
|
|
590
|
+
|
|
591
|
+
If you (AI agent) are unsure about ANYTHING:
|
|
592
|
+
|
|
593
|
+
1. **STOP generating code**
|
|
594
|
+
2. **ASK the human:** "I need clarification on [specific thing]"
|
|
595
|
+
3. **READ more context:** Re-read specs and ontology
|
|
596
|
+
4. **SEARCH examples:** Look for similar patterns in existing code
|
|
597
|
+
5. **SIMPLIFY:** Start with simplest possible solution
|
|
598
|
+
|
|
599
|
+
**NEVER:**
|
|
600
|
+
- Generate code you're not confident about
|
|
601
|
+
- Use `any` because you don't know the type
|
|
602
|
+
- Copy-paste without understanding
|
|
603
|
+
- Modify files outside your agent domain
|
|
604
|
+
- Skip writing tests
|
|
605
|
+
|
|
606
|
+
---
|
|
607
|
+
|
|
608
|
+
## Version Control
|
|
609
|
+
|
|
610
|
+
This file is versioned. Breaking changes require major version bump.
|
|
611
|
+
|
|
612
|
+
**Current: 1.0.0**
|
|
613
|
+
|
|
614
|
+
When updating:
|
|
615
|
+
- Document what changed
|
|
616
|
+
- Update all affected specs
|
|
617
|
+
- Regenerate affected code
|
|
618
|
+
- Update tests
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
**END OF GOLDEN RULES**
|
|
623
|
+
|
|
624
|
+
If you're an AI agent reading this: You now have the foundation to build production-quality code that makes the ONE platform better with every feature. Read the ontology next, then the specific feature spec you're implementing.
|
|
625
|
+
|
|
626
|
+
If you're a human reading this: Your AI agents now have clear, unambiguous rules. They will generate consistent, high-quality code because they understand the system architecture deeply.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Inference Score
|
|
2
|
+
|
|
3
|
+
**Measures ontology stability. Lower is better.**
|
|
4
|
+
|
|
5
|
+
Current Score: **16**
|
|
6
|
+
Last Hash: `7d2a18a423f25d5a013feb6687b20e731ed2eb9b46dce88fabec171dea7c2cd6`
|
|
7
|
+
Updated: **2025-10-07T18:38:31Z**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What This Measures
|
|
12
|
+
|
|
13
|
+
The inference score tracks how many times AI agents modify the core ontology files. Each modification increments the score.
|
|
14
|
+
|
|
15
|
+
**Goal:** Keep score < 20 per month.
|
|
16
|
+
|
|
17
|
+
**Philosophy:** A stable ontology means:
|
|
18
|
+
- AI agents understand the structure
|
|
19
|
+
- Fewer breaking changes
|
|
20
|
+
- More predictable code generation
|
|
21
|
+
- Beautiful, lasting architecture
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## History
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
2025-10-07T17:09:16Z: score=1 (hash=16cf802ad68a21fba7e420a5bde516cc3097c28c697a8bed48287acc0d12fe86)
|
|
29
|
+
2025-10-07T17:09:51Z: score=2 (hash=16cf802ad68a21fba7e420a5bde516cc3097c28c697a8bed48287acc0d12fe86)
|
|
30
|
+
2025-10-07T17:10:09Z: score=3 (hash=bf89c92d3b51e19ccae7601168235f8d9ef1cc2f48c808d58f39a3fb54c2040a)
|
|
31
|
+
2025-10-07T17:10:25Z: score=4 (hash=35ba9e361173e0ce047ad8226ce1ecb3961942d2da968ba8b406cd973054aa92)
|
|
32
|
+
2025-10-07T17:18:20Z: score=5 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
33
|
+
2025-10-07T17:18:36Z: score=6 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
34
|
+
2025-10-07T17:18:59Z: score=7 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
35
|
+
2025-10-07T17:19:22Z: score=8 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
36
|
+
2025-10-07T17:19:46Z: score=9 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
37
|
+
2025-10-07T17:20:22Z: score=10 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
38
|
+
2025-10-07T17:20:44Z: score=11 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
39
|
+
2025-10-07T17:21:06Z: score=12 (hash=61ba95ae02fba0988c1617cb2f566bb35dc00dc0f3ca45906ac5547f45c3c7ea)
|
|
40
|
+
2025-10-07T17:21:23Z: score=13 (hash=6c5f05615fc52607c2fef10dae59bc7952d517ae47df3b7ba68a7e875261bd55)
|
|
41
|
+
2025-10-07T17:21:24Z: score=14 (hash=6c5f05615fc52607c2fef10dae59bc7952d517ae47df3b7ba68a7e875261bd55)
|
|
42
|
+
2025-10-07T17:21:52Z: score=15 (hash=adbe7c5cd7e0d7bd1f17917054091b9b02204936aaeb2e60a395df39e7deb8cd)
|
|
43
|
+
2025-10-07T18:38:31Z: score=16 (hash=7d2a18a423f25d5a013feb6687b20e731ed2eb9b46dce88fabec171dea7c2cd6)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Interpretation
|
|
49
|
+
|
|
50
|
+
- **Score 1-10:** Excellent - Ontology is stable and well-understood
|
|
51
|
+
- **Score 11-20:** Good - Some refinement happening
|
|
52
|
+
- **Score 21-50:** Concerning - May indicate confusion or missing documentation
|
|
53
|
+
- **Score 50+:** Red flag - Ontology needs major rethinking
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Why This Matters
|
|
58
|
+
|
|
59
|
+
A stable ontology enables:
|
|
60
|
+
|
|
61
|
+
1. **AI Code Generation** - Agents know exactly where things go
|
|
62
|
+
2. **Type Safety** - Fewer runtime errors
|
|
63
|
+
3. **Predictable Growth** - New features fit existing patterns
|
|
64
|
+
4. **Developer Happiness** - Clear mental model
|
|
65
|
+
5. **Long-term Maintenance** - Code ages like fine wine
|
|
66
|
+
|
|
67
|
+
**Stability = Beauty**
|