agentleFS
ChouChiuChouChiu/heya-skill/AGENTS.md

heya-skill

AGENTS.md20 starsChanged 5 months agoMITView on GitHub

Bilibili creator "黑鸦" title style generator — CLI pipeline + AI skill output. Order matters: bun run check before bun test. CI enforces this. 3 phases: fetch (UApi Bilibili proxy) → analyze (HanLP REST + deterministic aggregation) → generate (template substitution). Fetch uses uapi-sdk-typescript — no Bilibili cookie or WBI signing needed. HanLP REST required for analysis; skip with --skip-analyze. Copy .env.example to .env (gitignored), and start a local HanLP REST service before running analysis. Pipeline performs /health check and…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Bun only: Every command uses bun. No npm/pnpm/yarn.

    line 7

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Bilibili creator "黑鸦" title style generator — CLI pipeline + AI skill output.

Runtime

  • Bun only. Every command uses bun. No npm/pnpm/yarn.
  • bun run <script> for package.json scripts, bun test for tests.
  • #!/usr/bin/env bun shebang on src/index.ts.

Commands

bun install                    # install deps (bun.lock)
bun run check                  # biome check . && tsc --noEmit
bun run format                 # biome check --write .
bun test                       # run all tests
bun test -t <pattern>          # filter by test name regex
bun run pipeline               # full pipeline: fetch → analyze → generate
bun run pipeline --skip-fetch --skip-analyze --dry-run
bun run docs                   # typedoc → docs/ (gitignored)

Order matters: bun run check before bun test. CI enforces this.

Pipeline

3 phases: fetch (UApi Bilibili proxy) → analyze (HanLP REST + deterministic aggregation) → generate (template substitution).

Fetch uses uapi-sdk-typescript — no Bilibili cookie or WBI signing needed. HanLP REST required for analysis; skip with --skip-analyze.

SKILL.md generation

  • Template: SKILL.template.md — the canonical source. Edit this file.
  • Output: skills/heya-title-style/SKILL.md — auto-generated from template + analysis, committed. This is the deployed agent skill artifact.
  • AUTO sections: Content between <!-- AUTO_START:xxx --> / <!-- AUTO_END:xxx --> is replaced by pipeline for these 4 sections: core-features, title-examples, vocab-library, structure-formulas. The core-guidance section has template fallback text but is NOT replaced by pipeline. Never edit AUTO sections in the output file.
  • Reference data: skills/heya-title-style/references/ is auto-generated.
    • 00-llm-brief.md — compact LLM-readable summary
    • 01-titles.csv — raw video titles
    • 02-style-analysis.yaml — structured analysis data
    • 02-style-analysis.md — human-readable analysis report
    • 03-title-features.json — per-title debug data; never load wholesale into LLM context

Environment

VariableRequiredDefaultNotes
UAPI_BASE_URLnohttps://uapis.cnUApi proxy base URL
UAPI_API_KEYno—UApi API key (free tier works without)
BILIBILI_MIDno3706929260006322Target user ID (黑鸦)
BILIBILI_PAGE_SIZEno30Archive API page size
NLP_BACKENDnohanlpOnly hanlp is supported
HANLP_URLyes (unless --skip-analyze)http://127.0.0.1:8765Local HanLP REST service
HANLP_TIMEOUT_MSno20000Per-request timeout (ms)
HANLP_BATCH_SIZEno32Titles per HanLP parse call

Copy .env.example to .env (gitignored), and start a local HanLP REST service before running analysis. Pipeline performs /health check and fails clearly if HanLP unavailable.

Lint / format

  • Biome (v2.5+), not ESLint/Prettier.
  • Excludes: skills/ (see biome.json).
  • Double quotes, tab indent, organize imports on save (assist.source.organizeImports: "on").

TypeScript

  • strict: true, noEmit: true, target: ES2023, moduleResolution: Bundler.
  • Notable: noUncheckedIndexedAccess: true, allowImportingTsExtensions: true, skipLibCheck: true.
  • TypeScript 6.x with bun-types for Bun globals.

Testing

  • bun:test (Bun built-in). No Vitest/Jest config.
  • Integration tests use static fixture data — no network, no HanLP needed.
  • 4 test files: nlp-adapter, pipeline.integration, skill-generation, video-titles.

Architecture

src/index.ts                 CLI entry (bun shebang)
src/shared/                  env, files (CSV/JSON/YAML), paths, sleep
src/features/
  video-titles/              UApi proxy pagination → VideoEntry[]
  style-analysis/            HanLP adapter + style aggregation + report rendering
  skill-generation/          Template → SKILL.md with AUTO section replacement
  pipeline/                  Orchestration + CLI option parsing
tests/                       4 test files (bun:test)
  • Fetch: uapi-sdk-typescript (UapiClient) proxies Bilibili API. No WBI signing needed.
  • NLP: local HanLP REST for segmentation, POS, and NER. Aggregation and style scoring remain deterministic.
  • File I/O: custom CSV/YAML/JSON helpers in src/shared/files.ts (auto-create parent dirs).

CI

Scheduled daily (30 12 * * *) + manual dispatch via .github/workflows/update-reference.yml. Runs: install → check → test → HanLP health check → pipeline → commit if skills/heya-title-style/references/ changed. Note: CI pushes reference data only; SKILL.md is regenerated but commits require manual review.

Commit conventions

Conventional Commits.

<type>(<scope>): <description>

Types: feat, fix, docs, test, refactor, chore, ci. Scopes: video-titles, style-analysis, skill-generation, pipeline, readme.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.