ostacky 0.6.0 → 0.6.2

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.
@@ -1,216 +1,216 @@
1
- ---
2
- name: review
3
- description: Review code changes for security, performance, bugs, and quality. Reviews staged changes, unstaged changes, specific commits, or PR-ready diffs.
4
- ---
5
-
6
- <objective>
7
- Review code changes and provide structured feedback covering security, performance, bug risks, code quality, and test coverage gaps. This skill analyzes diffs and surrounding context to catch issues before they reach production.
8
- </objective>
9
-
10
- <context>
11
- This skill reviews code changes at various stages of the development workflow. It can review staged changes before a commit, unstaged work-in-progress, a specific commit, or the full set of changes on a branch that are ready for a pull request.
12
-
13
- The reviewer reads both the diff and the surrounding source files to understand intent and catch issues that only appear in context.
14
- </context>
15
-
16
- <core_principle>
17
- **FIND REAL ISSUES, NOT STYLE NITS.** Focus on problems that cause bugs, security vulnerabilities, performance degradation, or maintainability pain. Avoid nitpicking formatting or subjective style preferences unless they harm readability.
18
- </core_principle>
19
-
20
- <analysis_only_rule>
21
- **THIS SKILL IS READ-ONLY. DO NOT MODIFY CODE.**
22
-
23
- The purpose is to review and report findings. Making changes during review conflates the reviewer and author roles. Present findings and let the user decide what to act on.
24
- </analysis_only_rule>
25
-
26
- <quick_start>
27
-
28
- <determine_review_scope>
29
-
30
- Parse the user's input to determine what to review:
31
-
32
- 1. **No arguments** - Review staged changes first. If nothing is staged, review unstaged changes.
33
- - Staged: `git diff --cached`
34
- - Unstaged: `git diff`
35
- - If both are empty, review the most recent commit: `git show HEAD`
36
-
37
- 2. **Commit hash argument** (e.g., `/review abc1234`) - Review that specific commit.
38
- - `git show <hash>`
39
-
40
- 3. **File path argument** (e.g., `/review src/foo.ts`) - Review unstaged changes in that file.
41
- - `git diff -- <path>` then fall back to `git diff --cached -- <path>`
42
-
43
- 4. **"pr" argument** (e.g., `/review pr`) - Review all changes since branching from main.
44
- - `git diff main...HEAD`
45
- - If on main, review `git diff HEAD~1`
46
-
47
- After obtaining the diff, if it is empty, inform the user that there are no changes to review and stop.
48
-
49
- </determine_review_scope>
50
-
51
- <gather_context>
52
-
53
- Before analyzing the diff:
54
-
55
- 1. **Follow Core Instructions** — `ostacky.md` Core Instructions section for CodeGraph usage patterns. Use `codegraph_explore` to understand the code structure before reading files directly.
56
- 2. **Use CodeGraph for code understanding** — `codegraph_explore` on the changed symbols gives you call paths, blast radius, and related code in ONE call. Only `Read` files for details CodeGraph didn't cover.
57
- 3. **Read changed files for full context** — After CodeGraph exploration, read each modified file to understand the surrounding code, imports, types, and control flow.
58
- 4. **Identify the tech stack** — Note languages, frameworks, and libraries in use. This affects what patterns are risky.
59
- 5. **Check for related test files** — For each changed source file, look for corresponding test files. Note whether tests were updated alongside the changes.
60
- 6. **Check for configuration changes** — If config files changed (env, CI, package.json, tsconfig, etc.), pay extra attention to side effects.
61
-
62
- </gather_context>
63
-
64
- <review_categories>
65
-
66
- Analyze the changes against each category below. Only report findings that are actually present. Skip categories with no issues.
67
-
68
- **A. Security Issues** (Severity: CRITICAL or HIGH)
69
- - Injection vulnerabilities (SQL injection, command injection, template injection)
70
- - Cross-site scripting (XSS) - unsanitized user input rendered in HTML
71
- - Authentication and authorization flaws (missing auth checks, privilege escalation)
72
- - Secrets or credentials hardcoded or logged
73
- - Insecure deserialization or unsafe eval usage
74
- - Path traversal or file access vulnerabilities
75
- - Missing input validation on external data
76
-
77
- **B. Performance Concerns** (Severity: HIGH or MEDIUM)
78
- - N+1 query patterns in database access
79
- - Unnecessary memory allocations in hot paths or loops
80
- - Blocking operations on the main thread or in async contexts
81
- - Missing pagination on unbounded queries
82
- - Redundant computation that could be cached or memoized
83
- - Large payloads without streaming or chunking
84
-
85
- **C. Bug Risks** (Severity: HIGH or MEDIUM)
86
- - Off-by-one errors in loops or array access
87
- - Null/undefined dereferences without guards
88
- - Race conditions in concurrent or async code
89
- - Incorrect error handling (swallowed errors, wrong error types)
90
- - Type mismatches or unsafe type assertions
91
- - Logic errors in conditionals (inverted checks, missing cases)
92
- - Resource leaks (unclosed connections, file handles, listeners)
93
-
94
- **D. Code Quality** (Severity: MEDIUM or LOW)
95
- - Unclear or misleading naming
96
- - Significant code duplication that should be extracted
97
- - Excessive complexity (deeply nested logic, functions doing too many things)
98
- - Dead code or unreachable branches
99
- - Missing or misleading comments on non-obvious logic
100
- - Inconsistency with patterns used elsewhere in the codebase
101
-
102
- **E. Test Coverage Gaps** (Severity: MEDIUM or LOW)
103
- - New logic paths without corresponding test cases
104
- - Changed behavior without updated tests
105
- - Edge cases not covered (empty inputs, boundary values, error paths)
106
- - Missing integration tests for new API endpoints or database changes
107
-
108
- </review_categories>
109
-
110
- <format_findings>
111
-
112
- For each finding, use this structure:
113
-
114
- ```
115
- ### [SEVERITY] Category: Brief Title
116
-
117
- **File**: `path/to/file.ext` (lines X-Y)
118
-
119
- **Issue**: Clear description of the problem.
120
-
121
- **Why it matters**: What could go wrong if this is not addressed.
122
-
123
- **Suggestion**: How to fix it, with a code snippet if helpful.
124
- ```
125
-
126
- Severity levels:
127
- - **CRITICAL** - Must fix before merge. Security vulnerability or data loss risk.
128
- - **HIGH** - Should fix before merge. Likely bug or significant performance issue.
129
- - **MEDIUM** - Should fix soon. Code quality or moderate risk issue.
130
- - **LOW** - Consider fixing. Minor improvement opportunity.
131
-
132
- </format_findings>
133
-
134
- </quick_start>
135
-
136
- <critical_rules>
137
-
138
- 1. **FOLLOW CORE INSTRUCTIONS** — Use CodeGraph for code understanding before reading files. See `ostacky.md` Core Instructions section.
139
- 2. **NO FALSE ALARMS**: Only report issues you can explain concretely. Do not report vague concerns
140
- 3. **PRIORITIZE**: Lead with the most severe findings. Do not bury critical issues under style nits
141
- 4. **BE SPECIFIC**: Include file paths, line numbers, and code references for every finding
142
- 5. **EXPLAIN THE RISK**: For each finding, explain what could actually go wrong
143
- 6. **CHECK TESTS**: Always check whether changes have corresponding test updates
144
- 7. **CONSIDER THE STACK**: Apply language-specific and framework-specific knowledge to your review
145
- 8. **DO NOT MODIFY CODE**: Present findings only. The user decides what to act on
146
-
147
- </critical_rules>
148
-
149
- <output_format>
150
-
151
- ```markdown
152
- ## Code Review: [brief description of what was reviewed]
153
-
154
- **Scope**: [staged changes | unstaged changes | commit abc1234 | PR changes from main]
155
- **Files reviewed**: [count] files changed, [additions] additions, [deletions] deletions
156
-
157
- ---
158
-
159
- ### Findings
160
-
161
- [Findings grouped by severity, highest first. Use the format from <format_findings>.]
162
-
163
- ---
164
-
165
- ### Summary
166
-
167
- | Severity | Count |
168
- |----------|-------|
169
- | CRITICAL | X |
170
- | HIGH | X |
171
- | MEDIUM | X |
172
- | LOW | X |
173
-
174
- ### Recommended Actions
175
-
176
- 1. [Most important action to take]
177
- 2. [Next most important action]
178
- 3. [...]
179
- ```
180
-
181
- If no issues are found:
182
-
183
- ```markdown
184
- ## Code Review: [brief description]
185
-
186
- **Scope**: [what was reviewed]
187
- **Files reviewed**: [count]
188
-
189
- No significant issues found. The changes look good to merge.
190
- ```
191
-
192
- </output_format>
193
-
194
- <decision_gate>
195
-
196
- **After presenting findings, ALWAYS offer these options:**
197
-
198
- ```
199
- ─────────────────────────────────────────
200
- REVIEW COMPLETE
201
-
202
- What would you like to do?
203
-
204
- 1. **Fix issues** - I'll address the findings starting with the most critical
205
- 2. **Save review** - Export findings to a markdown file
206
- 3. **Review again** - Re-review with different scope or focus
207
- 4. **Discuss a finding** - Ask questions about a specific issue
208
- 5. **Other** - Tell me what you need
209
- ─────────────────────────────────────────
210
- ```
211
-
212
- **Wait for user response before taking any action.**
213
-
214
- This gate is MANDATORY. Never skip it. Never auto-implement fixes.
215
-
216
- </decision_gate>
1
+ ---
2
+ name: review
3
+ description: Review code changes for security, performance, bugs, and quality. Reviews staged changes, unstaged changes, specific commits, or PR-ready diffs.
4
+ ---
5
+
6
+ <objective>
7
+ Review code changes and provide structured feedback covering security, performance, bug risks, code quality, and test coverage gaps. This skill analyzes diffs and surrounding context to catch issues before they reach production.
8
+ </objective>
9
+
10
+ <context>
11
+ This skill reviews code changes at various stages of the development workflow. It can review staged changes before a commit, unstaged work-in-progress, a specific commit, or the full set of changes on a branch that are ready for a pull request.
12
+
13
+ The reviewer reads both the diff and the surrounding source files to understand intent and catch issues that only appear in context.
14
+ </context>
15
+
16
+ <core_principle>
17
+ **FIND REAL ISSUES, NOT STYLE NITS.** Focus on problems that cause bugs, security vulnerabilities, performance degradation, or maintainability pain. Avoid nitpicking formatting or subjective style preferences unless they harm readability.
18
+ </core_principle>
19
+
20
+ <analysis_only_rule>
21
+ **THIS SKILL IS READ-ONLY. DO NOT MODIFY CODE.**
22
+
23
+ The purpose is to review and report findings. Making changes during review conflates the reviewer and author roles. Present findings and let the user decide what to act on.
24
+ </analysis_only_rule>
25
+
26
+ <quick_start>
27
+
28
+ <determine_review_scope>
29
+
30
+ Parse the user's input to determine what to review:
31
+
32
+ 1. **No arguments** - Review staged changes first. If nothing is staged, review unstaged changes.
33
+ - Staged: `git diff --cached`
34
+ - Unstaged: `git diff`
35
+ - If both are empty, review the most recent commit: `git show HEAD`
36
+
37
+ 2. **Commit hash argument** (e.g., `/review abc1234`) - Review that specific commit.
38
+ - `git show <hash>`
39
+
40
+ 3. **File path argument** (e.g., `/review src/foo.ts`) - Review unstaged changes in that file.
41
+ - `git diff -- <path>` then fall back to `git diff --cached -- <path>`
42
+
43
+ 4. **"pr" argument** (e.g., `/review pr`) - Review all changes since branching from main.
44
+ - `git diff main...HEAD`
45
+ - If on main, review `git diff HEAD~1`
46
+
47
+ After obtaining the diff, if it is empty, inform the user that there are no changes to review and stop.
48
+
49
+ </determine_review_scope>
50
+
51
+ <gather_context>
52
+
53
+ Before analyzing the diff:
54
+
55
+ 1. **Follow Core Instructions** — `ostacky.md` Core Instructions section for CodeGraph usage patterns. Use `codegraph_explore` to understand the code structure before reading files directly.
56
+ 2. **Use CodeGraph for code understanding** — `codegraph_explore` on the changed symbols gives you call paths, blast radius, and related code in ONE call. Only `Read` files for details CodeGraph didn't cover.
57
+ 3. **Read changed files for full context** — After CodeGraph exploration, read each modified file to understand the surrounding code, imports, types, and control flow.
58
+ 4. **Identify the tech stack** — Note languages, frameworks, and libraries in use. This affects what patterns are risky.
59
+ 5. **Check for related test files** — For each changed source file, look for corresponding test files. Note whether tests were updated alongside the changes.
60
+ 6. **Check for configuration changes** — If config files changed (env, CI, package.json, tsconfig, etc.), pay extra attention to side effects.
61
+
62
+ </gather_context>
63
+
64
+ <review_categories>
65
+
66
+ Analyze the changes against each category below. Only report findings that are actually present. Skip categories with no issues.
67
+
68
+ **A. Security Issues** (Severity: CRITICAL or HIGH)
69
+ - Injection vulnerabilities (SQL injection, command injection, template injection)
70
+ - Cross-site scripting (XSS) - unsanitized user input rendered in HTML
71
+ - Authentication and authorization flaws (missing auth checks, privilege escalation)
72
+ - Secrets or credentials hardcoded or logged
73
+ - Insecure deserialization or unsafe eval usage
74
+ - Path traversal or file access vulnerabilities
75
+ - Missing input validation on external data
76
+
77
+ **B. Performance Concerns** (Severity: HIGH or MEDIUM)
78
+ - N+1 query patterns in database access
79
+ - Unnecessary memory allocations in hot paths or loops
80
+ - Blocking operations on the main thread or in async contexts
81
+ - Missing pagination on unbounded queries
82
+ - Redundant computation that could be cached or memoized
83
+ - Large payloads without streaming or chunking
84
+
85
+ **C. Bug Risks** (Severity: HIGH or MEDIUM)
86
+ - Off-by-one errors in loops or array access
87
+ - Null/undefined dereferences without guards
88
+ - Race conditions in concurrent or async code
89
+ - Incorrect error handling (swallowed errors, wrong error types)
90
+ - Type mismatches or unsafe type assertions
91
+ - Logic errors in conditionals (inverted checks, missing cases)
92
+ - Resource leaks (unclosed connections, file handles, listeners)
93
+
94
+ **D. Code Quality** (Severity: MEDIUM or LOW)
95
+ - Unclear or misleading naming
96
+ - Significant code duplication that should be extracted
97
+ - Excessive complexity (deeply nested logic, functions doing too many things)
98
+ - Dead code or unreachable branches
99
+ - Missing or misleading comments on non-obvious logic
100
+ - Inconsistency with patterns used elsewhere in the codebase
101
+
102
+ **E. Test Coverage Gaps** (Severity: MEDIUM or LOW)
103
+ - New logic paths without corresponding test cases
104
+ - Changed behavior without updated tests
105
+ - Edge cases not covered (empty inputs, boundary values, error paths)
106
+ - Missing integration tests for new API endpoints or database changes
107
+
108
+ </review_categories>
109
+
110
+ <format_findings>
111
+
112
+ For each finding, use this structure:
113
+
114
+ ```
115
+ ### [SEVERITY] Category: Brief Title
116
+
117
+ **File**: `path/to/file.ext` (lines X-Y)
118
+
119
+ **Issue**: Clear description of the problem.
120
+
121
+ **Why it matters**: What could go wrong if this is not addressed.
122
+
123
+ **Suggestion**: How to fix it, with a code snippet if helpful.
124
+ ```
125
+
126
+ Severity levels:
127
+ - **CRITICAL** - Must fix before merge. Security vulnerability or data loss risk.
128
+ - **HIGH** - Should fix before merge. Likely bug or significant performance issue.
129
+ - **MEDIUM** - Should fix soon. Code quality or moderate risk issue.
130
+ - **LOW** - Consider fixing. Minor improvement opportunity.
131
+
132
+ </format_findings>
133
+
134
+ </quick_start>
135
+
136
+ <critical_rules>
137
+
138
+ 1. **FOLLOW CORE INSTRUCTIONS** — Use CodeGraph for code understanding before reading files. See `ostacky.md` Core Instructions section.
139
+ 2. **NO FALSE ALARMS**: Only report issues you can explain concretely. Do not report vague concerns
140
+ 3. **PRIORITIZE**: Lead with the most severe findings. Do not bury critical issues under style nits
141
+ 4. **BE SPECIFIC**: Include file paths, line numbers, and code references for every finding
142
+ 5. **EXPLAIN THE RISK**: For each finding, explain what could actually go wrong
143
+ 6. **CHECK TESTS**: Always check whether changes have corresponding test updates
144
+ 7. **CONSIDER THE STACK**: Apply language-specific and framework-specific knowledge to your review
145
+ 8. **DO NOT MODIFY CODE**: Present findings only. The user decides what to act on
146
+
147
+ </critical_rules>
148
+
149
+ <output_format>
150
+
151
+ ```markdown
152
+ ## Code Review: [brief description of what was reviewed]
153
+
154
+ **Scope**: [staged changes | unstaged changes | commit abc1234 | PR changes from main]
155
+ **Files reviewed**: [count] files changed, [additions] additions, [deletions] deletions
156
+
157
+ ---
158
+
159
+ ### Findings
160
+
161
+ [Findings grouped by severity, highest first. Use the format from <format_findings>.]
162
+
163
+ ---
164
+
165
+ ### Summary
166
+
167
+ | Severity | Count |
168
+ |----------|-------|
169
+ | CRITICAL | X |
170
+ | HIGH | X |
171
+ | MEDIUM | X |
172
+ | LOW | X |
173
+
174
+ ### Recommended Actions
175
+
176
+ 1. [Most important action to take]
177
+ 2. [Next most important action]
178
+ 3. [...]
179
+ ```
180
+
181
+ If no issues are found:
182
+
183
+ ```markdown
184
+ ## Code Review: [brief description]
185
+
186
+ **Scope**: [what was reviewed]
187
+ **Files reviewed**: [count]
188
+
189
+ No significant issues found. The changes look good to merge.
190
+ ```
191
+
192
+ </output_format>
193
+
194
+ <decision_gate>
195
+
196
+ **After presenting findings, ALWAYS offer these options:**
197
+
198
+ ```
199
+ ─────────────────────────────────────────
200
+ REVIEW COMPLETE
201
+
202
+ What would you like to do?
203
+
204
+ 1. **Fix issues** - I'll address the findings starting with the most critical
205
+ 2. **Save review** - Export findings to a markdown file
206
+ 3. **Review again** - Re-review with different scope or focus
207
+ 4. **Discuss a finding** - Ask questions about a specific issue
208
+ 5. **Other** - Tell me what you need
209
+ ─────────────────────────────────────────
210
+ ```
211
+
212
+ **Wait for user response before taking any action.**
213
+
214
+ This gate is MANDATORY. Never skip it. Never auto-implement fixes.
215
+
216
+ </decision_gate>