@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
@@ -1,6 +1,6 @@
1
1
  # HD Skills Map
2
2
 
3
- > Last verified: 2026-03-01 | 22 hd-* skills
3
+ > Last verified: 2026-03-05 | 26 hd-* skills
4
4
  > Invoke `/hd-help [describe your task]` for an interactive recommendation.
5
5
 
6
6
  ---
@@ -79,7 +79,7 @@ Worker needs to be run?
79
79
  | `hd-issue-resolution` | Something is broken | "fix bug", "error in X", "test failing", "unexpected behavior", "crash" |
80
80
  | `hd-changelog` | Work just completed | "log this bead", "update CHANGELOG.md", "generate changelog entry", "what changed in this epic" |
81
81
  | `hd-estimation` | Incoming bid or scope request | "estimate effort", "how long will X take", "create a bid", "ballpark quote" |
82
- | `hd-code-review` | Reviews git diff between branches across 11 aspects. Outputs Approved / Approved with Comments / Changes Requested verdict. Reads `CODING_STANDARDS.md` for project-specific rules. | "review this branch", "code review", "gate merge", "review diff", "review PR" |
82
+ | `hd-code-review` | Reviews git diff between branches across 12 universal aspects. Loads `CODING_STANDARDS.md` (style rules), `REVIEW_STANDARDS.md` (tech-stack presets, aspect escalations, custom aspects), and `KNOWN_ISSUES.md` (accepted debt — annotates matching findings as INFO instead of blocking). Outputs Approved / Approved with Comments / Changes Requested verdict. | "review this branch", "code review", "gate merge", "review diff", "review PR" |
83
83
  | `hd-security-review` | Deep security-only analysis: OWASP Top 10, PII audit, auth/authz, tenant isolation, compliance gate. Outputs APPROVED or NOT APPROVED with severity-classified findings. | "security review", "OWASP check", "PII audit", "compliance gate", "pre-launch security", "is this safe to ship?" |
84
84
 
85
85
  **Disambiguation:**
@@ -87,7 +87,7 @@ Worker needs to be run?
87
87
  Something broken that used to work? → hd-issue-resolution (not hd-planning)
88
88
  Completed beads to document? → hd-changelog (not hd-docs-sync)
89
89
  New project bid or ETA needed? → hd-estimation
90
- Full code review (11 aspects)? → hd-code-review
90
+ Full code review (12 aspects)? → hd-code-review
91
91
  Deep security-only audit (OWASP)? → hd-security-review (can run both)
92
92
  ```
93
93
 
@@ -169,7 +169,7 @@ hd-look-at vs hd-painter:
169
169
  → hd-docs-parse (text extraction from 75+ formats — not hd-look-at, which analyzes visual content)
170
170
 
171
171
  "review code changes / review this branch / gate merge"
172
- → hd-code-review (full review across 11 aspects + quick security pass)
172
+ → hd-code-review (full review across 12 aspects + quick security pass)
173
173
  → hd-security-review (deep security-only: OWASP, PII audit, compliance gate, APPROVED/NOT APPROVED)
174
174
  → can run both
175
175
  ```
@@ -207,6 +207,11 @@ hd-look-at vs hd-painter:
207
207
  /hd-daily-goals # Write today's morning goals report
208
208
  /hd-daily-goals Today I work on AI Kit 3h: fix login, review PRs # with inline draft
209
209
  /hd-daily-report # Write today's status report (done / working / blockers)
210
+ /hd-daily-viewer # List last 7 days with ✅/❌ availability
211
+ /hd-daily-viewer yesterday # Single-day view: goals + report + metrics
212
+ /hd-daily-viewer this week # Weekly summary with per-day breakdown
213
+ /hd-daily-viewer last 30 days # Monthly aggregates + outstanding activities
214
+ /hd-daily-viewer 2026-03-01 # Specific date
210
215
  /hd-tasks <workspace-url> # List tasks, pick which ones, dispatch hd-task on each
211
216
  /hd-tasks --status=todo <url> # Filter list to Todo only before selecting
