Comprehensive GitHub Classroom automation with workflow orchestration, repository discovery, and secret management. Handles assignment setup, batch operations, collaboration management, and automated workflows for educational environments.
A comprehensive AI assistant for working with ClassDock, a Python CLI tool for automating GitHub Classroom assignment management with modular functionality for repository operations, assignment orchestration, secret management, and automation workflows.
This skill provides expert guidance for developing, maintaining, and extending ClassDock — a production-grade GitHub Classroom automation suite. It understands the project's modular architecture, GitHub API integration patterns, testing requirements, and provides context-aware assistance for all development tasks.
When working with ClassDock:
- `classdock/cli.py` — Main CLI interface with Typer sub-applications
- `classdock/assignments/` — Assignment management and orchestration
- `classdock/repos/` — Repository operations and discovery
- `classdock/secrets/` — Secret management with encryption
- `classdock/automation/` — Scheduling and batch processing
- `classdock/utils/github_exceptions.py` — Centralized GitHub API error handling
Follow these guidelines strictly:
```python
@app.command()
def command_name(
dry_run: bool = typer.Option(False, help="Show what would be done"),
verbose: bool = typer.Option(False, help="Enable verbose output")
):
"""Clear command description."""
```
**NEVER introduce incompatible versions:**
```toml
python = "^3.10"
click = ">=8.0.0,<8.2.0" # Compatible with typer
typer = ">=0.12.0" # Latest stable version
pyyaml = "^6.0.1"
requests = "^2.31.0"
```
**Compatibility Rule**: Never use `typer < 0.12.0` with `click >= 8.1.3` (causes `make_metavar()` errors)
**Foundation First Approach** — Always start with error handling infrastructure:
#### Phase 1: Error Handling Setup
```python
class GitHubAPIError(Exception): pass
class RateLimitError(GitHubAPIError): pass
class AuthenticationError(GitHubAPIError): pass
class ResourceNotFoundError(GitHubAPIError): pass
@retry_on_github_error(max_retries=3, base_delay=1)
def make_github_request(method: str, url: str, **kwargs):
"""Make authenticated GitHub API request with retry logic."""
headers = kwargs.get('headers', {})
headers.update({
'Authorization': f'token {get_github_token()}',
'Accept': 'application/vnd.github.v3+json'
})
response = requests.request(method, url, headers=headers, **kwargs)
return handle_github_response(response)
```
#### Phase 2: Module Conversion Pattern
**Analysis before implementation:**
1. Map bash commands to GitHub API endpoints
2. Document required permissions and scopes
3. List error scenarios
4. Determine data transformations
**Standard conversion workflow:**
```python
result = bash_wrapper.run(['gh', 'repo', 'view', repo_url, '--json', 'name'])
response = self._make_github_request('GET', f'/repos/{owner}/{repo}')
return {'name': response['name'], 'description': response['description']}
```
#### Repository Operations (`repos/`)
#### Secret Management (`secrets/`)
#### Assignment Management (`assignments/`)
**Comprehensive coverage required:**
```python
@pytest.fixture
def mock_github_api(mocker):
"""Mock GitHub API responses."""
mock_response = mocker.Mock()
mock_response.status_code = 200
mock_response.json.return_value = {"id": 123, "name": "test-repo"}
mock_response.headers = {"X-RateLimit-Remaining": "4999"}
mocker.patch('requests.request', return_value=mock_response)
return mock_response
```
**Test categories:**
**Module conversion priority:**
1. Core utilities (`github_exceptions.py`) — Foundation first
2. Repository operations (`repos/`) — High usage
3. Secret management (`secrets/`) — Security critical
4. Assignment operations (`assignments/`) — Business logic
5. Automation workflows (`automation/`) — Lower priority
**Pre-merge checklist:**
**Best practices:**
**Adding a new command:**
1. Create command in appropriate sub-app (`assignments_app`, `repos_app`, etc.)
2. Use standard option pattern (dry_run, verbose, etc.)
3. Add comprehensive docstring with examples
4. Implement error handling with GitHub exceptions
5. Write tests covering success and failure scenarios
6. Update documentation
**Updating dependencies:**
1. Check compatibility matrix (especially click/typer)
2. Update `pyproject.toml`
3. Run `poetry lock`
4. Run full test suite
5. Update version if needed
**Converting bash to API:**
1. Review GitHub API Integration Methodology (Phase 1-8)
2. Start with error handling infrastructure
3. Map bash commands to API endpoints
4. Implement with retry logic and error handling
5. Add comprehensive tests
6. Maintain backward compatibility
**Working with repository operations:**
```
User: "Add a command to bulk clone all assignment repositories"
Assistant: I'll create a new command in the repos sub-app with GitHub API integration...
[Implements with proper error handling, retry logic, and comprehensive tests]
```
**Updating secret management:**
```
User: "Update the secret manager to support batch secret updates"
Assistant: I'll extend the secrets module with batch API support...
[Uses repository public key encryption, implements batch operations efficiently]
```
**Troubleshooting dependency issues:**
```
User: "Getting make_metavar() error with typer"
Assistant: This is the known click/typer compatibility issue. Checking your versions...
[Identifies incompatible versions, provides exact fix with version constraints]
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/github-classroom-automation-suite/raw