Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ccf377f
chore(typing): exclude skill dirs from ty analysis
RazorBackRoar Feb 18, 2026
7bf806d
chore(ci): enforce Ruff SSOT and quality gates
RazorBackRoar Feb 18, 2026
7b13a94
fix(ci): load canonical ruff config before lint
RazorBackRoar Feb 18, 2026
fe7b211
fix(ci): use local Ruff fallback for Actions
RazorBackRoar Feb 18, 2026
3c6087d
fix(ci): create ty compatibility paths on macos
RazorBackRoar Feb 18, 2026
d54974d
test: update AGENTS.md, README.md, main_window.py
RazorBackRoar Feb 19, 2026
da4613c
chore: bump version to 4.9.1
RazorBackRoar Feb 19, 2026
cce46a5
chore: sync version docs
RazorBackRoar Feb 19, 2026
1c669de
fix(gui): use strict host validation in URL checks
RazorBackRoar Feb 19, 2026
6735269
chore: update AGENTS.md, README.md
RazorBackRoar Feb 19, 2026
ad8b74d
chore: bump version to 4.9.2
RazorBackRoar Feb 19, 2026
d067400
chore: sync version docs
RazorBackRoar Feb 19, 2026
30305c8
chore: update .gitignore, AGENTS.md, README.md
RazorBackRoar Feb 19, 2026
ece3432
chore: bump version to 4.9.3
RazorBackRoar Feb 19, 2026
238e202
chore: sync version docs
RazorBackRoar Feb 19, 2026
64d4566
chore: update .gitignore, AGENTS.md, README.md
RazorBackRoar Feb 19, 2026
f456926
chore: bump version to 4.9.4
RazorBackRoar Feb 19, 2026
87a1158
chore: sync version docs
RazorBackRoar Feb 19, 2026
f07e6ca
test: update core.py, design_system.py, search.py and 7 more
RazorBackRoar Feb 21, 2026
867a864
chore: bump version to 4.9.5
RazorBackRoar Feb 21, 2026
d007864
feat: update README.md
RazorBackRoar Feb 21, 2026
480182b
chore: bump version to 4.10.0
RazorBackRoar Feb 21, 2026
cb641e8
chore(ci): update ci.yml, README.md
RazorBackRoar Feb 24, 2026
1a4d2ed
chore: bump version to 4.11.0
RazorBackRoar Feb 24, 2026
a76b140
chore: update AGENTS.md, README.md
RazorBackRoar Feb 24, 2026
d938ab3
chore: bump version to 4.12.0
RazorBackRoar Feb 24, 2026
9cbd627
test: update ci.yml, README.md, pyproject.toml and 2 more
RazorBackRoar Feb 24, 2026
dc5383d
chore: bump version to 4.13.0
RazorBackRoar Feb 24, 2026
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
29 changes: 15 additions & 14 deletions .agent/skills/ui-ux-pro-max/scripts/core.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env python3
"""UI/UX Pro Max Core - BM25 search engine for UI/UX style guides.
# -*- coding: utf-8 -*-
"""
UI/UX Pro Max Core - BM25 search engine for UI/UX style guides
"""

import csv
import re
from collections import defaultdict
from math import log
from pathlib import Path

from math import log
from collections import defaultdict

# ============ CONFIGURATION ============
DATA_DIR = Path(__file__).parent.parent / "data"
Expand Down Expand Up @@ -93,7 +94,7 @@

# ============ BM25 IMPLEMENTATION ============
class BM25:
"""BM25 ranking algorithm for text search."""
"""BM25 ranking algorithm for text search"""

def __init__(self, k1=1.5, b=0.75):
self.k1 = k1
Expand All @@ -106,12 +107,12 @@ def __init__(self, k1=1.5, b=0.75):
self.N = 0

def tokenize(self, text):
"""Lowercase, split, remove punctuation, filter short words."""
"""Lowercase, split, remove punctuation, filter short words"""
text = re.sub(r'[^\w\s]', ' ', str(text).lower())
return [w for w in text.split() if len(w) > 2]

def fit(self, documents):
"""Build BM25 index from documents."""
"""Build BM25 index from documents"""
self.corpus = [self.tokenize(doc) for doc in documents]
self.N = len(self.corpus)
if self.N == 0:
Expand All @@ -130,7 +131,7 @@ def fit(self, documents):
self.idf[word] = log((self.N - freq + 0.5) / (freq + 0.5) + 1)

def score(self, query):
"""Score all documents against query."""
"""Score all documents against query"""
query_tokens = self.tokenize(query)
scores = []

Expand All @@ -156,13 +157,13 @@ def score(self, query):

# ============ SEARCH FUNCTIONS ============
def _load_csv(filepath):
"""Load CSV and return list of dicts."""
with open(filepath, encoding='utf-8') as f:
"""Load CSV and return list of dicts"""
with open(filepath, 'r', encoding='utf-8') as f:
return list(csv.DictReader(f))


def _search_csv(filepath, search_cols, output_cols, query, max_results):
"""Core search function using BM25."""
"""Core search function using BM25"""
if not filepath.exists():
return []

Expand All @@ -187,7 +188,7 @@ def _search_csv(filepath, search_cols, output_cols, query, max_results):


def detect_domain(query):
"""Auto-detect the most relevant domain from query."""
"""Auto-detect the most relevant domain from query"""
query_lower = query.lower()

domain_keywords = {
Expand All @@ -209,7 +210,7 @@ def detect_domain(query):


def search(query, domain=None, max_results=MAX_RESULTS):
"""Main search function with auto-domain detection."""
"""Main search function with auto-domain detection"""
if domain is None:
domain = detect_domain(query)

Expand All @@ -231,7 +232,7 @@ def search(query, domain=None, max_results=MAX_RESULTS):


def search_stack(query, stack, max_results=MAX_RESULTS):
"""Search stack-specific guidelines."""
"""Search stack-specific guidelines"""
if stack not in STACK_CONFIG:
return {"error": f"Unknown stack: {stack}. Available: {', '.join(AVAILABLE_STACKS)}"}

Expand Down
Loading
Loading