@hdwebsoft/hdcode-ai-darwin-x64 0.0.7 → 0.0.8

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 (54) hide show
  1. package/bin/hdcode +0 -0
  2. package/bin/index.js.map +1 -1
  3. package/bin/worker.js.map +1 -1
  4. package/package.json +1 -1
  5. package/resources/agents/finder.md +1 -1
  6. package/resources/agents/mermaid.md +1 -1
  7. package/resources/skills/hd-code-review/CODING_STANDARDS.md +14 -114
  8. package/resources/skills/hd-code-review/REVIEW_STANDARDS.md +76 -0
  9. package/resources/skills/hd-code-review/SKILL.md +314 -90
  10. package/resources/skills/hd-code-review/reference/review-checklist.md +104 -101
  11. package/resources/skills/hd-code-review/reference/stacks/apex.md +49 -0
  12. package/resources/skills/hd-code-review/reference/stacks/aura.md +39 -0
  13. package/resources/skills/hd-code-review/reference/stacks/cakephp.md +50 -0
  14. package/resources/skills/hd-code-review/reference/stacks/django.md +53 -0
  15. package/resources/skills/hd-code-review/reference/stacks/dotnet.md +52 -0
  16. package/resources/skills/hd-code-review/reference/stacks/expo.md +39 -0
  17. package/resources/skills/hd-code-review/reference/stacks/flutter.md +48 -0
  18. package/resources/skills/hd-code-review/reference/stacks/go.md +51 -0
  19. package/resources/skills/hd-code-review/reference/stacks/laravel.md +56 -0
  20. package/resources/skills/hd-code-review/reference/stacks/lwc.md +49 -0
  21. package/resources/skills/hd-code-review/reference/stacks/nodejs.md +51 -0
  22. package/resources/skills/hd-code-review/reference/stacks/php.md +52 -0
  23. package/resources/skills/hd-code-review/reference/stacks/python.md +50 -0
  24. package/resources/skills/hd-code-review/reference/stacks/react.md +51 -0
  25. package/resources/skills/hd-code-review/reference/stacks/reactnative.md +54 -0
  26. package/resources/skills/hd-code-review/reference/stacks/scala.md +48 -0
  27. package/resources/skills/hd-code-review/reference/stacks/visualforce.md +38 -0
  28. package/resources/skills/hd-code-review/reference/stacks/vuejs.md +52 -0
  29. package/resources/skills/hd-code-review/reference/stacks/wordpress.md +54 -0
  30. package/resources/skills/hd-daily-goals/SKILL.md +41 -9
  31. package/resources/skills/hd-daily-goals/reference/ticket-autofill.md +104 -0
  32. package/resources/skills/hd-daily-goals/reference/validation-rules.md +13 -0
  33. package/resources/skills/hd-daily-report/SKILL.md +70 -14
  34. package/resources/skills/hd-daily-report/reference/sample-report-qc.md +44 -0
  35. package/resources/skills/hd-daily-report/reference/sample-report.md +18 -15
  36. package/resources/skills/hd-daily-report/reference/validation-rules.md +28 -7
  37. package/resources/skills/hd-daily-viewer/SKILL.md +222 -0
  38. package/resources/skills/hd-docs-init/SKILL.md +33 -0
  39. package/resources/skills/hd-docs-parse/SKILL.md +2 -0
  40. package/resources/skills/hd-docs-parse/scripts/parse_document.py +6 -0
  41. package/resources/skills/hd-docs-sync/SKILL.md +65 -3
  42. package/resources/skills/hd-docs-sync/reference/doc-mapping.md +1 -0
  43. package/resources/skills/hd-help/SKILL.md +24 -0
  44. package/resources/skills/hd-help/reference/skill-map.md +122 -7
  45. package/resources/skills/hd-iso/SKILL.md +409 -0
  46. package/resources/skills/hd-iso/reference/iso-27001-requirements.md +166 -0
  47. package/resources/skills/hd-iso/reference/iso-9001-requirements.md +91 -0
  48. package/resources/skills/hd-iso/reference/role-profiles.md +115 -0
  49. package/resources/skills/hd-iso-ready/SKILL.md +146 -0
  50. package/resources/skills/hd-iso-sync/SKILL.md +217 -0
  51. package/resources/skills/hd-iso-sync/reference/frontmatter-schema.md +89 -0
  52. package/resources/skills/hd-iso-verify/SKILL.md +294 -0
  53. package/resources/skills/hd-issue-resolution/SKILL.md +20 -0
  54. package/resources/skills/hd-task/SKILL.md +12 -0
