Agent skill

Yida DB Seq Fix

by openyida in openyida/openyida

PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。

MITAuto-check passedDatabases

Install Yida DB Seq Fix

skills CLI
$ npx skills add openyida/openyida --skill yida-db-seq-fix -a claude-code

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

GitHub CLI
$ gh skill install openyida/openyida yida-db-seq-fix --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/openyida/openyida.git skills-src && mkdir -p .claude/skills && cp -r skills-src/yida-skills/skills/yida-db-seq-fix .claude/skills/yida-db-seq-fix && 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
yida-db-seq-fix
GitHub stars
220
Token cost
~552 tokens
SKILL.md length
131 words
Files
1
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。

  • Works in 3 steps: 检测 8 个核心表的 Sequence 当前值 → 对比表中实际最大 ID → 自动将 Sequence 起始值设置为 max(id) + 1
  • Databases work in your project
  • SKILL.md covers 严格禁止 (NEVER DO), 严格要求 (MUST DO), 适用场景 and 背景, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Yida DB Seq Fix is an agent skill from openyida/openyida. PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。

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

It sits in Databases. It works with PostgreSQL. The repository describes itself as: Your own personal YiDA AI assistant! The licence is MIT.

When your agent uses it

  • Databases work in your project

Example prompts

  • “Sequence”
  • “自增ID错误”
  • “db-seq-fix”
  • “/yida-db-seq-fix”

Workflow steps

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

  1. 检测 8 个核心表的 Sequence 当前值
  2. 对比表中实际最大 ID
  3. 自动将 Sequence 起始值设置为 max(id) + 1

What it can do on your machine

Read from SKILL.md and the folder at commit 3dd4693. 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 bash).

    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

Yida DB Seq Fix loads about 552 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 131 words of instructions outside code blocks.

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

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 openyida/openyida at commit 3dd4693, republished under its MIT licence (© openyida). 131 words, ~552 tokens.

