Ban Type Assertions
Factory-AI/factory-plugins
Ban as type assertions in a package via the @typescript-eslint/consistent-type-assertions lint rule, replacing them with compiler-verified type-safe alternatives.
Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern.
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install google-labs-code/stitch-sdk typed-service-contracts --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/typed-service-contract .claude/skills/typed-service-contracts && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .claude/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contractType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install google-labs-code/stitch-sdk typed-service-contracts --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/typed-service-contract .agents/skills/typed-service-contracts && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .agents/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install google-labs-code/stitch-sdk typed-service-contracts --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/typed-service-contract .cursor/skills/typed-service-contracts && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .cursor/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/google-labs-code/stitch-sdk.git --path .agents/skills/typed-service-contract--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install google-labs-code/stitch-sdk typed-service-contracts --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/typed-service-contract .gemini/skills/typed-service-contracts && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .gemini/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install google-labs-code/stitch-sdk typed-service-contractsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/typed-service-contract .github/skills/typed-service-contracts && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .github/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install google-labs-code/stitch-sdk typed-service-contracts --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/google-labs-code/stitch-sdk.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/typed-service-contract .opencode/skills/typed-service-contracts && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "typed-service-contracts" agent skill from https://github.com/google-labs-code/stitch-sdk/tree/main/.agents/skills/typed-service-contract into .opencode/skills/typed-service-contracts/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "typed-service-contracts", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
typed-service-contractsArchitecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern.
Typed Service Contracts is an agent skill from google-labs-code/stitch-sdk, published by the product's own GitHub organization. Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern. Use when building CLIs, libraries, or complex business logic.
Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Development, covering Type safety. It works with TypeScript and Zod. The repository describes itself as: Generate UI screens from text prompts and extract their HTML and screenshots programmatically. The licence is Apache-2.0.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e3f8ece. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Typed Service Contracts loads about 1.4k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 336 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from google-labs-code/stitch-sdk at commit e3f8ece, republished under its Apache-2.0 licence (© google-labs-code). 336 words, ~1,420 tokens.
.claude/skills/typed-service-contracts/SKILL.md (or your agent's skills folder).This skill defines a Vertical Slice Architecture backed by Design by Contract (DbC) principles. It treats application logic as rigorously defined Units of Work where inputs are parsed (not just validated) and errors are treated as values (Result Pattern) rather than exceptions.
spec.ts)The "Contract" or "Port". It defines the What. It must contain:
DiscriminatedUnion of Success | Failure.interface ConfigureSpec).handler.ts)The "Implementation" or "Adapter". It defines the How. It must:
Result type.spec.ts)Follow this template to define the boundaries.
import { z } from "zod";
// 1. VALIDATION HELPERS (Reusable Refinements)
export const SafePathSchema = z
.string()
.min(1)
.refine((p) => !p.includes(".."), "No traversal allowed");
// 2. INPUT (The Command) - "Parse, don't validate"
export const MyTaskInputSchema = z.object({
path: SafePathSchema,
force: z.boolean().default(false),
});
export type MyTaskInput = z.infer<typeof MyTaskInputSchema>;
// 3. ERROR CODES (Exhaustive)
export const MyTaskErrorCode = z.enum([
"FILE_NOT_FOUND",
"PERMISSION_DENIED",
"UNKNOWN_ERROR",
]);
// 4. RESULT (The Monad)
export const MyTaskSuccess = z.object({
success: z.literal(true),
data: z.string(), // The output payload
});
export const MyTaskFailure = z.object({
success: z.literal(false),
error: z.object({
code: MyTaskErrorCode,
message: z.string(),
suggestion: z.string().optional(),
recoverable: z.boolean(),
}),
});
export type MyTaskResult =
| z.infer<typeof MyTaskSuccess>
| z.infer<typeof MyTaskFailure>;
// 5. INTERFACE (The Capability)
export interface MyTaskSpec {
execute(input: MyTaskInput): Promise<MyTaskResult>;
}handler.ts)Follow this template to implement the logic.
import { MyTaskSpec, MyTaskInput, MyTaskResult } from "./spec.js";
import * as fs from "fs";
export class MyTaskHandler implements MyTaskSpec {
async execute(input: MyTaskInput): Promise<MyTaskResult> {
try {
// 1. Business Logic
if (!fs.existsSync(input.path)) {
// 2. Explicit Error Return (No Throwing)
return {
success: false,
error: {
code: "FILE_NOT_FOUND",
message: `Path does not exist: ${input.path}`,
recoverable: true,
},
};
}
// 3. Success Return
return {
success: true,
data: "Operation complete",
};
} catch (error) {
// 4. Safety Net: Catch unknown runtime errors
return {
success: false,
error: {
code: "UNKNOWN_ERROR",
message: error instanceof Error ? error.message : String(error),
recoverable: false,
},
};
}
}
}Do not write monolithic tests. Split them into Contract Tests and Logic Tests.
Test the Bouncer. Ensure invalid data is rejected before it reaches the handler.
// spec.test.ts
import { MyTaskInputSchema } from "./spec";
const invalidCases = [
{ val: "../etc/passwd", err: "No traversal allowed" },
{ val: "", err: "min(1)" },
];
test.each(invalidCases)("validates paths", ({ val, err }) => {
const result = MyTaskInputSchema.safeParse({ path: val });
expect(result.success).toBe(false);
});Test the Chef. Mock external dependencies (fs, network) and assert the Result Object.
// handler.test.ts
import { MyTaskHandler } from "./handler";
import { vi } from "vitest"; // or jest
test("returns FILE_NOT_FOUND if path missing", async () => {
// MOCK
vi.mocked(fs.existsSync).mockReturnValue(false);
// EXECUTE
const handler = new MyTaskHandler();
const result = await handler.execute({ path: "/fake" });
// ASSERT (Check the Result Object)
expect(result.success).toBe(false);
if (!result.success) {
expect(result.error.code).toBe("FILE_NOT_FOUND");
}
});© google-labs-code, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/typed-service-contract of google-labs-code/stitch-sdk.
Open the folder on GitHubat commit e3f8ece
Typed Service Contracts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Typed Service Contracts this skillgoogle-labs-code/stitch-sdk | 1.8k | — | ~1.4k | Automated safety check: Pass | Apache-2.0 | |
| Ban Type AssertionsFactory-AI/factory-plugins | 110 | — | ~1.7k | Automated safety check: Pass | None | |
| Hono Idiomsirahardianto/awesome-agv | 157 | — | ~3k | Automated safety check: Pass | MIT | |
| Type Safetyidavidov13/agentic-playwright | 223 | — | ~3.5k | Automated safety check: Pass | MIT | |
| Common Tasksidavidov13/agentic-playwright | 223 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Data Strategyidavidov13/agentic-playwright | 223 | — | ~3.4k | Automated safety check: Pass | MIT |
Factory-AI/factory-plugins
Ban as type assertions in a package via the @typescript-eslint/consistent-type-assertions lint rule, replacing them with compiler-verified type-safe alternatives.
irahardianto/awesome-agv
Hono lightweight web framework patterns: type-safe route handlers, middleware composition, Zod validation, and RPC clients for Cloudflare Workers, Node, or Bun.
idavidov13/agentic-playwright
TypeScript type safety conventions for the Playwright scaffold — the "no any" rule, Zod 4 schema patterns (z.strictObject, top-level validators like z.uuid / z.email / z.url / z.int / z.enum)…
idavidov13/agentic-playwright
Copy-paste AI prompt templates for common Playwright scaffold development tasks — adding page objects, functional/E2E/API tests, Zod schemas, factories, fixtures, and components.
idavidov13/agentic-playwright
Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…
TheDecipherist/claude-code-mastery-project-starter-kit
One canonical Zod schema per entity, reused across the stack instead of redeclared at each layer.
google-labs-code/stitch-sdk
Develop the Stitch SDK. An agent skill from google-labs-code/stitch-sdk.
google-labs-code/stitch-sdk
Design the domain model for the Stitch SDK. An agent skill from google-labs-code/stitch-sdk.
google-labs-code/stitch-sdk
Run the full Stitch SDK generation pipeline. An agent skill from google-labs-code/stitch-sdk.
google-labs-code/stitch-sdk
Generate or update the README for the Stitch SDK. An agent skill from google-labs-code/stitch-sdk.
google-labs-code/stitch-sdk
Use the Stitch SDK to generate, edit, and iterate on UI screens from text prompts, manage projects, and retrieve screen HTML/images.
google-labs-code/stitch-sdk
Enforces a disciplined Red-Green-Refactor (TDD) workflow in TypeScript/Node.js.
Works with
Categories
Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern. Typed Service Contracts is an agent skill from google-labs-code/stitch-sdk, published by the product's own GitHub organization. Architecture standard for building robust, type-safe TypeScript services using the "Spec and Handler" pattern.
Typed Service Contracts fits situations like: complex business logic; tasks that involve Type safety.
Run `npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a claude-code`. Or copy the skill folder (.agents/skills/typed-service-contract in google-labs-code/stitch-sdk) into .claude/skills/typed-service-contracts in your project. Claude Code loads it when a task matches its description.
Run `npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a codex`. Or copy the skill folder (.agents/skills/typed-service-contract in google-labs-code/stitch-sdk) into .agents/skills/typed-service-contracts in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google-labs-code/stitch-sdk --skill typed-service-contracts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typed-service-contracts, .gemini/skills/typed-service-contracts, .github/skills/typed-service-contracts and .opencode/skills/typed-service-contracts in your project.
SKILL.md names no scripts, command-line tools or credentials: Typed Service Contracts is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Typed Service Contracts is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Typed Service Contracts: Ban Type Assertions (Factory-AI/factory-plugins, 110 stars), Hono Idioms (irahardianto/awesome-agv, 157 stars), Type Safety (idavidov13/agentic-playwright, 223 stars) and Common Tasks (idavidov13/agentic-playwright, 223 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
google-labs-code (a GitHub organization, an official publisher) maintains it in google-labs-code/stitch-sdk, which has 1,826 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 1, 2026.
Source: google-labs-code/stitch-sdk on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.