jianshuo/claude-skills / wjs-x-improving-content
wjs-x-improving-content
VerifiedUse when 王建硕 wants to systematically improve his X (Twitter) content by iterating on the content-generation prompt (prompts/x/prompt.md, used by the every-6h tweet Action) and finding which prompt version produces the highest-reach tweets. Each prompt edit is a git-SHA-versioned, numbered experiment with a hypothesis; tweets are attributed to the version live at post time and judged on median impressions per tweet. Also mines per-tweet impression data for content-feature signals (angle / length / topic) that feed the next prompt edit. North-star = impressions per tweet. Triggers — "改 X 的 prompt", "X 内容改进", "哪版 prompt 最好", "什么内容 impression 高", "improve my tweets", "A/B test the X prompt", "/wjs-x-improving-content".
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.2 KB |
| inbox/.gitignore | other | 12 B |
| scripts/_common.pyexecutable | script | 1.5 KB |
| scripts/analyze-content.pyexecutable | script | 4.1 KB |
| scripts/evaluate.pyexecutable | script | 3.1 KB |
| scripts/ingest-tweets.pyexecutable | script | 4.3 KB |
| scripts/ledger.pyexecutable | script | 2.9 KB |
| scripts/scoreboard.pyexecutable | script | 3.7 KB |
| state/.gitignore | other | 6 B |
| state/SCOREBOARD.md | markdown | 1.1 KB |
| state/tweets.jsonl | other | 42.1 KB |
| state/versions.jsonl | other | 523 B |
scripts/_common.py
View on GitHub"""Shared helpers for wjs-x-improving-content. stdlib only."""
import json
from datetime import date, datetime
from pathlib import Path
from statistics import median
SKILL_DIR = Path(__file__).resolve().parent.parent
STATE = SKILL_DIR / "state"
TWEETS = STATE / "tweets.jsonl"
VERSIONS = STATE / "versions.jsonl"
SCOREBOARD = STATE / "SCOREBOARD.md"
# Where the prompt-generated tweets are logged, and where the X prompt lives.
HISTORY = Path.home() / ".claude/skills/wjs-tweeting-from-articles/state/history.jsonl"
REPO = Path.home() / "code/wechat-publish"
PROMPT_FILE = "prompts/x/prompt.md" # relative to REPO
MATURITY_DAYS = 3 # impressions keep climbing; tweets younger than this don't count in verdicts
MIN_TWEETS_PER_VERSION = 5 # need at least this many mature tweets before a version verdict
def read_jsonl(path: Path):
if not path.exists():
return []
return [json.loads(l) for l in path.read_text().splitlines() if l.strip()]
def write_jsonl(path: Path, rows):
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text("".join(json.dumps(r, ensure_ascii=False) + "\n" for r in rows))
def parse_date(s):
return datetime.strptime(s, "%Y-%m-%d").date()
def med(vals):
vals = [v for v in vals if v is not None]
return round(median(vals), 1) if vals else None
def cjk_len(text):
"""王建硕 tweets are CJK; count chars excluding whitespace as the length proxy."""
return len("".join(text.split()))
def mature_tweets():
return [t for t in read_jsonl(TWEETS) if t.get("mature")]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |