[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78FEN57JXTKWEE164TCPXTP":3,"skill-same:01M78FEN57JXTKWEE164TCPXTP":69},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":25,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":28,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M78FEN57JXTKWEE164TCPXTP","input-handling",null,"poppyTM\u002Foride","poppyTM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F339400917?v=4","01M78F6YNKFR5S5JQR27X9F09Z","Poppy Team","01M78F6YP8ZZTRES9X8Q2ZAD21",1,"MIT","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Input Subsystem\n\n## Purpose\nImplement responsive, remappable multi-device input: action-based mapping (not raw key polling), input buffering with timing windows, dead-zone and sensitivity calibration, chord\u002Fgesture detection, gamepad hot-plug, and latency within an explicit input-to-photon budget.\n\n## Use when\n- Adding action mapping, rebinding UI, or multi-device support (keyboard, mouse, gamepad, touch).\n- Implementing input buffering, coyote-time\u002Fjump-forgiveness windows, or combo\u002Fchord detection.\n- Calibrating sticks (dead zones, response curves), triggers, or pointer sensitivity.\n- Auditing dropped inputs, double-fires, focus-stealing, or input latency.\n\n## Do not use when\n- Designing the simulation that consumes input (use `game-runtime`).\n- Building editor gizmo manipulation UX (use `editor-tooling`).\n- Securing networked input against cheating (server-authoritative validation concern, pair with `network-security` for transport).\n\n## Required context\n- Device matrix: keyboard, mouse, gamepad, touch with platform APIs.\n- Action inventory: gameplay actions, chords, and rebinding requirements.\n- Latency budget: input-to-photon ceiling and buffering window (ms).\n\n## Procedure\n1. **Map Actions, Not Keys**: Define gameplay actions (`jump`, `dodge`, `confirm`) with per-device binding tables. Gameplay code reads actions; devices produce them. Example: `jump ← Space | GamepadA | TouchButton(jump-zone)`. Raw keycodes never appear in gameplay logic.\n2. **Buffer with Windows**: Queue discrete action presses with timestamps; consume within an explicit window (e.g., 120 ms buffering, 100 ms coyote time). Buffer size is bounded (e.g., 8 events); overflow drops oldest with a debug counter, never newest.\n3. **Calibrate Sticks & Triggers**: Apply radial dead zones (e.g., 0.15 inner, 1.0 outer) plus a response curve (e.g., cubic ease) per stick; document per-device overrides. Triggers use press\u002Frelease hysteresis (press > 0.4, release \u003C 0.3) to prevent flutter.\n4. **Detect Chords & Gestures Deterministically**: Chords require all members within a simultaneity window (e.g., 50 ms); sequences match against a trie with per-step timeouts. Conflicting bindings (same gesture → two actions) are rejected at bind time with a named error.\n5. **Survive Device Churn**: Handle gamepad hot-plug\u002Funplug mid-frame: pause-on-disconnect for single-player, migrate bindings to the replacement device, and persist user rebinds to versioned storage with conflict resolution on load (user binding wins; log the override).\n6. **Verify**: Run `scripts\u002Fverify.sh`. Prove buffered-input execution rates at 30\u002F60\u002F120 fps simulation, dead-zone curves against calibration tables, chord timing boundaries, and zero dropped actions in a scripted input replay.\n\n## Decision rules\n- **Actions Only in Gameplay**: Gameplay polling raw device state is a defect; all input arrives as named actions.\n- **Bounded Buffers**: Unbounded input queues are forbidden; every buffer has size, window, and drop policy.\n- **No Silent Conflicts**: Overlapping bindings fail loudly at bind time, never at press time.\n- **Rebinds Persist**: Default bindings are code; user bindings are versioned data that survives updates.\n\n## Evidence required\n- Input-replay test: scripted sequence yields identical action streams across frame rates.\n- Calibration tables: measured vs expected stick curves and trigger thresholds.\n- Chord\u002Fgesture boundary tests and conflict-rejection cases.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Action-mapped input subsystem with buffering and dead-zone calibration.\n- Rebinding persistence with conflict-resolution rules.\n- Latency and dropped-input benchmark evidence.\n\n## Stop conditions\n- All actions mapped, buffered, and rebindable within latency budget.\n- Zero dropped or double-fired actions in scripted replay.\n- Token budget exhausted.\n\n## Escalation rules\n- Escalate to lead architect if platform input latency floor exceeds the design budget (needs game-feel tradeoff).\n- Escalate immediately on device-churn crashes or input handling on the wrong thread causing races.\n",{},"main","1cd515630b8ceb57777d466bee4970fe7c2e30e0",".ai\u002Fskills\u002Finput-handling",0,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride","https:\u002F\u002Fgithub.com\u002FpoppyTM","https:\u002F\u002Fpoppy.lat","Construímos linguagens de programação e ferramentas para quem lê código com o mesmo cuidado com que escreve.","2026-09-30 10:15:52",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add poppyTM\u002Foride --skill input-handling",{"tool":37,"command":38},"bunx","bunx skills add poppyTM\u002Foride --skill input-handling",{"tool":40,"command":41},"pnpm","pnpm dlx skills add poppyTM\u002Foride --skill input-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002FSKILL.md",true,[45,51,55,59,65],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"checks\u002Finput-handling-invariants.md","REFERENCE","参考文档",1382,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002Fchecks\u002Finput-handling-invariants.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"manifest.json",1791,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002Fmanifest.json",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Finput-handling-guide.md",2000,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002Freferences\u002Finput-handling-guide.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fverify.sh","SCRIPT","脚本",3750,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002Fscripts\u002Fverify.sh",{"path":66,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":67,"sourceHtmlUrl":68},"templates\u002Finput-handling-template.md",2290,"https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Finput-handling\u002Ftemplates\u002Finput-handling-template.md",[70,76,82,89,96,103],{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M78FHQN254KEH0DETXT5JM29","zoom-reflow","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M78FHP1880S695V8GQEE0RXK","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M78FHHYM6AN2H819FABW01DZ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M78FHE53D8DD0QVRY5C37DA4","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M78FHBJ1KXFF734GFE509TBJ","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":18},"01M78FH9X6CPJX1H61ZDWTTVW8","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002FpoppyTM\u002Foride\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]