ecd-template
管理和生成编码规则 SQL 模板。当用户需要创建或修改系统编码规则、业务单号规则、infra_ecd_tp/infra_ecd_dtl SQL 时调用此技能。
Skill by GFigting
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gfigting-ecd-template
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/ecd-template
What's inside
- Skill name
ecd-template- Description
- 管理和生成编码规则 SQL 模板。当用户需要创建或修改系统编码规则、业务单号规则、infra_ecd_tp/infra_ecd_dtl SQL 时调用此技能。
- License
- MIT
- Instructions
- 175 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
---
name: "ecd-template"
description: "管理和生成编码规则 SQL 模板。当用户需要创建或修改系统编码规则、业务单号规则、infra_ecd_tp/infra_ecd_dtl SQL 时调用此技能。"
---
# 编码规则模板技能
## 功能
生成 `infra_ecd_tp`、`infra_ecd_dtl` 编码规则 SQL。
## 默认格式
- 默认业务单号格式:`[业务编码]-yyyyMMdd0001`。
- `[业务编码]` 使用编码类型 ID,如 `COST`、`CGDD`。
- 示例:业务编码 `COST` 生成 `COST-202606040001`。
- 用户不同意默认格式时,要求用户提供完整格式;不要自行猜新格式。
## 规则来源
- `constantFill`:常量填充,如 `COST-`
- `sysDateFill`:系统日期填充
- `zeroFill`:序列流水,输出按 `ecd_len` 补零,如 `0001`
- `dynamicSerialFill`:按前缀动态流水,适合每日/年度重置
- `cascadeSerialFill`:级联流水
- `variableFill`:变量填充
## 生成规则
- 默认拆成三段:业务编码前缀、日期、序列流水。
- 日期使用 Java `SimpleDateFormat`:`yyyyMMdd`,不要写 `YYYYMMDD`。
- 默认 4 位序列:`0001`,使用 `zeroFill`,`ecd_val` 初始值用 `1`。
- 默认不按日期重置;日期只是编码内容的一段。
- 用户明确要求按日期/年度重置时,才使用 `dynamicSerialFill`,并让 `ecd_val` 指向前面已拼出的前缀键,如 `{COST_PREFIX}{COST_DATE}`。
- SQL 要幂等:存在则 `UPDATE`,不存在则 `INSERT ... SELECT ... WHERE NOT EXISTS`。
- 可清理同一 `ecd_tp_id` 下非当前规则明细,但要在注释中说明。
## 推荐模板
```sql
-- 编码规则:[业务编码]-yyyyMMdd0001
-- 生成示例:COST-202606040001
SET @ecd_tp_id := 'COST';
SET @ecd_tp_nm := '费用单';
SET @prefix_dtl_id := CONCAT(@ecd_tp_id, '_PREFIX');
SET @date_dtl_id := CONCAT(@ecd_tp_id, '_DATE');
SET @serial_dtl_id := CONCAT(@ecd_tp_id, '_SERIAL');
INSERT INTO `infra_ecd_tp` (
`ecd_tp_id`, `ecd_tp_nm`, `rmrk`, `status`,
`creator`, `create_time`, `updater`, `update_time`, `deleted`
)
SELECT
@ecd_tp_id, @ecd_tp_nm, CONCAT(@ecd_tp_nm, '编码:', @ecd_tp_id, '-yyyyMMdd0001'), 0,
'1', NOW(), '1', NOW(), b'0'
WHERE NOT EXISTS (
SELECT 1 FROM `infra_ecd_tp`
WHERE `ecd_tp_id` = @ecd_tp_id
AND `deleted` = b'0'
);
UPDATE `infra_ecd_tp`
SET `ecd_tp_nm` = @ecd_tp_nm,
`rmrk` = CONCAT(@ecd_tp_nm, '编码:', @ecd_tp_id, '-yyyyMMdd0001'),
`status` = 0,
`updater` = '1',
`update_time` = NOW()
WHERE `ecd_tp_id` = @ecd_tp_id
AND `deleted` = b'0';
-- 前缀:[业务编码]-
INSERT INTO `infra_ecd_dtl` (
`ecd_dtl_id`, `ecd_tp_id`, `rule_id`, `rule_src`, `sn`,
`ecd_len`, `ecd_val`, `status`,
`creator`, `create_time`, `updater`, `update_time`, `deleted`
)
SELECT
@prefix_dtl_id, @ecd_tp_id, NULL, 'constantFill', 1,
LENGTH(CONCAT(@ecd_tp_id, '-')), CONCAT(@ecd_tp_id, '-'), 0,
'1', NOW(), '1', NOW(), b'0'
WHERE NOT EXISTS (
SELECT 1 FROM `infra_ecd_dtl`
WHERE `ecd_tp_id` = @ecd_tp_id
AND `ecd_dtl_id` = @prefix_dtl_id
AND `deleted` = b'0'
);
UPDATE `infra_ecd_dtl`
SET `rule_id` = NULL,
`rule_src` = 'constantFill',
`sn` = 1,
`ecd_len` = LENGTH(CONCAT(@ecd_tp_id, '-')),
`ecd_val` = CONCAT(@ecd_tp_id, '-'),
`status` = 0,
`updater` = '1',
`update_time` = NOW()
WHERE `ecd_tp_id` = @ecd_tp_id
AND `ecd_dtl_id` = @prefix_dtl_id
AND `deleted` = b'0';
-- 日期:yyyyMMdd
INSERT INTO `infra_ecd_dtl` (
`ecd_dtl_id`, `ecd_tp_id`, `rule_id`, `rule_src`, `sn`,
`ecd_len`, `ecd_val`, `status`,
`creator`, `create_time`, `updater`, `update_time`, `deleted`
)
SELECT
@date_dtl_id, @ecd_tp_id, NULL, 'sysDateFill', 2,
8, 'yyyyMMdd', 0,
'1', NOW(), '1', NOW(), b'0'
WHERE NOT EXISTS (
SELECT 1 FROM `infra_ecd_dtl`
WHERE `ecd_tp_id` = @ecd_tp_id
AND `ecd_dtl_id` = @date_dtl_id
AND `deleted` = b'0'
);
UPDATE `infra_ecd_dtl`
SET `rule_id` = NULL,
`rule_src` = 'sysDateFill',
`sn` = 2,
`ecd_len` = 8,
`ecd_val` = 'yyyyMMdd',
`status` = 0,From GFigting/carry-god, MIT.
More from GFigting/carry-god
- 0.558score
docs-maintainer
GFigting
维护、审阅并同步项目 docs 文档与代码、接口和业务规则。用户提到 docs、文档、项目说明、接口说明、文档同步或文档整理时使用。
SkillAFreshness: AClaude Code +9 - 0.539score
code-review
GFigting
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding…
SkillAFreshness: AClaude Code +9 - 0.539score
grilling
GFigting
Grill the user relentlessly about a plan, decision, or idea.
SkillAFreshness: AClaude Code +9 - 0.519score
framework-optimization
GFigting
Use when improving cg-work's rules, workflows, templates, validators, directory conventions, or framework-native skills; not for project business-code…
SkillBFreshness: BClaude Code +9 - 0.515score
dict-template
GFigting
管理和生成字典 SQL 模板。当用户需要创建或修改系统字典、从枚举提取字典项、生成幂等字典 SQL 时调用此技能。
SkillBFreshness: BClaude Code +9 - 0.515score
menu-template
GFigting
管理和生成菜单 SQL 模板。当用户需要创建或修改系统菜单、按钮权限、父级菜单关联 SQL 时调用此技能。
SkillBFreshness: BClaude Code +9 - 0.515score
perm-template
GFigting
管理和生成角色-菜单权限关联 SQL 模板。当用户需要将菜单/按钮权限分配给角色时调用此技能。
SkillBFreshness: BClaude Code +9 - 0.499score
codebase-design
GFigting
Shared vocabulary for designing deep modules.
SkillBFreshness: BClaude Code +9 - 0.499score
domain-modeling
GFigting
Build and sharpen a project's domain model.
SkillBFreshness: BClaude Code +9 - 0.498score
review
GFigting
Pre-landing PR review.
SkillBFreshness: BClaude Code +9 - 0.283score
reconciliation-tax-fix
GFigting
No description from the publisher yet.
SkillBFreshness: BClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 4, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/GFigting/carry-god
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from GFigting
- 0.558score
docs-maintainer
GFigting
维护、审阅并同步项目 docs 文档与代码、接口和业务规则。用户提到 docs、文档、项目说明、接口说明、文档同步或文档整理时使用。
SkillAFreshness: AClaude Code +9 - 0.539score
code-review
GFigting
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this repo's documented coding…
SkillAFreshness: AClaude Code +9 - 0.539score
grilling
GFigting
Grill the user relentlessly about a plan, decision, or idea.
SkillAFreshness: AClaude Code +9 - 0.519score
framework-optimization
GFigting
Use when improving cg-work's rules, workflows, templates, validators, directory conventions, or framework-native skills; not for project business-code…
SkillBFreshness: BClaude Code +9 - 0.515score
dict-template
GFigting
管理和生成字典 SQL 模板。当用户需要创建或修改系统字典、从枚举提取字典项、生成幂等字典 SQL 时调用此技能。
SkillBFreshness: BClaude Code +9 - 0.515score
perm-template
GFigting
管理和生成角色-菜单权限关联 SQL 模板。当用户需要将菜单/按钮权限分配给角色时调用此技能。
SkillBFreshness: BClaude Code +9
Cite this page
ecd-template skill. Agent Mart. https://agentmart.dev/skills/gfigting-ecd-template (last updated 2026-10-24)