comp3-packed-decimal

comp3-packed-decimal is a skill for Claude Code, Codex from benchflow-ai/skillsbench. It costs 72 tokens per session (1,158 once invoked), scanned A, original, Apache-2.0.

A reference for COMP-3, a COBOL format that stores decimal numbers in compact binary-coded bytes, including their sign and decimal digits.

In plain words
What is it for?
It is for defining COMP-3 fields in COBOL file records, calculating their byte size, decoding their sign, and carrying the values safely into later calculations.
Why use it?
It helps prevent incorrect field definitions that make stored balances, rates, or amounts appear as unreadable data or produce wrong arithmetic.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for defining COMP-3 fields in COBOL file records, calculating their byte size, decoding their sign, and carrying the values safely into later calculations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/benchflow-ai/skillsbench/comp3-packed-decimal
About the project

SkillsBench is a benchmark for measuring how effectively AI agents use modular skills—folders containing instructions, scripts, and resources—to complete specialized tasks. It helps researchers and developers evaluate both skill quality and agent behavior, including tasks that require combining multiple skills. The catalogue’s skills and instructions are evaluated as part of this workflow.

benchflow-ai/skillsbench · 1,748 stars · on GitHub · skillsbench.ai

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 benchflow-ai/skillsbench --skill comp3-packed-decimal
Clone the repo
git clone --depth 1 https://github.com/benchflow-ai/skillsbench

Made for: Claude Code, 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 comp3-packed-decimal

README.md
[![agentmods](https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/comp3-packed-decimal.svg)](https://agentmods.dev/skills/benchflow-ai/skillsbench/comp3-packed-decimal)
Your own site
<a href="https://agentmods.dev/skills/benchflow-ai/skillsbench/comp3-packed-decimal"><img src="https://agentmods.dev/badge/skills/benchflow-ai/skillsbench/comp3-packed-decimal.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,158 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00072 $0.01158
Opus 5 $0.00036 $0.00579
Sonnet 5 $0.00014 $0.00232
Haiku 4.5 $0.00007 $0.00116

Measured 8d ago against content hash 729203ed0047, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

comp3-packed-decimal 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 8d 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.

tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal/SKILL.md · 110 lines

How it starts

The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.

COMP-3 / packed decimal storage

USAGE COMP-3 (a.k.a. PACKED-DECIMAL) stores a signed numeric field as binary-coded-decimal nibbles: each byte holds two decimal digits, except the last byte whose low nibble is the sign:

PIC S9(11)V99 USAGE COMP-3
+--+--+--+--+--+--+--+
|D1|D2|D3|D4|D5|D6|D7|   7 bytes total for 13 digits
+--+--+--+--+--+--+--+
              ^^-- sign nibble in the LOW half of the last byte

Bytes-on-disk = ceil((digit_count + 1) / 2). For PIC S9(11)V99 that is ceil(14 / 2) = 7 bytes. The high nibble of the first byte holds the first decimal digit; the implied decimal point is not stored.

Sign nibbles:

Nibble Meaning
C positive (some shops emit F for unsigned, but C is standard for SIGNED)
D negative
F unsigned / non-S PIC

Declaring COMP-3 in an FD

The record layout must match the byte budget. If the data in the file is packed but you declare the field as PIC X(n) or as an unpacked decimal, the COBOL runtime will not decode it and the value will look like binary garbage when displayed.

FD  MAST-FILE
    RECORD CONTAINS 80 CHARACTERS.
01  MAST-REC.
    05  M-ACCT     PIC X(6).
    05  M-TYPE     PIC X.
    05  M-STATUS   PIC X.
    05  M-CCY      PIC X(3).
    05  M-CARRY    PIC S9(11)V99 USAGE COMP-3.   *> 7 bytes
    05  FILLER     PIC X(62).                    *> remainder of 80

Use a runtime check: cobc -x -free -o prog PROG.cbl && ./prog and DISPLAY one record's COMP-3 field before relying on it. Common mistakes:

  • Forgetting the USAGE COMP-3 clause -> the field is read as 7 zoned ASCII characters; values look like control characters.
  • Wrong digit count -> the byte budget changes and subsequent fields slide.
  • Moving COMP-3 directly into a PIC X(7) workspace -> the bytes copy but no arithmetic translation happens; the value is unusable.

Carrying the value through working storage

A common defect when there is an opening balance / carry-forward column:

Read the full file on GitHub · 110 lines

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. 8d ago First seen · 110 lines · 72 tokens per session scan A 729203ed0047

Subscribe to this mod's changes

comp3-packed-decimal is a skill published in the GitHub repository benchflow-ai/skillsbench (1,748 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 72 tokens to every session and 1,158 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-30.