mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
Refactor workflow session archival and SKILL package updates
- Updated command invocation for SKILL memory generator to use session ID instead of incremental mode. - Enhanced documentation on the processing of archived sessions and intelligent aggregation by the agent. - Added templates for generating conflict patterns, lessons learned, SKILL index, and sessions timeline. - Established clear update strategies for incremental and full modes across all new templates. - Improved structure and formatting rules for better clarity and usability in generated documents.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -104,18 +104,18 @@ Complete workflow session archival. Session already moved to archive location.
|
||||
|
||||
#### Command Invocation
|
||||
|
||||
After Phase 2 completes successfully, invoke workflow SKILL memory generator in incremental mode:
|
||||
After Phase 2 completes successfully, invoke workflow SKILL memory generator with session ID:
|
||||
|
||||
```bash
|
||||
SlashCommand(command="/memory:workflow-skill-memory --incremental")
|
||||
SlashCommand(command="/memory:workflow-skill-memory session WFS-session-name")
|
||||
```
|
||||
|
||||
**What This Does**:
|
||||
- Reads updated manifest.json with new archived session
|
||||
- Incrementally updates SKILL package files
|
||||
- Fast execution (~5-10x faster than full regeneration)
|
||||
- Updates sessions-timeline.md, lessons-learned.md, conflict-patterns.md
|
||||
- Regenerates SKILL.md with latest session information
|
||||
- Processes single archived session incrementally
|
||||
- Agent analyzes session data and uses Gemini for intelligent aggregation
|
||||
- Updates SKILL package files: sessions-timeline.md, lessons-learned.md, conflict-patterns.md
|
||||
- Regenerates SKILL.md index with latest session
|
||||
- Fast execution through agent-driven incremental update
|
||||
|
||||
**Skip Condition**:
|
||||
- If user provides `--skip-skill` flag, skip this phase entirely
|
||||
@@ -151,9 +151,9 @@ SlashCommand(command="/memory:workflow-skill-memory --incremental")
|
||||
- Return success/error result
|
||||
|
||||
**Phase 3: SKILL Package Update** (1 slash command, optional)
|
||||
- Invoke `/memory:workflow-skill-memory --incremental`
|
||||
- Invoke `/memory:workflow-skill-memory session {session_id}`
|
||||
- Update workflow progress SKILL package with new session
|
||||
- Fast incremental update using existing aggregations
|
||||
- Agent-driven incremental update with intelligent aggregation
|
||||
- Can be skipped with `--skip-skill` flag
|
||||
|
||||
## Quick Commands
|
||||
@@ -169,7 +169,7 @@ bash(mv .workflow/WFS-session-name .workflow/.archives/WFS-session-name)
|
||||
Task(subagent_type="universal-executor", description="Complete session archival", prompt=`...`)
|
||||
|
||||
# Phase 3: Update SKILL package (optional)
|
||||
SlashCommand(command="/memory:workflow-skill-memory --incremental")
|
||||
SlashCommand(command="/memory:workflow-skill-memory session WFS-session-name")
|
||||
```
|
||||
|
||||
## Archive Query Commands
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
Template for generating conflict-patterns.md
|
||||
|
||||
## Purpose
|
||||
Document recurring conflict patterns across workflow sessions with resolutions.
|
||||
|
||||
## File Location
|
||||
`.claude/skills/workflow-progress/conflict-patterns.md`
|
||||
|
||||
## Update Strategy
|
||||
- **Incremental mode**: Add new conflicts, update frequency counters for existing patterns
|
||||
- **Full mode**: Regenerate entire conflict analysis from all sessions
|
||||
|
||||
## Structure
|
||||
|
||||
```markdown
|
||||
# Workflow Conflict Patterns
|
||||
|
||||
## Architecture Conflicts
|
||||
|
||||
### {Conflict_Pattern_Title}
|
||||
**Pattern**: {concise_pattern_description}
|
||||
**Sessions**: {session_id_1}, {session_id_2}
|
||||
**Resolution**: {resolution_strategy}
|
||||
|
||||
**Code Impact**:
|
||||
- Modified: {file_path_1}, {file_path_2}
|
||||
- Added: {file_path_3}
|
||||
- Tests: {test_file_path}
|
||||
|
||||
**Frequency**: {count} sessions
|
||||
**Severity**: {high|medium|low}
|
||||
|
||||
---
|
||||
|
||||
## Dependency Conflicts
|
||||
|
||||
### {Conflict_Pattern_Title}
|
||||
**Pattern**: {concise_pattern_description}
|
||||
**Sessions**: {session_id_list}
|
||||
**Resolution**: {resolution_strategy}
|
||||
|
||||
**Package Changes**:
|
||||
- Updated: {package_name}@{version}
|
||||
- Locked: {dependency_name}
|
||||
|
||||
**Frequency**: {count} sessions
|
||||
**Severity**: {high|medium|low}
|
||||
|
||||
---
|
||||
|
||||
## Testing Conflicts
|
||||
|
||||
### {Conflict_Pattern_Title}
|
||||
...
|
||||
|
||||
---
|
||||
|
||||
## Performance Conflicts
|
||||
|
||||
### {Conflict_Pattern_Title}
|
||||
...
|
||||
```
|
||||
|
||||
## Data Sources
|
||||
- IMPL_PLAN summaries: `.workflow/.archives/{session_id}/IMPL_PLAN.md`
|
||||
- Context packages: `.workflow/.archives/{session_id}/.process/context-package.json` (reference only)
|
||||
- Session lessons: `manifest.json` -> `archives[].lessons.challenges`
|
||||
|
||||
## Conflict Identification (Use Gemini CLI)
|
||||
|
||||
**Command Pattern**:
|
||||
```bash
|
||||
gemini -p "
|
||||
PURPOSE: Identify conflict patterns from workflow sessions
|
||||
TASK:
|
||||
• Extract conflicts from IMPL_PLAN and lessons
|
||||
• Group by type (architecture/dependencies/testing/performance)
|
||||
• Identify recurring patterns (same conflict in different sessions)
|
||||
• Link resolutions to specific sessions
|
||||
MODE: analysis
|
||||
CONTEXT: @.workflow/.archives/*/IMPL_PLAN.md @.workflow/.archives/manifest.json
|
||||
EXPECTED: Conflict patterns with frequency and resolution
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/workflow/skill-aggregation.txt)
|
||||
"
|
||||
```
|
||||
|
||||
**Pattern Grouping**:
|
||||
- **Architecture**: Design conflicts, incompatible strategies, interface mismatches
|
||||
- **Dependencies**: Version conflicts, library incompatibilities, package issues
|
||||
- **Testing**: Mock data inconsistencies, test environment issues, coverage gaps
|
||||
- **Performance**: Bottlenecks, optimization conflicts, resource issues
|
||||
|
||||
## Formatting Rules
|
||||
- Sort by frequency within each category
|
||||
- Include code impact for traceability
|
||||
- Mark high-frequency patterns (3+ sessions) as "RECURRING"
|
||||
- Keep resolution descriptions actionable
|
||||
- Use relative paths for file references
|
||||
125
.claude/workflows/cli-templates/prompts/workflow/skill-index.txt
Normal file
125
.claude/workflows/cli-templates/prompts/workflow/skill-index.txt
Normal file
@@ -0,0 +1,125 @@
|
||||
Template for generating SKILL.md (index file)
|
||||
|
||||
## Purpose
|
||||
Create main SKILL package index with progressive loading structure and session references.
|
||||
|
||||
## File Location
|
||||
`.claude/skills/workflow-progress/SKILL.md`
|
||||
|
||||
## Update Strategy
|
||||
- **Always regenerated**: This file is always updated with latest session count, domains, dates
|
||||
|
||||
## Structure
|
||||
|
||||
```yaml
|
||||
---
|
||||
name: workflow-progress
|
||||
description: Progressive workflow development history (located at {project_root}). Load this SKILL when continuing development, analyzing past implementations, or learning from workflow history, especially when no relevant context exists in memory.
|
||||
version: {semantic_version}
|
||||
---
|
||||
# Workflow Progress SKILL Package
|
||||
|
||||
## Documentation: `../../../.workflow/.archives/`
|
||||
|
||||
**Total Sessions**: {session_count}
|
||||
**Functional Domains**: {domain_list}
|
||||
**Date Range**: {earliest_date} - {latest_date}
|
||||
|
||||
## Progressive Loading
|
||||
|
||||
### Level 0: Quick Overview (~2K tokens)
|
||||
- [Sessions Timeline](sessions-timeline.md#recent-sessions-last-5) - Recent 5 sessions
|
||||
- [Top Conflict Patterns](conflict-patterns.md#top-patterns) - Top 3 recurring conflicts
|
||||
- Quick reference for last completed work
|
||||
|
||||
**Use Case**: Quick context refresh before starting new task
|
||||
|
||||
### Level 1: Core History (~8K tokens)
|
||||
- [Sessions Timeline](sessions-timeline.md) - Recent 10 sessions with details
|
||||
- [Lessons Learned](lessons-learned.md#best-practices) - Success patterns by category
|
||||
- [Conflict Patterns](conflict-patterns.md) - Known conflict types and resolutions
|
||||
- Context package references (metadata only)
|
||||
|
||||
**Use Case**: Understanding recent development patterns and avoiding known pitfalls
|
||||
|
||||
### Level 2: Complete History (~25K tokens)
|
||||
- All archived sessions with metadata
|
||||
- Full lessons learned (successes, challenges, watch patterns)
|
||||
- Complete conflict analysis with resolutions
|
||||
- IMPL_PLAN summaries from all sessions
|
||||
- Context package paths for on-demand loading
|
||||
|
||||
**Use Case**: Comprehensive review before major refactoring or architecture changes
|
||||
|
||||
### Level 3: Deep Dive (~40K tokens)
|
||||
- Full IMPL_PLAN.md and TODO_LIST.md from all sessions
|
||||
- Detailed task completion summaries
|
||||
- Cross-session dependency analysis
|
||||
- Direct context package file references
|
||||
|
||||
**Use Case**: Investigating specific implementation details or debugging historical decisions
|
||||
|
||||
---
|
||||
|
||||
## Quick Access
|
||||
|
||||
### Recent Sessions
|
||||
{list of 5 most recent sessions with one-line descriptions}
|
||||
|
||||
### By Domain
|
||||
- **{Domain_1}**: {count} sessions
|
||||
- **{Domain_2}**: {count} sessions
|
||||
- **{Domain_3}**: {count} sessions
|
||||
|
||||
### Top Watch Patterns
|
||||
1. {most_frequent_watch_pattern}
|
||||
2. {second_most_frequent}
|
||||
3. {third_most_frequent}
|
||||
|
||||
---
|
||||
|
||||
## Session Index
|
||||
|
||||
### {Domain_Category} Sessions
|
||||
- [{session_id}](../../../.workflow/.archives/{session_id}/) - {one_line_description} ({date})
|
||||
- Context: [context-package.json](../../../.workflow/.archives/{session_id}/.process/context-package.json)
|
||||
- Plan: [IMPL_PLAN.md](../../../.workflow/.archives/{session_id}/IMPL_PLAN.md)
|
||||
- Tags: {tag1}, {tag2}, {tag3}
|
||||
|
||||
---
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Loading Quick Context
|
||||
```markdown
|
||||
Load Level 0 from workflow-progress SKILL for overview of recent work
|
||||
```
|
||||
|
||||
### Investigating {Domain} History
|
||||
```markdown
|
||||
Load Level 2 from workflow-progress SKILL, filter by "{domain}" tag
|
||||
```
|
||||
|
||||
### Full Historical Analysis
|
||||
```markdown
|
||||
Load Level 3 from workflow-progress SKILL for complete development history
|
||||
```
|
||||
```
|
||||
|
||||
## Data Sources
|
||||
- Manifest: `.workflow/.archives/manifest.json`
|
||||
- All session metadata from manifest entries
|
||||
|
||||
## Generation Rules
|
||||
- Version format: `{major}.{minor}.{patch}` (increment patch for each update)
|
||||
- Domain list: Extract unique tags from all sessions, sort by frequency
|
||||
- Date range: Find earliest and latest archived_at timestamps
|
||||
- Token estimates: Approximate based on content length
|
||||
- Use relative paths (../../../.workflow/.archives/) for session references
|
||||
|
||||
## Formatting Rules
|
||||
- Keep descriptions concise
|
||||
- Sort sessions by date (newest first)
|
||||
- Group sessions by primary tag
|
||||
- Include only top 5 recent sessions in Quick Access
|
||||
- Include top 3 watch patterns
|
||||
@@ -0,0 +1,98 @@
|
||||
Template for generating lessons-learned.md
|
||||
|
||||
## Purpose
|
||||
Aggregate lessons learned from workflow sessions, categorized by functional domain and severity.
|
||||
|
||||
## File Location
|
||||
`.claude/skills/workflow-progress/lessons-learned.md`
|
||||
|
||||
## Update Strategy
|
||||
- **Incremental mode**: Merge new session lessons into existing categories, update frequencies
|
||||
- **Full mode**: Regenerate entire lessons document from all sessions
|
||||
|
||||
## Structure
|
||||
|
||||
```markdown
|
||||
# Workflow Lessons Learned
|
||||
|
||||
## Best Practices (Successes)
|
||||
|
||||
### {Domain_Category}
|
||||
- {success_pattern_1} (sessions: {session_id_1}, {session_id_2})
|
||||
- {success_pattern_2} (sessions: {session_id_3})
|
||||
|
||||
### {Domain_Category_2}
|
||||
...
|
||||
|
||||
---
|
||||
|
||||
## Known Challenges
|
||||
|
||||
### High Priority
|
||||
- **{challenge_title}**: {description}
|
||||
- Affected sessions: {session_id_1}, {session_id_2}
|
||||
- Resolution: {resolution_strategy}
|
||||
|
||||
### Medium Priority
|
||||
- **{challenge_title}**: {description}
|
||||
- Affected sessions: {session_id_3}
|
||||
- Resolution: {resolution_strategy}
|
||||
|
||||
### Low Priority
|
||||
...
|
||||
|
||||
---
|
||||
|
||||
## Watch Patterns
|
||||
|
||||
### Critical (3+ sessions)
|
||||
1. **{pattern_name}**: {description}
|
||||
- Frequency: {count} sessions
|
||||
- Affected: {session_list}
|
||||
- Mitigation: {mitigation_strategy}
|
||||
|
||||
### High Priority (2 sessions)
|
||||
...
|
||||
|
||||
### Normal (1 session)
|
||||
...
|
||||
```
|
||||
|
||||
## Data Sources
|
||||
- Lessons: `manifest.json` -> `archives[].lessons.{successes|challenges|watch_patterns}`
|
||||
- Session metadata: `.workflow/.archives/{session_id}/workflow-session.json`
|
||||
|
||||
## Aggregation Rules (Use Gemini CLI)
|
||||
|
||||
**Command Pattern**:
|
||||
```bash
|
||||
gemini -p "
|
||||
PURPOSE: Aggregate workflow lessons from session data
|
||||
TASK:
|
||||
• Group successes by functional domain
|
||||
• Categorize challenges by severity (HIGH/MEDIUM/LOW)
|
||||
• Identify watch patterns with frequency >= 2
|
||||
• Mark CRITICAL patterns (3+ sessions)
|
||||
MODE: analysis
|
||||
CONTEXT: @.workflow/.archives/manifest.json
|
||||
EXPECTED: Aggregated lessons with frequency counts
|
||||
RULES: $(cat ~/.claude/workflows/cli-templates/prompts/workflow/skill-aggregation.txt)
|
||||
"
|
||||
```
|
||||
|
||||
**Severity Classification**:
|
||||
- **HIGH**: Blocked development >4 hours OR repeated in 3+ sessions
|
||||
- **MEDIUM**: Required significant rework OR repeated in 2 sessions
|
||||
- **LOW**: Minor issues resolved quickly
|
||||
|
||||
**Pattern Identification**:
|
||||
- Successes in 3+ sessions → "Best Practices"
|
||||
- Challenges repeated 2+ times → "Known Issues"
|
||||
- Watch patterns frequency >= 2 → "High Priority Warnings"
|
||||
- Watch patterns frequency >= 3 → "CRITICAL"
|
||||
|
||||
## Formatting Rules
|
||||
- Sort by frequency (most common first)
|
||||
- Include session references for traceability
|
||||
- Use bold for challenge titles
|
||||
- Keep descriptions concise but actionable
|
||||
@@ -0,0 +1,53 @@
|
||||
Template for generating sessions-timeline.md
|
||||
|
||||
## Purpose
|
||||
Create or update chronological timeline of workflow sessions with functional domain grouping.
|
||||
|
||||
## File Location
|
||||
`.claude/skills/workflow-progress/sessions-timeline.md`
|
||||
|
||||
## Update Strategy
|
||||
- **Incremental mode**: Append new session to timeline, keep existing content
|
||||
- **Full mode**: Regenerate entire timeline from all sessions
|
||||
|
||||
## Structure
|
||||
|
||||
```markdown
|
||||
# Workflow Sessions Timeline
|
||||
|
||||
## Recent Sessions (Last 5)
|
||||
|
||||
### {session_id} ({archived_date})
|
||||
**Description**: {description}
|
||||
**Tags**: {tag1}, {tag2}, {tag3}
|
||||
**Metrics**: {task_count} tasks, {success_rate}% success, {duration_hours} hours
|
||||
**Context Package**: [{session_id}/context-package.json](../../../.workflow/.archives/{session_id}/.process/context-package.json)
|
||||
|
||||
**Key Outcomes**:
|
||||
- ✅ {success_item_1}
|
||||
- ✅ {success_item_2}
|
||||
- ⚠️ Watch: {watch_pattern}
|
||||
|
||||
---
|
||||
|
||||
## By Functional Domain
|
||||
|
||||
### {Domain_Name} ({count} sessions)
|
||||
- {session_id_1} ({date}) - {one_line_description}
|
||||
- {session_id_2} ({date}) - {one_line_description}
|
||||
|
||||
### {Domain_Name_2} ({count} sessions)
|
||||
...
|
||||
```
|
||||
|
||||
## Data Sources
|
||||
- Session metadata: `.workflow/.archives/{session_id}/workflow-session.json`
|
||||
- Manifest entry: `.workflow/.archives/manifest.json`
|
||||
- Lessons: `manifest.json` -> `archives[].lessons`
|
||||
|
||||
## Formatting Rules
|
||||
- Sort recent sessions by archived_at (newest first)
|
||||
- Group by functional domain using tags
|
||||
- Use relative paths for context package links
|
||||
- Use ✅ for successes, ⚠️ for watch patterns
|
||||
- Keep descriptions concise (one line)
|
||||
Reference in New Issue
Block a user