Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Quick-sync session work to specs/*.md and project-tech.json
.claude/skills/catlog22-session-sync/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-16 | ✗→✓ | ▲ Improved | 94% | 0% |
| case-06 | ✓→✗ | ▼ Worse | 1% | 0% |
| case-14 | ✓→✓ | = Same ✓ | 127% | 0% |
| case-20 | ✓→✓ | = Same ✓ | 91% | 0% |
| case-21 | ✓→✓ | = Same ✓ | 44% | 0% |
One-shot update specs/*.md + project-tech.json from current session context.
Design: Scan context -> extract -> write. No interactive wizards.
bash$session-sync # Sync with preview + confirmation $session-sync -y # Auto-sync, skip confirmation $session-sync "Added JWT auth flow" # Sync with explicit summary $session-sync -y "Fixed N+1 query" # Auto-sync with summary
Step 1: Gather Context
|- git diff --stat HEAD~3..HEAD (recent changes)
|- Active session folder (.workflow/.lite-plan/*) if exists
+- User summary ($ARGUMENTS or auto-generate from git log)
Step 2: Extract Updates
|- Guidelines: conventions / constraints / learnings
+- Tech: development_index entry
Step 3: Preview & Confirm (skip if --yes)
Step 4: Write both files
Step 5: One-line confirmationjavascriptconst AUTO_YES = "$ARGUMENTS".includes('--yes') || "$ARGUMENTS".includes('-y') const userSummary = "$ARGUMENTS".replace(/--yes|-y/g, '').trim() // Recent changes const gitStat = Bash('git diff --stat HEAD~3..HEAD 2>/dev/null || git diff --stat HEAD 2>/dev/null') const gitLog = Bash('git log --oneline -5') // Active session (optional) const sessionFolders = Glob('.workflow/.lite-plan/*/plan.json') let sessionContext = null if (sessionFolders.length > 0) { const latest = sessionFolders[sessionFolders.length - 1] sessionContext = JSON.parse(Read(latest)) } // Build summary const summary = userSummary || sessionContext?.summary || gitLog.split('\n')[0].replace(/^[a-f0-9]+ /, '')
Analyze context and produce two update payloads. Use LLM reasoning (current agent) -- no CLI calls.
javascript// -- Guidelines extraction -- // Scan git diff + session for: // - New patterns adopted -> convention // - Restrictions discovered -> constraint // - Surprises / gotchas -> learning // // Output: array of { type, category, text } // RULE: Only extract genuinely reusable insights. Skip trivial/obvious items. // RULE: Deduplicate against existing guidelines before adding. // Load existing specs via ccw spec load const existingSpecs = Bash('ccw spec load --dimension specs 2>/dev/null || echo ""') const guidelineUpdates = [] // populated by agent analysis // -- Tech extraction -- // Build one development_index entry from session work function detectCategory(text) { text = text.toLowerCase() if (/\b(fix|bug|error|crash)\b/.test(text)) return 'bugfix' if (/\b(refactor|cleanup|reorganize)\b/.test(text)) return 'refactor' if (/\b(doc|readme|comment)\b/.test(text)) return 'docs' if (/\b(add|new|create|implement)\b/.test(text)) return 'feature' return 'enhancement' } function detectSubFeature(gitStat) { // Most-changed directory from git diff --stat const dirs = gitStat.match(/\S+\//g) || [] const counts = {} dirs.forEach(d => { const seg = d.split('/').filter(Boolean).slice(-2, -1)[0] || 'general' counts[seg] = (counts[seg] || 0) + 1 }) return Object.entries(counts).sort((a, b) => b[1] - a[1])[0]?.[0] || 'general' } const techEntry = { title: summary.slice(0, 60), sub_feature: detectSubFeature(gitStat), date: new Date().toISOString().split('T')[0], description: summary.slice(0, 100), status: 'completed', session_id: sessionContext ? sessionFolders[sessionFolders.length - 1].match(/lite-plan\/([^/]+)/)?.[1] : null }
javascript// Show preview console.log(` -- Sync Preview -- Guidelines (${guidelineUpdates.length} items): ${guidelineUpdates.map(g => ` [${g.type}/${g.category}] ${g.text}`).join('\n') || ' (none)'} Tech [${detectCategory(summary)}]: ${techEntry.title} Target files: .ccw/specs/*.md .workflow/project-tech.json `) if (!AUTO_YES) { const answer = functions.request_user_input({ questions: [{ header: "确认同步", id: "confirm_sync", question: "Apply these updates? (modify/skip items if needed)", options: [ { label: "Apply(Recommended)", description: "Apply all extracted updates to specs and project-tech.json" }, { label: "Cancel", description: "Abort sync, no changes made" } ] }] }) // BLOCKS (wait for user response) if (answer.answers.confirm_sync.answers[0] !== "Apply(Recommended)") { console.log('Sync cancelled.') return } }
javascript// -- Update specs/*.md -- // Uses .ccw/specs/ directory (same as frontend/backend spec-index-builder) if (guidelineUpdates.length > 0) { // Map guideline types to spec files const specFileMap = { convention: '.ccw/specs/coding-conventions.md', constraint: '.ccw/specs/architecture-constraints.md', learning: '.ccw/specs/coding-conventions.md' // learnings appended to conventions } for (const g of guidelineUpdates) { const targetFile = specFileMap[g.type] const existing = Read(targetFile) const ruleText = g.type === 'learning' ? `- [${g.category}] ${g.text} (learned: ${new Date().toISOString().split('T')[0]})` : `- [${g.category}] ${g.text}` // Deduplicate: skip if text already in file if (!existing.includes(g.text)) { const newContent = existing.trimEnd() + '\n' + ruleText + '\n' Write(targetFile, newContent) } } // Rebuild spec index after writing Bash('ccw spec rebuild') } // -- Update project-tech.json -- const techPath = '.workflow/project-tech.json' const tech = JSON.parse(Read(techPath)) if (!tech.development_index) { tech.development_index = { feature: [], enhancement: [], bugfix: [], refactor: [], docs: [] } } const category = detectCategory(summary) tech.development_index[category].push(techEntry) tech._metadata.last_updated = new Date().toISOString() Write(techPath, JSON.stringify(tech, null, 2))
Synced: ${guidelineUpdates.length} guidelines + 1 tech entry [${category}]| Error | Resolution | |-------|------------| | File missing | Create scaffold (same as $spec-setup Step 4) | | No git history | Use user summary or session context only | | No meaningful updates | Skip guidelines, still add tech entry | | Duplicate entry | Skip silently (dedup check in Step 4) |
$spec-setup - Initialize project with specs scaffold$spec-add - Interactive wizard to create individual specs with scope selection$workflow-plan - Start planning with initialized project context| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-10 | fail→fail | 3,680 | 6,617 | +80% | 1 | 1 | 0% | 529 | 2,137 | +304% | 0 | 0 | — |
case-04 | fail→fail | 17,390 | 6,939 | -60% | 1 | 1 | 0% | 3,423 | 2,453 | -28% | 0 | 0 | — |
case-01 | fail→fail | 8,198 | 7,070 | -14% | 1 | 1 | 0% | 1,292 | 2,103 | +63% | 0 | 0 | — |
case-02 | fail→fail | 7,187 | 8,891 | +24% | 1 | 1 | 0% | 1,112 | 2,343 | +111% | 0 | 0 | — |
case-03 | fail→fail | 7,182 | 5,539 | -23% | 1 | 1 | 0% | 1,156 | 2,228 | +93% | 0 | 0 | — |
case-05 | fail→fail | 4,411 | 5,582 | +27% | 1 | 1 | 0% | 648 | 2,241 | +246% | 0 | 0 | — |
case-06 | pass→fail | 12,252 | 6,008 | -51% | 1 | 1 | 0% | 2,149 | 2,168 | +1% | 0 | 0 | — |
case-07 | fail→fail | 8,195 | 6,583 | -20% | 1 | 1 | 0% | 1,019 | 2,267 | +122% | 0 | 0 | — |
case-08 | fail→fail | 2,689 | 6,983 | +160% | 1 | 1 | 0% | 358 | 2,384 | +566% | 0 | 0 | — |
case-09 | fail→fail | 3,871 | 8,413 | +117% | 1 | 1 | 0% | 305 | 2,320 | +661% | 0 | 0 | — |
case-11 | fail→fail | 5,082 | 6,093 | +20% | 1 | 1 | 0% | 804 | 2,141 | +166% | 0 | 0 | — |
case-12 | fail→fail | 2,269 | 7,016 | +209% | 1 | 1 | 0% | 302 | 2,203 | +629% | 0 | 0 | — |
case-13 | fail→fail | 3,902 | 8,273 | +112% | 1 | 1 | 0% | 631 | 2,433 | +286% | 0 | 0 | — |
case-14 | pass→pass | 7,325 | 4,301 | -41% | 1 | 1 | 0% | 1,156 | 2,619 | +127% | 0 | 0 | — |
case-15 | fail→fail | 11,546 | 5,772 | -50% | 1 | 1 | 0% | 1,994 | 2,223 | +11% | 0 | 0 | — |
case-16 | fail→pass | 10,175 | 11,615 | +14% | 1 | 1 | 0% | 1,692 | 3,279 | +94% | 0 | 0 | — |
case-17 | fail→fail | 6,681 | 6,496 | -3% | 1 | 1 | 0% | 812 | 2,135 | +163% | 0 | 0 | — |
case-18 | fail→fail | 12,644 | 7,707 | -39% | 1 | 1 | 0% | 2,229 | 2,172 | -3% | 0 | 0 | — |
case-19 | fail→fail | 2,546 | 6,427 | +152% | 1 | 1 | 0% | 370 | 2,140 | +478% | 0 | 0 | — |
case-20 | pass→pass | 8,753 | 9,266 | +6% | 1 | 1 | 0% | 1,369 | 2,618 | +91% | 0 | 0 | — |
case-21 | pass→pass | 10,706 | 2,553 | -76% | 1 | 1 | 0% | 1,616 | 2,330 | +44% | 0 | 0 | — |
case-22 | fail→fail | 7,753 | 6,677 | -14% | 1 | 1 | 0% | 1,459 | 2,228 | +53% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 4 counted toward the lift figure. The other 18 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of 0 percentage points is the difference between those two pass rates over the 4 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.