#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright 2024-2026 Lukasz Krzemien (biuro@softspark.eu)
# Source: https://github.com/softspark/ai-toolkit

"""Generate .clinerules from app/agents/*.md and app/skills/*/SKILL.md.

Usage: ./scripts/generate_cline.py > .clinerules
"""
from __future__ import annotations

import sys
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parent))
from generator_base import render_generator

if __name__ == "__main__":
    render_generator({
        "title": "# Cline Rules — generated from ai-toolkit agents",
        "header_lines": [
            "# Auto-generated by scripts/generate-cline.sh — do not edit manually.",
            "# Regenerate: ./scripts/generate-cline.sh > .clinerules",
        ],
        "intro_template": (
            "This repository uses the ai-toolkit — a shared AI development toolkit"
            " with specialized agent personas and skills."
        ),
        "agents_section": "## Available Agent Personas",
        "agents_intro": "Apply the expertise of these agents when working on relevant tasks:",
        "agents_format": "headings",
        "agents_level": "##",
        "skills_section": "## Available Skills",
        "skills_intro": "The following skills are available as slash commands or knowledge sources:",
        "skills_format": "headings",
        "skills_level": "##",
        "trailing_newline_after_skills": True,
        "guidelines": ["general"],
    })