@@ -0,0 +1,217 @@
1
+ ---
2
+ name: hd-iso-sync
3
+ description: "Sync ISO 9001/27001 documentation from Google Docs to Markdown files in Git. Use when importing or refreshing ISO documents from a Google Drive folder. Triggers on: sync iso docs, import from google docs, refresh iso markdown, hd-iso-sync, pull ISO docs from Google Drive."
4
+ license: proprietary
5
+ metadata:
6
+ version: "1.0.0"
7
+ copyright: "© HDWEBSOFT. All rights reserved."
8
+ ---
9
+
10
+ # ISO Docs Sync
11
+
12
+ > **[IMPORTANT]** One-way sync only: Google Docs → Markdown. Never edit the generated MD files directly — they will be overwritten on next sync. Only `pinned: true` frontmatter blocks overwrite protection.
13
+
14
+ ## Pipeline
15
+
16
+ ```
17
+ INPUT (folder URL/ID)
18
+ → Phase 1: Resolve Target
19
+ → Phase 2: List Documents
20
+ → Phase 3: Export to Markdown
21
+ → Phase 4: Update Index
22
+ → Phase 5: Tagging Prompt
23
+ OUTPUT (docs/iso/*.md + docs/iso/index.md)
24
+ ```
25
+
26
+ | Phase | Action | Output |
27
+ |-------|--------|--------|
28
+ | 1. Resolve | Parse folder arg, validate MCP available | Folder ID confirmed |
29
+ | 2. List | `listFiles` → show doc list for confirmation | File manifest |
30
+ | 3. Export | `readDocument` × N → inject frontmatter → save MD | `docs/iso/**/*.md` |
31
+ | 4. Index | Regenerate index table | `docs/iso/index.md` |
32
+ | 5. Tag | Prompt for untagged docs (clauses, standard, roles) | Tagged frontmatter |
33
+
34
+ ---
35
+
36
+ ## Phase 1: Resolve Target
37
+
38
+ Parse the argument provided by the user.
39
+
40
+ - **URL format**: `https://drive.google.com/drive/folders/<FOLDER_ID>` → extract `FOLDER_ID`
41
+ - **Direct ID**: use as-is
42
+ - **No arg**: ask user — "Please provide the Google Drive folder URL or ID containing your ISO documents."
43
+
44
+ Validate MCP is available:
45
+ - Check that `a-bonus/google-docs-mcp` is configured in Claude Code settings
46
+ - If not: stop and output setup instructions (see MCP Setup section below)
47
+
48
+ ---
49
+
50
+ ## Phase 2: List Documents
51
+
52
+ Use MCP `listFiles` tool with the resolved folder ID:
53
+
54
+ ```
55
+ listFiles(folderId: "<FOLDER_ID>", recursive: true, mimeType: "application/vnd.google-apps.document")
56
+ ```
57
+
58
+ Display results to user:
59
+ ```
60
+ Found 42 Google Docs in folder:
61
+ - Password Policy (docs/procedures/)
62
+ - Data Retention Policy (docs/policies/)
63
+ - Access Control Procedure (docs/procedures/)
64
+ ...
65
+
66
+ Proceed with sync? [yes/no]
67
+ ```
68
+
69
+ Stop if user says no.
70
+
71
+ ---
72
+
73
+ ## Phase 3: Export to Markdown
74
+
75
+ For each document in the list:
76
+
77
+ 1. Call MCP `readDocument(documentId: "<ID>")` → returns document content as markdown
78
+ 2. Derive output path:
79
+ - Mirror Google Drive subfolder structure under `docs/iso/`
80
+ - Slugify doc title for filename: lowercase, spaces → hyphens, remove special chars
81
+ - Example: "Password Policy" in folder "procedures/" → `docs/iso/procedures/password-policy.md`
82
+ 3. Check if file already exists with `pinned: true` in frontmatter → **skip overwrite** if pinned
83
+ 4. Inject frontmatter header:
84
+
85
+ ```yaml
86
+ ---
87
+ title: "<exact Google Docs title>"
88
+ gdoc_url: "https://docs.google.com/document/d/<DOC_ID>"
89
+ last_sync: "<YYYY-MM-DDTHH:MM:SSZ>"
90
+ iso_standard: []
91
+ clauses: []
92
+ doc_type: ""
93
+ roles: []
94
+ pinned: false
95
+ ---
96
+ ```
97
+
98
+ 5. Append document markdown body after frontmatter
99
+ 6. Save file
100
+
101
+ Run all exports — do not stop on individual doc errors; collect errors and report at end.
102
+
103
+ **After all exports complete — Stale Cleanup:**
104
+ 7. Collect all local `docs/iso/**/*.md` files (exclude `docs/iso/index.md`)
105
+ 8. Stale = local files whose path does NOT match any file written in steps 1–6
106
+ 9. For each stale file:
107
+ - Read frontmatter — if `pinned: true` → skip (never auto-delete pinned files)
108
+ - Otherwise → delete the file
109
+ 10. If any files were deleted, print warning:
110
+ ```
111
+ ⚠️ Removed N stale file(s) (no longer in Google Drive):
112
+ - docs/iso/procedures/old-policy.md
113
+ - docs/iso/policies/archived-doc.md
114
+ ```
115
+ If 0 stale files → silent (no output)
116
+
117
+ ---
118
+
119
+ ## Phase 4: Update Index
120
+
121
+ Regenerate `docs/iso/index.md` as a full manifest:
122
+
123
+ ```markdown
124
+ # ISO Document Index
125
+
126
+ _Last synced: <datetime>_
127
+
128
+ | Title | Standard | Clauses | Type | Roles | Last Sync | Source |
129
+ |-------|----------|---------|------|-------|-----------|--------|
130
+ | Password Policy | 27001 | A.9.4.3 | procedure | developer, security | 2026-03-05 | [link](...) |
131
+ | ... | | | | | | |
132
+
133
+ ## Untagged Documents (needs clause assignment)
134
+
135
+ | Title | Path | Action |
136
+ |-------|------|--------|
137
+ | Some Doc | docs/iso/... | Add iso_standard, clauses, doc_type, roles |
138
+ ```
139
+
140
+ ---
141
+
142
+ ## Phase 5: Tagging Prompt
143
+
144
+ If any documents have empty `clauses`, `iso_standard`, or `doc_type` fields:
145
+
146
+ ```
147
+ ⚠️ 12 documents need clause tagging before gap analysis will work.
148
+
149
+ Options:
150
+ [1] Tag now interactively (recommended for first sync)
151
+ [2] Skip — tag manually later by editing frontmatter
152
+ ```
153
+
154
+ If user chooses interactive tagging, for each untagged doc:
155
+ 1. Show doc title + first 200 characters of content
156
+ 2. Suggest iso_standard based on title keywords:
157
+ - Security, access, encryption, incident → 27001
158
+ - Quality, process, customer, audit → 9001
159
+ - Both keywords present → suggest both
160
+ 3. Suggest clauses from `../hd-iso/reference/iso-27001-requirements.md` or `iso-9001-requirements.md` based on title match
161
+ 4. User confirms or corrects → write to frontmatter
162
+ 5. Proceed to next doc
163
+
164
+ ---
165
+
166
+ ## Frontmatter Field Reference
167
+
168
+ See `reference/frontmatter-schema.md` for full spec.
169
+
170
+ | Field | Type | Values |
171
+ |-------|------|--------|
172
+ | `title` | string | Exact Google Docs title (auto-filled) |
173
+ | `gdoc_url` | string | Full Google Docs URL (auto-filled) |
174
+ | `last_sync` | datetime | ISO 8601 (auto-filled) |
175
+ | `iso_standard` | array | `[9001]`, `[27001]`, `[9001, 27001]` |
176
+ | `clauses` | array | `["7.5", "A.9.4.3", "8.5"]` |
177
+ | `doc_type` | string | `policy` \| `procedure` \| `record` \| `guideline` |
178
+ | `roles` | array | `developer` \| `qa` \| `manager` \| `security` \| `all` |
179
+ | `pinned` | boolean | `true` = never overwrite on sync |
180
+
181
+ ---
182
+
183
+ ## MCP Setup
184
+
185
+ Requires `a-bonus/google-docs-mcp` configured in Claude Code.
186
+
187
+ Quick setup — add to `.claude/settings.json`:
188
+ ```json
189
+ {
190
+ "mcpServers": {
191
+ "google-docs": {
192
+ "command": "npx",
193
+ "args": ["-y", "@a-bonus/google-docs-mcp"],
194
+ "env": {
195
+ "GOOGLE_CLIENT_ID": "<your-client-id>",
196
+ "GOOGLE_CLIENT_SECRET": "<your-client-secret>"
197
+ }
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
203
+ For full OAuth setup instructions, see `docs/INSTALL.md` → "ISO Skills Setup".
204
+
205
+ Or run `/hd-mcp sync` to auto-configure.
206
+
207
+ ---
208
+
209
+ ## Error Handling
210
+
211
+ | Error | Action |
212
+ |-------|--------|
213
+ | MCP not configured | Stop, show setup instructions |
214
+ | Folder not found / no access | Stop, show permission guidance |
215
+ | Individual doc export fails | Log warning, continue with rest, report failures at end |
216
+ | `pinned: true` doc | Skip silently, note in summary |
217
+ | Duplicate filename slug | Append `-2`, `-3` etc. |
@@ -0,0 +1,89 @@
1
+ # ISO Doc Frontmatter Schema
2
+
3
+ Every file under `docs/iso/` must have this YAML frontmatter block at the top.
4
+ `hd-iso-sync` auto-fills the marked fields. Human fills the rest.
5
+
6
+ ## Full Schema
7
+
8
+ ```yaml
9
+ ---
10
+ title: "<string>" # AUTO — exact Google Docs title
11
+ gdoc_url: "<url>" # AUTO — full Google Docs edit URL
12
+ last_sync: "<datetime>" # AUTO — ISO 8601 UTC, e.g. 2026-03-05T08:00:00Z
13
+ iso_standard: [] # HUMAN — list: [9001], [27001], or [9001, 27001]
14
+ clauses: [] # HUMAN — list of clause IDs (see formats below)
15
+ doc_type: "" # HUMAN — one value: policy | procedure | record | guideline
16
+ roles: [] # HUMAN — list: developer | qa | manager | security | all
17
+ pinned: false # HUMAN — set true to prevent overwrite on next sync
18
+ ---
19
+ ```
20
+
21
+ ## Field Specs
22
+
23
+ ### `iso_standard`
24
+ Which ISO standard(s) this document supports.
25
+ - `[9001]` — Quality management only
26
+ - `[27001]` — Information security only
27
+ - `[9001, 27001]` — Supports both
28
+
29
+ ### `clauses`
30
+ Clause IDs this document satisfies. Use the exact ID format from the standard:
31
+
32
+ **ISO 27001:2022** (Annex A controls):
33
+ ```
34
+ A.5.1 A.5.2 A.5.3 ... A.5.37
35
+ A.6.1 A.6.2 ... A.6.8
36
+ A.7.1 A.7.2 ... A.7.14
37
+ A.8.1 A.8.2 ... A.8.34
38
+ ```
39
+
40
+ **ISO 27001:2022** (mandatory clauses):
41
+ ```
42
+ 4.1 4.2 4.3 4.4
43
+ 5.1 5.2 5.3
44
+ 6.1 6.2 6.3
45
+ 7.1 7.2 7.3 7.4 7.5
46
+ 8.1 8.2 8.3
47
+ 9.1 9.2 9.3
48
+ 10.1 10.2
49
+ ```
50
+
51
+ **ISO 9001:2015**:
52
+ ```
53
+ 4.1 4.2 4.3 4.4
54
+ 5.1 5.2 5.3
55
+ 6.1 6.2 6.3
56
+ 7.1 7.2 7.3 7.4 7.5
57
+ 8.1 8.2 8.3 8.4 8.5 8.6 8.7
58
+ 9.1 9.2 9.3
59
+ 10.1 10.2 10.3
60
+ ```
61
+
62
+ Multiple clauses example:
63
+ ```yaml
64
+ clauses: ["7.5", "A.5.37", "A.8.9"]
65
+ ```
66
+
67
+ ### `doc_type`
68
+ The nature of the document:
69
+ - `policy` — states intent and direction (e.g. "Information Security Policy")
70
+ - `procedure` — step-by-step instructions (e.g. "Access Review Procedure")
71
+ - `record` — evidence of activity (e.g. "Annual Risk Assessment Record")
72
+ - `guideline` — recommendations, non-mandatory guidance
73
+
74
+ ### `roles`
75
+ Who needs to read this document:
76
+ - `developer` — software engineers, DevOps
77
+ - `qa` — quality assurance, testers
78
+ - `manager` — team leads, department heads
79
+ - `security` — CISO, security team
80
+ - `all` — every employee (use for company-wide policies)
81
+
82
+ Multiple roles: `["developer", "security"]`
83
+
84
+ ### `pinned`
85
+ Set to `true` to prevent `hd-iso-sync` from overwriting this file.
86
+ Use when you've made manual corrections to the MD body that don't exist in Google Docs yet,
87
+ or when the Google Doc is being heavily edited and you don't want partial content synced.
88
+
89
+ **Important**: pinned files still appear in the index; sync just skips the body update.
@@ -0,0 +1,294 @@
1
+ ---
2
+ name: hd-iso-verify
3
+ description: "ISO document content quality audit. Checks whether a document body actually fulfills ISO requirements for its tagged clauses — not just existence, but content quality. Use when: verifying a policy is ISO-compliant, auditing document quality, checking if a process meets ISO requirements, natural language queries like 'is onboarding ISO compliant', 'verify password policy against ISO 27001', 'hd-iso-verify'."
4
+ license: proprietary
5
+ metadata:
6
+ version: "1.0.0"
7
+ copyright: "© HDWEBSOFT. All rights reserved."
8
+ ---
9
+
10
+ # ISO Document Content Verifier
11
+
12
+ > **[IMPORTANT]** This skill reads from `docs/iso/*.md` (run `hd-iso-sync` first) and
13
+ > `skills/hd-iso/reference/` for clause definitions. All verdicts are advisory — humans
14
+ > own all compliance decisions and auditor submissions.
15
+
16
+ > **Distinction from `hd-iso gap`**:
17
+ > - `hd-iso gap` — existence check: is there *a* doc for clause X?
18
+ > - `hd-iso-verify` — content check: does that doc *say what ISO requires*?
19
+
20
+ ## Invocation
21
+
22
+ ```
23
+ /hd-iso-verify <path> — verify a specific doc
24
+ /hd-iso-verify --clause A.5.17 — verify all docs tagged with this clause
25
+ /hd-iso-verify --standard 27001 — verify all docs for this standard
26
+ /hd-iso-verify --standard 9001 — verify all docs for ISO 9001
27
+ /hd-iso-verify --standard 27001 --clause A.8 — verify docs for a clause section
28
+ /hd-iso-verify <natural language query> — semantic: find + verify docs by topic
29
+ ```
30
+
31
+ **Natural language examples:**
32
+ ```
33
+ /hd-iso-verify check if the new member onboarding process is valid against ISO 27001
34
+ /hd-iso-verify verify our password policy against ISO 27001
35
+ /hd-iso-verify is the incident response procedure ISO compliant?
36
+ /hd-iso-verify check backup policy completeness
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Phase 0 — Argument Parse + Prerequisite Check
42
+
43
+ Parse the invocation to determine scope:
44
+
45
+ | Args | Scope |
46
+ |------|-------|
47
+ | `<path>` | Single file at `docs/iso/<path>` or absolute path |
48
+ | `--clause <id>` | All docs in `docs/iso/` where frontmatter `clauses` contains `<id>` |
49
+ | `--standard <std>` | All docs in `docs/iso/` where frontmatter `iso_standard` contains `<std>` |
50
+ | `--standard <std> --clause <id>` | Intersection: standard AND clause prefix match |
51
+ | Natural language query | → **NL Query Mode** (see below) |
52
+
53
+ ### NL Query Mode
54
+
55
+ When args are free text (no flags, no file path), extract:
56
+ 1. **Topic** — what process/policy is being asked about (e.g., "new member onboarding", "password policy", "backup")
57
+ 2. **Standard** — if mentioned explicitly (e.g., "ISO 27001", "9001"); if not → check both standards
58
+
59
+ Then:
60
+ 1. **Find relevant docs** — grep `docs/iso/` for docs whose title or body contains the topic keywords
61
+ 2. **Identify relevant clauses** — use the reference files + ISO knowledge to name the 2–5 clauses that typically govern this topic
62
+ - Examples: "onboarding" → A.6.1 (Screening), A.6.2 (Terms), A.6.3 (Training), A.6.5 (Responsibilities after termination)
63
+ - "password policy" → A.5.17 (Authentication), A.8.5 (Secure authentication)
64
+ - "incident response" → A.5.24 (Planning), A.5.26 (Response), A.5.27 (Learning from incidents)
65
+ 3. **Scope = found docs** — run full verification (Phase 1–3) on those docs
66
+ 4. **Gap check** — for the identified relevant clauses, note any that have no docs tagged (existence gap)
67
+ 5. Output includes a preamble: "I found N docs related to '<topic>' covering clauses X, Y, Z. Here's the content quality analysis:"
68
+
69
+ If no docs found for the topic → report: "No docs found in `docs/iso/` matching '<topic>'. Run `hd-iso gap --standard 27001` to check if a doc for this area is missing entirely."
70
+
71
+ **Prerequisite checks**:
72
+ - If `docs/iso/` is empty or missing → stop:
73
+ > "Run `/hd-iso-sync` first to import your ISO documents.
74
+ > If Google Docs MCP is not yet configured, see `docs/INSTALL.md` → Google Docs MCP section, or run `/hd-mcp` (no args) for guided setup."
75
+ - If no docs match the scope → stop with "No docs found matching `<args>`. Check clause IDs or run `hd-iso gap` first."
76
+ - Load reference files from `skills/hd-iso/reference/` relative to this skill's location:
77
+ - For ISO 27001 docs: `iso-27001-requirements.md`
78
+ - For ISO 9001 docs: `iso-9001-requirements.md`
79
+
80
+ ---
81
+
82
+ ## Phase 1 — Load Target Docs
83
+
84
+ For each doc in scope:
85
+ 1. Read the full MD file (frontmatter + body)
86
+ 2. Extract frontmatter fields: `title`, `iso_standard`, `clauses`, `doc_type`, `gdoc_url`, `last_sync`
87
+ 3. Check for verifiability:
88
+ - `clauses: []` → skip with warning: "⚠️ `<filename>` has no clause tags — cannot verify. Tag it in frontmatter or re-run `hd-iso-sync` with tagging step."
89
+ - `iso_standard: []` → warn: "⚠️ `<filename>` has no standard tagged — will infer from clause IDs (A.x = 27001, numeric only = 9001)"
90
+ 4. Display loaded scope to user before running verification:
91
+ ```
92
+ Verifying 3 documents against ISO 27001:
93
+ - docs/iso/password-policy.md (clauses: A.5.17, A.8.5)
94
+ - docs/iso/access-control.md (clauses: A.5.15, A.5.18)
95
+ - docs/iso/incident-response.md (clauses: A.5.24, A.5.26)
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Phase 2 — Per-Clause Content Check
101
+
102
+ For each document, run verification clause by clause.
103
+
104
+ ### Step 2a — Load Clause Definition
105
+
106
+ For each clause in the doc's `clauses` frontmatter:
107
+ - Look up the clause row in the reference file (match by `Clause` column)
108
+ - Extract: clause title + description
109
+ - If clause not found in reference → note as "unknown clause ID — skipping"
110
+
111
+ ### Step 2b — Universal Quality Checklist
112
+
113
+ Apply these 5 checks to the document body for EACH clause being evaluated.
114
+ These are the baseline ISO document control requirements (ISO 9001 cl. 7.5 / ISO 27001 cl. 7.5):
115
+
116
+ | # | Check | Signal words / patterns to look for |
117
+ |---|-------|--------------------------------------|
118
+ | U1 | **Scope defined** | "applies to", "scope", "covers", "this policy/procedure applies", "all staff", "all systems" |
119
+ | U2 | **Ownership assigned** | role name + "is responsible", "owner:", "maintained by", department name, job title |
120
+ | U3 | **Process described** | numbered steps, "shall", "must", "procedure:", "how to", imperative verbs |
121
+ | U4 | **Evidence/records** | "record", "log", "audit trail", "documented", "evidence of", "report" |
122
+ | U5 | **Review trigger** | "reviewed annually", "reviewed every", "upon change", "review date", version table |
123
+
124
+ Grade each: ✅ Present and specific / ⚠️ Mentioned but vague / ❌ Absent
125
+
126
+ ### Step 2c — Clause-Specific Signals
127
+
128
+ After the universal checklist, derive clause-specific signals and check the doc body for each.
129
+
130
+ **Signal source — use the first available:**
131
+ 1. **`Shall` column** in the reference file (if populated) — contains normative "shall" statements from the official ISO standard. Extract each distinct requirement as a check. This is the most accurate source.
132
+ 2. **Fallback** — derive 2–4 checks from the clause title + description + built-in ISO knowledge.
133
+
134
+ > To populate the `Shall` column with official text: purchase the PDF from BSI ([bsigroup.com](https://www.bsigroup.com)) or ISO ([iso.org/store](https://www.iso.org/store)), extract with `/hd-docs-parse <pdf> --markdown`, then add the key "shall" statements to the reference file.
135
+
136
+ **How to derive fallback signals** (when `Shall` column is empty):
137
+ 1. Read the clause title and description from the reference file
138
+ 2. Identify 2–4 concrete things that document MUST address for that clause
139
+ 3. Check the doc body for each
140
+
141
+ **Examples** (to illustrate the pattern — apply the same logic to ALL clauses):
142
+
143
+ ```
144
+ A.5.17 — Authentication Information
145
+ → check: password complexity rules present
146
+ → check: MFA or multi-factor authentication mentioned
147
+ → check: prohibition of shared accounts
148
+ → check: password recovery/reset process described
149
+
150
+ A.5.24 — Information Security Incident Management
151
+ → check: incident classification or severity levels defined
152
+ → check: escalation path or contacts named
153
+ → check: response timeline or SLA stated
154
+ → check: post-incident review process mentioned
155
+
156
+ A.8.13 — Information Backup
157
+ → check: backup frequency specified
158
+ → check: backup storage location described
159
+ → check: restoration test/verification process mentioned
160
+ → check: retention period stated
161
+
162
+ 8.3 (ISO 9001) — Design and Development
163
+ → check: design inputs defined
164
+ → check: design review steps included
165
+ → check: design verification/validation described
166
+ → check: design output requirements stated
167
+ ```
168
+
169
+ Grade each clause-specific signal: ✅ Present and specific / ⚠️ Mentioned but vague / ❌ Absent
170
+
171
+ ### Step 2d — Clause Verdict
172
+
173
+ For each clause, calculate:
174
+ - Total checks = 5 universal + N clause-specific
175
+ - Met = count of ✅
176
+ - Partial = count of ⚠️ (counts as 0.5 in percentage)
177
+ - Score = (Met + 0.5 × Partial) / Total
178
+
179
+ | Score | Verdict |
180
+ |-------|---------|
181
+ | ≥ 80% | ✅ COMPLIANT |
182
+ | 50–79% | ⚠️ PARTIAL |
183
+ | < 50% | ❌ NON-COMPLIANT |
184
+
185
+ Override to ❌ NON-COMPLIANT if ANY universal check (U1–U5) is ❌ Absent.
186
+
187
+ ---
188
+
189
+ ## Phase 3 — Per-Document Output
190
+
191
+ Print a detailed report for each document:
192
+
193
+ ```
194
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
195
+ 📄 Password and Authentication Policy
196
+ Standard: ISO 27001 | Type: policy | Last sync: 2026-03-01
197
+ Source: https://docs.google.com/document/d/1abc...
198
+
199
+ ── Clause A.5.17 — Authentication Information ──────────────
200
+
201
+ Universal checks:
202
+ ✅ U1 Scope — "applies to all staff and system accounts" (line 4)
203
+ ✅ U2 Ownership — "IT Security team owns this policy" (line 7)
204
+ ⚠️ U3 Process — password complexity rules present but reset process vague
205
+ ❌ U4 Evidence — no mention of audit logs or compliance records
206
+ ✅ U5 Review — "reviewed annually each January" (line 45)
207
+
208
+ Clause-specific checks:
209
+ ✅ Password complexity — min 12 chars, mixed case, symbols required (line 12)
210
+ ⚠️ MFA — mentioned ("MFA is encouraged") but no specifics on when mandatory
211
+ ❌ Shared account prohibition — not mentioned
212
+ ❌ Password recovery process — not described
213
+
214
+ Verdict: ⚠️ PARTIAL (5.5/9 checks — 61%)
215
+ Key gaps: Evidence records, shared account prohibition, recovery process
216
+
217
+ Overall Document Verdict: ⚠️ REVIEW NEEDED
218
+ Recommendations:
219
+ 1. Add compliance record/audit trail requirement (fixes U4 across all clauses)
220
+ 2. Define when MFA is mandatory (A.5.17 specific)
221
+ 3. Add explicit prohibition of shared accounts (A.5.17 specific)
222
+ 4. Add password recovery/reset process with SLA (A.5.17 specific)
223
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
224
+ ```
225
+
226
+ **Document-level verdict** (aggregate of all clause verdicts):
227
+ - 🟢 **COMPLIANT** — all clauses ✅ COMPLIANT
228
+ - 🟡 **REVIEW NEEDED** — any clause ⚠️ PARTIAL, no clause ❌ NON-COMPLIANT
229
+ - 🔴 **NON-COMPLIANT** — any clause ❌ NON-COMPLIANT
230
+
231
+ ---
232
+
233
+ ## Phase 4 — Summary Report
234
+
235
+ After all documents are processed, print a summary:
236
+
237
+ ```
238
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
239
+ hd-iso-verify Summary — 2026-03-05
240
+ Scope: ISO 27001 | Docs verified: 12
241
+
242
+ Results:
243
+ 🟢 COMPLIANT 4 docs
244
+ 🟡 REVIEW NEEDED 6 docs
245
+ 🔴 NON-COMPLIANT 2 docs
246
+
247
+ Docs requiring immediate attention (🔴 NON-COMPLIANT):
248
+ 1. docs/iso/incident-response.md
249
+ — A.5.24: missing response timeline, escalation path absent
250
+ 2. docs/iso/backup-policy.md
251
+ — A.8.13: no restoration test procedure, retention period absent
252
+
253
+ Top gaps across all 12 docs:
254
+ ❌ U4 Evidence/records — missing in 8/12 docs
255
+ ❌ U5 Review trigger — missing in 5/12 docs
256
+ ⚠️ U3 Process specificity — vague in 6/12 docs
257
+
258
+ Skipped (untagged):
259
+ 3 docs have no clause tags — cannot verify. Run hd-iso-sync tagging step.
260
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
261
+ Report saved: reports/verify-27001-20260305.md
262
+ ```
263
+
264
+ **Report filename**:
265
+ - Single doc: `reports/verify-<doc-slug>-<YYYYMMDD>.md`
266
+ - Clause scope: `reports/verify-clause-<id-slug>-<YYYYMMDD>.md`
267
+ - Standard scope: `reports/verify-<standard>-<YYYYMMDD>.md`
268
+
269
+ Create `reports/` directory if it doesn't exist.
270
+
271
+ **After verification, always suggest next steps**:
272
+ - Any 🔴 → "Fix in Google Docs, re-sync with `/hd-iso-sync`, then re-run."
273
+ - Only 🟡 → "Use `/hd-iso change '<description>'` for a guided change checklist."
274
+ - All 🟢 → "Run `/hd-iso gap --standard <std>` to check for coverage gaps."
275
+
276
+ If reference file missing → "Ensure `hd-iso` skill is installed alongside `hd-iso-verify`."
277
+
278
+ ---
279
+
280
+ ## Relationship to Other ISO Skills
281
+
282
+ ```
283
+ hd-iso-sync — import docs from Google Drive → docs/iso/*.md
284
+ hd-iso gap — existence check: which clauses have NO documents?
285
+ hd-iso-verify — content check: do existing documents fulfill requirements? ← this skill
286
+ hd-iso change — before editing: what clauses does a change affect?
287
+ hd-iso onboard — new employee reading path by role
288
+ ```
289
+
290
+ Run order for a full compliance review:
291
+ 1. `/hd-iso-sync` — refresh MD layer
292
+ 2. `/hd-iso gap --standard 27001` — find missing docs (existence)
293
+ 3. `/hd-iso-verify --standard 27001` — audit existing docs (content quality)
294
+ 4. Fix gaps in Google Docs → re-sync → re-verify
@@ -550,6 +550,26 @@ If a Linear task URL was provided at the start of this session:
550
550
 
551
551
  Skip this step if no task URL is in context, or if the task was already updated.
552
552
 
553
+ ## Known Issues Suggestion Hook
554
+
555
+ After resolution, check if the fix involved accepting or deferring the underlying issue rather than fully resolving it.
556
+
557
+ **Trigger signals** (in fix summary, root cause, or verification notes):
558
+ - "workaround", "temporary fix", "partial fix", "deferred", "can't fix now", "won't fix"
559
+ - "known limitation", "accepted", "acknowledged", "expected behavior"
560
+ - "TODO", "FIXME", "tech debt", "legacy constraint"
561
+
562
+ If any trigger signal is present and no matching KI entry exists in `docs/KNOWN_ISSUES.md`:
563
+
564
+ ```
565
+ > This resolution appears to involve accepted/deferred debt: "<matched phrase>".
566
+ > Add to docs/KNOWN_ISSUES.md as a known issue? (y/n)
567
+ ```
568
+
569
+ On **yes**: append a new KI entry with auto-assigned next sequential ID, title from the issue summary, scope from affected files, today's date, and `<fill in>` placeholders for Reason, Accepted-by, and Target-fix. Display: `KI-NNN added — fill in the remaining fields.`
570
+
571
+ On **no**: skip silently.
572
+
553
573
  ---
554
574
 
555
575
  ## Quick Reference
@@ -90,6 +90,9 @@ Parse the invocation arguments before any other action:
90
90
  - If description is missing, fewer than 50 characters, or lacks acceptance criteria: ask the developer for more context before proceeding.
91
91
  6. **Stale detection** — compare `task.updatedAt` to today's date.
92
92
  - If difference > `state_machine.stale_days` (default: 5) from `docs/tasks/config.yaml`: print `Warning: task last updated N days ago. Verify it is still current.` Continue without blocking.
93
+ 7. **Load Known Issues** — check for `docs/KNOWN_ISSUES.md` in the project root.
94
+ - If found: read and store as `KNOWN_ISSUES`. Pass as context to the routed skill in Phase 4 so it can factor in accepted debt when planning or debugging.
95
+ - If not found: `KNOWN_ISSUES` = none. Continue without blocking.
93
96
 
94
97
  ### Phase 2: Route
95
98
 
@@ -239,6 +242,15 @@ Skip if code review is not part of your team's workflow.
239
242
  ```
240
243
  <id> | <date> | <hitl-mode> | pending-review
241
244
  ```
245
+ 4. **Known Issues suggestion** — scan the session output (execution notes, routed skill output, PR description) for language indicating accepted or deferred debt:
246
+ - Trigger signals: "workaround", "known issue", "accepted", "deferred", "can't fix now", "TODO", "tech debt", "temporary fix", "acknowledged"
247
+ - For each match with no existing KI entry in `docs/KNOWN_ISSUES.md`:
248
+ ```
249
+ > This looks like accepted debt: "<matched phrase>".
250
+ > Add to docs/KNOWN_ISSUES.md as a known issue? (y/n)
251
+ ```
252
+ - On **yes**: append a new KI entry (auto-assign next KI-NNN, use today's date, leave Reason/Accepted-by/Target-fix as `<fill in>` placeholders). Display: `KI-NNN added — fill in the remaining fields.`
253
+ - On **no**: skip silently.
242
254
 
243
255
  ---
244
256