generate-path-instructions

Generate path-specific instruction files for JIT loading from glob patterns.

29|22|Updated Nov 25, 2025
One-click install
npx skills add https://github.com/canonical/copilot-collections --skill generate-path-instructions
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: generate-path-instructions
Source: https://github.com/canonical/copilot-collections/tree/main/.github/skills/generate-path-instructions
Command: npx skills add https://github.com/canonical/copilot-collections --skill generate-path-instructions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation of precise, context-aware instructions for specific parts of your codebase, preventing global instruction bloat and improving AI efficiency.

Core Features & Use Cases

  • Scoped Instruction Generation: Creates .github/instructions/*.md files that load Just-In-Time (JIT) based on file paths.
  • Automated Analysis: Analyzes repository structure, identifies file patterns, and extracts scope-specific rules.
  • Context Economics: Optimizes AI context by loading rules only when relevant, overriding global instructions with higher priority.
  • Use Case: Automatically generate instructions for all Python test files, ensuring they follow specific testing conventions without polluting the global Copilot context.

Quick Start

Use the generate-path-instructions skill to create scoped instructions for all files matching the pattern 'tests/**/*.py'.

Frequently Asked Questions about generate-path-instructions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate path-specific instructions to prevent global context pollution in Copilot?▼

Generate path-specific instruction files using glob patterns to load rules Just-In-Time, overriding global instructions with higher priority to prevent context pollution and enhance AI performance.

How does Just-In-Time context loading work for scoped repository instructions?▼

Just-In-Time context loading works by generating `.github/instructions/*.md` files that activate based on file paths, ensuring AI assistants only load relevant scope-specific rules when matching files are edited.

How do I automate code generation rules for specific file patterns like Python tests?▼

Automate code generation rules by analyzing your repository structure to discover file patterns and extract scope-specific rules, generating targeted instructions for matching paths like `tests/**/*.py`.

Can I use LLM-driven repository analysis to extract framework-specific conventions?▼

Yes, the Skill performs LLM-driven repository analysis to discover file patterns and extract framework-specific conventions, optimizing context economics by loading rules only when relevant files are accessed.

What is the best way to optimize AI context when managing instructions across different directories?▼

The best way to optimize AI context is generating scoped instruction files per directory that load JIT, overriding global instructions to prevent context bloat and improve assistant efficiency.

When should I not use global instructions and switch to path-specific instruction files?▼

Switch to path-specific instruction files when global instructions cause context bloat, requiring precise framework-specific or directory-specific rules to prevent context pollution and enhance AI performance.