Skip to content

Commit c2d5502

Browse files
authored
Merge pull request #14 from mojwang/feat/git-workflow-enhancement
feat: enhance git workflow with worktrees and Graphite CLI
2 parents 16292ec + acb9ada commit c2d5502

13 files changed

Lines changed: 758 additions & 474 deletions

File tree

CLAUDE.md

Lines changed: 39 additions & 346 deletions
Large diffs are not rendered by default.

config/global-claude.md

Lines changed: 24 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,28 @@
1-
# Global Claude Code Instructions
1+
# Claude Global Config v2.0
22

3-
This file provides baseline guidance to Claude Code across all projects. Project-specific instructions in local CLAUDE.md files will override or extend these.
4-
5-
## Communication Style
6-
7-
- Be direct, concise, and honest - avoid sycophantic or overly deferential language
8-
- Provide constructive feedback when something could be improved
9-
- Challenge assumptions when they might lead to problems
10-
- Keep responses focused and to the point
11-
12-
## Development Standards
13-
14-
- Follow shell scripting best practices with consistent error handling
15-
- Use color-coded output for different message types (success=green, warning=yellow, error=red, dry-run=cyan)
16-
- All scripts should use `set -e` for fail-fast behavior
17-
- Add timeout protection (30s) for potentially hanging commands
18-
- Configure Git with security-conscious settings (fsckObjects enabled)
19-
20-
## Safety Principles
21-
22-
- Comprehensive prerequisite validation before any system changes
23-
- Automatic backup of existing files before replacement
24-
- Provide dry-run/preview modes for all destructive operations
25-
- Detailed error handling with recovery options
26-
- Optional logging for troubleshooting
27-
- Signal-safe cleanup handlers for all system-modifying scripts
28-
- Atomic file operations to prevent partial writes
29-
30-
## File Organization
31-
32-
- Use modular configuration approach when possible
33-
- Separate concerns into focused, single-purpose files
34-
- Support local overrides through gitignored files
35-
- Prefer configuration over hardcoding
36-
37-
## Code Style
38-
39-
- Match existing code conventions in the project
40-
- Use existing libraries and utilities rather than reinventing
41-
- Follow established patterns in the codebase
42-
- Never add comments unless explicitly requested
43-
- Never introduce code that exposes or logs secrets
44-
45-
## Testing Requirements
46-
47-
- Practice test-driven development (TDD) whenever possible:
48-
- Write tests first to define expected behavior
49-
- Implement the minimum code needed to make tests pass
50-
- Refactor while keeping tests green
51-
- If TDD isn't feasible, explain why and write tests immediately after implementation
52-
- Always add tests for new functionality, features, scripts, components, capabilities, or code
53-
- Write unit tests for isolated functionality
54-
- Write integration tests for features that interact with other components
55-
- Ensure tests pass before considering a feature complete
56-
- Follow existing test patterns and frameworks in the project
57-
- If no test framework exists, suggest adding one before implementing features
58-
- Run existing tests before making changes to ensure you don't break functionality
3+
## Core Principles
4+
- Be direct and concise
5+
- Test-driven development by default
6+
- Security-first approach
7+
- Match existing project patterns
598

609
## Git Workflow
10+
- Feature branches only
11+
- Small commits (<200 LOC diffs)
12+
- Conventional commit format
13+
- Create PR unless told otherwise
6114

62-
- Always create a new feature branch from the main/master branch before making changes
63-
- Use descriptive branch names (e.g., `feat/add-login`, `fix/memory-leak`, `docs/update-readme`)
64-
- Never commit directly to the main/master branch
65-
- Commit complete implementations frequently to keep diffs small and readable:
66-
- Commit after each logical unit of work is complete and tested
67-
- Aim for diffs under 200 lines when possible
68-
- Break large features into smaller, incremental commits
69-
- Each commit should represent a working state of the code
70-
- Prefer multiple small commits over one large commit
71-
- When asked to commit changes, also create a pull request unless explicitly told not to
72-
- Follow conventional commit message formats when they exist in the project
73-
- Keep commits focused and atomic - one logical change per commit
74-
75-
## Security Practices
76-
77-
- Always quote variables in shell scripts: `"$var"` not `$var`
78-
- Validate and sanitize all user inputs
79-
- Use `mktemp` for temporary files with restrictive permissions
80-
- Never store secrets in code or logs
81-
- Clean up sensitive data from memory/disk after use
82-
- Implement proper signal handling for cleanup on interruption
83-
- Use secure defaults and fail closed, not open
84-
85-
## Important Behavioral Guidelines
86-
87-
- Do only what has been asked; nothing more, nothing less
88-
- Never create files unless absolutely necessary for the task
89-
- Always prefer editing existing files over creating new ones
90-
- Never proactively create documentation files (*.md) or README files unless explicitly requested
91-
- Never commit changes unless explicitly asked to
92-
- When blocked, ask for clarification rather than making assumptions
15+
## Development Standards
16+
- Fail-fast: `set -e` in shell scripts
17+
- Clean up after interruptions
18+
- Backup before system changes
19+
- Follow project conventions
20+
21+
## Behavior
22+
- Do only what's asked
23+
- Prefer editing over creating files
24+
- Never create docs unless requested
25+
- Ask for clarification when blocked
26+
27+
## Important
28+
When global CLAUDE.md updates, sync to macbook-dev-setup project.

