跳到正文
cccskills
免费在 GitHub 公开

skmtc-graphql

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.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

SKMTC GraphQL pipeline

Everything in the skmtc-generator skill applies unchanged — same axioms, same producers, same register/insert machinery, same ContentSettings. GraphQL differs in exactly four places: the entry factory, the operation object, enrichment resolution, and how mutation arguments become a schema. This skill is those differences.

1. The entry factory

Scaffold C variant: GraphQL entry (toGqlOperationEntry)

import { toGqlOperationEntry, synthesizeArgsObject } from '@skmtc/core'

export const MyGqlEntry = toGqlOperationEntry<EnrichmentSchema>({
  id: denoJson.name,

  // ⬇ Mutations only, gated on a synthesizable args object.
  isSupported({ operation }) {
    return operation.rootKind === 'mutation' &&
      synthesizeArgsObject(operation) !== undefined
  },

  transform({ context, operation, variant }) {
    if (operation.rootKind !== 'mutation') return
    context.insertOperation({ projection: MyGen, operation, variant })
  },

  toEnrichmentSchema
})

GQL-specific notes:

  1. Enrichments arrive parsed on settings.enrichments, exactly as for OAS operations and models — read them there; never index the raw umbrella by hand. The subject keys are [id][rootKind][fieldName][variant].
  2. Mutation args come via synthesizeArgsObject(operation) — GQL has no requestBody; this turns the field's arguments into an object schema for insertNormalizedModel.

Background: concepts/the-graphql-pipeline.md.

2. The four GraphQL differences

  1. Entries come from toGqlOperationEntry; transform receives operation: GqlOperation (fields: rootKind — 'query' | 'mutation' — and fieldName; operation.identifier is <rootKind>_<fieldName>). The companion projection-base factory is the lang package's to<Lang>GqlOperationProjectionBase.
  2. Enrichments arrive parsed on settings.enrichments, same as OAS — the base's static toEnrichments parses the umbrella with subjectSegments: [operation.rootKind, operation.fieldName, variant] (toGqlOperationProjectionBase.ts). Only the subject keys differ: two nested segments (rootKind, fieldName) where OAS has path+method. operation.identifier (<rootKind>_<fieldName>) is a file-naming/cache key, never an enrichment key.
  3. Mutation args come via synthesizeArgsObject(operation) — GQL has no requestBody; this turns the field's arguments into an object schema suitable for insertNormalizedModel.
  4. Routing keys: enrichment routing is enrichments.<id>.<rootKind>.<fieldName>.<variant>; the GeneratorKey is id|rootKind|fieldName|variant. Compose with this.insertOperation(Peer, op, { variant?, options }) exactly as for OAS — options only when the peer declares them.

3. Boundary with other skills

  • skmtc-generator — everything engine-side; load it first.
  • skmtc-lang-typescript / skmtc-lang-kotlin — the target-language layer, exactly as for OAS generators.
  • Deep dive: concepts/the-graphql-pipeline.md; the operation-reference protocol's GraphQL example is in concepts/cross-generator-coordination.md.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

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月17日 更新

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月17日 更新

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.

中文简介正在准备中。当前显示原文说明。

skmtc/skmtc192026年10月17日 更新

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月17日 更新

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月17日 更新

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月17日 更新

查看 skmtc 的全部技能

报告此技能的问题