Token导航 LogoToken导航

Agent Skill · 研究检索

new-rule-completeness-validator(新规则完整性验证器)

new-rule-completeness-validator 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

new-rule-completeness-validator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 19,823。

总安装 5,451周安装 184GitHub Stars 195下载 2,101核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:new-rule-completeness-validator(新规则完整性验证器)
来源仓库:https://github.com/calcitem/sanmill
仓库路径:skills/new-rule-completeness-validator
安装命令:
npx skills add https://github.com/calcitem/sanmill --skill 'New Rule Completeness Validator'
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/calcitem/sanmill --skill 'New Rule Completeness Validator'

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

添加新的游戏规则是一项系统工作,需要 C++ 引擎和 Flutter UI 之间的仔细协调。

使用此清单可确保: ✓ 没有遗漏必要的文件修改 ✓ C++ 和 Flutter 保持同步 ✓ 向后兼容性没有被破坏 ✓ 性能不受影响 ✓ 测试覆盖率足够 ✓ 本地化完成 请记住:如有疑问,请参阅 docs/guides/ADDING_NEW_GAME_RULES.md 以及现有规则的实施。

每周安装量 – 存储库 方解石/桑米尔 GitHub 之星 195 第一次看到 – 安全审计 Gen Agent Trust Hub 通行证 套接字通行证 斯尼克通行证

来源仓库内路径:skills/new-rule-completeness-validator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/calcitem/sanmill --skill 'New Rule Completenes…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

new-rule-completeness-validator 怎么安装?

在终端执行 npx skills add https://github.com/calcitem/sanmill --skill 'New Rule Completeness Validato…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

new-rule-completeness-validator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

new-rule-completeness-validator 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

new-rule-completeness-validator 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

new-rule-completeness-validator 用的人多吗?

公开数据是累计安装 5,451 次,近一周安装 184 次,下载 2,101 次,GitHub 195 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

new-rule-completeness-validator 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
new-rule-completeness-validator

新规则完整性验证器 · 本页

5,451195只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

New Rule Completeness Validator

Purpose

When adding a new game rule or rule variant to Sanmill, you need to modify multiple files (typically 70-80 files, including ~60 localization files). This skill provides a completeness checklist to ensure no necessary code changes are missed.

Reference: docs/guides/ADDING_NEW_GAME_RULES.md

Use Cases

  • Adding a new game rule variant
  • Adding new game mechanics to existing rules (e.g., new capture rules)
  • Modifying rule structure or parameters
  • Reviewing rule-related pull requests

Architecture Philosophy

Sanmill is configuration-based, not inheritance-based. Rule variants are expressed as data (Rule in C++, RuleSettings in Flutter) and toggled at runtime. Any new mechanics must be gated by booleans/params so existing variants remain untouched and fast.

Quick Overview

  • Estimated time: Simple parameter rule 2-4 hours; new mechanics 6-8 hours
  • Complexity: ⭐⭐⭐ Medium-High
  • Touched files: ~70-80 total (incl. ~60 ARB localization files)

Core Validation Checklist (Required Modifications)

1. C++ Engine Rule Definition

File: src/rule.cpp
  • Added new rule definition to the end of RULES[] array
  • Set all required fields:

- name - Rule name (max 32 chars) - description - Rule description (max 512 chars) - pieceCount, flyPieceCount, piecesAtLeastCount - hasDiagonalLines - Whether diagonal lines exist - Mill formation action and phase flags - Capture rule configs (custodian, intervention, leap) - Flying, draw rules (mayFly, nMoveRule, etc.)

Example structure:

{
  "Your Rule Name",
  "Short description",
  9, 3, 3,                      // pieceCount, flyPieceCount, piecesAtLeastCount
  false,                        // hasDiagonalLines
  MillFormationActionInPlacingPhase::removeOpponentsPieceFromBoard,
  /*mayMoveInPlacingPhase*/ false,
  /*isDefenderMoveFirst*/ false,
  /*mayRemoveMultiple*/ false,
  // ... other fields
  kDefaultCaptureRuleConfig,    // custodian
  kDefaultCaptureRuleConfig,    // intervention
  kDefaultCaptureRuleConfig,    // leap
  /*mayFly*/ true,
  /*nMoveRule*/ 100,
  /*endgameNMoveRule*/ 100,
  /*threefoldRepetitionRule*/ true
}
File: src/rule.h
  • Incremented N_RULES constant (to match new RULES[] length)
  • If new parameters needed, added new fields to Rule struct?
