|
| 1 | +# FeatureChecker Agent Guide |
| 2 | + |
| 3 | +Project: ManagedCode.FeatureChecker |
| 4 | +Stack: .NET 10 class library, TUnit tests, GitHub Actions, NuGet package publishing |
| 5 | + |
| 6 | +Follows [MCAF](https://mcaf.managed-code.com/). |
| 7 | + |
| 8 | +## Purpose |
| 9 | + |
| 10 | +This file defines how AI agents work in this solution. |
| 11 | + |
| 12 | +- Root `AGENTS.md` holds global workflow, shared commands, cross-cutting rules, and skill routing. |
| 13 | +- Local project rules live in `ManagedCode.FeatureChecker/AGENTS.md` and `ManagedCode.FeatureChecker.Tests/AGENTS.md`. |
| 14 | +- Local files refine or tighten root rules. They must not silently weaken this file. |
| 15 | + |
| 16 | +## Solution Topology |
| 17 | + |
| 18 | +- Solution root: `.` |
| 19 | +- Solution file: `ManagedCode.FeatureChecker.sln` |
| 20 | +- Production project: `ManagedCode.FeatureChecker/` |
| 21 | +- Test project: `ManagedCode.FeatureChecker.Tests/` |
| 22 | +- Architecture map: `docs/Architecture.md` |
| 23 | +- Agent skills: `.codex/skills/` |
| 24 | + |
| 25 | +## Rule Precedence |
| 26 | + |
| 27 | +1. Read this solution-root `AGENTS.md` first. |
| 28 | +2. Read the nearest local `AGENTS.md` for the files being edited. |
| 29 | +3. Apply the stricter rule when root and local files overlap. |
| 30 | +4. If a local rule appears weaker than root policy, stop and clarify or document an explicit exception. |
| 31 | +5. Document justified exceptions in the nearest local `AGENTS.md`, `docs/ADR/`, or `docs/Features/`. |
| 32 | + |
| 33 | +## Conversations |
| 34 | + |
| 35 | +Record durable user preferences and repeated corrections here instead of relying on chat history. Do not record one-off task scope. |
| 36 | + |
| 37 | +Update this file when the user gives a permanent requirement, repeated correction, workflow change, or strong preference. |
| 38 | + |
| 39 | +## Global Skills |
| 40 | + |
| 41 | +MCAF skills are installed from the canonical MCAF tutorial and use current `mcaf-*` folders only: |
| 42 | + |
| 43 | +- `mcaf-solution-governance` - root and project-local `AGENTS.md`, precedence, topology, and maintainability policy. |
| 44 | +- `mcaf-architecture-overview` - `docs/Architecture.md` and navigational system maps. |
| 45 | +- `mcaf-solid-maintainability` - SOLID, SRP, file/type/function limits, and exception handling policy. |
| 46 | +- `mcaf-testing` - automated testing rules and verification planning. |
| 47 | +- `mcaf-ci-cd` - GitHub Actions, NuGet publishing, release flow, and pipeline safety. |
| 48 | +- `mcaf-source-control` - branch, commit, review, and release hygiene. |
| 49 | +- `mcaf-documentation` - durable docs structure and source-of-truth placement. |
| 50 | +- `mcaf-feature-spec` - non-trivial feature behaviour specs under `docs/Features/`. |
| 51 | +- `mcaf-adr-writing` - architecture decisions under `docs/ADR/`. |
| 52 | +- `mcaf-code-review` - review readiness and PR hygiene. |
| 53 | +- `mcaf-security-baseline` - secrets, secure defaults, and security-impact checkpoints. |
| 54 | +- `mcaf-devex` - local setup, inner loop, onboarding, and reproducible commands. |
| 55 | + |
| 56 | +.NET skills are installed from [Managed Code Skills](https://skills.managed-code.com/) into `.codex/skills/`: |
| 57 | + |
| 58 | +- `dotnet`, `project-setup`, `modern-csharp`, `microsoft-extensions` |
| 59 | +- `format`, `analyzer-config`, `code-analysis`, `quality-ci` |
| 60 | +- `complexity`, `crap-score`, `roslynator`, `meziantou-analyzer`, `stylecop-analyzers`, `csharpier` |
| 61 | +- `run-tests`, `dotnet-test-frameworks`, `tunit`, `coverlet`, `coverage-analysis`, `reportgenerator`, `test-anti-patterns` |
| 62 | +- `nuget-trusted-publishing` |
| 63 | + |
| 64 | +Skill management rules: |
| 65 | + |
| 66 | +- Keep MCAF framework skills current and prefixed with `mcaf-`. |
| 67 | +- Fetch .NET-specific skills from `https://skills.managed-code.com/`. |
| 68 | +- Add new tool-specific skills only when the repo actually uses that tool in code, tests, CI, or release work. |
| 69 | +- After skill updates, recheck the build, test, format, analyze, coverage, and release commands below. |
| 70 | + |
| 71 | +## Commands |
| 72 | + |
| 73 | +- `restore`: `dotnet restore ManagedCode.FeatureChecker.sln` |
| 74 | +- `build`: `dotnet build ManagedCode.FeatureChecker.sln --configuration Release --no-restore` |
| 75 | +- `test`: `dotnet test --solution ManagedCode.FeatureChecker.sln --configuration Release --verbosity normal` |
| 76 | +- `format`: `dotnet format ManagedCode.FeatureChecker.sln --verify-no-changes` |
| 77 | +- `analyze`: `dotnet build ManagedCode.FeatureChecker.sln --configuration Release -p:RunAnalyzers=true` |
| 78 | +- `coverage`: `dotnet test --solution ManagedCode.FeatureChecker.sln --configuration Release -- --coverage --coverage-output-format cobertura` |
| 79 | + |
| 80 | +.NET specifics: |
| 81 | + |
| 82 | +- Target framework is `net10.0` from `Directory.Build.props`. |
| 83 | +- `LangVersion` is explicitly pinned to `14` in `Directory.Build.props`. |
| 84 | +- Test framework is TUnit. |
| 85 | +- Runner model is `Microsoft.Testing.Platform`, configured in `global.json`. |
| 86 | +- Coverage uses the `Microsoft.Testing.Platform` `--coverage` extension syntax. Do not use VSTest `--collect` syntax unless the runner model changes. |
| 87 | +- Repo-root `.editorconfig` is the source of truth for formatting, naming, style, and analyzer severity. |
| 88 | +- `Directory.Build.props`, `Directory.Packages.props`, and project files own package versions, analyzer switches, package metadata, and runner settings. |
| 89 | + |
| 90 | +## Project AGENTS Policy |
| 91 | + |
| 92 | +- This is a multi-project solution. Keep one root `AGENTS.md` and one local `AGENTS.md` in each project root. |
| 93 | +- Each local file must document purpose, entry points, boundaries, local commands, applicable skills, and local risks. |
| 94 | +- When adding a new project, add its local `AGENTS.md` in the same change. |
| 95 | + |
| 96 | +## Maintainability Limits |
| 97 | + |
| 98 | +- `file_max_loc`: `400` |
| 99 | +- `type_max_loc`: `200` |
| 100 | +- `function_max_loc`: `50` |
| 101 | +- `max_nesting_depth`: `3` |
| 102 | +- `exception_policy`: `Document any justified exception in the nearest ADR, feature doc, or local AGENTS.md with the reason, scope, verification, and removal or refactor plan.` |
| 103 | + |
| 104 | +Local `AGENTS.md` files may tighten these values. They must not loosen them without an explicit root-level exception. |
| 105 | + |
| 106 | +## Task Delivery |
| 107 | + |
| 108 | +- Start non-trivial work from `docs/Architecture.md` and the nearest local `AGENTS.md`. |
| 109 | +- Use vertical slices for behaviour changes: keep code, tests, contracts, docs, and supporting artifacts close to the feature boundary. |
| 110 | +- For non-trivial work, create `<slug>.brainstorm.md` before `<slug>.plan.md`; skip the brainstorm only for simple or obvious tasks. |
| 111 | +- Put test strategy inside the plan before implementation starts. |
| 112 | +- Run a baseline test pass after planning non-trivial work so pre-existing failures are visible. |
| 113 | +- Implement code and tests together. |
| 114 | +- Run verification in layers: build, focused tests, related tests, broader suite, format, analyzers, coverage, and any relevant release checks. |
| 115 | +- Update `docs/Architecture.md`, `docs/Features/`, or `docs/ADR/` when architecture, behaviour, or durable rules change. |
| 116 | + |
| 117 | +## Testing |
| 118 | + |
| 119 | +- TDD is the default for new behaviour and bug fixes. |
| 120 | +- Bug fixes start with a failing regression test when practical. |
| 121 | +- New public behaviour needs positive, negative, and edge-case coverage. |
| 122 | +- Prefer testing caller-visible behaviour through public contracts over implementation details. |
| 123 | +- Flaky tests are failures. Fix the cause. |
| 124 | +- Production code changes should preserve or improve coverage. Public contracts and critical flows require explicit success and failure assertions. |
| 125 | +- Do not skip tests to make a branch green. |
| 126 | + |
| 127 | +## Code and Design |
| 128 | + |
| 129 | +- SOLID, SRP, cohesion, and composition over inheritance are default design rules. |
| 130 | +- Keep public API changes intentional, documented, and covered by tests. |
| 131 | +- Avoid hardcoded values and magic literals in implementation code. Prefer named constants, enums, options, or value objects. |
| 132 | +- Remove obsolete code when replacing an implementation. Do not leave shims or fallback paths unless an explicit temporary exception documents the owner, scope, verification, and removal plan. |
| 133 | +- Do not add runtime dependencies to the core library without a documented reason. |
| 134 | + |
| 135 | +## Release and Source Control |
| 136 | + |
| 137 | +- Never force-push to `main`. |
| 138 | +- Do not commit secrets, keys, or connection strings. |
| 139 | +- Release and NuGet changes must be validated with `mcaf-ci-cd` and `nuget-trusted-publishing`. |
| 140 | +- Package metadata lives in `Directory.Build.props` and `ManagedCode.FeatureChecker/ManagedCode.FeatureChecker.csproj`. |
| 141 | +- GitHub Actions workflows live in `.github/workflows/`. |
| 142 | + |
| 143 | +## Preferences |
| 144 | + |
| 145 | +### Likes |
| 146 | + |
| 147 | +### Dislikes |
0 commit comments