[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71H6ZSZ6TXQEZHGCPG3PCNH":3,"skill-same:01M71H6ZSZ6TXQEZHGCPG3PCNH":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":13,"repositoryHtmlUrl":38,"repositoryHomepageUrl":6,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":40,"install":41,"resources":54},"01M71H6ZSZ6TXQEZHGCPG3PCNH","03-api-contracts",null,"Effect-TS 4 HttpApi schema-first REST contracts — route definitions, error schemas, and typed client","lambda-solver\u002Flambdabench-pro","lambda-solver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F279071046?v=4","01M71H55W2WK3PM6RRAY9JZWAJ","01M71H55WRT9XAFDAVACTCC2XP",0,"MIT","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Feffect-ts\u002Fschema\u002F03-api-contracts\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29],"03 api contracts","api contracts","contracts","api","error","route","effect","REST","first","opencode","schema","client","2026-11-10 10:12:30",false,"---\nname: 03-api-contracts\ndescription: Effect-TS 4 HttpApi schema-first REST contracts — route definitions, error schemas, and typed client\nlicense: MIT\ncompatibility: opencode\n---\n\n# API Contracts\n\n## HttpApi — schema-first REST definition\n\n```typescript\nimport { Schema } from \"effect\";\nimport { HttpApi, HttpApiEndpoint, HttpApiGroup } from \"effect\u002Funstable\u002Fhttpapi\";\n\nclass UsersGroup extends HttpApiGroup.make(\"users\")\n  .add(HttpApiEndpoint.get(\"list\", \"\u002F\").addSuccess(Schema.Array(User)))\n  .add(HttpApiEndpoint.get(\"get\", \"\u002F:id\").addSuccess(User).addError(NotFoundError))\n  .add(HttpApiEndpoint.post(\"create\", \"\u002F\").setPayload(CreateUserInput).addSuccess(User))\n  .prefix(\"\u002Fusers\") {}\n\nexport const Api = HttpApi.make(\"Api\").add(UsersGroup);\n```\n\n## HttpApiClient — generated typed client\n\n```typescript\nimport { HttpApiClient } from \"effect\u002Funstable\u002Fhttpapi\";\nimport { HttpClient, HttpClientRequest, Schedule } from \"effect\u002Funstable\u002Fhttp\";\n\nconst client =\n  yield *\n  HttpApiClient.make(Api, {\n    transformClient: (c) =>\n      c.pipe(\n        HttpClient.mapRequest(HttpClientRequest.prependUrl(\"http:\u002F\u002Flocalhost:3000\")),\n        HttpClient.retryTransient({\n          schedule: Schedule.exponential(\"100 millis\"),\n          times: 3,\n        }),\n      ),\n  });\n\nconst users = yield * client.users.list();\nconst user = yield * client.users.get({ path: { id: \"123\" } });\nconst newUser = yield * client.users.create({ body: { name: \"Ada\" } });\n```\n\n## RPC — streaming \u002F request-response\n\n```typescript\nimport { Schema } from \"effect\";\nimport { Rpc, RpcGroup } from \"effect\u002Funstable\u002Frpc\";\n\nexport class BenchmarkRpc extends RpcGroup.make(\n  Rpc.make(\"runEval\", {\n    payload: Schema.Struct({ taskId: Schema.String }),\n    success: EvalResult,\n  }),\n  Rpc.make(\"streamResults\", {\n    payload: Schema.Struct({ modelId: Schema.String }),\n    success: EvalResult,\n    stream: true,\n  }),\n) {}\n```\n\n## Domain schema export pattern\n\nAlways export the Schema constant AND the derived TypeScript type together:\n\n```typescript\nexport const Ranking = Schema.Struct({\n  model: Schema.String,\n  right: Schema.Number,\n  total: Schema.Number,\n  pct: Schema.String,\n  avgTime: Schema.Number,\n  tasks: Schema.Record(Schema.String, Schema.Boolean),\n  taskBits: Schema.Record(Schema.String, Schema.Number),\n  rlm: Schema.optional(Schema.Number),\n  rlmDepth: Schema.optional(Schema.Number),\n});\nexport type Ranking = Schema.Schema.Type\u003Ctypeof Ranking>;\n\nexport const BenchmarkData = Schema.Struct({\n  rankings: Schema.Array(Ranking),\n  tasks: Schema.Array(BenchmarkTask),\n  generatedAt: Schema.String,\n});\nexport type BenchmarkData = Schema.Schema.Type\u003Ctypeof BenchmarkData>;\n```\n\n## Error schemas for API boundaries\n\n```typescript\nexport class NotFoundError extends Schema.TaggedErrorClass\u003CNotFoundError>()(\"NotFoundError\", { id: Schema.String }) {}\n\nexport class ValidationError extends Schema.TaggedErrorClass\u003CValidationError>()(\"ValidationError\", {\n  field: Schema.String,\n  message: Schema.String,\n}) {}\n```\n\n## Layer.provide for API server\n\n```typescript\nconst AppLayer = Layer.mergeAll(HttpApiServer.layer, UsersHandler.layer, DbPool.layer);\nBunRuntime.runMain(Layer.launch(AppLayer));\n```\n","# API Contracts\n\n## HttpApi — schema-first REST definition\n\n```typescript\nimport { Schema } from \"effect\";\nimport { HttpApi, HttpApiEndpoint, HttpApiGroup } from \"effect\u002Funstable\u002Fhttpapi\";\n\nclass UsersGroup extends HttpApiGroup.make(\"users\")\n  .add(HttpApiEndpoint.get(\"list\", \"\u002F\").addSuccess(Schema.Array(User)))\n  .add(HttpApiEndpoint.get(\"get\", \"\u002F:id\").addSuccess(User).addError(NotFoundError))\n  .add(HttpApiEndpoint.post(\"create\", \"\u002F\").setPayload(CreateUserInput).addSuccess(User))\n  .prefix(\"\u002Fusers\") {}\n\nexport const Api = HttpApi.make(\"Api\").add(UsersGroup);\n```\n\n## HttpApiClient — generated typed client\n\n```typescript\nimport { HttpApiClient } from \"effect\u002Funstable\u002Fhttpapi\";\nimport { HttpClient, HttpClientRequest, Schedule } from \"effect\u002Funstable\u002Fhttp\";\n\nconst client =\n  yield *\n  HttpApiClient.make(Api, {\n    transformClient: (c) =>\n      c.pipe(\n        HttpClient.mapRequest(HttpClientRequest.prependUrl(\"http:\u002F\u002Flocalhost:3000\")),\n        HttpClient.retryTransient({\n          schedule: Schedule.exponential(\"100 millis\"),\n          times: 3,\n        }),\n      ),\n  });\n\nconst users = yield * client.users.list();\nconst user = yield * client.users.get({ path: { id: \"123\" } });\nconst newUser = yield * client.users.create({ body: { name: \"Ada\" } });\n```\n\n## RPC — streaming \u002F request-response\n\n```typescript\nimport { Schema } from \"effect\";\nimport { Rpc, RpcGroup } from \"effect\u002Funstable\u002Frpc\";\n\nexport class BenchmarkRpc extends RpcGroup.make(\n  Rpc.make(\"runEval\", {\n    payload: Schema.Struct({ taskId: Schema.String }),\n    success: EvalResult,\n  }),\n  Rpc.make(\"streamResults\", {\n    payload: Schema.Struct({ modelId: Schema.String }),\n    success: EvalResult,\n    stream: true,\n  }),\n) {}\n```\n\n## Domain schema export pattern\n\nAlways export the Schema constant AND the derived TypeScript type together:\n\n```typescript\nexport const Ranking = Schema.Struct({\n  model: Schema.String,\n  right: Schema.Number,\n  total: Schema.Number,\n  pct: Schema.String,\n  avgTime: Schema.Number,\n  tasks: Schema.Record(Schema.String, Schema.Boolean),\n  taskBits: Schema.Record(Schema.String, Schema.Number),\n  rlm: Schema.optional(Schema.Number),\n  rlmDepth: Schema.optional(Schema.Number),\n});\nexport type Ranking = Schema.Schema.Type\u003Ctypeof Ranking>;\n\nexport const BenchmarkData = Schema.Struct({\n  rankings: Schema.Array(Ranking),\n  tasks: Schema.Array(BenchmarkTask),\n  generatedAt: Schema.String,\n});\nexport type BenchmarkData = Schema.Schema.Type\u003Ctypeof BenchmarkData>;\n```\n\n## Error schemas for API boundaries\n\n```typescript\nexport class NotFoundError extends Schema.TaggedErrorClass\u003CNotFoundError>()(\"NotFoundError\", { id: Schema.String }) {}\n\nexport class ValidationError extends Schema.TaggedErrorClass\u003CValidationError>()(\"ValidationError\", {\n  field: Schema.String,\n  message: Schema.String,\n}) {}\n```\n\n## Layer.provide for API server\n\n```typescript\nconst AppLayer = Layer.mergeAll(HttpApiServer.layer, UsersHandler.layer, DbPool.layer);\nBunRuntime.runMain(Layer.launch(AppLayer));\n```\n",{"name":5,"license":14,"description":7,"compatibility":27},"main","816c073aaf171300af3605b06f7ec5aa7370ef0b",".opencode\u002Fskills\u002Feffect-ts\u002Fschema\u002F03-api-contracts","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro","https:\u002F\u002Fgithub.com\u002Flambda-solver","2026-05-31 17:08:46",{"source":8,"skillName":5,"commands":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add lambda-solver\u002Flambdabench-pro --skill 03-api-contracts",{"tool":47,"command":48},"bunx","bunx skills add lambda-solver\u002Flambdabench-pro --skill 03-api-contracts",{"tool":50,"command":51},"pnpm","pnpm dlx skills add lambda-solver\u002Flambdabench-pro --skill 03-api-contracts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002F.opencode\u002Fskills\u002Feffect-ts\u002Fschema\u002F03-api-contracts\u002FSKILL.md",true,[],[56,82,101,119,139,156],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":30},"01M71H9FNA5D6Y4ANXD18Z1Z3X","tmux-workflow","Development workflow with tmux — run dev servers, Storybook, and background processes in persistent sessions with live logs, while keeping OpenCode free for chat","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Ftmux\u002FSKILL.md",[],[63,64,65,66,67,68,69,70,71,72,73,27,74,75,76,77,78,79,80,81],"tmux","workflow","tmux workflow","chat","dev servers","background","processes","storybook","live","servers","run","with","logs","development workflow","free","dev","sessions","for","development",{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":30},"01M71H9DQJDAJVZX37NDN99D3P","04-anti-patterns","React anti-patterns to avoid — manual JSX repetition, useEffect misuse, reference instability, prop drilling, conditional hooks, and common performance traps","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Freact\u002Fpatterns\u002F04-anti-patterns\u002FSKILL.md",[],[89,90,91,92,93,94,95,96,97,98,99,27,100],"patterns","anti patterns","04 anti patterns","common","jsx","reference","conditional","hooks","manual","performance","anti-patterns","react",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":30},"01M71H9BXF511W2R3B73S5P9ZN","03-state-management","React state management patterns — lifting state, colocation, URL state, server state with TanStack Query, local state with useState\u002FuseReducer","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Freact\u002Fpatterns\u002F03-state-management\u002FSKILL.md",[],[108,109,110,111,100,112,89,113,114,115,116,27,117,74,118],"management","state management","state","03 state management","query","URL","tanstack","react state management","local","server","tanstack query",{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":30},"01M71H9AAGVWMYQ4NG82QPYCTE","02-component-composition","React component composition patterns — render props, compound components, list rendering with map, slot patterns, and layout primitives","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Freact\u002Fpatterns\u002F02-component-composition\u002FSKILL.md",[],[126,127,128,27,74,129,130,100,131,89,132,133,134,135,136,137,138],"02 component composition","component","Composition","compound","components","primitives","composition patterns","list","map","rendering","render","react component","layout",{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":30},"01M71H98RDXRQZDR496SRD906M","01-fp-style","React functional programming style — pure components, hooks conventions, Effect Atom integration, and Tailwind patterns","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Freact\u002Fpatterns\u002F01-fp-style\u002FSKILL.md",[],[146,147,148,89,149,150,27,151,100,152,130,96,153,154,155,24],"01 fp style","style","atom","conventions","integration","functional","programming","Tailwind","tailwind patterns","functional programming",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":162,"publishedAt":30},"01M71H95PYGAWBS5C8KN0C4WGT","react-animation","React animation with react\u002Fmotion (Framer Motion) — declarative animations, gestures, layout animations, and performance best practices","https:\u002F\u002Fgithub.com\u002Flambda-solver\u002Flambdabench-pro\u002Fblob\u002Fmain\u002Freference\u002Fghui\u002F.opencode\u002Fskills\u002Freact\u002Fanimation\u002FSKILL.md",[],[100,163,164,98,165,27,138,166,167,74,168,169,170,171],"react animation","Animation","framer motion","motion","best practices","framer","gestures","animations","declarative"]