@oyolincc/create 0.2.0 → 0.3.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/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -13
- package/templates/hono-fullstack/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/hono-fullstack/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/hono-fullstack/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/hono-fullstack/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/hono-fullstack/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/hono-fullstack/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/implement/SKILL.md +15 -0
- package/templates/hono-fullstack/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/hono-fullstack/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/hono-fullstack/.agents/skills/prototype/UI.md +112 -0
- package/templates/hono-fullstack/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/research/SKILL.md +12 -0
- package/templates/hono-fullstack/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/hono-fullstack/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/hono-fullstack/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/tdd/mocking.md +59 -0
- package/templates/hono-fullstack/.agents/skills/tdd/tests.md +77 -0
- package/templates/hono-fullstack/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/hono-fullstack/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/hono-fullstack/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/hono-fullstack/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/hono-fullstack/.agents/skills/teach/SKILL.md +140 -0
- package/templates/hono-fullstack/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/hono-fullstack/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/hono-fullstack/.agents/skills/triage/SKILL.md +112 -0
- package/templates/hono-fullstack/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/hono-fullstack/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/hono-fullstack/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/hono-fullstack/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/wizard/template.sh +204 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.changeset/README.md +8 -0
- package/templates/hono-fullstack/.changeset/config.json +11 -0
- package/templates/hono-fullstack/.editorconfig +31 -0
- package/templates/hono-fullstack/.gitattributes +39 -0
- package/templates/hono-fullstack/.vscode/extensions.json +5 -0
- package/templates/hono-fullstack/.vscode/launch.json +36 -0
- package/templates/hono-fullstack/.vscode/settings.json +26 -0
- package/templates/hono-fullstack/AGENTS.md +50 -0
- package/templates/hono-fullstack/README.md +51 -0
- package/templates/hono-fullstack/_gitignore +35 -0
- package/templates/hono-fullstack/apps/server/.dev.vars.example +9 -0
- package/templates/hono-fullstack/apps/server/package.json +63 -0
- package/templates/hono-fullstack/apps/server/src/adapters/cloudflare/entry.ts +36 -0
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +62 -0
- package/templates/hono-fullstack/apps/server/src/app.ts +43 -0
- package/templates/hono-fullstack/apps/server/src/config.ts +47 -0
- package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +74 -0
- package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +126 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/constants.ts +23 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +40 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/worker-entry.ts +13 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/pass-through/runner.ts +42 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/piscina/runner.ts +185 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +118 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +49 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
- package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +26 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +9 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +73 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +49 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +58 -0
- package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +44 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/constants.ts +152 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +15 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +16 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/log.ts +67 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/proto.ts +42 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/types.ts +29 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/fetcher.ts +35 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +50 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/types.ts +3 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/utils.ts +36 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/validator.ts +28 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/index.ts +30 -0
- package/templates/hono-fullstack/apps/server/src/virtual-modules.d.ts +5 -0
- package/templates/hono-fullstack/apps/server/tsconfig.json +17 -0
- package/templates/hono-fullstack/apps/server/vite.config.ts +87 -0
- package/templates/hono-fullstack/apps/server/wrangler.jsonc +29 -0
- package/templates/hono-fullstack/apps/stack/backend/cloudflare.ts +5 -0
- package/templates/hono-fullstack/apps/stack/backend/node.ts +3 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/general/ErrorMessage.tsx +4 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/AppLayout.tsx +11 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Header.tsx +7 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Page.tsx +5 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/PageContainer.tsx +5 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +13 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleForm.tsx +45 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleList.tsx +13 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks/api-hooks.ts +14 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/stores/index.ts +3 -0
- package/templates/hono-fullstack/apps/stack/frontend/routeTree.gen.ts +73 -0
- package/templates/hono-fullstack/apps/stack/frontend/router.tsx +22 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +61 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/api/$.ts +18 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +50 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/client.ts +19 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/constants.ts +1 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/errors.ts +33 -0
- package/templates/hono-fullstack/apps/stack/frontend/styles.css +23 -0
- package/templates/hono-fullstack/apps/stack/frontend/vite-env.d.ts +6 -0
- package/templates/hono-fullstack/apps/stack/package.json +59 -0
- package/templates/hono-fullstack/apps/stack/tsconfig.json +13 -0
- package/templates/hono-fullstack/apps/stack/tsr.config.json +5 -0
- package/templates/hono-fullstack/apps/stack/vite.config.ts +82 -0
- package/templates/hono-fullstack/apps/stack/wrangler.jsonc +20 -0
- package/templates/hono-fullstack/docs/agents/domain.md +41 -0
- package/templates/hono-fullstack/docs/agents/issue-tracker.md +30 -0
- package/templates/hono-fullstack/docs/agents/triage-labels.md +15 -0
- package/templates/hono-fullstack/envs/.env.example.server +12 -0
- package/templates/hono-fullstack/envs/.env.example.sqlite +1 -0
- package/templates/hono-fullstack/envs/.env.example.sqlite-d1 +3 -0
- package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite-d1.config.ts +22 -0
- package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite.config.ts +22 -0
- package/templates/hono-fullstack/libs/db/package.json +42 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/client.ts +35 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/d1-client.ts +12 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +37 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/utils.ts +8 -0
- package/templates/hono-fullstack/libs/db/src/shared/types.ts +26 -0
- package/templates/hono-fullstack/libs/db/tsconfig.json +10 -0
- package/templates/hono-fullstack/libs/db/vite.config.ts +25 -0
- package/templates/hono-fullstack/libs/definition/package.json +30 -0
- package/templates/hono-fullstack/libs/definition/src/backend.ts +2 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/log.ts +53 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/middleware.ts +16 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/runtime.ts +12 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/sqlite.ts +26 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/worker.ts +29 -0
- package/templates/hono-fullstack/libs/definition/src/configs/index.ts +5 -0
- package/templates/hono-fullstack/libs/definition/src/configs/proto.ts +81 -0
- package/templates/hono-fullstack/libs/definition/src/configs/schema.ts +23 -0
- package/templates/hono-fullstack/libs/definition/src/frontend.ts +1 -0
- package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +16 -0
- package/templates/hono-fullstack/libs/definition/src/modules/index.ts +1 -0
- package/templates/hono-fullstack/libs/definition/tsconfig.json +5 -0
- package/templates/hono-fullstack/libs/definition/vite.config.ts +16 -0
- package/templates/hono-fullstack/oyo.config.json +13 -0
- package/templates/hono-fullstack/package.json +25 -0
- package/templates/hono-fullstack/pnpm-workspace.yaml +84 -0
- package/templates/hono-fullstack/tsconfig.json +4 -0
- package/templates/hono-fullstack/turbo.json +36 -0
- package/templates/hono-fullstack/vite.config.ts +14 -0
- package/templates/hono-server/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/hono-server/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/hono-server/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/hono-server/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/hono-server/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/hono-server/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/hono-server/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/hono-server/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/hono-server/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/hono-server/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/hono-server/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/hono-server/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/hono-server/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/implement/SKILL.md +15 -0
- package/templates/hono-server/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/hono-server/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/hono-server/.agents/skills/prototype/UI.md +112 -0
- package/templates/hono-server/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/research/SKILL.md +12 -0
- package/templates/hono-server/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/hono-server/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/hono-server/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/tdd/mocking.md +59 -0
- package/templates/hono-server/.agents/skills/tdd/tests.md +77 -0
- package/templates/hono-server/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/hono-server/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/hono-server/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/hono-server/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/hono-server/.agents/skills/teach/SKILL.md +140 -0
- package/templates/hono-server/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/hono-server/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/hono-server/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/hono-server/.agents/skills/triage/SKILL.md +112 -0
- package/templates/hono-server/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/hono-server/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/hono-server/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/hono-server/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/wizard/template.sh +204 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/hono-server/.changeset/README.md +8 -0
- package/templates/hono-server/.changeset/config.json +11 -0
- package/templates/hono-server/.editorconfig +31 -0
- package/templates/hono-server/.gitattributes +39 -0
- package/templates/hono-server/.vscode/extensions.json +5 -0
- package/templates/hono-server/.vscode/launch.json +29 -0
- package/templates/hono-server/.vscode/settings.json +26 -0
- package/templates/hono-server/AGENTS.md +50 -0
- package/templates/hono-server/README.md +44 -0
- package/templates/hono-server/_gitignore +35 -0
- package/templates/hono-server/apps/server/.dev.vars.example +9 -0
- package/templates/hono-server/apps/server/package.json +64 -0
- package/templates/hono-server/apps/server/src/adapters/cloudflare/entry.ts +36 -0
- package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
- package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +62 -0
- package/templates/hono-server/apps/server/src/app.ts +43 -0
- package/templates/hono-server/apps/server/src/config.ts +47 -0
- package/templates/hono-server/apps/server/src/infra/logger/getter.ts +74 -0
- package/templates/hono-server/apps/server/src/infra/logger/pino.ts +126 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/constants.ts +23 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +40 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/example/worker-entry.ts +13 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/pass-through/runner.ts +42 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/piscina/runner.ts +185 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +118 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +49 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
- package/templates/hono-server/apps/server/src/middlewares/cors.ts +26 -0
- package/templates/hono-server/apps/server/src/modules/example/contracts.ts +9 -0
- package/templates/hono-server/apps/server/src/modules/example/routes.ts +73 -0
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +49 -0
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +58 -0
- package/templates/hono-server/apps/server/src/shared/app/types.ts +44 -0
- package/templates/hono-server/apps/server/src/shared/errors/constants.ts +152 -0
- package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +15 -0
- package/templates/hono-server/apps/server/src/shared/errors/handler.ts +16 -0
- package/templates/hono-server/apps/server/src/shared/errors/log.ts +67 -0
- package/templates/hono-server/apps/server/src/shared/errors/proto.ts +42 -0
- package/templates/hono-server/apps/server/src/shared/errors/types.ts +29 -0
- package/templates/hono-server/apps/server/src/shared/network/fetcher.ts +35 -0
- package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +50 -0
- package/templates/hono-server/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
- package/templates/hono-server/apps/server/src/shared/network/types.ts +3 -0
- package/templates/hono-server/apps/server/src/shared/network/utils.ts +36 -0
- package/templates/hono-server/apps/server/src/shared/network/validator.ts +28 -0
- package/templates/hono-server/apps/server/src/shared/utils/index.ts +30 -0
- package/templates/hono-server/apps/server/src/virtual-modules.d.ts +5 -0
- package/templates/hono-server/apps/server/tsconfig.json +17 -0
- package/templates/hono-server/apps/server/vite.config.ts +87 -0
- package/templates/hono-server/apps/server/wrangler.jsonc +29 -0
- package/templates/hono-server/docker/.env.example +4 -0
- package/templates/hono-server/docker/README.md +5 -0
- package/templates/hono-server/docker/local/compose.local.app.yml +21 -0
- package/templates/hono-server/docker/local/local-app-deploy.sh +8 -0
- package/templates/hono-server/docker/local/local-app-down.sh +8 -0
- package/templates/hono-server/docker/prod/.env.example.server +11 -0
- package/templates/hono-server/docker/prod/compose.prod.stack.yml +21 -0
- package/templates/hono-server/docker/prod/update.sh +7 -0
- package/templates/hono-server/docker/server.Dockerfile +38 -0
- package/templates/hono-server/docker/server.Dockerfile.dockerignore +23 -0
- package/templates/hono-server/docs/agents/domain.md +41 -0
- package/templates/hono-server/docs/agents/issue-tracker.md +30 -0
- package/templates/hono-server/docs/agents/triage-labels.md +15 -0
- package/templates/hono-server/envs/.env.example.server +12 -0
- package/templates/hono-server/envs/.env.example.sqlite +1 -0
- package/templates/hono-server/envs/.env.example.sqlite-d1 +3 -0
- package/templates/hono-server/libs/db/drizzle-kit/sqlite-d1.config.ts +22 -0
- package/templates/hono-server/libs/db/drizzle-kit/sqlite.config.ts +22 -0
- package/templates/hono-server/libs/db/package.json +42 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/client.ts +35 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/d1-client.ts +12 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/columns.ts +37 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/utils.ts +8 -0
- package/templates/hono-server/libs/db/src/shared/types.ts +26 -0
- package/templates/hono-server/libs/db/tsconfig.json +10 -0
- package/templates/hono-server/libs/db/vite.config.ts +25 -0
- package/templates/hono-server/libs/definition/package.json +29 -0
- package/templates/hono-server/libs/definition/src/backend.ts +2 -0
- package/templates/hono-server/libs/definition/src/configs/defs/log.ts +53 -0
- package/templates/hono-server/libs/definition/src/configs/defs/middleware.ts +16 -0
- package/templates/hono-server/libs/definition/src/configs/defs/runtime.ts +12 -0
- package/templates/hono-server/libs/definition/src/configs/defs/sqlite.ts +26 -0
- package/templates/hono-server/libs/definition/src/configs/defs/worker.ts +29 -0
- package/templates/hono-server/libs/definition/src/configs/index.ts +5 -0
- package/templates/hono-server/libs/definition/src/configs/proto.ts +81 -0
- package/templates/hono-server/libs/definition/src/configs/schema.ts +23 -0
- package/templates/hono-server/libs/definition/src/modules/example/index.ts +16 -0
- package/templates/hono-server/libs/definition/src/modules/index.ts +1 -0
- package/templates/hono-server/libs/definition/tsconfig.json +5 -0
- package/templates/hono-server/libs/definition/vite.config.ts +15 -0
- package/templates/hono-server/oyo.config.json +13 -0
- package/templates/hono-server/package.json +25 -0
- package/templates/hono-server/pnpm-workspace.yaml +66 -0
- package/templates/hono-server/scripts/.env.example.docker +4 -0
- package/templates/hono-server/scripts/build-docker-server.sh +13 -0
- package/templates/hono-server/scripts/common.sh +20 -0
- package/templates/hono-server/tsconfig.json +4 -0
- package/templates/hono-server/turbo.json +36 -0
- package/templates/hono-server/vite.config.ts +14 -0
- package/templates/monorepo/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/monorepo/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/monorepo/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/monorepo/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/monorepo/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/monorepo/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/monorepo/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/monorepo/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/monorepo/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/monorepo/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/monorepo/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/monorepo/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/monorepo/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/implement/SKILL.md +15 -0
- package/templates/monorepo/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/monorepo/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/monorepo/.agents/skills/prototype/UI.md +112 -0
- package/templates/monorepo/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/research/SKILL.md +12 -0
- package/templates/monorepo/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/monorepo/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/monorepo/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/tdd/mocking.md +59 -0
- package/templates/monorepo/.agents/skills/tdd/tests.md +77 -0
- package/templates/monorepo/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/monorepo/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/monorepo/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/monorepo/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/monorepo/.agents/skills/teach/SKILL.md +140 -0
- package/templates/monorepo/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/monorepo/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/monorepo/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/monorepo/.agents/skills/triage/SKILL.md +112 -0
- package/templates/monorepo/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/monorepo/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/monorepo/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/monorepo/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/wizard/template.sh +204 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/monorepo/.vscode/extensions.json +5 -0
- package/templates/monorepo/.vscode/launch.json +0 -3
- package/templates/monorepo/.vscode/settings.json +3 -1
- package/templates/monorepo/AGENTS.md +50 -0
- package/templates/monorepo/README.md +27 -0
- package/templates/monorepo/_gitignore +5 -0
- package/templates/monorepo/docs/agents/domain.md +41 -0
- package/templates/monorepo/docs/agents/issue-tracker.md +30 -0
- package/templates/monorepo/docs/agents/triage-labels.md +15 -0
- package/templates/monorepo/package.json +4 -3
- package/templates/monorepo/pnpm-workspace.yaml +23 -26
- package/templates/monorepo/turbo.json +27 -3
- package/templates/monorepo/vite.config.ts +1 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
import { defineSchemaConfig, defineStaticConfig } from '../proto'
|
|
3
|
+
|
|
4
|
+
export const $S_LogRollSchemaConfig = v.object({
|
|
5
|
+
loggerDir: v.optional(v.string(), './logs'),
|
|
6
|
+
loggerFileBase: v.optional(
|
|
7
|
+
v.pipe(v.string(), v.minLength(1, 'loggerFileBase must be at least 1 character long')),
|
|
8
|
+
'app',
|
|
9
|
+
),
|
|
10
|
+
})
|
|
11
|
+
export type LogRollSchemaConfig = v.InferOutput<typeof $S_LogRollSchemaConfig>
|
|
12
|
+
export const logRollSchemaConfig = defineSchemaConfig($S_LogRollSchemaConfig)
|
|
13
|
+
|
|
14
|
+
export const $S_LogBaseConfig = v.object({
|
|
15
|
+
loggerLevel: v.optional(
|
|
16
|
+
v.picklist(['trace', 'debug', 'info', 'warn', 'error', 'fatal', 'silent']),
|
|
17
|
+
),
|
|
18
|
+
})
|
|
19
|
+
export type LogBaseConfig = v.InferOutput<typeof $S_LogBaseConfig>
|
|
20
|
+
export const logBaseConfig = defineSchemaConfig($S_LogBaseConfig)
|
|
21
|
+
|
|
22
|
+
// https://github.com/mcollina/pino-roll#options
|
|
23
|
+
export interface LogRollRawConfig {
|
|
24
|
+
frequency: number | string
|
|
25
|
+
extension: string
|
|
26
|
+
size: number | string
|
|
27
|
+
maxFiles: number
|
|
28
|
+
mkdir: boolean
|
|
29
|
+
dateFormat: string
|
|
30
|
+
}
|
|
31
|
+
export const logRollRawConfig = defineStaticConfig<LogRollRawConfig>(() => ({
|
|
32
|
+
frequency: 'daily' as const,
|
|
33
|
+
extension: '.log',
|
|
34
|
+
size: '10M',
|
|
35
|
+
maxFiles: 30,
|
|
36
|
+
mkdir: true,
|
|
37
|
+
dateFormat: 'yyyy-MM-dd',
|
|
38
|
+
}))
|
|
39
|
+
|
|
40
|
+
export interface LogPrettyRawConfig {
|
|
41
|
+
colorize: boolean
|
|
42
|
+
singleLine: boolean
|
|
43
|
+
levelFirst: boolean
|
|
44
|
+
translateTime: string
|
|
45
|
+
ignore: string
|
|
46
|
+
}
|
|
47
|
+
export const logPrettyRawConfig = defineStaticConfig<LogPrettyRawConfig>(() => ({
|
|
48
|
+
colorize: true,
|
|
49
|
+
singleLine: true,
|
|
50
|
+
levelFirst: true,
|
|
51
|
+
translateTime: 'SYS:yyyy-mm-dd HH:MM:ss',
|
|
52
|
+
ignore: 'pid,hostname',
|
|
53
|
+
}))
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
import { defineSchemaConfig } from '../proto'
|
|
3
|
+
|
|
4
|
+
export const $S_CORSConfig = v.object({
|
|
5
|
+
domains: v.pipe(
|
|
6
|
+
v.optional(v.string()),
|
|
7
|
+
v.transform((val) =>
|
|
8
|
+
String(val || '')
|
|
9
|
+
.split(',')
|
|
10
|
+
.map((s) => s.trim())
|
|
11
|
+
.filter(Boolean),
|
|
12
|
+
),
|
|
13
|
+
) as v.GenericSchema<string | undefined, string[]>,
|
|
14
|
+
})
|
|
15
|
+
export type CORSConfig = v.InferOutput<typeof $S_CORSConfig>
|
|
16
|
+
export const corsConfig = defineSchemaConfig($S_CORSConfig)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
import { defineSchemaConfig } from '../proto'
|
|
3
|
+
|
|
4
|
+
export const $S_RuntimeConfig = v.object({
|
|
5
|
+
serverBasePath: v.optional(v.string(), '/'),
|
|
6
|
+
serverEnv: v.optional(
|
|
7
|
+
v.union([v.literal('local'), v.literal('test'), v.literal('staging'), v.literal('main')]),
|
|
8
|
+
'local',
|
|
9
|
+
),
|
|
10
|
+
})
|
|
11
|
+
export type RuntimeConfig = v.InferOutput<typeof $S_RuntimeConfig>
|
|
12
|
+
export const runtimeConfig = defineSchemaConfig($S_RuntimeConfig)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import path from 'node:path'
|
|
2
|
+
import * as v from 'valibot'
|
|
3
|
+
import { defineSchemaConfig } from '../proto'
|
|
4
|
+
import { $S_NonEmptyString } from '../schema'
|
|
5
|
+
|
|
6
|
+
function defaultSqliteDbPath(): string {
|
|
7
|
+
const workspaceRoot = path.join(import.meta.dirname, '../../..')
|
|
8
|
+
return path.join(workspaceRoot, 'db-data', 'repo.sqlite')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const $S_SqliteSchemaConfig = v.object({
|
|
12
|
+
dbPath: v.pipe(
|
|
13
|
+
v.optional($S_NonEmptyString),
|
|
14
|
+
v.transform((dbPath) => dbPath || defaultSqliteDbPath()),
|
|
15
|
+
) as v.GenericSchema<string | undefined, string>,
|
|
16
|
+
})
|
|
17
|
+
export type SqliteSchemaConfig = v.InferOutput<typeof $S_SqliteSchemaConfig>
|
|
18
|
+
export const sqliteSchemaConfig = defineSchemaConfig($S_SqliteSchemaConfig)
|
|
19
|
+
|
|
20
|
+
export const $S_D1SchemaConfig = v.object({
|
|
21
|
+
cloudflareAccountId: $S_NonEmptyString,
|
|
22
|
+
cloudflareDatabaseId: $S_NonEmptyString,
|
|
23
|
+
cloudflareToken: $S_NonEmptyString,
|
|
24
|
+
})
|
|
25
|
+
export type D1SchemaConfig = v.InferOutput<typeof $S_D1SchemaConfig>
|
|
26
|
+
export const d1SchemaConfig = defineSchemaConfig($S_D1SchemaConfig)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
import { defineSchemaConfig } from '../proto'
|
|
3
|
+
import { availableParallelism } from 'node:os'
|
|
4
|
+
|
|
5
|
+
const workerNumber = (minimum: number, name: string) =>
|
|
6
|
+
v.pipe(
|
|
7
|
+
v.union([v.string(), v.number()]),
|
|
8
|
+
v.transform((value) => Number(value)),
|
|
9
|
+
v.integer(`${name} must be an integer`),
|
|
10
|
+
v.minValue(minimum, `${name} must be at least ${minimum}`),
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
export const $S_WorkerConfig = v.object({
|
|
14
|
+
/** Worker 池启动时至少保留的 Worker 数量。 */
|
|
15
|
+
minThreads: v.optional(workerNumber(1, 'minThreads'), 1),
|
|
16
|
+
/** Worker 池允许创建的最大 Worker 数量。 */
|
|
17
|
+
maxThreads: v.optional(workerNumber(1, 'maxThreads'), Math.max(2, availableParallelism() + 1)),
|
|
18
|
+
/** 每个 Worker 可同时执行的任务数量。 */
|
|
19
|
+
concurrentTasksPerWorker: v.optional(workerNumber(1, 'concurrentTasksPerWorker'), 1),
|
|
20
|
+
/** Runner 等待队列允许容纳的最大任务数量。 */
|
|
21
|
+
maxQueue: v.optional(workerNumber(0, 'maxQueue'), 12),
|
|
22
|
+
|
|
23
|
+
/** 非 Piscina 官方配置,任务从提交到完成的最长时间,0 表示不限制。 */
|
|
24
|
+
workerTaskTimeoutMs: v.optional(workerNumber(0, 'workerTaskTimeoutMs'), 30_000),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
export type WorkerConfig = v.InferOutput<typeof $S_WorkerConfig>
|
|
28
|
+
|
|
29
|
+
export const workerConfig = defineSchemaConfig($S_WorkerConfig)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { camelCase, constantCase, kebabCase, snakeCase } from 'change-case'
|
|
2
|
+
import { type ObjectEntries, type ObjectSchema, type InferOutput, parse } from 'valibot'
|
|
3
|
+
|
|
4
|
+
export type ConfigType = 'static' | 'schema'
|
|
5
|
+
export type ContextCase = 'kebab' | 'camel' | 'env' | 'constantCase' | 'snake' | 'raw'
|
|
6
|
+
|
|
7
|
+
const rawCaser = (str: string) => str || ''
|
|
8
|
+
|
|
9
|
+
const caserMap: Record<ContextCase, (str: string) => string> = {
|
|
10
|
+
kebab: kebabCase,
|
|
11
|
+
camel: camelCase,
|
|
12
|
+
env: constantCase,
|
|
13
|
+
constantCase: constantCase,
|
|
14
|
+
snake: snakeCase,
|
|
15
|
+
raw: rawCaser,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ConfigResolver<TParams, TValue> {
|
|
19
|
+
(...args: undefined extends TParams ? [params?: TParams] : [params: TParams]): TValue
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SchemaConfigResolverParams {
|
|
23
|
+
context: Record<string, any>
|
|
24
|
+
matchContextKey?: ContextCase | ((str: string) => string)
|
|
25
|
+
}
|
|
26
|
+
export type SchemaConfigResolver<TSchema extends ObjectSchema<ObjectEntries, any>> = ConfigResolver<
|
|
27
|
+
SchemaConfigResolverParams,
|
|
28
|
+
InferOutput<TSchema>
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
export interface AppConfig<TKind extends ConfigType, R extends ConfigResolver<any, any>> {
|
|
32
|
+
kind: TKind
|
|
33
|
+
resolve: R
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type StaticAppConfig<TValue> = AppConfig<'static', ConfigResolver<undefined, TValue>>
|
|
37
|
+
|
|
38
|
+
export type SchemaAppConfig<TSchema extends ObjectSchema<ObjectEntries, any>> = AppConfig<
|
|
39
|
+
'schema',
|
|
40
|
+
SchemaConfigResolver<TSchema>
|
|
41
|
+
> & {
|
|
42
|
+
schema: TSchema
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const createSchemaResolver = <TSchema extends ObjectSchema<ObjectEntries, any>>(
|
|
46
|
+
schema: TSchema,
|
|
47
|
+
): SchemaConfigResolver<TSchema> => {
|
|
48
|
+
return ({ context, matchContextKey }) => {
|
|
49
|
+
const caser =
|
|
50
|
+
typeof matchContextKey === 'function'
|
|
51
|
+
? matchContextKey
|
|
52
|
+
: (matchContextKey && caserMap[matchContextKey]) || rawCaser
|
|
53
|
+
|
|
54
|
+
const depKeys = Object.keys(schema.entries)
|
|
55
|
+
const filteredInput: Record<string, any> = {}
|
|
56
|
+
for (const key of depKeys) {
|
|
57
|
+
const fromKey = caser(key)
|
|
58
|
+
if (fromKey) filteredInput[key] = context[fromKey]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const parsed = parse(schema, filteredInput)
|
|
62
|
+
return parsed
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const defineStaticConfig = <TValue>(resolver: () => TValue): StaticAppConfig<TValue> => {
|
|
67
|
+
return {
|
|
68
|
+
kind: 'static',
|
|
69
|
+
resolve: resolver,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const defineSchemaConfig = <TSchema extends ObjectSchema<ObjectEntries, any>>(
|
|
74
|
+
schema: TSchema,
|
|
75
|
+
): SchemaAppConfig<TSchema> => {
|
|
76
|
+
return {
|
|
77
|
+
kind: 'schema',
|
|
78
|
+
schema: schema,
|
|
79
|
+
resolve: createSchemaResolver(schema),
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
export const $S_NonEmptyString = v.pipe(v.string(), v.minLength(1))
|
|
4
|
+
|
|
5
|
+
export const $S_BooleanString = v.pipe(
|
|
6
|
+
v.optional(
|
|
7
|
+
v.pipe(
|
|
8
|
+
v.string(),
|
|
9
|
+
v.check((value) => value === 'true' || value === 'false', 'Expected true or false'),
|
|
10
|
+
),
|
|
11
|
+
),
|
|
12
|
+
v.transform((value) => value !== 'false'),
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export const $S_NumberString = (defaultValue: number) =>
|
|
16
|
+
v.optional(
|
|
17
|
+
v.pipe(
|
|
18
|
+
v.string(),
|
|
19
|
+
v.check((value) => Number.isFinite(Number(value)), 'Expected a numeric string'),
|
|
20
|
+
v.transform(Number),
|
|
21
|
+
),
|
|
22
|
+
String(defaultValue),
|
|
23
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type Example = {
|
|
2
|
+
id: string
|
|
3
|
+
message: string
|
|
4
|
+
createdAt: string
|
|
5
|
+
updatedAt: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type CreateExampleInput = Pick<Example, 'message'>
|
|
9
|
+
|
|
10
|
+
export type ProcessExampleInput = Pick<Example, 'message'>
|
|
11
|
+
|
|
12
|
+
export type ProcessExampleOutput = {
|
|
13
|
+
original: string
|
|
14
|
+
normalized: string
|
|
15
|
+
length: number
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './example'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'vite-plus'
|
|
2
|
+
import { packConfig } from '@oyolincc/dev-config'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
clearMocks: false,
|
|
7
|
+
},
|
|
8
|
+
pack: {
|
|
9
|
+
...packConfig,
|
|
10
|
+
entry: {
|
|
11
|
+
backend: 'src/backend.ts',
|
|
12
|
+
},
|
|
13
|
+
exports: false,
|
|
14
|
+
},
|
|
15
|
+
})
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "repo",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"prepare": "vp config",
|
|
7
|
+
"changeset": "vp exec changeset",
|
|
8
|
+
"build": "turbo build",
|
|
9
|
+
"build:libs": "turbo build --filter=!@repo/stack --filter=!@repo/server"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@changesets/changelog-github": "catalog:",
|
|
13
|
+
"@changesets/cli": "catalog:",
|
|
14
|
+
"@oyolincc/cli": "catalog:",
|
|
15
|
+
"@oyolincc/dev-config": "catalog:",
|
|
16
|
+
"@types/node": "catalog:",
|
|
17
|
+
"tsx": "catalog:",
|
|
18
|
+
"turbo": "catalog:",
|
|
19
|
+
"vite-plus": "catalog:"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.12.0"
|
|
23
|
+
},
|
|
24
|
+
"packageManager": "pnpm@11.25.0"
|
|
25
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
packages:
|
|
2
|
+
- apps/*
|
|
3
|
+
- libs/*
|
|
4
|
+
|
|
5
|
+
catalogMode: prefer
|
|
6
|
+
catalogPrune: true
|
|
7
|
+
|
|
8
|
+
catalog:
|
|
9
|
+
'@changesets/changelog-github': '0.5.0'
|
|
10
|
+
'@changesets/cli': '2.27.12'
|
|
11
|
+
'@cloudflare/vite-plugin': '1.62.5'
|
|
12
|
+
'@oyolincc/cli': '2.1.3'
|
|
13
|
+
'@oyolincc/dev-config': '0.1.1'
|
|
14
|
+
'@oyolincc/env-loader': '^0.2.0'
|
|
15
|
+
'@types/node': '^24'
|
|
16
|
+
'concurrently': '^10.0.5'
|
|
17
|
+
'dotenv': '17.2.3'
|
|
18
|
+
'tsx': '4.21.0'
|
|
19
|
+
'turbo': '^2.9.14'
|
|
20
|
+
'typescript': '7.0.2'
|
|
21
|
+
'vite': 'npm:@voidzero-dev/vite-plus-core@1.0.0'
|
|
22
|
+
'vite-plus': '1.0.0'
|
|
23
|
+
'wrangler': '4.147.0'
|
|
24
|
+
|
|
25
|
+
catalogs:
|
|
26
|
+
shared:
|
|
27
|
+
'@types/string-template': '^1.0.7'
|
|
28
|
+
'change-case': '^5.4.4'
|
|
29
|
+
'defu': '^6.1.7'
|
|
30
|
+
'ky': '^2.0.2'
|
|
31
|
+
'string-template': '^1.0.0'
|
|
32
|
+
'valibot': '^1.4.2'
|
|
33
|
+
'yaml': '^2.8.1'
|
|
34
|
+
server:
|
|
35
|
+
'@hono/node-server': '^2.1.0'
|
|
36
|
+
'@hono/standard-validator': '^0.4.0'
|
|
37
|
+
'@hono/swagger-ui': '^0.6.1'
|
|
38
|
+
'@hono/vite-dev-server': '^0.26.1'
|
|
39
|
+
'@valibot/to-json-schema': '^1.7.1'
|
|
40
|
+
'hono': '^4.13.1'
|
|
41
|
+
'hono-openapi': '^1.3.3'
|
|
42
|
+
'hono-pino': '^0.10.3'
|
|
43
|
+
'hono-problem-details': '^0.11.0'
|
|
44
|
+
'pino': '^10.3.1'
|
|
45
|
+
'pino-pretty': '^13.1.3'
|
|
46
|
+
'pino-roll': '^4.0.0'
|
|
47
|
+
'piscina': '^5.3.0'
|
|
48
|
+
db:
|
|
49
|
+
'@types/better-sqlite3': '^7.6.13'
|
|
50
|
+
'better-sqlite3': '^12.11.1'
|
|
51
|
+
'drizzle-kit': '1.0.0-rc.4'
|
|
52
|
+
'drizzle-orm': '1.0.0-rc.4'
|
|
53
|
+
|
|
54
|
+
overrides:
|
|
55
|
+
'vite@*': 'catalog:'
|
|
56
|
+
|
|
57
|
+
peerDependencyRules:
|
|
58
|
+
allowAny:
|
|
59
|
+
- 'vite'
|
|
60
|
+
allowedVersions:
|
|
61
|
+
'vite': '*'
|
|
62
|
+
|
|
63
|
+
allowBuilds:
|
|
64
|
+
'better-sqlite3': true
|
|
65
|
+
'esbuild': true
|
|
66
|
+
'workerd': true
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
+
REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
5
|
+
source "${SCRIPT_DIR}/common.sh"
|
|
6
|
+
if [ -f "${SCRIPT_DIR}/.env.docker" ]; then read_env "${SCRIPT_DIR}/.env.docker"; fi
|
|
7
|
+
BUILD_TAG=${INLINE_BUILD_TAG:-${BUILD_TAG:-local}}
|
|
8
|
+
SERVER_IMAGE=${SERVER_IMAGE:-repo/hono-server}
|
|
9
|
+
docker buildx build --platform "${DOCKER_PLATFORM:-linux/amd64}" --load \
|
|
10
|
+
-t "${SERVER_IMAGE}:${BUILD_TAG}" \
|
|
11
|
+
-f "${REPO_ROOT}/docker/server.Dockerfile" \
|
|
12
|
+
"${REPO_ROOT}"
|
|
13
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
read_env() {
|
|
4
|
+
local env_path=$1
|
|
5
|
+
if [ -z "$env_path" ] || [ ! -f "$env_path" ]; then
|
|
6
|
+
echo "Environment file not found: $env_path" >&2
|
|
7
|
+
return 1
|
|
8
|
+
fi
|
|
9
|
+
set -a
|
|
10
|
+
. "$env_path"
|
|
11
|
+
set +a
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
require_env() {
|
|
15
|
+
local name=$1
|
|
16
|
+
local value
|
|
17
|
+
eval "value=\${${name}:-}"
|
|
18
|
+
if [ -z "$value" ]; then echo "${name} is required" >&2; return 1; fi
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://turbo.build/schema.json",
|
|
3
|
+
"tasks": {
|
|
4
|
+
"dev": {
|
|
5
|
+
"dependsOn": ["^build"],
|
|
6
|
+
"cache": false,
|
|
7
|
+
"persistent": true
|
|
8
|
+
},
|
|
9
|
+
"dev:node": {
|
|
10
|
+
"dependsOn": ["^build"],
|
|
11
|
+
"env": ["DEPLOY_TARGET"],
|
|
12
|
+
"cache": false,
|
|
13
|
+
"persistent": true
|
|
14
|
+
},
|
|
15
|
+
"dev:cloudflare": {
|
|
16
|
+
"dependsOn": ["^build"],
|
|
17
|
+
"env": ["DEPLOY_TARGET"],
|
|
18
|
+
"cache": false,
|
|
19
|
+
"persistent": true
|
|
20
|
+
},
|
|
21
|
+
"build": {
|
|
22
|
+
"dependsOn": ["^build"],
|
|
23
|
+
"outputs": ["dist/**", ".output/**"]
|
|
24
|
+
},
|
|
25
|
+
"build:node": {
|
|
26
|
+
"dependsOn": ["^build"],
|
|
27
|
+
"env": ["DEPLOY_TARGET"],
|
|
28
|
+
"outputs": ["dist/**", ".output/**"]
|
|
29
|
+
},
|
|
30
|
+
"build:cloudflare": {
|
|
31
|
+
"dependsOn": ["^build"],
|
|
32
|
+
"env": ["DEPLOY_TARGET"],
|
|
33
|
+
"outputs": ["dist/**", ".output/**"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from 'vite-plus'
|
|
2
|
+
import { lintConfig, fmtConfig } from '@oyolincc/dev-config'
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
create: { defaultTemplate: '@oyolincc' },
|
|
6
|
+
staged: {
|
|
7
|
+
'*': 'vp check --fix',
|
|
8
|
+
},
|
|
9
|
+
fmt: fmtConfig,
|
|
10
|
+
lint: lintConfig,
|
|
11
|
+
run: {
|
|
12
|
+
cache: false,
|
|
13
|
+
},
|
|
14
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Phase boundaries
|
|
2
|
+
|
|
3
|
+
A **phase** is a chunk of work inside a session — the grilling, the implementation, the QA. The definition is fuzzy on purpose: a phase ends when you think *"ok, we're done with that"*.
|
|
4
|
+
|
|
5
|
+
The **phase boundary** is the gap between two phases, and it is the only place this decision belongs. Mid-phase there is no decision to make — continue, or split the work that's left into subagents. Compacting mid-phase makes the agent lose the thread.
|
|
6
|
+
|
|
7
|
+
## The five options
|
|
8
|
+
|
|
9
|
+
| Option | What it does |
|
|
10
|
+
| ------------ | --------------------------------------------------------------- |
|
|
11
|
+
| **Continue** | Stay in the session. No context switch at all. |
|
|
12
|
+
| **`/clear`** | Empty the context window and start from nothing. |
|
|
13
|
+
| **`/handoff`** | Write a portable markdown file and seed a session anywhere with it. |
|
|
14
|
+
| **Subagent** | Send the task to its own context window and get a report back. |
|
|
15
|
+
| **`/compact`** | Compress this context and seed a fresh session with the summary. |
|
|
16
|
+
|
|
17
|
+
## The tree
|
|
18
|
+
|
|
19
|
+
Work top to bottom at the boundary. The first **yes** wins.
|
|
20
|
+
|
|
21
|
+
**1. Can you continue in this session?** Two things make the answer yes: the next phase needs this phase as a **primary source**, or you have enough [smart zone](https://www.aihero.dev/ai-coding-dictionary/smart-zone) left (~150k tokens) for the next phase to fit. Grilling → implementation is the standard yes: the implementation wants the reasoning verbatim, not a summary of it. Continue costs nothing and loses nothing, so rule it out before anything else.
|
|
22
|
+
|
|
23
|
+
**2. Is the context irrelevant to what comes next?** Is everything in this session — the exploration, the decisions, the dead ends — disposable? If so, **`/clear`**. It is the cheapest move on the board: it takes no time and hands back the whole window. `/clear` also isn't terminal — the old session stays resumable.
|
|
24
|
+
|
|
25
|
+
The cost of getting this wrong is one-way. Clear a *relevant* context and you lose the **why** behind what you built, and no amount of reading the diff back gets it returned.
|
|
26
|
+
|
|
27
|
+
**3. Do you need to hand off?** `/handoff` is narrow. You need it only when you are:
|
|
28
|
+
|
|
29
|
+
- swapping to a **new harness** (Claude → Codex),
|
|
30
|
+
- moving to a **new directory** or repo,
|
|
31
|
+
- sending the work to a **colleague**,
|
|
32
|
+
- or forking a side task you found **mid-phase** without derailing what you're doing.
|
|
33
|
+
|
|
34
|
+
That list is the whole clause. What `/handoff` buys is **portability** — a file that travels. If nothing is travelling, you don't need it.
|
|
35
|
+
|
|
36
|
+
**4. Can the task be done AFK?** Is it scoped tightly enough to run with you away from the keyboard, no steering? Then send it to a **subagent** and leave this session untouched. Automated review is the standard case: the agent reads the diff and reports, and you aren't needed while it does.
|
|
37
|
+
|
|
38
|
+
**5. Otherwise, `/compact`.** Relevant context, same harness, same directory, and you need to stay in the loop — this is where the tree lands, and it lands here often. Pass it an instruction (`/compact we're going to QA this area`) so the summary keeps what the next phase needs.
|
|
39
|
+
|
|
40
|
+
`/compact` is the **default, not the first reach**. It sits at the bottom because the four questions above it are all cheaper or more precise. The failure mode when people start here is a fresh session that is confidently wrong about a decision the summary flattened.
|
|
41
|
+
|
|
42
|
+
## Primary and secondary sources
|
|
43
|
+
|
|
44
|
+
Every move except **Continue** turns a **primary source** into a **secondary source** — the session as it happened, replaced by a summary of it. The trade is always the same shape:
|
|
45
|
+
|
|
46
|
+
| Source | Information | Noise | Room to move |
|
|
47
|
+
| --------------------------------- | ----------- | ----- | ------------ |
|
|
48
|
+
| Primary (Continue) | Full | Lots | Little |
|
|
49
|
+
| Secondary (`/compact`, `/handoff`) | Lossy | Less | Lots |
|
|
50
|
+
|
|
51
|
+
This is why question 1 comes first. You only pay the lossiness when staying costs more than it saves.
|
|
52
|
+
|
|
53
|
+
## These are judgement calls
|
|
54
|
+
|
|
55
|
+
The questions are not objective — each has taste in it, and the same boundary can go two ways on two days. The value is in asking them **in order**, at the boundary rather than in the middle of the work.
|