ag-cortex 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.
- package/.agent/commands/test-browser.md +339 -0
- package/.agent/rules/00-constitution.md +46 -0
- package/.agent/rules/project-rules.md +49 -0
- package/.agent/skills/agent-browser/SKILL.md +223 -0
- package/.agent/skills/agent-native-architecture/SKILL.md +435 -0
- package/.agent/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
- package/.agent/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
- package/.agent/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
- package/.agent/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
- package/.agent/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
- package/.agent/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
- package/.agent/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
- package/.agent/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
- package/.agent/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
- package/.agent/skills/agent-native-architecture/references/product-implications.md +443 -0
- package/.agent/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
- package/.agent/skills/agent-native-architecture/references/self-modification.md +269 -0
- package/.agent/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
- package/.agent/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
- package/.agent/skills/agent-native-reviewer/SKILL.md +246 -0
- package/.agent/skills/andrew-kane-gem-writer/SKILL.md +184 -0
- package/.agent/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
- package/.agent/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
- package/.agent/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
- package/.agent/skills/andrew-kane-gem-writer/references/resources.md +119 -0
- package/.agent/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
- package/.agent/skills/ankane-readme-writer/SKILL.md +50 -0
- package/.agent/skills/architecture-strategist/SKILL.md +52 -0
- package/.agent/skills/best-practices-researcher/SKILL.md +100 -0
- package/.agent/skills/bug-reproduction-validator/SKILL.md +67 -0
- package/.agent/skills/code-simplicity-reviewer/SKILL.md +85 -0
- package/.agent/skills/coding-tutor/.claude-plugin/plugin.json +9 -0
- package/.agent/skills/coding-tutor/README.md +37 -0
- package/.agent/skills/coding-tutor/commands/quiz-me.md +1 -0
- package/.agent/skills/coding-tutor/commands/sync-tutorials.md +25 -0
- package/.agent/skills/coding-tutor/commands/teach-me.md +1 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +202 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +203 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
- package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +132 -0
- package/.agent/skills/compound-docs/SKILL.md +510 -0
- package/.agent/skills/compound-docs/assets/critical-pattern-template.md +34 -0
- package/.agent/skills/compound-docs/assets/resolution-template.md +93 -0
- package/.agent/skills/compound-docs/references/yaml-schema.md +65 -0
- package/.agent/skills/compound-docs/schema.yaml +176 -0
- package/.agent/skills/create-agent-skills/SKILL.md +299 -0
- package/.agent/skills/create-agent-skills/references/api-security.md +226 -0
- package/.agent/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
- package/.agent/skills/create-agent-skills/references/best-practices.md +404 -0
- package/.agent/skills/create-agent-skills/references/common-patterns.md +595 -0
- package/.agent/skills/create-agent-skills/references/core-principles.md +437 -0
- package/.agent/skills/create-agent-skills/references/executable-code.md +175 -0
- package/.agent/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
- package/.agent/skills/create-agent-skills/references/official-spec.md +185 -0
- package/.agent/skills/create-agent-skills/references/recommended-structure.md +168 -0
- package/.agent/skills/create-agent-skills/references/skill-structure.md +372 -0
- package/.agent/skills/create-agent-skills/references/using-scripts.md +113 -0
- package/.agent/skills/create-agent-skills/references/using-templates.md +112 -0
- package/.agent/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
- package/.agent/skills/create-agent-skills/templates/router-skill.md +73 -0
- package/.agent/skills/create-agent-skills/templates/simple-skill.md +33 -0
- package/.agent/skills/create-agent-skills/workflows/add-reference.md +96 -0
- package/.agent/skills/create-agent-skills/workflows/add-script.md +93 -0
- package/.agent/skills/create-agent-skills/workflows/add-template.md +74 -0
- package/.agent/skills/create-agent-skills/workflows/add-workflow.md +120 -0
- package/.agent/skills/create-agent-skills/workflows/audit-skill.md +138 -0
- package/.agent/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
- package/.agent/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
- package/.agent/skills/create-agent-skills/workflows/get-guidance.md +121 -0
- package/.agent/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
- package/.agent/skills/create-agent-skills/workflows/verify-skill.md +204 -0
- package/.agent/skills/data-integrity-guardian/SKILL.md +70 -0
- package/.agent/skills/data-migration-expert/SKILL.md +97 -0
- package/.agent/skills/deployment-verification-agent/SKILL.md +159 -0
- package/.agent/skills/design-implementation-reviewer/SKILL.md +85 -0
- package/.agent/skills/design-iterator/SKILL.md +197 -0
- package/.agent/skills/dhh-rails-reviewer/SKILL.md +45 -0
- package/.agent/skills/dhh-rails-style/SKILL.md +184 -0
- package/.agent/skills/dhh-rails-style/references/architecture.md +653 -0
- package/.agent/skills/dhh-rails-style/references/controllers.md +303 -0
- package/.agent/skills/dhh-rails-style/references/frontend.md +510 -0
- package/.agent/skills/dhh-rails-style/references/gems.md +266 -0
- package/.agent/skills/dhh-rails-style/references/models.md +359 -0
- package/.agent/skills/dhh-rails-style/references/testing.md +338 -0
- package/.agent/skills/dspy-ruby/SKILL.md +594 -0
- package/.agent/skills/dspy-ruby/assets/config-template.rb +359 -0
- package/.agent/skills/dspy-ruby/assets/module-template.rb +326 -0
- package/.agent/skills/dspy-ruby/assets/signature-template.rb +143 -0
- package/.agent/skills/dspy-ruby/references/core-concepts.md +265 -0
- package/.agent/skills/dspy-ruby/references/optimization.md +623 -0
- package/.agent/skills/dspy-ruby/references/providers.md +305 -0
- package/.agent/skills/every-style-editor/SKILL.md +134 -0
- package/.agent/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
- package/.agent/skills/figma-design-sync/SKILL.md +166 -0
- package/.agent/skills/file-todos/SKILL.md +251 -0
- package/.agent/skills/file-todos/assets/todo-template.md +155 -0
- package/.agent/skills/framework-docs-researcher/SKILL.md +83 -0
- package/.agent/skills/frontend-design/SKILL.md +42 -0
- package/.agent/skills/gemini-imagegen/SKILL.md +237 -0
- package/.agent/skills/gemini-imagegen/requirements.txt +2 -0
- package/.agent/skills/gemini-imagegen/scripts/compose_images.py +168 -0
- package/.agent/skills/gemini-imagegen/scripts/edit_image.py +157 -0
- package/.agent/skills/gemini-imagegen/scripts/gemini_images.py +265 -0
- package/.agent/skills/gemini-imagegen/scripts/generate_image.py +147 -0
- package/.agent/skills/gemini-imagegen/scripts/multi_turn_chat.py +215 -0
- package/.agent/skills/git-history-analyzer/SKILL.md +42 -0
- package/.agent/skills/git-worktree/SKILL.md +302 -0
- package/.agent/skills/git-worktree/scripts/worktree-manager.sh +345 -0
- package/.agent/skills/julik-frontend-races-reviewer/SKILL.md +222 -0
- package/.agent/skills/kieran-python-reviewer/SKILL.md +104 -0
- package/.agent/skills/kieran-rails-reviewer/SKILL.md +86 -0
- package/.agent/skills/kieran-typescript-reviewer/SKILL.md +95 -0
- package/.agent/skills/lint/SKILL.md +16 -0
- package/.agent/skills/pattern-recognition-specialist/SKILL.md +57 -0
- package/.agent/skills/performance-oracle/SKILL.md +110 -0
- package/.agent/skills/pr-comment-resolver/SKILL.md +69 -0
- package/.agent/skills/rclone/SKILL.md +150 -0
- package/.agent/skills/rclone/scripts/check_setup.sh +60 -0
- package/.agent/skills/repo-research-analyst/SKILL.md +113 -0
- package/.agent/skills/security-sentinel/SKILL.md +93 -0
- package/.agent/skills/skill-creator/SKILL.md +209 -0
- package/.agent/skills/skill-creator/scripts/init_skill.py +304 -0
- package/.agent/skills/skill-creator/scripts/package_skill.py +112 -0
- package/.agent/skills/skill-creator/scripts/quick_validate.py +72 -0
- package/.agent/skills/spec-flow-analyzer/SKILL.md +113 -0
- package/.agent/skills/test-agent/SKILL.md +4 -0
- package/.agent/workflows/agent-native-audit.md +277 -0
- package/.agent/workflows/ask-user-question.md +21 -0
- package/.agent/workflows/changelog.md +137 -0
- package/.agent/workflows/compound.md +202 -0
- package/.agent/workflows/create-agent-skill.md +8 -0
- package/.agent/workflows/deepen-plan-research.md +334 -0
- package/.agent/workflows/deepen-plan-synthesis.md +182 -0
- package/.agent/workflows/deepen-plan.md +79 -0
- package/.agent/workflows/feature-video.md +342 -0
- package/.agent/workflows/generate-command.md +162 -0
- package/.agent/workflows/heal-skill.md +142 -0
- package/.agent/workflows/lfg.md +20 -0
- package/.agent/workflows/plan-analysis.md +67 -0
- package/.agent/workflows/plan-next-steps.md +63 -0
- package/.agent/workflows/plan-review.md +33 -0
- package/.agent/workflows/plan-synthesis.md +106 -0
- package/.agent/workflows/plan.md +49 -0
- package/.agent/workflows/report-bug.md +150 -0
- package/.agent/workflows/reproduce-bug.md +99 -0
- package/.agent/workflows/resolve-parallel.md +34 -0
- package/.agent/workflows/resolve-pr-parallel.md +49 -0
- package/.agent/workflows/resolve-todo-parallel.md +35 -0
- package/.agent/workflows/review-analysis.md +145 -0
- package/.agent/workflows/review-synthesis.md +262 -0
- package/.agent/workflows/review.md +64 -0
- package/.agent/workflows/ship.md +90 -0
- package/.agent/workflows/test-command.md +3 -0
- package/.agent/workflows/triage.md +310 -0
- package/.agent/workflows/work.md +157 -0
- package/.agent/workflows/xcode-test.md +332 -0
- package/LICENSE +22 -0
- package/README.md +49 -0
- package/bin/ag-cortex.js +54 -0
- package/lib/core.js +165 -0
- package/package.json +31 -0
|
@@ -0,0 +1,305 @@
|
|
|
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
|
+
- **Google Gemini**: Gemini 1.5 Pro, Gemini 1.5 Flash, Gemini Ultra
|
|
11
|
+
- **Ollama**: Local model support via OpenAI compatibility layer
|
|
12
|
+
- **OpenRouter**: Unified multi-provider API for 200+ models
|
|
13
|
+
|
|
14
|
+
## Configuration
|
|
15
|
+
|
|
16
|
+
### Basic Setup
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'dspy'
|
|
20
|
+
|
|
21
|
+
DSPy.configure do |c|
|
|
22
|
+
c.lm = DSPy::LM.new('provider/model-name', api_key: ENV['API_KEY'])
|
|
23
|
+
end
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### OpenAI Configuration
|
|
27
|
+
|
|
28
|
+
**Required gem**: `dspy-openai`
|
|
29
|
+
|
|
30
|
+
```ruby
|
|
31
|
+
DSPy.configure do |c|
|
|
32
|
+
# GPT-4o Mini (recommended for development)
|
|
33
|
+
c.lm = DSPy::LM.new('openai/gpt-4o-mini', api_key: ENV['OPENAI_API_KEY'])
|
|
34
|
+
|
|
35
|
+
# GPT-4o (more capable)
|
|
36
|
+
c.lm = DSPy::LM.new('openai/gpt-4o', api_key: ENV['OPENAI_API_KEY'])
|
|
37
|
+
|
|
38
|
+
# GPT-4 Turbo
|
|
39
|
+
c.lm = DSPy::LM.new('openai/gpt-4-turbo', api_key: ENV['OPENAI_API_KEY'])
|
|
40
|
+
end
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Environment variable**: `OPENAI_API_KEY`
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Google Gemini Configuration
|
|
48
|
+
|
|
49
|
+
**Required gem**: `dspy-gemini`
|
|
50
|
+
|
|
51
|
+
```ruby
|
|
52
|
+
DSPy.configure do |c|
|
|
53
|
+
# Gemini 1.5 Pro (most capable)
|
|
54
|
+
c.lm = DSPy::LM.new('gemini/gemini-1.5-pro',
|
|
55
|
+
api_key: ENV['GOOGLE_API_KEY'])
|
|
56
|
+
|
|
57
|
+
# Gemini 1.5 Flash (faster, cost-effective)
|
|
58
|
+
c.lm = DSPy::LM.new('gemini/gemini-1.5-flash',
|
|
59
|
+
api_key: ENV['GOOGLE_API_KEY'])
|
|
60
|
+
end
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Environment variable**: `GOOGLE_API_KEY` or `GEMINI_API_KEY`
|
|
64
|
+
|
|
65
|
+
### Ollama Configuration
|
|
66
|
+
|
|
67
|
+
**Required gem**: None (uses OpenAI compatibility layer)
|
|
68
|
+
|
|
69
|
+
```ruby
|
|
70
|
+
DSPy.configure do |c|
|
|
71
|
+
# Local Ollama instance
|
|
72
|
+
c.lm = DSPy::LM.new('ollama/llama3.1',
|
|
73
|
+
base_url: 'http://localhost:11434')
|
|
74
|
+
|
|
75
|
+
# Other Ollama models
|
|
76
|
+
c.lm = DSPy::LM.new('ollama/mistral')
|
|
77
|
+
c.lm = DSPy::LM.new('ollama/codellama')
|
|
78
|
+
end
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Note**: Ensure Ollama is running locally: `ollama serve`
|
|
82
|
+
|
|
83
|
+
### OpenRouter Configuration
|
|
84
|
+
|
|
85
|
+
**Required gem**: `dspy-openai` (uses OpenAI adapter)
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
DSPy.configure do |c|
|
|
89
|
+
# Access 200+ models through OpenRouter
|
|
90
|
+
c.lm = DSPy::LM.new('openrouter/google/gemini-1.5-pro',
|
|
91
|
+
api_key: ENV['OPENROUTER_API_KEY'],
|
|
92
|
+
base_url: 'https://openrouter.ai/api/v1')
|
|
93
|
+
|
|
94
|
+
# Other examples
|
|
95
|
+
c.lm = DSPy::LM.new('openrouter/google/gemini-pro')
|
|
96
|
+
c.lm = DSPy::LM.new('openrouter/meta-llama/llama-3.1-70b-instruct')
|
|
97
|
+
end
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Environment variable**: `OPENROUTER_API_KEY`
|
|
101
|
+
|
|
102
|
+
## Provider Compatibility Matrix
|
|
103
|
+
|
|
104
|
+
### Feature Support
|
|
105
|
+
|
|
106
|
+
| Feature | OpenAI | Google Gemini | Ollama |
|
|
107
|
+
|---------|--------|-----------|--------|
|
|
108
|
+
| Structued Output | ✅ | ✅ | ✅ |
|
|
109
|
+
| Vision (Images) | ✅ | ✅ | ⚠️ Limited |
|
|
110
|
+
| Image URLs | ✅ | ❌ | ❌ |
|
|
111
|
+
| Tool Calling | ✅ | ✅ | Varies |
|
|
112
|
+
| Streaming | ❌ | ❌ | ❌ |
|
|
113
|
+
| Function Calling | ✅ | ✅ | ✅ | Varies |
|
|
114
|
+
|
|
115
|
+
**Legend**: ✅ Full support | ⚠️ Partial support | ❌ Not supported
|
|
116
|
+
|
|
117
|
+
### Vision Capabilities
|
|
118
|
+
|
|
119
|
+
**Image URLs**: Only OpenAI supports direct URL references. For other providers, load images as base64 or from files.
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
# OpenAI - supports URLs
|
|
123
|
+
DSPy::Image.from_url("https://example.com/image.jpg")
|
|
124
|
+
|
|
125
|
+
# Google Gemini - use file or base64
|
|
126
|
+
DSPy::Image.from_file("path/to/image.jpg")
|
|
127
|
+
DSPy::Image.from_base64(base64_data, mime_type: "image/jpeg")
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Ollama**: Limited multimodal functionality. Check specific model capabilities.
|
|
131
|
+
|
|
132
|
+
## Advanced Configuration
|
|
133
|
+
|
|
134
|
+
### Custom Parameters
|
|
135
|
+
|
|
136
|
+
Pass provider-specific parameters during configuration:
|
|
137
|
+
|
|
138
|
+
```ruby
|
|
139
|
+
DSPy.configure do |c|
|
|
140
|
+
c.lm = DSPy::LM.new('openai/gpt-4o',
|
|
141
|
+
api_key: ENV['OPENAI_API_KEY'],
|
|
142
|
+
temperature: 0.7,
|
|
143
|
+
max_tokens: 2000,
|
|
144
|
+
top_p: 0.9
|
|
145
|
+
)
|
|
146
|
+
end
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Multiple Providers
|
|
150
|
+
|
|
151
|
+
Use different models for different tasks:
|
|
152
|
+
|
|
153
|
+
```ruby
|
|
154
|
+
# Fast model for simple tasks
|
|
155
|
+
fast_lm = DSPy::LM.new('openai/gpt-4o-mini', api_key: ENV['OPENAI_API_KEY'])
|
|
156
|
+
|
|
157
|
+
# Powerful model for complex tasks
|
|
158
|
+
powerful_lm = DSPy::LM.new('google/gemini-1.5-pro',
|
|
159
|
+
api_key: ENV['GOOGLE_API_KEY'])
|
|
160
|
+
|
|
161
|
+
# Use different models in different modules
|
|
162
|
+
class SimpleClassifier < DSPy::Module
|
|
163
|
+
def initialize
|
|
164
|
+
super
|
|
165
|
+
DSPy.configure { |c| c.lm = fast_lm }
|
|
166
|
+
@predictor = DSPy::Predict.new(SimpleSignature)
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
class ComplexAnalyzer < DSPy::Module
|
|
171
|
+
def initialize
|
|
172
|
+
super
|
|
173
|
+
DSPy.configure { |c| c.lm = powerful_lm }
|
|
174
|
+
@predictor = DSPy::ChainOfThought.new(ComplexSignature)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Per-Request Configuration
|
|
180
|
+
|
|
181
|
+
Override configuration for specific predictions:
|
|
182
|
+
|
|
183
|
+
```ruby
|
|
184
|
+
predictor = DSPy::Predict.new(MySignature)
|
|
185
|
+
|
|
186
|
+
# Use default configuration
|
|
187
|
+
result1 = predictor.forward(input: "data")
|
|
188
|
+
|
|
189
|
+
# Override temperature for this request
|
|
190
|
+
result2 = predictor.forward(
|
|
191
|
+
input: "data",
|
|
192
|
+
config: { temperature: 0.2 } # More deterministic
|
|
193
|
+
)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Cost Optimization
|
|
197
|
+
|
|
198
|
+
### Model Selection Strategy
|
|
199
|
+
|
|
200
|
+
1. **Development**: Use cheaper, faster models (gpt-4o-mini, gemini-flash, gemini-1.5-flash)
|
|
201
|
+
2. **Production Simple Tasks**: Continue with cheaper models if quality is sufficient
|
|
202
|
+
3. **Production Complex Tasks**: Upgrade to more capable models (gpt-4o, gemini-1.5-pro, gemini-1.5-pro)
|
|
203
|
+
4. **Local Development**: Use Ollama for privacy and zero API costs
|
|
204
|
+
|
|
205
|
+
### Example Cost-Conscious Setup
|
|
206
|
+
|
|
207
|
+
```ruby
|
|
208
|
+
# Development environment
|
|
209
|
+
if Rails.env.development?
|
|
210
|
+
DSPy.configure do |c|
|
|
211
|
+
c.lm = DSPy::LM.new('ollama/llama3.1') # Free, local
|
|
212
|
+
end
|
|
213
|
+
elsif Rails.env.test?
|
|
214
|
+
DSPy.configure do |c|
|
|
215
|
+
c.lm = DSPy::LM.new('openai/gpt-4o-mini', # Cheap for testing
|
|
216
|
+
api_key: ENV['OPENAI_API_KEY'])
|
|
217
|
+
end
|
|
218
|
+
else # production
|
|
219
|
+
DSPy.configure do |c|
|
|
220
|
+
c.lm = DSPy::LM.new('google/gemini-1.5-pro',
|
|
221
|
+
api_key: ENV['GOOGLE_API_KEY'])
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Provider-Specific Best Practices
|
|
227
|
+
|
|
228
|
+
### OpenAI
|
|
229
|
+
|
|
230
|
+
- Use `gpt-4o-mini` for development and simple tasks
|
|
231
|
+
- Use `gpt-4o` for production complex tasks
|
|
232
|
+
- Best vision support including URL loading
|
|
233
|
+
- Excellent function calling capabilities
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
### Google Gemini
|
|
238
|
+
|
|
239
|
+
- Gemini 1.5 Pro for complex tasks, Flash for speed
|
|
240
|
+
- Strong multimodal capabilities
|
|
241
|
+
- Good balance of cost and performance
|
|
242
|
+
- Requires base64 for images
|
|
243
|
+
|
|
244
|
+
### Ollama
|
|
245
|
+
|
|
246
|
+
- Best for privacy-sensitive applications
|
|
247
|
+
- Zero API costs
|
|
248
|
+
- Requires local hardware resources
|
|
249
|
+
- Limited multimodal support depending on model
|
|
250
|
+
- Good for development and testing
|
|
251
|
+
|
|
252
|
+
## Troubleshooting
|
|
253
|
+
|
|
254
|
+
### API Key Issues
|
|
255
|
+
|
|
256
|
+
```ruby
|
|
257
|
+
# Verify API key is set
|
|
258
|
+
if ENV['OPENAI_API_KEY'].nil?
|
|
259
|
+
raise "OPENAI_API_KEY environment variable not set"
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Test connection
|
|
263
|
+
begin
|
|
264
|
+
DSPy.configure { |c| c.lm = DSPy::LM.new('openai/gpt-4o-mini',
|
|
265
|
+
api_key: ENV['OPENAI_API_KEY']) }
|
|
266
|
+
predictor = DSPy::Predict.new(TestSignature)
|
|
267
|
+
predictor.forward(test: "data")
|
|
268
|
+
puts "✅ Connection successful"
|
|
269
|
+
rescue => e
|
|
270
|
+
puts "❌ Connection failed: #{e.message}"
|
|
271
|
+
end
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Rate Limiting
|
|
275
|
+
|
|
276
|
+
Handle rate limits gracefully:
|
|
277
|
+
|
|
278
|
+
```ruby
|
|
279
|
+
def call_with_retry(predictor, input, max_retries: 3)
|
|
280
|
+
retries = 0
|
|
281
|
+
begin
|
|
282
|
+
predictor.forward(input)
|
|
283
|
+
rescue RateLimitError => e
|
|
284
|
+
retries += 1
|
|
285
|
+
if retries < max_retries
|
|
286
|
+
sleep(2 ** retries) # Exponential backoff
|
|
287
|
+
retry
|
|
288
|
+
else
|
|
289
|
+
raise
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Model Not Found
|
|
296
|
+
|
|
297
|
+
Ensure the correct gem is installed:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
# For OpenAI
|
|
301
|
+
gem install dspy-openai
|
|
302
|
+
|
|
303
|
+
# For Gemini
|
|
304
|
+
gem install dspy-gemini
|
|
305
|
+
```
|
|
@@ -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 Antigravity 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
|