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.
npx agentmods add skills/lewing/helix.mcp/string-perf-patternsnpx skills add lewing/helix.mcp --skill string-perf-patternsgit clone --depth 1 https://github.com/lewing/helix.mcpWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00732 |
| Opus 5 | $0.00000 | $0.00366 |
| Sonnet 5 | $0.00000 | $0.00146 |
| Haiku 4.5 | $0.00000 | $0.00073 |
Grade A, and why
string-perf-patterns 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 3d 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.
How it starts
The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SKILL: String Performance Patterns in .NET
When to apply
When writing or reviewing C# code that processes text content — especially log files, API responses, or search operations that may handle multi-MB strings.
Patterns to avoid
1. Chained .Replace() for line-ending normalization
// BAD — 2 intermediate full-size strings
var normalized = content.Replace("\r\n", "\n").Replace("\r", "\n");
Fix: Use a span-based line enumerator, or string.Create with a single-pass copy that normalizes as it goes. For search operations, consider handling mixed line endings during iteration instead of pre-normalizing.
2. Split() + Join() for tail/head operations
// BAD — allocates string[] of all lines just to get last N
var lines = content.Split('\n');
return string.Join('\n', lines[^tailLines..]);
Fix: Reverse-scan for Nth \n using ReadOnlySpan<char>:
var span = content.AsSpan();
int pos = span.Length;
for (int i = 0; i < tailLines && pos > 0; i++)
{
pos = span[..pos].LastIndexOf('\n');
if (pos < 0) { pos = 0; break; }
}
return pos > 0 ? content[(pos + 1)..] : content;
3. Substring allocation in pattern matching
// BAD — allocates new string every call
name.EndsWith(pattern[1..], StringComparison.OrdinalIgnoreCase);
Fix: Use spans:
name.AsSpan().EndsWith(pattern.AsSpan(1), StringComparison.OrdinalIgnoreCase);
4. Triple-iteration for categorization
// BAD — 3 passes over same list
Binlogs = files.Where(f => IsBinlog(f)).Select(Map).ToList();
TestResults = files.Where(f => IsTest(f)).Select(Map).ToList();
Other = files.Where(f => !IsBinlog(f) && !IsTest(f)).Select(Map).ToList();
Fix: Single-pass loop:
var binlogs = new List<FileInfo_>();
var testResults = new List<FileInfo_>();
var other = new List<FileInfo_>();
foreach (var f in files)
{
var mapped = new FileInfo_ { Name = f.Name, Uri = f.Uri };
if (IsBinlog(f.Name)) binlogs.Add(mapped);
else if (IsTest(f.Name)) testResults.Add(mapped);
else other.Add(mapped);
}
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.
- 3d ago First seen · 76 lines · 0 tokens per session scan A a04aa74332f7
string-perf-patterns is a skill published in the GitHub repository lewing/helix.mcp (4 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 732 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-31.
Other skills, from other repositories
dpg-migration
Migration logic for Azure SDK for .NET data-plane libraries migrating from AutoRest/Swagger to TypeSpec-based generation. Uses MCP tools from the generator-agent server for automated deterministic fixes.
mgmt-review-comment-resolution
Resolve review comments on Azure management-plane .NET SDK PRs. Handles renaming types/properties, changing property types, and other API surface adjustments by updating TypeSpec client.tsp and regenerating.
mpg-migration
Handles Azure SDK for .NET management-plane migrations from AutoRest/Swagger to TypeSpec; use for MPG, mgmt migration, or Azure.ResourceManager. migration requests.
generate-code-cs
Generate the code from typespec for C#. Parameter: C# SDK repository root location .
bump-mgmt-base-version
Bump the http-client-csharp base dependency version in http-client-csharp-mgmt. Updates emitter (npm) and generator (NuGet) references, rebuilds, and regenerates test projects.
author-test
Generate a test given sample. Parameters: C# SDK repository root; Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; the sample to use as a starting point for the test.