{"id":31534079,"url":"https://github.com/skmtc/skmtc","last_synced_at":"2025-10-04T05:17:09.261Z","repository":{"id":313558596,"uuid":"1045527445","full_name":"skmtc/skmtc","owner":"skmtc","description":"Skmtc is a declarative code generation framework","archived":false,"fork":false,"pushed_at":"2025-09-30T19:00:04.000Z","size":113487,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T19:23:51.198Z","etag":null,"topics":["code-generation","codegen","openapi","skmtc","swagger","typescript"],"latest_commit_sha":null,"homepage":"https://skm.tc","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skmtc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-27T10:10:44.000Z","updated_at":"2025-09-30T19:00:08.000Z","dependencies_parsed_at":"2025-09-06T22:36:46.858Z","dependency_job_id":null,"html_url":"https://github.com/skmtc/skmtc","commit_stats":null,"previous_names":["skmtc/skmtc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/skmtc/skmtc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skmtc%2Fskmtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skmtc%2Fskmtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skmtc%2Fskmtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skmtc%2Fskmtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skmtc","download_url":"https://codeload.github.com/skmtc/skmtc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skmtc%2Fskmtc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278266896,"owners_count":25958733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","codegen","openapi","skmtc","swagger","typescript"],"created_at":"2025-10-04T05:17:05.525Z","updated_at":"2025-10-04T05:17:09.254Z","avatar_url":"https://github.com/skmtc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./skmtc-animate.gif\" /\u003e\n\n\n\n\n**Skmtc is a declarative code generation framework**. It lets you generate TypeScript code from OpenAPI schemas without complex ASTs.\n\n## ✨ Features\n\n- 🏎️ **Fast** - Generates 550k+ tokens per second\n- 🧵 **Easy to edit code generators** - Outputs specified using string templates, not ASTs\n- 🥞 **Stackable generators** - Compose complex functionality by combining generators\n- 🗄️ **Use your own code conventions** - Full control over naming and file structure\n\n## 🚀 Quick Start\n\n```bash\n# Run directly with npx\nnpx skmtc\n\n```\n\n### Running code generators\n\n```bash\nnpx skmtc generate @skmtc/supabase-backend https://petstore3.swagger.io/api/v3/openapi.json\n# Generated 9 files (507 lines, 3,383 tokens) in 9ms\n\nnpx skmtc generate @skmtc/supabase-react-client https://raw.githubusercontent.com/cloudflare/api-schemas/refs/heads/main/openapi.json\n# Generated 6,797 files (104,752 lines, 1,635,227 tokens) in 2,969ms\n```\n\n## How does it work?\n\nSkmtc handles all OpenAPI parsing and output rendering, which means each generator only needs to specify how to represent its API schema input as a code string.\n\nThe process runs in 3 phases\n\n1. **Parse** - Converts input OpenAPI schema into an **OasDocument** object\n2. **Generate** - Creates **Projection** objects from operations and models in OasDocument and writes them to respective **File** objects\n3. **Render** - Outputs generated **File** objects as code files\n\nLet's take a look at an example, where we create a `fetch` based API client with Zod type checking\n\n```typescript\nimport { ZodInsertable } from '@skmtc/gen-zod'\n\nclass ZodFetch extends BaseProjection {\n  zodName: string;\n\n  constructor({context, operation, settings}){\n    super({context, operation, settings})\n\n    // To add Zod type checks, we look up the response schema for each operation,\n    const response = operation.toSuccessResponse()?.resolve().toSchema()\n\n    // generate a Zod schema from it and insert it into current file\n    const zodResponse = this.insert(ZodInsertable, response)\n\n    // Assign schema name to object so it can be accessed from `toString()` below\n    this.zodName = zodResponse.identifier.name\n  }\n\n  // Map object properties to output code\n  toString(){\n    return `() =\u003e {\n      const res = await fetch('${this.operation.path}')\n      const data = await res.json()\n\n      return ${zodName}.parse(data)\n    }`\n  }\n}\n```\n\n\n\n## 📦 Available Generators\n\nChoose from our growing collection of generators, combone them or create your own:\n\n- **Tanstack Query** - React Query hooks with Zod validation\n- **MSW** - Mock Service Worker handlers from OpenAPI examples\n- **Zod Schemas** - Runtime validation schemas\n- **TypeScript Types** - Pure type definitions\n- **Supabase/Hono Functions** - Edge function handlers\n- See full list at https://github.com/skmtc/skmtc-generators\n\n## ❓ FAQ\n\n### **What OpenAPI versions are supported?**\nSkmtc supports OpenAPI v3.0. Swagger 2.0 and OpenAPI v3.1 are automatically converted to OpenAPI v3.0.\n\n### **Can I customize the generated code?**\nYes! Each Transformer specifies its output using plain string templates, which means you can\nedit them as would you edit any other code.\n\n### **Can I use this with my existing React app?**\nYes! Skmtc generates standalone code that integrates with any React application. The generated components work with your existing setup.\n\n### **How does this compare to OpenAPI Generator?**\nSkmtc is the only code generation framework that provides full control over the generated code. You are not limited by library-specific settings and you do not need to write complex AST code.\n\n### **Does it work with Next.js/Remix/Vite?**\nYes! The generated code is framework-agnostic TypeScript that works with any build tool or library.\n\n## 🤝 Contributing\n\nWe welcome contributions! Check out our [Contributing Guide](CONTRIBUTING.md) to get started.\n\n\u003c!-- ## 📚 Documentation\n\n- [Full Documentation](https://docs.skmtc.dev)\n- [API Reference](https://docs.skmtc.dev/api)\n- [Custom Generators Guide](https://docs.skmtc.dev/generators)\n- [Examples](https://github.com/skmtc/skmtc/tree/main/examples) --\u003e\n\n## 🛟 Support\n\n- [GitHub Issues](https://github.com/skmtc/skmtc/issues) - Bug reports and feature requests\n- [Discord Community](https://discord.com/invite/Mg88C8Xu5Y) - Get help and share your experience\n\n## 📄 License\n\nApache 2.0 © [Skmtc Contributors](LICENSE.md)\n\n---\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Deno](https://img.shields.io/badge/Deno-2.5+-green.svg)](https://deno.land/)\n[![Discord](https://img.shields.io/badge/Discord-join%20chat-1dce73.svg)](https://discord.com/invite/Mg88C8Xu5Y)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskmtc%2Fskmtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskmtc%2Fskmtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskmtc%2Fskmtc/lists"}