kordoc-detect-format

kordoc-detect-format is a skill for Codex from composite/korean-skills. It costs 71 tokens per session (501 once invoked), scanned A, original, MIT.

A file-format detector for identifying Korean HWP, HWPX, PDF, or unknown files.

In plain words
What is it for?
Use it to check a file’s format, validate document uploads, or route mixed office files to the appropriate parsing workflow.
Why use it?
It helps decide how to process an uploaded file before attempting to read it, reducing errors from using the wrong document parser.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to check a file’s format, validate document uploads, or route mixed office files to the appropriate parsing workflow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/composite/korean-skills/kordoc-detect-format
Install

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.

Any agent
npx skills add composite/korean-skills --skill kordoc-detect-format
Clone the repo
git clone --depth 1 https://github.com/composite/korean-skills

Made for: Codex.

Wrote 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.

agentmods badge for kordoc-detect-format

README.md
[![agentmods](https://agentmods.dev/badge/skills/composite/korean-skills/kordoc-detect-format/github.svg)](https://agentmods.dev/skills/composite/korean-skills/kordoc-detect-format)
Your own site
<a href="https://agentmods.dev/skills/composite/korean-skills/kordoc-detect-format"><img src="https://agentmods.dev/badge/skills/composite/korean-skills/kordoc-detect-format/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kordoc-detect-format

Your own site · 80×15
<a href="https://agentmods.dev/skills/composite/korean-skills/kordoc-detect-format"><img src="https://agentmods.dev/badge/skills/composite/korean-skills/kordoc-detect-format.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00071 $0.00501
Opus 5 $0.00036 $0.00251
Sonnet 5 $0.00014 $0.00100
Haiku 4.5 $0.00007 $0.00050

Measured 10d ago against content hash 7fbdc68557e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

kordoc-detect-format 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 10d ago.

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.

skills/kordoc-detect-format/SKILL.md · 48 lines

What it actually says

kordoc: detect_format

Reproduce the detect_format logic from src/mcp.ts: read only the header, then call detectFormat.

Input Requirements

  • Require exactly one target file.
  • Require the user to attach the file or provide a concrete local path.
  • Prefer supported document candidates: .hwp, .hwpx, .pdf.
  • Do not proceed if the file is missing.

Command

npm exec --yes --package=kordoc --package=pdfjs-dist -- node <<'SCRIPT'
const p = require("path"), fs = require("fs");
const nmBin = process.env.PATH.split(p.delimiter).find(d => d.endsWith(".bin"));
const kUrl = "file:///" + p.join(p.resolve(nmBin, ".."), "kordoc", "dist", "index.js").split(p.sep).join("/");
import(kUrl).then(k => {
  const filePath = "/abs/path/document.hwpx";
  const fd = fs.openSync(filePath, "r");
  const header = Buffer.alloc(4);
  try { fs.readSync(fd, header, 0, 4, 0); } finally { fs.closeSync(fd); }
  const ab = header.buffer.slice(header.byteOffset, header.byteOffset + header.byteLength);
  console.log(k.detectFormat(ab));
}).catch(e => { console.error(e); process.exit(1); });
SCRIPT

Workflow

  1. Resolve the file to an absolute path.
  2. Read only the first 4 bytes (the magic bytes detectFormat inspects).
  3. Return only hwp, hwpx, pdf, or unknown.
  4. If the type is supported, move to the matching kordoc skill.

Guardrails

  • Do not infer type from the filename alone.
  • If the result is unknown, stop and report that rather than trying to parse anyway.
  • Keep the answer short unless the user asked for diagnostics.
  • Refuse to continue when no file was provided.
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 10d ago First seen · 48 lines · 71 tokens per session scan A 7fbdc68557e5

Subscribe to this mod's changes

kordoc-detect-format is a skill published in the GitHub repository composite/korean-skills (4 stars, last pushed 5mo ago), licensed MIT. It adds 71 tokens to every session and 501 once invoked, about $0.0004 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-08-31.