diff --git a/.config/opencode/skills/bash/SKILL.md b/.config/opencode/skills/bash/SKILL.md new file mode 100644 index 0000000..2a9f509 --- /dev/null +++ b/.config/opencode/skills/bash/SKILL.md @@ -0,0 +1,21 @@ +--- +name: bash +description: Shell scripting conventions (set -euo pipefail, quoting, shellcheck). Use when editing .sh or .bash files. +--- + +# Bash Conventions + +## Robustness +- Begin scripts with `#!/usr/bin/env bash` and `set -euo pipefail`. +- Pass `shellcheck` cleanly; treat its warnings as bugs. + +## Quoting and expansion +- Double-quote all variable expansions (`"$var"`, `"${array[@]}"`). +- Prefer `[[ ]]` over `[ ]`; use arrays for argument lists rather than space-separated strings. +- Avoid `eval`; do not parse `ls` output. + +## Structure +- Declare function-local variables with `local`. +- Use `trap` to clean up temporary files and directories. +- Use `printf` over `echo` for predictable output. +- Prefer a `$TMPDIR`-based path over hardcoded `/tmp` literals. diff --git a/.config/opencode/skills/csharp/SKILL.md b/.config/opencode/skills/csharp/SKILL.md new file mode 100644 index 0000000..53c5444 --- /dev/null +++ b/.config/opencode/skills/csharp/SKILL.md @@ -0,0 +1,37 @@ +--- +name: csharp +description: C# and .NET coding conventions. Use when reading, writing, or reviewing .cs, .razor, .csproj, or .sln files, or any .NET (C#) code. +--- + +# C# / .NET Conventions + +Follow the Microsoft [Common C# code conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions) and [.NET naming guidelines](https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/naming-guidelines). Match patterns already established in the target codebase. + +## Structure +- Use file-scoped namespaces (`namespace Example.Services;`). +- Nullable reference types are enabled solution-wide; do not suppress warnings without cause. +- Use `record` types for DTOs and data carriers. +- Use `required` / `init`-only properties for immutable domain models. +- Use primary constructors for services and repositories that take injected dependencies. +- Mark classes `sealed` by default unless inheritance is intended. +- Prefix interfaces with `I` (`IRenderer`, `IRepository`). + +## Expressions +- Use raw string literals (`""" ... """`) for multi-line SQL. +- Use `[GeneratedRegex]` partial methods for regex. +- Use collection expressions (`[]`, `[a, b]`). + +## Async and cancellation +- Every async method takes `CancellationToken ct = default` and honors it cooperatively (`ct.ThrowIfCancellationRequested()` in long loops). +- Never drop the token when calling downstream async APIs. + +## Logging +- Inject `ILogger` and use structured logging with named parameters: + `_logger.LogInformation("Generated {Count} transactions", count);` + +## Naming +- `PascalCase` for types and members. +- `_camelCase` for private fields. + +## Testing +- Use xUnit. Mirror the source structure under a `Tests/` directory with a `Tests` suffix on file names. diff --git a/.config/opencode/skills/go/SKILL.md b/.config/opencode/skills/go/SKILL.md new file mode 100644 index 0000000..ad76bb8 --- /dev/null +++ b/.config/opencode/skills/go/SKILL.md @@ -0,0 +1,22 @@ +--- +name: go +description: Idiomatic Go conventions. Use when editing .go files or go.mod/go.sum. +--- + +# Go Conventions + +Write strictly idiomatic Go following standard formatting and best practices. + +## Formatting and style +- `gofmt` / `goimports` formatting is mandatory. +- Follow [Effective Go](https://go.dev/doc/effective_go) and the [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments). + +## Design +- Accept `context.Context` as the first parameter on functions doing I/O or long work; honor cancellation. +- Compose via small interfaces; accept interfaces, return structs. +- Wire dependencies explicitly via constructor injection; avoid package-level mutable globals and DI frameworks. +- Return errors explicitly; wrap with `%w` (`fmt.Errorf("do thing: %w", err)`); classify with `errors.Is` / `errors.As`; never discard errors. + +## Testing +- Write table-driven tests in `_test.go` using the standard `testing` package. +- Use `t.Run` for subtests; report failures with `t.Errorf` / `t.Fatalf`. diff --git a/.config/opencode/skills/htmx/SKILL.md b/.config/opencode/skills/htmx/SKILL.md new file mode 100644 index 0000000..66c772c --- /dev/null +++ b/.config/opencode/skills/htmx/SKILL.md @@ -0,0 +1,22 @@ +--- +name: htmx +description: HTMX v2 progressive-enhancement and hypermedia patterns. +--- + +# HTMX Conventions + +Follow [HTMX](https://htmx.org) v2 and [Hypermedia Systems](https://hypermedia.systems/book/contents/) best practices. + +## Philosophy +- Treat the server as the source of truth; return HTML fragments, not JSON, for hypermedia interactions. +- Prefer `hx-*` attributes over client-side JavaScript; reach for client JavaScript only when htmx cannot express the interaction. +- Build progressively: ensure pages function without JavaScript, then enhance with htmx. + +## Patterns +- Target fragments with `hx-target` and swap with `hx-swap` (prefer `outerHTML` or `innerHTML` as appropriate). +- Return partial templates or fragments from endpoints; treat partials as isolated components that receive data via the page model. +- Use Out-of-Band Swaps (`hx-swap-oob`) to update multiple regions from a single response. +- Handle errors with a 4xx/5xx partial or `hx-on::responseError`. + +## Keep clean +- Return semantic HTML from endpoints; avoid mixing `hx-*` attributes with conflicting client-side handlers. diff --git a/.config/opencode/skills/primevue/SKILL.md b/.config/opencode/skills/primevue/SKILL.md new file mode 100644 index 0000000..fea989f --- /dev/null +++ b/.config/opencode/skills/primevue/SKILL.md @@ -0,0 +1,19 @@ +--- +name: primevue +description: PrimeVue v4 component patterns and Tailwind integration. Use when writing or styling PrimeVue components. +--- + +# PrimeVue v4 Conventions + +Assume PrimeVue v4 is installed when answering Vue questions. Use the Composition API with `