Goal: Create or update automation scripts in .claude/scripts/ for Claude Code workflows
Workflow
- Read
.claude/scripts/README.mdto understand existing scripts and patterns - Explore relevant subdirectories if the script belongs to a category
- Create a subdirectory for the script if it doesn't exist inside
.claude/scripts/directory. - Create or update the script following project conventions
- Update
.claude/scripts/README.mdif adding a new script - Test the script execution
Script Categories
| Category | Purpose |
|---|---|
Root (scripts/) |
General automation scripts |
utils/ |
Shared Python utilities |
ai_discussion/ |
AI discussion tools |
hooks_toggler/ |
Hook activation scripts |
phase_creator/ |
Phase management tools |
roadmap_filler/ |
Roadmap automation |
Rules
- MUST prefer Python over shell scripts
- MUST use type hints for Python scripts
- MUST include proper error handling
- MUST use
#!/usr/bin/env python3shebang for Python scripts - MUST use
argparsefor command-line arguments - MUST import shared utilities from
.claude/scripts/utils/when available - DO NOT hardcode paths - use
Path(__file__).parentfor relative paths - DO NOT include credentials or secrets in scripts
- MUST use
Path(__file__).parentfor relative paths - MUST use
# type: ignoreto suppress type errors - MUST use single line comments
#and avoid multi-line comments'''or""", unless necessary for documentation.
Python Script Template
#!/usr/bin/env python3
"""Brief description of what the script does."""
import argparse
from pathlib import Path
def main() -> None:
parser = argparse.ArgumentParser(description="Script description")
parser.add_argument("--arg", type=str, help="Argument description")
args = parser.parse_args()
# Implementation here
if __name__ == "__main__":
main()
Acceptance Criteria
- Script executes without errors
- Script has proper documentation (docstring)
- Script follows Python best practices
- README.md updated if new script added