Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import re
from pathlib import Path

DESCRIPTION = re.compile(r"^description:\s*([\"']?)(.*)\1\s*$", re.M)


def register(ctx):
skills_dir = Path(__file__).parent / "skills"
for skill_dir in sorted(p for p in skills_dir.iterdir() if (p / "SKILL.md").is_file()):
ctx.register_skill(skill_dir.name, skill_dir / "SKILL.md")
path = skill_dir / "SKILL.md"
match = DESCRIPTION.search(path.read_text(encoding="utf-8"))
ctx.register_skill(skill_dir.name, path, description=match.group(2) if match else "")
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pstack
version: "0.3.0"
version: "0.3.1"
description: "Poteto's engineering rigor stack. Playbooks, principles, multi-model review."
author: poteto (adapted by Madeleine)
24 changes: 19 additions & 5 deletions scripts/check_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,32 @@

class Ctx:
registered = []
def register_skill(self, name, path): self.registered.append((name, Path(path)))
def register_skill(self, name, path, description="", **kwargs): self.registered.append((name, Path(path), description))

spec = importlib.util.spec_from_file_location("pstack_init", ROOT / "__init__.py")
loader = importlib.util.module_from_spec(spec)
spec.loader.exec_module(loader)
loader.register(ctx := Ctx())
for name, path in ctx.registered:
DANGLING = re.compile(r"(?: (?:and|or|a|the|with|of|to|for|from|that|your)|[:,.])\.$")
for name, path, description in ctx.registered:
if path.name != "SKILL.md" or not path.is_file():
errors.append(f"__init__.py: {name} registered with {path}, not a SKILL.md file")
if {n for n, _ in ctx.registered} != SKILLS:
continue
text = path.read_text(encoding="utf-8")
m = re.search(r"^description:\s*([\"']?)(.*)\1\s*$", text.split("---", 2)[1] if text.startswith("---\n") else "", re.M)
if not text.startswith("---\n"):
errors.append(f"skills/{name}/SKILL.md: frontmatter must start with '---' on its own line")
if not description:
errors.append(f"__init__.py: {name} registered with empty description")
elif not m or description != m.group(2):
errors.append(f"__init__.py: {name} description differs from SKILL.md frontmatter")
if len(description) > 60:
errors.append(f"skills/{name}/SKILL.md: description over 60 chars")
if not description.endswith("."):
errors.append(f"skills/{name}/SKILL.md: description must end with a period")
if DANGLING.search(description):
errors.append(f"skills/{name}/SKILL.md: description looks cut mid-sentence: {description!r}")
if {n for n, _, _ in ctx.registered} != SKILLS:
errors.append("__init__.py: registered skills differ from skills/ directories")

