Install any skill in seconds. Free to start, no credit card required.
Get Started Free →fritzandfriends/skill-code-behind-transform-class-body-location-pattern
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.
Passed 21 of 21 test cases with the skill, and 16 of 21 without it.
and 3 more in the full report
5 fixed17 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
How does `BaseClassStripTransform` operating at Order 200 alter the class header of a C# code-behind file before downstream field injection transforms execute?
| Checked | Without skill | With skill |
|---|---|---|
| Modifies the class declaration line by replacing or appending base class inheritance details | Missed | Passed |
The instructions your model reads when the skill loads.
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.
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.
// 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 {.
test cases passed, vs 16 / 21 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.