@hasna/assistants 1.1.97 → 1.1.98
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.
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codereview
|
|
3
|
+
description: Review code for bugs, security issues, performance problems, and style. Accepts a file path, diff, or inline code snippet.
|
|
4
|
+
argument-hint: [file-path-or-diff]
|
|
5
|
+
allowed-tools: Read, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Code Review
|
|
9
|
+
|
|
10
|
+
Review the following for: $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
### What to look for
|
|
13
|
+
|
|
14
|
+
1. **Bugs & correctness** — logic errors, off-by-one, null/undefined handling, edge cases, incorrect assumptions
|
|
15
|
+
2. **Security** — injection risks (SQL, shell, XSS), hardcoded secrets, insecure defaults, improper input validation, path traversal
|
|
16
|
+
3. **Performance** — N+1 queries, unnecessary re-renders, blocking operations, missing indexes, large allocations
|
|
17
|
+
4. **Readability** — unclear naming, overly complex logic that could be simplified, missing or misleading comments
|
|
18
|
+
5. **Error handling** — swallowed errors, missing error boundaries, unclear error messages
|
|
19
|
+
6. **Type safety** — `any` types, unsafe casts, missing nullability checks
|
|
20
|
+
|
|
21
|
+
### Process
|
|
22
|
+
|
|
23
|
+
1. If `$ARGUMENTS` is a file path, read the file first with the Read tool
|
|
24
|
+
2. If it's a glob or directory, read the relevant files
|
|
25
|
+
3. If it's inline code, review it directly
|
|
26
|
+
4. For each issue found, state: **location** → **severity** (critical/high/medium/low) → **problem** → **fix**
|
|
27
|
+
|
|
28
|
+
### Output format
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
## Code Review: <file or description>
|
|
32
|
+
|
|
33
|
+
### Critical
|
|
34
|
+
- [line X] <issue> → <fix>
|
|
35
|
+
|
|
36
|
+
### High
|
|
37
|
+
- [line X] <issue> → <fix>
|
|
38
|
+
|
|
39
|
+
### Medium / Low
|
|
40
|
+
- <issue> → <fix>
|
|
41
|
+
|
|
42
|
+
### Summary
|
|
43
|
+
<1-2 sentence overall assessment>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If no issues are found, say so explicitly — don't pad with non-issues.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commitmsg
|
|
3
|
+
description: Generate a conventional commit message from staged changes or a diff. Follows Conventional Commits spec (feat/fix/chore/refactor/docs/test/perf/ci).
|
|
4
|
+
argument-hint: [optional: file paths or description]
|
|
5
|
+
allowed-tools: Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Generate Commit Message
|
|
9
|
+
|
|
10
|
+
$ARGUMENTS
|
|
11
|
+
|
|
12
|
+
### Process
|
|
13
|
+
|
|
14
|
+
1. Run `git diff --staged` to see staged changes (or `git diff HEAD` if nothing staged)
|
|
15
|
+
2. If `$ARGUMENTS` mentions specific files, focus on those
|
|
16
|
+
3. Analyse what changed — what was added, removed, modified, and why
|
|
17
|
+
4. Generate a commit message following Conventional Commits
|
|
18
|
+
|
|
19
|
+
### Conventional Commits format
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
<type>(<scope>): <short summary>
|
|
23
|
+
|
|
24
|
+
<optional body: what changed and why, wrapped at 72 chars>
|
|
25
|
+
|
|
26
|
+
<optional footer: BREAKING CHANGE: ..., Closes #123>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Types:** `feat` (new feature), `fix` (bug fix), `perf` (performance), `refactor` (no behaviour change), `docs` (documentation only), `test` (tests only), `chore` (tooling/deps), `ci` (CI/CD), `style` (formatting)
|
|
30
|
+
|
|
31
|
+
**Rules:**
|
|
32
|
+
- Subject line ≤ 72 characters, imperative mood ("add X" not "added X")
|
|
33
|
+
- Scope is optional but useful (e.g. `feat(auth):`, `fix(cli):`)
|
|
34
|
+
- Body explains *why*, not *what* (the diff shows what)
|
|
35
|
+
- Mark breaking changes with `BREAKING CHANGE:` in footer
|
|
36
|
+
- Reference issues with `Closes #N` or `Fixes #N`
|
|
37
|
+
|
|
38
|
+
### Output
|
|
39
|
+
|
|
40
|
+
Print the ready-to-use commit message in a code block so it can be copied directly.
|
|
41
|
+
If the changes span multiple unrelated concerns, suggest splitting into separate commits.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug
|
|
3
|
+
description: Structured debugging session. Accepts an error message, stack trace, or description of unexpected behaviour. Works through reproduce → isolate → hypothesize → verify → fix.
|
|
4
|
+
argument-hint: [error message or description]
|
|
5
|
+
allowed-tools: Bash, Read, Grep
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Debug Session
|
|
9
|
+
|
|
10
|
+
**Problem:** $ARGUMENTS
|
|
11
|
+
|
|
12
|
+
### Step 1 — Understand the error
|
|
13
|
+
|
|
14
|
+
- Parse the error message and stack trace
|
|
15
|
+
- Identify the failing file, line, and function
|
|
16
|
+
- Note what was expected vs. what actually happened
|
|
17
|
+
|
|
18
|
+
### Step 2 — Reproduce
|
|
19
|
+
|
|
20
|
+
- Find the minimal steps or input that trigger the issue
|
|
21
|
+
- Run the failing command / test to confirm the error is present
|
|
22
|
+
- Note exact error output
|
|
23
|
+
|
|
24
|
+
### Step 3 — Isolate
|
|
25
|
+
|
|
26
|
+
- Narrow down to the smallest code path involved
|
|
27
|
+
- Check recent changes (`git log --oneline -10`, `git diff HEAD~1`) — did something recently break this?
|
|
28
|
+
- Search for related error messages or similar patterns in the codebase
|
|
29
|
+
|
|
30
|
+
### Step 4 — Hypothesize
|
|
31
|
+
|
|
32
|
+
- List 2–3 plausible root causes, ranked by likelihood
|
|
33
|
+
- For each hypothesis, state what evidence would confirm or rule it out
|
|
34
|
+
|
|
35
|
+
### Step 5 — Verify
|
|
36
|
+
|
|
37
|
+
- Test each hypothesis by reading relevant code, adding debug output, or running targeted commands
|
|
38
|
+
- Eliminate hypotheses one by one until the root cause is confirmed
|
|
39
|
+
|
|
40
|
+
### Step 6 — Fix
|
|
41
|
+
|
|
42
|
+
- Implement the minimal correct fix
|
|
43
|
+
- Verify the fix resolves the original error
|
|
44
|
+
- Check for related issues the fix might cause
|
|
45
|
+
- Add a regression note if useful
|
|
46
|
+
|
|
47
|
+
### Output format
|
|
48
|
+
|
|
49
|
+
Work through each step out loud. Show commands run and their output. End with:
|
|
50
|
+
```
|
|
51
|
+
## Root cause
|
|
52
|
+
<one sentence>
|
|
53
|
+
|
|
54
|
+
## Fix applied
|
|
55
|
+
<what was changed>
|
|
56
|
+
|
|
57
|
+
## Verified by
|
|
58
|
+
<how you confirmed it works>
|
|
59
|
+
```
|