summaryrefslogtreecommitdiff
path: root/AGENTS.md
blob: ed0aa8637e32f572a12c42c51c6cfef2b3668894 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# AGENTS.md

## Project scope

This repository is a compact personal Emacs 30 configuration centred on Org mode as the primary work surface.

The live configuration is intentionally small:

- `early-init.el`
- `init.el`

Treat this as a standalone project. Do not assume hidden modules, generated files, or an older architecture unless the user explicitly adds them.

The immediate focus of the project is the Org core workflow rather than feature expansion. Prioritise the quality of the main operating loop:

- agenda
- capture
- refile
- archive
- speed commands
- narrowing and widening
- predictable window behaviour
- heading-centric navigation

Use `todo.md` as the working list of intended improvements and constraints when it is present in the repo.

## Role and technical standard

Operate as an Emacs Lisp expert working with Emacs 30.

Changes must be:

- idiomatic Elisp
- consistent with standard Emacs and Org conventions
- understandable by a human maintaining a small personal config
- biased toward built-in behaviour before custom behaviour

Do not treat this as a generic editor customisation exercise. Treat it as careful Elisp work on a deliberately small system.

## Design principles

### 1. Keep the configuration small

Prefer direct configuration over abstraction.

- Use built-in variables, hooks, keybindings, and package options first.
- Avoid turning a small config into a framework.
- Do not split code into extra files or modules unless explicitly asked.
- Do not introduce subsystems because they seem generally useful.

### 2. Prefer stock Emacs and package behaviour

Customise packages within their normal boundaries.

- Prefer supported configuration variables and documented hooks.
- Avoid wrapping or extending packages with bespoke behaviour unless there is a real gap.
- Do not build custom behaviour when standard Org functionality already solves the problem well enough.

### 3. Be judicious with helper functions

Minimise helper functions.

- Do not add helpers when a direct configuration form is clear and acceptable.
- Add a helper only when it materially improves clarity, correctness, reuse, or error handling.
- When a new helper or constant is justified, namespace it with the `ss-` prefix.
- Keep helpers small, local in intent, and easy to inspect.

If a change would introduce several helpers or a mini-abstraction layer, that is usually a sign the design should be simplified.

### 4. Optimise for robustness, not cleverness

The configuration should not be brittle.

- Handle missing files gracefully.
- Handle missing directories gracefully.
- Handle missing external executables or optional dependencies gracefully.
- Prefer clear failure modes and useful messages over silent breakage.
- Avoid partial setup that leaves inconsistent state behind.

Do not assume the user's environment is fully prepared.

### 5. Respect the boundary between config and notes

The user's notes live outside this repository, typically under `~/org`.

The configuration may reference that location, but it does not own the note system.

- Do not silently create a large directory structure.
- Do not overwrite user files.
- Do not assume every expected file already exists.
- Check for existence where appropriate.
- Fail safely and clearly when required files are absent.

The repo configures behaviour. It should not behave like a provisioning tool unless explicitly asked.

### 6. Preserve portability

The configuration should work across macOS, Linux, and Windows where practical.

- Avoid platform-specific assumptions unless unavoidable.
- Be careful with path handling.
- Be careful with executable discovery.
- Be careful with shell-specific behaviour.
- Prefer portable Emacs primitives over platform-bound shortcuts.

When platform-specific logic is genuinely needed, keep it explicit and narrow.

## Change bias

When making changes, prefer work that strengthens the current Org operating model instead of adding adjacent capabilities.

Good changes usually improve one of these:

- friction of capture
- clarity of agenda
- refile and archive ergonomics
- navigation speed
- heading-based work patterns
- modal and predictable window behaviour
- resilience when files or tools are missing

Avoid speculative extras unless the user explicitly asks for them.

## Style guidance for code changes

- Prefer clear, flat code over clever abstractions.
- Prefer explicit names over short opaque ones.
- Keep comments useful and sparse.
- Do not add comments that merely restate the code.
- Use `defconst`, `defvar`, and helper functions only when they add real value.
- Namespace constants, variables, and helpers with `ss-` when introducing project-owned definitions.
- Keep custom code small and close to the behaviour it supports.
- Prefer docstrings on non-trivial functions and user commands.
- Keep docstrings short, factual, and action-oriented.

## Package and dependency stance

Prefer built-in packages and standard Org features first.

When using third-party packages:

- keep the package set small
- use them for clear workflow wins
- configure them conservatively
- avoid deep custom extensions unless necessary

Do not add a package when built-in Emacs or Org can solve the problem simply enough.

## User experience stance

This project values a calm, dependable workflow over a feature-rich one.

Changes should aim for:

- predictable windows
- low-friction capture
- fast movement through headings
- minimal surprise
- explicit behaviour
- simple recovery when something is missing

Avoid adding UI noise, background magic, or hidden automation unless explicitly requested.

## Maintenance rules

### Updating `todo.md`

When `todo.md` is present, treat it as the current backlog for the Org core workflow.

- Align proposed work to that list unless the user explicitly changes direction.
- Do not rewrite or reorganise `todo.md` without being asked.
- Mark items complete only when the implementation actually covers them.
- Do not mark exploratory discussion as completed work.
- If a change materially affects an item in `todo.md`, mention that connection clearly.

### Preserving intent in `init.el` and `early-init.el`

- Keep `early-init.el` limited to true early startup concerns.
- Keep operational behaviour in `init.el` unless there is a strong reason otherwise.
- Avoid scattering related behaviour across distant sections when a local edit is clearer.
- Do not introduce generated-file workflows unless explicitly requested.

### Editing discipline

- Make the smallest coherent change that solves the problem.
- Do not refactor unrelated parts of the config while addressing a narrow request.
- Preserve existing behaviour unless the requested change should alter it.
- If a simplification removes custom code in favour of stock behaviour, prefer that.
- Avoid placeholder abstractions for imagined future needs.

## What to avoid

Avoid the following unless the user asks for them:

- large helper layers
- package-specific mini-frameworks
- hidden bootstrapping of external note files
- aggressive auto-creation of directories or content
- over-designed metadata schemes
- custom behaviour that fights normal Org conventions
- platform-specific shortcuts presented as universal solutions

## Output expectations

When proposing or implementing changes:

- keep the solution scoped to the user's request
- preserve the small-project character of the repo
- explain trade-offs plainly when they matter
- prefer the simplest correct implementation
- do not broaden scope without a strong reason

If a design can be solved either with stock configuration or custom machinery, choose stock configuration unless there is a clear downside.