Skip to content

Commit 91f0bb0

Browse files
committed
add learn and rule skills, optimize all skills for token efficiency
New skills: - cmk:learn — extract and record knowledge from any input to docs/knowledge/ - cmk:rule — codify engineering standards into docs/rules/ with promote workflow Optimizations (30% fewer lines across all 8 skills): - Add intent examples for better triggering accuracy - Remove boilerplate (Content Guidance, redundant sections) - Merge Quality Checklist + Output Contract into compact Output section - Add NNNN numbering guidance to feature-spec and ADR - Add status lifecycle to feature-spec (was missing) - Make Security (system-design), Alternatives and Consequences (ADR) explicitly required - Add docs/knowledge/ to scaffold manifest and orientation - Add docs/knowledge/ as input source to prd, system-design, feature-spec
1 parent 7b4500a commit 91f0bb0

27 files changed

Lines changed: 1071 additions & 719 deletions

File tree

.agents/skills/adr/SKILL.md

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,61 @@
11
---
22
name: cmk:adr
3-
description: Create or update architecture decision records for system-level technical choices. Use whenever users need to record, revise, or replace ADR decisions with clear trade-offs.
3+
description: Create or update architecture decision records for system-level technical choices. Use whenever someone needs to record, revise, or document a technical decision with trade-offs — like choosing a database, communication protocol, or infrastructure pattern. Also triggers for "record this decision", "we decided to use X over Y", or "document why we chose this approach".
44
metadata:
55
sdl_phase: "1"
66
domain: "adr"
77
---
88

99
# ADR
1010

11-
Use this skill for:
12-
- Creating a new ADR from decision discussions
13-
- Updating an existing ADR when the decision evolves
11+
## Intents
1412

15-
## Canonical References
13+
```
14+
We decided to use event sourcing over CRUD for the audit trail — record that as an ADR
15+
```
16+
```
17+
Record an ADR: chose Redis over Memcached for session caching because of pub/sub support
18+
```
19+
```
20+
Update ADR-0003 — we revisited the decision and switched from REST to gRPC
21+
```
22+
```
23+
Document why we chose Kafka over RabbitMQ
24+
```
25+
```
26+
What architecture decisions have we recorded?
27+
```
1628

17-
- ADR conventions: `references/adr-conventions.md`
18-
- ADR template: `references/adr-template.md`
29+
## References
1930

20-
## Content Guidance
31+
Read `references/adr-conventions.md` for placement rules and `references/adr-template.md` for section structure.
2132

22-
Write what matters, skip what's obvious. The template is a starting point — adapt it to fit the context.
33+
## Scope
2334

24-
## Decision Scope Rule
25-
26-
Use ADRs only for system-level decisions that affect multiple features or core architecture.
27-
For feature-scoped decisions, keep them in the feature `spec.md` under Technical Decisions.
35+
ADRs are for system-level decisions that affect multiple features or core architecture. Feature-scoped decisions belong in the feature `spec.md` under Technical Decisions.
2836

2937
## Workflow: Create
3038

31-
Use when no ADR exists for the decision.
32-
3339
1. Gather decision context from conversation/docs/links.
34-
2. Validate that decision scope is system-wide.
35-
3. Apply canonical placement:
36-
- Use the repository's existing canonical ADR path when available.
37-
- Fallback path when no local convention exists: `docs/adrs/{NNNN}-{decision-title}.md`
38-
4. Fill template fields from `references/adr-template.md` (or local repository ADR template when present).
40+
2. Validate scope is system-wide (not feature-scoped).
41+
3. Place at the repository's existing ADR path, or fallback: `docs/adrs/{NNNN}-{decision-title}.md`. Determine `{NNNN}` by scanning existing ADRs and incrementing (start at `0001` if none exist).
42+
4. Fill template from `references/adr-template.md` (or local template if present).
3943
5. Set status to `proposed`.
4044

4145
## Workflow: Iterate
4246

