Skip to content

Commit 51f4780

Browse files
committed
rewrite AGENTS.md to use natural language
1 parent 9a56e78 commit 51f4780

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

AGENTS.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
This is a **Kirby 5 CMS** project. Individual pages available as markdown by appending `.md` to any URL.
44

55
Docs: https://getkirby.com/llms.txt
6-
6+
77
## Existing Project Patterns
88

9-
Before implementing anything, ALWAYS check what already exists in the project:
9+
Before implementing anything, check what already exists in the project:
1010

11-
- **`site/plugins/`** — Check for installed plugins that already solve the problem. Also check `composer.json` for dependencies.
12-
- **`site/snippets/`** — Use existing snippets. NEVER use raw `<img>` tags — use the `image` snippet for all images. It handles responsive images, lazy loading, and SVG inlining.
13-
- **Existing blocks/templates** — Look at similar blocks for patterns before writing new ones.
11+
- **`site/plugins/`** has installed plugins that may already solve the problem. Also check `composer.json` for dependencies.
12+
- **`site/snippets/`** has existing snippets to reuse. Use the `image` snippet for all images instead of raw `<img>` tags. It handles responsive images, lazy loading, and SVG inlining.
13+
- **Existing blocks/templates** show patterns to follow before writing new ones.
1414

1515
When told to "use X", check if X is an existing package/plugin in the project before doing anything else.
1616

@@ -31,19 +31,19 @@ This ensures screen readers only announce the link once. Use `relative z-10` on
3131

3232
### Strings / i18n
3333

34-
ALWAYS use the `t()` function for hardcoded labels and strings. Pass the English translation as the argument, it serves as both the key and default value:
34+
Use the `t()` function for hardcoded labels and strings. Pass the English translation as the argument, it serves as both the key and default value:
3535

3636
```php
3737
<?= t('Read more') ?>
3838
<?= tt('Open submenu: {title}', ['title' => $title]) ?>
3939
<?= tc('{{ count }} members', $count) ?>
4040
```
4141

42-
After adding new strings, run `kirby trawl:extract` to extract them into the JSON translation files. Let the user translate. DO NOT manually edit translation files.
42+
After adding new strings, run `kirby trawl:extract` to extract them into the JSON translation files. Let the user translate and don't manually edit translation files.
4343

44-
In blueprints, most properties (`label`, `help`, `placeholder`, `before`, `after`, section `headline`/`text`) auto-resolve plain strings as translation keys no special syntax needed.
44+
In blueprints, most properties (`label`, `help`, `placeholder`, `before`, `after`, section `headline`/`text`) auto-resolve plain strings as translation keys, so no special syntax is needed.
4545

46-
Option `text` in select/radio/checkbox fields does NOT auto-resolve. Use `*:` to reference a translation key:
46+
Option `text` in select/radio/checkbox fields does not auto-resolve. Use `*:` to reference a translation key:
4747

4848
```yaml
4949
fields:
@@ -58,20 +58,20 @@ fields:
5858
5959
## Styling (Tailwind CSS v4)
6060
61-
**IMPORTANT:** This project resets ALL default Tailwind theme values (colors, font sizes, radii, shadows, etc.) using `--*: initial` in `src/styles/index.css` and only defines project-specific values. ALWAYS check `src/styles/index.css` for available theme tokens before using any Tailwind utility. For example, `text-red-500` or `rounded-lg` will NOT work unless explicitly defined in the theme.
61+
This project resets all default Tailwind theme values (colors, font sizes, radii, shadows, etc.) using `--*: initial` in `src/styles/index.css` and only defines project-specific values. Check `src/styles/index.css` for available theme tokens before using any Tailwind utility. For example, `text-red-500` or `rounded-lg` won't work unless explicitly defined in the theme.
6262

6363
### Custom classes
6464

6565
Custom classes are valid in two cases:
6666

67-
1. **Single HTML elements** that need consistent styling (e.g. `.button`) because creating a snippet for one element is overkill
67+
1. **Single HTML elements** that need consistent styling (e.g. `.button`), because creating a snippet for one element is overkill
6868
2. **Nested/prose content** where you need to style child elements you don't control (e.g. `.prose` targeting `p`, `h2`, `li` inside rich text)
6969

70-
If a component combines markup with styling (e.g. a badge with text + icon), create a **Kirby snippet** instead of a custom class, the rendering logic belongs with the styles.
70+
If a component combines markup with styling (e.g. a badge with text + icon), create a **Kirby snippet** instead of a custom class. The rendering logic belongs with the styles.
7171

7272
### Focus Styles
7373

74-
ALWAYS add custom focus styles. Silence browser defaults with `outline-none` and add custom styles with `focus-visible:`:
74+
Add custom focus styles to interactive elements. Silence browser defaults with `outline-none` and add custom styles with `focus-visible:`:
7575

7676
- Prefer `ring` utilities for interactive elements
7777
- Use `underline` for links unless specified otherwise
@@ -84,7 +84,7 @@ This project uses **desktop-first** breakpoints (opposite of Tailwind's default
8484
- **No prefix** = default (large screens)
8585
- **With prefix** = applies at that width **and below**
8686

87-
DO NOT use a prefix like `min-xl` to target larger screens.
87+
Don't use a prefix like `min-xl` to target larger screens.
8888

8989
```html
9090
<div class="p-8 md:p-4"></div>
@@ -99,25 +99,25 @@ The config can be found in `src/styles/index.css`.
9999

