This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
"sourceType": "github",
|
"sourceType": "github",
|
||||||
"skillPath": "skills/caveman/SKILL.md",
|
"skillPath": "skills/caveman/SKILL.md",
|
||||||
"computedHash": "d18cdf73a5f5c496d681a43a6846336b110223bdffa6817b8992529c57f1a815"
|
"computedHash": "59e1fe0d3eeb4189ee5c467efde567672e5cacb41f157c477a6152ca907d44ea"
|
||||||
},
|
},
|
||||||
"caveman-commit": {
|
"caveman-commit": {
|
||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
@@ -23,13 +23,13 @@
|
|||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
"sourceType": "github",
|
"sourceType": "github",
|
||||||
"skillPath": "skills/caveman-compress/SKILL.md",
|
"skillPath": "skills/caveman-compress/SKILL.md",
|
||||||
"computedHash": "84517cd4cf7a49d8d2bc1baf00f61bc359306c6ad9389756b6937eff958bd374"
|
"computedHash": "52f2301832b376a765b0ed02445c8bf05874b624052bf9a9c3861d9c3dfcee4b"
|
||||||
},
|
},
|
||||||
"caveman-help": {
|
"caveman-help": {
|
||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
"sourceType": "github",
|
"sourceType": "github",
|
||||||
"skillPath": "skills/caveman-help/SKILL.md",
|
"skillPath": "skills/caveman-help/SKILL.md",
|
||||||
"computedHash": "dd85267e76baad76995157e7b9f762dfa557cd58951ee92af0c283f48aa26537"
|
"computedHash": "c76fd4aa86ad557eee62aacbd4b9dd46499fe3913910e7d596d20d094296b984"
|
||||||
},
|
},
|
||||||
"caveman-review": {
|
"caveman-review": {
|
||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"source": "JuliusBrussee/caveman",
|
"source": "JuliusBrussee/caveman",
|
||||||
"sourceType": "github",
|
"sourceType": "github",
|
||||||
"skillPath": "skills/caveman-stats/SKILL.md",
|
"skillPath": "skills/caveman-stats/SKILL.md",
|
||||||
"computedHash": "47ce2de3d6cb39a75047b5c962e4eb3da15594e7397c94103e9a104d42626553"
|
"computedHash": "57c7db449641379e2afd1389fdb17cec8f33d9c8e25b1d28093937b4431895e8"
|
||||||
},
|
},
|
||||||
"ponytail": {
|
"ponytail": {
|
||||||
"source": "DietrichGebert/ponytail",
|
"source": "DietrichGebert/ponytail",
|
||||||
|
|||||||
@@ -42,11 +42,18 @@ class TestSkillPersistence(unittest.TestCase):
|
|||||||
|
|
||||||
def test_autotune_names_every_target(self):
|
def test_autotune_names_every_target(self):
|
||||||
text = SKILL.read_text(encoding="utf-8")
|
text = SKILL.read_text(encoding="utf-8")
|
||||||
for target in ("SKILLS_REPO", "skills/<name>/SKILL.md", "~/.claude/skills/", "~/.agents/skills/"):
|
for target in (
|
||||||
|
"SKILLS_REPO",
|
||||||
|
"skills/<name>/SKILL.md",
|
||||||
|
"~/.claude/skills/",
|
||||||
|
"~/.agents/skills/",
|
||||||
|
):
|
||||||
self.assertIn(target, text)
|
self.assertIn(target, text)
|
||||||
|
|
||||||
def test_autoskill_routes_to_the_same_persistence(self):
|
def test_autoskill_routes_to_the_same_persistence(self):
|
||||||
text = (REPO_ROOT / "skills" / "autoskill" / "SKILL.md").read_text(encoding="utf-8")
|
text = (REPO_ROOT / "skills" / "autoskill" / "SKILL.md").read_text(
|
||||||
|
encoding="utf-8"
|
||||||
|
)
|
||||||
for target in ("Persistence", "~/.claude/skills/", "~/.agents/skills/"):
|
for target in ("Persistence", "~/.claude/skills/", "~/.agents/skills/"):
|
||||||
self.assertIn(target, text)
|
self.assertIn(target, text)
|
||||||
|
|
||||||
@@ -84,7 +91,9 @@ class TestSettingsRegistration(unittest.TestCase):
|
|||||||
self.settings = Path(self.tmp.name) / "settings.json"
|
self.settings = Path(self.tmp.name) / "settings.json"
|
||||||
|
|
||||||
def _patch(self) -> dict:
|
def _patch(self) -> dict:
|
||||||
subprocess.run(["node", str(PATCHER), str(self.settings)], check=True, capture_output=True)
|
subprocess.run(
|
||||||
|
["node", str(PATCHER), str(self.settings)], check=True, capture_output=True
|
||||||
|
)
|
||||||
return json.loads(self.settings.read_text(encoding="utf-8"))
|
return json.loads(self.settings.read_text(encoding="utf-8"))
|
||||||
|
|
||||||
def test_hook_registered_once(self):
|
def test_hook_registered_once(self):
|
||||||
@@ -95,7 +104,15 @@ class TestSettingsRegistration(unittest.TestCase):
|
|||||||
|
|
||||||
def test_existing_hooks_preserved(self):
|
def test_existing_hooks_preserved(self):
|
||||||
self.settings.write_text(
|
self.settings.write_text(
|
||||||
json.dumps({"hooks": {"UserPromptSubmit": [{"hooks": [{"type": "command", "command": "true"}]}]}}),
|
json.dumps(
|
||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"UserPromptSubmit": [
|
||||||
|
{"hooks": [{"type": "command", "command": "true"}]}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
),
|
||||||
encoding="utf-8",
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
data = self._patch()
|
data = self._patch()
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ HOOK = REPO_ROOT / "skills" / "dream" / "hooks" / "reminder.sh"
|
|||||||
PATCHER = REPO_ROOT / "scripts" / "enable-plugins.js"
|
PATCHER = REPO_ROOT / "scripts" / "enable-plugins.js"
|
||||||
|
|
||||||
|
|
||||||
def _run_hook(cwd: Path, stamp: Path | None = None, interval: str = "43200") -> subprocess.CompletedProcess:
|
def _run_hook(
|
||||||
|
cwd: Path, stamp: Path | None = None, interval: str = "43200"
|
||||||
|
) -> subprocess.CompletedProcess:
|
||||||
env = {
|
env = {
|
||||||
"PATH": "/usr/bin:/bin",
|
"PATH": "/usr/bin:/bin",
|
||||||
"HOME": str(cwd),
|
"HOME": str(cwd),
|
||||||
@@ -73,7 +75,9 @@ class TestDreamHook(unittest.TestCase):
|
|||||||
for name in ("one", "two"):
|
for name in ("one", "two"):
|
||||||
repo = self.cwd / name
|
repo = self.cwd / name
|
||||||
repo.mkdir()
|
repo.mkdir()
|
||||||
subprocess.run(["git", "init", "-q", str(repo)], check=True, capture_output=True)
|
subprocess.run(
|
||||||
|
["git", "init", "-q", str(repo)], check=True, capture_output=True
|
||||||
|
)
|
||||||
self.assertIn("/dream", _run_hook(repo).stdout)
|
self.assertIn("/dream", _run_hook(repo).stdout)
|
||||||
self.assertTrue((repo / ".git" / ".dream-stamp").is_file())
|
self.assertTrue((repo / ".git" / ".dream-stamp").is_file())
|
||||||
self.assertEqual(_run_hook(repo).stdout, "")
|
self.assertEqual(_run_hook(repo).stdout, "")
|
||||||
@@ -87,7 +91,9 @@ class TestSettingsRegistration(unittest.TestCase):
|
|||||||
self.settings = Path(self.tmp.name) / "settings.json"
|
self.settings = Path(self.tmp.name) / "settings.json"
|
||||||
|
|
||||||
def _patch(self) -> dict:
|
def _patch(self) -> dict:
|
||||||
subprocess.run(["node", str(PATCHER), str(self.settings)], check=True, capture_output=True)
|
subprocess.run(
|
||||||
|
["node", str(PATCHER), str(self.settings)], check=True, capture_output=True
|
||||||
|
)
|
||||||
return json.loads(self.settings.read_text(encoding="utf-8"))
|
return json.loads(self.settings.read_text(encoding="utf-8"))
|
||||||
|
|
||||||
def test_hook_registered_once(self):
|
def test_hook_registered_once(self):
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ class TestOptimizeObjective(unittest.TestCase):
|
|||||||
def test_routers_point_at_it(self):
|
def test_routers_point_at_it(self):
|
||||||
for skill in ROUTERS:
|
for skill in ROUTERS:
|
||||||
text = (SKILLS / skill / "SKILL.md").read_text(encoding="utf-8")
|
text = (SKILLS / skill / "SKILL.md").read_text(encoding="utf-8")
|
||||||
self.assertIn("`optimize` skill", text, f"{skill} does not route to optimize")
|
self.assertIn(
|
||||||
|
"`optimize` skill", text, f"{skill} does not route to optimize"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user