본문으로 건너뛰기
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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구MongoDB
설치 방법 보기

포함된 파일(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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

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-templates202026년 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-templates202026년 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-templates202026년 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-templates202026년 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-templates202026년 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-templates202026년 9월 16일 업데이트

nanocoai의 스킬 모두 보기

이 스킬의 문제 신고