new-repository

new-repository is a command for GitHub Copilot from srnichols/plan-forge. It costs 19 tokens per session (562 once invoked), scanned A, original, MIT.

A .NET command that creates a repository interface and data-access class using Dapper. A repository is the part of an application that reads and writes data in a database.

In plain words
What is it for?
Use it to add a repository for an entity with database queries, paging, and asynchronous insert, read, update, and delete methods.
Why use it?
Data-access code often repeats connection handling, parameterized queries, asynchronous methods, and common create/read/update/delete operations. This command starts that code in the project's specified pattern.

Command for GitHub Copilot

Written for GitHub Copilot: a Copilot chat mode or prompt. Also seen: agent in frontmatter.

Good fit Use it to add a repository for an entity with database queries, paging, and asynchronous insert, read, update, and delete methods.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/srnichols/plan-forge/new-repository
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/srnichols/plan-forge

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 new-repository

README.md
[![agentmods](https://agentmods.dev/badge/commands/srnichols/plan-forge/new-repository.svg)](https://agentmods.dev/commands/srnichols/plan-forge/new-repository)
Your own site
<a href="https://agentmods.dev/commands/srnichols/plan-forge/new-repository"><img src="https://agentmods.dev/badge/commands/srnichols/plan-forge/new-repository.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 562 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.00019 $0.00562
Opus 5 $0.00010 $0.00281
Sonnet 5 $0.00004 $0.00112
Haiku 4.5 $0.00002 $0.00056

Measured today against content hash 9eab389da544, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

new-repository 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 today.

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.

presets/dotnet/.github/prompts/new-repository.prompt.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create New Repository

Scaffold a data access repository following clean architecture.

Required Pattern

Interface (I{EntityName}Repository.cs)

public interface I{EntityName}Repository
{
    Task<{EntityName}Dto?> GetByIdAsync(Guid id, CancellationToken ct = default);
    Task<IEnumerable<{EntityName}Dto>> GetAllAsync(int page, int pageSize, CancellationToken ct = default);
    Task<{EntityName}Dto> InsertAsync(Create{EntityName}Request request, CancellationToken ct = default);
    Task<bool> UpdateAsync(Guid id, Update{EntityName}Request request, CancellationToken ct = default);
    Task<bool> DeleteAsync(Guid id, CancellationToken ct = default);
}

Dapper Implementation ({EntityName}Repository.cs)

public sealed class {EntityName}Repository(IDbConnectionFactory connectionFactory) : I{EntityName}Repository
{
    public async Task<{EntityName}Dto?> GetByIdAsync(Guid id, CancellationToken ct = default)
    {
        const string sql = """
            SELECT id AS Id, name AS Name, created_at AS CreatedAt
            FROM {entity_name}s
            WHERE id = @Id
            """;
        using var connection = await connectionFactory.CreateConnectionAsync(ct);
        return await connection.QuerySingleOrDefaultAsync<{EntityName}Dto>(sql, new { Id = id });
    }
}

EF Core Implementation ({EntityName}Repository.cs)

public sealed class {EntityName}Repository(AppDbContext context) : I{EntityName}Repository
{
    public async Task<{EntityName}Dto?> GetByIdAsync(Guid id, CancellationToken ct = default)
    {
        return await context.{EntityName}s
            .Where(e => e.Id == id)
            .Select(e => new {EntityName}Dto(e.Id, e.Name, e.CreatedAt))
            .FirstOrDefaultAsync(ct);
    }
}

Rules

  • Repositories handle data access ONLY — no business logic
  • ALL SQL uses parameterized queries (@Param) — NEVER string interpolation
  • CancellationToken on every async method
  • Use using or await using for connection disposal
  • Use explicit column aliases: SELECT snake_col AS PascalProp
  • Register as Scoped in DI

Read the full file on GitHub · 68 lines

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. today First seen · 68 lines · 19 tokens per session scan A 9eab389da544

Subscribe to this mod's changes

new-repository is a command published in the GitHub repository srnichols/plan-forge (5 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 562 once invoked, about $0.0001 per session on Opus 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-08.