43-
Use when a decision has changed and the existing ADR needs to reflect the current state.
44-
45-
1. Read the existing ADR in full before making changes.
47+
1. Read the existing ADR in full.
4648
2. **Upstream check:** If `docs/system-design.md` exists, check whether the revised decision conflicts with current architecture. Warn the user if so.
47-
3. Identify what changed and why — new constraints, better alternatives discovered, lessons from implementation.
48-
4. Update the ADR in place:
49-
- **Revise Chose and Rationale** — reflect the current decision and why it shifted
50-
- **Update Alternatives** — add newly considered options or remove irrelevant ones
51-
- **Update Consequences** — revise based on actual impact observed
52-
- **Note what changed** — add a brief note in rationale explaining what shifted from the prior decision
49+
3. Identify what changed and why.
50+
4. Update in place: revise decision/rationale, update alternatives and consequences, note what shifted.
5351
5. Update `Last updated` date.
54-
6. Transition status when appropriate:
55-
- `proposed``accepted` when the team agrees
56-
- `accepted` stays `accepted` when the decision evolves but remains active
52+
6. Transition status: `proposed``accepted` when team agrees. `accepted` stays `accepted` when decision evolves.
5753

58-
## Quality Checklist
54+
## Output
5955

56+
- Create: complete ADR file using canonical naming
57+
- Iterate: update in place with current decision and rationale
6058
- Decision statement is clear and implementable
61-
- Alternatives are explicit and meaningful
62-
- Trade-offs are concrete (cost, complexity, risk, performance)
59+
- Alternatives section is always present with concrete trade-offs
60+
- Consequences section is always present with short-term and long-term impact
6361
- If decision changed, rationale explains what shifted
64-
65-
## Output Contract
66-
67-
- If creating: produce a complete ADR file using canonical naming
68-
- If iterating: update the ADR in place with current decision and rationale
Lines changed: 34 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,58 @@
11
---
22
name: cmk:codebase-summary
3-
description: Create or iterate codebase summary documents. Use whenever users ask to document, update, or map the repository structure, key entry points, core modules, and local development setup.
3+
description: Create or iterate codebase summary documents that map repository structure, key entry points, core modules, and local dev setup. Use whenever someone wants to document how the repo is organized, update the codebase map after restructuring, or help new contributors navigate the codebase. Also triggers for "map the repo", "document the project structure", or "where does everything live".
44
metadata:
55
sdl_phase: "1"
66
domain: "codebase-summary"
77
---
88

99
# Codebase Summary
1010

11-
Use this skill for:
12-
- Creating a new codebase summary for a repository
13-
- Updating the summary when the codebase structure changes
11+
## Intents
1412

15-
## Canonical References
13+
```
14+
Document the repository structure and key entry points
15+
```
16+
```
17+
Update the codebase summary — we reorganized the src/ directory
18+
```
19+
```
20+
Map the codebase so new contributors can get oriented quickly
21+
```
22+
```
23+
Where does everything live in this project?
24+
```
1625

17-
- Codebase summary conventions: `references/codebase-summary-conventions.md`
18-
- Codebase summary template: `references/codebase-summary-template.md`
26+
## References
1927

20-
## Supported Input Sources
28+
Read `references/codebase-summary-conventions.md` for placement rules and `references/codebase-summary-template.md` for section structure.
2129

22-
Collect and synthesize from one or more of:
23-
- Direct codebase exploration (directory structure, entry points, module boundaries)
24-
- Existing documentation (README, system-design, package.json, Cargo.toml, etc.)
25-
- Current conversation context
26-
- Direct prompt from the engineer
30+
## Scope
2731

28-
## Content Guidance
32+
Codebase summary captures repository structure and navigation — how to find things. Architecture rationale belongs in system-design; feature behavior in specs.
2933

30-
Write what matters, skip what's obvious. The template is a starting point — adapt it to fit the context.
34+
## Input
3135

32-
## Scope Rule
33-
34-
Codebase summary captures repository structure and navigation — how to find things and understand what lives where. Keep architecture rationale in system-design and feature behavior in specs.
36+
Synthesize from: direct codebase exploration (directories, entry points, modules), existing docs (README, package.json, etc.), conversation context, or direct prompts.
3537

3638
## Workflow: Create
3739

38-
Use when no codebase summary exists.
39-
40-
1. Explore the repository structure to understand layout, entry points, and module boundaries.
41-
2. Map findings into template sections in `references/codebase-summary-template.md`.
42-
- If the target repository already has an existing convention, align to that local standard.
43-
3. Apply canonical placement:
44-
- Use the repository's existing path when available.
45-
- Fallback path when no local convention exists: `docs/codebase-summary.md`
46-
4. Include local development commands if discoverable from the codebase.
40+
1. Explore the repository to understand layout, entry points, and module boundaries.
41+
2. Map into template sections from `references/codebase-summary-template.md`. Align to local convention if one exists.
42+
3. Place at the repository's existing path, or fallback: `docs/codebase-summary.md`.
43+
4. Include local dev commands if discoverable.
4744

4845
## Workflow: Iterate
4946

50-
Use when the codebase has changed and the summary needs to reflect the current state.
51-
52-
1. Read the existing codebase summary in full before making changes.
53-
2. Explore the current codebase structure to identify what changed.
54-
3. Apply changes to the relevant sections:
55-
- **Update Repository Layout** — reflect new/moved/removed directories
56-
- **Update Key Entry Points** — add new entry points, remove stale ones
57-
- **Update Core Modules** — add new modules, revise responsibilities, remove deprecated ones
58-
- **Update Data and Integration Paths** — reflect new flows or changed integrations
59-
- **Update Local Development Commands** — reflect changed setup, test, or build commands
60-
4. Preserve content that is still valid — do not rewrite sections that haven't changed.
61-
5. Update `Last updated` date.
62-
63-
## Quality Checklist
64-
65-
- Repository layout matches the actual directory structure
66-
- Entry points are accurate and current
67-
- Core modules table covers the important parts without listing every file
68-
- Local development commands are runnable
69-
- No architecture rationale (that belongs in system-design)
47+
1. Read the existing summary in full.
48+
2. Explore current codebase to identify what changed.
49+
3. Update affected sections in place. Preserve unchanged content.
50+
4. Update `Last updated` date.
7051

71-
## Output Contract
52+
## Output
7253

73-
- If creating: produce a complete codebase summary at `docs/codebase-summary.md`
74-
- If iterating: apply targeted updates to affected sections while preserving valid existing content
75-
- Always update `Last updated` date when iterating
54+
- Create: complete codebase summary at `docs/codebase-summary.md`
55+
- Iterate: targeted updates to affected sections only
56+
- Layout matches actual directory structure
57+
- Entry points and dev commands are current and runnable
58+
- No architecture rationale (belongs in system-design)

.agents/skills/docs/SKILL.md

Lines changed: 33 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,55 @@
11
---
22
name: cmk:docs
3-
description: Bootstrap or update the /docs directory structure with AGENTS.md navigation files, README.md guides, and templates. Use when initializing a new repository, verifying an existing docs structure, or syncing docs scaffolding after devkit updates.
3+
description: Bootstrap or update the /docs directory structure with navigation files, guides, and templates. Use when someone wants to set up docs for a new repo, check if their docs structure is current, or sync scaffolding after devkit updates. Also triggers when users mention "docs structure", "initialize docs", or "docs scaffold".
44
metadata:
55
sdl_phase: "0"
66
domain: "docs"
77
---
88

9-
# Docs Init
9+
# Docs
1010

11-
Use this skill for:
12-
- Bootstrapping a new repository with the standard docs structure
13-
- Verifying and filling gaps in an existing docs structure
14-
- Updating navigation and template files after devkit changes
11+
## Intents
1512

16-
## Canonical References
13+
```
14+
Set up the docs structure for this project
15+
```
16+
```
17+
Check if our docs structure matches the latest devkit
18+
```
19+
```
20+
We added a new service — update the docs scaffold
21+
```
22+
```
23+
Are we missing any docs directories?
24+
```
1725

18-
- Directory structure and file manifest: `references/scaffold-manifest.md`
19-
- Template files: sourced from `docs/templates/` in the devkit
26+
## References
2027

21-
## Modes
22-
23-
### Init (default)
24-
25-
First-time scaffolding. Creates missing directories, navigation files, and templates.
26-
27-
- Never overwrites existing files
28-
- Reports divergences without modifying them
28+
Read `references/scaffold-manifest.md` for the complete file manifest and exact content for each file.
2929

30-
### Update
31-
32-
Re-sync an existing docs structure. Use when the devkit adds new templates, directories, or navigation patterns.
30+
## Modes
3331

34-
- Creates any newly added directories and files that don't exist yet
35-
- For AGENTS.md and README.md files: compares against scaffold manifest and reports divergences
36-
- For templates: adds new templates that don't exist; never overwrites customized templates
37-
- Updates `docs/README.md` directory listing and template links when new entries are added
38-
- Always confirms with the user before modifying any existing file
32+
**Init** (default) — First-time scaffolding. Create missing directories, navigation files, and templates. Never overwrite existing files. Report divergences.
3933

40-
### Verify
34+
**Update** — Re-sync after devkit changes. Create newly added files, compare AGENTS.md/README.md against manifest and report divergences, add new templates without overwriting customized ones. Confirm with user before modifying existing files.
4135

42-
Dry-run check. Reports gaps and divergences without creating or modifying anything.
36+
**Verify**Dry-run. Report gaps and divergences without creating or modifying anything.
4337

4438
## Workflow
4539

46-
1. Determine mode from user intent (init, update, or verify).
47-
2. Scan the target repository for existing `/docs` structure.
48-
3. Compare against the scaffold manifest in `references/scaffold-manifest.md`.
49-
4. Execute based on mode:
50-
- **Init:** create missing directories and files, skip existing
51-
- **Update:** create missing, report divergences, offer to update existing with confirmation
52-
- **Verify:** report only, no file changes
53-
5. Copy templates into `docs/templates/` when they do not already exist.
54-
6. Report what was created, skipped, diverged, and (in update mode) updated.
55-
56-
## Directory Creation Order
57-
58-
Create directories before their contents:
40+
1. Determine mode from user intent.
41+
2. Scan target repository for existing `/docs` structure.
42+
3. Compare against `references/scaffold-manifest.md`.
43+
4. Execute based on mode (init → create missing; update → create missing + offer fixes; verify → report only).
44+
5. Create directories before contents, in order: `docs/`, `templates/`, `adrs/`, `specs/`, `rules/`, `rules/common/`, `knowledge/`, `guides/`, `reference/`.
45+
6. For each directory, create `AGENTS.md` first, then `README.md`.
46+
7. Report: created, skipped, diverged, updated.
5947

60-
1. `docs/`
61-
2. `docs/templates/`
62-
3. `docs/adrs/`
63-
4. `docs/specs/`
64-
5. `docs/rules/`
65-
6. `docs/rules/common/`
66-
7. `docs/guides/`
67-
8. `docs/reference/`
68-
69-
## File Creation Order
70-
71-
For each directory, create files in this order:
72-
73-
1. `AGENTS.md` — agent navigation entry point
74-
2. `README.md` — human-readable structure and conventions
75-
76-
Then create top-level docs:
77-
78-
1. `docs/README.md` — directory structure and conventions overview
79-
2. Root `AGENTS.md` — project-level entry pointing to `/docs`
80-
81-
## Quality Checklist
48+
## Output
8249

8350
- Every directory has both `AGENTS.md` and `README.md`
84-
- Root `AGENTS.md` points to `docs/AGENTS.md`
85-
- `docs/AGENTS.md` points to `docs/README.md`
86-
- All subdirectory `AGENTS.md` files point to their local `README.md`
87-
- `docs/README.md` lists all directories and templates
51+
- Root `AGENTS.md``docs/AGENTS.md``docs/README.md` chain is intact
8852
- Templates directory contains all baseline templates
89-
90-
## Output Contract
91-
92-
- Report created files, skipped files (already existed), divergences, and updates applied
93-
- In init mode: never modify existing files
94-
- In update mode: confirm with user before modifying any existing file
95-
- In verify mode: no file changes, report only
53+
- Init mode never modifies existing files
54+
- Update mode confirms before modifying
55+
- Verify mode makes no file changes

0 commit comments

Comments
 (0)