You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-7Lines changed: 26 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,8 @@ The goal of MCAF:
25
25
MCAF has three core elements:
26
26
27
27
-**Context** — code, docs, `AGENTS.md`, and skills live with the repo.
28
-
-**Verification** — tests and analyzers are the decision makers, not opinions.
29
-
-**Instructions** — root and local `AGENTS.md` files define how agents work here.
28
+
-**Verification** — integration tests and quality gates are the decision makers, not opinions.
29
+
-**Instructions** — root and local `AGENTS.md` files define how agents work here and learn over time.
30
30
31
31
These concepts define the framework (the "what" and "why").
32
32
`TUTORIAL.md` is the bootstrap procedure (the "how").
@@ -113,15 +113,18 @@ The public skill catalog lives on the Skills page:
113
113
114
114
Platform-specific bundles can stay small and still be explicit.
115
115
`.NET` skills are maintained outside this repository in the [Managed Code Skills catalog](https://skills.managed-code.com/).
116
-
Install the `.NET` skills you need from that catalog, then document the exact `dotnet build`, `dotnet test`, `dotnet format`, `analyze`, and coverage commands in the consuming repo’s `AGENTS.md`.
117
-
For `.NET` code changes, the task is not done when tests are green if the repo also configured formatters, analyzers, coverage, architecture tests, or security gates.
116
+
Install the `.NET` skills you need from that catalog, then document the exact `dotnet build`, `dotnet test`, `dotnet format`, `analyze`, `complexity`, coverage, and other quality-gate commands in the consuming repo’s `AGENTS.md`.
117
+
For `.NET` code changes, the task is not done when tests are green if the repo also configured formatters, analyzers, complexity checks, coverage, architecture tests, or security gates.
118
118
Agents should run the repo-defined post-change quality pass before completion, and any external `.NET` helper should still include a `Bootstrap When Missing` section so agents can detect, install, verify, and first-run the tool without guessing.
119
119
120
120
### 2.5 Context Rules
121
121
122
122
- All durable engineering context lives in the repository.
123
123
- The project has a current `docs/Architecture.md`.
124
124
- Humans and agents start from the architecture map, not repo-wide scanning.
125
+
- Vertical-slice architecture is mandatory by default.
126
+
- Each feature lives in its own folder tree with the code, tests, contracts, docs, and other dependencies needed for that slice.
127
+
- Feature slices stay as isolated as possible so task context stays narrow and the right files are easy to find.
125
128
-`docs/Architecture.md` contains Mermaid diagrams for system/module boundaries, interfaces/contracts, and key types for the active area.
126
129
- Feature docs under `docs/Features/` contain at least one Mermaid diagram for the main flow.
127
130
- ADRs under `docs/ADR/` contain at least one Mermaid diagram for the decision and affected boundaries.
The goal is enough automated evidence to trust the change.
147
150
151
+
Integration tests are the backbone because they prove that a slice works through real boundaries, not just isolated units.
152
+
148
153
### 3.2 Verification Rules
149
154
150
155
- Prefer TDD for new behaviour and bug fixes: start with a failing test, make it pass, then refactor.
151
156
- New or changed behaviour is proven by new or updated automated tests.
152
157
- Tests prove user-visible or caller-visible flows, not just isolated implementation detail.
153
158
- Tests cover positive, negative, edge, and unexpected flows when the behaviour can fail in different ways.
154
159
- Integration/API/UI coverage is preferred when the behaviour crosses boundaries.
160
+
- Integration tests are the default primary proof for behaviour that spans more than one component inside a feature slice.
155
161
- Internal and external systems are exercised through real containers, test instances, or sandbox environments in primary suites.
156
162
- Mocks, fakes, stubs, and service doubles are forbidden in verification flows.
157
163
- Changed production code should reach at least 80% line coverage and 70% branch coverage where supported; critical flows and public contracts should reach 90% line coverage.
158
164
- Coverage must not regress below the pre-change baseline without an explicit exception, and coverage numbers do not replace scenario coverage.
159
165
- Static analysis is part of done, not a cleanup task.
160
166
- Failing tests or analyzers block completion.
167
+
- Run every repo-defined quality gate that is available for the stack and change scope: formatters, linters, analyzers, complexity checks, architecture tests, security scans, mutation checks, coverage, and any other configured verification tools.
161
168
- The task is not done until the full relevant test suite is green, not only the newly added or changed tests.
162
169
163
170
### 3.3 Verification Artifacts
@@ -210,13 +217,14 @@ Agents follow this order:
210
217
211
218
Root `AGENTS.md` stays current with:
212
219
213
-
- commands (`build`, `test`, `format`, `analyze`, `coverage` if used)
220
+
- commands (`build`, `test`, `format`, `analyze`, `complexity`, `coverage`, and other quality gates if used)
214
221
- global skills and when to use them
215
222
- self-learning rules
216
223
- non-trivial task workflow rules, including root-level `<slug>.brainstorm.md` and `<slug>.plan.md` usage
217
224
- testing discipline
218
225
- done criteria for tests, coverage, and quality gates
219
226
- design and maintainability rules
227
+
- vertical-slice architecture rules and allowed exceptions
220
228
- exception policy
221
229
- topology for local `AGENTS.md` files
222
230
@@ -254,13 +262,18 @@ Stable corrections, preferences, and recurring mistakes should become:
254
262
- skill updates
255
263
256
264
If the same mistake happens twice, the framework expects the rule to be made durable.
265
+
Self-learning is a cornerstone of the framework, not an optional habit.
257
266
258
267
### 4.6 Hard Rules for Instructions
259
268
260
269
- Every MCAF repo has a root `AGENTS.md`.
261
270
- Multi-project solutions use local `AGENTS.md` files at project roots.
262
271
- Agents read root and local `AGENTS.md` before editing code.
263
-
- Non-trivial tasks start with a root-level `<slug>.brainstorm.md`, then move into a root-level `<slug>.plan.md`.
272
+
- Vertical-slice architecture is mandatory unless an ADR or local exception rule says otherwise.
273
+
- Each feature must live in its own isolated folder tree with its local code, tests, and supporting artifacts kept together.
274
+
- Agents must prefer the smallest relevant feature slice over repo-wide scanning.
275
+
- Only non-trivial tasks start with a root-level `<slug>.brainstorm.md`, then move into a root-level `<slug>.plan.md`.
276
+
- Simple, short, or obvious tasks should skip the brainstorm and go straight to execution.
264
277
- Brainstorms capture thinking, options, trade-offs, and the chosen direction before implementation starts.
265
278
- Plans include ordered implementation steps, explicit test steps, testing methodology, and final validation commands.
266
279
- Skills are preferred over improvised workflow when a skill matches the task.
@@ -274,6 +287,8 @@ MCAF coding rules exist to keep systems changeable and testable.
274
287
275
288
- SOLID is mandatory.
276
289
- SRP and cohesion are mandatory.
290
+
- Vertical-slice architecture is mandatory at feature level.
291
+
- Organize code so each feature owns its folder, subfolders, tests, and nearby dependencies as an isolated slice.
277
292
- Prefer composition over inheritance unless inheritance is explicitly justified.
278
293
- Boundaries must support realistic tests through public interfaces.
279
294
- Hidden global state and side effects are design smells.
@@ -362,6 +377,7 @@ The brainstorm records:
362
377
- the recommended direction that will become the plan
363
378
364
379
Brainstorm first, think through the task, then convert the chosen direction into a working plan.
380
+
Do not create a brainstorm for simple, short, or obvious work where the path is already clear.
365
381
366
382
### 7.3 Plan
367
383
@@ -397,7 +413,8 @@ Run verification in layers:
397
413
2. related suite
398
414
3. broader required regressions and the full relevant suite
399
415
4. analyzers, formatters, and any configured architecture, security, mutation, or other quality gates
400
-
5. coverage comparison against the pre-change baseline
416
+
5. complexity checks and any other configured code-quality tools
417
+
6. coverage comparison against the pre-change baseline
401
418
402
419
### 7.6 Update Durable Context and Close the Task
403
420
@@ -444,5 +461,7 @@ Adoption is complete when:
444
461
- multi-project boundaries have local `AGENTS.md`
445
462
- commands and docs reflect the real repo
446
463
- non-trivial work is guided by root-level `<slug>.brainstorm.md`, `<slug>.plan.md`, and the Ralph Loop
464
+
- simple work skips brainstorm overhead and goes straight to execution
465
+
- vertical-slice architecture, integration tests, and self-learning are treated as core framework pillars
447
466
- tool-specific skills document real bootstrap and install steps when the tool is missing
Copy file name to clipboardExpand all lines: docs/templates/AGENTS.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ If the stack is `.NET`, document skill-management rules explicitly:
112
112
- Keep exactly one framework skill: `mcaf-dotnet-xunit` or `mcaf-dotnet-tunit` or `mcaf-dotnet-mstest`.
113
113
- Add tool-specific `.NET` skills only when the repository actually uses those tools in CI or local verification.
114
114
- Keep only `mcaf-*` skills in agent skill directories.
115
-
- When upgrading skills, recheck `build`, `test`, `format`, `analyze`, and `coverage` commands against the repo toolchain.
115
+
- When upgrading skills, recheck `build`, `test`, `format`, `analyze`, `complexity`, and `coverage` commands against the repo toolchain.
116
116
117
117
## Rules to Follow (Mandatory)
118
118
@@ -122,6 +122,7 @@ If the stack is `.NET`, document skill-management rules explicitly:
122
122
-`test`: `...`
123
123
-`format`: `...`
124
124
-`analyze`: `...` (delete if not used)
125
+
-`complexity`: `...` (delete if not used)
125
126
-`coverage`: `...` (delete if not used)
126
127
127
128
If the stack is `.NET`, also document:
@@ -160,6 +161,9 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
160
161
- Start from `docs/Architecture.md` and the nearest local `AGENTS.md`.
161
162
- Treat `docs/Architecture.md` as the architecture map for every non-trivial task.
162
163
- If the overview is missing, stale, or diagram-free, update it before implementation.
164
+
- Use vertical slices as the default architecture rule.
165
+
- Keep each feature in its own folder tree with its code, tests, contracts, docs, and supporting artifacts together.
166
+
- Prefer the smallest relevant feature slice over repo-wide scanning so context stays narrow.
163
167
- Define scope before coding:
164
168
- in scope
165
169
- out of scope
@@ -169,7 +173,9 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
169
173
- current state
170
174
- required change
171
175
- constraints and risks
176
+
- Before starting a brainstorm, decide whether the task is actually non-trivial.
172
177
- For non-trivial work, create a root-level `<slug>.brainstorm.md` file before making code or doc changes.
178
+
- For simple, short, or obvious work, skip the brainstorm and go directly to execution.
173
179
- Use `<slug>.brainstorm.md` to capture the problem framing, options, trade-offs, risks, open questions, and the recommended direction.
174
180
- Think through the task in the brainstorm before committing to implementation details.
175
181
- After the brainstorm direction is chosen, create a root-level `<slug>.plan.md` file.
@@ -208,6 +214,7 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
208
214
- broader required regressions
209
215
- If `build` is separate from `test`, run `build` before `test`.
210
216
- After tests pass, run `format`, then the final required verification commands.
217
+
- Run every repo-defined quality gate that is available for the stack and change scope, including analyzers, linters, complexity checks, coverage, architecture checks, security checks, and any other configured tools.
211
218
- The task is complete only when every planned checklist item is done and all relevant tests are green.
212
219
- Summarize the change, risks, and verification before marking the task complete.
213
220
@@ -242,6 +249,7 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
242
249
- Tests should be as realistic as possible and exercise the system through real flows, contracts, and dependencies.
243
250
- Tests must cover positive flows, negative flows, edge cases, and unexpected paths from multiple relevant angles when the behaviour can fail in different ways.
244
251
- Prefer integration/API/UI tests over isolated unit tests when behaviour crosses boundaries.
252
+
- Integration tests are the default primary proof for feature-slice behaviour that spans multiple components.
245
253
- Do not use mocks, fakes, stubs, or service doubles in verification.
246
254
- Exercise internal and external dependencies through real containers, test instances, or sandbox environments that match the real contract.
247
255
- Flaky tests are failures. Fix the cause.
@@ -251,14 +259,16 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
251
259
- Coverage is for finding gaps, not gaming a number. Coverage numbers do not replace scenario coverage or user-flow verification.
252
260
- The task is not done until the full relevant test suite is green, not only the newly added tests.
253
261
- If the stack is `.NET`, document the active framework and runner model explicitly so agents do not mix VSTest and Microsoft.Testing.Platform assumptions.
254
-
- If the stack is `.NET`, after changing production code run the repo-defined quality pass: format, build, analyze, focused tests, broader tests, coverage, and any configured extra gates such as architecture, security, or mutation checks.
262
+
- If the stack is `.NET`, after changing production code run the repo-defined quality pass: format, build, analyze, focused tests, broader tests, complexity, coverage, and any configured extra gates such as architecture, security, or mutation checks.
255
263
256
264
### Code and Design
257
265
258
266
- Everything in this solution MUST follow SOLID principles by default.
259
267
- Every class, object, module, and service MUST have a clear single responsibility and explicit boundaries.
260
268
- SOLID is mandatory.
261
269
- SRP and strong cohesion are mandatory for files, types, and functions.
270
+
- Vertical-slice architecture is mandatory unless a local rule or ADR documents an exception.
271
+
- Each feature MUST live in its own isolated folder tree with all slice-local dependencies kept together.
262
272
- Prefer composition over inheritance unless inheritance is explicitly justified.
263
273
- Large files, types, functions, and deep nesting are design smells. Split them or document a justified exception under `exception_policy`.
264
274
- Hardcoded values are forbidden.
@@ -274,6 +284,7 @@ Local `AGENTS.md` files may tighten these values, but they must not loosen them
274
284
- Never weaken a test or analyzer without explicit justification.
275
285
- Never introduce mocks, fakes, stubs, or service doubles to hide real behaviour in tests or local flows.
276
286
- Never introduce a non-SOLID design unless the exception is explicitly documented under `exception_policy`.
287
+
- Never spread one feature across unrelated folders when a vertical slice can keep it isolated.
277
288
- Never force-push to `main`.
278
289
- Never approve or merge on behalf of a human maintainer.
0 commit comments