Skip to content

Commit 4f22d91

Browse files
paxcalptclaude
andauthored
docs: align Homebrew workflow with automation and add CLAUDE.md (#12)
Add automation guidelines and fix documentation inconsistencies: 1. Update CONTRIBUTING.md: - Add 'just release taskrepo' as recommended method - Keep manual workflow as alternative - Change VERSION=0.10.17 to VERSION=X.Y.Z - Change ~/GitHub/homebrew-formulas to ../homebrew-formulas - Add reference to homebrew-formulas repository utilities 2. Create CLAUDE.md: - Add comprehensive AI assistant guidelines - Document Homebrew formula automation workflow - Include development environment setup - Add release process documentation - Document code style and testing strategy 3. Update .gitignore: - Allow CLAUDE.md to be tracked (add !CLAUDE.md exception) Aligns with rxiv-maker PR #280 and folder2md4llms PR #37. Ensures consistency across HenriquesLab ecosystem. Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c73f821 commit 4f22d91

3 files changed

Lines changed: 169 additions & 10 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dmypy.json
6060
!README.md
6161
!CHANGELOG.md
6262
!CONTRIBUTING.md
63+
!CLAUDE.md
6364

6465
# Sensitive data patterns
6566
*.pem

CLAUDE.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Claude Instructions for TaskRepo Development
2+
3+
This file provides guidance for AI assistants working on TaskRepo development.
4+
5+
## Project Overview
6+
7+
TaskRepo is a TaskWarrior-inspired task management system that stores tasks as markdown files in git repositories. It provides a modern CLI interface with TUI support and GitHub integration.
8+
9+
## Development Environment
10+
11+
### Setup
12+
```bash
13+
# Install UV (recommended package manager)
14+
curl -LsSf https://astral.sh/uv/install.sh | sh
15+
16+
# Install dependencies
17+
uv sync --extra dev
18+
19+
# Run tests
20+
uv run pytest tests/ -v
21+
```
22+
23+
### Code Quality
24+
```bash
25+
# Format code
26+
uv run ruff format .
27+
28+
# Lint code
29+
uv run ruff check .
30+
31+
# Type checking
32+
uv run mypy src/taskrepo
33+
```
34+
35+
## Release Process
36+
37+
### Version Bumping
38+
39+
1. Update version in `pyproject.toml`
40+
2. Update CHANGELOG.md with new release notes
41+
3. Create PR to main
42+
4. Tag release triggers PyPI publication
43+
5. Update Homebrew formula (see below)
44+
45+
### Homebrew Formula Updates
46+
47+
TaskRepo is distributed via PyPI and Homebrew. After the PyPI release is live, update the Homebrew formula.
48+
49+
#### Homebrew Formula Location
50+
51+
The Homebrew formula is maintained in a separate repository located at `../homebrew-formulas`:
52+
- **Repository**: `../homebrew-formulas/`
53+
- **Formula file**: `Formula/taskrepo.rb`
54+
- **Automation**: Managed via justfile commands
55+
56+
#### Commands
57+
58+
After the PyPI release is live and verified at https://pypi.org/project/taskrepo/:
59+
60+
```bash
61+
cd ../homebrew-formulas
62+
63+
# Option 1: Full automated release workflow (recommended)
64+
# This will update, test, commit, and push in one command
65+
just release taskrepo
66+
67+
# Option 2: Manual step-by-step workflow
68+
just update taskrepo # Updates to latest PyPI version
69+
just test taskrepo # Tests the formula installation
70+
just commit taskrepo VERSION # Commits with standardized message
71+
git push # Push to remote
72+
73+
# Utility commands
74+
just list # List all formulas with current versions
75+
just check-updates # Check for available PyPI updates
76+
just sha256 taskrepo VERSION # Get SHA256 for a specific version
77+
```
78+
79+
#### Workflow Notes
80+
81+
- **Always verify PyPI first**: The formula update pulls package info from PyPI, so the release must be live
82+
- **Automatic metadata**: The `just update` command automatically fetches the version, download URL, and SHA256 checksum from PyPI
83+
- **Full automation**: The `just release` command runs the complete workflow: update → test → commit → push
84+
- **Standardized commits**: Formula updates use consistent commit message format
85+
- **Testing**: The `just test` command uninstalls and reinstalls the formula to verify it works correctly
86+
87+
## Key Features
88+
89+
### Task Management
90+
- Tasks stored as markdown files with YAML frontmatter
91+
- Git-based version control and synchronization
92+
- Support for tags, priorities, due dates, and dependencies
93+
- Rich CLI with color-coded output
94+
95+
### Repository Support
96+
- Multiple task repositories
97+
- GitHub integration for remote storage
98+
- Discovery and initialization commands
99+
- Automatic syncing capabilities
100+
101+
### TUI Components
102+
- Interactive prompts using questionary
103+
- Rich formatting for better UX
104+
- Progress bars and status indicators
105+
106+
## Testing Strategy
107+
108+
- **Unit tests**: Individual component testing
109+
- **Integration tests**: End-to-end workflow testing
110+
- Use pytest with fixtures for common setups
111+
- Aim for >80% test coverage
112+
113+
## Code Style
114+
115+
- Follow PEP 8 style guide
116+
- Use type hints for all function signatures
117+
- Google-style docstrings for public functions
118+
- Ruff for linting and formatting
119+
120+
## Important Notes
121+
122+
- Tasks are stored in `~/.taskrepo/` by default or in user-configured locations
123+
- Each repository is a git repository with tasks as markdown files
124+
- YAML frontmatter contains task metadata
125+
- GitHub integration requires `gh` CLI tool
126+
127+
## Security Considerations
128+
129+
- Sanitize user input for file paths
130+
- Validate repository URLs
131+
- Handle git credentials securely
132+
- Avoid exposing sensitive data in task files

CONTRIBUTING.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,53 +31,79 @@ uv run pytest tests/ -v
3131

3232
## Updating the Homebrew Formula
3333

34-
When releasing a new version of TaskRepo, update the Homebrew formula:
34+
When releasing a new version, the Homebrew formula must be updated in the [`homebrew-formulas` repository](https://github.com/HenriquesLab/homebrew-formulas).
3535

36-
### 1. Get Package Information from PyPI
36+
### Automated Workflow (Recommended)
3737

3838
```bash
39-
VERSION=0.10.17 # Replace with new version
39+
cd ../homebrew-formulas
40+
just release taskrepo # Full workflow: update → test → commit → push
41+
```
42+
43+
This automatically:
44+
- Fetches the latest version from PyPI
45+
- Downloads and calculates SHA256 checksum
46+
- Updates the formula file
47+
- Tests the installation
48+
- Commits with standardized message
49+
- Pushes to remote
50+
51+
### Manual Workflow (Alternative)
52+
53+
If `just` is not available, you can update the formula manually:
54+
55+
#### 1. Get Package Information from PyPI
56+
57+
```bash
58+
VERSION=X.Y.Z # Replace with new version
4059
curl "https://pypi.org/pypi/taskrepo/$VERSION/json" | \
4160
jq -r '.urls[] | select(.packagetype=="sdist") | "URL: \(.url)\nSHA256: \(.digests.sha256)"'
4261
```
4362

44-
### 2. Update the Formula
63+
#### 2. Update the Formula
64+
65+
Navigate to the homebrew-formulas repository and edit the formula:
66+
67+
```bash
68+
cd ../homebrew-formulas # Use relative path from TaskRepo directory
69+
```
4570

46-
Edit `homebrew-formulas/Formula/taskrepo.rb`:
71+
Edit `Formula/taskrepo.rb`:
4772
- Update the `url` line with the new URL
4873
- Update the `sha256` line with the new hash
4974

50-
### 3. Test Locally
75+
#### 3. Test Locally
5176

5277
```bash
53-
cd ~/GitHub/homebrew-formulas
5478
brew install --build-from-source ./Formula/taskrepo.rb
5579
brew test taskrepo
5680
tsk --version # Verify correct version
5781
brew uninstall taskrepo
5882
```
5983

60-
### 4. Audit the Formula
84+
#### 4. Audit the Formula
6185

6286
```bash
6387
brew audit --strict --online taskrepo
6488
```
6589

66-
### 5. Commit and Push
90+
#### 5. Commit and Push
6791

6892
```bash
6993
git add Formula/taskrepo.rb
7094
git commit -m "taskrepo: update to version $VERSION"
7195
git push
7296
```
7397

74-
### 6. Verify Installation
98+
#### 6. Verify Installation
7599

76100
```bash
77101
brew install henriqueslab/formulas/taskrepo
78102
tsk --version
79103
```
80104

105+
**Note:** The automated workflow using `just` is preferred for consistency and efficiency. See the [homebrew-formulas repository](https://github.com/HenriquesLab/homebrew-formulas) for additional utility commands like `just list`, `just check-updates`, and `just sha256`
106+
81107
## Development Workflow
82108

83109
### Making Changes

0 commit comments

Comments
 (0)