Initial commit
This commit is contained in:
14
commands/ci-check.md
Normal file
14
commands/ci-check.md
Normal file
@@ -0,0 +1,14 @@
|
||||
---
|
||||
description: Run all CI checks locally before pushing
|
||||
---
|
||||
|
||||
Run comprehensive CI validation locally:
|
||||
|
||||
1. Run linters and fix issues (pnpm biome check --write, uv run ruff check --fix, uv run ruff format)
|
||||
2. Stage any lint fixes
|
||||
3. Run type checking (pnpm tsc --noEmit for TypeScript, uv run ty check for Python)
|
||||
4. Run test suite (pnpm test, uv run pytest)
|
||||
5. Verify build succeeds if build command exists (pnpm build)
|
||||
6. Report summary of all checks
|
||||
|
||||
IMPORTANT: Stop at first failure and report the error clearly.
|
||||
36
commands/commit.md
Normal file
36
commands/commit.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
description: Smart Git commit with automatic lint fixing and CI validation
|
||||
argument-hint: [message]
|
||||
---
|
||||
|
||||
Create a Git commit with the following workflow:
|
||||
|
||||
1. Run `git status` to see all files (tracked, untracked, modified)
|
||||
|
||||
2. **Classify all files** into three categories:
|
||||
- **Project files**: Source code, tests, configs, documentation that belong in repo
|
||||
- **Git-ignored**: Files already matching .gitignore (node_modules, __pycache__, .env, etc.)
|
||||
- **Temporary/scratch**: Random scripts, debug files, test outputs, Claude-generated utilities
|
||||
|
||||
3. **Handle temporary files**:
|
||||
- Create /tmp directory if it doesn't exist
|
||||
- Move all temporary/scratch files to /tmp
|
||||
- Create/update /tmp/README.md documenting:
|
||||
- What each file is
|
||||
- Whether it should be kept temporarily or can be deleted
|
||||
- When it was created
|
||||
- Only update .gitignore if a NEW pattern needs to be added (very rare)
|
||||
|
||||
4. **Stage project files only** (never use `git add -A`)
|
||||
- Explicitly stage each legitimate project file
|
||||
- Ask for confirmation if unsure about any file
|
||||
|
||||
5. Run linters and fix issues (pnpm biome check --write, uv run ruff check --fix, uv run ruff format)
|
||||
|
||||
6. Run type checking (pnpm tsc --noEmit for TypeScript, uv run ty check for Python)
|
||||
|
||||
7. If lint/type fixes were applied, stage those changes
|
||||
|
||||
8. Create a commit with the provided message (or generate one if not provided)
|
||||
|
||||
IMPORTANT: Always maintain a clean working state. Move scratch work to /tmp. Never commit temporary files. Do NOT run tests as part of commit flow.
|
||||
15
commands/lint-fix.md
Normal file
15
commands/lint-fix.md
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
description: Run linters and automatically fix all issues
|
||||
---
|
||||
|
||||
Run all available linters and fix issues:
|
||||
|
||||
1. Detect linter configuration files in project
|
||||
2. Run linters with auto-fix enabled:
|
||||
- For JavaScript/TypeScript: pnpm biome check --write
|
||||
- For Python: uv run ruff check --fix, uv run ruff format
|
||||
- For other detected linters with fix capabilities
|
||||
3. Stage all fixed files
|
||||
4. Report summary of fixes applied
|
||||
|
||||
IMPORTANT: Only run linters that exist in the project. Do not suggest installing new ones.
|
||||
22
commands/pr.md
Normal file
22
commands/pr.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
description: Create a pull request with CI validation and lint checks
|
||||
argument-hint: [title]
|
||||
---
|
||||
|
||||
Create a pull request with the following workflow:
|
||||
|
||||
1. Check current branch and ensure it's not main/master
|
||||
2. Run `git status` to see current state
|
||||
3. Run all linters and automatically fix any issues
|
||||
4. Run type checking
|
||||
5. Stage any lint/type fixes
|
||||
6. If there are uncommitted changes, commit them first
|
||||
7. Push the current branch to remote (with -u flag if needed)
|
||||
8. Create the PR using `gh pr create` with:
|
||||
- Clear title (use argument if provided, or generate from commits)
|
||||
- Summary of changes from all commits in the branch
|
||||
- Test plan checklist
|
||||
9. After PR is created, monitor PR checks status using `gh pr checks`
|
||||
10. Return the PR URL and deployment information from GitHub
|
||||
|
||||
IMPORTANT: Do NOT add any Claude Code attribution or co-author tags. Do NOT run tests locally - rely on GitHub PR checks.
|
||||
23
commands/stage.md
Normal file
23
commands/stage.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
description: Intelligently stage files based on their purpose
|
||||
---
|
||||
|
||||
Smart file staging with three categories:
|
||||
|
||||
1. **Check git status** and categorize untracked/modified files into:
|
||||
- **Project files**: Source code, tests, configs that belong in the repo
|
||||
- **Git-ignored**: Files matching .gitignore patterns (node_modules, __pycache__, .env, etc.)
|
||||
- **Temporary/scratch**: Random scripts, test files, debug outputs created during development
|
||||
|
||||
2. **Detection heuristics**:
|
||||
- Project files: In src/, tests/, config files (package.json, pyproject.toml, tsconfig.json, etc.), documentation
|
||||
- Git-ignored: Check against .gitignore patterns
|
||||
- Temporary: test*.py, scratch.*, debug.*, temp.*, random filenames not following project conventions
|
||||
|
||||
3. **Present categorization** to user with clear breakdown
|
||||
|
||||
4. **Ask for confirmation** before staging project files
|
||||
|
||||
5. **Suggest adding** temporary files to .gitignore if they match patterns
|
||||
|
||||
IMPORTANT: Never blindly stage all files. Always categorize and confirm with user.
|
||||
17
commands/sync.md
Normal file
17
commands/sync.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
description: Sync branch with main/master and resolve conflicts
|
||||
---
|
||||
|
||||
Sync current branch with main branch:
|
||||
|
||||
1. Fetch latest changes from remote
|
||||
2. Identify the main branch (main or master)
|
||||
3. Ensure working directory is clean (fail if uncommitted changes)
|
||||
4. Rebase current branch on latest main
|
||||
5. If conflicts occur:
|
||||
- List all conflicting files
|
||||
- Ask user how to proceed (abort, resolve manually, or auto-resolve if simple)
|
||||
6. Run linters and fix any issues introduced
|
||||
7. Report sync status
|
||||
|
||||
IMPORTANT: Never force-push without explicit confirmation.
|
||||
18
commands/test-debug.md
Normal file
18
commands/test-debug.md
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
description: Run and debug a specific failing test
|
||||
argument-hint: [test-name-or-path]
|
||||
---
|
||||
|
||||
Debug a specific failing test:
|
||||
|
||||
1. Identify the test command for the project (pnpm test, uv run pytest)
|
||||
2. Run the specific test provided in the argument
|
||||
3. If test fails, analyze the error output
|
||||
4. Suggest potential fixes based on the failure
|
||||
5. Allow iterative debugging with repeated test runs
|
||||
6. After test passes, run linters and fix issues (pnpm biome check --write, uv run ruff check --fix, uv run ruff format)
|
||||
7. Run type checking (pnpm tsc --noEmit for TypeScript, uv run ty check for Python)
|
||||
8. Run the test again to ensure it still passes after lint/type fixes
|
||||
9. Stage all changes if everything passes
|
||||
|
||||
IMPORTANT: This is for investigating specific test failures, not for running the full test suite. All linting and type checking must pass before completing.
|
||||
Reference in New Issue
Block a user