Skip to content

stark-ai-de/agent-skills / incubator/skills/engineering-workflows/hindsight-memory

hindsight-memory

Verified

Set up, diagnose, enable or use scoped Hindsight memory without requiring Greppy. Use when the user requests approved project or workspace memory, compact Codex/pi session outcomes or source-backed reflection. Not for global memory cleanup or implicit ingestion of search-indexed repositories.

diagnostics/workspace_status.py

View on GitHub
"""Read the owner's effective workspace policy without opening a bank or registering a repository."""

import argparse
import json
from pathlib import Path
import subprocess
import sys

sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))

import project_scope
import workspace_scope


def eligibility(policy, repo):
    actual = workspace_scope.git_identity(repo)
    if actual["root"] != repo:
        raise ValueError("select the exact repository root")
    canonical = policy["worktrees"].get(repo, repo)
    if (Path(repo) / ".git").is_file() and repo not in policy["worktrees"]:
        return "excluded"
    if not any(Path(canonical).is_relative_to(allowed) for allowed in policy["roots"]):
        return "excluded"
    if any(Path(candidate).is_relative_to(excluded) for candidate in (repo, canonical) for excluded in policy["exclude"]):
        return "excluded"
    if policy["repositories"].get(canonical, {}).get("enabled") is False:
        return "excluded"
    identity = actual if canonical == repo else workspace_scope.git_identity(canonical)
    if identity["root"] != canonical or identity["commonDir"] != actual["commonDir"]:
        raise ValueError("worktree does not belong to mapped repository")
    return "eligible"


def inspect(policy_file, project, docker):
    policy = workspace_scope.load(policy_file)
    repo = workspace_scope.absolute(str(project.expanduser()))
    result = {"scope": "workspace", "projectRoot": repo, "freshness": "separate"}
    if not policy["enabled"]:
        return {**result, "status": "disabled", "eligibility": "disabled"}
    result["eligibility"] = eligibility(policy, repo)
    if result["eligibility"] == "excluded":
        return {**result, "status": "disabled"}
    binding = project_scope.fingerprint(policy, docker)
    try:
        workspace_scope.local_active(policy)
        grant = json.loads(project_scope.private_read(Path(policy["stateRoot"]) / "activation.json"))
        ready = grant["bindingSha256"] == binding
    except (OSError, ValueError, KeyError, TypeError):
        ready = False
    return {**result, "status": "ready" if ready else "unverified", "bindingSha256": binding}


def main():
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--workspace-policy", type=Path, required=True)
    parser.add_argument("--repo", type=Path, required=True, help="Exact repository root")
    parser.add_argument("--docker", default="docker")
    args = parser.parse_args()
    try:
        print(json.dumps(inspect(args.workspace_policy, args.repo, args.docker)))
        return 0
    except (OSError, ValueError, KeyError, TypeError, subprocess.SubprocessError):
        print(json.dumps({"status": "attention", "reason": "Workspace policy or effective route requires review."}))
        return 1


if __name__ == "__main__":
    raise SystemExit(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: 471kUpdated 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: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated 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: 322kUpdated Claude CodeCodexVerifiedInstall