Skip to content

Commit b071c05

Browse files
committed
docs(readme): update project overview and instruction references, new instructions for csharp, dotnet, nuxt, vue and tailwindcss
1 parent ac205c4 commit b071c05

7 files changed

Lines changed: 429 additions & 65 deletions

File tree

.github/copilot-instructions.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,25 @@ This repository contains guidelines and best practices for using GitHub Copilot
2929

3030
## 📚 Table of Contents
3131

32-
- **UI Guidelines**: Accessibility, design system, and styling principles for consistent, usable, and maintainable user interfaces.
33-
[Read more](./instructions/ui-guidelines.instructions.md)
34-
- **Project and Folder Structure**: Key directories and their roles in the project.
35-
[Read more](./instructions/project-file-structure.instructions.md)
36-
- **Tools, Libraries & Frameworks Instructions**: Core technologies, frameworks, and their versions used in this repository.
37-
[Read more](./instructions/tools.instructions.md)
38-
- **Coding Instructions**: Practical coding standards for JavaScript/TypeScript, CSS, and components, including semicolons, quotes, and function-based patterns.
39-
[Read more](./instructions/coding.instructions.md)
40-
- **Commit Message Instructions**: Conventional Commits format for clear, consistent commit messages.
41-
[Read more](./instructions/commit.instructions.md)
42-
- **Testing & TDD Instructions**: Test-driven development process, recommended tools, and test naming conventions.
43-
[Read more](./instructions/testing.instructions.md)
44-
- **Configuration Files Instructions**: Standards for configuration files such as .editorconfig, Prettier, and ESLint.
45-
[Read more](./instructions/config.instructions.md)
46-
- **Best Practices Instructions**: Universal coding principles (SOLID, DRY, KISS) for maintainable and efficient code.
47-
[Read more](./instructions/best-practices.instructions.md)
32+
- Coding standards ([coding.instructions.md](.github/instructions/coding.instructions.md))
33+
- Accessibility ([accessibility.instructions.md](.github/instructions/accessibility.instructions.md))
34+
- CSS ([css.instructions.md](.github/instructions/css.instructions.md))
35+
- Tailwind CSS ([tailwind.instructions.md](.github/instructions/tailwind.instructions.md))
36+
- HTML ([html.instructions.md](.github/instructions/html.instructions.md))
37+
- UI guidelines ([ui-guidelines.instructions.md](.github/instructions/ui-guidelines.instructions.md))
38+
- Commit messages ([commit.instructions.md](.github/instructions/commit.instructions.md))
39+
- Best practices ([best-practices.instructions.md](.github/instructions/best-practices.instructions.md))
40+
- Configuration files ([config.instructions.md](.github/instructions/config.instructions.md))
41+
- C# standards ([csharp.instructions.md](.github/instructions/csharp.instructions.md))
42+
- .NET standards ([dotnet.instructions.md](.github/instructions/dotnet.instructions.md))
43+
- JavaScript/TypeScript standards ([javascript-typescript.instructions.md](.github/instructions/javascript-typescript.instructions.md))
44+
- Vue standards ([vue.instructions.md](.github/instructions/vue.instructions.md))
45+
- Nuxt.js standards ([nuxt.instructions.md](.github/instructions/nuxt.instructions.md))
46+
- Markdown standards ([markdown.instructions.md](.github/instructions/markdown.instructions.md))
47+
- Project structure ([project-file-structure.instructions.md](.github/instructions/project-file-structure.instructions.md))
48+
- Security ([security.instructions.md](.github/instructions/security.instructions.md))
49+
- Testing & TDD ([testing.instructions.md](.github/instructions/testing.instructions.md))
50+
- Tooling ([tools.instructions.md](.github/instructions/tools.instructions.md))
4851

