session-tidy
Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- session-tidy
- description
- Audit, clean, and consolidate session logs in the Obsidian vault. Fixes format drift, resolves orphaned next-steps, updates stale statuses, and generates project rollup summaries. Use when session logs feel cluttered or before starting a new project milestone. Triggers on '/session-tidy', 'tidy sessions', 'clean up session logs', 'session audit'.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档.claude/CLAUDE.md14 B
- 参考文档AGENTS.md1 B
03 SKILL.md 正文
Session Tidy: Session Log Consolidation
Overview
Audit and consolidate session logs in the Obsidian vault (sessions/[Project]/) by enforcing the tidy audit rules, categorizing uncategorized files into project subfolders, resolving orphaned next-steps, updating stale statuses, and generating project rollup summaries.
Announce at start: "Running session log consolidation."
Context: Standalone maintenance utility. Run periodically, after completing a project milestone, or when starting fresh on a project. Companion to /dream (memory consolidation) and /session-log (session creation).
The Format Contract
Write-side HTML contract: /session-log owns how new session reports are written — vault path, HTML frontmatter comment block, Artifact publish, and body design. Read journal:session-log SKILL.md for that contract. The markdown field shapes below describe files tidy may read; they are not the write path for new session reports.
What tidy audits: Project folders under sessions/ may hold .html session reports and .md session files. Audit every session file present. The rules in this skill are the single home for tidy audit criteria.
Directory structure: sessions/[Project]/
- Session files match
[N]. [Title].htmlor[N]. [Title].md, where Title is a 2-5 word summary of the primary outcome (e.g.,3. Amazon Auth Migration.html) - Summary files are
Summary.htmlorSummary.mdin the same project folder - No parenthetical suffixes like
(Wrap-Up) - Files missing a title (e.g.,
Session 1.mdor1.html) should be flagged for renaming — read the content to derive a title
Shared metadata fields (required on every session file):
type, project, session, date, status, blocked, tags
HTML session reports — when tidy reads a .html session file, metadata sits in an HTML comment block at the start of the file content. The write-side comment shape lives in session-log SKILL.md. HTML reports also carry session_id and vault_context_retrieved.
Markdown session files — when tidy reads a .md session file, metadata sits in YAML frontmatter:
---
type: session-report
project: "[name]"
session: [N]
date: "[YYYY-MM-DD]"
status: "completed" | "in-progress" | "blocked"
blocked: true | false
tags: ["session", "[project-tag]"]
---
Content structure for markdown session files:
- Section headers (
###) use one emoji + outcome-oriented title - Valid emojis: ✅ (done), 🚫 (blocked), ⚠️ (note), 🔧 (in-progress), 📋 (queued)
- Explanatory paragraphs under each header, not just bullets
- Tables for 3+ rows of structured data
- No play-by-play or process narration
Content structure for HTML session reports: Body shape is session-specific (session-log designs per session). Tidy does not enforce a fixed HTML section template. Audit naming, metadata completeness, type, status coherence, orphaned next-steps text in the body, and categorization.
The Process
Phase 0: Preflight
Determine which storage backend is available. First success wins:
-
Headless vault — same check as Backend Detection in
journal:session-logSKILL.md: Bashob --version, thenOBSIDIAN_VAULT_PATHor~/.claude/vault/. When the CLI check succeeds and a vault directory resolves, setbackend = "headless". -
Obsidian MCP — call
mcp__obsidian__list_directorywithpath="sessions". If it succeeds, setbackend = "obsidian". -
Local vault — same fallback as session-log Backend Detection:
~/.claude/vault/. Create~/.claude/vault/sessionsviamkdir -pif missing. Setbackend = "local".
Capability notes by backend:
- obsidian: list, read, move, frontmatter update, and write via MCP tools (
list_directory,read_note,move_note,update_frontmatter,write_note). For.htmlfiles, metadata edits use Read + Edit of the HTML comment block when MCP frontmatter tools do not apply. - headless / local: Move/rename via
mv(Bash). Metadata update via Read + Edit/Write. Search via Bashls+ Grep.
Phase 1: Audit
List project subdirectories in sessions/ (MCP list_directory when backend is obsidian; Bash ls when headless or local). For each project folder, read its files. Also check for any files sitting directly in sessions/ (uncategorized). Audit both .html and .md session files. For each file, check:
- Naming convention? Must match
[N]. [Title].htmlor[N]. [Title].mdwhere N is the session number and Title is a 2-5 word outcome summary. Flag bracket prefixes, date-only names, parenthetical suffixes, or patterns missing a title such asSession 1.mdor1.html. - Frontmatter complete? All shared required fields present:
type,project,session,date,status,blocked,tags. For.htmlsession reports, also requiresession_idandvault_context_retrieved. - Type correct? Must be
session-report. Flag other types. - Status coherent?
status: completedwithblocked: trueis contradictory.status: in-progressorstatus: blockedon sessions older than 7 days is likely stale. - Orphaned next-steps? Scan content for sections containing "Next", "Queued", "Session N+1", "TODO", or clipboard emoji sections. Cross-reference against subsequent sessions for the same project to determine if the items were addressed.
- Categorized? Files sitting directly in
sessions/(not in a project subfolder) are uncategorized. Infer the project name from the filename pattern (e.g.,BudgetBridge Session 3.mdbelongs insessions/BudgetBridge/) or from the frontmatterprojectfield. Flag for a move into the correct subfolder.
Phase 2: Propose Changes
Present a structured report:
Format violations -- files with wrong naming, missing/wrong frontmatter fields, wrong type Stale statuses -- in-progress or blocked sessions older than 7 days, contradictory status+blocked combos Orphaned next-steps -- queued items from session N with no evidence of resolution in session N+1 or later. For each item, state whether it was:
- Resolved: found evidence in a later session
- Orphaned: no later session addresses it
- Unknown: later sessions exist but don't clearly address or skip the item
Uncategorized files -- files in
sessions/root that should live in a project subfolder Rollup candidates -- projects with 3+ sessions that have noSummary.htmlorSummary.mdProposed actions -- numbered list of specific changes
Do NOT execute any changes yet. Wait for user approval.
Phase 3: Execute
After user approves (all or selected items):
- Rename non-conforming files via
mcp__obsidian__move_note(obsidian) ormv(headless/local). Keep the file's extension (.htmlor.md). - Fix frontmatter:
.mdfiles:mcp__obsidian__update_frontmatterwhen backend is obsidian; Read + Edit/Write of YAML frontmatter when headless or local. Set correct type; add missing shared fields..htmlfiles: Read + Edit of the HTML comment block fields (shape in session-log SKILL.md). Set correct type; add missing shared fields plussession_idandvault_context_retrievedwhen absent.
- Update stale statuses -- change old in-progress/blocked to completed (or ask user for correct status).
- Clean orphaned next-steps -- for confirmed orphaned items, either:
- Remove the section if all items are orphaned and the session is old
- Add a strikethrough or "(not pursued)" annotation if some items remain relevant
- Leave unchanged if user declines
- Generate project rollups -- for each qualifying project, write a summary note via
mcp__obsidian__write_note(obsidian) or Write (headless/local):- Path:
sessions/[Project]/Summary.md - Frontmatter:
{"type": "project-summary", "project": "[name]", "sessions": [count], "date_range": "[first] to [last]", "tags": ["summary", "[project-tag]"]} - Content: Use this template:
- Path:
## [Project] -- Project Summary
### Timeline
| # | Title | Date | Status |
|---|-------|------|--------|
| 1 | [title from filename] | [date] | ✅/🔧/🚫 |
### Key Outcomes
- **Session [N]:** [one-line summary of primary outcome]
### Current Status
[One paragraph: where the project stands now, what's active, what's done]
### Carried Forward
- [ ] [unresolved item from latest session]
- Categorize uncategorized files -- move files from
sessions/root into the correct project subfolder viamcp__obsidian__move_noteormv. When moving, rename to match the[N]. [Title].htmlor[N]. [Title].mdconvention for that file's extension (e.g.,sessions/BudgetBridge Session 3.mdbecomessessions/BudgetBridge/3. [Title derived from content].md).
Phase 4: Verify
After execution, re-read the vault and confirm:
- Every session file lives in a project subfolder under
sessions/[Project]/ - Every file has valid frontmatter with all required fields for its shape
- Every filename matches the naming convention (
[N]. [Title].html,[N]. [Title].md,Summary.html, orSummary.md) - No contradictory status/blocked combos
- All orphaned next-steps resolved or annotated
- Rollup summaries exist for qualifying projects
Report the results: files renamed, frontmatter fixed, statuses updated, next-steps resolved, rollups generated.
If Phase 1 finds zero issues across all checks, skip Phases 2-4 and report: "All session logs are tidy. Nothing to do."
Output Format
Phase 2 report structure:
## Session Tidy Report
### Format Violations (X found)
- [file] -- [issue]
### Stale Statuses (X found)
- [file] -- [status] since [date] ([age] days ago)
### Uncategorized Files (X found)
- [file] -- move to sessions/[Project]/[new filename]
### Orphaned Next-Steps (X found)
- [file] -- "[item text]" -- [resolved/orphaned/unknown]
### Rollup Candidates (X projects)
- [project] -- [N] sessions, [date range], no summary exists
### Proposed Actions
1. [action] -- [file] -- [reason]
2. ...
Approve all, select by number, or cancel?
After Completion
Report summary: files renamed, frontmatter fixes, status updates, next-steps cleaned, rollups generated.
Best Practices
- Run after finishing a multi-session project
- Run before starting a new milestone on an existing project (clears stale context)
- Cross-reference next-steps manually when the skill flags "unknown" -- it cannot determine intent from content alone
- The 7-day staleness threshold is a heuristic -- adjust based on how frequently you session-log
- Rollup summaries are not a replacement for individual session logs -- they are a navigational aid
04 同仓库更多 Skills
update
Fast-forwards a local repository's main branch to a remote's main after confirming the repo path and source remote through AskUserQuestion. Use when the user says '/update', 'update main', 'fast-forward main', 'sync main from origin', 'pull latest main into <path>', or 'bring main up to date'.
source-command-sr-loop
Converging cleanup loop: repeat /simplify until clean, then repeat /code-review --fix until clean
skill-builder
Skill lifecycle: classify, scaffold, write via the skill-writer-agent, self-audit, compose sub-skills, polish description triggers, enforce deterministic scripts. Triggers: build a skill, new skill workflow, improve this skill, optimize skill description, skill development lifecycle, skill modularity, skill composition, description trigger catalog, deterministic skill scripts.
session-log
Logs a session report as an HTML page, tracks vault context, extracts decisions, and outputs a /rename command. Use for /session-log, 'journal this session', 'log this work', 'session report', 'summarize/log/record this session', 'save session', 'capture session', or 'document what we did'.
run-claude-dev-env
Build, install, run, and test the claude-dev-env installer. Use when asked to run claude-dev-env, install the Claude Code config into ~/.claude, drive the installer, smoke-test it against a sandbox, or run its test suite.
review-tier
Classify `review_tier_constants` from change axes, hard triggers, and user overrides. Triggers: /review-tier, tier override, and review classification.