You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/general.instructions.md
+6-57Lines changed: 6 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,92 +40,41 @@ applyTo: "**"
40
40
# Code Organization and Directory Structure
41
41
42
42
## src/lib Directory Restrictions
43
+
43
44
-**The src/lib directory is for server-side build code ONLY**
44
45
- NO client-side code can go in src/lib (it gets bundled into server-side builds)
45
46
- Client-side utilities should go in src/components/scripts/ or appropriate component directories
46
47
47
48
## API Code Organization
49
+
48
50
-**API endpoints** go in `src/pages/api/`
49
51
-**Code files related to API endpoints** go in `src/pages/api/` and are prefixed with `_` (e.g., `_utils/`, `_contracts/`)
50
52
-**API utility files** go specifically in the `_utils/` folder
51
53
-**API contract/type files** go in `_contracts/` folder for centralized type definitions
52
54
53
55
## API Endpoints (Permission Required)
56
+
54
57
-**Do not create, recreate, or restore `src/pages/api/*` endpoints without explicit user permission.**
55
58
- Prefer Astro Actions (`/_actions/...`) for new backend behavior unless instructed otherwise.
56
59
57
60
## Mixed Concern Files
61
+
58
62
- Files that straddle server-side API and client-side concerns (like API client wrappers) require clarification
59
63
-**Ask before placing such files** - they may need special handling or alternative organization
60
64
- Example: gdpr.client.ts (API client wrapper) - unclear placement due to mixed server/client concerns
61
65
62
-
# Astro View Transitions Navigation
63
-
64
-
Components may have behavior dependent on Astro View Transitions navigation events. Choose the appropriate navigation method:
65
-
66
-
-**Fresh page load**: Use `page.goto(url)` for full browser navigation (no View Transitions, triggers full page lifecycle)
67
-
-**Client-side navigation**: Use `navigateToPage('/path')` for in-site navigation with View Transitions (triggers `astro:page-load` and other View Transition events)
68
-
69
-
Always use the `navigateToPage()` method for client-side navigation - never ad-hoc `click('a[href]')` calls. This maintains centralized control.
70
-
71
-
When a Playwright-native action (e.g., `page.click()`, `page.fill()`, `page.hover()`) is required, expose it through the shared `BasePage` helpers (e.g., `BasePage.click()`), then call that helper from tests instead of the raw Playwright API. This keeps all browser interactions centrally managed and makes future behavior changes (timeouts, logging, etc.) easier.
72
-
73
66
# Personality
74
67
75
-
# Testing Standards
76
-
77
-
## Astro Component Testing - Container API (MANDATORY)
78
-
79
-
-**NEVER use manual HTML strings in test files or fixtures.** They get out of sync with templates and are worse than no test at all.
80
-
-**ALWAYS use Astro's Container API** to create fixtures from actual .astro templates. See: https://docs.astro.build/en/reference/container-reference/
81
-
-**Test fixtures MUST import actual components**, not duplicate HTML. Example:
82
-
```astro
83
-
---
84
-
import MyComponent from '@components/MyComponent/index.astro'
85
-
const { testProp } = Astro.props
86
-
---
87
-
<MyComponent prop={testProp} />
88
-
```
89
-
-**Hard-coded HTML fixtures are FORBIDDEN.** If you find yourself writing HTML in a fixture, STOP and use the actual component instead.
90
-
- Reference the working example in src/components/Test/container.astro and its test file.
91
-
- Use experimental_AstroContainer.create() to instantiate the container.
92
-
- Use container.renderToString(Component) to get rendered HTML from actual Astro components.
93
-
- Configure Vitest with getViteConfig() from 'astro/config' to support Astro Container API.
94
-
- Test files should follow a client.spec.ts naming pattern or similar.
95
-
- Fixture files should follow a componentName.fixture.astro naming pattern (e.g., newsletter.fixture.astro).
96
-
- A working example test using the Container API is available at /home/kevin/Repos/Webstack Builders/Corporate Website/astro.webstackbuilders.com/src/components/Test/container.spec.ts
97
-
98
-
## E2E Testing Standards
99
-
100
-
-**NEVER hard-code content slugs in e2e tests** (e.g., `/articles/typescript-best-practices`, `/services/web-development`). Content can be deleted or renamed. Always dynamically fetch the first available item from listing pages (articles, services, case-studies, etc.) and navigate to it. This prevents test breakage when content changes.
101
-
-**Playwright E2E Tests**: ALWAYS run with `CI=1` and `FORCE_COLOR=1` environment variables (e.g., `CI=1 FORCE_COLOR=1 npx playwright test`). This prevents the Playwright test runner from launching its own dev server. The user maintains a running dev server for development.
102
-
-**NEVER run the full e2e test suite** unless explicitly requested by the user. The full suite is very resource intensive and takes over 10 minutes to run. Only run specific e2e test files when verification is needed (e.g., `CI=1 FORCE_COLOR=1 npx playwright test test/e2e/specific-file.spec.ts`).
103
-
-**NEVER start a dev server yourself**. The user runs their own dev server for development. When you need a dev server running, notify the user instead of starting one.
104
-
105
-
### Astro View Transitions Testing
106
-
107
-
-**Navigation method matters**: Choose between `page.goto()` and Astro's client-side navigation based on what you're testing:
108
-
- Use `page.goto(url)` for testing **fresh page loads** (full browser navigation, no View Transitions)
109
-
- Use `BasePage.click()` on navigation links or `BasePage.navigateToPage()` for testing **View Transitions** (client-side navigation within the site) so that all clicks flow through the centralized helpers
110
-
-**Wait for page load properly**: Use BasePage's `waitForPageLoad()` method to wait for `astro:page-load` event instead of arbitrary timeouts
111
-
-**NEVER use `page.waitForTimeout()`** for waiting on View Transitions - it's unreliable and slows tests. Use event-based waits instead
112
-
-**transition:persist directive**: Must be applied directly to HTML elements (including custom elements), not on Astro component wrappers. Example:
- When the user asks "What would you suggest", "what do you recommend", or similar language, provide multiple options with clear explanations but do NOT begin implementation
130
79
- Always wait for explicit permission before implementing suggested changes
131
80
- Present suggestions as numbered options with pros/cons when applicable
description: Use this skill when writing or reviewing CSS in this repository. Triggers include .css files, selector specificity, z-index usage, dark-mode theming, and Tailwind dark variant questions.
4
+
---
5
+
6
+
# CSS skill
7
+
8
+
Use this skill for stylesheet edits in this repository.
9
+
10
+
## Rules
11
+
12
+
- Prefer a single class selector for styling.
13
+
- Avoid ID selectors in CSS. Use classes or attributes instead.
14
+
- Avoid chaining state across unrelated roots.
15
+
- Avoid long selector chains. If more specificity is needed, add a single component class.
16
+
- Avoid `!important` except in vendor CSS and print rules.
17
+
- Do not use Tailwind `dark:` variant classes for dark-mode theming.
18
+
- Use the project's theme tokens and helper classes instead.
19
+
20
+
## Z-index rules
21
+
22
+
- Do not hard-code numeric `z-index` values.
23
+
- Use the z-index tokens defined in `src/styles/index.css`.
24
+
- If no existing token fits, ask the user before adding a new token.
25
+
26
+
## Related guidance
27
+
28
+
- Theme color tokens remain governed by the always-on `theme-colors.instructions.md` rules.
29
+
30
+
## References
31
+
32
+
- See `.claude/skills/css/references/examples.md` for concrete repo examples.
0 commit comments