Skip to content

Commit 219d12e

Browse files
committed
skils
1 parent 167607a commit 219d12e

16 files changed

Lines changed: 229 additions & 72 deletions

File tree

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ In MCAF, repository context includes:
4545
- application code
4646
- automated tests (unit, integration, API, UI/E2E)
4747
- documentation for features, architecture, testing, development, and operations
48-
- `skills/` packages (workflows + scripts + references) for repeatable agent tasks
48+
- Agent Skills packages (workflows + scripts + references) for repeatable agent tasks
49+
- Codex: `.codex/skills/`
50+
- Claude Code: `.claude/skills/`
4951
- the repository’s root `AGENTS.md`
5052

5153
Anything that matters for development, testing, or operations lives in the repository.
@@ -134,7 +136,8 @@ A skill is a folder that contains:
134136

135137
Recommended layout:
136138

137-
- `skills/<skill-name>/SKILL.md`
139+
- Codex: `.codex/skills/<skill-name>/SKILL.md`
140+
- Claude Code: `.claude/skills/<skill-name>/SKILL.md`
138141

139142
Integration principle:
140143

@@ -615,7 +618,9 @@ Used for:
615618
To adopt MCAF in a repository:
616619

617620
1. A `docs/` directory exists with at least `Architecture/`, `Features/`, `ADR/`, `Testing`, and `Development` (and a `docs/Architecture/Overview.md` entry point).
618-
2. A `skills/` directory exists with skills used by your agents (each skill has `SKILL.md`).
621+
2. A skills directory exists in your agent’s supported location (each skill has `SKILL.md`):
622+
- Codex: `.codex/skills/`
623+
- Claude Code: `.claude/skills/`
619624
3. This Guide and a root `AGENTS.md` live at the repository root and are kept current.
620625
4. Commands for `build`, `test`, `format`, and `analyze` are defined and documented.
621626
5. Containerized or scripted environments exist for integration/API/UI tests.
@@ -649,4 +654,4 @@ Every significant feature, document, and decision has an accountable owner:
649654

650655
- **Onboarding**: New team members read this Guide, the root `AGENTS.md`, and key docs before making changes.
651656
- **Regular review**: The team periodically reviews `AGENTS.md` and docs to ensure they reflect current practices.
652-
- **Feedback loops**: Issues with AI agent behaviour are tracked and lead to updates in `AGENTS.md`, skills (`skills/*/SKILL.md`), and docs — not repeated chat corrections.
657+
- **Feedback loops**: Issues with AI agent behaviour are tracked and lead to updates in `AGENTS.md`, skills (`*/SKILL.md` in your skills directory), and docs — not repeated chat corrections.

TUTORIAL.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Get MCAF running in your repository:
88

99
1. Bootstrap AGENTS.md with AI analysis
1010
2. Create documentation structure in `docs/` (including `docs/Architecture/Overview.md`)
11-
3. Add skills in `skills/`
11+
3. Add skills (agent-specific directory)
1212
4. Document existing features
1313
5. Create ADRs for existing decisions
1414
6. Write feature docs before coding (ongoing workflow)
@@ -90,7 +90,15 @@ Report what you created.
9090

9191
Skills are part of MCAF: keep them in-repo so agents and humans share the same workflows, scripts, and standards.
9292

93-
Install baseline templates + skills:
93+
Where to put skills depends on your agent:
94+
95+
- **Codex (OpenAI)**: `.codex/skills/`
96+
- **Claude Code (Anthropic)**: `.claude/skills/`
97+
- **Gemini Code Assist (Google)**: no documented Agent Skills folders (`SKILL.md`) like Codex/Claude; use `AGENTS.md` + docs, and control context with `.aiexclude`/`.gitignore` (Gemini CLI: `.geminiignore`)
98+
99+
Baseline skills in this MCAF repo live under `skills/` (templates). The installer copies them into your chosen skills directory.
100+
101+
Install baseline templates + skills (defaults to Codex: `.codex/skills/`):
94102

95103
```bash
96104
git clone https://github.com/managedcode/MCAF.git ../MCAF
@@ -99,13 +107,21 @@ git clone https://github.com/managedcode/MCAF.git ../MCAF
99107
bash ../MCAF/scripts/mcaf-install.sh
100108
```
101109

110+
Install skills for Claude Code instead:
111+
112+
```bash
113+
bash ../MCAF/scripts/mcaf-install.sh --skills-dir .claude/skills
114+
```
115+
102116
**Prompt:**
103117

