Skip to content

Commit 3842617

Browse files
committed
skills
1 parent 45043b9 commit 3842617

File tree

24 files changed

+484
-33
lines changed

24 files changed

+484
-33
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 81 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,27 @@ jobs:
136136
data[key.strip()] = value.strip().strip("\"'")
137137
return data
138138
139+
def replace_marker_block(
140+
text: str,
141+
begin_marker: str,
142+
end_marker: str,
143+
replacement_lines: list[str],
144+
) -> str:
145+
begin_idx = text.find(begin_marker)
146+
if begin_idx == -1:
147+
raise SystemExit(f"Missing marker: {begin_marker}")
148+
149+
begin_line_end = text.find("\n", begin_idx)
150+
if begin_line_end == -1:
151+
raise SystemExit(f"Broken marker line: {begin_marker}")
152+
153+
end_idx = text.find(end_marker, begin_line_end + 1)
154+
if end_idx == -1:
155+
raise SystemExit(f"Missing marker: {end_marker}")
156+
157+
replacement = "\n".join(replacement_lines).rstrip()
158+
return text[: begin_line_end + 1] + replacement + "\n" + text[end_idx:]
159+
139160
skills: list[dict[str, str]] = []
140161
for skill_md in sorted((repo / "skills").glob("*/SKILL.md")):
141162
skill_dir = skill_md.parent
@@ -223,21 +244,67 @@ jobs:
223244
"\n".join(skills_page_lines) + "\n",
224245
encoding="utf-8",
225246
)
226-
PY
227247
228-
- name: Copy TUTORIAL to github-pages
229-
run: |
230-
cat > github-pages/tutorial.md << 'EOF'
231-
---
232-
layout: default
233-
title: Tutorial
234-
description: Step-by-step tutorial for bootstrapping an MCAF v1.2 repository through URLs, bootstrap templates, and direct GitHub skill folders.
235-
keywords: MCAF tutorial, AGENTS.md setup, skill-first install, AI coding bootstrap, Codex skills, Claude Code skills
236-
nav_order: 3
237-
---
238-
EOF
239-
sed -i 's/^ //' github-pages/tutorial.md
240-
cat TUTORIAL.md >> github-pages/tutorial.md
248+
dotnet_optional_exclude = {
249+
"mcaf-dotnet-features",
250+
"mcaf-dotnet-quality-ci",
251+
"mcaf-dotnet-complexity",
252+
"mcaf-dotnet-xunit",
253+
"mcaf-dotnet-tunit",
254+
"mcaf-dotnet-mstest",
255+
}
256+
dotnet_optional = sorted(
257+
skill["name"]
258+
for skill in skills
259+
if skill["name"].startswith("mcaf-dotnet-")
260+
and skill["name"] not in dotnet_optional_exclude
261+
)
262+
dotnet_optional_lines = (
263+
[f"- `{skill_name}`" for skill_name in dotnet_optional]
264+
if dotnet_optional
265+
else ["- _No optional .NET skills found._"]
266+
)
267+
268+
all_skills_lines = [
269+
(
270+
f"- `{skill['name']}` — "
271+
f"[Folder]({skill['folder_url']}), "
272+
f"[Raw SKILL]({skill['skill_md_url']})"
273+
)
274+
for skill in skills
275+
]
276+
277+
tutorial_body = (repo / "TUTORIAL.md").read_text(encoding="utf-8")
278+
tutorial_body = replace_marker_block(
279+
tutorial_body,
280+
"<!-- MCAF:DOTNET-OPTIONAL-SKILLS-BEGIN -->",
281+
"<!-- MCAF:DOTNET-OPTIONAL-SKILLS-END -->",
282+
dotnet_optional_lines,
283+
)
284+
tutorial_body = replace_marker_block(
285+
tutorial_body,
286+
"<!-- MCAF:ALL-SKILLS-BEGIN -->",
287+
"<!-- MCAF:ALL-SKILLS-END -->",
288+
all_skills_lines,
289+
)
290+
291+
tutorial_frontmatter = "\n".join(
292+
[
293+
"---",
294+
"layout: default",
295+
"title: Tutorial",
296+
"description: Step-by-step tutorial for bootstrapping an MCAF v1.2 repository through URLs, bootstrap templates, and direct GitHub skill folders.",
297+
"keywords: MCAF tutorial, AGENTS.md setup, skill-first install, AI coding bootstrap, Codex skills, Claude Code skills",
298+
"nav_order: 3",
299+
"---",
300+
"",
301+
]
302+
)
303+
(repo / "github-pages" / "tutorial.md").write_text(
304+
tutorial_frontmatter + tutorial_body.rstrip() + "\n",
305+
encoding="utf-8",
306+
)
307+
PY
241308
242309
- name: Copy CREDITS to github-pages
243310
run: |

