@kubbisec/ai-linux-arm64 0.1.3 → 0.1.4

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.
Files changed (122) hide show
  1. package/bin/kubbisec +0 -0
  2. package/bundled/assets/terminal/banner-compact.ansi +7 -0
  3. package/bundled/assets/terminal/banner-wide.ansi +10 -0
  4. package/bundled/assets/terminal/logotipo-compact-fallback.ansi +7 -0
  5. package/bundled/assets/terminal/logotipo-compact.ansi +1 -0
  6. package/bundled/assets/terminal/logotipo-compact.png +0 -0
  7. package/bundled/assets/terminal/logotipo-wide-fallback.ansi +10 -0
  8. package/bundled/assets/terminal/logotipo-wide.ansi +1 -0
  9. package/bundled/assets/terminal/logotipo-wide.png +0 -0
  10. package/bundled/assets/terminal/mark.ansi +7 -0
  11. package/bundled/edit-format.md +17 -0
  12. package/bundled/extensions/cli-local-shared.d.ts +26 -0
  13. package/bundled/extensions/cli-local-shared.d.ts.map +1 -0
  14. package/bundled/extensions/cli-local-shared.js +97 -0
  15. package/bundled/extensions/cli-local-shared.js.map +1 -0
  16. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts +17 -0
  17. package/bundled/extensions/kubbisec-aspm-local.extension.d.ts.map +1 -0
  18. package/bundled/extensions/kubbisec-aspm-local.extension.js +134 -0
  19. package/bundled/extensions/kubbisec-aspm-local.extension.js.map +1 -0
  20. package/bundled/extensions/kubbisec-brand.extension.d.ts +20 -0
  21. package/bundled/extensions/kubbisec-brand.extension.d.ts.map +1 -0
  22. package/bundled/extensions/kubbisec-brand.extension.js +84 -0
  23. package/bundled/extensions/kubbisec-brand.extension.js.map +1 -0
  24. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts +30 -0
  25. package/bundled/extensions/kubbisec-byok-provider.extension.d.ts.map +1 -0
  26. package/bundled/extensions/kubbisec-byok-provider.extension.js +44 -0
  27. package/bundled/extensions/kubbisec-byok-provider.extension.js.map +1 -0
  28. package/bundled/extensions/kubbisec-clarify.extension.d.ts +45 -0
  29. package/bundled/extensions/kubbisec-clarify.extension.d.ts.map +1 -0
  30. package/bundled/extensions/kubbisec-clarify.extension.js +305 -0
  31. package/bundled/extensions/kubbisec-clarify.extension.js.map +1 -0
  32. package/bundled/extensions/kubbisec-footer.extension.d.ts +64 -0
  33. package/bundled/extensions/kubbisec-footer.extension.d.ts.map +1 -0
  34. package/bundled/extensions/kubbisec-footer.extension.js +187 -0
  35. package/bundled/extensions/kubbisec-footer.extension.js.map +1 -0
  36. package/bundled/extensions/kubbisec-github-local.extension.d.ts +23 -0
  37. package/bundled/extensions/kubbisec-github-local.extension.d.ts.map +1 -0
  38. package/bundled/extensions/kubbisec-github-local.extension.js +105 -0
  39. package/bundled/extensions/kubbisec-github-local.extension.js.map +1 -0
  40. package/bundled/extensions/kubbisec-memory.extension.d.ts +12 -0
  41. package/bundled/extensions/kubbisec-memory.extension.d.ts.map +1 -0
  42. package/bundled/extensions/kubbisec-memory.extension.js +107 -0
  43. package/bundled/extensions/kubbisec-memory.extension.js.map +1 -0
  44. package/bundled/extensions/kubbisec-naus-local.extension.d.ts +17 -0
  45. package/bundled/extensions/kubbisec-naus-local.extension.d.ts.map +1 -0
  46. package/bundled/extensions/kubbisec-naus-local.extension.js +125 -0
  47. package/bundled/extensions/kubbisec-naus-local.extension.js.map +1 -0
  48. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts +27 -0
  49. package/bundled/extensions/kubbisec-platform-tools.extension.d.ts.map +1 -0
  50. package/bundled/extensions/kubbisec-platform-tools.extension.js +144 -0
  51. package/bundled/extensions/kubbisec-platform-tools.extension.js.map +1 -0
  52. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts +13 -0
  53. package/bundled/extensions/kubbisec-runtime-status.extension.d.ts.map +1 -0
  54. package/bundled/extensions/kubbisec-runtime-status.extension.js +18 -0
  55. package/bundled/extensions/kubbisec-runtime-status.extension.js.map +1 -0
  56. package/bundled/extensions/kubbisec-scope.extension.d.ts +14 -0
  57. package/bundled/extensions/kubbisec-scope.extension.d.ts.map +1 -0
  58. package/bundled/extensions/kubbisec-scope.extension.js +14 -0
  59. package/bundled/extensions/kubbisec-scope.extension.js.map +1 -0
  60. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts +24 -0
  61. package/bundled/extensions/kubbisec-skill-mentions.extension.d.ts.map +1 -0
  62. package/bundled/extensions/kubbisec-skill-mentions.extension.js +54 -0
  63. package/bundled/extensions/kubbisec-skill-mentions.extension.js.map +1 -0
  64. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts +6 -0
  65. package/bundled/extensions/kubbisec-skill-telemetry.extension.d.ts.map +1 -0
  66. package/bundled/extensions/kubbisec-skill-telemetry.extension.js +85 -0
  67. package/bundled/extensions/kubbisec-skill-telemetry.extension.js.map +1 -0
  68. package/bundled/extensions/kubbisec-ui.extension.d.ts +6 -0
  69. package/bundled/extensions/kubbisec-ui.extension.d.ts.map +1 -0
  70. package/bundled/extensions/kubbisec-ui.extension.js +116 -0
  71. package/bundled/extensions/kubbisec-ui.extension.js.map +1 -0
  72. package/bundled/extensions/kubbisec-workflow.extension.d.ts +38 -0
  73. package/bundled/extensions/kubbisec-workflow.extension.d.ts.map +1 -0
  74. package/bundled/extensions/kubbisec-workflow.extension.js +169 -0
  75. package/bundled/extensions/kubbisec-workflow.extension.js.map +1 -0
  76. package/bundled/gate-system.md +27 -0
  77. package/bundled/reflect-system.md +31 -0
  78. package/bundled/skills/aspm-platform/SKILL.md +58 -0
  79. package/bundled/skills/chat-mention-render.d.ts +7 -0
  80. package/bundled/skills/chat-mention-render.d.ts.map +1 -0
  81. package/bundled/skills/chat-mention-render.js +122 -0
  82. package/bundled/skills/chat-mention-render.js.map +1 -0
  83. package/bundled/skills/chat-mention-render.test.ts +47 -0
  84. package/bundled/skills/chat-mention-render.ts +141 -0
  85. package/bundled/skills/chat-mentions.d.ts +27 -0
  86. package/bundled/skills/chat-mentions.d.ts.map +1 -0
  87. package/bundled/skills/chat-mentions.js +104 -0
  88. package/bundled/skills/chat-mentions.js.map +1 -0
  89. package/bundled/skills/chat-mentions.test.ts +32 -0
  90. package/bundled/skills/chat-mentions.ts +126 -0
  91. package/bundled/skills/github-local/SKILL.md +16 -0
  92. package/bundled/skills/list-bundled-skills.d.ts +7 -0
  93. package/bundled/skills/list-bundled-skills.d.ts.map +1 -0
  94. package/bundled/skills/list-bundled-skills.js +44 -0
  95. package/bundled/skills/list-bundled-skills.js.map +1 -0
  96. package/bundled/skills/list-bundled-skills.ts +46 -0
  97. package/bundled/skills/naus-pipelines/SKILL.md +31 -0
  98. package/bundled/skills/remediation/SKILL.md +12 -0
  99. package/bundled/skills/scanner-gitleaks/SKILL.md +10 -0
  100. package/bundled/skills/scanner-nmap/SKILL.md +10 -0
  101. package/bundled/skills/scanner-osv/SKILL.md +10 -0
  102. package/bundled/skills/scanner-semgrep/SKILL.md +10 -0
  103. package/bundled/skills/scanner-skipfish/SKILL.md +10 -0
  104. package/bundled/skills/scanner-sonar/SKILL.md +10 -0
  105. package/bundled/skills/scanner-syft/SKILL.md +10 -0
  106. package/bundled/skills/scanner-trivy/SKILL.md +10 -0
  107. package/bundled/skills/sec-brainstorm/SKILL.md +74 -0
  108. package/bundled/skills/sec-clarify/SKILL.md +68 -0
  109. package/bundled/skills/sec-debug/SKILL.md +94 -0
  110. package/bundled/skills/sec-plan/SKILL.md +101 -0
  111. package/bundled/skills/sec-review/SKILL.md +110 -0
  112. package/bundled/skills/sec-review/code-reviewer-sec.md +176 -0
  113. package/bundled/skills/sec-using-skills/SKILL.md +79 -0
  114. package/bundled/skills/sec-verify/SKILL.md +77 -0
  115. package/bundled/skills/skill-mention.d.ts +3 -0
  116. package/bundled/skills/skill-mention.d.ts.map +1 -0
  117. package/bundled/skills/skill-mention.js +3 -0
  118. package/bundled/skills/skill-mention.js.map +1 -0
  119. package/bundled/skills/skill-mention.test.ts +46 -0
  120. package/bundled/skills/skill-mention.ts +10 -0
  121. package/bundled/theme/kubbisec.json +93 -0
  122. package/package.json +3 -2
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: sec-clarify
3
+ description: "Chat-only: collect scope via the questionnaire tool before mutations."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ surfaces: [chat]
8
+ excludes: [fix, watch, run]
9
+ ---
10
+
11
+ # sec-clarify — Session scope (KubbiSec)
12
+
13
+ **Announce briefly:** `A recolher escopo antes de alterações.`
14
+
15
+ ## Primary mechanism: `questionnaire` tool
16
+
17
+ Use the **`questionnaire` tool** (not ad-hoc markdown) to format and track scope.
18
+
19
+ | Action | When |
20
+ |--------|------|
21
+ | `status` | Check missing fields + scenario hints |
22
+ | `ask` | One contextual question (you provide or reuse hints) |
23
+ | `record` | User already gave scope in prose — persist fields |
24
+ | `complete` | Scope is sufficient — unblock mutations |
25
+
26
+ ### ask — tailor to the scenario
27
+
28
+ Provide **your own** question text and 2–4 short options when possible:
29
+
30
+ ```json
31
+ {
32
+ "action": "ask",
33
+ "scenario": "remediation",
34
+ "field": "severityMin",
35
+ "question": "Qual severidade mínima entra no escopo desta remediação?",
36
+ "options": ["CRITICAL", "HIGH", "MEDIUM", "Todas"]
37
+ }
38
+ ```
39
+
40
+ If you omit copy, the tool suggests field hints for the scenario — still **adapt** wording to the user.
41
+
42
+ ## When to use
43
+
44
+ - Execute/remediation intent without enough scope
45
+ - Before destructive tools or `@plan` when decisions are unclear
46
+
47
+ ## When NOT to use
48
+
49
+ - Questionnaire already **ready**
50
+ - Factual/docs questions
51
+ - `KUBBISEC_SKIP_CLARIFY=1`
52
+ - Headless `kbs fix` / `watch`
53
+
54
+ ## UX rules
55
+
56
+ - KubbiSec renders A–E in the **questionnaire panel** — do not repeat the full list in chat.
57
+ - One question per turn; wait for A–E or free text.
58
+ - **Never** mention internal paths, `.kbs`, or JSON files.
59
+
60
+ ## Common scope fields
61
+
62
+ - `projectIds`, `severityMin`, `remediationMode` (remediation)
63
+ - `customNotes`, `nausConstraints` (plan/pipeline context)
64
+ - Any extra key → stored in `extras`
65
+
66
+ ## Handoff
67
+
68
+ When status is **ready**, proceed with remediation, `sec-plan`, or the user request.
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: sec-debug
3
+ description: "Systematic root-cause analysis for test failures, harness errors, and failed remediations before proposing fixes."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ surfaces: [chat, fix, watch]
8
+ follows: [sec-verify]
9
+ ---
10
+
11
+ # sec-debug — Systematic debugging (KubbiSec)
12
+
13
+ **Announce:** `Using sec-debug — Phase 1 investigation.`
14
+
15
+ ## Iron Law
16
+
17
+ **NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.**
18
+
19
+ Even under time pressure, complete Phase 1 summary before any edit.
20
+
21
+ ## When to use
22
+
23
+ - `sec-verify` reported failures
24
+ - Remediation harness empty diff or retry loop
25
+ - `kbs watch` tick failure
26
+ - Flaky or intermittent CI vs local delta
27
+
28
+ Pairs with `remediation` after root cause is proven for CVE-scoped work.
29
+
30
+ ## Four phases
31
+
32
+ | Phase | Name | Activities | Exit criteria |
33
+ |-------|------|------------|---------------|
34
+ | 1 | Root cause investigation | Read errors, reproduce, git diff, recent changes | Written hypothesis with evidence |
35
+ | 2 | Pattern analysis | Compare similar code, search repo, check deps | Hypothesis confirmed or ruled out |
36
+ | 3 | Hypothesis test | Minimal experiment, logging, single-variable change | Root cause proven |
37
+ | 4 | Fix implementation | Minimal fix + `sec-verify` | Verify evidence attached |
38
+
39
+ Show phase headers to user: `Fase 1/4 — Investigação`.
40
+
41
+ ## Multi-component boundaries (KubbiSec)
42
+
43
+ | Boundary | Diagnostic action |
44
+ |----------|-------------------|
45
+ | CLI → API | Log HTTP status + request id |
46
+ | API → Prisma | Log query error code |
47
+ | Harness → git | Log diff stat + exit code |
48
+ | Scanner → finding | Log rule id + file path |
49
+
50
+ ## Debug log artifact (optional)
51
+
52
+ Write `.kbs/context/debug-YYYY-MM-DD-<slug>.md`:
53
+
54
+ ```markdown
55
+ ## Symptom
56
+ ...
57
+
58
+ ## Reproduction steps
59
+ 1. ...
60
+
61
+ ## Evidence
62
+ - command: ...
63
+ - output: ...
64
+
65
+ ## Root cause
66
+ ...
67
+
68
+ ## Fix (minimal)
69
+ ...
70
+ ```
71
+
72
+ No secrets from `.env` or tokens in reproduction commands. Use test accounts for auth bugs.
73
+
74
+ ## Empty remediation diff playbook
75
+
76
+ Phase 1: read harness JSON, model tool calls, task XML.
77
+
78
+ Root cause categories: tool-weak model, wrong branch, permission, prompt drift.
79
+
80
+ Handoff to `remediation` or config change — not blind retry.
81
+
82
+ ## Escalation
83
+
84
+ - **3rd failed fix:** Stop auto-retry; escalate human with debug log summary
85
+ - **Cannot reproduce:** Do not fix; list data needed from user
86
+ - **Multiple root causes:** Split debug sessions per cause
87
+
88
+ ## Copy (PT)
89
+
90
+ `Investigando causa raiz antes de novo patch.`
91
+
92
+ ---
93
+
94
+ *Adapted from Superpowers (obra/superpowers) — MIT License.*
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: sec-plan
3
+ description: "After approved .kbs/specs: produce bite-sized implementation plan at .kbs/plans/ with verification steps."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ requires: [kbs-spec-approved]
8
+ produces: kbs-plan
9
+ ---
10
+
11
+ # sec-plan — Implementation plan (KubbiSec)
12
+
13
+ **Announce:** `Using sec-plan to decompose work from <spec-path>.`
14
+
15
+ ## When to use
16
+
17
+ - `.kbs/specs/*.md` has `status: approved`
18
+ - Handoff from `sec-brainstorm` after user approval
19
+ - User invokes `/skill:sec-plan` or `@plan` with approved spec
20
+
21
+ ## When NOT to use
22
+
23
+ - Spec still `draft` — refuse; link to sec-brainstorm approval step
24
+ - Headless remediation unless task metadata sets `requirePlan=true`
25
+ - Emergency plan without spec — only with `deferred-spec: true` header + explicit user sign-off (discouraged)
26
+
27
+ ## Process
28
+
29
+ 1. Read approved spec + questionnaire + affected package layout
30
+ 2. Draft **file map** (which packages touched; `packages/shared` first if types change)
31
+ 3. Write `.kbs/plans/YYYY-MM-DD-<slug>.md` paired with spec (same date + slug)
32
+ 4. Present plan summary; user may edit plan file
33
+ 5. Implementation begins; mark checkboxes as tasks complete
34
+ 6. After each task or batch: run **`sec-verify`** before claiming done
35
+
36
+ ## Plan header (required)
37
+
38
+ ```markdown
39
+ # <Feature> — Implementation Plan
40
+
41
+ > **Spec:** `.kbs/specs/YYYY-MM-DD-<slug>.md` (approved)
42
+ > **For KubbiSec agents:** Execute tasks in order; run `sec-verify` before marking task done.
43
+
44
+ **Goal:** <one sentence>
45
+
46
+ **Architecture:** <2-3 sentences>
47
+
48
+ **Tech stack:** <e.g. NestJS, Prisma, Vitest, React, NAUS>
49
+
50
+ **Security notes:** <top mitigations from threat model>
51
+
52
+ ---
53
+ ```
54
+
55
+ ## Task entry schema
56
+
57
+ ```markdown
58
+ ### Task N: <name>
59
+
60
+ **Files:**
61
+ - Create: `path/to/file`
62
+ - Modify: `path/to/existing.ts:10-40`
63
+ - Test: `path/to/file.test.ts`
64
+
65
+ - [ ] **Step 1:** <action>
66
+ - Verify: `pnpm --filter <pkg> test path -v`
67
+ - Expected: PASS
68
+
69
+ - [ ] **Step 2:** ...
70
+ ```
71
+
72
+ Optional frontmatter:
73
+
74
+ ```yaml
75
+ ---
76
+ kbsPlan:
77
+ specRef: .kbs/specs/2026-05-29-mfa-login.md
78
+ estimatedTasks: 8
79
+ ---
80
+ ```
81
+
82
+ ## Dispatch reviewer (orchestrator)
83
+
84
+ After each batch of ~3 tasks (or before merge), dispatch `code-reviewer-sec` subagent — see `sec-review/code-reviewer-sec.md`.
85
+
86
+ ## Rules
87
+
88
+ - Each task includes ≥1 verify command
89
+ - Reference threat model mitigations for auth, crypto, CI secrets tasks
90
+ - Never embed credentials; reference EnvPack key **names** only
91
+ - NAUS tasks: reference `@naus/validation` and relevant scanner skill
92
+ - If plan exists: ask overwrite vs `-v2` suffix
93
+ - Low-resource mode: cap at 6 tasks
94
+
95
+ ## Handoff copy (PT)
96
+
97
+ `Plano salvo em .kbs/plans/. Marque cada passo após sec-verify.`
98
+
99
+ ---
100
+
101
+ *Adapted from Superpowers (obra/superpowers) — MIT License.*
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: sec-review
3
+ description: "Review git diffs for OWASP issues, authz bugs, secrets, and supply-chain risks before merge or PR."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ surfaces: [chat, fix]
8
+ pairsWith: [sec-verify]
9
+ ---
10
+
11
+ # sec-review — Security code review (KubbiSec)
12
+
13
+ **Announce:** `Using sec-review on diff {BASE}..{HEAD}.`
14
+
15
+ Read-only skill. Do not exfiltrate secrets from diff into `.kbs/` files — redact matches (`***` + line number).
16
+
17
+ ## When to use
18
+
19
+ - `kbs chat --mode review` or `/skill:sec-review`
20
+ - Before merge / PR after implementation
21
+ - After remediation harness produces non-empty diff (FIX-001)
22
+ - Pairs with `sec-verify` — review alone does not prove merge-safe
23
+
24
+ ## Git commands
25
+
26
+ ```bash
27
+ git diff --stat {BASE}..{HEAD}
28
+ git diff {BASE}..{HEAD}
29
+ git log --oneline {BASE}..{HEAD} # optional
30
+ ```
31
+
32
+ Default base: `origin/main`. Invalid SHA → ask user or use `HEAD~1`.
33
+
34
+ ## OWASP Top 10:2021 checklist
35
+
36
+ | ID | Category | Review focus |
37
+ |----|----------|--------------|
38
+ | A01 | Broken Access Control | Guards, IDOR, role checks, BOLA |
39
+ | A02 | Cryptographic Failures | Weak algos, hardcoded keys, TLS |
40
+ | A03 | Injection | SQL/NoSQL/OS/command/template |
41
+ | A04 | Insecure Design | Rate limits, trust boundaries |
42
+ | A05 | Security Misconfiguration | Debug flags, default creds, CORS `*` |
43
+ | A06 | Vulnerable Components | Dep bumps without audit |
44
+ | A07 | Auth Failures | Session fixation, weak MFA, passwords |
45
+ | A08 | Integrity Failures | Unsigned artifacts, unsafe deserialization |
46
+ | A09 | Logging Failures | Sensitive data in logs, missing audit |
47
+ | A10 | SSRF | User-controlled URLs in server fetch |
48
+
49
+ ## KubbiSec-specific checks
50
+
51
+ | Check | Trigger |
52
+ |-------|---------|
53
+ | Secrets in repo | Regex + gitleaks patterns in diff |
54
+ | EnvPack leakage | `GITHUB_TOKEN`, API keys in tests/fixtures |
55
+ | NAUS pipeline | Unsafe `curl \| bash`, privileged containers |
56
+ | Multi-tenant | `organizationId` scoping on new endpoints |
57
+
58
+ ## Output format
59
+
60
+ ```markdown
61
+ ## sec-review — <short title>
62
+
63
+ **Range:** `<base>..<head>`
64
+ **Spec/plan:** <path or N/A>
65
+
66
+ ### Strengths
67
+ - ...
68
+
69
+ ### OWASP findings
70
+
71
+ | OWASP | Severity | File:line | Issue | Fix hint |
72
+ |-------|----------|-----------|-------|----------|
73
+ | A03 | Critical | api/foo.ts:42 | ... | ... |
74
+
75
+ ### Other issues
76
+
77
+ #### Critical (must fix before merge)
78
+ 1. ...
79
+
80
+ #### Important
81
+ 1. ...
82
+
83
+ #### Minor
84
+ 1. ...
85
+
86
+ ### Assessment
87
+ **Ready to merge?** Yes / No / With fixes
88
+ **Reasoning:** ...
89
+ ```
90
+
91
+ ## Edge cases
92
+
93
+ - **Empty diff:** Report "no changes"; skip OWASP table except note
94
+ - **Large diff (>500 files):** Prioritize `apps/api`, auth, deps; note scope limit
95
+ - **No git repo:** Review user-pasted patch; warn reduced confidence
96
+ - **Binary diff:** Skip with note
97
+
98
+ ## Subagent template
99
+
100
+ For orchestrator batch reviews, use `code-reviewer-sec.md` in this directory — same OWASP matrix plus Compliance and Supply chain sections.
101
+
102
+ ## Critical rules
103
+
104
+ **DO:** Cite file:line; separate severity buckets; acknowledge strengths.
105
+
106
+ **DON'T:** Approve without reading diff; mark nits Critical; claim tests pass without verify evidence.
107
+
108
+ ---
109
+
110
+ *Adapted from Superpowers (obra/superpowers) — MIT License.*
@@ -0,0 +1,176 @@
1
+ # KubbiSec Security Code Review Agent
2
+
3
+ You are reviewing code changes for **production readiness and DevSecOps compliance** on the KubbiSec platform.
4
+
5
+ **Your task:**
6
+
7
+ 1. Review {WHAT_WAS_IMPLEMENTED}
8
+ 2. Compare against {PLAN_OR_REQUIREMENTS}
9
+ 3. Run git diff analysis between {BASE_SHA} and {HEAD_SHA}
10
+ 4. Apply **Code Quality**, **Security (OWASP)**, **Compliance**, and **Supply chain** checklists
11
+ 5. Categorize issues: Critical / Important / Minor
12
+ 6. Assess merge readiness — require sec-verify evidence if author claims tests pass
13
+
14
+ ## What Was Implemented
15
+
16
+ {DESCRIPTION}
17
+
18
+ ## Requirements / Plan / Spec
19
+
20
+ {PLAN_OR_REQUIREMENTS}
21
+
22
+ ## Finding context (remediation)
23
+
24
+ {FINDING_CONTEXT}
25
+
26
+ ## Git range
27
+
28
+ **Base:** {BASE_SHA}
29
+ **Head:** {HEAD_SHA}
30
+
31
+ ```bash
32
+ git diff --stat {BASE_SHA}..{HEAD_SHA}
33
+ git diff {BASE_SHA}..{HEAD_SHA}
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Review checklist — Code quality
39
+
40
+ - Separation of concerns and SRP
41
+ - Error handling and typed exceptions
42
+ - TypeScript types (no unjustified `any`)
43
+ - DRY without premature abstraction
44
+ - Edge cases and null safety
45
+ - Architecture matches plan/spec
46
+ - Tests cover changed behavior
47
+ - Requirements from spec/plan satisfied
48
+ - Production readiness (no debug flags, TODO blockers)
49
+
50
+ ---
51
+
52
+ ## Review checklist — Security (OWASP Top 10:2021)
53
+
54
+ For each category, mark **Pass / Fail / N/A** with file:line refs on Fail:
55
+
56
+ | ID | Category | Pass/Fail/N/A | Notes |
57
+ |----|----------|---------------|-------|
58
+ | A01 | Broken Access Control | | |
59
+ | A02 | Cryptographic Failures | | |
60
+ | A03 | Injection | | |
61
+ | A04 | Insecure Design | | |
62
+ | A05 | Security Misconfiguration | | |
63
+ | A06 | Vulnerable Components | | |
64
+ | A07 | Auth Failures | | |
65
+ | A08 | Integrity Failures | | |
66
+ | A09 | Logging Failures | | |
67
+ | A10 | SSRF | | |
68
+
69
+ **KubbiSec-specific:**
70
+
71
+ - [ ] Multi-tenant `organizationId` / `projectId` scoping on new endpoints
72
+ - [ ] No secrets in code, tests, fixtures, or `.kbs/` artifacts
73
+ - [ ] Platform tools respect RBAC (no privilege escalation via assistant)
74
+
75
+ ---
76
+
77
+ ## Review checklist — Compliance
78
+
79
+ Mark **Pass / Fail / N/A** with rationale (engineering controls only — no legal advice):
80
+
81
+ | Area | Checks |
82
+ |------|--------|
83
+ | **Data protection** | PII minimization, retention notes, encryption at rest/transit for new fields |
84
+ | **Auditability** | Security-relevant actions logged with actor + tenant ids |
85
+ | **Access control** | Role checks documented; default-deny for new routes |
86
+ | **Regulatory hooks** | If health/finance keywords in spec: flag need for human compliance review |
87
+ | **License** | New deps have compatible licenses; NOTICE updated if required |
88
+
89
+ ---
90
+
91
+ ## Review checklist — Supply chain
92
+
93
+ | Check | Pass/Fail/N/A | Notes |
94
+ |-------|---------------|-------|
95
+ | Dependency changes reviewed (`package.json`, lockfiles) | | |
96
+ | Pinning vs range policy respected | | |
97
+ | CI pipeline changes (`*.yml`, NAUS) — no untrusted scripts | | |
98
+ | Container/base image bumps traced | | |
99
+ | SBOM impact noted if monorepo publishes SBOM | | |
100
+ | Third-party GitHub Actions pinned to SHA | | |
101
+
102
+ ---
103
+
104
+ ## Output format
105
+
106
+ ### Strengths
107
+
108
+ ...
109
+
110
+ ### Issues
111
+
112
+ #### Critical (must fix)
113
+
114
+ - File:line — issue — why — fix hint
115
+
116
+ #### Important (should fix)
117
+
118
+ ...
119
+
120
+ #### Minor (nice to have)
121
+
122
+ ...
123
+
124
+ ### Security summary
125
+
126
+ | OWASP | Highest severity found |
127
+ |-------|------------------------|
128
+
129
+ ### Compliance summary
130
+
131
+ ...
132
+
133
+ ### Supply chain summary
134
+
135
+ ...
136
+
137
+ ### Recommendations
138
+
139
+ ...
140
+
141
+ ### Assessment
142
+
143
+ **Ready to merge?** Yes / No / With fixes
144
+
145
+ **sec-verify required:** List commands author must run if not attached.
146
+
147
+ **Reasoning:** 1-2 sentences.
148
+
149
+ ---
150
+
151
+ ## Critical rules
152
+
153
+ **DO:** Cite file:line; separate OWASP vs compliance vs supply chain; acknowledge strengths; clear verdict.
154
+
155
+ **DON'T:** Approve without reading diff; mark nits Critical; claim tests pass without log evidence; provide legal certification.
156
+
157
+ ---
158
+
159
+ ## Dispatch protocol
160
+
161
+ **When to dispatch `code-reviewer-sec`:**
162
+
163
+ - After each plan task batch (~3 tasks) OR before merge
164
+ - Mandatory after remediation diff (FIX-001)
165
+ - When sec-review findings include any Critical/Important open items
166
+
167
+ **How:**
168
+
169
+ 1. Resolve BASE_SHA / HEAD_SHA
170
+ 2. Spawn subagent with this template
171
+ 3. Feed outputs back to implementing agent
172
+ 4. Critical → fix immediately; Important → fix before next task
173
+
174
+ ---
175
+
176
+ *Adapted from Superpowers (obra/superpowers) — MIT License. KubbiSec modifications: OWASP Top 10 matrix, Compliance and Supply chain checklists, tenant/secrets rules, sec-verify evidence requirement. Interactive chat equivalent: `/skill:sec-review`.*
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: sec-using-skills
3
+ description: "Route KubbiSec chat to sec-* workflow skills vs domain skills (naus-pipelines, remediation, scanner-*, aspm-platform). Invoke before choosing a skill path."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ surfaces: [chat]
8
+ ---
9
+
10
+ # sec-using-skills — Skill routing (KubbiSec)
11
+
12
+ Use this skill when the user intent is unclear, when multiple skills could apply, or at the start of a non-trivial session.
13
+
14
+ **Announce:** `Using sec-using-skills to pick the right workflow.`
15
+
16
+ ## The rule
17
+
18
+ If a **sec-*** workflow skill might apply, invoke it **before** domain skills or code changes. User explicit `@skill <name>` overrides routing.
19
+
20
+ ## Skill categories
21
+
22
+ | Category | Examples | Purpose |
23
+ |----------|----------|---------|
24
+ | **workflow** | `sec-clarify`, `sec-brainstorm`, `sec-plan`, `sec-review`, `sec-verify`, `sec-debug` | Specify, plan, review, verify |
25
+ | **domain** | `naus-pipelines`, `remediation`, `aspm-platform`, `github-local` | ASPM, CI, CVE fixes, GitHub |
26
+ | **scanner** | `scanner-semgrep`, `scanner-trivy`, … | Run one scanner per turn |
27
+
28
+ ## Routing matrix
29
+
30
+ | User intent | Primary skill | Optional secondary | Never combine |
31
+ |-------------|---------------|-------------------|---------------|
32
+ | Vague scope, missing org/project/CVE context | `sec-clarify` | — | `sec-plan` before clarify done |
33
+ | New feature / refactor / policy (chat) | `sec-brainstorm` → `sec-plan` | `naus-pipelines` if CI-only | `remediation` |
34
+ | Implement approved `.kbs/specs/*.md` | `sec-plan` | domain skill for file area | `sec-brainstorm` mid-implementation |
35
+ | Review diff before merge / after fix | `sec-review` | `sec-verify` | `sec-brainstorm` |
36
+ | Claim "done", "tests pass", open PR | `sec-verify` | — | skip verify |
37
+ | Failed remediation / flaky test / regression | `sec-debug` | `remediation` (CVE-scoped) | `sec-plan` |
38
+ | NAUS pipeline YAML | `naus-pipelines` | `sec-review` if auth/secrets touched | — |
39
+ | CVE minimal patch | `remediation` | `sec-verify` on exit | `sec-brainstorm` |
40
+ | ASPM API / findings | `aspm-platform` | — | — |
41
+ | Local GitHub clone/status | `github-local` | — | — |
42
+ | Run Semgrep/Trivy/etc. | one `scanner-*` | — | multiple scanners same turn |
43
+
44
+ ## Invocation surfaces
45
+
46
+ | Surface | sec-* | Domain |
47
+ |---------|-------|--------|
48
+ | `kbs chat` | Yes (`/skill:sec-*`, `@skill sec-*`) | Yes |
49
+ | `kbs chat --mode plan` | **Required:** clarify → brainstorm → plan | Read-only discovery only |
50
+ | `kbs chat --mode review` | **Prefer** `sec-review` | Read + diff tools |
51
+ | `kbs fix` / remediation harness | `sec-review` + `sec-verify` only | `remediation` implicit |
52
+ | `kbs watch` | `sec-debug` on failure | scanner-* per policy |
53
+
54
+ ## Typical greenfield flow
55
+
56
+ 1. `sec-clarify` — lock org/project/acceptance criteria → `.kbs/context/session-questionnaire.json`
57
+ 2. `sec-brainstorm` — threat model + design → `.kbs/specs/YYYY-MM-DD-<slug>.md` (HARD-GATE until `approved`)
58
+ 3. `sec-plan` — bite-sized tasks → `.kbs/plans/YYYY-MM-DD-<slug>.md`
59
+ 4. Implement with domain skills as needed
60
+ 5. `sec-review` on diff, then `sec-verify` with command evidence before PR
61
+
62
+ ## Env / flags
63
+
64
+ ```bash
65
+ KUBBISEC_CHAT_MODE=default|plan|review
66
+ KUBBISEC_FORCE_SKILL=sec-brainstorm # escape hatch; log warning
67
+ KUBBISEC_SKIP_CLARIFY=1 # skip questionnaire; still log skip
68
+ ```
69
+
70
+ ## Anti-patterns
71
+
72
+ - Loading `sec-brainstorm` + `remediation` in the same turn
73
+ - Running `sec-plan` before spec is `approved`
74
+ - Claiming merge-ready without `sec-review` + `sec-verify`
75
+ - Multiple `scanner-*` skills in one turn
76
+
77
+ ---
78
+
79
+ *Adapted from Superpowers (obra/superpowers) — MIT License.*
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: sec-verify
3
+ description: "Run verification commands and attach evidence before claiming tests pass, build OK, or PR ready."
4
+ metadata:
5
+ kubbisec:
6
+ category: workflow
7
+ surfaces: [chat, fix, watch]
8
+ blocks: [false-completion-claims]
9
+ ---
10
+
11
+ # sec-verify — Evidence before completion (KubbiSec)
12
+
13
+ **Announce:** `Using sec-verify for <claim>.`
14
+
15
+ ## Iron Law
16
+
17
+ **No completion claims without fresh command output in this session.**
18
+
19
+ ## Gate function
20
+
21
+ Before claiming any status (pass, fixed, ready, done):
22
+
23
+ 1. **IDENTIFY** — What command proves this claim?
24
+ 2. **RUN** — Execute the FULL command in this session (fresh)
25
+ 3. **READ** — Full stdout/stderr, exit code, failure count
26
+ 4. **VERIFY** — Does output support the claim?
27
+ 5. **REPORT** — State claim ONLY with quoted evidence snippet
28
+
29
+ ## Claim → evidence map (monorepo defaults)
30
+
31
+ | Claim | Required command | Not sufficient |
32
+ |-------|------------------|----------------|
33
+ | Unit tests pass | `pnpm --filter <pkg> test <file> -v` | Prior run, "should pass" |
34
+ | API tests pass | `pnpm --filter api test -v` | Lint only |
35
+ | Lint clean | `pnpm exec eslint <paths>` | Partial file |
36
+ | Typecheck | `pnpm exec tsc -p <tsconfig> --noEmit` | IDE green |
37
+ | Build | `pnpm --filter <pkg> build` | Types only |
38
+ | CVE fixed | Re-run scanner + target test | Code changed only |
39
+ | sec-review clear | sec-review output attached | Self-review |
40
+ | No secrets | `gitleaks detect --no-git` or scanner skill | grep once |
41
+
42
+ ## Forbidden phrases (without step 5 evidence)
43
+
44
+ - "should work", "probably", "seems fine", "looks good"
45
+ - "Great!", "Done!", "Perfect!" before evidence
46
+ - "Tests pass" without exit code 0 in same turn
47
+
48
+ ## Process — after plan task
49
+
50
+ 1. Read plan step **Verify:** command
51
+ 2. Run via `bash`; capture full output
52
+ 3. Post: `Claim: tests pass. Evidence: exit 0, N passed` + excerpt (max 2k chars)
53
+ 4. Check plan checkbox only after evidence posted
54
+ 5. Scrub `*TOKEN*`, `*SECRET*` from excerpts
55
+
56
+ ## Process — before PR (fix flow)
57
+
58
+ 1. Remediation diff + sec-review done
59
+ 2. Run package tests + optional semgrep/trivy per policy
60
+ 3. Append `verifyEvidence[]` to progress log
61
+ 4. PR creation allowed
62
+
63
+ ## Failures and waivers
64
+
65
+ - Command fails → report actual failures; no "mostly pass"
66
+ - Command not found → suggest `pnpm install`; fail verify
67
+ - Timeout (>10m) → report timeout; no pass claim
68
+ - Flaky test → report flake; suggest `sec-debug`
69
+ - User requests skip → refuse false claim; allow `verifyWaived: true` only with user-typed waiver in chat
70
+
71
+ ## Copy (PT)
72
+
73
+ `Sem saída de comando nesta sessão, não afirmamos sucesso.`
74
+
75
+ ---
76
+
77
+ *Adapted from Superpowers (obra/superpowers) — MIT License.*