@kenkaiiii/ggcoder 5.85.0 → 5.86.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/bulletproof/SKILL.md +69 -130
- package/assets/skills/bulletproof/references/agent-surface.md +22 -1
- package/assets/skills/bulletproof/references/audit-protocol.md +23 -6
- package/assets/skills/bulletproof/references/platform-playbooks.md +12 -0
- package/assets/skills/bulletproof/references/provenance.md +19 -2
- package/assets/skills/bulletproof/references/secure-defaults.md +13 -1
- package/assets/skills/bulletproof/references/supply-chain.md +8 -5
- package/assets/skills/bulletproof/references/threat-landscape.md +46 -57
- package/assets/skills/clarify/SKILL.md +2 -2
- package/assets/skills/code-review/SKILL.md +5 -11
- package/assets/skills/compliance-guard/SKILL.md +59 -212
- package/assets/skills/compliance-guard/references/artifacts.md +14 -1
- package/assets/skills/compliance-guard/references/eu-uk.md +17 -7
- package/assets/skills/compliance-guard/references/exposure-triage.md +16 -0
- package/assets/skills/compliance-guard/references/full-review.md +155 -0
- package/assets/skills/compliance-guard/references/lawsuit-vectors.md +14 -2
- package/assets/skills/compliance-guard/references/provenance.md +33 -2
- package/assets/skills/compliance-guard/references/sector-gates.md +15 -1
- package/assets/skills/compliance-guard/references/security-baseline.md +21 -34
- package/assets/skills/compliance-guard/references/trigger-map.md +15 -1
- package/assets/skills/compliance-guard/references/us.md +32 -8
- package/assets/skills/durable/SKILL.md +22 -29
- package/assets/skills/durable/references/agent-db-safety.md +2 -2
- package/assets/skills/durable/references/backups-and-runtime.md +6 -6
- package/assets/skills/durable/references/migrations-and-schema.md +5 -4
- package/assets/skills/evidence-led-ui/LICENSES.md +3 -4
- package/assets/skills/evidence-led-ui/SKILL.md +9 -14
- package/assets/skills/evidence-led-ui/references/archetypes.md +1 -1
- package/assets/skills/evidence-led-ui/references/direction.md +4 -12
- package/assets/skills/evidence-led-ui/references/methodology.md +3 -11
- package/assets/skills/evidence-led-ui/references/observed-patterns.md +1 -1
- package/assets/skills/evidence-led-ui/references/production-contract.md +2 -2
- package/assets/skills/evidence-led-ui/references/provenance.md +14 -14
- package/assets/skills/lean/SKILL.md +34 -50
- package/assets/skills/lean/references/playbooks.md +9 -7
- package/assets/skills/refactoring/SKILL.md +35 -50
- package/assets/skills/root-cause/SKILL.md +2 -2
- package/assets/skills/shared-language/SKILL.md +3 -3
- package/dist/app-sidecar/progress-manager.d.ts +20 -2
- package/dist/app-sidecar/progress-manager.js +15 -2
- package/dist/app-sidecar/progress-manager.js.map +1 -1
- package/dist/app-sidecar/royale-bug.d.ts +19 -0
- package/dist/app-sidecar/royale-bug.js +112 -0
- package/dist/app-sidecar/royale-bug.js.map +1 -0
- package/dist/app-sidecar/royale-deploy.d.ts +5 -0
- package/dist/app-sidecar/royale-deploy.js +76 -0
- package/dist/app-sidecar/royale-deploy.js.map +1 -0
- package/dist/app-sidecar/royale.d.ts +38 -0
- package/dist/app-sidecar/royale.js +251 -0
- package/dist/app-sidecar/royale.js.map +1 -0
- package/dist/app-sidecar.js +57 -3
- package/dist/app-sidecar.js.map +1 -1
- package/dist/core/agent-session.js +4 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bundled-agents.js +2 -2
- package/dist/modes/agent-home-mode.js +5 -5
- package/dist/modes/agent-home-mode.js.map +1 -1
- package/dist/modes/serve-mode.js +5 -5
- package/dist/modes/serve-mode.js.map +1 -1
- package/dist/system-prompt.js +1 -1
- package/dist/system-prompt.js.map +1 -1
- package/dist/tools/bash.js +8 -2
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/routine-output.d.ts +30 -0
- package/dist/tools/routine-output.js +203 -0
- package/dist/tools/routine-output.js.map +1 -0
- package/dist/tools/skill.d.ts +2 -0
- package/dist/tools/skill.js +18 -1
- package/dist/tools/skill.js.map +1 -1
- package/package.json +4 -4
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/LICENSE +0 -21
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/airbnb/DESIGN.md +0 -545
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/airtable/DESIGN.md +0 -554
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/apple/DESIGN.md +0 -562
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/binance/DESIGN.md +0 -634
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/bmw/DESIGN.md +0 -544
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/bmw-m/DESIGN.md +0 -503
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/bugatti/DESIGN.md +0 -454
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/cal/DESIGN.md +0 -542
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/claude/DESIGN.md +0 -589
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/clay/DESIGN.md +0 -541
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/clickhouse/DESIGN.md +0 -544
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/cohere/DESIGN.md +0 -451
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/coinbase/DESIGN.md +0 -570
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/composio/DESIGN.md +0 -506
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/cursor/DESIGN.md +0 -537
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/dell-1996/DESIGN.md +0 -632
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/elevenlabs/DESIGN.md +0 -504
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/expo/DESIGN.md +0 -526
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/ferrari/DESIGN.md +0 -531
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/figma/DESIGN.md +0 -578
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/framer/DESIGN.md +0 -544
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/hashicorp/DESIGN.md +0 -575
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/hp/DESIGN.md +0 -670
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/ibm/DESIGN.md +0 -550
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/intercom/DESIGN.md +0 -546
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/kraken/DESIGN.md +0 -125
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/lamborghini/DESIGN.md +0 -288
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/linear.app/DESIGN.md +0 -548
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/lovable/DESIGN.md +0 -298
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/mastercard/DESIGN.md +0 -365
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/meta/DESIGN.md +0 -683
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/minimax/DESIGN.md +0 -746
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/mintlify/DESIGN.md +0 -852
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/miro/DESIGN.md +0 -825
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/mistral.ai/DESIGN.md +0 -773
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/mongodb/DESIGN.md +0 -767
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/nike/DESIGN.md +0 -575
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/nintendo-2001/DESIGN.md +0 -649
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/notion/DESIGN.md +0 -821
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/nvidia/DESIGN.md +0 -640
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/ollama/DESIGN.md +0 -539
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/opencode.ai/DESIGN.md +0 -521
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/pinterest/DESIGN.md +0 -597
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/playstation/DESIGN.md +0 -661
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/posthog/DESIGN.md +0 -690
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/raycast/DESIGN.md +0 -669
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/renault/DESIGN.md +0 -589
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/replicate/DESIGN.md +0 -616
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/resend/DESIGN.md +0 -585
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/revolut/DESIGN.md +0 -636
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/runwayml/DESIGN.md +0 -244
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/sanity/DESIGN.md +0 -357
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/sentry/DESIGN.md +0 -551
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/shopify/DESIGN.md +0 -516
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/slack/DESIGN.md +0 -482
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/spacex/DESIGN.md +0 -363
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/spotify/DESIGN.md +0 -246
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/starbucks/DESIGN.md +0 -580
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/stripe/DESIGN.md +0 -487
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/supabase/DESIGN.md +0 -462
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/superhuman/DESIGN.md +0 -448
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/tesla/DESIGN.md +0 -286
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/theverge/DESIGN.md +0 -339
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/together.ai/DESIGN.md +0 -633
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/uber/DESIGN.md +0 -636
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/vercel/DESIGN.md +0 -736
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/vodafone/DESIGN.md +0 -538
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/voltagent/DESIGN.md +0 -521
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/warp/DESIGN.md +0 -526
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/webflow/DESIGN.md +0 -588
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/wired/DESIGN.md +0 -497
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/wise/DESIGN.md +0 -544
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/x.ai/DESIGN.md +0 -465
- package/assets/skills/evidence-led-ui/corpus/awesome-design-md/design-md/zapier/DESIGN.md +0 -537
- package/assets/skills/evidence-led-ui/data/corpus-manifest.json +0 -768
- package/assets/skills/evidence-led-ui/data/observations.json +0 -47053
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Contents
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Upstream corpus (not bundled) and nature of observations
|
|
6
6
|
- Refero boundary
|
|
7
7
|
- Accessibility standards
|
|
8
8
|
- UI craft research
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
- Q4 2026 refresh (3 October 2026): slop tells, platform status, legal dates
|
|
13
13
|
- Refresh policy
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Upstream corpus (not bundled)
|
|
16
16
|
|
|
17
17
|
- **Source:** [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md)
|
|
18
18
|
- **Pinned commit:** [`664b3e78fd1a298ba11973822da988483256d4b4`](https://github.com/VoltAgent/awesome-design-md/tree/664b3e78fd1a298ba11973822da988483256d4b4)
|
|
19
19
|
- **Archive:** `https://codeload.github.com/VoltAgent/awesome-design-md/tar.gz/664b3e78fd1a298ba11973822da988483256d4b4`
|
|
20
20
|
- **Retrieved:** 2026-07-13
|
|
21
|
-
- **License:** MIT, copyright 2026 VoltAgent
|
|
22
|
-
- **
|
|
21
|
+
- **License:** MIT, copyright 2026 VoltAgent (see `LICENSES.md`)
|
|
22
|
+
- **Analyzed:** all 74 `design-md/*/DESIGN.md` files present in the pinned archive; removed from this package on 22 October 2026, only derived counts and slugs remain
|
|
23
23
|
- **Excluded:** upstream previews, screenshots, media, fonts, website assets, private requests, and non-`DESIGN.md` content
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The analyzer verified each document's SHA-256 before producing observations; the manifest was not kept after the corpus was unbundled.
|
|
26
26
|
|
|
27
|
-
The pinned archive contains 74 documents. This differs from both the initial planning estimate of 75 and the upstream README badge of 73 at that commit. The
|
|
27
|
+
The pinned archive contains 74 documents. This differs from both the initial planning estimate of 75 and the upstream README badge of 73 at that commit. The extraction recorded the discrepancy rather than silently modifying the corpus.
|
|
28
28
|
|
|
29
29
|
## Nature of the observations
|
|
30
30
|
|
|
@@ -48,7 +48,7 @@ Therefore this skill must not bulk-scrape Refero, call undocumented Refero endpo
|
|
|
48
48
|
- **Web conformance floor:** [Web Content Accessibility Guidelines (WCAG) 2.2](https://www.w3.org/TR/WCAG22/), W3C Recommendation dated 12 December 2024 in the current publication fetched 2026-07-21. The [W3C WCAG overview](https://www.w3.org/WAI/standards-guidelines/wcag/) encourages the latest version and states that WCAG 2.2 conformance is backward compatible with WCAG 2.1 and 2.0.
|
|
49
49
|
- **Native application guidance:** [WCAG2ICT](https://www.w3.org/TR/wcag2ict-22/) explains how Level A and AA criteria apply to non-web software. It is informative guidance, not a normative standard, and native work still needs platform and product-specific accessibility requirements.
|
|
50
50
|
- **U.S. ADA context:** The Department of Justice [ADA web accessibility guidance](https://www.ada.gov/resources/web-guidance/) explains equal access and effective communication under Titles II and III. The current [Title II web and mobile app rule fact sheet](https://www.ada.gov/resources/2024-03-08-web-rule/) names WCAG 2.1 Level AA as its technical standard and documents scope, exceptions, and compliance timing. These sources were checked 2026-07-21.
|
|
51
|
-
- **Not the conformance target:** [W3C Accessibility Guidelines (WCAG) 3.0](https://www.w3.org/TR/wcag-3.0/) is a W3C Working Draft (dated 10 September 2026 when re-checked
|
|
51
|
+
- **Not the conformance target:** [W3C Accessibility Guidelines (WCAG) 3.0](https://www.w3.org/TR/wcag-3.0/) is a W3C Working Draft (dated 10 September 2026 when re-checked 22 October 2026). W3C says publication as a Working Draft does not imply endorsement and that it is inappropriate to cite as anything other than work in progress.
|
|
52
52
|
|
|
53
53
|
WCAG 2.2 Level AA is the default engineering floor because it includes and extends WCAG 2.1, but technical WCAG conformance alone does not prove compliance with the ADA or another law. Project, procurement, contractual, platform, and jurisdictional requirements may exceed this floor. Use the current official standard and obtain qualified product or legal review before making a legal-compliance claim.
|
|
54
54
|
|
|
@@ -67,7 +67,7 @@ The binding rulings in `references/craft-rulings.md` use these current sources:
|
|
|
67
67
|
- [Google Fonts CSS API](https://developers.google.com/fonts/docs/getting_started) and [web.dev font practices](https://web.dev/articles/font-best-practices): explicit families/weights, `font-display`, early discovery, preconnect for third-party origins, and layout-shift testing;
|
|
68
68
|
- [Google Fonts metadata](https://fonts.google.com/metadata/fonts), fetched 14 July 2026: current family availability and popularity ordering used for the inspiration list.
|
|
69
69
|
|
|
70
|
-
The motion recommendations were also checked against the pinned
|
|
70
|
+
The motion recommendations were also checked against the pinned upstream corpus. Several observed systems use color, underline, border, surface, icon, or opacity feedback instead of generic scale/translate hover lift. These remain independent observations, not official brand guidance.
|
|
71
71
|
|
|
72
72
|
Refero content was not accessed for this update because no authorized Refero MCP or user-provided export was available. The existing Refero boundary remains unchanged.
|
|
73
73
|
|
|
@@ -104,7 +104,7 @@ No source skill text is bundled or renamed. This skill rejects fixed palette/fon
|
|
|
104
104
|
|
|
105
105
|
The package structure was checked against the [Agent Skills specification](https://agentskills.io/specification), [Anthropic skill-authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices.md), [OpenAI Skills guidance](https://platform.openai.com/docs/guides/tools-skills), and [Agent Skills evaluation guidance](https://agentskills.io/skill-creation/evaluating-skills): loader-visible name/description metadata, a concise directly actionable `SKILL.md`, references one level from the root, focused on-demand documents, self-contained scripts, explicit validation, and evaluation-driven iteration. The installed GG Coder loader reads `name` and `description`; the portable `license` and `compatibility` fields are retained for other Agent Skills clients and safely ignored by GG Coder.
|
|
106
106
|
|
|
107
|
-
`SKILL.md` remains below the recommended 500-line limit. Reference files over 100 lines include a contents overview so an agent preview exposes the file's scope.
|
|
107
|
+
`SKILL.md` remains below the recommended 500-line limit. Reference files over 100 lines include a contents overview so an agent preview exposes the file's scope. Raw corpus data is not bundled; audits read the pinned upstream sources. The existing external A/B artifacts are unscored and predate the current contracts, so they are benchmark inputs rather than evidence that the current skill improves quality.
|
|
108
108
|
|
|
109
109
|
## Q4 2026 refresh (3 October 2026)
|
|
110
110
|
|
|
@@ -118,14 +118,14 @@ All accessed 3 October 2026 (SNAPSHOT).
|
|
|
118
118
|
|
|
119
119
|
### Platform status
|
|
120
120
|
|
|
121
|
-
- Baseline statuses in `references/direction.md` § 8 read from the [`web-features`](https://www.npmjs.com/package/web-features) package v3.40.1 (
|
|
121
|
+
- Baseline statuses in `references/direction.md` § 8 originally read from the [`web-features`](https://www.npmjs.com/package/web-features) package v3.40.1 (1 Oct 2026). Re-checked 22 Oct 2026: CSS anchor positioning became Baseline Newly available with Firefox 147 ([web.dev, Jan 2026](https://web.dev/blog/web-platform-01-2026)); `progress()` and `alpha()` became Baseline Newly available in Sep 2026 ([web.dev, Sep 2026](https://web.dev/blog/web-platform-09-2026)). The table now keeps stable rows only and defers newer features to a live [webstatus.dev](https://webstatus.dev) check.
|
|
122
122
|
- [Interop 2026 focus areas](https://github.com/web-platform-tests/interop/blob/main/2026/README.md) and [WebKit's announcement](https://webkit.org/blog/17818/announcing-interop-2026/): anchor positioning, scroll-driven animations, view transitions, dialogs and popovers, container style queries, among others.
|
|
123
|
-
- [WCAG 2.2](https://www.w3.org/TR/WCAG22/) Recommendation 12 Dec 2024; [WCAG 3.0](https://www.w3.org/TR/wcag-3.0/) Working Draft 10 Sep 2026.
|
|
123
|
+
- [WCAG 2.2](https://www.w3.org/TR/WCAG22/) Recommendation 12 Dec 2024; [WCAG 3.0](https://www.w3.org/TR/wcag-3.0/) Working Draft 10 Sep 2026 (still latest on 22 Oct 2026).
|
|
124
124
|
- [web.dev INP](https://web.dev/articles/inp): good at 200 ms or less, 75th percentile.
|
|
125
125
|
|
|
126
126
|
### Legal dates
|
|
127
127
|
|
|
128
|
-
- ADA Title II: DOJ interim final rule published 20 April 2026 (91 Fed. Reg. 20902) extends compliance to 26 April 2027 / 26 April 2028; WCAG 2.1 AA unchanged. Secondary confirmations: [Reed Smith](https://www.reedsmith.com/articles/doj-extends-digital-accessibility-compliance-dates-under-title-ii-of-the-ada/), [Seyfarth](https://www.adatitleiii.com/2026/04/doj-extends-ada-title-ii-website-accessibility-deadlines-for-governmental-entities-but-litigation-and-compliance-risks-remain/). Primary: [ada.gov web rule](https://www.ada.gov/resources/2024-03-08-web-rule/).
|
|
128
|
+
- ADA Title II: DOJ interim final rule published 20 April 2026 (91 Fed. Reg. 20902) extends compliance to 26 April 2027 / 26 April 2028; WCAG 2.1 AA unchanged. Secondary confirmations: [Reed Smith](https://www.reedsmith.com/articles/doj-extends-digital-accessibility-compliance-dates-under-title-ii-of-the-ada/), [Seyfarth](https://www.adatitleiii.com/2026/04/doj-extends-ada-title-ii-website-accessibility-deadlines-for-governmental-entities-but-litigation-and-compliance-risks-remain/). Primary: [ada.gov web rule](https://www.ada.gov/resources/2024-03-08-web-rule/) (dates re-checked 22 Oct 2026). Pending challenge: NFB v. DOJ, D. Md., filed May 2026, no ruling found as of 12 Oct 2026 (secondary: [titleii.org](https://titleii.org/title-ii-updates)).
|
|
129
129
|
- European Accessibility Act (Directive (EU) 2019/882): applies from 28 June 2025; [European Commission EAA page](https://commission.europa.eu/strategy-and-policy/policies/justice-and-fundamental-rights/disability/union-equality-strategy-rights-persons-disabilities-2021-2030/european-accessibility-act_en).
|
|
130
130
|
|
|
131
131
|
## Refresh policy
|
|
@@ -133,8 +133,8 @@ All accessed 3 October 2026 (SNAPSHOT).
|
|
|
133
133
|
A corpus refresh must be explicit:
|
|
134
134
|
|
|
135
135
|
1. choose and record a new upstream commit;
|
|
136
|
-
2.
|
|
137
|
-
3.
|
|
136
|
+
2. read the licensed `DESIGN.md` files at that commit outside the package;
|
|
137
|
+
3. record every hash and parser status;
|
|
138
138
|
4. rerun analysis and inspect changed denominators/outliers;
|
|
139
139
|
5. update synthesis claims and examples;
|
|
140
140
|
6. rerun validation.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lean
|
|
3
|
-
description: Use when speed or resource use matters. Do NOT use for correctness bugs.
|
|
3
|
+
description: "Use when speed or resource use matters: slow pages or startup, memory leaks, high CPU, bundle size, N+1 queries. Do NOT use for correctness bugs."
|
|
4
4
|
license: Performance engineering guidance, not a benchmark certification. Sources and snapshot date are recorded at the foot of each reference file.
|
|
5
|
-
compatibility: Snapshot dated 3 October 2026
|
|
5
|
+
compatibility: Snapshot dated 3 October 2026; Node release schedule, Core Web Vitals browser support and the current Next.js version re-verified 22 October 2026. Thresholds and tool names decay — re-verify before asserting them as current.
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Lean
|
|
@@ -13,48 +13,40 @@ compatibility: Snapshot dated 3 October 2026. Thresholds, tool names, and defaul
|
|
|
13
13
|
|---|---|---|
|
|
14
14
|
| Writing or editing a feature (any size) | **Inline gate** | Apply *Binding defaults* + *AI-code traps* while you write. One line in the reply on what you did. No benchmarks, no spawning. |
|
|
15
15
|
| Asked "make it faster / why slow / eating RAM / will it run smoothly", a regression, pre-ship | **Full pass** | Run *Full-pass workflow*. Read `references/playbooks.md` sections for the stacks found; `references/memory-and-processes.md` for any memory or process finding. |
|
|
16
|
-
| About to run `kill`/`pkill`/`taskkill`, or "stop that stuck process" | **Process safety** | Obey *Never kill your own host* first. |
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
**Process safety:** kill only an exact PID you started (the bash tool's rule); a process using lots of CPU/RAM is a finding to report, not a target. Details: `references/memory-and-processes.md`.
|
|
18
|
+
|
|
19
|
+
On from the first line of code: never ship the heavy version intending to "optimize later".
|
|
19
20
|
|
|
20
21
|
## Governing rules
|
|
21
22
|
|
|
22
|
-
1. **Measure, then cut.** In a pass, never optimize from vibes: baseline → find the bottleneck → fix → re-measure.
|
|
23
|
-
2. **Fix the shared cause once.** The N+1 belongs in the query layer, not a memo at each call site.
|
|
24
|
-
3. **Optimize user time, not machine time.** Startup, first paint, navigation, hot interactions, the nightly job.
|
|
25
|
-
4. **Memory should be flat.** After N cycles of the core loop, committed memory ≈ after 1. A climbing staircase is a leak
|
|
26
|
-
5. **Nothing outlives its job.** Timers, listeners,
|
|
23
|
+
1. **Measure, then cut.** In a pass, never optimize from vibes: baseline → find the bottleneck → fix → re-measure. Build-mode defaults apply without benchmarking.
|
|
24
|
+
2. **Fix the shared cause once.** The N+1 belongs in the query layer, not a memo at each call site.
|
|
25
|
+
3. **Optimize user time, not machine time.** Startup, first paint, navigation, hot interactions, the nightly job.
|
|
26
|
+
4. **Memory should be flat.** After N cycles of the core loop, committed memory ≈ after 1. A climbing staircase is a leak; a sawtooth back to baseline is GC.
|
|
27
|
+
5. **Nothing outlives its job.** Timers, listeners, subscriptions, watchers, child processes, temp files, locks: each has an owner that ends it on success *and* every failure path.
|
|
27
28
|
6. **Bounded by default.** Cache, queue, buffer, retry, log, list render: cap and eviction policy at creation.
|
|
28
|
-
7. **Small is fast.**
|
|
29
|
+
7. **Small is fast.** Deleting dead code, unused deps and duplicate styles is the cheapest optimization.
|
|
29
30
|
8. **Numbers or silence.** Before/after on the same machine and data, cold and warm. Say what moved, X → Y, and what you could not measure.
|
|
30
|
-
9. **No perf theater.** Complexity must pay for itself in measured user time, or revert it.
|
|
31
|
-
10. **Label evidence** on every claim: `RUNTIME` (measured), `CODE` (read in source), `DEDUCED` (inferred), `SNAPSHOT` (dated external source).
|
|
32
|
-
|
|
33
|
-
## Never kill your own host
|
|
34
|
-
|
|
35
|
-
Agent sessions run *inside* a host process (GG Coder's daemon/sidecar, an editor, a terminal multiplexer). Killing it kills this session and every sibling session mid-turn. This has happened.
|
|
36
|
-
|
|
37
|
-
- **Never kill by pattern.** No `pkill -f`, `killall`, `kill $(pgrep …)`, `taskkill /IM`, or loops over `ps | grep` output. Kill only an **exact PID or process group you started in this task** (you hold the PID from your own spawn or background-task handle).
|
|
38
|
-
- **Before touching any PID you did not start:** walk its ancestry (`ps -o pid,ppid,command -p <pid>`, repeat up the PPID chain) and your own (`$$`, `$PPID` upward). If it is you, an ancestor, or another instance of the same host binary (e.g. another `app-sidecar`/daemon) — **do not kill. Report it.**
|
|
39
|
-
- **A process using lots of CPU/RAM is a finding, not a target.** Report PID, command, RSS, age; recommend the fix. Orphan cleanup belongs to the app's startup sweep, never to a live session.
|
|
40
|
-
- Unsure whether you own it? You don't. Ask the user.
|
|
31
|
+
9. **No perf theater.** Complexity must pay for itself in measured user time, or revert it.
|
|
32
|
+
10. **Label evidence** on every claim: `RUNTIME` (measured), `CODE` (read in source), `DEDUCED` (inferred), `SNAPSHOT` (dated external source).
|
|
41
33
|
|
|
42
34
|
## Binding defaults (build mode)
|
|
43
35
|
|
|
44
|
-
- **Teardown ships with the feature.** Whatever you start is torn down in the same module, success and error paths. One cleanup handle per owner
|
|
36
|
+
- **Teardown ships with the feature.** Whatever you start is torn down in the same module, success and error paths. One cleanup handle per owner (`AbortController`, `dispose()`, `finally`).
|
|
45
37
|
- **Cap every accumulation.** LRU/TTL cache, bounded queue, paginated query, virtualized long list, capped retries with backoff + jitter, rotating logs.
|
|
46
|
-
- **Never block the interactive thread.** Work that can exceed a frame (web long-task threshold: 50 ms) is chunked (`scheduler.yield()` where supported, else `setTimeout` chunking), deferred, or moved to a worker / utility process / background thread.
|
|
47
|
-
- **Lazy by default, eager only for the first screen.** Rare routes, heavy editors, charts, optional SDKs: dynamic `import()
|
|
38
|
+
- **Never block the interactive thread.** Work that can exceed a frame (web long-task threshold: 50 ms) is chunked (`scheduler.yield()` where supported, else `setTimeout` chunking), deferred, or moved to a worker / utility process / background thread.
|
|
39
|
+
- **Lazy by default, eager only for the first screen.** Rare routes, heavy editors, charts, optional SDKs: dynamic `import()`.
|
|
48
40
|
- **Right-size media.** AVIF/WebP with fallback, explicit `width`/`height`, `srcset`/`sizes`, `loading="lazy"` below the fold, `fetchpriority="high"` on the one LCP image only — never lazy-load it.
|
|
49
41
|
- **Stream, don't hoard.** Stream files and large responses; cursor-paginate queries; chunk big jobs.
|
|
50
42
|
- **Timeout everything external.** Network, subprocesses, locks, queues — and tear down on timeout.
|
|
51
43
|
- **Price a dependency before adopting it** in anything user-facing (bundle impact client-side; `node --cpu-prof -e "require('mod')"` server/desktop).
|
|
52
44
|
- **Batch I/O.** One query for N rows; DOM reads before writes; debounce/throttle expensive handlers.
|
|
53
|
-
- **Events over polling.** Prefer push (WebSocket/SSE,
|
|
45
|
+
- **Events over polling.** Prefer push (WebSocket/SSE, watchers, webhooks). If you must poll: slowest tolerable interval, back off when idle, pause when hidden, stop on unmount.
|
|
54
46
|
|
|
55
47
|
## AI-code traps (check every generated diff)
|
|
56
48
|
|
|
57
|
-
|
|
49
|
+
Scan your own diff before replying.
|
|
58
50
|
|
|
59
51
|
| Trap | Detect | Fix |
|
|
60
52
|
|---|---|---|
|
|
@@ -70,9 +62,9 @@ The patterns agents produce most. Scan your own diff for them before replying.
|
|
|
70
62
|
|
|
71
63
|
## Full-pass workflow
|
|
72
64
|
|
|
73
|
-
1. **Profile the target from the code.** Shape
|
|
74
|
-
2. **Baseline, or say you cannot.**
|
|
75
|
-
3. **Sweep the
|
|
65
|
+
1. **Profile the target from the code.** Shape, surfaces users wait on, scale, platform constraints (low-end devices over the dev machine). Build the coverage ledger: areas × units.
|
|
66
|
+
2. **Baseline, or say you cannot.** Startup, p50/p99 latency, bundle sizes, RSS/heap at rest and after repeated cycles (`references/playbooks.md`). If nothing runs, do a `CODE`-labeled static pass and say plainly nothing was measured.
|
|
67
|
+
3. **Sweep the five areas, in order:**
|
|
76
68
|
|
|
77
69
|
| # | Area | Hunting |
|
|
78
70
|
|---|---|---|
|
|
@@ -80,10 +72,9 @@ The patterns agents produce most. Scan your own diff for them before replying.
|
|
|
80
72
|
| 2 | Runtime responsiveness | Long tasks / long animation frames, layout thrash, re-render storms, N+1, sync hot paths, missing pagination/virtualization, allocation churn |
|
|
81
73
|
| 3 | Memory | Forgotten timers/listeners/observers, detached DOM, unbounded maps, large captured closures, non-GC cycles, full-size media, whole-file loads |
|
|
82
74
|
| 4 | Processes & lifecycle | Unreaped children, orphans (killed node not tree), no signal handling, leaked ports/fds/locks/temp files, no startup sweep |
|
|
83
|
-
| 5 | Payload & dead weight | Unused deps/files/exports, dead CSS, two libs for one job, debug payloads shipped, tree-shaking blockers |
|
|
84
|
-
| 6 | Styling consistency | Same visual thing built three ways, literals duplicating tokens (design decisions are evidence-led-ui's call) |
|
|
75
|
+
| 5 | Payload & dead weight | Unused deps/files/exports, dead or duplicate CSS, two libs for one job, debug payloads shipped, tree-shaking blockers |
|
|
85
76
|
|
|
86
|
-
4. **Rank by user impact; fix the top three to five
|
|
77
|
+
4. **Rank by user impact; fix the top three to five**: straight away when the user asked to make it faster, otherwise report first and fix what they select.
|
|
87
78
|
|
|
88
79
|
| Severity | Meaning |
|
|
89
80
|
|---|---|
|
|
@@ -93,37 +84,30 @@ The patterns agents produce most. Scan your own diff for them before replying.
|
|
|
93
84
|
| Low | Dead code/styles, micro-tuning — only when adjacent to a real fix |
|
|
94
85
|
|
|
95
86
|
Record each baseline first. Prefer removing work over hiding it (delete the eager import > code-split it > defer it); prefer the platform primitive.
|
|
96
|
-
5. **Verify.** Re-measure exactly as baselined. Memory: cycle the path
|
|
97
|
-
6. **Leave one guard
|
|
87
|
+
5. **Verify.** Re-measure exactly as baselined. Memory: cycle the path, force GC, compare. Number didn't move → revert and say so.
|
|
88
|
+
6. **Leave one guard** with tools already installed and the existing CI: bundle budget, slow-query threshold, repeated-cycle memory assertion, a test that fails if the eager import returns. A guard needing a new package or CI workflow (`size-limit`, Lighthouse CI) is a recommendation unless the user agrees.
|
|
98
89
|
7. **Report.** Numbers first (X → Y, machine, data, date) → remaining findings ranked with file:line and fix → **not checked** list → changed vs recommended → dropped candidates (false positives). Label every claim.
|
|
99
90
|
|
|
100
91
|
## Scaling: one agent or several
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
- **Ledger:** rows = six areas × in-scope units. Each row ends checked-with-findings / checked-clean / not-checked(reason).
|
|
110
|
-
- **Child brief (self-contained):** absolute skill root and which `references/*.md` sections to read; slice paths; owned ledger rows; evidence labels; output = findings (file:line, label, severity, fix) + explicit `checked` / `not checked` lists; "read-only: do not kill, start, or benchmark anything". Use `owl`, or a general-purpose child if it must load this skill.
|
|
111
|
-
- **Measurement does not fan out on one machine.** Benchmarks, load tests, and memory-cycle runs stay in the main thread, or one child per *separate environment*, so numbers stay comparable (same machine, same data, same build). Never run benchmarks in parallel on the same machine — they distort each other.
|
|
112
|
-
- **Merge:** a failed, timed-out, or silent child → its rows are `not checked`, never clean. Re-open every reported file:line before reporting it.
|
|
113
|
-
- **Large pre-ship pass:** one fresh-context verifier child tries to disprove the top findings.
|
|
114
|
-
- **Edits stay serialized** in the main thread (or `bee` children on strictly disjoint files); re-measure once after merging.
|
|
93
|
+
- Stay single-threaded for the inline gate, single fixes, and a full pass on one deployable you can read fully.
|
|
94
|
+
- Fan out static review for several deployables or more ledger rows (five areas × units) than you can read: read-only repo helpers, one per surface (frontend / backend / processes & lifecycle).
|
|
95
|
+
- One researcher for a dated threshold or tool-status claim.
|
|
96
|
+
- **Measurement does not fan out on one machine.** Benchmarks, load tests and memory-cycle runs stay in the main thread, or one per separate environment, so numbers stay comparable.
|
|
97
|
+
- Helpers never kill, start, or benchmark anything. Re-measure once after merging.
|
|
98
|
+
|
|
99
|
+
Helper types, brief contents and merge rules come with the skill loader.
|
|
115
100
|
|
|
116
101
|
## Honesty rules
|
|
117
102
|
|
|
118
103
|
- Never state or imply the software is "fast", "optimized", or "leak-free". State what was measured, fixed, and left unchecked.
|
|
119
104
|
- A lint rule, analyzer, or profiler is never proof of absence; tools find a minority of what matters.
|
|
120
105
|
- Never invent a number, threshold, or version. Date-sensitive and unverified → `SNAPSHOT` or "verify this".
|
|
121
|
-
- "I could not measure this" is a useful output. A fabricated confirmation is not.
|
|
122
106
|
- Prototype with no users or load → say proportionality applies and stop early.
|
|
123
107
|
|
|
124
108
|
## Reference map
|
|
125
109
|
|
|
126
110
|
Resolve paths from the installed skill root. Load only what the profile triggered.
|
|
127
111
|
|
|
128
|
-
- `references/playbooks.md` — per-stack measurement and sweeps: web (Core Web Vitals, LoAF, React/Next/Vite), Node/backend, data & N+1, Electron, Tauri, mobile, native, Python, payload/dead-code tooling,
|
|
129
|
-
- `references/memory-and-processes.md` — leak taxonomy and detection per runtime; process lifecycle: host-safety
|
|
112
|
+
- `references/playbooks.md` — per-stack measurement and sweeps: web (Core Web Vitals, LoAF, React/Next/Vite), Node/backend, data & N+1, Electron, Tauri, mobile, native, Python, payload/dead-code tooling, duplicate styles.
|
|
113
|
+
- `references/memory-and-processes.md` — leak taxonomy and detection per runtime; process lifecycle: host-safety detail, zombies, orphans, tree kills, graceful shutdown, startup sweeps, container PID 1, leaked handles.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Lean — per-stack playbooks
|
|
2
2
|
|
|
3
|
-
Load only the sections the profile triggered. Commands assume a POSIX shell unless noted. Claims
|
|
3
|
+
Load only the sections the profile triggered. Commands assume a POSIX shell unless noted. Claims carry `SNAPSHOT` with their date (most 3 Oct 2026; Node, Next.js and Core Web Vitals support re-verified 22 Oct 2026); tool versions and thresholds decay — re-verify with web access before asserting as current.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
Web frontend · React / Next.js / Vite · Node.js / backend / API · Electron · Tauri · Mobile · Native / compiled · Python · Data & queries (N+1) · Payload & dead weight (incl. duplicate styles)
|
|
6
8
|
|
|
7
9
|
## Web frontend
|
|
8
10
|
|
|
@@ -19,7 +21,7 @@ SEO blogs claim 2026 "tightenings" (LCP 2.0 s, stricter INP). None appear on web
|
|
|
19
21
|
**Measure:**
|
|
20
22
|
|
|
21
23
|
- Lab: Lighthouse (DevTools, or `npx lighthouse <url> --output json`), DevTools Performance panel (long tasks, long animation frames, layout shifts), Network waterfall, Coverage tab for shipped-but-unused JS/CSS.
|
|
22
|
-
- Field: the `web-vitals` npm package; use its **attribution build** (`import { onINP } from "web-vitals/attribution"`) to get INP phase breakdown (input delay / processing / presentation) and the **Long Animation Frames (LoAF)** entries for the slow interaction — LoAF names the script and function that blocked the frame. LoAF is Chromium-only (
|
|
24
|
+
- Field: the `web-vitals` npm package; use its **attribution build** (`import { onINP } from "web-vitals/attribution"`) to get INP phase breakdown (input delay / processing / presentation) and the **Long Animation Frames (LoAF)** entries for the slow interaction — LoAF names the script and function that blocked the frame. LCP and INP are Baseline Newly available since Safari 26.2 (Dec 2025), so RUM collects them in Safari too; LoAF is still Chromium-only (`SNAPSHOT` 22 Oct 2026); script attribution misses cross-origin iframes, workers, and extensions.
|
|
23
25
|
- SPAs: route changes after the first load are not separate page views in CrUX. Chrome's **Soft Navigations API** was in a final origin trial (Chrome 147–149) with a planned 2026 ship; how CrUX will use it is undecided (`SNAPSHOT`). Until it ships, measure SPA route transitions yourself (`performance.mark` around route change → next paint).
|
|
24
26
|
- Regression gate: Lighthouse CI with assertions (budgets on LCP/CLS/TBT and resource sizes) and/or `size-limit` on bundle bytes.
|
|
25
27
|
|
|
@@ -39,12 +41,12 @@ SEO blogs claim 2026 "tightenings" (LCP 2.0 s, stricter INP). None appear on web
|
|
|
39
41
|
## React / Next.js / Vite
|
|
40
42
|
|
|
41
43
|
- **React Compiler 1.0** (stable Oct 2025; works for React and React Native) auto-memoizes components and hooks. With it on, write plain code; React's guidance keeps `useMemo`/`useCallback` only as an escape hatch (e.g. a value used as an effect dependency). In existing code, don't mass-delete manual memo — removing it can change compiled output; remove only with tests. Without the compiler, memo only what the React DevTools Profiler implicates. The compiler does **not** fix effects: an effect that refetches on every render is still a bug.
|
|
42
|
-
- **Next.js 16** (Oct
|
|
44
|
+
- **Next.js 16** (16.4 current, `SNAPSHOT` 22 Oct 2026): Turbopack is the default bundler for dev and build. Caching is explicit — with `cacheComponents: true`, dynamic code runs per request and only `"use cache"` functions/components are cached (tune with `cacheLife`/`cacheTag`, invalidate with `revalidateTag`/`updateTag`). Perf checks: is expensive shared data cached? is per-user data kept out of shared cache (`"use cache: private"`)? is `"use client"` pushed down to leaves? are request waterfalls in server components parallelized? Turn on `reactCompiler: true` when the codebase passes the compiler's rules.
|
|
43
45
|
- **Vite 8** (stable 12 Mar 2026): Rolldown (Rust) replaces esbuild + Rollup as the single bundler; config key `build.rollupOptions` → `build.rolldownOptions`; needs Node 20.19+/22.12+. Vite 7 projects still use Rollup. Build-time wins are not runtime wins — measure the shipped bundle, not the build clock.
|
|
44
46
|
|
|
45
47
|
## Node.js / backend / API
|
|
46
48
|
|
|
47
|
-
**Runtime:** Node
|
|
49
|
+
**Runtime:** Node 24 has been in maintenance since 20 Oct 2026 (EOL 30 Apr 2028); Node 26 becomes Active LTS on 28 Oct 2026; Node 22 EOL 30 Apr 2027. From 27.x Node ships one major per year and every major becomes LTS (`SNAPSHOT` 22 Oct 2026, nodejs/Release schedule). New projects target 26. Bun/Deno: same rules apply; benchmark your workload before switching runtimes for speed — vendor benchmarks are not your app.
|
|
48
50
|
|
|
49
51
|
**Measure:** `autocannon` or `k6` for load (watch p99, not the average — the average lies), `clinic doctor` / `clinic flame` / `0x` for CPU and event-loop diagnosis, `--inspect` + Chrome DevTools for heap. DB: slow-query log, `EXPLAIN ANALYZE`.
|
|
50
52
|
|
|
@@ -123,10 +125,10 @@ Generators/streams instead of list-building for large data; vectorize hot loops
|
|
|
123
125
|
|
|
124
126
|
**Sweep list:** `knip` in CI; duplicate dependencies (`pnpm why <pkg>`, `npm ls <pkg>`) — two versions of one library is double weight; "two of the same job" audit (two icon sets, two date libs, two CSS systems, a utility lib plus hand-rolled copies of its functions); polyfills for browsers no longer supported; debug/symbol payloads shipped in release (strip; source maps to a symbol server, not the bundle); largest-files audit (`du`, bundle analyzer) — the top ten files are usually the whole story; unused assets in repos (images, fonts nobody references).
|
|
125
127
|
|
|
126
|
-
##
|
|
128
|
+
## Duplicate styles (payload view)
|
|
127
129
|
|
|
128
130
|
The rule: **one way to express one visual decision.** Hunt repeated rule blocks that differ by one value, spacing/color literals that duplicate existing design tokens, the same component styled three ways, utility classes wrapped around handwritten CSS doing the same job, dead rules for removed components. Each duplication is bytes today and divergence tomorrow. Kill the copies, keep the token. If resolving it requires a design *decision* (which of three styles is right), that call belongs to evidence-led-ui — coordinate rather than decide unilaterally.
|
|
129
131
|
|
|
130
132
|
---
|
|
131
133
|
|
|
132
|
-
**Provenance:** snapshot 3 October 2026 (
|
|
134
|
+
**Provenance:** snapshot 3 October 2026; re-verified 22 Oct 2026: Node schedule (https://github.com/nodejs/Release/blob/main/schedule.json , https://nodejs.org/en/blog/announcements/evolving-the-nodejs-release-schedule), LCP/INP Baseline (https://web.dev/blog/lcp-and-inp-are-now-baseline-newly-available), Next.js 16.4 (npm `next` latest). Other sources accessed 3 Oct 2026: https://web.dev/articles/vitals (thresholds); https://web.dev/articles/find-slow-interactions-in-the-field and https://developer.chrome.com/docs/web-platform/long-animation-frames (attribution build, LoAF); https://developer.chrome.com/blog/final-soft-navigations-origin-trial (Chrome 147–149, CrUX use undecided); Speculation Rules support from secondary 2026 coverage (corewebvitals.io, uploadcare.com — Chromium default, Safari 26.2 flag; re-verify on caniuse); https://react.dev/blog/2025/10/07/react-compiler-1; https://nextjs.org/docs/app/api-reference/directives/use-cache; https://vite.dev/blog/announcing-vite8; https://github.com/nodejs/Release/blob/main/schedule.json (Node release dates); https://docs.python.org/3/whatsnew/3.14.html (PEP 779); React Native 0.82 release coverage (New Architecture only, Hermes V1 experimental). Carried from the 17 Aug 2026 snapshot, not re-verified: Electron official performance tutorial (module cost, lazy loading, main-process blocking, profiling guidance), Rust std `process::Child` docs (zombie reaping), Knip documentation and 2026 ecosystem coverage (dead-code standard claim — `SNAPSHOT`), Valgrind/LeakCanary/Instruments/pprof public docs for tool usage. Version-specific flags and thresholds decay fastest; re-verify before asserting.
|
|
@@ -6,82 +6,67 @@ license: Behavior-preservation methodology synthesized from public sources (Fowl
|
|
|
6
6
|
|
|
7
7
|
# Refactoring
|
|
8
8
|
|
|
9
|
-
**Scope gate:** Decide from the requested behavior, not the word "refactor". A requested change to return values, error handling, or an API contract is implementation work
|
|
9
|
+
**Scope gate:** Decide from the requested behavior, not the word "refactor". A requested change to return values, error handling, or an API contract is implementation work: inspect the callers, change the contract and callers together, add regression coverage, run the checks. Do not manufacture a separate pure-rename stage merely to enter this skill. Existing authorization and safety controls still apply. For a genuine behavior-preserving refactor, use the gated loop below unchanged.
|
|
10
10
|
|
|
11
11
|
**Route first:**
|
|
12
12
|
|
|
13
13
|
| Situation | Mode | Next |
|
|
14
14
|
|---|---|---|
|
|
15
|
-
| Tidy
|
|
16
|
-
| User wants a plan, architectural change, or competing approaches | **
|
|
17
|
-
| No/red/unrunnable tests, or migration bigger than one session | **
|
|
15
|
+
| Tidy code you are already touching, suite green | **In-the-small** | Execute loop, inline; keep cleanup to files you are touching |
|
|
16
|
+
| User wants a plan, architectural change, or competing approaches | **Plan-first** | Interview, verify claims in the repo, fix scope as in/out lists, check coverage (thin coverage is a question, not an assumption), then a plan of tiny commits that each leave the code working. No file paths or snippets in the plan; they go stale |
|
|
17
|
+
| No/red/unrunnable tests, or a migration bigger than one session | **Legacy** | `references/legacy.md` before any edit |
|
|
18
18
|
| Same mechanical change across >~10 files or >~500 lines | **Codemod** | `references/legacy.md` → Codemods |
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
**Without tests, you're not refactoring — you're editing.**
|
|
20
|
+
Every observable behavior before the refactoring, bugs included, must exist after it. **Without tests, you're not refactoring — you're editing.**
|
|
23
21
|
|
|
24
22
|
## Governing rules
|
|
25
23
|
|
|
26
|
-
1. **Two hats.**
|
|
27
|
-
2. **The baseline is a gate, not advice.** Before the first edit
|
|
28
|
-
3. **One named transformation per step
|
|
29
|
-
4. **Red means revert, not debug.** After each step
|
|
30
|
-
5. **Never touch tests to get green.**
|
|
31
|
-
6. **Smallest suite per step, full suite per finish
|
|
32
|
-
7. **Prove it
|
|
33
|
-
8. **Make the change easy, then make the easy change
|
|
34
|
-
9. **Public API surface is observable behavior.**
|
|
35
|
-
10. **Edit sources, not generated output
|
|
36
|
-
|
|
37
|
-
## Modes
|
|
38
|
-
|
|
39
|
-
**1. In-the-small** — tidy a module, extract a function, kill duplication while working. The execute loop below, inline, without ceremony. Keep litter-pickup bounded to files you are already touching; a boy-scout sweep across the repo is scope creep.
|
|
40
|
-
|
|
41
|
-
**2. Plan-first** — the user asks for a refactor plan, the change is architectural, or multiple approaches compete. Interview the problem, explore the repo to verify claims, fix scope as in/out lists, check test coverage (thin coverage is a question to the user, not an assumption), then break the work into a plan of tiny commits — each commit leaves the codebase working. File it where the user wants (issue, doc, or just the reply). Do NOT embed file paths or code snippets in the plan — they go stale before the work starts.
|
|
42
|
-
|
|
43
|
-
**3. Legacy / untested** — no tests, unrunnable suite, or a migration too large for one session. Do not proceed with the normal loop. Go to `references/legacy.md`: characterization tests capturing *actual* current behavior (bugs included — log them, don't silently fix them), seams, branch-by-abstraction, parallel change (expand–migrate–contract), strangler fig.
|
|
24
|
+
1. **Two hats.** Add function or restructure, never both in one change. If new behavior is required, finish and prove the structural change first.
|
|
25
|
+
2. **The baseline is a gate, not advice.** Before the first edit the suite runs green on unmodified code, or you build a safety net first (Legacy). Record what you ran. A suite that was already red tells you nothing.
|
|
26
|
+
3. **One named transformation per step** (Extract Function, Move Function, Introduce Parameter…). If you cannot name it, it is a rewrite.
|
|
27
|
+
4. **Red means revert, not debug.** After each step run the smallest relevant suite. Green ⇒ commit if per-step commits were agreed, message = transformation name. Red ⇒ undo that step at once and take a smaller step. Undo by reversing that step's edits; `git restore` only when every earlier step is committed, because without per-step commits it also wipes the earlier steps in those files.
|
|
28
|
+
5. **Never touch tests to get green.** Modifying, loosening, or deleting an assertion in a pure refactor destroys the proof. A test that asserts private internals gets converted to observable behavior first, as its own step.
|
|
29
|
+
6. **Smallest suite per step, full suite per finish**: full suite + typecheck + lint on the commands CI runs, including every package that imports what you touched.
|
|
30
|
+
7. **Prove it.** The closing question is "can I prove nothing observable changed?": suites run, before/after outputs, a mutation spot-check on critical boundaries. Say what you could not verify.
|
|
31
|
+
8. **Make the change easy, then make the easy change.** Preparatory refactoring is the highest-value kind. Do it, then stop.
|
|
32
|
+
9. **Public API surface is observable behavior.** Across a published boundary (exports, endpoints, file layout): deprecate-and-alias unless the user chose the break.
|
|
33
|
+
10. **Edit sources, not generated output** (`dist/`, vendored, generated files).
|
|
44
34
|
|
|
45
35
|
## Execute loop
|
|
46
36
|
|
|
47
|
-
1. **Baseline.** Run the suite on unmodified code; record green.
|
|
48
|
-
2. **Commit checkpoint.**
|
|
49
|
-
3. **Pick one target
|
|
50
|
-
4. **Apply one named transformation.**
|
|
51
|
-
5. **Verify
|
|
52
|
-
6. **Close
|
|
37
|
+
1. **Baseline.** Run the suite on unmodified code; record green. Red or absent → Legacy. No VCS or a tree dirty with unrelated changes → say so and stop for direction.
|
|
38
|
+
2. **Commit checkpoint.** Ask once: "I'll commit each verified step on a branch — good?" If declined, keep steps small and report the step list at the end. Never commit without authorization.
|
|
39
|
+
3. **Pick one target** by risk-adjusted value: security → correctness → structure → duplication → naming; hotspots (churn × complexity) first. Smells and thresholds: `references/smells.md`.
|
|
40
|
+
4. **Apply one named transformation.** Mechanics in `references/smells.md`. Prefer language-aware tools (`code_nav`, IDE rename, AST codemods) over regex.
|
|
41
|
+
5. **Verify** per rule 4.
|
|
42
|
+
6. **Close** per rule 6. Report transformations applied, before/after, smells left and why, anything deferred. Check `references/agent-pitfalls.md` before closing.
|
|
53
43
|
|
|
54
|
-
## Risk
|
|
44
|
+
## Risk sets the safety net
|
|
55
45
|
|
|
56
46
|
| Risk | Touching | Minimum net before editing |
|
|
57
47
|
|---|---|---|
|
|
58
48
|
| Low | Pure internals, no I/O | Unit tests + types |
|
|
59
49
|
| Medium | Module boundary, parsing, state | + contract tests at the seam |
|
|
60
|
-
| High | Money, auth, concurrency, migrations, data | + integration tests, a rollback plan,
|
|
50
|
+
| High | Money, auth, concurrency, migrations, data | + integration tests, a rollback plan, small phases |
|
|
61
51
|
|
|
62
|
-
|
|
52
|
+
Unsure whether behavior could change: **do not apply — ask.**
|
|
63
53
|
|
|
64
54
|
## When NOT to refactor
|
|
65
55
|
|
|
66
|
-
- No
|
|
67
|
-
- The code is about to be deleted or replaced.
|
|
68
|
-
-
|
|
69
|
-
- The rewrite instinct
|
|
56
|
+
- No driver: nothing to add, nothing hurting.
|
|
57
|
+
- The code is about to be deleted or replaced.
|
|
58
|
+
- No safety net can be built and the risk is medium or higher: report and stop.
|
|
59
|
+
- The rewrite instinct ("let me start fresh"): that is a separate conversation with the user, not a refactor.
|
|
70
60
|
|
|
71
61
|
## Scaling: one agent or several
|
|
72
62
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
| Dated claim needed (framework migration, deprecated API) | One `researcher` child; label result SNAPSHOT with source URL. |
|
|
78
|
-
| Executing transformations | **Serialized in the main thread**, one named step at a time, revert-on-red. Never parallel edits on a shared tree. |
|
|
79
|
-
| Truly independent modules (no shared files, no import edges) | Optionally one `worker` per module on its own branch; each runs the full loop and its own baseline. Merge one branch at a time, full suite after each. |
|
|
80
|
-
|
|
81
|
-
Merge rule: a child that fails or omits a slice → that slice is `not checked`; treat its callers as unknown and do not change the public signature. Re-open each reported caller before relying on it.
|
|
63
|
+
- In-the-small, or one package you can fully read: main thread only.
|
|
64
|
+
- A changed symbol with many callers across packages: impact map first, one read-only repo helper per package returning every caller/import/dynamic reference as file:line. A slice not checked → treat its callers as unknown and keep the public signature.
|
|
65
|
+
- Transformations run serialized in the main thread, one named step at a time, revert-on-red; never parallel edits on a shared tree.
|
|
66
|
+
- Helper types, brief contents and merge rules come with the skill loader.
|
|
82
67
|
|
|
83
68
|
## References
|
|
84
69
|
|
|
85
|
-
- `references/smells.md
|
|
86
|
-
- `references/legacy.md
|
|
87
|
-
- `references/agent-pitfalls.md
|
|
70
|
+
- `references/smells.md`: smell catalog, metrics thresholds, prioritization, transformation mechanics
|
|
71
|
+
- `references/legacy.md`: characterization tests, seams, branch-by-abstraction, parallel change, strangler fig, codemods
|
|
72
|
+
- `references/agent-pitfalls.md`: how agents break "behavior-preserving", and the layered proof that catches it
|
|
@@ -5,7 +5,7 @@ description: Use when a bug resists the obvious fix or is flaky. Do NOT use when
|
|
|
5
5
|
|
|
6
6
|
# Root-Cause
|
|
7
7
|
|
|
8
|
-
Build a feedback loop, then let evidence kill hypotheses. Each phase has a gate. Keep a hypothesis log
|
|
8
|
+
Build a feedback loop, then let evidence kill hypotheses. Each phase has a gate. Keep a hypothesis log as working notes (`H# | prediction | experiment | result | verdict`); show it in the final answer when the ask was "why", otherwise summarise it in one line.
|
|
9
9
|
|
|
10
10
|
## Phase 1 — Build the loop
|
|
11
11
|
|
|
@@ -41,6 +41,6 @@ Hard rules: three failed fixes → the hypothesis list is wrong; return to Phase
|
|
|
41
41
|
## Scaling: one agent or several
|
|
42
42
|
|
|
43
43
|
- Reproduction, shrinking, and experiments: main thread only — one variable at a time.
|
|
44
|
-
- Wide codebase (several packages could own the bug): in Phase 3 you may send one read-only
|
|
44
|
+
- Wide codebase (several packages could own the bug): in Phase 3 you may send one read-only repo helper per hypothesis; brief = symptom, repro command, paths, "return file:line evidence for/against; do not run or edit". Treat replies as `CODE` leads to re-open, not verdicts. Helper types, brief contents and merge rules come with the skill loader.
|
|
45
45
|
|
|
46
46
|
Sources (accessed 3 October 2026): https://git-scm.com/docs/git-bisect; https://www.debuggingbook.org/html/DeltaDebugger.html
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: shared-language
|
|
3
|
-
description: Use when domain terms drift or a decision needs an ADR. Do NOT use for renames.
|
|
3
|
+
description: Use when domain terms drift (glossary, CONTEXT.md) or a hard-to-reverse decision needs an ADR (decision record). Do NOT use for renames.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Shared Language
|
|
@@ -27,6 +27,6 @@ Only when a decision is **hard to reverse**, **surprising without context**, and
|
|
|
27
27
|
|
|
28
28
|
## Scaling: one agent or several
|
|
29
29
|
|
|
30
|
-
Main thread only. On a large repo, one
|
|
30
|
+
Main thread only. On a large repo, one read-only repo helper may inventory competing terms across packages (occurrences with file:line); the main thread decides and edits. Helper types, brief contents and merge rules come with the skill loader.
|
|
31
31
|
|
|
32
|
-
Sources (
|
|
32
|
+
Sources (re-checked 22 October 2026): MADR 4.0.0, still the latest release (2024-09-17) — https://adr.github.io/madr/; ubiquitous language — https://martinfowler.com/bliki/UbiquitousLanguage.html
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
+
import type { RoyaleBugCategory } from "./royale-bug.js";
|
|
2
|
+
/** What a finished run did, beyond its commits, for GG Royale. */
|
|
3
|
+
export interface RunExtras {
|
|
4
|
+
/** The goal this run worked on (its coordinator's run), if any. */
|
|
5
|
+
goalId?: string | null;
|
|
6
|
+
/** The run handed work to workers (spawn_agent). */
|
|
7
|
+
workers?: boolean;
|
|
8
|
+
/** A deploy or publish command ran and succeeded. */
|
|
9
|
+
deployed?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** One run's outcome as GG Royale hears it (counts and labels only). */
|
|
12
|
+
export interface RunOutcome extends RunExtras {
|
|
13
|
+
commits: number;
|
|
14
|
+
bug?: RoyaleBugCategory | null;
|
|
15
|
+
}
|
|
1
16
|
import type { ProgressSnapshot } from "../core/progress/types.js";
|
|
2
17
|
export interface ProgressManager {
|
|
3
18
|
/** Current snapshot for GET /progress + the SSE ready path. */
|
|
4
19
|
snapshot: () => ProgressSnapshot;
|
|
5
20
|
/** Award XP for one successfully completed run (prompt + any new commits). */
|
|
6
|
-
awardRun: (cwd: string, runStartedAt: number, originId?: string) => Promise<void>;
|
|
21
|
+
awardRun: (cwd: string, runStartedAt: number, originId?: string, bug?: RoyaleBugCategory | null, extras?: RunExtras) => Promise<void>;
|
|
7
22
|
/** Close the ~/.gg fs.watch + clear any pending debounce (leak-free shutdown). */
|
|
8
23
|
dispose: () => void;
|
|
9
24
|
}
|
|
10
|
-
export declare function createProgressManager(agentDir: string, broadcastAll: (snapshot: ProgressSnapshot, originId?: string) => void
|
|
25
|
+
export declare function createProgressManager(agentDir: string, broadcastAll: (snapshot: ProgressSnapshot, originId?: string) => void,
|
|
26
|
+
/** Optional: called after each successful run award with the number of newly
|
|
27
|
+
* detected commits (0 if none). Must not throw (GG Royale reporting). */
|
|
28
|
+
onRunAwarded?: (outcome: RunOutcome) => void): Promise<ProgressManager>;
|
|
@@ -8,7 +8,10 @@ import { loadProgress, peekProgress, updateProgress } from "../core/progress/sto
|
|
|
8
8
|
import { awardPrompt, awardCommits } from "../core/progress/engine.js";
|
|
9
9
|
import { detectNewCommits, repoKey } from "../core/progress/git-xp.js";
|
|
10
10
|
import { rebuildFromSessions } from "../core/progress/rebuild.js";
|
|
11
|
-
export async function createProgressManager(agentDir, broadcastAll
|
|
11
|
+
export async function createProgressManager(agentDir, broadcastAll,
|
|
12
|
+
/** Optional: called after each successful run award with the number of newly
|
|
13
|
+
* detected commits (0 if none). Must not throw (GG Royale reporting). */
|
|
14
|
+
onRunAwarded) {
|
|
12
15
|
// Boot: recovery chain main → backup → coding + chat session rebuild → empty.
|
|
13
16
|
const coderSessionsDir = path.join(agentDir, "sessions");
|
|
14
17
|
let file = await loadProgress({
|
|
@@ -26,9 +29,10 @@ export async function createProgressManager(agentDir, broadcastAll) {
|
|
|
26
29
|
function snapshot() {
|
|
27
30
|
return buildSnapshot(file);
|
|
28
31
|
}
|
|
29
|
-
async function awardRun(cwd, runStartedAt, originId) {
|
|
32
|
+
async function awardRun(cwd, runStartedAt, originId, bug, extras = {}) {
|
|
30
33
|
try {
|
|
31
34
|
const now = Date.now();
|
|
35
|
+
let newCommits = 0;
|
|
32
36
|
const updated = await updateProgress(async (f) => {
|
|
33
37
|
const levelBefore = levelForXp(f.xp);
|
|
34
38
|
awardPrompt(f, now, cwd);
|
|
@@ -42,6 +46,7 @@ export async function createProgressManager(agentDir, broadcastAll) {
|
|
|
42
46
|
const detected = await detectNewCommits(cwd, lastHead, runStartedAt);
|
|
43
47
|
if (detected && detected.commits.length > 0) {
|
|
44
48
|
awardCommits(f, detected.commits, now, cwd);
|
|
49
|
+
newCommits = detected.commits.length;
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
f.repos[key] = { lastHead: probe.head };
|
|
@@ -57,6 +62,14 @@ export async function createProgressManager(agentDir, broadcastAll) {
|
|
|
57
62
|
file = updated;
|
|
58
63
|
lastSeenNonce = updated.lastEvent?.nonce ?? null;
|
|
59
64
|
broadcastAll(buildSnapshot(updated), originId);
|
|
65
|
+
try {
|
|
66
|
+
onRunAwarded?.({ commits: newCommits, ...(bug ? { bug } : {}), ...extras });
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
log("DEBUG", "app-sidecar", "run outcome hook failed", {
|
|
70
|
+
message: err instanceof Error ? err.message : String(err),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
60
73
|
}
|
|
61
74
|
catch (err) {
|
|
62
75
|
log("DEBUG", "app-sidecar", "progress award failed", {
|