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.
Files changed (162) hide show
  1. package/.agent/commands/test-browser.md +339 -0
  2. package/.agent/rules/00-constitution.md +46 -0
  3. package/.agent/rules/project-rules.md +49 -0
  4. package/.agent/skills/agent-browser/SKILL.md +223 -0
  5. package/.agent/skills/agent-native-architecture/SKILL.md +435 -0
  6. package/.agent/skills/agent-native-architecture/references/action-parity-discipline.md +409 -0
  7. package/.agent/skills/agent-native-architecture/references/agent-execution-patterns.md +467 -0
  8. package/.agent/skills/agent-native-architecture/references/agent-native-testing.md +582 -0
  9. package/.agent/skills/agent-native-architecture/references/architecture-patterns.md +478 -0
  10. package/.agent/skills/agent-native-architecture/references/dynamic-context-injection.md +338 -0
  11. package/.agent/skills/agent-native-architecture/references/files-universal-interface.md +301 -0
  12. package/.agent/skills/agent-native-architecture/references/from-primitives-to-domain-tools.md +359 -0
  13. package/.agent/skills/agent-native-architecture/references/mcp-tool-design.md +506 -0
  14. package/.agent/skills/agent-native-architecture/references/mobile-patterns.md +871 -0
  15. package/.agent/skills/agent-native-architecture/references/product-implications.md +443 -0
  16. package/.agent/skills/agent-native-architecture/references/refactoring-to-prompt-native.md +317 -0
  17. package/.agent/skills/agent-native-architecture/references/self-modification.md +269 -0
  18. package/.agent/skills/agent-native-architecture/references/shared-workspace-architecture.md +680 -0
  19. package/.agent/skills/agent-native-architecture/references/system-prompt-design.md +250 -0
  20. package/.agent/skills/agent-native-reviewer/SKILL.md +246 -0
  21. package/.agent/skills/andrew-kane-gem-writer/SKILL.md +184 -0
  22. package/.agent/skills/andrew-kane-gem-writer/references/database-adapters.md +231 -0
  23. package/.agent/skills/andrew-kane-gem-writer/references/module-organization.md +121 -0
  24. package/.agent/skills/andrew-kane-gem-writer/references/rails-integration.md +183 -0
  25. package/.agent/skills/andrew-kane-gem-writer/references/resources.md +119 -0
  26. package/.agent/skills/andrew-kane-gem-writer/references/testing-patterns.md +261 -0
  27. package/.agent/skills/ankane-readme-writer/SKILL.md +50 -0
  28. package/.agent/skills/architecture-strategist/SKILL.md +52 -0
  29. package/.agent/skills/best-practices-researcher/SKILL.md +100 -0
  30. package/.agent/skills/bug-reproduction-validator/SKILL.md +67 -0
  31. package/.agent/skills/code-simplicity-reviewer/SKILL.md +85 -0
  32. package/.agent/skills/coding-tutor/.claude-plugin/plugin.json +9 -0
  33. package/.agent/skills/coding-tutor/README.md +37 -0
  34. package/.agent/skills/coding-tutor/commands/quiz-me.md +1 -0
  35. package/.agent/skills/coding-tutor/commands/sync-tutorials.md +25 -0
  36. package/.agent/skills/coding-tutor/commands/teach-me.md +1 -0
  37. package/.agent/skills/coding-tutor/skills/coding-tutor/SKILL.md +214 -0
  38. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/create_tutorial.py +202 -0
  39. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/index_tutorials.py +203 -0
  40. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/quiz_priority.py +190 -0
  41. package/.agent/skills/coding-tutor/skills/coding-tutor/scripts/setup_tutorials.py +132 -0
  42. package/.agent/skills/compound-docs/SKILL.md +510 -0
  43. package/.agent/skills/compound-docs/assets/critical-pattern-template.md +34 -0
  44. package/.agent/skills/compound-docs/assets/resolution-template.md +93 -0
  45. package/.agent/skills/compound-docs/references/yaml-schema.md +65 -0
  46. package/.agent/skills/compound-docs/schema.yaml +176 -0
  47. package/.agent/skills/create-agent-skills/SKILL.md +299 -0
  48. package/.agent/skills/create-agent-skills/references/api-security.md +226 -0
  49. package/.agent/skills/create-agent-skills/references/be-clear-and-direct.md +531 -0
  50. package/.agent/skills/create-agent-skills/references/best-practices.md +404 -0
  51. package/.agent/skills/create-agent-skills/references/common-patterns.md +595 -0
  52. package/.agent/skills/create-agent-skills/references/core-principles.md +437 -0
  53. package/.agent/skills/create-agent-skills/references/executable-code.md +175 -0
  54. package/.agent/skills/create-agent-skills/references/iteration-and-testing.md +474 -0
  55. package/.agent/skills/create-agent-skills/references/official-spec.md +185 -0
  56. package/.agent/skills/create-agent-skills/references/recommended-structure.md +168 -0
  57. package/.agent/skills/create-agent-skills/references/skill-structure.md +372 -0
  58. package/.agent/skills/create-agent-skills/references/using-scripts.md +113 -0
  59. package/.agent/skills/create-agent-skills/references/using-templates.md +112 -0
  60. package/.agent/skills/create-agent-skills/references/workflows-and-validation.md +510 -0
  61. package/.agent/skills/create-agent-skills/templates/router-skill.md +73 -0
  62. package/.agent/skills/create-agent-skills/templates/simple-skill.md +33 -0
  63. package/.agent/skills/create-agent-skills/workflows/add-reference.md +96 -0
  64. package/.agent/skills/create-agent-skills/workflows/add-script.md +93 -0
  65. package/.agent/skills/create-agent-skills/workflows/add-template.md +74 -0
  66. package/.agent/skills/create-agent-skills/workflows/add-workflow.md +120 -0
  67. package/.agent/skills/create-agent-skills/workflows/audit-skill.md +138 -0
  68. package/.agent/skills/create-agent-skills/workflows/create-domain-expertise-skill.md +605 -0
  69. package/.agent/skills/create-agent-skills/workflows/create-new-skill.md +191 -0
  70. package/.agent/skills/create-agent-skills/workflows/get-guidance.md +121 -0
  71. package/.agent/skills/create-agent-skills/workflows/upgrade-to-router.md +161 -0
  72. package/.agent/skills/create-agent-skills/workflows/verify-skill.md +204 -0
  73. package/.agent/skills/data-integrity-guardian/SKILL.md +70 -0
  74. package/.agent/skills/data-migration-expert/SKILL.md +97 -0
  75. package/.agent/skills/deployment-verification-agent/SKILL.md +159 -0
  76. package/.agent/skills/design-implementation-reviewer/SKILL.md +85 -0
  77. package/.agent/skills/design-iterator/SKILL.md +197 -0
  78. package/.agent/skills/dhh-rails-reviewer/SKILL.md +45 -0
  79. package/.agent/skills/dhh-rails-style/SKILL.md +184 -0
  80. package/.agent/skills/dhh-rails-style/references/architecture.md +653 -0
  81. package/.agent/skills/dhh-rails-style/references/controllers.md +303 -0
  82. package/.agent/skills/dhh-rails-style/references/frontend.md +510 -0
  83. package/.agent/skills/dhh-rails-style/references/gems.md +266 -0
  84. package/.agent/skills/dhh-rails-style/references/models.md +359 -0
  85. package/.agent/skills/dhh-rails-style/references/testing.md +338 -0
  86. package/.agent/skills/dspy-ruby/SKILL.md +594 -0
  87. package/.agent/skills/dspy-ruby/assets/config-template.rb +359 -0
  88. package/.agent/skills/dspy-ruby/assets/module-template.rb +326 -0
  89. package/.agent/skills/dspy-ruby/assets/signature-template.rb +143 -0
  90. package/.agent/skills/dspy-ruby/references/core-concepts.md +265 -0
  91. package/.agent/skills/dspy-ruby/references/optimization.md +623 -0
  92. package/.agent/skills/dspy-ruby/references/providers.md +305 -0
  93. package/.agent/skills/every-style-editor/SKILL.md +134 -0
  94. package/.agent/skills/every-style-editor/references/EVERY_WRITE_STYLE.md +529 -0
  95. package/.agent/skills/figma-design-sync/SKILL.md +166 -0
  96. package/.agent/skills/file-todos/SKILL.md +251 -0
  97. package/.agent/skills/file-todos/assets/todo-template.md +155 -0
  98. package/.agent/skills/framework-docs-researcher/SKILL.md +83 -0
  99. package/.agent/skills/frontend-design/SKILL.md +42 -0
  100. package/.agent/skills/gemini-imagegen/SKILL.md +237 -0
  101. package/.agent/skills/gemini-imagegen/requirements.txt +2 -0
  102. package/.agent/skills/gemini-imagegen/scripts/compose_images.py +168 -0
  103. package/.agent/skills/gemini-imagegen/scripts/edit_image.py +157 -0
  104. package/.agent/skills/gemini-imagegen/scripts/gemini_images.py +265 -0
  105. package/.agent/skills/gemini-imagegen/scripts/generate_image.py +147 -0
  106. package/.agent/skills/gemini-imagegen/scripts/multi_turn_chat.py +215 -0
  107. package/.agent/skills/git-history-analyzer/SKILL.md +42 -0
  108. package/.agent/skills/git-worktree/SKILL.md +302 -0
  109. package/.agent/skills/git-worktree/scripts/worktree-manager.sh +345 -0
  110. package/.agent/skills/julik-frontend-races-reviewer/SKILL.md +222 -0
  111. package/.agent/skills/kieran-python-reviewer/SKILL.md +104 -0
  112. package/.agent/skills/kieran-rails-reviewer/SKILL.md +86 -0
  113. package/.agent/skills/kieran-typescript-reviewer/SKILL.md +95 -0
  114. package/.agent/skills/lint/SKILL.md +16 -0
  115. package/.agent/skills/pattern-recognition-specialist/SKILL.md +57 -0
  116. package/.agent/skills/performance-oracle/SKILL.md +110 -0
  117. package/.agent/skills/pr-comment-resolver/SKILL.md +69 -0
  118. package/.agent/skills/rclone/SKILL.md +150 -0
  119. package/.agent/skills/rclone/scripts/check_setup.sh +60 -0
  120. package/.agent/skills/repo-research-analyst/SKILL.md +113 -0
  121. package/.agent/skills/security-sentinel/SKILL.md +93 -0
  122. package/.agent/skills/skill-creator/SKILL.md +209 -0
  123. package/.agent/skills/skill-creator/scripts/init_skill.py +304 -0
  124. package/.agent/skills/skill-creator/scripts/package_skill.py +112 -0
  125. package/.agent/skills/skill-creator/scripts/quick_validate.py +72 -0
  126. package/.agent/skills/spec-flow-analyzer/SKILL.md +113 -0
  127. package/.agent/skills/test-agent/SKILL.md +4 -0
  128. package/.agent/workflows/agent-native-audit.md +277 -0
  129. package/.agent/workflows/ask-user-question.md +21 -0
  130. package/.agent/workflows/changelog.md +137 -0
  131. package/.agent/workflows/compound.md +202 -0
  132. package/.agent/workflows/create-agent-skill.md +8 -0
  133. package/.agent/workflows/deepen-plan-research.md +334 -0
  134. package/.agent/workflows/deepen-plan-synthesis.md +182 -0
  135. package/.agent/workflows/deepen-plan.md +79 -0
  136. package/.agent/workflows/feature-video.md +342 -0
  137. package/.agent/workflows/generate-command.md +162 -0
  138. package/.agent/workflows/heal-skill.md +142 -0
  139. package/.agent/workflows/lfg.md +20 -0
  140. package/.agent/workflows/plan-analysis.md +67 -0
  141. package/.agent/workflows/plan-next-steps.md +63 -0
  142. package/.agent/workflows/plan-review.md +33 -0
  143. package/.agent/workflows/plan-synthesis.md +106 -0
  144. package/.agent/workflows/plan.md +49 -0
  145. package/.agent/workflows/report-bug.md +150 -0
  146. package/.agent/workflows/reproduce-bug.md +99 -0
  147. package/.agent/workflows/resolve-parallel.md +34 -0
  148. package/.agent/workflows/resolve-pr-parallel.md +49 -0
  149. package/.agent/workflows/resolve-todo-parallel.md +35 -0
  150. package/.agent/workflows/review-analysis.md +145 -0
  151. package/.agent/workflows/review-synthesis.md +262 -0
  152. package/.agent/workflows/review.md +64 -0
  153. package/.agent/workflows/ship.md +90 -0
  154. package/.agent/workflows/test-command.md +3 -0
  155. package/.agent/workflows/triage.md +310 -0
  156. package/.agent/workflows/work.md +157 -0
  157. package/.agent/workflows/xcode-test.md +332 -0
  158. package/LICENSE +22 -0
  159. package/README.md +49 -0
  160. package/bin/ag-cortex.js +54 -0
  161. package/lib/core.js +165 -0
  162. package/package.json +31 -0
