codebehind-class-body-location

codebehind-class-body-location is a skill for Claude Code, Codex from FritzAndFriends/BlazorWebFormsComponents. It costs 0 tokens per session (570 once invoked), scanned A, original, MIT.

A code pattern for finding the opening brace of a class in generated C# code before adding fields or members.

In plain words
What is it for?
It helps maintain code-behind transforms, which modify the C# file paired with a page, so injected members appear in the correct class.
Why use it?
It keeps automated code changes working when a class also has a base class, interfaces, or line breaks before its opening brace.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps maintain code-behind transforms, which modify the C# file paired with a page, so injected members appear in the correct class.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location
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.

Any agent
npx skills add FritzAndFriends/BlazorWebFormsComponents --skill codebehind-class-body-location
Clone the repo
git clone --depth 1 https://github.com/FritzAndFriends/BlazorWebFormsComponents

Made for: Claude Code, Codex.

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 codebehind-class-body-location

README.md
[![agentmods](https://agentmods.dev/badge/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location/github.svg)](https://agentmods.dev/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location)
Your own site
<a href="https://agentmods.dev/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location"><img src="https://agentmods.dev/badge/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location/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 codebehind-class-body-location

Your own site · 80×15
<a href="https://agentmods.dev/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location"><img src="https://agentmods.dev/badge/skills/fritzandfriends/blazorwebformscomponents/codebehind-class-body-location.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 570 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00570
Opus 5.5 $0.00000 $0.00228
Sonnet 5.5 $0.00000 $0.00114
Haiku 4.5 $0.00000 $0.00057

Measured 3mo ago against content hash 32718661f6f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebehind-class-body-location 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 3mo 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.

.squad/skills/codebehind-class-body-location/SKILL.md · 52 lines

How it starts

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

Skill: Code-Behind Transform — Class Body Location Pattern

Summary

When a code-behind transform must locate the class body opening brace ({) to inject fields or members, it must use [^{]*\{ not \s*\{ between the class name and the brace.

Problem This Solves

Code-behind transforms run in Order sequence. Earlier transforms (e.g., BaseClassStripTransform at Order 200) modify the class declaration before later transforms see it. By Order 220+, a typical Page class looks like:

public partial class ShoppingCart : WebFormsPageBase
{

A regex like partial\s+class\s+\w+\s*\{ fails to match this because : WebFormsPageBase\n is not \s*. The transform silently returns the content unchanged — no injection happens, no error is raised.

Correct Pattern

// WRONG — fails when base class or interface list is present
private static readonly Regex ClassOpenRegex = new(
    @"partial\s+class\s+\w+\s*\{",
    RegexOptions.Compiled);

// CORRECT — [^{]* skips base class, interfaces, newlines, anything before {
private static readonly Regex ClassOpenRegex = new(
    @"partial\s+class\s+\w+[^{]*\{",
    RegexOptions.Compiled);

[^{]* matches : WebFormsPageBase, : Base, IInterface, spaces, newlines — everything up to (but not including) the first {.

When To Apply

  • Any transform that injects members/fields/properties into a class body.
  • Any transform that locates the class body to insert using statements or attributes near it.

Test Coverage Required

When authoring such a transform, always include these three test shapes:

  1. Plain class — public partial class Foo { (baseline)
  2. Class with base — public partial class Foo : WebFormsPageBase {
  3. Brace on next line with base — public partial class Foo : WebFormsPageBase\n{

Real-World Example

ComponentRefCodeBehindTransform (Order 220) injects @ref backing fields. It was broken from inception because its ClassOpenRegex used \s*\{. After BaseClassStripTransform (Order 200) added : WebFormsPageBase, the regex never matched — causing 15+ CS0103 errors per page in WingtipToys Run 80.

Read the full file on GitHub · 52 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. 3mo ago First seen · 52 lines · 0 tokens per session scan A 32718661f6f6

Subscribe to this mod's changes

codebehind-class-body-location is a skill published in the GitHub repository FritzAndFriends/BlazorWebFormsComponents (454 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 570 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.

Related

codebehind-class-body-location compared with skills from other repositories

codebehind-class-body-location next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codebehind-class-body-locationFritzAndFriends/BlazorWebFormsComponentsSkill4545mo agoMITA0Claude Code, Codex
lumeoBrain2k-0005/LumeoSkill248d agoMITA133Claude Code, Codex
vue-best-practicesTenon-Net/TenonAdminSkill47yesterdayApache-2.0A81Claude Code, Codex
create-adaptable-composableTenon-Net/TenonAdminSkill47yesterdayApache-2.0A80Claude Code, Codex
vue-options-api-best-practicesTenon-Net/TenonAdminSkill47yesterdayApache-2.0A30Claude Code, Codex
dotnet-vuln-scannerjinyimeng01/net-code-audit-skill-masterSkill77mo agoMulanPSL-2.0A58Codex
migrate-xunit-to-xunit-v3dotnet/skillsSkill6.4ktodayMITA149Claude Code