copilot-setting: Command for GitHub Copilot

.github/prompts/check-n-plus-1.prompt.md

check-n-plus-1 is a command for GitHub Copilot from zexion7873/copilot-setting. It costs 21 tokens per session (151 once invoked), scanned A, original, MIT.

A checker for N+1 database queries, where one initial query is followed by many extra queries, often inside a loop. It looks for lazy-loaded relationships and queries that could be combined.

In plain words
What is it for?
Use it to inspect service methods that load related records or run database queries in loops. It suggests Hibernate query changes such as JOIN FETCH when appropriate.
Why use it?
N+1 queries can make an otherwise correct service slow as the amount of data grows. Finding the loop and the triggering access points helps you fix the database access pattern.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt.

This is zexion7873/copilot-setting's own configuration. It tells GitHub Copilot how to work on copilot-setting itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything copilot-setting configures →

Reuse

Borrowing it

Nothing to install: this file belongs to zexion7873/copilot-setting. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/zexion7873/copilot-setting/main/.github/prompts/check-n-plus-1.prompt.md
Clone the repo
git clone --depth 1 https://github.com/zexion7873/copilot-setting

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-n-plus-1

README.md
[![agentmods](https://agentmods.dev/badge/commands/zexion7873/copilot-setting/check-n-plus-1/github.svg)](https://agentmods.dev/commands/zexion7873/copilot-setting/check-n-plus-1)
Your own site
<a href="https://agentmods.dev/commands/zexion7873/copilot-setting/check-n-plus-1"><img src="https://agentmods.dev/badge/commands/zexion7873/copilot-setting/check-n-plus-1/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for check-n-plus-1

Your own site · 80×15
<a href="https://agentmods.dev/commands/zexion7873/copilot-setting/check-n-plus-1"><img src="https://agentmods.dev/badge/commands/zexion7873/copilot-setting/check-n-plus-1.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 151 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.00151
Opus 5.5 $0.00008 $0.00060
Sonnet 5.5 $0.00004 $0.00030
Haiku 4.5 $0.00002 $0.00015

Measured 1mo ago against content hash badcb7ffe639, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

check-n-plus-1 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/prompts/check-n-plus-1.prompt.md · 12 lines

What it actually says

Check this service method for N+1 query problems:

  1. Is lazy loading triggered inside a loop (accessing collections or associations)?
  2. Are SQL / HQL queries executed inside a loop?
  3. Are there lazy collections solvable with JOIN FETCH or fetch="join"?

Output one entry per problem: location (file:line) → the triggering access (loop + lazy association) → fix (HQL JOIN FETCH or hbm.xml fetch="join"). If the method is N+1-clean, say so in one line — do not pad with a per-check explanation.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -1 lines badcb7ffe639
  2. 1mo ago First seen · 13 lines · 21 tokens per session scan A 2c07a70b6e2a

Subscribe to this mod's changes

check-n-plus-1 is a command published in the GitHub repository zexion7873/copilot-setting (1 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 151 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-11.

Related

check-n-plus-1 compared with commands from other repositories

check-n-plus-1 next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
check-n-plus-1zexion7873/copilot-settingCommand11mo agoMITA21GitHub Copilot
vibeflow-hotfixpe-menezes/vibeflowCommand33yesterdayMITA30Claude Code
dev.implement-cli-args-parsingstefaniuk/loadoutCommand119d agoMITA12GitHub Copilot
dev.implement-loggingstefaniuk/loadoutCommand119d agoMITA10GitHub Copilot
profilejabrena/plinthCommand460yesterdayApache-2.0A10Claude Code, Cursor
update-issuejabrena/plinthCommand460yesterdayApache-2.0A11Claude Code, Cursor
util.gh-pr-contentstefaniuk/loadoutCommand119d agoMITA9GitHub Copilot