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/log_viewer.py

View on GitHub
from __future__ import annotations

import argparse
import json
import sys
from pathlib import Path
from datetime import datetime

def format_timestamp(ts_str: str) -> str:
    try:
        return ts_str[:19].replace("T", " ")
    except Exception:
        return "N/A"

def view_logs(log_dir: Path, limit: int = 10, detail_id: str | None = None):
    if not log_dir.exists():
        print(f"Error: Log directory not found at {log_dir}")
        return

    logs = sorted(log_dir.glob("log_*.json"), key=lambda p: p.stat().st_mtime, reverse=True)
    
    if detail_id:
        _show_detail(logs, detail_id)
        return

    print(f"\n--- Recent Audit Logs (showing top {min(len(logs), limit)}) ---")
    header = f"{'Timestamp':<20} | {'Action':<15} | {'Status':<8} | {'Score':<5} | {'Reasoning'}"
    print(header)
    print("-" * len(header))
    
    for log_path in logs[:limit]:
        try:
            data = json.loads(log_path.read_text(encoding="utf-8"))
            ts = format_timestamp(data.get("timestamp_utc", ""))
            action = data.get("action", "unknown")
            status = data.get("status", "unknown")
            score = str(data.get("confidence_score", "-"))
            reasoning = str(data.get("reasoning") or "")
            if len(reasoning) > 45:
                reasoning = reasoning[:42] + "..."
            
            color_code = ""
            if status == "error": color_code = "\033[91m" # Red
            elif status == "success": color_code = "\033[92m" # Green
            
            reset = "\033[0m"
            print(f"{ts:<20} | {action:<15} | {color_code}{status:<8}{reset} | {score:<5} | {reasoning}")
        except Exception:
            continue
    
    print(f"\nTip: Use --session <id> to see full details of a specific log.")

def _show_detail(logs: list[Path], session_id: str):
    target = None
    for log in logs:
        if session_id in log.name:
            target = log
            break
    
    if not target:
        print(f"Error: Session '{session_id}' not found.")
        return

    data = json.loads(target.read_text(encoding="utf-8"))
    print(f"\n=== Detailed Audit Log: {session_id} ===")
    print(json.dumps(data, indent=2))

def main():
    parser = argparse.ArgumentParser(description="AI Project Rules Generator - Log Viewer")
    parser.add_argument("--dir", default=".agent/logs", help="Directory containing JSON logs")
    parser.add_argument("--limit", type=int, default=15, help="Number of logs to show")
    parser.add_argument("--session", help="Show full JSON for a specific session ID")
    
    args = parser.parse_args()
    view_logs(Path(args.dir), limit=args.limit, detail_id=args.session)

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