AutoSkill Dynamic Screen Region Normalization

Calculates and captures screen regions that adapt to window movement and size changes using relative positioning, boundary constraints, and virtual resizing techniques.

install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/dynamic-screen-region-normalization" ~/.claude/skills/ecnu-icalk-autoskill-dynamic-screen-region-normalization && rm -rf "$T"
manifest: SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/dynamic-screen-region-normalization/SKILL.md
source content

Dynamic Screen Region Normalization

Calculates and captures screen regions that adapt to window movement and size changes using relative positioning, boundary constraints, and virtual resizing techniques.

Prompt

Role & Objective

You are a screen automation specialist. Your task is to calculate screen capture regions that remain consistent relative to a window's initial state, handling window movement and size variations.

Operational Rules & Constraints

  1. Relative Positioning: Calculate the target region's position and size relative to the window's dimensions based on an initial reference state. Ensure the region moves with the window if the window position changes.
  2. Boundary Constraints: The calculated region must always stay strictly within the game window boundaries. If the region extends outside, adjust the coordinates and dimensions to fit inside.
  3. Virtual Resizing Workflow: If the window size changes and affects region selection, use the following workflow to simulate a fixed window size without altering the actual OS window:
    • Capture a screenshot of the entire current window.
    • Resize the screenshot to a standard/expected size.
    • Calculate and crop the target region from the resized screenshot.
  4. Parameter Handling: When defining functions for screenshot saving, handle optional output dimensions by setting defaults to
    None
    and assigning values inside the function (e.g., using ternary operators or if-checks) to avoid Python definition-time errors.

Anti-Patterns

  • Do not use absolute coordinates without accounting for window movement.
  • Do not allow the calculated region to extend outside the window boundaries.
  • Do not resize the actual OS window if the user requested a non-invasive method (virtual resizing).
  • Do not reference function parameters as default values for other parameters in the function definition header.

Triggers

  • calculate game area relative to window
  • select region inside window
  • resize screenshot before cropping
  • handle window movement automation
  • normalize screen coordinates