Compare commits

...

1 Commits

Author SHA1 Message Date
abmantis 6ba411b070 Remove autogenerated list of skills from copilot-instructions 2026-04-28 18:42:39 +01:00
2 changed files with 4 additions and 59 deletions
+2 -6
View File
@@ -5,7 +5,8 @@
# Copilot code review instructions
- Start review comments with a short, one-sentence summary of the suggested fix.
- Do not add comments about code style, formatting or linting issues.
- Do comment on code style, formatting or linting issues.
- When reviewing an integration, follow the instructions in .claude/skills/ha-integration-knowledge/SKILL.md
# GitHub Copilot & Claude Code Instructions
@@ -34,8 +35,3 @@ Integrations with Platinum or Gold level in the Integration Quality Scale reflec
When reviewing entity actions, do not suggest extra defensive checks for input fields that are already validated by Home Assistant's service/action schemas and entity selection filters. Suggest additional guards only when data bypasses those validators or is transformed into a less-safe form.
When validation guarantees a dict key exists, prefer direct key access (`data["key"]`) instead of `.get("key")` so contract violations are surfaced instead of silently masked.
# Skills
- ha-integration-knowledge: .claude/skills/ha-integration-knowledge/SKILL.md
+2 -53
View File
@@ -13,59 +13,18 @@ GENERATED_MESSAGE = (
f"<!-- Automatically generated by {Path(__file__).name}, do not edit -->\n\n"
)
SKILLS_DIR = Path(".claude/skills")
AGENTS_FILE = Path("AGENTS.md")
OUTPUT_FILE = Path(".github/copilot-instructions.md")
EXCLUDED_SKILLS = {"github-pr-reviewer"}
COPILOT_SPECIFIC_INSTRUCTIONS = """
# Copilot code review instructions
- Start review comments with a short, one-sentence summary of the suggested fix.
- Do not add comments about code style, formatting or linting issues.
- Do comment on code style, formatting or linting issues.
- When reviewing an integration, follow the instructions in .claude/skills/ha-integration-knowledge/SKILL.md
"""
def gather_skills() -> list[tuple[str, Path]]:
"""Gather all skills from the skills directory.
Returns a list of tuples (skill_name, skill_file_path).
"""
skills: list[tuple[str, Path]] = []
if not SKILLS_DIR.exists():
return skills
for skill_dir in sorted(SKILLS_DIR.iterdir()):
if not skill_dir.is_dir():
continue
if skill_dir.name in EXCLUDED_SKILLS:
continue
skill_file = skill_dir / "SKILL.md"
if not skill_file.exists():
continue
skill_content = skill_file.read_text()
# Extract skill name from frontmatter if present
skill_name = skill_dir.name
if skill_content.startswith("---"):
# Parse YAML frontmatter
end_idx = skill_content.find("---", 3)
if end_idx != -1:
frontmatter = skill_content[3:end_idx]
for line in frontmatter.split("\n"):
if line.startswith("name:"):
skill_name = line[5:].strip()
break
skills.append((skill_name, skill_file))
return skills
def generate_output() -> str:
"""Generate the copilot-instructions.md content."""
if not AGENTS_FILE.exists():
@@ -79,16 +38,6 @@ def generate_output() -> str:
output_parts.append(agents_content.strip())
output_parts.append("")
# Add skills section as a bullet list of name: path
skills = gather_skills()
if skills:
output_parts.append("")
output_parts.append("# Skills")
output_parts.append("")
for skill_name, skill_file in skills:
output_parts.append(f"- {skill_name}: {skill_file}")
output_parts.append("")
return "\n".join(output_parts)