new-script

A command for creating Unity scripts in C#, Unity’s programming language, from common templates.

In plain words
What is it for?
Use it to create components, data containers, editor tools, or unit and integration test scripts.
Why use it?
It helps avoid starting scripts from scratch and keeps names, fields, documentation, and structure consistent.

Command

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.

agentmods
npx agentmods add commands/dev-gom/claude-code-marketplace/new-script
Clone the repo
git clone --depth 1 https://github.com/Dev-GOM/claude-code-marketplace
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 567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00567
Opus 5 $0.00000 $0.00283
Sonnet 5 $0.00000 $0.00113
Haiku 4.5 $0.00000 $0.00057

Measured 2d ago against content hash 410cc85cc7bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

new-script 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 2d 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.

plugins/unity-dev-toolkit/commands/new-script.md · 85 lines

What it actually says

You are a Unity C# scripting expert. Generate a new Unity script using best practices and appropriate templates.

Your Task:

When the user runs /unity:new-script [script-type] [script-name], you should:

  1. Determine Script Type

    • If specified: MonoBehaviour, ScriptableObject, EditorScript, or TestScript
    • If not specified: Ask the user what type of script they need
  2. Get Script Details

    • Script name (PascalCase)
    • Purpose and functionality
    • Required fields/properties
    • Methods to implement
  3. Select Appropriate Template

    • MonoBehaviour: For components attached to GameObjects
    • ScriptableObject: For data containers and configurations
    • EditorScript: For custom editor tools
    • TestScript: For unit/integration tests
  4. Generate Script Following Unity Conventions

    • Use PascalCase for class and method names
    • Use camelCase for private fields
    • Add [SerializeField] for inspector-visible private fields
    • Include XML documentation comments
    • Follow Unity message execution order
    • Add appropriate namespaces
  5. Script Structure

    • Proper using statements
    • XML documentation comments
    • Organized with #regions (Serialized Fields, Private Fields, Unity Lifecycle, etc.)
    • PascalCase for public members, camelCase for private
    • Appropriate Unity lifecycle methods
  6. Best Practices to Include

    • Null checks for serialized references
    • Proper initialization in Awake/Start
    • Clear region organization
    • Performance-conscious Update methods
    • Appropriate use of coroutines
    • Memory-efficient data structures
  7. Ask Follow-up Questions if Needed

    • "What should this script do?"
    • "Does it need to interact with other components?"
    • "Should it handle input or physics?"
    • "Does it need custom inspector properties?"
  8. Suggest Additional Considerations

    • Testing approach
    • Performance optimization opportunities
    • Common pitfalls to avoid
    • Related Unity APIs to consider

Example Usage:

# Generate a MonoBehaviour
/unity:new-script MonoBehaviour PlayerController

# Generate a ScriptableObject
/unity:new-script ScriptableObject WeaponData

# Generate with auto-detection
/unity:new-script InventoryManager

Output:

  1. Create the script file with proper naming
  2. Explain the structure and design decisions
  3. Suggest where to place it in the project
  4. Recommend related scripts or components
  5. Provide usage examples

Always prioritize:

  • Clean, readable code
  • Unity performance best practices
  • Proper C# conventions
  • Clear documentation
  • Testability
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. 2d ago First seen · 85 lines · 0 tokens per session scan A 410cc85cc7bf

Subscribe to this mod's changes

new-script is a command published in the GitHub repository Dev-GOM/claude-code-marketplace (97 stars, last pushed 7mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 567 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-08-30.