本文へ移動
cccskills
無料GitHub で公開

skmtc-cli

Use the Skmtc CLI to scaffold projects, install or clone generators from JSR, configure schema sources and enrichments, and produce code artifacts from an OpenAPI v3 or GraphQL SDL schema. Teaches the workspace mental model (`<root>/.skmtc/<project>/`, client.json, bundle, manifest) and the agent contract (strict text / strict JSON modes, exit codes, recipe errors, `agent-context` + `doctor`); the command surface itself is discovered from the binary — `skmtc --help`, `skmtc <cmd> -h` — rather than carried in this skill. Use this skill when the user asks to "run skmtc", "generate code from an OpenAPI schema", "install a skmtc generator", "scaffold a skmtc project", "watch a skmtc project", "configure enrichments", "publish a stack", "deploy to skmtc-hub" (the command is `publish`; there is no `deploy`), "skmtc in CI", or invokes any CLI subcommand. For *authoring* a generator package (Projections, Snippets, transform functions), defer to `skmtc-generator`. When something is broken (no output, wrong output, error messages, a failed bundle build), verify before proposing a fix: read the manifest and the parse issues, and reproduce the failure first.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md11.2 KB
  • reference.md19.8 KB
  • task-cards.md17.0 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Skmtc CLI

The Skmtc CLI generates code from OpenAPI v3 or GraphQL SDL documents. It's a Deno binary that wraps a project workspace under <root>/.skmtc/, fetches generators from JSR, and runs them against a schema source pinned in each project.

This skill carries what the binary cannot tell you: the workspace mental model, the agent contract, and the decisions that need intent. Everything else — the command list, per-command flags, argument shapes — lives in the binary itself and is always current there; §3 shows how to pull it on demand. This skill guides using the CLI; for authoring generator packages see skmtc-generator, for diagnosing failures see debug-failing-generation.

1. Mental model

ConceptWhere it livesNotes
Skmtc rootnearest ancestor dir containing .skmtc/Created by skmtc init
Project<root>/.skmtc/<project>/One schema + one set of generators
Project deps<root>/.skmtc/<project>/deno.jsonJSR imports of installed generators
Schema pin<root>/.skmtc/<project>/.settings/client.jsonsource field — URL or path. Resolution: explicit schema arg → client.json#source → interactive prompt (TTY only; strict mode fails with a recipe error)
basePathclient.json#settings.basePathMust match the consumer app's @ alias root. Both the on-disk root for generated files AND the alias root in the bundler's resolver. Generators produce @/<subdir>/... paths assuming this alignment. Absolute paths are rejected at init.
Bundle<root>/.skmtc/<project>/bundle.jsCompiled worker entry. Rebuilt before every run by generate/dev, and by bundle/clone/install. describe/status/clean build their own copy outside the project.
Manifest<root>/.skmtc/<project>/.settings/manifest.jsonPer-run record of every file written and every (generator × item) outcome
GeneratorJSR package or local folderLocal: <root>/.skmtc/<project>/<gen-name>/
Global state~/.skmtc/auth.json (the hub PAT stored by skmtc login), shadow project state, schema caches. Check this when local state alone doesn't explain a failure.

A "project" is not the consuming app — it's the generator configuration the consuming app pulls code from.

Generators are opinionated templates, not configurable libraries. Stock @skmtc/gen-* packages ship hardcoded defaults — export paths, identifier naming, peer imports, output shapes — and there are no config flags for any of them, deliberately. To change them, skmtc clone the generator into the project and edit its source; that is the customization seam, not a workaround. "Stock generator hardcodes X" is almost never a CLI bug. Enrichments supply the settings a generator's author declared it needs — its enrichments.ts schema is the whole contract a consumer can fill; cloning changes the shape.

Two engine facts that shape CLI expectations: generator order never affects output (coordination is a memoized cache, not a dependency graph — never sequence generators), and render does not run a formatter (unformatted output is by design; consumers format separately).

2. The agent contract

Every state-touching command supports three modes, picked automatically:

ModeWhenBehavior
InteractiveTTY attached and no --json / --no-inputInk TUI; prompts for missing args
Strict textNon-TTY (CI / pipes / agents) OR --no-inputPlain-text result on stdout; missing required args fail with a recipe error on stderr
Strict JSON--json (implies --no-input)Single JSON object on stdout; logs on stderr

For agents: add --json to every command. The CLI auto-degrades to non-interactive mode on any non-TTY stdin/stdout — no PTY wrappers needed. (Two exceptions surface in help: dev is long-running and has no --json; create has no --json yet.)

