Files
Claude-Code-Workflow/.claude/commands/context.md
catlog22 9502741d50 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>
2025-09-08 15:26:01 +08:00

6.2 KiB

name, description, usage, argument-hint, examples
name description usage argument-hint examples
context Generate on-demand views from JSON task data /context [task-id] [--format=<format>] [--validate]
optional
task-id
format
validation
/context
/context impl-1
/context --format=hierarchy
/context --validate

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.

Core Principles

Data Source: @/.claude/workflows/json-document-coordination-system.md
Session Management: @
/.claude/workflows/session-management-principles.md

Key Features

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

Multiple View Formats

  • Overview (default): Current tasks and status
  • Hierarchy: Task relationships and structure
  • Details: Specific task information

Usage

Default Overview

/context

Generates current workflow overview:

# Workflow Overview
**Session**: WFS-user-auth
**Phase**: IMPLEMENT
**Type**: medium

## Active Tasks
- [⚠️] impl-1: Build authentication module (code-developer)
- [⚠️] impl-2: Setup user management (code-developer)

## Completed Tasks  
- [✅] impl-0: Project setup

## Stats
- **Total**: 8 tasks
- **Completed**: 3
- **Active**: 2
- **Remaining**: 3

Specific Task View

/context impl-1

Shows detailed task information:

# 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

Hierarchy View

/context --format=hierarchy

Shows task relationships:

# Task Hierarchy

## 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

View Generation Process

Data Loading

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

/context --validate

Performs integrity checks:

# 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

❌ 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

❌ 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

# 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

# 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
  • /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.