mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
Remove granular progress tracking across workflow system
- Remove detailed progress views (Total Tasks: X, Completed: Y %) from all templates - Simplify TODO_LIST.md structure by removing Progress Overview sections - Remove stats tracking from session-management-principles.json schema - Eliminate progress format and calculation logic from context command - Remove percentage-based progress displays from action-planning-agent - Simplify vibe command coordination by removing detailed task counts - Focus on essential JSON state changes rather than UI progress metrics 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,344 +1,259 @@
|
||||
---
|
||||
name: context
|
||||
description: Unified context command - Single source of truth for all workflow and task status information
|
||||
usage: /context [task-id] [--format=<tree|list|json|progress>] [--health-check] [--detailed] [--export]
|
||||
argument-hint: [optional task-id] [display format] [analysis options] [export flag]
|
||||
description: Generate on-demand views from JSON task data
|
||||
usage: /context [task-id] [--format=<format>] [--validate]
|
||||
argument-hint: [optional: task-id, format, validation]
|
||||
examples:
|
||||
- /context
|
||||
- /context IMPL-001
|
||||
- /context --format=tree
|
||||
- /context --health-check
|
||||
- /context --detailed --export
|
||||
- /context --format=progress
|
||||
- /context impl-1
|
||||
- /context --format=hierarchy
|
||||
- /context --validate
|
||||
---
|
||||
|
||||
# Unified Context Command (/context)
|
||||
# Context Command (/context)
|
||||
|
||||
## Overview
|
||||
Generates on-demand views from JSON task data. No synchronization needed - all views are calculated from the current state of JSON files.
|
||||
|
||||
**Single Source of Truth**: This command replaces `/workflow:context` and `/task:context` with a unified interface that generates all views on-demand from JSON data. Eliminates synchronization complexity by making documents read-only views.
|
||||
## Core Principles
|
||||
**Data Source:** @~/.claude/workflows/json-document-coordination-system.md
|
||||
**Session Management:** @~/.claude/workflows/session-management-principles.md
|
||||
|
||||
## Core Architecture
|
||||
## Key Features
|
||||
|
||||
### Single Source of Truth Principle
|
||||
- **JSON Authority**: All data read from `.task/*.json` and `workflow-session.json` files
|
||||
- **Generated Views**: All markdown displays generated on-demand (never manually edited)
|
||||
- **No Synchronization**: Documents are views, not synchronized states
|
||||
- **Conflict-Free**: Single direction data flow eliminates conflicts
|
||||
### Pure View Generation
|
||||
- **No Sync**: Views are generated, not synchronized
|
||||
- **Always Current**: Reads latest JSON data every time
|
||||
- **No Persistence**: Views are temporary, not saved
|
||||
- **Single Source**: All data comes from JSON files only
|
||||
|
||||
### Unified Command Interface
|
||||
- **Global Context**: `/context` shows complete workflow status
|
||||
- **Task-Specific**: `/context IMPL-001` shows individual task details
|
||||
- **Health Checking**: `/context --health-check` validates JSON data integrity
|
||||
- **Multiple Formats**: Tree, list, progress, and JSON output formats
|
||||
### Multiple View Formats
|
||||
- **Overview** (default): Current tasks and status
|
||||
- **Hierarchy**: Task relationships and structure
|
||||
- **Details**: Specific task information
|
||||
|
||||
## Usage Modes
|
||||
## Usage
|
||||
|
||||
### 1. Global Workflow Context (Default)
|
||||
### Default Overview
|
||||
```bash
|
||||
/context
|
||||
```
|
||||
|
||||
**Generated Output** (from JSON data):
|
||||
```
|
||||
🔍 Workflow Status Overview
|
||||
========================
|
||||
|
||||
📋 Session Information:
|
||||
- Session ID: WFS-workflow-optimization
|
||||
- Current Phase: IMPLEMENT
|
||||
- Complexity: complex
|
||||
- Start Time: 2025-09-07 14:30:22Z
|
||||
- Duration: 4h 15m
|
||||
|
||||
📊 Task Progress (from .task/*.json):
|
||||
✅ Completed: 2/5 (40%)
|
||||
🔄 In Progress: 1 task
|
||||
⏳ Pending: 2 tasks
|
||||
🚫 Blocked: 0 tasks
|
||||
|
||||
📁 JSON Data Health:
|
||||
✅ workflow-session.json - Valid JSON, complete data
|
||||
✅ .task/ directory - 5 task files, all valid JSON
|
||||
✅ Task relationships - All dependencies valid
|
||||
✅ Progress calculations - Mathematically consistent
|
||||
|
||||
⏱️ Estimated Completion: 2025-09-07 20:45 (2h 30m remaining)
|
||||
|
||||
🎯 Next Actions (generated from JSON state):
|
||||
1. Complete IMPL-003 (currently in progress)
|
||||
2. Begin IMPL-004 (dependencies satisfied)
|
||||
3. Review completed IMPL-001 and IMPL-002
|
||||
```
|
||||
|
||||
### 2. Task-Specific Context
|
||||
```bash
|
||||
/context IMPL-001
|
||||
```
|
||||
|
||||
**Generated Output** (from JSON file):
|
||||
```
|
||||
📋 Task Context: IMPL-001
|
||||
━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
📄 JSON Source: .task/impl-001.json
|
||||
Status: completed (from JSON authority)
|
||||
Created: 2025-09-07T14:45:00Z
|
||||
Completed: 2025-09-07T16:30:00Z
|
||||
Duration: 1h 45m
|
||||
|
||||
🎯 Task Definition (from JSON):
|
||||
Title: Implement single source of truth architecture by removing sync commands
|
||||
Type: architecture
|
||||
Agent: code-developer
|
||||
Priority: critical
|
||||
|
||||
📋 Context (from JSON):
|
||||
Requirements:
|
||||
- Remove workflow:sync and task:sync commands
|
||||
- Update coordination system documentation
|
||||
- Establish JSON as single authority source
|
||||
Scope:
|
||||
- .claude/commands/workflow/sync.md
|
||||
- .claude/commands/task/sync.md
|
||||
- .claude/workflows/json-document-coordination-system.md
|
||||
|
||||
🔗 Dependencies (from JSON):
|
||||
Upstream: None
|
||||
Downstream: IMPL-002, IMPL-003
|
||||
Parent: None
|
||||
|
||||
✅ Completion Status (from JSON):
|
||||
Result: success
|
||||
Files Modified: 3 files moved to deprecated, 1 file updated
|
||||
Next Task: IMPL-002 ready to begin
|
||||
```
|
||||
|
||||
### 3. Health Check Mode
|
||||
```bash
|
||||
/context --health-check
|
||||
```
|
||||
|
||||
**Generated Analysis** (from JSON validation):
|
||||
```
|
||||
🏥 System Health Check (JSON Data Analysis)
|
||||
========================================
|
||||
|
||||
✅ JSON File Integrity:
|
||||
- workflow-session.json: ✅ Valid JSON, complete schema
|
||||
- .task/impl-001.json: ✅ Valid JSON, all required fields
|
||||
- .task/impl-002.json: ✅ Valid JSON, all required fields
|
||||
- .task/impl-003.json: ✅ Valid JSON, all required fields
|
||||
- .task/impl-004.json: ✅ Valid JSON, all required fields
|
||||
- .task/impl-005.json: ✅ Valid JSON, all required fields
|
||||
|
||||
🔗 Data Consistency Check:
|
||||
✅ Task IDs: All unique, follow impl-N format
|
||||
✅ Dependencies: All referenced tasks exist
|
||||
✅ Status Logic: All transitions valid
|
||||
✅ Progress Math: Calculations consistent
|
||||
✅ Timestamps: All valid, chronologically ordered
|
||||
|
||||
📊 Data Completeness:
|
||||
✅ All tasks have required fields
|
||||
✅ All tasks have context information
|
||||
✅ All dependencies properly defined
|
||||
✅ Session state complete
|
||||
|
||||
🎯 Overall System Health: 100% (Excellent)
|
||||
- Zero data conflicts (Single source of truth benefit)
|
||||
- All JSON files valid and consistent
|
||||
- No synchronization issues (eliminated by design)
|
||||
- Ready for continued execution
|
||||
```
|
||||
|
||||
### 4. Tree Format Display
|
||||
```bash
|
||||
/context --format=tree
|
||||
```
|
||||
|
||||
**Generated Tree** (from JSON hierarchy):
|
||||
```
|
||||
📁 WFS-workflow-optimization (from workflow-session.json)
|
||||
├── 📋 PLAN [Completed]
|
||||
│ └── Output: IMPL_PLAN.md, 5 tasks generated
|
||||
├── 🔨 IMPLEMENT [Active - 40% complete]
|
||||
│ ├── ✅ IMPL-001: Single source of truth architecture (completed)
|
||||
│ ├── ✅ IMPL-002: Automated planning-to-execution flow (completed)
|
||||
│ ├── 🔄 IMPL-003: Unified context commands (in_progress)
|
||||
│ ├── ⏳ IMPL-004: Dynamic complexity escalation (pending)
|
||||
│ └── ⏳ IMPL-005: Update session management (pending)
|
||||
└── 📝 REVIEW [Pending]
|
||||
└── Awaiting implementation completion
|
||||
```
|
||||
|
||||
### 5. Progress Format
|
||||
```bash
|
||||
/context --format=progress
|
||||
```
|
||||
|
||||
**Generated Progress View** (calculated from JSON data):
|
||||
```
|
||||
📊 Implementation Progress Report
|
||||
==============================
|
||||
|
||||
🎯 Overall Progress: 40% (2/5 tasks complete)
|
||||
|
||||
📈 Progress by Phase:
|
||||
┌─────────────┬─────────┬──────────┬─────────┐
|
||||
│ Phase │ Status │ Progress │ Tasks │
|
||||
├─────────────┼─────────┼──────────┼─────────┤
|
||||
│ PLAN │ ✅ │ 100% │ N/A │
|
||||
│ IMPLEMENT │ 🔄 │ 40% │ 2/5 │
|
||||
│ REVIEW │ ⏳ │ 0% │ 0/0 │
|
||||
└─────────────┴─────────┴──────────┴─────────┘
|
||||
|
||||
📋 Task Progress Details (from JSON files):
|
||||
✅ IMPL-001: single source of truth [100%] ⏱️ 1h 45m
|
||||
✅ IMPL-002: automated planning flow [100%] ⏱️ 2h 10m
|
||||
🔄 IMPL-003: unified context commands [75%] ⏱️ 1h 30m (in progress)
|
||||
⏳ IMPL-004: dynamic complexity [0%] ⏱️ 2h 00m (estimated)
|
||||
⏳ IMPL-005: session management updates [0%] ⏱️ 1h 15m (estimated)
|
||||
|
||||
⏰ Time Analysis (calculated from JSON):
|
||||
Time Spent: 5h 25m
|
||||
Remaining: 2h 45m
|
||||
Estimated Total: 8h 10m
|
||||
Completion: 2025-09-07 21:15
|
||||
```
|
||||
|
||||
## File Export Feature
|
||||
|
||||
### Export Generated Views
|
||||
```bash
|
||||
/context --export
|
||||
```
|
||||
|
||||
**Generated Files** (all from JSON data):
|
||||
```
|
||||
.workflow/WFS-workflow-optimization/reports/
|
||||
├── CONTEXT_REPORT.md # Current context view
|
||||
├── PROGRESS_REPORT.md # Progress analysis
|
||||
├── HEALTH_CHECK.md # System health status
|
||||
└── context-exports/ # Historical exports
|
||||
├── context-2025-09-07-14-30.md
|
||||
├── progress-2025-09-07-15-45.md
|
||||
└── health-2025-09-07-16-15.md
|
||||
```
|
||||
|
||||
**Report Structure** (generated from JSON):
|
||||
Generates current workflow overview:
|
||||
```markdown
|
||||
# Workflow Context Report
|
||||
*Generated: 2025-09-07 16:15:00 from JSON data sources*
|
||||
# Workflow Overview
|
||||
**Session**: WFS-user-auth
|
||||
**Phase**: IMPLEMENT
|
||||
**Type**: medium
|
||||
|
||||
## Data Sources
|
||||
- workflow-session.json (last updated: 2025-09-07T15:45:00Z)
|
||||
- 5 task JSON files in .task/ directory
|
||||
- All sources validated and consistent
|
||||
## Active Tasks
|
||||
- [⚠️] impl-1: Build authentication module (code-developer)
|
||||
- [⚠️] impl-2: Setup user management (code-developer)
|
||||
|
||||
## Session Overview
|
||||
[Generated from workflow-session.json]
|
||||
## Completed Tasks
|
||||
- [✅] impl-0: Project setup
|
||||
|
||||
## Task Analysis
|
||||
[Generated from .task/*.json files]
|
||||
|
||||
## Health Assessment
|
||||
[Validated from JSON data integrity]
|
||||
|
||||
---
|
||||
*This report is a generated view from authoritative JSON data*
|
||||
*No manual editing required - data updates automatically in JSON files*
|
||||
## Stats
|
||||
- **Total**: 8 tasks
|
||||
- **Completed**: 3
|
||||
- **Active**: 2
|
||||
- **Remaining**: 3
|
||||
```
|
||||
|
||||
## Advanced Features
|
||||
|
||||
### JSON Output for Scripting
|
||||
### Specific Task View
|
||||
```bash
|
||||
/context --format=json
|
||||
/context impl-1
|
||||
```
|
||||
|
||||
**Generated JSON** (compiled from all sources):
|
||||
```json
|
||||
{
|
||||
"session": {
|
||||
"id": "WFS-workflow-optimization",
|
||||
"status": "active",
|
||||
"phase": "implement",
|
||||
"progress": 40,
|
||||
"data_source": "workflow-session.json"
|
||||
},
|
||||
"tasks": [
|
||||
{
|
||||
"id": "IMPL-001",
|
||||
"status": "completed",
|
||||
"progress": 100,
|
||||
"data_source": ".task/impl-001.json"
|
||||
}
|
||||
],
|
||||
"health": {
|
||||
"json_integrity": 100,
|
||||
"data_consistency": 100,
|
||||
"completeness": 100
|
||||
},
|
||||
"generated_at": "2025-09-07T16:15:00Z",
|
||||
"data_freshness": "current"
|
||||
}
|
||||
Shows detailed task information:
|
||||
```markdown
|
||||
# Task: impl-1
|
||||
|
||||
**Title**: Build authentication module
|
||||
**Status**: active
|
||||
**Agent**: code-developer
|
||||
**Type**: feature
|
||||
|
||||
## Context
|
||||
- **Requirements**: JWT authentication, OAuth2 support
|
||||
- **Scope**: src/auth/*, tests/auth/*
|
||||
- **Acceptance**: Module handles JWT tokens, OAuth2 flow implemented
|
||||
- **Inherited From**: WFS-user-auth
|
||||
|
||||
## Relations
|
||||
- **Parent**: none
|
||||
- **Subtasks**: impl-1.1, impl-1.2
|
||||
- **Dependencies**: impl-0
|
||||
|
||||
## Execution
|
||||
- **Attempts**: 0
|
||||
- **Last Attempt**: never
|
||||
|
||||
## Metadata
|
||||
- **Created**: 2025-09-05T10:30:00Z
|
||||
- **Updated**: 2025-09-05T10:35:00Z
|
||||
```
|
||||
|
||||
### Health Check Integration
|
||||
- **Validation Engine**: Checks all JSON files for schema compliance
|
||||
- **Consistency Verification**: Validates cross-references between files
|
||||
- **Data Integrity**: Ensures all dependencies and relationships are valid
|
||||
- **Performance Monitoring**: Tracks data loading and generation speed
|
||||
|
||||
## Benefits of Unified Architecture
|
||||
|
||||
### Eliminated Complexity
|
||||
- **No Sync Commands**: Removed `/workflow:sync` and `/task:sync`
|
||||
- **No Conflicts**: Single source eliminates data drift
|
||||
- **No Manual Document Editing**: All documents are generated views
|
||||
- **Simplified User Experience**: One command for all context needs
|
||||
|
||||
### Enhanced Reliability
|
||||
- **Data Consistency**: JSON authority ensures consistent state
|
||||
- **Error Reduction**: No synchronization bugs or conflicts
|
||||
- **Simplified Recovery**: Only JSON files need backup/restore
|
||||
- **Predictable Behavior**: Views always reflect current JSON state
|
||||
|
||||
### Improved Performance
|
||||
- **On-Demand Generation**: Views created only when requested
|
||||
- **Efficient Data Access**: Direct JSON file reading
|
||||
- **No Background Sync**: No overhead from synchronization processes
|
||||
- **Cached Calculations**: Smart caching for expensive operations
|
||||
|
||||
## Technical Implementation
|
||||
|
||||
### Data Flow Architecture
|
||||
```
|
||||
JSON Files (.task/*.json + workflow-session.json)
|
||||
↓ (Single Direction - Read Only)
|
||||
View Generation Engine
|
||||
↓
|
||||
Formatted Output (Console/File)
|
||||
### Hierarchy View
|
||||
```bash
|
||||
/context --format=hierarchy
|
||||
```
|
||||
|
||||
### View Generation Process
|
||||
1. **Load JSON Data**: Read all relevant JSON files
|
||||
2. **Validate Data**: Check integrity and consistency
|
||||
3. **Calculate Views**: Generate requested format/content
|
||||
4. **Format Output**: Apply formatting and display
|
||||
5. **Export (Optional)**: Save generated views to files
|
||||
Shows task relationships:
|
||||
```markdown
|
||||
# Task Hierarchy
|
||||
|
||||
### Error Handling
|
||||
- **Missing Files**: Clear error messages with recovery suggestions
|
||||
- **Invalid JSON**: Schema validation with specific error details
|
||||
- **Broken References**: Dependency validation with repair recommendations
|
||||
- **Data Inconsistencies**: Automatic detection and resolution suggestions
|
||||
## Main Tasks
|
||||
- impl-0: Project setup ✅
|
||||
- impl-1: Build authentication module ⚠️
|
||||
- impl-1.1: Design auth schema
|
||||
- impl-1.2: Implement auth logic
|
||||
- impl-2: Setup user management ⚠️
|
||||
|
||||
## Dependencies
|
||||
- impl-1 → depends on → impl-0
|
||||
- impl-2 → depends on → impl-1
|
||||
```
|
||||
|
||||
### Data Management
|
||||
- All commands now work with JSON as single source of truth
|
||||
- Document generation happens on-demand
|
||||
- No synchronization commands needed
|
||||
- Simplified data model improves reliability
|
||||
## View Generation Process
|
||||
|
||||
### Data Loading
|
||||
```pseudo
|
||||
function generate_context_view(task_id, format):
|
||||
// Load all current data
|
||||
session = load_workflow_session()
|
||||
all_tasks = load_all_task_json_files()
|
||||
|
||||
// Filter if specific task requested
|
||||
if task_id:
|
||||
target_task = find_task(all_tasks, task_id)
|
||||
return generate_task_detail_view(target_task)
|
||||
|
||||
// Generate requested format
|
||||
switch format:
|
||||
case 'hierarchy':
|
||||
return generate_hierarchy_view(all_tasks)
|
||||
default:
|
||||
return generate_overview(session, all_tasks)
|
||||
```
|
||||
|
||||
### Real-Time Calculation
|
||||
- **Task Counts**: Calculated from JSON file status fields
|
||||
- **Relationships**: Built from JSON relations fields
|
||||
- **Status**: Read directly from current JSON state
|
||||
|
||||
## Validation Mode
|
||||
|
||||
### Basic Validation
|
||||
```bash
|
||||
/context --validate
|
||||
```
|
||||
|
||||
Performs integrity checks:
|
||||
```markdown
|
||||
# Validation Results
|
||||
|
||||
## JSON File Validation
|
||||
✅ All task JSON files are valid
|
||||
✅ Session file is valid and readable
|
||||
|
||||
## Relationship Validation
|
||||
✅ All parent-child relationships are valid
|
||||
✅ All dependencies reference existing tasks
|
||||
✅ No circular dependencies detected
|
||||
|
||||
## Hierarchy Validation
|
||||
✅ Task hierarchy within depth limits (max 3 levels)
|
||||
✅ All subtask references are bidirectional
|
||||
|
||||
## Issues Found
|
||||
⚠️ impl-3: No subtasks defined (expected for leaf task)
|
||||
|
||||
**Status**: All systems operational
|
||||
```
|
||||
|
||||
### Validation Checks
|
||||
- **JSON Schema**: All files parse correctly
|
||||
- **References**: All task IDs exist
|
||||
- **Hierarchy**: Parent-child relationships are valid
|
||||
- **Dependencies**: No circular dependencies
|
||||
- **Depth**: Task hierarchy within limits
|
||||
|
||||
## Error Handling
|
||||
|
||||
### Missing Files
|
||||
```bash
|
||||
❌ Session file not found
|
||||
→ Initialize new workflow session? (y/n)
|
||||
|
||||
❌ Task impl-5 not found
|
||||
→ Available tasks: impl-1, impl-2, impl-3, impl-4
|
||||
```
|
||||
|
||||
### Invalid Data
|
||||
```bash
|
||||
❌ Invalid JSON in impl-2.json
|
||||
→ Cannot generate view for impl-2
|
||||
→ Repair file manually or recreate task
|
||||
|
||||
⚠️ Circular dependency detected: impl-1 → impl-2 → impl-1
|
||||
→ Task relationships may be incorrect
|
||||
```
|
||||
|
||||
## Performance Benefits
|
||||
|
||||
### Fast Generation
|
||||
- **No File Writes**: Only reads JSON files
|
||||
- **No Sync Logic**: No complex synchronization
|
||||
- **Instant Results**: Generate views on demand
|
||||
- **No Conflicts**: No state consistency issues
|
||||
|
||||
### Scalability
|
||||
- **Large Task Sets**: Handles hundreds of tasks efficiently
|
||||
- **Complex Hierarchies**: No performance degradation
|
||||
- **Concurrent Access**: Multiple views can be generated simultaneously
|
||||
|
||||
## Integration
|
||||
|
||||
### Workflow Integration
|
||||
- Use after task creation to see current state
|
||||
- Use for debugging task relationships
|
||||
|
||||
### Command Integration
|
||||
```bash
|
||||
# Common workflow
|
||||
/task:create "New feature"
|
||||
/context # Check current state
|
||||
/task:breakdown impl-1
|
||||
/context --format=hierarchy # View new structure
|
||||
/task:execute impl-1.1
|
||||
```
|
||||
|
||||
## Output Formats
|
||||
|
||||
### Supported Formats
|
||||
- `overview` (default): General workflow status
|
||||
- `hierarchy`: Task relationships
|
||||
- `tasks`: Simple task list
|
||||
- `details`: Comprehensive information
|
||||
|
||||
### Custom Filtering
|
||||
```bash
|
||||
# Show only active tasks
|
||||
/context --format=tasks --filter=active
|
||||
|
||||
# Show completed tasks only
|
||||
/context --format=tasks --filter=completed
|
||||
|
||||
# Show tasks for specific agent
|
||||
/context --format=tasks --agent=code-developer
|
||||
```
|
||||
|
||||
## Related Commands
|
||||
|
||||
- `/task:create` - Create tasks (generates JSON data)
|
||||
- `/task:execute` - Execute tasks (updates JSON data)
|
||||
- `/task:breakdown` - Create subtasks (generates more JSON data)
|
||||
- `/workflow:vibe` - Coordinate agents (uses context for coordination)
|
||||
|
||||
This context system provides instant, accurate views of workflow state without any synchronization complexity or performance overhead.
|
||||
Reference in New Issue
Block a user