@anionzo/skill 1.4.0 → 1.7.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/CONTRIBUTING.md +2 -1
- package/README.md +82 -24
- package/docs/design-brief.md +17 -13
- package/docs/knowledge-spec.md +1 -0
- package/i18n/CONTRIBUTING.vi.md +2 -1
- package/i18n/README.vi.md +82 -24
- package/i18n/design-brief.vi.md +17 -13
- package/i18n/knowledge-spec.vi.md +1 -0
- package/knowledge/global/skill-triggering-rules.md +3 -2
- package/package.json +1 -1
- package/scripts/install-opencode-skills +197 -35
- package/skills/brainstorming/SKILL.md +176 -13
- package/skills/brainstorming/meta.yaml +18 -10
- package/skills/code-review/SKILL.md +214 -19
- package/skills/code-review/meta.yaml +21 -9
- package/skills/commit/SKILL.md +187 -0
- package/skills/commit/examples.md +62 -0
- package/skills/commit/meta.yaml +29 -0
- package/skills/commit/references/output-template.md +14 -0
- package/skills/debug/SKILL.md +252 -0
- package/skills/debug/examples.md +83 -0
- package/skills/debug/meta.yaml +39 -0
- package/skills/debug/references/output-template.md +16 -0
- package/skills/docs-writer/SKILL.md +85 -10
- package/skills/docs-writer/meta.yaml +18 -13
- package/skills/extract/SKILL.md +201 -0
- package/skills/extract/examples.md +47 -0
- package/skills/extract/meta.yaml +33 -0
- package/skills/extract/references/output-template.md +24 -0
- package/skills/feature-delivery/SKILL.md +12 -5
- package/skills/feature-delivery/meta.yaml +6 -1
- package/skills/planning/SKILL.md +146 -17
- package/skills/planning/meta.yaml +19 -7
- package/skills/refactor-safe/SKILL.md +10 -7
- package/skills/research/SKILL.md +130 -0
- package/skills/research/examples.md +79 -0
- package/skills/research/meta.yaml +31 -0
- package/skills/research/references/output-template.md +23 -0
- package/skills/test-driven-development/SKILL.md +194 -0
- package/skills/test-driven-development/examples.md +77 -0
- package/skills/test-driven-development/meta.yaml +31 -0
- package/skills/test-driven-development/references/.gitkeep +0 -0
- package/skills/test-driven-development/references/output-template.md +31 -0
- package/skills/using-skills/SKILL.md +33 -17
- package/skills/using-skills/examples.md +20 -5
- package/skills/using-skills/meta.yaml +7 -4
- package/skills/verification-before-completion/SKILL.md +127 -13
- package/skills/verification-before-completion/meta.yaml +23 -14
- package/templates/SKILL.md +8 -1
- package/skills/bug-triage/SKILL.md +0 -47
- package/skills/bug-triage/examples.md +0 -68
- package/skills/bug-triage/meta.yaml +0 -25
- package/skills/bug-triage/references/output-template.md +0 -26
- package/skills/repo-onboarding/SKILL.md +0 -52
- package/skills/repo-onboarding/examples.md +0 -115
- package/skills/repo-onboarding/meta.yaml +0 -23
- package/skills/repo-onboarding/references/output-template.md +0 -24
|
@@ -2,40 +2,235 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
Review code changes with a risk-first
|
|
5
|
+
Review code changes with a risk-first, multi-perspective approach using severity-based triage. When receiving review feedback, evaluate technically before implementing.
|
|
6
|
+
|
|
7
|
+
This skill covers both sides of code review: giving reviews (severity triage, multi-perspective) and receiving reviews (technical evaluation, no performative agreement).
|
|
6
8
|
|
|
7
9
|
## When To Use
|
|
8
10
|
|
|
9
|
-
Load this skill when
|
|
11
|
+
Load this skill when:
|
|
12
|
+
|
|
13
|
+
- the user asks for a review of a diff, PR, commit range, or changed files
|
|
14
|
+
- you are receiving code review feedback and need to evaluate and respond to it
|
|
15
|
+
- the user says "review this", "check this code", or "fix the review comments"
|
|
16
|
+
|
|
17
|
+
## Part 1: Giving Code Reviews
|
|
18
|
+
|
|
19
|
+
### Workflow
|
|
20
|
+
|
|
21
|
+
1. Gather the full set of changes to review.
|
|
22
|
+
2. Review from four perspectives: code quality, architecture, security, completeness.
|
|
23
|
+
3. Triage each finding by severity (P1/P2/P3).
|
|
24
|
+
4. Present findings grouped by severity.
|
|
25
|
+
5. Gate the commit on P1 findings.
|
|
26
|
+
|
|
27
|
+
### Multi-Perspective Review
|
|
28
|
+
|
|
29
|
+
#### Code Quality
|
|
30
|
+
- Readability and simplicity
|
|
31
|
+
- Duplicated logic (DRY)
|
|
32
|
+
- Error handling — missing or swallowed errors
|
|
33
|
+
- Type safety — `any`, unsafe casts, missing types
|
|
34
|
+
- Naming — unclear variable/function names
|
|
35
|
+
|
|
36
|
+
#### Architecture
|
|
37
|
+
- Separation of concerns — business logic in wrong layer
|
|
38
|
+
- Coupling — tight dependencies between unrelated modules
|
|
39
|
+
- API design — consistent patterns, proper methods/status codes
|
|
40
|
+
- File organization — follows project conventions
|
|
41
|
+
|
|
42
|
+
#### Security
|
|
43
|
+
- Input validation — user input sanitized
|
|
44
|
+
- Auth — proper authorization checks
|
|
45
|
+
- Secrets — no hardcoded credentials or tokens
|
|
46
|
+
- Data exposure — sensitive data in logs, responses, or error messages
|
|
47
|
+
|
|
48
|
+
#### Completeness
|
|
49
|
+
- Missing tests for new logic
|
|
50
|
+
- Edge cases not handled
|
|
51
|
+
- Integration gaps — new code not wired into existing flows
|
|
52
|
+
- Stubs or TODOs left in code
|
|
53
|
+
|
|
54
|
+
### Severity Triage
|
|
55
|
+
|
|
56
|
+
| Severity | Criteria | Action |
|
|
57
|
+
|----------|----------|--------|
|
|
58
|
+
| **P1** | Security vuln, data corruption, breaking change, stub shipped | **Blocks commit — must fix** |
|
|
59
|
+
| **P2** | Performance issue, architecture concern, missing test | Should fix before commit |
|
|
60
|
+
| **P3** | Minor cleanup, naming, style | Record for later |
|
|
61
|
+
|
|
62
|
+
**Calibration:** Not everything is P1. Severity inflation wastes time. When in doubt, P2.
|
|
63
|
+
|
|
64
|
+
### Handling Review Results
|
|
65
|
+
|
|
66
|
+
**P1 findings exist — HARD GATE:**
|
|
67
|
+
|
|
68
|
+
Do NOT proceed to commit. Do NOT offer to skip P1.
|
|
69
|
+
|
|
70
|
+
> P1 findings block commit. Fix these first, then re-review.
|
|
71
|
+
|
|
72
|
+
**Only P2/P3:**
|
|
73
|
+
|
|
74
|
+
> No blocking issues. P2 findings recommended.
|
|
75
|
+
> Options: fix P2s now, commit as-is, or create follow-up task for P2s.
|
|
76
|
+
|
|
77
|
+
**Clean:**
|
|
78
|
+
|
|
79
|
+
> Review passed. No issues found. Ready to commit.
|
|
80
|
+
|
|
81
|
+
## Part 2: Receiving Code Reviews
|
|
82
|
+
|
|
83
|
+
### Response Protocol
|
|
84
|
+
|
|
85
|
+
When receiving code review feedback:
|
|
86
|
+
|
|
87
|
+
1. **READ** — complete feedback without reacting
|
|
88
|
+
2. **UNDERSTAND** — restate the requirement in your own words (or ask)
|
|
89
|
+
3. **VERIFY** — check against codebase reality
|
|
90
|
+
4. **EVALUATE** — technically sound for THIS codebase?
|
|
91
|
+
5. **RESPOND** — technical acknowledgment or reasoned pushback
|
|
92
|
+
6. **IMPLEMENT** — one item at a time, test each
|
|
93
|
+
|
|
94
|
+
### No Performative Agreement
|
|
95
|
+
|
|
96
|
+
Do not respond to review feedback with:
|
|
10
97
|
|
|
11
|
-
|
|
98
|
+
- "You're absolutely right!"
|
|
99
|
+
- "Great point!" / "Excellent feedback!"
|
|
100
|
+
- "Thanks for catching that!"
|
|
12
101
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
102
|
+
Instead:
|
|
103
|
+
|
|
104
|
+
- Restate the technical requirement
|
|
105
|
+
- Ask clarifying questions if unclear
|
|
106
|
+
- Push back with technical reasoning if the suggestion is wrong
|
|
107
|
+
- Just fix it — actions speak louder than words
|
|
108
|
+
|
|
109
|
+
When acknowledging correct feedback:
|
|
110
|
+
|
|
111
|
+
- "Fixed. [Brief description of what changed]"
|
|
112
|
+
- "Good catch — [specific issue]. Fixed in [location]."
|
|
113
|
+
- Or just fix it and show the code change.
|
|
114
|
+
|
|
115
|
+
### When to Push Back
|
|
116
|
+
|
|
117
|
+
Push back when:
|
|
118
|
+
|
|
119
|
+
- Suggestion breaks existing functionality
|
|
120
|
+
- Reviewer lacks full context
|
|
121
|
+
- Violates YAGNI (unused feature being "properly implemented")
|
|
122
|
+
- Technically incorrect for this stack
|
|
123
|
+
- Legacy/compatibility reasons exist
|
|
124
|
+
- Conflicts with prior architectural decisions
|
|
125
|
+
|
|
126
|
+
How to push back:
|
|
127
|
+
|
|
128
|
+
- Use technical reasoning, not defensiveness
|
|
129
|
+
- Ask specific questions
|
|
130
|
+
- Reference working tests or code
|
|
131
|
+
- Escalate to the user if it is an architectural disagreement
|
|
132
|
+
|
|
133
|
+
### YAGNI Check for Suggested Features
|
|
134
|
+
|
|
135
|
+
When a reviewer suggests "implementing properly" or adding capabilities:
|
|
136
|
+
|
|
137
|
+
1. Search the codebase for actual usage of the component in question
|
|
138
|
+
2. If unused: suggest removing it (YAGNI)
|
|
139
|
+
3. If used: then implement the improvement
|
|
140
|
+
|
|
141
|
+
### Handling Unclear Feedback
|
|
142
|
+
|
|
143
|
+
If any review item is unclear, STOP — do not implement anything yet. Ask for clarification on all unclear items before proceeding. Items may be related, and partial understanding leads to wrong implementation.
|
|
144
|
+
|
|
145
|
+
### Implementation Order for Multi-Item Feedback
|
|
146
|
+
|
|
147
|
+
1. Clarify anything unclear FIRST
|
|
148
|
+
2. Then implement in this order:
|
|
149
|
+
- Blocking issues (breaks, security)
|
|
150
|
+
- Simple fixes (typos, imports)
|
|
151
|
+
- Complex fixes (refactoring, logic)
|
|
152
|
+
3. Test each fix individually
|
|
153
|
+
4. Verify no regressions
|
|
22
154
|
|
|
23
155
|
## Output Format
|
|
24
156
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
157
|
+
Present results using the Shared Output Contract:
|
|
158
|
+
|
|
159
|
+
**When giving a review:**
|
|
160
|
+
|
|
161
|
+
1. **Goal/Result** — review verdict: PASS, BLOCKED (P1 exists), or PASS with warnings
|
|
162
|
+
2. **Key Details:**
|
|
163
|
+
```
|
|
164
|
+
P1 (blocks commit): X findings
|
|
165
|
+
- [file:line] Description — why it is critical
|
|
166
|
+
|
|
167
|
+
P2 (should fix): X findings
|
|
168
|
+
- [file:line] Description — impact
|
|
169
|
+
|
|
170
|
+
P3 (nice to have): X findings
|
|
171
|
+
- [file:line] Description
|
|
172
|
+
|
|
173
|
+
Verdict: PASS / BLOCKED
|
|
174
|
+
```
|
|
175
|
+
3. **Next Action:**
|
|
176
|
+
- if P1 exists → fix these first, then re-review
|
|
177
|
+
- if only P2/P3 → `commit` (or fix P2s first)
|
|
178
|
+
- if clean → `commit`
|
|
179
|
+
|
|
180
|
+
**When receiving a review:**
|
|
181
|
+
|
|
182
|
+
1. **Goal/Result** — review feedback evaluated and implementation status
|
|
183
|
+
2. **Key Details:**
|
|
184
|
+
- items understood vs. items needing clarification
|
|
185
|
+
- items implemented with verification
|
|
186
|
+
- items pushed back with reasoning
|
|
187
|
+
3. **Next Action:**
|
|
188
|
+
- all items resolved → `verification-before-completion`
|
|
189
|
+
- items remain unclear → waiting for clarification
|
|
29
190
|
|
|
30
191
|
## Red Flags
|
|
31
192
|
|
|
193
|
+
**When giving reviews:**
|
|
32
194
|
- reviewing only the latest file and ignoring related changes
|
|
33
195
|
- focusing on style before correctness
|
|
34
196
|
- vague comments with no user-visible impact
|
|
35
|
-
-
|
|
197
|
+
- severity inflation — calling everything P1
|
|
198
|
+
- approving code with P1 findings
|
|
199
|
+
- not checking the actual diff (reviewing from memory)
|
|
200
|
+
- skipping the security perspective
|
|
201
|
+
|
|
202
|
+
**When receiving reviews:**
|
|
203
|
+
- performative agreement ("Great point!")
|
|
204
|
+
- implementing suggestions without verifying against codebase
|
|
205
|
+
- implementing all items without testing each one
|
|
206
|
+
- avoiding pushback when the suggestion is technically wrong
|
|
207
|
+
- implementing unclear items based on assumptions
|
|
208
|
+
- thanking the reviewer instead of just fixing the issue
|
|
209
|
+
|
|
210
|
+
## Checklist
|
|
211
|
+
|
|
212
|
+
**Giving a review:**
|
|
213
|
+
- [ ] Full diff reviewed
|
|
214
|
+
- [ ] Code quality perspective checked
|
|
215
|
+
- [ ] Architecture perspective checked
|
|
216
|
+
- [ ] Security perspective checked
|
|
217
|
+
- [ ] Completeness perspective checked
|
|
218
|
+
- [ ] Findings triaged by severity (P1/P2/P3)
|
|
219
|
+
- [ ] P1 findings block commit (hard gate)
|
|
220
|
+
- [ ] File and line references included where possible
|
|
221
|
+
- [ ] Next step communicated
|
|
222
|
+
|
|
223
|
+
**Receiving a review:**
|
|
224
|
+
- [ ] All feedback read completely
|
|
225
|
+
- [ ] Each item understood or clarification requested
|
|
226
|
+
- [ ] Suggestions verified against codebase before implementing
|
|
227
|
+
- [ ] Push back applied where technically warranted
|
|
228
|
+
- [ ] Items implemented one at a time
|
|
229
|
+
- [ ] Each fix tested individually
|
|
230
|
+
- [ ] No performative agreement used
|
|
36
231
|
|
|
37
232
|
## Done Criteria
|
|
38
233
|
|
|
39
|
-
|
|
234
|
+
**Giving:** Every finding includes a severity, a file and line reference where possible, and a plain-language statement of user-visible impact. The verdict is clearly stated as PASS or BLOCKED.
|
|
40
235
|
|
|
41
|
-
|
|
236
|
+
**Receiving:** All review items are either implemented with individual verification, pushed back with technical reasoning, or waiting on clarification. No performative agreement was used.
|
|
@@ -1,24 +1,36 @@
|
|
|
1
1
|
name: code-review
|
|
2
|
-
version: 0.
|
|
2
|
+
version: 0.3.0
|
|
3
3
|
category: review
|
|
4
|
-
summary:
|
|
5
|
-
summary_vi: Review
|
|
4
|
+
summary: Multi-perspective code review with P1/P2/P3 severity triage, plus technical evaluation protocol for receiving feedback.
|
|
5
|
+
summary_vi: "Review code đa chiều với P1/P2/P3, cộng protocol đánh giá kỹ thuật khi nhận feedback."
|
|
6
6
|
triggers:
|
|
7
7
|
- review this PR
|
|
8
8
|
- review these changes
|
|
9
9
|
- look for risks before merge
|
|
10
|
+
- check this code
|
|
11
|
+
- fix review comments
|
|
12
|
+
- respond to review feedback
|
|
10
13
|
inputs:
|
|
11
14
|
- diff or changed files
|
|
15
|
+
- review feedback to evaluate
|
|
12
16
|
- relevant tests or docs when needed
|
|
17
|
+
- optional task or spec reference
|
|
13
18
|
outputs:
|
|
14
|
-
- severity-ranked findings
|
|
15
|
-
-
|
|
16
|
-
-
|
|
19
|
+
- severity-ranked findings (P1/P2/P3)
|
|
20
|
+
- review verdict (PASS/BLOCKED)
|
|
21
|
+
- technical evaluation of received feedback
|
|
22
|
+
- items implemented or pushed back
|
|
17
23
|
constraints:
|
|
18
|
-
-
|
|
19
|
-
-
|
|
24
|
+
- P1 blocks commit (hard gate)
|
|
25
|
+
- no performative agreement when receiving feedback
|
|
26
|
+
- verify suggestions against codebase before implementing
|
|
27
|
+
- push back with technical reasoning when warranted
|
|
20
28
|
related_skills:
|
|
21
29
|
- using-skills
|
|
22
|
-
-
|
|
30
|
+
- debug
|
|
31
|
+
- feature-delivery
|
|
32
|
+
- refactor-safe
|
|
23
33
|
- verification-before-completion
|
|
34
|
+
- commit
|
|
24
35
|
- planning
|
|
36
|
+
- test-driven-development
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Commit
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Create clean, well-scoped commits by learning the repo's commit style first, then proposing a message for user approval.
|
|
6
|
+
|
|
7
|
+
This skill ensures that every commit is intentional, matches the project's existing conventions, and is never created without explicit user permission.
|
|
8
|
+
|
|
9
|
+
## The Iron Rule
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
NEVER COMMIT WITHOUT EXPLICIT USER APPROVAL
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
No exceptions. Not even when the user says "commit this" — still show the proposed message and wait for confirmation. The only exception is when the user explicitly grants blanket permission (e.g., "commit freely", "auto-commit is fine").
|
|
16
|
+
|
|
17
|
+
## When To Use
|
|
18
|
+
|
|
19
|
+
Load this skill when:
|
|
20
|
+
|
|
21
|
+
- ready to commit completed work
|
|
22
|
+
- the user says "commit this", "save my changes", or "commit"
|
|
23
|
+
- finishing a task and need to record the change properly
|
|
24
|
+
- multiple unrelated changes are staged and need to be split
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
1. Read the repo's recent commit history to learn the style.
|
|
29
|
+
2. Review what is staged.
|
|
30
|
+
3. Verify the staged changes are coherent (single concern).
|
|
31
|
+
4. Generate a commit message that matches the repo's style.
|
|
32
|
+
5. Present the commit for user approval.
|
|
33
|
+
6. Commit ONLY after explicit approval.
|
|
34
|
+
|
|
35
|
+
## Step 1: Learn the Repo's Commit Style
|
|
36
|
+
|
|
37
|
+
**Before proposing any commit message, study the existing history:**
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git log --oneline -20
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Look for:
|
|
44
|
+
|
|
45
|
+
- **Format pattern** — does the repo use conventional commits (`feat:`, `fix:`), plain messages, ticket prefixes (`JIRA-123:`), or something else?
|
|
46
|
+
- **Casing** — lowercase subjects? Sentence case? All caps type prefix?
|
|
47
|
+
- **Scope usage** — does the repo use `feat(auth):` or just `feat:`?
|
|
48
|
+
- **Subject length** — typical length of subject lines?
|
|
49
|
+
- **Body style** — do commits have bodies? What do they explain?
|
|
50
|
+
- **Language** — English? Vietnamese? Mixed?
|
|
51
|
+
|
|
52
|
+
**Match the observed pattern.** Do not impose a different convention on a repo that already has one.
|
|
53
|
+
|
|
54
|
+
If the repo has no clear pattern (new repo, mixed styles), fall back to conventional commits:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
<type>(<scope>): <subject>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `build`, `ci`
|
|
61
|
+
|
|
62
|
+
## Step 2: Review Staged Changes
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
git status
|
|
66
|
+
git diff --staged
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Check:
|
|
70
|
+
|
|
71
|
+
- Are the right files staged?
|
|
72
|
+
- Is anything missing that should be included?
|
|
73
|
+
- Is anything staged that should not be (secrets, generated files, unrelated changes)?
|
|
74
|
+
|
|
75
|
+
## Step 3: Verify Coherence
|
|
76
|
+
|
|
77
|
+
A good commit addresses ONE concern. If the staged diff mixes unrelated work:
|
|
78
|
+
|
|
79
|
+
> These changes span multiple concerns:
|
|
80
|
+
> - Feature X changes in `src/feature/`
|
|
81
|
+
> - Bug fix in `src/utils/`
|
|
82
|
+
>
|
|
83
|
+
> Recommend splitting into separate commits. Stage one concern at a time.
|
|
84
|
+
|
|
85
|
+
Do NOT commit mixed changes without calling it out.
|
|
86
|
+
|
|
87
|
+
## Step 4: Generate Commit Message
|
|
88
|
+
|
|
89
|
+
Based on the style learned in Step 1, generate a commit message that:
|
|
90
|
+
|
|
91
|
+
- Matches the repo's existing format and conventions
|
|
92
|
+
- Has a subject that explains the WHY or the user-visible change
|
|
93
|
+
- Has a body that explains reasoning (not a diff summary) when the change is non-trivial
|
|
94
|
+
- References task/issue IDs when applicable
|
|
95
|
+
- Does not include "Co-Authored-By" unless the user requests it
|
|
96
|
+
- Does not include "Generated with AI" or similar attribution
|
|
97
|
+
|
|
98
|
+
## Step 5: Present for Approval
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Repo commit style observed: conventional commits, lowercase, with scope
|
|
102
|
+
Recent examples:
|
|
103
|
+
feat: add 6 new skills and upgrade 4 existing skills
|
|
104
|
+
fix(auth): handle expired refresh tokens
|
|
105
|
+
|
|
106
|
+
Proposed commit:
|
|
107
|
+
|
|
108
|
+
feat(planning): add bite-sized task granularity and no-placeholder rule
|
|
109
|
+
|
|
110
|
+
Staged files:
|
|
111
|
+
M skills/planning/SKILL.md
|
|
112
|
+
M skills/planning/meta.yaml
|
|
113
|
+
|
|
114
|
+
Proceed? (yes / edit message / no)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**WAIT for the user's response.** Do NOT proceed until you receive one of:
|
|
118
|
+
|
|
119
|
+
- **yes / ok / go / ship it** → commit
|
|
120
|
+
- **edit** → user provides a new message or adjustments
|
|
121
|
+
- **no** → abort, explain what to do next
|
|
122
|
+
|
|
123
|
+
## Step 6: Commit
|
|
124
|
+
|
|
125
|
+
Only after explicit approval:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
git commit -m "<approved-message>"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Output Format
|
|
132
|
+
|
|
133
|
+
Present results using the Shared Output Contract:
|
|
134
|
+
|
|
135
|
+
1. **Goal/Result** — whether a commit was proposed, created, or blocked
|
|
136
|
+
2. **Key Details:**
|
|
137
|
+
- observed repo commit style
|
|
138
|
+
- the proposed or final commit message
|
|
139
|
+
- staged files summary
|
|
140
|
+
- any concerns about the diff (mixed concerns, missing files)
|
|
141
|
+
- approval status
|
|
142
|
+
3. **Next Action** — only when a natural follow-up exists:
|
|
143
|
+
- after successful commit → `verification-before-completion` or `extract`
|
|
144
|
+
- if commit blocked → explain what to fix first
|
|
145
|
+
|
|
146
|
+
## Commit Rules
|
|
147
|
+
|
|
148
|
+
- **NEVER auto-commit without user approval** — this is the most important rule
|
|
149
|
+
- Only commit staged files
|
|
150
|
+
- No "Co-Authored-By" lines unless the user requests it
|
|
151
|
+
- No "Generated with AI" or similar attribution lines
|
|
152
|
+
- If nothing is staged, say so and stop
|
|
153
|
+
- Learn the repo style before proposing — do not impose a foreign convention
|
|
154
|
+
|
|
155
|
+
## Red Flags
|
|
156
|
+
|
|
157
|
+
- committing without reviewing the diff
|
|
158
|
+
- committing without reading the repo's commit history first
|
|
159
|
+
- proposing a commit style that does not match the repo's existing convention
|
|
160
|
+
- mixing unrelated changes in one commit
|
|
161
|
+
- writing commit messages that describe the diff instead of the intent
|
|
162
|
+
- auto-committing without user approval
|
|
163
|
+
- committing with failing tests or lint errors still present
|
|
164
|
+
- assuming "commit this" means "commit without showing me"
|
|
165
|
+
|
|
166
|
+
## Checklist
|
|
167
|
+
|
|
168
|
+
- [ ] Repo commit history read (git log)
|
|
169
|
+
- [ ] Commit style identified and matched
|
|
170
|
+
- [ ] Staged changes reviewed
|
|
171
|
+
- [ ] Changes are coherent (single concern)
|
|
172
|
+
- [ ] Commit message follows repo's convention
|
|
173
|
+
- [ ] Subject explains why/what changed (not a diff summary)
|
|
174
|
+
- [ ] Commit message presented to user
|
|
175
|
+
- [ ] User explicitly approved
|
|
176
|
+
- [ ] Commit created successfully
|
|
177
|
+
|
|
178
|
+
## Abort Conditions
|
|
179
|
+
|
|
180
|
+
- Nothing staged
|
|
181
|
+
- Staged diff includes unrelated work that should be split
|
|
182
|
+
- User has not explicitly approved the final message
|
|
183
|
+
- Secrets or credentials detected in staged files
|
|
184
|
+
|
|
185
|
+
## Done Criteria
|
|
186
|
+
|
|
187
|
+
This skill is complete when the commit is created with explicit user approval, or when the user is informed why the commit was blocked and what to do about it. A commit created without user approval is a skill failure, regardless of whether the message was correct.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
## Example 1
|
|
4
|
+
|
|
5
|
+
User request:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Commit my changes.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Expected result:
|
|
12
|
+
|
|
13
|
+
- review staged changes
|
|
14
|
+
- check coherence (single concern)
|
|
15
|
+
- generate conventional commit message
|
|
16
|
+
- present for approval
|
|
17
|
+
|
|
18
|
+
Sample completed output:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Goal/Result: Commit proposed — awaiting approval.
|
|
22
|
+
|
|
23
|
+
Key Details:
|
|
24
|
+
Ready to commit:
|
|
25
|
+
|
|
26
|
+
feat(auth): add JWT token refresh endpoint
|
|
27
|
+
|
|
28
|
+
- Adds /auth/refresh route for issuing new access tokens
|
|
29
|
+
- Preserves existing sessions during refresh
|
|
30
|
+
|
|
31
|
+
Staged files:
|
|
32
|
+
M src/routes/auth.ts
|
|
33
|
+
A src/middleware/refresh.ts
|
|
34
|
+
M tests/auth.test.ts
|
|
35
|
+
|
|
36
|
+
Proceed? (yes / no / edit)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Example 2
|
|
40
|
+
|
|
41
|
+
User request:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
Save my work.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Expected result — mixed changes detected:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Goal/Result: Commit blocked — staged changes span multiple concerns.
|
|
51
|
+
|
|
52
|
+
Key Details:
|
|
53
|
+
These changes span multiple concerns:
|
|
54
|
+
- Feature: new search endpoint in src/routes/search.ts
|
|
55
|
+
- Bug fix: null check in src/utils/format.ts
|
|
56
|
+
- Style: whitespace cleanup in src/app.ts
|
|
57
|
+
|
|
58
|
+
Recommend splitting into separate commits.
|
|
59
|
+
Stage one concern at a time.
|
|
60
|
+
|
|
61
|
+
Next Action: Stage the feature changes first, then commit each concern separately.
|
|
62
|
+
```
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: commit
|
|
2
|
+
version: 0.2.0
|
|
3
|
+
category: workflow
|
|
4
|
+
summary: Learn repo commit style from history, propose a matching message, and commit ONLY after explicit user approval.
|
|
5
|
+
summary_vi: "Học style commit từ history, đề xuất message phù hợp, và commit CHỈ KHI user xác nhận rõ ràng."
|
|
6
|
+
triggers:
|
|
7
|
+
- commit these changes
|
|
8
|
+
- save my work
|
|
9
|
+
- ready to commit
|
|
10
|
+
inputs:
|
|
11
|
+
- staged git changes
|
|
12
|
+
- repo commit history (read automatically)
|
|
13
|
+
- optional task or issue reference
|
|
14
|
+
outputs:
|
|
15
|
+
- observed commit style
|
|
16
|
+
- proposed commit message matching repo convention
|
|
17
|
+
- user approval gate
|
|
18
|
+
- committed changes
|
|
19
|
+
constraints:
|
|
20
|
+
- NEVER auto-commit without explicit user approval
|
|
21
|
+
- read commit history before proposing a message
|
|
22
|
+
- match the repo's existing commit convention
|
|
23
|
+
- one concern per commit
|
|
24
|
+
related_skills:
|
|
25
|
+
- using-skills
|
|
26
|
+
- verification-before-completion
|
|
27
|
+
- code-review
|
|
28
|
+
- debug
|
|
29
|
+
- extract
|