mirror of
https://github.com/samber/cc-skills-golang.git
synced 2026-09-11 19:46:44 +03:00
feat(skills): add isolated-worktree workflow to 5 skills (#73)
* feat(skills): add isolated-worktree workflow to 5 skills Document when to use the native EnterWorktree/ExitWorktree tools for workflows with genuine collision risk: parallel mutating sub-agents (golang-documentation, golang-modernize), variant comparison with a serial-measurement caveat (golang-benchmark, golang-performance), and per-fix remediation branches during large audits (golang-security). Read-only parallel audits (security scan, testing, troubleshooting, etc.) were deliberately excluded — concurrent reads need no isolation. * revert: keep plugin version at 1.7.0 The isolated-worktree workflow changes do not warrant a plugin-wide version bump on their own. * revert: drop worktree workflow from golang-documentation Its parallel sub-agents write independent files/sections rather than racing on shared state, so isolation is not warranted here. * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
1e3ae5fbcb
commit
faa9ccfeee
@@ -156,6 +156,7 @@ Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent
|
|||||||
| `WebFetch` | Library-specific skills, skills requiring deep research/analysis, skills fetching external docs or resources |
|
| `WebFetch` | Library-specific skills, skills requiring deep research/analysis, skills fetching external docs or resources |
|
||||||
| `WebSearch` | Skills requiring deep research or analysis (security, benchmarking, performance, troubleshooting, observability) and skills that discover resources or track updates |
|
| `WebSearch` | Skills requiring deep research or analysis (security, benchmarking, performance, troubleshooting, observability) and skills that discover resources or track updates |
|
||||||
| `AskUserQuestion` | Skills that benefit from clarifying user intent, confirming assumptions, or gathering context before proceeding — useful for audit/review modes, architecture decisions, ambiguous requirements, or any skill where acting on wrong assumptions is costly |
|
| `AskUserQuestion` | Skills that benefit from clarifying user intent, confirming assumptions, or gathering context before proceeding — useful for audit/review modes, architecture decisions, ambiguous requirements, or any skill where acting on wrong assumptions is costly |
|
||||||
|
| `EnterWorktree ExitWorktree` | Skills whose workflow spawns **mutating** parallel sub-agents (doc generation, modernization sweeps), compares code variants (benchmarks/perf), or applies each fix on its own branch (large security audits). Not for read-only parallel audits — concurrent reads need no isolation. |
|
||||||
|
|
||||||
When creating a new skill, suggest a tailored `allowed-tools` list based on the skill's purpose.
|
When creating a new skill, suggest a tailored `allowed-tools` list based on the skill's purpose.
|
||||||
|
|
||||||
|
|||||||
@@ -190,13 +190,13 @@ These skills are designed as **atomic, cross-referencing units**. A skill may re
|
|||||||
| ⭐️ | ✅ `golang-documentation` | ⚡ ⚙️ | -53% | 73 | 3,017 | 11,116 |
|
| ⭐️ | ✅ `golang-documentation` | ⚡ ⚙️ | -53% | 73 | 3,017 | 11,116 |
|
||||||
| ⭐️ | ✅ `golang-error-handling` | ⚡ ⚙️ | -26% | 139 | 1,520 | 4,394 |
|
| ⭐️ | ✅ `golang-error-handling` | ⚡ ⚙️ | -26% | 139 | 1,520 | 4,394 |
|
||||||
| ⭐️ | ✅ `golang-how-to` | ⚡ | — | 165 | 2,254 | 10,372 |
|
| ⭐️ | ✅ `golang-how-to` | ⚡ | — | 165 | 2,254 | 10,372 |
|
||||||
| ⭐️ | ✅ `golang-modernize` | ⚡ | -61% | 68 | 2,476 | 7,599 |
|
| ⭐️ | ✅ `golang-modernize` | ⚡ | -61% | 68 | 2,719 | 9,032 |
|
||||||
| ⭐️ | ✅ `golang-naming` | ⚡ ⚙️ | -23% | 158 | 2,865 | 7,233 |
|
| ⭐️ | ✅ `golang-naming` | ⚡ ⚙️ | -23% | 158 | 2,865 | 7,233 |
|
||||||
| ⭐️ | ✅ `golang-safety` | ⚡ | -58% | 78 | 2,457 | 5,227 |
|
| ⭐️ | ✅ `golang-safety` | ⚡ | -58% | 78 | 2,457 | 5,227 |
|
||||||
| ⭐️ | ✅ `golang-testing` | ⚡ 🧠 ⚙️ | -32% | 113 | 3,105 | 6,212 |
|
| ⭐️ | ✅ `golang-testing` | ⚡ 🧠 ⚙️ | -32% | 113 | 3,105 | 6,212 |
|
||||||
| ⭐️ | ✅ `golang-troubleshooting` | ⚡ 🧠 | -32% | 126 | 2,735 | 15,901 |
|
| ⭐️ | ✅ `golang-troubleshooting` | ⚡ 🧠 | -32% | 126 | 2,735 | 15,901 |
|
||||||
| ⭐️ | ✅ `golang-security` | ⚡ 🧠 | -32% | 84 | 3,036 | 21,472 |
|
| ⭐️ | ✅ `golang-security` | ⚡ 🧠 | -32% | 85 | 3,094 | 21,530 |
|
||||||
| | ✅ `golang-benchmark` | ⚡ 🧠 | -50% | 99 | 2,135 | 29,248 |
|
| | ✅ `golang-benchmark` | ⚡ 🧠 | -50% | 102 | 2,814 | 29,996 |
|
||||||
| | ✅ `golang-cli` | ⚡ | -43% | 122 | 2,274 | 6,089 |
|
| | ✅ `golang-cli` | ⚡ | -43% | 122 | 2,274 | 6,089 |
|
||||||
| | ✅ `golang-concurrency` | ⚡ ⚙️ | -39% | 71 | 1,873 | 6,338 |
|
| | ✅ `golang-concurrency` | ⚡ ⚙️ | -39% | 71 | 1,873 | 6,338 |
|
||||||
| | ✅ `golang-context` | ⚡ ⚙️ | -34% | 80 | 1,144 | 3,940 |
|
| | ✅ `golang-context` | ⚡ ⚙️ | -34% | 80 | 1,144 | 3,940 |
|
||||||
@@ -206,7 +206,7 @@ These skills are designed as **atomic, cross-referencing units**. A skill may re
|
|||||||
| | ✅ `golang-structs-interfaces` | ⚡ ⚙️ | -35% | 110 | 2,999 | 2,999 |
|
| | ✅ `golang-structs-interfaces` | ⚡ ⚙️ | -35% | 110 | 2,999 | 2,999 |
|
||||||
| | ✅ `golang-lint` | ⚡ | -41% | 98 | 1,714 | 5,493 |
|
| | ✅ `golang-lint` | ⚡ | -41% | 98 | 1,714 | 5,493 |
|
||||||
| | ✅ `golang-observability` | ⚡ ⚙️ | -37% | 161 | 2,921 | 18,453 |
|
| | ✅ `golang-observability` | ⚡ ⚙️ | -37% | 161 | 2,921 | 18,453 |
|
||||||
| | ✅ `golang-performance` | ⚡ 🧠 | -39% | 127 | 1,953 | 17,855 |
|
| | ✅ `golang-performance` | ⚡ 🧠 | -39% | 130 | 2,121 | 18,121 |
|
||||||
| | ✅ `golang-pkg-go-dev` | ⚡ | — | 185 | 2,693 | 4,302 |
|
| | ✅ `golang-pkg-go-dev` | ⚡ | — | 185 | 2,693 | 4,302 |
|
||||||
| | ✅ `golang-popular-libraries` | ⚡ | -30% | 61 | 893 | 4,287 |
|
| | ✅ `golang-popular-libraries` | ⚡ | -30% | 61 | 893 | 4,287 |
|
||||||
| | ✅ `golang-project-layout` | ⚡ | -38% | 69 | 1,510 | 5,718 |
|
| | ✅ `golang-project-layout` | ⚡ | -38% | 69 | 1,510 | 5,718 |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ license: MIT
|
|||||||
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
||||||
metadata:
|
metadata:
|
||||||
author: samber
|
author: samber
|
||||||
version: "1.2.4"
|
version: "1.2.5"
|
||||||
openclaw:
|
openclaw:
|
||||||
emoji: "📊"
|
emoji: "📊"
|
||||||
homepage: https://github.com/samber/cc-skills-golang
|
homepage: https://github.com/samber/cc-skills-golang
|
||||||
@@ -18,7 +18,7 @@ metadata:
|
|||||||
- kind: go
|
- kind: go
|
||||||
package: golang.org/x/perf/cmd/benchstat@latest
|
package: golang.org/x/perf/cmd/benchstat@latest
|
||||||
bins: [benchstat]
|
bins: [benchstat]
|
||||||
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(benchdiff:*) Bash(cob:*) Bash(gobenchdata:*) Bash(curl:*) mcp__context7__resolve-library-id mcp__context7__query-docs WebSearch AskUserQuestion
|
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(benchdiff:*) Bash(cob:*) Bash(gobenchdata:*) Bash(curl:*) mcp__context7__resolve-library-id mcp__context7__query-docs WebSearch AskUserQuestion EnterWorktree ExitWorktree
|
||||||
---
|
---
|
||||||
|
|
||||||
**Persona:** You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run — statistical rigor and controlled conditions are prerequisites before any optimization decision.
|
**Persona:** You are a Go performance measurement engineer. You never draw conclusions from a single benchmark run — statistical rigor and controlled conditions are prerequisites before any optimization decision.
|
||||||
@@ -105,6 +105,14 @@ go test -bench=BenchmarkEncode -benchmem -count=10 ./pkg/... | tee bench.txt
|
|||||||
|
|
||||||
**Output format:** `BenchmarkEncode/size=64-8 5000000 230.5 ns/op 128 B/op 2 allocs/op` — the `-8` suffix is GOMAXPROCS, `ns/op` is time per operation, `B/op` is bytes allocated per op, `allocs/op` is heap allocation count per op.
|
**Output format:** `BenchmarkEncode/size=64-8 5000000 230.5 ns/op 128 B/op 2 allocs/op` — the `-8` suffix is GOMAXPROCS, `ns/op` is time per operation, `B/op` is bytes allocated per op, `allocs/op` is heap allocation count per op.
|
||||||
|
|
||||||
|
## Comparing Optimization Variants in Parallel
|
||||||
|
|
||||||
|
When several competing optimization hypotheses exist for the same bottleneck, implement each variant in its own isolated worktree (`EnterWorktree`) via a separate sub-agent, so their code changes never collide in the shared working tree.
|
||||||
|
|
||||||
|
**Run the benchmarks serially, not concurrently.** Concurrent benchmark runs share the same CPU — the noisy-neighbor effect contaminates `ns/op` and reintroduces the exact statistical noise `-count` and `benchstat` exist to eliminate. Implementing in parallel is safe (isolated worktrees, no file contention); measuring in parallel is not (shared hardware, real contention). Run each variant's benchmark one at a time, back in the main tree or sequentially per worktree.
|
||||||
|
|
||||||
|
Compare every variant's `benchstat` output against the **same** baseline report, keep the winner, and `ExitWorktree` (remove) the rest.
|
||||||
|
|
||||||
## Documenting Results in Commits
|
## Documenting Results in Commits
|
||||||
|
|
||||||
Paste benchstat output in the commit body when the change has a measurable performance impact. This documents _why_ an optimization was made, prevents future readers from reverting it, and lets reviewers verify the claim without re-running benchmarks.
|
Paste benchstat output in the commit body when the change has a measurable performance impact. This documents _why_ an optimization was made, prevents future readers from reverting it, and lets reviewers verify the claim without re-running benchmarks.
|
||||||
|
|||||||
@@ -1077,5 +1077,20 @@
|
|||||||
{"id": "80.3", "text": "A growing gap indicates a non-Go memory leak"},
|
{"id": "80.3", "text": "A growing gap indicates a non-Go memory leak"},
|
||||||
{"id": "80.4", "text": "Suggests investigating cgo calls or memory-mapped files as potential sources"}
|
{"id": "80.4", "text": "Suggests investigating cgo calls or memory-mapped files as potential sources"}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 81,
|
||||||
|
"name": "parallel-variant-serial-measurement",
|
||||||
|
"description": "Tests whether the model isolates parallel optimization variants in separate worktrees but still measures each variant's benchmark serially, rather than running the benchmarks themselves concurrently",
|
||||||
|
"prompt": "I have three competing ideas for speeding up a hot function: replacing a map with a slice, adding a sync.Pool, and rewriting the loop to cut allocations. I want to try all three at once to save time — set up one sub-agent per idea so their edits don't collide, then benchmark all three together so I can quickly pick a winner.",
|
||||||
|
"trap": "Without the skill, the model takes 'all at once' and 'quickly' literally on both axes: it isolates the three implementations in separate worktrees (correct) but also launches the three benchmark runs concurrently to save time (incorrect) — missing that concurrent benchmarks share the same CPU and the noisy-neighbor effect contaminates ns/op, reintroducing the exact variance -count and benchstat exist to eliminate",
|
||||||
|
"assertions": [
|
||||||
|
{"id": "81.1", "text": "Recommends implementing each of the three variants in its own isolated worktree (EnterWorktree) so their code edits never collide"},
|
||||||
|
{"id": "81.2", "text": "Explicitly warns against running the three variants' benchmarks concurrently / at the same time"},
|
||||||
|
{"id": "81.3", "text": "Explains that concurrent benchmark runs share the CPU — the noisy-neighbor effect contaminates ns/op measurements"},
|
||||||
|
{"id": "81.4", "text": "Recommends running each variant's benchmark serially, one at a time"},
|
||||||
|
{"id": "81.5", "text": "Recommends comparing each variant's benchstat output against the same baseline report"},
|
||||||
|
{"id": "81.6", "text": "Recommends removing (ExitWorktree) the losing variants' worktrees once the winner is chosen"}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ license: MIT
|
|||||||
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
||||||
metadata:
|
metadata:
|
||||||
author: samber
|
author: samber
|
||||||
version: "1.2.2"
|
version: "1.2.3"
|
||||||
openclaw:
|
openclaw:
|
||||||
emoji: "🔄"
|
emoji: "🔄"
|
||||||
homepage: https://github.com/samber/cc-skills-golang
|
homepage: https://github.com/samber/cc-skills-golang
|
||||||
@@ -14,7 +14,7 @@ metadata:
|
|||||||
bins:
|
bins:
|
||||||
- go
|
- go
|
||||||
install: []
|
install: []
|
||||||
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion
|
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch WebSearch AskUserQuestion EnterWorktree ExitWorktree
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- markdownlint-disable ol-prefix -->
|
<!-- markdownlint-disable ol-prefix -->
|
||||||
@@ -24,7 +24,7 @@ allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(g
|
|||||||
**Modes:**
|
**Modes:**
|
||||||
|
|
||||||
- **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature; mention other opportunities you noticed but do not touch unrelated files.
|
- **Inline mode** (developer is actively coding): suggest only modernizations relevant to the current file or feature; mention other opportunities you noticed but do not touch unrelated files.
|
||||||
- **Full-scan mode** (explicit `/golang-modernize` invocation or CI): use up to 5 parallel sub-agents — Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min/max, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) — then consolidate and prioritize by the migration priority guide.
|
- **Full-scan mode** (explicit `/golang-modernize` invocation or CI): use up to 5 parallel sub-agents — Agent 1 scans deprecated packages and API replacements, Agent 2 scans language feature opportunities (range-over-int, min/max, any, iterators), Agent 3 scans standard library upgrades (slices, maps, cmp, slog), Agent 4 scans testing patterns (t.Context, b.Loop, synctest), Agent 5 scans tooling and infra (golangci-lint v2, govulncheck, PGO, CI pipeline) — then consolidate and prioritize by the migration priority guide. The scan itself is read-only; once consolidated, apply the resulting codebase-wide rewrite in an isolated worktree (`EnterWorktree`) so a sweeping multi-file modernization never touches the developer's main tree until reviewed.
|
||||||
|
|
||||||
# Go Code Modernization Guide
|
# Go Code Modernization Guide
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ When invoked:
|
|||||||
6. **Suggest improvements contextually**:
|
6. **Suggest improvements contextually**:
|
||||||
- If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial — but let the developer decide.
|
- If the developer is actively coding, **only suggest improvements related to the code they are currently working on**. Do not refactor unrelated files. Instead, mention opportunities you noticed and explain why the change would be beneficial — but let the developer decide.
|
||||||
- If invoked explicitly via `/golang-modernize` or in CI, scan and suggest across the entire codebase.
|
- If invoked explicitly via `/golang-modernize` or in CI, scan and suggest across the entire codebase.
|
||||||
7. **For large codebases**, parallelize the scan using up to 5 sub-agents (via the Agent tool), each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra)
|
7. **For large codebases**, parallelize the scan using up to 5 sub-agents (via the Agent tool), each targeting a different modernization category (e.g. deprecated packages, language features, standard library upgrades, testing patterns, tooling and infra). Once scanning is done and changes are ready to apply, do so in an isolated worktree (`EnterWorktree`) — a codebase-wide modernization sweep touches many files at once, and isolation keeps the main tree safe to abandon or review before merging.
|
||||||
8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding.
|
8. **Before suggesting a dependency update**, run `go mod tidy` and the test suite to verify compatibility. Ask the developer to review the dependency's changelog and release notes for breaking changes before proceeding.
|
||||||
9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description.
|
9. **If the developer explicitly ignores a suggestion**, write a short memo to `.modernize` in the project root so it is not suggested again. Format: one line per ignored suggestion, with a short description.
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ license: MIT
|
|||||||
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
||||||
metadata:
|
metadata:
|
||||||
author: samber
|
author: samber
|
||||||
version: "1.2.2"
|
version: "1.2.3"
|
||||||
openclaw:
|
openclaw:
|
||||||
emoji: "🏎"
|
emoji: "🏎"
|
||||||
homepage: https://github.com/samber/cc-skills-golang
|
homepage: https://github.com/samber/cc-skills-golang
|
||||||
@@ -18,7 +18,7 @@ metadata:
|
|||||||
- kind: go
|
- kind: go
|
||||||
package: golang.org/x/perf/cmd/benchstat@latest
|
package: golang.org/x/perf/cmd/benchstat@latest
|
||||||
bins: [benchstat]
|
bins: [benchstat]
|
||||||
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(fieldalignment:*) Bash(staticcheck:*) Bash(curl:*) Bash(fgprof:*) Bash(perf:*) WebSearch AskUserQuestion
|
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(benchstat:*) Bash(fieldalignment:*) Bash(staticcheck:*) Bash(curl:*) Bash(fgprof:*) Bash(perf:*) WebSearch AskUserQuestion EnterWorktree ExitWorktree
|
||||||
---
|
---
|
||||||
|
|
||||||
**Persona:** You are a Go performance engineer. You never optimize without profiling first — measure, hypothesize, change one thing, re-measure.
|
**Persona:** You are a Go performance engineer. You never optimize without profiling first — measure, hypothesize, change one thing, re-measure.
|
||||||
@@ -66,6 +66,8 @@ Before optimizing Go code, verify the bottleneck is in your process — if 90% o
|
|||||||
|
|
||||||
Refer to library documentation for known patterns before inventing custom solutions. Keep all `/tmp/report-*.txt` files as an audit trail.
|
Refer to library documentation for known patterns before inventing custom solutions. Keep all `/tmp/report-*.txt` files as an audit trail.
|
||||||
|
|
||||||
|
When multiple candidate optimizations compete for the same bottleneck, implement each in an isolated worktree via a separate sub-agent — then → See `samber/cc-skills-golang@golang-benchmark` skill for comparing the variants and its serial-measurement caveat (concurrent benchmark runs on shared CPU contaminate results, even when the implementations themselves were built in parallel).
|
||||||
|
|
||||||
## Decision Tree: Where Is Time Spent?
|
## Decision Tree: Where Is Time Spent?
|
||||||
|
|
||||||
| Bottleneck | Signal (from pprof) | Action |
|
| Bottleneck | Signal (from pprof) | Action |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ license: MIT
|
|||||||
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
compatibility: Designed for Claude Code or similar AI coding agents, and for projects using Golang.
|
||||||
metadata:
|
metadata:
|
||||||
author: samber
|
author: samber
|
||||||
version: "1.1.8"
|
version: "1.1.9"
|
||||||
openclaw:
|
openclaw:
|
||||||
emoji: "🔒"
|
emoji: "🔒"
|
||||||
homepage: https://github.com/samber/cc-skills-golang
|
homepage: https://github.com/samber/cc-skills-golang
|
||||||
@@ -18,7 +18,7 @@ metadata:
|
|||||||
- kind: go
|
- kind: go
|
||||||
package: golang.org/x/vuln/cmd/govulncheck@latest
|
package: golang.org/x/vuln/cmd/govulncheck@latest
|
||||||
bins: [govulncheck]
|
bins: [govulncheck]
|
||||||
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(govulncheck:*) WebSearch AskUserQuestion
|
allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch Bash(govulncheck:*) WebSearch AskUserQuestion EnterWorktree ExitWorktree
|
||||||
---
|
---
|
||||||
|
|
||||||
**Persona:** You are a senior Go security engineer. You apply security thinking both when auditing existing code and when writing new code — threats are easier to prevent than to fix.
|
**Persona:** You are a senior Go security engineer. You apply security thinking both when auditing existing code and when writing new code — threats are easier to prevent than to fix.
|
||||||
@@ -28,7 +28,7 @@ allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(g
|
|||||||
**Modes:**
|
**Modes:**
|
||||||
|
|
||||||
- **Review mode** — reviewing a PR for security issues. Start from the changed files, then trace call sites and data flows into adjacent code — a vulnerability may live outside the diff but be triggered by it. Sequential.
|
- **Review mode** — reviewing a PR for security issues. Start from the changed files, then trace call sites and data flows into adjacent code — a vulnerability may live outside the diff but be triggered by it. Sequential.
|
||||||
- **Audit mode** — full codebase security scan. Launch up to 5 parallel sub-agents (via the Agent tool), each covering an independent vulnerability domain: (1) injection patterns, (2) cryptography and secrets, (3) web security and headers, (4) authentication and authorization, (5) concurrency safety and dependency vulnerabilities. Aggregate findings, score with DREAD, and report by severity.
|
- **Audit mode** — full codebase security scan. Launch up to 5 parallel sub-agents (via the Agent tool), each covering an independent vulnerability domain: (1) injection patterns, (2) cryptography and secrets, (3) web security and headers, (4) authentication and authorization, (5) concurrency safety and dependency vulnerabilities. Aggregate findings, score with DREAD, and report by severity. A large audit produces many independent findings — apply each fix/improvement in its own worktree (`EnterWorktree`), so one fix = one worktree = one focused, reviewable, independently revertible PR, instead of one large mixed-concern change.
|
||||||
- **Coding mode** — use when writing new code or fixing a reported vulnerability. Follow the skill's sequential guidance. Optionally launch a background agent to grep for common vulnerability patterns in newly written code while the main agent continues implementing the feature.
|
- **Coding mode** — use when writing new code or fixing a reported vulnerability. Follow the skill's sequential guidance. Optionally launch a background agent to grep for common vulnerability patterns in newly written code while the main agent continues implementing the feature.
|
||||||
|
|
||||||
**Dependencies:**
|
**Dependencies:**
|
||||||
|
|||||||
Reference in New Issue
Block a user