From 2f1931d6de2d66aaa30f504ee865004df23344e1 Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Fri, 13 Mar 2026 12:01:39 +1100 Subject: [PATCH 1/5] Cleaned up some tool names --- agents/csharp-dotnet-janitor.agent.md | 2 +- agents/janitor.agent.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agents/csharp-dotnet-janitor.agent.md b/agents/csharp-dotnet-janitor.agent.md index 4ab838158..858f55bdd 100644 --- a/agents/csharp-dotnet-janitor.agent.md +++ b/agents/csharp-dotnet-janitor.agent.md @@ -1,7 +1,7 @@ --- description: 'Perform janitorial tasks on C#/.NET code including cleanup, modernization, and tech debt remediation.' name: 'C#/.NET Janitor' -tools: ['changes', 'codebase', 'edit/editFiles', 'extensions', 'web/fetch', 'findTestFiles', 'githubRepo', 'new', 'openSimpleBrowser', 'problems', 'runCommands', 'runTasks', 'runTests', 'search', 'searchResults', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'usages', 'vscodeAPI', 'microsoft.docs.mcp', 'github'] +tools: [vscode/extensions, vscode/getProjectSetupInfo, vscode/installExtension, vscode/newWorkspace, vscode/runCommand, vscode/vscodeAPI, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runTests, execute/runInTerminal, execute/testFailure, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, read/problems, read/readFile, 'github/*', 'microsoft.docs.mcp/*', edit/editFiles, search, web] --- # C#/.NET Janitor diff --git a/agents/janitor.agent.md b/agents/janitor.agent.md index 5a2f64009..42fb92585 100644 --- a/agents/janitor.agent.md +++ b/agents/janitor.agent.md @@ -1,7 +1,7 @@ --- description: 'Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.' name: 'Universal Janitor' -tools: ['search/changes', 'search/codebase', 'edit/editFiles', 'vscode/extensions', 'web/fetch', 'findTestFiles', 'web/githubRepo', 'vscode/getProjectSetupInfo', 'vscode/installExtension', 'vscode/newWorkspace', 'vscode/runCommand', 'vscode/openSimpleBrowser', 'read/problems', 'execute/getTerminalOutput', 'execute/runInTerminal', 'read/terminalLastCommand', 'read/terminalSelection', 'execute/createAndRunTask', 'execute/getTaskOutput', 'execute/runTask', 'execute/runTests', 'search', 'search/searchResults', 'execute/testFailure', 'search/usages', 'vscode/vscodeAPI', 'microsoft.docs.mcp', 'github'] +tools: [vscode/extensions, vscode/getProjectSetupInfo, vscode/installExtension, vscode/newWorkspace, vscode/runCommand, vscode/vscodeAPI, execute/getTerminalOutput, execute/runTask, execute/createAndRunTask, execute/runTests, execute/runInTerminal, execute/testFailure, read/terminalSelection, read/terminalLastCommand, read/getTaskOutput, read/problems, read/readFile, browser, 'github/*', 'microsoft.docs.mcp/*', edit/editFiles, search, web] --- # Universal Janitor From 7fc237ccb562d02965b70135c21dece24cce9c6e Mon Sep 17 00:00:00 2001 From: Aaron Powell Date: Fri, 13 Mar 2026 12:03:16 +1100 Subject: [PATCH 2/5] Removing some instructionsThese instructions are no longer useful as the knowledge the add is already well handled by frontier models, so the instructions potentially provide conflicting or incorrect information to the agent while it undertakes a task --- instructions/angular.instructions.md | 104 ----------- instructions/java.instructions.md | 81 --------- instructions/python.instructions.md | 56 ------ instructions/reactjs.instructions.md | 162 ------------------ .../typescript-5-es2022.instructions.md | 114 ------------ instructions/vuejs3.instructions.md | 153 ----------------- 6 files changed, 670 deletions(-) delete mode 100644 instructions/angular.instructions.md delete mode 100644 instructions/java.instructions.md delete mode 100644 instructions/python.instructions.md delete mode 100644 instructions/reactjs.instructions.md delete mode 100644 instructions/typescript-5-es2022.instructions.md delete mode 100644 instructions/vuejs3.instructions.md diff --git a/instructions/angular.instructions.md b/instructions/angular.instructions.md deleted file mode 100644 index 12b7355a2..000000000 --- a/instructions/angular.instructions.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -description: 'Angular-specific coding standards and best practices' -applyTo: '**/*.ts, **/*.html, **/*.scss, **/*.css' ---- - -# Angular Development Instructions - -Instructions for generating high-quality Angular applications with TypeScript, using Angular Signals for state management, adhering to Angular best practices as outlined at https://angular.dev. - -## Project Context -- Latest Angular version (use standalone components by default) -- TypeScript for type safety -- Angular CLI for project setup and scaffolding -- Follow Angular Style Guide (https://angular.dev/style-guide) -- Use Angular Material or other modern UI libraries for consistent styling (if specified) - -## Development Standards - -### Architecture -- Use standalone components unless modules are explicitly required -- Organize code by standalone feature modules or domains for scalability -- Implement lazy loading for feature modules to optimize performance -- Use Angular's built-in dependency injection system effectively -- Structure components with a clear separation of concerns (smart vs. presentational components) - -### TypeScript -- Enable strict mode in `tsconfig.json` for type safety -- Define clear interfaces and types for components, services, and models -- Use type guards and union types for robust type checking -- Implement proper error handling with RxJS operators (e.g., `catchError`) -- Use typed forms (e.g., `FormGroup`, `FormControl`) for reactive forms - -### Component Design -- Follow Angular's component lifecycle hooks best practices -- When using Angular >= 19, Use `input()` `output()`, `viewChild()`, `viewChildren()`, `contentChild()` and `contentChildren()` functions instead of decorators; otherwise use decorators -- Leverage Angular's change detection strategy (default or `OnPush` for performance) -- Keep templates clean and logic in component classes or services -- Use Angular directives and pipes for reusable functionality - -### Styling -- Use Angular's component-level CSS encapsulation (default: ViewEncapsulation.Emulated) -- Prefer SCSS for styling with consistent theming -- Implement responsive design using CSS Grid, Flexbox, or Angular CDK Layout utilities -- Follow Angular Material's theming guidelines if used -- Maintain accessibility (a11y) with ARIA attributes and semantic HTML - -### State Management -- Use Angular Signals for reactive state management in components and services -- Leverage `signal()`, `computed()`, and `effect()` for reactive state updates -- Use writable signals for mutable state and computed signals for derived state -- Handle loading and error states with signals and proper UI feedback -- Use Angular's `AsyncPipe` to handle observables in templates when combining signals with RxJS - -### Data Fetching -- Use Angular's `HttpClient` for API calls with proper typing -- Implement RxJS operators for data transformation and error handling -- Use Angular's `inject()` function for dependency injection in standalone components -- Implement caching strategies (e.g., `shareReplay` for observables) -- Store API response data in signals for reactive updates -- Handle API errors with global interceptors for consistent error handling - -### Security -- Sanitize user inputs using Angular's built-in sanitization -- Implement route guards for authentication and authorization -- Use Angular's `HttpInterceptor` for CSRF protection and API authentication headers -- Validate form inputs with Angular's reactive forms and custom validators -- Follow Angular's security best practices (e.g., avoid direct DOM manipulation) - -### Performance -- Enable production builds with `ng build --prod` for optimization -- Use lazy loading for routes to reduce initial bundle size -- Optimize change detection with `OnPush` strategy and signals for fine-grained reactivity -- Use trackBy in `ngFor` loops to improve rendering performance -- Implement server-side rendering (SSR) or static site generation (SSG) with Angular Universal (if specified) - -### Testing -- Write unit tests for components, services, and pipes using Jasmine and Karma -- Use Angular's `TestBed` for component testing with mocked dependencies -- Test signal-based state updates using Angular's testing utilities -- Write end-to-end tests with Cypress or Playwright (if specified) -- Mock HTTP requests using `provideHttpClientTesting` -- Ensure high test coverage for critical functionality - -## Implementation Process -1. Plan project structure and feature modules -2. Define TypeScript interfaces and models -3. Scaffold components, services, and pipes using Angular CLI -4. Implement data services and API integrations with signal-based state -5. Build reusable components with clear inputs and outputs -6. Add reactive forms and validation -7. Apply styling with SCSS and responsive design -8. Implement lazy-loaded routes and guards -9. Add error handling and loading states using signals -10. Write unit and end-to-end tests -11. Optimize performance and bundle size - -## Additional Guidelines -- Follow the Angular Style Guide for file naming conventions (see https://angular.dev/style-guide), e.g., use `feature.ts` for components and `feature-service.ts` for services. For legacy codebases, maintain consistency with existing pattern. -- Use Angular CLI commands for generating boilerplate code -- Document components and services with clear JSDoc comments -- Ensure accessibility compliance (WCAG 2.1) where applicable -- Use Angular's built-in i18n for internationalization (if specified) -- Keep code DRY by creating reusable utilities and shared modules -- Use signals consistently for state management to ensure reactive updates diff --git a/instructions/java.instructions.md b/instructions/java.instructions.md deleted file mode 100644 index 7a4258e15..000000000 --- a/instructions/java.instructions.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -description: 'Guidelines for building Java base applications' -applyTo: '**/*.java' ---- - -# Java Development - -## General Instructions - -- First, prompt the user if they want to integrate static analysis tools (SonarQube, PMD, Checkstyle) into their project setup. - - If yes, document a recommended static-analysis setup. - - Prefer SonarQube/SonarCloud (SonarLint in IDE + `sonar-scanner` in CI). - - Create a Sonar project key. - - Store the scanner token in CI secrets. - - Provide a sample CI job that runs the scanner. - - If the team declines Sonar, note this in the project README and continue. - - If Sonar is bound to the project: - - Use Sonar as the primary source of actionable issues. - - Reference Sonar rule keys in remediation guidance. - - If Sonar is unavailable: - - Perform up to 3 troubleshooting checks: - 1. Verify project binding and token. - 2. Ensure SonarScanner runs in CI. - 3. Confirm SonarLint is installed and configured. - - If still failing after 3 attempts: - - Enable SpotBugs, PMD, or Checkstyle as CI fallbacks. - - Open a short tracker issue documenting the blocker and next steps. -- If the user declines static analysis tools or wants to proceed without them, continue with implementing the Best practices, bug patterns and code smell prevention guidelines outlined below. -- Address code smells proactively during development rather than accumulating technical debt. -- Focus on readability, maintainability, and performance when refactoring identified issues. -- Use IDE / Code editor reported warnings and suggestions to catch common patterns early in development. - -## Best practices - -- **Records**: For classes primarily intended to store data (e.g., DTOs, immutable data structures), **Java Records should be used instead of traditional classes**. -- **Pattern Matching**: Utilize pattern matching for `instanceof` and `switch` expression to simplify conditional logic and type casting. -- **Type Inference**: Use `var` for local variable declarations to improve readability, but only when the type is explicitly clear from the right-hand side of the expression. -- **Immutability**: Favor immutable objects. Make classes and fields `final` where possible. Use collections from `List.of()`/`Map.of()` for fixed data. Use `Stream.toList()` to create immutable lists. -- **Streams and Lambdas**: Use the Streams API and lambda expressions for collection processing. Employ method references (e.g., `stream.map(Foo::toBar)`). -- **Null Handling**: Avoid returning or accepting `null`. Use `Optional` for possibly-absent values and `Objects` utility methods like `equals()` and `requireNonNull()`. - -### Naming Conventions - -- Follow Google's Java style guide: - - `UpperCamelCase` for class and interface names. - - `lowerCamelCase` for method and variable names. - - `UPPER_SNAKE_CASE` for constants. - - `lowercase` for package names. -- Use nouns for classes (`UserService`) and verbs for methods (`getUserById`). -- Avoid abbreviations and Hungarian notation. - -### Common Bug Patterns - -Below are concise, human-readable rules you can apply regardless of which static analysis tool you use. If you run Sonar/SonarLint, the IDE will show the matching rule and location — direct Sonar connections are preferred and should override this ruleset. - -- Resource management — Always close resources (files, sockets, streams). Use try-with-resources where possible so resources are closed automatically. -- Equality checks — Compare object equality with `.equals()` or `Objects.equals(...)` rather than `==` for non-primitives; this avoids reference-equality bugs. -- Redundant casts — Remove unnecessary casts; prefer correct generic typing and let the compiler infer types where possible. -- Reachable conditions — Avoid conditional expressions that are always true or false; they indicate bugs or dead code and should be corrected. - -For contributors who *do* use Sonar or SonarLint: the IDE/scan will show the specific rule key (for example, S2095 for resource leaks) and the affected file/line. Use that information to navigate to the exact location, then apply the recommended remediation. - -### Common Code Smells - -These patterns are phrased for humans; they map cleanly to checks in Sonar, SpotBugs, PMD, or Checkstyle but do not require those tools to be useful. - -- Parameter count — Keep method parameter lists short. If a method needs many params, consider grouping into a value object or using the builder pattern. -- Method size — Keep methods focused and small. Extract helper methods to improve readability and testability. -- Cognitive complexity — Reduce nested conditionals and heavy branching by extracting methods, using polymorphism, or applying the Strategy pattern. -- Duplicated literals — Extract repeated strings and numbers into named constants or enums to reduce errors and ease changes. -- Dead code — Remove unused variables and assignments. They confuse readers and can hide bugs. -- Magic numbers — Replace numeric literals with named constants that explain intent (e.g., MAX_RETRIES). - -If you run a static analyzer like Sonar or SonarLint — direct Sonar connections are preferred and should override this ruleset. Sonar rule keys are useful for automation and suppression, but they are not required in day-to-day developer guidance. - -## Build and Verification - -- After adding or modifying code, verify the project continues to build successfully. -- If the project uses Maven, run `mvn clean install`. -- If the project uses Gradle, run `./gradlew build` (or `gradlew.bat build` on Windows). -- Ensure all tests pass as part of the build. diff --git a/instructions/python.instructions.md b/instructions/python.instructions.md deleted file mode 100644 index a783f4244..000000000 --- a/instructions/python.instructions.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -description: 'Python coding conventions and guidelines' -applyTo: '**/*.py' ---- - -# Python Coding Conventions - -## Python Instructions - -- Write clear and concise comments for each function. -- Ensure functions have descriptive names and include type hints. -- Provide docstrings following PEP 257 conventions. -- Use the `typing` module for type annotations (e.g., `List[str]`, `Dict[str, int]`). -- Break down complex functions into smaller, more manageable functions. - -## General Instructions - -- Always prioritize readability and clarity. -- For algorithm-related code, include explanations of the approach used. -- Write code with good maintainability practices, including comments on why certain design decisions were made. -- Handle edge cases and write clear exception handling. -- For libraries or external dependencies, mention their usage and purpose in comments. -- Use consistent naming conventions and follow language-specific best practices. -- Write concise, efficient, and idiomatic code that is also easily understandable. - -## Code Style and Formatting - -- Follow the **PEP 8** style guide for Python. -- Maintain proper indentation (use 4 spaces for each level of indentation). -- Ensure lines do not exceed 79 characters. -- Place function and class docstrings immediately after the `def` or `class` keyword. -- Use blank lines to separate functions, classes, and code blocks where appropriate. - -## Edge Cases and Testing - -- Always include test cases for critical paths of the application. -- Account for common edge cases like empty inputs, invalid data types, and large datasets. -- Include comments for edge cases and the expected behavior in those cases. -- Write unit tests for functions and document them with docstrings explaining the test cases. - -## Example of Proper Documentation - -```python -def calculate_area(radius: float) -> float: - """ - Calculate the area of a circle given the radius. - - Parameters: - radius (float): The radius of the circle. - - Returns: - float: The area of the circle, calculated as π * radius^2. - """ - import math - return math.pi * radius ** 2 -``` diff --git a/instructions/reactjs.instructions.md b/instructions/reactjs.instructions.md deleted file mode 100644 index 79bd2754e..000000000 --- a/instructions/reactjs.instructions.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -description: 'ReactJS development standards and best practices' -applyTo: '**/*.jsx, **/*.tsx, **/*.js, **/*.ts, **/*.css, **/*.scss' ---- - -# ReactJS Development Instructions - -Instructions for building high-quality ReactJS applications with modern patterns, hooks, and best practices following the official React documentation at https://react.dev. - -## Project Context -- Latest React version (React 19+) -- TypeScript for type safety (when applicable) -- Functional components with hooks as default -- Follow React's official style guide and best practices -- Use modern build tools (Vite, Create React App, or custom Webpack setup) -- Implement proper component composition and reusability patterns - -## Development Standards - -### Architecture -- Use functional components with hooks as the primary pattern -- Implement component composition over inheritance -- Organize components by feature or domain for scalability -- Separate presentational and container components clearly -- Use custom hooks for reusable stateful logic -- Implement proper component hierarchies with clear data flow - -### TypeScript Integration -- Use TypeScript interfaces for props, state, and component definitions -- Define proper types for event handlers and refs -- Implement generic components where appropriate -- Use strict mode in `tsconfig.json` for type safety -- Leverage React's built-in types (`React.FC`, `React.ComponentProps`, etc.) -- Create union types for component variants and states - -### Component Design -- Follow the single responsibility principle for components -- Use descriptive and consistent naming conventions -- Implement proper prop validation with TypeScript or PropTypes -- Design components to be testable and reusable -- Keep components small and focused on a single concern -- Use composition patterns (render props, children as functions) - -### State Management -- Use `useState` for local component state -- Implement `useReducer` for complex state logic -- Leverage `useContext` for sharing state across component trees -- Consider external state management (Redux Toolkit, Zustand) for complex applications -- Implement proper state normalization and data structures -- Use React Query or SWR for server state management - -### Hooks and Effects -- Use `useEffect` with proper dependency arrays to avoid infinite loops -- Implement cleanup functions in effects to prevent memory leaks -- Use `useMemo` and `useCallback` for performance optimization when needed -- Create custom hooks for reusable stateful logic -- Follow the rules of hooks (only call at the top level) -- Use `useRef` for accessing DOM elements and storing mutable values - -### Styling -- Use CSS Modules, Styled Components, or modern CSS-in-JS solutions -- Implement responsive design with mobile-first approach -- Follow BEM methodology or similar naming conventions for CSS classes -- Use CSS custom properties (variables) for theming -- Implement consistent spacing, typography, and color systems -- Ensure accessibility with proper ARIA attributes and semantic HTML - -### Performance Optimization -- Use `React.memo` for component memoization when appropriate -- Implement code splitting with `React.lazy` and `Suspense` -- Optimize bundle size with tree shaking and dynamic imports -- Use `useMemo` and `useCallback` judiciously to prevent unnecessary re-renders -- Implement virtual scrolling for large lists -- Profile components with React DevTools to identify performance bottlenecks - -### Data Fetching -- Use modern data fetching libraries (React Query, SWR, Apollo Client) -- Implement proper loading, error, and success states -- Handle race conditions and request cancellation -- Use optimistic updates for better user experience -- Implement proper caching strategies -- Handle offline scenarios and network errors gracefully - -### Error Handling -- Implement Error Boundaries for component-level error handling -- Use proper error states in data fetching -- Implement fallback UI for error scenarios -- Log errors appropriately for debugging -- Handle async errors in effects and event handlers -- Provide meaningful error messages to users - -### Forms and Validation -- Use controlled components for form inputs -- Implement proper form validation with libraries like Formik, React Hook Form -- Handle form submission and error states appropriately -- Implement accessibility features for forms (labels, ARIA attributes) -- Use debounced validation for better user experience -- Handle file uploads and complex form scenarios - -### Routing -- Use React Router for client-side routing -- Implement nested routes and route protection -- Handle route parameters and query strings properly -- Implement lazy loading for route-based code splitting -- Use proper navigation patterns and back button handling -- Implement breadcrumbs and navigation state management - -### Testing -- Write unit tests for components using React Testing Library -- Test component behavior, not implementation details -- Use Jest for test runner and assertion library -- Implement integration tests for complex component interactions -- Mock external dependencies and API calls appropriately -- Test accessibility features and keyboard navigation - -### Security -- Sanitize user inputs to prevent XSS attacks -- Validate and escape data before rendering -- Use HTTPS for all external API calls -- Implement proper authentication and authorization patterns -- Avoid storing sensitive data in localStorage or sessionStorage -- Use Content Security Policy (CSP) headers - -### Accessibility -- Use semantic HTML elements appropriately -- Implement proper ARIA attributes and roles -- Ensure keyboard navigation works for all interactive elements -- Provide alt text for images and descriptive text for icons -- Implement proper color contrast ratios -- Test with screen readers and accessibility tools - -## Implementation Process -1. Plan component architecture and data flow -2. Set up project structure with proper folder organization -3. Define TypeScript interfaces and types -4. Implement core components with proper styling -5. Add state management and data fetching logic -6. Implement routing and navigation -7. Add form handling and validation -8. Implement error handling and loading states -9. Add testing coverage for components and functionality -10. Optimize performance and bundle size -11. Ensure accessibility compliance -12. Add documentation and code comments - -## Additional Guidelines -- Follow React's naming conventions (PascalCase for components, camelCase for functions) -- Use meaningful commit messages and maintain clean git history -- Implement proper code splitting and lazy loading strategies -- Document complex components and custom hooks with JSDoc -- Use ESLint and Prettier for consistent code formatting -- Keep dependencies up to date and audit for security vulnerabilities -- Implement proper environment configuration for different deployment stages -- Use React Developer Tools for debugging and performance analysis - -## Common Patterns -- Higher-Order Components (HOCs) for cross-cutting concerns -- Render props pattern for component composition -- Compound components for related functionality -- Provider pattern for context-based state sharing -- Container/Presentational component separation -- Custom hooks for reusable logic extraction diff --git a/instructions/typescript-5-es2022.instructions.md b/instructions/typescript-5-es2022.instructions.md deleted file mode 100644 index 1b5303537..000000000 --- a/instructions/typescript-5-es2022.instructions.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -description: 'Guidelines for TypeScript Development targeting TypeScript 5.x and ES2022 output' -applyTo: '**/*.ts' ---- - -# TypeScript Development - -> These instructions assume projects are built with TypeScript 5.x (or newer) compiling to an ES2022 JavaScript baseline. Adjust guidance if your runtime requires older language targets or down-level transpilation. - -## Core Intent - -- Respect the existing architecture and coding standards. -- Prefer readable, explicit solutions over clever shortcuts. -- Extend current abstractions before inventing new ones. -- Prioritize maintainability and clarity, short methods and classes, clean code. - -## General Guardrails - -- Target TypeScript 5.x / ES2022 and prefer native features over polyfills. -- Use pure ES modules; never emit `require`, `module.exports`, or CommonJS helpers. -- Rely on the project's build, lint, and test scripts unless asked otherwise. -- Note design trade-offs when intent is not obvious. - -## Project Organization - -- Follow the repository's folder and responsibility layout for new code. -- Use kebab-case filenames (e.g., `user-session.ts`, `data-service.ts`) unless told otherwise. -- Keep tests, types, and helpers near their implementation when it aids discovery. -- Reuse or extend shared utilities before adding new ones. - -## Naming & Style - -- Use PascalCase for classes, interfaces, enums, and type aliases; camelCase for everything else. -- Skip interface prefixes like `I`; rely on descriptive names. -- Name things for their behavior or domain meaning, not implementation. - -## Formatting & Style - -- Run the repository's lint/format scripts (e.g., `npm run lint`) before submitting. -- Match the project's indentation, quote style, and trailing comma rules. -- Keep functions focused; extract helpers when logic branches grow. -- Favor immutable data and pure functions when practical. - -## Type System Expectations - -- Avoid `any` (implicit or explicit); prefer `unknown` plus narrowing. -- Use discriminated unions for realtime events and state machines. -- Centralize shared contracts instead of duplicating shapes. -- Express intent with TypeScript utility types (e.g., `Readonly`, `Partial`, `Record`). - -## Async, Events & Error Handling - -- Use `async/await`; wrap awaits in try/catch with structured errors. -- Guard edge cases early to avoid deep nesting. -- Send errors through the project's logging/telemetry utilities. -- Surface user-facing errors via the repository's notification pattern. -- Debounce configuration-driven updates and dispose resources deterministically. - -## Architecture & Patterns - -- Follow the repository's dependency injection or composition pattern; keep modules single-purpose. -- Observe existing initialization and disposal sequences when wiring into lifecycles. -- Keep transport, domain, and presentation layers decoupled with clear interfaces. -- Supply lifecycle hooks (e.g., `initialize`, `dispose`) and targeted tests when adding services. - -## External Integrations - -- Instantiate clients outside hot paths and inject them for testability. -- Never hardcode secrets; load them from secure sources. -- Apply retries, backoff, and cancellation to network or IO calls. -- Normalize external responses and map errors to domain shapes. - -## Security Practices - -- Validate and sanitize external input with schema validators or type guards. -- Avoid dynamic code execution and untrusted template rendering. -- Encode untrusted content before rendering HTML; use framework escaping or trusted types. -- Use parameterized queries or prepared statements to block injection. -- Keep secrets in secure storage, rotate them regularly, and request least-privilege scopes. -- Favor immutable flows and defensive copies for sensitive data. -- Use vetted crypto libraries only. -- Patch dependencies promptly and monitor advisories. - -## Configuration & Secrets - -- Reach configuration through shared helpers and validate with schemas or dedicated validators. -- Handle secrets via the project's secure storage; guard `undefined` and error states. -- Document new configuration keys and update related tests. - -## UI & UX Components - -- Sanitize user or external content before rendering. -- Keep UI layers thin; push heavy logic to services or state managers. -- Use messaging or events to decouple UI from business logic. - -## Testing Expectations - -- Add or update unit tests with the project's framework and naming style. -- Expand integration or end-to-end suites when behavior crosses modules or platform APIs. -- Run targeted test scripts for quick feedback before submitting. -- Avoid brittle timing assertions; prefer fake timers or injected clocks. - -## Performance & Reliability - -- Lazy-load heavy dependencies and dispose them when done. -- Defer expensive work until users need it. -- Batch or debounce high-frequency events to reduce thrash. -- Track resource lifetimes to prevent leaks. - -## Documentation & Comments - -- Add JSDoc to public APIs; include `@remarks` or `@example` when helpful. -- Write comments that capture intent, and remove stale notes during refactors. -- Update architecture or design docs when introducing significant patterns. diff --git a/instructions/vuejs3.instructions.md b/instructions/vuejs3.instructions.md deleted file mode 100644 index 879cf2c2e..000000000 --- a/instructions/vuejs3.instructions.md +++ /dev/null @@ -1,153 +0,0 @@ ---- -description: 'VueJS 3 development standards and best practices with Composition API and TypeScript' -applyTo: '**/*.vue, **/*.ts, **/*.js, **/*.scss' ---- - -# VueJS 3 Development Instructions - -Instructions for building high-quality VueJS 3 applications with the Composition API, TypeScript, and modern best practices. - -## Project Context -- Vue 3.x with Composition API as default -- TypeScript for type safety -- Single File Components (`.vue`) with ` -``` - ---- - -## `` - -> **Source:** - -### Description - -The `` element displays a progress indicator showing the completion of a task, typically rendered as a progress bar. - -### Key Attributes - -| Attribute | Description | -|-----------|-------------| -| `max` | Total amount of work required. Must be greater than 0 and a valid floating-point number. Default: `1`. | -| `value` | Completed amount (0 to `max`, or 0 to 1 if `max` is omitted). If omitted, shows an indeterminate progress bar. | - -### Difference from `` - -- Minimum value is always 0 (the `min` attribute is **not allowed** for ``). -- `` is specifically for task completion; `` is for scalar measurements. - -### Usage Notes - -- Both opening and closing tags are required. -- Implicit ARIA role: `progressbar`. -- Text between tags is fallback content for older browsers (not an accessible label). -- Use the `:indeterminate` pseudo-class to style indeterminate progress bars. -- Remove the `value` attribute (`element.removeAttribute('value')`) to make an indeterminate progress bar. - -### Accessibility Considerations - -- Always provide an accessible label using a `