CURSOR_LEFTOVERS = re.compile(
Expand Down Expand Up @@ -58,8 +74,6 @@ def register_skill(self, name, path): self.registered.append((name, Path(path)))
head = text.split("---", 2)[1] if text.startswith("---") else ""
for field in ("name:", "description:", "version:", "author:", "license:", "platforms:", "metadata:", "hermes:", "tags:", "related_skills:"):
if field not in head: errors.append(f"{path.relative_to(ROOT)}: missing frontmatter {field}")
m = re.search(r"^description:\s*[\"']?(.*?)[\"']?\s*$", head, re.M)
if m and len(m.group(1).strip('"')) > 60: errors.append(f"{path.relative_to(ROOT)}: description over 60 chars")
if errors:
print("\n".join(errors)); sys.exit(1)
print(f"checked {len(files)} markdown files, {len(SKILLS)} skills")
3 changes: 2 additions & 1 deletion skills/architect/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---name: architect
---
name: architect
description: "Design types and module structure before writing code."
version: 0.1.0
author: poteto (Hermes adaptation)
Expand Down
5 changes: 3 additions & 2 deletions skills/automate-me/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: automate-me
description: "Use for \"automate me\", \"create/update/refresh my."
---
name: automate-me
description: "Use for 'automate me' or to build a personal -mode skill."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/blast-radius/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: blast-radius
description: "Find what a change could break somewhere else before it."
---
name: blast-radius
description: "Find what a change could break elsewhere before it ships."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/bro/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: bro
description: "Restate the last message in plain human language, with."
---
name: bro
description: "Use to restate your last message in plain human words."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
3 changes: 2 additions & 1 deletion skills/create-formal-verification-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---name: create-formal-verification-skill
---
name: create-formal-verification-skill
description: "Generate a project-local formal verification skill."
version: 0.1.0
author: poteto (Hermes adaptation)
Expand Down
5 changes: 3 additions & 2 deletions skills/create-verification-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: create-verification-skill
description: "Generate a project-local verification skill that drives."
---
name: create-verification-skill
description: "Generate a project-local skill that drives the real app."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/figure-it-out/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: figure-it-out
description: "Design an auditable playbook when no narrower one fits:."
---
name: figure-it-out
description: "Use when no playbook fits: design an auditable one first."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/how/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: how
description: "Explain how code works. Subsystem walkthroughs and."
---
name: how
description: "Use to explain how code works, with walkthroughs."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
3 changes: 2 additions & 1 deletion skills/in-your-own-words/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---name: in-your-own-words
---
name: in-your-own-words
description: "Restate the user's goals and problem before work."
version: 0.1.0
author: poteto (Hermes adaptation)
Expand Down
5 changes: 3 additions & 2 deletions skills/interrogate/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: interrogate
description: "Multi-model adversarial code review via parallel."
---
name: interrogate
description: "Use before merging for adversarial multi-model code review."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
3 changes: 2 additions & 1 deletion skills/maintain-formal-verification-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---name: maintain-formal-verification-skill
---
name: maintain-formal-verification-skill
description: "Resync formal verification with changed code."
version: 0.1.0
author: poteto (Hermes adaptation)
Expand Down
5 changes: 3 additions & 2 deletions skills/maintain-verification-skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: maintain-verification-skill
description: "Periodic pass that keeps a project's verification skill."
---
name: maintain-verification-skill
description: "Use to resync a project's verification skill with its app."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/no-comments/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: no-comments
description: "Spawn Comment Sicko, fix accepted findings, and offer."
---
name: no-comments
description: "Use to remove needless code comments via Comment Sicko."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/poteto-mode/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: poteto-mode
description: "Engineering rigor orchestrator with playbooks and."
---
name: poteto-mode
description: "Use first on any engineering task to route to a playbook."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-attack-the-premise/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-attack-the-premise
description: "Apply when two or more fixes that share one premise have."
---
name: principle-attack-the-premise
description: "Apply when fixes sharing one premise keep failing a gate."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-boundary-discipline/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-boundary-discipline
description: "Apply when wiring validation, error handling, or."
---
name: principle-boundary-discipline
description: "Apply when placing validation or error handling in code."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-build-the-lever/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-build-the-lever
description: "Apply to any non-trivial work, not just bulk work:."
---
name: principle-build-the-lever
description: "Apply to non-trivial work: build the tool that does it."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-encode-lessons-in-structure/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-encode-lessons-in-structure
description: "Apply when you catch yourself writing the same."
---
name: principle-encode-lessons-in-structure
description: "Apply when writing the same instruction twice: encode it."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-exhaust-the-design-space/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-exhaust-the-design-space
description: "Apply when facing a novel UI interaction or."
---
name: principle-exhaust-the-design-space
description: "Apply when a novel UI or design has no precedent."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-experience-first/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-experience-first
description: "Apply when product, UX, or feature-scope tradeoffs come."
---
name: principle-experience-first
description: "Apply when product, UX, or scope tradeoffs come up."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-explain-the-number/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-explain-the-number
description: "Apply before you trust, report, or act on a number you."
---
name: principle-explain-the-number
description: "Apply before you trust or report a measured number."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-fix-root-causes/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-fix-root-causes
description: "Apply when debugging. Trace each symptom to its root."
---
name: principle-fix-root-causes
description: "Apply when debugging: trace each symptom to its root."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-foundational-thinking/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-foundational-thinking
description: "Apply before writing logic: choosing core types and data."
---
name: principle-foundational-thinking
description: "Apply before writing logic: pick core types and data first."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-guard-the-context-window/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-guard-the-context-window
description: "Apply when context is filling up: large outputs, long."
---
name: principle-guard-the-context-window
description: "Apply when context fills with large outputs or files."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-laziness-protocol/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-laziness-protocol
description: "Apply when refactoring, evaluating diff size, or tempted."
---
name: principle-laziness-protocol
description: "Apply when refactoring or tempted to add more code."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-make-operations-idempotent/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-make-operations-idempotent
description: "Apply when designing commands, lifecycle steps, or."
---
name: principle-make-operations-idempotent
description: "Apply when designing commands or steps that may rerun."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-migrate-callers-then-delete-legacy-apis
description: "Apply when introducing a new internal API while old."
---
name: principle-migrate-callers-then-delete-legacy-apis
description: "Apply when replacing an internal API: migrate, then delete."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-minimize-reader-load/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-minimize-reader-load
description: "Apply when reviewing or shaping code that's hard to."
---
name: principle-minimize-reader-load
description: "Apply when reviewing code that is hard to read or trace."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-model-the-domain/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-model-the-domain
description: "Apply when writing stateful logic, or when code branches."
---
name: principle-model-the-domain
description: "Apply when stateful logic branches on scattered conditions."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-never-block-on-the-human/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-never-block-on-the-human
description: "Apply when tempted to ask 'should I do X?' on reversible."
---
name: principle-never-block-on-the-human
description: "Apply when tempted to ask permission on reversible work."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-outcome-oriented-execution/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-outcome-oriented-execution
description: "Apply during planned rewrites and migrations with."
---
name: principle-outcome-oriented-execution
description: "Apply during planned rewrites with explicit phase gates."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-prove-it-works/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-prove-it-works
description: "Apply after completing a task, before declaring done.."
---
name: principle-prove-it-works
description: "Apply after finishing a task, before declaring it done."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-redesign-from-first-principles/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-redesign-from-first-principles
description: "Apply when integrating a new requirement into an."
---
name: principle-redesign-from-first-principles
description: "Apply when adding a requirement to an existing design."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-separate-before-serializing-shared-state
description: "Apply when concurrent actors might write to the same."
---
name: principle-separate-before-serializing-shared-state
description: "Apply when concurrent actors may write the same state."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-sequence-verifiable-units/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-sequence-verifiable-units
description: "Apply to multi-step work (sweeps, migrations, runs of."
---
name: principle-sequence-verifiable-units
description: "Apply to multi-step work: verify each unit before the next."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-subtract-before-you-add/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-subtract-before-you-add
description: "Apply when sequencing an addition, refactor, or rewrite.."
---
name: principle-subtract-before-you-add
description: "Apply when adding or refactoring: remove complexity first."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-test-behavior-not-implementation/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-test-behavior-not-implementation
description: "Apply when you write, change, or keep a test. Call the."
---
name: principle-test-behavior-not-implementation
description: "Apply when writing or reviewing tests: test behavior."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
5 changes: 3 additions & 2 deletions skills/principle-type-system-discipline/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---name: principle-type-system-discipline
description: "Apply when designing types, reviewing a function."
---
name: principle-type-system-discipline
description: "Apply when designing types or reviewing function signatures."
version: 0.1.0
author: poteto (Hermes adaptation)
license: MIT
Expand Down
Loading
Loading