ai-for-poetry
Reusable Windsurf rules and Cursor agent skill files for cross-project AI-assisted development
Install / Use
npx skills add Ryukijano/agent-skillsInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Skill content
View source on GitHubAI for Poetry
Description
Meter, rhyme, and stylistic constraints for AI-generated poetry, with evaluation and human-AI curation.
When to use
You want to generate or co-write poems under formal constraints such as meter, rhyme, syllable counts, or a specific literary style.
Key concepts
- Formal constraints: meter, rhyme scheme, syllable counts, stanza forms, and refrain patterns.
- Poetic style prompting: persona, era, mood, imagery, alliteration, and lexical register.
- Controllable generation: constrained decoding, iterative refinement, and rule-based post-processing for rhyme and meter.
- Evaluation: automatic metrics, LLM-as-judge, and human evaluation for novelty, emotion, and aesthetic quality.
- Ethics and attribution: respect public-domain or licensed training data and credit human curators.
Code pattern
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "openai-community/gpt2"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
prompt = """Write a Shakespearean sonnet about autumn.
Use iambic pentameter and an ABAB CDCD EFEF GG rhyme scheme:
"""
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(
**inputs,
max_new_tokens=200,
temperature=0.9,
do_sample=True,
)
poem = tokenizer.decode(output[0], skip_special_tokens=True)
print(poem)
Tuning notes
- Use constrained decoding or post-hoc rhyme checking to satisfy form.
- Fine-tune on poetry corpora for stronger stylistic control.
- Balance novelty with readability; avoid cliches.
- Validate meter and rhyme with dedicated tools such as
pronouncingpyorpyphen.
Verification
- Generate 10 sonnets and check rhyme and meter compliance automatically.
- Compare human vs. AI poems in a small blinded preference test.
- Evaluate diversity and novelty across a themed set of poems.
References
- https://doi.org/10.1613/jair.1.20584
- https://aclanthology.org/W17-3502/
- https://aclanthology.org/2024.emnlp-main.1097/
- https://computationalcreativity.net/iccc24/papers/ICCC24_paper_164.pdf
Related Skills
pyspark-etl-best-practices-cursorrules-prompt-file
40.6kCursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
semiotic-react-dataviz-cursorrules-prompt-file
40.6kCursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
claude-howto
41.1kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
AstrBot
39.4kAI Agent Assistant & development framework that integrates lots of IM platforms, LLMs, plugins and AI feature, and can be your openclaw alternative. ✨
Security Score
Audited on Invalid Date