@@ -0,0 +1,437 @@
1
+ <overview>
2
+ Core principles guide skill authoring decisions. These principles ensure skills are efficient, effective, and maintainable across different models and use cases.
3
+ </overview>
4
+
5
+ <xml_structure_principle>
6
+ <description>
7
+ Skills use pure XML structure for consistent parsing, efficient token usage, and improved Antigravity performance.
8
+ </description>
9
+
10
+ <why_xml>
11
+ <consistency>
12
+ XML enforces consistent structure across all skills. All skills use the same tag names for the same purposes:
13
+ - `<objective>` always defines what the skill does
14
+ - `<quick_start>` always provides immediate guidance
15
+ - `<success_criteria>` always defines completion
16
+
17
+ This consistency makes skills predictable and easier to maintain.
18
+ </consistency>
19
+
20
+ <parseability>
21
+ XML provides unambiguous boundaries and semantic meaning. Antigravity can reliably:
22
+ - Identify section boundaries (where content starts and ends)
23
+ - Understand content purpose (what role each section plays)
24
+ - Skip irrelevant sections (progressive disclosure)
25
+ - Parse programmatically (validation tools can check structure)
26
+
27
+ Markdown headings are just visual formatting. Antigravity must infer meaning from heading text, which is less reliable.
28
+ </parseability>
29
+
30
+ <token_efficiency>
31
+ XML tags are more efficient than markdown headings:
32
+
33
+ **Markdown headings**:
34
+ ```markdown
35
+ ## Quick start
36
+ ## Workflow
37
+ ## Advanced features
38
+ ## Success criteria
39
+ ```
40
+ Total: ~20 tokens, no semantic meaning to Antigravity
41
+
42
+ **XML tags**:
43
+ ```xml
44
+ <quick_start>
45
+ <workflow>
46
+ <advanced_features>
47
+ <success_criteria>
48
+ ```
49
+ Total: ~15 tokens, semantic meaning built-in
50
+
51
+ Savings compound across all skills in the ecosystem.
52
+ </token_efficiency>
53
+
54
+ <antigravity_performance>
55
+ Antigravity performs better with pure XML because:
56
+ - Unambiguous section boundaries reduce parsing errors
57
+ - Semantic tags convey intent directly (no inference needed)
58
+ - Nested tags create clear hierarchies
59
+ - Consistent structure across skills reduces cognitive load
60
+ - Progressive disclosure works more reliably
61
+
62
+ Pure XML structure is not just a style preference—it's a performance optimization.
63
+ </antigravity_performance>
64
+ </why_xml>
65
+
66
+ <critical_rule>
67
+ **Remove ALL markdown headings (#, ##, ###) from skill body content.** Replace with semantic XML tags. Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
68
+ </critical_rule>
69
+
70
+ <required_tags>
71
+ Every skill MUST have:
72
+ - `<objective>` - What the skill does and why it matters
73
+ - `<quick_start>` - Immediate, actionable guidance
74
+ - `<success_criteria>` or `<when_successful>` - How to know it worked
75
+
76
+ See [use-xml-tags.md](use-xml-tags.md) for conditional tags and intelligence rules.
77
+ </required_tags>
78
+ </xml_structure_principle>
79
+
80
+ <conciseness_principle>
81
+ <description>
82
+ The context window is shared. Your skill shares it with the system prompt, conversation history, other skills' metadata, and the actual request.
83
+ </description>
84
+
85
+ <guidance>
86
+ Only add context Antigravity doesn't already have. Challenge each piece of information:
87
+ - "Does Antigravity really need this explanation?"
88
+ - "Can I assume Antigravity knows this?"
89
+ - "Does this paragraph justify its token cost?"
90
+
91
+ Assume Antigravity is smart. Don't explain obvious concepts.
92
+ </guidance>
93
+
94
+ <concise_example>
95
+ **Concise** (~50 tokens):
96
+ ```xml
97
+ <quick_start>
98
+ Extract PDF text with pdfplumber:
99
+
100
+ ```python
101
+ import pdfplumber
102
+
103
+ with pdfplumber.open("file.pdf") as pdf:
104
+ text = pdf.pages[0].extract_text()
105
+ ```
106
+ </quick_start>
107
+ ```
108
+
109
+ **Verbose** (~150 tokens):
110
+ ```xml
111
+ <quick_start>
112
+ PDF files are a common file format used for documents. To extract text from them, we'll use a Python library called pdfplumber. First, you'll need to import the library, then open the PDF file using the open method, and finally extract the text from each page. Here's how to do it:
113
+
114
+ ```python
115
+ import pdfplumber
116
+
117
+ with pdfplumber.open("file.pdf") as pdf:
118
+ text = pdf.pages[0].extract_text()
119
+ ```
120
+
121
+ This code opens the PDF and extracts text from the first page.
122
+ </quick_start>
123
+ ```
124
+
125
+ The concise version assumes Antigravity knows what PDFs are, understands Python imports, and can read code. All those assumptions are correct.
126
+ </concise_example>
127
+
128
+ <when_to_elaborate>
129
+ Add explanation when:
130
+ - Concept is domain-specific (not general programming knowledge)
131
+ - Pattern is non-obvious or counterintuitive
132
+ - Context affects behavior in subtle ways
133
+ - Trade-offs require judgment
134
+
135
+ Don't add explanation for:
136
+ - Common programming concepts (loops, functions, imports)
137
+ - Standard library usage (reading files, making HTTP requests)
138
+ - Well-known tools (git, npm, pip)
139
+ - Obvious next steps
140
+ </when_to_elaborate>
141
+ </conciseness_principle>
142
+
143
+ <degrees_of_freedom_principle>
144
+ <description>
145
+ Match the level of specificity to the task's fragility and variability. Give Antigravity more freedom for creative tasks, less freedom for fragile operations.
146
+ </description>
147
+
148
+ <high_freedom>
149
+ <when>
150
+ - Multiple approaches are valid
151
+ - Decisions depend on context
152
+ - Heuristics guide the approach
153
+ - Creative solutions welcome
154
+ </when>
155
+
156
+ <example>
157
+ ```xml
158
+ <objective>
159
+ Review code for quality, bugs, and maintainability.
160
+ </objective>
161
+
162
+ <workflow>
163
+ 1. Analyze the code structure and organization
164
+ 2. Check for potential bugs or edge cases
165
+ 3. Suggest improvements for readability and maintainability
166
+ 4. Verify adherence to project conventions
167
+ </workflow>
168
+
169
+ <success_criteria>
170
+ - All major issues identified
171
+ - Suggestions are actionable and specific
172
+ - Review balances praise and criticism
173
+ </success_criteria>
174
+ ```
175
+
176
+ Antigravity has freedom to adapt the review based on what the code needs.
177
+ </example>
178
+ </high_freedom>
179
+
180
+ <medium_freedom>
181
+ <when>
182
+ - A preferred pattern exists
183
+ - Some variation is acceptable
184
+ - Configuration affects behavior
185
+ - Template can be adapted
186
+ </when>
187
+
188
+ <example>
189
+ ```xml
190
+ <objective>
191
+ Generate reports with customizable format and sections.
192
+ </objective>
193
+
194
+ <report_template>
195
+ Use this template and customize as needed:
196
+
197
+ ```python
198
+ def generate_report(data, format="markdown", include_charts=True):
199
+ # Process data
200
+ # Generate output in specified format
201
+ # Optionally include visualizations
202
+ ```
203
+ </report_template>
204
+
205
+ <success_criteria>
206
+ - Report includes all required sections
207
+ - Format matches user preference
208
+ - Data accurately represented
209
+ </success_criteria>
210
+ ```
211
+
212
+ Antigravity can customize the template based on requirements.
213
+ </example>
214
+ </medium_freedom>
215
+
216
+ <low_freedom>
217
+ <when>
218
+ - Operations are fragile and error-prone
219
+ - Consistency is critical
220
+ - A specific sequence must be followed
221
+ - Deviation causes failures
222
+ </when>
223
+
224
+ <example>
225
+ ```xml
226
+ <objective>
227
+ Run database migration with exact sequence to prevent data loss.
228
+ </objective>
229
+
230
+ <workflow>
231
+ Run exactly this script:
232
+
233
+ ```bash
234
+ python scripts/migrate.py --verify --backup
235
+ ```
236
+
237
+ **Do not modify the command or add additional flags.**
238
+ </workflow>
239
+
240
+ <success_criteria>
241
+ - Migration completes without errors
242
+ - Backup created before migration
243
+ - Verification confirms data integrity
244
+ </success_criteria>
245
+ ```
246
+
247
+ Antigravity must follow the exact command with no variation.
248
+ </example>
249
+ </low_freedom>
250
+
251
+ <matching_specificity>
252
+ The key is matching specificity to fragility:
253
+
254
+ - **Fragile operations** (database migrations, payment processing, security): Low freedom, exact instructions
255
+ - **Standard operations** (API calls, file processing, data transformation): Medium freedom, preferred pattern with flexibility
256
+ - **Creative operations** (code review, content generation, analysis): High freedom, heuristics and principles
257
+
258
+ Mismatched specificity causes problems:
259
+ - Too much freedom on fragile tasks → errors and failures
260
+ - Too little freedom on creative tasks → rigid, suboptimal outputs
261
+ </matching_specificity>
262
+ </degrees_of_freedom_principle>
263
+
264
+ <model_testing_principle>
265
+ <description>
266
+ Skills act as additions to models, so effectiveness depends on the underlying model. What works for Opus might need more detail for Haiku.
267
+ </description>
268
+
269
+ <testing_across_models>
270
+ Test your skill with all models you plan to use:
271
+
272
+ <haiku_testing>
273
+ **Antigravity Haiku** (fast, economical)
274
+
275
+ Questions to ask:
276
+ - Does the skill provide enough guidance?
277
+ - Are examples clear and complete?
278
+ - Do implicit assumptions become explicit?
279
+ - Does Haiku need more structure?
280
+
281
+ Haiku benefits from:
282
+ - More explicit instructions
283
+ - Complete examples (no partial code)
284
+ - Clear success criteria
285
+ - Step-by-step workflows
286
+ </haiku_testing>
287
+
288
+ <sonnet_testing>
289
+ **Antigravity Sonnet** (balanced)
290
+
291
+ Questions to ask:
292
+ - Is the skill clear and efficient?
293
+ - Does it avoid over-explanation?
294
+ - Are workflows well-structured?
295
+ - Does progressive disclosure work?
296
+
297
+ Sonnet benefits from:
298
+ - Balanced detail level
299
+ - XML structure for clarity
300
+ - Progressive disclosure
301
+ - Concise but complete guidance
302
+ </sonnet_testing>
303
+
304
+ <opus_testing>
305
+ **Antigravity Opus** (powerful reasoning)
306
+
307
+ Questions to ask:
308
+ - Does the skill avoid over-explaining?
309
+ - Can Opus infer obvious steps?
310
+ - Are constraints clear?
311
+ - Is context minimal but sufficient?
312
+
313
+ Opus benefits from:
314
+ - Concise instructions
315
+ - Principles over procedures
316
+ - High degrees of freedom
317
+ - Trust in reasoning capabilities
318
+ </opus_testing>
319
+ </testing_across_models>
320
+
321
+ <balancing_across_models>
322
+ Aim for instructions that work well across all target models:
323
+
324
+ **Good balance**:
325
+ ```xml
326
+ <quick_start>
327
+ Use pdfplumber for text extraction:
328
+
329
+ ```python
330
+ import pdfplumber
331
+ with pdfplumber.open("file.pdf") as pdf:
332
+ text = pdf.pages[0].extract_text()
333
+ ```
334
+
335
+ For scanned PDFs requiring OCR, use pdf2image with pytesseract instead.
336
+ </quick_start>
337
+ ```
338
+
339
+ This works for all models:
340
+ - Haiku gets complete working example
341
+ - Sonnet gets clear default with escape hatch
342
+ - Opus gets enough context without over-explanation
343
+
344
+ **Too minimal for Haiku**:
345
+ ```xml
346
+ <quick_start>
347
+ Use pdfplumber for text extraction.
348
+ </quick_start>
349
+ ```
350
+
351
+ **Too verbose for Opus**:
352
+ ```xml
353
+ <quick_start>
354
+ PDF files are documents that contain text. To extract that text, we use a library called pdfplumber. First, import the library at the top of your Python file. Then, open the PDF file using the pdfplumber.open() method. This returns a PDF object. Access the pages attribute to get a list of pages. Each page has an extract_text() method that returns the text content...
355
+ </quick_start>
356
+ ```
357
+ </balancing_across_models>
358
+
359
+ <iterative_improvement>
360
+ 1. Start with medium detail level
361
+ 2. Test with target models
362
+ 3. Observe where models struggle or succeed
363
+ 4. Adjust based on actual performance
364
+ 5. Re-test and iterate
365
+
366
+ Don't optimize for one model. Find the balance that works across your target models.
367
+ </iterative_improvement>
368
+ </model_testing_principle>
369
+
370
+ <progressive_disclosure_principle>
371
+ <description>
372
+ SKILL.md serves as an overview. Reference files contain details. Antigravity loads reference files only when needed.
373
+ </description>
374
+
375
+ <token_efficiency>
376
+ Progressive disclosure keeps token usage proportional to task complexity:
377
+
378
+ - Simple task: Load SKILL.md only (~500 tokens)
379
+ - Medium task: Load SKILL.md + one reference (~1000 tokens)
380
+ - Complex task: Load SKILL.md + multiple references (~2000 tokens)
381
+
382
+ Without progressive disclosure, every task loads all content regardless of need.
383
+ </token_efficiency>
384
+
385
+ <implementation>
386
+ - Keep SKILL.md under 500 lines
387
+ - Split detailed content into reference files
388
+ - Keep references one level deep from SKILL.md
389
+ - Link to references from relevant sections
390
+ - Use descriptive reference file names
391
+
392
+ See [skill-structure.md](skill-structure.md) for progressive disclosure patterns.
393
+ </implementation>
394
+ </progressive_disclosure_principle>
395
+
396
+ <validation_principle>
397
+ <description>
398
+ Validation scripts are force multipliers. They catch errors that Antigravity might miss and provide actionable feedback.
399
+ </description>
400
+
401
+ <characteristics>
402
+ Good validation scripts:
403
+ - Provide verbose, specific error messages
404
+ - Show available valid options when something is invalid
405
+ - Pinpoint exact location of problems
406
+ - Suggest actionable fixes
407
+ - Are deterministic and reliable
408
+
409
+ See [workflows-and-validation.md](workflows-and-validation.md) for validation patterns.
410
+ </characteristics>
411
+ </validation_principle>
412
+
413
+ <principle_summary>
414
+ <xml_structure>
415
+ Use pure XML structure for consistency, parseability, and Antigravity performance. Required tags: objective, quick_start, success_criteria.
416
+ </xml_structure>
417
+
418
+ <conciseness>
419
+ Only add context Antigravity doesn't have. Assume Antigravity is smart. Challenge every piece of content.
420
+ </conciseness>
421
+
422
+ <degrees_of_freedom>
423
+ Match specificity to fragility. High freedom for creative tasks, low freedom for fragile operations, medium for standard work.
424
+ </degrees_of_freedom>
425
+
426
+ <model_testing>
427
+ Test with all target models. Balance detail level to work across Haiku, Sonnet, and Opus.
428
+ </model_testing>
429
+
430
+ <progressive_disclosure>
431
+ Keep SKILL.md concise. Split details into reference files. Load reference files only when needed.
432
+ </progressive_disclosure>
433
+
434
+ <validation>
435
+ Make validation scripts verbose and specific. Catch errors early with actionable feedback.
436
+ </validation>
437
+ </principle_summary>
@@ -0,0 +1,175 @@
1
+ <when_to_use_scripts>
2
+ Even if Antigravity could write a script, pre-made scripts offer advantages:
3
+ - More reliable than generated code
4
+ - Save tokens (no need to include code in context)
5
+ - Save time (no code generation required)
6
+ - Ensure consistency across uses
7
+
8
+ <execution_vs_reference>
9
+ Make clear whether Antigravity should:
10
+ - **Execute the script** (most common): "Run `analyze_form.py` to extract fields"
11
+ - **Read it as reference** (for complex logic): "See `analyze_form.py` for the extraction algorithm"
12
+
13
+ For most utility scripts, execution is preferred.
14
+ </execution_vs_reference>
15
+
16
+ <how_scripts_work>
17
+ When Antigravity executes a script via bash:
18
+ 1. Script code never enters context window
19
+ 2. Only script output consumes tokens
20
+ 3. Far more efficient than having Antigravity generate equivalent code
21
+ </how_scripts_work>
22
+ </when_to_use_scripts>
23
+
24
+ <file_organization>
25
+ <scripts_directory>
26
+ **Best practice**: Place all executable scripts in a `scripts/` subdirectory within the skill folder.
27
+
28
+ ```
29
+ skill-name/
30
+ ├── SKILL.md
31
+ ├── scripts/
32
+ │ ├── main_utility.py
33
+ │ ├── helper_script.py
34
+ │ └── validator.py
35
+ └── references/
36
+ └── api-docs.md
37
+ ```
38
+
39
+ **Benefits**:
40
+ - Keeps skill root clean and organized
41
+ - Clear separation between documentation and executable code
42
+ - Consistent pattern across all skills
43
+ - Easy to reference: `python scripts/script_name.py`
44
+
45
+ **Reference pattern**: In SKILL.md, reference scripts using the `scripts/` path:
46
+
47
+ ```bash
48
+ python ~/.antigravity/skills/skill-name/scripts/analyze.py input.har
49
+ ```
50
+ </scripts_directory>
51
+ </file_organization>
52
+
53
+ <utility_scripts_pattern>
54
+ <example>
55
+ ## Utility scripts
56
+
57
+ **analyze_form.py**: Extract all form fields from PDF
58
+
59
+ ```bash
60
+ python scripts/analyze_form.py input.pdf > fields.json
61
+ ```
62
+
63
+ Output format:
64
+ ```json
65
+ {
66
+ "field_name": { "type": "text", "x": 100, "y": 200 },
67
+ "signature": { "type": "sig", "x": 150, "y": 500 }
68
+ }
69
+ ```
70
+
71
+ **validate_boxes.py**: Check for overlapping bounding boxes
72
+
73
+ ```bash
74
+ python scripts/validate_boxes.py fields.json
75
+ # Returns: "OK" or lists conflicts
76
+ ```
77
+
78
+ **fill_form.py**: Apply field values to PDF
79
+
80
+ ```bash
81
+ python scripts/fill_form.py input.pdf fields.json output.pdf
82
+ ```
83
+ </example>
84
+ </utility_scripts_pattern>
85
+
86
+ <solve_dont_punt>
87
+ Handle error conditions rather than punting to Antigravity.
88
+
89
+ <example type="good">
90
+ ```python
91
+ def process_file(path):
92
+ """Process a file, creating it if it doesn't exist."""
93
+ try:
94
+ with open(path) as f:
95
+ return f.read()
96
+ except FileNotFoundError:
97
+ print(f"File {path} not found, creating default")
98
+ with open(path, 'w') as f:
99
+ f.write('')
100
+ return ''
101
+ except PermissionError:
102
+ print(f"Cannot access {path}, using default")
103
+ return ''
104
+ ```
105
+ </example>
106
+
107
+ <example type="bad">
108
+ ```python
109
+ def process_file(path):
110
+ # Just fail and let Antigravity figure it out
111
+ return open(path).read()
112
+ ```
113
+ </example>
114
+
115
+ <configuration_values>
116
+ Document configuration parameters to avoid "voodoo constants":
117
+
118
+ <example type="good">
119
+ ```python
120
+ # HTTP requests typically complete within 30 seconds
121
+ REQUEST_TIMEOUT = 30
122
+
123
+ # Three retries balances reliability vs speed
124
+ MAX_RETRIES = 3
125
+ ```
126
+ </example>
127
+
128
+ <example type="bad">
129
+ ```python
130
+ TIMEOUT = 47 # Why 47?
131
+ RETRIES = 5 # Why 5?
132
+ ```
133
+ </example>
134
+ </configuration_values>
135
+ </solve_dont_punt>
136
+
137
+ <package_dependencies>
138
+ <runtime_constraints>
139
+ Skills run in code execution environment with platform-specific limitations:
140
+ - **agent.ai**: Can install packages from npm and PyPI
141
+ - **Antigravity API**: No network access and no runtime package installation
142
+ </runtime_constraints>
143
+
144
+ <guidance>
145
+ List required packages in your SKILL.md and verify they're available.
146
+
147
+ <example type="good">
148
+ Install required package: `pip install pypdf`
149
+
150
+ Then use it:
151
+
152
+ ```python
153
+ from pypdf import PdfReader
154
+ reader = PdfReader("file.pdf")
155
+ ```
156
+ </example>
157
+
158
+ <example type="bad">
159
+ "Use the pdf library to process the file."
160
+ </example>
161
+ </guidance>
162
+ </package_dependencies>
163
+
164
+ <mcp_tool_references>
165
+ If your Skill uses MCP (Model Context Protocol) tools, always use fully qualified tool names.
166
+
167
+ <format>ServerName:tool_name</format>
168
+
169
+ <examples>
170
+ - Use the BigQuery:bigquery_schema tool to retrieve table schemas.
171
+ - Use the GitHub:create_issue tool to create issues.
172
+ </examples>
173
+
174
+ Without the server prefix, Antigravity may fail to locate the tool, especially when multiple MCP servers are available.
175
+ </mcp_tool_references>