mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
refactor(workflow): remove redundant sections, focus on core responsibilities
Streamline workflow command documentation by removing sections that don't belong to core command responsibilities. ## Changes ### init.md (-46 lines) - Remove Integration with Existing Commands section - Remove Performance Considerations section - Remove Related Commands section - Focus: Project initialization and analysis only ### session/complete.md (-30 lines) - Remove Quick Commands reference section - Remove Archive Query Commands section - Focus: Session archival and feature registry updates only ### session/start.md (-34 lines) - Remove Simple Bash Commands reference section - Keep: Session ID Format (specification/standard) - Focus: Session creation and discovery only ### status.md (-165 lines) - Remove Simple Bash Commands section - Remove Simple Output Format examples - Remove Project Mode Quick Commands section - Focus: Status display logic only ### context-gather.md (-29 lines) - Remove Usage Examples section - Remove Success Criteria section - Remove Error Handling table - Keep: Notes (core design principles) - Focus: Context gathering orchestration only ## Benefits - Reduced documentation redundancy (~304 lines removed) - Clearer command responsibilities and boundaries - Easier maintenance and updates - Commands focus on their specific roles in workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -397,50 +397,3 @@ If not in git repo and empty directory:
|
||||
2. Create minimal project.json
|
||||
3. Suggest: "Add code files and run /workflow:init --regenerate"
|
||||
```
|
||||
|
||||
## Integration with Existing Commands
|
||||
|
||||
### /workflow:session:start
|
||||
Modified to check and call init:
|
||||
```javascript
|
||||
// In start.md Step 0
|
||||
if (!FileExists('.workflow/project.json')) {
|
||||
console.log("Project not initialized. Running /workflow:init...");
|
||||
SlashCommand({command: "/workflow:init"});
|
||||
// Wait for completion, then continue with session creation
|
||||
}
|
||||
```
|
||||
|
||||
### /workflow:status --project
|
||||
Uses extended overview fields:
|
||||
```javascript
|
||||
console.log(`## Technology Stack`);
|
||||
console.log(`Languages: ${overview.technology_stack.languages.map(l => l.name).join(', ')}`);
|
||||
console.log(`Frameworks: ${overview.technology_stack.frameworks.join(', ')}`);
|
||||
|
||||
console.log(`\n## Architecture`);
|
||||
console.log(`Style: ${overview.architecture.style}`);
|
||||
console.log(`Patterns: ${overview.architecture.patterns.join(', ')}`);
|
||||
|
||||
console.log(`\n## Key Components (${overview.key_components.length})`);
|
||||
overview.key_components.forEach(c => {
|
||||
console.log(`- ${c.name} (${c.path})`);
|
||||
console.log(` ${c.description}`);
|
||||
});
|
||||
```
|
||||
|
||||
## Performance Considerations
|
||||
|
||||
**Execution Time**:
|
||||
- cli-explore-agent Deep Scan: 2-5 minutes
|
||||
- Total initialization: 2-6 minutes (one-time cost)
|
||||
|
||||
**Optimization**:
|
||||
- Skip regeneration if project.json exists
|
||||
- Cache analysis results in _metadata
|
||||
- Parallel execution: project discovery + agent analysis
|
||||
|
||||
## Related Commands
|
||||
- `/workflow:session:start` - Calls init if needed
|
||||
- `/workflow:status --project` - Views project overview
|
||||
- `/workflow:init --regenerate` - Updates project analysis
|
||||
|
||||
@@ -114,19 +114,6 @@ Complete workflow session archival. Session already moved to archive location.
|
||||
- Remove active marker
|
||||
- Return success/error result
|
||||
|
||||
## Quick Commands
|
||||
|
||||
```bash
|
||||
# Phase 1: Find and move
|
||||
bash(find .workflow/ -name ".active-*" -type f | head -1)
|
||||
bash(basename .workflow/.active-WFS-session-name | sed 's/^\.active-//')
|
||||
bash(mkdir -p .workflow/.archives/)
|
||||
bash(mv .workflow/WFS-session-name .workflow/.archives/WFS-session-name)
|
||||
|
||||
# Phase 2: Agent completes archival
|
||||
Task(subagent_type="universal-executor", description="Complete session archival", prompt=`...`)
|
||||
```
|
||||
|
||||
### Phase 3: Update Project Feature Registry
|
||||
|
||||
**Purpose**: Record completed session as a project feature in `.workflow/project.json`.
|
||||
@@ -278,22 +265,3 @@ function getLatestCommitHash() {
|
||||
- If extraction fails: Use minimal defaults
|
||||
|
||||
**Phase 3 Total Commands**: 2 bash reads + JSON manipulation
|
||||
|
||||
## Archive Query Commands
|
||||
|
||||
After archival, you can query the manifest:
|
||||
|
||||
```bash
|
||||
# List all archived sessions
|
||||
jq '.archives[].session_id' .workflow/.archives/manifest.json
|
||||
|
||||
# Find sessions by keyword
|
||||
jq '.archives[] | select(.description | test("auth"; "i"))' .workflow/.archives/manifest.json
|
||||
|
||||
# Get specific session details
|
||||
jq '.archives[] | select(.session_id == "WFS-user-auth")' .workflow/.archives/manifest.json
|
||||
|
||||
# List all watch patterns across sessions
|
||||
jq '.archives[].lessons.watch_patterns[]' .workflow/.archives/manifest.json
|
||||
```
|
||||
|
||||
|
||||
@@ -202,41 +202,6 @@ SlashCommand(command="/workflow:session:start")
|
||||
SlashCommand(command="/workflow:session:start --new \"experimental feature\"")
|
||||
```
|
||||
|
||||
## Simple Bash Commands
|
||||
|
||||
### Basic Operations
|
||||
```bash
|
||||
# Check active sessions
|
||||
bash(ls .workflow/.active-*)
|
||||
|
||||
# List all sessions
|
||||
bash(ls .workflow/WFS-*)
|
||||
|
||||
# Read session metadata
|
||||
bash(cat .workflow/WFS-[session-id]/workflow-session.json)
|
||||
|
||||
# Create session directories
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.process)
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.task)
|
||||
bash(mkdir -p .workflow/WFS-[session-id]/.summaries)
|
||||
|
||||
# Mark session as active
|
||||
bash(touch .workflow/.active-WFS-[session-id])
|
||||
|
||||
# Clean active markers
|
||||
bash(rm .workflow/.active-*)
|
||||
```
|
||||
|
||||
### Generate Session Slug
|
||||
```bash
|
||||
bash(echo "Task Description" | sed 's/[^a-zA-Z0-9]/-/g' | tr '[:upper:]' '[:lower:]' | cut -c1-50)
|
||||
```
|
||||
|
||||
### Create Metadata JSON
|
||||
```bash
|
||||
bash(echo '{"session_id":"WFS-test","project":"test project","status":"planning"}' > .workflow/WFS-test/workflow-session.json)
|
||||
```
|
||||
|
||||
## Session ID Format
|
||||
- Pattern: `WFS-[lowercase-slug]`
|
||||
- Characters: `a-z`, `0-9`, `-` only
|
||||
|
||||
@@ -192,170 +192,4 @@ find .workflow/WFS-session/.summaries/ -name "*.md" -type f 2>/dev/null | wc -l
|
||||
|
||||
## Completed Tasks
|
||||
- [COMPLETED] impl-0: Setup completed
|
||||
```
|
||||
|
||||
## Simple Bash Commands
|
||||
|
||||
### Basic Operations
|
||||
- **Find active session**: `find .workflow/ -name ".active-*" -type f`
|
||||
- **Read session info**: `cat .workflow/session/workflow-session.json`
|
||||
- **List tasks**: `find .workflow/session/.task/ -name "*.json" -type f`
|
||||
- **Check task status**: `cat task.json | jq -r '.status'`
|
||||
- **Count completed**: `find .summaries/ -name "*.md" -type f | wc -l`
|
||||
|
||||
### Task Status Check
|
||||
- **pending**: Not started yet
|
||||
- **active**: Currently in progress
|
||||
- **completed**: Finished with summary
|
||||
- **blocked**: Waiting for dependencies
|
||||
|
||||
### Validation Commands
|
||||
```bash
|
||||
# Check session exists
|
||||
test -f .workflow/.active-* && echo "Session active"
|
||||
|
||||
# Validate task files
|
||||
for f in .workflow/session/.task/*.json; do jq empty "$f" && echo "Valid: $f"; done
|
||||
|
||||
# Check summaries match
|
||||
find .task/ -name "*.json" -type f | wc -l
|
||||
find .summaries/ -name "*.md" -type f 2>/dev/null | wc -l
|
||||
```
|
||||
|
||||
## Simple Output Format
|
||||
|
||||
### Default Overview
|
||||
```
|
||||
Session: WFS-user-auth
|
||||
Status: ACTIVE
|
||||
Progress: 5/12 tasks
|
||||
|
||||
Current: impl-3 (Building API endpoints)
|
||||
Next: impl-4 (Adding authentication)
|
||||
Completed: impl-1, impl-2
|
||||
```
|
||||
|
||||
### Task Details
|
||||
```
|
||||
Task: impl-1
|
||||
Title: Build authentication module
|
||||
Status: completed
|
||||
Agent: code-developer
|
||||
Created: 2025-09-15
|
||||
Completed: 2025-09-15
|
||||
Summary: .summaries/impl-1-summary.md
|
||||
```
|
||||
|
||||
### Validation Results
|
||||
```
|
||||
Session file valid
|
||||
8 task files found
|
||||
3 summaries found
|
||||
5 tasks pending completion
|
||||
```
|
||||
|
||||
## Project Mode Quick Commands
|
||||
|
||||
### Basic Operations
|
||||
```bash
|
||||
# Check if project initialized
|
||||
bash(test -f .workflow/project.json && echo "Initialized" || echo "Not initialized")
|
||||
|
||||
# Read project data
|
||||
bash(cat .workflow/project.json)
|
||||
|
||||
# Count total features
|
||||
bash(cat .workflow/project.json | jq '.statistics.total_features')
|
||||
|
||||
# List all feature IDs
|
||||
bash(cat .workflow/project.json | jq -r '.features[].id')
|
||||
|
||||
# Find feature by keyword
|
||||
bash(cat .workflow/project.json | jq '.features[] | select(.title | test("auth"; "i"))')
|
||||
|
||||
# Get most recent feature
|
||||
bash(cat .workflow/project.json | jq '.features | sort_by(.implemented_at) | reverse | .[0]')
|
||||
|
||||
# List archived sessions
|
||||
bash(ls -1t .workflow/.archives/WFS-* 2>/dev/null | head -5)
|
||||
```
|
||||
|
||||
### Output Comparison
|
||||
|
||||
**Project Overview** (`--project`):
|
||||
```
|
||||
## Project: claude_dms3
|
||||
Initialized: 2025-01-18T10:00:00Z
|
||||
|
||||
### Overview
|
||||
TypeScript workflow automation system with AI agent orchestration
|
||||
|
||||
**Technology Stack**:
|
||||
- TypeScript (primary): 150 files
|
||||
- Bash: 30 files
|
||||
Frameworks: Node.js
|
||||
|
||||
**Architecture**:
|
||||
Style: Agent-based workflow orchestration with modular command system
|
||||
Patterns: Command Pattern, Agent Pattern, Template Method
|
||||
|
||||
**Key Components** (3):
|
||||
- Workflow Planning (.claude/commands/workflow)
|
||||
Multi-phase planning workflow with brainstorming and task generation
|
||||
- Agent System (.claude/agents)
|
||||
Specialized agents for code development, testing, documentation
|
||||
- CLI Tool Integration (.claude/scripts)
|
||||
Gemini, Qwen, Codex wrapper scripts for AI-powered analysis
|
||||
|
||||
**Metrics**:
|
||||
- Files: 180
|
||||
- Lines of Code: 15000
|
||||
- Complexity: medium
|
||||
|
||||
---
|
||||
|
||||
### Completed Features (2)
|
||||
|
||||
- Authentication System (2025-01-15)
|
||||
JWT-based authentication with OAuth2 support
|
||||
Tags: auth, security, api
|
||||
Session: WFS-auth-system
|
||||
Archive: .workflow/.archives/WFS-auth-system
|
||||
Commit: a1b2c3d
|
||||
|
||||
- Workflow Planning (2025-01-10)
|
||||
Multi-phase planning workflow with agent coordination
|
||||
Tags: workflow, planning
|
||||
Session: WFS-workflow-v2
|
||||
Archive: .workflow/.archives/WFS-workflow-v2
|
||||
Commit: e5f6g7h
|
||||
|
||||
### Project Statistics
|
||||
- Total Features: 2
|
||||
- Total Sessions: 15
|
||||
- Last Updated: 2025-01-18T15:30:00Z
|
||||
|
||||
### Query Commands
|
||||
# Find by tag
|
||||
cat .workflow/project.json | jq '.features[] | select(.tags[] == "auth")'
|
||||
|
||||
# View archive
|
||||
cat .workflow/.archives/WFS-auth-system/IMPL_PLAN.md
|
||||
|
||||
# List all tags
|
||||
cat .workflow/project.json | jq -r '.features[].tags[]' | sort -u
|
||||
|
||||
# Regenerate project analysis
|
||||
/workflow:init --regenerate
|
||||
```
|
||||
|
||||
**Session Overview** (default):
|
||||
```
|
||||
Session: WFS-user-auth
|
||||
Status: ACTIVE
|
||||
Progress: 5/12 tasks
|
||||
|
||||
Current: impl-3 (Building API endpoints)
|
||||
Next: impl-4 (Adding authentication)
|
||||
Completed: impl-1, impl-2
|
||||
```
|
||||
@@ -252,30 +252,6 @@ if (historicalConflicts.length > 0 && currentRisk === "low") {
|
||||
3. Continue to Track 2 (reference documentation)
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
### Basic Usage
|
||||
```bash
|
||||
/workflow:tools:context-gather --session WFS-auth-feature "Implement JWT authentication with refresh tokens"
|
||||
```
|
||||
## Success Criteria
|
||||
|
||||
- ✅ Valid context-package.json generated in `.workflow/{session}/.process/`
|
||||
- ✅ Contains >80% relevant files based on task keywords
|
||||
- ✅ Execution completes within 2 minutes
|
||||
- ✅ All required schema fields present and valid
|
||||
- ✅ Conflict risk accurately assessed
|
||||
- ✅ Agent reports completion with statistics
|
||||
|
||||
## Error Handling
|
||||
|
||||
| Error | Cause | Resolution |
|
||||
|-------|-------|------------|
|
||||
| Package validation failed | Invalid session_id in existing package | Re-run agent to regenerate |
|
||||
| Agent execution timeout | Large codebase or slow MCP | Increase timeout, check code-index status |
|
||||
| Missing required fields | Agent incomplete execution | Check agent logs, verify schema compliance |
|
||||
| File count exceeds limit | Too many relevant files | Agent should auto-prioritize top 50 by relevance |
|
||||
|
||||
## Notes
|
||||
|
||||
- **Detection-first**: Always check for existing package before invoking agent
|
||||
|
||||
Reference in New Issue
Block a user