Agent skill

Comp3 Packed Decimal

by benchflow-ai in benchflow-ai/skillsbench

Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later…

Apache-2.0Auto-check passed

Install Comp3 Packed Decimal

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill comp3-packed-decimal -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench comp3-packed-decimal --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal .claude/skills/comp3-packed-decimal && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
comp3-packed-decimal
GitHub stars
1.8k
Token cost
~1.1k tokens
SKILL.md length
438 words
Files
1
Skills in repo
178
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later…

  • Works in 3 steps: The COMP-3 column is decoded correctly… → But when the per-account accumulator row… → Every account is then summed up…
  • SKILL.md covers Declaring COMP-3 in an FD, Carrying the value through…, Verification tip and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Comp3 Packed Decimal is an agent skill from benchflow-ai/skillsbench. Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later arithmetic. Useful when an input record holds a balance, rate, or carry-forward as packed decimal rather than a printable digit string.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

Example prompts

  • “/comp3-packed-decimal”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. The COMP-3 column is decoded correctly in the FD-side record (the
  2. But when the per-account accumulator row is created later in the
  3. Every account is then summed up correctly from the detail tape but the

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cobol).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Comp3 Packed Decimal loads about 1.1k tokens when it runs. Until then it costs about 87 tokens; SKILL.md has 438 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 438 words, ~1,069 tokens.

Download SKILL.mdSave it as .claude/skills/comp3-packed-decimal/SKILL.md (or your agent's skills folder).
name
comp3-packed-decimal
description
Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later arithmetic. Useful when an input record holds a balance, rate, or carry-forward as packed decimal rather than a printable digit string.

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:

NibbleMeaning
Cpositive (some shops emit F for unsigned, but C is standard for SIGNED)
Dnegative
Funsigned / 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.

cobol
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.
Show full SKILL.md (226 more words)Show less

Carrying the value through working storage

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

  1. The COMP-3 column is decoded correctly in the FD-side record (the master lookup returns the right number).
  2. But when the per-account accumulator row is created later in the program, the carry-forward seed is initialised to a constant (often zero) instead of being copied from the lookup result.
  3. Every account is then summed up correctly from the detail tape but the opening balance is silently dropped at output time.

The cure is structural, not a single magic line: when you allocate a new accumulator row, seed every column that has a meaningful starting value — including the decoded carry-forward — rather than leaving it at its INITIALIZE/VALUE ZERO default. Pseudocode with placeholder names (adapt to your own record and table identifiers):

cobol
       *> placeholders: <new-row> is the freshly allocated accumulator,
       *> <decoded-carry> is the COMP-3 value from the master lookup.
       IF row-not-yet-present
           allocate <new-row>
           MOVE <account-key>   TO key-of   (<new-row>)
           MOVE <currency>      TO ccy-of   (<new-row>)
           MOVE <decoded-carry> TO carry-of (<new-row>)   *> seed, don't zero
           MOVE <period-delta>  TO delta-of (<new-row>)
       END-IF

The point is to recognise which fields need a non-zero seed at row creation; the exact MOVE targets depend on how your program names its balance table.

Verification tip

od -An -tx1 ACCT.MASTER | head and confirm bytes 11-17 of one record match the expected packed nibbles for that account's known opening balance. A few hand-decoded rows are usually enough to confirm both the FD declaration and the carry-through logic.

References

  • IBM Enterprise COBOL Language Reference -- "USAGE PACKED-DECIMAL / COMP-3"
  • GnuCOBOL documentation on USAGE clauses and arithmetic on packed fields

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Comp3 Packed Decimal next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Comp3 Packed Decimal compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Comp3 Packed Decimal this skillbenchflow-ai/skillsbench1.8k—~1.1kAutomated safety check: PassApache-2.0
Evm Token Decimalsaffaan-m/ECC275k2 repos~997Automated safety check: PassMIT
Evm Token Decimalsaffaan-m/ECC275k—~814Automated safety check: PassMIT
Evm Token Decimalsaffaan-m/ECC275k—~762Automated safety check: PassMIT
Numerical Integrationparcadei/Continuous-Claude-v33.9k1 repos~948Automated safety check: NotesMIT
Analyzing Packed Malware With Upx Unpackermukul975/Anthropic-Cybersecurity-Skills34k—~3kAutomated safety check: PassApache-2.0

Similar skills

  • Evm Token Decimals

    affaan-m/ECC

    Prevent silent decimal mismatch bugs across EVM chains. An agent skill from affaan-m/ECC.

    275k GitHub starsUsed in 2 repos~997 tokens
    Backend & APIsAuto-check passed
  • Evm Token Decimals

    affaan-m/ECC

    EVMチェーン全体でサイレントな小数点不一致バグを防ぐ。ランタイムでの小数点照会、チェーン対応キャッシング、ブリッジドトークンの精度ドリフト、ボット・ダッシュボード・DeFiツール向けの安全な正規化をカバーします。

    275k GitHub stars~814 tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Evm Token Decimals

    affaan-m/ECC

    防止跨EVM链的静默小数不匹配错误。涵盖运行时小数查找、链感知缓存、桥接代币精度漂移以及面向机器人、仪表盘和DeFi工具的安全归一化。

    275k GitHub stars~762 tokensUpdated 3 days ago
    Backend & APIsAuto-check passed
  • Numerical Integration

    parcadei/Continuous-Claude-v3

    Problem-solving strategies for numerical integration in numerical methods

    3.9k GitHub starsUsed in 1 repo~948 tokens
    Research & ScienceAuto-check: notes
  • Analyzing Packed Malware With Upx Unpacker

    mukul975/Anthropic-Cybersecurity-Skills

    Identifies and unpacks UPX-packed malware samples, including binaries with modified UPX magic bytes or headers that block automated decompression, to recover the original executable for static…

    34k GitHub stars~3k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Numerical Methods

    brycewang-stanford/Auto-Empirical-Research-Skills

    Numerical algorithms and computational techniques for statistics

    4.5k GitHub stars~1.9k tokensUpdated 3 days ago
    Research & ScienceAuto-check passed

More from benchflow-ai/skillsbench

All 178 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Questions about Comp3 Packed Decimal

What does Comp3 Packed Decimal do?

Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later…. Comp3 Packed Decimal is an agent skill from benchflow-ai/skillsbench. Reference for COBOL COMP-3 (packed decimal / BCD) numeric storage -- layout on disk, declaring it in the FD, and pitfalls when carrying the decoded value through working storage and into later arithmetic.

How do I install Comp3 Packed Decimal in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill comp3-packed-decimal -a claude-code`. Or copy the skill folder (tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal in benchflow-ai/skillsbench) into .claude/skills/comp3-packed-decimal in your project. Claude Code loads it when a task matches its description.

How do I install Comp3 Packed Decimal in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill comp3-packed-decimal -a codex`. Or copy the skill folder (tasks-extra/cobol-gl-batch-reconcile/environment/skills/comp3-packed-decimal in benchflow-ai/skillsbench) into .agents/skills/comp3-packed-decimal in your project. Codex loads it when a task matches its description.

Can I use Comp3 Packed Decimal in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill comp3-packed-decimal -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/comp3-packed-decimal, .gemini/skills/comp3-packed-decimal, .github/skills/comp3-packed-decimal and .opencode/skills/comp3-packed-decimal in your project.

What does Comp3 Packed Decimal need to run?

SKILL.md names no scripts, command-line tools or credentials: Comp3 Packed Decimal is instructions for the agent only.

Does Comp3 Packed Decimal access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Comp3 Packed Decimal safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Comp3 Packed Decimal use?

Comp3 Packed Decimal is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Comp3 Packed Decimal use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Comp3 Packed Decimal?

Skills that share tags, products or a category with Comp3 Packed Decimal: Evm Token Decimals (affaan-m/ECC, 275k stars), Evm Token Decimals (affaan-m/ECC, 275k stars), Evm Token Decimals (affaan-m/ECC, 275k stars) and Numerical Integration (parcadei/Continuous-Claude-v3, 3.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Comp3 Packed Decimal?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 178 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.