Community写作与编辑github.com

tolimcn7786/skills

Compile natural language specs into local neural functions for text classification, extraction, and fuzzy matching tasks in your AI coding agent.

skills 是什么?

skills is a Claude Code agent skill that compile natural language specs into local neural functions for text classification, extraction, and fuzzy matching tasks in your AI coding agent.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add tolimcn7786/skills

Installed? Explore more 写作与编辑 skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

ProgramAsWeights (PAW)

ProgramAsWeights compiles a short natural-language spec into a tiny neural function ("neural software") that takes one text input and returns one text output and runs locally. You compile once on the hosted API; the resulting function then runs locally and offline forever.

When to use this

Reach for PAW when a task is fuzzy text -> text and you want it cheap, fast, local, and repeatable:

  • Classification / categorization - sentiment, urgency, intent, topic, spam, or ALERT vs QUIET log lines.
  • Extraction - pull emails, names, dates, IDs, or fields out of messy/unstructured text.
  • Format repair / normalization - fix broken JSON, normalize dates, clean inconsistent inputs.
  • Fuzzy matching - typo-tolerant matching, near-duplicate detection, map a phrase to the closest option.
  • Triage / routing - filter noise from logs, route a request to the right handler.

It replaces a brittle regex or an expensive per-item LLM call with one small function that, after compiling, runs in roughly 0.05-0.5s locally with no network.

When NOT to use it

  • Long-form or open-ended generation (essays, code, chat) - use a full LLM instead.
  • Multi-step reasoning, math, or tasks that need broad world knowledge.
  • Anything that is not single text in -> single text out. Functions are stateless and share a ~2048-token window across spec + input + output.

How to use it (the workflow)

1. Check the Hub first. Someone may have already published a function; try a slug before compiling:

import programasweights as paw

fn = paw.function("email-triage")   # downloads once, then runs locally
fn("Urgent: server is down!")        # "immediate"
fn("Newsletter: spring picnic")      # "wait"

2. Otherwise compile your own. A good spec is a description PLUS a few Input: ... Output: ... examples and an explicit output constraint:

import programasweights as paw

fn = paw.compile_and_load("""
Classify support tickets. Return ONLY one of: billing, bug, feature, other.

Input: I was charged twice this month
Output: billing

Input: The export button does nothing
Output: bug

Input: Please add a dark mode
Output: feature
""")

fn("my card got charged again")   # "billing"

3. Iterate with test cases - the #1 practice. Do not accept the first result. Build a small set of input/expected pairs, measure accuracy, then refine the wording and examples and recompile until it is good enough. Treat it like software: test, debug the specific failures, fix the spec, retest. A minimal eval loop:

import programasweights as paw

tests = [
    {"input": "I was charged twice this month", "expected": "billing"},
    {"input": "The export button does nothing", "expected": "bug"},
    {"input": "Please add a dark mode",          "expected": "feature"},
]

fn = paw.compile_and_load(open("spec.txt").read())
results = [(t, fn(t["input"]).strip()) for t in tests]
misses = [(t, got) for t, got in results if got != t["expected"]]
print(f"accuracy: {(len(tests) - len(misses)) / len(tests):.0%}")
for t, got in misses:        # inspect failures, then fix the spec + recompile
    print("FAIL:", t["input"], "-> got", repr(got), "want", repr(t["expected"]))

See references/writing-good-specs.md for how to debug the misses.

4. Save the program id or slug and reuse it locally. Inference needs no server after the first asset download.

Install

pip install programasweights --extra-index-url https://pypi.programasweights.com/simple/

Browser / JavaScript: npm install @programasweights/web. Functions compiled with compiler="paw-4b-gpt2" run client-side via WebAssembly. See references/browser-sdk.md.

What runs where (data flow - read before using)

  • Compile sends your spec to the hosted PAW API (https://programasweights.com) and returns a program id. Do not put secrets in a spec.
  • Inference runs locally through the SDK and works offline after the first download.
  • Auth is optional - anonymous use works. Sign in only for higher compile rate limits and named slugs (export PAW_API_KEY=paw_sk_...).

More detail (load on demand)

  • Full API, compilers, versioning, chaining, auth: references/api.md
  • Writing and debugging specs: references/writing-good-specs.md
  • Browser / JavaScript SDK: references/browser-sdk.md
  • Common errors and fixes: references/troubleshooting.md
  • Worked case studies (log monitoring, semantic search, tool calling): https://programasweights.readthedocs.io

相关技能

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community