hdd-2bc2d4 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited hdd-2bc2d4 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Run Hypothesis-Driven Development for: $ARGUMENTS
Code is an implementation artifact. ADRs are the source of truth.
Before writing any code, form testable hypotheses about what you expect to happen, document them in a staging ADR, implement the minimum needed to test them, validate whether reality matched predictions, then accept or reject based on evidence.
Parse $ARGUMENTS for:
adr_number (required): The ADR number, e.g. 008title (required): Brief title, e.g. "Task Endpoint Implementation"--resume (optional): Resume an existing HDD session instead of starting fresh--phases=N-M (optional): Run only phases N through M. Used by /workflow to invokePhases 1-2 (research + stage docs) as its Stage 2, then take back control for its own planning/implementation/review stages. Default: 1-5 (full lifecycle).
Research --> Stage Docs --> Implement --> Validate --> Decide --[PR review]--> Amend
| checkpoint | checkpoint | | checkpoint | checkpoint |
v v v v v v
hypotheses spec + ADR code + tests evidence accept/reject fix + ADR amendmentEach phase has a user checkpoint. You do NOT skip checkpoints.
When /workflow dispatches to /hdd at Stage 2, it passes --phases=1-2. This produces the spec and staging ADR, then returns control to /workflow for its own planning, implementation, and review stages. When invoked standalone (the default), /hdd runs all 5 phases as a self-contained lifecycle.
.hdd/state.json for this ADR number. If an active session exists, warn and ask whether to resume or start fresh.If --phases=1-2, only create tasks for Phases 1 and 2.
.hdd/state.json: {
"workflow": "hdd",
"version": "2.1",
"adr_number": "<number>",
"title": "<title>",
"phase": "research",
"phases_requested": [1, 2, 3, 4, 5],
"tracker": { "provider": "<selected-tracker-or-none>", "issueId": "<optional>" },
"phaseIds": {
"research": "<id>",
"stage": "<id>",
"implement": "<id>",
"validate": "<id>",
"decide": "<id>"
},
"status": "in_progress",
"artifacts": [],
"hypotheses": [], // After Phase 1: [{ "id": "H1", "claim": "...", "prediction": "...", "validation": "...", "outcome": null }]
"staging_adr_path": null,
"spec_path": null,
"open_risks": [],
"reconciliation_flags": [],
"updated_at": "<ISO timestamp>"
}.hdd/state.jsonGoal: Understand the problem space and form testable hypotheses.
Dispatch one Explore-type sub-agent using the Agent tool:
Agent tool call:
subagent_type: Explore
prompt: |
You are the HDD Research agent for ADR-${adr_number}: ${title}.
## Task
Build context and form testable hypotheses for this architectural decision.
## What to read
- Accepted ADRs: .adr/accepted/ (constraints and patterns)
Also check docs/adr/ — legacy ADRs predate the .adr/ convention
- Rejected ADRs: .adr/rejected/ (prior failure modes)
Also check docs/adr/rejected/ — legacy location
- Active staging: .adr/staging/ (in-flight work)
- Specs: specs/ (implementation contracts)
## ADR Reconciliation
For each accepted ADR related to this domain, apply these 7 signals:
1. Context mismatch — ADR describes codebase state that no longer matches
2. Broken references — files/modules mentioned have moved or been deleted
3. Dependency drift — major version change in a dependency the ADR relied on
4. Contradicting direction — this new work conflicts with the ADR's decision
5. Unrealized consequences — ADR predicted outcomes that never materialized
6. Rejected alternative resurfacing — a rejected approach is being proposed again
7. Orphaned dependency chain — ADR depends on a retired/rejected ADR
If any signal fires, include it in your output with specific evidence.
## Hypotheses
Form SOFT hypotheses — Specific, Observable, Falsifiable, Testable.
Each hypothesis must name an exact behavior, metric, or outcome.
## Return formatRESEARCH SUMMARY ================ Domain: <what area of the codebase this touches>
EXISTING CONSTRAINTS
PRIOR FAILURES
RECONCILIATION FLAGS
Recommended disposition: STILL VALID | NEEDS AMENDMENT | SUPERSEDED | INVALIDATED (or: No reconciliation flags.)
HYPOTHESES H1: <specific testable claim> Prediction: <exact observable outcome> Validation: <how to test> H2: ...
UNKNOWNS
OPEN RISKS
Checkpoint: Present the research summary and draft hypotheses to the user. Wait for approval before advancing.
Gate: At least one SOFT hypothesis with evidence-backed context. User approved.
Artifact persistence (MANDATORY before advancing):
After user approval, the orchestrator MUST:
.hdd/state.json: # Update state.json — hypotheses array, reconciliation_flags, phase
# Each hypothesis object: { "id": "H1", "claim": "...", "prediction": "...", "validation": "..." }.hdd/state.json back and verify hypotheses.length > 0Phase 2 MUST refuse to start if .hdd/state.json has an empty hypotheses array. Conversation memory is not an artifact. If it's not on disk, it didn't happen.
When a reconciliation signal fires, the research agent recommends one of four outcomes. The orchestrator presents these to the user during the checkpoint for a decision:
reflect current codebase. Amend the ADR in place during Phase 5 (alongside the new ADR).
.adr/retired/with a forward reference during Phase 5.
.adr/retired/with an explanation. If the domain still needs a decision, the current HDD session serves as that replacement.
Do NOT act on dispositions during Phase 1. Record them. Execute them in Phase 5 alongside the primary ADR migration.
Goal: Document WHAT we're implementing (spec) and WHY (ADR) before writing code.
Dispatch one sub-agent:
Agent tool call:
prompt: |
You are the HDD Staging agent for ADR-${adr_number}: ${title}.
## Context
Research summary (from Phase 1):
<paste the full research output here>
Approved hypotheses:
<paste the user-approved hypotheses>
## Task
Create two documents:
### 1. Spec (WHAT)
Path: specs/${slug}.md
The spec describes the implementation contract. It answers: what does the
system look like after this work is done? Include:
- Data structures / types being added or changed
- API surface (new endpoints, tool operations, parameters)
- Behavior descriptions (what happens when X)
- Acceptance criteria (testable conditions for "done")
Do NOT include reasoning about WHY — that belongs in the ADR.
### 2. Staging ADR (WHY)
Path: .adr/staging/ADR-${adr_number}-${slug}.md
Sections:
- **Status**: Proposed
- **Context**: Problem, current state, constraints from research
- **Decision**: Chosen approach and why (reference alternatives considered)
- **Consequences**: Positive outcomes, tradeoffs, follow-ups
- **Hypotheses**: Each in SOFT format with validation plan (use format below)
- **Spec**: Link to specs/${slug}.md
- **Links**: Related ADRs, files, rejected approaches
### Hypothesis format in ADRPrediction: [Exact observable outcome] Validation: [Commands, observations, or measurements] Outcome: PENDING
### Dependency/conflict notes
If any reconciliation flags were raised in Phase 1, note them in the ADR's
Context section with planned dispositions.
## Return formatSTAGING SUMMARY =============== Spec path: specs/${slug}.md ADR path: .adr/staging/ADR-${adr_number}-${slug}.md Hypotheses staged: N Dependencies noted: [list or "none"] Conflicts noted: [list or "none"]
After receiving the sub-agent output, update .hdd/state.json with staging_adr_path and spec_path.
Checkpoint: Present both the spec and the staging ADR to the user. Wait for approval before implementation.
Gate: Spec exists in specs/. Staging ADR exists in .adr/staging/. All sections complete. Each hypothesis is SOFT. User approved both documents.
Artifact persistence (MANDATORY before advancing):
After user approval, the orchestrator MUST:
spec_path from state, then read the filestaging_adr_path from state, then read the file.hdd/state.json has non-null staging_adr_path and spec_pathPhase 3 MUST refuse to start if either file is missing from disk.
If `--phases=1-2`: Stop here. Return the spec path, ADR path, and hypotheses to the calling workflow. Update state to phase: "stage-complete".
Goal: Build the minimum code needed to test hypotheses.
Dispatch one or more sub-agents depending on implementation scope. For each sub-agent:
Agent tool call:
prompt: |
You are an HDD Implementation agent.
## Scope
ADR: <paste staging ADR path and content>
Spec: <paste spec path and content>
## Task
Implement the minimum changes required to exercise the hypotheses in the ADR.
Rules:
1. Read the spec for WHAT to build. Read the ADR for WHY.
2. Write tests tied to each hypothesis — tests validate the PREDICTION,
not just that code exists.
3. Run build and type checks after implementation.
4. Track any deviation from spec with justification.
5. Do NOT commit. Changes stay uncommitted until after validation.
## Return formatIMPLEMENTATION SUMMARY ====================== Files modified: [list with paths] Files created: [list with paths] Tests written: N Tests passing: N/N Build: pass | fail Type check: pass | fail
HYPOTHESIS COVERAGE H1: covered by test <test name> H2: covered by test <test name> ...
DEVIATIONS FROM SPEC
(or: None.)
TEST TARGETS Command: <exact test command> Files: <test file paths>
After receiving summaries, update .hdd/state.json with artifacts and test targets.
No user checkpoint — advance directly to validation.
Gate: Implementation and hypothesis-linked tests exist. Build passes. Type checks pass.
Goal: Test whether predictions match reality.
Dispatch one sub-agent:
Agent tool call:
prompt: |
You are an HDD Validation agent.
## Context
ADR: <staging ADR path and content>
Test targets: <from implementation summary>
## Task
For each hypothesis in the ADR:
1. Run the specific validation described in the hypothesis
2. Capture concrete evidence (test output, command output, observations)
3. Classify: VALIDATED | INVALIDATED | INCONCLUSIVE
Also run full quality checks:
- Build: npm run build (or equivalent)
- Tests: npm test (or equivalent)
- Linter: if configured
- Type checker: tsc --noEmit (or equivalent)
## Return formatVALIDATION REPORT ================= Quality checks: build [pass|fail], tests [pass|fail], types [pass|fail]
HYPOTHESIS RESULTS H1: "<claim>" Prediction: <what we expected> Evidence: <what actually happened — include command output> Classification: VALIDATED | INVALIDATED | INCONCLUSIVE Notes: <analysis of match/mismatch>
H2: ...
MANUAL VERIFICATION NEEDED
(or: None — all hypotheses verified automatically.)
OVERALL: ALL VALIDATED | SOME INVALIDATED | MIXED
Checkpoint: Present the validation report to the user. For each hypothesis, show prediction vs. evidence. Ask the user to:
Gate: Every hypothesis has an explicit outcome. User confirmed results.
Goal: Accept or reject the ADR based on validation evidence.
mv .adr/staging/ADR-NNN-*.md .adr/accepted/.adr/retired/ with forward reference.adr/retired/ with explanationspecs/) feat(<scope>): <description>
ADR-NNN accepted — all hypotheses validated..hdd/state.jsonCheckpoint: Present the rejection analysis. The user MUST approve the rejection.
mv .adr/staging/ADR-NNN-*.md .adr/rejected/trash specs/${slug}.md (it describes something we didn't build)git checkout -- <files> docs(adr): reject ADR-NNN — [hypothesis] invalidated
[Brief explanation of what was learned].hdd/state.jsonIf some hypotheses validated and others didn't:
a. Accept with amendments: Update ADR and spec to reflect narrowed scope, accept b. Reject and re-scope: Reject this ADR, create a new one with revised hypotheses c. Continue validation: If inconclusive results can be resolved with more testing
Trigger: PR review (human or automated) surfaces issues after the ADR is accepted and committed. This phase is not part of the normal flow — it activates only when external review finds something Phase 4 validation missed.
Classify each finding before acting:
| Finding Type | Action | Example |
|---|---|---|
| Hypothesis gap — a behavior the hypotheses should have tested but didn't | Amend ADR + fix code | "prefix-strip produces wrong internal names" |
| Spec gap — the spec didn't cover a mapping or edge case | Amend ADR + update spec + fix code | "spec lists 41 operations but mapping table has 4" |
| Unrelated issue — not caused by this ADR's changes | Create a separate tracker item or handoff entry; do NOT amend this ADR | "pre-existing bug in session handler" |
If the finding is unrelated, stop here. Create a tracker item or handoff entry and move on. The rest of this phase applies only to in-scope findings.
Name it concretely — "H7: Each models_* gateway operation resolves to the correct internal handler name" — not "tests should be more thorough."
### Post-Review Amendments section at the end of theaccepted ADR (before Links, if present):
### Post-Review Amendments
#### Amendment 1: <title> (<date>)
**Found by**: <reviewer name or tool>
**Finding**: <one-sentence description of what was wrong>
**Gap**: <which hypothesis should have existed or was under-specified>
**Fix**: <what changed — file:line or commit hash>
**Pattern**: <reusable lesson for future HDD sessions>wasn't documented). The spec should reflect reality after the fix.
fix(<scope>): <description>
ADR-NNN post-review amendment — <gap summary>.create a single fix tracker item or handoff entry. Either way, mark it complete when the fix commit lands.
The Pattern field in the amendment is the payoff. It feeds into Phase 1 research for future HDD sessions — when the research agent reads accepted ADRs, post-review amendments tell it what validation approaches failed and why.
Common patterns to watch for:
string transform, test each mapping individually, not just the boundary.
own switch statement, verify the value that reaches the inner switch, not just that the gateway dispatched.
string instead of aunion type, the compiler can't catch wrong values. Test at runtime.
not an amendment.
amendment needed.
Render after every phase transition:
HDD SESSION: ADR-<number> — <title>
Epic: <epicId> | Branch: <branch>
Phases: <1-5 or 1-2>
Phase Status Artifact
----- ------ --------
1. Research [status] hypotheses: N, flags: N
2. Stage Docs [status] spec: specs/<slug>.md
adr: .adr/staging/ADR-NNN-*.md
3. Implementation [status] files: N, tests: N
4. Validation [status] validated: N, invalidated: N
5. Decision [status] accepted | rejected | pending
5.5 Post-Review [status] amendments: N (if triggered)
Open risks: <count>
Reconciliation: <count> flags, <count> pending dispositionsStatus symbols: [ ] pending, [~] in progress, [x] complete, [!] blocked
Before leaving Phase 1, every hypothesis MUST pass the SOFT check:
Reject hypotheses that are vague ("performance is good"), implementation-focused ("we will use class X"), or unfalsifiable ("code will be maintainable").
.hdd/state.json and the selected tracker or handoff artifact after each phase completes. Crashes should be recoverable. Write-then-verify: after writing state, read it back and confirm the expected data is present. Conversation memory is not an artifact — if it's not on disk, it didn't happen./hdd command router at .claude/commands/hdd/hdd.md is deprecated. The module briefs in .claude/commands/hdd/modules/ remain as reference material for sub-agent context..hdd/state.json and verified by reading the file back, they will be lost when the session endsAlways use for: New features, architectural changes, protocol implementations, refactoring that changes behavior, performance optimizations with measurable goals.
Skip for: Trivial bug fixes, documentation-only changes, test-only additions, formatting/linting fixes.
.adr/
staging/ # Work in progress — under validation
accepted/ # Validated — source of truth
rejected/ # Failed — documented lessons
retired/ # Superseded — historical reference
.hdd/
state.json # Current session state (gitignored)
specs/ # Implementation specs (WHAT — paired with ADRs)docs/WORKFLOW-MASTER-DESCRIPTION.md.claude/commands/hdd/modules/ (sub-agent reference material).claude/commands/hdd/state.mddocs/adr/000-template.md (if it exists)~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.