@workingpayload/agent-skills 1.0.0 → 2.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/APIForge/skill.md +150 -17
- package/AccessPlus/skill.md +122 -18
- package/AlgoMaster/skill.md +110 -17
- package/Architekt AI/skill.md +125 -17
- package/AuthCraft/skill.md +129 -17
- package/AutoScriptor/skill.md +122 -17
- package/BoilerCore/skill.md +121 -17
- package/BugHunter Pro/skill.md +118 -17
- package/ChangeScribe/skill.md +98 -17
- package/CodeSage/skill.md +148 -17
- package/CommitCraft/skill.md +97 -16
- package/CoverageMax/skill.md +145 -16
- package/CronGenius/skill.md +141 -16
- package/DataPolish/skill.md +126 -16
- package/DataWeaver/skill.md +135 -16
- package/DockMaster/skill.md +142 -16
- package/DocuGenie/skill.md +122 -16
- package/EdgeGuard/skill.md +144 -16
- package/EnvWizard/skill.md +140 -16
- package/ErrorMedic/skill.md +136 -16
- package/FeatureSmith/skill.md +123 -16
- package/FlexiLayout/skill.md +128 -16
- package/FlowTester/skill.md +138 -16
- package/FunctionForge/skill.md +120 -16
- package/InputShield/skill.md +128 -16
- package/IssueForge/skill.md +132 -16
- package/KubeCrafter/skill.md +133 -16
- package/LogicLens/skill.md +116 -16
- package/MockSmith/skill.md +130 -16
- package/ModelSensei/skill.md +122 -16
- package/PRMentor/skill.md +103 -32
- package/PerfDetective/skill.md +90 -32
- package/PipelinePro/skill.md +146 -32
- package/PolyglotShift/skill.md +94 -32
- package/PromptForge/skill.md +118 -32
- package/QueryPulse/skill.md +123 -32
- package/README.md +416 -329
- package/ReadMeCraft/skill.md +127 -32
- package/RefactorX/skill.md +84 -32
- package/RenderBoost/skill.md +148 -32
- package/SEOMancer/skill.md +140 -16
- package/ScrapeMaster/skill.md +157 -32
- package/SecretSniffer/skill.md +107 -16
- package/SecureScan/skill.md +114 -16
- package/ServiceSplitter/skill.md +137 -16
- package/SpeedSmith/skill.md +139 -16
- package/StackWise/skill.md +139 -16
- package/TaskOrchestrator/skill.md +119 -16
- package/TestCrafter/skill.md +142 -16
- package/TraceMind/skill.md +127 -16
- package/UISmith/skill.md +115 -16
- package/bin/cli.js +377 -0
- package/extension-extender/SKILL.md +122 -0
- package/fastapi-furious/SKILL.md +148 -0
- package/package.json +41 -28
- package/python-master/SKILL.md +108 -0
- package/react-ranger/SKILL.md +93 -0
- package/scripts/build_index.py +282 -0
- package/scripts/doctor.py +541 -0
- package/scripts/install.py +397 -0
- package/scripts/route.py +348 -0
- package/scripts/score.py +355 -0
- package/scripts/test_skill.py +473 -0
- package/scripts/validate.py +254 -0
- package/skills-routing.json +1131 -0
- package/skills.json +3261 -0
- package/Extension-Extender/SKILL.md +0 -41
- package/Extension-Extender/references/ui-guidelines.md +0 -26
- package/Fastapi-Furious/README.md +0 -16
- package/Fastapi-Furious/SKILL.md +0 -37
- package/Python-Master/README.md +0 -11
- package/Python-Master/SKILL.md +0 -37
- package/React-Ranger/README.md +0 -17
- package/React-Ranger/SKILL.md +0 -37
- package/cli.js +0 -181
- package/parse_skills.py +0 -44
- /package/{Extension-Extender → extension-extender}/assets/manifest.json +0 -0
- /package/{Extension-Extender → extension-extender}/assets/popup.css +0 -0
- /package/{Extension-Extender → extension-extender}/assets/popup.html +0 -0
- /package/{Extension-Extender → extension-extender}/assets/popup.js +0 -0
package/ChangeScribe/skill.md
CHANGED
|
@@ -1,32 +1,113 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: changescribe
|
|
3
|
-
description:
|
|
3
|
+
description: Generates and maintains changelogs following Keep a Changelog format and Conventional Commits, determines semver bump rules from commit history, and parses git log output into structured release notes. Use when a user needs to create a CHANGELOG.md, prepare release notes, determine the next version number, or automate changelog generation in CI.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ChangeScribe
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Domain Scope
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Changelog generation, semantic versioning (semver 2.0.0), Conventional Commits specification parsing, Keep a Changelog format, git log analysis, and release automation.
|
|
11
|
+
|
|
12
|
+
---
|
|
11
13
|
|
|
12
14
|
## Workflow
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
### 1. Parse the Commit History
|
|
17
|
+
```bash
|
|
18
|
+
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%H|%s|%b|%an|%ae|%ci" --no-merges
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Classify Commits — Type-to-Semver Mapping
|
|
22
|
+
|
|
23
|
+
| Commit Type | Semver Bump | Changelog Section |
|
|
24
|
+
|-------------|-------------|-------------------|
|
|
25
|
+
| `feat` | MINOR | Added |
|
|
26
|
+
| `fix`, `perf` | PATCH | Fixed / Changed |
|
|
27
|
+
| `refactor` | PATCH (if behavior change) | Changed |
|
|
28
|
+
| `docs`, `chore`, `test`, `ci`, `build` | none | (omit) |
|
|
29
|
+
| `BREAKING CHANGE` or `!` suffix | MAJOR | Breaking Changes |
|
|
30
|
+
|
|
31
|
+
**Breaking change detection**: footer `BREAKING CHANGE: <desc>` or type with `!` suffix (`feat!: remove API`). Always list breaking changes first.
|
|
32
|
+
|
|
33
|
+
### 3. Determine the Next Version
|
|
34
|
+
```
|
|
35
|
+
Current: 1.4.2 → BREAKING CHANGE → 2.0.0
|
|
36
|
+
→ feat commits → 1.5.0
|
|
37
|
+
→ fix/perf only → 1.4.3
|
|
38
|
+
→ docs/chore only → no release
|
|
39
|
+
```
|
|
40
|
+
Version `0.x.y`: MINOR bumps may contain breaking changes — document in changelog header.
|
|
41
|
+
|
|
42
|
+
### 4. Write the Changelog Entry
|
|
43
|
+
|
|
44
|
+
Follow **Keep a Changelog** format:
|
|
45
|
+
```markdown
|
|
46
|
+
## [1.5.0] - 2026-03-28
|
|
47
|
+
|
|
48
|
+
### Breaking Changes
|
|
49
|
+
- **api**: Removed `GET /v1/users/search`. Use `POST /v1/users/query`. ([#342](link)) — by @alice
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- **auth**: WebAuthn/passkey authentication ([#318](link)) — by @bob
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
- **auth**: Refresh token not invalidated on logout ([#340](link)) — by @alice
|
|
56
|
+
```
|
|
57
|
+
**Section order**: Breaking Changes → Added → Changed → Deprecated → Removed → Fixed → Security.
|
|
58
|
+
Entry format: `- **<scope>**: <Imperative description> ([#<issue>](<url>)) — by @<author>`
|
|
15
59
|
|
|
16
|
-
###
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
60
|
+
### 5. Maintain CHANGELOG.md Structure
|
|
61
|
+
```markdown
|
|
62
|
+
# Changelog
|
|
63
|
+
## [Unreleased]
|
|
64
|
+
## [1.5.0] - 2026-03-28
|
|
65
|
+
...
|
|
66
|
+
[Unreleased]: https://github.com/owner/repo/compare/v1.5.0...HEAD
|
|
67
|
+
[1.5.0]: https://github.com/owner/repo/compare/v1.4.2...v1.5.0
|
|
68
|
+
```
|
|
69
|
+
Rules: never delete old entries; `[Unreleased]` always present; newest version first; version comparison links at bottom.
|
|
70
|
+
|
|
71
|
+
### 6. Monorepo Per-Package Changelogs
|
|
72
|
+
Use **changesets** for monorepos with independent package versioning:
|
|
73
|
+
```bash
|
|
74
|
+
npx changeset # developer describes change + bump type interactively
|
|
75
|
+
npx changeset version # consumes changesets, bumps package.json versions, writes CHANGELOG.md per package
|
|
76
|
+
npx changeset publish # publishes to npm
|
|
77
|
+
```
|
|
78
|
+
For commit-based automation without changesets, scope parsing by directory: filter `git log` with `-- packages/my-pkg/` and parse only commits touching that package's path. `git-cliff` supports per-package `cliff.toml` with `commit_parsers` scoped to `paths`.
|
|
79
|
+
|
|
80
|
+
### 7. Hotfix Branch Changelog Placement
|
|
81
|
+
When a hotfix is cut from a release branch (e.g., `release/1.4.x`) and produces `v1.4.3` after `v1.5.0` already exists on main:
|
|
82
|
+
- Insert the `## [1.4.3]` section **chronologically** in CHANGELOG.md (after `1.5.0`, before `1.4.2`), not at the top.
|
|
83
|
+
- Add a note: `_Backport of security fix from v1.5.1 to the v1.4.x maintenance branch._`
|
|
84
|
+
- After merging the hotfix back to main, update the `[Unreleased]` diff link to include the hotfix commits.
|
|
85
|
+
|
|
86
|
+
### 8. Automation in CI
|
|
87
|
+
```bash
|
|
88
|
+
# git-cliff: generate changelog from last tag to HEAD
|
|
89
|
+
git cliff --output CHANGELOG.md --latest
|
|
90
|
+
|
|
91
|
+
# GitHub Actions: determine bump + generate
|
|
92
|
+
BUMP=$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s" | python scripts/bump_type.py)
|
|
93
|
+
git cliff --tag "$NEXT_VERSION" --unreleased --output release-notes.md
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Output Artifacts
|
|
99
|
+
|
|
100
|
+
- Updated `CHANGELOG.md` with new release section.
|
|
101
|
+
- Version determination rationale: commit types found and resulting bump.
|
|
102
|
+
- `release-notes.md` for GitHub Release body.
|
|
103
|
+
- Git tag command: `git tag -a v1.5.0 -m "Release 1.5.0"`.
|
|
104
|
+
|
|
105
|
+
---
|
|
20
106
|
|
|
21
|
-
|
|
22
|
-
- Apply the core logic of ChangeScribe perfectly.
|
|
23
|
-
- Prioritize clean architecture, high efficiency, and robust error handling.
|
|
24
|
-
- Strive for a flawless, comprehensive solution that directly addresses the user's needs.
|
|
107
|
+
## Edge Cases
|
|
25
108
|
|
|
26
|
-
|
|
27
|
-
- Review the generated output against industry best practices for docs.
|
|
28
|
-
- Ensure the result perfectly resolves the user's request without omissions.
|
|
109
|
+
1. **Non-conventional commits**: Classify by keyword heuristics (fix/bug → Fixed; add/new → Added; update/migrate → Changed; remove/drop → Removed). Flag ambiguous commits for review. Recommend `commitlint` hook going forward.
|
|
29
110
|
|
|
30
|
-
|
|
111
|
+
2. **Multiple releases from one branch**: Split commits by tag boundary. Use `git log v1.4.2..v1.4.3` and `git log v1.4.3..v1.5.0` separately — never aggregate all commits under the latest version.
|
|
31
112
|
|
|
32
|
-
|
|
113
|
+
3. **Merge commits, reverts, squash PRs**: Skip merge commits. Reverts remove the original entry and add a note only if user-visible. For squash-merged PRs, enforce PR title linting via branch protection rules.
|
package/CodeSage/skill.md
CHANGED
|
@@ -1,32 +1,163 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: codesage
|
|
3
|
-
description:
|
|
3
|
+
description: Performs structured code reviews with severity-tiered findings covering security, correctness, performance, and maintainability. Uses language-specific linters and static analysis tools. Use when a user submits code for review, asks for feedback on a PR, or needs an audit of a module or function.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# CodeSage
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Domain Scope
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Code review across languages (Python, TypeScript/JavaScript, Java, Go, Rust, C/C++), covering: correctness bugs, security vulnerabilities, performance anti-patterns, API design, test coverage gaps, and maintainability issues. Output is structured by severity tier.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Severity Tiers
|
|
15
|
+
|
|
16
|
+
Every finding must be tagged with a severity:
|
|
17
|
+
|
|
18
|
+
| Tier | Label | Meaning | Action required |
|
|
19
|
+
|------|-------|---------|-----------------|
|
|
20
|
+
| 1 | **CRITICAL** | Security vulnerability, data loss risk, or crash-causing bug | Block merge; must fix |
|
|
21
|
+
| 2 | **HIGH** | Logic error, incorrect behavior under edge cases, significant performance issue | Block merge; must fix |
|
|
22
|
+
| 3 | **MEDIUM** | Code smell, missing error handling, test gap, suboptimal approach | Fix before merge preferred |
|
|
23
|
+
| 4 | **LOW** | Style, naming, minor readability, non-idiomatic code | Fix or acknowledge |
|
|
24
|
+
| 5 | **NOTE** | Suggestion, alternative approach, educational context | No action required |
|
|
25
|
+
|
|
26
|
+
---
|
|
11
27
|
|
|
12
28
|
## Workflow
|
|
13
29
|
|
|
14
|
-
|
|
30
|
+
### 1. Identify Language and Context
|
|
31
|
+
- Detect language from file extension and syntax.
|
|
32
|
+
- Note: framework (React, Spring, FastAPI), runtime (Node, JVM, Python 3.11+), and test framework.
|
|
33
|
+
- Check if this is new code, a modification, or a refactor.
|
|
34
|
+
|
|
35
|
+
### 2. Static Analysis Pass (Automated Tools)
|
|
36
|
+
Run mentally (or recommend the user run):
|
|
37
|
+
|
|
38
|
+
**Python**: `ruff check` (style + basic errors), `mypy --strict` (type errors), `bandit -r .` (security), `pylint` (additional checks).
|
|
39
|
+
|
|
40
|
+
**TypeScript/JavaScript**: `eslint --max-warnings 0` with `@typescript-eslint/recommended`, `eslint-plugin-security`, `eslint-plugin-unicorn`. `tsc --noEmit` for type checking.
|
|
41
|
+
|
|
42
|
+
**Java**: SpotBugs + FindSecurityBugs plugin, Checkstyle, SonarQube rules. PMD for code quality.
|
|
43
|
+
|
|
44
|
+
**Go**: `go vet ./...`, `staticcheck ./...`, `gosec ./...`, `golangci-lint run`.
|
|
45
|
+
|
|
46
|
+
**Rust**: `cargo clippy -- -D warnings`, `cargo audit`, `cargo geiger` (unsafe usage audit).
|
|
47
|
+
|
|
48
|
+
**C/C++**: `clang-tidy`, `cppcheck`, AddressSanitizer/UBSan in tests.
|
|
49
|
+
|
|
50
|
+
### 3. Security Review Checklist
|
|
51
|
+
Check for OWASP Top 10 patterns, including:
|
|
52
|
+
|
|
53
|
+
**OWASP A02 — Cryptographic Failures**: Flag any custom or hand-rolled cryptography implementation as CRITICAL — no exceptions. Recommend library-only crypto (`cryptography` in Python, `libsodium`, `WebCrypto API`). Common red flags: custom XOR/ROT ciphers, MD5/SHA-1 for security, ECB mode, hardcoded IVs/keys, non-constant-time secret comparisons.
|
|
54
|
+
|
|
55
|
+
**Feature Flag Removal Review**: When a feature flag is being removed (flag permanently on), verify all guarded code paths are cleaned up:
|
|
56
|
+
- [ ] Flag check condition and its `else` branch both removed (not just the `if`).
|
|
57
|
+
- [ ] Dead code path (the disabled branch) deleted, not just unreachable.
|
|
58
|
+
- [ ] Flag definition removed from config/constants and feature flag service.
|
|
59
|
+
- [ ] Tests for the old disabled path removed; tests for the enabled path remain without the flag setup.
|
|
60
|
+
|
|
61
|
+
**LLM-Generated Code Review**: Apply elevated scrutiny to code known or suspected to be AI-generated:
|
|
62
|
+
- Verify all referenced APIs, methods, and library functions actually exist — LLMs hallucinate plausible-sounding but non-existent APIs.
|
|
63
|
+
- Increase semantic testing requirement: generated code often passes syntactic checks but has subtle logic errors in edge cases. Add property-based tests or fuzz the inputs.
|
|
64
|
+
- Check for over-confident error handling (`except Exception: pass` patterns are common in generated code).
|
|
65
|
+
- Do not assume generated code follows your codebase's security conventions — recheck the full security checklist.
|
|
66
|
+
|
|
67
|
+
Check for additional OWASP Top 10 patterns:
|
|
68
|
+
|
|
69
|
+
- [ ] **Injection**: SQL queries built with string concatenation instead of parameterized queries / ORM. Command injection via `shell=True` (Python), `exec()`/`eval()` with user input.
|
|
70
|
+
- [ ] **Broken auth**: Hardcoded credentials, tokens in source code, weak random (use `secrets` module, not `random`).
|
|
71
|
+
- [ ] **Sensitive data exposure**: PII/secrets logged, HTTP instead of HTTPS, sensitive fields not excluded from serialization.
|
|
72
|
+
- [ ] **Insecure deserialization**: `pickle.loads()` / `yaml.load()` (use `yaml.safe_load()`) on untrusted input.
|
|
73
|
+
- [ ] **XSS**: `innerHTML`, `dangerouslySetInnerHTML` with unsanitized user content.
|
|
74
|
+
- [ ] **Path traversal**: file paths constructed from user input without validation (`os.path.join` does not protect against absolute paths in user input).
|
|
75
|
+
- [ ] **SSRF**: HTTP requests to URLs from user input without allowlist validation.
|
|
76
|
+
- [ ] **Dependency vulnerabilities**: check `npm audit`, `pip-audit`, `cargo audit`, `trivy`.
|
|
77
|
+
|
|
78
|
+
### 4. Correctness Review
|
|
79
|
+
|
|
80
|
+
- **Off-by-one errors**: loop bounds, slice indices, pagination.
|
|
81
|
+
- **Null/undefined handling**: unchecked nullable access. In TypeScript: `strictNullChecks` enabled?
|
|
82
|
+
- **Error handling**: errors silently swallowed (`except: pass`, `.catch(() => {})`, unchecked `err` in Go). Every error must be handled, logged, or explicitly propagated.
|
|
83
|
+
- **Concurrency**: shared mutable state accessed without synchronization. Thread-safe collections used where needed.
|
|
84
|
+
- **Resource leaks**: file handles, DB connections, HTTP response bodies not closed in `finally`/`defer`/`using`.
|
|
85
|
+
- **Integer overflow**: especially in size calculations, array indexing, financial math (use `Decimal`, not `float`, for money).
|
|
86
|
+
- **Floating-point equality**: `if (x === 0.1 + 0.2)` is wrong; use epsilon comparison or integer arithmetic.
|
|
15
87
|
|
|
16
|
-
###
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
88
|
+
### 5. Performance Review
|
|
89
|
+
|
|
90
|
+
- **N+1 queries**: loop that issues a DB query per iteration. Fix with eager loading (`JOIN`, `prefetch_related`, DataLoader).
|
|
91
|
+
- **Missing database indexes**: `WHERE`, `ORDER BY`, `JOIN` columns without indexes. Check `EXPLAIN ANALYZE`.
|
|
92
|
+
- **Unbounded queries**: no `LIMIT` on user-triggered queries. Risk: full table scan under load.
|
|
93
|
+
- **Unnecessary serialization**: converting to/from JSON inside a hot loop.
|
|
94
|
+
- **Algorithm complexity**: O(n²) where O(n log n) or O(n) is achievable (see AlgoMaster skill).
|
|
95
|
+
- **Memory allocation in loops**: creating large objects, closures, or buffers inside tight loops.
|
|
96
|
+
- **Blocking I/O in async context**: `time.sleep()` in an async function (Python), `fs.readFileSync()` in Node.js event handler.
|
|
97
|
+
|
|
98
|
+
### 6. Maintainability Review
|
|
99
|
+
|
|
100
|
+
- **Function length**: functions > 40 lines are candidates for extraction. Single Responsibility Principle.
|
|
101
|
+
- **Cyclomatic complexity**: branches > 10 in a single function — extract sub-functions.
|
|
102
|
+
- **Magic numbers/strings**: unexplained literal values — extract to named constants.
|
|
103
|
+
- **Test coverage**: are happy path, error path, and edge cases covered? Missing tests for the code under review.
|
|
104
|
+
- **Documentation**: exported functions/classes must have docstrings. Complex algorithms need inline explanation.
|
|
105
|
+
- **Dead code**: unreachable branches, unused variables/imports (linters catch these).
|
|
106
|
+
|
|
107
|
+
### 7. Language-Specific Idioms
|
|
108
|
+
|
|
109
|
+
**Python**: use comprehensions over explicit loops for simple transforms; `pathlib` over `os.path`; `dataclasses` or `pydantic` over raw dicts for structured data; `contextlib.contextmanager` for resource management.
|
|
110
|
+
|
|
111
|
+
**TypeScript**: prefer `const` over `let`; use `unknown` over `any`; use discriminated unions over optional fields; prefer `Array.prototype.map/filter/reduce` over imperative loops.
|
|
112
|
+
|
|
113
|
+
**Go**: handle errors explicitly, do not use `_` for error return unless the error is truly impossible; prefer `errors.Is`/`errors.As` over string comparison; use `context.Context` for cancellation propagation.
|
|
114
|
+
|
|
115
|
+
**Rust**: prefer `Option`/`Result` over panics in library code; use `?` operator for error propagation; avoid `clone()` in hot paths; use iterators over manual indexing.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Output Format
|
|
120
|
+
|
|
121
|
+
Structure the review output as:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
## Code Review: <filename or PR title>
|
|
125
|
+
|
|
126
|
+
### Summary
|
|
127
|
+
<2-3 sentences: overall quality, main concerns, recommendation (approve / approve with changes / request changes)>
|
|
128
|
+
|
|
129
|
+
### Findings
|
|
130
|
+
|
|
131
|
+
#### [CRITICAL] SQL injection via string concatenation — line 47
|
|
132
|
+
**File**: `src/repositories/user_repo.py:47`
|
|
133
|
+
**Issue**: `query = f"SELECT * FROM users WHERE id = {user_id}"` — user-controlled input concatenated directly into SQL.
|
|
134
|
+
**Impact**: Attacker can exfiltrate entire database, bypass auth, or drop tables.
|
|
135
|
+
**Fix**:
|
|
136
|
+
```python
|
|
137
|
+
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### [HIGH] Error silently swallowed — line 83
|
|
141
|
+
...
|
|
142
|
+
|
|
143
|
+
#### [MEDIUM] Missing index on query filter — line 12 of migration
|
|
144
|
+
...
|
|
145
|
+
|
|
146
|
+
### Test Coverage Gaps
|
|
147
|
+
- No test for `user_id` being negative
|
|
148
|
+
- No test for empty result set from `list_users()`
|
|
149
|
+
|
|
150
|
+
### Positive Notes
|
|
151
|
+
- Good use of `contextlib.suppress` in cleanup handler
|
|
152
|
+
- Consistent error message format across all endpoints
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
20
156
|
|
|
21
|
-
|
|
22
|
-
- Apply the core logic of CodeSage perfectly.
|
|
23
|
-
- Prioritize clean architecture, high efficiency, and robust error handling.
|
|
24
|
-
- Strive for a flawless, comprehensive solution that directly addresses the user's needs.
|
|
157
|
+
## Edge Cases
|
|
25
158
|
|
|
26
|
-
|
|
27
|
-
- Review the generated output against industry best practices for code, analysis.
|
|
28
|
-
- Ensure the result perfectly resolves the user's request without omissions.
|
|
159
|
+
1. **Reviewing auto-generated code** (e.g., from Prisma, gRPC protobuf, OpenAPI codegen): Do not flag generated files for style or structure issues — they are not human-maintained. Focus review on: (a) the generator configuration and schema (the real source), (b) any hand-written code that extends or wraps the generated code, (c) whether generated code is committed or regenerated in CI (prefer CI regeneration to avoid drift).
|
|
29
160
|
|
|
30
|
-
|
|
161
|
+
2. **Security findings with false positive risk**: A finding like "user input passed to a function" is not automatically a security bug — it depends on whether the function performs sanitization internally. Before escalating to CRITICAL, trace the data flow from source to sink and confirm there is no sanitization in the call chain. Use data flow analysis tools (Semgrep with taint mode, CodeQL) to reduce false positives. Always include a concrete exploit scenario to justify CRITICAL/HIGH security findings.
|
|
31
162
|
|
|
32
|
-
-
|
|
163
|
+
3. **Reviewing performance-sensitive code without profiling data**: Avoid premature optimization flags. Only flag a performance issue if: (a) the algorithmic complexity is provably worse (O(n²) where O(n) exists), (b) the pattern is a known anti-pattern (N+1 queries, blocking I/O), or (c) there is profiling data showing this is a hot path. For speculative performance concerns, use NOTE tier: "This loop allocates a new object per iteration — worth profiling if this becomes a hot path."
|
package/CommitCraft/skill.md
CHANGED
|
@@ -1,32 +1,113 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: commitcraft
|
|
3
|
-
description:
|
|
3
|
+
description: Crafts Conventional Commits v1.0.0 compliant messages by analyzing git diffs. Use when a user asks for help with commit messages, git commits, or wants to commit staged changes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# CommitCraft
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Produce Conventional Commits v1.0.0 messages from staged diffs or change descriptions. Every message must be machine-parseable for changelogs and semver automation.
|
|
11
11
|
|
|
12
12
|
## Workflow
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### 1. Gather the Diff
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- Analyze the user's request thoroughly.
|
|
18
|
-
- Identify the core requirements for crafting clear, conventional commit messages that accurately reflect code changes and adhere to project standards.
|
|
19
|
-
- Ensure all context and preconditions are understood.
|
|
16
|
+
Run `git diff --staged` (or `git diff HEAD~1` for the last commit). If nothing is staged, tell the user and stop.
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
18
|
+
Read the diff to identify:
|
|
19
|
+
- Which files changed and in what way (added, deleted, modified, renamed)
|
|
20
|
+
- Whether any public API surface changed (exported functions, REST routes, DB schema)
|
|
21
|
+
- Whether any config, env var, or migration is included
|
|
25
22
|
|
|
26
|
-
###
|
|
27
|
-
- Review the generated output against industry best practices for git.
|
|
28
|
-
- Ensure the result perfectly resolves the user's request without omissions.
|
|
23
|
+
### 2. Choose Type and Scope
|
|
29
24
|
|
|
30
|
-
|
|
25
|
+
**Type** — pick exactly one:
|
|
26
|
+
| Type | When to use |
|
|
27
|
+
|------|-------------|
|
|
28
|
+
| `feat` | New user-facing capability |
|
|
29
|
+
| `fix` | Bug correction |
|
|
30
|
+
| `refactor` | Code restructure with no behaviour change |
|
|
31
|
+
| `perf` | Performance improvement |
|
|
32
|
+
| `test` | Adding or fixing tests only |
|
|
33
|
+
| `docs` | Documentation only |
|
|
34
|
+
| `build` | Build system / dependency changes (webpack, npm, gradle) |
|
|
35
|
+
| `ci` | CI/CD pipeline changes |
|
|
36
|
+
| `chore` | Housekeeping (linting, formatting) |
|
|
37
|
+
| `revert` | Reverting a prior commit |
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
**Scope** — optional, in parentheses. Use the module, package, or route name: `feat(auth)`, `fix(api/users)`.
|
|
40
|
+
|
|
41
|
+
Before choosing types or scopes, check for `commitlint.config.js` or `.commitlintrc` — these override defaults and define allowed types/scopes. Use only values listed there; introducing an unlisted scope will break automated changelog tooling.
|
|
42
|
+
|
|
43
|
+
**Monorepo multi-scope**: When a change spans tightly coupled packages (e.g., a shared type changed in `core` that requires updates in `api` and `ui`), use the most impacted scope and list affected packages in the body: `feat(core): add PaymentIntent type` then `Affects: api, ui` in the body. Avoid comma-separated scopes like `feat(api,ui)` — most parsers reject them.
|
|
44
|
+
|
|
45
|
+
### 3. Write the Subject Line
|
|
46
|
+
|
|
47
|
+
Rules (all mandatory):
|
|
48
|
+
- Format: `<type>(<scope>): <imperative description>`
|
|
49
|
+
- Max **72 characters** total
|
|
50
|
+
- Imperative mood: "add", "fix", "remove" — never "added", "fixes", "adding"
|
|
51
|
+
- No period at the end
|
|
52
|
+
- Lowercase everything except proper nouns and acronyms
|
|
53
|
+
|
|
54
|
+
Examples:
|
|
55
|
+
```
|
|
56
|
+
feat(payments): add Stripe webhook signature verification
|
|
57
|
+
fix(auth): handle expired JWT refresh tokens correctly
|
|
58
|
+
refactor(db): replace raw queries with Drizzle ORM
|
|
59
|
+
perf(images): lazy-load thumbnails below the fold
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 4. Write the Body (when needed)
|
|
63
|
+
|
|
64
|
+
Include a body when the diff is non-trivial. Separate from subject with a blank line. Wrap at 72 characters. Explain *why*, not *what* — the diff already shows what.
|
|
65
|
+
|
|
66
|
+
### 5. Add Footers
|
|
67
|
+
|
|
68
|
+
**Breaking change** (triggers major semver bump):
|
|
69
|
+
```
|
|
70
|
+
BREAKING CHANGE: <description of what breaks and migration path>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Issue references:**
|
|
74
|
+
```
|
|
75
|
+
Closes #42
|
|
76
|
+
Refs #17, #23
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Co-authors:**
|
|
80
|
+
```
|
|
81
|
+
Co-authored-by: Name <email>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 6. Validate Before Presenting
|
|
85
|
+
|
|
86
|
+
Check:
|
|
87
|
+
- [ ] Subject ≤ 72 chars
|
|
88
|
+
- [ ] Imperative verb in subject
|
|
89
|
+
- [ ] `BREAKING CHANGE:` footer present if any public API removed or changed incompatibly
|
|
90
|
+
- [ ] Body explains motivation, not mechanics
|
|
91
|
+
- [ ] No trailing whitespace, no period on subject
|
|
92
|
+
|
|
93
|
+
## Output Format
|
|
94
|
+
|
|
95
|
+
Present the final message in a fenced code block so the user can copy it directly:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
feat(scope): short imperative description
|
|
99
|
+
|
|
100
|
+
Longer explanation of why this change was needed. Mention
|
|
101
|
+
any trade-offs or alternatives considered.
|
|
102
|
+
|
|
103
|
+
BREAKING CHANGE: describe what breaks and how to migrate.
|
|
104
|
+
Closes #42
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Edge Cases
|
|
108
|
+
|
|
109
|
+
**Multiple unrelated changes in one diff**: Flag this. Suggest splitting with `git add -p`. Offer a message for the dominant change only, with a note listing the other concerns.
|
|
110
|
+
|
|
111
|
+
**Revert commit**: Use `revert: revert "original subject"` as subject, and include `This reverts commit <SHA>` in the body. For merge or squash commits, use `git revert -m 1 <SHA>` to revert to the mainline parent; without `-m 1`, git cannot determine which parent to revert to and will error.
|
|
112
|
+
|
|
113
|
+
**Dependency-only bump**: Use `build(deps): bump <package> from X to Y` — never `chore` for security-relevant dependency upgrades; use `fix(deps)` if it patches a CVE.
|
package/CoverageMax/skill.md
CHANGED
|
@@ -1,32 +1,161 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: coveragemax
|
|
3
|
-
description:
|
|
3
|
+
description: Identifies untested code paths and generates targeted unit tests to reach 80%+ coverage using pytest-cov, Jest, Istanbul/nyc, or JaCoCo. Use when a user asks to improve test coverage, add missing tests, or analyze coverage reports.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# CoverageMax
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Analyze existing coverage reports, identify uncovered branches and lines, then generate well-structured tests using the AAA (Arrange-Act-Assert) pattern. Target: 80% line coverage and 75% branch coverage as a minimum bar.
|
|
11
11
|
|
|
12
12
|
## Workflow
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### 1. Detect the Stack and Run Coverage
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
**Python (pytest-cov):**
|
|
17
|
+
```bash
|
|
18
|
+
pytest --cov=src --cov-report=term-missing --cov-report=html:coverage_html
|
|
19
|
+
```
|
|
20
|
+
Read the `term-missing` output — the rightmost column lists uncovered line ranges.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
**JavaScript/TypeScript (Jest):**
|
|
23
|
+
```bash
|
|
24
|
+
jest --coverage --coverageReporters=text --coverageReporters=lcov
|
|
25
|
+
```
|
|
26
|
+
Check `coverage/lcov-report/index.html` or the terminal table.
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
**JavaScript (Istanbul/nyc standalone):**
|
|
29
|
+
```bash
|
|
30
|
+
nyc --reporter=text --reporter=lcov npm test
|
|
31
|
+
```
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
**Java (JaCoCo via Maven):**
|
|
34
|
+
```bash
|
|
35
|
+
mvn test jacoco:report
|
|
36
|
+
```
|
|
37
|
+
Open `target/site/jacoco/index.html`. Focus on "Missed Branches" column.
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
**Go:**
|
|
40
|
+
```bash
|
|
41
|
+
go test ./... -coverprofile=coverage.out && go tool cover -html=coverage.out
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Rust (cargo-tarpaulin):**
|
|
45
|
+
```bash
|
|
46
|
+
cargo tarpaulin --out Html --output-dir coverage/
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Exclusion config**: Exclude generated code, migrations, and vendor files rather than artificially inflating scores.
|
|
50
|
+
- Python: `pytest --cov-omit="src/migrations/*,src/generated/*"` or list paths under `[tool:coverage] omit =` in `.coveragerc`
|
|
51
|
+
- Jest: `coveragePathIgnorePatterns: ["/migrations/", "/generated/"]` in `jest.config.js`
|
|
52
|
+
- Go: tag generated files with `//go:build ignore` or pass `-coverpkg` to scope coverage explicitly
|
|
53
|
+
|
|
54
|
+
### 2. Triage Coverage Gaps
|
|
55
|
+
|
|
56
|
+
Priority order for what to test first:
|
|
57
|
+
1. **Uncovered branches** in business logic (conditionals, early returns, switch cases)
|
|
58
|
+
2. **Error/exception paths** (catch blocks, null guards, validation failures)
|
|
59
|
+
3. **Uncovered lines** in pure functions
|
|
60
|
+
4. Skip: generated code, migrations, `__init__.py` re-exports, trivial getters/setters
|
|
61
|
+
|
|
62
|
+
Flag files with 0% coverage — these likely indicate missing test files entirely.
|
|
63
|
+
|
|
64
|
+
### 3. Write Tests Using AAA Pattern
|
|
65
|
+
|
|
66
|
+
Every test must have three clearly separated sections:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
def test_calculate_discount_applies_vip_rate():
|
|
70
|
+
# Arrange
|
|
71
|
+
user = User(tier="vip", cart_total=100.0)
|
|
72
|
+
pricing = PricingService(vip_rate=0.20)
|
|
73
|
+
|
|
74
|
+
# Act
|
|
75
|
+
result = pricing.calculate_discount(user)
|
|
76
|
+
|
|
77
|
+
# Assert
|
|
78
|
+
assert result == 20.0
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
it('returns 401 when token is expired', async () => {
|
|
83
|
+
// Arrange
|
|
84
|
+
const expiredToken = generateToken({ exp: Date.now() - 1000 });
|
|
85
|
+
|
|
86
|
+
// Act
|
|
87
|
+
const response = await request(app).get('/api/profile')
|
|
88
|
+
.set('Authorization', `Bearer ${expiredToken}`);
|
|
89
|
+
|
|
90
|
+
// Assert
|
|
91
|
+
expect(response.status).toBe(401);
|
|
92
|
+
expect(response.body.error).toBe('TOKEN_EXPIRED');
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 4. Cover Branch Conditions Systematically
|
|
97
|
+
|
|
98
|
+
For each `if/else`, ternary, `||`, `&&`, or `switch`, write one test per branch:
|
|
99
|
+
- Truthy path
|
|
100
|
+
- Falsy path
|
|
101
|
+
- Boundary value (off-by-one, empty string, zero, null)
|
|
102
|
+
|
|
103
|
+
Use parameterized tests to reduce boilerplate:
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
@pytest.mark.parametrize("value,expected", [
|
|
107
|
+
(0, False),
|
|
108
|
+
(1, True),
|
|
109
|
+
(-1, False),
|
|
110
|
+
(None, False),
|
|
111
|
+
])
|
|
112
|
+
def test_is_positive(value, expected):
|
|
113
|
+
assert is_positive(value) == expected
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
test.each([
|
|
118
|
+
[0, false],
|
|
119
|
+
[1, true],
|
|
120
|
+
[-1, false],
|
|
121
|
+
])('isPositive(%i) returns %s', (value, expected) => {
|
|
122
|
+
expect(isPositive(value)).toBe(expected);
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 5. Mock External Dependencies
|
|
127
|
+
|
|
128
|
+
Never let tests hit real databases, HTTP endpoints, or file systems.
|
|
129
|
+
|
|
130
|
+
**Python:** `unittest.mock.patch`, `pytest-mock`'s `mocker.patch`
|
|
131
|
+
**Jest:** `jest.mock()`, `jest.spyOn()`
|
|
132
|
+
**Java:** Mockito `@Mock` + `@InjectMocks`
|
|
133
|
+
|
|
134
|
+
### 6. Verify Coverage Improved
|
|
135
|
+
|
|
136
|
+
Re-run the coverage command from Step 1. Confirm:
|
|
137
|
+
- Line coverage >= 80%
|
|
138
|
+
- Branch coverage >= 75%
|
|
139
|
+
- No previously-covered lines regressed
|
|
140
|
+
|
|
141
|
+
## Output Format
|
|
142
|
+
|
|
143
|
+
After writing tests, provide a summary table:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
File Before After Δ
|
|
147
|
+
src/pricing.py 42% 87% +45%
|
|
148
|
+
src/auth/tokens.py 61% 91% +30%
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
List any remaining uncovered branches that are intentionally excluded (dead code, platform-specific guards) with a brief justification.
|
|
152
|
+
|
|
153
|
+
## Edge Cases
|
|
154
|
+
|
|
155
|
+
**Legacy code with no tests at all**: Start with integration/smoke tests to establish a safety net before adding unit tests. Use `pytest --cov` with `--cov-fail-under=0` initially just to generate the baseline report.
|
|
156
|
+
|
|
157
|
+
**Over-mocking warning**: High coverage achieved by mocking away all real logic is misleading — tests pass because they only verify mock behavior, not the unit under test. If every meaningful call in the function is replaced by a mock return value, the coverage number is meaningless. Mock only external boundaries (HTTP, DB, filesystem); leave business logic unmocked.
|
|
158
|
+
|
|
159
|
+
**Coverage inflation via trivial tests**: Never write tests that just call a function without asserting anything meaningful. A test that passes with `assert True` harms more than it helps — reviewers should reject it.
|
|
160
|
+
|
|
161
|
+
**Async code**: Use `pytest-asyncio` with `@pytest.mark.asyncio`, or Jest's `async/await` test bodies. Ensure all async branches (resolved, rejected, timeout) are covered.
|