4952
---
5053

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
description: C# coding standards and conventions for the project.
3+
applyTo: "**/*.cs"
4+
---
5+
6+
# C# Coding Standards & Conventions
7+
8+
## General Guidelines
9+
10+
1. Use PascalCase for class, interface, enum, and method names.
11+
2. Use camelCase for local variables and parameters.
12+
3. Use explicit access modifiers (public, private, protected, internal) for all types and members.
13+
4. Prefer expression-bodied members for simple properties and methods.
14+
5. Use var for local variable declarations when the type is obvious from the right side of the assignment; otherwise, use the explicit type.
15+
6. Always use braces `{}` for all control flow statements (if, else, for, foreach, while, etc.), even for single statements.
16+
7. Use single quotes for char literals and double quotes for string literals.
17+
8. Prefer pattern matching and modern C# features where appropriate.
18+
9. Avoid magic numbers; use named constants or enums.
19+
10. Write XML documentation comments for public APIs, classes, and methods.
20+
11. End every statement with a semicolon.
21+
22+
## Example
23+
24+
```csharp
25+
/// <summary>
26+
/// Calculates the sum of two integers.
27+
/// </summary>
28+
public static int Add(int a, int b)
29+
{
30+
return a + b;
31+
}
32+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
description: .NET coding standards and conventions for the project.
3+
applyTo: "**/*.cs"
4+
---
5+
6+
# .NET Coding Standards & Conventions
7+
8+
## General Guidelines
9+
10+
1. Organize code by feature or module, keeping related files together.
11+
2. Use solution folders to mirror the logical structure of the application.
12+
3. Use PascalCase for project, namespace, and folder names.
13+
4. Place using directives outside the namespace and sort them alphabetically.
14+
5. Use explicit access modifiers (public, private, protected, internal) for all types and members.
15+
6. Prefer dependency injection for service and resource management.
16+
7. Use async/await for asynchronous code.
17+
8. Avoid magic numbers; use named constants or enums.
18+
9. Write XML documentation comments for public APIs, classes, and methods.
19+
10. End every statement with a semicolon.
20+
11. Use .editorconfig to enforce consistent formatting.
21+
12. Avoid regions except for large files with clear logical separation.
22+
23+
## Example
24+
25+
```csharp
26+
using System;
27+
28+
namespace MyApp.Services
29+
{
30+
/// <summary>
31+
/// Provides user-related operations.
32+
/// </summary>
33+
public class UserService : IUserService
34+
{
35+
public async Task<User> GetUserAsync(Guid id)
36+
{
37+
// ...implementation...
38+
}
39+
}
40+
}
41+
```
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
description: Coding standards and conventions for Nuxt.js projects in this repository.
3+
applyTo: "**/*.vue"
4+
---
5+
6+
7+
# Nuxt.js Coding Instructions
8+
9+
For all general Vue coding standards, see [vue.instructions.md](./vue.instructions.md). Follow those rules for all Nuxt components and pages unless overridden below.
10+
11+
## Nuxt-Specific Guidelines
12+
13+
### Pages
14+
- Place all route pages in the `pages/` directory. File and folder names define the route structure automatically.
15+
- Use `<script setup>` at the top of each page file, followed by `<template>`, then `<style scoped>`.
16+
- Use TypeScript for all pages when possible.
17+
18+
### Layouts
19+
- Place shared layouts in the `layouts/` directory. Use the `default.vue` layout for the main app shell.
20+
- Use the `<NuxtLayout />` component to switch layouts dynamically.
21+
- Use the `definePageMeta` composable to set page-specific metadata.
22+
23+
### Auto-Import Components
24+
- Place reusable components in the `components/` directory. Nuxt auto-imports components, so you do not need to manually import them in your templates.
25+
- Use PascalCase for component file names and references in templates.
26+
27+
### Composables
28+
- Place composable functions in the `composables/` directory. Nuxt auto-imports composables that start with `use` (e.g., `useAuth`).
29+
- Use Nuxt composables such as `useRoute`, `useRouter`, `useAsyncData`, and `useFetch` for routing and data fetching.
30+
31+
### Directory Structure
32+
- Organize your app using Nuxt's conventions: `pages/`, `layouts/`, `components/`, `composables/`, `stores/`, and `middleware/`.
33+
34+
### Example Page Component
35+
36+
```vue
37+
<script setup lang='ts'>
38+
import { ref } from 'vue';
39+
import { useRoute } from 'route';
40+
41+
const route = useRoute();
42+
const count = ref(0);
43+
44+
const increment = () => {
45+
count.value++;
46+
};
47+
</script>
48+
49+
<template>
50+
<section>
51+
<h2>Welcome to Nuxt!</h2>
52+
<p>Current route: {{ route.path }}</p>
53+
<button @click="increment">Clicked {{ count }} times</button>
54+
</section>
55+
</template>
56+
57+
<style scoped>
58+
section {
59+
padding: 2rem;
60+
}
61+
button {
62+
font-size: 1rem;
63+
margin-top: 1rem;
64+
}
65+
</style>
66+
```
67+
68+
## References
69+
- [Nuxt 3 Documentation](https://nuxt.com/docs)
70+
- [Nuxt 3 Directory Structure](https://nuxt.com/docs/guide/directory-structure/nuxt)
71+
- [Vue.js Style Guide](https://vuejs.org/style-guide/)
72+
- [Vitest for Vue/Nuxt Testing](https://vitest.dev/)
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
---
2+
description: Tailwind CSS usage and configuration standards for this repository.
3+
applyTo: "**/*.{css,vue,js,ts,jsx,tsx}"
4+
---
5+
6+
# Tailwind CSS Instructions
7+
8+
## Version
9+
- Use Tailwind CSS v4 or higher. Do not use older versions.
10+
- Tailwind v4+ does not use `@config` or JavaScript/TypeScript config files. All configuration is handled via CSS and utility classes.
11+
12+
## Customizing Colors
13+
- To use custom colors, use Tailwind's built-in color palette and utility classes (e.g., `bg-blue-600`, `text-primary`).
14+
- For custom colors, you can:
15+
- Use the `style` attribute for one-off values.
16+
- Do not use arbitrary color values (e.g. `bg-[#0ea5e9]`). Always use colors defined in your `@theme` block for consistency and maintainability.
17+
- Define custom CSS variables with the `@theme` directive and use them in your utility classes.
18+
19+
### Example: Customizing Colors with @theme
20+
21+
```css
22+
@import "tailwindcss";
23+
@theme {
24+
--color-midnight: #121063;
25+
--color-tahiti: #3ab7bf;
26+
--color-bermuda: #78dcca;
27+
}
28+
29+
.btn-tahiti {
30+
@apply bg-[--color-tahiti] text-white font-semibold px-4 py-2 rounded;
31+
}
32+
```
33+
34+
```vue
35+
<template>
36+
<button class="btn-tahiti hover:bg-[--color-bermuda]">Custom Color</button>
37+
</template>
38+
```
39+
40+
See the [Tailwind CSS Colors documentation](https://tailwindcss.com/docs/colors) for more details on using and customizing colors.
41+
42+
## Usage
43+
- Use Tailwind utility classes directly in your HTML, Vue, or JSX/TSX templates.
44+
- Prefer semantic and accessible markup; combine Tailwind with best practices from the HTML and accessibility instructions.
45+
- To use `@apply` in a Vue component's `<style>` block, you must reference TailwindCSS at the top of the style section:
46+
47+
```vue
48+
<template>
49+
<h1>Hello world!</h1>
50+
</template>
51+
<style>
52+
@reference "tailwindcss";
53+
h1 {
54+
@apply text-2xl font-bold text-red-500;
55+
}
56+
</style>
57+
```
58+
- Use `@apply` for extracting repeated utility patterns into custom classes in your CSS modules or component styles.
59+
- Do not override Tailwind base styles globally unless absolutely necessary.
60+
61+
## Best Practices
62+
- Keep utility class lists short and readable; extract to custom classes if they become too long.
63+
- Use responsive and state variants (e.g., `md:`, `hover:`) as needed for interactivity and layout.
64+
- Use Tailwind's color palette and spacing scale for consistency.
65+
- Avoid using arbitrary values. Always use colors and spacing defined in your `@theme` block or Tailwind's default palette for consistency.
66+
- Do not use deprecated or removed features from earlier Tailwind versions.
67+
68+
69+
## Example
70+
71+
72+
### Custom Components with @layer
73+
74+
To add custom component classes (such as buttons or cards), use the `@layer components` directive:
75+
### Custom Utilities with @utility
76+
77+
To define custom utility classes, use the `@utility` directive:
78+
79+
```css
80+
@utility content-auto {
81+
content-visibility: auto;
82+
}
83+
```
84+
85+
```css
86+
@import "tailwindcss";
87+
@theme {
88+
--color-white: #fff;
89+
--radius-lg: 0.5rem;
90+
--spacing-6: 1.5rem;
91+
--shadow-xl: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
92+
}
93+
94+
@layer components {
95+
.card {
96+
background-color: var(--color-white);
97+
border-radius: var(--radius-lg);
98+
padding: var(--spacing-6);
99+
box-shadow: var(--shadow-xl);
100+
}
101+
.btn-primary {
102+
@apply px-4 py-2 rounded bg-[--color-primary] text-white font-semibold hover:bg-[--color-primary-hover];
103+
}
104+
}
105+
```
106+
107+
### Variants with @variant
108+
109+
To define variants (such as dark mode), use the `@variant` directive:
110+
111+
```css
112+
.my-element {
113+
background: white;
114+
@variant dark {
115+
background: black;
116+
}
117+
}
118+
```
119+
120+
```vue
121+
<template>
122+
<div class="card">Card content</div>
123+
<button class="btn-primary">Click me</button>
124+
</template>
125+
```
126+
127+
## References
128+
- [Tailwind CSS v4 Documentation](https://tailwindcss.com/docs/installation)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
description: Coding standards and conventions for Vue.js projects in this repository.
3+
applyTo: "**/*.vue"
4+
---
5+
6+
# Vue.js Coding Instructions
7+
8+
## General Guidelines
9+
10+
1. Use Vue 3 with the Composition API for all new components.
11+
2. Organize code by feature/module; keep related files together.
12+
3. Use single-file components (`.vue`) with `<script setup>`, `<template>`, and `<style scoped>` sections (in that order).
13+
4. Place the `<script setup>` section at the top of the file, followed by `<template>`, then `<style scoped>` at the bottom.
14+
5. Prefer `<script setup>` syntax for simplicity and type inference.
15+
5. Use TypeScript in Vue components when possible.
16+
6. Use PascalCase for component names and file names (e.g., `MyComponent.vue`).
17+
7. Use kebab-case for custom event names and props in templates.
18+
8. Always define `props` with types and default values where appropriate.
19+
9. Use `defineEmits` and `defineProps` for event and prop definitions.
20+
10. Use `ref` and `reactive` for state; avoid using `this`.
21+
11. Use `v-bind` and `v-on` shorthand (`:` and `@`) in templates.
22+
12. Use `v-if`/`v-else` for conditional rendering and `v-for` for lists; always provide a unique `:key` for `v-for`.
23+
13. Avoid logic in templates; keep templates declarative and move logic to the script section.
24+
14. Use composables (`useXyz`) for reusable logic.
25+
15. Write clear JSDoc/TSDoc comments for composables and complex logic.
26+
16. Use CSS modules or `<style scoped>` for component styles; avoid global styles.
27+
17. Follow accessibility and UI guidelines for all components.
28+
18. End every statement with a semicolon and use single quotes for strings.
29+
19. Avoid using `any` type; prefer explicit types.
30+
20. Write unit tests for all components using Vitest.
31+
32+
33+
## Example Component
34+
35+
```vue
36+
<script setup lang='ts'>
37+
import { defineProps, defineEmits } from 'vue';
38+
39+
const props = defineProps<{
40+
disabled?: boolean;
41+
}>();
42+
const emit = defineEmits<{ (e: 'click'): void }>();
43+
44+
const onClick = () => {
45+
if (!props.disabled) emit('click');
46+
};
47+
</script>
48+
49+
<template>
50+
<button @click="onClick" :disabled="disabled">
51+
<slot />
52+
</button>
53+
</template>
54+
55+
<style scoped>
56+
button {
57+
font-size: 1rem;
58+
padding: 0.5em 1em;
59+
}
60+
</style>
61+
```
62+
63+
## References
64+
- [Vue.js Style Guide](https://vuejs.org/style-guide/)
65+
- [Vue 3 Documentation](https://vuejs.org/)
66+
- [Vitest for Vue Testing](https://vitest.dev/)

0 commit comments

Comments
 (0)