212
217
  /hd-docs-parse report.pdf — extract text to stdout
@@ -217,6 +222,21 @@ hd-look-at vs hd-painter:
217
222
  /hd-code-review https://linear.app/.../PROJ-123 — review with task context
218
223
  /hd-code-review --source=feat/auth --target=main — explicit branches
219
224
  /hd-security-review — deep security analysis (OWASP, PII, compliance gate)
225
+ /hd-iso-sync https://drive.google.com/drive/folders/<id> — sync ISO docs from Google Drive
226
+ /hd-iso lookup "password policy" — search ISO docs for content
227
+ /hd-iso gap --standard 27001 — check compliance coverage
228
+ /hd-iso gap --standard 9001 --clause 8 — check specific clause section
229
+ /hd-iso change "update data retention period" — get impact analysis before editing
230
+ /hd-iso onboard --role developer — generate onboarding reading path
231
+ /hd-iso-verify docs/iso/password-policy.md — verify a specific doc
232
+ /hd-iso-verify --standard 27001 — verify all docs for ISO 27001
233
+ /hd-iso-verify check if onboarding is valid against ISO 27001 — NL query mode
234
+ /hd-iso ncr log — guided NCR intake
235
+ /hd-iso ncr list --status open — view open NCRs
236
+ /hd-iso ncr close NCR-001 — close a nonconformity
237
+ /hd-iso records --standard 27001 — check mandatory records
238
+ /hd-iso-ready --standard 27001 — full readiness report
239
+ /hd-iso-ready --standard 27001 --brief — executive summary
220
240
 
221
241
  # Chaining example: extract requirements from PDF → estimate
222
242
  /hd-docs-parse requirements.pdf --markdown -o requirements.md # 1. extract text
@@ -227,9 +247,38 @@ hd-look-at vs hd-painter:
227
247
 
228
248
  ---
229
249
 
250
+ ### Cluster E: ISO & Compliance
251
+
252
+ > Skills for managing ISO 9001/27001 documentation. Requires Google Docs MCP for sync.
253
+
254
+ | Skill | What it does | Use when you say… |
255
+ |-------|-------------|-------------------|
256
+ | `hd-iso-sync` | One-way sync from Google Drive → Markdown in Git. Exports docs, injects clause-tagging frontmatter, regenerates index. **Req:** Google Docs MCP. | "sync ISO docs", "import from Google Docs", "refresh iso markdown", "pull ISO docs from Drive" |
257
+ | `hd-iso lookup` | Search ISO docs by query — returns excerpts, clause refs, and Google Doc links. | "find ISO clause for X", "which policy covers Y", "search iso docs" |
258
+ | `hd-iso gap` | Map all ISO clauses against tagged docs. Outputs ✅ Covered / ⚠️ Partial / ❌ Missing. | "compliance gap check", "what clauses are missing", "iso 27001 gap report" |
259
+ | `hd-iso change` | Impact analysis before editing a doc — lists affected clauses + change checklist. | "what changes if I update X", "iso change checklist", "impact of editing this policy" |
260
+ | `hd-iso onboard` | Role-based reading path for new employees — filtered must-read list with time estimates. | "onboard new developer", "iso reading path for QA", "what should new hire read" |
261
+ | `hd-iso-verify` | Content quality audit — checks whether a doc's body actually fulfills ISO requirements for its tagged clauses. Supports file path, clause/standard flags, and natural language queries. Outputs ✅/⚠️/❌ per check + COMPLIANT/REVIEW NEEDED/NON-COMPLIANT verdict. | "is this doc ISO compliant", "verify password policy against ISO 27001", "is our onboarding process ISO valid", "audit document quality" |
262
+ | `hd-iso ncr` | Log, list, close, and view Nonconformity/Corrective Action Records. Stores NCRs as `docs/iso/ncr/NCR-NNN.md` with guided intake and lifecycle tracking. | "log NCR", "track nonconformity", "corrective action", "close NCR-001", "list open NCRs" |
263
+ | `hd-iso records` | Check mandatory documented information exists — verifies all records required by ISO 9001/27001 are present with correct `doc_type: record` and clause tags. | "check mandatory records", "are all ISO records present", "mandatory documented information" |
264
+ | `hd-iso-ready` | Certification readiness report — aggregates gap (30%), document quality (35%), mandatory records (25%), and open NCRs (penalty) into a weighted readiness score. Grade: 🟢 READY / 🟡 PARTIALLY READY / 🔴 NOT READY. | "are we ISO ready", "certification readiness", "pre-audit check", "readiness report" |
265
+
266
+ **Disambiguation:**
267
+ ```
268
+ Syncing from Google Docs? → hd-iso-sync (run first, populates docs/iso/)
269
+ Searching content? → hd-iso lookup <query>
270
+ Checking compliance coverage? → hd-iso gap --standard 27001
271
+ Editing a doc safely? → hd-iso change <description> (get impact first)
272
+ New employee starting? → hd-iso onboard --role <developer|qa|manager|security|new-hire>
273
+ Verifying doc content quality? → hd-iso-verify <path|--clause|--standard|NL query>
274
+ Logging a nonconformity? → hd-iso ncr log
275
+ Checking mandatory records exist? → hd-iso records --standard 27001
276
+ Pre-audit readiness check? → hd-iso-ready --standard 27001
277
+ ```
278
+
230
279
  ---
