dev-log-rotate
Skill0 starsChanged 9 months agoMITView on GitHub
Checks development-log.md size and rotates to numbered archives (.1.md, .2.md) if too large. Use when log exceeds ~1000 lines or user says "rotate dev log". Maintains system log-style rotation pattern.
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adr-createSkill
- discovery-startSkill
- gather-insightSkill
- git-commitSkill
- init-projectSkill
- insight-captureSkill
- jira-startSkill
- review-implementationSkill
- session-endSkill
- session-listSkill
- session-startSkill
- team-stream-startSkill
- work-stream-startSkill
- worktree-endSkill
- worktree-listSkill
- worktree-removeSkill
- worktree-startSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 12 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Before starting new work and dev log feels unwieldy
- Very specific: line 24
Read .claude/project-config.md if it exists
- Distinctive: line 29
Use default path listed above
- Distinctive: line 48
Create new main with header template
- Distinctive: line 69
STOP (do not rotate)
- Very specific: line 77
Check which archive files exist (based on [dev-log-path] from config):
- Very specific: line 112
Read first 50 lines of archived log (.1) to extract header/template
- Very specific: line 119
Create new development log at [dev-log-path] with template:
- Distinctive: line 142
Read archived log's "Active Work" section
- Distinctive: line 172
Verify new log is small (should be ~50-100 lines - just template)
- Distinctive: line 174
Verify archived log exists:
- Distinctive: line 261
STOP immediately (do not create new log)
- Distinctive: line 266
Create log without Active Work section
- Distinctive: line 284
No data loss occurred
- Distinctive: line 296
Keep up to 3 archive levels (.1, .2, .3)
- Distinctive: line 302
No data loss (everything archived)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dev Log Rotate Skill
Automates rotation of the development log when it becomes too large for efficient context loading.
When to Use
Activate this skill when:
- User says "rotate dev log", "check dev log size", or "archive dev log"
- User mentions dev log is too big or difficult to load
- Before starting new work and dev log feels unwieldy
- Proactively when you notice dev log exceeds ~1000 lines
Instructions
Step 0: Read Project Config
- Read
.claude/project-config.mdif it exists - Parse
## Documentation Pathssection to get:- Development log path (default:
docs/development-log.md)
- Development log path (default:
If no config exists:
- Use default path listed above
- Continue with skill execution
Rotation Strategy
System log-style numbered rotation (paths based on config):
[dev-log-path] # Current (most recent entries)
[dev-log-path].1 # Previous rotation (e.g., docs/development-log.1.md)
[dev-log-path].2 # Older rotation
[dev-log-path].3 # Oldest rotationThreshold: Rotate when development log exceeds 1000 lines (keeps file manageable)
Rotation process:
- Rename
.2->.3(if.2exists) - Rename
.1->.2(if.1exists) - Rename main ->
.1 - Create new main with header template
Step 1: Check Current Size
- Count lines in development log:
wc -l [dev-log-path] - Parse line count from output
- Report current size:
Development log size: [N] lines Status: [NEEDS ROTATION / OK] Threshold: 1000 lines - If < 1000 lines:
- Report: "Development log is healthy ([N] lines). No rotation needed."
- STOP (do not rotate)
- If >= 1000 lines:
- Report: "Development log exceeds threshold ([N] lines). Rotation recommended."
- Proceed to rotation steps
Step 2: Check for Existing Archives
Check which archive files exist (based on [dev-log-path] from config):
ls [dev-log-path].* 2>/dev/null || echo "No archives"Parse results to determine:
- Does
.1.mdexist? - Does
.2.mdexist? - Does
.3.mdexist?
Step 3: Perform Rotation
IMPORTANT: Rotate in reverse order to avoid overwriting!
- If
.2exists, rename to.3:mv [dev-log-path].2 [dev-log-path].3- Report: "Rotated: .2 -> .3"
- If
.1exists, rename to.2:mv [dev-log-path].1 [dev-log-path].2- Report: "Rotated: .1 -> .2"
- Rename current log to
.1:mv [dev-log-path] [dev-log-path].1- Report: "Rotated: main -> .1"
Step 4: Create New Development Log
- Read first 50 lines of archived log (
.1) to extract header/template - Extract:
- Title line (usually
# Development Log) - Description/purpose section
- Structure template (Active Work, Chronological, etc.)
- Title line (usually
- Create new development log at
[dev-log-path]with template:# Development Log This is the current development log. Older entries are archived in numbered files: - [basename].1.md - Previous rotation - [basename].2.md - Older rotation (if exists) - [basename].3.md - Oldest rotation (if exists) --- ## Active Work [Copy from archived log's Active Work section - latest state] --- ## Development History [Empty - will populate with new entries] - Preserve Active Work section:
- Read archived log's "Active Work" section
- Copy current active items to new log
- Ensures continuity of ongoing work tracking
Step 5: Report Rotation Summary
Generate rotation summary:
Development log rotated successfully!
Rotation Summary:
- development-log.md: [OLD_LINES] lines -> archived to .1.md
- development-log.1.md -> development-log.2.md ([if existed])
- development-log.2.md -> development-log.3.md ([if existed])
New log created:
- development-log.md: Fresh template with Active Work preserved
- Archive chain: .1.md -> .2.md -> .3.md
Tip: Archived logs remain searchable and accessible for historical reference.Step 6: Verify Rotation
- Count lines in new log:
wc -l [dev-log-path] - Verify new log is small (should be ~50-100 lines - just template)
- Verify archived log exists:
ls -lh [dev-log-path].1 - Report verification:
Verification: - New log: [N] lines (healthy) - Archive .1.md: [SIZE] ([OLD_LINES] lines)
Examples
Example 1: Rotation Needed
User: "Check if we need to rotate the dev log"
Skill Actions:
- Runs
wc -l [dev-log-path]-> "2318 lines" - Reports: "Log exceeds threshold (2318 lines). Rotation recommended."
- Checks archives:
.1.mddoes not exist - Rotates:
.md->.1.md
- Reads archived log header (first 50 lines)
- Extracts "Active Work" section
- Creates new development log with template + Active Work
- Reports:
Rotation complete! - Archived: 2318 lines -> [dev-log-path].1 - New log: 87 lines (healthy)
Example 2: Rotation Not Needed
User: "rotate dev log"
Skill Actions:
- Runs
wc -l [dev-log-path]-> "432 lines" - Reports:
Development log is healthy (432 lines). No rotation needed (threshold: 1000 lines). - STOPS (does not rotate)
Example 3: Multiple Archives Exist
User: "rotate the log"
Skill Actions:
- Checks size: 1543 lines -> needs rotation
- Checks archives:
.1.mdexists (2100 lines).2.mdexists (1987 lines).3.mddoes not exist
- Rotates in reverse order:
.2.md->.3.md.1.md->.2.md.md->.1.md
- Creates new log with template
- Reports:
Rotation complete! Archive chain: - .1.md: 1543 lines (just archived) - .2.md: 2100 lines - .3.md: 1987 lines New log: 92 lines
Error Handling
If development log not found:
- Report: "Development log not found at [dev-log-path]"
- Suggest: "Check working directory or config path"
- STOP
If rotation fails (file operation error):
- Report exact error message
- STOP immediately (do not create new log)
- Suggest manual intervention
If Active Work section cannot be extracted:
- Warn: "Could not extract Active Work. Creating minimal template."
- Create log without Active Work section
- Continue with rotation
If new log creation fails:
- Report error
- STOP
- Suggest: "Original log still exists at .1.md. Manually create new log."
Quality Checks
Before completing, verify:
- Old log archived with correct number (.1.md)
- Archive chain rotated correctly (.1 -> .2 -> .3)
- New log exists and is small (~50-100 lines)
- Active Work section preserved (if present)
- Archive files readable and complete
- No data loss occurred
Notes
When to rotate:
- Proactively suggest rotation when log exceeds 1000 lines
- User can manually trigger anytime
- Rotation is safe and reversible (archives preserved)
Archive retention:
- Keep up to 3 archive levels (.1, .2, .3)
- Oldest archive (.3) is overwritten when new rotation pushes .2 -> .3
- Adjust retention policy if needed
Performance:
- Rotation takes seconds (file renames + template creation)
- No data loss (everything archived)
- New log loads quickly
Reverting rotation:
- To undo:
mv [dev-log-path].1 [dev-log-path] - Archives remain untouched (easy rollback)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

