@namch/agent-assistant 1.3.0 → 1.3.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 +11 -1
- package/agents/backend-engineer.md +3 -3
- package/agents/brainstormer.md +3 -3
- package/agents/business-analyst.md +3 -3
- package/agents/database-architect.md +3 -3
- package/agents/debugger.md +2 -2
- package/agents/designer.md +2 -2
- package/agents/devops-engineer.md +2 -2
- package/agents/docs-manager.md +23 -15
- package/agents/frontend-engineer.md +3 -3
- package/agents/game-engineer.md +3 -3
- package/agents/mobile-engineer.md +4 -4
- package/agents/performance-engineer.md +3 -3
- package/agents/planner.md +4 -4
- package/agents/project-manager.md +3 -3
- package/agents/researcher.md +3 -3
- package/agents/reviewer.md +3 -3
- package/agents/scouter.md +3 -3
- package/agents/security-engineer.md +3 -3
- package/agents/tech-lead.md +3 -3
- package/agents/tester.md +2 -2
- package/commands/docs/audit.md +554 -78
- package/commands/docs/business.md +392 -76
- package/commands/docs/core.md +573 -74
- package/commands/docs.md +62 -61
- package/documents/business/business-features/00-index.md +101 -0
- package/documents/business/business-features/01-feature-inventory.md +341 -0
- package/documents/business/business-features/02-prioritization-moscow.md +148 -0
- package/documents/business/business-features/03-feature-specifications.md +512 -0
- package/documents/business/business-features/04-dependencies-and-release-sequencing.md +313 -0
- package/documents/business/business-features/05-success-metrics.md +290 -0
- package/documents/business/business-glossary/00-index.md +89 -0
- package/documents/business/business-glossary/01-canonical-terms.md +428 -0
- package/documents/business/business-glossary/02-synonyms-and-deprecated-terms.md +180 -0
- package/documents/business/business-glossary/03-domain-entities-and-events.md +395 -0
- package/documents/business/business-glossary/04-api-term-mapping.md +173 -0
- package/documents/business/business-prd/00-index.md +107 -0
- package/documents/business/business-prd/01-executive-summary.md +131 -0
- package/documents/business/business-prd/02-problem-goals-and-scope.md +204 -0
- package/documents/business/business-prd/03-stakeholders-and-requirements.md +210 -0
- package/documents/business/business-prd/04-acceptance-risks-assumptions.md +246 -0
- package/documents/business/business-workflows/00-index.md +107 -0
- package/documents/business/business-workflows/01-actor-map.md +303 -0
- package/documents/business/business-workflows/02-workflow-catalog.md +252 -0
- package/documents/business/business-workflows/03-detailed-workflows.md +641 -0
- package/documents/business/business-workflows/04-decision-rules-and-exceptions.md +216 -0
- package/documents/business/business-workflows/05-sla-and-handoffs.md +253 -0
- package/documents/knowledge-architecture/00-index.md +159 -0
- package/documents/knowledge-architecture/01-system-overview.md +240 -0
- package/documents/knowledge-architecture/02-components.md +419 -0
- package/documents/knowledge-architecture/03-data-flow.md +369 -0
- package/documents/knowledge-architecture/04-design-patterns.md +498 -0
- package/documents/knowledge-architecture/05-decisions.md +410 -0
- package/documents/knowledge-domain/00-index.md +251 -0
- package/documents/knowledge-domain/01-entities.md +583 -0
- package/documents/knowledge-domain/02-database-schema.md +138 -0
- package/documents/knowledge-domain/03-api-contracts.md +479 -0
- package/documents/knowledge-domain/04-business-rules.md +555 -0
- package/documents/knowledge-overview/00-index.md +107 -0
- package/documents/knowledge-overview/01-project-identity.md +162 -0
- package/documents/knowledge-overview/02-tech-stack.md +119 -0
- package/documents/knowledge-overview/03-features.md +233 -0
- package/documents/knowledge-overview/04-getting-started.md +394 -0
- package/documents/knowledge-source-base/00-index.md +107 -0
- package/documents/knowledge-source-base/01-directory-structure.md +312 -0
- package/documents/knowledge-source-base/02-entry-points.md +346 -0
- package/documents/knowledge-source-base/03-key-modules.md +582 -0
- package/documents/knowledge-source-base/04-configuration.md +467 -0
- package/documents/knowledge-standards/00-index.md +129 -0
- package/documents/knowledge-standards/01-code-style.md +161 -0
- package/documents/knowledge-standards/02-conventions.md +255 -0
- package/documents/knowledge-standards/03-git-workflow.md +228 -0
- package/documents/knowledge-standards/04-testing-standards.md +175 -0
- package/package.json +1 -1
- package/rules/REFERENCE.md +10 -6
- package/skills/docs-audit/README.md +10 -8
- package/skills/docs-audit/SKILL.md +45 -41
- package/skills/docs-audit/references/scoring-framework.md +5 -5
- package/skills/docs-core/README.md +19 -14
- package/skills/docs-core/SKILL.md +189 -117
- package/skills/planning/references/codebase-understanding.md +5 -5
- package/documents/business/business-features.md +0 -894
- package/documents/business/business-glossary.md +0 -554
- package/documents/business/business-prd.md +0 -400
- package/documents/business/business-workflows.md +0 -713
- package/documents/knowledge-architecture.md +0 -621
- package/documents/knowledge-domain.md +0 -602
- package/documents/knowledge-overview.md +0 -316
- package/documents/knowledge-source-base.md +0 -581
- package/documents/knowledge-standards.md +0 -632
package/commands/docs/audit.md
CHANGED
|
@@ -1,167 +1,643 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
3
|
-
version: "
|
|
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
|
|
8
|
+
# /docs:audit - Security & Compliance Audit Documentation (Folder-Based)
|
|
9
9
|
|
|
10
|
-
> **MISSION**: Generate **ALL 4
|
|
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
|
-
##
|
|
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
|
|
21
|
-
2. PHASES.md
|
|
22
|
-
3. AGENTS.md
|
|
20
|
+
1. CORE.md - Identity, Laws, Routing
|
|
21
|
+
2. PHASES.md - Phase Execution
|
|
22
|
+
3. AGENTS.md - Tiered Execution
|
|
23
23
|
|
|
24
|
-
|
|
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
|
-
##
|
|
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
|
|
37
|
-
TIER_2_FALLBACK: "ONLY on system error
|
|
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
|
-
-
|
|
40
|
-
-
|
|
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
|
-
##
|
|
45
|
+
## DELIVERABLES - FOLDER-BASED AUDIT SYSTEM
|
|
46
46
|
|
|
47
47
|
> [!CAUTION]
|
|
48
|
-
> **MUST CREATE ALL 4
|
|
48
|
+
> **MUST CREATE OR UPDATE ALL 4 FOLDERS** with `00-index.md` and sub-files. Incomplete = FAILED execution.
|
|
49
49
|
|
|
50
|
-
>
|
|
51
|
-
> Every file under `./documents/` must be written in **English only**. Do not use the user's language
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
##
|
|
164
|
+
## INCREMENTAL EXECUTION (MANDATORY)
|
|
63
165
|
|
|
64
|
-
One phase at a time, each phase independent: Phase 1
|
|
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
|
-
##
|
|
170
|
+
## Phase 1: AUDIT RECONNAISSANCE
|
|
69
171
|
|
|
70
|
-
| Attribute | Value
|
|
71
|
-
|
|
72
|
-
| **Agent** | `
|
|
73
|
-
| **Goal**
|
|
172
|
+
| Attribute | Value |
|
|
173
|
+
|-----------|-------|
|
|
174
|
+
| **Agent** | `scouter` |
|
|
175
|
+
| **Goal** | Map attack surface, data flows, security-sensitive areas, and existing audit state |
|
|
74
176
|
|
|
75
|
-
###
|
|
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]
|
|
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
|
-
|
|
355
|
+
### Exit Criteria
|
|
87
356
|
|
|
88
|
-
- [ ]
|
|
89
|
-
- [ ] OWASP
|
|
90
|
-
- [ ]
|
|
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
|
-
##
|
|
366
|
+
## Phase 3: GENERATE AUDIT FOLDERS
|
|
95
367
|
|
|
96
|
-
| Attribute | Value
|
|
97
|
-
|
|
98
|
-
| **Agent** | `
|
|
99
|
-
| **Goal**
|
|
368
|
+
| Attribute | Value |
|
|
369
|
+
|-----------|-------|
|
|
370
|
+
| **Agent** | `docs-manager` |
|
|
371
|
+
| **Goal** | Generate or update all 4 audit folders in English only |
|
|
100
372
|
|
|
101
|
-
###
|
|
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
|
-
|
|
110
|
-
|
|
464
|
+
---
|
|
465
|
+
|
|
466
|
+
## Phase 4: FRAMEWORK MAPPING AND SCORING
|
|
111
467
|
|
|
112
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
##
|
|
520
|
+
## Phase 5: CONSISTENCY AND QUALITY REVIEW
|
|
121
521
|
|
|
122
|
-
| Attribute | Value
|
|
123
|
-
|
|
124
|
-
| **Agent** | `
|
|
125
|
-
| **Goal**
|
|
522
|
+
| Attribute | Value |
|
|
523
|
+
|-----------|-------|
|
|
524
|
+
| **Agent** | `reviewer` |
|
|
525
|
+
| **Goal** | Validate cross-folder consistency, evidence integrity, and production readiness |
|
|
126
526
|
|
|
127
|
-
###
|
|
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
|
-
|
|
136
|
-
> EMBODY [docs-manager] — Requires logged system error justification.
|
|
137
|
-
|
|
138
|
-
**Exit Criteria:**
|
|
552
|
+
### Exit Criteria
|
|
139
553
|
|
|
140
|
-
- [ ]
|
|
141
|
-
- [ ]
|
|
142
|
-
- [ ]
|
|
143
|
-
- [ ]
|
|
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
|
-
##
|
|
562
|
+
## VERIFICATION
|
|
563
|
+
|
|
564
|
+
Before completion, verify folder existence and quality:
|
|
148
565
|
|
|
149
|
-
|
|
566
|
+
### Folder Existence
|
|
150
567
|
|
|
151
568
|
```
|
|
152
569
|
./documents/audit/
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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.
|
|
166
|
-
2.
|
|
167
|
-
3.
|
|
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
|
+
```
|