You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Decompose the largest Aurora Shell modules into cohesive resource owners for Screenshot UI hooks, capture toolbar behavior and OCR sessions; tray viewport calculations and SNI entries; dock configuration, per-monitor bindings, contextual drag reveal and external-storage operations; Dash visibility, application activation, fixed items and spring loading; Aurora Menu recent-item parsing; Meeting Clock presentation and alerts; clipboard card construction; and IconWeave patching, inspection and window registration. Preserve the existing facades, public module APIs and DevTool contracts while making each extracted component responsible for its own actors, signals, cancellables, GLib sources and teardown.
Introduce factory-based ManagedSource replacement and apply symmetric lifecycle orchestration across the affected modules, including explicit asynchronous identity checks, safe actor transition cleanup, conditional monkey-patch restoration and deterministic enable, disable and re-enable behavior. Tighten the implementation against the EGO review rules by removing redundant guards, lifecycle flags, defensive cleanup wrappers, unnecessary aliases and stale compatibility helpers, while documenting accepted analyzer findings and keeping settings, translations and review guidance synchronized.
Expand pure unit coverage for tray layout, SNI icon handling and identity matching, dock configuration transitions, Dash visibility and window selection, Aurora Menu recent parsing, clipboard card classification, IconWeave scoring and registration, Meeting Clock alert timing and ManagedSource ordering. Extend Shell integration coverage for the refactored Dock, IconWeave and Volume Mixer paths so resource destruction and lifecycle restoration remain exercised in a real GNOME Shell environment.
Copy file name to clipboardExpand all lines: AGENTS.md
+63-19Lines changed: 63 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,6 +171,29 @@ Per the GNOME review guidelines, clipboard-related keyboard shortcuts must not s
171
171
- Constants: `UPPER_CASE`
172
172
- Keep `enable()` and `disable()` symmetric.
173
173
- Read settings through `this.context.settings`. Importing `Main`/`Shell`/`St` directly is fine — keep heavy algorithms in shell-free pure files so they stay unit-testable.
174
+
- Optimize refactors for human readability, not line count. Do not compress control flow, callback bodies,
175
+
object literals, or several operations onto one line merely to shorten a file.
176
+
- Visually separate guard clauses, state preparation, actor mutation, animation, scheduling, and cleanup
177
+
with blank lines. Keep local constants next to the logical block that consumes them; avoid unexplained
178
+
aliases in the middle of a stateful method.
179
+
- Do not add pass-through methods that only forward the same arguments to a stored function or object.
180
+
Expose a meaningful domain operation, return the required callable directly, or keep the call at its
181
+
natural owner.
182
+
- Do not hide lifecycle invariants behind optional chaining with fallback values, such as
183
+
`owner?.value ?? default` or `owner?.operation() ?? false`. At public boundaries, guard the inactive
184
+
state explicitly and access stable fields directly during synchronous work. Reserve optional
185
+
chaining and nullish fallbacks for genuinely optional external data and idempotent cleanup.
186
+
- Do not create a local alias for an instance field merely to shorten `this._field`, repeat the same
187
+
name, or satisfy nullable type narrowing during synchronous work. Guard the field explicitly and
188
+
use it directly when it cannot change inside the block. A snapshot of an instance field is justified
189
+
only when it transfers ownership before the field is cleared or captures the exact resource across
190
+
an `await` or asynchronous callback. A local result is also appropriate for a genuinely dynamic
191
+
lookup or computation that must remain stable; directly reading `this._field` is not such a lookup.
192
+
Name identity captures explicitly, such as `scheduledRetry` or `activeRequest`, so the reason is
193
+
visible.
194
+
- Before finishing a refactor, review every newly created or substantially edited file as prose: expand
195
+
dense one-line branches and loops, remove redundant wrappers, and make lifecycle ownership obvious
196
+
without requiring the reader to infer it from implementation details.
174
197
175
198
## Human Review Quality Bar
176
199
@@ -185,29 +208,50 @@ Changes intended for the production extension must follow both:
185
208
186
209
Apply these rules during implementation and review:
187
210
188
-
- Target the Shell versions declared in `metadata.json`; do not add speculative compatibility checks
189
-
or optional calls for APIs guaranteed by those versions.
190
-
- Keep `extension.ts` small and keep `enable()`/`disable()` close, symmetric, and limited to lifecycle
191
-
orchestration.
192
-
- Every signal, GLib source, cancellable, child actor, menu, and other resource created by a component
193
-
must be cleaned up by that same component. Remove sources and signals before destroying owned actors,
194
-
and call `super.destroy()` last in widget overrides.
195
-
- Override a widget's `destroy()` method for its cleanup. Do not connect the widget's own `destroy`
196
-
signal as a substitute.
211
+
- Target only the Shell versions declared in `metadata.json`. Do not add speculative compatibility
212
+
branches, `typeof method === 'function'` checks, or optional calls for methods guaranteed by those
213
+
versions. For real multi-version support, follow the
214
+
[official port guide](https://gjs.guide/extensions/upgrading/gnome-shell.html).
215
+
- Do not wrap deterministic lifecycle methods such as `destroy()`, `connect()`, `disconnect()`,
216
+
`disconnectObject()`, `abort()`, `GLib.Source.remove()`, or `Gio.DBusConnection.unregister_object()`
217
+
in defensive `try`/`catch`. Catch failures only at operations whose contract can genuinely fail,
218
+
such as I/O, parsing, D-Bus calls, subprocesses, and asynchronous result propagation.
219
+
- Do not add optional calls such as `object?.method(...)` or `object?.method?.(...)` when the object and
220
+
method are guaranteed by the active lifecycle or the targeted API. Use an explicit boundary guard
221
+
when the owning object itself is legitimately inactive or absent.
197
222
- Do not add `_enabled`, `_destroyed`, or similar lifecycle flags when owned references, cancellables,
198
-
or the underlying GObject lifecycle already express the state. Any unavoidable exception needs a
199
-
concise invariant comment and regression coverage.
200
-
- Avoid defensive `try`/`catch` around deterministic cleanup and avoid trivial comments that merely
201
-
restate the next line.
202
-
- Do not use emoji or ASCII art as UI icons, do not ship placeholders, keep generated JavaScript lines
203
-
at 200 characters or fewer, and keep production packages free of developer-only files.
204
-
- Avoid subprocesses in the Shell process. If a subprocess is unavoidable, document why a D-Bus
205
-
service is not practical and keep invocation local, explicit, cancellable, and free of shell
206
-
interpretation.
223
+
or the underlying GObject lifecycle already express the state. After destruction, the owner must
224
+
clear its reference and must not call the instance again.
225
+
- In widget `destroy()` overrides, remove GLib sources and timeouts first, disconnect signals next,
226
+
release owned children and references after that, and call `super.destroy()` last. A widget must
227
+
override its own `destroy()` method instead of connecting its own `destroy` signal for cleanup;
228
+
observing the destruction of an external actor is valid when the observer owns that connection.
229
+
- Every signal, GLib source, cancellable, child actor, menu, Soup session, and other resource created
230
+
by a component must be cleaned up by that same component. Never spread initialization and cleanup
231
+
ownership across unrelated classes.
232
+
- When a repeatable operation creates a timeout, remove or replace its prior source immediately next
233
+
to the new source creation. Do not separate replacement and creation into distant methods or blocks.
234
+
- Keep `extension.ts` minimal. Keep `enable()` and `disable()` adjacent, symmetric, and limited to
235
+
lifecycle orchestration; avoid aliases that merely forward lifecycle calls. Never ship empty,
236
+
placeholder, or partially implemented lifecycle methods.
237
+
- Split large features into cohesive, single-responsibility modules. Extract repeated logic into
238
+
helpers instead of copying blocks. Modules imported by both Shell and preferences must remain free
239
+
of `St`, `Clutter`, `Gtk`, `Gdk`, and `Adw`; keep process-specific UI under clearly named runtime or
240
+
`preferences/` directories.
241
+
- Keep the extension's schema ID in `metadata.json` as `settings-schema` and call `this.getSettings()`
242
+
without repeating the schema ID in source code.
243
+
- Use `St.Icon` or `icon_name` for Shell UI and `Gtk.Image` for preferences. Do not use Unicode emoji
244
+
as icons or ASCII strings as progress indicators; use Shell widgets such as `BarLevel` or `St.Bin`.
245
+
- Keep generated JavaScript lines at 200 characters or fewer. Prefer self-explanatory names and remove
246
+
comments that restate syntax or translate the following statement into prose.
247
+
- Avoid subprocesses in the Shell process. Prefer D-Bus for system services and move heavy work to a
248
+
separate application. If a subprocess is unavoidable, document why D-Bus is not practical and keep
249
+
invocation local, explicit, cancellable, and free of shell interpretation.
207
250
- Review every Shexli finding. Fix real ownership/lifecycle defects and record accepted manual-review
208
251
findings or analyzer false positives in `EGO_REVIEW.md`.
209
252
210
-
- Do not add optional calls such as `object?.method?.(...)` unless that method is a real, documented API or the local type intentionally models it. Never use patterns like `this.disconnectObject?.(this)` on objects that do not own that signal connection contract.
253
+
- Never use patterns like `this.disconnectObject?.(this)` on objects that do not own that signal
254
+
connection contract.
211
255
- Do not ship fake behavior. If a UI label, schema description, README entry, or module subtitle says a feature is wired to NetworkManager, ModemManager, UPower, sensors, widgets, or GNOME internals, the code must actually call the relevant API or clearly describe itself as a fallback.
212
256
- Keep runtime capability checks honest. Hardware-specific modules must detect missing services/devices at runtime and stay inactive or degrade explicitly.
213
257
- Do not scatter `as unknown as ...` casts through feature modules. If GObject construction or Shell internals require a cast, isolate it in a small shared helper/factory with a clear name.
0 commit comments