@every-env/compound-plugin 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/.claude-plugin/marketplace.json +37 -0
  2. package/.github/workflows/deploy-docs.yml +39 -0
  3. package/AGENTS.md +48 -0
  4. package/CLAUDE.md +380 -0
  5. package/LICENSE +21 -0
  6. package/README.md +65 -0
  7. package/bun.lock +30 -0
  8. package/docs/css/docs.css +675 -0
  9. package/docs/css/style.css +2886 -0
  10. package/docs/index.html +1046 -0
  11. package/docs/js/main.js +225 -0
  12. package/docs/pages/agents.html +649 -0
  13. package/docs/pages/changelog.html +495 -0
  14. package/docs/pages/commands.html +523 -0
  15. package/docs/pages/getting-started.html +582 -0
  16. package/docs/pages/mcp-servers.html +409 -0
  17. package/docs/pages/skills.html +611 -0
  18. package/docs/solutions/plugin-versioning-requirements.md +77 -0
  19. package/docs/specs/claude-code.md +67 -0
  20. package/docs/specs/codex.md +59 -0
  21. package/docs/specs/opencode.md +57 -0
  22. package/package.json +26 -0
  23. package/plans/grow-your-own-garden-plugin-architecture.md +102 -0
  24. package/plans/landing-page-launchkit-refresh.md +279 -0
  25. package/plugins/coding-tutor/.claude-plugin/plugin.json +9 -0
  26. package/plugins/coding-tutor/README.md +37 -0
  27. package/plugins/coding-tutor/commands/quiz-me.md +1 -0
  28. package/plugins/coding-tutor/commands/sync-tutorials.md +25 -0
  29. package/plugins/coding-tutor/commands/teach-me.md +1 -0
  30. package/plugins/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
  31. package/plugins/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +207 -0
  32. package/plugins/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +193 -0
  33. package/plugins/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
  34. package/plugins/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +118 -0
  35. package/plugins/compound-engineering/.claude-plugin/plugin.json +33 -0
  36. package/plugins/compound-engineering/CHANGELOG.md +393 -0
  37. package/plugins/compound-engineering/CLAUDE.md +90 -0
  38. package/plugins/compound-engineering/LICENSE +21 -0
  39. package/plugins/compound-engineering/README.md +219 -0
  40. package/plugins/compound-engineering/agents/design/design-implementation-reviewer.md +94 -0
  41. package/plugins/compound-engineering/agents/design/design-iterator.md +197 -0
  42. package/plugins/compound-engineering/agents/design/figma-design-sync.md +172 -0
  43. package/plugins/compound-engineering/agents/docs/ankane-readme-writer.md +50 -0
  44. package/plugins/compound-engineering/agents/research/best-practices-researcher.md +100 -0
  45. package/plugins/compound-engineering/agents/research/framework-docs-researcher.md +83 -0
  46. package/plugins/compound-engineering/agents/research/git-history-analyzer.md +42 -0
  47. package/plugins/compound-engineering/agents/research/repo-research-analyst.md +113 -0
  48. package/plugins/compound-engineering/agents/review/agent-native-reviewer.md +246 -0
  49. package/plugins/compound-engineering/agents/review/architecture-strategist.md +52 -0
  50. package/plugins/compound-engineering/agents/review/code-simplicity-reviewer.md +85 -0
  51. package/plugins/compound-engineering/agents/review/data-integrity-guardian.md +70 -0
  52. package/plugins/compound-engineering/agents/review/data-migration-expert.md +97 -0
  53. package/plugins/compound-engineering/agents/review/deployment-verification-agent.md +159 -0
  54. package/plugins/compound-engineering/agents/review/dhh-rails-reviewer.md +45 -0
  55. package/plugins/compound-engineering/agents/review/julik-frontend-races-reviewer.md +222 -0
  56. package/plugins/compound-engineering/agents/review/kieran-python-reviewer.md +104 -0
  57. package/plugins/compound-engineering/agents/review/kieran-rails-reviewer.md +86 -0
  58. package/plugins/compound-engineering/agents/review/kieran-typescript-reviewer.md +95 -0
  59. package/plugins/compound-engineering/agents/review/pattern-recognition-specialist.md +57 -0
  60. package/plugins/compound-engineering/agents/review/performance-oracle.md +110 -0
  61. package/plugins/compound-engineering/agents/review/security-sentinel.md +93 -0
  62. package/plugins/compound-engineering/agents/workflow/bug-reproduction-validator.md +67 -0
  63. package/plugins/compound-engineering/agents/workflow/every-style-editor.md +64 -0
  64. package/plugins/compound-engineering/agents/workflow/lint.md +16 -0
  65. package/plugins/compound-engineering/agents/workflow/pr-comment-resolver.md +69 -0
  66. package/plugins/compound-engineering/agents/workflow/spec-flow-analyzer.md +113 -0
  67. package/plugins/compound-engineering/commands/agent-native-audit.md +277 -0
  68. package/plugins/compound-engineering/commands/changelog.md +137 -0
  69. package/plugins/compound-engineering/commands/create-agent-skill.md +8 -0
  70. package/plugins/compound-engineering/commands/deepen-plan.md +546 -0
  71. package/plugins/compound-engineering/commands/deploy-docs.md +112 -0
  72. package/plugins/compound-engineering/commands/feature-video.md +342 -0
  73. package/plugins/compound-engineering/commands/generate_command.md +162 -0
  74. package/plugins/compound-engineering/commands/heal-skill.md +142 -0
  75. package/plugins/compound-engineering/commands/lfg.md +19 -0
  76. package/plugins/compound-engineering/commands/plan_review.md +7 -0
  77. package/plugins/compound-engineering/commands/release-docs.md +211 -0
  78. package/plugins/compound-engineering/commands/report-bug.md +150 -0
  79. package/plugins/compound-engineering/commands/reproduce-bug.md +99 -0
  80. package/plugins/compound-engineering/commands/resolve_parallel.md +34 -0
  81. package/plugins/compound-engineering/commands/resolve_pr_parallel.md +49 -0
  82. package/plugins/compound-engineering/commands/resolve_todo_parallel.md +35 -0
  83. package/plugins/compound-engineering/commands/test-browser.md +339 -0
  84. package/plugins/compound-engineering/commands/triage.md +310 -0
  85. package/plugins/compound-engineering/commands/workflows/compound.md +202 -0
  86. package/plugins/compound-engineering/commands/workflows/plan.md +466 -0
  87. package/plugins/compound-engineering/commands/workflows/review.md +514 -0
  88. package/plugins/compound-engineering/commands/workflows/work.md +363 -0
  89. package/plugins/compound-engineering/commands/xcode-test.md +331 -0
  90. package/plugins/compound-engineering/skills/agent-browser/SKILL.md +223 -0
  91. package/plugins/compound-engineering/skills/agent-native-architecture/SKILL.md +435 -0
  92. package/plugins/compound-engineering/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  93. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  94. package/plugins/compound-engineering/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  95. package/plugins/compound-engineering/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  96. package/plugins/compound-engineering/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  97. package/plugins/compound-engineering/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  98. package/plugins/compound-engineering/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  99. package/plugins/compound-engineering/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  100. package/plugins/compound-engineering/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  101. package/plugins/compound-engineering/skills/agent-native-architecture/references/product-implications.md +443 -0
  102. package/plugins/compound-engineering/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  103. package/plugins/compound-engineering/skills/agent-native-architecture/references/self-modification.md +269 -0
  104. package/plugins/compound-engineering/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  105. package/plugins/compound-engineering/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  106. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  107. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  108. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  109. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  110. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  111. package/plugins/compound-engineering/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  112. package/plugins/compound-engineering/skills/compound-docs/SKILL.md +510 -0
  113. package/plugins/compound-engineering/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  114. package/plugins/compound-engineering/skills/compound-docs/assets/resolution-template.md +93 -0
  115. package/plugins/compound-engineering/skills/compound-docs/references/yaml-schema.md +65 -0
  116. package/plugins/compound-engineering/skills/compound-docs/schema.yaml +176 -0
  117. package/plugins/compound-engineering/skills/create-agent-skills/SKILL.md +299 -0
  118. package/plugins/compound-engineering/skills/create-agent-skills/references/api-security.md +226 -0
  119. package/plugins/compound-engineering/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  120. package/plugins/compound-engineering/skills/create-agent-skills/references/best-practices.md +404 -0
  121. package/plugins/compound-engineering/skills/create-agent-skills/references/common-patterns.md +595 -0
  122. package/plugins/compound-engineering/skills/create-agent-skills/references/core-principles.md +437 -0
  123. package/plugins/compound-engineering/skills/create-agent-skills/references/executable-code.md +175 -0
  124. package/plugins/compound-engineering/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  125. package/plugins/compound-engineering/skills/create-agent-skills/references/official-spec.md +185 -0
  126. package/plugins/compound-engineering/skills/create-agent-skills/references/recommended-structure.md +168 -0
  127. package/plugins/compound-engineering/skills/create-agent-skills/references/skill-structure.md +372 -0
  128. package/plugins/compound-engineering/skills/create-agent-skills/references/using-scripts.md +113 -0
  129. package/plugins/compound-engineering/skills/create-agent-skills/references/using-templates.md +112 -0
  130. package/plugins/compound-engineering/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  131. package/plugins/compound-engineering/skills/create-agent-skills/templates/router-skill.md +73 -0
  132. package/plugins/compound-engineering/skills/create-agent-skills/templates/simple-skill.md +33 -0
  133. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-reference.md +96 -0
  134. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-script.md +93 -0
  135. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-template.md +74 -0
  136. package/plugins/compound-engineering/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  137. package/plugins/compound-engineering/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  138. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  139. package/plugins/compound-engineering/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  140. package/plugins/compound-engineering/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  141. package/plugins/compound-engineering/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  142. package/plugins/compound-engineering/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  143. package/plugins/compound-engineering/skills/dhh-rails-style/SKILL.md +185 -0
  144. package/plugins/compound-engineering/skills/dhh-rails-style/references/architecture.md +653 -0
  145. package/plugins/compound-engineering/skills/dhh-rails-style/references/controllers.md +303 -0
  146. package/plugins/compound-engineering/skills/dhh-rails-style/references/frontend.md +510 -0
  147. package/plugins/compound-engineering/skills/dhh-rails-style/references/gems.md +266 -0
  148. package/plugins/compound-engineering/skills/dhh-rails-style/references/models.md +359 -0
  149. package/plugins/compound-engineering/skills/dhh-rails-style/references/testing.md +338 -0
  150. package/plugins/compound-engineering/skills/dspy-ruby/SKILL.md +594 -0
  151. package/plugins/compound-engineering/skills/dspy-ruby/assets/config-template.rb +359 -0
  152. package/plugins/compound-engineering/skills/dspy-ruby/assets/module-template.rb +326 -0
  153. package/plugins/compound-engineering/skills/dspy-ruby/assets/signature-template.rb +143 -0
  154. package/plugins/compound-engineering/skills/dspy-ruby/references/core-concepts.md +265 -0
  155. package/plugins/compound-engineering/skills/dspy-ruby/references/optimization.md +623 -0
  156. package/plugins/compound-engineering/skills/dspy-ruby/references/providers.md +338 -0
  157. package/plugins/compound-engineering/skills/every-style-editor/SKILL.md +134 -0
  158. package/plugins/compound-engineering/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  159. package/plugins/compound-engineering/skills/file-todos/SKILL.md +251 -0
  160. package/plugins/compound-engineering/skills/file-todos/assets/todo-template.md +155 -0
  161. package/plugins/compound-engineering/skills/frontend-design/SKILL.md +42 -0
  162. package/plugins/compound-engineering/skills/gemini-imagegen/SKILL.md +237 -0
  163. package/plugins/compound-engineering/skills/gemini-imagegen/requirements.txt +2 -0
  164. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/compose_images.py +157 -0
  165. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/edit_image.py +144 -0
  166. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/gemini_images.py +263 -0
  167. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/generate_image.py +133 -0
  168. package/plugins/compound-engineering/skills/gemini-imagegen/scripts/multi_turn_chat.py +216 -0
  169. package/plugins/compound-engineering/skills/git-worktree/SKILL.md +302 -0
  170. package/plugins/compound-engineering/skills/git-worktree/scripts/worktree-manager.sh +345 -0
  171. package/plugins/compound-engineering/skills/rclone/SKILL.md +150 -0
  172. package/plugins/compound-engineering/skills/rclone/scripts/check_setup.sh +60 -0
  173. package/plugins/compound-engineering/skills/skill-creator/SKILL.md +209 -0
  174. package/plugins/compound-engineering/skills/skill-creator/scripts/init_skill.py +303 -0
  175. package/plugins/compound-engineering/skills/skill-creator/scripts/package_skill.py +110 -0
  176. package/plugins/compound-engineering/skills/skill-creator/scripts/quick_validate.py +65 -0
  177. package/src/commands/convert.ts +156 -0
  178. package/src/commands/install.ts +221 -0
  179. package/src/commands/list.ts +37 -0
  180. package/src/converters/claude-to-codex.ts +124 -0
  181. package/src/converters/claude-to-opencode.ts +392 -0
  182. package/src/index.ts +20 -0
  183. package/src/parsers/claude.ts +248 -0
  184. package/src/targets/codex.ts +91 -0
  185. package/src/targets/index.ts +29 -0
  186. package/src/targets/opencode.ts +48 -0
  187. package/src/types/claude.ts +88 -0
  188. package/src/types/codex.ts +23 -0
  189. package/src/types/opencode.ts +54 -0
  190. package/src/utils/codex-agents.ts +64 -0
  191. package/src/utils/files.ts +64 -0
  192. package/src/utils/frontmatter.ts +65 -0
  193. package/tests/claude-parser.test.ts +89 -0
  194. package/tests/cli.test.ts +289 -0
  195. package/tests/codex-agents.test.ts +62 -0
  196. package/tests/codex-converter.test.ts +121 -0
  197. package/tests/codex-writer.test.ts +76 -0
  198. package/tests/converter.test.ts +171 -0
  199. package/tests/fixtures/custom-paths/.claude-plugin/plugin.json +8 -0
  200. package/tests/fixtures/custom-paths/agents/default-agent.md +5 -0
  201. package/tests/fixtures/custom-paths/commands/default-command.md +5 -0
  202. package/tests/fixtures/custom-paths/custom-agents/custom-agent.md +5 -0
  203. package/tests/fixtures/custom-paths/custom-commands/custom-command.md +5 -0
  204. package/tests/fixtures/custom-paths/custom-hooks/hooks.json +7 -0
  205. package/tests/fixtures/custom-paths/custom-skills/custom-skill/SKILL.md +5 -0
  206. package/tests/fixtures/custom-paths/hooks/hooks.json +7 -0
  207. package/tests/fixtures/custom-paths/skills/default-skill/SKILL.md +5 -0
  208. package/tests/fixtures/invalid-command-path/.claude-plugin/plugin.json +5 -0
  209. package/tests/fixtures/invalid-hooks-path/.claude-plugin/plugin.json +5 -0
  210. package/tests/fixtures/invalid-mcp-path/.claude-plugin/plugin.json +5 -0
  211. package/tests/fixtures/mcp-file/.claude-plugin/plugin.json +5 -0
  212. package/tests/fixtures/mcp-file/.mcp.json +6 -0
  213. package/tests/fixtures/sample-plugin/.claude-plugin/plugin.json +30 -0
  214. package/tests/fixtures/sample-plugin/agents/agent-one.md +10 -0
  215. package/tests/fixtures/sample-plugin/agents/security-reviewer.md +7 -0
  216. package/tests/fixtures/sample-plugin/commands/command-one.md +7 -0
  217. package/tests/fixtures/sample-plugin/commands/model-command.md +8 -0
  218. package/tests/fixtures/sample-plugin/commands/nested/command-two.md +9 -0
  219. package/tests/fixtures/sample-plugin/commands/pattern-command.md +7 -0
  220. package/tests/fixtures/sample-plugin/commands/skill-command.md +7 -0
  221. package/tests/fixtures/sample-plugin/commands/todo-command.md +7 -0
  222. package/tests/fixtures/sample-plugin/hooks/hooks.json +156 -0
  223. package/tests/fixtures/sample-plugin/skills/skill-one/SKILL.md +6 -0
  224. package/tests/frontmatter.test.ts +20 -0
  225. package/tests/opencode-writer.test.ts +62 -0
  226. package/tsconfig.json +14 -0
@@ -0,0 +1,338 @@
1
+ # DSPy.rb LLM Providers
2
+
3
+ ## Supported Providers
4
+
5
+ DSPy.rb provides unified support across multiple LLM providers through adapter gems that automatically load when installed.
6
+
7
+ ### Provider Overview
8
+
9
+ - **OpenAI**: GPT-4, GPT-4o, GPT-4o-mini, GPT-3.5-turbo
10
+ - **Anthropic**: Claude 3 family (Sonnet, Opus, Haiku), Claude 3.5 Sonnet
11
+ - **Google Gemini**: Gemini 1.5 Pro, Gemini 1.5 Flash, other versions
12
+ - **Ollama**: Local model support via OpenAI compatibility layer
13
+ - **OpenRouter**: Unified multi-provider API for 200+ models
14
+
15
+ ## Configuration
16
+
17
+ ### Basic Setup
18
+
19
+ ```ruby
20
+ require 'dspy'
21
+
22
+ DSPy.configure do |c|
23
+ c.lm = DSPy::LM.new('provider/model-name', api_key: ENV['API_KEY'])
24
+ end
25
+ ```
26
+
27
+ ### OpenAI Configuration
28
+
29
+ **Required gem**: `dspy-openai`
30
+
31
+ ```ruby
32
+ DSPy.configure do |c|
33
+ # GPT-4o Mini (recommended for development)
34
+ c.lm = DSPy::LM.new('openai/gpt-4o-mini', api_key: ENV['OPENAI_API_KEY'])
35
+
36
+ # GPT-4o (more capable)
37
+ c.lm = DSPy::LM.new('openai/gpt-4o', api_key: ENV['OPENAI_API_KEY'])
38
+
39
+ # GPT-4 Turbo
40
+ c.lm = DSPy::LM.new('openai/gpt-4-turbo', api_key: ENV['OPENAI_API_KEY'])
41
+ end
42
+ ```
43
+
44
+ **Environment variable**: `OPENAI_API_KEY`
45
+
46
+ ### Anthropic Configuration
47
+
48
+ **Required gem**: `dspy-anthropic`
49
+
50
+ ```ruby
51
+ DSPy.configure do |c|
52
+ # Claude 3.5 Sonnet (latest, most capable)
53
+ c.lm = DSPy::LM.new('anthropic/claude-3-5-sonnet-20241022',
54
+ api_key: ENV['ANTHROPIC_API_KEY'])
55
+
56
+ # Claude 3 Opus (most capable in Claude 3 family)
57
+ c.lm = DSPy::LM.new('anthropic/claude-3-opus-20240229',
58
+ api_key: ENV['ANTHROPIC_API_KEY'])
59
+
60
+ # Claude 3 Sonnet (balanced)
61
+ c.lm = DSPy::LM.new('anthropic/claude-3-sonnet-20240229',
62
+ api_key: ENV['ANTHROPIC_API_KEY'])
63
+
64
+ # Claude 3 Haiku (fast, cost-effective)
65
+ c.lm = DSPy::LM.new('anthropic/claude-3-haiku-20240307',
66
+ api_key: ENV['ANTHROPIC_API_KEY'])
67
+ end
68
+ ```
69
+
70
+ **Environment variable**: `ANTHROPIC_API_KEY`
71
+
72
+ ### Google Gemini Configuration
73
+
74
+ **Required gem**: `dspy-gemini`
75
+
76
+ ```ruby
77
+ DSPy.configure do |c|
78
+ # Gemini 1.5 Pro (most capable)
79
+ c.lm = DSPy::LM.new('gemini/gemini-1.5-pro',
80
+ api_key: ENV['GOOGLE_API_KEY'])
81
+
82
+ # Gemini 1.5 Flash (faster, cost-effective)
83
+ c.lm = DSPy::LM.new('gemini/gemini-1.5-flash',
84
+ api_key: ENV['GOOGLE_API_KEY'])
85
+ end
86
+ ```
87
+
88
+ **Environment variable**: `GOOGLE_API_KEY` or `GEMINI_API_KEY`
89
+
90
+ ### Ollama Configuration
91
+
92
+ **Required gem**: None (uses OpenAI compatibility layer)
93
+
94
+ ```ruby
95
+ DSPy.configure do |c|
96
+ # Local Ollama instance
97
+ c.lm = DSPy::LM.new('ollama/llama3.1',
98
+ base_url: 'http://localhost:11434')
99
+
100
+ # Other Ollama models
101
+ c.lm = DSPy::LM.new('ollama/mistral')
102
+ c.lm = DSPy::LM.new('ollama/codellama')
103
+ end
104
+ ```
105
+
106
+ **Note**: Ensure Ollama is running locally: `ollama serve`
107
+
108
+ ### OpenRouter Configuration
109
+
110
+ **Required gem**: `dspy-openai` (uses OpenAI adapter)
111
+
112
+ ```ruby
113
+ DSPy.configure do |c|
114
+ # Access 200+ models through OpenRouter
115
+ c.lm = DSPy::LM.new('openrouter/anthropic/claude-3.5-sonnet',
116
+ api_key: ENV['OPENROUTER_API_KEY'],
117
+ base_url: 'https://openrouter.ai/api/v1')
118
+
119
+ # Other examples
120
+ c.lm = DSPy::LM.new('openrouter/google/gemini-pro')
121
+ c.lm = DSPy::LM.new('openrouter/meta-llama/llama-3.1-70b-instruct')
122
+ end
123
+ ```
124
+
125
+ **Environment variable**: `OPENROUTER_API_KEY`
126
+
127
+ ## Provider Compatibility Matrix
128
+
129
+ ### Feature Support
130
+
131
+ | Feature | OpenAI | Anthropic | Gemini | Ollama |
132
+ |---------|--------|-----------|--------|--------|
133
+ | Structured Output | ✅ | ✅ | ✅ | ✅ |
134
+ | Vision (Images) | ✅ | ✅ | ✅ | ⚠️ Limited |
135
+ | Image URLs | ✅ | ❌ | ❌ | ❌ |
136
+ | Tool Calling | ✅ | ✅ | ✅ | Varies |
137
+ | Streaming | ❌ | ❌ | ❌ | ❌ |
138
+ | Function Calling | ✅ | ✅ | ✅ | Varies |
139
+
140
+ **Legend**: ✅ Full support | ⚠️ Partial support | ❌ Not supported
141
+
142
+ ### Vision Capabilities
143
+
144
+ **Image URLs**: Only OpenAI supports direct URL references. For other providers, load images as base64 or from files.
145
+
146
+ ```ruby
147
+ # OpenAI - supports URLs
148
+ DSPy::Image.from_url("https://example.com/image.jpg")
149
+
150
+ # Anthropic, Gemini - use file or base64
151
+ DSPy::Image.from_file("path/to/image.jpg")
152
+ DSPy::Image.from_base64(base64_data, mime_type: "image/jpeg")
153
+ ```
154
+
155
+ **Ollama**: Limited multimodal functionality. Check specific model capabilities.
156
+
157
+ ## Advanced Configuration
158
+
159
+ ### Custom Parameters
160
+
161
+ Pass provider-specific parameters during configuration:
162
+
163
+ ```ruby
164
+ DSPy.configure do |c|
165
+ c.lm = DSPy::LM.new('openai/gpt-4o',
166
+ api_key: ENV['OPENAI_API_KEY'],
167
+ temperature: 0.7,
168
+ max_tokens: 2000,
169
+ top_p: 0.9
170
+ )
171
+ end
172
+ ```
173
+
174
+ ### Multiple Providers
175
+
176
+ Use different models for different tasks:
177
+
178
+ ```ruby
179
+ # Fast model for simple tasks
180
+ fast_lm = DSPy::LM.new('openai/gpt-4o-mini', api_key: ENV['OPENAI_API_KEY'])
181
+
182
+ # Powerful model for complex tasks
183
+ powerful_lm = DSPy::LM.new('anthropic/claude-3-5-sonnet-20241022',
184
+ api_key: ENV['ANTHROPIC_API_KEY'])
185
+
186
+ # Use different models in different modules
187
+ class SimpleClassifier < DSPy::Module
188
+ def initialize
189
+ super
190
+ DSPy.configure { |c| c.lm = fast_lm }
191
+ @predictor = DSPy::Predict.new(SimpleSignature)
192
+ end
193
+ end
194
+
195
+ class ComplexAnalyzer < DSPy::Module
196
+ def initialize
197
+ super
198
+ DSPy.configure { |c| c.lm = powerful_lm }
199
+ @predictor = DSPy::ChainOfThought.new(ComplexSignature)
200
+ end
201
+ end
202
+ ```
203
+
204
+ ### Per-Request Configuration
205
+
206
+ Override configuration for specific predictions:
207
+
208
+ ```ruby
209
+ predictor = DSPy::Predict.new(MySignature)
210
+
211
+ # Use default configuration
212
+ result1 = predictor.forward(input: "data")
213
+
214
+ # Override temperature for this request
215
+ result2 = predictor.forward(
216
+ input: "data",
217
+ config: { temperature: 0.2 } # More deterministic
218
+ )
219
+ ```
220
+
221
+ ## Cost Optimization
222
+
223
+ ### Model Selection Strategy
224
+
225
+ 1. **Development**: Use cheaper, faster models (gpt-4o-mini, claude-3-haiku, gemini-1.5-flash)
226
+ 2. **Production Simple Tasks**: Continue with cheaper models if quality is sufficient
227
+ 3. **Production Complex Tasks**: Upgrade to more capable models (gpt-4o, claude-3.5-sonnet, gemini-1.5-pro)
228
+ 4. **Local Development**: Use Ollama for privacy and zero API costs
229
+
230
+ ### Example Cost-Conscious Setup
231
+
232
+ ```ruby
233
+ # Development environment
234
+ if Rails.env.development?
235
+ DSPy.configure do |c|
236
+ c.lm = DSPy::LM.new('ollama/llama3.1') # Free, local
237
+ end
238
+ elsif Rails.env.test?
239
+ DSPy.configure do |c|
240
+ c.lm = DSPy::LM.new('openai/gpt-4o-mini', # Cheap for testing
241
+ api_key: ENV['OPENAI_API_KEY'])
242
+ end
243
+ else # production
244
+ DSPy.configure do |c|
245
+ c.lm = DSPy::LM.new('anthropic/claude-3-5-sonnet-20241022',
246
+ api_key: ENV['ANTHROPIC_API_KEY'])
247
+ end
248
+ end
249
+ ```
250
+
251
+ ## Provider-Specific Best Practices
252
+
253
+ ### OpenAI
254
+
255
+ - Use `gpt-4o-mini` for development and simple tasks
256
+ - Use `gpt-4o` for production complex tasks
257
+ - Best vision support including URL loading
258
+ - Excellent function calling capabilities
259
+
260
+ ### Anthropic
261
+
262
+ - Claude 3.5 Sonnet is currently the most capable model
263
+ - Excellent for complex reasoning and analysis
264
+ - Strong safety features and helpful outputs
265
+ - Requires base64 for images (no URL support)
266
+
267
+ ### Google Gemini
268
+
269
+ - Gemini 1.5 Pro for complex tasks, Flash for speed
270
+ - Strong multimodal capabilities
271
+ - Good balance of cost and performance
272
+ - Requires base64 for images
273
+
274
+ ### Ollama
275
+
276
+ - Best for privacy-sensitive applications
277
+ - Zero API costs
278
+ - Requires local hardware resources
279
+ - Limited multimodal support depending on model
280
+ - Good for development and testing
281
+
282
+ ## Troubleshooting
283
+
284
+ ### API Key Issues
285
+
286
+ ```ruby
287
+ # Verify API key is set
288
+ if ENV['OPENAI_API_KEY'].nil?
289
+ raise "OPENAI_API_KEY environment variable not set"
290
+ end
291
+
292
+ # Test connection
293
+ begin
294
+ DSPy.configure { |c| c.lm = DSPy::LM.new('openai/gpt-4o-mini',
295
+ api_key: ENV['OPENAI_API_KEY']) }
296
+ predictor = DSPy::Predict.new(TestSignature)
297
+ predictor.forward(test: "data")
298
+ puts "✅ Connection successful"
299
+ rescue => e
300
+ puts "❌ Connection failed: #{e.message}"
301
+ end
302
+ ```
303
+
304
+ ### Rate Limiting
305
+
306
+ Handle rate limits gracefully:
307
+
308
+ ```ruby
309
+ def call_with_retry(predictor, input, max_retries: 3)
310
+ retries = 0
311
+ begin
312
+ predictor.forward(input)
313
+ rescue RateLimitError => e
314
+ retries += 1
315
+ if retries < max_retries
316
+ sleep(2 ** retries) # Exponential backoff
317
+ retry
318
+ else
319
+ raise
320
+ end
321
+ end
322
+ end
323
+ ```
324
+
325
+ ### Model Not Found
326
+
327
+ Ensure the correct gem is installed:
328
+
329
+ ```bash
330
+ # For OpenAI
331
+ gem install dspy-openai
332
+
333
+ # For Anthropic
334
+ gem install dspy-anthropic
335
+
336
+ # For Gemini
337
+ gem install dspy-gemini
338
+ ```
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: every-style-editor
3
+ description: This skill should be used when reviewing or editing copy to ensure adherence to Every's style guide. It provides a systematic line-by-line review process for grammar, punctuation, mechanics, and style guide compliance.
4
+ ---
5
+
6
+ # Every Style Editor
7
+
8
+ This skill provides a systematic approach to reviewing copy against Every's comprehensive style guide. It transforms Claude into a meticulous line editor and proofreader specializing in grammar, mechanics, and style guide compliance.
9
+
10
+ ## When to Use This Skill
11
+
12
+ Use this skill when:
13
+ - Reviewing articles, blog posts, newsletters, or any written content
14
+ - Ensuring copy follows Every's specific style conventions
15
+ - Providing feedback on grammar, punctuation, and mechanics
16
+ - Flagging deviations from the Every style guide
17
+ - Preparing clean copy for human editorial review
18
+
19
+ ## Skill Overview
20
+
21
+ This skill enables performing a comprehensive review of written content in four phases:
22
+
23
+ 1. **Initial Assessment** - Understanding context and document type
24
+ 2. **Detailed Line Edit** - Checking every sentence for compliance
25
+ 3. **Mechanical Review** - Verifying formatting and consistency
26
+ 4. **Recommendations** - Providing actionable improvement suggestions
27
+
28
+ ## How to Use This Skill
29
+
30
+ ### Step 1: Initial Assessment
31
+
32
+ Begin by reading the entire piece to understand:
33
+ - Document type (article, knowledge base entry, social post, etc.)
34
+ - Target audience
35
+ - Overall tone and voice
36
+ - Content context
37
+
38
+ ### Step 2: Detailed Line Edit
39
+
40
+ Review each paragraph systematically, checking for:
41
+ - Sentence structure and grammar correctness
42
+ - Punctuation usage (commas, semicolons, em dashes, etc.)
43
+ - Capitalization rules (especially job titles, headlines)
44
+ - Word choice and usage (overused words, passive voice)
45
+ - Adherence to Every style guide rules
46
+
47
+ Reference the complete [EVERY_WRITE_STYLE.md](./references/EVERY_WRITE_STYLE.md) for specific rules when in doubt.
48
+
49
+ ### Step 3: Mechanical Review
50
+
51
+ Verify:
52
+ - Spacing and formatting consistency
53
+ - Style choices applied uniformly throughout
54
+ - Special elements (lists, quotes, citations)
55
+ - Proper use of italics and formatting
56
+ - Number formatting (numerals vs. spelled out)
57
+ - Link formatting and descriptions
58
+
59
+ ### Step 4: Output Results
60
+
61
+ Present findings using this structure:
62
+
63
+ ```
64
+ DOCUMENT REVIEW SUMMARY
65
+ =====================
66
+ Document Type: [type]
67
+ Word Count: [approximate]
68
+ Overall Assessment: [brief overview]
69
+
70
+ ERRORS FOUND: [total number]
71
+
72
+ DETAILED CORRECTIONS
73
+ ===================
74
+
75
+ [For each error found:]
76
+
77
+ **Location**: [Paragraph #, Sentence #]
78
+ **Issue Type**: [Grammar/Punctuation/Mechanics/Style Guide]
79
+ **Original**: "[exact text with error]"
80
+ **Correction**: "[corrected text]"
81
+ **Rule Reference**: [Specific style guide rule violated]
82
+ **Explanation**: [Brief explanation of why this is an error]
83
+
84
+ ---
85
+
86
+ RECURRING ISSUES
87
+ ===============
88
+ [List patterns of errors that appear multiple times]
89
+
90
+ STYLE GUIDE COMPLIANCE CHECKLIST
91
+ ==============================
92
+ ✓ [Rule followed correctly]
93
+ ✗ [Rule violated - with count of violations]
94
+
95
+ FINAL RECOMMENDATIONS
96
+ ===================
97
+ [2-3 actionable suggestions for improving the draft]
98
+ ```
99
+
100
+ ## Style Guide Reference
101
+
102
+ The complete Every style guide is included in [EVERY_WRITE_STYLE.md](./references/EVERY_WRITE_STYLE.md). Key areas to focus on:
103
+
104
+ - **Quick Rules**: Title case for headlines, sentence case elsewhere
105
+ - **Tone**: Active voice, avoid overused words (actually, very, just), be specific
106
+ - **Numbers**: Spell out one through nine; use numerals for 10+
107
+ - **Punctuation**: Oxford commas, em dashes without spaces, proper quotation mark usage
108
+ - **Capitalization**: Lowercase job titles, company as singular (it), teams as plural (they)
109
+ - **Emphasis**: Italics only (no bold for emphasis)
110
+ - **Links**: 2-4 words, don't say "click here"
111
+
112
+ ## Key Principles
113
+
114
+ - **Be specific**: Always quote the exact text with the error
115
+ - **Reference rules**: Cite the specific style guide rule for each correction
116
+ - **Maintain voice**: Preserve the author's voice while correcting errors
117
+ - **Prioritize clarity**: Focus on changes that improve readability
118
+ - **Be constructive**: Frame feedback to help writers improve
119
+ - **Flag ambiguous cases**: When style guide doesn't address an issue, explain options and recommend the clearest choice
120
+
121
+ ## Common Areas to Focus On
122
+
123
+ Based on Every's style guide, pay special attention to:
124
+
125
+ - Punctuation (comma usage, semicolons, apostrophes, quotation marks)
126
+ - Capitalization (proper nouns, titles, sentence starts)
127
+ - Numbers (when to spell out vs. use numerals)
128
+ - Passive voice (replace with active whenever possible)
129
+ - Overused words (actually, very, just)
130
+ - Lists (parallel structure, punctuation, capitalization)
131
+ - Hyphenation (compound adjectives, except adverbs)
132
+ - Word usage (fewer vs. less, they vs. them)
133
+ - Company references (singular "it", teams as plural "they")
134
+ - Job title capitalization