Back to Rules
DevOps

AutoHotkey v2 Best Practices: Actionable Checklist for Clean Automation Scripts

Claude Directory November 29, 2025
0 copies 0 downloads

Elevate your AutoHotkey v2 scripting with this expert-rewritten checklist. Focus on API-driven, beginner-friendly code that's simple, efficient, and production-ready for seamless automation.

Rule Content
Follow these essential guidelines to craft superior AutoHotkey v2 scripts:

### Initial Script Directives (Add at the Top)
- Include `#Requires AutoHotkey v2.0.2+` to enforce the minimum version.
- Add `#SingleInstance Force` to restrict to one script instance.
- Set `DetectHiddenWindows true` for reliable access to hidden windows.
- Enable `ListLines True` to aid debugging (enabled by default).
- Use `SetWorkingDir A_InitialWorkingDir` to base operations on the script's folder.

### Coding Style and Structure
- Favor native APIs instead of simulating user inputs like mouse movements or key presses.
- Name all variables, functions, and classes in camelCase with 5-25 characters, ensuring descriptive clarity.
- Avoid any third-party libraries; build everything natively.
- Define all custom functions and classes yourself at the script's end.
- Place function and class declarations after the main AutoExecute section.

### Formatting and Comments
- Apply One True Brace style for functions, classes, loops, and conditionals (brace on new line).
- Add detailed inline comments throughout to guide novice developers on each step.

### Optimization Priorities
- Opt for straightforward, potentially longer scripts over compact advanced ones, except when efficiency gains are substantial.

### Essential Hotkeys (Add Post-AutoExecute)
- `^+e::Edit` for quick script editing with Ctrl+Shift+E.
- `^+Escape::ExitApp` to safely terminate via Ctrl+Shift+Escape.
- `^+r::Reload` to refresh the script instantly with Ctrl+Shift+R.

Comments

More Rules

View all
AI/ML

GLM-4.7 Optimized Config & System Prompt Designer

Expert system prompt for designing high-performance configurations tailored to GLM-4.7's strengths in coding, reasoning, tool use, and multilingual tasks, backed by benchmarks like SWE-bench and τ²-Bench.

C
Community
AI/ML

GLM-4.7 Open-Source Coding Expert: Optimized System Prompt

Leverage GLM-4.7's top benchmarks in SWE-bench, LiveCodeBench, and more with this system prompt designed for generating clean, secure, open-source-ready code, stunning UIs, and agentic workflows.

C
Community
AI/ML

GLM-4.7 Optimized Coding Agent

This system prompt transforms an AI into GLM-4.7, a benchmark-leading coding agent excelling in agentic workflows, tool use, multilingual coding, and complex reasoning with verified best practices for production-ready open-source development.

C
Community
DevOps

Agentic Dev Loop: Autonomous Jira-Driven Coding Agent with GitHub CI Self-Healing

Ralph, a persistent autonomous AI agent, implements Jira tickets through an endless loop until 100% test success, with GitHub PRs, Jules AI reviews, and CI self-healing for reliable development workflows.

C
Claude Directory
AI/ML

Türk Hukuku Uzmanı AI Agent: Güvenilir Yasal Danışman System Prompt

Claude'u Türk hukuku alanında dünyanın en önde gelen uzmanı olarak yapılandıran, yapılandırılmış yanıtlar, zorunlu uyarılar ve etik sınırlarla donatılmış profesyonel AI agent promptu.

C
Community
Database

PostgreSQL Best Practices: Expert Subagent Guide

Expert subagent providing production-ready PostgreSQL guidance on schema design, query optimization, security, performance tuning, and administration with structured, actionable advice and official references.

C
Claude Directory