بنقرة واحدة
new-board
Add a new preset board to PRESET_TEMPLATES. Use when: adding a board, creating a template, new preset.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Add a new preset board to PRESET_TEMPLATES. Use when: adding a board, creating a template, new preset.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | new-board |
| description | Add a new preset board to PRESET_TEMPLATES. Use when: adding a board, creating a template, new preset. |
| argument-hint | Board name + role list (e.g., Wolf King Seer 4villagers 4wolves seer+witch+hunter+guard) |
输出语言:执行本 skill 过程中,所有面向用户的输出(进度报告、询问、完成通知、错误提示)一律使用中文。
End-to-end addition of a preset board to PRESET_TEMPLATES, from collecting requirements to passing verification.
| Required Field | Description | Example |
|---|---|---|
| Board name | Chinese name (typically 3-6 characters, no player count suffix) | 狼王魔术师 |
| Category | TemplateCategory.Classic / Advanced / Special / ThirdParty | Advanced |
| Role list | Complete RoleId array (including duplicated villager/wolf) | ['villager', 'villager', ...] |
grep_search to confirm each RoleId exists in specs.ts./new-role skill first to add that role, then continue this skill.Perform the following checks on the role list:
| Check Item | Requirement |
|---|---|
| Player count | 12 players; getPlayerCount(roles) calculates actual count (bottom card roles not counted) |
| Faction balance | Wolves typically 3-4, god faction typically 3-4, villagers fill remaining slots |
| No duplicate special roles | Except villager / wolf, each special role appears at most once |
| Bottom cards | treasureMaster needs 3 extra bottom cards, thief needs 2 (appended to roles, roles.length > 12) |
| Naming convention | No player count suffix (count derived from roles), 3-6 Chinese characters |
Output the change plan, wait for user confirmation before coding.
File: packages/game-engine/src/models/Template.ts
Add at the end of the corresponding category block:
{
name: '板子名',
category: TemplateCategory.Advanced, // Classic | Advanced | Special | ThirdParty
roles: [
'villager',
'villager',
'villager',
'villager',
'wolf',
'wolf',
'wolf',
'roleId1',
'seer',
'witch',
'hunter',
'guard',
],
},
Ordering convention: Villagers first → wolves → special wolves → god faction → special roles → bottom cards (if any).
File: src/config/guideContent.ts
Search PRESET_TEMPLATES.length; if the guide text has a hardcoded template count (e.g., 25 个预设板子), update to the new number.
Current implementation uses
${PRESET_TEMPLATES.length}dynamic reference, so usually no manual update needed. Only change when the text has a hardcoded number.
Create an integration test under src/services/__tests__/boards/.
File: src/services/__tests__/boards/night1.<topic>.<role-feature>.12p.integration.test.ts
Naming example: night1.guard.blocks_wolfkill.12p.integration.test.ts
import type { RoleId } from '@werewolf/game-engine/models/roles';
import { cleanupGame, createGame, GameContext } from './gameFactory';
import { executeFullNight } from './stepByStepRunner';
const TEMPLATE_NAME = '板子名';
function createRoleAssignment(): Map<number, RoleId> {
const map = new Map<number, RoleId>();
// seat 0-3: villager, seat 4-6: wolf, seat 7+: special roles
map.set(0, 'villager');
// ...
return map;
}
describe('Night-1: <topic description> (12p)', () => {
let ctx: GameContext;
afterEach(() => {
cleanupGame();
});
it('<core scenario description>', () => {
ctx = createGame(TEMPLATE_NAME, createRoleAssignment());
const result = executeFullNight(ctx, {
wolf: 0,
witch: { save: null, poison: null },
seer: 4,
// ...other role actions
});
expect(result.completed).toBe(true);
// Assert currentNightResults / reveal / deaths
expect(ctx.getGameState().currentNightResults?.xxx).toBe(yyy);
});
});
Must include at least one topic-specific assertion (not purely deaths):
currentNightResults?.xxx / seerReveal / psychicReveal / gargoyleReveal / actions?.xxx etc.
File: src/services/__tests__/boards/night1.boards.coverage.contract.test.ts
REQUIRED_12P_TEMPLATES arrayTEMPLATE_TO_TEST_PATTERN// REQUIRED_12P_TEMPLATES
'新板子名',
// TEMPLATE_TO_TEST_PATTERN
新板子名: /TEMPLATE_NAME\s*=\s*['"]新板子名['"]/,
Run through the core principles checklist 🔍 for all changes made:
as any / unnecessary ?.? (Principle 3)Run contract tests to ensure data consistency:
pnpm exec jest --testPathPattern="Template.contract" --no-coverage
Contract tests automatically verify:
Run boards coverage contract to ensure integration test is registered correctly:
pnpm exec jest --testPathPattern="night1.boards.coverage.contract" --no-coverage
Run nightPlanSchemas contract test to ensure night plan is valid:
pnpm exec jest --testPathPattern="nightPlanSchemas.contract" --no-coverage
Full verification:
pnpm run quality
For snapshot changes use pnpm exec jest --updateSnapshot.
If the board contains special role combinations or new roles, add a Playwright E2E spec covering the Night 1 flow.
night-roles-*.spec.ts file under e2e/specs/withSetup + BoardPickerPage.selectPreset('板子名') to select the new boardpnpm run e2e:coreIf the board only contains roles already covered by E2E and has no new interactions, this step can be skipped (state the reason in wrap-up).
pnpm run quality passessrc/components/BoardStrategy/boardStrategyData.ts under BOARD_STRATEGY (key = PresetTemplate.name), including difficulty, recommendLevel, tags, summary, goodStrategy, wolfStrategy (add thirdStrategy if third-party faction present), firstNight, pitfalls, metaREADME.md and README.en.md (e.g., "27 preset boards" → "28 preset boards")docs/PRESET_BOARDS.md preset boards reference doc (append to corresponding category table)feat(models): add <boardName> preset template| Category | Applicable Scenario | Examples |
|---|---|---|
Classic | Beginner/classic configurations | Seer+Witch+Hunter+Guard, Wolf+Beauty |
Advanced | Contains advanced roles (gargoyle/nightmare/etc.) | Gargoyle+Gravekeeper, Nightmare+Guard |
Special | Special gameplay/unique mechanic combos | PureWhite+Shadow, Masquerade |
ThirdParty | Contains third-party faction roles | Piper, Shadow+Avenger |
| Faction | Available Roles |
|---|---|
| Villager | villager (repeatable) |
| Wolf | wolf (repeatable), wolfQueen, wolfKing, darkWolfKing, wolfWitch, wolfRobot, bloodMoon |
| God | seer, witch, hunter, guard, idiot, knight, witcher, mirrorSeer, drunkSeer, psychic, gargoyle, graveyardKeeper, silenceElder, votebanElder, pureWhite, spiritKnight, dancer, warden |
| Utility | magician, nightmare, dreamcatcher, slacker, wildChild, avenger, shadow, masquerade |
| Awakened | awakenedGargoyle |
| Third-party | piper |
| Bottom cards | treasureMaster (+3 bottom cards), thief (+2 bottom cards) |
This index may change across versions. If unsure whether a RoleId exists, use
grep_searchto verify inspecs.ts.
roles.length)villager / wolf, special roles must not repeattreasureMaster requires 3 extra bottom card roles, thief requires 2ROLE_SPECSRun full quality pipeline, auto-fix lint/format issues, then commit and push. Use when: quality fix commit push, run quality, fix lint, fix format, quality commit push.
Structured debugging workflow: diagnose bugs/abnormal behavior, locate root cause, verify fix. Use when: debugging, bug, issue investigation, error, crash, not working, not rendering, timeout, disconnect.
Generate delegation prompts for specialist agents. Use when delegating tasks, writing expert prompts, or finding a specialist workflow.
Execute a minor release end-to-end: collect changes, write announcement, bump version, commit, tag, push. Use when: minor-release, minor release, new version, release minor.
Add a new Playwright E2E spec for a night role, flow, or feature. Use when: adding an e2e test, new playwright spec.
Add a new werewolf role end-to-end: spec, night step, resolver, audio, badge, config, tests. Use when: adding a role, creating a character, new role SOP.