Skip to content

flurdy/agent-skills / skills/prompt-patterns

prompt-patterns

Unverified

Find recurring substantial prompts in local Pi and Claude Code history and suggest reusable prompt-template drafts; metadata-first, redacted, bounded and read-only.

FileKindSize
SKILL.mdskill md8.3 KB
references/history-safety.mdmarkdown8.6 KB
scripts/prompt_patterns.pyscript27.6 KB
tests/test_contract.pyscript2.2 KB
tests/test_prompt_patterns.pyscript23.9 KB

tests/test_contract.py

View on GitHub
"""Runtime workflow stays read-only and requires disclosure before text exposure."""
import ast
from pathlib import Path
import unittest

ROOT = Path(__file__).resolve().parents[1]
REPO = ROOT.parents[1]


class ContractTests(unittest.TestCase):
    def test_skill_separates_summary_disclosure_emission_and_external_consent(self):
        skill = (ROOT / "SKILL.md").read_text()
        self.assertLess(skill.index("## 1. Collect metadata only"), skill.index("Before requesting any text"))
        self.assertLess(skill.index("Before requesting any text"), skill.index("## 2. Expose only"))
        for required in ("current session model", "fresh, explicit consent", "untrusted historical data",
                         "--expected-digest", "stale-summary", "never reread raw history", "$ARGUMENTS",
                         "never create", "Persist nothing by default", "ignored `.artifacts/`",
                         "separately approved follow-up", "real-history usefulness trial",
                         "directory-proxy count", "union", "already covered", "Codex is"):
            self.assertIn(required, skill)

    def test_helper_has_no_network_subprocess_or_file_output_interface(self):
        source = (ROOT / "scripts/prompt_patterns.py").read_text()
        tree = ast.parse(source)
        imports = {node.names[0].name.split(".")[0] if isinstance(node, ast.Import) else (node.module or "").split(".")[0]
                   for node in ast.walk(tree) if isinstance(node, (ast.Import, ast.ImportFrom))}
        self.assertFalse(imports & {"socket", "http", "urllib", "requests", "subprocess"})
        for sink in ("write_text", "write_bytes", "O_WRONLY", "O_RDWR", "O_CREAT", "--output", "--provider", "--model"):
            self.assertNotIn(sink, source)

    def test_catalogue_and_full_gate_include_the_new_skill(self):
        catalogue = (REPO / "skills/README.md").read_text()
        self.assertEqual(catalogue.count("| prompt-patterns |"), 1)
        makefile = (REPO / "Makefile").read_text()
        self.assertIn("test-prompt-patterns", makefile.split("test: $(TEST_TARGETS)")[0])
        self.assertIn("test-prompt-patterns:", makefile)


if __name__ == "__main__":
    unittest.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