Execute qualquer Skill no Manus
com um clique
com um clique
Execute qualquer Skill no Manus com um clique
Começar$pwd:
$ git log --oneline --stat
stars:3.132
forks:354
updated:25 de fevereiro de 2026 às 11:35
SKILL.md
| name | write-vuex-unit-test |
| description | Vuex storeの単体テストを生成。mutation/action/getterのテスト作成時に使用。 |
cloneWithUnwrapProxy で複製して初期状態を保存beforeEach で store.replaceState を使って毎回リセットresetMockMode() でランダム値を初期化Good:
import { beforeEach, expect, test } from "vitest";
import { store } from "@/store";
import { resetMockMode } from "@/helpers/random";
import { cloneWithUnwrapProxy } from "@/helpers/cloneWithUnwrapProxy";
const initialState = cloneWithUnwrapProxy(store.state);
beforeEach(() => {
store.replaceState(cloneWithUnwrapProxy(initialState));
resetMockMode();
});
Bad 1 (mockを使う):
const state: Partial<AudioStoreState> = {
audioKeys: [],
audioItems: {},
};
Bad 2 (beforeEach を使わない):
const initialState = cloneWithUnwrapProxy(store.state);
// beforeEach が無いため、テスト間で状態が残る
store.mutations.MUTATION_NAME(payload) で mutation を呼び出すGood:
test("トラックを挿入する", () => {
const trackId1 = TrackId(uuid4());
store.mutations.INSERT_TRACK({
trackId: trackId1,
track: dummyTrack,
prevTrackId: undefined,
});
expect(store.state.trackOrder.slice(1)).toEqual([trackId1]);
});
await store.actions.ACTION_NAME(payload) で action を呼び出すasync/await を使うGood:
test("コマンド実行で履歴が作られる", async () => {
await store.actions.COMMAND_SET_AUDIO_KEYS({
audioKeys: [AudioKey(uuid4())],
});
expect(store.state.audioKeys.length).toBe(1);
expect(store.state.undoCommands.length).toBe(1);
expect(store.state.redoCommands.length).toBe(0);
});
store.getters.GETTER_NAME で getter を取得Good:
test("音声の合計時間を取得", () => {
store.mutations.SET_AUDIO_KEYS({ audioKeys: [audioKey1, audioKey2] }); // state を準備
const total = store.getters.TOTAL_AUDIO_LENGTH;
expect(total).toBeCloseTo(0.65);
});
Bad (getterを直接呼び出す):
const total = (audioStore.getters as any).TOTAL_AUDIO_LENGTH(state);
Good:
test("複数のAudioItemの合計時間を計算する");
test("AudioItemがない場合は0を返す");
Bad (体言止め):
test("複数のAudioItemの合計時間を計算");
test または it で個別のテストケースを定義expect で検証