@samline/skills 0.3.0 → 0.4.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/README.md +1 -1
- package/bin/skills.mjs +19 -0
- package/package.json +1 -1
- package/skills/samline-catalog/SKILL.md +15 -5
- package/skills/samline-components/SKILL.md +26 -6
- package/skills/samline-debugging/SKILL.md +21 -11
- package/skills/samline-frontend/SKILL.md +52 -18
- package/skills/samline-i18n/SKILL.md +22 -5
- package/skills/samline-kickoff/SKILL.md +29 -8
- package/skills/samline-library/SKILL.md +44 -17
- package/skills/samline-library/references/dom-traps.md +15 -0
- package/skills/samline-motion/SKILL.md +47 -21
- package/skills/samline-motion/references/reveal-recipe.md +32 -8
- package/skills/samline-qa/SKILL.md +42 -15
- package/skills/samline-workflow/SKILL.md +95 -41
- package/skills/samline-workflow/references/agent-folders.md +62 -0
- package/skills/samline-workflow/references/lessons-and-memory.md +12 -3
- package/skills/samline-workflow/references/web-traps.md +7 -3
- package/skills-index.json +27 -25
- package/skills.json +2 -4
|
@@ -12,6 +12,8 @@ Each item is a rule and the reason behind it.
|
|
|
12
12
|
edit runs your logic twice.
|
|
13
13
|
- Re-enable a disabled control before waiting on it or moving focus: a
|
|
14
14
|
disabled element cannot take focus, so the focus call silently fails.
|
|
15
|
+
- `aria-invalid` follows what the user can see and fix: set it only on a
|
|
16
|
+
visible error, and clear it when the error is corrected.
|
|
15
17
|
|
|
16
18
|
## Observers and state
|
|
17
19
|
|
|
@@ -25,6 +27,19 @@ Each item is a rule and the reason behind it.
|
|
|
25
27
|
- Render initial choices as server `checked` or `selected` values. A late
|
|
26
28
|
prefill overwrote quick user edits.
|
|
27
29
|
|
|
30
|
+
## Overlays and focus
|
|
31
|
+
|
|
32
|
+
- Dismiss on outside press only when both press and release land on the
|
|
33
|
+
overlay; a drag that starts inside and ends outside must not close it.
|
|
34
|
+
- Ignore Escape while `isComposing`: it cancels the IME composition, not the
|
|
35
|
+
overlay.
|
|
36
|
+
- Restore focus with `focus({ preventScroll: true })` so closing does not jump
|
|
37
|
+
the page.
|
|
38
|
+
- Exiting or hidden items are `inert`, so they leave the tab order and the
|
|
39
|
+
accessibility tree while their exit runs.
|
|
40
|
+
- The trigger's `aria-expanded` and `aria-haspopup` persist across rebuilds;
|
|
41
|
+
a re-render must not drop them.
|
|
42
|
+
|
|
28
43
|
## Accessibility
|
|
29
44
|
|
|
30
45
|
- Never put `aria-label` on a toast or notification item that has visible text:
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: samline-motion
|
|
3
|
-
description: Motion rules for any site, in vanilla CSS and JavaScript: animate
|
|
3
|
+
description: "Motion rules for any site, in vanilla CSS and JavaScript: never animate layout properties (prefer opacity and transform), one owner per animated property, scroll reveal that never hides visible content, no animation on initial state, reduced-motion fallbacks, cleanup. Use when adding or reviewing transitions, entrances, scroll reveals, hover or open/close motion. Defers to the project's AGENTS.md, DESIGN.md and stack skill; reveal details are in references/reveal-recipe.md."
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Motion the samline way
|
|
8
8
|
|
|
9
|
+
Precedence: the user's current instructions, then the project's `AGENTS.md`,
|
|
10
|
+
`DESIGN.md` and `.agents/memory`, then the stack skill (and `samline-package`
|
|
11
|
+
in @samline/* repositories), then this skill. When this skill disagrees with
|
|
12
|
+
them, follow them and mention the conflict once. An absolute "never" below
|
|
13
|
+
defers to `DESIGN.md` or a recorded owner decision.
|
|
14
|
+
|
|
15
|
+
Scope: these rules govern how a site or app uses motion. A package that owns
|
|
16
|
+
the element (drawer panel, toast, ticker track) animates its own nodes; its
|
|
17
|
+
exit and closed states are not hidden start states, as long as content is not
|
|
18
|
+
hidden without JavaScript. The package ships its own `prefers-reduced-motion`
|
|
19
|
+
handling in its stylesheet.
|
|
20
|
+
|
|
9
21
|
Motion is a tool for orientation and feedback, not decoration. These rules are
|
|
10
22
|
vanilla CSS and JavaScript with no animation library and no framework
|
|
11
23
|
dependency. The stack skill defines where scripts and styles live. Before CSS or
|
|
@@ -15,32 +27,38 @@ evidence rules live in `samline-workflow`; markup rules in `samline-frontend`.
|
|
|
15
27
|
|
|
16
28
|
## Rules
|
|
17
29
|
|
|
18
|
-
- **
|
|
19
|
-
`
|
|
20
|
-
|
|
30
|
+
- **Never animate layout properties** (`width`, `height`, `top`/`left`,
|
|
31
|
+
`margin`, `padding`): they trigger layout every frame and drop frames. Prefer
|
|
32
|
+
`opacity` and `transform` (the individual `translate`, `scale`, `rotate`
|
|
33
|
+
properties are fine). Short paint-only feedback (color, background, shadow,
|
|
34
|
+
filter, `clip-path`) is allowed when measured; `DESIGN.md` decides.
|
|
21
35
|
- **Never `transition: all`**; list the properties. `all` animates properties
|
|
22
36
|
you did not intend, including ones added later.
|
|
23
37
|
- **No persistent `will-change`.** Set it just before an animation and remove
|
|
24
38
|
it after; a permanent layer wastes memory and can blur text.
|
|
25
|
-
- **One owner per animated property.**
|
|
26
|
-
controls (a marquee track, a drawer panel, a parallax target), and
|
|
27
|
-
reveals that compete for one transform. Animate a wrapper instead.
|
|
39
|
+
- **One owner per animated property.** From a site, never animate a node that a
|
|
40
|
+
package controls (a marquee track, a drawer panel, a parallax target), and
|
|
41
|
+
never nest reveals that compete for one transform. Animate a wrapper instead.
|
|
28
42
|
- **The initial state or selection never animates.** On load, a restored
|
|
29
43
|
tab or a preselected option is simply there; animation marks change.
|
|
30
44
|
- **Never hide visible content to replay an entrance.** Content already on
|
|
31
45
|
screen at first observation stays natural. A block that disappears and
|
|
32
46
|
returns reads as a bug.
|
|
33
47
|
- **No hidden start state without JavaScript.** Content stays readable with
|
|
34
|
-
JavaScript off or an API missing (`samline-frontend`). The reveal recipe's
|
|
35
|
-
script-applied `pending` marker is the only permitted hidden state, applied
|
|
48
|
+
JavaScript off or an API missing (`samline-frontend` when installed). The reveal recipe's
|
|
49
|
+
script-applied `pending` marker is the only permitted hidden state for scroll reveals (script-applied hidden regions: samline-frontend), applied
|
|
36
50
|
only to targets still offscreen at first observation (see
|
|
37
51
|
`references/reveal-recipe.md`).
|
|
38
52
|
- **`prefers-reduced-motion` gets a static fallback.** The content is shown
|
|
39
53
|
immediately and any running effect is cancelled, including when the setting
|
|
40
54
|
changes mid-animation.
|
|
41
55
|
- **Prefer one purposeful motion moment** over identical entrances on every
|
|
42
|
-
section
|
|
43
|
-
the
|
|
56
|
+
section, unless `DESIGN.md` or the owner fixes a motion language; then follow
|
|
57
|
+
it. Uniform fade-ins on every block make the page feel slow and hide the
|
|
58
|
+
hierarchy.
|
|
59
|
+
- **Auto-moving content longer than 5 seconds needs a pause or stop control**
|
|
60
|
+
(carousels, marquees, tickers), or an owner exception documented in
|
|
61
|
+
`DESIGN.md`. Never suppress a package's own reduced-motion policy.
|
|
44
62
|
- **Get geometry from observers** (`IntersectionObserver`, `ResizeObserver`),
|
|
45
63
|
not from per-item scroll listeners, because listeners run on every scroll
|
|
46
64
|
frame.
|
|
@@ -56,8 +74,12 @@ skills) and write them in plain CSS and JavaScript:
|
|
|
56
74
|
|
|
57
75
|
- Keep durations short: fast for feedback and small state changes, longer only
|
|
58
76
|
for an entrance; slow motion reads as lag.
|
|
59
|
-
- Ease-out (decelerate) for
|
|
60
|
-
|
|
77
|
+
- Ease-out (decelerate) for entrances and short exits by default; continuous
|
|
78
|
+
loops (marquees, tickers) are linear; follow the project's effect dictionary
|
|
79
|
+
for page transitions (exits may use ease-in there). Make the easing explicit
|
|
80
|
+
and let the project set its own curve.
|
|
81
|
+
- Derive distances and speeds a library needs from `rem` at the API boundary,
|
|
82
|
+
never hardcoded `px`.
|
|
61
83
|
- Animation must be interruptible: a new input mid-animation continues from
|
|
62
84
|
the current state without a jump or a queue.
|
|
63
85
|
- Animate from where the element is (origin-aware), by a small distance; do
|
|
@@ -67,13 +89,15 @@ skills) and write them in plain CSS and JavaScript:
|
|
|
67
89
|
|
|
68
90
|
## Scroll reveal
|
|
69
91
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
92
|
+
If the project already has a reveal owner (a local runtime or a recipe), extend
|
|
93
|
+
it and never add a second one. Only when there is no reveal, use
|
|
94
|
+
`@samline/reveal` if the project already depends on it or `samline-catalog`
|
|
95
|
+
(when installed) recommends it, and record the choice in the project's
|
|
96
|
+
decisions. Otherwise follow
|
|
73
97
|
[references/reveal-recipe.md](references/reveal-recipe.md): states, first
|
|
74
98
|
observation rule, focus and hash handling, reduced motion, cleanup and the
|
|
75
|
-
acceptance matrix. A
|
|
76
|
-
|
|
99
|
+
acceptance matrix. A reveal that hides visible content (for example fading in
|
|
100
|
+
every block unconditionally) is retired, not extended.
|
|
77
101
|
|
|
78
102
|
## Check before "done"
|
|
79
103
|
|
|
@@ -93,6 +117,8 @@ acceptance matrix. A different, simpler reveal that contradicts the recipe
|
|
|
93
117
|
- Keep a presentation frame (a counter's intro, a flip) separate from the
|
|
94
118
|
logical value, accessible label and stored value.
|
|
95
119
|
- A loop seam needs one shared gap: test the last-to-first boundary.
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
- Updating options (theme, speed) must not restart running timers or
|
|
121
|
+
animations: pass only what changed.
|
|
122
|
+
- A package's stylesheet carries its own reduced-motion handling; do not
|
|
123
|
+
duplicate or override it from a site.
|
|
124
|
+
- View transitions: use the stack's view-transitions skill when installed.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Scroll reveal recipe (vanilla JS and CSS)
|
|
2
2
|
|
|
3
|
-
Use this when
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Use this only when the project has no reveal owner and `@samline/reveal` is not
|
|
4
|
+
installed or recommended. If a reveal owner exists, extend it instead. It is a
|
|
5
|
+
recipe to adapt inside the section that owns the targets, not a global
|
|
6
|
+
animation system. Reuse the project's lifecycle owner if it has one. No library
|
|
7
|
+
is needed.
|
|
6
8
|
|
|
7
9
|
## States
|
|
8
10
|
|
|
@@ -47,10 +49,19 @@ delay and no stagger.
|
|
|
47
49
|
8. **bfcache.** A persisted `pagehide` keeps controllers alive; `pageshow`
|
|
48
50
|
reuses them without replay. Only a real back/forward navigation proves it;
|
|
49
51
|
synthetic events only exercise listener branches.
|
|
50
|
-
9. **
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
9. **Animation promises.** Cancelling rejects `animation.finished`; handle or
|
|
53
|
+
avoid awaiting it so cancel never throws an unhandled rejection.
|
|
54
|
+
10. **No layered fill.** `fill: forwards` keeps the effect layered over later
|
|
55
|
+
styles; finish by restoring natural styles instead.
|
|
56
|
+
11. **Silent for assistive technology.** Decorative opacity must not create
|
|
57
|
+
`aria-live` announcements; keep targets out of live regions.
|
|
58
|
+
12. **Group markers.** A group marker (a wrapper that only tags its children)
|
|
59
|
+
never wraps children at runtime; mark each target instead.
|
|
60
|
+
13. **Explicit easing.** Ease-out by default; the project can set its own curve.
|
|
61
|
+
14. **Dynamic content** (deferred or client-rendered) needs an explicit owner
|
|
62
|
+
that calls setup after inserting the real wrapper and cleanup before
|
|
63
|
+
removing it. A placeholder is never a target. Do not add a global
|
|
64
|
+
mutation observer.
|
|
54
65
|
|
|
55
66
|
## Controller sketch
|
|
56
67
|
|
|
@@ -74,6 +85,16 @@ export const setupReveal = (element) => {
|
|
|
74
85
|
animation?.cancel();
|
|
75
86
|
animation = undefined;
|
|
76
87
|
};
|
|
88
|
+
const exposeHash = () => {
|
|
89
|
+
let id;
|
|
90
|
+
try {
|
|
91
|
+
id = decodeURIComponent(location.hash.slice(1));
|
|
92
|
+
} catch {
|
|
93
|
+
return; // A malformed hash cannot point inside the target.
|
|
94
|
+
}
|
|
95
|
+
const target = document.getElementById(id);
|
|
96
|
+
if (target && element.contains(target)) finish();
|
|
97
|
+
};
|
|
77
98
|
const cleanup = () => {
|
|
78
99
|
if (disposed) return;
|
|
79
100
|
disposed = true;
|
|
@@ -83,10 +104,10 @@ export const setupReveal = (element) => {
|
|
|
83
104
|
};
|
|
84
105
|
mounted.set(element, cleanup);
|
|
85
106
|
element.addEventListener("focusin", finish, { signal: events.signal });
|
|
107
|
+
window.addEventListener("hashchange", exposeHash, { signal: events.signal });
|
|
86
108
|
motion.addEventListener("change", () => motion.matches && finish(), {
|
|
87
109
|
signal: events.signal,
|
|
88
110
|
});
|
|
89
|
-
// Add a hashchange listener that finishes when the hash points inside.
|
|
90
111
|
|
|
91
112
|
if (
|
|
92
113
|
element.dataset.revealDone ||
|
|
@@ -98,6 +119,9 @@ export const setupReveal = (element) => {
|
|
|
98
119
|
finish();
|
|
99
120
|
return cleanup;
|
|
100
121
|
}
|
|
122
|
+
// Initial hash check: a deep link into the target must never hide it.
|
|
123
|
+
exposeHash();
|
|
124
|
+
if (element.dataset.revealDone) return cleanup;
|
|
101
125
|
|
|
102
126
|
observer = new IntersectionObserver(
|
|
103
127
|
(entries) => {
|
|
@@ -7,7 +7,14 @@ license: MIT
|
|
|
7
7
|
# QA: proof before "done"
|
|
8
8
|
|
|
9
9
|
Extends the evidence bar in `samline-workflow` (see its `evidence-and-qa.md`); it
|
|
10
|
-
never replaces it.
|
|
10
|
+
never replaces it.
|
|
11
|
+
|
|
12
|
+
Precedence: the user's current instructions, then the project's `AGENTS.md`,
|
|
13
|
+
`DESIGN.md` and `.agents/memory`, then the stack skill (and `samline-package` in
|
|
14
|
+
@samline/* repositories), then this skill. When this skill disagrees with them,
|
|
15
|
+
follow them and mention the conflict once. In a @samline/* repository,
|
|
16
|
+
`samline-package` and the repository's `AGENTS.md` are authoritative and this
|
|
17
|
+
skill never relaxes them.
|
|
11
18
|
|
|
12
19
|
## Rules
|
|
13
20
|
|
|
@@ -28,19 +35,34 @@ never replaces it. The project's `AGENTS.md` and the user's instructions win.
|
|
|
28
35
|
|
|
29
36
|
Check each row on the rendered page, not in the code:
|
|
30
37
|
|
|
31
|
-
| Axis | What to cover
|
|
32
|
-
| ---------- |
|
|
33
|
-
| Width |
|
|
34
|
-
| Text size | 200% browser text: nothing clips, overlaps or hides behind a fixed element
|
|
35
|
-
| Theme | Light and dark, including focus rings, borders and disabled states
|
|
36
|
-
| State | Hover, focus, pressed, current, disabled, empty, loading, error, success
|
|
37
|
-
| Copy | The longest real label and a long translation, not placeholder text
|
|
38
|
-
| Text width | Usable line length. No horizontal overflow is not enough: a column squeezed to a few characters still fails
|
|
39
|
-
| No JS | Content and navigation still work when scripts do not run
|
|
38
|
+
| Axis | What to cover |
|
|
39
|
+
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
40
|
+
| Width | 320, 390, 768 and 1440px, every breakpoint the project configures (both sides), the user's real width. Never invent breakpoints |
|
|
41
|
+
| Text size | 200% browser text: nothing clips, overlaps or hides behind a fixed element |
|
|
42
|
+
| Theme | Light and dark, including focus rings, borders and disabled states |
|
|
43
|
+
| State | Hover, focus, pressed, current, disabled, empty, loading, error, success. Open every transient UI (toast, drawer, popover, dialog) in each variant and both themes: check contrast and usable width inside it, and scroll position and focus return after closing |
|
|
44
|
+
| Copy | The longest real label and a long translation, not placeholder text |
|
|
45
|
+
| Text width | Usable line length. No horizontal overflow is not enough: a column squeezed to a few characters still fails |
|
|
46
|
+
| No JS | Content and navigation still work when scripts do not run |
|
|
40
47
|
|
|
41
48
|
Reason for the width rule: bugs live at boundaries, and the project's own
|
|
42
49
|
breakpoints are the only ones its CSS reacts to.
|
|
43
50
|
|
|
51
|
+
## Captures, journeys and verdicts
|
|
52
|
+
|
|
53
|
+
- Journeys: visit states in sequence, not only one by one: switch mode and come
|
|
54
|
+
back, repeat an action, close and reopen, correct an input. Then confirm
|
|
55
|
+
controls, results and links still agree.
|
|
56
|
+
- Label every capture (viewport, scroll position, mode, state), open the file
|
|
57
|
+
before sending it, and clear focus (the skip link) before a composition
|
|
58
|
+
capture. A capture artifact is not automatically a design defect.
|
|
59
|
+
- A verdict states its scope: fidelity to a reference, working behavior and
|
|
60
|
+
editorial quality are separate judgments. Without a quality reference, say the
|
|
61
|
+
verdict covers fidelity and behavior only.
|
|
62
|
+
- An automated accessibility pass is scoped evidence, not WCAG certification.
|
|
63
|
+
- Triage findings in order: broken tasks and inaccessible paths, missing
|
|
64
|
+
states, hierarchy and responsive drift, visual details, cleanup.
|
|
65
|
+
|
|
44
66
|
## Behavior checks
|
|
45
67
|
|
|
46
68
|
- SSR before hydration: read the initial HTML (view source or disable JS). A
|
|
@@ -70,7 +92,8 @@ breakpoints are the only ones its CSS reacts to.
|
|
|
70
92
|
- A failed or crashed run is "unverified", not a pass.
|
|
71
93
|
- Keep performance work inside the agreed boundary: do not trade visual or
|
|
72
94
|
content decisions for a score.
|
|
73
|
-
- Stop measurement servers you started
|
|
95
|
+
- Stop only the measurement servers you started; the project's managed dev
|
|
96
|
+
server stays under its manager (see `samline-workflow`, Dev servers and
|
|
74
97
|
processes).
|
|
75
98
|
|
|
76
99
|
## Test policy by project type
|
|
@@ -79,11 +102,15 @@ breakpoints are the only ones its CSS reacts to.
|
|
|
79
102
|
from the matrix above, and Playwright e2e only for critical flows (forms,
|
|
80
103
|
checkout, login). No coverage target; add unit tests where logic warrants them.
|
|
81
104
|
- Library: unit tests with coverage thresholds of 90 branches, 95 functions, 95
|
|
82
|
-
lines and 95 statements
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
lines and 95 statements (browser entry and CSS excluded from coverage; the
|
|
106
|
+
project's check script must pass); browser tests against the built artifacts
|
|
107
|
+
in Chromium, Firefox and WebKit; every copyable README example runs as a test.
|
|
108
|
+
See `samline-library` when installed.
|
|
85
109
|
- Pin one Playwright version per repository and install its browsers with the
|
|
86
|
-
repository's own Playwright
|
|
110
|
+
repository's own Playwright (`pnpm exec playwright install <browsers>`), so
|
|
111
|
+
every run uses the same builds. In @samline/* repos the version is the
|
|
112
|
+
template's exact pin, changed only in the template and then synced; never
|
|
113
|
+
change it locally.
|
|
87
114
|
- Test naming: see `samline-workflow` `references/evidence-and-qa.md`.
|
|
88
115
|
|
|
89
116
|
## Report
|
|
@@ -6,9 +6,16 @@ license: MIT
|
|
|
6
6
|
|
|
7
7
|
# Work the samline way (workflow)
|
|
8
8
|
|
|
9
|
-
These rules hold in every project.
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
These rules hold in every project. They only add to the project's own rules.
|
|
10
|
+
|
|
11
|
+
Precedence: the user's current instructions, then the project's `AGENTS.md`,
|
|
12
|
+
`DESIGN.md` and `.agents/memory`, then the stack skill (and `samline-package` in
|
|
13
|
+
@samline/* repositories), then this skill. When this skill disagrees with them,
|
|
14
|
+
follow them and mention the conflict once. An absolute "never" here defers to
|
|
15
|
+
`DESIGN.md` or an owner decision when one exists. In a @samline/* repository,
|
|
16
|
+
`samline-package` and the repository's `AGENTS.md` (with its synced family
|
|
17
|
+
block) are authoritative: this skill is the generic baseline and never relaxes
|
|
18
|
+
them. On a conflict follow them, then ask the maintainer.
|
|
12
19
|
|
|
13
20
|
## Authority
|
|
14
21
|
|
|
@@ -32,55 +39,80 @@ this skill, follow them and mention the conflict once.
|
|
|
32
39
|
- Never retry a mutation whose outcome is uncertain or that is not idempotent
|
|
33
40
|
(payments, external writes): check its state first, a retry can apply it twice.
|
|
34
41
|
- After a pull request is merged or closed, delete its local branch (`-D`,
|
|
35
|
-
squash merges hide ancestry), prune and fast-forward the
|
|
36
|
-
|
|
42
|
+
squash merges hide ancestry), prune and fast-forward the project's base branch
|
|
43
|
+
as recorded in `AGENTS.md` or memory (it may not be Git's default). Never touch
|
|
44
|
+
a branch the project marks as off limits, and never delete a branch with an
|
|
45
|
+
open PR or unmerged commits without asking.
|
|
37
46
|
|
|
38
47
|
## Language
|
|
39
48
|
|
|
40
|
-
- Reply
|
|
49
|
+
- Reply in the language the user writes in, or the project's recorded
|
|
50
|
+
communication language, with correct accents. Public text and repository docs
|
|
51
|
+
stay English: this skill ships to public repositories.
|
|
41
52
|
- Code comments, READMEs, commit messages, public docs and skills in English,
|
|
42
53
|
unless the project or the skill states another language.
|
|
43
54
|
|
|
44
55
|
## Tools
|
|
45
56
|
|
|
57
|
+
- The project's `AGENTS.md` defines its INSTALL tool and its RUN tool. Use them;
|
|
58
|
+
with split tools, install with the install tool and run scripts with the run
|
|
59
|
+
tool. The project's check or verify script (`package.json` is the source of
|
|
60
|
+
truth for its name) is the single meaning of "done" for source changes.
|
|
46
61
|
- In samline repositories: install with pnpm (`pnpm install`, `pnpm add -D`,
|
|
47
62
|
`pnpm exec`), run every script with `bun run <script>`. Never `bun install`,
|
|
48
63
|
`bun add`, `npm install` or yarn; only `pnpm-lock.yaml` is committed. Remove the
|
|
49
64
|
upstream `bun` skill after an autoskills refresh: it teaches the opposite.
|
|
50
65
|
- In client projects: keep the package manager and runtime the project already
|
|
51
66
|
uses. The samline policy is not a client requirement.
|
|
67
|
+
- pnpm's `minimumReleaseAge` blocks fresh releases on purpose. When a fresh
|
|
68
|
+
release is required, add an exact-version `minimumReleaseAgeExclude` entry in
|
|
69
|
+
`pnpm-workspace.yaml`; never lower the age or drop the setting.
|
|
52
70
|
- samline packages use each other through published npm versions only. Never
|
|
53
71
|
link, alias or import a sibling checkout. A primitive is published first, then
|
|
54
72
|
consumers upgrade. Retire a package with `npm deprecate`, never
|
|
55
73
|
`npm unpublish`: published projects still install it.
|
|
56
74
|
|
|
75
|
+
## Agent files: one source
|
|
76
|
+
|
|
77
|
+
- `.agents/` owns every agent file: instructions, memory, skills
|
|
78
|
+
(`.agents/skills/<name>`) and subagents per tool (`.agents/claude/`,
|
|
79
|
+
`.agents/codex/`). `CLAUDE.md` contains only `@AGENTS.md`.
|
|
80
|
+
- Tool folders (`.claude/`, `.codex/` and any other) hold only relative,
|
|
81
|
+
tracked symlinks into `.agents/` plus local, ignored settings. A real file
|
|
82
|
+
there is a fork that one tool sees and the others miss: move it into
|
|
83
|
+
`.agents/` and replace it with a link, merging first if both copies differ.
|
|
84
|
+
- Install, write and edit skills only in `.agents/skills/`, never in a tool
|
|
85
|
+
folder. See [agent-folders.md](references/agent-folders.md) for the layout
|
|
86
|
+
and the check commands.
|
|
87
|
+
|
|
57
88
|
## Explore before editing
|
|
58
89
|
|
|
59
90
|
1. Read the project's `AGENTS.md`, README and the files of record it names.
|
|
60
91
|
Memory may be outdated: check the real branch, status, manifest and scripts.
|
|
61
|
-
2. Graph first, Grep last
|
|
62
|
-
needed,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
3. Search `modern-web-guidance` before HTML, CSS or client-side JavaScript work.
|
|
92
|
+
2. Graph first, Grep last, as the project's `AGENTS.md` and its `codebase-memory`
|
|
93
|
+
skill describe: index when needed, use the graph for symbols and callers,
|
|
94
|
+
and keep Grep for literals, configuration and coverage gaps.
|
|
95
|
+
3. Search `modern-web-guidance` (when installed) before HTML, CSS or client-side
|
|
96
|
+
JavaScript work.
|
|
67
97
|
4. Check whether an existing package, component or helper already does the job
|
|
68
|
-
before writing a new one. For UI behavior,
|
|
69
|
-
|
|
98
|
+
before writing a new one. For UI behavior, check the project's installed
|
|
99
|
+
features first, then `samline-catalog` when installed.
|
|
70
100
|
|
|
71
101
|
## Delegate
|
|
72
102
|
|
|
73
|
-
The main session leads: it plans, decides and owns quality and security.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
`
|
|
77
|
-
|
|
103
|
+
The main session leads: it plans, decides and owns quality and security. When
|
|
104
|
+
the project's agents (`Explore`, `implementer`, `reviewer`) exist and delegation
|
|
105
|
+
is authorized, search and reading go to `Explore`, a planned multi-file change
|
|
106
|
+
to `implementer` and review of any non-trivial diff to `reviewer`, by model
|
|
107
|
+
alias, never a dated model ID. Do questions and one-file fixes directly. Verify
|
|
108
|
+
every agent report before calling work done. The project's `AGENTS.md` owns the
|
|
109
|
+
delegation and lock rules.
|
|
78
110
|
|
|
79
111
|
## Evidence before "done"
|
|
80
112
|
|
|
81
113
|
- Define what success looks like before implementing.
|
|
82
|
-
- Never say "should work". Run the project's
|
|
83
|
-
|
|
114
|
+
- Never say "should work". Run the project's check or verify script and report
|
|
115
|
+
failures with their output.
|
|
84
116
|
- Name what each check proves: a build is not responsive behavior, a mock is not
|
|
85
117
|
a live provider, localhost is not the deployed site, a fidelity match is not
|
|
86
118
|
editorial quality. Report only checks actually performed.
|
|
@@ -91,19 +123,34 @@ every agent report before calling work done.
|
|
|
91
123
|
|
|
92
124
|
## Where knowledge goes
|
|
93
125
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
126
|
+
When the project's `.agents/README.md` has a "Where a correction goes" section,
|
|
127
|
+
follow it. Otherwise this list is the fallback:
|
|
128
|
+
|
|
129
|
+
- `DESIGN.md`: visual taste and design corrections.
|
|
130
|
+
- Component README: component behavior and API.
|
|
131
|
+
- `memory/decisions.md`: architecture, rendering and data ownership.
|
|
132
|
+
- `AGENTS.md` or the frontend conventions file: project-wide conventions.
|
|
133
|
+
- A lessons file: technical traps that cost real time, as rule + reason.
|
|
134
|
+
- `todos.md`: open work, removed once done.
|
|
135
|
+
- The change description or `.local/` (ignored): evidence, private notes,
|
|
136
|
+
handoffs, upstream reports, credential-bearing references.
|
|
137
|
+
|
|
138
|
+
Rules for all of them:
|
|
139
|
+
|
|
140
|
+
- Memory is not a place for test counts, run logs, release diaries or history.
|
|
99
141
|
- Public repositories never hold dated reports, audits, transcripts, client
|
|
100
142
|
names or private paths. Personal global files (`~/.claude/CLAUDE.md`) never
|
|
101
143
|
go into any repository, not even a private backup.
|
|
102
144
|
- Memory holds current contracts: rewrite a rule in place when it changes,
|
|
103
145
|
never append dated entries, and drop superseded rules.
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
|
|
146
|
+
- Do not trim agent instructions to save context. Reconciling `.agents` per the
|
|
147
|
+
project's own README (removing superseded rules, size caps) is the project's
|
|
148
|
+
process and is allowed.
|
|
149
|
+
- In a @samline/* repository, a package lesson goes in that repository's
|
|
150
|
+
`AGENTS.md` above the synced family block, never inside it. A lesson true for
|
|
151
|
+
two or more packages is proposed to the maintainer for the family `AGENTS.md`,
|
|
152
|
+
not written into a skill. Outside the family, a lesson true for two or more
|
|
153
|
+
projects moves up to this collection.
|
|
107
154
|
- See [lessons-and-memory.md](references/lessons-and-memory.md) for the lesson,
|
|
108
155
|
failure-record and improvement formats.
|
|
109
156
|
|
|
@@ -112,17 +159,17 @@ every agent report before calling work done.
|
|
|
112
159
|
The detailed rules live in their own skills: `samline-frontend` (HTML, CSS,
|
|
113
160
|
platform), `samline-components`, `samline-motion`, `samline-i18n`, `samline-qa`
|
|
114
161
|
(evidence), `samline-debugging` and `samline-library` (JavaScript packages).
|
|
115
|
-
Use them when installed; the basics below hold everywhere.
|
|
162
|
+
Use them when installed; the basics below hold everywhere. These rules govern
|
|
163
|
+
how a site or app uses the web platform: a package that owns an element animates
|
|
164
|
+
its own nodes and ships its own reduced-motion handling.
|
|
116
165
|
|
|
117
166
|
- Content stays visible and usable without JavaScript; respect
|
|
118
167
|
`prefers-reduced-motion`; semantics and keyboard support are part of the API.
|
|
119
168
|
- No DOM access at import time; without a DOM, calls are no-ops.
|
|
120
169
|
- Arrow functions and closures, no classes or `this`; `destroy()` is idempotent.
|
|
121
170
|
- Icons and arrows are SVG, never Unicode glyphs (`↗ ↓ × ✓`).
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
- Check real long labels at breakpoint boundaries, at 320px, the project's
|
|
125
|
-
breakpoints and a wide desktop (see `samline-qa`), enlarged text, keyboard, overlays and overflow in a real browser.
|
|
171
|
+
- Check real long labels, enlarged text, keyboard, overlays and overflow in a
|
|
172
|
+
real browser at the widths `samline-qa` lists.
|
|
126
173
|
- Motion rules, including never hiding visible content to replay an entrance:
|
|
127
174
|
`samline-motion`.
|
|
128
175
|
- Motion skills (emilkowalski/skills) give principles, not APIs: write vanilla
|
|
@@ -131,13 +178,20 @@ Use them when installed; the basics below hold everywhere.
|
|
|
131
178
|
|
|
132
179
|
## Dev servers and processes
|
|
133
180
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
181
|
+
The project's server docs (`AGENTS.md`, README) own the procedure; these are the
|
|
182
|
+
generic limits.
|
|
183
|
+
|
|
184
|
+
- Never stop or restart a process you did not start or whose command and
|
|
185
|
+
project you have not confirmed. A user-owned session is never restarted
|
|
186
|
+
without authorization. Never delete lock files or use `--force` to free a port.
|
|
187
|
+
- Stop only measurement or preview servers you started, then confirm their ports
|
|
188
|
+
are free. The project's managed dev server stays under its documented manager.
|
|
189
|
+
- PID liveness, manager registration, a TCP listener and HTTP readiness are four
|
|
190
|
+
separate signals, and a busy port does not identify the project. A manager's
|
|
191
|
+
`status` may not be read-only: under restricted process visibility (EPERM) it
|
|
192
|
+
can mistake a healthy registration for stale and delete it.
|
|
193
|
+
- After config, `.env`, `package.json` or dependency changes the watcher may
|
|
194
|
+
restart or keep stale state: confirm HTTP readiness on the printed URL.
|
|
141
195
|
|
|
142
196
|
## Finish
|
|
143
197
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# One source for agent files
|
|
2
|
+
|
|
3
|
+
Every agent tool reads the same instructions, skills and subagents, so no tool
|
|
4
|
+
sees a rule or skill that another misses. `.agents/` owns the real files; each
|
|
5
|
+
tool's folder holds only relative symlinks and that tool's local settings.
|
|
6
|
+
|
|
7
|
+
## Layout
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
AGENTS.md project entry point (Codex and others read it natively)
|
|
11
|
+
CLAUDE.md one line: @AGENTS.md
|
|
12
|
+
.agents/
|
|
13
|
+
README.md index: where each kind of knowledge goes
|
|
14
|
+
AGENTS.md, memory/, lessons.md, todos.md
|
|
15
|
+
skills/<name>/SKILL.md every skill, flat (tools only look one level deep)
|
|
16
|
+
claude/<agent>.md Claude Code subagents
|
|
17
|
+
codex/config.toml Codex configuration
|
|
18
|
+
codex/agents/<agent>.toml Codex roles
|
|
19
|
+
skills-lock.json provenance and hashes of installed skills
|
|
20
|
+
.claude/
|
|
21
|
+
skills -> ../.agents/skills symlink
|
|
22
|
+
agents -> ../.agents/claude symlink
|
|
23
|
+
settings.local.json, launch.json local only, never committed
|
|
24
|
+
.codex/
|
|
25
|
+
config.toml -> ../.agents/codex/config.toml
|
|
26
|
+
agents -> ../.agents/codex/agents
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Another tool follows the same pattern: its entry file is a pointer to
|
|
30
|
+
`AGENTS.md` (an import or a one-line include), and its skills or agents folder is
|
|
31
|
+
a relative symlink into `.agents/`. If a tool cannot follow symlinks, generate
|
|
32
|
+
its copy from `.agents/` with a script and never edit the copy by hand.
|
|
33
|
+
|
|
34
|
+
## Rules
|
|
35
|
+
|
|
36
|
+
- Write and edit only inside `.agents/` and `AGENTS.md`. A real file inside
|
|
37
|
+
`.claude/`, `.codex/` or another tool folder is a fork: one tool reads it and
|
|
38
|
+
the others never do.
|
|
39
|
+
- Symlinks are relative (`../.agents/skills`) and tracked in Git, so they work
|
|
40
|
+
in every clone and machine.
|
|
41
|
+
- When an installer writes real folders into a tool folder (some create
|
|
42
|
+
`.claude/skills/<name>` per skill), move the content into `.agents/skills/`,
|
|
43
|
+
then replace the folder with a link. If both copies differ, merge first: never
|
|
44
|
+
delete the only copy of a local edit.
|
|
45
|
+
- Settings that hold personal paths, permissions or machine state
|
|
46
|
+
(`settings.local.json`, `launch.json`) stay local and ignored.
|
|
47
|
+
- Personal global files (`~/.claude/CLAUDE.md`, global skills) are never copied
|
|
48
|
+
into a repository; the project carries its own rules in `.agents/`.
|
|
49
|
+
|
|
50
|
+
## Check
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
# Real files under tool folders, other than local settings, mean a fork.
|
|
54
|
+
find .claude .codex -not -type d -not -type l \
|
|
55
|
+
-not -name settings.local.json -not -name launch.json 2>/dev/null
|
|
56
|
+
|
|
57
|
+
# Every link must resolve into .agents.
|
|
58
|
+
find .claude .codex -type l -exec sh -c 'printf "%s -> %s\n" "$1" "$(readlink "$1")"' _ {} \; 2>/dev/null
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The first command prints nothing in a correct project. `npx @samline/skills check`
|
|
62
|
+
also warns when `.claude/skills` holds real copies.
|
|
@@ -9,10 +9,17 @@ Write for a reader who has not seen the conversation. Keep each entry short.
|
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Group lessons by topic (components, dev server, configuration, images, widgets,
|
|
12
|
-
motion).
|
|
12
|
+
motion). `Rule + reason` is the only format inside `.agents`: no dates, no
|
|
13
|
+
narrative. In a @samline/* repository the lesson goes in that repository's
|
|
14
|
+
`AGENTS.md` above the synced family block, never inside it; a lesson for two or
|
|
15
|
+
more packages is proposed to the maintainer for the family `AGENTS.md`. Outside
|
|
16
|
+
the family, a lesson that holds in two or more projects moves to this collection.
|
|
13
17
|
|
|
14
18
|
## Failure record (settled problems)
|
|
15
19
|
|
|
20
|
+
Failure records are working notes: keep them in `.local/` or the pull request,
|
|
21
|
+
never in `.agents` or a public file, because they carry narrative and dates.
|
|
22
|
+
|
|
16
23
|
```md
|
|
17
24
|
### <Short title>
|
|
18
25
|
|
|
@@ -34,13 +41,15 @@ Never re-apply a reverted change without reading why it was reverted.
|
|
|
34
41
|
5. Owner decision.
|
|
35
42
|
6. Local proof.
|
|
36
43
|
7. Verification on the deployed target.
|
|
37
|
-
8.
|
|
44
|
+
8. Update the contract in place (rewrite the rule, delete the one it replaces).
|
|
45
|
+
The result of the work goes in the pull request, not in memory.
|
|
38
46
|
|
|
39
47
|
## Upstream findings
|
|
40
48
|
|
|
41
49
|
For a defect in a dependency, write `.local/upstream/<package>.md`: installed
|
|
42
50
|
version, sanitized reproduction, expected and actual behavior, defect or
|
|
43
|
-
preference, issue link and state.
|
|
51
|
+
preference, issue link and state. Check current releases and existing issues
|
|
52
|
+
first. Post it only when the user asks.
|
|
44
53
|
|
|
45
54
|
## What never goes in memory
|
|
46
55
|
|