Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .agents/skills/test-t3-app/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ below before declaring it unavailable. Do not install or switch to another
automation system. For native mobile testing, use
[test-t3-mobile](../test-t3-mobile/SKILL.md).

Name what you test with [the feature map](references/feature-map.md), the
user's names for every page, panel and control.

## Start the app

Reuse this task's healthy dev server. Otherwise run `vp run dev` from the
Expand Down
289 changes: 289 additions & 0 deletions .agents/skills/test-t3-app/references/feature-map.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .agents/skills/test-t3-mobile/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description: Test T3 Code's native iOS and Android app through its Device panel

# Test T3 Mobile

Name what you test with [the feature map](../test-t3-app/references/feature-map.md);
its Mobile section covers the app's screens.

## Open the device

Call `device_list`, then `device_open` with the selected host and device IDs.
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/closura-arc-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ jobs:
apps/web/src/components/chat/draftUploadReconcile.test.ts \
apps/web/src/lib/attachmentUploadQueue.test.ts \
apps/server/src/ws.test.ts \
packages/contracts/src/environment.test.ts
packages/contracts/src/environment.test.ts \
scripts/feature-map.test.ts

- name: Test mobile new-task placement, outbox and uploads
shell: bash
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ We need to be on the same page with terminology. When communicating, use this la

The most common defect in this repo is a change that works on the path you tested and is missing everywhere else. Before calling frontend work done, walk this list and say which entries applied:

- **Feature map.** [The feature map](.agents/skills/test-t3-app/references/feature-map.md) names every surface the way users see it. Use its names when you talk about UI, and add a new route or keybinding command to it; `scripts/feature-map.test.ts` fails until you do.
- **Entry points.** A behavior reachable from the chat view is usually also reachable from Settings, the command palette, and a keybinding. Fixing one is not fixing the feature.
- **Clients.** Web, desktop (wraps web, adds Electron shell/IPC), and mobile (React Native, separate navigation). Shared logic lives in `packages/client-runtime`
- **Providers.** Codex, Claude, Cursor, Grok, OpenCode, Antigravity, Kiro, Pi, Muse Code, fx, and ACP Registry each have an adapter. Provider-shaped features need a decision per adapter, even if the decision is "not supported here".
Expand Down
88 changes: 88 additions & 0 deletions scripts/feature-map.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import * as NodeServices from "@effect/platform-node/NodeServices";
import { STATIC_KEYBINDING_COMMANDS } from "@t3tools/contracts";
import { expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";
import * as FileSystem from "effect/FileSystem";
import * as Path from "effect/Path";

const MAP = ".agents/skills/test-t3-app/references/feature-map.md";
const ROUTES = "apps/web/src/routes";

const commandNames = [
...new Set(
STATIC_KEYBINDING_COMMANDS.map((command) => command.replace(/\.jump\.\d+$/, ".jump.<n>")),
),
"script.<id>.run",
].toSorted();
const commandNamespaces = new Set(commandNames.map((command) => command.split(".")[0]!));

const looksLikeRoute = (token: string) => /^\/([A-Za-z0-9$_-]+(\/[A-Za-z0-9$_-]+)*)?$/.test(token);
const looksLikeCommand = (token: string) =>
/^[a-z][A-Za-z]*\.[A-Za-z0-9.<>]+$/.test(token) &&
commandNamespaces.has(token.split(".")[0]!) &&
!/\.(md|ts|tsx|json)$/.test(token);

const loadMap = Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const root = path.resolve(import.meta.dirname, "..");
const mapText = yield* fs.readFileString(path.join(root, MAP));
const named = new Set([...mapText.matchAll(/`([^`\s]+)`/g)].map((match) => match[1]!));
const files = (yield* fs.readDirectory(path.join(root, ROUTES), { recursive: true })).filter(
(file) => file.endsWith(".tsx"),
);
const routePaths: string[] = [];
for (const file of files) {
const source = yield* fs.readFileString(path.join(root, ROUTES, file));
const declared = /createFileRoute\(\s*"([^"]+)"/.exec(source)?.[1];
if (declared === undefined) continue;
const route = declared.replace(/^\/_chat(?=\/|$)/, "").replace(/(.)\/$/, "$1");
if (route !== "") routePaths.push(route);
}
return { named, routePaths: routePaths.toSorted() };
});

it.layer(NodeServices.layer)("feature map", (it) => {
it.effect("finds the routes and keybinding commands it checks", () =>
Effect.gen(function* () {
const { routePaths } = yield* loadMap;
expect(routePaths).toContain("/settings/general");
expect(routePaths).toContain("/$environmentId/$threadId");
expect(commandNames).toContain("diff.toggle");
}),
);

it.effect("names every web route on the feature map", () =>
Effect.gen(function* () {
const { named, routePaths } = yield* loadMap;
expect(
routePaths.filter((route) => !named.has(route)),
`add these routes to ${MAP}`,
).toEqual([]);
}),
);

it.effect("names every keybinding command on the feature map", () =>
Effect.gen(function* () {
const { named } = yield* loadMap;
expect(
commandNames.filter((command) => !named.has(command)),
`add these keybinding commands to ${MAP}`,
).toEqual([]);
}),
);

it.effect("names no route or keybinding command that no longer exists", () =>
Effect.gen(function* () {
const { named, routePaths } = yield* loadMap;
const routes = new Set(routePaths);
const commands = new Set(commandNames);
const stale = [...named].filter(
(token) =>
(looksLikeRoute(token) && !routes.has(token)) ||
(looksLikeCommand(token) && !commands.has(token)),
);
expect(stale, `remove or rename these on ${MAP}`).toEqual([]);
}),
);
});
Loading