// e.g., if it was 11, now it should be 12
constexpr auto N_RULES = 12;

2. Flutter UI Models

File: lib/rule_settings/models/rule_settings.dart
  • Added new rule variant value to RuleSet enum
  • Created new RuleSettings subclass (e.g., YourNewVariantRuleSettings)
  • All fields in new subclass match 1-to-1 with C++ Rule struct
  • Updated ruleSetDescriptions map with description
  • Updated ruleSetProperties map with default property instance

Example:

enum RuleSet {
  // ... existing variants
  yourNewVariant,  // new
}

class YourNewVariantRuleSettings extends RuleSettings {
  const YourNewVariantRuleSettings({
    // All params must match C++ Rule fields
  }) : super(/* ... */);
}

3. Flutter UI Selection Interface

File: lib/rule_settings/widgets/modals/rule_set_modal.dart
  • Added RadioListTile or similar UI component for selecting new rule
  • UI item correctly references new RuleSet enum value
  • If rule is experimental, marked as "Experimental" in rule_settings_page.dart?

4. Localization (Internationalization)

Files: lib/l10n/intl_*.arb (~60 files)
  • intl_en.arb - Added English translations
  • intl_zh_CN.arb - Added Simplified Chinese translations
  • All other intl_*.arb files - At least copied English version
  • Ran flutter gen-l10n to generate localization code

Key strings:

  • Rule name
  • Rule description
  • Any new UI labels or hints

Conditional Validation Checklist (Based on Mechanic Type)

5. Game Logic Modifications (If Gameplay Changed)

File: src/position.cpp (C++ side)
  • Must modify: If new rule changes placement, movement, or capture logic
  • Used conditional guards for performance: if (!rule.yourFeature) return fastPath(); // new logic
  • Handled all edge cases
File: lib/game_page/services/engine/position.dart (Flutter side)
  • Must mirror logic from C++ position.cpp
  • C++ and Dart game logic remain fully symmetric
  • Implemented _putPiece, _movePiece, _removePiece related logic
Important: User-visible game logic must be symmetrically implemented in both C++ and Dart. Move generation (movegen) is C++ only.

6. Move Generation (C++ Only)

File: src/movegen.cpp
  • If custom movement patterns exist (e.g., special move rules), updated move generation logic?
  • Added conditional guards to avoid affecting other rules?

7. Mill Formation

File: src/mills.cpp
  • If rule has non-standard mill formation, updated this file?

8. Engine Options (If Added New Rule Fields)

File: lib/game_page/services/engine/engine.dart
  • Must modify: If Rule struct gained new fields
  • Added logic in setRuleOptions() method to send new parameters
  • Parameter names match UCI option names
File: src/ucioption.cpp
  • Must modify: If Rule struct gained new fields
  • Added corresponding UCI option definitions
  • Added on_change handlers to apply values to global rule object

Example:

// ucioption.cpp
{"YourNewOption", "false", "bool", {}, on_your_new_option}

void on_your_new_option(Option &o) {
    rule.yourNewField = o.get<bool>();
}

9. FEN Format Extension (Only If Dynamic State Persistence Needed)

When to extend FEN: Only when you must persist dynamic state that cannot be recomputed from the board.
Need to extend if:
  • Need to track capture targets (custodian/intervention)
  • Need to persist temporary user choice (e.g., preferredRemoveTarget)
  • Need to store intermediate multi-step state across moves/undo/search
  • Need history-dependent constraints (e.g., "same piece can't move twice")
Do NOT extend for:
  • ✗ Static rule params (piece counts, hasDiagonalLines, etc.)
  • ✗ Anything derivable from board (piece counts, mills)
  • ✗ Global flags (mayFly, mayRemoveMultiple)
Files: src/position.h, src/position.cpp
  • If FEN extension needed:

- Added new fields in position.h - Added export logic in fen() method - Added parsing logic in set() method - Followed backward compatibility rules: new fields at end, missing fields have safe defaults

File: lib/game_page/services/engine/position.dart
  • Mirrored C++ FEN fields
  • Implemented _getFen() export logic
  • Implemented setFen() parsing logic
Files: tests/test_position.cpp, Flutter integration tests
  • Added FEN round-trip tests (export then reimport, state should match)

