Commit Graph

648 Commits

Author SHA1 Message Date
catlog22
45a082d963 refactor(agents): remove Performance Optimization section from cli-explore-agent
- Removed Performance Optimization section (49 lines)
- Performance considerations should not appear in agent responsibilities
- Deleted caching strategy, parallel execution, and resource limits sections
- Agent documentation now focuses solely on core capabilities and execution flow
2025-11-18 13:07:47 +08:00
catlog22
19ebb2dc82 fix(workflow): complete path migration and enhance session:complete
Comprehensive update to eliminate all old path references and implement transactional archival in session:complete.

## Part 1: Complete Path Migration (43 files)

### Files Updated
- action-plan-verify.md
- session/list.md, session/resume.md
- tdd-verify.md, tdd-plan.md, test-*.md
- All brainstorm/*.md files (13 files)
- All tools/*.md files (10 files)
- All ui-design/*.md files (10 files)
- lite-plan.md, lite-execute.md, plan.md

### Path Changes
- `.workflow/.active-*` → `find .workflow/sessions/ -name "WFS-*" -type d`
- `.workflow/WFS-{session}` → `.workflow/sessions/WFS-{session}`
- `.workflow/.archives/` → `.workflow/archives/`
- Removed all marker file operations (touch/rm .active-*)

### Verification
-  0 references to .active-* markers remain
-  0 references to direct .workflow/WFS-* paths
-  0 references to .workflow/.archives/ (dot prefix)

## Part 2: Transactional Archival Enhancement

### session/complete.md - Complete Rewrite

**New Four-Phase Architecture**:

1. **Phase 1: Pre-Archival Preparation**
   - Find active session in .workflow/sessions/
   - Check for existing .archiving marker (resume detection)
   - Create .archiving marker to prevent concurrent operations

2. **Phase 2: Agent Analysis (In-Place)**
   - Agent processes session WHILE STILL in sessions/ directory
   - Pure analysis - no file moves or manifest updates
   - Returns complete metadata package for atomic commit
   - Failure here → session remains active, safe to retry

3. **Phase 3: Atomic Commit**
   - Only executes if Phase 2 succeeds
   - Move session to archives/
   - Update manifest.json
   - Remove .archiving marker
   - All-or-nothing guarantee

4. **Phase 4: Project Registry Update**
   - Extract feature metadata and update project.json

**Key Improvements**:
- **Agent-first, move-second**: Prevents inconsistent states
- **Transactional guarantees**: All-or-nothing file operations
- **Resume capability**: .archiving marker enables safe retry
- **Error recovery**: Comprehensive failure handling documented

**Old Design Flaw (Fixed)**:
- Old: Move first → Agent processes → If agent fails, session moved but metadata incomplete
- New: Agent processes → If success, atomic commit → Guaranteed consistency

## Benefits

1. **Consistency**: All commands use identical path patterns
2. **Robustness**: Transactional archival prevents data loss
3. **Maintainability**: Single source of truth for directory structure
4. **Recoverability**: Failed operations can be safely retried
5. **Alignment**: Closer to OpenSpec's clean three-layer model

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 12:39:23 +08:00
catlog22
d9fcdad949 refactor(workflow): migrate to sessions/ subdirectory structure
Refactor workflow directory structure to improve clarity and robustness by introducing dedicated sessions/ subdirectory for active sessions.

## Directory Structure Changes

### Before (Old Structure)
```
.workflow/
├── .active-WFS-session-1    # Marker files (fragile)
├── WFS-session-1/           # Active sessions mixed with config
├── WFS-session-2/
├── project.json
└── .archives/               # Archived sessions
```

### After (New Structure)
```
.workflow/
├── project.json             # Project metadata
├── sessions/                # [NEW] All active sessions
│   └── WFS-session-1/
└── archives/                # Archived sessions (removed dot prefix)
```

## Key Improvements

1. **Physical Isolation**: Active sessions now in dedicated sessions/ subdirectory
2. **No Marker Files**: Removed fragile .active-* marker file mechanism
3. **Directory-Based State**: Session state determined by directory location
   - In sessions/ = active
   - In archives/ = archived
4. **Simpler Discovery**: `ls .workflow/sessions/` instead of `find .workflow/ -name ".active-*"`
5. **Cleaner Root**: .workflow/ root now only contains project.json, sessions/, archives/

## Path Transformations

| Old Pattern | New Pattern |
|-------------|-------------|
| `find .workflow/ -name ".active-*"` | `find .workflow/sessions/ -name "WFS-*" -type d` |
| `.workflow/WFS-[slug]/` | `.workflow/sessions/WFS-[slug]/` |
| `.workflow/.archives/` | `.workflow/archives/` |
| `touch .workflow/.active-*` | *Removed* |
| `rm .workflow/.active-*` | *Removed* |

## Modified Commands

### session/start.md
- Update session creation path to .workflow/sessions/WFS-*/
- Remove .active-* marker file creation
- Update session discovery to use directory listing
- Updated all 3 modes: Discovery, Auto, Force New

### session/complete.md
- Update session move from sessions/ to archives/
- Remove .active-* marker file deletion
- Update manifest path to archives/manifest.json
- Update agent prompts with new paths

### status.md
- Update session discovery to find .workflow/sessions/
- Update all session file path references
- Update archive query examples

### execute.md
- Update session discovery logic
- Update all task file paths to include sessions/ prefix
- Update context package paths
- Update error handling documentation

## Benefits

- **Robustness**: Eliminates marker file state inconsistency risk
- **Clarity**: Clear separation between active and archived sessions
- **Simplicity**: Session discovery is straightforward directory listing
- **Alignment**: Closer to OpenSpec's three-layer structure (specs/changes/archive)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 11:34:52 +08:00
catlog22
2aacc34c24 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>
2025-11-18 11:21:35 +08:00
catlog22
4dafec7054 feat(workflow): add project-level state management with intelligent initialization
Implement comprehensive project.json system for tracking project state, completed features, and architecture overview.

## New Features

### 1. /workflow:init Command (NEW)
- Independent project initialization command using cli-explore-agent
- Deep Scan mode analyzes: technology stack, architecture, key components, metrics
- Generates project.json with comprehensive overview field
- Supports --regenerate flag to update analysis while preserving features
- One-time initialization with intelligent project cognition

### 2. Enhanced session:start
- Added Step 0: Check project.json existence before session creation
- Auto-calls /workflow:init if project.json missing
- Separated project-level vs session-level initialization responsibilities

### 3. Enhanced session:complete
- Added Phase 3: Update Project Feature Registry
- Extracts feature metadata from IMPL_PLAN.md
- Records completed sessions as features in project.json
- Includes: title, description, tags, timeline, traceability (archive_path, commit_hash)
- Auto-generates feature IDs and tags from implementation plans

### 4. Enhanced status Command
- Added --project flag for project overview mode
- Displays: technology stack, architecture patterns, key components, metrics
- Shows completed features with full traceability
- Provides query commands for feature exploration

### 5. Enhanced context-gather
- Integrated project.json reading in context-search-agent workflow
- Phase 1: Load project.json overview as foundational context
- Phase 3: Populate context-package.json from project.json
- Prioritizes project.json context for architecture and tech stack
- Avoids redundant project analysis on every planning session

## Data Flow
project.json (init) → context-gather → context-package.json → task-generation
session-complete → project.json (features registry)

## Benefits
- Single source of truth for project state
- Efficient context reuse across sessions
- Complete feature traceability and history
- Consistent architectural baseline for all workflows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 11:10:07 +08:00
catlog22
b4e09213e4 fix(installer): prevent deletion of current manifest in Bash version
Issue:
- In Bash version, new_install_manifest creates file immediately
- save_install_manifest calls remove_old_manifests_for_path
- This deletes ALL manifests for the path, including the new one
- Result: "WARNING: Failed to save installation manifest"

Solution:
- Add current_manifest_file parameter to remove_old_manifests_for_path
- Skip deletion if file matches current manifest
- Pass manifest_file to exclude it from deletion

Note: PowerShell version does not have this issue because it creates
the manifest file AFTER deleting old ones (hashtable → file conversion)
2025-11-17 22:51:14 +08:00
catlog22
3f7db2fdbc refactor(installer): implement manifest deduplication for same installation paths
- Add Remove-OldManifestsForPath function to automatically clean old manifests
- Modify Save-InstallManifest to remove old manifests before saving new one
- Update Get-AllInstallManifests to return only latest manifest per installation path
- Apply same strategy to both Install-Claude.ps1 (PowerShell) and Install-Claude.sh (Bash)

Benefits:
- Each installation location registers only once
- Only latest version manifest is retained
- Uninstall UI shows only latest version per location
- Prevents manifest file accumulation
2025-11-17 22:48:54 +08:00
catlog22
7bcf7f24a3 refactor(workflow): reorganize lite-plan and lite-execute docs for improved clarity
Restructure lite-plan.md (844→668 lines, -176) and lite-execute.md (597→569 lines, -28) following agent document patterns. Move Data Structures sections to end as reference, simplify repeated content, improve hierarchical organization. All original content preserved.

Key changes:
- Data Structures moved to end (from beginning)
- Simplified Execution Process to avoid duplication
- Improved section hierarchy and flow
- Consistent structure across both documents
v5.8.3
2025-11-17 22:10:44 +08:00
catlog22
0a6c90c345 refactor(lite-plan): remove timeout and color attributes for streamlined configuration 2025-11-17 22:05:29 +08:00
catlog22
4a0eef03a2 refactor(agents): reorganize cli-planning agent docs for improved clarity and consistency
Restructure cli-lite-planning-agent.md and cli-planning-agent.md following action-planning-agent.md's clear hierarchical pattern. Merge duplicate content, consolidate sections, and improve readability while preserving all original information.
2025-11-17 21:51:01 +08:00
catlog22
9cb9b2213b fix(lite-plan): correct executionContext.planObject.tasks type documentation
Issue found by Gemini analysis:
- executionContext.planObject.tasks was incorrectly documented as string[]
- Actual runtime structure is array of structured task objects (7 fields)
- This caused documentation mismatch between lite-plan and lite-execute

Fix:
- Update executionContext definition to show full task object structure
- Add comment clarifying it's an array of structured objects (7 fields each)
- Aligns with actual implementation and lite-execute consumption logic

Impact: Documentation only (no code changes, runtime behavior was already correct)
2025-11-17 20:58:51 +08:00
catlog22
0e21c0dba7 feat(lite-plan): upgrade task structure to detailed objects with implementation guidance
Major changes:
- Add cli-lite-planning-agent.md for generating structured task objects
- Upgrade planObject.tasks from string[] to structured objects with 7 fields:
  - title, file, action, description (what to do)
  - implementation (3-7 steps on how to do it)
  - reference (pattern, files, examples to follow)
  - acceptance (verification criteria)
- Update lite-execute.md to format structured tasks for Agent/Codex execution
- Clean up agent files: remove "how to call me" sections (cli-planning-agent, cli-explore-agent)
- Update lite-plan.md to use cli-lite-planning-agent for Medium/High complexity tasks

Benefits:
- Execution agents receive complete "how to do" guidance instead of vague descriptions
- Each task includes specific file paths, implementation steps, and verification criteria
- Clear separation of concerns: agents only describe what they do, not how they are called
- Architecture validated by Gemini: 100% consistency, no responsibility leakage

Breaking changes: None (backward compatible via task.title || task fallback in lite-execute)
2025-11-17 20:52:49 +08:00
catlog22
8e4e751655 fix(lite-plan): update user confirmation step to collect four inputs instead of three 2025-11-17 18:38:44 +08:00
catlog22
6ebb1801d1 feat(lite-plan): add detailed data structures and enhanced task JSON export for improved planning context 2025-11-17 17:06:13 +08:00
catlog22
0380cbb7b8 feat(lite-execute, lite-plan): store original user input for enhanced task execution context 2025-11-17 16:34:23 +08:00
catlog22
85ef755c12 feat(lite-execute): add new command for executing tasks with in-memory plans and flexible input modes 2025-11-17 16:16:15 +08:00
catlog22
a5effb9784 refactor(intelligent-tools): clarify write permission and session resume instructions 2025-11-16 23:16:16 +08:00
catlog22
1d766ed4ad fix(lite-plan): clarify executionId definition and tracking flow
Changes:
1. Initialize previousExecutionResults array in Step 5.1
2. Add id field to executionCalls objects (format: [Method-Index])
3. Add execution loop structure in Step 5.2 showing sequential processing
4. Clarify executionId comes from executionCalls[currentIndex].id
5. Add comments explaining ID storage for result collection

Benefits:
- Clear definition of where executionId comes from
- Explicit initialization of tracking variables
- Better understanding of execution flow and result collection
- Proper context continuity across multiple execution calls
2025-11-16 23:14:21 +08:00
catlog22
fe0d30256c feat(lite-plan): enhance execution context continuity for multi-call scenarios
Improvements:
1. Add plan summary in confirmation question for quick review
2. Add previousExecutionResults tracking for multi-execution flows
3. Include execution result collection mechanism after each call
4. Update both Agent and Codex execution prompts with context continuity

Benefits:
- Subsequent executions can see what previous calls completed
- Avoid duplicate work across multiple execution calls
- Better dependency management and task flow
- Clear context propagation: executionId, status, tasks, outputs, notes
v5.8.2
2025-11-16 23:10:18 +08:00
catlog22
1c416b538d refactor(lite-plan): separate plan display from user confirmation in Phase 4
Change Phase 4 confirmation flow from single-step to two-step process:
- Step 4.1: Display complete plan as readable text output
- Step 4.2: Collect three-dimensional input via AskUserQuestion

Benefits:
- Clearer plan presentation (not embedded in question)
- Simpler question interface focused on user decisions
- Better user experience with logical separation
2025-11-16 22:56:48 +08:00
catlog22
81362c14de refactor(lite-plan): enhance execution call tracking and user interaction clarity 2025-11-16 21:52:09 +08:00
catlog22
fa6257ecae refactor(lite-plan): streamline planning execution guidelines and enhance user confirmation process 2025-11-16 21:35:47 +08:00
catlog22
ccb4490ed4 refactor(cli-tools): remove redundant model parameters for improved command clarity 2025-11-16 21:11:16 +08:00
catlog22
58206f1996 refactor(lite-plan): update execution method options for clarity and complexity-based selection 2025-11-16 21:03:16 +08:00
catlog22
564bcb72ea refactor(lite-plan): simplify command format for Codex and Qwen by removing redundant parameters 2025-11-16 20:58:25 +08:00
catlog22
965a80b54e docs: Release v5.8.1 - Lite-Plan Workflow & CLI Tools Enhancement
Major Features:
- Add /workflow:lite-plan - Lightweight interactive planning workflow
  - Three-dimensional multi-select confirmation
  - Smart code exploration with auto-detection
  - Parallel task execution support
  - Flexible execution (Agent/CLI) with optional code review
- Optimize CLI tools - Remove -m parameter requirement
  - Auto-model-selection for Gemini, Qwen, Codex
  - Updated models: gpt-5.1, gpt-5.1-codex, gpt-5.1-codex-mini

Documentation Updates:
- Update README.md with Lite-Plan usage examples
- Update README_CN.md (Chinese translation)
- Add /workflow:lite-plan to COMMAND_SPEC.md
- Add /workflow:lite-plan to COMMAND_REFERENCE.md
- Update CHANGELOG.md with v5.8.1 release notes
- Update intelligent-tools-strategy.md with model selection guidelines

