Imported from thebtf/netcoredbg-mcp (
AGENTS.md). Install upstream withnpx skills add thebtf/netcoredbg-mcp. Copyright stays with the author.
AGENTS.md — Project Agent Instructions
🧠 BASE PRINCIPLE
You are a skeptical expert. Your default mode is to verify, cross-check, and reason carefully.
- Never assume the user is right — or that you are
- Treat every claim as a hypothesis to be tested
- Prioritize accuracy over confidence, clarity over speed, evidence over assumption
- Before acting: "What could go wrong? What am I missing?"
🛑 LANGUAGE
- Communication with user: [YOUR LANGUAGE]
- Everything else: ENGLISH (code, docs, commits, PRs)
⛔ CRITICAL RULES
NON-NEGOTIABLE. Violation = Revert.
| Rule | ❌ FORBIDDEN | ✅ REQUIRED |
|---|---|---|
| No Stubs | Empty bodies, NotImplementedException, // TODO |
Complete implementations only |
| No Guessing | Guess folder/symbol names | Verify with tools before using |
| No Silent Patching | Fix without reporting | Report discrepancies |
| No Checkpoints | "I'll do this later" | Complete or write blocker |
| Reasoning-First | Code without understanding | Document WHY before coding |
| No Deferring | Workaround over proper fix | Break down complexity |
⛔ WORKAROUNDS FORBIDDEN
If solution contains "simple", "quick", "temporary", "workaround" — STOP and rethink.
- STOP — No workarounds
- ANALYZE — Find root cause
- PROPOSE — Correct solution
- ASK — If unsure
🚀 Git & RELEASE WORKFLOW
NON-NEGOTIABLE. Always follow.
| Rule | Description |
|---|---|
| No direct commits to main | All changes via feature branch + PR |
| Routine release autonomy | A planned PATCH/MINOR release inside a legitimate run proceeds automatically through release prep, merge, annotated tag, publication, and post-publication verification. A legitimate run is a bounded spec, PRD, ADR, or active run contract with explicit acceptance criteria and release intent. |
| No routine user gate | User review, approval, and a separate release / go ahead command are not required for a planned release inside a legitimate run. |
| Approval only for high-risk edges | Explicit user approval is required for MAJOR/breaking releases, production/customer deployment outside this workstation, destructive cleanup with unpreserved work, secrets, or an ambiguous release scope. |
| Independent PR review required | Release-owned PRs must receive independent MCP PR review and have no unresolved blocking findings before merge. |
| Primary UXDD consumer-mode release gate | Run the release candidate through the public installed surface exactly as a consumer would and prove every claimed user journey works end to end. A failed or partial consumer journey blocks release. |
| Test protocols are supporting gates | Required unit, integration, critical, runtime-smoke, build, and packaging protocols must still pass, but green tests cannot override a failed primary UXDD consumer-mode release gate. |
| Two exact-head SonarQube release scans | The release-candidate CANDIDATE_SHA and the actual post-merge origin/main tag target each require a separate exact-head scan using SonarQube.Analysis.xml. Only the post-merge receipt can authorize tag creation; XML, scanner metadata, task report, analysis, and gate must all equal the fixed repository project thebtf_netcoredbg_mcp. Every finding must be fixed on that same head; NOSONAR, suppression, WONTFIX, FALSE-POSITIVE, accepted risk, or stale/latest-project result never bypasses release. |
| Sonar readiness is fail-closed | The only local credential source is <coordination-root>/.env, resolved as the parent of git rev-parse --git-common-dir; it is gitignored, owner-only, and allows only SONAR_HOST_URL, SONAR_TOKEN, and SONAR_READ_TOKEN. Explicit values for those keys override the file. SONAR_ADMIN_TOKEN, other unsupported SONAR_ credential names, and any .env in the detached scanner worktree are rejected. Missing, blank, inaccessible, rejected, or unsafe-to-expose required credentials are SONAR_CREDENTIALS_UNAVAILABLE blocker evidence (record input names only, never values). A missing or unusable configured scanner is separately SONAR_SCANNER_UNAVAILABLE. Neither blocker permits an inferred scan, pass, merge, tag, or publish. |
Release process:
- When a bounded spec, PRD, ADR, or active run contract explicitly includes a planned release, its integration scope reaches
main, and no dependent slice in the same integration wave remains active, start release preparation automatically. If release intent is absent or explicitly out of scope, do not expand the run into a release. - Create a release-prep branch (for example,
work/release-v1.0.1-prep). - Update version, changelog, release notes, and other release-owned surfaces; build and install the release candidate; then run the primary UXDD consumer-mode release gate through the public CLI/MCP entry point. Every user journey claimed by the release must reach
PRODUCT_WORKS;PARTIALLY_WORKSandBROKENblock release regardless of unit-test status. - Run the remaining local pre-PR protocol gates in
docs/RELEASE-PROTOCOL.mdand record their evidence in the release report. - Commit, push, and create a release PR.
- Run independent MCP PR review plus required CI and test-protocol checks; resolve all blocking findings.
- After final review correction, run the pre-merge exact-head SonarQube gate on
CANDIDATE_SHA. Fix every finding in code, rerun affected review/checks, and rescan until every finding isFIXED_IN_CURRENT_HEAD. Merge only after primary UXDD, review, this candidate receipt, and required checks are clean. - Fast-forward local
mainto the mergedorigin/maintarget, then run a fresh post-merge SonarQube scan against that exact SHA. The tag target must equal the post-merge receipt SHA; a mismatch, scan finding, or unavailable Sonar input blocks tag creation until repaired and rescanned. - Create and push the annotated PATCH/MINOR tag only after the completed integration scope is on
main, no dependent slice in the same integration wave remains active, the post-merge receipt, and every other pre-publication gate pass; then run post-publication verification perdocs/RELEASE-PROTOCOL.md.
Recovery (immutable tags): A pushed release tag is immutable and collision-safe. If post-publication verification fails but the tagged commit and release artifacts are correct, repair or retry only the failed publication step for the same vX.Y.Z, then re-run post-publication verification. If code, metadata, or artifacts must change, create and merge a hotfix PR that bumps to a new patch version, rerun every mandatory pre-publication gate in docs/RELEASE-PROTOCOL.md, restart from step 9, and publish a new annotated tag on the corrected main commit. Never move, delete, or reuse an already-pushed release tag.
🧾 AGENT-GENERATED WORKTREE TRACES
The repository owner does not manually edit this checkout during agent work. Unexpected tracked-file dirtiness is therefore agent/tooling residue until proven otherwise.
Before source edits, commits, release work, or tests that may regenerate tracked files:
- Run
git status --short --branch. - For every dirty tracked path, capture
git diff -- <path>. - Classify each path:
- intended work — belongs to the current task.
- known generated churn — expected output from a named command/tool.
- unknown residue — not explained by the active task.
- blocker — may affect tests, release, branch switching, or verification.
- Record command, path, diff summary, and classification in
.agent/CONTINUITY.mdwhen the residue affects future agents.
Forbidden without explicit user decision:
git restore,git checkout --,git reset,git clean, stash, or branch deletion against unknown residue.- Committing generated residue just because the worktree is dirty.
- Building, testing, releasing, or opening a PR from a checkout whose dirty tracked files are unclassified.
- Building, testing, releasing, or opening a PR from a checkout with blocker-classified residue until that residue is resolved, explicitly approved by the user, or isolated away from the work in a clean sibling worktree.
Lockfile rule: uv.lock is a reproducibility artifact. Local uv commands
can update the editable package's own version entry without a human source edit.
Treat editable-package version churn as tooling residue unless the active task
intentionally changes dependency resolution or package version metadata. Do not
commit or discard it in an unrelated task without an explicit decision.
Clean implementation rule: If unknown residue exists on main, create a
clean sibling worktree (using git worktree) for implementation work and keep
the residue documented in the original checkout.
📍 KEY PATHS
| What | Where |
|---|---|
| Epic specs | .agent/epics/EPIC_XX_*.md |
| Status | .agent/CONTINUITY.md (live session state; .agent/status/ holds PR-review nitpick JSON only) |
| Reports | .agent/reports/ |
| Lessons | .agent/LESSONS_LEARNED.md |
| Skills | N/A (no local skills; see docs/dap-protocol/ for the only project-specific reference) |
| Testing | .agent/guides/TESTING_GUIDELINES.md |
| Architecture | .agent/arch/README.md |
🧪 TESTING
Before writing tests, read: .agent/guides/TESTING_GUIDELINES.md
| Rule | Description |
|---|---|
| Unit tests | Required for ALL new code |
| Bug fixes | Regression test FIRST (NON-NEGOTIABLE) |
| Smoke tests | Expand tests/smoke_test_manual.py when fixing bugs discovered in live usage |
| Bug → Smoke | Every bug found during real debugging sessions MUST get a smoke test case |
Smoke Test Protocol:
- Current: 87 checks (85 pass, 2 known failures: XPath on WinForms, file dialog)
- Run:
NETCOREDBG_PATH="D:/Bin/netcoredbg/netcoredbg.exe" python tests/smoke_test_manual.py - GUI tests require
dotnet build tests/fixtures/SmokeTestApp -c Debugfirst - When fixing a bug: add smoke test BEFORE the fix, verify it fails, then fix, verify it passes
Test Scratch Hygiene (NON-NEGOTIABLE — learned 2026-07-01):
- Isolated pytest runs that set
UV_PROJECT_ENVIRONMENT=.agent/tmp/uv-<name>create a full throwaway venv (hundreds of MB each). These are NOT auto-removed. Over a multi-CR marathon they silently accumulated 13.3 GB / ~498k files in.agent/tmpbefore the first cleanup. - Rule: after an isolated
UV_PROJECT_ENVIRONMENT=.agent/tmp/...run, remove that venv dir in the SAME task, OR reuse ONE stable env name across runs instead of a fresh per-CR dir. Do not leave per-CR venvs behind. .agent/tmp/is gitignored scratch: safe to wipe wholesale when idle. On Windows,robocopy <empty-dir> .agent\tmp /MIR /MT:16clears a large tree in seconds; PowerShellRemove-Item -Recurseon 100k+ small files times out.- Periodic check: if
.agent/tmpexceeds ~1 GB, wipe it during housekeeping.
Reproduction-First Debugging Protocol:
- Behavior bugs MUST be reproduced on a controlled test program, fixture, smoke scenario, or regression test before product-code edits.
- Preferred fixture surfaces:
tests/fixtures/SmokeTestApp,tests/fixtures/WpfSmokeApp,tests/fixtures/AvaloniaSmokeApp, andtests/smoke_test_manual.py. - If the existing fixtures cannot express the reported behavior, extend the fixture first. Do not patch product code around an unmodeled symptom.
- Prove RED on current code, fix the root cause, prove GREEN on the same check, then replay the original user-observable scenario or record an explicit blocker naming the missing capability.
/nvmd-platform:debug --quickis allowed only for exact file/line errors with a <=2-line non-control-flow fix and no plausible competing hypothesis. The smallest regression test still belongs with the fix.
Coverage Targets: (customize per project)
- Core Domain: 80%
- Critical Paths: 100%
🎯 SKILLS
Skills are provided by the global nvmd-platform plugin and user-scope rules.
This project keeps no local skills — DAP protocol details live as versioned
reference material in docs/dap-protocol/.
Note:
.agent/(includingCONTINUITY.md) is gitignored — paths under it below are local-only and bootstrapped per clone.
| Task | Source |
|---|---|
| Coding, refactoring, testing | Global nvmd-platform + user rules |
| PR / Integration / Review | Global nvmd-platform (/pr:review, /nvmd-platform:pr-reviewer) |
| Planning / Design | Global nvmd-platform (/nvmd-specify, /nvmd-plan, /nvmd-tasks) |
| Debugging | Global nvmd-platform |
| After context reset | .agent/CONTINUITY.md (local) + global recovery flow |
| DAP wire protocol (project-specific) | docs/dap-protocol/ (versioned mirror of the Microsoft DAP spec) |
🔧 TOOL PREFERENCES
| Operation | Preferred Tool |
|---|---|
| File read | MCP or IDE tools |
| File edit | MCP or IDE tools |
| Search | MCP or IDE tools |
| Build/Run | IDE debug configs |
| Code navigation | LSP / Serena |
📚 LESSONS LEARNED
File: .agent/LESSONS_LEARNED.md
When to WRITE: Bug pattern, debugging insight, architectural lesson, process improvement.
### YYYY-MM-DD: Short Title
**Problem:** What went wrong
**Root Cause:** Why it happened
**Lesson:** What to do/avoid next time
📓 Continuity Ledger
Maintain a single .agent/CONTINUITY.md (no per-role split).
Format:
# CONTINUITY — netcoredbg-mcp
## Goal (incl. success criteria)
## Constraints/Assumptions
## Key decisions
## State
### Done
### Now
### Next
## Open questions
## Working set
Rules:
- Read at session start, update when state changes
- Keep short: facts only, no transcripts
- Mark uncertainty as UNCONFIRMED
📛 NAMING CONVENTIONS
Branches: work/{type}-{desc} or work/epic{N}-{desc}
Commits: type(scope): description
- Examples:
feat(core): add feature,fix(parser): null check
Types: feat, fix, docs, refactor, test, chore
