drincs-productions/nqtr

nqtr-testing

Drive and inspect NQTR games from browser automation through the opt-in testing bridge, and connect application actions with awaited UI query refresh.

Voir la source

Mode d’emploi

  1. Copiez la commande et examinez le paquet avant de l’installer dans votre environnement agent.
  2. Consultez le document original pour les outils, identifiants et environnements requis.
  3. Décrivez les entrées et le livrable souhaité ; comparez la sortie aux sources.
npx skills add https://github.com/drincs-productions/nqtr --skill nqtr-testing

Avant de commencer

  • L’installation n’inclut ni abonnement au modèle, ni quota API, ni accès aux fichiers.
  • Étoiles et installations reflètent l’activité, pas un test indépendant de qualité ou de sécurité.
Document Skill original

Rendu depuis le dépôt source en conservant titres, exemples, code, tableaux, liens et images.

NQTR testing bridge

Enable the bridge only in development:

ts
import { testing } from "@drincs/nqtr";
if (import.meta.env.DEV) testing.enable(); // window.nqtr

Use testing.setProps(props) to supply current OnRunProps, and testing.setActions(actions) to register application actions that await UI refresh. Unspecified actions use NQTR directly. enable({ windowKey }) replaces the previous session; disable() removes its global property and isEnabled() reports its state. Props and action registrations survive disable/enable. Unknown IDs reject with an error.

Read content without React hooks

getCurrentRoom() returns the current registered room or undefined. getRooms(), getActivities(), getCommitments(), and getQuests() return all registered domain objects, including inactive content. getRoutine() returns the unique commitments in the current active routine. Read fields explicitly when returning browser evaluation results; domain objects can contain functions or cyclic references.

Drive actions

js
const api = window.nqtr;
api.getRooms().map(room => room.id);
await api.goToRoom("mc_room");
await api.increaseTime(2);
await api.increaseDate(1, 8);
await api.addActivity("mc_room", "order_product");
await api.removeActivity("mc_room", "order_product");
await api.addCommitment("terrace", "alice_quest_talk");
await api.removeRoutine("alice_smokes");
await api.runActivity("order_product");
await api.runCommitment("alice_quest_talk");
await api.startQuest("aliceQuest");
await api.continueQuest("aliceQuest");

These examples are independent operations; the game must make an item available before it can be run through the template. removeRoutine follows routine.remove: it removes a temporary commitment, not a fixed registration. Time actions are direct engine operations; they do not apply the template's sleep/wait rules or automatic cleanup.

React template integration

Register useNqtrFunctions() results from the template's development-only useTestingBridge(). This shared hook can also run in normal React components. It resolves IDs, applies UI availability checks for room/activity/commitment execution, manages loading, and awaits query invalidation. Activity and commitment model run methods already await their own refresh, so do not invalidate twice in the wrapper. Quest actions supply current game props automatically. The library itself does not depend on React Query. Do not call React hooks inside narrative labels.

Changing rooms mounts the navigation screen and refreshes its queries. Automatic room events run through the existing screen effect and may outlive the action: inspect narration and loading state before issuing the next action.

wait and sleep are intentionally not testing actions.

du même dépôt

Autres Skills

Tous les Skills
drincs-productions
Communauté

nqtr

Index and entry point of the NQTR skill set — start here for any task on a project using @drincs/nqtr (Navigation Quest Time Routine), then follow the skill map to the right skill (navigation, time, activity, routine, quest, ink). Use when installing/configuring @drincs/nqtr, wiring vitePluginNqtr, overriding OnRunProps or the Interface types in nqtr.d.ts, writing custom Room/Location/Map/Activity/Commitment/Quest classes, or deciding whether to write NQTR logic in ink or TypeScript.

Installations / 1h
3
GitHub Stars
2
Mis à jour
17 nov.
drincs-productions
Communauté

nqtr-activity

Use when creating NQTR activities (actions the player can take, linked to rooms/locations/maps) — ActivityBaseModel, RegisteredActivities, linking at init (activities in the room constructor) vs at runtime (room.addActivity / " add activity X in room"), unlinking, timeSlot/dateScheduling, disabled/hidden, and custom Activity classes.

Installations / 1h
3
GitHub Stars
2
Mis à jour
17 nov.
drincs-productions
Communauté

nqtr-ink

Use when writing .ink files in a Pixi'VN project that uses @drincs/nqtr — every NQTR hashtag command ( enter room, set time, set date, wait, add/remove activity, add/remove routine, start/continue quest) and the quest state variables (questIdstarted, completed, failed, currentStageIndex), plus createNqtrHandler setup and options. Prefer this over TypeScript labels whenever ink is configured.

Installations / 1h
3
GitHub Stars
2
Mis à jour
17 nov.
drincs-productions
Communauté

nqtr-navigation

Use when defining or navigating NQTR rooms, locations and maps — RoomBaseModel/LocationBaseModel/MapBaseModel, RegisteredRooms/RegisteredLocations/RegisteredMaps, navigator.currentRoom, " enter room" in ink, entrance rooms, and custom Room/Location/Map classes. Navigation is the base of NQTR; activities and routines attach to it.

Installations / 1h
3
GitHub Stars
2
Mis à jour
17 nov.