evizi-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +506 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/agent/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/agent/.agent/skills/skill-creator/SKILL.md +485 -0
- package/kits/agent/.agent/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/agent/.agent/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/agent/.agent/skills/skill-creator/agents/grader.md +223 -0
- package/kits/agent/.agent/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/agent/.agent/skills/skill-creator/references/schemas.md +430 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/agent/manifest.json +10 -0
- package/kits/claude/.claude/agents/code-pusher.md +46 -0
- package/kits/claude/.claude/agents/feature-document-updater.md +37 -0
- package/kits/claude/.claude/agents/self-reviewer.md +32 -0
- package/kits/claude/.claude/agents/web-auto-agentic-workflow-initializer.md +42 -0
- package/kits/claude/.claude/agents/web-auto-assisted-fix-and-runner.md +36 -0
- package/kits/claude/.claude/agents/web-auto-chrome-devtools-selector-extractor.md +36 -0
- package/kits/claude/.claude/agents/web-auto-coder.md +33 -0
- package/kits/claude/.claude/agents/web-auto-fe-selector-extractor.md +31 -0
- package/kits/claude/.claude/agents/web-auto-fix-and-runner.md +35 -0
- package/kits/claude/.claude/agents/web-auto-lessons-learned-extractor.md +34 -0
- package/kits/claude/.claude/agents/web-auto-playwright-mcp-selector-extractor.md +37 -0
- package/kits/claude/.claude/agents/web-auto-source-instructions-updater.md +43 -0
- package/kits/claude/.claude/agents/web-auto-test-cases-generator.md +29 -0
- package/kits/claude/.claude/agents/web-auto-ticket-designer.md +35 -0
- package/kits/claude/.claude/agents/web-auto-ticket-playbook-planner.md +36 -0
- package/kits/claude/.claude/agents/web-auto.md +382 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/claude/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/claude/.claude/skills/skill-creator/SKILL.md +485 -0
- package/kits/claude/.claude/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/claude/.claude/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/claude/.claude/skills/skill-creator/agents/grader.md +223 -0
- package/kits/claude/.claude/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/claude/.claude/skills/skill-creator/references/schemas.md +430 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/claude/manifest.json +10 -0
- package/kits/cursor/.cursor/agents/code-pusher.agent.md +43 -0
- package/kits/cursor/.cursor/agents/feature-document-updater.agent.md +34 -0
- package/kits/cursor/.cursor/agents/self-reviewer.agent.md +29 -0
- package/kits/cursor/.cursor/agents/web-auto-agentic-workflow-initializer.agent.md +37 -0
- package/kits/cursor/.cursor/agents/web-auto-assisted-fix-and-runner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto-chrome-devtools-selector-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-coder.agent.md +30 -0
- package/kits/cursor/.cursor/agents/web-auto-fe-selector-extractor.agent.md +28 -0
- package/kits/cursor/.cursor/agents/web-auto-fix-and-runner.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-lessons-learned-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-playwright-mcp-selector-extractor.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-source-instructions-updater.agent.md +40 -0
- package/kits/cursor/.cursor/agents/web-auto-test-cases-generator.agent.md +26 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-designer.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-playbook-planner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto.agent.md +379 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/cursor/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/SKILL.md +485 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/kits/cursor/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/cursor/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/cursor/manifest.json +10 -0
- package/kits/github/.github/agents/code-pusher.agent.md +45 -0
- package/kits/github/.github/agents/feature-document-updater.agent.md +36 -0
- package/kits/github/.github/agents/self-reviewer.agent.md +31 -0
- package/kits/github/.github/agents/web-auto-agentic-workflow-initializer.agent.md +39 -0
- package/kits/github/.github/agents/web-auto-assisted-fix-and-runner.agent.md +35 -0
- package/kits/github/.github/agents/web-auto-chrome-devtools-selector-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-coder.agent.md +32 -0
- package/kits/github/.github/agents/web-auto-fe-selector-extractor.agent.md +30 -0
- package/kits/github/.github/agents/web-auto-fix-and-runner.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-lessons-learned-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-playwright-mcp-selector-extractor.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-source-instructions-updater.agent.md +42 -0
- package/kits/github/.github/agents/web-auto-test-cases-generator.agent.md +28 -0
- package/kits/github/.github/agents/web-auto-ticket-designer.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-ticket-playbook-creator.agent.md +35 -0
- package/kits/github/.github/agents/web-auto.agent.md +382 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/SKILL.md +310 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +37 -0
- package/kits/github/.github/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/github/.github/skills/skill-creator/SKILL.md +485 -0
- package/kits/github/.github/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/github/.github/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/github/.github/skills/skill-creator/agents/grader.md +223 -0
- package/kits/github/.github/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/github/.github/skills/skill-creator/references/schemas.md +430 -0
- package/kits/github/.github/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/github/.github/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/github/.github/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/github/.github/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/github/.github/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/github/.github/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/github/.github/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/github/manifest.json +10 -0
- package/kits/shared/docs/ai-code-review.md +440 -0
- package/kits/shared/docs/increase-unit-test-coverage.md +77 -0
- package/kits/shared/docs/pr-review-agent.md +501 -0
- package/kits/shared/docs/self-review-agent.md +246 -0
- package/kits/shared/docs/web-auto-agentic-workflow.md +506 -0
- package/kits/shared/manifest.json +11 -0
- package/kits/shared/skills/fix-automation-tests/SKILL.md +280 -0
- package/kits/shared/skills/fix-automation-tests/scripts/fetch_pr_changes.py +300 -0
- package/kits/shared/skills/fix-automation-tests/templates/impact-report.template.md +42 -0
- package/kits/shared/skills/increase-unit-test-coverage/SKILL.md +117 -0
- package/kits/shared/skills/increase-unit-test-coverage/scripts/filter_low_coverage.py +447 -0
- package/kits/shared/skills/pr-review/SKILL.md +200 -0
- package/kits/shared/skills/pr-review/references/automation.md +62 -0
- package/kits/shared/skills/pr-review/references/backend.md +95 -0
- package/kits/shared/skills/pr-review/references/frontend.md +103 -0
- package/kits/shared/skills/pr-review/references/mobile.md +108 -0
- package/kits/shared/skills/pr-review/references/output-schema.md +130 -0
- package/kits/shared/skills/pr-review/scripts/post-review.py +1395 -0
- package/kits/shared/skills/push-code/SKILL.md +176 -0
- package/kits/shared/skills/self-review/SKILL.md +234 -0
- package/kits/shared/skills/self-review/evals/evals.json +23 -0
- package/kits/shared/skills/self-review/references/automation.md +62 -0
- package/kits/shared/skills/self-review/references/backend.md +95 -0
- package/kits/shared/skills/self-review/references/frontend.md +103 -0
- package/kits/shared/skills/self-review/references/mobile.md +108 -0
- package/kits/shared/skills/self-review/templates/issues.template.md +72 -0
- package/kits/shared/skills/update-feature-document/SKILL.md +156 -0
- package/kits/shared/skills/update-feature-document/templates/delta.template.yaml +58 -0
- package/kits/shared/skills/update-feature-document/templates/feature.template.md +25 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/SKILL.md +130 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-api-error.md +108 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-selector.md +60 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/templates/issues-resolution-report-append.template.md +54 -0
- package/kits/shared/skills/web-auto-chrome-devtools-mcp-extract-selectors/SKILL.md +284 -0
- package/kits/shared/skills/web-auto-coding/SKILL.md +152 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/SKILL.md +168 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/templates/lessons-learned.template.md +115 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/SKILL.md +282 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/SKILL.md +183 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/templates/issues-resolution-report.template.md +77 -0
- package/kits/shared/skills/web-auto-generate-best-practices/SKILL.md +123 -0
- package/kits/shared/skills/web-auto-generate-instructions/SKILL.md +200 -0
- package/kits/shared/skills/web-auto-generate-instructions/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-generate-instructions/references/analysis-guide.md +145 -0
- package/kits/shared/skills/web-auto-generate-instructions/templates/web-auto-instructions.template.md +184 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/SKILL.md +181 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/evals/evals.json +57 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/templates/web-auto-project-blueprint.template.md +161 -0
- package/kits/shared/skills/web-auto-playwright-mcp-extract-selectors/SKILL.md +293 -0
- package/kits/shared/skills/web-auto-test-cases/SKILL.md +138 -0
- package/kits/shared/skills/web-auto-test-cases/evals/evals.json +129 -0
- package/kits/shared/skills/web-auto-test-cases/templates/test-cases.template.md +53 -0
- package/kits/shared/skills/web-auto-ticket-design/SKILL.md +199 -0
- package/kits/shared/skills/web-auto-ticket-design/templates/ticket-design.template.md +138 -0
- package/kits/shared/skills/web-auto-ticket-playbook/SKILL.md +218 -0
- package/kits/shared/skills/web-auto-ticket-playbook/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-ticket-playbook/templates/ticket-playbook.template.md +148 -0
- package/kits/shared/skills/web-auto-update-source-instructions/SKILL.md +156 -0
- package/kits/shared/skills/web-auto-update-source-instructions/evals/evals.json +22 -0
- package/kits/shared/skills/workspace-ai-nav-creator/SKILL.md +168 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/agents-md.template.md +112 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/claude-md.template.md +86 -0
- package/package.json +16 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: push-code
|
|
3
|
+
description: Push current code changes to the Git remote repository. Verifies git identity, stages changes, generates a conventional commit message from the diff, and pushes to the current branch. Use this skill whenever the user wants to push code, commit and push, save changes to remote, git push, send code upstream, ship code, deploy changes to a branch, or sync local work with the remote. Triggers on requests like "push the code", "commit and push", "push my changes", "push to remote", "ship it", "save my work to git", "upload my changes", "sync to remote", even if they don't explicitly mention git โ if they clearly want their local changes sent to a remote repository, use this skill.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Push Code
|
|
7
|
+
|
|
8
|
+
Push current code changes to the Git remote with auto-generated conventional commit messages and clear status reporting.
|
|
9
|
+
|
|
10
|
+
## Input Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Required | Description |
|
|
13
|
+
|-----------|------|----------|-------------|
|
|
14
|
+
| commit_message | string | No | If provided, use this instead of auto-generating. Respect the user's wording. |
|
|
15
|
+
| branch | string | No | Target branch to push to. Defaults to the current branch. |
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
1. Verify git is available and identity is configured
|
|
20
|
+
2. Check current branch and working tree status
|
|
21
|
+
3. Guard against pushing directly to protected branches
|
|
22
|
+
4. Stage changes (only unstaged files when nothing is pre-staged)
|
|
23
|
+
5. Generate a conventional commit message from the diff
|
|
24
|
+
6. Push to remote, setting upstream if needed
|
|
25
|
+
7. Report final status
|
|
26
|
+
|
|
27
|
+
## Workflow
|
|
28
|
+
|
|
29
|
+
### Step 1: Verify Git Configuration
|
|
30
|
+
|
|
31
|
+
Check git availability and identity โ without a configured identity, commits will either fail or be attributed incorrectly, which causes problems for the whole team.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git --version
|
|
35
|
+
git config user.name
|
|
36
|
+
git config user.email
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**If git is not installed** โ Stop and inform the user to install git.
|
|
40
|
+
**If username or email is empty** โ Stop and provide configuration commands:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git config --global user.name "Your Name"
|
|
44
|
+
git config --global user.email "your.email@example.com"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Step 2: Check Branch and Status
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
git branch --show-current
|
|
51
|
+
git status --porcelain
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- Record the current branch name for later steps
|
|
55
|
+
- If the output of `git branch --show-current` is empty, the repo is in **detached HEAD** state โ Stop and tell the user to checkout a branch first (`git checkout -b <branch-name>`)
|
|
56
|
+
- If there are **no changes** (both working tree and staging area are clean) โ Inform the user and stop (this is not an error)
|
|
57
|
+
|
|
58
|
+
### Step 3: Protected Branch Guard
|
|
59
|
+
|
|
60
|
+
Before making any changes, check whether the current branch is a protected branch like `main`, `master`, or `develop`. Pushing directly to these branches bypasses code review and can break the build for the entire team.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
BRANCH=$(git branch --show-current)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If `$BRANCH` is `main`, `master`, or `develop`:
|
|
67
|
+
- **Stop** and warn the user: "You're on `[branch]`, which is typically a protected branch. Create a feature branch first with `git checkout -b <feature-branch>`."
|
|
68
|
+
- Only proceed if the user explicitly confirms they want to push to this branch.
|
|
69
|
+
|
|
70
|
+
### Step 4: Stage Changes
|
|
71
|
+
|
|
72
|
+
Staging is context-sensitive โ if the user has already carefully staged specific files, blindly running `git add -A` would undo their curation by pulling in everything else too.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
git diff --cached --name-only
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- **If there are already staged files** โ Respect the user's staging. Do not add more files. Proceed to Step 5.
|
|
79
|
+
- **If nothing is staged** โ Stage all changes:
|
|
80
|
+
```bash
|
|
81
|
+
git add -A
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 5: Generate Commit Message and Commit
|
|
85
|
+
|
|
86
|
+
Generate a descriptive commit message based on the actual changes. Start with the stat summary to understand scope, then read the full diff for detail:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git diff --cached --stat
|
|
90
|
+
git diff --cached
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Handling large diffs:** If the diff exceeds ~500 lines, rely on `--stat` plus `--cached --name-only` to understand the change scope rather than reading every line. Focus the commit message on the high-level intent.
|
|
94
|
+
|
|
95
|
+
**Handling binary files:** Binary files show up in `--stat` but not in the text diff. Mention them in the commit body if relevant (e.g., "update logo asset").
|
|
96
|
+
|
|
97
|
+
Create a commit message following **conventional commits** format:
|
|
98
|
+
|
|
99
|
+
- **Subject line** (max 72 chars): concise summary of the overall change
|
|
100
|
+
- **Prefix**: `feat:`, `fix:`, `refactor:`, `docs:`, `chore:`, `test:`, `style:`, `ci:`, `build:`
|
|
101
|
+
- If changes span multiple concerns, use the most dominant category
|
|
102
|
+
- For multi-file changes, add a body with bullet points explaining each logical group
|
|
103
|
+
|
|
104
|
+
**Examples:**
|
|
105
|
+
- `feat: add user authentication middleware`
|
|
106
|
+
- `fix: resolve null pointer in payment processing`
|
|
107
|
+
- `refactor: extract shared validation logic into utils`
|
|
108
|
+
- `docs: update API endpoint documentation`
|
|
109
|
+
- `chore: update dependencies and config files`
|
|
110
|
+
|
|
111
|
+
If the user provided a `commit_message` parameter, use that instead of auto-generating.
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
git commit -m "<message>"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
If the commit fails (e.g., pre-commit hooks reject it), stop and report the hook output so the user can fix lint/format issues.
|
|
118
|
+
|
|
119
|
+
### Step 6: Push to Remote
|
|
120
|
+
|
|
121
|
+
First check whether the branch has an upstream tracking reference โ without one, `git push` will fail with a confusing error about no tracking information.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
- **If upstream exists** โ Push normally:
|
|
128
|
+
```bash
|
|
129
|
+
git push
|
|
130
|
+
```
|
|
131
|
+
- **If no upstream** โ Set upstream and push:
|
|
132
|
+
```bash
|
|
133
|
+
git push --set-upstream origin $(git branch --show-current)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Step 7: Report Status
|
|
137
|
+
|
|
138
|
+
**On success:**
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
โ
Push Completed
|
|
142
|
+
|
|
143
|
+
- Branch: [branch_name]
|
|
144
|
+
- Commit: [short_hash] โ [commit message]
|
|
145
|
+
- Files changed: [count]
|
|
146
|
+
- Pushed to: origin/[branch_name]
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**On failure:**
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
โ Push Failed
|
|
153
|
+
|
|
154
|
+
- Step: [which step failed]
|
|
155
|
+
- Error: [error message]
|
|
156
|
+
- Suggested fix: [actionable guidance]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Error Handling
|
|
160
|
+
|
|
161
|
+
Each git step depends on the previous one succeeding โ a failed stage means the commit will be wrong, and a failed commit means there's nothing to push. Stop at the first failure and report clearly so the user can fix the root cause rather than chasing cascading errors.
|
|
162
|
+
|
|
163
|
+
| Scenario | Action |
|
|
164
|
+
|----------|--------|
|
|
165
|
+
| Git not installed | Stop, inform user to install git |
|
|
166
|
+
| Identity not configured | Stop, provide `git config` commands |
|
|
167
|
+
| Detached HEAD | Stop, suggest `git checkout -b <branch-name>` |
|
|
168
|
+
| On protected branch | Warn user, stop unless they explicitly confirm |
|
|
169
|
+
| No changes to commit | Inform user, stop gracefully |
|
|
170
|
+
| Staging fails | Report error, stop |
|
|
171
|
+
| Commit fails (pre-commit hook) | Show hook output, suggest fixing lint/format issues, re-stage, commit again |
|
|
172
|
+
| Commit fails (other) | Report error, stop |
|
|
173
|
+
| Push fails โ auth error | Suggest PAT (HTTPS) or SSH key setup |
|
|
174
|
+
| Push fails โ rejected (behind remote) | Suggest `git pull --rebase origin [branch]`, resolve conflicts, retry |
|
|
175
|
+
| Push fails โ no upstream | Use `git push --set-upstream origin [branch]` (handled automatically in Step 6) |
|
|
176
|
+
| Push fails โ remote not found | Suggest `git remote add origin <url>` |
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: self-review
|
|
3
|
+
description: Perform automated pre-PR code review with clear verdict. Analyzes branch changes against the target branch, generates a table-based report with severity-categorized issues, and provides a Ready/Not Ready decision for PR creation. Use this skill whenever the user mentions self-review, reviewing code, checking changes before PR, asking if code is ready for PR or merge, wanting a code quality check, pre-merge review, or any variation of "review my branch". Also trigger for phrases like "check my diff", "anything wrong with my changes", "am I ready to merge", or "scan my code for issues" โ even if the user doesn't explicitly say "self-review".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Self Review Skill
|
|
7
|
+
|
|
8
|
+
Review code changes between current branch and target branch, providing a clear verdict and structured feedback in table format for quick verification before creating a PR.
|
|
9
|
+
|
|
10
|
+
## Input Parameters
|
|
11
|
+
|
|
12
|
+
| Parameter | Type | Required | Description |
|
|
13
|
+
|-----------|------|----------|-------------|
|
|
14
|
+
| `TICKET_ID` | string | No | If provided, `issues.md` is saved to `.tickets/{TICKET_ID}/issues.md`. If omitted, saved to the project root. |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
1. Read config from `project.config.json` in `.documents-design/`
|
|
19
|
+
2. Run `git diff` against target branch
|
|
20
|
+
3. Analyze changes for issues
|
|
21
|
+
4. Generate report in `issues.md`
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
### Step 1: Load Configuration
|
|
26
|
+
|
|
27
|
+
Read `project.config.json` from `.documents-design/`. Extract:
|
|
28
|
+
- `baseBranch` - the branch to compare against
|
|
29
|
+
- `excludePaths` (optional) - glob patterns for files to skip during review
|
|
30
|
+
|
|
31
|
+
**If config missing:** STOP, ask user to create `project.config.json`
|
|
32
|
+
|
|
33
|
+
### Step 2: Check for Untracked Files
|
|
34
|
+
|
|
35
|
+
Before analyzing changes, check for untracked files that won't be included in the diff:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git ls-files --others --exclude-standard
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**If untracked files found:**
|
|
42
|
+
1. Run `git add <files>` for each untracked file automatically
|
|
43
|
+
2. Inform the user:
|
|
44
|
+
```
|
|
45
|
+
โน๏ธ Staged X untracked file(s) for review:
|
|
46
|
+
- path/to/file1.ts
|
|
47
|
+
- path/to/file2.tsx
|
|
48
|
+
```
|
|
49
|
+
3. Proceed to Step 3
|
|
50
|
+
|
|
51
|
+
**If no untracked files:** Proceed directly to Step 3.
|
|
52
|
+
|
|
53
|
+
### Step 3: Get Changes
|
|
54
|
+
|
|
55
|
+
**Use three-dot diff (`...`) to scope the review to only the current branch's own commits.**
|
|
56
|
+
|
|
57
|
+
Two-dot diff (`git diff origin/main HEAD`) compares the full tree difference, which includes unrelated changes from other branches. Three-dot diff (`git diff origin/main...HEAD`) uses the merge-base, showing only changes introduced by the current branch's commits. This distinction matters when the branch was created from another feature branch โ two-dot would include that feature branch's changes, while three-dot correctly isolates only the current branch's contributions.
|
|
58
|
+
|
|
59
|
+
Run git commands to get changes between current branch and target branch:
|
|
60
|
+
|
|
61
|
+
1. Fetch the latest target branch to ensure accurate diff:
|
|
62
|
+
```
|
|
63
|
+
git fetch origin <target-branch>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. List the branch's own commits (for scope verification):
|
|
67
|
+
```
|
|
68
|
+
git log origin/<target-branch>..HEAD --oneline
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
3. Get list of changed files (three-dot):
|
|
72
|
+
```
|
|
73
|
+
git diff origin/<target-branch>...HEAD --name-only
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
4. Get detailed line-by-line diff (three-dot):
|
|
77
|
+
```
|
|
78
|
+
git diff origin/<target-branch>...HEAD --unified=3
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**If no changes:** STOP, inform user.
|
|
82
|
+
|
|
83
|
+
**Check for branch divergence:** After fetching, check how far the branch has diverged from the target:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git log HEAD..origin/<target-branch> --oneline | wc -l
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If the target branch has new commits that the current branch doesn't have (i.e., the count is > 0), warn the user. The three-dot diff correctly reviews only the current branch's changes, but it cannot detect incompatibilities with new code on the target branch โ for example, the target branch may have renamed a function the current branch still calls, deleted an API the current branch depends on, or introduced a duplicate implementation.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
โ ๏ธ Target branch has X new commit(s) since this branch diverged.
|
|
93
|
+
The review covers your branch's changes only. It cannot detect conflicts or incompatibilities with the new code on <target-branch>.
|
|
94
|
+
Consider rebasing before PR: git rebase origin/<target-branch>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Include this warning in the report header (below the verdict) so it's visible.
|
|
98
|
+
|
|
99
|
+
**If large diff (>30 files or >2000 lines):** Prioritize review by focusing on:
|
|
100
|
+
1. Files with the most additions/modifications first
|
|
101
|
+
2. Source code over generated files, configs, or lock files
|
|
102
|
+
3. Files that touch security-sensitive areas (auth, payments, data access)
|
|
103
|
+
|
|
104
|
+
Mention in the report summary that the review was prioritized and which files were given deeper attention.
|
|
105
|
+
|
|
106
|
+
### Step 4: Analyze
|
|
107
|
+
|
|
108
|
+
#### 1. Identify Tech Stack
|
|
109
|
+
|
|
110
|
+
Determine the project type by checking the extensions of **changed files** (not the entire repo):
|
|
111
|
+
|
|
112
|
+
- **Frontend**: `.tsx`, `.jsx`, `.vue`, `.svelte`, `.css`, `.scss`
|
|
113
|
+
- **Backend**: `.java`, `.go`, `.py`, `.rb`, `.cs`, `.sql`
|
|
114
|
+
- **Mobile**: `.swift`, `.kt`, `Podfile`, `AndroidManifest.xml`
|
|
115
|
+
- **Automation**: `spec.ts`, `spec.js`, `.test.ts`, `.test.js`, `Test.java`, `_test.go`
|
|
116
|
+
|
|
117
|
+
A project can span multiple stacks โ for instance, a full-stack change might include both `.tsx` and `.java` files. Identify all applicable stacks.
|
|
118
|
+
|
|
119
|
+
#### 2. Load Domain Checklists
|
|
120
|
+
|
|
121
|
+
Based on the detected stack(s), **read the corresponding reference file(s)**:
|
|
122
|
+
|
|
123
|
+
| Stack | Reference File |
|
|
124
|
+
|-------|----------------|
|
|
125
|
+
| **Frontend** | `references/frontend.md` |
|
|
126
|
+
| **Backend** | `references/backend.md` |
|
|
127
|
+
| **Mobile** | `references/mobile.md` |
|
|
128
|
+
| **Automation** | `references/automation.md` |
|
|
129
|
+
|
|
130
|
+
For mixed-stack changes, load all relevant checklists and apply each to its corresponding files.
|
|
131
|
+
|
|
132
|
+
#### 3. Load Project-Specific Guidelines
|
|
133
|
+
|
|
134
|
+
Check `.documents-design/` for project-level documents that define conventions specific to this codebase. These take priority over generic checklists when they conflict โ the project's own rules are what the PR reviewer will enforce.
|
|
135
|
+
|
|
136
|
+
| Document | Path | What to check |
|
|
137
|
+
|----------|------|---------------|
|
|
138
|
+
| **Project Blueprint** | `.documents-design/*-project-blueprint.md` | Naming conventions, directory structure, selector strategy, architectural patterns. Flag violations as โ ๏ธ Warning. |
|
|
139
|
+
| **Project Instructions** | `.documents-design/*-instructions.md` | Code patterns, templates, and idioms the project uses. Flag deviations as โ ๏ธ Warning โ the code should match established patterns. |
|
|
140
|
+
| **Best Practices** | `.documents-design/*-best-practices.md` | Coding standards, rules, and anti-patterns. Flag rule violations by their documented severity; anti-pattern violations are โ ๏ธ Warning. |
|
|
141
|
+
|
|
142
|
+
**If none of these files exist:** Proceed with only the domain checklists. This is fine โ not every project has these.
|
|
143
|
+
|
|
144
|
+
**If found:** Read each document and extract the relevant conventions. During the review, check changed code against both the domain checklist AND project-specific rules. When reporting issues from project guidelines, use the category "Project Convention" so the developer knows the rule comes from the project's own docs, not a generic checklist.
|
|
145
|
+
|
|
146
|
+
#### 4. Perform Review
|
|
147
|
+
|
|
148
|
+
Read the entire diff before starting analysis โ context across files often reveals issues that single-file review misses (e.g., an API endpoint added in the backend without corresponding frontend error handling).
|
|
149
|
+
|
|
150
|
+
Focus on the **changed lines and their immediate context**, not the entire file. The goal is to catch issues introduced by this branch, not audit the whole codebase. However, do check whether changed code interacts poorly with surrounding unchanged code (e.g., a new function call that doesn't match an existing function signature).
|
|
151
|
+
|
|
152
|
+
Classify issues by severity:
|
|
153
|
+
|
|
154
|
+
- **โ Critical** โ Bugs, security vulnerabilities, breaking changes, data loss risks. These block the PR because they'd cause real harm if deployed.
|
|
155
|
+
- **โ ๏ธ Warning** โ Code quality, readability, maintainability issues, missing error handling. These won't break production but make the code harder to work with over time.
|
|
156
|
+
- **๐ก Suggestion** โ Patterns, optimizations, naming improvements. Nice to have but not worth blocking a PR.
|
|
157
|
+
|
|
158
|
+
**Severity calibration matters.** Inflating severity wastes reviewer trust โ if everything is "critical", the developer starts ignoring the report. Reserve critical for issues that would actually cause production incidents. Style-only concerns (naming, formatting) are suggestions at most. Missing null checks on internal code with guaranteed inputs are warnings, not critical. A SQL injection vector on user-facing input is genuinely critical.
|
|
159
|
+
|
|
160
|
+
### Step 5: Generate Report
|
|
161
|
+
|
|
162
|
+
**Output path:**
|
|
163
|
+
- If `TICKET_ID` was provided: `.tickets/{TICKET_ID}/issues.md`
|
|
164
|
+
- Otherwise: `issues.md` (project root)
|
|
165
|
+
|
|
166
|
+
**Template:** `templates/issues.template.md`
|
|
167
|
+
|
|
168
|
+
The report includes:
|
|
169
|
+
1. **Verdict** โ Clear decision: Ready / Not Ready for PR
|
|
170
|
+
2. **Summary** โ Count of files reviewed and issues by severity
|
|
171
|
+
3. **Files Reviewed** โ Table with file status, lines changed, and issue count
|
|
172
|
+
4. **Issues by Severity** โ Tables with file, line, category, issue, and recommendation
|
|
173
|
+
5. **No code snippets** โ Keep the report compact and scannable. The developer already has the diff; what they need is location + what's wrong + how to fix it.
|
|
174
|
+
|
|
175
|
+
### Step 6: Show Summary in Chat
|
|
176
|
+
|
|
177
|
+
After generating `issues.md`, display a concise summary in chat:
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
โ
Self-review complete! Generated issues.md at {output_path}
|
|
181
|
+
|
|
182
|
+
๐ Summary:
|
|
183
|
+
- Files Reviewed: X
|
|
184
|
+
- โ Critical: X issues
|
|
185
|
+
- โ ๏ธ Warnings: X issues
|
|
186
|
+
- ๐ก Suggestions: X issues
|
|
187
|
+
|
|
188
|
+
Verdict: [โ
Ready to Create PR | โ ๏ธ Ready with Warnings | โ Not Ready for PR]
|
|
189
|
+
[Action message based on verdict]
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Action messages:**
|
|
193
|
+
- โ
Ready: "All checks passed! You can create the PR."
|
|
194
|
+
- โ ๏ธ Ready with Warnings: "Consider addressing warnings before PR."
|
|
195
|
+
- โ Not Ready: "Fix critical issues before proceeding."
|
|
196
|
+
|
|
197
|
+
## Files
|
|
198
|
+
|
|
199
|
+
| File | Purpose |
|
|
200
|
+
|------|---------|
|
|
201
|
+
| `templates/issues.template.md` | Report format |
|
|
202
|
+
| `references/frontend.md` | Frontend (React, Vue, Angular, etc.) checklist |
|
|
203
|
+
| `references/backend.md` | Backend (API, database, security) checklist |
|
|
204
|
+
| `references/mobile.md` | Mobile (iOS, Android) checklist |
|
|
205
|
+
| `references/automation.md` | E2E / integration test checklist |
|
|
206
|
+
|
|
207
|
+
### Project-Specific Files (loaded at runtime if present)
|
|
208
|
+
|
|
209
|
+
| File | Purpose |
|
|
210
|
+
|------|---------|
|
|
211
|
+
| `.documents-design/*-project-blueprint.md` | Architecture, naming, directory structure, selector strategy |
|
|
212
|
+
| `.documents-design/*-instructions.md` | Code patterns and templates from the codebase |
|
|
213
|
+
| `.documents-design/*-best-practices.md` | Coding standards, rules, anti-patterns |
|
|
214
|
+
|
|
215
|
+
## Configuration
|
|
216
|
+
|
|
217
|
+
Required in `.documents-design/project.config.json`:
|
|
218
|
+
|
|
219
|
+
```json
|
|
220
|
+
{
|
|
221
|
+
"baseBranch": "main",
|
|
222
|
+
"excludePaths": ["*.lock", "*.generated.*"]
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
`excludePaths` is optional โ when provided, files matching these glob patterns are skipped during review.
|
|
227
|
+
|
|
228
|
+
## Verdict Logic
|
|
229
|
+
|
|
230
|
+
| Verdict | Criteria |
|
|
231
|
+
|---------|----------|
|
|
232
|
+
| **โ
Ready to Create PR** | Zero critical issues |
|
|
233
|
+
| **โ ๏ธ Ready with Warnings** | Zero critical, some warnings or suggestions |
|
|
234
|
+
| **โ Not Ready for PR** | One or more critical issues |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "self-review",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Self-review for PROJ-456",
|
|
7
|
+
"expected_output": "Loads config, runs three-dot diff, detects tech stack from changed files, loads correct domain checklist(s), generates issues.md at .tickets/PROJ-456/issues.md with verdict, shows summary in chat",
|
|
8
|
+
"files": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 2,
|
|
12
|
+
"prompt": "I just finished a full-stack feature that touches both React components and Java API endpoints. Can you check my changes before I create the PR?",
|
|
13
|
+
"expected_output": "Detects both frontend and backend stacks, loads both frontend.md and backend.md checklists, reviews .tsx files against frontend checklist and .java files against backend checklist, generates combined report",
|
|
14
|
+
"files": []
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": 3,
|
|
18
|
+
"prompt": "Am I ready to merge? I've got like 50 files changed across the whole monorepo - mostly config updates but also some auth changes",
|
|
19
|
+
"expected_output": "Handles large diff gracefully with prioritization strategy, flags auth-related changes for deeper review, mentions in summary that review was prioritized, provides accurate verdict",
|
|
20
|
+
"files": []
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Automation Test Review Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when reviewing E2E or integration tests (Playwright, Cypress, Selenium, WebdriverIO, etc.).
|
|
4
|
+
|
|
5
|
+
> **Severity guide**: Each item is tagged with a default severity. Adjust based on context โ a hard-coded wait in a quick smoke test is a suggestion, but in a CI-gating test suite it's a warning.
|
|
6
|
+
> - โ = Critical (blocks PR)
|
|
7
|
+
> - โ ๏ธ = Warning (should fix)
|
|
8
|
+
> - ๐ก = Suggestion (nice to have)
|
|
9
|
+
|
|
10
|
+
## โฑ๏ธ Stability & Waits (review first โ #1 cause of flaky tests)
|
|
11
|
+
- โ **No Hard Waits**: Avoid `sleep()`, `page.waitForTimeout()`, or fixed delays. Use dynamic waits (`waitForSelector`, `waitForResponse`, `expect().toBeVisible()`). Hard waits are the leading cause of flaky tests โ they're either too short (test fails) or too long (suite is slow).
|
|
12
|
+
- โ ๏ธ **Race Conditions**: Are async operations properly awaited? Missing `await` before Playwright/Cypress commands causes non-deterministic failures.
|
|
13
|
+
- โ ๏ธ **Timeout Configuration**: Are explicit timeouts set on actions and assertions? Relying on framework defaults (30s/60s) masks slow tests.
|
|
14
|
+
- โ ๏ธ **Network Waits**: Are tests waiting for API responses to complete before asserting on rendered data? (`waitForResponse`, `cy.intercept`)
|
|
15
|
+
- ๐ก **Retry on Assertion**: Are auto-retrying assertions used (`expect(locator).toHaveText()` in Playwright, `.should()` in Cypress) instead of manual retry loops?
|
|
16
|
+
|
|
17
|
+
## ๐ฏ Selectors & Locators
|
|
18
|
+
- โ **Stable Selectors**: Are selectors resilient to UI changes? Using CSS classes tied to styling (`.btn-primary`) or fragile XPath (`/div[3]/span[2]`) breaks when the UI is refactored.
|
|
19
|
+
- โ ๏ธ **Selector Priority**: Follow: `data-testid` > `role` / ARIA > `id` > CSS > XPath (last resort)
|
|
20
|
+
- โ ๏ธ **Unique Selectors**: Are selectors specific enough to match exactly one element? Ambiguous selectors cause tests to interact with the wrong element.
|
|
21
|
+
- ๐ก **Playwright Locators**: Prefer Playwright's built-in locators (`getByRole`, `getByText`, `getByTestId`) over raw CSS selectors โ they auto-wait and provide better error messages.
|
|
22
|
+
|
|
23
|
+
## ๐งน Isolation & Cleanup
|
|
24
|
+
- โ **Test Independence**: Can each test run in isolation, in any order? Tests that depend on prior test state are fragile and impossible to parallelize.
|
|
25
|
+
- โ ๏ธ **Teardown**: Does `afterEach`/`afterAll` clean up created data (even on failure)? Leaked test data poisons later runs.
|
|
26
|
+
- โ ๏ธ **Own Test Data**: Does each test create its own seed data via API or fixtures? Shared data causes inter-test interference.
|
|
27
|
+
- ๐ก **Parallel Safe**: Can tests run in parallel without conflicts? (No shared mutable state, no port collisions)
|
|
28
|
+
|
|
29
|
+
## ๐ Security & Data
|
|
30
|
+
- โ **No Hardcoded Secrets**: Are credentials, tokens, and API keys in environment variables or config, not in test code?
|
|
31
|
+
- โ ๏ธ **Test Data Privacy**: Is PII/sensitive data anonymized or mocked?
|
|
32
|
+
- ๐ก **API Keys Separation**: Are test API keys separate from production?
|
|
33
|
+
|
|
34
|
+
## ๐ Error Handling & Debugging
|
|
35
|
+
- โ ๏ธ **Screenshots on Failure**: Are screenshots/videos/traces captured automatically on test failure?
|
|
36
|
+
- โ ๏ธ **Meaningful Assertions**: Do assertion messages explain WHAT failed and WHY? (`expect(count).toBe(5, 'Cart should have 5 items after adding')` not just `expect(count).toBe(5)`)
|
|
37
|
+
- โ ๏ธ **Trace / Debug Logs**: Are critical user actions logged for troubleshooting? (`console.log('Clicked checkout button')`)
|
|
38
|
+
- ๐ก **Error Recovery**: Are expected transient failures (e.g., toast auto-dismiss) handled gracefully with retry or conditional logic?
|
|
39
|
+
|
|
40
|
+
## ๐งฑ Code Quality & Patterns
|
|
41
|
+
- โ ๏ธ **Page Object Pattern**: Is test logic separated from locators/selectors? Page Object Model (or equivalent abstraction) keeps tests readable and locators maintainable.
|
|
42
|
+
- โ ๏ธ **Explicit Assertions**: Does every test action have a corresponding assertion? Actions without assertions pass even when the feature is broken.
|
|
43
|
+
- โ ๏ธ **Descriptive Names**: Does the test name describe the behavior being verified? (`should show error when login with expired token` โ not `test1` or `loginTest`)
|
|
44
|
+
- โ ๏ธ **Given-When-Then / AAA**: Is test structure clear? (Arrange preconditions โ Act on the system โ Assert expected outcome)
|
|
45
|
+
- ๐ก **Positive & Negative Tests**: Does the test verify both success and error scenarios?
|
|
46
|
+
- ๐ก **DRY Helpers**: Are repeated setup sequences (login, navigate, seed data) extracted to reusable helpers?
|
|
47
|
+
|
|
48
|
+
## ๐ Environment & CI
|
|
49
|
+
- โ **CI Ready**: Will the test run in headless mode without display dependencies? (No `headless: false` left in CI config)
|
|
50
|
+
- โ ๏ธ **Environment Agnostic**: Does the test work across environments (dev/staging/prod) using config โ not hardcoded URLs or ports?
|
|
51
|
+
- โ ๏ธ **Test Duration**: Does each test complete in a reasonable time? (< 2 min per E2E test, < 10 min total suite for CI gating)
|
|
52
|
+
- ๐ก **External Dependencies**: Are external APIs/services mocked or stubbed to avoid flakiness from third-party outages?
|
|
53
|
+
- ๐ก **Test Reporting**: Are results reported in a format CI can parse (JUnit XML, HTML report)?
|
|
54
|
+
|
|
55
|
+
## ๐ Test Data Management
|
|
56
|
+
- โ ๏ธ **Data Setup via API**: Are test preconditions set up via API calls rather than through the UI? API setup is faster and more reliable.
|
|
57
|
+
- ๐ก **Fixtures / Factories**: Are reusable data factories or fixture files used for test data generation?
|
|
58
|
+
- ๐ก **Database Seeding**: For complex scenarios, is the database seeded directly rather than clicking through UI flows?
|
|
59
|
+
|
|
60
|
+
## โฟ Accessibility (Optional)
|
|
61
|
+
- ๐ก **A11y Validation**: Are basic accessibility rules checked during E2E flows (e.g., axe-core integration)?
|
|
62
|
+
- ๐ก **Keyboard Navigation**: Can critical flows complete using keyboard only?
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Backend Code Review Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when reviewing Backend, API, or Database code.
|
|
4
|
+
|
|
5
|
+
> **Severity guide**: Each item is tagged with a default severity. Adjust based on context โ a missing index on a rarely-queried column is a suggestion, but on a high-traffic endpoint it's a warning.
|
|
6
|
+
> - โ = Critical (blocks PR)
|
|
7
|
+
> - โ ๏ธ = Warning (should fix)
|
|
8
|
+
> - ๐ก = Suggestion (nice to have)
|
|
9
|
+
|
|
10
|
+
## ๐ Security โ OWASP (review first)
|
|
11
|
+
- โ **SQL Injection**: Are parameterized queries / prepared statements used? Raw SQL with string-concatenated user input is the most exploited web vulnerability.
|
|
12
|
+
- โ **Authentication**: Are endpoints requiring auth properly protected?
|
|
13
|
+
- โ **Authorization**: Does the user have permission to access this specific resource? (Check for IDOR โ can user A access user B's data by changing an ID?)
|
|
14
|
+
- โ **No Hardcoded Secrets**: Are credentials, API keys, and tokens in env vars or secret managers (not committed in code)?
|
|
15
|
+
- โ **Password Hashing**: Are passwords hashed with bcrypt/Argon2? (MD5/SHA1 are broken for passwords)
|
|
16
|
+
- โ ๏ธ **JWT/Token Validation**: Are tokens verified, checked for expiry, and scoped correctly?
|
|
17
|
+
- โ ๏ธ **XSS Prevention**: Is user input sanitized before rendering in responses?
|
|
18
|
+
- โ ๏ธ **Safe Error Messages**: Do error responses hide internal details? (No stack traces, SQL errors, or file paths to the client)
|
|
19
|
+
- โ ๏ธ **Sensitive Data in Logs**: Is PII redacted from logs and error messages?
|
|
20
|
+
- โ ๏ธ **CORS Configuration**: Are CORS headers restrictive? (`Access-Control-Allow-Origin: *` in production is almost always wrong)
|
|
21
|
+
- โ ๏ธ **CSRF Protection**: Are state-changing endpoints protected from cross-site request forgery?
|
|
22
|
+
- โ ๏ธ **File Upload Security**: Are uploaded files validated for type, size, and content? Are they stored outside the web root?
|
|
23
|
+
- ๐ก **Rate Limiting Headers**: Do rate-limited endpoints return `Retry-After` and `X-RateLimit-*` headers?
|
|
24
|
+
|
|
25
|
+
## โ
Input Validation & Data
|
|
26
|
+
- โ **Input Validation**: Are all API inputs validated at the boundary? Unvalidated input is the root cause of injection attacks.
|
|
27
|
+
- โ ๏ธ **Type Checking**: Are input types validated (string, int, email format, UUID)?
|
|
28
|
+
- โ ๏ธ **Boundary Checks**: Are ranges validated (min/max length, value ranges, array sizes)?
|
|
29
|
+
- โ ๏ธ **Required Fields**: Are required fields enforced?
|
|
30
|
+
- ๐ก **Business Rules**: Are domain-specific rules validated (e.g., quantity > 0, date in future)?
|
|
31
|
+
|
|
32
|
+
## ๐ API Design & HTTP
|
|
33
|
+
- โ ๏ธ **HTTP Status Codes**: Are correct codes used? (200, 201, 400, 401, 403, 404, 409, 500)
|
|
34
|
+
- โ ๏ธ **REST Principles**: Do endpoints follow REST conventions (GET reads, POST creates, PUT/PATCH updates, DELETE removes)?
|
|
35
|
+
- โ ๏ธ **Response Format**: Is JSON structure consistent across endpoints (same envelope, error format)?
|
|
36
|
+
- ๐ก **API Versioning**: Is the API versioned (e.g., `/v1/users`) for breaking changes?
|
|
37
|
+
- ๐ก **Content-Type**: Are proper content-type headers set on requests and responses?
|
|
38
|
+
|
|
39
|
+
## ๐พ Database & Queries
|
|
40
|
+
- โ **Transactions**: Are multi-step updates wrapped in transactions? Partial writes corrupt data.
|
|
41
|
+
- โ ๏ธ **N+1 Queries**: Are loops triggering individual DB calls? (Use `JOIN`, batch loading, or `IN` clause)
|
|
42
|
+
- โ ๏ธ **Connection Management**: Are DB connections properly closed/returned to pool?
|
|
43
|
+
- โ ๏ธ **Pagination**: Do list endpoints paginate large datasets? Unbounded queries can OOM.
|
|
44
|
+
- ๐ก **Indexing**: Are foreign keys and frequently-queried/filtered columns indexed?
|
|
45
|
+
- ๐ก **Query Optimization**: Are slow queries analyzed (EXPLAIN) for missing indexes or full scans?
|
|
46
|
+
- ๐ก **Query Limits**: Are queries limited with a ceiling (e.g., `LIMIT 1000`) as a safety net?
|
|
47
|
+
|
|
48
|
+
## โก Performance & Scalability
|
|
49
|
+
- โ ๏ธ **Timeouts**: Are external API calls wrapped with timeouts? A hanging dependency can cascade.
|
|
50
|
+
- โ ๏ธ **Rate Limiting**: Are public endpoints protected from abuse/DDoS?
|
|
51
|
+
- ๐ก **Caching**: Are expensive or frequently-read queries/responses cached appropriately?
|
|
52
|
+
- ๐ก **Lazy Loading**: Are large objects (files, blobs) loaded only when requested?
|
|
53
|
+
- ๐ก **Async Processing**: Are long-running tasks offloaded to queues/workers instead of blocking the request?
|
|
54
|
+
|
|
55
|
+
## ๐งฑ Error Handling & Resilience
|
|
56
|
+
- โ ๏ธ **Error Handling**: Are errors caught, logged with context, and returned with appropriate HTTP status?
|
|
57
|
+
- โ ๏ธ **Idempotency**: Can create/update operations be safely retried without side effects? (Important for payment flows, webhooks)
|
|
58
|
+
- ๐ก **Graceful Degradation**: Does the service handle dependency failures without cascading?
|
|
59
|
+
- ๐ก **Circuit Breakers**: Are failing external services circuit-broken?
|
|
60
|
+
- ๐ก **Retry Logic**: Are transient failures retried with exponential backoff and jitter?
|
|
61
|
+
|
|
62
|
+
## ๐ Observability & Monitoring
|
|
63
|
+
- โ ๏ธ **Logging**: Are errors logged with enough context (`request_id`, `user_id`, `timestamp`)?
|
|
64
|
+
- โ ๏ธ **Structured Logs**: Are logs in structured format (JSON) for parsing by log aggregators?
|
|
65
|
+
- ๐ก **Tracing**: Can requests be traced across services (trace_id/span_id)?
|
|
66
|
+
- ๐ก **Health Checks**: Does the service expose `/health` and `/ready` endpoints?
|
|
67
|
+
- ๐ก **Metrics**: Are key metrics exposed (latency, error rate, throughput)?
|
|
68
|
+
|
|
69
|
+
## ๐ Concurrency & State
|
|
70
|
+
- โ **Race Conditions**: Are concurrent updates handled? (e.g., optimistic locking, `SELECT ... FOR UPDATE`)
|
|
71
|
+
- โ ๏ธ **Concurrency Safety**: Is shared state protected (locks/mutex) in async or multi-threaded code?
|
|
72
|
+
- ๐ก **Stateless Design**: Is the service stateless for horizontal scaling?
|
|
73
|
+
|
|
74
|
+
## ๐งช Testing
|
|
75
|
+
- โ ๏ธ **Unit Tests**: Are business logic and edge cases tested?
|
|
76
|
+
- โ ๏ธ **Error Scenarios**: Are error paths tested (not just happy path)?
|
|
77
|
+
- ๐ก **Integration Tests**: Are database and API interactions tested end-to-end?
|
|
78
|
+
- ๐ก **Test Isolation**: Do tests use isolated data and clean up after themselves?
|
|
79
|
+
|
|
80
|
+
## ๐ Migrations & Deployments
|
|
81
|
+
- โ **Backward Compatible**: Can old code run with new schema during rolling deployment? Dropping a column that old code still reads causes outages.
|
|
82
|
+
- โ ๏ธ **Migration Rollback**: Can database migrations be safely rolled back?
|
|
83
|
+
- ๐ก **Zero Downtime**: Does the change support rolling deployments?
|
|
84
|
+
- ๐ก **Breaking API Changes**: Are breaking changes properly versioned with deprecation notices?
|
|
85
|
+
|
|
86
|
+
## ๐๏ธ Code Structure & Maintainability
|
|
87
|
+
- โ ๏ธ **Separation of Concerns**: Is business logic separated from routing/controllers?
|
|
88
|
+
- โ ๏ธ **DRY Principle**: Is duplicated code refactored?
|
|
89
|
+
- ๐ก **Magic Numbers**: Are hardcoded values extracted to constants/config?
|
|
90
|
+
- ๐ก **Naming Conventions**: Are variables, functions, and classes clearly named?
|
|
91
|
+
|
|
92
|
+
## ๐ฆ Dependencies
|
|
93
|
+
- โ ๏ธ **Vulnerable Packages**: Are dependencies scanned for known CVEs?
|
|
94
|
+
- ๐ก **Version Pinning**: Are dependency versions locked/pinned?
|
|
95
|
+
- ๐ก **Unused Dependencies**: Are unused packages removed?
|