TUTORIAL.md

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,32 @@ The install path is URL-first and simple:
1212

1313
---
1414

15+
## 0. First Prompt to Paste into an AI Agent
16+
17+
Use this prompt first when you want to install or update MCAF in an existing repo:
18+
19+
```text
20+
Install or update MCAF for this repository using these canonical pages:
21+
- https://mcaf.managed-code.com/tutorial
22+
- https://mcaf.managed-code.com/templates
23+
- https://mcaf.managed-code.com/skills
24+
25+
Rules:
26+
- remove all legacy skills with prefix mcf-
27+
- install only current skills with prefix mcaf-
28+
- keep AGENTS.md in the repository root
29+
- if this is a multi-project solution, create or update local AGENTS.md files per project
30+
```
31+
32+
---
33+
1534
## 1. Open the Canonical Pages
1635

1736
Use these pages as the install surface:
1837

19-
- Tutorial: [https://mcaf.managed-code.com/tutorial.html](https://mcaf.managed-code.com/tutorial.html)
20-
- Templates: [https://mcaf.managed-code.com/templates.html](https://mcaf.managed-code.com/templates.html)
21-
- Skills: [https://mcaf.managed-code.com/skills.html](https://mcaf.managed-code.com/skills.html)
38+
- Tutorial: [https://mcaf.managed-code.com/tutorial](https://mcaf.managed-code.com/tutorial)
39+
- Templates: [https://mcaf.managed-code.com/templates](https://mcaf.managed-code.com/templates)
40+
- Skills: [https://mcaf.managed-code.com/skills](https://mcaf.managed-code.com/skills)
2241

2342
Use these raw template files for direct download:
2443

@@ -66,7 +85,31 @@ Only create the directory for the agent runtime you actually use.
6685

6786
Get the available skills from:
6887

69-
- Skills page: [https://mcaf.managed-code.com/skills.html](https://mcaf.managed-code.com/skills.html)
88+
- Skills page: [https://mcaf.managed-code.com/skills](https://mcaf.managed-code.com/skills)
89+
90+
### 4.0 Remove Legacy `mcf-*` Skills First
91+
92+
Before installing current skills, delete old folders with prefix `mcf-` from your chosen target directory.
93+
94+
Codex:
95+
96+
```bash
97+
find .codex/skills -maxdepth 1 -mindepth 1 -type d -name 'mcf-*' -exec rm -rf {} +
98+
```
99+
100+
Claude Code:
101+
102+
```bash
103+
find .claude/skills -maxdepth 1 -mindepth 1 -type d -name 'mcf-*' -exec rm -rf {} +
104+
```
105+
106+
Optional verification:
107+
108+
```bash
109+
find .codex/skills .claude/skills -maxdepth 1 -mindepth 1 -type d -name 'mcf-*' 2>/dev/null
110+
```
111+
112+
The result should be empty.
70113

71114
For each selected skill:
72115

@@ -112,21 +155,17 @@ The intended flow is:
112155

113156
Add tool-specific .NET skills only when the repo standardizes on them:
114157

115-
- `mcaf-dotnet-format`
116-
- `mcaf-dotnet-code-analysis`
117-
- `mcaf-dotnet-analyzer-config`
118-
- `mcaf-dotnet-complexity`
119-
- `mcaf-dotnet-stylecop-analyzers`
120-
- `mcaf-dotnet-roslynator`
121-
- `mcaf-dotnet-meziantou-analyzer`
122-
- `mcaf-dotnet-coverlet`
123-
- `mcaf-dotnet-reportgenerator`
124-
- `mcaf-dotnet-stryker`
125-
- `mcaf-dotnet-netarchtest`
126-
- `mcaf-dotnet-archunitnet`
127-
- `mcaf-dotnet-codeql`
128-
- `mcaf-dotnet-semgrep`
129-
- `mcaf-dotnet-csharpier`
158+
<!-- MCAF:DOTNET-OPTIONAL-SKILLS-BEGIN -->
159+
- Generated during site build from current `mcaf-dotnet-*` folders in `skills/`.
160+
<!-- MCAF:DOTNET-OPTIONAL-SKILLS-END -->
161+
162+
### 4.2 Current Skill Catalog (Generated)
163+
164+
The website build generates this list from the actual folders under `skills/`.
165+
166+
<!-- MCAF:ALL-SKILLS-BEGIN -->
167+
- Generated during site build from `skills/*/SKILL.md`
168+
<!-- MCAF:ALL-SKILLS-END -->
130169

131170
---
132171

@@ -202,6 +241,7 @@ The bootstrap is complete when:
202241

203242
- root `AGENTS.md` exists
204243
- the right skill folders exist in the chosen skills directory
244+
- no legacy `mcf-*` skill folders remain in the chosen skills directory
205245
- local `AGENTS.md` files exist for project roots in a multi-project solution
206246
- docs and commands are customized to the real repo
207247

docs/templates/AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,14 @@ If the stack is `.NET`, this usually includes:
104104
- `mcaf-architecture-overview` if the repo keeps a maintained architecture map
105105
- `mcaf-ci-cd`
106106

107+
If the stack is `.NET`, document skill-management rules explicitly:
108+
109+
- `mcaf-dotnet` is the entry skill and routes to specialized `.NET` skills.
110+
- Keep exactly one framework skill: `mcaf-dotnet-xunit` or `mcaf-dotnet-tunit` or `mcaf-dotnet-mstest`.
111+
- Add tool-specific `.NET` skills only when the repository actually uses those tools in CI or local verification.
112+
- Legacy `mcf-*` skills are forbidden. Remove old `mcf-*` folders and keep only `mcaf-*` skills in agent skill directories.
113+
- When upgrading skills, recheck `build`, `test`, `format`, `analyze`, and `coverage` commands against the repo toolchain.
114+
107115
## Rules to Follow (Mandatory)
108116

109117
### Commands

skills/mcaf-dotnet-analyzer-config/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
4747
- IDE-only settings do not silently override repo policy
4848
- the default path is a root `.editorconfig`, not a surprise alternative
4949

50+
## Findings Loop
51+
52+
When this skill is used to run a checker, analyzer, test gate, or verification command:
53+
54+
1. Run the command in read-only or report mode first and collect findings.
55+
2. Return a concise findings list with only actionable items:
56+
- rule or check id
57+
- `file:line`
58+
- one-line fix intent
59+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
60+
4. Re-run the same command after each fix batch.
61+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
62+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
63+
64+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
65+
5066
## Load References
5167

5268
- read `references/analyzer-config.md` first

skills/mcaf-dotnet-archunitnet/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ compatibility: "Requires a .NET test project; supports dedicated integrations fo
3636
- architecture load cost is reasonable for the suite
3737
- rules are stable and tied to real boundaries
3838

39+
## Findings Loop
40+
41+
When this skill is used to run a checker, analyzer, test gate, or verification command:
42+
43+
1. Run the command in read-only or report mode first and collect findings.
44+
2. Return a concise findings list with only actionable items:
45+
- rule or check id
46+
- `file:line`
47+
- one-line fix intent
48+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
49+
4. Re-run the same command after each fix batch.
50+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
51+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
52+
53+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
54+
3955
## Load References
4056

4157
- read `references/archunitnet.md` first

skills/mcaf-dotnet-code-analysis/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
4545
- analyzer behavior is driven by repo config, not IDE defaults
4646
- CI can reproduce the same warnings and errors locally
4747

48+
## Findings Loop
49+
50+
When this skill is used to run a checker, analyzer, test gate, or verification command:
51+
52+
1. Run the command in read-only or report mode first and collect findings.
53+
2. Return a concise findings list with only actionable items:
54+
- rule or check id
55+
- `file:line`
56+
- one-line fix intent
57+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
58+
4. Re-run the same command after each fix batch.
59+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
60+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
61+
62+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
63+
4864
## Load References
4965

5066
- read `references/code-analysis.md` first

skills/mcaf-dotnet-codeql/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@ compatibility: "Requires a GitHub-based or CLI-based CodeQL workflow; respects t
3636
- the chosen CodeQL path is allowed for the repo type
3737
- build mode is documented and reproducible
3838

39+
## Findings Loop
40+
41+
When this skill is used to run a checker, analyzer, test gate, or verification command:
42+
43+
1. Run the command in read-only or report mode first and collect findings.
44+
2. Return a concise findings list with only actionable items:
45+
- rule or check id
46+
- `file:line`
47+
- one-line fix intent
48+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
49+
4. Re-run the same command after each fix batch.
50+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
51+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
52+
53+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
54+
3955
## Load References
4056

4157
- read `references/codeql.md` first

skills/mcaf-dotnet-complexity/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
4747
- thresholds are versioned in repo, not held in IDE memory
4848
- complexity findings map to real refactoring decisions
4949

50+
## Findings Loop
51+
52+
When this skill is used to run a checker, analyzer, test gate, or verification command:
53+
54+
1. Run the command in read-only or report mode first and collect findings.
55+
2. Return a concise findings list with only actionable items:
56+
- rule or check id
57+
- `file:line`
58+
- one-line fix intent
59+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
60+
4. Re-run the same command after each fix batch.
61+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
62+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
63+
64+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
65+
5066
## Load References
5167

5268
- read `references/complexity.md` first

skills/mcaf-dotnet-coverlet/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ compatibility: "Requires a .NET test project or solution; respects the repo's `A
4343
- coverage driver matches the runner model
4444
- coverage files are stable and consumable by downstream reporting
4545

46+
## Findings Loop
47+
48+
When this skill is used to run a checker, analyzer, test gate, or verification command:
49+
50+
1. Run the command in read-only or report mode first and collect findings.
51+
2. Return a concise findings list with only actionable items:
52+
- rule or check id
53+
- `file:line`
54+
- one-line fix intent
55+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
56+
4. Re-run the same command after each fix batch.
57+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
58+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
59+
60+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
61+
4662
## Load References
4763

4864
- read `references/coverlet.md` first

skills/mcaf-dotnet-csharpier/SKILL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ compatibility: "Requires a .NET SDK-based repository; respects the repo's `AGENT
3838
- formatter ownership is not ambiguous
3939
- the repo is comfortable with opinionated formatting decisions
4040

41+
## Findings Loop
42+
43+
When this skill is used to run a checker, analyzer, test gate, or verification command:
44+
45+
1. Run the command in read-only or report mode first and collect findings.
46+
2. Return a concise findings list with only actionable items:
47+
- rule or check id
48+
- `file:line`
49+
- one-line fix intent
50+
3. Fix findings in small batches without hiding rules unless the repo already documents an exception.
51+
4. Re-run the same command after each fix batch.
52+
5. Repeat until the gate passes or only explicitly accepted exceptions remain.
53+
6. Keep output trimmed: include counts and the top remaining items only, not raw full logs.
54+
55+
For setup-only requests that do not execute checks, return `status: configured` and the exact commands that should be run later.
56+
4157
## Load References
4258

4359
- read `references/csharpier.md` first

0 commit comments

Comments
 (0)