Navigate Effect, effect-atom, and website submodules to find canonical sources, test examples, and human-authored documentation
Navigate TMNL's submodule library with precision. This skill guides you through effect, effect-atom, and website submodules to find canonical sources, test patterns, and human-authored documentation.
TMNL includes essential libraries as git submodules for reference and pattern validation:
Location: ../../submodules/ (from packages/tmnl)
Prime Directive: When validating patterns, prefer website submodule over deepwiki ā it's human-authored and contains battle-tested patterns.
../../submodules/
āāā effect/ # Effect-TS core library
ā āāā packages/
ā ā āāā effect/ # Core Effect runtime
ā ā āāā sql-sqlite-bun/ # SQLite integration (Bun)
ā ā āāā sql-drizzle/ # Drizzle ORM integration
ā ā āāā sql-kysely/ # Kysely query builder
ā ā āāā sql-mssql/ # MS SQL integration
ā ā āāā sql-libsql/ # LibSQL integration
ā ā āāā experimental/ # Experimental features
ā āāā scripts/
ā
āāā effect-atom/ # Reactive atoms for Effect
ā āāā packages/
ā āāā atom/ # Core atom library
ā ā āāā test/ # Atom test patterns
ā āāā atom-react/ # React bindings
ā āāā atom-vue/ # Vue bindings
ā
āāā website/ # Effect documentation
ā āāā content/
ā āāā src/content/docs/
ā āāā docs/ # Human-authored documentation
ā āāā introduction/
ā āāā guides/
ā āāā concurrency/
ā āāā state-management/
ā āāā stream/
ā āāā schema/
ā āāā additional-resources/
ā
āāā ag-grid/ # AG-Grid data grid library
āāā anime/ # anime.js animation library
āāā GSAP/ # GSAP animation library
āāā xstate/ # XState state machines
āāā ... # Other submodules
Location: ../../submodules/effect/
Key Directories:
Test Examples (Canonical Patterns):
packages/effect/test/ ā Core Effect testspackages/sql-sqlite-bun/test/ ā SQLite client tests (Bun runtime)packages/sql-drizzle/test/ ā Drizzle ORM integration testspackages/sql-kysely/test/ ā Kysely query builder testspackages/sql-mssql/test/ ā MS SQL client testspackages/sql-libsql/test/ ā LibSQL client testsSource Code:
packages/effect/src/ ā Effect runtime sourcepackages/sql/src/ ā Base SQL abstractionpackages/platform/src/ ā Platform servicespackages/experimental/src/ ā EventLog, DevTools, etc.Test File Naming Convention:
*.test.ts ā Main test files (use @effect/vitest)*.spec.ts ā Rare, used for specific test typesexamples/*.test.ts ā Example-driven testsLocation: ../../submodules/effect-atom/
Key Directories:
Test Examples (Canonical Patterns):
packages/atom/test/Atom.test.ts ā Atom creation, derivation, subscriptionspackages/atom/test/AtomRef.test.ts ā AtomRef patterns (mutable refs in atoms)packages/atom/test/AtomRpc.test.ts ā RPC patterns for atomspackages/atom/test/Result.test.ts ā Result handling in atomspackages/atom-react/test/ ā React integration testspackages/atom-vue/test/ ā Vue integration testsSource Code:
packages/atom/src/ ā Core atom implementationpackages/atom-react/src/ ā React hooks (useAtom, useAtomValue, etc.)Test Pattern:
it() (not it.effect())Registry.make() for atom testingit("should update atom value", () => {
const r = Registry.make();
const atom = Atom.make(0);
r.set(atom, 42);
expect(r.get(atom)).toBe(42);
});
Location: ../../submodules/website/
Key Directories:
Human-Authored Documentation:
content/src/content/docs/docs/ ā Main documentation directoryCategories:
| Category | Path | Topics |
|---|---|---|
| Introduction | docs/introduction/ |
What is Effect, quick start |
| Guides | docs/guides/ |
Best practices, migration guides |
| Concurrency | docs/concurrency/ |
Fibers, queues, semaphores, deferred |
| State Management | docs/state-management/ |
Ref, SynchronizedRef, SubscriptionRef |
| Streams | docs/stream/ |
Creating, consuming, transforming streams |
| Schema | docs/schema/ |
Schema definition, validation, encoding |
| Additional Resources | docs/additional-resources/ |
Effect vs FP-TS, myths, API reference |
File Format: .mdx (Markdown with JSX components)
Why This Matters: These docs are human-authored by the Effect team ā they represent battle-tested patterns, not AI inference.
ag-grid (../../submodules/ag-grid/):
anime (../../submodules/anime/):
GSAP (../../submodules/GSAP/):
xstate (../../submodules/xstate/):
Goal: Learn how to test an Effect service with SQL integration
Process:
cd ../../submodules/effectfind packages/sql-sqlite-bun/test -name "*.test.ts"cat packages/sql-sqlite-bun/test/Client.test.tsKey Observations:
import { it } from "@effect/vitest";
import { Effect } from "effect";
it.effect("should query database", () =>
Effect.gen(function* () {
const client = yield* SqliteClient;
const rows = yield* client.query("SELECT * FROM users");
expect(rows).toHaveLength(3);
}).pipe(Effect.provide(TestLayer))
);
Patterns Learned:
it.effect() for tests returning EffectEffect.gen for generator-style codeEffect.provide()Goal: Learn how to test atoms with subscriptions
Process:
cd ../../submodules/effect-atomfind packages/atom/test -name "*.test.ts"cat packages/atom/test/Atom.test.tsKey Observations:
import { Atom, Registry } from "@effect-atom/atom";
it("should subscribe to atom changes", () => {
const r = Registry.make();
const atom = Atom.make(0);
const values: number[] = [];
r.subscribe(atom, (value) => values.push(value));
r.set(atom, 1);
r.set(atom, 2);
expect(values).toEqual([0, 1, 2]);
});
Patterns Learned:
Registry.make() for testing atomsr.get(), r.set(), r.subscribe() for atom operationsit() tests (not it.effect())Goal: Understand how to use Effect.Ref for mutable state
Process:
cd ../../submodules/websitels content/src/content/docs/docs/state-management/cat content/src/content/docs/docs/state-management/ref.mdxKey Insights:
Ref.make(initialValue)Ref.set(), Ref.update(), Ref.modify()Goal: Learn how to create custom cell renderers
Process:
cd ../../submodules/ag-gridfind . -name "*CellRenderer*" -type f | head -10Key Insights:
components propparams with value, data, node, etc.Scenario: Implementing a stream with backpressure
Process:
cat .edin/EFFECT_PATTERNS.md (search for "stream")cat ../../submodules/website/content/src/content/docs/docs/stream/*.mdxfind ../../submodules/effect/packages -name "*stream*.test.ts"Result: Comprehensive understanding from TMNL-specific patterns + canonical docs + test examples.
Question: How do I define an Effect service with dependencies?
Exploration Path:
Website submodule:
cd ../../submodules/website
find . -name "*context*.mdx" | xargs grep -l "Context.Tag"
Result: content/src/content/docs/docs/guides/context-management.mdx
Effect tests:
cd ../../submodules/effect
grep -r "Context.Tag" packages/sql-sqlite-bun/test/ | head -5
Result: packages/sql-sqlite-bun/test/Client.test.ts shows service usage
TMNL patterns:
cat .edin/EFFECT_SERVICE_PATTERNS.md
Result: Service definition template
Combined Learning: Service definition syntax + test provisioning + TMNL conventions.
Question: How do I create a runtime atom for Effect services?
Exploration Path:
effect-atom source:
cd ../../submodules/effect-atom
grep -r "Atom.runtime" packages/atom/src/
Result: Implementation in packages/atom/src/Atom.ts
TMNL examples:
cd packages/tmnl
grep -r "Atom.runtime" src/lib/*/atoms/
Result: src/lib/data-manager/v1/atoms/index.ts shows usage pattern
effect-atom tests:
cd ../../submodules/effect-atom
grep -r "runtime" packages/atom/test/
Result: Runtime atom tests (if any)
Combined Learning: Implementation details + TMNL usage patterns + test validation.
Question: Should I use Schema.Struct or Schema.TaggedStruct?
Exploration Path:
TMNL directive:
cat CLAUDE.md | grep -A 20 "Schema Discipline"
Result: Use TaggedStruct for discriminated data
Website submodule:
cd ../../submodules/website
cat content/src/content/docs/docs/schema/*.mdx | grep "TaggedStruct"
Result: Documentation on when to use tagged unions
Effect source:
cd ../../submodules/effect
grep -r "TaggedStruct" packages/effect/src/Schema.ts
Result: Implementation and type signature
Combined Learning: TMNL convention + canonical docs + implementation details.
Question: How do I run multiple SQL queries in a transaction?
Exploration Path:
Effect SQL tests:
cd ../../submodules/effect/packages/sql-sqlite-bun/test
grep -n "transaction" Client.test.ts
Result: Transaction test examples
Website submodule:
cd ../../submodules/website
find . -name "*sql*.mdx" | xargs grep -l "transaction"
Result: SQL documentation with transaction patterns
TMNL patterns:
cat .edin/EFFECT_SQL_SQLITE_PATTERNS.md
Result: TMNL-specific SQL patterns
Combined Learning: Test examples + documentation + TMNL conventions.
Question: How do I filter and map a stream?
Exploration Path:
Website submodule:
cd ../../submodules/website
cat content/src/content/docs/docs/stream/consuming-streams.mdx
Result: Stream operator documentation
Effect tests:
cd ../../submodules/effect/packages
find . -name "*stream*.test.ts" | xargs grep "pipe.*filter.*map"
Result: Test examples combining operators
TMNL examples:
cd packages/tmnl
grep -r "Stream.filter" src/lib/
Result: TMNL usage patterns
Combined Learning: Documentation + test examples + TMNL usage.
# WRONG: Go straight to AI agent
deepwiki ask "How do I use Effect.Ref?"
# RIGHT: Check human-authored docs first
cd ../../submodules/website
cat content/src/content/docs/docs/state-management/ref.mdx
Why: AI inference may be outdated or incorrect. Human-authored docs are canonical.
# WRONG: Read any test file without checking age
cat ../../submodules/effect/packages/old-package/test/Old.test.ts
# RIGHT: Check recent packages (sql-sqlite-bun, sql-drizzle)
cat ../../submodules/effect/packages/sql-sqlite-bun/test/Client.test.ts
Why: Effect evolves rapidly. Recent packages have modern patterns.
# WRONG: Explore every submodule for every question
ls ../../submodules/
# RIGHT: Focus on effect, effect-atom, website for Effect questions
cd ../../submodules/effect
cd ../../submodules/effect-atom
cd ../../submodules/website
Why: Not all submodules are equally important. Prioritize core libraries.
# WRONG: Read only one source
cat ../../submodules/website/content/src/content/docs/docs/stream/consuming-streams.mdx
# RIGHT: Cross-reference with tests and TMNL patterns
cat ../../submodules/website/content/src/content/docs/docs/stream/consuming-streams.mdx
find ../../submodules/effect/packages -name "*stream*.test.ts" | xargs grep "filter"
cat .edin/EFFECT_PATTERNS.md | grep -A 10 "Stream"
Why: Multiple perspectives ensure comprehensive understanding.
# WRONG: Edit submodule files directly
vim ../../submodules/effect/packages/effect/src/Effect.ts
# RIGHT: Reference only, implement in TMNL
cat ../../submodules/effect/packages/effect/src/Effect.ts
# Then implement in src/lib/my-domain/
Why: Submodules are read-only references. Changes should be in TMNL codebase.
| Goal | Submodule | Path | Command |
|---|---|---|---|
| Effect test patterns | effect | packages/*/test/ |
find ../../submodules/effect/packages -name "*.test.ts" |
| Atom test patterns | effect-atom | packages/atom/test/ |
ls ../../submodules/effect-atom/packages/atom/test/ |
| Effect documentation | website | content/src/content/docs/docs/ |
find ../../submodules/website -name "*.mdx" |
| SQL patterns | effect | packages/sql-*/test/ |
find ../../submodules/effect/packages -name "*sql*.test.ts" |
| Stream patterns | website | docs/stream/ |
ls ../../submodules/website/content/src/content/docs/docs/stream/ |
| Schema patterns | website | docs/schema/ |
ls ../../submodules/website/content/src/content/docs/docs/schema/ |
# Navigate to submodules directory
cd ../../submodules
# List all submodules
ls
# Find all Effect test files
find effect/packages -name "*.test.ts" | head -20
# Find all effect-atom test files
find effect-atom/packages/atom/test -name "*.test.ts"
# Find all website documentation files
find website/content/src/content/docs/docs -name "*.mdx" | head -20
# Search for specific pattern in Effect tests
grep -r "Effect.gen" effect/packages/sql-sqlite-bun/test/
# Search for specific topic in website docs
grep -r "Ref.make" website/content/src/content/docs/docs/state-management/
# Find AG-Grid examples
find ag-grid -name "*Renderer*" -type f | head -10
# Check submodule git status (should be clean)
cd effect && git status
# Update submodule to latest (use sparingly)
cd effect && git pull origin main
SQL Client Test (sql-sqlite-bun/test/Client.test.ts):
import { it } from "@effect/vitest";
import { SqliteClient } from "@effect/sql-sqlite-bun";
it.effect("should query users", () =>
Effect.gen(function* () {
const client = yield* SqliteClient;
const rows = yield* client.query("SELECT * FROM users");
expect(rows).toHaveLength(3);
}).pipe(Effect.provide(TestLayer))
);
Atom Test (atom/test/Atom.test.ts):
import { Atom, Registry } from "@effect-atom/atom";
it("should derive atom", () => {
const r = Registry.make();
const source = Atom.make(1);
const derived = Atom.make((get) => get(source) * 2);
expect(r.get(derived)).toBe(2);
r.set(source, 5);
expect(r.get(derived)).toBe(10);
});
# Introduction
../../submodules/website/content/src/content/docs/docs/introduction/
# Concurrency (Fibers, Queue, Semaphore)
../../submodules/website/content/src/content/docs/docs/concurrency/
# State Management (Ref, SynchronizedRef)
../../submodules/website/content/src/content/docs/docs/state-management/
# Streams
../../submodules/website/content/src/content/docs/docs/stream/
# Schema
../../submodules/website/content/src/content/docs/docs/schema/
# Additional Resources (Effect vs FP-TS, myths)
../../submodules/website/content/src/content/docs/docs/additional-resources/
When implementing a new pattern:
.edin/EFFECT_PATTERNS.md, CLAUDE.md../../submodules/website/content/src/content/docs/docs/../../submodules/effect/packages/*/test/../../submodules/effect-atom/packages/atom/test/.edin/EFFECT_PATTERNS.md if new pattern emergesGolden Rule: Human-authored docs (website submodule) > Canonical tests (effect/effect-atom submodules) > AI inference (deepwiki).