Add shared instruction files and copilot history maintenance scripts
- Add 12 cross-project instruction files to resources/instructions/ - Add cleanup-copilot-history.mjs/.sh: quarantine-based history cleanup with dry-run and aggressive scope - Add restore-copilot-history.mjs/.sh: restore from quarantine by run, path, or filter - Add purge-copilot-history-quarantine.mjs/.sh: purge old quarantine runs with keep-latest guard - Add copilot-history-maintenance.test.mjs: 3 passing unit tests covering all three scripts
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
---
|
||||
name: "Global Engineering Best Practices"
|
||||
description: "Umbrella baseline for cross-project engineering guidance."
|
||||
applyTo: "**"
|
||||
---
|
||||
|
||||
- Use `engineering-core-defaults.instructions.md` for global engineering behavior.
|
||||
- Use `language-and-tooling-defaults.instructions.md` for file-type and tooling baselines.
|
||||
- When project-local instructions are present, treat them as the authoritative source.
|
||||
@@ -0,0 +1,17 @@
|
||||
---
|
||||
name: "Engineering Core Defaults"
|
||||
description: "Cross-project baseline for maintainable, predictable, and secure engineering decisions."
|
||||
applyTo: "**"
|
||||
---
|
||||
|
||||
- Prioritize maintainability, readability, and predictability over novelty.
|
||||
- Prefer explicit behavior and descriptive names over implicit shortcuts.
|
||||
- Reuse existing project patterns and utilities before introducing abstractions.
|
||||
- Keep implementations modular and scoped; avoid monolithic files and deep nesting.
|
||||
- Remove dead code, unused imports, and duplicate logic when touching related areas.
|
||||
- Add comments only for non-obvious intent, trade-offs, or constraints.
|
||||
- Favor composition over inheritance and use early returns to simplify control flow.
|
||||
- Default to secure practices: validate inputs, isolate secrets, and avoid hardcoded credentials.
|
||||
- Keep dependencies minimal and add new ones only with clear justification.
|
||||
- Optimize for practical performance without reducing clarity or maintainability.
|
||||
- Treat project-local instructions as authoritative when they conflict with global defaults.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: "Environment and Config Standards"
|
||||
description: "Cross-project standards for env and conf files, with secure configuration defaults."
|
||||
applyTo: "**/*.env,**/*.env.*,**/*.conf"
|
||||
---
|
||||
|
||||
- Keep secrets out of source-controlled env files.
|
||||
- Use environment-specific overrides instead of duplicating large config blocks.
|
||||
- Keep `.example` templates free of real credentials.
|
||||
- Document required variables and reasonable defaults.
|
||||
- Prefer least-privilege and secret isolation practices.
|
||||
- Ensure runtime/deploy scripts fail clearly when required variables are missing.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: "HTML Standards"
|
||||
description: "Cross-project HTML standards for semantic structure and accessibility."
|
||||
applyTo: "**/*.html"
|
||||
---
|
||||
|
||||
- Prefer semantic elements over generic wrappers.
|
||||
- Maintain accessible heading order and labels.
|
||||
- Keep layouts responsive and avoid inline styling where possible.
|
||||
- Avoid deprecated or non-semantic patterns.
|
||||
- Ensure keyboard and screen-reader-friendly markup for interactive elements.
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
name: "JavaScript Standards"
|
||||
description: "Cross-project JavaScript and MJS standards for clarity, maintainability, and performance-aware code."
|
||||
applyTo: "**/*.js,**/*.mjs"
|
||||
---
|
||||
|
||||
- Prefer `const` over `let`, and avoid `var`.
|
||||
- Use async/await for asynchronous flows.
|
||||
- Keep modules focused and avoid monolithic files.
|
||||
- Remove dead code and unused imports during related edits.
|
||||
- Use early returns to reduce branching complexity.
|
||||
- Keep behavior explicit; avoid implicit coercion and hidden side effects.
|
||||
- Favor composition and reusable utilities over duplicated logic.
|
||||
- Avoid deep nesting, callback-heavy control flow, and blocking sync work in user-facing paths.
|
||||
- Validate with the project's JavaScript lint, test, and build commands.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: "JSON Standards"
|
||||
description: "Cross-project JSON standards for stable structure and deterministic formatting."
|
||||
applyTo: "**/*.json"
|
||||
---
|
||||
|
||||
- Keep JSON formatting consistent and deterministic.
|
||||
- Avoid duplicate keys and ambiguous nesting.
|
||||
- Prefer stable, explicit property names.
|
||||
- Remove unused configuration fields during related edits.
|
||||
- Preserve existing data contracts unless intentional changes are documented.
|
||||
- Validate JSON syntax before commit.
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: "Language and Tooling Defaults"
|
||||
description: "Cross-project language and file-type guidance for JS, Vue, SCSS, Markdown, JSON, HTML, Shell, YAML, and config files."
|
||||
applyTo: "**/*.js,**/*.mjs,**/*.vue,**/*.scss,**/*.md,**/*.json,**/*.html,**/*.sh,**/*.yml,**/*.yaml,**/*.env,**/*.conf"
|
||||
---
|
||||
|
||||
- Use `javascript.instructions.md` for JavaScript and MJS files.
|
||||
- Use `vue.instructions.md` for Vue SFC files.
|
||||
- Use `scss.instructions.md` for SCSS stylesheets.
|
||||
- Use `markdown.instructions.md` for Markdown docs.
|
||||
- Use `json.instructions.md` for JSON data/config files.
|
||||
- Use `html.instructions.md` for HTML templates/pages.
|
||||
- Use `shell.instructions.md` for shell scripts.
|
||||
- Use `yaml.instructions.md` for YAML configs.
|
||||
- Use `env-config.instructions.md` for env and conf files.
|
||||
- Prefer project-local instructions when they provide more specific guidance.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: "Markdown Standards"
|
||||
description: "Cross-project Markdown standards for concise, scan-friendly documentation."
|
||||
applyTo: "**/*.md"
|
||||
---
|
||||
|
||||
- Keep documents concise, structured, and easy to scan.
|
||||
- Use consistent heading hierarchy.
|
||||
- Prefer bullet lists and tables for structured content.
|
||||
- Avoid large unbroken paragraphs.
|
||||
- Use examples where they improve clarity.
|
||||
- Keep formatting markdownlint-compatible when possible.
|
||||
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: "SCSS Standards"
|
||||
description: "Cross-project SCSS standards for modular styling and maintainable selector design."
|
||||
applyTo: "**/*.scss"
|
||||
---
|
||||
|
||||
- Keep selectors shallow and specificity low.
|
||||
- Reuse variables and mixins instead of repeating style constants.
|
||||
- Keep style modules focused; avoid monolithic stylesheet files.
|
||||
- Avoid deep nesting and `!important` except as a last resort.
|
||||
- Remove duplicated selectors and dead style rules during related edits.
|
||||
- Prefer design-token reuse before adding new primitives.
|
||||
- Validate with project style lint/build commands when available.
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: "Shell Standards"
|
||||
description: "Cross-project shell scripting standards for safety and predictable automation."
|
||||
applyTo: "**/*.sh"
|
||||
---
|
||||
|
||||
- Use defensive scripting with explicit error handling.
|
||||
- Quote variables and paths.
|
||||
- Validate inputs before using them in commands.
|
||||
- Keep scripts modular and avoid hidden side effects.
|
||||
- Avoid unsafe deletion patterns, silent failures, and hardcoded environment-specific paths.
|
||||
- Keep scripts ShellCheck-compatible where feasible.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: "Vue Standards"
|
||||
description: "Cross-project Vue standards for component structure, state derivation, and rendering efficiency."
|
||||
applyTo: "**/*.vue"
|
||||
---
|
||||
|
||||
- Prefer Composition API with `<script setup>` for new components.
|
||||
- Keep components single-purpose and move reusable logic to composables.
|
||||
- Prefer computed state over watchers when deriving values.
|
||||
- Use props/events for communication instead of tight coupling.
|
||||
- Keep templates declarative; avoid embedding business logic in templates.
|
||||
- Minimize reactive dependencies and avoid broad reactive objects when narrower refs suffice.
|
||||
- Use lazy loading and route-level splitting when project architecture supports it.
|
||||
- Validate with the project's Vue lint/test/build commands.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
name: "YAML Standards"
|
||||
description: "Cross-project YAML standards for readable and consistent configuration files."
|
||||
applyTo: "**/*.yml,**/*.yaml"
|
||||
---
|
||||
|
||||
- Use consistent indentation and spacing.
|
||||
- Keep values explicit and structures readable.
|
||||
- Avoid overly complex inline expressions.
|
||||
- Keep file conventions consistent within each configuration domain.
|
||||
- Keep YAML yamllint-compatible where feasible.
|
||||
Reference in New Issue
Block a user