Skip to main content
ClaudeWave
Slash Command717 repo starsupdated 4mo ago

pre-commit

This Claude Code command runs the complete CI validation pipeline locally for the ptc-agent and ptc-cli libraries, executing ruff linting with auto-fixes, mypy type checking, and both unit and integration tests in sequence. Use it before committing to catch code quality, type safety, and functionality issues that would otherwise fail in GitHub CI.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/Chen-zexi/open-ptc-agent/HEAD/.claude/commands/pre-commit.md -o ~/.claude/commands/pre-commit.md
Then start a new Claude Code session; the slash command loads automatically.

pre-commit.md

# Pre-Commit Check

Run all CI checks locally before committing. This matches the GitHub CI workflow exactly.

## Your Task

Run these checks in order, stopping if any fail:

### 1. Lint (ruff check)

```bash
uv run ruff check libs/ptc-agent/ptc_agent/ libs/ptc-agent/tests/
uv run ruff check libs/ptc-cli/ptc_cli/ libs/ptc-cli/tests/
```

If there are auto-fixable issues, fix them:
```bash
uv run ruff check libs/ptc-agent/ptc_agent/ libs/ptc-agent/tests/ --fix
uv run ruff check libs/ptc-cli/ptc_cli/ libs/ptc-cli/tests/ --fix
```

### 2. Type Check (mypy)

```bash
cd libs/ptc-agent && uv run mypy ptc_agent/
cd libs/ptc-cli && uv run mypy ptc_cli/
```

### 3. Unit Tests

```bash
uv run pytest libs/ptc-agent/tests/unit_tests/ -v
uv run pytest libs/ptc-cli/tests/unit_tests/ -v
```

### 4. Integration Tests

```bash
uv run pytest libs/ptc-agent/tests/integration_tests/ -v
uv run pytest libs/ptc-cli/tests/integration_tests/ -v
```

Note: Integration tests require `DAYTONA_API_KEY` and `ANTHROPIC_API_KEY` environment variables.

## Summary

Report results for each step:
- Lint: PASS/FAIL
- Type check: PASS/FAIL
- Unit tests: PASS/FAIL
- Integration tests: PASS/FAIL/SKIPPED (if env vars missing)
creating-financial-modelsSkill

This skill provides an advanced financial modeling suite with DCF analysis, sensitivity testing, Monte Carlo simulations, and scenario planning for investment decisions

docxSkill

Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction. When Claude needs to work with professional documents (.docx files) for: (1) Creating new documents, (2) Modifying or editing content, (3) Working with tracked changes, (4) Adding comments, or any other document tasks

pdfSkill

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

pptxSkill

Presentation creation, editing, and analysis. When Claude needs to work with presentations (.pptx files) for: (1) Creating new presentations, (2) Modifying or editing content, (3) Working with layouts, (4) Adding comments or speaker notes, or any other presentation tasks

xlsxSkill

Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas