diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 9bd582c..3a5ed56 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -292,7 +292,7 @@ "description": "Corrects speech-to-text (ASR/STT) transcription errors using dictionary rules and native Claude AI corrections (no API key needed by default). Supports intelligent paragraph breaks, filler word reduction, interactive review, Chinese domain names, and iterative dictionary building. Use when users mention transcript correction, ASR errors, speech-to-text mistakes, homophone errors, or working with transcription files", "source": "./", "strict": false, - "version": "1.3.0", + "version": "1.3.1", "category": "productivity", "keywords": [ "transcription", diff --git a/marketplace-dev/SKILL.md b/marketplace-dev/SKILL.md new file mode 100644 index 0000000..2098760 --- /dev/null +++ b/marketplace-dev/SKILL.md @@ -0,0 +1,206 @@ +--- +name: marketplace-dev +description: | + Convert any Claude Code skills repository into an official plugin marketplace. + Creates .claude-plugin/marketplace.json conforming to the Anthropic spec, validates + it, tests installation, and creates a PR to the upstream repo. + Use this skill when the user says: "make this a marketplace", "add plugin support", + "convert to plugin", "one-click install", "marketplace.json", or wants their skills + repo installable via `claude plugin install`. Also trigger when the user has a + skills repo and mentions distribution, installation, or auto-update. +argument-hint: [repo-path] +--- + +# marketplace-dev + +Convert a Claude Code skills repository into an official plugin marketplace so users +can install skills via `claude plugin marketplace add` and get auto-updates. + +**Input**: a repo with `skills/` directories containing SKILL.md files. +**Output**: `.claude-plugin/marketplace.json` + validated + installation-tested + PR-ready. + +## Phase 1: Analyze the Target Repo + +### Step 1: Discover all skills + +```bash +# Find every SKILL.md +find /skills -name "SKILL.md" -type f 2>/dev/null +``` + +For each skill, extract from SKILL.md frontmatter: +- `name` — the skill identifier +- `description` — the ORIGINAL text, do NOT rewrite or translate + +### Step 2: Read the repo metadata + +- `VERSION` file (if exists) — this becomes `metadata.version` +- `README.md` — understand the project, author info, categories +- `LICENSE` — note the license type +- Git remotes — identify upstream vs fork (`git remote -v`) + +### Step 3: Determine categories + +Group skills by function. Categories are freeform strings. Good patterns: +- `business-diagnostics`, `content-creation`, `thinking-tools`, `utilities` +- `developer-tools`, `productivity`, `documentation`, `security` + +Ask the user to confirm categories if grouping is ambiguous. + +## Phase 2: Create marketplace.json + +### The official schema (memorize this) + +Read `references/marketplace_schema.md` for the complete field reference. +Key rules that are NOT obvious from the docs: + +1. **`$schema` field is REJECTED** by `claude plugin validate`. Do not include it. +2. **`metadata` only has 3 valid fields**: `description`, `version`, `pluginRoot`. Nothing else. + `metadata.homepage` does NOT exist — the validator accepts it silently but it's not in the spec. +3. **`metadata.version`** is the marketplace catalog version, NOT individual plugin versions. + It should match the repo's VERSION file (e.g., `"2.3.0"`). +4. **Plugin entry `version`** is independent. For first-time marketplace registration, use `"1.0.0"`. +5. **`strict: false`** is required when there's no `plugin.json` in the repo. + With `strict: false`, the marketplace entry IS the entire plugin definition. + Having BOTH `strict: false` AND a `plugin.json` with components causes a load failure. +6. **`source: "./"` with `skills: ["./skills/"]`** is the pattern for skills in the same repo. +7. **Reserved marketplace names** that CANNOT be used: `claude-code-marketplace`, + `claude-code-plugins`, `claude-plugins-official`, `anthropic-marketplace`, + `anthropic-plugins`, `agent-skills`, `knowledge-work-plugins`, `life-sciences`. +8. **`tags` vs `keywords`**: Both are optional. In the current Claude Code source, + `keywords` is defined but never consumed in search. `tags` only has a UI effect + for the value `"community-managed"` (shows a label). Neither affects discovery. + The Discover tab searches only `name` + `description` + `marketplaceName`. + Include `keywords` for future-proofing but don't over-invest. + +### Generate the marketplace.json + +Use this template, filling in from the analysis: + +```json +{ + "name": "", + "owner": { + "name": "" + }, + "metadata": { + "description": "", + "version": "" + }, + "plugins": [ + { + "name": "", + "description": "", + "source": "./", + "strict": false, + "version": "1.0.0", + "category": "", + "keywords": ["", ""], + "skills": ["./skills/"] + } + ] +} +``` + +### Naming the marketplace + +The `name` field is what users type after `@` in install commands: +`claude plugin install dbs@` + +Choose a name that is: +- Short and memorable +- kebab-case (lowercase, hyphens only) +- Related to the project identity, not generic + +### Description rules + +- **Use the ORIGINAL description from each SKILL.md frontmatter** +- Do NOT translate, embellish, or "improve" descriptions +- If the repo's audience is Chinese, keep descriptions in Chinese +- If bilingual, use the first language in the SKILL.md description field +- The `metadata.description` at marketplace level can be a new summary + +## Phase 3: Validate + +### Step 1: CLI validation + +```bash +claude plugin validate . +``` + +This catches schema errors. Common failures and fixes: +- `Unrecognized key: "$schema"` → remove the `$schema` field +- `Duplicate plugin name` → ensure all names are unique +- `Path contains ".."` → use `./` relative paths only + +### Step 2: Installation test + +```bash +# Add as local marketplace +claude plugin marketplace add . + +# Install a plugin +claude plugin install @ + +# Verify it appears +claude plugin list | grep + +# Check for updates (should say "already at latest") +claude plugin update @ + +# Clean up +claude plugin uninstall @ +claude plugin marketplace remove +``` + +### Step 3: GitHub installation test (if pushed) + +```bash +# Test from GitHub (requires the branch to be pushed) +claude plugin marketplace add / +claude plugin install @ + +# Verify +claude plugin list | grep + +# Clean up +claude plugin uninstall @ +claude plugin marketplace remove +``` + +## Phase 4: Create PR + +### Principles +- **Pure incremental**: do NOT modify any existing files (skills, README, etc.) +- **Squash commits**: avoid binary bloat in git history from iterative changes +- Only add: `.claude-plugin/marketplace.json`, optionally `scripts/`, optionally update README + +### README update (if appropriate) +Add the marketplace install method above existing install instructions: + +```markdown +## Install + +![demo](demo.gif) + +**Claude Code plugin marketplace (one-click install, auto-update):** + +\`\`\`bash +claude plugin marketplace add / +claude plugin install @ +\`\`\` +``` + +### PR description template +Include: +- What was added (marketplace.json with N skills, M categories) +- Install commands users will use after merge +- Design decisions (pure incremental, original descriptions, etc.) +- Validation evidence (`claude plugin validate .` passed) +- Test plan (install commands to verify) + +## Anti-Patterns (things that went wrong and how to fix them) + +Read `references/anti_patterns.md` for the full list of pitfalls discovered during +real marketplace development. These are NOT theoretical — every one was encountered +and debugged in production. diff --git a/transcript-fixer/scripts/fix_transcript_enhanced.py b/transcript-fixer/scripts/fix_transcript_enhanced.py index b3ca458..594baf3 100755 --- a/transcript-fixer/scripts/fix_transcript_enhanced.py +++ b/transcript-fixer/scripts/fix_transcript_enhanced.py @@ -1,4 +1,11 @@ #!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "httpx>=0.24.0", +# "filelock>=3.13.0", +# ] +# /// """ Enhanced transcript fixer wrapper with improved user experience. diff --git a/transcript-fixer/scripts/fix_transcript_timestamps.py b/transcript-fixer/scripts/fix_transcript_timestamps.py index 17754d2..19664e2 100644 --- a/transcript-fixer/scripts/fix_transcript_timestamps.py +++ b/transcript-fixer/scripts/fix_transcript_timestamps.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [] +# /// """Normalize and repair speaker timestamp lines in ASR transcripts. This script targets transcript lines shaped like: diff --git a/transcript-fixer/scripts/fix_transcription.py b/transcript-fixer/scripts/fix_transcription.py index 323ba17..8815eac 100755 --- a/transcript-fixer/scripts/fix_transcription.py +++ b/transcript-fixer/scripts/fix_transcription.py @@ -1,4 +1,11 @@ #!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [ +# "httpx>=0.24.0", +# "filelock>=3.13.0", +# ] +# /// """ Transcript Fixer - Main Entry Point diff --git a/transcript-fixer/scripts/generate_word_diff.py b/transcript-fixer/scripts/generate_word_diff.py index a36f78d..8c17360 100755 --- a/transcript-fixer/scripts/generate_word_diff.py +++ b/transcript-fixer/scripts/generate_word_diff.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [] +# /// """ Generate Word-Level Diff HTML Comparison diff --git a/transcript-fixer/scripts/split_transcript_sections.py b/transcript-fixer/scripts/split_transcript_sections.py index 89733ba..cd0e648 100644 --- a/transcript-fixer/scripts/split_transcript_sections.py +++ b/transcript-fixer/scripts/split_transcript_sections.py @@ -1,4 +1,8 @@ #!/usr/bin/env python3 +# /// script +# requires-python = ">=3.10" +# dependencies = [] +# /// """Split a transcript into named sections and optionally rebase timestamps. Example: diff --git a/transcript-fixer/scripts/utils/common_words.py b/transcript-fixer/scripts/utils/common_words.py index 16b498c..f9848a3 100644 --- a/transcript-fixer/scripts/utils/common_words.py +++ b/transcript-fixer/scripts/utils/common_words.py @@ -64,6 +64,10 @@ COMMON_WORDS_2CHAR: Set[str] = { "明确", "清晰", "具体", "详细", "准确", "完整", "稳定", "灵活", # --- Domain terms that look like ASR errors but are valid --- "线数", "曲线", "分母", "正面", "旗号", "无果", "演技", + # --- Common verb+一 patterns (打一个/来一个/做一下 etc.) --- + # "打一" caused production false positive: "打一个锚" → "答疑个锚" (2026-04) + "打一", "来一", "做一", "写一", "给一", "拉一", "开一", "看一", + "跑一", "找一", "选一", "试一", "走一", "问一", "搞一", "聊一", } # Common 3+ character words that should also be protected. @@ -88,6 +92,14 @@ COMMON_WORDS_3PLUS: Set[str] = { "保健品", "保健操", "医疗保健", "文化内涵", "无果而终", + # --- Common verb+一+量词 patterns (防止"打一"→X 类误纠) --- + "打一个", "打一针", "打一下", "打一次", "打一把", + "来一个", "来一下", "来一次", "来一杯", + "做一个", "做一下", "做一次", + "写一个", "写一下", "写一篇", + "给一个", "看一下", "看一看", "看一遍", + "跑一下", "跑一遍", "跑一次", + "试一下", "试一试", "试一次", # --- Common Chinese idioms/phrases containing short words --- # These are needed to prevent idiom corruption "正面临", "正面对", @@ -132,6 +144,8 @@ SUBSTRING_COLLISION_MAP: dict[str, list[str]] = { "保健": ["保健品", "保健操", "医疗保健"], # "内涵" common in compound words "内涵": ["内涵段子", "文化内涵"], + # "打一" common in verb+一+量词 (2026-04 production false positive) + "打一": ["打一个", "打一针", "打一下", "打一次", "打一把"], } ALL_COMMON_WORDS: Set[str] = COMMON_WORDS_2CHAR | COMMON_WORDS_3PLUS