docs/COMMANDS.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Command Reference
2+
3+
## Setup Commands
4+
5+
### Basic Usage
6+
```bash
7+
./setup.sh # Smart setup - detects what needs to be done
8+
./setup.sh preview # Show what would be installed/updated
9+
./setup.sh minimal # Install essential tools only
10+
./setup.sh fix # Run diagnostics and fix common issues
11+
./setup.sh warp # Configure Warp terminal optimizations
12+
./setup.sh info # Learn about installed tools, aliases & features
13+
./setup.sh help # Show help message
14+
15+
# Backup management (automatic - runs during setup)
16+
./setup.sh backup # List all backups
17+
./setup.sh backup clean # Manually remove old backups (also automatic)
18+
```
19+
20+
### Advanced Options
21+
```bash
22+
# Use environment variables instead of flags
23+
SETUP_VERBOSE=1 ./setup.sh # Verbose output
24+
SETUP_JOBS=8 ./setup.sh # Custom parallel jobs
25+
SETUP_LOG=file.log ./setup.sh # Log to file
26+
SETUP_NO_WARP=true ./setup.sh # Skip Warp auto-detection
27+
28+
# Advanced interactive mode
29+
./setup.sh advanced # Interactive menu for all options
30+
```
31+
32+
### Information Commands
33+
```bash
34+
./setup.sh info # Show help categories
35+
./setup.sh info tools # List all installed tools with descriptions
36+
./setup.sh info aliases # Show all shell aliases
37+
./setup.sh info functions # Show custom shell functions
38+
./setup.sh info features # Show special features and enhancements
39+
./setup.sh info examples # Show usage examples for common tasks
40+
./setup.sh info search fd # Search for specific tool/command
41+
./setup.sh info all # Show everything (paginated)
42+
43+
# After setup, use the alias:
44+
devhelp # Quick access to info command
45+
devhelp tools # Show tools
46+
devhelp search ripgrep # Search for ripgrep
47+
```
48+
49+
## Git Helpers
50+
51+
### Conventional Commits
52+
```bash
53+
./scripts/setup-git-hooks.sh # Set up conventional commit hooks
54+
./scripts/commit-helper.sh # Interactive commit message creator
55+
./scripts/commit-helper.sh --quick # Quick mode with fewer prompts
56+
57+
# Shell aliases (after running setup):
58+
gci # Interactive commit helper
59+
gcft "message" # Quick feat commit
60+
gcfs scope "message" # Scoped feat commit
61+
commit-help # Show commit format reference
62+
```
63+
64+
## MCP Server Management
65+
```bash
66+
./scripts/setup-claude-mcp.sh # Install and configure MCP servers
67+
./scripts/setup-claude-mcp.sh --check # Check MCP server status
68+
./scripts/setup-claude-mcp.sh --update # Update MCP servers
69+
./scripts/setup-claude-mcp.sh --remove # Remove MCP configuration
70+
71+
# After setup, use MCP servers in Claude Code:
72+
/mcp # Access MCP servers in Claude Code
73+
claude mcp list # List configured MCP servers
74+
```
75+
76+
## Package Synchronization
77+
The `--sync` flag detects and installs new packages added to configuration files:
78+
- Checks `homebrew/Brewfile` for new formulae/casks
79+
- Syncs VS Code extensions from `vscode/extensions.txt`
80+
- Installs missing global npm packages from `nodejs-config/global-packages.txt`
81+
- Updates Python packages from `python/requirements.txt`
82+
- Use `--sync --minimal` to sync only essential packages from `Brewfile.minimal`
83+
84+
## Other Scripts
85+
```bash
86+
./scripts/cleanup-artifacts.sh # Periodic maintenance and cleanup
87+
./scripts/health-check.sh # System health verification
88+
./scripts/update.sh # Update all tools and dependencies
89+
./scripts/uninstall.sh # Clean removal with backups
90+
./scripts/rollback.sh # Restore from previous backups
91+
```

0 commit comments

Comments
 (0)