80 Commits

Author SHA1 Message Date
Ran Aroussi
3c8e0e7f67 Fix: Resolve bash command truncation and syntax errors (#958)
* fix: resolve bash command truncation and syntax errors

- Convert long one-liner bash commands to multiline format to prevent truncation
- Fix awk syntax errors in epic-sync.md (replace literal \n with proper newlines)
- Add missing directory separators in file path patterns
- Replace chained && operators with proper if-then blocks
- Break down complex pipe chains into step-by-step operations

Key changes:
* ccpm/scripts/pm/*.sh: Convert complex dependency parsing from one-liners to readable multiline blocks
* ccpm/ccpm.config: Break down repository URL processing into clear steps
* ccpm/commands/pm/epic-sync.md: Fix awk print statements for proper newline handling

Fixes command truncation errors like:
- Error: (eval):1: parse error near ')'
- awk: syntax error at source line 1
- command not found: !

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: additional bash syntax fixes in command documentation

- epic-merge.md: Convert complex nested commands to multiline format
  - Fix feature list generation with proper error handling
  - Break down epic issue number extraction
  - Add proper file existence checks
- epic-refresh.md: Fix task issue extraction with error handling
- epic-sync.md: Re-fix awk syntax for proper newline handling
- test-runner.md: Remove MUXI-specific reference

Prevents additional command truncation in:
- Complex subshell operations with cd and loops
- Chained grep operations for GitHub issue extraction
- Nested command substitution patterns

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address CodeRabbit feedback on dependency parsing and SSH URL handling

- ccpm.config: Add support for ssh://git@github.com/ and ssh://github.com/ URL schemes
  - Ensures all GitHub URL variants are properly normalized
- All PM scripts: Fix dependency parsing to handle whitespace-only cases
  - Trim leading/trailing whitespace after bracket removal
  - Properly handle empty dependency lists like "depends_on: [ ]"
  - Normalize whitespace-only strings to empty strings
  - Prevents false positive dependency detection

Fixes issues where:
- SSH URLs starting with ssh://git@github.com/ would fail parsing
- Empty dependency arrays with whitespace were treated as non-empty
- Tasks with "depends_on: [ ]" were incorrectly blocked

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-24 22:32:39 +01:00
Ran Aroussi
1cb9483a74 fix: resolve bash syntax errors in ccpm command files
- Fix sed regex patterns that caused parse errors in eval contexts
- Replace problematic \( \) regex groups with pipe-friendly sed commands
- Convert {variable} template placeholders to ${variable} bash syntax
- Ensure all bash code blocks pass syntax validation

This resolves the "parse error near ')'" issues encountered when
ccpm executes bash commands from command files.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 21:01:54 +01:00
Ran Aroussi
22b311fe7e Merged main back into rc
commit abf5bed203a9ac13579eac7c9299deee3b9c50c6
Author: Ran Aroussi <ranaroussi@users.noreply.github.com>
Date:   Wed Sep 24 18:46:43 2025 +0100

    Refactor Bash command patterns in settings

commit 1cc603ee2df72eb47b61df04b156dfadb70b5b58
Author: Ran Aroussi <ran@aroussi.com>
Date:   Wed Sep 24 15:23:43 2025 +0100

    Remove outdated Chinese documentation files for agents, commands, and README to streamline project resources.

commit 34d7e724e8159d5ec4aa6365940f355d8ed02872
Author: Ran Aroussi <ranaroussi@users.noreply.github.com>
Date:   Wed Sep 24 15:23:17 2025 +0100

    Revise README with new badge links and documentation

    Updated links and added Chinese documentation reference.

commit 0026086f7a118fd3c46161cde5becf52939ee6be
Author: Ran Aroussi <ranaroussi@users.noreply.github.com>
Date:   Wed Sep 24 15:17:22 2025 +0100

    RC => Main (stability and usability) (#954)

    * feat: Add automatic worktree directory fix via pre-tool-use hook

    Problem: Bash tool resets to main project directory after every command,
      breaking worktree operations for parallel agent development.

      Solution: Pre-tool-use hook that automatically detects worktree context
      and injects 'cd /path/to/worktree && ' prefix to all Bash commands.

      Features:
      - Zero-config: Agents don't need special instructions or awareness
      - Smart detection: Distinguishes worktrees (.git file) from repos (.git dir)
      - Edge case handling: Background processes, pipes, env vars, etc.
      - Debug mode: CLAUDE_HOOK_DEBUG=true for troubleshooting
      - Skip patterns: Avoids double-prefixing and unnecessary injections

      This enables true parallel development with multiple agents in different
      worktrees without any manual command prefixing or documentation burden.

      Tested via shell-shocked test suite: All 7 stress test scenarios passed.

      Or if you prefer a shorter version:

      feat: Auto-fix Bash tool worktree directory reset issue

      Implements pre-tool-use hook that transparently injects 'cd /worktree && '
      prefix when operating in git worktrees. Handles background processes, pipes,
      and other edge cases. Agents need zero awareness of the fix.

      Enables parallel multi-agent development in worktrees without manual prefixing.

    * fix: script name in hooks README file

    * fix: make bash-worktree-fix POSIX-compliant

    * Update .claude/hooks/config.json

    Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

    * fix: improve bash worktree hook robustness and documentation

    - Fix critical bugs in worktree detection and command parsing:
      * Distinguish between git worktrees and submodules (check for /worktrees/ in gitdir path)
      * Fix TAB pattern bug using proper tokenization instead of brittle globbing
      * Fix overly broad dot-prefix skip that broke ./script.sh execution
      * Add proper path quoting to handle spaces and special characters
      * Capture all arguments with $* instead of just $1

    - Improve documentation:
      * Remove personal paths from examples
      * Restructure troubleshooting steps for clarity
      * Switch from jq to python -m json.tool for wider compatibility
      * Clarify that hook config goes in main .claude/settings.json

    - Simplify configuration:
      * Remove redundant config.json
      * Add settings.json.example showing proper integration
      * Fix background process detection for both "cmd &" and "cmd&" patterns

    These changes prevent false positives on commands like "cdbuild", ensure
    relative scripts work in worktrees, and handle paths with spaces correctly.

    * docs: fix a path in the instructions for how to enable the bash worktree fix hook

    * fix: harden bash worktree hook against security vulnerabilities

    Security and robustness improvements to prevent shell injection and edge cases:

    - Prevent pathname expansion attacks by disabling globbing during tokenization
      * Commands like "echo *" no longer expand before parsing
    - Fix absolute path detection for environment-prefixed commands
      * Now correctly handles "VAR=1 /usr/bin/make" patterns
    - Implement secure path quoting using single quotes with proper escaping
      * Handles paths containing quotes, spaces, and special characters
    - Optimize .git file reading using shell built-ins instead of cat
      * Avoids subshell and only reads first line for efficiency
    - Improve debug mode to accept multiple truthy values (true/TRUE/1/yes/YES)
    - Add ShellCheck compliance with consistent variable bracing and default cases

    The hook now safely handles edge cases like:
    - Paths with single quotes: /path/to/joe's-project/
    - Commands with wildcards that shouldn't expand
    - Mixed environment variables and absolute paths

    All changes maintain POSIX compatibility while significantly improving
    security posture and reliability.

    * refactor: improve worktree hook robustness and portability

      Major improvements to the bash worktree fix hook for better reliability:

      Validation & Safety:
      - Add gitdir path validation to verify the directory actually exists
      - Normalize relative gitdir paths to absolute for proper resolution
      - Add pwd directory check to handle edge cases
      - Use dirname with -- flag for safer path handling

      Portability:
      - Replace echo with printf throughout for consistent behavior
      - Use literal space/tab characters instead of [:space:] for POSIX compatibility
      - Rename shell_quote to shell_squote for clarity
      - Maintain set -f protection during pattern matching

      Simplification:
      - Streamline skip detection logic with cleaner patterns
      - Consolidate builtin command checks into single case statement
      - Remove unnecessary comments while keeping essential documentation
      - Cleaner whitespace detection using portable pattern

      The hook now properly validates that gitdir paths exist before treating
      them as worktrees, preventing false positives. Pattern matching is more
      portable across different POSIX shells, and printf usage eliminates
      echo's platform-specific quirks.

      All security improvements are retained: pathname expansion protection,
      proper single-quote escaping, and safe handling of background processes.

    * fix: restore [:space:] patterns and handle CRLF line endings

    Critical fixes and improvements to the bash worktree hook:

    Bug Fixes:
    - Handle CRLF line endings in .git files (Windows compatibility)
      * Strip trailing CR characters that break gitdir path parsing
    - Restore [:space:] character class for better Unicode support
      * Literal space/tab was too restrictive for international locales
    - Remove absolute path skip logic that broke many commands
      * Commands like `/usr/bin/npm install` still need correct cwd
      * Only skip builtins and commands that truly don't need directory context

    Performance:
    - Add fast-path exit when not in a worktree
      * Avoids unnecessary skip checks for common case
    - Remove redundant set -f globbing protection
      * Pattern matching doesn't trigger pathname expansion in case statements

    Clarity:
    - Streamline comments to be more concise
    - Quote original_command consistently
    - Better explain why absolute paths aren't skipped

    The hook now correctly handles Windows-created .git files with CRLF
    endings and properly supports all absolute-path commands that depend
    on the current working directory (which is most of them).

    * revert: remove dirname -- flag for broader compatibility

      Remove the '--' end-of-options flag from dirname command as it's not
      universally supported across all POSIX implementations. While '--' is
      good practice for handling filenames starting with dashes, dirname
      rarely encounters such edge cases in practice, and the compatibility
      issue is more pressing.

      Some older or minimal POSIX shells don't recognize '--' with dirname,
      causing the script to fail. Since we're already in a controlled loop
      walking up directory paths that come from pwd, the risk of dash-prefixed
      paths is negligible.

      Trade-off: Prioritizing compatibility over theoretical edge case protection.

    * Enhance context creation with comprehensive language detection

    Expand project detection capabilities to support 20+ programming languages and frameworks:

    - Add detection for JavaScript/TypeScript, Python (pyproject.toml), Java (Maven/Gradle),
      C#/.NET, Ruby, PHP, Dart/Flutter, Swift (including Xcode projects), C/C++, and Docker
    - Extend file type detection to include .ts, .jsx, .tsx, .kt, .cs, .rb, .php, .swift,
      .dart, .c, .h, .cpp, .hpp, and .sh files
    - Improve test detection to find both test directories and test files with common
      naming patterns (*test.*, *spec.*, test_*.*, *_test.*)
    - Exclude hidden directories in test detection for better performance

    This enhancement enables more accurate project analysis and better context creation
    across diverse development environments and technology stacks.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * Expand comprehensive programming language support across all project components

    Complete systematic enhancement of language detection and build system support,
    following the comprehensive approach established in context/create.md:

    **Testing Framework Detection (.claude/commands/testing/prime.md):**
    - Add detection for PHP (PHPUnit, Pest), C#/.NET (MSTest, NUnit, xUnit),
      Java (JUnit/Maven/Gradle), Kotlin, Swift (XCTest), Dart/Flutter,
      C/C++ (GoogleTest, Catch2), Ruby (RSpec, Minitest)
    - Expand framework-specific configurations with proper commands and options
    - Add comprehensive dependency checking for all package managers
    - Include installation commands for all build systems (composer, mvn, gradle,
      dotnet, bundle, flutter, swift, ctest)
    - Add test file discovery patterns for all languages

    **Context Management Enhancement:**
    - Update dependency change detection in context/update.md for 11 build systems
    - Enhance context/prime.md project file analysis beyond basic detection
    - Maintain consistency with context/create.md comprehensive language support

    **Build System Integration:**
    - Expand pm/epic-merge.md test commands from 2 to 12 build systems
    - Add Maven, Gradle, Composer, .NET, Cargo, Go, Flutter, Swift, CMake support
    - Enable automated testing across all major development ecosystems

    **Infrastructure Support:**
    - Add bash permissions for 10 additional build tools in settings.local.json
    - Update process cleanup in test-execution.md and testing/run.md for all frameworks
    - Ensure consistent cross-language development workflow support

    This enhancement enables full development lifecycle support for 20+ programming
    languages and frameworks, providing consistent project detection, dependency
    management, testing, and build capabilities across diverse technology stacks.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * Complete comprehensive programming language expansion with final enhancements

    Add final layer of language support improvements across infrastructure components:

    **Multi-Language Test Script (.claude/scripts/test-and-log.sh):**
    - Transform Python-only script to support 10+ languages and frameworks
    - Add intelligent test framework detection: Python (pytest), JavaScript/TypeScript
      (npm test, jest), Java (Maven, Gradle), C# (.NET), Ruby (RSpec), PHP (PHPUnit),
      Go, Rust, Swift, Dart/Flutter
    - Automatic file extension detection with appropriate test runner selection
    - Enhanced usage examples showing multi-language support

    **AST-Grep Language Reference (.claude/rules/use-ast-grep.md):**
    - Expand supported languages list from basic to comprehensive 50+ languages
    - Organize by categories: Primary Languages, Web & Markup, Configuration & Data,
      Shell & Scripts, and specialty languages
    - Add specific language codes for JavaScript/TypeScript variants, C/C++/C#,
      web frameworks (Vue, Svelte), and configuration formats (YAML, TOML, XML)

    **Issue Analysis Enhancement (.claude/commands/pm/issue-analyze.md):**
    - Generalize package.json references to support all project configuration files
    - Include build system coordination for Maven, Gradle, CMake, etc.

    **Test Runner Agent (.claude/agents/test-runner.md):**
    - Replace pytest-specific fallback with comprehensive multi-language fallback
    - Support framework detection and execution for all major testing ecosystems

    These enhancements complete the comprehensive language support initiative,
    ensuring consistent multi-language development workflow capabilities across
    all system components, from project detection to testing execution.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * Fix ast-grep supported languages list to match official documentation

    Correct the ast-grep language support documentation to accurately reflect
    the actual 25 languages supported according to ast-grep.github.io:

    **Removed unsupported languages:**
    - Dart (not actually supported by ast-grep)
    - Vue, Svelte (framework-specific, not core languages)
    - SCSS, SASS, LESS (CSS preprocessors not supported)
    - TOML, XML (not in official support list)
    - PowerShell, shell variants beyond bash
    - OCaml and other languages incorrectly listed

    **Corrected to official 25 languages:**
    - System: C, C++, C#, Go, Rust
    - Web: JavaScript (js/jsx), TypeScript (ts), TSX, HTML, CSS, PHP
    - General: Python, Java, Kotlin, Ruby, Swift, Scala, Lua, Elixir, Haskell
    - Config: JSON, YAML
    - Other: Bash, Nix, Solidity

    **Updated examples:**
    - Use correct language aliases (js instead of javascript, ts instead of typescript)
    - Align with actual ast-grep command patterns

    This ensures accurate guidance for developers using ast-grep integration
    and prevents errors from referencing unsupported language identifiers.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * Fix spelling error in README.md (#608)

    Bit of an inane PR but 🤷

    * Fix path to install script in README.md (#570)

    * Add Chinese documentation and fix typo (#676)

    - Add Chinese documentation links in README.md, COMMANDS.md, and AGENTS.md
    - Fix typo: 'mutiple' -> 'multiple' in README.md
    - Include new Chinese documentation files in doc/ directory

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

    Co-authored-by: Claude <noreply@anthropic.com>

    * Fix: Prevent local file paths exposure in GitHub issue comments (#631)

    * Fix privacy issue: Add path standards validation and normalization

    - Add .claude/rules/path-standards.md with comprehensive path usage guidelines
    - Add .claude/scripts/check-path-standards.sh for automated validation
    - Add .claude/scripts/fix-path-standards.sh for automatic path normalization
    - Add documentation for path standards tools

    Addresses issue #630: Prevents local file paths from being exposed
    in GitHub issue comments, maintaining privacy and portability.

    Features:
    - Automatic detection of absolute path violations
    - Safe path normalization with backup support
    - Comprehensive validation with colored output
    - CI/CD integration ready
    - Cross-platform support (Unix/Windows paths)

    Author: Zephyr <zephyrTang@aliyun.com>

    * Fix PR feedback: Improve scripts and documentation

    - Enhanced shell error handling with 'set -Eeuo pipefail'
    - Fixed Windows path patterns in regex expressions
    - Added exclusions for rules and backup files to prevent false positives
    - Converted all Chinese text to English in documentation
    - Corrected path examples in standards documentation
    - Improved script robustness and cross-platform compatibility

    Addresses feedback from CodeRabbit AI and GitHub Copilot reviews.

    Author: Zephyr <zephyrTang@aliyun.com>

    * Polish: Final micro-optimizations for PR feedback

    - Fixed grammar issues in path-tools-README.md per LanguageTool feedback
    - Corrected path transformation examples in path-standards.md to match actual implementation
    - Ensured consistency between documentation examples and script behavior
    - Minor improvements for production-ready code quality

    All CodeRabbit AI and GitHub Copilot feedback addressed.

    Author: Zephyr <zephyrTang@aliyun.com>

    ---------

    Co-authored-by: dengzefeng <zephyr@shopline.com>

    * Fix: Ensure GitHub issues are created in correct repository (#532)

    - Add explicit --repo flag to all gh issue create commands
    - Create repository detection configuration file
    - Handle both SSH and HTTPS git remote formats
    - Add validation and error handling for repository detection

    This prevents issues from being created in automazeio/ccpm instead of the user's actual repository.

    Co-authored-by: jodagreyhame <jodagreyhame@users.noreply.github.com>

    * Major Cleanup & Issue Resolution - 2025-01-24 (#953)

    * feat: Major cleanup and issue resolution - 2025-01-24 release

     NEW FEATURES:
    - Add comprehensive LOCAL_MODE.md guide for offline workflow
    - Auto-create GitHub labels (epic, task) during init
    - Modernize PM command syntax with !bash pattern
    - Add context accuracy safeguards with self-verification
    - Create comprehensive CHANGELOG.md documentation

    🔧 IMPROVEMENTS:
    - Update 4 core PM commands to use efficient !bash syntax
    - Enhance init.sh with automatic GitHub label creation
    - Document context accuracy improvements in CONTEXT_ACCURACY.md
    - Streamline command definitions for better token efficiency

    📊 IMPACT:
    - Resolves 10+ GitHub issues with comprehensive solutions
    - Enables true local-only development workflow
    - Reduces AI hallucination in context generation
    - Improves Claude Code compatibility and performance

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * fix: improve GitHub detection and error handling in init.sh

    Address GitHub Copilot feedback for better robustness:

    🔧 IMPROVED REPOSITORY DETECTION:
    - Replace string matching with `gh repo view` for robust detection
    - Handles SSH URLs, GitHub Enterprise, and edge cases properly
    - Graceful fallback for non-GitHub repositories

    🛡️ ENHANCED ERROR HANDLING:
    - Replace silent failures with meaningful user feedback
    - Track label creation success/failure individually
    - Check for existing labels before reporting errors
    - Clear status messages: success, partial, or failure

    🧪 TESTED:
    - Bash syntax validation passed
    - Repository detection logic verified
    - Error handling scenarios tested

    Addresses high and medium priority feedback from Copilot review.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    ---------

    Co-authored-by: Claude <noreply@anthropic.com>

    * Complete Directory Restructure & PM Command Modernization

    - Restructure from .claude/ to ccpm/ directory
    - Update all PM commands to use !bash execution syntax
    - Modernize command frontmatter for better token efficiency
    - Complete the missing directory restructuring from previous PRs

    This completes the architectural shift to the ccpm/ template structure.

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * fix: correct script paths from .claude/ to ccpm/ in all PM commands

    All PM commands now properly reference ccpm/scripts/pm/ instead of
    the old .claude/scripts/pm/ paths. This completes the directory
    restructure that was partially implemented.

    - Fixed 28 script path references across all PM command files
    - Commands now correctly point to ccpm/scripts/pm/ location
    - Resolves issue where PM commands couldn't find their scripts

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

    Co-Authored-By: Claude <noreply@anthropic.com>

    * Update installation script URLs in README files

    - Changed installation script URLs from GitHub raw links to direct links at automaze.io for improved reliability.
    - Updated both English and Chinese README files to reflect the new URLs.
    - Ensured consistency across Unix/Linux/macOS and Windows installation instructions.

    This change enhances the user experience by providing a more stable source for installation scripts.

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

    * Update installation script URLs in README files to point to the new install path

    - Changed installation script URLs from the old path to the new `/install` path for improved clarity and reliability.
    - Updated both English and Chinese README files to reflect the new URLs.
    - Ensured consistency across Unix/Linux/macOS and Windows installation instructions.

    This change enhances the user experience by providing a clear and stable source for installation scripts.

    ---------

    Co-authored-by: James Ross <james@flyingrobots.dev>
    Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
    Co-authored-by: Steven <tseven@gmail.com>
    Co-authored-by: Claude <noreply@anthropic.com>
    Co-authored-by: Connor Adams <connorads@users.noreply.github.com>
    Co-authored-by: Stefan Legg <legg.stefan@gmail.com>
    Co-authored-by: cyxer000 <48980829+cyxer000@users.noreply.github.com>
    Co-authored-by: Aka mo <56784262+ZephyrDeng@users.noreply.github.com>
    Co-authored-by: dengzefeng <zephyr@shopline.com>
    Co-authored-by: jodagreyhame <66655312+jodagreyhame@users.noreply.github.com>
    Co-authored-by: jodagreyhame <jodagreyhame@users.noreply.github.com>
2025-09-24 18:50:01 +01:00
Ran Aroussi
44d7dc369e Update installation script URLs in README files to point to the new install path
- Changed installation script URLs from the old path to the new `/install` path for improved clarity and reliability.
- Updated both English and Chinese README files to reflect the new URLs.
- Ensured consistency across Unix/Linux/macOS and Windows installation instructions.

This change enhances the user experience by providing a clear and stable source for installation scripts.
2025-09-24 15:15:30 +01:00
Ran Aroussi
a6817d39a3 Update installation script URLs in README files
- Changed installation script URLs from GitHub raw links to direct links at automaze.io for improved reliability.
- Updated both English and Chinese README files to reflect the new URLs.
- Ensured consistency across Unix/Linux/macOS and Windows installation instructions.

This change enhances the user experience by providing a more stable source for installation scripts.

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-09-24 15:07:50 +01:00
Ran Aroussi
3d444f0aaa fix: correct script paths from .claude/ to ccpm/ in all PM commands
All PM commands now properly reference ccpm/scripts/pm/ instead of
the old .claude/scripts/pm/ paths. This completes the directory
restructure that was partially implemented.

- Fixed 28 script path references across all PM command files
- Commands now correctly point to ccpm/scripts/pm/ location
- Resolves issue where PM commands couldn't find their scripts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:59:51 +01:00
Ran Aroussi
e0fc1a8a83 Complete Directory Restructure & PM Command Modernization
- Restructure from .claude/ to ccpm/ directory
- Update all PM commands to use !bash execution syntax
- Modernize command frontmatter for better token efficiency
- Complete the missing directory restructuring from previous PRs

This completes the architectural shift to the ccpm/ template structure.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:55:54 +01:00
Ran Aroussi
4d4f88868e Major Cleanup & Issue Resolution - 2025-01-24 (#953)
* feat: Major cleanup and issue resolution - 2025-01-24 release

 NEW FEATURES:
- Add comprehensive LOCAL_MODE.md guide for offline workflow
- Auto-create GitHub labels (epic, task) during init
- Modernize PM command syntax with !bash pattern
- Add context accuracy safeguards with self-verification
- Create comprehensive CHANGELOG.md documentation

🔧 IMPROVEMENTS:
- Update 4 core PM commands to use efficient !bash syntax
- Enhance init.sh with automatic GitHub label creation
- Document context accuracy improvements in CONTEXT_ACCURACY.md
- Streamline command definitions for better token efficiency

📊 IMPACT:
- Resolves 10+ GitHub issues with comprehensive solutions
- Enables true local-only development workflow
- Reduces AI hallucination in context generation
- Improves Claude Code compatibility and performance

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: improve GitHub detection and error handling in init.sh

Address GitHub Copilot feedback for better robustness:

🔧 IMPROVED REPOSITORY DETECTION:
- Replace string matching with `gh repo view` for robust detection
- Handles SSH URLs, GitHub Enterprise, and edge cases properly
- Graceful fallback for non-GitHub repositories

🛡️ ENHANCED ERROR HANDLING:
- Replace silent failures with meaningful user feedback
- Track label creation success/failure individually
- Check for existing labels before reporting errors
- Clear status messages: success, partial, or failure

🧪 TESTED:
- Bash syntax validation passed
- Repository detection logic verified
- Error handling scenarios tested

Addresses high and medium priority feedback from Copilot review.

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-24 14:47:09 +01:00
jodagreyhame
23616e7ab6 Fix: Ensure GitHub issues are created in correct repository (#532)
- Add explicit --repo flag to all gh issue create commands
- Create repository detection configuration file
- Handle both SSH and HTTPS git remote formats
- Add validation and error handling for repository detection

This prevents issues from being created in automazeio/ccpm instead of the user's actual repository.

Co-authored-by: jodagreyhame <jodagreyhame@users.noreply.github.com>
2025-09-24 10:49:02 +01:00
Aka mo
d6453fa674 Fix: Prevent local file paths exposure in GitHub issue comments (#631)
* Fix privacy issue: Add path standards validation and normalization

- Add .claude/rules/path-standards.md with comprehensive path usage guidelines
- Add .claude/scripts/check-path-standards.sh for automated validation
- Add .claude/scripts/fix-path-standards.sh for automatic path normalization
- Add documentation for path standards tools

Addresses issue #630: Prevents local file paths from being exposed
in GitHub issue comments, maintaining privacy and portability.

Features:
- Automatic detection of absolute path violations
- Safe path normalization with backup support
- Comprehensive validation with colored output
- CI/CD integration ready
- Cross-platform support (Unix/Windows paths)

Author: Zephyr <zephyrTang@aliyun.com>

* Fix PR feedback: Improve scripts and documentation

- Enhanced shell error handling with 'set -Eeuo pipefail'
- Fixed Windows path patterns in regex expressions
- Added exclusions for rules and backup files to prevent false positives
- Converted all Chinese text to English in documentation
- Corrected path examples in standards documentation
- Improved script robustness and cross-platform compatibility

Addresses feedback from CodeRabbit AI and GitHub Copilot reviews.

Author: Zephyr <zephyrTang@aliyun.com>

* Polish: Final micro-optimizations for PR feedback

- Fixed grammar issues in path-tools-README.md per LanguageTool feedback
- Corrected path transformation examples in path-standards.md to match actual implementation
- Ensured consistency between documentation examples and script behavior
- Minor improvements for production-ready code quality

All CodeRabbit AI and GitHub Copilot feedback addressed.

Author: Zephyr <zephyrTang@aliyun.com>

---------

Co-authored-by: dengzefeng <zephyr@shopline.com>
2025-09-24 10:47:06 +01:00
cyxer000
50f3ec8644 Add Chinese documentation and fix typo (#676)
- Add Chinese documentation links in README.md, COMMANDS.md, and AGENTS.md
- Fix typo: 'mutiple' -> 'multiple' in README.md
- Include new Chinese documentation files in doc/ directory

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-24 10:42:00 +01:00
Stefan Legg
3f3bce2748 Fix path to install script in README.md (#570) 2025-09-24 10:41:56 +01:00
Connor Adams
0f6f0bbdd0 Fix spelling error in README.md (#608)
Bit of an inane PR but 🤷
2025-09-24 10:41:52 +01:00
Ran Aroussi
084489debb Merge pull request #516 from tseven/more_context_langs
Add comprehensive multi-language development support
2025-08-28 16:23:43 +01:00
Ran Aroussi
ccdec26503 Merge branch 'rc' into more_context_langs 2025-08-28 16:23:30 +01:00
Ran Aroussi
190b0236a6 Merge pull request #76 from flyingrobots/main
fix: Add automatic worktree support for Bash tool directory reset issue
2025-08-28 16:08:47 +01:00
Ran Aroussi
d01e80af9b Merge pull request #513 from trentschnee/patch-1
docs(broke-star-link): Update README.md
2025-08-27 21:43:42 +01:00
Ran Aroussi
4e3ace6a02 Add Star History section to README.md with chart 2025-08-27 21:07:57 +01:00
Ran Aroussi
8ebbd09d12 Add CLAUDE.md to .gitignore to prevent tracking of the file 2025-08-27 21:05:15 +01:00
Ran Aroussi
7975cb2012 Enhance cleanup process after cloning by removing .gitignore along with .git and install directory 2025-08-27 21:04:54 +01:00
Ran Aroussi
5d6dcfe986 Fix numbering in installation steps and update repository link in README.md 2025-08-27 21:02:01 +01:00
Ran Aroussi
702d9a9ef0 Add repository protection checks to prevent syncing with CCPM template repository 2025-08-27 21:01:57 +01:00
Ran Aroussi
31af0af8b9 Revise setup instructions in README.md
Updated installation instructions and command sequence.
2025-08-27 20:50:10 +01:00
Ran Aroussi
6475528354 Remove 'install' directory on successful clone
Remove the 'install' directory after successful clone.
2025-08-27 20:45:04 +01:00
Ran Aroussi
2dc3abd4de Update ccpm.sh to remove .git and install directory
Remove .git directory and install folder after cloning.
2025-08-27 20:44:47 +01:00
Ran Aroussi
e0bd3b9d87 Create README.md with quick install guide
Added installation instructions for Unix/Linux/macOS and Windows.
2025-08-27 20:44:09 +01:00
Ran Aroussi
d4c7de5305 Add batch script to clone CCPM repository 2025-08-27 20:42:06 +01:00
Ran Aroussi
dae0663989 Add script to clone and untrack ccpm repository 2025-08-27 20:41:34 +01:00
Trent Schneweis
c6be66e426 docs(broke-star-link): Update README.md
Update broken star link for ccpm.
2025-08-26 12:51:21 -05:00
Steven
6fa8fea979 Fix ast-grep supported languages list to match official documentation
Correct the ast-grep language support documentation to accurately reflect
the actual 25 languages supported according to ast-grep.github.io:

**Removed unsupported languages:**
- Dart (not actually supported by ast-grep)
- Vue, Svelte (framework-specific, not core languages)
- SCSS, SASS, LESS (CSS preprocessors not supported)
- TOML, XML (not in official support list)
- PowerShell, shell variants beyond bash
- OCaml and other languages incorrectly listed

**Corrected to official 25 languages:**
- System: C, C++, C#, Go, Rust
- Web: JavaScript (js/jsx), TypeScript (ts), TSX, HTML, CSS, PHP
- General: Python, Java, Kotlin, Ruby, Swift, Scala, Lua, Elixir, Haskell
- Config: JSON, YAML
- Other: Bash, Nix, Solidity

**Updated examples:**
- Use correct language aliases (js instead of javascript, ts instead of typescript)
- Align with actual ast-grep command patterns

This ensures accurate guidance for developers using ast-grep integration
and prevents errors from referencing unsupported language identifiers.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:51:04 -07:00
Steven
0ec76d9e1b Complete comprehensive programming language expansion with final enhancements
Add final layer of language support improvements across infrastructure components:

**Multi-Language Test Script (.claude/scripts/test-and-log.sh):**
- Transform Python-only script to support 10+ languages and frameworks
- Add intelligent test framework detection: Python (pytest), JavaScript/TypeScript
  (npm test, jest), Java (Maven, Gradle), C# (.NET), Ruby (RSpec), PHP (PHPUnit),
  Go, Rust, Swift, Dart/Flutter
- Automatic file extension detection with appropriate test runner selection
- Enhanced usage examples showing multi-language support

**AST-Grep Language Reference (.claude/rules/use-ast-grep.md):**
- Expand supported languages list from basic to comprehensive 50+ languages
- Organize by categories: Primary Languages, Web & Markup, Configuration & Data,
  Shell & Scripts, and specialty languages
- Add specific language codes for JavaScript/TypeScript variants, C/C++/C#,
  web frameworks (Vue, Svelte), and configuration formats (YAML, TOML, XML)

**Issue Analysis Enhancement (.claude/commands/pm/issue-analyze.md):**
- Generalize package.json references to support all project configuration files
- Include build system coordination for Maven, Gradle, CMake, etc.

**Test Runner Agent (.claude/agents/test-runner.md):**
- Replace pytest-specific fallback with comprehensive multi-language fallback
- Support framework detection and execution for all major testing ecosystems

These enhancements complete the comprehensive language support initiative,
ensuring consistent multi-language development workflow capabilities across
all system components, from project detection to testing execution.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:42:56 -07:00
Steven
fc8f4ee32d Expand comprehensive programming language support across all project components
Complete systematic enhancement of language detection and build system support,
following the comprehensive approach established in context/create.md:

**Testing Framework Detection (.claude/commands/testing/prime.md):**
- Add detection for PHP (PHPUnit, Pest), C#/.NET (MSTest, NUnit, xUnit),
  Java (JUnit/Maven/Gradle), Kotlin, Swift (XCTest), Dart/Flutter,
  C/C++ (GoogleTest, Catch2), Ruby (RSpec, Minitest)
- Expand framework-specific configurations with proper commands and options
- Add comprehensive dependency checking for all package managers
- Include installation commands for all build systems (composer, mvn, gradle,
  dotnet, bundle, flutter, swift, ctest)
- Add test file discovery patterns for all languages

**Context Management Enhancement:**
- Update dependency change detection in context/update.md for 11 build systems
- Enhance context/prime.md project file analysis beyond basic detection
- Maintain consistency with context/create.md comprehensive language support

**Build System Integration:**
- Expand pm/epic-merge.md test commands from 2 to 12 build systems
- Add Maven, Gradle, Composer, .NET, Cargo, Go, Flutter, Swift, CMake support
- Enable automated testing across all major development ecosystems

**Infrastructure Support:**
- Add bash permissions for 10 additional build tools in settings.local.json
- Update process cleanup in test-execution.md and testing/run.md for all frameworks
- Ensure consistent cross-language development workflow support

This enhancement enables full development lifecycle support for 20+ programming
languages and frameworks, providing consistent project detection, dependency
management, testing, and build capabilities across diverse technology stacks.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:31:32 -07:00
Steven
4d18a2f008 Enhance context creation with comprehensive language detection
Expand project detection capabilities to support 20+ programming languages and frameworks:

- Add detection for JavaScript/TypeScript, Python (pyproject.toml), Java (Maven/Gradle),
  C#/.NET, Ruby, PHP, Dart/Flutter, Swift (including Xcode projects), C/C++, and Docker
- Extend file type detection to include .ts, .jsx, .tsx, .kt, .cs, .rb, .php, .swift,
  .dart, .c, .h, .cpp, .hpp, and .sh files
- Improve test detection to find both test directories and test files with common
  naming patterns (*test.*, *spec.*, test_*.*, *_test.*)
- Exclude hidden directories in test detection for better performance

This enhancement enables more accurate project analysis and better context creation
across diverse development environments and technology stacks.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:01:12 -07:00
Ran Aroussi
9b1acb26dd Enhance agent capabilities by adding new tools
- Updated `code-analyzer.md`, `file-analyzer.md`, `parallel-worker.md`, and `test-runner.md` to include new tools: Search, Task, and Agent.
- Improved functionality for analyzing code, summarizing files, executing parallel tasks, and running tests.
2025-08-21 23:22:28 +01:00
Ran Aroussi
2da721192f Add epic-start command and branch operations documentation
- Introduced `epic-start-worktree.md` for launching parallel agents on epic tasks.
- Updated `epic-start.md` to reflect changes from worktree to branch operations.
- Added `branch-operations.md` to outline best practices for managing branches in the project.
2025-08-21 23:21:43 +01:00
Ran Aroussi
dc4a84da43 Merge branch 'main' of github.com:ranaroussi/ccpm 2025-08-21 21:30:43 +01:00
Ran Aroussi
b2562512f0 Update command files to make preflight checks less veebose 2025-08-21 21:30:21 +01:00
Ran Aroussi
4b47e0153e Fix epic-show.sh script to remove unnecessary error suppression in task file loop 2025-08-21 21:29:47 +01:00
J. Kirby Ross
6603544958 revert: remove dirname -- flag for broader compatibility
Remove the '--' end-of-options flag from dirname command as it's not
  universally supported across all POSIX implementations. While '--' is
  good practice for handling filenames starting with dashes, dirname
  rarely encounters such edge cases in practice, and the compatibility
  issue is more pressing.

  Some older or minimal POSIX shells don't recognize '--' with dirname,
  causing the script to fail. Since we're already in a controlled loop
  walking up directory paths that come from pwd, the risk of dash-prefixed
  paths is negligible.

  Trade-off: Prioritizing compatibility over theoretical edge case protection.
2025-08-21 08:45:49 -07:00
J. Kirby Ross
1968083e76 fix: restore [:space:] patterns and handle CRLF line endings
Critical fixes and improvements to the bash worktree hook:

Bug Fixes:
- Handle CRLF line endings in .git files (Windows compatibility)
  * Strip trailing CR characters that break gitdir path parsing
- Restore [:space:] character class for better Unicode support
  * Literal space/tab was too restrictive for international locales
- Remove absolute path skip logic that broke many commands
  * Commands like `/usr/bin/npm install` still need correct cwd
  * Only skip builtins and commands that truly don't need directory context

Performance:
- Add fast-path exit when not in a worktree
  * Avoids unnecessary skip checks for common case
- Remove redundant set -f globbing protection
  * Pattern matching doesn't trigger pathname expansion in case statements

Clarity:
- Streamline comments to be more concise
- Quote original_command consistently
- Better explain why absolute paths aren't skipped

The hook now correctly handles Windows-created .git files with CRLF
endings and properly supports all absolute-path commands that depend
on the current working directory (which is most of them).
2025-08-21 08:16:57 -07:00
J. Kirby Ross
24946d45c1 refactor: improve worktree hook robustness and portability
Major improvements to the bash worktree fix hook for better reliability:

  Validation & Safety:
  - Add gitdir path validation to verify the directory actually exists
  - Normalize relative gitdir paths to absolute for proper resolution
  - Add pwd directory check to handle edge cases
  - Use dirname with -- flag for safer path handling

  Portability:
  - Replace echo with printf throughout for consistent behavior
  - Use literal space/tab characters instead of [:space:] for POSIX compatibility
  - Rename shell_quote to shell_squote for clarity
  - Maintain set -f protection during pattern matching

  Simplification:
  - Streamline skip detection logic with cleaner patterns
  - Consolidate builtin command checks into single case statement
  - Remove unnecessary comments while keeping essential documentation
  - Cleaner whitespace detection using portable pattern

  The hook now properly validates that gitdir paths exist before treating
  them as worktrees, preventing false positives. Pattern matching is more
  portable across different POSIX shells, and printf usage eliminates
  echo's platform-specific quirks.

  All security improvements are retained: pathname expansion protection,
  proper single-quote escaping, and safe handling of background processes.
2025-08-21 08:01:00 -07:00
J. Kirby Ross
64dc02d6d3 fix: harden bash worktree hook against security vulnerabilities
Security and robustness improvements to prevent shell injection and edge cases:

- Prevent pathname expansion attacks by disabling globbing during tokenization
  * Commands like "echo *" no longer expand before parsing
- Fix absolute path detection for environment-prefixed commands
  * Now correctly handles "VAR=1 /usr/bin/make" patterns
- Implement secure path quoting using single quotes with proper escaping
  * Handles paths containing quotes, spaces, and special characters
- Optimize .git file reading using shell built-ins instead of cat
  * Avoids subshell and only reads first line for efficiency
- Improve debug mode to accept multiple truthy values (true/TRUE/1/yes/YES)
- Add ShellCheck compliance with consistent variable bracing and default cases

The hook now safely handles edge cases like:
- Paths with single quotes: /path/to/joe's-project/
- Commands with wildcards that shouldn't expand
- Mixed environment variables and absolute paths

All changes maintain POSIX compatibility while significantly improving
security posture and reliability.
2025-08-21 07:46:10 -07:00
J. Kirby Ross
672c458bb4 docs: fix a path in the instructions for how to enable the bash worktree fix hook 2025-08-21 07:39:33 -07:00
J. Kirby Ross
3f3c19c232 fix: improve bash worktree hook robustness and documentation
- Fix critical bugs in worktree detection and command parsing:
  * Distinguish between git worktrees and submodules (check for /worktrees/ in gitdir path)
  * Fix TAB pattern bug using proper tokenization instead of brittle globbing
  * Fix overly broad dot-prefix skip that broke ./script.sh execution
  * Add proper path quoting to handle spaces and special characters
  * Capture all arguments with $* instead of just $1

- Improve documentation:
  * Remove personal paths from examples
  * Restructure troubleshooting steps for clarity
  * Switch from jq to python -m json.tool for wider compatibility
  * Clarify that hook config goes in main .claude/settings.json

- Simplify configuration:
  * Remove redundant config.json
  * Add settings.json.example showing proper integration
  * Fix background process detection for both "cmd &" and "cmd&" patterns

These changes prevent false positives on commands like "cdbuild", ensure
relative scripts work in worktrees, and handle paths with spaces correctly.
2025-08-21 07:28:09 -07:00
James Ross
e6a3f7fdd8 Update .claude/hooks/config.json
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-08-21 07:05:32 -07:00
James Ross
494beefd97 Merge remote-tracking branch 'origin/main' 2025-08-21 13:42:27 +00:00
James Ross
a92d8e86c9 fix: make bash-worktree-fix POSIX-compliant 2025-08-21 13:41:25 +00:00
James Ross
311a009ddf fix: script name in hooks README file 2025-08-21 06:31:37 -07:00
James Ross
664d14e3ef feat: Add automatic worktree directory fix via pre-tool-use hook
Problem: Bash tool resets to main project directory after every command,
  breaking worktree operations for parallel agent development.

  Solution: Pre-tool-use hook that automatically detects worktree context
  and injects 'cd /path/to/worktree && ' prefix to all Bash commands.

  Features:
  - Zero-config: Agents don't need special instructions or awareness
  - Smart detection: Distinguishes worktrees (.git file) from repos (.git dir)
  - Edge case handling: Background processes, pipes, env vars, etc.
  - Debug mode: CLAUDE_HOOK_DEBUG=true for troubleshooting
  - Skip patterns: Avoids double-prefixing and unnecessary injections

  This enables true parallel development with multiple agents in different
  worktrees without any manual command prefixing or documentation burden.

  Tested via shell-shocked test suite: All 7 stress test scenarios passed.

  Or if you prefer a shorter version:

  feat: Auto-fix Bash tool worktree directory reset issue

  Implements pre-tool-use hook that transparently injects 'cd /worktree && '
  prefix when operating in git worktrees. Handles background processes, pipes,
  and other edge cases. Agents need zero awareness of the fix.

  Enables parallel multi-agent development in worktrees without manual prefixing.
2025-08-21 13:29:35 +00:00
Ran Aroussi
f06f49f45f Added a note about cloning into existing projects (issue #2) 2025-08-20 21:46:34 +01:00