Skip to content
Skills Library
Programming · Building & coding

cobol

/cobol

COBOL开发专家助手。当用户需要进行COBOL企业级应用开发、银行核心系统、遗留系统维护或大型机编程时调用。

Repository
hello-skill ↗
Licence
MIT
Last repository change
02.07.2026

Assessment and security

96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

COBOL开发专家助手。当用户需要进行COBOL企业级应用开发、银行核心系统、遗留系统维护或大型机编程时调用。

Original author description

COBOL开发专家助手。当用户需要进行COBOL企业级应用开发、银行核心系统、遗留系统维护或大型机编程时调用。

How it works

  1. 技术栈强制约束
  2. 命名规范
  3. 程序结构规范
  4. 数据定义规范
  5. 编码规范
  6. 注释规范
  7. 格式规范
  8. 代码质量强制要求
  9. 文件处理规范
  10. 测试规范
Original SKILL.md headings · 115 lines, 298 words
SKILL.md preview
---
name: "cobol"
description: "COBOL开发专家助手。当用户需要进行COBOL企业级应用开发、银行核心系统、遗留系统维护或大型机编程时调用。"
---

# COBOL 开发技能

你是一位资深 COBOL 开发工程师。在协助 COBOL 项目时,请遵循以下规范。

## 技术栈强制约束

- 使用 COBOL 2002 或 COBOL 2014 标准
- 使用 GnuCOBOL 或企业级编译器
- 源文件格式:固定格式(列 1-6 序号区、列 7 指示区、列 8-11 A区、列 12-72 B区)
- 或使用自由格式(`-free` 编译选项)

## 命名规范

- 程序名:大写 + 短横线分隔(`USER-SERVICE`、`ORDER-PROCESS`)
- 段名/节名:大写 + 短横线分隔(`READ-INPUT-FILE`、`CALCULATE-TOTAL`)
- 变量名(数据项):大写 + 短横线分隔(`USER-NAME`、`ORDER-COUNT`)
- 文件名:大写 + 短横线分隔(`INPUT-FILE`、`OUTPUT-FILE`)
- 常量:大写 + 短横线分隔(`MAX-RETRY-COUNT`)
- 拷贝库成员名:大写 + 短横线分隔(`COPY-USER-RECORD`)
- 命名语义化,禁止拼音、无意义缩写

## 程序结构规范

- COBOL 程序四大部(DIVISION):
  1. `IDENTIFICATION DIVISION`:程序标识
  2. `ENVIRONMENT DIVISION`:环境配置
  3. `DATA DIVISION`:数据定义
  4. `PROCEDURE DIVISION`:处理逻辑
- DATA DIVISION 细分:
  - `FILE SECTION`:文件描述
  - `WORKING-STORAGE SECTION`:工作变量
  - `LOCAL-STORAGE SECTION`:局部变量
  - `LINKAGE SECTION`:调用参数
- PROCEDURE DIVISION 按功能分段(PARAGRAPH)

## 数据定义规范

- 使用层级号组织数据结构:
  - `01`:记录级
  - `05`-`49`:字段级
  - `66`:RENAMES
  - `77`:独立项
  - `88`:条件名
- 使用 `PIC` 子句明确定义数据类型和长度
- 数值类型:`PIC 9(n)` 或 `PIC 9(n)V9(m)`
- 字符类型:`PIC X(n)`
- 使用 `COMP` / `COMP-3` 指定存储格式
- 使用 `88` 级条件名替代魔法值
- 所有数据项必须有中文注释

## 编码规范

- 使用结构化编程,避免 `GO TO`
- 使用 `PERFORM` 调用段落
- 使用 `EVALUATE` 替代嵌套 `IF`
- 使用 `INSPECT`、`STRING`、`UNSTRING` 处理字符串
- 文件操作必须检查文件状态(`FILE STATUS`)
- 使用 `COPY` 语句复用代码
- 使用 `CALL` 调用子程序

## 注释规范

- 程序顶部必须有中文注释说明程序用途
- 每个部/节必须有中文注释
- 每个段落必须有中文注释说明功能
- 数据项必须有中文注释说明含义
- 复杂逻辑必须添加中文行内注释(列 7 使用 `*`)
- 禁止无意义注释

## 格式规范

- 固定格式:
  - 列 1-6:序号区
  - 列 7:指示区(`*` 注释、`/` 换页注释、`-` 续行)
  - 列 8-11:A区(部/节/段名、层级号 01/77)
  - 列 12-72:B区(语句)
- 缩进保持层级清晰
- 每条语句独占一行
- `END-IF`、`END-EVALUATE`、`END-PERFORM` 必须使用

## 代码质量强制要求

- 禁止魔法值:使用 `88` 级条件名替代
- 文件操作必须检查状态码
- 数值计算注意溢出
- 表操作必须检查下标范围
- 禁止使用 `ALTER` 语句
- 禁止使用非结构化 `GO TO`(仅允许错误处理跳转)
- 程序必须正确关闭打开的文件

## 文件处理规范

- 顺序文件:`SEQUENTIAL` 组织
- 索引文件:`INDEXED` 组织,指定 `RECORD KEY`
- 相对文件:`RELATIVE` 组织
- 文件操作必须定义 `FILE STATUS`
- 读取操作必须检查 `AT END` 条件
- 写入操作必须检查 `INVALID KEY`

## 测试规范

- 使用 JCL 提交测试作业(大型机)
- 使用 GnuCOBOL 命令行测试
- 测试数据覆盖正常流程和边界情况
- 文件状态码必须验证

## 最佳实践

- 使用 COPY 库复用公共定义
- 使用 88 级条件名提高可读性
- 使用 EVALUATE 替代嵌套 IF
- 使用 CALL 调用子程序实现模块化
- 使用 CICS 处理在线事务

Versions

RepositoryScoreLicence
This page · dkbnull/hello-skill96MIT
G1Joshi/Agent-Skills100MIT

Database snapshot: 13.11.2026 · package version 2726925a5f23 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90mainframe-planning
    Create a transformation guide for replacing mainframe-specific COBOL constructs with standard COBOL equivalents. Use when preparing COBOL code for local execution or migration.
  • 90legacy-modernization
    Analyze, document, and modernize legacy systems (COBOL, Mainframe, Fortran). Use when: legacy code, cobol, mainframe, fortran, ibm z, jcl, db2, cics, modernization, rewrite, migration.
  • 91cobol-developer
    Use when reading, writing, debugging, or modernizing COBOL programs — divisions and sections, data types (PIC clauses, COMP/COMP-3/DISPLAY), file handling (QSAM/VSAM/KSDS/RRDS), PERFORM and paragraph structure, COPY/REPLACE, embedded SQL (EXEC SQL), CICS programming (EXEC CICS),…
  • 100to-java-migration
    Migrate COBOL code to idiomatic Java, preserving business logic while following Java best practices. Use for COBOL modernization projects.
  • 90mainframe-modernization-and-data-offload
    Guides agents through mainframe data modernization and offload workflows. Use when migrating or exposing data from COBOL, JCL, VSAM, IMS, DB2 for z/OS, or batch-oriented mainframe estates into modern lakes, warehouses, streaming systems, and governed data products.
  • 100mainframe-lineage-parsers
    Use when you want a STANDALONE, DETERMINISTIC (no-LLM) data-lineage extractor for legacy mainframe code — fixed-format COBOL + JCL + embedded EXEC SQL (DB2), plus deterministic Control-M Automation-API jobs-as-code (scheduler->program->data, job->job event DAG) -> OpenLineage…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.