Skip to content
cccskills
FreePublished on GitHub

spec-query

Use whenever a question is about what the specification says or does — "what happens if", "can X do Y", "which errors can this return", "what does the screen show for", "what fields does this command take", "is there an operation for". Answers by running the Lean executable spec (scenarios, commands,

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md4.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

仕様問い合わせ — Lean を動かして答える

仕様に関する問いは推測で答えない。モデルを動かし、その出力を引用して答える。 道具は cradle spec-query(cradle スキルの scripts/spec-query.mjs。以下 spec-query)。

問いの種類と手順

問い手順
「どんな操作がある / 無い」「どんな失敗がある」「外から何が届く」spec-query meta → commands / observations(内部入力: 通知・契機。利用者の操作ではない)/ ports / errors をそのまま示す。無いものは「モデルに無い(反機能の一覧 Runtime/Command.lean を確認)」と答える
「このコマンドは何を受け取る」「この型の中身」spec-query print <FullName>(例: MonoWa.Application.PostIntentUseCase.Command)
「この状況で X が Y したらどうなる」1) spec-query scenarios で出発点を選ぶ 2) 必要なら spec-query init --scenario S --viewer V で盤面を見る 3) spec-query run --scenario S --actor A --viewer V --today D --commands '[…]' で手を打つ 4) 各手の ok / domainError と最後の views を引用
「外部が〜と答えたら」「通知が届いたら」「途中で落ちたら」Port を使う手・内部入力の手は spec-query external flow --scenario S --environment N --inputs '[…]'(環境の名前は spec-query environments。script そのものは --env @file。1 手ずつなら external init → external step --state @file --env @file --input J)。入力は {"command":…,"actor":…} か {"observation":…}、障害契約の指名は "fault":"<def 名>"。各手の result(applied / refused / fault)と環境の cursor、harnessError なら環境と入力列の不一致(業務の答えではない)を引用。旧 run は環境を持たないので Port を使う手はプロトコルエラーになる
「画面に何が見える」「誰に見える」spec-query init / run の views を viewer を変えて比べる(null = そこに無い、[] = 見えたうえで空)
「日付でどう変わる」同じ手を --today を変えて 2 回走らせ、差を示す
「golden のこの流れは何をしている」golden/<name>-flow.json の trace を読む。要約せず手の列と結果を写す(外部能力を使う流れの要素は observation / result / interactions / faultContract を持つ。環境は <name>.request.json の environment か応答の env)

答え方

  • 実行したコマンドと出力(該当部分)を引用してから結論を書く。「モデルは〜と答えた」の形。
  • 「できない」は domainError の語彙で言う(notAuthor など)。語彙の意味は Domain/Error.lean の docstring。
  • 出発点のシナリオに欲しい状況が無いときは、既存シナリオから手を打って作る。Scenarios.lean に一時シナリオを足さない(それは ddd スキルのプローブの仕事)。
  • モデルが答えられない問い(型に無い事実・未決)は「モデルに無い」と言い、決めたければ ddd スキルに戻す。勝手に補わない。
  • 出力が長いときは views の該当する口だけを引用する。

例

spec-query meta
spec-query print Sprout.Application.CloseNoteUseCase.Command
spec-query run --scenario basic --viewer 1 --actor '{"user":{"id":2}}' \
  --commands '[{"closeNote":{"note":{"id":0}}}]'
# → #1 closeNote by {"user":{"id":2}} → domainError: "notAuthor"
spec-query environments
spec-query external flow --scenario basic --environment paymentAuthorized --actor '{"user":{"id":1}}' \
  --inputs '[{"command":{"startPayment":{"visit":{"id":0}}}},{"observation":{"dispatchPayment":{"attempt":{"id":0}}}}]'
# → #1 startPayment by {"user":{"id":1}} → applied  [env cursor 0/1]
# → #2 observation dispatchPayment → applied  [env cursor 1/1]

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Use when adding or changing REST endpoints or the OpenAPI contract — deriving endpoints from the Lean commands and views, writing documents/codebase/openapi.yaml first, then regenerating the backend controller interfaces and the frontend client.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

Use after a backend build succeeds or whenever authentication, authorization, actor/identity handling, external service calls (IdP, JWKS, DB, clock), logging, observability, configuration or error contracts are in play — delegates to the backend-design-reviewer agent for a design-quality review of the current branch.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

Use when it is time to make the backend follow the Lean model — regenerate Kotlin from Lean, implement the generated interfaces (UseCase, QueryService, Repository, Entity), wire every generated contract test, make the build green, then run the design and SQL reviews. Backend comes after the human confirmed the screens.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

cradle

Free

Use when you need the current position in the Lean spec-driven pipeline, or any deterministic check of a Cradle project — status, golden regression, Lean layer walls, regeneration impact, unslop lint, ddd cleanup. Runs the scripts under scripts/ and reports their output verbatim.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

Use to start a new product on Cradle or to add the Cradle skeleton to an existing repository — writes cradle.json, the project-facts instruction (.apm/instructions/project.instructions.md), documents/{ddd,ai-notes,infra-design,codebase} templates, CI, and a compiling Lean executable-spec scaffold with a minimal example domain, mockup and CLI.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

Use when the product owner asks where the project stands, what to do next, or which phase of the Lean spec-driven pipeline is current — runs cradle status and proposes exactly one next step.

The English summary is being prepared. Showing the original description.

asuka1975/cradle5Updated Oct 1, 2026

See all skills by asuka1975

Report a problem with this skill