npx agentspec-cli install 07b61d08-2d17-4a11-a4d2-f2012f9f5d6b --file-type clinerules→ .clinerules/
# AHKv2 Cline Rules System
This document explains the `.clinerules` file format and how it helps Claude and other LLMs generate better AutoHotkey v2 code.
## Overview
The `.clinerules` file provides a structured way to define AutoHotkey v2 coding standards, best practices, and syntax rules. When included in a project, Cline and other compatible LLMs will use these rules to:
1. Generate new code that follows proper AHK v2 patterns
2. Validate existing code against best practices
3. Suggest improvements and corrections to ensure code quality
## File Structure
The `.clinerules` file uses JSON format with the following structure:
```json
{
"version": "1.0.0",
"rules": {
"category_name": {
"description": "Category description",
"patterns": [
{
"name": "rule_name",
"description": "Rule description",
"correct": "Example of correct code",
"incorrect": "Example of incorrect code",
"message": "Error message explaining the rule"
}
]
}
},
"documentation": {
"version_history": "Version change log",
"usage": "Usage instructions"
}
}
```
## Categories
Our AHK v2 rules are organized into these main categories:
1. **ahkv2_syntax**: Core syntax rules for AHK v2 (class initialization, Map usage, variable declaration)
2. **ahkv2_best_practices**: General coding standards (error handling, resource management)
3. **ahkv2_gui_patterns**: GUI-specific patterns and practices
4. **ahkv2_oop_patterns**: Object-oriented programming patterns in AHK v2
5. **ahkv2_hotkey_patterns**: Proper hotkey implementation and management
## Key Rules
### Critical Rules
Some of the most important rules to follow:
1. **Use Map() for data structures**
```ahk
config := Map("width", 800, "height", 600) ; CORRECT
config := {width: 800, height: 600} ; INCORRECT
```
2. **Initialize classes without 'new'**
```ahk
MyClass() ; CORRECT
new MyClass() ; INCORRECT
```
3. **Bind methods when used as callbacks**
```ahk
button.OnEvent("Click", this.HandleClick.Bind(this)) ; CORRECT
button.OnEvent("Click", this.HandleClick) ; INCORRECT
```
4. **Use arrow functions only for simple expressions**
```ahk
callback := (*) => MsgBox("Simple action") ; CORRECT
; INCORRECT:
callback := (*) => {
MsgBox("Complex")
DoSomethingElse()
}
```
## Integration with Cline
When using Cline with this rules system:
1. Place the `.clinerules` file in your project root
2. Cline will automatically detect and apply these rules
3. When asking Cline to generate code, you can reference specific rules:
```
Generate an AHK v2 GUI class following our event binding and GUI patterns from the clinerules.
```
## Extending the Rules
You can extend these rules by adding new patterns or categories to the `.clinerules` file. Follow the established JSON structure and ensure all required fields (name, description, correct, incorrect, message) are provided for each rule.CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler
CLAUDE.md - Agent Instructions for CodeMap
You are building **CodeMap**, a CLI tool that generates structural indexes of codebases to reduce LLM token consumption. The tool creates a `.codemap/` directory that mirrors the project structure, enabling targeted line-range reads instead of full file reads.
by AgentHub Crawler
Sign in to leave a comment.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
by AgentHub Crawler