Skip to content

Commit 6fdba86

Browse files
authored
chore - clean up stale yml references in documentation (#123)
* chore - clean up stale yml references in documentation - update CLAUDE.md to reference rules/*.md instead of context/*.yml - rewrite mantra/FORMAT.md for current rules-based architecture - update companion docs (context-format.md, format-guide.md, test.md, rule-design.md) - update skill files to reference rules/ and context/ directories - update rules files (context-format.md, behavior.md) * chore - bump plugin versions (mantra 0.4.2, memento 0.3.8, onus 0.3.3)
1 parent 8393201 commit 6fdba86

File tree

19 files changed

+208
-126
lines changed

19 files changed

+208
-126
lines changed

.claude-plugin/marketplace.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
"name": "memento",
99
"source": "./memento",
1010
"description": "Session persistence - persist context across conversation resets with branch-based session tracking",
11-
"version": "0.3.7"
11+
"version": "0.3.8"
1212
},
1313
{
1414
"name": "mantra",
1515
"source": "./mantra",
1616
"description": "Context refresh - periodic re-injection of behavioral guidance to prevent context drift",
17-
"version": "0.4.1"
17+
"version": "0.4.2"
1818
},
1919
{
2020
"name": "onus",
2121
"source": "./onus",
2222
"description": "Work-item automation - fetches issues, generates commits/PRs, syncs progress",
23-
"version": "0.3.2"
23+
"version": "0.3.3"
2424
}
2525
]
2626
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Session: chore/cleanup-stale-yml-references
2+
3+
## Details
4+
- **Type**: Chore
5+
- **Branch**: `chore/cleanup-stale-yml-references`
6+
- **Created**: 2026-01-14
7+
8+
## Goal
9+
Remove stale references to `.yml` context files throughout documentation. The project migrated from `context/*.yml` to `rules/*.md` but documentation still referenced the old pattern.
10+
11+
## Session Log
12+
- 2026-01-14: Identified stale yml references in CLAUDE.md, FORMAT.md, shared code, and companion docs
13+
- 2026-01-14: Updated CLAUDE.md - meta table, plugin structure, context system, ownership table
14+
- 2026-01-14: Rewrote mantra/FORMAT.md to reflect rules/*.md pattern
15+
- 2026-01-14: Updated context/context-format.md and context/format-guide.md
16+
- 2026-01-14: Updated context/test.md and context/rule-design.md
17+
- 2026-01-14: Updated all skill files (work-item-handler, session-manager, resume)
18+
- 2026-01-14: Updated rules/context-format.md and rules/behavior.md
19+
- 2026-01-14: Note: shared/index.js keeps findYmlFiles() for backwards compatibility
20+
21+
## Files Changed
22+
- CLAUDE.md
23+
- mantra/FORMAT.md
24+
- mantra/context/context-format.md
25+
- mantra/context/format-guide.md
26+
- mantra/context/test.md
27+
- mantra/context/rule-design.md
28+
- mantra/rules/context-format.md
29+
- mantra/rules/behavior.md
30+
- onus/skills/work-item-handler/SKILL.md
31+
- memento/skills/session-manager/SKILL.md
32+
- memento/skills/resume/SKILL.md
33+
34+
## Next Steps
35+
- [x] Update documentation files
36+
- [x] Update skill files
37+
- [x] Update rules files
38+
- [ ] Commit and merge

CLAUDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This repository is the source code for memento, mantra, and onus plugins—and t
88

99
| Concept | Source Code (what we develop) | Running Instance (what's active) |
1010
|---------|------------------------------|----------------------------------|
11-
| mantra context | `mantra/context/*.yml` | Injected via hooks on each prompt |
11+
| mantra rules | `mantra/rules/*.md` | Injected via hooks on each prompt |
1212
| memento sessions | `memento/templates/*.md` | `.claude/sessions/*.md` in each plugin dir |
1313
| onus work items | `onus/hooks/work-item.js` | Tracking issues for this repo |
1414

@@ -39,8 +39,8 @@ Each plugin follows the same structure:
3939
<plugin>/
4040
├── .claude-plugin/plugin.json # Plugin manifest
4141
├── hooks/ # Hook implementations (SessionStart, UserPromptSubmit)
42-
├── rules/ # Rule files (*.md with YAML frontmatter)
43-
├── context/ # Context files (*.yml) and companion docs
42+
├── rules/ # Rule files (*.md with YAML frontmatter, auto-injected)
43+
├── context/ # Companion docs (*.md, loaded on-demand)
4444
├── commands/ # Skill commands (*.md)
4545
├── lib/ # Bundled shared utilities
4646
└── package.json # Plugin dependencies
@@ -104,8 +104,8 @@ Run `npm run build` to re-bundle shared code after changes.
104104
### Context System
105105

106106
Two-tier context pattern:
107-
- `*.yml` - Compact rules, machine-optimized (~850 tokens vs ~7,750 for prose)
108-
- `*.md` - Detailed examples, loaded on-demand
107+
- `rules/*.md` - Compact rules in YAML frontmatter (auto-injected via hooks)
108+
- `context/*.md` - Detailed examples and companion docs (loaded on-demand)
109109

110110
Context loading order: base (plugin) → sibling plugins → project extensions → CLAUDE.md
111111

@@ -115,9 +115,9 @@ Each plugin owns specific context domains. When adding or modifying context, res
115115

116116
| Plugin | Domain | Files |
117117
|--------|--------|-------|
118-
| **mantra** | AI behavior, format conventions | `behavior.yml`, `format-guide.yml`, `context-format.yml` |
119-
| **memento** | Session management | `sessions.yml` |
120-
| **onus** | Git operations, work items | `git.yml`, `work-items.yml` |
118+
| **mantra** | AI behavior, format conventions | `rules/behavior.md`, `rules/context-format.md`, `rules/format-guide.md`, `rules/test.md`, `rules/rule-design.md` |
119+
| **memento** | Session management | `rules/sessions.md` |
120+
| **onus** | Git operations, work items | `rules/git.md`, `rules/work-items.md` |
121121

122122
**Ownership rules:**
123123
- Single source of truth: each concept defined in exactly one place

mantra/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mantra",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Behavioral rules for Claude Code sessions - auto-injected via hooks, zero config",
55
"author": {
66
"name": "David Puglielli"

mantra/FORMAT.md

Lines changed: 64 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@ This document defines the format for context files used by mantra.
66

77
**Base context** (shipped with plugin):
88
```
9-
<plugin-root>/context/
10-
├── behavior.yml # AI behavior rules
11-
├── behavior.md # Detailed behavior guide
12-
├── context-format.yml # Format specification
13-
├── context-format.md # Detailed format guide
14-
└── format-guide.yml # Compact YAML conventions
9+
<plugin-root>/
10+
├── rules/ # Rule files (auto-injected)
11+
│ ├── behavior.md # AI behavior rules (frontmatter + optional body)
12+
│ ├── test.md # Testing conventions
13+
│ └── ...
14+
└── context/ # Companion docs (on-demand)
15+
├── behavior.md # Detailed behavior guide
16+
├── test.md # Detailed test examples
17+
└── ...
1518
```
1619

1720
**Project extensions** (your project):
1821
```
19-
.claude/context/
20-
├── project.yml # Project-specific context
21-
├── testing.yml # Testing patterns
22-
└── *.yml # Additional context
22+
.claude/
23+
├── rules/ # Project rule overrides
24+
│ └── *.md # Custom rules with YAML frontmatter
25+
└── context/ # Project companion docs
26+
└── *.md # Detailed examples
2327
```
2428

2529
**Loading order**: base → sibling plugins → project extensions → CLAUDE.md
@@ -28,22 +32,47 @@ This document defines the format for context files used by mantra.
2832

2933
Each topic should have TWO files:
3034

31-
### 1. YAML File (`.yml`)
35+
### 1. Rule File (`rules/*.md`)
3236
**Purpose:** Quick context injection for Claude
37+
**Format:** YAML frontmatter (extracted and injected automatically)
3338
**Characteristics:**
3439
- Token-efficient (aim for 89% reduction vs prose)
35-
- Key-value assertions
40+
- Key-value assertions in frontmatter
3641
- Minimal prose
37-
- Target size: 10-30 lines
42+
- Target size: 10-30 lines of frontmatter
3843

39-
### 2. Markdown File (`.md`)
44+
### 2. Companion Doc (`context/*.md`)
4045
**Purpose:** Detailed reference for humans and Claude deep-dives
4146
**Characteristics:**
4247
- Full prose explanations
4348
- Code examples
4449
- Edge cases and troubleshooting
4550
- Not injected automatically (read on-demand)
4651

52+
## Rule File Format
53+
54+
Rule files use YAML frontmatter with an optional markdown body:
55+
56+
```markdown
57+
---
58+
companion: behavior.md
59+
type: actionable
60+
61+
## Assessment
62+
stance: skeptical-default
63+
assess-first: correctness, architecture, risks
64+
never: eager-agreement, sycophantic-tone
65+
66+
## Implementation
67+
mode: discuss-first (non-trivial) | build-first (trivial)
68+
order: syntax → runtime → logic → optimize
69+
---
70+
71+
Optional body content (usually omitted for rule files).
72+
```
73+
74+
The frontmatter between `---` markers is extracted and injected.
75+
4776
## YAML Format Conventions
4877

4978
### Operators
@@ -71,14 +100,15 @@ Each topic should have TWO files:
71100

72101
**Don't:**
73102
- Write complete sentences
74-
- Include explanations (put in `.md` file)
103+
- Include explanations (put in companion `.md` file)
75104
- Use markdown formatting in YAML
76105
- Repeat information
77106

78-
### Example
107+
### Example Frontmatter
79108

80109
```yaml
81-
# behavior.yml - Compact Reference
110+
# behavior.md - Compact Reference
111+
companion: context/behavior.md
82112

83113
## Assessment
84114
stance: skeptical-default
@@ -102,18 +132,17 @@ skip: simple-DTOs, getters, boilerplate
102132
103133
| File | Purpose |
104134
|------|---------|
105-
| `project.yml` | Project identity, architecture, tech stack |
106-
| `behavior.yml` | AI behavior rules, assessment stance |
107-
| `git.yml` | Git conventions, commit format, PR rules |
108-
| `testing.yml` | Testing patterns, what to test/skip |
109-
| `sessions.yml` | Session management workflow |
110-
| `<domain>.yml` | Domain-specific context |
135+
| `behavior.md` | AI behavior rules, assessment stance |
136+
| `git.md` | Git conventions, commit format, PR rules |
137+
| `test.md` | Testing patterns, what to test/skip |
138+
| `sessions.md` | Session management workflow |
139+
| `<domain>.md` | Domain-specific rules |
111140

112141
### Naming Rules
113142
- Use lowercase
114143
- Use hyphens for multi-word names
115144
- Be descriptive but concise
116-
- Pair with same-name `.md` file for details
145+
- Pair with same-name companion file in `context/` for details
117146

118147
## Token Efficiency
119148

@@ -132,13 +161,13 @@ Context files are injected into Claude's context window. Efficiency matters.
132161

133162
1. **Abbreviate consistently** - Use same short forms throughout
134163
2. **Omit obvious context** - Don't repeat what's in project files
135-
3. **Use references** - Point to `.md` files for details
164+
3. **Use references** - Point to companion `.md` files for details
136165
4. **Prioritize** - Put most important rules first
137166
5. **Prune regularly** - Remove obsolete content
138167

139168
## Interpretation Guide
140169

141-
When Claude reads compact YAML:
170+
When Claude reads compact YAML frontmatter:
142171

143172
| Pattern | Interpretation |
144173
|---------|----------------|
@@ -153,7 +182,7 @@ When Claude reads compact YAML:
153182

154183
mantra validates:
155184
- File exists and is readable
156-
- Valid YAML syntax
185+
- Valid YAML frontmatter syntax
157186
- File size within limits
158187

159188
mantra does NOT validate:
@@ -166,8 +195,8 @@ mantra does NOT validate:
166195
If migrating from a single `CLAUDE.md`:
167196

168197
1. **Identify topics** - Group related rules
169-
2. **Extract assertions** - Pull out key rules for YAML
170-
3. **Keep details** - Leave examples/explanations in `.md`
198+
2. **Create rule file** - Add YAML frontmatter to `rules/<topic>.md`
199+
3. **Keep details** - Leave examples/explanations in `context/<topic>.md`
171200
4. **Test refresh** - Verify context injects correctly
172201

173202
### Before (CLAUDE.md excerpt)
@@ -179,10 +208,14 @@ or Co-Authored-By tags. Commit messages should be lowercase after
179208
the issue number. Format: "#N - verb description"
180209
```
181210

182-
### After (git.yml)
183-
```yaml
211+
### After (rules/git.md)
212+
```markdown
213+
---
184214
# Git Workflow - Compact Reference
215+
companion: context/git.md
216+
185217
commit-format: "#N - verb desc" | "chore - desc"
186218
commit-style: HEREDOC, lowercase-after-dash
187219
no: attribution, co-authored-by, emojis
220+
---
188221
```

0 commit comments

Comments
 (0)