Skip to content

naravid19/ai-project-rules-generator

generating-project-rules

Verified

Make sure to use this skill WHENEVER the user mentions creating, generating, or updating project rules files (.cursorrules, AGENTS.md, CLAUDE.md, GEMINI.md, or equivalent) for any software project. This is essential when a user wants to integrate AI skills into their development workflow, or when they need cross-platform AI tool configuration. Skip this for general code generation, refactoring, or tasks unrelated to AI agent configuration files.

scripts/remote_source.py

View on GitHub
"""Minimal git-based remote skill source resolver."""
from __future__ import annotations

import re
import subprocess
from pathlib import Path


def resolve_remote_source(
    url: str,
    cache_root: Path,
    offline: bool = False,
) -> Path:
    """Clone or pull a remote git repo into cache_root and return the local path.

    Args:
        url: Git-compatible URL (https or ssh).
        cache_root: Directory to store cloned repos.
        offline: If True, use existing cache without network access.

    Returns:
        Path to the cloned/cached repo directory.

    Raises:
        RuntimeError: If clone/pull fails and no cached copy exists.
    """
    repo_name = _extract_repo_name(url)
    target_dir = cache_root / repo_name

    if target_dir.exists() and any(target_dir.iterdir()):
        if offline:
            return target_dir
        try:
            subprocess.run(
                ["git", "-C", str(target_dir), "pull", "--ff-only"],
                capture_output=True,
                check=True,
                timeout=30,
            )
        except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError):
            pass  # Use existing cache on pull failure
        return target_dir

    if offline:
        raise RuntimeError(
            f"No cached copy and offline mode is enabled: {url}"
        )

    cache_root.mkdir(parents=True, exist_ok=True)
    try:
        subprocess.run(
            ["git", "clone", "--depth", "1", url, str(target_dir)],
            capture_output=True,
            check=True,
            timeout=60,
        )
    except (subprocess.CalledProcessError, subprocess.TimeoutExpired, FileNotFoundError) as exc:
        raise RuntimeError(
            f"Failed to clone remote skill source: {url}"
        ) from exc

    return target_dir


def _extract_repo_name(url: str) -> str:
    """Extract a safe directory name from a git URL."""
    cleaned = url.rstrip("/")
    if cleaned.endswith(".git"):
        cleaned = cleaned[:-4]
    name = cleaned.rsplit("/", 1)[-1]
    return re.sub(r"[^\w\-.]", "_", name) or "remote-skills"
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 469kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 321kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 321kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 321kUpdated Claude CodeCodexVerifiedInstall