Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/hmj1026/dhpk/spec-minegit clone --depth 1 https://github.com/hmj1026/dhpkWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/hmj1026/dhpk/spec-mine)<a href="https://agentmods.dev/commands/hmj1026/dhpk/spec-mine"><img src="https://agentmods.dev/badge/commands/hmj1026/dhpk/spec-mine.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00033 | $0.00532 |
| Opus 5 | $0.00016 | $0.00266 |
| Sonnet 5 | $0.00007 | $0.00106 |
| Haiku 4.5 | $0.00003 | $0.00053 |
Grade A, and why
spec-mine scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
/spec-mine
Front door for behavioral-spec extraction. This command does not mine inline — it dispatches the spec-miner agent (opus), which owns the sampling budget, metadata rules, and the flat Requirement / Invariant output format. Mirrors how the Playwright route delegates journeys directly to the agent:e2e-runner capability (an unavailable browser/agent is reported as UNAVAILABLE, not remapped to another test workflow).
When to use
- Onboarding an existing project to spec-driven development ("mine specs", "extract specs from the codebase", "萃取規格").
- A module's existing behavior needs documenting as OpenSpec baseline truth before
opsx-apply-goal//opsx:applychanges can reference it.
Steps
- Pre-flight — confirm this is (or should be) an OpenSpec project:
Ifls openspec/specs 2>/dev/null && echo "specs dir present" || echo "no openspec/specs yet"openspec/is absent, ask before creating it —spec-minernever scatters spec files outsideopenspec/specs/. - Dispatch the
spec-mineragent via theAgenttool (subagent_type: dhpk:spec-miner), passing$ARGUMENTS(the capability or path to mine first; omit to let the agent present the capability list and ask). - Relay the agent's result: the written
openspec/specs/<capability>/spec.mdpath, the capability name, theLast verifiedcommit stamp, and any<!-- deferred: -->files to schedule for a follow-up pass.
Constraints
- The deliverable is
openspec/specs/<capability>/spec.md(the agent's only Write target) — not a.claude/artifacts/report. - Do not mine every module at once; mine the requested capability (or ask which one first). Spec rot starts when specs outpace usage.
$ARGUMENTS: optional capability name or path to mine first.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 34 lines · 33 tokens per session scan A 4bc6084d4715
spec-mine is a command published in the GitHub repository hmj1026/dhpk (2 stars, last pushed yesterday), licensed MIT. It adds 33 tokens to every session and 532 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.
Other commands, from other repositories
init
在既有專案初始化 Octopus——摸專案、檢查 OpenSpec CLI 與結構(缺則引導安裝)、盤點 change 狀態、建 Arena、出交接報告。每個專案跑一次。.
spec
SDD 前半段:需求釐清(反問+挑戰)→ OpenSpec change 一次落檔(proposal+delta+tasks,Draft)→ TPM 拍板鎖定(回一個 OK 即可)。鎖定後 build 全自主執行。.
debug
用 Agent 工具啟動 debugger agent,把錯誤資訊原文(含截圖/log)完整轉給它。.
review
單獨審查——Reviewer 對指定 branch/變更出四段式驗收報告(可直接貼 PR description)。.
review
Comprehensive multi-agent code quality and architecture review with cross-validation.
config
View and configure Argus settings.