Non-obvious gotchas, surprising behaviors, and hard-won lessons from this codebase. Read this before debugging runtime-specific behavior or assuming a local example is running the same source tree across Node, Bun, and Deno. Session-start rule: read this file before planning or executing work in this repo. End rule: DO NOT mention
<tasks>COMPLETE</tasks>AT ALL, unless your tasks ARE complete. Not even a little.
- Bare
import '@kjanat/dreamcli'resolves to different targets depending on the runtime when run inside this repo.nodefollowspackage.jsonexports todist/index.mjs;bunfollows the repotsconfig.jsonpaths tosrc/index.ts;denofollowsdeno.jsonimports tosrc/index.ts. If a fix appears in Bun or Deno examples but not Node examples, rebuilddistwithbun bdbefore assuming the source patch failed. dreamcli.schema.jsonlooks like a checked-in package artifact becausepackage.json,deno.json, and docs all reference it, but git ignores it (.gitignorehas/dreamcli.schema.json). If schema work or publish validation depends on that file, regenerate it explicitly;git diffwill not tell you anything.- Docs deployments that upload only
docs/.vitepress/distwill not include repo-root artifacts.scripts/emit-definition-schema.tswritesdreamcli.schema.jsonat root, so the docs site must emit/copy that file into dist if it should be served as/dreamcli.schema.json. tsdownalready supportsWithEnabledvalues'ci-only' | 'local-only'. Useenabled: 'local-only'onpublint/attwinstead of hand-rollingenv.CIgates when release CI should skip package-pack validation but local builds should keep it.jsr.io/@scope/pkg/...is a package website/module namespace, not a raw file host..../schema404s. For a dereferenceable JSR-flavored schema URL, usehttps://esm.sh/jsr/@scope/pkg/schema.scripts/emit-definition-schema.tsnow switches onREGISTRYand must rewrite both the top-level$idand the embeddedproperties.$schema.constso the emitted schema stays internally consistent.- Cloudflare Workers
wrangler versions uploadcreates a version preview only. Production traffic does not move untilwrangler versions deploy.
- Post-processing minified Vite/VitePress chunks with regex/string rewrites is fragile. A prior
shiki-dedupe-popup-stylestransform injectedconst __s*inside template literals (after "first newline"), leaking constants into rendered code blocks and breaking twoslash hovers. Keep chunk transforms AST-aware or disable them.
src/runtime/node-builtins.d.tsis ambient typing only. It can keep stale declarations such asnode:readlineafter runtime code stopped importing that module. Do not treat it as evidence of live runtime behavior; checksrc/runtime/node.tsfor the real Node/Bun execution path.WriteFninsrc/core/output/writer.tsis a synchronous contract. If a runtime adapter implementsstdout/stderrwith async writes, final spinner/progress cleanup can race with later output and process exit. Deno must usewriteSync, notwrite, or TTY progress output can end as...CompilingBuilt 5 modulesinstead of a clean final line.
- While the
dreamcli-re-foundationPRD is active, the GitHub project is expected to reflect live task state, not just end-of-task cleanup. When running/complete-next-task, update project item workflow at task start (In Progress) and at task end (Done), and move newly unblocked follow-up items toReady. End-only updates leave the board misleading for the next agent/session.
- Use GitHub Project
4. - Use
scripts/gh-project.tsinstead of ad hocgh projectcalls. It is Bun-native, uses DreamCLI for the command surface, reads.opencode/state/dreamcli-re-foundation/prd.json, and batches project metadata fetches once per invocation. - The visible board state on GitHub is driven by built-in
Status, not the customWorkflowfield. The helper must update both. Workflow keepsBacklog/Ready/Blockeddetail; Status is the coarse mirror the board actually shows:Backlog|Ready -> Todo,In Progress|Blocked -> In Progress,Done -> Done. - Exact commands future agents should use:
bun run gh-project:start <task-id>
bun run gh-project:finish <task-id>
bun run gh-project:sync
bun run gh-project:listfinishupdates project state and, by default, writespasses: trueback to.opencode/state/dreamcli-re-foundation/prd.json. Use--skip-passonly if the PRD state is being updated elsewhere.syncuses PRD truth to set passed tasks toDone, unblocked tasks toReady, and the rest toBacklogwhile preservingIn ProgressandBlockedunless--overwrite-activeis passed.- For rate-limit efficiency, prefer one script invocation that batches work over several raw
gh projectcalls. The script fetches project metadata once, then applies all needed edits.