Exit codes are consistent across all commands: 0 success (including documented no-ops), 2 required input missing or invalid (recipe error on stderr), 1 anything else (registry unreachable, schema parse failure, fatal parseIssue, typecheck failure). For generate --json, an empty errors array is the success condition — not the exit code alone.

Recipe errors are the discovery mechanism. When a required argument is missing in strict mode, stderr carries the usage line, a worked example, and a Discover: line naming the command that lists the valid values (e.g. ls .skmtc/ for project names). Trust it: run the command, read the recipe, run the discovery, retry.

3. The command surface lives in the binary

Do not look for a command table in this skill — pull it live, where it is always current with the installed version:

skmtc --help        # every command, with real descriptions
skmtc <cmd> -h      # full flags for one command

The newer commands' help descriptions (status, eject, adopt, publish, push, pull) carry their full semantics — read them there rather than guessing from the names. One naming trap help cannot intercept: there is no skmtc deploy — stacks are published (skmtc publish) as immutable semver versions; deployments and the production alias belong to hub projects and are driven from the web app, not the CLI.

4. First steps in a workspace

skmtc agent-context --json    # enumerate projects, commands, state
skmtc doctor --json           # check for known frictions

These two give the full workspace picture without documentation lookups — agent-context is the snapshot, doctor the diagnostic, in that order. doctor's summary is the worst status across checks (error > warning > ok; exit 1 only on error), and every check carries its own id, status, message, and remediation hint — the output is self-describing. The check-id catalogue, if you need to reason about a specific check: reference.md §"Doctor check ids".

5. The bundle is rebuilt on every generate

Generation runs the compiled bundle.js, not generator source. For a local project, generate rebuilds bundle.js from deno.json#imports and the generator source on disk before every run, so pin changes and edits to cloned source apply on the next generate — no skmtc bundle step. dev builds the same way; describe, status and clean build a read-only copy in a temporary directory (deno bundle --frozen), so after a pin change run generate once before them. A build failure exits 1 with the deno bundle error; a module graph with two copies of @skmtc/core (or a @skmtc/lang-*) exits 1 naming the packages that import each copy.

6. Configuration: client.json and filters

.skmtc/<project>/.settings/client.json — top level is { source?, settings }; settings carries basePath (required, relative, no ..), packages, enrichments, skip, include, generatedSuffix. Full annotated shape, every key: reference.md §6 — read it before editing the file.

packages (optional) routes output into monorepo packages. Each entry { rootPath, moduleName? } is a folder forward from basePath, which is then the common ancestor of every package, not a bundler alias. Inside a root, imports render @/ from that root; from outside, they render the root's moduleName. Nested roots are subpath exports (@app/sdk/models) that share the outer package's @. Config load rejects .., a repeated root and the workspace root; render fails on an outside import of a root with no moduleName. Task page: docs/using/how-to/generate-into-multiple-packages.md.

Enrichment misaddressing never errors. When a customization does not land, read manifest.enrichmentWarnings (printed after generate, and re-read by skmtc doctor as project-enrichments/<project>): a typo'd id, path, method, model name or leaf key is reported with the nearest match. Routing is the literal path plus lowercase method, never operationId, under a main variant key. A wrong-typed value fails only that item, recorded as error in the manifest.

settings.skip / settings.include accept a whole generator, a per-operation entry (path → method → variant[]), or a per-model entry (refName → variant[]); [] means every variant. Filters are where user intent is expressed — never a generator's isSupported. Semantics and precedence: reference.md §7.

Every command's --json envelope is one object discriminated by a type field; per-command shapes: reference.md §8 — read when parsing output, not before.

7. Task cards

End-to-end workflows (setup, adding generators, enrichments, CI, publishing, customizing a stock generator, …) live in task-cards.md — open the one card for the job in front of you. A single command doesn't need a card; -h covers it.

8. Boundary with other skills

This skill ends at the CLI surface. Hand off when:

  • The next step edits a .ts/.tsx file under <root>/.skmtc/<project>/<gen-name>/ → skmtc-generator
  • The user reports something broken and the cause isn't yet known → verify before proposing: manifest, parse issues, then a reproduction (debug-failing-generation, error codes)

Companion files

Loaded on demand with the Read tool, never eagerly:

FileWhat it holdsRead it when
reference.md§6 client.json shape, §7 filter semantics, §8 JSON envelopes, §11 operational principles, doctor check idsEditing settings, writing a filter, parsing --json, reasoning about a doctor check
task-cards.mdTwelve end-to-end workflow cardsDoing a multi-step job for the first time

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Write, restructure, or review documentation — tutorials, how-to guides, reference pages, concept/explanation docs, API references, READMEs, changelogs, release notes, and troubleshooting guides. Distills documentation craft from Mintlify's guides (compiled from technical writers at Stripe, GitHub, Amplitude, and Anaconda), the Diátaxis framework (including the compass and per-type voice), the Google and Microsoft style guides, Every Page Is Page One, Write the Docs, and Docs for Developers: audience analysis, content-type selection, style and word-level rules, procedure writing, structure for humans and AI agents, code-example standards, page templates (templates.md), mechanical enforcement and llms.txt (mechanics.md), maintenance, and success metrics. Use this skill when the user asks to "write docs", "document this feature", "improve this page", "review these docs", "write a tutorial / how-to / reference page", "structure the docs", "write API documentation", "write a README / changelog", or when authoring any file under a `docs/` tree. For SKMTC docs specifically, this skill governs the *craft* (what makes the page good); the content split between skills, `llms.md`, and the docs tree is governed by `docs/skills/README.md`. Distinct from `skmtc-retro` (captures observations about work) and the `skmtc-*` operational skills (guide doing the work) — this skill guides writing *about* the work for readers.

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

Understand what SKMTC is, how its engine works, and the architectural invariants — for agents building or extending infrastructure *around* SKMTC rather than authoring generators or running the CLI. Covers the three-phase pipeline, the host/Worker boundary, cross-generator coordination, the manifest, the attribution / gen-maps (provenance) subsystem, the package graph, the dependency substrate, and the design decisions that make SKMTC behave unlike a typical codegen tool. Use this skill when the user asks "what is SKMTC", "how does the SKMTC engine work", "explain the SKMTC architecture", or is building platform infrastructure around SKMTC — a hosted generate API, a schema or generator registry, tracing or provenance tooling, a web app or SaaS that wraps the engine, or platform-level CI integration. This skill is the system mental model. It does NOT cover authoring generators (→ skmtc-generator), running CLI commands (→ skmtc-cli), or diagnosing broken runs (→ skmtc-debug).

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

Diagnose failures in SKMTC sessions — no output, wrong output, error messages, failed bundle builds, parseIssues, "Registered definition mismatch", ref cycles, "Module not found" in generated code, or any other broken behavior. Applies across both CLI usage and generator authoring contexts. Use this skill when the user asks "why isn't my generator working", "no output for X", "wrong output", "what does this error mean", "manifest says X", "bundle failed", "INVALID_SCHEMA", "INVALID_DEPENDENCY_REF", "Registered definition mismatch", "Module not found" (in generated code), "ConfigValidationError", or reports any other SKMTC failure. This skill encodes a **verify-first epistemic stance** — read the manifest, check parseIssues, reproduce the failure before proposing fixes. Distinct from `skmtc-cli` and `skmtc-generator` which guide *doing*; this skill guides *diagnosing*.

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

Author and edit Skmtc generators — packages that project an OpenAPI domain model into application code. Method: clone the nearest stock generator, then apply the engine rules imitation can't teach. Assumes zero prior Skmtc knowledge. Use when asked to "write a skmtc generator", "author/clone/customize gen-x", "add a field type", "change export paths", "add enrichment options", or when editing generator source. ALWAYS pair with the target language's skill (skmtc-lang-typescript).

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

The GraphQL pipeline for SKMTC generators — authoring generators whose input schema is GraphQL SDL rather than OpenAPI. Covers `toGqlOperationEntry`, `GqlOperation`, `synthesizeArgsObject` (mutation args -> object schema), the GQL enrichment routing (`[id][rootKind][fieldName][variant]` — two nested subject keys where OAS has path+method), the `to<Lang>GqlOperationProjectionBase` companion factories, and the `GeneratorKey` shape `id|rootKind|fieldName|variant`. Use this skill ALONGSIDE `skmtc-generator` whenever the schema source is GraphQL SDL or the task mentions "GraphQL", "SDL", "GqlOperation", "toGqlOperationEntry", or GraphQL query/mutation generators. Engine rules (producers, register/insert, the axioms) stay in `skmtc-generator`; this skill carries only what differs for GraphQL.

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

The Kotlin target-language layer for Skmtc generators (@skmtc/lang-kotlin): base factories, KtSnippet, the seven entity kinds, packages-from-paths imports, the head+value render model, KtAnnotation and the composition classes, sanitization and @SerialName placement, plus the current-API worked example (the shipped gen-kotlin-* packages are API-stale — do not copy their call shapes). Use ALONGSIDE skmtc-generator whenever a generator emits Kotlin. Headings mirror skmtc-lang-typescript.

日本語の概要は準備中です。原文の説明を表示しています。

skmtc/skmtc192026年10月3日 更新

skmtc のスキルをすべて見る

このスキルの問題を報告する