command-attribute-template.cs

command-attribute-template.cs is a command for Claude Code from gabrielmoreira/agent-skills-mirror. It costs 0 tokens per session (707 once invoked), scanned A, original, MIT.

A C# template for declaring fixed plugin commands and shorter aliases with SwiftlyS2 attributes. The command handler is a regular void method, while more complex work can be kept in separate services or modules.

In plain words
What is it for?
Use it to add commands, aliases, permissions, argument checks, and player feedback to SwiftlyS2 plugins.
Why use it?
It helps small plugins define command entry points correctly and makes the required handler shape clear.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to add commands, aliases, permissions, argument checks, and player feedback to SwiftlyS2 plugins.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs
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/gabrielmoreira/agent-skills-mirror

Made for: Claude Code.

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 command-attribute-template.cs

README.md
[![agentmods](https://agentmods.dev/badge/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs/github.svg)](https://agentmods.dev/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs)
Your own site
<a href="https://agentmods.dev/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs"><img src="https://agentmods.dev/badge/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs/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 command-attribute-template.cs

Your own site · 80×15
<a href="https://agentmods.dev/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs"><img src="https://agentmods.dev/badge/commands/gabrielmoreira/agent-skills-mirror/command-attribute-template.cs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 707 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.00000 $0.00707
Opus 5 $0.00000 $0.00353
Sonnet 5 $0.00000 $0.00141
Haiku 4.5 $0.00000 $0.00071

Measured 5d ago against content hash 4f4f6b5864a2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

command-attribute-template.cs 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 5d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

mirrors/repos/2oaJ@SwiftlyS2-Toolkit/skills/SwiftlyS2-Toolkit/assets/development/commands/command-attribute-template.cs.md · 80 lines

How it starts

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

SwiftlyS2 Attribute Command Template

Official docs sections:

  • Commands
  • Using attributes
  • Thread Safety

Suitable for: partial / small plugins that use [Command] and [CommandAlias] to declare fixed command entry points.

Usage principles

  • The command layer should own the entry point, permissions, argument validation, and player feedback.
  • Complex business logic should be pushed down into modules or services.
  • If the feature later needs dynamic install / uninstall, conditional start / stop, or precise cleanup, consider switching to programmatic registration.

Critical constraints

Handler return type must be void

The [Command] attribute handler signature is void OnMyCommand(ICommandContext context). It must not be async ValueTask, async Task, or any other async return type. The underlying delegate type is delegate void CommandListener(ICommandContext context);. If you need to perform async work inside a command handler, you may fire-and-forget an async method from within the void handler body, but the handler entry point itself must remain void.

CommandAlias is a shorter alias, not a prefixed variant

[CommandAlias("mc")] registers an alternative name that players can type instead of the full command (e.g., !mc instead of !mycommand). It is not used to add framework prefixes like sw_ or namespace groupings. Aliases should be short, memorable abbreviations of the canonical command name.

Example skeleton

using SwiftlyS2.Shared.Commands;
using SwiftlyS2.Shared.Core.Attributes.Commands;

namespace MyNamespace;

public partial class MyPlugin
{
    [Command("mycommand", permission: "myplugin.commands.use")]
    [CommandAlias("mc")]
    public void OnMyCommand(ICommandContext context)
    {
        if (!context.IsSentByPlayer || context.Sender is null || !context.Sender.IsValid)
        {
            context.Reply("[Plugin] This command can only be executed by a valid player.");
            return;
        }

        var args = context.Arguments;
        if (args.Count < 2)
        {
            context.Reply("[Plugin] Invalid arguments. Please check the input format.");
            return;
        }

        var parsedArg = args[1].Trim();
        if (string.IsNullOrWhiteSpace(parsedArg))
        {
            context.Reply("[Plugin] The argument cannot be empty.");
            return;
        }

        var success = _myFeatureService.TryHandlePlayerAction(context.Sender.SteamID, parsedArg);
        if (!success)
        {
            context.Reply("[Plugin] This operation cannot be executed right now.");
            return;
        }

        context.Reply("[Plugin] Operation completed successfully.");
    }
}

Read the full file on GitHub · 80 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. 5d ago First seen · 80 lines · 0 tokens per session scan A 4f4f6b5864a2

Subscribe to this mod's changes

command-attribute-template.cs is a command published in the GitHub repository gabrielmoreira/agent-skills-mirror (17 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 707 tokens. 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-03.