Skip to content

teaceo-debug/DEEP6 / .claude/skills/nt8-build-verify

nt8-build-verify

Verified

FileKindSize
README.mdmarkdown13.6 KB
SKILL.mdskill md1.5 KB
fixes/BRACE_MISMATCH.mdmarkdown5.1 KB
fixes/CS0019.mdmarkdown4.7 KB
fixes/CS0101.mdmarkdown4.9 KB
fixes/CS0103.mdmarkdown4.0 KB
fixes/CS0246.mdmarkdown5.4 KB
fixes/CS0535.mdmarkdown3.6 KB
fixes/CS1061.mdmarkdown5.0 KB
fixes/MISSING_ATTRIBUTE.mdmarkdown5.9 KB
knowledge.mdmarkdown3.5 KB
lib/__init__.pyscript0 B
lib/diagnostics.pyscript2.3 KB
lib/nt8_paths.pyscript3.8 KB
scripts/compile_editor.ps1script5.1 KB
scripts/compile_headless.ps1script9.2 KB
scripts/deploy.ps1script2.6 KB
scripts/fix_loop.ps1script19.7 KB
scripts/fix_router.pyscript15.8 KB
scripts/install_indicator.ps1script16.0 KB
scripts/modal_detect.ps1script10.9 KB
scripts/orchestrator.ps1script19.8 KB
scripts/parse_errors.pyscript4.6 KB
scripts/runtime_check.ps1script2.9 KB
scripts/screenshot_chart.ps1script7.5 KB
scripts/verify_visual.pyscript8.0 KB
scripts/workspace_mutator.pyscript17.6 KB

fixes/BRACE_MISMATCH.md

View on GitHub
# BRACE_MISMATCH — Unmatched braces or region directives

## Pattern
```
error CS1513: } expected
error CS1514: { expected
error CS1022: Type or namespace definition, or end-of-file expected
error CS0116: A namespace cannot directly contain members such as fields or methods
```
These errors often appear together and point to a location far from the actual mismatch.

## Root Causes (ordered by likelihood)
1. A closing `}` was deleted or never written, leaving a method, class, or namespace block open
2. An extra `{` was inserted (e.g., copy-paste of a block that already had its opening brace)
3. `#region` / `#endregion` imbalance — a `#region` was added without a matching `#endregion`, or vice versa (this doesn't cause a compile error but causes editor folding issues and can mask real brace errors)
4. A `using` block's `}` was removed, leaving the enclosed code at the wrong nesting level

## Fix Strategies

### Strategy 1: Count braces per scope level
- **Detect**: The compiler error points to a line near the end of the file, or to a line that looks syntactically correct. This is the classic sign of a brace mismatch earlier in the file.
- **Lookup**: Count opening `{` and closing `}` in the file. They must be equal. A quick count:
  ```powershell
  $src = Get-Content "path\to\File.cs" -Raw
  $open  = ($src.ToCharArray() | Where-Object { $_ -eq '{' }).Count
  $close = ($src.ToCharArray() | Where-Object { $_ -eq '}' }).Count
  Write-Host "Open: $open  Close: $close  Delta: $($open - $close)"
  ```
- **Fix**: If `open > close`, a `}` is missing. If `close > open`, there's an extra `}`. Locate the mismatch by scanning from the top, tracking depth. Insert or remove the brace at the correct location.
- **Verify**: After the fix, `open == close` and the file compiles without CS1513/CS1514.

### Strategy 2: Locate the mismatch by depth tracking
- **Detect**: The brace count is off by 1 or 2. The error line number is near the end of the file.
- **Lookup**: Walk the file line by line, maintaining a depth counter. Increment on `{`, decrement on `}`. The first line where depth goes negative (extra `}`) or the last line where depth is non-zero (missing `}`) is the mismatch site.
- **Fix**: Insert the missing `}` at the end of the block that was left open, or remove the extra `}` at the line where depth went negative.
- **Verify**: Depth reaches exactly 0 at the last line of the file.

```
Depth tracking example:
  namespace N {          // depth: 1
    public class C {     // depth: 2
      void M() {         // depth: 3
        if (x) {         // depth: 4
        }                // depth: 3
      // Missing }       // depth stays 3 — mismatch!
    }                    // depth: 2 (closes class, but method was never closed)
  }                      // depth: 1 (closes namespace)
                         // EOF at depth 1 — CS1513: } expected
```

### Strategy 3: Region/endregion imbalance
- **Detect**: The file uses `#region` / `#endregion` directives and the editor shows folding errors, or a `#endregion` appears without a matching `#region` (or vice versa).
- **Lookup**: Count `#region` and `#endregion` occurrences. They must be equal and properly nested.
  ```powershell
  Select-String -Path "File.cs" -Pattern "#region|#endregion"
  ```
- **Fix**: Add the missing `#endregion` at the end of the region block, or remove the orphaned `#endregion`. Region directives don't affect compilation but their imbalance can hide real brace errors in the editor.
- **Verify**: `#region` count equals `#endregion` count. The file compiles cleanly.

### Strategy 4: Copy-paste introduced duplicate opening brace
- **Detect**: A block of code was pasted and the paste included the opening `{` of the block, but the destination already had an opening `{` for that scope. The result is an extra `{` that opens a nested scope where none was intended.
- **Lookup**: Look for two consecutive `{` on adjacent lines without any code between them, or a `{` immediately after a method signature that already has a `{` on the same line.
- **Fix**: Remove the extra `{` and its matching `}` (which will be somewhere later in the file, closing the unintended nested scope).
- **Verify**: The method or block has exactly one opening and one closing brace.

## NT8-Specific Notes

- NT8 indicators and strategies have a fixed nesting structure: `namespace { class { method { } } }`. Any deviation from 3 levels of nesting (for a simple method) is suspicious.
- `OnStateChange`, `OnBarUpdate`, and `OnRender` are the most common sites for brace mismatches because they contain nested `if (State == ...)` blocks.
- After a brace fix, always run `nt8-ai-loop.ps1` to confirm the compile succeeds. Brace errors cascade — fixing one may reveal another.

## Example Fix

```diff
  protected override void OnStateChange()
  {
      if (State == State.SetDefaults)
      {
          Name = "DEEP6Footprint";
          Description = "Footprint chart renderer";
      }
      else if (State == State.DataLoaded)
      {
          _bidSeries = new Series<double>(this);
          _askSeries = new Series<double>(this);
-     // Missing closing brace for DataLoaded block — CS1513 fires at end of file
+     }
  }
```
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall