xiaohongshu
xiaohongshu
cobol-modernization
This skill provides guidance for translating COBOL programs to modern languages (Python, Java, etc.) while preserving exact behavior. It should be used when tasks involve COBOL-to-modern-language migration, legacy code translation, fixed-width file format handling, or ensuring byte-level compatib...
Full skill instructions
This skill guides the translation of COBOL programs to modern languages while ensuring functional equivalence. COBOL modernization requires meticulous attention to data formats, file handling semantics, and numeric precision to achieve byte-for-byte output compatibility.
Before writing any translation code:
COBOL programs typically use fixed-width record formats. Critical considerations:
9(10) mean 10-digit zero-padded numbersImplement a systematic comparison approach:
diff or cmp to verify exact output match, not just logical equivalenceField Name | PICTURE | Length | Position | Type
ACCOUNT-ID | X(5) | 5 | 1-5 | Alphanumeric
BALANCE | 9(10) | 10 | 6-15 | Numeric
Problem: Working from truncated code views leads to missing logic. Prevention: Always verify the complete source is available. If truncated, use offset reading or request full file.
Problem: Input files don't match expected record lengths. Prevention: Calculate expected length from COBOL definitions. If files differ, investigate whether COBOL handles short records with padding.
Problem: Python's default number-to-string conversion doesn't match COBOL's zero-padded format.
Prevention: Use explicit formatting: f"{value:010d}" for PIC 9(10).
Problem: COBOL's REWRITE updates a record in place; Python file operations differ. Prevention: For indexed files, read entire file, modify in memory, write complete file. Track record positions explicitly.
Problem: Removing backup files before confirming task completion. Prevention: Keep all backups until explicit final verification succeeds.
Problem: Not testing with malformed or edge-case inputs. Prevention: Create explicit test cases for invalid inputs, boundary values, and empty files.
Before declaring translation complete:
Create a reusable comparison workflow:
# Backup original data
for f in *.DAT; do cp "$f" "${f}.orig"; done
# Run COBOL version
./run_cobol.sh
for f in *.DAT; do cp "$f" "${f%.DAT}_COBOL.DAT"; done
# Restore and run Python version
for f in *.DAT.orig; do cp "$f" "${f%.orig}"; done
python program.py
for f in *.DAT; do [[ ! "$f" =~ (COBOL|orig) ]] && cp "$f" "${f%.DAT}_PYTHON.DAT"; done
# Compare outputs
for f in *_COBOL.DAT; do
base="${f%_COBOL.DAT}"
diff -q "${base}_COBOL.DAT" "${base}_PYTHON.DAT" || echo "MISMATCH: $base"
done
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience