Agent skill
階層IDの競合安全な採番(counters 方式)
REQ/TSK/SUB の三階層IDを同時作成でも重複させないため、counters(scope,last) を トランザクションでインクリメントして採番する手法。ユニーク違反時は指数バックオフでリトライする。
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/idcounters
SKILL.md
使い方
- scope 例:
REQ,REQ-001.TSK,REQ-001.TSK-001.SUB - 1 Tx 内で
SELECT ... FOR UPDATE→UPDATE last=last+1 - 失敗(ユニーク違反)が発生した場合はバックオフしてリトライ
手順(擬似)
- BEGIN
SELECT last FROM counters WHERE scope=:scope FOR UPDATEUPDATE counters SET last=last+1 WHERE scope=:scope- COMMIT
hier_id = f"{scope}-{last:03}"を生成
例
examples/id_alloc.sql
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?