104118
```
105119
Add skills structure to this project:
106120
107-
1. Create `skills/` at repo root.
108-
2. Add baseline MCAF skills (copy `skills/` from the MCAF repo and then adapt to your repo):
121+
1. Create the agent skills directory at repo root:
122+
- Codex: `.codex/skills/`
123+
- Claude Code: `.claude/skills/`
124+
2. Add baseline MCAF skills (copy from the MCAF repo and then adapt to your repo):
109125
- `mcaf-architecture-overview`
110126
- `mcaf-feature-spec`
111127
- `mcaf-adr-writing`
@@ -119,9 +135,9 @@ Add skills structure to this project:
119135
4. Generate an “available skills” block for your agent runtime:
120136
- include only metadata (name, description, location)
121137
- prefer a simple XML `<available_skills>` block (easy to copy/paste and parse)
122-
- generate from your repo (recommended): `python3 skills/mcaf-skill-curation/scripts/generate_available_skills.py skills --absolute`
138+
- generate from your repo (example for Codex): `python3 .codex/skills/mcaf-skill-curation/scripts/generate_available_skills.py .codex/skills --absolute`
123139
5. Validate skills and fix reported issues:
124-
- `python3 skills/mcaf-skill-curation/scripts/validate_skills.py skills`
140+
- (example for Codex) `python3 .codex/skills/mcaf-skill-curation/scripts/validate_skills.py .codex/skills`
125141
126142
Report what you created.
127143
```
@@ -137,20 +153,28 @@ If your project already uses MCAF and you want to see what changed upstream (wit
137153
bash ../MCAF/scripts/mcaf-upstream-snapshot.sh
138154
```
139155

156+
For Claude Code repos (skills in `.claude/skills/`):
157+
158+
```bash
159+
bash ../MCAF/scripts/mcaf-upstream-snapshot.sh --skills-dir .claude/skills
160+
```
161+
140162
Then review and merge what you want (example):
141163

142164
```bash
143165
diff -ruN docs/templates .mcaf/upstream/<timestamp>/docs/templates | less
144-
diff -ruN skills .mcaf/upstream/<timestamp>/skills | less
166+
diff -ruN .codex/skills .mcaf/upstream/<timestamp>/.codex/skills | less
145167
```
146168

147169
After merging, validate skills and regenerate the metadata block:
148170

149171
```bash
150-
python3 skills/mcaf-skill-curation/scripts/validate_skills.py skills
151-
python3 skills/mcaf-skill-curation/scripts/generate_available_skills.py skills --absolute
172+
python3 .codex/skills/mcaf-skill-curation/scripts/validate_skills.py .codex/skills
173+
python3 .codex/skills/mcaf-skill-curation/scripts/generate_available_skills.py .codex/skills --absolute
152174
```
153175

176+
If you use a different skills directory, replace `.codex/skills` with your chosen path (for example `.claude/skills`).
177+
154178
---
155179

156180
## Step 4: Document Existing Features

docs/templates/AGENTS.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ If no new rule is detected → do not update the file.
108108

109109
- All docs live in `docs/` (or `.wiki/`)
110110
- Global architecture entry point: `docs/Architecture/Overview.md` (read first)
111-
- When creating docs from `docs/templates/*`:
112-
- copy the template, then remove every `TEMPLATE ONLY` note
113-
- replace all placeholder text (`TODO:`, `...`, “FeatureName”, “ADR-XXXX”, etc.)
114-
- real docs must not contain template instructions or placeholder scaffolding
111+
- When creating docs from templates:
112+
- copy the template into its real docs location
113+
- replace all placeholders and remove all template notes (real docs must be clean: no `TEMPLATE ONLY`, `TODO:`, `...`)
115114
- Update feature docs when behaviour changes
116115
- Update ADRs when architecture changes
117116
- Diagrams are mandatory in docs:

scripts/mcaf-install.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ usage() {
66
Install MCAF baseline templates + skills into the CURRENT directory (target repo root).
77
88
Usage:
9-
mcaf-install.sh [--force] [--repo <git-url>] [--ref <ref>]
9+
mcaf-install.sh [--force] [--repo <git-url>] [--ref <ref>] [--skills-dir <path>]
1010
1111
Defaults:
1212
--repo https://github.com/managedcode/MCAF.git
1313
--ref main
14+
--skills-dir .codex/skills
1415
1516
Behaviour:
1617
- Without --force: do NOT overwrite existing files.
@@ -19,14 +20,15 @@ Behaviour:
1920
Output:
2021
- docs/templates/*
2122
- docs/Architecture/Overview.md (from template if missing)
22-
- skills/* (baseline skills)
23+
- <skills-dir>/* (baseline skills)
2324
- AGENTS.md (from template if missing)
2425
EOF
2526
}
2627

2728
FORCE=0
2829
MCAF_REPO="https://github.com/managedcode/MCAF.git"
2930
MCAF_REF="main"
31+
SKILLS_DIR=".codex/skills"
3032

3133
while [[ $# -gt 0 ]]; do
3234
case "$1" in
@@ -42,6 +44,10 @@ while [[ $# -gt 0 ]]; do
4244
MCAF_REF="${2:-}"
4345
shift 2
4446
;;
47+
--skills-dir)
48+
SKILLS_DIR="${2:-}"
49+
shift 2
50+
;;
4551
-h|--help)
4652
usage
4753
exit 0
@@ -70,20 +76,18 @@ mkdir -p \
7076
docs/Architecture \
7177
docs/ADR \
7278
docs/Features \
73-
docs/Testing \
74-
docs/Development \
75-
skills
79+
"$SKILLS_DIR"
7680

7781
if [[ $FORCE -eq 1 ]]; then
7882
echo "Copying templates (overwrite enabled) ..."
7983
cp -R "$tmp_dir/mcaf/docs/templates/." docs/templates/
8084
echo "Copying skills (overwrite enabled) ..."
81-
cp -R "$tmp_dir/mcaf/skills/." skills/
85+
cp -R "$tmp_dir/mcaf/skills/." "$SKILLS_DIR/"
8286
else
8387
echo "Copying templates (no overwrite) ..."
8488
cp -R -n "$tmp_dir/mcaf/docs/templates/." docs/templates/ || true
8589
echo "Copying skills (no overwrite) ..."
86-
cp -R -n "$tmp_dir/mcaf/skills/." skills/ || true
90+
cp -R -n "$tmp_dir/mcaf/skills/." "$SKILLS_DIR/" || true
8791
fi
8892

8993
if [[ ! -f AGENTS.md || $FORCE -eq 1 ]]; then
@@ -105,4 +109,5 @@ echo "Done."
105109
echo "Next:"
106110
echo " 1) Customize AGENTS.md with REAL commands and rules."
107111
echo " 2) Fill docs/Architecture/Overview.md (modules/boundaries + ADR links)."
108-
echo " 3) Run build/test/format commands from AGENTS.md to verify."
112+
echo " 3) Restart your agent so it reloads skills from: $SKILLS_DIR"
113+
echo " 4) Run build/test/format commands from AGENTS.md to verify."

scripts/mcaf-upstream-snapshot.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@ usage() {
66
Fetch the latest MCAF templates + skills into a snapshot folder (safe for updating existing repos).
77
88
Usage:
9-
mcaf-upstream-snapshot.sh [--repo <git-url>] [--ref <ref>] [--out <dir>]
9+
mcaf-upstream-snapshot.sh [--repo <git-url>] [--ref <ref>] [--out <dir>] [--skills-dir <path>]
1010
1111
Defaults:
1212
--repo https://github.com/managedcode/MCAF.git
1313
--ref main
1414
--out .mcaf/upstream/<timestamp>/
15+
--skills-dir .codex/skills
1516
1617
Notes:
1718
- Run this from the TARGET repo root.
18-
- This does NOT overwrite your current docs/templates or skills.
19+
- This does NOT overwrite your current docs/templates or skills dir.
1920
EOF
2021
}
2122

2223
MCAF_REPO="https://github.com/managedcode/MCAF.git"
2324
MCAF_REF="main"
2425
OUT_DIR=""
26+
SKILLS_DIR=".codex/skills"
2527

2628
while [[ $# -gt 0 ]]; do
2729
case "$1" in
@@ -37,6 +39,10 @@ while [[ $# -gt 0 ]]; do
3739
OUT_DIR="${2:-}"
3840
shift 2
3941
;;
42+
--skills-dir)
43+
SKILLS_DIR="${2:-}"
44+
shift 2
45+
;;
4046
-h|--help)
4147
usage
4248
exit 0
@@ -70,12 +76,13 @@ git -C "$tmp_dir/mcaf" rev-parse HEAD > "$OUT_DIR/mcaf.commit"
7076

7177
mkdir -p "$OUT_DIR/docs"
7278
cp -R "$tmp_dir/mcaf/docs/templates" "$OUT_DIR/docs/"
73-
cp -R "$tmp_dir/mcaf/skills" "$OUT_DIR/"
79+
mkdir -p "$OUT_DIR/$SKILLS_DIR"
80+
cp -R "$tmp_dir/mcaf/skills/." "$OUT_DIR/$SKILLS_DIR/"
7481

7582
echo ""
7683
echo "Upstream snapshot written to: $OUT_DIR"
7784
echo "Commit: $(cat "$OUT_DIR/mcaf.commit")"
7885
echo ""
7986
echo "Review diffs:"
8087
echo " diff -ruN docs/templates \"$OUT_DIR/docs/templates\" | less"
81-
echo " diff -ruN skills \"$OUT_DIR/skills\" | less"
88+
echo " diff -ruN \"$SKILLS_DIR\" \"$OUT_DIR/$SKILLS_DIR\" | less"

skills/mcaf-adr-writing/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: mcaf-adr-writing
3-
description: Create or update an ADR under `docs/ADR/` using `docs/templates/ADR-Template.md`, capturing context, decision, alternatives, consequences, rollout, and verification. Use when changing architecture, boundaries, dependencies, data model, or cross-cutting patterns; ensure the ADR is self-contained, has a Mermaid diagram, and defines testable invariants.
4-
compatibility: Requires repository write access; produces Markdown docs with Mermaid diagrams.
3+
description: "Create or update an ADR under `docs/ADR/` using `docs/templates/ADR-Template.md`, capturing context, decision, alternatives, consequences, rollout, and verification. Use when changing architecture, boundaries, dependencies, data model, or cross-cutting patterns; ensure the ADR is self-contained, has a Mermaid diagram, and defines testable invariants."
4+
compatibility: "Requires repository write access; produces Markdown docs with Mermaid diagrams."
55
---
66

77
# MCAF: ADR Writing
@@ -29,7 +29,7 @@ Before writing, make the ADR executable (no placeholders, no hand-waving):
2929
- what module(s) are affected
3030
- follow `AGENTS.md` scoping rules: Architecture map → linked ADR/Feature → entry points (do not scan everything)
3131
2. Start from `docs/templates/ADR-Template.md`.
32-
- Remove every `TEMPLATE ONLY` note and replace placeholder text before treating it as a real ADR.
32+
- keep the ADR’s `## Implementation plan (step-by-step)` updated while executing
3333
3. Write the ADR as a decision record:
3434
- **Context**: constraints + why this is needed now
3535
- **Decision**: a short, direct statement

skills/mcaf-architecture-overview/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: mcaf-architecture-overview
3-
description: Create or update `docs/Architecture/Overview.md` for a repository: map modules and boundaries, add a Mermaid module diagram, document dependency rules, and link to ADRs/features. Use when onboarding, refactoring, adding modules, or when the repo lacks a clear global architecture map.
4-
compatibility: Requires repository write access; produces Markdown docs with Mermaid diagrams.
3+
description: "Create or update `docs/Architecture/Overview.md` for a repository: map modules and boundaries, add a Mermaid module diagram, document dependency rules, and link to ADRs/features. Use when onboarding, refactoring, adding modules, or when the repo lacks a clear global architecture map."
4+
compatibility: "Requires repository write access; produces Markdown docs with Mermaid diagrams."
55
---
66

77
# MCAF: Architecture Overview
@@ -25,12 +25,12 @@ This doc is the **global map**: boundaries, modules, and dependency rules.
2525
## Workflow
2626

2727
1. Open `docs/Architecture/Overview.md` if it exists; otherwise start from `docs/templates/Architecture-Template.md`.
28-
- Remove every `TEMPLATE ONLY` note and replace placeholder text before treating it as a real doc.
28+
- Ensure it contains a short `## Scoping (read first)` section (this is how we prevent “scan everything” behaviour).
2929
2. Identify the **real** top-level boundaries:
3030
- entry points (HTTP/API, CLI, UI, jobs, events)
3131
- modules/layers (group by folders/namespaces, not individual files)
3232
- external dependencies (only those that actually exist)
33-
3. Fill the **TL;DR** so a new engineer can orient in ~1 minute.
33+
3. Fill the **Summary** so a new engineer can orient in ~1 minute.
3434
4. Draw the Mermaid diagram as a **module map**:
3535
- keep it small (roughly 8–15 nodes)
3636
- label arrows with meaning (calls, events, reads/writes)

skills/mcaf-feature-spec/SKILL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: mcaf-feature-spec
3-
description: Create or update a feature document under `docs/Features/` using `docs/templates/Feature-Template.md`, including business rules, user flows, system behaviour, Mermaid diagram, verification plan, and Definition of Done. Use before implementing a non-trivial feature or when behaviour changes; make the spec executable (test flows + traceability to tests).
4-
compatibility: Requires repository write access; produces Markdown docs with Mermaid diagrams and executable verification steps.
3+
description: "Create or update a feature document under `docs/Features/` using `docs/templates/Feature-Template.md`, including business rules, user flows, system behaviour, Mermaid diagram, verification plan, and Definition of Done. Use before implementing a non-trivial feature or when behaviour changes; make the spec executable (test flows + traceability to tests)."
4+
compatibility: "Requires repository write access; produces Markdown docs with Mermaid diagrams and executable verification steps."
55
---
66

77
# MCAF: Feature Spec
@@ -26,8 +26,8 @@ Write a spec that can be implemented and verified **without guessing**:
2626

2727
1. Start from `docs/Architecture/Overview.md` to pick the affected module(s).
2828
2. Create/update the feature doc using `docs/templates/Feature-Template.md`.
29-
- Remove every `TEMPLATE ONLY` note and replace placeholder text before treating it as a real spec.
3029
- follow `AGENTS.md` scoping rules (do not scan the whole repo; use the architecture map to stay focused)
30+
- keep the feature’s `## Implementation plan (step-by-step)` updated while executing
3131
3. Define behaviour precisely:
3232
- purpose and scope (in/out)
3333
- business rules (numbered, testable)

skills/mcaf-formatting/SKILL.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: mcaf-formatting
3-
description: Format code and keep style consistent using the repository’s canonical formatting/lint commands from AGENTS.md. Use after implementing changes or when formatting drift causes noisy diffs; keep formatting changes intentional and verified with build/tests.
4-
compatibility: Requires the repository’s formatter/linter tools; uses commands from AGENTS.md.
3+
description: "Format code and keep style consistent using the repository’s canonical formatting/lint commands from AGENTS.md. Use after implementing changes or when formatting drift causes noisy diffs; keep formatting changes intentional and verified with build/tests."
4+
compatibility: "Requires the repository’s formatter/linter tools; uses commands from AGENTS.md."
55
---
66

77
# MCAF: Formatting
@@ -18,10 +18,9 @@ compatibility: Requires the repository’s formatter/linter tools; uses commands
1818
3. Review the diff:
1919
- ensure changes are formatting-only
2020
- if the formatter touched many files, separate the change or confirm it was explicitly requested
21-
4. Verify after formatting (use `AGENTS.md` commands):
22-
- run `test` (at least new/related suites)
23-
- run `build` if required by `AGENTS.md`
24-
- run `analyze` if required by `AGENTS.md`
21+
4. Verify (follow `AGENTS.md` for sequencing + required commands):
22+
- for formatting-only changes: run the smallest meaningful verification the repo requires (build/tests/analyze as applicable)
23+
- for formatting as part of a behaviour change: follow the repo’s normal order (don’t reorder the pipeline)
2524
5. If `format`/linters are missing or flaky:
2625
- fix `AGENTS.md` to point to a real, repeatable command
2726
- only then rerun formatting

skills/mcaf-memory/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
name: mcaf-memory
3-
description: Maintain a persistent project memory file (`skills/mcaf-memory/references/memory.md`) with stable facts, constraints, preferences, and glossary so agents don’t re-learn the same context every chat. Use when the user says “remember”, gives repeating feedback, or when important project constraints are discovered.
4-
compatibility: Requires repository write access; stores memory in Markdown.
3+
description: "Maintain a persistent project memory file (`references/memory.md` in this skill folder) with stable facts, constraints, preferences, and glossary so agents don’t re-learn the same context every chat. Use when the user says “remember”, gives repeating feedback, or when important project constraints are discovered."
4+
compatibility: "Requires repository write access; stores memory in Markdown."
55
---
66

77
# MCAF: Memory
88

99
## Output
1010

11-
- `skills/mcaf-memory/references/memory.md` (create/update)
11+
- `references/memory.md` (create/update)
1212

1313
## When to use (triggers)
1414

@@ -19,7 +19,7 @@ compatibility: Requires repository write access; stores memory in Markdown.
1919

2020
## Workflow
2121

22-
1. Open `skills/mcaf-memory/references/memory.md`.
22+
1. Open `references/memory.md`.
2323
2. Keep the “7 Questions (profile)” up to date:
2424
- fill the answers as short bullets
2525
- these answers must reflect the real workflow (TDD, docs, release discipline)
@@ -37,7 +37,7 @@ compatibility: Requires repository write access; stores memory in Markdown.
3737
- **Rules/commands for agents**`AGENTS.md`
3838
- **Architecture decisions**`docs/ADR/*`
3939
- **Behaviour/flows**`docs/Features/*`
40-
- **Long-lived context & preferences**`skills/mcaf-memory/references/memory.md`
40+
- **Long-lived context & preferences**`references/memory.md`
4141
6. Never store secrets or personal data.
4242

4343
## Guardrails

0 commit comments

Comments
 (0)