liteagents 2.8.0 → 2.8.1
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/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/packages/ampcode/commands/security.md +50 -12
- package/packages/ampcode/commands/ship.md +33 -11
- package/packages/claude/commands/git-commit.md +1 -1
- package/packages/claude/commands/security.md +50 -12
- package/packages/claude/commands/ship.md +33 -11
- package/packages/droid/commands/security.md +50 -12
- package/packages/droid/commands/ship.md +33 -11
- package/packages/opencode/command/security.md +50 -12
- package/packages/opencode/command/ship.md +33 -11
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
|
+
## [2.8.1] - 2026-05-22
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
- **`/security` and `/ship` rewritten across all four tools (claude, opencode, ampcode, droid).** Both were thin stubs; they're now substantive, stack-agnostic gates that apply to libraries, CLIs, web apps, and services alike.
|
|
24
|
+
- `/security` leads with the six failure classes that recur in nearly every quickly-built app — secrets committed to the repo, data-access / tenant isolation, rate limiting (including authenticated write routes), error handling past the happy path, authorization-beyond-authentication (IDOR / privilege), and N+1 / unindexed data access — plus a trust-boundary pass (spoofable headers like `X-Forwarded-For`, services bound to `0.0.0.0`, unvalidated untrusted input) and severity-ranked, coverage-auditable output.
|
|
25
|
+
- `/ship` is now stack-adaptive: it detects the toolchain (`package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `Makefile`) and runs only the checks that exist instead of assuming `npm run lint`/`build`/`migrate`, and adds gates for authorization, rate limiting, data-access scoping, error handling, and secret-scanning before deploy.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- **`allowed-tools` permission syntax normalized to the canonical colon form** (`Bash(git:*)`) in the claude package's `ship.md`, `security.md`, and `git-commit.md` — the space form (`Bash(git *)`) is not a valid Claude Code permission wildcard. The opencode/ampcode/droid packages retain their existing space-form syntax (their runners parse `allowed-tools` differently, if at all), so there is no behavior change there.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
20
32
|
## [2.8.0] - 2026-05-18
|
|
21
33
|
|
|
22
34
|
### Added
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liteagents",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.1",
|
|
4
4
|
"description": "AI development toolkit with 11 specialized agents and 23 commands including live-canvas UI design with click-to-annotate feedback. Simple one-question installer for Claude, Opencode, Ampcode, and Droid.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -3,19 +3,57 @@ name: security
|
|
|
3
3
|
description: Scan security [target]
|
|
4
4
|
usage: /security
|
|
5
5
|
argument-hint: [file, directory, or leave empty for full scan]
|
|
6
|
-
allowed-tools: Read, Grep, Glob
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
|
|
7
7
|
---
|
|
8
|
-
Audit $ARGUMENTS for security vulnerabilities.
|
|
8
|
+
Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
|
|
9
|
+
actually is — a library, CLI, web app, and service won't all have every
|
|
10
|
+
category. Skip what genuinely doesn't apply; never invent findings to fill a
|
|
11
|
+
section.
|
|
9
12
|
|
|
10
|
-
##
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
13
|
+
## The recurring six (check every project, where applicable)
|
|
14
|
+
These show up in nearly every quickly-built app regardless of stack:
|
|
15
|
+
|
|
16
|
+
1. **Secrets in the repo.** Tokens / API keys / `.env` files committed to
|
|
17
|
+
tracked files or anywhere in git history. Verify `.env` is gitignored and
|
|
18
|
+
only a value-less `.env.example` is tracked; scan history (`git log -p`,
|
|
19
|
+
`git grep`) for leaked keys. Secrets must load from env / a secret store at
|
|
20
|
+
runtime — never hardcoded, never logged.
|
|
21
|
+
2. **Data-access authorization (tenant isolation).** Every record read or
|
|
22
|
+
written must be scoped to the requesting principal — via DB-level rules
|
|
23
|
+
(RLS / row policies) and/or application-layer ownership checks. Flag any
|
|
24
|
+
query that trusts a client-supplied id without an ownership or role gate,
|
|
25
|
+
and any table/collection with a policy that's too broad or missing.
|
|
26
|
+
3. **Rate limiting.** Every externally reachable endpoint and abuse-prone
|
|
27
|
+
inbound path is bounded — including **authenticated mutation/write routes**,
|
|
28
|
+
not just the obvious public GETs. Note any unbounded route.
|
|
29
|
+
4. **Error handling past the happy path.** Third-party / IO / DB failures are
|
|
30
|
+
caught; nothing fails silently; no internal detail (stack traces, queries,
|
|
31
|
+
secrets) leaks to the client. Background/async work has its own catch.
|
|
32
|
+
5. **Authorization beyond authentication (IDOR / privilege).** "Logged in" is
|
|
33
|
+
not "allowed to do this". Confirm ownership AND role/permission checks on
|
|
34
|
+
every state-changing or privileged action. Mentally swap an id in a request
|
|
35
|
+
— does it return 403, or does it leak/modify another user's data?
|
|
36
|
+
6. **Inefficient data access (N+1 / unindexed).** Queries inside loops,
|
|
37
|
+
per-render repeated calls, missing indexes on filtered/joined columns.
|
|
38
|
+
Correct but falls over under load — a real availability risk.
|
|
39
|
+
|
|
40
|
+
## Also scan for
|
|
41
|
+
- **Injection:** SQL, command, XSS, template, path traversal.
|
|
42
|
+
- **Auth/session:** weak token handling, CSRF, session fixation, predictable ids.
|
|
43
|
+
- **Trust boundaries:** spoofable headers (e.g. `X-Forwarded-For`) trusted
|
|
44
|
+
without a vetted proxy; unvalidated untrusted input (uploads, inbound mail,
|
|
45
|
+
webhooks); services bound to `0.0.0.0` that should be loopback-only.
|
|
46
|
+
- **Config:** debug mode on in prod, default creds, missing security headers,
|
|
47
|
+
permissive CORS.
|
|
48
|
+
- **Dependencies:** known CVEs; unmaintained or single-maintainer deps in
|
|
49
|
+
security-critical paths.
|
|
16
50
|
|
|
17
51
|
## Output
|
|
18
|
-
Severity-ranked findings with:
|
|
19
|
-
- Location (file:line)
|
|
20
|
-
- Risk
|
|
21
|
-
- Remediation
|
|
52
|
+
Severity-ranked findings (Critical → High → Medium → Low), each with:
|
|
53
|
+
- **Location** (`file:line`)
|
|
54
|
+
- **Risk** — what an attacker actually gains
|
|
55
|
+
- **Remediation** — concrete, minimal fix
|
|
56
|
+
|
|
57
|
+
End with: which of the six classes were checked and found **clean**, and any
|
|
58
|
+
marked **N/A** for this target — so the scan's coverage is auditable, not just
|
|
59
|
+
its hits.
|
|
@@ -2,17 +2,39 @@
|
|
|
2
2
|
name: ship
|
|
3
3
|
description: Check pre-deployment
|
|
4
4
|
usage: /ship
|
|
5
|
-
allowed-tools: Bash(npm *), Bash(
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash(git *), Bash(npm *), Bash(pnpm *), Bash(yarn *), Bash(pytest *), Bash(python *), Bash(go *), Bash(cargo *), Bash(make *)
|
|
6
6
|
---
|
|
7
|
-
Pre-deploy
|
|
7
|
+
Pre-deploy / pre-merge gate. **Detect the stack first** (look for
|
|
8
|
+
`package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
|
|
9
|
+
`Makefile`) and run only the checks that actually exist — never assume a
|
|
10
|
+
script (`lint`, `build`, `migrate`) is present. Report each item as
|
|
11
|
+
**pass / fail / N/A**.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- [ ]
|
|
11
|
-
|
|
12
|
-
- [ ]
|
|
13
|
-
- [ ]
|
|
14
|
-
- [ ] No
|
|
15
|
-
-
|
|
16
|
-
- [ ]
|
|
13
|
+
## Checklist
|
|
14
|
+
- [ ] **Tests pass** — run the project's real test command (`npm test`,
|
|
15
|
+
`pytest`, `go test ./...`, `cargo test`, `make test`).
|
|
16
|
+
- [ ] **Lint / format clean** — only if a linter or formatter is configured.
|
|
17
|
+
- [ ] **Build succeeds** — only if the project has a build step.
|
|
18
|
+
- [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
|
|
19
|
+
`dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
|
|
20
|
+
- [ ] **No hardcoded secrets** — scan the diff. Secrets load from env / a
|
|
21
|
+
secret store; `.env` is gitignored and only a value-less `.env.example`
|
|
22
|
+
is tracked.
|
|
23
|
+
- [ ] **Error handling complete** — every new IO / network / DB call has a
|
|
24
|
+
failure path; nothing fails silently; no internal detail leaks to clients.
|
|
25
|
+
- [ ] **Authorization** — new endpoints/actions check **ownership + role**,
|
|
26
|
+
not just authentication (no IDOR via id-swapping).
|
|
27
|
+
- [ ] **Rate limiting** — new externally reachable routes, including
|
|
28
|
+
authenticated writes, are bounded.
|
|
29
|
+
- [ ] **Data access scoped & scales** — new queries are constrained to the
|
|
30
|
+
requesting principal (no cross-tenant leak) and avoid obvious N+1 /
|
|
31
|
+
unindexed scans on hot paths.
|
|
32
|
+
- [ ] **Migrations ready** — only if the project has a schema / migrations.
|
|
33
|
+
- [ ] **Docs & config in sync** — `.env.example`, README, and any
|
|
34
|
+
threat-model / PRD updated for new config or new attack surface.
|
|
35
|
+
- [ ] **Clean tree, correct branch, in sync with `origin`.**
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
For any security-sensitive change in the diff, run **`/security`** on the
|
|
38
|
+
changed files before shipping.
|
|
39
|
+
|
|
40
|
+
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items.
|
|
@@ -3,19 +3,57 @@ name: security
|
|
|
3
3
|
description: Scan security [target]
|
|
4
4
|
usage: /security
|
|
5
5
|
argument-hint: [file, directory, or leave empty for full scan]
|
|
6
|
-
allowed-tools: Read, Grep, Glob
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash(git log:*), Bash(git grep:*), Bash(rg:*)
|
|
7
7
|
---
|
|
8
|
-
Audit $ARGUMENTS for security vulnerabilities.
|
|
8
|
+
Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
|
|
9
|
+
actually is — a library, CLI, web app, and service won't all have every
|
|
10
|
+
category. Skip what genuinely doesn't apply; never invent findings to fill a
|
|
11
|
+
section.
|
|
9
12
|
|
|
10
|
-
##
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
13
|
+
## The recurring six (check every project, where applicable)
|
|
14
|
+
These show up in nearly every quickly-built app regardless of stack:
|
|
15
|
+
|
|
16
|
+
1. **Secrets in the repo.** Tokens / API keys / `.env` files committed to
|
|
17
|
+
tracked files or anywhere in git history. Verify `.env` is gitignored and
|
|
18
|
+
only a value-less `.env.example` is tracked; scan history (`git log -p`,
|
|
19
|
+
`git grep`) for leaked keys. Secrets must load from env / a secret store at
|
|
20
|
+
runtime — never hardcoded, never logged.
|
|
21
|
+
2. **Data-access authorization (tenant isolation).** Every record read or
|
|
22
|
+
written must be scoped to the requesting principal — via DB-level rules
|
|
23
|
+
(RLS / row policies) and/or application-layer ownership checks. Flag any
|
|
24
|
+
query that trusts a client-supplied id without an ownership or role gate,
|
|
25
|
+
and any table/collection with a policy that's too broad or missing.
|
|
26
|
+
3. **Rate limiting.** Every externally reachable endpoint and abuse-prone
|
|
27
|
+
inbound path is bounded — including **authenticated mutation/write routes**,
|
|
28
|
+
not just the obvious public GETs. Note any unbounded route.
|
|
29
|
+
4. **Error handling past the happy path.** Third-party / IO / DB failures are
|
|
30
|
+
caught; nothing fails silently; no internal detail (stack traces, queries,
|
|
31
|
+
secrets) leaks to the client. Background/async work has its own catch.
|
|
32
|
+
5. **Authorization beyond authentication (IDOR / privilege).** "Logged in" is
|
|
33
|
+
not "allowed to do this". Confirm ownership AND role/permission checks on
|
|
34
|
+
every state-changing or privileged action. Mentally swap an id in a request
|
|
35
|
+
— does it return 403, or does it leak/modify another user's data?
|
|
36
|
+
6. **Inefficient data access (N+1 / unindexed).** Queries inside loops,
|
|
37
|
+
per-render repeated calls, missing indexes on filtered/joined columns.
|
|
38
|
+
Correct but falls over under load — a real availability risk.
|
|
39
|
+
|
|
40
|
+
## Also scan for
|
|
41
|
+
- **Injection:** SQL, command, XSS, template, path traversal.
|
|
42
|
+
- **Auth/session:** weak token handling, CSRF, session fixation, predictable ids.
|
|
43
|
+
- **Trust boundaries:** spoofable headers (e.g. `X-Forwarded-For`) trusted
|
|
44
|
+
without a vetted proxy; unvalidated untrusted input (uploads, inbound mail,
|
|
45
|
+
webhooks); services bound to `0.0.0.0` that should be loopback-only.
|
|
46
|
+
- **Config:** debug mode on in prod, default creds, missing security headers,
|
|
47
|
+
permissive CORS.
|
|
48
|
+
- **Dependencies:** known CVEs; unmaintained or single-maintainer deps in
|
|
49
|
+
security-critical paths.
|
|
16
50
|
|
|
17
51
|
## Output
|
|
18
|
-
Severity-ranked findings with:
|
|
19
|
-
- Location (file:line)
|
|
20
|
-
- Risk
|
|
21
|
-
- Remediation
|
|
52
|
+
Severity-ranked findings (Critical → High → Medium → Low), each with:
|
|
53
|
+
- **Location** (`file:line`)
|
|
54
|
+
- **Risk** — what an attacker actually gains
|
|
55
|
+
- **Remediation** — concrete, minimal fix
|
|
56
|
+
|
|
57
|
+
End with: which of the six classes were checked and found **clean**, and any
|
|
58
|
+
marked **N/A** for this target — so the scan's coverage is auditable, not just
|
|
59
|
+
its hits.
|
|
@@ -2,17 +2,39 @@
|
|
|
2
2
|
name: ship
|
|
3
3
|
description: Check pre-deployment
|
|
4
4
|
usage: /ship
|
|
5
|
-
allowed-tools: Bash(npm
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash(git:*), Bash(npm:*), Bash(pnpm:*), Bash(yarn:*), Bash(pytest:*), Bash(python:*), Bash(go:*), Bash(cargo:*), Bash(make:*)
|
|
6
6
|
---
|
|
7
|
-
Pre-deploy
|
|
7
|
+
Pre-deploy / pre-merge gate. **Detect the stack first** (look for
|
|
8
|
+
`package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
|
|
9
|
+
`Makefile`) and run only the checks that actually exist — never assume a
|
|
10
|
+
script (`lint`, `build`, `migrate`) is present. Report each item as
|
|
11
|
+
**pass / fail / N/A**.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- [ ]
|
|
11
|
-
|
|
12
|
-
- [ ]
|
|
13
|
-
- [ ]
|
|
14
|
-
- [ ] No
|
|
15
|
-
-
|
|
16
|
-
- [ ]
|
|
13
|
+
## Checklist
|
|
14
|
+
- [ ] **Tests pass** — run the project's real test command (`npm test`,
|
|
15
|
+
`pytest`, `go test ./...`, `cargo test`, `make test`).
|
|
16
|
+
- [ ] **Lint / format clean** — only if a linter or formatter is configured.
|
|
17
|
+
- [ ] **Build succeeds** — only if the project has a build step.
|
|
18
|
+
- [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
|
|
19
|
+
`dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
|
|
20
|
+
- [ ] **No hardcoded secrets** — scan the diff. Secrets load from env / a
|
|
21
|
+
secret store; `.env` is gitignored and only a value-less `.env.example`
|
|
22
|
+
is tracked.
|
|
23
|
+
- [ ] **Error handling complete** — every new IO / network / DB call has a
|
|
24
|
+
failure path; nothing fails silently; no internal detail leaks to clients.
|
|
25
|
+
- [ ] **Authorization** — new endpoints/actions check **ownership + role**,
|
|
26
|
+
not just authentication (no IDOR via id-swapping).
|
|
27
|
+
- [ ] **Rate limiting** — new externally reachable routes, including
|
|
28
|
+
authenticated writes, are bounded.
|
|
29
|
+
- [ ] **Data access scoped & scales** — new queries are constrained to the
|
|
30
|
+
requesting principal (no cross-tenant leak) and avoid obvious N+1 /
|
|
31
|
+
unindexed scans on hot paths.
|
|
32
|
+
- [ ] **Migrations ready** — only if the project has a schema / migrations.
|
|
33
|
+
- [ ] **Docs & config in sync** — `.env.example`, README, and any
|
|
34
|
+
threat-model / PRD updated for new config or new attack surface.
|
|
35
|
+
- [ ] **Clean tree, correct branch, in sync with `origin`.**
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
For any security-sensitive change in the diff, run **`/security`** on the
|
|
38
|
+
changed files before shipping.
|
|
39
|
+
|
|
40
|
+
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items.
|
|
@@ -3,19 +3,57 @@ name: security
|
|
|
3
3
|
description: Scan security [target]
|
|
4
4
|
usage: /security
|
|
5
5
|
argument-hint: [file, directory, or leave empty for full scan]
|
|
6
|
-
allowed-tools: Read, Grep, Glob
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
|
|
7
7
|
---
|
|
8
|
-
Audit $ARGUMENTS for security vulnerabilities.
|
|
8
|
+
Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
|
|
9
|
+
actually is — a library, CLI, web app, and service won't all have every
|
|
10
|
+
category. Skip what genuinely doesn't apply; never invent findings to fill a
|
|
11
|
+
section.
|
|
9
12
|
|
|
10
|
-
##
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
13
|
+
## The recurring six (check every project, where applicable)
|
|
14
|
+
These show up in nearly every quickly-built app regardless of stack:
|
|
15
|
+
|
|
16
|
+
1. **Secrets in the repo.** Tokens / API keys / `.env` files committed to
|
|
17
|
+
tracked files or anywhere in git history. Verify `.env` is gitignored and
|
|
18
|
+
only a value-less `.env.example` is tracked; scan history (`git log -p`,
|
|
19
|
+
`git grep`) for leaked keys. Secrets must load from env / a secret store at
|
|
20
|
+
runtime — never hardcoded, never logged.
|
|
21
|
+
2. **Data-access authorization (tenant isolation).** Every record read or
|
|
22
|
+
written must be scoped to the requesting principal — via DB-level rules
|
|
23
|
+
(RLS / row policies) and/or application-layer ownership checks. Flag any
|
|
24
|
+
query that trusts a client-supplied id without an ownership or role gate,
|
|
25
|
+
and any table/collection with a policy that's too broad or missing.
|
|
26
|
+
3. **Rate limiting.** Every externally reachable endpoint and abuse-prone
|
|
27
|
+
inbound path is bounded — including **authenticated mutation/write routes**,
|
|
28
|
+
not just the obvious public GETs. Note any unbounded route.
|
|
29
|
+
4. **Error handling past the happy path.** Third-party / IO / DB failures are
|
|
30
|
+
caught; nothing fails silently; no internal detail (stack traces, queries,
|
|
31
|
+
secrets) leaks to the client. Background/async work has its own catch.
|
|
32
|
+
5. **Authorization beyond authentication (IDOR / privilege).** "Logged in" is
|
|
33
|
+
not "allowed to do this". Confirm ownership AND role/permission checks on
|
|
34
|
+
every state-changing or privileged action. Mentally swap an id in a request
|
|
35
|
+
— does it return 403, or does it leak/modify another user's data?
|
|
36
|
+
6. **Inefficient data access (N+1 / unindexed).** Queries inside loops,
|
|
37
|
+
per-render repeated calls, missing indexes on filtered/joined columns.
|
|
38
|
+
Correct but falls over under load — a real availability risk.
|
|
39
|
+
|
|
40
|
+
## Also scan for
|
|
41
|
+
- **Injection:** SQL, command, XSS, template, path traversal.
|
|
42
|
+
- **Auth/session:** weak token handling, CSRF, session fixation, predictable ids.
|
|
43
|
+
- **Trust boundaries:** spoofable headers (e.g. `X-Forwarded-For`) trusted
|
|
44
|
+
without a vetted proxy; unvalidated untrusted input (uploads, inbound mail,
|
|
45
|
+
webhooks); services bound to `0.0.0.0` that should be loopback-only.
|
|
46
|
+
- **Config:** debug mode on in prod, default creds, missing security headers,
|
|
47
|
+
permissive CORS.
|
|
48
|
+
- **Dependencies:** known CVEs; unmaintained or single-maintainer deps in
|
|
49
|
+
security-critical paths.
|
|
16
50
|
|
|
17
51
|
## Output
|
|
18
|
-
Severity-ranked findings with:
|
|
19
|
-
- Location (file:line)
|
|
20
|
-
- Risk
|
|
21
|
-
- Remediation
|
|
52
|
+
Severity-ranked findings (Critical → High → Medium → Low), each with:
|
|
53
|
+
- **Location** (`file:line`)
|
|
54
|
+
- **Risk** — what an attacker actually gains
|
|
55
|
+
- **Remediation** — concrete, minimal fix
|
|
56
|
+
|
|
57
|
+
End with: which of the six classes were checked and found **clean**, and any
|
|
58
|
+
marked **N/A** for this target — so the scan's coverage is auditable, not just
|
|
59
|
+
its hits.
|
|
@@ -2,17 +2,39 @@
|
|
|
2
2
|
name: ship
|
|
3
3
|
description: Check pre-deployment
|
|
4
4
|
usage: /ship
|
|
5
|
-
allowed-tools: Bash(npm *), Bash(
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash(git *), Bash(npm *), Bash(pnpm *), Bash(yarn *), Bash(pytest *), Bash(python *), Bash(go *), Bash(cargo *), Bash(make *)
|
|
6
6
|
---
|
|
7
|
-
Pre-deploy
|
|
7
|
+
Pre-deploy / pre-merge gate. **Detect the stack first** (look for
|
|
8
|
+
`package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
|
|
9
|
+
`Makefile`) and run only the checks that actually exist — never assume a
|
|
10
|
+
script (`lint`, `build`, `migrate`) is present. Report each item as
|
|
11
|
+
**pass / fail / N/A**.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- [ ]
|
|
11
|
-
|
|
12
|
-
- [ ]
|
|
13
|
-
- [ ]
|
|
14
|
-
- [ ] No
|
|
15
|
-
-
|
|
16
|
-
- [ ]
|
|
13
|
+
## Checklist
|
|
14
|
+
- [ ] **Tests pass** — run the project's real test command (`npm test`,
|
|
15
|
+
`pytest`, `go test ./...`, `cargo test`, `make test`).
|
|
16
|
+
- [ ] **Lint / format clean** — only if a linter or formatter is configured.
|
|
17
|
+
- [ ] **Build succeeds** — only if the project has a build step.
|
|
18
|
+
- [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
|
|
19
|
+
`dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
|
|
20
|
+
- [ ] **No hardcoded secrets** — scan the diff. Secrets load from env / a
|
|
21
|
+
secret store; `.env` is gitignored and only a value-less `.env.example`
|
|
22
|
+
is tracked.
|
|
23
|
+
- [ ] **Error handling complete** — every new IO / network / DB call has a
|
|
24
|
+
failure path; nothing fails silently; no internal detail leaks to clients.
|
|
25
|
+
- [ ] **Authorization** — new endpoints/actions check **ownership + role**,
|
|
26
|
+
not just authentication (no IDOR via id-swapping).
|
|
27
|
+
- [ ] **Rate limiting** — new externally reachable routes, including
|
|
28
|
+
authenticated writes, are bounded.
|
|
29
|
+
- [ ] **Data access scoped & scales** — new queries are constrained to the
|
|
30
|
+
requesting principal (no cross-tenant leak) and avoid obvious N+1 /
|
|
31
|
+
unindexed scans on hot paths.
|
|
32
|
+
- [ ] **Migrations ready** — only if the project has a schema / migrations.
|
|
33
|
+
- [ ] **Docs & config in sync** — `.env.example`, README, and any
|
|
34
|
+
threat-model / PRD updated for new config or new attack surface.
|
|
35
|
+
- [ ] **Clean tree, correct branch, in sync with `origin`.**
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
For any security-sensitive change in the diff, run **`/security`** on the
|
|
38
|
+
changed files before shipping.
|
|
39
|
+
|
|
40
|
+
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items.
|
|
@@ -3,19 +3,57 @@ name: security
|
|
|
3
3
|
description: Scan security [target]
|
|
4
4
|
usage: /security
|
|
5
5
|
argument-hint: [file, directory, or leave empty for full scan]
|
|
6
|
-
allowed-tools: Read, Grep, Glob
|
|
6
|
+
allowed-tools: Read, Grep, Glob, Bash(git log *), Bash(git grep *), Bash(rg *)
|
|
7
7
|
---
|
|
8
|
-
Audit $ARGUMENTS for security vulnerabilities.
|
|
8
|
+
Audit $ARGUMENTS for security vulnerabilities. Adapt scope to what the target
|
|
9
|
+
actually is — a library, CLI, web app, and service won't all have every
|
|
10
|
+
category. Skip what genuinely doesn't apply; never invent findings to fill a
|
|
11
|
+
section.
|
|
9
12
|
|
|
10
|
-
##
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
13
|
+
## The recurring six (check every project, where applicable)
|
|
14
|
+
These show up in nearly every quickly-built app regardless of stack:
|
|
15
|
+
|
|
16
|
+
1. **Secrets in the repo.** Tokens / API keys / `.env` files committed to
|
|
17
|
+
tracked files or anywhere in git history. Verify `.env` is gitignored and
|
|
18
|
+
only a value-less `.env.example` is tracked; scan history (`git log -p`,
|
|
19
|
+
`git grep`) for leaked keys. Secrets must load from env / a secret store at
|
|
20
|
+
runtime — never hardcoded, never logged.
|
|
21
|
+
2. **Data-access authorization (tenant isolation).** Every record read or
|
|
22
|
+
written must be scoped to the requesting principal — via DB-level rules
|
|
23
|
+
(RLS / row policies) and/or application-layer ownership checks. Flag any
|
|
24
|
+
query that trusts a client-supplied id without an ownership or role gate,
|
|
25
|
+
and any table/collection with a policy that's too broad or missing.
|
|
26
|
+
3. **Rate limiting.** Every externally reachable endpoint and abuse-prone
|
|
27
|
+
inbound path is bounded — including **authenticated mutation/write routes**,
|
|
28
|
+
not just the obvious public GETs. Note any unbounded route.
|
|
29
|
+
4. **Error handling past the happy path.** Third-party / IO / DB failures are
|
|
30
|
+
caught; nothing fails silently; no internal detail (stack traces, queries,
|
|
31
|
+
secrets) leaks to the client. Background/async work has its own catch.
|
|
32
|
+
5. **Authorization beyond authentication (IDOR / privilege).** "Logged in" is
|
|
33
|
+
not "allowed to do this". Confirm ownership AND role/permission checks on
|
|
34
|
+
every state-changing or privileged action. Mentally swap an id in a request
|
|
35
|
+
— does it return 403, or does it leak/modify another user's data?
|
|
36
|
+
6. **Inefficient data access (N+1 / unindexed).** Queries inside loops,
|
|
37
|
+
per-render repeated calls, missing indexes on filtered/joined columns.
|
|
38
|
+
Correct but falls over under load — a real availability risk.
|
|
39
|
+
|
|
40
|
+
## Also scan for
|
|
41
|
+
- **Injection:** SQL, command, XSS, template, path traversal.
|
|
42
|
+
- **Auth/session:** weak token handling, CSRF, session fixation, predictable ids.
|
|
43
|
+
- **Trust boundaries:** spoofable headers (e.g. `X-Forwarded-For`) trusted
|
|
44
|
+
without a vetted proxy; unvalidated untrusted input (uploads, inbound mail,
|
|
45
|
+
webhooks); services bound to `0.0.0.0` that should be loopback-only.
|
|
46
|
+
- **Config:** debug mode on in prod, default creds, missing security headers,
|
|
47
|
+
permissive CORS.
|
|
48
|
+
- **Dependencies:** known CVEs; unmaintained or single-maintainer deps in
|
|
49
|
+
security-critical paths.
|
|
16
50
|
|
|
17
51
|
## Output
|
|
18
|
-
Severity-ranked findings with:
|
|
19
|
-
- Location (file:line)
|
|
20
|
-
- Risk
|
|
21
|
-
- Remediation
|
|
52
|
+
Severity-ranked findings (Critical → High → Medium → Low), each with:
|
|
53
|
+
- **Location** (`file:line`)
|
|
54
|
+
- **Risk** — what an attacker actually gains
|
|
55
|
+
- **Remediation** — concrete, minimal fix
|
|
56
|
+
|
|
57
|
+
End with: which of the six classes were checked and found **clean**, and any
|
|
58
|
+
marked **N/A** for this target — so the scan's coverage is auditable, not just
|
|
59
|
+
its hits.
|
|
@@ -2,17 +2,39 @@
|
|
|
2
2
|
name: ship
|
|
3
3
|
description: Check pre-deployment
|
|
4
4
|
usage: /ship
|
|
5
|
-
allowed-tools: Bash(npm *), Bash(
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash(git *), Bash(npm *), Bash(pnpm *), Bash(yarn *), Bash(pytest *), Bash(python *), Bash(go *), Bash(cargo *), Bash(make *)
|
|
6
6
|
---
|
|
7
|
-
Pre-deploy
|
|
7
|
+
Pre-deploy / pre-merge gate. **Detect the stack first** (look for
|
|
8
|
+
`package.json`, `pyproject.toml`/`setup.cfg`, `go.mod`, `Cargo.toml`,
|
|
9
|
+
`Makefile`) and run only the checks that actually exist — never assume a
|
|
10
|
+
script (`lint`, `build`, `migrate`) is present. Report each item as
|
|
11
|
+
**pass / fail / N/A**.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
- [ ]
|
|
11
|
-
|
|
12
|
-
- [ ]
|
|
13
|
-
- [ ]
|
|
14
|
-
- [ ] No
|
|
15
|
-
-
|
|
16
|
-
- [ ]
|
|
13
|
+
## Checklist
|
|
14
|
+
- [ ] **Tests pass** — run the project's real test command (`npm test`,
|
|
15
|
+
`pytest`, `go test ./...`, `cargo test`, `make test`).
|
|
16
|
+
- [ ] **Lint / format clean** — only if a linter or formatter is configured.
|
|
17
|
+
- [ ] **Build succeeds** — only if the project has a build step.
|
|
18
|
+
- [ ] **No debug leftovers** — stray `console.log` / `print` / `debugger` /
|
|
19
|
+
`dbg!` / commented-out blocks / blocker `TODO`s in the changed files.
|
|
20
|
+
- [ ] **No hardcoded secrets** — scan the diff. Secrets load from env / a
|
|
21
|
+
secret store; `.env` is gitignored and only a value-less `.env.example`
|
|
22
|
+
is tracked.
|
|
23
|
+
- [ ] **Error handling complete** — every new IO / network / DB call has a
|
|
24
|
+
failure path; nothing fails silently; no internal detail leaks to clients.
|
|
25
|
+
- [ ] **Authorization** — new endpoints/actions check **ownership + role**,
|
|
26
|
+
not just authentication (no IDOR via id-swapping).
|
|
27
|
+
- [ ] **Rate limiting** — new externally reachable routes, including
|
|
28
|
+
authenticated writes, are bounded.
|
|
29
|
+
- [ ] **Data access scoped & scales** — new queries are constrained to the
|
|
30
|
+
requesting principal (no cross-tenant leak) and avoid obvious N+1 /
|
|
31
|
+
unindexed scans on hot paths.
|
|
32
|
+
- [ ] **Migrations ready** — only if the project has a schema / migrations.
|
|
33
|
+
- [ ] **Docs & config in sync** — `.env.example`, README, and any
|
|
34
|
+
threat-model / PRD updated for new config or new attack surface.
|
|
35
|
+
- [ ] **Clean tree, correct branch, in sync with `origin`.**
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
For any security-sensitive change in the diff, run **`/security`** on the
|
|
38
|
+
changed files before shipping.
|
|
39
|
+
|
|
40
|
+
Report: **Ready 🚀** or **Blocked 🛑** with the specific failing items.
|