cookiengineer/shakespeare-skill

:rose: Make agents sound like William Shakespeare

Go

0

1 commits

updated Sep 17, 2026

See the code

README

shakespeare-skill

An Agent Skill that teaches coding agents to speak and write like William Shakespeare, backed by a bundled corpus of 14 plays and the complete sonnets — plus bard, a portable static Go binary for searching them.

The skill works with opencode, Claude Code, Gemini CLI, and any other client that follows the open Agent Skills standard (SKILL.md with name and description frontmatter).

User:  talk like Shakespeare and explain what a git rebase does
Agent: Good morrow, gentle friend. A rebase doth lift thy commits from
       their old foundation and set them anew upon another branch, as one
       might transplant a rose to fresher soil. Where once thy history
       forked, it shall run straight and true. Anon!

Contents

What's inside

  • skills/shakespeare/SKILL.md — the skill itself: grammar rules, vocabulary tables, iambic-pentameter guidance, rhetorical figures, register selection, guardrails, and a workflow for looking things up.
  • skills/shakespeare/references/ — the cleaned plays and sonnets plus a deep style-guide.md and insults.md.
  • skills/shakespeare/assets/sonnet-template.md — a sonnet scaffold.
  • bard — a dependency-free static binary that searches an embedded index of ~14,000 spoken lines: by phrase, character, act/scene, or sonnet, and generates Shakespearean insults. Built with CGO_ENABLED=0, so one binary runs anywhere.

Progressive disclosure keeps this cheap: until the skill is triggered, only its name and description occupy context. The 2 MB of plays are read only when needed, and bard means the agent rarely needs to read them at all.

Repository layout