100100
### !important
101101

102-
If you really need to force `!important`, use the `!` suffix (NOT prefix):
102+
If you really need to force `!important`, use the `!` suffix (not the prefix):
103103

104104
```html
105105
<div class="bg-white bg-black!"></div>
106106
```
107107

108108
### Spacing scale
109109

110-
Tailwind 4 calculates spacing as `n * 0.25rem`. You DO NOT have to follow the known spacing scale. Use `h-128` instead of `h-[32rem]`.
110+
Tailwind 4 calculates spacing as `n * 0.25rem`. You don't have to follow the known spacing scale, so use `h-128` instead of `h-[32rem]`.
111111

112112
## Tailwind Merge
113113

114-
If you need to conditionally apply classes, ALWAYS refer to one of the following functions:
114+
When conditionally applying classes, use one of the following functions:
115115

116-
- `merge()` - outputs `class="..."` attribute with merged classes
117-
- `cls()` - outputs just the merged class string
118-
- `attr()` - like Kirby's built-in, but merges Tailwind classes in the `class` attribute
116+
- `merge()` outputs a `class="..."` attribute with merged classes
117+
- `cls()` outputs just the merged class string
118+
- `attr()` works like Kirby's built-in, but merges Tailwind classes in the `class` attribute
119119

120-
You DO NOT need to use `cls()` inside `attr()`.
120+
You don't need to use `cls()` inside `attr()`.
121121

122122
All support conditional syntax with arrays:
123123

@@ -129,13 +129,13 @@ All support conditional syntax with arrays:
129129

130130
Define components with a default export in `src/components/`. These will be automatically registered and can be used in the frontend with `x-data`.
131131

132-
NEVER use document.querySelector() or similar document-level methods. ALWAYS scope to the component's elements, e.g. using `this.$root.querySelector()`. Generally, prefer Alpine's built-in methods like `x-on`, `x-show`, `x-transition`, to trigger methods, etc. Avoid global event listeners. Use Alpine.js plugins like Focus, Intersect, Resize, etc. when required.
132+
Don't use `document.querySelector()` or similar document-level methods. Scope to the component's elements instead, e.g. using `this.$root.querySelector()`. Prefer Alpine's built-in methods like `x-on`, `x-show`, `x-transition` to trigger methods, etc. Avoid global event listeners. Use Alpine.js plugins like Focus, Intersect, Resize, etc. when required.
133133

134134
Documentation: https://alpinejs.dev
135135

136136
## Icons
137137

138-
SVG icons live in `assets/icons/` and are compiled into a sprite by Vite. Use the `icon()` helper to render them. Never inline SVGs or use `<img>` tags for icons.
138+
SVG icons live in `assets/icons/` and are compiled into a sprite by Vite. Use the `icon()` helper to render them. Don't inline SVGs or use `<img>` tags for icons.
139139

140140
```php
141141
<?= icon('angle-right', class: 'size-4') ?>
@@ -151,15 +151,15 @@ Fields store raw strings and need casting (`->toPage()`, `->toFiles()`, `->toBoo
151151

152152
### Code Style
153153

154-
AVOID setting preliminary variables in files. Prefer inline expressions instead UNLESS you'd need to repeat a statement.
154+
Avoid setting preliminary variables in files. Prefer inline expressions instead, unless you'd need to repeat a statement.
155155

156-
GOOD: inline when used once:
156+
Inline when used once:
157157

158158
```php
159159
<?php snippet('image', ['image' => $block->image()->toFile()]) ?>
160160
```
161161

162-
GOOD: assign in condition when reused:
162+
Assign in a condition when reused:
163163

164164
```php
165165
<?php if ($isLtr = $block->order()->value() === 'ltr') : ?>

0 commit comments

Comments
 (0)