troy: Skill for Cursor

.cursor/skills/trailing-comma/SKILL.md

trailing-comma is a skill for Cursor from sybrew/troy. It costs 54 tokens per session (767 once invoked), scanned A, original, MIT.

A code-formatting rule for adding trailing commas to supported multiline PHP and JavaScript calls, arrays, and objects. It also distinguishes places where those commas are not valid or wanted.

In plain words
What is it for?
It is for formatting multiline PHP and JavaScript expressions according to this repository's rules.
Why use it?
It removes guesswork when wrapping code across multiple lines and helps avoid syntax or style errors caused by misplaced commas.

Skill for Cursor

Written for Cursor: installed under .cursor/.

This is sybrew/troy's own configuration. It tells Cursor how to work on troy 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 troy configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sybrew/troy. 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/sybrew/troy/main/.cursor/skills/trailing-comma/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sybrew/troy

Made for: Cursor.

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 trailing-comma

README.md
[![agentmods](https://agentmods.dev/badge/skills/sybrew/troy/trailing-comma/github.svg)](https://agentmods.dev/skills/sybrew/troy/trailing-comma)
Your own site
<a href="https://agentmods.dev/skills/sybrew/troy/trailing-comma"><img src="https://agentmods.dev/badge/skills/sybrew/troy/trailing-comma/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 trailing-comma

Your own site · 80×15
<a href="https://agentmods.dev/skills/sybrew/troy/trailing-comma"><img src="https://agentmods.dev/badge/skills/sybrew/troy/trailing-comma.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 767 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.00054 $0.00767
Opus 5.5 $0.00022 $0.00307
Sonnet 5.5 $0.00011 $0.00153
Haiku 4.5 $0.00005 $0.00077

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

Security

Grade A, and why

trailing-comma 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.

.cursor/skills/trailing-comma/SKILL.md · 89 lines

How it starts

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

Trailing commas

Source of truth: .github/copilot-instructions.md — trailing commas at the end of multiline object/array properties and function arguments when the language supports it.

PHP 7.4

Put a trailing comma on multiline:

  • Function and method calls (apply_filters(, sprintf(, Escape::css_content()
  • array( … ) and [ … ] literals

Do not put a trailing comma on:

  • Function, method, closure, or fn() parameter lists in PHP 7.4 packages (PHP 8.0 syntax)
  • Closure use ( … ) lists (PHP 8.0)
  • if ( / elseif ( / for ( / foreach ( / while ( / switch ( / catch ( conditions
  • Single-line calls or arrays

src/troy-server/** is PHP 8.4+. Put a trailing comma on multiline parameter lists there, matching existing constructors. PHP 7.4 packages must not.

JavaScript

Same rule for multiline calls, arrays, and objects. Parameter lists may have trailing commas (ES2017). Do not edit *.min.js.

Shapes

Comma after the last item of a multiline call, array, or object. A docblock after ( does not make it single-line.

foo( $a, $b );           // no — one line
foo(
	$a,
	$b,                  // yes
);
bar(
	baz( $x ),           // yes — bar is multiline
);
bar(
	baz(
		$x,              // yes — both
	),
);
[
	'a' => 1,
	'b' => 2,            // yes
];
function f( $a, $b ) {}  // no — one line; PHP 7.4 packages: never on params
function f(             // troy-server (PHP 8.4) multiline params: yes
	$a,
	$b,
) {}
use ( $c )               // no — closure use (PHP 8.0)
if ( $a && $b ) {}       // no — condition
fn( a, b );              // no — one line
fn(
	a,
	b,                   // yes
);
{ a: 1, b: 2 };          // no — one line
{
	a: 1,
	b: 2,                // yes
}
function f( a, b ) {}    // yes — JS parameters may

Finder

PHP only. Same command on Windows (PowerShell or cmd), macOS, and Linux. PHP 7.4+ on PATH. Reports; does not rewrite.

php .cursor/skills/trailing-comma/scripts/find-missing.php path/to/file.php
php .cursor/skills/trailing-comma/scripts/find-missing.php src

Read the full file on GitHub · 89 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 89 lines · 54 tokens per session scan A ef803901cb6e

Subscribe to this mod's changes

trailing-comma is a skill published in the GitHub repository sybrew/troy (55 stars, last pushed 14d ago), licensed MIT. It adds 54 tokens to every session and 767 once invoked, about $0.0002 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-10-26.

Related

Other skills, from other repositories

bd-better-route-bridge

Compose better-data DTOs with the better-route library — use BetterRouteBridge::{get, post, put, patch, delete} to register a REST route that hydrates the request into a DTO, validates, calls the handler with (DataObject, mixed $request), and presents returned DataObject values through Presenter with…

Lonsdale201/wp-agent-skills · 214 tokens

bd-data-object

Add or modify DataObject subclasses inside the better-data library — the immutable, attribute-decorated DTOs the whole library is built around. Every DTO is final readonly class extends DataObject with constructor-promoted typed parameters; sources hydrate via ::fromArray, sinks project via SinkProjection, the…

Lonsdale201/wp-agent-skills · 206 tokens

wp-plugin-bootstrap

Scaffolds and reviews the main entry-point PHP file of a WordPress plugin — header (with Requires Plugins for WP 6.5+), ABSPATH guard, file/path/url/version constants, Composer PSR-4 autoload with src/ as the default class root, optional scoped fallback for release ZIP safety, PascalCase class filenames that match…

Lonsdale201/wp-agent-skills · 183 tokens

bd-attribute

Add a new declarative attribute to the better-data library (e.g. #[ArrayOf], #[Default], domain hint). Attributes live in src/Attribute/ as final readonly classes with constructor-promoted public properties — pure data carriers, never business logic. The failure mode that catches every contributor is "partial wiring"…

Lonsdale201/wp-agent-skills · 193 tokens

bd-hydration-coercion

Modify how raw values become typed property values in better-data — work in TypeCoercer (primitives + DateTime + Enum + Secret) or DataObject::coerceParameter (attribute-aware — ListOf, Encrypted, etc.). Critical layering — TypeCoercer is pure, must stay callable from a no-WordPress unit test, no side effects, no…

Lonsdale201/wp-agent-skills · 224 tokens

bd-source-adapter

Add a new source adapter to better-data — code that reads from a WordPress data store the library doesn't cover yet (comments, attachments, transients, custom tables). Mirror the canonical shape PostSource / UserSource / TermSource use — a non-final class with static hydrate(int|object, $dtoClass) and…

Lonsdale201/wp-agent-skills · 207 tokens