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

query-writing

Write the SQL or MongoDB query that answers a question and keeps answering it: the right grain, no fan out, parameterised window, checked against something known. Use when a number is needed that no report carries, when an existing query returns something that looks wrong, when a query is slow or expensive, or when somebody asks for a one off pull.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.7 KB

SKILL.md(原文)

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

Query writing

Goal

A query that returns the right rows today and the same rows next month, saved somewhere it can be found instead of rewritten.

Procedure

  1. Get the question before writing anything. What is being counted, over what window, at what grain, with which exclusions. A query written from a one line request answers a question nobody asked.
  2. Check whether it already exists. A saved query in memory/queries/, an existing report, a definition in memory/conventions/metrics.md. Rewriting an existing metric slightly differently is exactly how two reports end up disagreeing.
  3. Establish the grain and the key. Which table or collection is one row per what, and which key is genuinely unique. In MongoDB, check whether the document shape is consistent across the collection, because it usually is not and the exceptions are where the wrong count comes from.
  4. Write it to be re-run. Parameterise the window, name the columns rather than selecting everything, and avoid a wide scan you do not need. Explore with a limit, then remove it, since a limit caps rows returned and not work done.
  5. Check the fan out. If the row count exceeds the distinct entity count, a join or an unwind is multiplying rows and every total after it is inflated. This is the defect that survives review because the output looks plausible.
  6. Sanity check the answer against something known before handing it over: an existing report, a manual count on one slice you can verify by hand, last period's figure.
  7. Save it with the question it answers written next to it, in memory/queries/.

Boundaries

  • Never run a write, an update or a delete against production data to answer a question.
  • Never hand over a number without its window, its filters and its source.
  • Never compute a metric that already has a definition in a different way. Use the definition, or change it deliberately and say so.
  • Estimate the cost of a heavy scan before running it.
  • Never leave a one off query only in a chat message. It will be asked for again.

What to record

Save the query in memory/queries/ with the question it answers and the date. When the query establishes or settles a metric definition, write that to memory/conventions/metrics.md with its numerator, denominator, window and source, so the next person computes it the same way.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

Plan or review software architecture through a small expert panel. Use when the user explicitly asks for architecture planning, system design, technical strategy, an architecture assessment, a design review, or a system health review. Do not use for ordinary PR review, debugging, or implementation.

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

nanocoai/nanoclaw-templates182026年9月16日 更新

Thorough, consistently formatted competitor and product research. Produces a structured "About" doc, a "Recent News" log, and a row in a tracking spreadsheet. Use whenever the user researches a company or competitor, builds or updates a competitor doc, compares products, or logs a competitor to the tracker.

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

nanocoai/nanoclaw-templates182026年9月16日 更新

Household assistant for a whole family. Runs a morning brief, plans meals and builds grocery lists (hunting the best prices), looks ahead at the week's logistics, stays on top of the kids' school, watches prices on things the family wants, and helps book appointments and reservations. Use it for anything that keeps the family's day or week running. Trigger even on implicit asks - "what's on today", "what do the kids have this week", "what should we make for dinner", "add milk to the list", "when's the dentist", "did anything come from school", "remind me about the permission slip", "watch this jacket and tell me if it drops", "book us a table Friday".

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

nanocoai/nanoclaw-templates182026年9月16日 更新

Reporting workflow for a working journalist, using web research and Apify's X scraper (social signals). Onboards the journalist, monitors their beat and builds digests, evaluates story pitches, finds and vets sources, and prepares interviews. Use for any newsroom task, such as "what's new on my beat", "is this pitch any good", "who should I talk to about X", "prep me for this interview", or "turn these notes into a draft".

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

nanocoai/nanoclaw-templates182026年9月16日 更新

Check that the scheduled data work behind the reports actually ran and produced something sensible: the daily reshaping scripts, the API pulls, the tables the reports read from. Use each morning before anyone opens a report, when a report looks wrong and nobody knows whether it is the data or the query, after a schema or API change, when a new audience or source is added to the pipeline, or when a scheduled job failed or finished suspiciously fast.

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

nanocoai/nanoclaw-templates182026年9月16日 更新

Stand up reporting for a new audience — an external client, a business unit, a region, an executive team — end to end: what they need to see, whether the data exists, access and scoping, their place in the pipeline, the standard report set, and validation against numbers they can check themselves. Use when a new audience is onboarded, when an existing one adds a site, a region or a business unit, when their reporting is rebuilt after a change on their side, or when they say the numbers do not match their own records.

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

nanocoai/nanoclaw-templates182026年9月16日 更新

nanocoai のスキルをすべて見る

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