231
280
 
232
- ### Cluster E: QA & Testing
281
+ ### Cluster F: QA & Testing
233
282
 
234
283
  > Skills for QC teams to generate, manage, and verify test cases. No developer access required for the main skill.
235
284
 
@@ -252,7 +301,7 @@ hd-qa-test-cases-verify requires:
252
301
 
253
302
  ---
254
303
 
255
- ### Cluster F: Project Setup & Configuration
304
+ ### Cluster G: Project Setup & Configuration
256
305
 
257
306
  > Skills that configure the project environment for Claude Code.
258
307
 
@@ -267,7 +316,7 @@ Project stack changed, need to add MCPs? → /hd-mcp sync
267
316
  Developer joining, need to set up locally? → /hd-mcp (no args)
268
317
  ```
269
318
 
270
- ### Cluster G: Daily Reporting
319
+ ### Cluster H: Daily Reporting
271
320
 
272
321
  > Skills for team members to write structured daily reports via a guided HITL loop.
273
322
 
@@ -275,6 +324,7 @@ Developer joining, need to set up locally? → /hd-mcp (no args)
275
324
  |-------|-------------|-------------------|
276
325
  | `hd-daily-goals` | Write the daily morning goals report. Guides you through projects, hours, and goals — enforces outcome + temporal marker + confidence per goal before outputting a copy-ready Discord report. | "write my daily goals", "morning report", "daily goals", "write today's goals", "hd-daily-goals" |
277
326
  | `hd-daily-report` | Write the daily status report (what was done, what's in progress, blockers). Enforces all required fields per section before outputting. | "write my daily report", "daily standup", "end of day report", "what I worked on today" |
327
+ | `hd-daily-viewer` | View, navigate, and summarize past daily goals and reports from `~/.hd/`. Single-day detail view (goals + report + metrics), time-window summaries (per-day breakdown or high-level aggregates), and list mode. Always surfaces at least 7 outstanding in-progress/blocked activities. | "show me yesterday's report", "view past goals", "this week summary", "what did I do last week", "daily history" |
278
328
 
279
329
  **Disambiguation:**
280
330
  ```
@@ -283,10 +333,75 @@ Morning, before work starts → plan what you WILL do?
283
333
 
284
334
  During or end of day → report what you DID / are doing / blocked on?
285
335
  YES → hd-daily-report
336
+
337
+ Reviewing past days, comparing goals vs results, or getting a summary?
338
+ YES → hd-daily-viewer
286
339
  ```
287
340
 
288
341
  ---
289
342
 
343
+ ---
344
+
345
+ ## Project Configuration Conventions
346
+
347
+ > One-time setup for each project, not skill-specific.
348
+
349
+ ### Multi-Repo Projects (Polyrepo)
350
+
351
+ When a project spans multiple repositories (e.g., frontend + API), two additions help
352
+ Claude and skills find related code without needing full paths in every prompt.
353
+
354
+ **Step 1 — `AGENTS.md` (committed)**
355
+
356
+ Add a `## Related Projects` section declaring related repos by alias:
357
+
358
+ ```markdown
359
+ ## Related Projects
360
+ | Alias | Role |
361
+ |-------|------|
362
+ | project-b-api | REST API backend |
363
+ | project-b-story-android | Story branch worktree checkout of API |
364
+ ```
365
+
366
+ **Step 2 — `additionalDirectories` (native file access + path registry)**
367
+
368
+ Use the same `additionalDirectories` key in both settings files:
369
+
370
+ ```json
371
+ // .claude/settings.json ← committed; team-shared paths (if paths are stable)
372
+ {
373
+ "additionalDirectories": [
374
+ "/shared/path/to/project-b-api"
375
+ ]
376
+ }
377
+
378
+ // .claude/settings.local.json ← gitignored; developer-local paths
379
+ {
380
+ "additionalDirectories": [
381
+ "/my/local/path/to/project-b-api",
382
+ "/my/local/worktrees/story-android"
383
+ ]
384
+ }
385
+ ```
386
+
387
+ Both files are merged at runtime. Gives Claude native Glob/Grep/Read access across repos.
388
+ Skills (e.g., `hd-docs-sync`) read `additionalDirectories` from both files and
389
+ cross-reference with AGENTS.md aliases to know which directories are related repos.
390
+
391
+ In prompts, mention the alias — `"also check project-b-api"` — instead of the full path.
392
+
393
+ **Git worktrees**: Worktrees don't inherit `.claude/`. Fix with a symlink:
394
+
395
+ ```bash
396
+ ln -s /project/a/.claude /project/a/worktrees/story-android/.claude
397
+ ```
398
+
399
+ **`hd-docs-sync` integration**: When `## Related Projects` is in AGENTS.md AND
400
+ matching paths exist in `additionalDirectories`, docs-sync automatically includes related
401
+ repos' git history (Stream D) so API changes that implicate frontend docs are detected.
402
+
403
+ ---
404
+
290
405
  ## Other Skill Sets
291
406
 
292
407
  > This section is intentionally empty.
@@ -0,0 +1,409 @@
1
+ ---
2
+ name: hd-iso
3
+ description: >
4
+ ISO 9001/27001 document intelligence skill. Lookup content, detect compliance gaps,
5
+ guide document changes, and generate role-based onboarding paths.
6
+ Use when: searching ISO docs, checking compliance coverage, planning a doc change,
7
+ onboarding a new employee, "hd-iso", "iso compliance check", "what ISO clause covers X".
8
+ license: proprietary
9
+ metadata:
10
+ version: "1.0.0"
11
+ copyright: "© HDWEBSOFT. All rights reserved."
12
+ ---
13
+
14
+ # ISO Document Intelligence
15
+
16
+ > **[IMPORTANT]** This skill reads from `docs/iso/*.md` — run `hd-iso-sync` first to populate. All output is advisory; humans own all changes to Google Docs.
17
+
18
+ ## Sub-commands
19
+
20
+ ```
21
+ hd-iso lookup <query> Search ISO docs for content
22
+ hd-iso gap [--standard 9001|27001] Detect missing/incomplete clause coverage
23
+ hd-iso change <description> Get change impact + checklist before editing a doc
24
+ hd-iso onboard [--role <role>] Generate role-based reading path for new employee
25
+ hd-iso ncr log Log a new nonconformity (guided intake)
26
+ hd-iso ncr list [--status open|closed] List NCRs with summary table
27
+ hd-iso ncr close <NCR-NNN> Mark NCR closed with evidence
28
+ hd-iso ncr show <NCR-NNN> Show full NCR details
29
+ hd-iso records [--standard 9001|27001] Check mandatory ISO records exist
30
+ ```
31
+
32
+ ## Prerequisites
33
+
34
+ - `docs/iso/*.md` populated (run `hd-iso-sync` first)
35
+ - `docs/iso/index.md` exists
36
+ - For `hd-iso gap`: frontmatter `clauses` and `iso_standard` tagged on docs
37
+
38
+ ---
39
+
40
+ ## `hd-iso lookup <query>`
41
+
42
+ **Purpose**: Find ISO documents and clauses relevant to a search query.
43
+
44
+ ### Steps
45
+
46
+ 1. Search `docs/iso/` in order of priority:
47
+ - **Clause match**: query matches a clause ID in frontmatter `clauses` field
48
+ - **Title match**: query found in doc `title` frontmatter
49
+ - **Body match**: query found in document body text
50
+
51
+ 2. For each match, extract and return:
52
+ ```
53
+ 📄 [Doc Title]
54
+ Standard: ISO 27001 | Clauses: A.9.4.3, A.5.15
55
+ Type: procedure | Roles: developer, security
56
+ Source: https://docs.google.com/document/d/...
57
+
58
+ > ...relevant excerpt (2-3 sentences containing the query)...
59
+ ```
60
+
61
+ 3. Sort results: clause matches first → title matches → body matches
62
+
63
+ 4. If no results found:
64
+ - Suggest broader search terms
65
+ - Note if `docs/iso/` is empty (prompt to run `hd-iso-sync`)
66
+
67
+ ### Example
68
+
69
+ ```
70
+ User: hd-iso lookup "password policy"
71
+
72
+ Results (3 found):
73
+
74
+ 📄 Password and Authentication Policy
75
+ Standard: ISO 27001 | Clauses: A.5.17, A.8.5
76
+ Type: policy | Roles: all
77
+ Source: https://docs.google.com/document/d/1abc...
78
+
79
+ > "Passwords must be at least 12 characters, include uppercase, lowercase,
80
+ numbers and symbols. Shared accounts are prohibited..."
81
+
82
+ 📄 Access Control Procedure
83
+ Standard: ISO 27001 | Clauses: A.5.15, A.5.18
84
+ Type: procedure | Roles: developer, security
85
+ Source: https://docs.google.com/document/d/2def...
86
+
87
+ > "...password resets must be initiated via the IT helpdesk. Temporary passwords
88
+ expire after 24 hours..."
89
+ ```
90
+
91
+ ---
92
+
93
+ ## `hd-iso gap [--standard 9001|27001] [--clause <id>]`
94
+
95
+ **Purpose**: Map ISO requirements against tagged documents. Find what's covered, partial, or missing.
96
+
97
+ ### Steps
98
+
99
+ 1. Load requirement list:
100
+ - `--standard 27001` → `reference/iso-27001-requirements.md`
101
+ - `--standard 9001` → `reference/iso-9001-requirements.md`
102
+ - No flag → run both standards
103
+
104
+ 2. For each requirement clause, check `docs/iso/`:
105
+ - Query: any doc with matching clause ID in `clauses` frontmatter
106
+ - **`✅ Covered`**: 1+ docs with this clause, and at least one is `doc_type: policy` or `procedure`
107
+ - **`⚠️ Partial`**: clause found but only in `record` or `guideline` type docs (no policy/procedure)
108
+ - **`❌ Missing`**: no docs tagged with this clause
109
+
110
+ 3. Calculate summary stats:
111
+ ```
112
+ ISO 27001 Gap Report
113
+ Covered: 61/93 controls (66%)
114
+ Partial: 12/93 controls (13%)
115
+ Missing: 20/93 controls (22%)
116
+ ```
117
+
118
+ 4. Print full table grouped by section (A.5, A.6, A.7, A.8 for 27001):
119
+ ```
120
+ ## A.5 — Organizational Controls
121
+ ✅ A.5.1 Policies for information security
122
+ ✅ A.5.2 IS roles and responsibilities
123
+ ⚠️ A.5.9 Inventory of assets (only a record, needs a procedure)
124
+ ❌ A.5.23 Security for use of cloud services
125
+ ...
126
+ ```
127
+
128
+ 5. Save full report to `reports/gap-<standard>-<YYYYMMDD>.md`
129
+
130
+ 6. For `⚠️ Partial` and `❌ Missing` items, suggest action:
131
+ ```
132
+ Recommended actions:
133
+ ❌ A.5.23 — Create a Cloud Security Policy document in Google Docs
134
+ Tag it: iso_standard: [27001], clauses: ["A.5.23"], doc_type: policy
135
+ ⚠️ A.5.9 — Existing "Asset List" record is insufficient. Add an Asset Management Procedure.
136
+ ```
137
+
138
+ ### Scope Filtering
139
+
140
+ ```
141
+ hd-iso gap --standard 27001 --clause A.8
142
+ → Only check A.8.x controls (Technological Controls)
143
+
144
+ hd-iso gap --standard 9001 --clause 8
145
+ → Only check clause 8.x (Operations)
146
+ ```
147
+
148
+ ---
149
+
150
+ ## `hd-iso change <description>`
151
+
152
+ **Purpose**: Before editing any ISO document, understand what compliance impact the change has and follow the correct process.
153
+
154
+ ### Steps
155
+
156
+ 1. **Find relevant docs**: semantic search in `docs/iso/` for docs related to the described change
157
+ - Show top 3-5 matches with confidence level
158
+
159
+ 2. **Map clause impact**: for each matched doc, list all `clauses` from frontmatter
160
+ - These are the ISO clauses the change may affect
161
+
162
+ 3. **Output impact warning**:
163
+ ```
164
+ ⚠️ Change Impact Analysis: "update data retention period"
165
+
166
+ Affected documents (2):
167
+ 📄 Data Retention Policy — clauses: A.8.10, A.5.33, 7.5
168
+ 📄 Data Classification Guide — clauses: A.5.12, A.5.13
169
+
170
+ ISO clauses at risk:
171
+ A.8.10 Information deletion
172
+ A.5.33 Protection of records
173
+ 7.5 Documented information
174
+ ```
175
+
176
+ 4. **Generate change checklist**:
177
+ ```
178
+ Change Checklist — Data Retention Policy Update
179
+
180
+ Before editing:
181
+ [ ] Confirm which ISO clauses this change affects (see above)
182
+ [ ] Identify approver: Manager / Security Officer review required for policy changes
183
+ [ ] Check if related procedures also need updating (e.g. Data Classification Guide)
184
+
185
+ During editing (in Google Docs):
186
+ [ ] Update version number in document header
187
+ [ ] Add change description in revision history table
188
+ [ ] Date the change
189
+
190
+ After editing:
191
+ [ ] Get required approval signatures
192
+ [ ] Run hd-iso-sync to refresh Markdown layer
193
+ [ ] Run hd-iso gap --standard 27001 to confirm coverage maintained
194
+ [ ] Notify relevant roles: security, all (based on doc roles field)
195
+ ```
196
+
197
+ 5. Save checklist to `reports/change-guide-<YYYYMMDD>.md`
198
+
199
+ ---
200
+
201
+ ## `hd-iso onboard [--role <role>]`
202
+
203
+ **Purpose**: Generate a personalized reading path for a new employee based on their role.
204
+
205
+ ### Supported Roles
206
+
207
+ | Role | Description |
208
+ |------|-------------|
209
+ | `developer` | Software engineers, DevOps, tech leads |
210
+ | `qa` | Quality assurance, testers |
211
+ | `manager` | Team leads, department heads, project managers |
212
+ | `security` | CISO, security team, security engineers |
213
+ | `new-hire` | All employees — company-wide policies only |
214
+
215
+ If no `--role` provided: ask user which role.
216
+
217
+ ### Steps
218
+
219
+ 1. Load role profile from `reference/role-profiles.md` → get relevant clause list
220
+
221
+ 2. Filter `docs/iso/` for docs where:
222
+ - `roles` frontmatter contains the specified role OR `all`
223
+ - OR `clauses` frontmatter intersects with role's clause list
224
+
225
+ 3. Categorize docs:
226
+ - **Must-read**: `doc_type: policy` or `procedure` that directly apply to this role
227
+ - **Reference**: `doc_type: record` or `guideline` — useful but not required reading
228
+ - **Awareness only**: other company-wide policies for context
229
+
230
+ 4. Estimate reading time per doc: `word_count / 200` (words per minute), round up to nearest 5 min
231
+
232
+ 5. Output reading path:
233
+ ```
234
+ 🎯 ISO Onboarding Path — Developer
235
+ Total estimated reading time: 45 minutes
236
+
237
+ ## Must-Read (30 min)
238
+ 1. [15 min] Information Security Policy → https://docs.google.com/...
239
+ Covers: A.5.1 | Why: Sets your security obligations as a developer
240
+ 2. [10 min] Access Control Procedure → https://docs.google.com/...
241
+ Covers: A.5.15, A.8.3 | Why: How to request and manage system access
242
+ 3. [5 min] Secure Development Policy → https://docs.google.com/...
243
+ Covers: A.8.25, A.8.28 | Why: Coding standards you must follow
244
+
245
+ ## Reference (15 min — read when relevant)
246
+ 4. [10 min] Vulnerability Management Procedure → https://docs.google.com/...
247
+ Covers: A.8.8 | When: When you discover or report a vulnerability
248
+ 5. [5 min] Change Management Procedure → https://docs.google.com/...
249
+ Covers: A.8.32 | When: Before deploying to production
250
+
251
+ ## Awareness (skim when you have time)
252
+ 6. Quality Policy — company-wide quality commitments
253
+ 7. Data Classification Guide — how to label data you handle
254
+
255
+ ## Key Rules for Developers (quick summary)
256
+ - All code must go through code review before merge
257
+ - Report security vulnerabilities immediately to security@company.com
258
+ - Never commit credentials or secrets to Git
259
+ - Production access requires approval — request via IT helpdesk
260
+ ```
261
+
262
+ 6. Save to `reports/onboarding-<role>-<YYYYMMDD>.md`
263
+
264
+ ---
265
+
266
+ ## Common Patterns
267
+
268
+ ### First-time setup check
269
+ Before any command, verify `docs/iso/` exists and has content:
270
+ ```
271
+ If docs/iso/ is empty or missing:
272
+ → "Run hd-iso-sync first to import your ISO documents from Google Drive."
273
+ ```
274
+
275
+ ### Untagged docs warning
276
+ If many docs lack `clauses` frontmatter:
277
+ ```
278
+ ⚠️ 38 of 42 docs are untagged. Gap analysis will be incomplete.
279
+ Run hd-iso-sync and complete the tagging step for accurate results.
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Report Output Paths
285
+
286
+ | Command | Output file |
287
+ |---------|-------------|
288
+ | `hd-iso gap` | `reports/gap-<standard>-<YYYYMMDD>.md` |
289
+ | `hd-iso change` | `reports/change-guide-<YYYYMMDD>.md` |
290
+ | `hd-iso onboard` | `reports/onboarding-<role>-<YYYYMMDD>.md` |
291
+ | `hd-iso records` | `reports/records-<standard>-<YYYYMMDD>.md` |
292
+
293
+ Reports folder is created automatically if it doesn't exist.
294
+
295
+ ---
296
+
297
+ ## hd-iso ncr — Nonconformity & Corrective Action Tracking
298
+
299
+ NCR files live in `docs/iso/ncr/NCR-NNN.md` (auto-numbered, 3-digit zero-padded).
300
+
301
+ ### NCR File Format
302
+
303
+ ```yaml
304
+ ---
305
+ id: NCR-001
306
+ title: "Password policy missing shared account prohibition"
307
+ date_raised: 2026-03-05
308
+ raised_by: "hd-iso-verify / manual"
309
+ doc_ref: docs/iso/procedures/password-policy.md
310
+ clause: A.5.17
311
+ severity: minor # major | minor | observation
312
+ status: open # open | in-progress | closed
313
+ root_cause: ""
314
+ corrective_action: ""
315
+ target_date: ""
316
+ closed_date: ""
317
+ closed_by: ""
318
+ ---
319
+
320
+ ## Details
321
+
322
+ <free text description of the nonconformity>
323
+ ```
324
+
325
+ ### ncr log
326
+
327
+ Guided intake:
328
+ 1. Ask: title, doc_ref, clause, severity (major/minor/observation)
329
+ 2. Auto-assign ID from highest NCR-NNN in `docs/iso/ncr/` (create dir if needed)
330
+ 3. Create file with frontmatter preset: status: open, date_raised: today, raised_by: "manual"
331
+
332
+ ### ncr list [--status open|closed]
333
+
334
+ Scan `docs/iso/ncr/*.md`, render summary table:
335
+
336
+ ```
337
+ Open NCRs (3)
338
+
339
+ | ID | Title | Clause | Severity | Status | Age |
340
+ |---------|------------------------------------------|---------|----------|-------------|-------|
341
+ | NCR-001 | Password policy missing shared account | A.5.17 | minor | open | 5d |
342
+ | NCR-002 | Incident response missing SLA | A.5.24 | major | in-progress | 12d |
343
+ | NCR-003 | Backup policy has no restoration test | A.8.13 | minor | open | 2d |
344
+ ```
345
+
346
+ - Default: show all open + in-progress NCRs
347
+ - `--status closed` → show closed NCRs only
348
+ - `--status all` → show all
349
+
350
+ ### ncr close <NCR-NNN>
351
+
352
+ Show current NCR details. Ask: corrective_action, closed_by (name/role). Update frontmatter: `status: closed`, `closed_date: today`.
353
+
354
+ ### ncr show <NCR-NNN>
355
+
356
+ Pretty-print the full NCR:
357
+
358
+ ```
359
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
360
+ NCR-001 — minor | open
361
+ Title: Password policy missing shared account prohibition
362
+ Clause: A.5.17
363
+ Doc ref: docs/iso/procedures/password-policy.md
364
+ Raised: 2026-03-05 by manual
365
+ Target: (not set)
366
+
367
+ Details:
368
+ The password policy does not prohibit shared accounts. ISO 27001 A.5.17
369
+ requires explicit prohibition of shared credentials.
370
+
371
+ Root cause: (not yet set)
372
+ Corrective action: (not yet set)
373
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
374
+ ```
375
+
376
+ ---
377
+
378
+ ## hd-iso records — Mandatory Records Existence Check
379
+
380
+ ```
381
+ hd-iso records [--standard 9001|27001]
382
+ ```
383
+
384
+ For each required record in the reference file ("Mandatory Documented Information" section):
385
+ - Search `docs/iso/` for a doc with `doc_type: record` + matching clause tag
386
+ - Grade: ✅ Present | ⚠️ Wrong type (clause found, wrong doc_type) | ❌ Missing
387
+ - Default (no flag): check both standards
388
+
389
+ ### Output
390
+
391
+ ```
392
+ Mandatory Records Check — ISO 27001:2022
393
+ Run: 2026-03-05
394
+
395
+ ✅ Risk assessment results (docs/iso/records/risk-register.md)
396
+ ✅ Risk treatment plan (docs/iso/records/risk-treatment.md)
397
+ ⚠️ Statement of Applicability (docs/iso/policies/soa.md) — doc_type is 'policy', expected 'record'
398
+ ❌ Internal audit results — no record tagged 9.2.2
399
+ ❌ Nonconformities and CARs — no record tagged 10.2.2
400
+ ✅ Management review results (docs/iso/records/mgmt-review-minutes.md)
401
+
402
+ Summary: 3/6 mandatory records present | 2 missing | 1 wrong type
403
+
404
+ Next: Create missing records in Google Docs → sync → tag with correct clause + doc_type: record
405
+ ```
406
+
407
+ Save to `reports/records-<standard>-<YYYYMMDD>.md`.
408
+
409
+ If `--standard` not provided, run both standards and combine output under separate headings.