10. Evaluation and Search (Rare)

File: src/evaluate.cpp
  • If rule variant requires special evaluation logic, updated?
File: src/search.cpp
  • If rule variant requires special search logic, updated?

Testing Validation Checklist

11. C++ Tests

Files: tests/test_*.cpp
  • Rule loading and bounds tests (set_rule(i) correctly loads new rule)
  • Position/logic unit tests (including new mechanics)
  • If FEN extended, added FEN round-trip tests (tests/test_position.cpp)
  • Ran make test to ensure all tests pass

Run tests:

cd src
make build all
make test

12. Flutter Tests

Widget tests
  • New rule displays correctly in modal
  • Selecting new rule correctly saves and restores
Engine mirror tests
  • Test scenarios cover _putPiece, _movePiece, _removePiece
  • C++ and Dart logic produce same results
Integration tests
  • Select new rule → start new game → verify behavior visible

Run tests:

cd src/ui/flutter_app
flutter test

13. Performance Benchmarks

  • Ran benchmarks (if project has make benchmark)
  • Ensured no performance regression when new feature is off
  • Verified conditional guards enable early exits on hot paths

Build, Format, and Generate

14. Code Formatting

# Format all code
./format.sh
  • C++ code formatted (clang-format)
  • Dart code formatted (dart format)

15. Localization Generation

cd src/ui/flutter_app
flutter gen-l10n
  • Generated localization code without errors

16. Full Build

# C++ build
cd src
make build all

# Flutter build (pick a platform to test)
cd ../src/ui/flutter_app
flutter build apk  # Android
# or
flutter build ios   # iOS
# or
flutter build windows  # Windows
  • All platforms build successfully

Quality & Safety Assurance Checklist

17. Backward Compatibility

  • All existing rule variants remain unchanged
  • All old tests still pass
  • New features don't affect existing game logic (via conditional guards)

18. Performance Parity

  • When new feature is off, no performance regression
  • Hot paths remain efficient (early exits)
  • Benchmarks show acceptable performance

19. Code Symmetry

  • C++ and Dart user-visible logic fully symmetric
  • Same inputs produce same outputs
  • Tests verify symmetry

20. Documentation and Comments

  • Clear docs and comments near each new flag
  • Complex logic has explanatory comments
  • Updated docs/guides/ADDING_NEW_GAME_RULES.md (if needed)

21. Localization Completeness

  • At minimum, includes English (EN) and Simplified Chinese (ZH_CN)
  • Ideally, all ARB files updated
  • All translation strings meaningful with no placeholders

Complete QA Checklist (Summary)

Before submitting PR, confirm all of the following:

  • RULES[] has new entry, N_RULES incremented
  • Flutter RuleSet enum and RuleSettings subclass match C++
  • UI selection interface added, strings localized
  • Game logic uses conditional guards and early exits
  • C++ ↔ Dart position logic symmetric
  • FEN extended if necessary; round-trip tests added
  • If new Rule fields added, engine options updated
  • All tests pass (C++ and Flutter)
  • Benchmarks show no performance drop when feature off
  • Code formatted, builds succeed
  • Documentation and comments clear and complete

Validation Workflow

Phase 1: Planning (1 hour)

  1. Determine specific requirements for rule variant
  2. Determine if simple parameter adjustment or new mechanics needed
  3. List files that need modification

Phase 2: C++ Implementation (2-3 hours)

  1. Modify src/rule.h and src/rule.cpp
  2. If new mechanics needed, modify src/position.cpp, src/movegen.cpp, etc.
  3. If new fields added, update src/ucioption.cpp
  4. Run C++ tests, ensure they pass

Phase 3: Flutter Implementation (2-3 hours)

  1. Modify rule_settings.dart (enum + subclass + mappings)
  2. Modify rule_set_modal.dart (UI selection)
  3. If game logic modified, mirror to position.dart
  4. Update engine.dart's setRuleOptions()
  5. Run Flutter tests, ensure they pass

Phase 4: Localization (30 minutes)

  1. Update intl_en.arb and intl_zh_CN.arb
  2. Batch update other ARB files (can use English initially)
  3. Run flutter gen-l10n

Phase 5: Testing & Validation (1-2 hours)

  1. Run all C++ tests
  2. Run all Flutter tests
  3. Manually test new rule behavior in UI
  4. Check performance benchmarks
  5. Verify backward compatibility

Phase 6: Code Review & Documentation (30 minutes)

  1. Run code formatting
  2. Review all changes
  3. Update docs and comments
  4. Complete QA checklist

Common Pitfalls and Notes

❌ Common Mistakes

  1. Forgot to increment N_RULES

- Symptom: Runtime crash or rule loading failure - Fix: Ensure N_RULES in src/rule.h matches RULES[] length

  1. C++ and Flutter fields don't match

- Symptom: UI-set rule parameters don't take effect - Fix: Ensure RuleSettings fields match Rule struct 1-to-1

  1. Missing UCI options

- Symptom: New Rule field values always default - Fix: Add corresponding options and handlers in ucioption.cpp

  1. Didn't mirror game logic to Dart

- Symptom: UI preview inconsistent with actual game - Fix: Ensure position.dart mirrors position.cpp logic

  1. Incomplete localization

- Symptom: Some languages show placeholders or English - Fix: At minimum complete English and Chinese, others can use English placeholder

  1. Performance regression

- Symptom: Game slower even when not using new feature - Fix: Use conditional guards, ensure early exits

  1. Over-extended FEN

- Symptom: FEN strings too long, hard to debug - Fix: Only extend FEN when must persist dynamic state

✓ Best Practices

  1. Incremental development: Implement C++ first, test, then do Flutter
  2. Frequent testing: Run relevant tests after each file modification
  3. Use conditional guards: Ensure new code doesn't affect existing rules
  4. Maintain symmetry: C++ and Dart logic should be readable side-by-side
  5. Documentation first: Write comments and docs before code
  6. Reference existing rules: Look at other rules in RULES[] as templates

Reference Files and Resources

Core Documentation

  • docs/guides/ADDING_NEW_GAME_RULES.md - Official guide for adding rules (must read)

C++ Files

  • src/rule.h - Rule struct definition
  • src/rule.cpp - RULES[] array
  • src/position.h/.cpp - Game position and logic
  • src/movegen.cpp - Move generation
  • src/ucioption.cpp - UCI options
  • src/mills.cpp - Mill formation logic
  • include/config.h - Default config (rarely modified)

Flutter Files

  • lib/rule_settings/models/rule_settings.dart - Rule models
  • lib/rule_settings/widgets/modals/rule_set_modal.dart - UI selection
  • lib/game_page/services/engine/position.dart - Position mirror
  • lib/game_page/services/engine/engine.dart - Engine communication
  • lib/l10n/intl_*.arb - Localization files

Test Files

  • tests/test_*.cpp - C++ unit tests
  • test/ - Flutter unit and widget tests
  • integration_test/ - Flutter integration tests

Output Format

Validation results should be reported clearly:

✓ [Complete] Core File Modifications
  ✓ src/rule.cpp - RULES[] added
  ✓ src/rule.h - N_RULES incremented
  ✓ rule_settings.dart - RuleSet enum added
  ...

⚠ [Warning] Conditional File Modifications
  ✓ src/position.cpp - Logic updated
  ✗ position.dart - Logic not mirrored (needs fix)
  ...

✓ [Complete] Test Validation
  ✓ C++ tests all passed (25/25)
  ✓ Flutter tests all passed (42/42)
  ...

✗ [Failed] Localization
  ✓ intl_en.arb - Updated
  ✓ intl_zh_CN.arb - Updated
  ✗ Other ARB files - Not updated (needs completion)
  ...

📊 Completion: 75% (15/20 checks passed)
💡 Recommendation: Priority fix position.dart mirror and localization

Summary

Adding a new game rule is a systematic effort requiring careful coordination between the C++ engine and Flutter UI. Using this checklist ensures:

  • ✓ No necessary file modifications are missed
  • ✓ C++ and Flutter stay synchronized
  • ✓ Backward compatibility is not broken
  • ✓ Performance is not affected
  • ✓ Test coverage is adequate
  • ✓ Localization is complete

Remember: When in doubt, refer to docs/guides/ADDING_NEW_GAME_RULES.md and existing rule implementations.

平台分布

windsurf

29.02%
按下载量换算610

Codex

25.32%
按下载量换算532

OpenCode

16.49%
按下载量换算346

Cursor

13.56%
按下载量换算285

Claude Code

7.64%
按下载量换算161

Antigravity

3.77%
按下载量换算79

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills