bitjaru/styleseed / extensions/learning/skills/ss-learn
ss-learn
VerifiedCapture a human-approved UI design lesson as a privacy-minimized local StyleSeed candidate, review it, and prepare an opt-in share package without transmitting project code, prompts, screenshots, or brand data. Use when a person asks StyleSeed to remember, learn from, generalize, review, or prepare a reusable rule from an accepted design correction.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.9 KB |
| agents/openai.yaml | config | 291 B |
| references/candidate-record.schema.json | config | 2.1 KB |
| references/candidate.schema.json | config | 2.4 KB |
| references/privacy-contract.md | markdown | 2.1 KB |
| references/share-package.schema.json | config | 808 B |
| scripts/learning-contract.mjs | script | 9.6 KB |
| scripts/learning-package.mjs | script | 4.1 KB |
| scripts/learning.mjs | script | 10.4 KB |
| scripts/privacy-scan.mjs | script | 3.1 KB |
| scripts/secure-fs.mjs | script | 10.7 KB |
scripts/privacy-scan.mjs
View on GitHubconst ZERO_WIDTH_AND_BIDI = /[\u200B-\u200D\u202A-\u202E\u2060\u2066-\u2069\uFEFF]/gu;
const MAX_TEXT = 600;
function clean(value) {
return String(value).normalize("NFKC").replace(ZERO_WIDTH_AND_BIDI, "");
}
function isLuhn(value) {
let sum = 0;
let parity = value.length % 2;
for (let i = 0; i < value.length; i += 1) {
let digit = Number(value[i]);
if (i % 2 === parity) {
digit *= 2;
if (digit > 9) digit -= 9;
}
sum += digit;
}
return sum % 10 === 0;
}
function luhnCard(text) {
const candidates = text.match(/(?:\d[ -]?){13,19}/gu) ?? [];
return candidates.some((value) => {
const digits = value.replace(/\D/gu, "");
return digits.length >= 13 && digits.length <= 19 && isLuhn(digits);
});
}
const RULES = [
["code-or-markup", /```|<\/?[A-Za-z][^>]*>|\b(?:import|export)\s+.+\bfrom\b|\b(?:className|onClick|useState)\s*=/iu],
["url-or-domain", /(?:https?:\/\/|ftp:\/\/|www\.|\b[a-z0-9-]+\.(?:com|net|org|io|dev|app|co\.kr|kr)\b)/iu],
["email", /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/iu],
["local-path", /(?:^|[\s"'`])\/(?:Users|home|private|var|tmp|workspace|Volumes)\/[^\s"'`]+|\b[A-Z]:\\[^\s"'`]+/u],
["secret-like", /\b(?:sk-[A-Za-z0-9_-]{12,}|gh[pousr]_[A-Za-z0-9]{12,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{12,}|AIza[0-9A-Za-z_-]{20,})\b/u],
["color-value", /(?:^|[^A-Za-z0-9])#[0-9a-f]{3,8}(?:[^A-Za-z0-9]|$)|\b(?:rgb|hsl)a?\([^)]{3,}\)/iu],
["resident-id-like", /\b\d{6}[- ]?[1-4]\d{6}\b/u],
["ip-address", /\b(?:25[0-5]|2[0-4]\d|1?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|1?\d?\d)){3}\b/u],
["card-number", /(?:\d[ -]?){13,19}/u],
["phone", /(?:\+?82[- .]?10|(?:01[016789]|02|0[3-9]\d))[- .]?\d{3,4}[- .]?\d{4}/u],
["account-like", /\b\d(?:[ -]?\d){9,18}\b/u],
];
const FREE_TEXT_FIELDS = [
["title", (candidate) => [candidate.title]],
["learning.problem", (candidate) => [candidate.learning?.problem]],
["learning.intervention", (candidate) => [candidate.learning?.intervention]],
["learning.rationale", (candidate) => [candidate.learning?.rationale]],
["learning.appliesWhen", (candidate) => candidate.learning?.appliesWhen ?? []],
["learning.avoidWhen", (candidate) => candidate.learning?.avoidWhen ?? []],
];
export const scannerVersion = 2;
export function scanCandidatePrivacy(candidate) {
const findings = [];
for (const [field, getter] of FREE_TEXT_FIELDS) {
for (const value of getter(candidate)) {
if (typeof value !== "string") continue;
const text = clean(value).slice(0, MAX_TEXT);
for (const [code, pattern] of RULES) {
const matched = code === "card-number" ? luhnCard(text) : pattern.test(text);
if (matched || (code === "account-like" && luhnCard(text))) {
findings.push({ code: code === "account-like" && luhnCard(text) ? "card-number" : code, field });
break;
}
}
}
}
return { scannerVersion, findings };
}
export function assertCandidatePrivacy(candidate) {
const result = scanCandidatePrivacy(candidate);
if (result.findings.length > 0) {
throw new Error(`Privacy scan rejected ${result.findings[0].code} in ${result.findings[0].field}. Generalize the candidate further.`);
}
return candidate;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |