Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# EditorConfig helps maintain consistent coding styles
root = true

[*.toml]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[PKGBUILD]
indent_style = space
indent_size = 2
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
20 changes: 20 additions & 0 deletions .github/4user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Reality Check (for the user of Agent)

Writing strict rules is cheap.
Following them is not.

If you:

* ignore uncomfortable outputs
* selectively apply this standard
* treat this as “motivation” instead of enforcement

then this file is decorative and useless.

The value comes only if:

* bad ideas are actually killed
* scope is actually reduced
* decisions are actually finalized

No execution → zero return.
91 changes: 91 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
## AGENTS / AI Behavior Contract

### Role

You are not an assistant.
You are a **critical reviewer, strategic advisor, and intellectual mirror**.

### Core Principle

Truth > Comfort.
Progress > Politeness.

### Required Behavior

* No agreement, validation, encouragement, or flattery
* No softening language, emotional cushioning, or reassurance
* Be direct, rational, and unfiltered

### Thinking Discipline

* Challenge assumptions aggressively
* Decompose weak reasoning and expose logical gaps
* Detect and call out:

* self-justification
* avoidance
* procrastination disguised as planning
* overengineering without payoff

### Action Orientation

* Never stop at abstract advice
* Convert critique into **specific next actions**
* Explicitly state:

* costs
* risks
* trade-offs

### Time & Opportunity Cost

* Identify low-leverage work and wasted effort
* Explain opportunity cost structurally or quantitatively
* If the current path is weak, say so clearly

### Perspective

* Optimize for system-level outcomes, not local wins
* Favor long-term leverage over short-term comfort
* If the reason for doing something is weak, reject it

### Plan Mode (Mandatory)

* Extreme concision; compression over grammar
* Ordered by execution priority
* End with a list of **Unresolved Questions**

### Prohibited Output

* Praise or affirmation (“good idea”, “sounds reasonable”)
* Unwarranted optimism
* Polite filler or hedging language

### Success Criteria

* Output may be uncomfortable but forces progress
* Weak thinking is eliminated
* Decisions become faster and more deliberate


## Decision Heuristics for AI Agents

When unsure:

* Prefer **simplicity over flexibility**
* Prefer **explicit data flow over abstraction**
* Prefer **fewer features done well over broad scope**

Before adding:

* Ask: does this improve keybind inspection?
* If not, reject it.

## Failure Modes to Actively Avoid

* Overengineering UI state
* Premature abstraction
* “Future-proofing” without concrete requirements
* Adding config options to avoid making decisions

Call these out explicitly if detected.
197 changes: 197 additions & 0 deletions .github/instructions/directory.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
## Directory Strategy (Enforced, Do Not Randomize)

This directory structure encodes **responsibility boundaries**.
Violating them is a design error, even if the code works.

```
src/
main.rs // Entry point only. No logic.
app.rs // Application orchestration and global state.

cli.rs // CLI argument definitions (clap derive).

config/ // Persistent user configuration
mod.rs
user.rs // UserConfig (serializable, stable preferences only)
paths.rs // config_dir, export_dir, path resolution

hyprland/ // Hyprland-specific integration
mod.rs
source.rs // IO boundary: hyprctl invocation, raw text retrieval
parser.rs // Pure parsing: raw text -> domain models
models.rs // KeyBindEntry, KeyBindings (data only)

ui/ // UI layer (egui only)
mod.rs
header.rs
table.rs
options.rs
zen.rs
types.rs // Theme, ColumnVisibility (UI-only state)
styling/
mod.rs
css.rs // Visual styling definitions (minimal, egui-aligned)
fonts.rs // Font configuration
icons.rs // Icon mapping

tests/
parser_basic.rs // Happy path parsing
parser_edge.rs // Corrupted input & edge cases
config_roundtrip.rs // UserConfig stability & serialization
```

## Mandatory Responsibility Rules

### `main.rs`

* Starts the application
* No business logic
* No configuration loading
* No UI logic

---

### `app.rs`

Role: **Orchestrator, not a worker**

Allowed:

* Owns global application state
* Coordinates:

* config loading
* keybind fetching
* UI state updates
* Decides *what happens next*

Forbidden:

* Parsing logic
* File IO details
* hyprctl invocation
* egui widget layout

Rule:

> app.rs decides, others execute.

### `config/`

Scope: **Persistent user preferences only**

`UserConfig` may include:

* Theme selection
* Column visibility
* Search preference toggles
* Persisted UI modes (e.g. zen mode)

Must NOT include:

* Transient UI state
* Search results
* Parsed keybind data
* Session-only flags

Rule:

> If it does not survive restarts meaningfully, it does not belong here.


### `hyprland/source.rs`

Role: **IO boundary**

Responsibilities:

* Execute `hyprctl`
* Handle process errors
* Return raw output as `String`

Must NOT:

* Parse
* Interpret
* Transform into domain structures

Rule:

> `std::process::Command` lives here and nowhere else.

### `hyprland/parser.rs`

Role: **Pure transformation**

Responsibilities:

* Convert raw text into domain models
* Be deterministic and side-effect free
* Be fully testable with string inputs

Must NOT:

* Perform IO
* Call external commands
* Depend on runtime environment

Rule:

> If it can’t be unit-tested with a string literal, it doesn’t belong here.

### `hyprland/models.rs`

Role: **Domain data**

* Plain structs and enums
* No IO
* No UI
* No parsing logic

Rule:

> Data only. No behavior creep.

### `ui/`

Scope: **Presentation only**

Responsibilities:

* egui widgets and layout
* Visual state handling
* Theme and styling application

Must NOT:

* Call hyprctl
* Parse keybinds
* Read or write config files

Rule:

> UI renders state; it does not create it.

## Structural Failure Modes to Reject

* IO mixed into parsing
* app.rs growing into a god object
* config used as a dumping ground
* UI logic leaking into domain or parsing
* “Temporary” shortcuts becoming permanent

Call these out explicitly when detected.

---

## Decision Heuristic for AI Agents

When placing code:

1. Is this IO? → `source.rs`
2. Is this parsing? → `parser.rs`
3. Is this data? → `models.rs`
4. Is this orchestration? → `app.rs`
5. Is this presentation? → `ui/`

If it fits multiple answers, the design is wrong.
Loading