Getting Started with MCAF v1.3
This tutorial is the canonical bootstrap flow for humans and agents.
It is intentionally separate from README.md:
README.mdexplains MCAF conceptsTUTORIAL.mdexplains installation and update steps
There is no shell installer in v1.3.
The install path is URL-first and simple:
- fetch bootstrap templates
- fetch the needed skill folders
- place them in the right target directories
- restart the agent
0. First Prompt to Paste into an AI Agent
Use this prompt first when you want to install or update MCAF in an existing repo:
Install or update MCAF for this repository using the canonical tutorial:
- https://mcaf.managed-code.com/tutorial
Follow the tutorial end-to-end, including template and skill installation steps it references.
Rules:
- install only current skills with prefix mcaf-
- keep AGENTS.md in the repository root
- if this is a multi-project solution, create or update local AGENTS.md files per project
- if this is a .NET repo, fetch the needed skills from https://skills.managed-code.com/
- treat every rule in every existing root or local AGENTS.md as mandatory repository policy
- update AGENTS.md files by merging; never replace, truncate, summarize, or omit existing rules or sections
- never weaken a rule, reduce its scope or priority, add a bypass, or change mandatory wording into optional guidance
- if incoming MCAF guidance conflicts with an existing rule, preserve the stricter rule and report the conflict instead of silently rewriting policy
- for non-trivial work, use the strongest suitable large or high-capability model available for analysis, architecture, acceptance criteria, planning, decomposition, integration, and final review
- before write-capable agents start, require a feature spec with stable REQ-* and AC-* IDs plus every required ADR with an implementation contract
- after the plan is explicit, spawn bounded coding tasks on the least expensive capable models with exact instructions, disjoint ownership, dependencies, verification commands, completion states, wait/join conditions, and escalation rules
- wait for all required agent results, inspect every diff and evidence packet, then run integrated verification before completion
- inspect the complete affected code, callers, contracts, tests, and docs up front; implement all approved behavior and wiring, self-review code and tests, fix findings, and format before one planned verification phase
- preserve required repository gates; rerun affected checks only for a new change, concrete failure, or unresolved question
- require explicit user approval for architecture, serializers/serialization contracts, and other material changes; do routine work within the approved design without asking again
1. Open the Canonical Entry Point
Use the tutorial as the single canonical install surface:
- Tutorial: https://mcaf.managed-code.com/tutorial
Direct links below are optional shortcuts when you need them:
- Templates: https://mcaf.managed-code.com/templates
- Skills: https://mcaf.managed-code.com/skills
Use these raw template files for direct download:
- Root
AGENTS.md: https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/AGENTS.md CLAUDE.md: https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/CLAUDE.md
2. Bootstrap the Repo Root
Always place AGENTS.md at the repository or solution root.
MCAF-GOV-001 is mandatory during both installation and updates. Before changing governance, read the complete root AGENTS.md and every project-local AGENTS.md. Existing rules remain mandatory and MUST NOT be deleted, omitted, summarized away, overwritten, or weakened.
Policy details: MCAF-GOV-001.
If you use Claude Code, also place CLAUDE.md at the repository root.
For a first bootstrap, download a template only when the target file does not already exist:
if [[ ! -e AGENTS.md ]]; then
curl -fsSL https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/AGENTS.md -o AGENTS.md
else
printf '%s\n' 'AGENTS.md already exists; preserve it and merge the current template requirements.'
fi
if [[ ! -e CLAUDE.md ]]; then
curl -fsSL https://raw.githubusercontent.com/managedcode/MCAF/main/docs/templates/CLAUDE.md -o CLAUDE.md
else
printf '%s\n' 'CLAUDE.md already exists; preserve it and merge only required additions.'
fi
For an update:
- Inventory and read the root and all local
AGENTS.mdfiles completely. - Fetch the current template to a separate temporary path, never to an existing
AGENTS.mdpath. - Merge missing current requirements into the customized files.
- Preserve every existing rule and keep the stricter wording when rules overlap.
- Review the complete diff for deleted sections, softened verbs, narrowed scope, new bypasses, or missing commands and boundaries.
- Stop and report a real conflict instead of resolving it by silently reducing a rule’s importance.
If you are not using Claude Code, CLAUDE.md is optional.
2.1 Structure the Solution for AI Coding
Vertical-slice architecture means that one business capability is the ownership boundary across the complete solution. For example, Orders is one logical slice spanning its backend, frontend, contracts, tests, infrastructure, and docs/Features/Orders.md.
The solution means the complete product delivery boundary in this repository, not only a .sln or .slnx file and not only the backend project.
An AI coding agent uses the slice as its unit of context: it reads the architecture entry, root and local governance, feature doc, and matching implementation and test paths. It should not have to reconstruct a feature by searching unrelated top-level Controllers, Services, Repositories, Components, and test buckets.
Use one canonical name and mirrored structure when toolchains require separate projects:
src/Backend/Features/<SliceName>/
src/Frontend/Features/<SliceName>/
src/Contracts/Features/<SliceName>/
tests/Features/<SliceName>/
docs/Features/<SliceName>.md
Alternatively, colocate executable artifacts under features/<SliceName>/ when the toolchain supports it. Durable feature docs still live under docs/Features/ with the same slice name.
During setup:
- Inventory every backend, frontend, contract, test, infrastructure, and documentation root in the repository.
- Choose one
<SliceName>naming and casing convention. - Record the exact paths and required internal shape in root
AGENTS.md. - Add the repository boundary and slice-to-surface map to
docs/Architecture.md. - Create or update local
AGENTS.mdfiles so each project names the slices and paths it owns. - Keep feature-owned code in its slice; use shared folders only for dependencies genuinely owned by multiple slices.
- For every change, update and verify all affected surfaces of the same slice together.
Canonical details: MCAF-ARCH-001.
2.2 Configure Mandatory Model-Tier Orchestration
MCAF-AI-001 is mandatory for non-trivial implementation work.
Configure root AGENTS.md so that:
- The strongest suitable large or high-capability model available owns discovery, architecture, acceptance criteria, test strategy, the ordered plan, and task decomposition.
- No coding worker starts before its scope, contracts, constraints, tests, and pass conditions are explicit.
- Independent, bounded coding scopes are spawned on the least expensive models that remain capable of the stack, tools, context, and risk level.
- Every worker receives exact file/module/slice ownership, expected artifacts, forbidden changes, verification commands, and an instruction to stop on ambiguity.
- The planning model reviews every worker diff, integrates the result, resolves conflicts, and owns final quality gates.
- A non-trivial task that cannot use cheaper coding workers records the concrete reason before the planning model implements it directly.
- Every delegated task records its
TASK-*,REQ-*, andAC-*IDs, role/model tier, exact read/write ownership, dependencies, start condition, expected evidence, and join condition. - Write-capable agents own disjoint files or slices; shared contracts, migrations, solution files, and central docs have one integration owner.
- The lead monitors native agent status, steers or replaces stuck work, and waits until every required task is explicitly
complete,blocked,failed, orcancelled. - Only verified
completeresults may unblock dependent tasks. The lead inspects joined output and proves the combined repository state.
Do not hard-code temporary product names unless the repository intentionally pins them. Prefer durable roles such as planning tier: highest-capability suitable model and coding tier: least expensive capable model.
Canonical details: MCAF-AI-001.
Inspect the actual runtime’s models, roles, permissions, and native delegation/status/wait controls. Use durable capability roles rather than model names or commands that may become stale:
| Role | Selection rule | Ownership |
|---|---|---|
| Lead / architect | Highest-capability suitable model | Requirements, decisions, task graph, integration, final quality |
| Explorer / researcher | Least expensive capable model; stronger reasoning for ambiguity | Read-only discovery and evidence |
| Coding worker | Least expensive model proven capable of the bounded stack/tool/risk scope | Disjoint writes, fixed contracts, complete implementation and tests |
| Independent reviewer | Suitable correctness/security reasoning capability | Read-only requirement, code, and test review |
For exact product configuration, consult the current official Codex subagents, Claude Code parallel agents, subagents, or agent teams documentation as applicable. Record unsupported capabilities instead of inventing an adapter. Escalate incapable workers without lowering requirements.
Use a spawn request shaped like this:
Keep the lead on the highest-capability suitable planning tier.
Read the approved feature requirements and ADR implementation contract.
Create one TASK-* per independent workstream and record dependencies.
Spawn read-only explorers for discovery and the least expensive capable coding workers for disjoint write scopes.
Give each worker its REQ-*/AC-* IDs, exact owned paths, preserved contracts, forbidden changes, required artifacts, test commands, pass conditions, and escalation rules.
Monitor native task status. Steer or replace blocked, failed, or drifting workers.
Wait for every required task; do not treat idle or partial output as complete.
After all join conditions are satisfied, inspect every diff and evidence packet, run integrated verification, and report the requirement-to-test results.
2.3 Require Feature Requirements and ADR Implementation Contracts
MCAF-REQ-001 is mandatory for every non-trivial feature.
Before implementation:
- Create or update
docs/Features/<SliceName>.mdfrommcaf-feature-spec. - Give every requirement a stable
REQ-*ID, type, priority, rationale, measurable pass/fail conditions, and one or moreAC-*acceptance criteria. - Record an ADR link or
ADR: N/Awith the concrete reason existing architecture and contracts are sufficient. - Create or update an ADR before changing boundaries, public contracts, data, dependencies, security, deployment topology, cross-cutting standards, or migration architecture.
- Require the ADR to define ordered implementation stages, exact ownership, dependencies, migration/rollout/rollback, agent roles, tests, pass conditions, and integration/join evidence.
- Keep one traceability matrix from
REQ-*toAC-*, ADR,TASK-*, automated test, and final evidence. - Do not mark a feature
Verifiedor ADRImplementeduntil the mapped implementation and verification are complete.
Canonical details: MCAF-REQ-001.
3. Choose the Agent Skill Directory
Use one of these target directories:
- Codex:
.codex/skills/ - Claude Code:
.claude/skills/
Create the directory if it does not exist:
mkdir -p .codex/skills
mkdir -p .claude/skills
Only create the directory for the agent runtime you actually use.
4. Fetch the Skill Folders
Get the available skills from:
- Skills page: https://mcaf.managed-code.com/skills
For each selected skill:
- Open the skill entry on the Skills page.
- Open the
Raw SKILLlink for that skill. - Fetch
SKILL.mdinto the target skill folder. - Follow the skill’s reference links and fetch only the files needed for the active task, preserving relative paths. If a link points into another skill folder, fetch that required reference at the matching path too.
Read the installed repository’s AGENTS.md for the shared task workflow and approval rules. Skill entrypoints add task-specific guidance; references are conditional, not a list to load in full. When updating a skill, keep its name and folder stable, replace its files with the current version, and review removed resources before deleting them. Governance updates still follow MCAF-GOV-001.
This keeps install deterministic without requiring manifests or archives.
4.0 For .NET Repositories
This repository no longer bundles .NET skills under skills/.
Fetch the required .NET skills from the Managed Code Skills catalog.
The mandatory repository and slice contract is MCAF-ARCH-001.
For .NET repositories, keep these repo-native artifacts explicit in AGENTS.md:
- a repo-root
.editorconfigas the analyzer and formatting source of truth - project-specific nested
.editorconfigfiles when a subtree has a clear different purpose or policy Directory.Build.propsor project files for bulk analyzer and runner settings- target
TFMand explicitLangVersiononly when the repo intentionally differs from the SDK default - whether the solution uses
VSTestorMicrosoft.Testing.Platform - the decision rule for
brainstorm: use<slug>.brainstorm.mdonly for non-trivial tasks, then<slug>.plan.md, then implementation and validation - mandatory
MCAF-ARCH-001rules: all solution-owned backend, frontend, contracts, tests, infrastructure, and docs stay in one repository - one canonical vertical-slice name and internal convention reused across every applicable technical root
- self-learning rules so repeated corrections become durable repo guidance
The intended .NET flow stays the same even though the bundle is external:
- install the required skills from the external catalog
- use the skills that fit the repo workflow and test framework
- after code changes, run the repo-defined quality pass: format, build, analyze, tests, complexity, coverage, and any configured extra gates
4.1 Current Skill Catalog (Generated)
The website build generates this list from the actual folders under skills/.
.NET skills are excluded here because they live in the external repository above.
mcaf-adr-writing— Folder, Raw SKILLmcaf-agile-delivery— Folder, Raw SKILLmcaf-architecture-overview— Folder, Raw SKILLmcaf-ci-cd— Folder, Raw SKILLmcaf-code-review— Folder, Raw SKILLmcaf-devex— Folder, Raw SKILLmcaf-documentation— Folder, Raw SKILLmcaf-feature-spec— Folder, Raw SKILLmcaf-human-review-planning— Folder, Raw SKILLmcaf-ml-ai-delivery— Folder, Raw SKILLmcaf-nfr— Folder, Raw SKILLmcaf-observability— Folder, Raw SKILLmcaf-security-baseline— Folder, Raw SKILLmcaf-solid-maintainability— Folder, Raw SKILLmcaf-solution-governance— Folder, Raw SKILLmcaf-source-control— Folder, Raw SKILLmcaf-testing— Folder, Raw SKILLmcaf-ui-ux— Folder, Raw SKILL
5. Multi-Project Solutions
For multi-project solutions:
- keep one root
AGENTS.mdat the solution root - add one local
AGENTS.mdat each project or module root
Do not create local files ad hoc.
Use the mcaf-solution-governance skill to define:
- project purpose
- entry points
- boundaries
- project-local commands
- applicable skills
- stricter local maintainability limits, if needed
Project-local AGENTS.md files refine root rules.
They do not silently weaken root policy.
6. Maintainability Limits Live in AGENTS.md
Numeric limits are repo policy, not framework constants.
Put them in root AGENTS.md under Maintainability Limits:
file_max_loctype_max_locfunction_max_locmax_nesting_depthexception_policy
Project-local AGENTS.md files may tighten these limits for a specific area.
Use the mcaf-solid-maintainability skill for:
- SOLID and SRP guidance
- split/refactor workflow
- documenting justified exceptions
7. Where the Authoring Scaffolds Live
v1.3 keeps public templates minimal.
Public templates:
AGENTS.mdCLAUDE.md
Authoring scaffolds are now loaded through skills:
- architecture overview scaffold:
mcaf-architecture-overview - feature spec scaffold:
mcaf-feature-spec - ADR scaffold:
mcaf-adr-writing - project-local
AGENTS.mdscaffold:mcaf-solution-governance
This keeps public pages small and lets agents fetch only the guidance they need.
8. Restart the Agent
After placing the skill folders in the target directory, restart the agent runtime so it reloads the installed skills.
The bootstrap is complete when:
- root
AGENTS.mdexists - the right skill folders exist in the chosen skills directory
- local
AGENTS.mdfiles exist for project roots in a multi-project solution - docs and commands are customized to the real repo
- root
AGENTS.mddefines the mandatoryMCAF-AI-001planning tier, coding tier, task graph, worker instruction packet, native status/wait, completion states, join, escalation, and lead review rules - root
AGENTS.mddefines mandatoryMCAF-REQ-001feature requirements, ADR triggers and implementation contracts, plus traceability through tasks, tests, and evidence - root
AGENTS.mdrequires complete implementation and code/test self-review before planned verification, and user approval for architecture, serialization, and other material decisions while allowing routine work autonomously
9. Suggested First Prompt After Install
Use a prompt like this:
Analyze this solution and customize the root AGENTS.md.
If this is a multi-project solution, create project-local AGENTS.md files in each project root.
Then identify which MCAF skills apply to each project and document them in the local AGENTS files.
For non-trivial tasks, require a root-level <slug>.brainstorm.md before <slug>.plan.md, but skip brainstorm for simple or obvious tasks.
Make MCAF-ARCH-001 mandatory: keep every solution-owned backend, frontend, contract, test, infrastructure, and documentation artifact in this repository.
Use one canonical vertical-slice name and one consistent feature-first convention across every applicable technical root; local AGENTS files and ADRs must not weaken this rule.
Require MCAF-AI-001 for non-trivial work: use the strongest suitable large or high-capability model available for planning, architecture, acceptance criteria, decomposition, integration, and final review; delegate bounded coding scopes to the least expensive capable models with exact instructions, disjoint ownership, dependencies, status/wait, completion evidence, and join gates.
Require MCAF-REQ-001: every non-trivial feature has stable REQ-* and AC-* before implementation; every architecture-affecting decision has an ADR with an ordered implementation contract; trace requirements through ADRs, TASK-*, tests, and final evidence.
Treat integration tests, self-learning, and full quality-gate execution as non-negotiable repo rules.
Inspect the complete affected flow before coding, implement every approved variant and integration, self-review code and tests, fix findings, and format before one planned verification phase. Keep TDD and the Ralph Loop purposeful; rerun checks only for a new change, concrete failure, or unresolved question.
Require explicit user approval before architecture, serializer/serialization, or other material contract, data, security, dependency, or deployment changes. Preserve prior authorization and do routine work within the agreed design without asking again.
Finally, update docs/Architecture.md so agents can scope work without repo-wide scanning.