Skip to content

Commit 252b5cc

Browse files
committed
Remove examples directory and update README/setup script
- Remove all example workie configurations and documentation - Update README.md with simplified content - Update github-setup.sh script
1 parent 3b240ba commit 252b5cc

14 files changed

Lines changed: 6 additions & 2208 deletions

README.md

Lines changed: 5 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,8 @@ No configuration file found
276276

277277
#### ✅ Recommended Practices
278278

279-
- **Environment templates**: Copy `.env.example` instead of `.env` to avoid secrets
280279
- **Development configs**: Include development-specific configurations only
281280
- **Script organization**: Group related scripts in directories for easy copying
282-
- **Documentation**: Include relevant documentation files (`README.md`, setup guides)
283281
- **Version control**: Always version control your `.workie.yaml` configuration
284282

285283
#### ❌ What to Avoid
@@ -296,42 +294,6 @@ No configuration file found
296294
- **Environment separation**: Use different configs for different environments
297295
- **Documentation**: Comment your `.workie.yaml` to explain why files are copied
298296

299-
### Real-World Examples
300-
301-
#### Full-Stack Web Application
302-
```yaml
303-
files_to_copy:
304-
# Environment setup
305-
- .env.example
306-
- .env.development.example
307-
308-
# Build and development tools
309-
- package.json # For npm dependencies reference
310-
- docker-compose.dev.yml # Development containers
311-
- scripts/ # Build and utility scripts
312-
313-
# Configuration files
314-
- config/development.json # App configuration
315-
- .eslintrc.json # Code quality
316-
- jest.config.js # Testing setup
317-
```
318-
319-
#### Microservices Project
320-
```yaml
321-
files_to_copy:
322-
# Shared configurations
323-
- .env.example
324-
- docker-compose.yml
325-
- scripts/deploy.sh
326-
327-
# Service-specific configs
328-
- config/
329-
- kubernetes/ # K8s manifests
330-
- docs/setup.md # Development guide
331-
```
332-
333-
By following these patterns and best practices, you'll ensure that every new worktree is properly configured and ready for development from the moment it's created.
334-
335297
## How It Works
336298

337299
1. **Repository Detection**: Detects the current git repository using `git rev-parse --show-toplevel`
@@ -357,6 +319,7 @@ Hooks allow you to execute commands at different stages in the lifecycle of a wo
357319

358320
- **post_create**: Commands to run after creating a new worktree.
359321
- **pre_remove**: Commands to run before removing a worktree.
322+
- **post_cd**: Commands to run after changing to a worktree.
360323

361324
### Configuration Example
362325

@@ -371,142 +334,30 @@ hooks:
371334
pre_remove:
372335
- "echo 'Cleaning up...'"
373336
- "rm -rf /tmp/*"
337+
post_cd:
338+
- "echo 'Entering worktree'"
339+
- "ls -l"
374340
```
375341
376342
### Common Use Cases
377343
378344
- **Setting up development environments** with `post_create`, ensuring all dependencies are installed.
379345
- **Cleanup tasks** using `pre_remove` to tidy up temporary files.
346+
- **Post-cd actions** with `post_cd` to perform actions after changing to a worktree.
380347

381348
### Security Considerations
382349

383350
- Avoid destructive commands like `rm -rf /` in hooks.
384351
- Validate all inputs and paths to prevent injection attacks.
385352
- Limit the number of hooks and complexity to maintain performance.
386353

387-
## Examples
388-
389-
### Example 1: Basic Usage
390-
391-
```bash
392-
cd /path/to/your/repo
393-
workie feature/user-authentication
394-
395-
# Output:
396-
# 🌳 Workie
397-
# ==============================================
398-
# ✓ Detected git repository: /path/to/your/repo
399-
# ✓ Worktrees directory: /path/to/your-repo-worktrees
400-
# ✓ Created worktrees directory: /path/to/your-repo-worktrees
401-
# 📝 Creating worktree for branch 'feature/user-authentication'...
402-
# ✅ Successfully created worktree:
403-
# Branch: feature/user-authentication
404-
# Path: /path/to/your-repo-worktrees/feature/user-authentication
405-
#
406-
# 🚀 To start working:
407-
# cd /path/to/your-repo-worktrees/feature/user-authentication
408-
```
409-
410-
### Example 2: With Configuration File
411-
412-
Create `.workie.yaml`:
413-
```yaml
414-
files_to_copy:
415-
- .env.example
416-
- scripts/setup.sh
417-
- config/
418-
```
419-
420-
Run the tool:
421-
```bash
422-
workie bugfix/database-connection
423-
424-
# Output includes:
425-
# ✓ Loaded configuration from: .workie.yaml
426-
# ✓ Files to copy: 3 entries
427-
# 📂 Copying configured files to worktree...
428-
# 📄 Copying file: .env.example
429-
# 📄 Copying file: scripts/setup.sh
430-
# 📁 Copying directory: config/
431-
# ✓ Finished copying configured files
432-
```
433-
434-
### Example 3: Auto-Generated Branch Names
435-
436-
```bash
437-
workie
438-
439-
# Creates branch like: feature/work-20240120-143022
440-
```
441-
442354
## Error Handling
443355

444356
- **Not in Git Repository**: Shows clear error message
445357
- **Branch Already Exists**: Prevents duplicate branches
446358
- **Missing Configuration Files**: Shows warnings but continues
447359
- **File Copy Errors**: Shows warnings for individual files but continues
448360

449-
## Building and Development
450-
451-
### Prerequisites
452-
453-
- Go 1.21 or later
454-
- Git
455-
456-
### Building
457-
458-
```bash
459-
go mod download
460-
go build -o workie .
461-
```
462-
463-
### Testing
464-
465-
```bash
466-
go test ./...
467-
```
468-
469-
### Cross-Platform Builds
470-
471-
```bash
472-
# Linux
473-
GOOS=linux GOARCH=amd64 go build -o workie-linux .
474-
475-
# macOS
476-
GOOS=darwin GOARCH=amd64 go build -o workie-macos .
477-
478-
# Windows
479-
GOOS=windows GOARCH=amd64 go build -o workie.exe .
480-
```
481-
482-
## Roadmap
483-
484-
Workie is evolving beyond Git worktree management into a comprehensive agentic coding assistant. Here's what's planned:
485-
486-
### 🎯 Short Term (Q1-Q2 2024)
487-
- **Enhanced configuration** - More flexible `.workie.yaml` options for project setup
488-
- **Template system** - Pre-configured templates for common project types
489-
- **Integration plugins** - Support for popular development tools and workflows
490-
- **Smart branch suggestions** - AI-powered branch naming based on commit history and patterns
491-
492-
### 🚀 Medium Term (Q3-Q4 2024)
493-
- **Code analysis engine** - Intelligent code quality assessment and suggestions
494-
- **Automated test generation** - Generate unit tests based on existing code patterns
495-
- **Workflow learning** - Learn and suggest optimizations for your development patterns
496-
- **Context-aware assistance** - Understand project structure and provide relevant recommendations
497-
498-
### 🌟 Long Term (2025+)
499-
- **Full agentic capabilities** - Autonomous code generation and refactoring
500-
- **Natural language commands** - Describe what you want and let Workie implement it
501-
- **Team collaboration features** - Share and synchronize development patterns across teams
502-
- **Advanced AI integrations** - Integration with cutting-edge AI models for code generation
503-
- **Ecosystem expansion** - Plugin architecture for community-driven extensions
504-
505-
### 🤝 Community Driven
506-
- **Open source contributions** - Community-driven feature development
507-
- **Plugin marketplace** - Ecosystem of community-created extensions
508-
- **Best practices sharing** - Learn from and contribute to collective development wisdom
509-
510361
## Dependencies
511362

512363
- [Cobra](https://github.com/spf13/cobra) - CLI framework

examples/INDEX.md

Lines changed: 0 additions & 155 deletions
This file was deleted.

0 commit comments

Comments
 (0)