@namch/agent-assistant 1.3.0 → 1.3.2

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 (142) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/README.md +3 -4
  3. package/agents/backend-engineer.md +3 -3
  4. package/agents/brainstormer.md +3 -3
  5. package/agents/business-analyst.md +3 -3
  6. package/agents/database-architect.md +3 -3
  7. package/agents/debugger.md +2 -2
  8. package/agents/designer.md +2 -2
  9. package/agents/devops-engineer.md +2 -2
  10. package/agents/docs-manager.md +23 -15
  11. package/agents/frontend-engineer.md +3 -3
  12. package/agents/game-engineer.md +3 -3
  13. package/agents/mobile-engineer.md +4 -4
  14. package/agents/performance-engineer.md +3 -3
  15. package/agents/planner.md +4 -4
  16. package/agents/project-manager.md +3 -3
  17. package/agents/researcher.md +3 -3
  18. package/agents/reviewer.md +3 -3
  19. package/agents/scouter.md +3 -3
  20. package/agents/security-engineer.md +3 -3
  21. package/agents/tech-lead.md +3 -3
  22. package/agents/tester.md +2 -2
  23. package/code-assistants/codex-assistant/CODEX.md +1 -2
  24. package/commands/ask/hard.md +1 -1
  25. package/commands/brainstorm/hard.md +1 -1
  26. package/commands/code/hard.md +1 -1
  27. package/commands/code.md +2 -7
  28. package/commands/cook/hard.md +1 -1
  29. package/commands/cook.md +1 -6
  30. package/commands/debug/hard.md +1 -1
  31. package/commands/debug.md +1 -6
  32. package/commands/design/hard.md +1 -1
  33. package/commands/design.md +1 -6
  34. package/commands/docs/audit.md +554 -78
  35. package/commands/docs/business.md +392 -76
  36. package/commands/docs/core.md +573 -74
  37. package/commands/docs.md +62 -61
  38. package/commands/fix/hard.md +1 -1
  39. package/commands/fix.md +1 -6
  40. package/commands/plan/hard.md +1 -1
  41. package/commands/plan.md +1 -6
  42. package/commands/report/fast.md +2 -2
  43. package/commands/report/hard.md +1 -1
  44. package/commands/report.md +2 -7
  45. package/commands/review/hard.md +1 -1
  46. package/commands/test/hard.md +1 -1
  47. package/commands/test.md +1 -6
  48. package/documents/HSOL-ASSESSMENT.md +6 -6
  49. package/documents/SMART-SKILL-ORCHESTRATION-BLUEPRINT.md +1 -1
  50. package/documents/business/business-features/00-index.md +101 -0
  51. package/documents/business/business-features/01-feature-inventory.md +341 -0
  52. package/documents/business/business-features/02-prioritization-moscow.md +148 -0
  53. package/documents/business/business-features/03-feature-specifications.md +511 -0
  54. package/documents/business/business-features/04-dependencies-and-release-sequencing.md +313 -0
  55. package/documents/business/business-features/05-success-metrics.md +290 -0
  56. package/documents/business/business-glossary/00-index.md +89 -0
  57. package/documents/business/business-glossary/01-canonical-terms.md +428 -0
  58. package/documents/business/business-glossary/02-synonyms-and-deprecated-terms.md +180 -0
  59. package/documents/business/business-glossary/03-domain-entities-and-events.md +395 -0
  60. package/documents/business/business-glossary/04-api-term-mapping.md +173 -0
  61. package/documents/business/business-prd/00-index.md +107 -0
  62. package/documents/business/business-prd/01-executive-summary.md +131 -0
  63. package/documents/business/business-prd/02-problem-goals-and-scope.md +204 -0
  64. package/documents/business/business-prd/03-stakeholders-and-requirements.md +210 -0
  65. package/documents/business/business-prd/04-acceptance-risks-assumptions.md +246 -0
  66. package/documents/business/business-workflows/00-index.md +107 -0
  67. package/documents/business/business-workflows/01-actor-map.md +303 -0
  68. package/documents/business/business-workflows/02-workflow-catalog.md +252 -0
  69. package/documents/business/business-workflows/03-detailed-workflows.md +641 -0
  70. package/documents/business/business-workflows/04-decision-rules-and-exceptions.md +216 -0
  71. package/documents/business/business-workflows/05-sla-and-handoffs.md +253 -0
  72. package/documents/knowledge-architecture/00-index.md +159 -0
  73. package/documents/knowledge-architecture/01-system-overview.md +240 -0
  74. package/documents/knowledge-architecture/02-components.md +419 -0
  75. package/documents/knowledge-architecture/03-data-flow.md +368 -0
  76. package/documents/knowledge-architecture/04-design-patterns.md +497 -0
  77. package/documents/knowledge-architecture/05-decisions.md +410 -0
  78. package/documents/knowledge-domain/00-index.md +251 -0
  79. package/documents/knowledge-domain/01-entities.md +582 -0
  80. package/documents/knowledge-domain/02-database-schema.md +138 -0
  81. package/documents/knowledge-domain/03-api-contracts.md +477 -0
  82. package/documents/knowledge-domain/04-business-rules.md +554 -0
  83. package/documents/knowledge-overview/00-index.md +107 -0
  84. package/documents/knowledge-overview/01-project-identity.md +162 -0
  85. package/documents/knowledge-overview/02-tech-stack.md +119 -0
  86. package/documents/knowledge-overview/03-features.md +232 -0
  87. package/documents/knowledge-overview/04-getting-started.md +394 -0
  88. package/documents/knowledge-source-base/00-index.md +107 -0
  89. package/documents/knowledge-source-base/01-directory-structure.md +312 -0
  90. package/documents/knowledge-source-base/02-entry-points.md +346 -0
  91. package/documents/knowledge-source-base/03-key-modules.md +581 -0
  92. package/documents/knowledge-source-base/04-configuration.md +467 -0
  93. package/documents/knowledge-standards/00-index.md +129 -0
  94. package/documents/knowledge-standards/01-code-style.md +161 -0
  95. package/documents/knowledge-standards/02-conventions.md +254 -0
  96. package/documents/knowledge-standards/03-git-workflow.md +228 -0
  97. package/documents/knowledge-standards/04-testing-standards.md +175 -0
  98. package/matrix-skills/_index.yaml +1 -1
  99. package/package.json +1 -1
  100. package/rules/AGENTS.md +1 -1
  101. package/rules/REFERENCE.md +18 -14
  102. package/rules/SKILLS.md +1 -1
  103. package/rules/TEAMS.md +1 -2
  104. package/skills/docs-audit/README.md +10 -8
  105. package/skills/docs-audit/SKILL.md +45 -41
  106. package/skills/docs-audit/references/scoring-framework.md +5 -5
  107. package/skills/docs-core/README.md +19 -14
  108. package/skills/docs-core/SKILL.md +189 -117
  109. package/skills/planning/references/codebase-understanding.md +5 -5
  110. package/code-assistants/codex-assistant/skills/agent-assistant-code-focus/SKILL.md +0 -18
  111. package/code-assistants/codex-assistant/skills/agent-assistant-code-focus/agents/openai.yaml +0 -4
  112. package/code-assistants/codex-assistant/skills/agent-assistant-cook-focus/SKILL.md +0 -18
  113. package/code-assistants/codex-assistant/skills/agent-assistant-cook-focus/agents/openai.yaml +0 -4
  114. package/code-assistants/codex-assistant/skills/agent-assistant-debug-focus/SKILL.md +0 -18
  115. package/code-assistants/codex-assistant/skills/agent-assistant-debug-focus/agents/openai.yaml +0 -4
  116. package/code-assistants/codex-assistant/skills/agent-assistant-design-focus/SKILL.md +0 -18
  117. package/code-assistants/codex-assistant/skills/agent-assistant-design-focus/agents/openai.yaml +0 -4
  118. package/code-assistants/codex-assistant/skills/agent-assistant-fix-focus/SKILL.md +0 -18
  119. package/code-assistants/codex-assistant/skills/agent-assistant-fix-focus/agents/openai.yaml +0 -4
  120. package/code-assistants/codex-assistant/skills/agent-assistant-plan-focus/SKILL.md +0 -18
  121. package/code-assistants/codex-assistant/skills/agent-assistant-plan-focus/agents/openai.yaml +0 -4
  122. package/code-assistants/codex-assistant/skills/agent-assistant-report-focus/SKILL.md +0 -18
  123. package/code-assistants/codex-assistant/skills/agent-assistant-report-focus/agents/openai.yaml +0 -4
  124. package/code-assistants/codex-assistant/skills/agent-assistant-test-focus/SKILL.md +0 -18
  125. package/code-assistants/codex-assistant/skills/agent-assistant-test-focus/agents/openai.yaml +0 -4
  126. package/commands/code/focus.md +0 -297
  127. package/commands/cook/focus.md +0 -209
  128. package/commands/debug/focus.md +0 -103
  129. package/commands/design/focus.md +0 -229
  130. package/commands/fix/focus.md +0 -145
  131. package/commands/plan/focus.md +0 -140
  132. package/commands/report/focus.md +0 -107
  133. package/commands/test/focus.md +0 -123
  134. package/documents/business/business-features.md +0 -894
  135. package/documents/business/business-glossary.md +0 -554
  136. package/documents/business/business-prd.md +0 -400
  137. package/documents/business/business-workflows.md +0 -713
  138. package/documents/knowledge-architecture.md +0 -621
  139. package/documents/knowledge-domain.md +0 -602
  140. package/documents/knowledge-overview.md +0 -316
  141. package/documents/knowledge-source-base.md +0 -581
  142. package/documents/knowledge-standards.md +0 -632
@@ -1,167 +1,643 @@
1
1
  ---
2
- description: 🔒 Audit Docs Generate 4 security and compliance documentation files
3
- version: "1.0"
2
+ description: "Audit Docs - Generate 4 audit folders with structured sub-files"
3
+ version: "2.0"
4
4
  category: documentation
5
5
  execution-mode: execute
6
6
  ---
7
7
 
8
- # /docs:audit Security & Compliance Documentation
8
+ # /docs:audit - Security & Compliance Audit Documentation (Folder-Based)
9
9
 
10
- > **MISSION**: Generate **ALL 4** audit documentation files.
10
+ > **MISSION**: Generate or update **ALL 4 audit folders**, each with `00-index.md` + numbered sub-files. Output must be evidence-backed, traceable, scored, and actionable for security, compliance, and engineering teams.
11
11
 
12
12
  <scope>$ARGUMENTS</scope>
13
13
 
14
14
  ---
15
15
 
16
- ## 🛑 PRE-FLIGHT (DO FIRST BLOCKS PHASE 1)
16
+ ## PRE-FLIGHT (DO FIRST - BLOCKS PHASE 1)
17
17
 
18
18
  **LOAD now** (in order; path `./rules/` or `~/.{TOOL}/skills/agent-assistant/rules/`):
19
19
 
20
- 1. CORE.md Identity, Laws, Routing
21
- 2. PHASES.md Phase Execution
22
- 3. AGENTS.md Tiered Execution
20
+ 1. CORE.md - Identity, Laws, Routing
21
+ 2. PHASES.md - Phase Execution
22
+ 3. AGENTS.md - Tiered Execution
23
23
 
24
- **⛔ Do not run Phase 1 until all are loaded.** Follow **all** rules in those files; they override any conflicting instructions in this file.
24
+ **Do not run Phase 1 until all are loaded.** Follow all rules in those files; they override any conflicting instructions in this file.
25
25
 
26
26
  ---
27
27
 
28
- ## 🔀 TIERED EXECUTION PROTOCOL (MANDATORY)
28
+ ## TIERED EXECUTION PROTOCOL (MANDATORY)
29
29
 
30
- > **Reference: AGENTS.md (Tiered Execution)`
30
+ > **Reference: AGENTS.md (Tiered Execution)**
31
31
 
32
32
  ```yaml
33
33
  tiered_execution:
34
34
  principle: "Sub-agent FIRST (Tier 1). EMBODY ONLY on system failure (Tier 2)."
35
35
  for_each_phase:
36
- TIER_1_MANDATORY: "IF tool exists MUST use SUB_AGENT_DELEGATION"
37
- TIER_2_FALLBACK: "ONLY on system errorNOT complexity/preference/speed"
36
+ TIER_1_MANDATORY: "IF tool exists -> MUST use SUB_AGENT_DELEGATION"
37
+ TIER_2_FALLBACK: "ONLY on system error - NOT complexity/preference/speed"
38
38
  anti_lazy_fallback:
39
- - NEVER use Tier 2 when Tier 1 tool is available
40
- - ALWAYS attempt Tier 1 first when tool exists
39
+ - NEVER use Tier 2 when Tier 1 tool is available
40
+ - ALWAYS attempt Tier 1 first when tool exists
41
41
  ```
42
42
 
43
43
  ---
44
44
 
45
- ## 📦 DELIVERABLES (REQUIRED ALL 4 FILES)
45
+ ## DELIVERABLES - FOLDER-BASED AUDIT SYSTEM
46
46
 
47
47
  > [!CAUTION]
48
- > **MUST CREATE ALL 4 FILES**. Incomplete = FAILED execution.
48
+ > **MUST CREATE OR UPDATE ALL 4 FOLDERS** with `00-index.md` and sub-files. Incomplete = FAILED execution.
49
49
 
50
- > **⛔ DOCUMENT LANGUAGE NON-NEGOTIABLE**
51
- > Every file under `./documents/` must be written in **English only**. Do not use the user's language (e.g. Vietnamese) for file content. (CORE § LAW 6.)
50
+ > **DOCUMENT LANGUAGE - NON-NEGOTIABLE**
51
+ > Every file under `./documents/` must be written in **English only**. Do not use the user's language for file content. (CORE LAW 6.)
52
52
 
53
- | File | Purpose |
54
- | -------------------------------------------- | -------------------------------- |
55
- | `./documents/audit/audit-security.md` | Security assessment and findings |
56
- | `./documents/audit/audit-compliance.md` | Compliance status and gaps |
57
- | `./documents/audit/audit-dataflow.md` | Data flow and privacy analysis |
58
- | `./documents/audit/audit-recommendations.md` | Remediation recommendations |
53
+ ### Folder Structure
54
+
55
+ ```
56
+ ./documents/audit/
57
+ audit-security/
58
+ 00-index.md
59
+ 01-attack-surface.md
60
+ 02-vulnerability-findings.md
61
+ 03-owasp-assessment.md
62
+ 04-risk-summary.md
63
+
64
+ audit-compliance/
65
+ 00-index.md
66
+ 01-control-inventory.md
67
+ 02-framework-mapping.md
68
+ 03-gap-register.md
69
+ 04-evidence-state.md
70
+
71
+ audit-dataflow/
72
+ 00-index.md
73
+ 01-trust-boundaries.md
74
+ 02-data-flow-map.md
75
+ 03-sensitive-data-inventory.md
76
+ 04-privacy-posture.md
77
+
78
+ audit-recommendations/
79
+ 00-index.md
80
+ 01-critical-remediations.md
81
+ 02-high-priority-improvements.md
82
+ 03-medium-low-enhancements.md
83
+ 04-score-uplift-plan.md
84
+ ```
85
+
86
+ **Minimum total**: 4 folders x (1 index + 4 sub-files) = **20 files minimum**.
87
+
88
+ ### `00-index.md` Pattern (MANDATORY)
89
+
90
+ Every audit folder `00-index.md` MUST include:
91
+
92
+ 1. Quick summary (2-3 paragraphs)
93
+ 2. Strict score section (numeric score, grade band, confidence, blockers)
94
+ 3. Sub-files table with descriptions
95
+ 4. Key findings for that area
96
+ 5. Cross-references to related audit/core folders
97
+ 6. Known Gaps and Open Questions
98
+
99
+ ```markdown
100
+ # {Audit Area}
101
+
102
+ > **Purpose**: {one-line purpose}
103
+ > **Sub-files**: {count}
104
+ > **Last Updated**: {YYYY-MM-DD}
105
+ > **Score**: {numeric}/100 | **Grade**: {A-F} | **Confidence**: {High/Medium/Low}
106
+
107
+ ## Quick Summary
108
+ {2-3 paragraphs}
109
+
110
+ ## Strict Score
111
+ | Dimension | Score | Weight | Weighted |
112
+ |-----------|-------|--------|----------|
113
+ | ... | .../100 | ...% | ... |
114
+
115
+ **Grade Band**: {grade} | **Confidence**: {level}
116
+ **Score Caps Applied**: {Yes/No + reason}
117
+ **What Would Raise the Score**: {concrete actions}
118
+
119
+ ## Sub-Files
120
+ | File | Description |
121
+ |------|-------------|
122
+ | [01-...](./01-...md) | ... |
123
+
124
+ ## Key Findings
125
+ | Finding ID | Severity | Summary | Status |
126
+ |------------|----------|---------|--------|
127
+ | SEC-001 | Critical/High/Medium/Low | ... | Verified/Partial/Unknown |
128
+
129
+ ## Cross-References
130
+ - [audit-compliance](../audit-compliance/00-index.md)
131
+ - [knowledge-architecture](../knowledge-architecture/00-index.md)
132
+
133
+ ## Known Gaps and Open Questions
134
+ - ...
135
+ ```
136
+
137
+ ### Finding ID System (MANDATORY)
138
+
139
+ All findings across folders MUST use a consistent ID scheme:
140
+
141
+ | Prefix | Area | Example |
142
+ |--------|------|---------|
143
+ | `SEC-` | Security findings | SEC-001, SEC-002 |
144
+ | `CMP-` | Compliance gaps | CMP-001, CMP-002 |
145
+ | `DFL-` | Data flow issues | DFL-001, DFL-002 |
146
+ | `REM-` | Remediation items | REM-001, REM-002 |
147
+
148
+ Cross-folder rules:
149
+ - Same finding referenced in multiple folders MUST use the same ID
150
+ - Same severity MUST be assigned to the same finding across folders
151
+ - `audit-recommendations/` MUST reference finding IDs from the other 3 folders
152
+
153
+ ### Evidence Discipline (MANDATORY)
154
+
155
+ Every major claim in every sub-file MUST be backed by evidence:
156
+ - Tag claims as: `Verified` (direct evidence), `Partial` (incomplete evidence), `Unknown` (no evidence)
157
+ - Include file paths with line anchors where feasible: `path/to/file.ts#L42`
158
+ - If confidence is low, state it explicitly
159
+ - Never infer a control as Verified without direct repository evidence
160
+ - Never leave unresolved placeholders (`{...}`, `TODO`, `TBD`) in final documents
59
161
 
60
162
  ---
61
163
 
62
- ## INCREMENTAL EXECUTION (MANDATORY)
164
+ ## INCREMENTAL EXECUTION (MANDATORY)
63
165
 
64
- One phase at a time, each phase independent: Phase 1 then Phase 2 in one reply. No batching (load only what each phase needs). **Within each phase:** when doing a part, output it in format so user sees what’s happening (announce before doing).
166
+ One phase at a time, each phase independent: Phase 1 -> Phase 2 -> Phase 3 -> Phase 4 -> Phase 5.
65
167
 
66
168
  ---
67
169
 
68
- ## 🎭 Phase 1: SECURITY ANALYSIS
170
+ ## Phase 1: AUDIT RECONNAISSANCE
69
171
 
70
- | Attribute | Value |
71
- | --------- | ---------------------------- |
72
- | **Agent** | `security-engineer` |
73
- | **Goal** | Complete security assessment |
172
+ | Attribute | Value |
173
+ |-----------|-------|
174
+ | **Agent** | `scouter` |
175
+ | **Goal** | Map attack surface, data flows, security-sensitive areas, and existing audit state |
74
176
 
75
- ### TIERED EXECUTION
177
+ ### TIERED EXECUTION
76
178
 
77
179
  **TIER 1 (MANDATORY when tool exists):**
180
+ > Invoke runSubagent for `scouter`. Context: ISOLATED.
181
+
182
+ **TIER 2 (FALLBACK on system error only):**
183
+ > Load `{AGENTS_PATH}/scouter.md`
184
+ > EMBODY [scouter] - Requires logged system error justification.
185
+
186
+ ### Required Work
187
+
188
+ 1. Detect current audit docs state (folder-level mode per area):
189
+ - `./documents/audit/audit-security/`
190
+ - `./documents/audit/audit-compliance/`
191
+ - `./documents/audit/audit-dataflow/`
192
+ - `./documents/audit/audit-recommendations/`
193
+
194
+ Mode rules:
195
+ - Folder exists with sub-files -> UPDATE
196
+ - Flat file exists (legacy `audit-*.md`) -> MIGRATE
197
+ - Neither exists -> CREATE
198
+
199
+ 2. Run hybrid reconnaissance across security surfaces:
200
+ - Bootstrap scan using `skills/docs-audit/scripts/scan-audit-surface.sh` (if available)
201
+ - Targeted search for auth, session, crypto, validation, config, dependency, CI/CD surfaces
202
+ - Direct reads of high-value files (manifests, lockfiles, middleware, routes, auth, config)
203
+ - Evidence cross-check against existing audit docs if present
204
+
205
+ 3. Signal precision rules:
206
+ - Exclude vendor/generated noise: `node_modules`, `dist`, `build`, `coverage`, `.next`, `.turbo`
207
+ - Do not treat marketing/UI keyword matches as controls without code-path evidence
208
+ - Classify test/demo/sample hits as `Contextual` - do not score as production risk
209
+ - For polyglot repos, produce language-aware evidence slices
210
+
211
+ 4. Catalog findings:
212
+ - Authentication and authorization surfaces
213
+ - Input validation and sanitization points
214
+ - Cryptographic usage and key management
215
+ - Data flow paths and trust boundaries
216
+ - Sensitive data handling (PII, secrets, tokens)
217
+ - Dependency risk posture
218
+ - CI/CD and deployment security
219
+ - Logging, monitoring, and audit trail coverage
220
+
221
+ 5. Build Audit Evidence Ledger with file-level references.
222
+
223
+ ### Mandatory Output
224
+
225
+ ```markdown
226
+ ## Audit Reconnaissance Report
227
+
228
+ ### Execution Plan
229
+ | Audit Area | Mode | Notes |
230
+ |------------|------|-------|
231
+ | audit-security/ | CREATE/UPDATE/MIGRATE | {note} |
232
+ | audit-compliance/ | CREATE/UPDATE/MIGRATE | {note} |
233
+ | audit-dataflow/ | CREATE/UPDATE/MIGRATE | {note} |
234
+ | audit-recommendations/ | CREATE/UPDATE/MIGRATE | {note} |
235
+
236
+ ### Attack Surface Map
237
+ | Surface | Entry Points | Risk Level | Evidence |
238
+ |---------|-------------|------------|----------|
239
+ | {surface} | {endpoints/files} | Critical/High/Medium/Low | {path} |
240
+
241
+ ### Security Controls Detected
242
+ | Control | Type | Coverage | Evidence |
243
+ |---------|------|----------|----------|
244
+ | {control} | Auth/Validation/Crypto/... | Full/Partial/None | {path} |
245
+
246
+ ### Data Flow Candidates
247
+ | Flow | Source | Destination | Sensitive Data | Evidence |
248
+ |------|--------|-------------|----------------|----------|
249
+ | {flow} | {source} | {dest} | Yes/No | {path} |
250
+
251
+ ### Dependency Risk Posture
252
+ | Package Manager | Total Deps | Known Vulns | Lock File | Evidence |
253
+ |----------------|------------|-------------|-----------|----------|
254
+ | {manager} | {count} | {count} | Yes/No | {path} |
255
+
256
+ ### Audit Evidence Ledger
257
+ | Claim Area | Evidence Files | Confidence |
258
+ |------------|----------------|------------|
259
+ | Security Controls | {paths} | High/Medium/Low |
260
+ | Compliance Signals | {paths} | High/Medium/Low |
261
+ | Data Flow | {paths} | High/Medium/Low |
262
+ | Privacy Posture | {paths} | High/Medium/Low |
263
+ | Remediation Basis | {paths} | High/Medium/Low |
264
+ ```
265
+
266
+ ### Exit Criteria
267
+
268
+ - [ ] CREATE/UPDATE/MIGRATE mode detected per audit area
269
+ - [ ] Attack surface mapped with evidence
270
+ - [ ] Security controls cataloged
271
+ - [ ] Data flow candidates identified
272
+ - [ ] Dependency risk posture assessed
273
+ - [ ] Audit Evidence Ledger complete
274
+
275
+ ---
78
276
 
277
+ ## Phase 2: DEEP SECURITY ANALYSIS
278
+
279
+ | Attribute | Value |
280
+ |-----------|-------|
281
+ | **Agent** | `security-engineer` |
282
+ | **Goal** | Deep vulnerability analysis, OWASP assessment, risk scoring, compliance mapping |
283
+ | **Skill** | Load `skills/docs-audit/SKILL.md` |
284
+
285
+ ### TIERED EXECUTION
286
+
287
+ **TIER 1 (MANDATORY when tool exists):**
79
288
  > Invoke runSubagent for `security-engineer`. Context: ISOLATED.
80
289
 
81
290
  **TIER 2 (FALLBACK on system error only):**
82
-
83
291
  > Load `{AGENTS_PATH}/security-engineer.md`
84
- > EMBODY [security-engineer] Requires logged system error justification.
292
+ > EMBODY [security-engineer] - Requires logged system error justification.
293
+
294
+ ### Required Work
295
+
296
+ 1. Deep vulnerability analysis:
297
+ - Assign finding IDs (SEC-xxx) to each vulnerability
298
+ - Classify severity: Critical / High / Medium / Low / Informational
299
+ - Determine blast radius and exploitability
300
+ - Map to OWASP Top 10 and CWE Top 25
301
+
302
+ 2. OWASP assessment:
303
+ - Systematic check against OWASP Top 10 categories
304
+ - OWASP ASVS verification levels where applicable
305
+ - Evidence-backed status per category: Verified / Partial / Gap / Unknown
306
+
307
+ 3. Compliance mapping:
308
+ - Map controls to NIST CSF, CIS, ISO 27001 themes
309
+ - Identify GDPR/privacy obligations where relevant
310
+ - Build control coverage matrix with evidence state
311
+
312
+ 4. Risk scoring per finding:
313
+ - Likelihood x Impact matrix
314
+ - Business context consideration
315
+ - Score caps for blocking issues
316
+
317
+ 5. Audit Thinking Protocol (per finding):
318
+ - What evidence supports this claim?
319
+ - Is this verified, probable, or unknown?
320
+ - What is the blast radius?
321
+ - Which framework reference is relevant?
322
+ - What would a skeptical reviewer challenge?
323
+
324
+ ### Mandatory Output
325
+
326
+ ```markdown
327
+ ## Deep Security Analysis
328
+
329
+ ### Findings Register
330
+ | ID | Title | Severity | OWASP | CWE | Status | Evidence |
331
+ |----|-------|----------|-------|-----|--------|----------|
332
+ | SEC-001 | {title} | Critical | A01 | CWE-xxx | Verified | {path} |
333
+
334
+ ### OWASP Top 10 Assessment
335
+ | Category | Status | Findings | Evidence |
336
+ |----------|--------|----------|----------|
337
+ | A01: Broken Access Control | Verified/Partial/Gap/Unknown | SEC-xxx | {paths} |
338
+
339
+ ### Compliance Control Matrix
340
+ | Control Theme | NIST CSF | CIS | ISO 27001 | Status | Evidence |
341
+ |---------------|----------|-----|-----------|--------|----------|
342
+ | {theme} | {function} | {control} | {annex} | Verified/Partial/Gap | {path} |
343
+
344
+ ### Risk Matrix
345
+ | Finding | Likelihood | Impact | Risk Level | Blast Radius |
346
+ |---------|-----------|--------|------------|--------------|
347
+ | SEC-001 | High/Med/Low | High/Med/Low | Critical/High/Med/Low | {scope} |
348
+
349
+ ### Privacy and Data Protection
350
+ | Obligation | Applicability | Status | Evidence | Gap |
351
+ |------------|--------------|--------|----------|-----|
352
+ | {GDPR article / privacy principle} | Yes/No/Possible | Met/Partial/Unmet | {path} | {gap} |
353
+ ```
85
354
 
86
- **Exit Criteria:**
355
+ ### Exit Criteria
87
356
 
88
- - [ ] Vulnerabilities identified
89
- - [ ] OWASP checklist complete
90
- - [ ] Risk assessment done
357
+ - [ ] All findings assigned IDs and severity
358
+ - [ ] OWASP Top 10 assessment complete
359
+ - [ ] Compliance control matrix built
360
+ - [ ] Risk matrix with likelihood x impact
361
+ - [ ] Privacy obligations assessed
362
+ - [ ] Evidence backs every claim
91
363
 
92
364
  ---
93
365
 
94
- ## 🎭 Phase 2: CODEBASE SCAN
366
+ ## Phase 3: GENERATE AUDIT FOLDERS
95
367
 
96
- | Attribute | Value |
97
- | --------- | ---------------------------------- |
98
- | **Agent** | `scouter` |
99
- | **Goal** | Map data flows and sensitive areas |
368
+ | Attribute | Value |
369
+ |-----------|-------|
370
+ | **Agent** | `docs-manager` |
371
+ | **Goal** | Generate or update all 4 audit folders in English only |
100
372
 
101
- ### TIERED EXECUTION
373
+ ### TIERED EXECUTION
102
374
 
103
375
  **TIER 1 (MANDATORY when tool exists):**
104
-
105
- > Invoke runSubagent for `scouter`. Context: ISOLATED.
376
+ > Invoke runSubagent for `docs-manager`. Context: ISOLATED.
106
377
 
107
378
  **TIER 2 (FALLBACK on system error only):**
379
+ > Load `{AGENTS_PATH}/docs-manager.md`
380
+ > EMBODY [docs-manager] - Requires logged system error justification.
381
+
382
+ ### Thinking Protocol (MANDATORY - Run BEFORE Writing Each Sub-File)
383
+
384
+ For each sub-file, THINK before writing:
385
+
386
+ 1. What evidence from Phase 1/2 supports this file's content?
387
+ 2. Is every finding backed by the Audit Evidence Ledger?
388
+ 3. Are finding IDs consistent with Phase 2's Findings Register?
389
+ 4. Am I writing verified facts or speculation? Tag uncertainty explicitly.
390
+ 5. Would a security reviewer accept this as rigorous evidence?
391
+
392
+ ### Writing Protocol (MANDATORY)
393
+
394
+ For each audit folder:
395
+
396
+ 1. If UPDATE mode:
397
+ - Read all existing sub-files fully
398
+ - Preserve accurate sections
399
+ - Append missing and revise stale sections
400
+ - Add update footer: `> Last updated: {date} - {summary}` to touched files
401
+ 2. If MIGRATE mode (legacy flat file exists):
402
+ - Read existing flat file fully - preserve all valid content
403
+ - Create folder with `00-index.md` + sub-files
404
+ - Distribute content into appropriate sub-files
405
+ - Add migration note: `> Migrated from flat file: {date}`
406
+ - Delete or archive legacy flat file after migration
407
+ 3. If CREATE mode:
408
+ - Create folder
409
+ - Write `00-index.md` first (with score section)
410
+ - Write `01-...`, `02-...` sub-files sequentially
411
+ 4. Include `## Evidence Sources` in every sub-file
412
+ 5. Include `## Known Gaps and Open Questions` in every `00-index.md`
413
+ 6. Include strict score section in every `00-index.md`
414
+ 7. No placeholders: `TODO`, `TBD`, `{placeholder}`, `fill in later`
415
+
416
+ ### Per-Folder Content Requirements
417
+
418
+ #### `audit-security/`
419
+ - `00-index.md`: summary, strict score, TOC, key findings, cross-refs, gaps
420
+ - `01-attack-surface.md`: entry points, exposed interfaces, external dependencies, trust boundaries at ingress
421
+ - `02-vulnerability-findings.md`: findings register with IDs (SEC-xxx), severity, evidence, blast radius, exploitability
422
+ - `03-owasp-assessment.md`: systematic OWASP Top 10 check, ASVS mapping, per-category status with evidence
423
+ - `04-risk-summary.md`: risk matrix (likelihood x impact), aggregate risk posture, business context, risk acceptance criteria
424
+
425
+ #### `audit-compliance/`
426
+ - `00-index.md`: summary, strict score, TOC, key findings, cross-refs, gaps
427
+ - `01-control-inventory.md`: all detected controls with type, owner, evidence, and coverage status
428
+ - `02-framework-mapping.md`: mapping to OWASP, NIST CSF, CIS, ISO 27001, GDPR with evidence state per control
429
+ - `03-gap-register.md`: compliance gaps with IDs (CMP-xxx), severity, affected frameworks, remediation pointers
430
+ - `04-evidence-state.md`: evidence completeness per control area, confidence levels, verification methodology
431
+
432
+ #### `audit-dataflow/`
433
+ - `00-index.md`: summary, strict score, TOC, key findings, cross-refs, gaps
434
+ - `01-trust-boundaries.md`: trust boundary definitions, boundary crossings, authentication at boundaries
435
+ - `02-data-flow-map.md`: data flow diagrams (Mermaid), system-to-system flows, API communication paths
436
+ - `03-sensitive-data-inventory.md`: PII/secrets/tokens inventory, storage locations, encryption state, retention posture
437
+ - `04-privacy-posture.md`: GDPR/privacy compliance, consent mechanisms, data subject rights, DPO considerations
438
+
439
+ #### `audit-recommendations/`
440
+ - `00-index.md`: summary, strict score, TOC, key findings, cross-refs, gaps
441
+ - `01-critical-remediations.md`: Critical/High severity fixes with finding IDs, implementation steps, effort estimates
442
+ - `02-high-priority-improvements.md`: Medium severity improvements, architectural recommendations, dependency updates
443
+ - `03-medium-low-enhancements.md`: Low/Informational items, hardening opportunities, best-practice alignments
444
+ - `04-score-uplift-plan.md`: projected score improvements per action, prioritized by impact-to-effort ratio, timeline
445
+
446
+ ### Scoring Integration (MANDATORY)
447
+
448
+ Use the rubric in `skills/docs-audit/references/scoring-framework.md` for every `00-index.md`:
449
+ - Include numeric score, grade band, confidence, blockers, and rationale
450
+ - Apply score caps when blocking issues exist (any file below 50 caps overall at D)
451
+ - Summarize what would raise the score next
452
+
453
+ ### Exit Criteria
454
+
455
+ - [ ] `audit-security/` complete (`00-index.md` + 4 sub-files)
456
+ - [ ] `audit-compliance/` complete (`00-index.md` + 4 sub-files)
457
+ - [ ] `audit-dataflow/` complete (`00-index.md` + 4 sub-files)
458
+ - [ ] `audit-recommendations/` complete (`00-index.md` + 4 sub-files)
459
+ - [ ] Each sub-file includes Evidence Sources
460
+ - [ ] Each `00-index.md` includes strict score section
461
+ - [ ] Finding IDs consistent across folders
462
+ - [ ] No placeholders remain
108
463
 
109
- > Load `{AGENTS_PATH}/scouter.md`
110
- > EMBODY [scouter] — Requires logged system error justification.
464
+ ---
465
+
466
+ ## Phase 4: FRAMEWORK MAPPING AND SCORING
111
467
 
112
- **Exit Criteria:**
468
+ | Attribute | Value |
469
+ |-----------|-------|
470
+ | **Agent** | `security-engineer` |
471
+ | **Goal** | Validate framework mappings, finalize scoring, ensure cross-folder consistency |
472
+ | **Skill** | Load `skills/docs-audit/references/framework-mapping.md` and `skills/docs-audit/references/scoring-framework.md` |
113
473
 
114
- - [ ] Data flows mapped
115
- - [ ] Sensitive data identified
116
- - [ ] Integration points cataloged
474
+ ### TIERED EXECUTION
475
+
476
+ **TIER 1 (MANDATORY when tool exists):**
477
+ > Invoke runSubagent for `security-engineer`. Context: ISOLATED.
478
+
479
+ **TIER 2 (FALLBACK on system error only):**
480
+ > Load `{AGENTS_PATH}/security-engineer.md`
481
+ > EMBODY [security-engineer] - Requires logged system error justification.
482
+
483
+ ### Required Work
484
+
485
+ 1. Validate framework mappings in `audit-compliance/02-framework-mapping.md`:
486
+ - OWASP Top 10 and ASVS
487
+ - CWE Top 25
488
+ - NIST CSF functions
489
+ - CIS Secure Software practices
490
+ - ISO 27001 Annex A themes
491
+ - GDPR/privacy principles where relevant
492
+
493
+ 2. Finalize scoring across all 4 folders:
494
+ - Verify score dimensions and weights per folder
495
+ - Apply weighted roll-up for overall audit maturity
496
+ - Apply score caps (blocking issues, low confidence)
497
+ - Document what would raise each score
498
+
499
+ 3. Cross-folder finding consistency:
500
+ - Same finding ID = same severity everywhere
501
+ - Recommendations reference correct finding IDs
502
+ - No orphaned IDs (every finding in security/compliance/dataflow has a recommendation)
503
+
504
+ 4. Mapping rules:
505
+ - Distinguish Verified evidence, Partial coverage, Unknown areas, Non-applicable controls
506
+ - Do not claim certification or formal compliance
507
+ - Do not convert coding signals into legal conclusions
508
+ - If mapping is uncertain, mark Unknown and list the evidence gap
509
+
510
+ ### Exit Criteria
511
+
512
+ - [ ] Framework mappings validated
513
+ - [ ] Scoring finalized with weighted roll-up
514
+ - [ ] Score caps applied where needed
515
+ - [ ] Cross-folder finding IDs consistent
516
+ - [ ] No orphaned finding IDs
117
517
 
118
518
  ---
119
519
 
120
- ## 🎭 Phase 3: GENERATE ALL 4 DOCUMENTS
520
+ ## Phase 5: CONSISTENCY AND QUALITY REVIEW
121
521
 
122
- | Attribute | Value |
123
- | --------- | ---------------------------------------------------------------------------------------------- |
124
- | **Agent** | `docs-manager` |
125
- | **Goal** | Create all 4 audit documentation files in **English only** (no user-language content in files) |
522
+ | Attribute | Value |
523
+ |-----------|-------|
524
+ | **Agent** | `reviewer` |
525
+ | **Goal** | Validate cross-folder consistency, evidence integrity, and production readiness |
126
526
 
127
- ### TIERED EXECUTION
527
+ ### TIERED EXECUTION
128
528
 
129
529
  **TIER 1 (MANDATORY when tool exists):**
130
-
131
- > Invoke runSubagent for `docs-manager`. Context: ISOLATED.
530
+ > Invoke runSubagent for `reviewer`. Context: ISOLATED.
132
531
 
133
532
  **TIER 2 (FALLBACK on system error only):**
533
+ > Load `{AGENTS_PATH}/reviewer.md`
534
+ > EMBODY [reviewer] - Requires logged system error justification.
535
+
536
+ ### Consistency Matrix (MANDATORY)
537
+
538
+ ```markdown
539
+ ## Audit Docs Consistency Matrix
540
+ | Check | Security | Compliance | Dataflow | Recommendations | Status |
541
+ |-------|----------|------------|----------|-----------------|--------|
542
+ | Finding IDs consistent | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
543
+ | Severity alignment | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
544
+ | Evidence sources present | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
545
+ | Score section present | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
546
+ | No placeholders | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
547
+ | Framework refs consistent | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
548
+ | Cross-refs valid | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
549
+ | No contradictions | Yes/No | Yes/No | Yes/No | Yes/No | Pass/Fail |
550
+ ```
134
551
 
135
- > Load `{AGENTS_PATH}/docs-manager.md`
136
- > EMBODY [docs-manager] — Requires logged system error justification.
137
-
138
- **Exit Criteria:**
552
+ ### Exit Criteria
139
553
 
140
- - [ ] `audit-security.md` created
141
- - [ ] `audit-compliance.md` created
142
- - [ ] `audit-dataflow.md` created
143
- - [ ] `audit-recommendations.md` created
554
+ - [ ] Cross-folder consistency verified
555
+ - [ ] Contradictions resolved
556
+ - [ ] Finding ID traceability intact
557
+ - [ ] Evidence integrity confirmed
558
+ - [ ] Production readiness confirmed
144
559
 
145
560
  ---
146
561
 
147
- ## VERIFICATION
562
+ ## VERIFICATION
563
+
564
+ Before completion, verify folder existence and quality:
148
565
 
149
- Before completion, verify ALL 4 files exist:
566
+ ### Folder Existence
150
567
 
151
568
  ```
152
569
  ./documents/audit/
153
- ├── audit-security.md
154
- ├── audit-compliance.md
155
- ├── audit-dataflow.md
156
- └── audit-recommendations.md
570
+ [ ] audit-security/ (00-index.md + 01~04)
571
+ [ ] audit-compliance/ (00-index.md + 01~04)
572
+ [ ] audit-dataflow/ (00-index.md + 01~04)
573
+ [ ] audit-recommendations/ (00-index.md + 01~04)
157
574
  ```
158
575
 
576
+ ### Quality Gates
577
+
578
+ For every audit folder and sub-file:
579
+
580
+ - [ ] English only
581
+ - [ ] Required sections present
582
+ - [ ] Evidence Sources section present with actual file paths
583
+ - [ ] `00-index.md` contains strict score section
584
+ - [ ] `00-index.md` contains Known Gaps and Open Questions
585
+ - [ ] No placeholder text
586
+ - [ ] Finding IDs present and correctly formatted
587
+ - [ ] Claims tagged as Verified/Partial/Unknown
588
+ - [ ] TOC links in every `00-index.md` match actual sub-files
589
+
590
+ ### Cross-Folder Gates
591
+
592
+ - [ ] Finding IDs consistent across all 4 folders (SEC-xxx, CMP-xxx, DFL-xxx, REM-xxx)
593
+ - [ ] Same finding has same severity everywhere
594
+ - [ ] Every finding has a corresponding recommendation
595
+ - [ ] Framework mappings reference correct finding IDs
596
+ - [ ] Scoring weights match `skills/docs-audit/references/scoring-framework.md`
597
+ - [ ] Overall weighted roll-up calculated correctly
598
+
599
+ ### Per-Folder Quality Gates
600
+
601
+ - [ ] `audit-security/` contains attack-surface view and findings register
602
+ - [ ] `audit-compliance/` contains control-mapping table and gap register
603
+ - [ ] `audit-dataflow/` contains data-flow diagram (Mermaid) and trust-boundary definitions
604
+ - [ ] `audit-recommendations/` contains prioritized remediation matrix and score uplift plan
605
+
159
606
  ---
160
607
 
161
608
  ## COMPLETION
162
609
 
163
610
  Report status:
164
611
 
165
- 1. **Complete** All 4 audit docs created
166
- 2. **Incomplete** List missing files
167
- 3. 🔒 **Follow-up** Address critical findings
612
+ 1. **Complete** - All 4 audit folders created/updated, scored, and consistency-validated
613
+ 2. **Incomplete** - List missing folders/sub-files, failed quality gates, and blockers
614
+ 3. **Continue** - Address critical findings from audit results
615
+
616
+ ```markdown
617
+ ## Audit Documentation Complete
618
+
619
+ | Folder | Files | Score | Grade | Status |
620
+ |--------|-------|-------|-------|--------|
621
+ | audit-security/ | 00-index + 01~04 | {score}/100 | {grade} | Created/Updated |
622
+ | audit-compliance/ | 00-index + 01~04 | {score}/100 | {grade} | Created/Updated |
623
+ | audit-dataflow/ | 00-index + 01~04 | {score}/100 | {grade} | Created/Updated |
624
+ | audit-recommendations/ | 00-index + 01~04 | {score}/100 | {grade} | Created/Updated |
625
+
626
+ ### Overall Audit Maturity
627
+ - **Weighted Score**: {score}/100
628
+ - **Grade**: {grade}
629
+ - **Confidence**: {High/Medium/Low}
630
+ - **Score Caps Applied**: {Yes/No + reasons}
631
+
632
+ ### Integrity Notes
633
+ - Lowest-confidence area: {area + why}
634
+ - Cross-file consistency: {Pass/Fail}
635
+ - Orphaned finding IDs: {count}
636
+
637
+ ### Highest-Priority Follow-Up
638
+ 1. {action with finding ID}
639
+ 2. {action with finding ID}
640
+ 3. {action with finding ID}
641
+
642
+ **Total: 4 folders (20+ files) in `./documents/audit/`**
643
+ ```