Download SKILL.mdSave it as .claude/skills/yida-db-seq-fix/SKILL.md (or your agent's skills folder).
name
yida-db-seq-fix
description
PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。

PostgreSQL Sequence 自动修复

严格禁止 (NEVER DO)

  • 不要在生产环境直接执行 --fix,必须先用 --dry-run 预览
  • 不要在未确认数据库连接的情况下执行修复操作
  • 不要跳过 Sequence 检测直接修改数据库

严格要求 (MUST DO)

  • 执行修复前必须先用 --dry-run 确认影响范围
  • 修复完成后必须验证 Sequence 值是否正确更新
  • 记录修复操作日志,便于问题追溯

适用场景

用户意图触发条件
Sequence 起始值检测环境检测自动建表后,需要验证 Sequence 配置
主键冲突修复插入数据时报 duplicate key value violates unique constraint 错误
预防性检查数据迁移后,确保 Sequence 值正确

背景

宜搭环境检测自动建表时,PostgreSQL 的 Sequence 默认使用 START 1。如果数据迁移时已有数据,Sequence 起始值可能小于已有数据的最大 ID,导致插入时报主键冲突错误。

此工具用于:

  1. 检测 8 个核心表的 Sequence 当前值
  2. 对比表中实际最大 ID
  3. 自动将 Sequence 起始值设置为 max(id) + 1

命令

预览模式(推荐先执行)
bash
openyida db-seq-fix --dry-run

输出示例:

📋 Sequence 检测报告

表名                    当前值    最大ID    状态
─────────────────────────────────────────────
form_component          1         1000      ⚠️ 需要修复
form_definition         1         500       ⚠️ 需要修复
...

💡 使用 openyida db-seq-fix --fix 执行自动修复
执行修复
bash
openyida db-seq-fix --fix

输出示例:

✅ Sequence 修复完成

表名                    修复前    修复后
────────────────────────────────────────
form_component          1         1001
form_definition         1         501
...

监控的表

表名Sequence 名称
form_componentform_component_id_seq
form_definitionform_definition_id_seq
form_instanceform_instance_id_seq
form_permissionform_permission_id_seq
process_definitionprocess_definition_id_seq
process_instanceprocess_instance_id_seq
process_taskprocess_task_id_seq
system_logsystem_log_id_seq

参数说明

参数说明
--dry-run仅检测,不执行修复,输出检测报告
--fix执行自动修复,将 Sequence 起始值设置为 max(id) + 1

错误处理

错误信息原因处理方式
数据库连接失败数据库配置错误或服务不可用检查数据库连接配置
表不存在表尚未创建先执行环境检测建表
Sequence 不存在Sequence 未正确创建手动创建 Sequence

注意事项

  1. 生产环境谨慎操作:建议在低峰期执行,避免影响业务
  2. 备份数据:修复前建议备份数据库
  3. 验证结果:修复后执行测试插入,确认问题已解决
  4. 日志记录:修复操作会记录到系统日志,便于追溯

© openyida, MIT. 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 yida-skills/skills/yida-db-seq-fix of openyida/openyida.

Open the folder on GitHubat commit 3dd4693

Compare with similar skills

Yida DB Seq Fix 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.

Yida DB Seq Fix compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Yida DB Seq Fix this skillopenyida/openyida220—~552Automated safety check: PassMIT
Backend Test WorkerCorrectRoadH/OpenTickly306—~1.3kAutomated safety check: PassAGPL-3.0
Ef Core Migrationsjihadkhawaja/Egroo178—~673Automated safety check: PassApache-2.0
Add Oliphaunt Extensionf0rr0/oliphaunt105—~1.4kAutomated safety check: PassMIT
Diagnose Cloud SessionFreakStudioCN/mpy-hardware-extension132—~809Automated safety check: NotesCustom licence
DB AdminEliasOulkadi/shokunin114—~2kAutomated safety check: NotesMIT

Similar skills

  • Backend Test Worker

    CorrectRoadH/OpenTickly

    Build and verify real-Postgres Go tests and thin transport smoke for tracking behavior.

    306 GitHub stars~1.3k tokensUpdated 6 days ago
    DatabasesAuto-check passed
  • Ef Core Migrations

    jihadkhawaja/Egroo

    Handle EF Core schema changes in Egroo. An agent skill from jihadkhawaja/Egroo.

    178 GitHub stars~673 tokensUpdated 6 mo ago
    DatabasesAuto-check passed
  • Add, update, or remove an Oliphaunt PostgreSQL contrib or external extension, including source pins, build recipes, target support, SDK metadata, release products, carrier identities, and package…

    105 GitHub stars~1.4k tokensUpdated today
    DatabasesAuto-check passed
  • Diagnose Cloud Session

    FreakStudioCN/mpy-hardware-extension

    用户报告 Blockless 扩展在云端实测时出问题(卡死/灰屏/跳步/构建失败),但本地复现不了、日志不在本地文件里时,用这个从云端托管数据库拉真实 session 定位症状与根因 / Use when a user reports an in-product Blockless bug from live cloud-backend testing and the real session…

    132 GitHub stars~809 tokensUpdated 10 days ago
    DatabasesAuto-check: notes
  • DB Admin

    EliasOulkadi/shokunin

    PostgreSQL database administration — backup/restore (pgdump, PITR, WAL archiving), health monitoring (connections, bloat, cache hit ratio, dead tuples), connection pooling (PgBouncer), replication…

    114 GitHub stars~2k tokensUpdated 3 days ago
    DatabasesAuto-check: notes
  • Postgresql Table Design

    ynulihao/AgentSkillOS

    Design a PostgreSQL-specific schema. An agent skill from ynulihao/AgentSkillOS.

    617 GitHub starsUsed in 15 repos~4k tokens
    DatabasesAuto-check passed

More from openyida/openyida

All 58 skills in this repo
  • Yida Canvas Custom Page

    openyida/openyida

    宜搭自定义页面开发规范,使用 YidaCodeCanvas 组件实现现代 React18 自定义页面。用于官网、看板、工作台、列表、详情、门户壳、可视化、hooks 交互、表单入口,以及需要门户组件、数据管理视图、成员、部门或上传组件的场景;发布层自动注入 yida/utils window 桥。

    220 GitHub stars~4.3k tokensUpdated 8 days ago
    Auto-check passed
  • Openyida Release

    openyida/openyida

    快速发布 OpenYida npm 正式版或测试版。用户说“发布正式版”“发布测试版”“发 beta”或要求按当天日期生成版本 tag 时使用;不用于宜搭应用或自定义页面发布。

    220 GitHub stars~520 tokensUpdated 8 days ago
    Auto-check passed
  • Yida Design Plan

    openyida/openyida

    Plan 模式的视觉设计分支。基于需求选择视觉方向,再结合业务页面规划维护 build-plan.json 的 visualStyle,供 CLI 派生 design.md。

    220 GitHub stars~756 tokensUpdated 8 days ago
    Auto-check passed
  • Prevent stale local OpenYida custom page source from overwriting live designer edits.

    220 GitHub stars~1.2k tokensUpdated 8 days ago
    Auto-check passed
  • Codemap

    openyida/openyida

    Generate, update, or drift-check agent-facing CodeMaps as progressive code terrain indexes for projects, features, capabilities, functions, modules, or bug chains.

    220 GitHub stars~1k tokensUpdated 8 days ago
    Auto-check passed
  • Sdd Riper One Light

    openyida/openyida

    面向 GPT-5.5 等强模型和熟练用户的轻量 AI Agent Harness / checkpoint-driven coding skill。默认用户已经把任务切到基本可执行的最小混沌单元;模型自行分解、探索与推进,人类通过最终目标、最小 spec、复述、checkpoint、证据验证与回写来低干扰控盘。

    220 GitHub stars~1.5k tokensUpdated 8 days ago
    Auto-check passed

Works with

Categories

Questions about Yida DB Seq Fix

What does Yida DB Seq Fix do?

PostgreSQL Sequence 自动修复工具。检测并修复宜搭环境检测自动建表时 Sequence 起始值问题,避免主键冲突。当用户提到"Sequence"、"主键冲突"、"自增ID错误"、"db-seq-fix"时触发。. Yida DB Seq Fix is an agent skill from openyida/openyida.

When should I use Yida DB Seq Fix?

Yida DB Seq Fix fits situations like: databases work in your project.

How do I install Yida DB Seq Fix in Claude Code?

Run `npx skills add openyida/openyida --skill yida-db-seq-fix -a claude-code`. Or copy the skill folder (yida-skills/skills/yida-db-seq-fix in openyida/openyida) into .claude/skills/yida-db-seq-fix in your project. Claude Code loads it when a task matches its description.

How do I install Yida DB Seq Fix in Codex?

Run `npx skills add openyida/openyida --skill yida-db-seq-fix -a codex`. Or copy the skill folder (yida-skills/skills/yida-db-seq-fix in openyida/openyida) into .agents/skills/yida-db-seq-fix in your project. Codex loads it when a task matches its description.

Can I use Yida DB Seq Fix 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 openyida/openyida --skill yida-db-seq-fix -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/yida-db-seq-fix, .gemini/skills/yida-db-seq-fix, .github/skills/yida-db-seq-fix and .opencode/skills/yida-db-seq-fix in your project.

What does Yida DB Seq Fix need to run?

SKILL.md names no scripts, command-line tools or credentials: Yida DB Seq Fix is instructions for the agent only.

Does Yida DB Seq Fix 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 Yida DB Seq Fix 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 Yida DB Seq Fix use?

Yida DB Seq Fix is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Yida DB Seq Fix use?

About 552 tokens (SKILL.md is roughly 2.2k 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 Yida DB Seq Fix?

Skills that share tags, products or a category with Yida DB Seq Fix: Backend Test Worker (CorrectRoadH/OpenTickly, 306 stars), Ef Core Migrations (jihadkhawaja/Egroo, 178 stars), Add Oliphaunt Extension (f0rr0/oliphaunt, 105 stars) and Diagnose Cloud Session (FreakStudioCN/mpy-hardware-extension, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Yida DB Seq Fix?

openyida (a GitHub organization) maintains it in openyida/openyida, which has 220 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on September 30, 2026.

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