Move all three skills into skills/; add root README; fix paths

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VasanthandClaude Sonnet 5.5 committed 2026-10-16 17:04:38 +05:30
1 parent 312742cfef
commit d95e5d452d
84 files changed
+97 -31

No files matched your search

@@ -0,0 +1,35 @@
"""Keep the optional sections the user chose in dashboard.html, and delete the rest.
Usage: python sections.py <dashboard.html> [checkpoints] [admin] [login]
Each section sits between marker lines, in HTML, CSS and script:
<!-- OPTIONAL:admin BEGIN --> /* OPTIONAL:admin BEGIN */ // OPTIONAL:admin BEGIN
... ... ...
<!-- OPTIONAL:admin END --> /* OPTIONAL:admin END */ // OPTIONAL:admin END
Chosen sections lose only their marker lines. Unchosen ones lose everything.
The file is rewritten in place. Name no sections to remove all of them.
"""
import re
import sys
from pathlib import Path
SECTIONS = ("checkpoints", "admin", "login")
BLOCK = re.compile(r"^[ \t]*(?:<!--|/\*|//) OPTIONAL:(\w+) BEGIN.*\n((?:.*\n)*?)[ \t]*(?:<!--|/\*|//) OPTIONAL:\1 END.*\n", re.M)
def keep(html, chosen):
unknown = set(chosen) - set(SECTIONS)
if unknown:
sys.exit(f"unknown section(s) {', '.join(sorted(unknown))}; choose from {', '.join(SECTIONS)}")
html = BLOCK.sub(lambda m: m[2] if m[1] in chosen else "", html)
if "OPTIONAL:" in html:
sys.exit("an OPTIONAL marker has no matching BEGIN/END line; fix the template")
return html
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit(__doc__)
page = Path(sys.argv[1])
page.write_text(keep(page.read_text(encoding="utf-8"), sys.argv[2:]), encoding="utf-8")
print(f"{page}: kept {', '.join(sys.argv[2:]) or 'no optional sections'}")