See CHANGELOG.md for full details.
v5.8.1
2025-11-16 20:50:10 +08:00
catlog22
8f55bf2ece refactor(intelligent-tools-strategy): remove optional model parameter for improved command clarity and auto-selection guidance 2025-11-16 20:41:39 +08:00
catlog22
a721c50ba3 refactor(lite-plan): enhance three-dimensional confirmation to support multi-select interactions for task approval, execution method, and code review tool 2025-11-15 19:59:38 +08:00
catlog22
4a5c8490b1 refactor(cli-explore-agent): update color scheme from blue to yellow for improved visibility 2025-11-15 18:17:08 +08:00
catlog22
2f0ca988f4 refactor(lite-plan): enhance confirmation process with three-dimensional user interaction and optional code review 2025-11-15 18:13:10 +08:00
catlog22
a45f5e9dc2 refactor(lite-plan): enhance task dependency management and introduce parallel execution guidelines 2025-11-15 17:57:11 +08:00
catlog22
b8dc3018d4 refactor(lite-plan): enhance argument hints and clarify exploration flags in documentation 2025-11-15 17:39:28 +08:00
catlog22
9d4c9ef212 refactor(execute): clarify resume mode description and enhance error handling details 2025-11-15 17:03:35 +08:00
catlog22
d7ffd6ee32 refactor(execute): streamline execution phases and enhance lazy loading strategy 2025-11-15 16:50:51 +08:00
catlog22
02ee426af0 Refactor UI Design Commands: Replace /workflow:ui-design:update with /workflow:ui-design:design-sync
- Deleted the `list` command for design runs.
- Removed the `update` command and its associated documentation.
- Introduced `design-sync` command to synchronize finalized design system references to brainstorming artifacts.
- Updated command references in `COMMAND_REFERENCE.md`, `GETTING_STARTED.md`, and `GETTING_STARTED_CN.md` to reflect the new command structure.
- Ensured all related documentation and output styles are consistent with the new command naming and functionality.
2025-11-15 16:30:40 +08:00
catlog22
e76e5bbf5c refactor(enhance-prompt): update description and streamline enhancement pipeline by removing codebase analysis references 2025-11-15 16:19:36 +08:00
catlog22
763c51cb28 refactor(workflow): remove redundant key characteristics and usage examples from lite-plan documentation 2025-11-15 16:13:08 +08:00
catlog22
c7542d95c8 refactor(memory): streamline SKILL.md usage instructions and remove redundant references 2025-11-15 11:22:01 +08:00
catlog22
02bf6e296c feat(memory): enhance SKILL.md template by adding comprehensive jq usage guide and improving package overview 2025-11-15 11:12:23 +08:00
catlog22
f839a3afb8 refactor(memory): remove outdated template file references from style-skill-memory documentation 2025-11-15 11:05:38 +08:00
catlog22
79714edc9a fix(memory): update path to skill-md-template.md for accurate template processing 2025-11-15 10:16:44 +08:00
catlog22
f9c33bd0ba Add SKILL.md template for Style Memory Package with comprehensive jq usage guide and design principles 2025-11-15 10:09:45 +08:00
catlog22
e4a29c0b2e feat(memory): enhance style-skill-memory process by adding design system analysis and dynamic principle generation 2025-11-14 23:53:12 +08:00
catlog22
ca18043b14 feat(memory): optimize style-skill-memory process by simplifying data extraction and enhancing documentation clarity 2025-11-14 23:29:54 +08:00
catlog22
871a02c1f8 feat(memory): enhance style-skill-memory documentation with design principles and jq usage guide 2025-11-14 23:14:53 +08:00
catlog22
3747a7b083 feat(memory): optimize SKILL.md generation with concise structure and embedded jq commands 2025-11-14 15:43:23 +08:00
catlog22
c05dbb2791 docs(skill): update command guide for v5.8.0 release
Major updates:
- Add UI Design Style Memory workflow documentation
  - /memory:style-skill-memory command
  - /workflow:ui-design:codify-style orchestrator
  - /workflow:ui-design:reference-page-generator
- Add /workflow:lite-plan intelligent planning command (testing)
- Add /memory:code-map-memory code flow mapping (testing)

Agent enhancements:
- Add cli-explore-agent for code exploration
- Enhance cli-planning-agent task generation
- Major ui-design-agent refactoring

Statistics:
- Commands: 69 → 75 (+6)
- Agents: 11 → 13 (+2)
- Reference docs: 80 → 88 files

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
v5.8.0
2025-11-12 21:33:23 +08:00
catlog22
167034aaa7 feat(workflow): add --style-skill parameter for enhanced UI design capabilities 2025-11-12 21:27:00 +08:00
catlog22
a8e8412477 feat(agents): add cli-explore-agent and enhance workflow documentation
Add new cli-explore-agent for code structure analysis and dependency mapping:
- Dual-source strategy (Bash + Gemini CLI) for comprehensive code exploration
- Three analysis modes: quick-scan, deep-scan, dependency-map
- Language-agnostic support (TypeScript, Python, Go, Java, Rust)

Enhance lite-plan workflow documentation:
- Clarify agent call prompts with structured return formats
- Add expected return structures for cli-explore-agent and cli-planning-agent
- Simplify AskUserQuestion usage with clearer examples
- Document data flow between workflow phases

Add code-map-memory command:
- Generate Mermaid code flow diagrams from feature keywords
- Create SKILL packages for code understanding
- Auto-continue workflow with phase skipping

Improve UI design system:
- Add theme colors guide to ui-design-agent
- Enhance code import workflow documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-12 21:13:42 +08:00
catlog22
158df6acfa feat(workflow): add lite-plan command for intelligent task planning and execution 2025-11-12 20:11:11 +08:00