# Where Is the Core Ruleset for Ponytail Located?

> Find the core ruleset for Ponytail in the .windsurf/rules/ponytail.md file. Discover the markdown rules enforcing the tool's lazy senior dev philosophy.

- Repository: [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail)
- Tags: api-reference
- Published: 2026-09-03

---

**The core ruleset for Ponytail resides in the [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md) file at the repository root, containing the markdown-based rule definitions that enforce the tool’s "lazy senior dev" philosophy.**

The **core ruleset for Ponytail** serves as the authoritative configuration that governs how this open-source automation tool evaluates code, applies safety constraints, and executes its behavioral logic. Hosted in the `DietrichGebert/ponytail` repository, understanding the exact location and structure of these rules is essential for contributors extending the framework or developers debugging rule-based decisions.

## Primary Location of the Core Ruleset

### The Main Rules File ([`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md))

The definitive source of truth for Ponytail’s behavior lives in **[`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md)**. This file sits at the repository root within the `.windsurf` directory and contains the hierarchical, markdown-based rule definitions that the engine parses during initialization. According to the repository structure, this path represents the primary configuration that dictates how Ponytail prioritizes tasks, handles edge cases, and maintains its "lazy senior dev" approach to code management.

You can view the source directly at:  
[[`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md)](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md)

### CLI-Specific Extensions ([`.clinerules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.clinerules/ponytail.md))

For command-line interface operations, Ponytail maintains a parallel rule set in **[`.clinerules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.clinerules/ponytail.md)**. This file provides terminal-specific overrides and extensions that adapt the core logic for shell-based interactions, ensuring consistent behavior across different execution contexts while allowing for CLI-optimized constraints.

## Runtime Architecture and Supporting Files

### The Runtime Hook ([`hooks/ponytail-runtime.js`](https://github.com/DietrichGebert/ponytail/blob/main/hooks/ponytail-runtime.js))

During execution, Ponytail loads the ruleset through the runtime hook located at **[`hooks/ponytail-runtime.js`](https://github.com/DietrichGebert/ponytail/blob/main/hooks/ponytail-runtime.js)**. This component resolves the repository-relative path to [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md), reads the raw markdown content, and passes it to the rule engine for parsing. The hook ensures that the latest rule definitions are always loaded into memory before the tool processes any code changes.

### Philosophical Foundation ([`AGENTS.md`](https://github.com/DietrichGebert/ponytail/blob/main/AGENTS.md))

While not the ruleset itself, **[`AGENTS.md`](https://github.com/DietrichGebert/ponytail/blob/main/AGENTS.md)** provides the conceptual framework that informs the rules' design. This documentation file outlines the "lazy senior dev" principles—efficiency, minimal intervention, and high-impact changes—that the [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md) file implements as executable constraints.

## Loading and Parsing the Ruleset Programmatically

The following examples demonstrate how Ponytail’s internal components resolve the file path and consume the markdown rules:

```javascript
// Loading the ruleset in a Node.js environment
import fs from 'fs';
import path from 'path';

// Resolve the absolute path to the core rules file
const rulesPath = path.resolve(
  import.meta.dirname,
  '..', '..', '.windsurf', 'rules', 'ponytail.md'
);

// Read the rule definitions as markdown
const rulesMarkdown = fs.readFileSync(rulesPath, 'utf-8');

// Initialize the engine and parse the rules
const ruleEngine = new RuleEngine();
ruleEngine.loadFromMarkdown(rulesMarkdown);

```

```python

# Consuming the ruleset in Python helper scripts

import pathlib

# Navigate from the current file to the repository root rules

RULES_FILE = pathlib.Path(__file__).parents[2] / ".windsurf" / "rules" / "ponytail.md"

with RULES_FILE.open(encoding="utf-8") as f:
    rules_text = f.read()

# Instantiate Ponytail's rule engine and load the markdown

engine = ponytail.RuleEngine()
engine.load_markdown(rules_text)

```

These implementations follow the standard pattern: resolve the repository-relative path from the executing script’s location, read the UTF-8 encoded markdown, and hydrate the `RuleEngine` instance with the raw content for tree construction.

## Summary

- The **core ruleset for Ponytail** is centrally defined in [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md) at the repository root.
- CLI-specific rule extensions are maintained separately in [`.clinerules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.clinerules/ponytail.md).
- The runtime initialization process loads these definitions via [`hooks/ponytail-runtime.js`](https://github.com/DietrichGebert/ponytail/blob/main/hooks/ponytail-runtime.js).
- The ruleset utilizes markdown formatting, parsed by the internal `RuleEngine` class to build the decision tree.
- Repository contributors should reference [`AGENTS.md`](https://github.com/DietrichGebert/ponytail/blob/main/AGENTS.md) for the guiding principles behind the rule constraints.

## Frequently Asked Questions

### Where exactly is the core ruleset for Ponytail stored?

The **core ruleset for Ponytail** is stored in the [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md) file located at the root of the `DietrichGebert/ponytail` repository. This path serves as the single source of truth for the tool's behavioral logic and safety constraints.

### What file format does Ponytail use for its ruleset?

Ponytail uses a **markdown-based format** for its core ruleset. The [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md) file contains human-readable rules that the `RuleEngine` class parses into an executable decision tree at runtime.

### How does Ponytail load the ruleset during execution?

The runtime hook in **[`hooks/ponytail-runtime.js`](https://github.com/DietrichGebert/ponytail/blob/main/hooks/ponytail-runtime.js)** handles the loading process. It resolves the path to [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md), reads the file contents, and passes the markdown string to the `RuleEngine.loadFromMarkdown()` method (or `load_markdown()` in Python implementations) to initialize the rule tree.

### Can I extend the core ruleset for specific CLI environments?

Yes. While the **core ruleset for Ponytail** lives in [`.windsurf/rules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.windsurf/rules/ponytail.md), you can create environment-specific extensions in [`.clinerules/ponytail.md`](https://github.com/DietrichGebert/ponytail/blob/main/.clinerules/ponytail.md). This file allows you to override or augment base rules specifically for command-line interface contexts without modifying the primary configuration.