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/extract-capabilities.py

View on GitHub
from __future__ import annotations

import argparse
import json
import sys
from pathlib import Path
from typing import Any

SCRIPT_DIR = Path(__file__).resolve().parent
if str(SCRIPT_DIR) not in sys.path:
    sys.path.insert(0, str(SCRIPT_DIR))

from skill_metadata import extract_heading, extract_summary, extract_tools, parse_frontmatter, resolve_skill_entry


class CapabilityExtractor:
    """Extract lightweight capability summaries from skill entries."""

    def extract(self, skill_path: str) -> dict[str, Any] | None:
        requested_path = Path(skill_path)
        if not requested_path.exists():
            return None

        entry = resolve_skill_entry(requested_path)
        if entry is None:
            return None

        try:
            content = entry.primary_path.read_text(encoding="utf-8")
        except OSError as exc:
            return {"error": str(exc), "path": str(entry.primary_path)}

        frontmatter = parse_frontmatter(content)
        title = extract_heading(content) or str(frontmatter.get("name") or entry.directory.name)
        capability = str(frontmatter.get("description") or "").strip() or extract_summary(content)

        return {
            "title": title,
            "capability": capability,
            "tools": extract_tools(frontmatter),
            "path": str(entry.primary_path),
            "companion_docs": [str(path) for path in entry.companion_docs],
            "reference_dirs": [str(path) for path in entry.reference_dirs],
        }


def main() -> None:
    parser = argparse.ArgumentParser(
        description="Extract capability summaries from skill directories or instruction files"
    )
    parser.add_argument("paths", nargs="+", help="Paths to skill directories or SKILL/AGENTS/CLAUDE files")
    args = parser.parse_args()

    extractor = CapabilityExtractor()
    results = []
    for path in args.paths:
        capability = extractor.extract(path)
        if capability is not None:
            results.append(capability)

    print(json.dumps(results, indent=2))


if __name__ == "__main__":
    main()
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