Skip to content

Commit 7b72fd5

Browse files
committed
Add skills refactored from instructions
1 parent c187853 commit 7b72fd5

22 files changed

Lines changed: 363 additions & 246 deletions

File tree

.clinerules/project-standards.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/instructions/astro.instructions.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/instructions/css.instructions.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/instructions/docs.instructions.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/instructions/general.instructions.md

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -40,92 +40,41 @@ applyTo: "**"
4040
# Code Organization and Directory Structure
4141

4242
## src/lib Directory Restrictions
43+
4344
- **The src/lib directory is for server-side build code ONLY**
4445
- NO client-side code can go in src/lib (it gets bundled into server-side builds)
4546
- Client-side utilities should go in src/components/scripts/ or appropriate component directories
4647

4748
## API Code Organization
49+
4850
- **API endpoints** go in `src/pages/api/`
4951
- **Code files related to API endpoints** go in `src/pages/api/` and are prefixed with `_` (e.g., `_utils/`, `_contracts/`)
5052
- **API utility files** go specifically in the `_utils/` folder
5153
- **API contract/type files** go in `_contracts/` folder for centralized type definitions
5254

5355
## API Endpoints (Permission Required)
56+
5457
- **Do not create, recreate, or restore `src/pages/api/*` endpoints without explicit user permission.**
5558
- Prefer Astro Actions (`/_actions/...`) for new backend behavior unless instructed otherwise.
5659

5760
## Mixed Concern Files
61+
5862
- Files that straddle server-side API and client-side concerns (like API client wrappers) require clarification
5963
- **Ask before placing such files** - they may need special handling or alternative organization
6064
- Example: gdpr.client.ts (API client wrapper) - unclear placement due to mixed server/client concerns
6165

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-
7366
# Personality
7467

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:
113-
```astro
114-
<!-- CORRECT: In component definition -->
115-
<theme-picker transition:name="theme-picker-island" transition:persist>
116-
117-
<!-- WRONG: On component usage -->
118-
<ThemePicker transition:name="theme-picker-island" transition:persist />
119-
```
120-
12168
# Personality
69+
12270
- Do not apologize
12371
- Do not flatter me
12472
- Do not use superlatives lke "absolutely"
12573
- Be concise
12674
- Be direct
12775

12876
# Response Guidelines
77+
12978
- 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
13079
- Always wait for explicit permission before implementing suggested changes
13180
- Present suggestions as numbered options with pros/cons when applicable

.github/instructions/javascript.instructions.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/instructions/markdown.instructions.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/instructions/testing.instructions.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/skills/css/SKILL.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: css
3+
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.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# CSS references
2+
3+
Use these files as baseline examples for CSS patterns in this repo:
4+
5+
- `src/components/Toasts/NetworkStatus/index.module.css`
6+
- `src/styles/index.css`
7+
- `src/styles/vendor/mermaid.css`
8+
- `src/styles/theme-inline.css`
9+
10+
Key repo-specific constraints:
11+
12+
- Prefer low-specificity component classes.
13+
- Use theme tokens instead of ad-hoc colors.
14+
- Use z-index tokens from `src/styles/index.css` instead of numeric literals.

0 commit comments

Comments
 (0)