shakespeare-skill/
├── skills/shakespeare/
│   ├── SKILL.md                  # the skill (Agent Skills format)
│   ├── references/
│   │   ├── plays/*.txt           # normalized plays (generated)
│   │   ├── poems/sonnets.txt     # normalized sonnets (generated)
│   │   ├── style-guide.md        # deep grammar/meter/rhetoric reference
│   │   └── insults.md            # insult tables + canonical examples
│   ├── assets/sonnet-template.md
│   └── scripts/README.md         # how to install/build bard
├── cmd/bard/                     # CLI entry point
├── cmd/normalize/                # regenerates references + index
├── internal/
│   ├── normalizer/               # edition-aware Gutenberg parser
│   ├── corpus/                   # data model, works manifest, queries
│   └── index/                    # go:embed of corpus.jsonl
├── sources/gutenberg/*.txt       # raw Project Gutenberg sources
├── .claude-plugin/               # Claude Code plugin + marketplace manifests
├── gemini-extension.json         # Gemini CLI extension manifest
├── opencode.json                 # sample opencode config (skills.paths)
├── Makefile
├── .goreleaser.yaml
└── .github/workflows/            # ci.yml + release.yml

Install: opencode

opencode discovers skills from .opencode/skills/<name>/SKILL.md, .claude/skills/, and .agents/skills/ in the project, and the matching directories under ~/.config/opencode and ~/.claude. It also accepts extra paths via skills.paths.

Option A — point opencode at this repo (global). Add the absolute path to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "skills": {
    "paths": ["/absolute/path/to/shakespeare-skill/skills"]
  }
}

Option B — copy the skill in place (global):

mkdir -p ~/.config/opencode/skills
cp -R skills/shakespeare ~/.config/opencode/skills/

Option C — reuse the Claude/agent path. opencode auto-loads ~/.claude/skills/ and ~/.agents/skills/:

mkdir -p ~/.claude/skills
cp -R skills/shakespeare ~/.claude/skills/

Configuration is loaded once at startup: quit and restart opencode after installing. Then ask something that triggers the skill ("talk like Shakespeare about indexing") or reference it by name. opencode exposes skills through its skill tool, so the agent loads the body on demand.

The opencode.json at the root of this repository already points to ./skills for running inside the checkout.

Install: Claude Code

Claude Code reads skills from ~/.claude/skills/ (personal) and .claude/skills/ (project). Skills are auto-invoked when relevant, or run explicitly with /<skill-name>.

Personal install:

mkdir -p ~/.claude/skills
cp -R skills/shakespeare ~/.claude/skills/

Project install (committed for the whole team):

mkdir -p .claude/skills
cp -R /path/to/shakespeare-skill/skills/shakespeare .claude/skills/

Plugin install (this repo is already a plugin + marketplace):

/plugin marketplace add cookiengineer/shakespeare-skill
/plugin install shakespeare

Then use it automatically ("write this commit message as Shakespeare"), or invoke it directly:

/shakespeare

Install: Gemini CLI

Gemini CLI discovers skills from .gemini/skills/ (workspace), ~/.gemini/skills/ (user), and the cross-tool aliases .agents/skills/ and ~/.agents/skills/. It prompts for consent before activating a skill.

Install from Git:

gemini skills install https://github.com/cookiengineer/shakespeare-skill.git --path skills/shakespeare --consent

Or link a local checkout for development:

gemini skills link /path/to/shakespeare-skill/skills/shakespeare --scope user

Or bundle as an extension (this repo ships gemini-extension.json):

gemini extensions install https://github.com/cookiengineer/shakespeare-skill

Check what loaded with /skills list, then ask Gemini to speak like Shakespeare; it activates the skill automatically.

Install: other Agent Skills clients

The skill folder is portable. Copy skills/shakespeare/ into whatever directory your client scans for Agent Skills (for example Cursor, GitHub Copilot, and OpenHands use .agents/skills/ or an equivalent configured path). The only hard requirement is that SKILL.md sits in a folder named shakespeare and starts with the name/description frontmatter, which it does.

Using the bard CLI

Download a prebuilt static binary from GitHub Releases, or build it:

make build                          # -> bin/bard
# or, without make:
CGO_ENABLED=0 go build -trimpath -o bard ./cmd/bard

Put it on PATH (or in skills/shakespeare/scripts/) and the skill will use it automatically. Every command accepts --json for machine-readable output.

CommandDescription
bard search "<phrase>" --work <slug> --speaker <name> --limit NFind spoken lines containing a phrase
bard speaker "<name>" --work <slug> --limit NShow a character's lines (fuzzy-matches abbreviations: "Hamlet" → "Ham")
bard quote --work <slug> --act 3 --scene 1 [--random]Print a passage
bard sonnet <1-154> / bard sonnet --randomPrint a sonnet
bard insult [-n N]Generate a Shakespearean insult
bard list plays / bard list speakers --work <slug>List works or characters
bard statsCorpus statistics
bard normalize / bard versionRegenerate references, or print the version

Examples:

$ bard search "not to be" --work hamlet --limit 1
Hamlet, Act III, Scene I
  Ham: To be, or not to be, that is the question: ...

$ bard speaker macbeth --work macbeth --limit 1
Macbeth, Act I, Scene III
  Macb: So foule and faire a day I haue not seene

$ bard insult
Thou roguish swag-bellied barnacle!

Bundled works

SlugTitleKindSource edition
antony-and-cleopatraAntony and CleopatraplayFirst Folio
the-comedy-of-errorsThe Comedy of ErrorsplayGlobe
coriolanusCoriolanusplayGlobe
hamletHamletplayKean (italic)
julius-caesarJulius CaesarplayGlobe
king-learKing LearplayGlobe
macbethMacbethplayFirst Folio
the-merchant-of-veniceThe Merchant of VeniceplayGlobe
much-ado-about-nothingMuch Ado about NothingplayGlobe
richard-iiiKing Richard IIIplayGlobe
romeo-and-julietRomeo and JulietplayRolfe (italic)
the-tempestThe TempestplayGlobe
twelfth-nightTwelfth NightplayGlobe
the-winters-taleThe Winter's TaleplayGlobe
sonnetsShakespeare's SonnetspoemsSonnets

Development

Requirements: Go 1.23+ and (optionally) make.

make normalize   # regenerate references/ and internal/index/corpus.jsonl
make test        # go test ./...
make vet         # go vet ./...
make build       # static binary at bin/bard
make check       # fmt + vet + test + build (what CI runs)
make cross       # local cross-compiled binaries for linux/darwin/windows

How normalization works. The raw Project Gutenberg files vary wildly: uppercase SPEAKER. lines, underscored _Speaker._ italic editions, First Folio spellings ( Lenox., Actus Primus. Scoena Prima.), and the numbered sonnets. internal/normalizer detects the edition (recorded in the works manifest), strips the Gutenberg boilerplate, line numbers, footnote markers, and italic marks, and emits both a readable text file and structured {work, act, scene, speaker, text} records. internal/index embeds the resulting corpus.jsonl with go:embed, so bard needs no external files.

Adding a work. Drop the raw file in sources/gutenberg/, add an entry to corpus.Works in internal/corpus/corpus.go with its edition and slug, run make normalize, and commit the generated output.

CI runs gofmt, go vet, the test suite, a static build, a smoke test, and an idempotence check that fails if make normalize produces a diff.

Publishing

  1. Push the repository to GitHub.

  2. Tag a release; the release workflow runs GoReleaser and attaches bard archives for Linux, macOS, and Windows (amd64/arm64) to the GitHub release.

    git tag v1.0.0
    git push origin v1.0.0
    
  3. For Claude Code, the repository already contains .claude-plugin/ so it can be added as a plugin marketplace (/plugin marketplace add <owner>/<repo>).

  4. For Gemini CLI, submit the extension to the gallery following Google's extension releasing guide.

  5. For the broader Agent Skills ecosystem, the skills/shakespeare/ folder is already in the standard layout; list it wherever the community indexes skills.

License and attribution

  • Code and manifests: MIT (see LICENSE).
  • Authored prose and data (SKILL.md, style-guide.md, insults.md, the sonnet template): CC0-1.0.
  • Literary texts: William Shakespeare's works are in the public domain. The raw files in sources/gutenberg/ are Project Gutenberg eBooks and remain under the Project Gutenberg License; the normalized texts are derivatives of those files. See THIRD_PARTY_NOTICES.md for the required notice and per-work attribution. Project Gutenberg is a registered trademark and does not endorse this project.

Contributors

cookiengineer

1 commits

cookiengineer/shakespeare-skill

:rose: Make agents sound like William Shakespeare

Go

0

1 commits

updated Sep 17, 2026

See the code

README

shakespeare-skill

An Agent Skill that teaches coding agents to speak and write like William Shakespeare, backed by a bundled corpus of 14 plays and the complete sonnets — plus bard, a portable static Go binary for searching them.

The skill works with opencode, Claude Code, Gemini CLI, and any other client that follows the open Agent Skills standard (SKILL.md with name and description frontmatter).

User:  talk like Shakespeare and explain what a git rebase does
Agent: Good morrow, gentle friend. A rebase doth lift thy commits from
       their old foundation and set them anew upon another branch, as one
       might transplant a rose to fresher soil. Where once thy history
       forked, it shall run straight and true. Anon!

Contents

What's inside

  • skills/shakespeare/SKILL.md — the skill itself: grammar rules, vocabulary tables, iambic-pentameter guidance, rhetorical figures, register selection, guardrails, and a workflow for looking things up.
  • skills/shakespeare/references/ — the cleaned plays and sonnets plus a deep style-guide.md and insults.md.
  • skills/shakespeare/assets/sonnet-template.md — a sonnet scaffold.
  • bard — a dependency-free static binary that searches an embedded index of ~14,000 spoken lines: by phrase, character, act/scene, or sonnet, and generates Shakespearean insults. Built with CGO_ENABLED=0, so one binary runs anywhere.

Progressive disclosure keeps this cheap: until the skill is triggered, only its name and description occupy context. The 2 MB of plays are read only when needed, and bard means the agent rarely needs to read them at all.

Repository layout

shakespeare-skill/
├── skills/shakespeare/
│   ├── SKILL.md                  # the skill (Agent Skills format)
│   ├── references/
│   │   ├── plays/*.txt           # normalized plays (generated)
│   │   ├── poems/sonnets.txt     # normalized sonnets (generated)
│   │   ├── style-guide.md        # deep grammar/meter/rhetoric reference
│   │   └── insults.md            # insult tables + canonical examples
│   ├── assets/sonnet-template.md
│   └── scripts/README.md         # how to install/build bard
├── cmd/bard/                     # CLI entry point
├── cmd/normalize/                # regenerates references + index
├── internal/
│   ├── normalizer/               # edition-aware Gutenberg parser
│   ├── corpus/                   # data model, works manifest, queries
│   └── index/                    # go:embed of corpus.jsonl
├── sources/gutenberg/*.txt       # raw Project Gutenberg sources
├── .claude-plugin/               # Claude Code plugin + marketplace manifests
├── gemini-extension.json         # Gemini CLI extension manifest
├── opencode.json                 # sample opencode config (skills.paths)
├── Makefile
├── .goreleaser.yaml
└── .github/workflows/            # ci.yml + release.yml

Install: opencode

opencode discovers skills from .opencode/skills/<name>/SKILL.md, .claude/skills/, and .agents/skills/ in the project, and the matching directories under ~/.config/opencode and ~/.claude. It also accepts extra paths via skills.paths.

Option A — point opencode at this repo (global). Add the absolute path to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "skills": {
    "paths": ["/absolute/path/to/shakespeare-skill/skills"]
  }
}

Option B — copy the skill in place (global):

mkdir -p ~/.config/opencode/skills
cp -R skills/shakespeare ~/.config/opencode/skills/

Option C — reuse the Claude/agent path. opencode auto-loads ~/.claude/skills/ and ~/.agents/skills/:

mkdir -p ~/.claude/skills
cp -R skills/shakespeare ~/.claude/skills/

Configuration is loaded once at startup: quit and restart opencode after installing. Then ask something that triggers the skill ("talk like Shakespeare about indexing") or reference it by name. opencode exposes skills through its skill tool, so the agent loads the body on demand.

The opencode.json at the root of this repository already points to ./skills for running inside the checkout.

Install: Claude Code

Claude Code reads skills from ~/.claude/skills/ (personal) and .claude/skills/ (project). Skills are auto-invoked when relevant, or run explicitly with /<skill-name>.

Personal install:

mkdir -p ~/.claude/skills
cp -R skills/shakespeare ~/.claude/skills/

Project install (committed for the whole team):

mkdir -p .claude/skills
cp -R /path/to/shakespeare-skill/skills/shakespeare .claude/skills/

Plugin install (this repo is already a plugin + marketplace):

/plugin marketplace add cookiengineer/shakespeare-skill
/plugin install shakespeare

Then use it automatically ("write this commit message as Shakespeare"), or invoke it directly:

/shakespeare

Install: Gemini CLI

Gemini CLI discovers skills from .gemini/skills/ (workspace), ~/.gemini/skills/ (user), and the cross-tool aliases .agents/skills/ and ~/.agents/skills/. It prompts for consent before activating a skill.

Install from Git:

gemini skills install https://github.com/cookiengineer/shakespeare-skill.git --path skills/shakespeare --consent

Or link a local checkout for development:

gemini skills link /path/to/shakespeare-skill/skills/shakespeare --scope user

Or bundle as an extension (this repo ships gemini-extension.json):

gemini extensions install https://github.com/cookiengineer/shakespeare-skill

Check what loaded with /skills list, then ask Gemini to speak like Shakespeare; it activates the skill automatically.

Install: other Agent Skills clients

The skill folder is portable. Copy skills/shakespeare/ into whatever directory your client scans for Agent Skills (for example Cursor, GitHub Copilot, and OpenHands use .agents/skills/ or an equivalent configured path). The only hard requirement is that SKILL.md sits in a folder named shakespeare and starts with the name/description frontmatter, which it does.

Using the bard CLI

Download a prebuilt static binary from GitHub Releases, or build it:

make build                          # -> bin/bard
# or, without make:
CGO_ENABLED=0 go build -trimpath -o bard ./cmd/bard

Put it on PATH (or in skills/shakespeare/scripts/) and the skill will use it automatically. Every command accepts --json for machine-readable output.

CommandDescription
bard search "<phrase>" --work <slug> --speaker <name> --limit NFind spoken lines containing a phrase
bard speaker "<name>" --work <slug> --limit NShow a character's lines (fuzzy-matches abbreviations: "Hamlet" → "Ham")
bard quote --work <slug> --act 3 --scene 1 [--random]Print a passage
bard sonnet <1-154> / bard sonnet --randomPrint a sonnet
bard insult [-n N]Generate a Shakespearean insult
bard list plays / bard list speakers --work <slug>List works or characters
bard statsCorpus statistics
bard normalize / bard versionRegenerate references, or print the version

Examples:

$ bard search "not to be" --work hamlet --limit 1
Hamlet, Act III, Scene I
  Ham: To be, or not to be, that is the question: ...

$ bard speaker macbeth --work macbeth --limit 1
Macbeth, Act I, Scene III
  Macb: So foule and faire a day I haue not seene

$ bard insult
Thou roguish swag-bellied barnacle!

Bundled works

SlugTitleKindSource edition
antony-and-cleopatraAntony and CleopatraplayFirst Folio
the-comedy-of-errorsThe Comedy of ErrorsplayGlobe
coriolanusCoriolanusplayGlobe
hamletHamletplayKean (italic)
julius-caesarJulius CaesarplayGlobe
king-learKing LearplayGlobe
macbethMacbethplayFirst Folio
the-merchant-of-veniceThe Merchant of VeniceplayGlobe
much-ado-about-nothingMuch Ado about NothingplayGlobe
richard-iiiKing Richard IIIplayGlobe
romeo-and-julietRomeo and JulietplayRolfe (italic)
the-tempestThe TempestplayGlobe
twelfth-nightTwelfth NightplayGlobe
the-winters-taleThe Winter's TaleplayGlobe
sonnetsShakespeare's SonnetspoemsSonnets

Development

Requirements: Go 1.23+ and (optionally) make.

make normalize   # regenerate references/ and internal/index/corpus.jsonl
make test        # go test ./...
make vet         # go vet ./...
make build       # static binary at bin/bard
make check       # fmt + vet + test + build (what CI runs)
make cross       # local cross-compiled binaries for linux/darwin/windows

How normalization works. The raw Project Gutenberg files vary wildly: uppercase SPEAKER. lines, underscored _Speaker._ italic editions, First Folio spellings ( Lenox., Actus Primus. Scoena Prima.), and the numbered sonnets. internal/normalizer detects the edition (recorded in the works manifest), strips the Gutenberg boilerplate, line numbers, footnote markers, and italic marks, and emits both a readable text file and structured {work, act, scene, speaker, text} records. internal/index embeds the resulting corpus.jsonl with go:embed, so bard needs no external files.

Adding a work. Drop the raw file in sources/gutenberg/, add an entry to corpus.Works in internal/corpus/corpus.go with its edition and slug, run make normalize, and commit the generated output.

CI runs gofmt, go vet, the test suite, a static build, a smoke test, and an idempotence check that fails if make normalize produces a diff.

Publishing

  1. Push the repository to GitHub.

  2. Tag a release; the release workflow runs GoReleaser and attaches bard archives for Linux, macOS, and Windows (amd64/arm64) to the GitHub release.

    git tag v1.0.0
    git push origin v1.0.0
    
  3. For Claude Code, the repository already contains .claude-plugin/ so it can be added as a plugin marketplace (/plugin marketplace add <owner>/<repo>).

  4. For Gemini CLI, submit the extension to the gallery following Google's extension releasing guide.

  5. For the broader Agent Skills ecosystem, the skills/shakespeare/ folder is already in the standard layout; list it wherever the community indexes skills.

License and attribution

  • Code and manifests: MIT (see LICENSE).
  • Authored prose and data (SKILL.md, style-guide.md, insults.md, the sonnet template): CC0-1.0.
  • Literary texts: William Shakespeare's works are in the public domain. The raw files in sources/gutenberg/ are Project Gutenberg eBooks and remain under the Project Gutenberg License; the normalized texts are derivatives of those files. See THIRD_PARTY_NOTICES.md for the required notice and per-work attribution. Project Gutenberg is a registered trademark and does not endorse this project.

Contributors

cookiengineer

1 commits

Languages

Go

96.5%

Makefile

3.5%