You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How does t3code (local clone at ~/Dev/t3code) structure Effect so that agents write it well, and what would each practice cost us to adopt? The vendored .repos/effect-smol plus generated LLMS.md via sync:repos (pinned how, how large, how it stays in sync); the effect-service-conventions rules file; the lint rules (no-manual-effect-runtime-in-tests, no-inline-schema-compile, namespace imports for service modules, others); @effect/vitest layers; typed receipts instead of sleeps; service and layer conventions. Read the source, not summaries of it.
Output: docs/research/effect-for-agents-t3code.md on branch research/effect-for-agents-t3code. Waits on it: Chart the Effect v4 port map.
t3code does not rely on prose alone. It stacks five mechanisms, cheapest to dearest: a 155-line AGENTS.md that points agents at vendored upstream docs; the upstream LLMS.md and .patterns/ carried in by a git subtree; 25 @effect/language-service diagnostics set to error in tsconfig.base.json and surfaced by tsgo --noEmit; five custom oxlint rules; and a paid Macroscope review agent for the conventions that cannot be checked mechanically [1][3][5][6][7].
.repos/ is two git subtree --squash snapshots: Effect-TS/effect at tag effect@<pnpm catalog version> and alchemy-run/alchemy-effect at v<infra/relay dependency>. Together they are 97 MB, 12,961 of the repo's 16,066 tracked files (81%), and about 1.7 M lines of TypeScript, excluded from lint, format and test [2][4].
LLMS.md is not generated by t3code. It is upstream's effect-ai-docgen ai-docs/src -o LLMS.md output (382 lines, 16 KB) that the subtree happens to include, alongside upstream's .patterns/*.md and .agents/. None of that ships in the effect npm tarball, which does ship src/**/*.ts [8][9].
The pin is derived, not stored: sync:repos reads catalog.effect from pnpm-workspace.yaml and runs git subtree pull --prefix=.repos/effect-smol <url> effect@<version> --squash. Nothing automates it. Of the four catalog versions since June, the vendored copy matched two: it sat at beta.73 for 53 days after the beta.78 bump, and has sat at beta.102 for the 22 days since the beta.103 bump (2026-08-04) [2][10].
Effect namespace imports (import * as Effect from "effect/Effect") are enforced by the language-service (importFromBarrel: "error" with namespaceImportPackages: ["@effect/platform-node", "effect"]) plus Macroscope prose, not by oxlint. Result: across apps/, packages/, infra/ and scripts/ (tests included) 4,861 import * as X from "effect/..." lines vs 4 named imports from "effect". The oxlint namespace-node-imports rule covers only node:* and exists because the language-service option did not [5][6][11].
no-manual-effect-runtime-in-tests is a ratchet: any Effect.run* or ManagedRuntime.make in a *.test.ts is an error unless the file is in a hard-coded baseline (27 files, 244 occurrences). The baseline has shrunk by 5 occurrences in 2.5 months, so the debt is frozen rather than paid down [7].
no-inline-schema-compile (warn) flags Schema.decode*/encode*/is/asserts compiled inside a function body with a static schema; the landing PR hoisted "hundreds" of call sites to module scope and fixed a class of throw-on-encode bugs on the way [7][12].
The Macroscope check .macroscope/check-run-agents/effect-service-conventions.md is a 13 KB prose spec run by claude-opus-5 at effort: high on the full diff of every PR touching TS under apps/, packages/, infra/, with conclusion: failure (merge-blocking). It was tightened six times in the two days after landing. Macroscope is usage-billed SaaS [3][13][14].
Tests: 399 of 881 test files import @effect/vitest, none import vitest directly; 2,915 it.effect, 129 it.layer, 29 it.live; effect/testing/TestClock imported in 48 test files. @effect/vitest is patched to import from vite-plus/test, a cost specific to t3code's Vite+ toolchain [15][16].
"Typed receipts instead of sleeps" is precise about the target, not the mechanism: receipts are a Schema.Union of three milestone structs published by CheckpointReactor; the production layer's publish is a no-op and only the test layer is PubSub-backed. The integration harness's waitForReceipt polls a Ref of received receipts every 10 ms for up to 40 s. DrainableWorker.drain (65 uses in server tests) is the other wait primitive. 22 sleep/setTimeout calls remain in server tests [17][18][19].
Service conventions in code (non-test source under apps/, packages/, infra/): 224 Context.Service classes, 0 Context.Tag, 708 Schema.TaggedErrorClass vs 32 Data.TaggedError, 229 module-level make and 204 layer exports, consumers importing service modules as namespaces. The migration to single-file services is incomplete: 81 files still live under Services/ or Layers/ and 8 services still take a separate *Shape type [20][21].
For Patchy Cloud (no Effect dependency today; vitest 4, ESLint, TypeScript 6): AGENTS.md guidance, @effect/vitest, and the language-service plugin are cheap; porting the two Effect oxlint rules to ESLint is a few hundred lines; vendoring 97 MB that its own authors let drift, and a paid prose-driven review agent, are the two practices whose cost is not obviously earned [22].
Open questions
How PR #4643 produced its incremental sync. git subtree merge --squash refuses to run when main carries no git-subtree-dir trailer, which is t3code's state after squash-merging, so the pull branch of sync:repos cannot have worked as written on a clean checkout; the PR (11,694 files) does not say whether the author ran it on a non-squashed branch, deleted and re-added the prefix, or something else.
Whether the language-service diagnostics actually gate CI in practice. The documented mechanism says yes (effect-tsgo patch + tsgo --noEmit + vpr typecheck, ignoreEffectErrorsInTscExitCode defaulting to false and unset in tsconfig.base.json), but no CI run failing on an Effect diagnostic was located.
How much the Macroscope agent catches. The repo records its spec and its revisions, not its findings, false-positive rate, or credit spend.
Whether the same Effect diagnostics are as complete on TypeScript 6 via @effect/language-service 0.87.2 as on TS 7 via @effect/tsgo; the rule docs list Effect versions per rule but not TS-version coverage, and two of t3code's error rules (missingEffectServiceDependency, schemaSyncInEffect) are listed as v3-only at tsgo HEAD.
Whether upstream intends to publish LLMS.md or ai-docs in the effect npm package; today the tarball is src/** and dist/** only, which is the whole reason the subtree exists.
Whether t3code will finish the Services/→single-file migration (81 files remain) or leave the Macroscope prose to apply only to touched code, which is what its "Do not demand unrelated repository-wide cleanup" line implies.
Activity
allisonmahmood commentedon Aug 26, 2026
Resolution
Write-up verified claim-by-claim against the t3code clone at
e67074f, the vendored upstream sources, t3code PR bodies, the npm registry, and the language-service/tsgo/Macroscope docs, then corrected in place. File: https://github.com/allisonmahmood/patchy-cloud/blob/research/effect-for-agents-t3code/docs/research/effect-for-agents-t3code.mdSummary
AGENTS.mdthat points agents at vendored upstream docs; the upstreamLLMS.mdand.patterns/carried in by a git subtree; 25@effect/language-servicediagnostics set toerrorintsconfig.base.jsonand surfaced bytsgo --noEmit; five custom oxlint rules; and a paid Macroscope review agent for the conventions that cannot be checked mechanically [1][3][5][6][7]..repos/is twogit subtree --squashsnapshots:Effect-TS/effectat tageffect@<pnpm catalog version>andalchemy-run/alchemy-effectatv<infra/relay dependency>. Together they are 97 MB, 12,961 of the repo's 16,066 tracked files (81%), and about 1.7 M lines of TypeScript, excluded from lint, format and test [2][4].LLMS.mdis not generated by t3code. It is upstream'seffect-ai-docgen ai-docs/src -o LLMS.mdoutput (382 lines, 16 KB) that the subtree happens to include, alongside upstream's.patterns/*.mdand.agents/. None of that ships in theeffectnpm tarball, which does shipsrc/**/*.ts[8][9].sync:reposreadscatalog.effectfrompnpm-workspace.yamland runsgit subtree pull --prefix=.repos/effect-smol <url> effect@<version> --squash. Nothing automates it. Of the four catalog versions since June, the vendored copy matched two: it sat at beta.73 for 53 days after the beta.78 bump, and has sat at beta.102 for the 22 days since the beta.103 bump (2026-08-04) [2][10].import * as Effect from "effect/Effect") are enforced by the language-service (importFromBarrel: "error"withnamespaceImportPackages: ["@effect/platform-node", "effect"]) plus Macroscope prose, not by oxlint. Result: acrossapps/,packages/,infra/andscripts/(tests included) 4,861import * as X from "effect/..."lines vs 4 named imports from"effect". The oxlintnamespace-node-importsrule covers onlynode:*and exists because the language-service option did not [5][6][11].no-manual-effect-runtime-in-testsis a ratchet: anyEffect.run*orManagedRuntime.makein a*.test.tsis an error unless the file is in a hard-coded baseline (27 files, 244 occurrences). The baseline has shrunk by 5 occurrences in 2.5 months, so the debt is frozen rather than paid down [7].no-inline-schema-compile(warn) flagsSchema.decode*/encode*/is/assertscompiled inside a function body with a static schema; the landing PR hoisted "hundreds" of call sites to module scope and fixed a class of throw-on-encode bugs on the way [7][12]..macroscope/check-run-agents/effect-service-conventions.mdis a 13 KB prose spec run byclaude-opus-5ateffort: highon the full diff of every PR touching TS underapps/,packages/,infra/, withconclusion: failure(merge-blocking). It was tightened six times in the two days after landing. Macroscope is usage-billed SaaS [3][13][14].@effect/vitest, none importvitestdirectly; 2,915it.effect, 129it.layer, 29it.live;effect/testing/TestClockimported in 48 test files.@effect/vitestis patched to import fromvite-plus/test, a cost specific to t3code's Vite+ toolchain [15][16].Schema.Unionof three milestone structs published byCheckpointReactor; the production layer'spublishis a no-op and only the test layer is PubSub-backed. The integration harness'swaitForReceiptpolls aRefof received receipts every 10 ms for up to 40 s.DrainableWorker.drain(65 uses in server tests) is the other wait primitive. 22sleep/setTimeoutcalls remain in server tests [17][18][19].apps/,packages/,infra/): 224Context.Serviceclasses, 0Context.Tag, 708Schema.TaggedErrorClassvs 32Data.TaggedError, 229 module-levelmakeand 204layerexports, consumers importing service modules as namespaces. The migration to single-file services is incomplete: 81 files still live underServices/orLayers/and 8 services still take a separate*Shapetype [20][21].AGENTS.mdguidance,@effect/vitest, and the language-service plugin are cheap; porting the two Effect oxlint rules to ESLint is a few hundred lines; vendoring 97 MB that its own authors let drift, and a paid prose-driven review agent, are the two practices whose cost is not obviously earned [22].Open questions
git subtree merge --squashrefuses to run whenmaincarries nogit-subtree-dirtrailer, which is t3code's state after squash-merging, so thepullbranch ofsync:reposcannot have worked as written on a clean checkout; the PR (11,694 files) does not say whether the author ran it on a non-squashed branch, deleted and re-added the prefix, or something else.effect-tsgo patch+tsgo --noEmit+vpr typecheck,ignoreEffectErrorsInTscExitCodedefaulting tofalseand unset intsconfig.base.json), but no CI run failing on an Effect diagnostic was located.@effect/language-service0.87.2 as on TS 7 via@effect/tsgo; the rule docs listEffect versionsper rule but not TS-version coverage, and two of t3code'serrorrules (missingEffectServiceDependency,schemaSyncInEffect) are listed as v3-only at tsgo HEAD.LLMS.mdorai-docsin theeffectnpm package; today the tarball issrc/**anddist/**only, which is the whole reason the subtree exists.Services/→single-file migration (81 files remain) or leave the Macroscope prose to apply only to touched code, which is what its "Do not demand unrelated repository-wide cleanup" line implies.