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,168 @@
|
|
|
1
|
+
# Recommended Skill Structure
|
|
2
|
+
|
|
3
|
+
The optimal structure for complex skills separates routing, workflows, and knowledge.
|
|
4
|
+
|
|
5
|
+
<structure>
|
|
6
|
+
```
|
|
7
|
+
skill-name/
|
|
8
|
+
├── SKILL.md # Router + essential principles (unavoidable)
|
|
9
|
+
├── workflows/ # Step-by-step procedures (how)
|
|
10
|
+
│ ├── workflow-a.md
|
|
11
|
+
│ ├── workflow-b.md
|
|
12
|
+
│ └── ...
|
|
13
|
+
└── references/ # Domain knowledge (what)
|
|
14
|
+
├── reference-a.md
|
|
15
|
+
├── reference-b.md
|
|
16
|
+
└── ...
|
|
17
|
+
```
|
|
18
|
+
</structure>
|
|
19
|
+
|
|
20
|
+
<why_this_works>
|
|
21
|
+
## Problems This Solves
|
|
22
|
+
|
|
23
|
+
**Problem 1: Context gets skipped**
|
|
24
|
+
When important principles are in a separate file, Antigravity may not read them.
|
|
25
|
+
**Solution:** Put essential principles directly in SKILL.md. They load automatically.
|
|
26
|
+
|
|
27
|
+
**Problem 2: Wrong context loaded**
|
|
28
|
+
A "build" task loads debugging references. A "debug" task loads build references.
|
|
29
|
+
**Solution:** Intake question determines intent → routes to specific workflow → workflow specifies which references to read.
|
|
30
|
+
|
|
31
|
+
**Problem 3: Monolithic skills are overwhelming**
|
|
32
|
+
500+ lines of mixed content makes it hard to find relevant parts.
|
|
33
|
+
**Solution:** Small router (SKILL.md) + focused workflows + reference library.
|
|
34
|
+
|
|
35
|
+
**Problem 4: Procedures mixed with knowledge**
|
|
36
|
+
"How to do X" mixed with "What X means" creates confusion.
|
|
37
|
+
**Solution:** Workflows are procedures (steps). References are knowledge (patterns, examples).
|
|
38
|
+
</why_this_works>
|
|
39
|
+
|
|
40
|
+
<skill_md_template>
|
|
41
|
+
## SKILL.md Template
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
---
|
|
45
|
+
name: skill-name
|
|
46
|
+
description: What it does and when to use it.
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
<essential_principles>
|
|
50
|
+
## How This Skill Works
|
|
51
|
+
|
|
52
|
+
[Inline principles that apply to ALL workflows. Cannot be skipped.]
|
|
53
|
+
|
|
54
|
+
### Principle 1: [Name]
|
|
55
|
+
[Brief explanation]
|
|
56
|
+
|
|
57
|
+
### Principle 2: [Name]
|
|
58
|
+
[Brief explanation]
|
|
59
|
+
</essential_principles>
|
|
60
|
+
|
|
61
|
+
<intake>
|
|
62
|
+
**Ask the user:**
|
|
63
|
+
|
|
64
|
+
What would you like to do?
|
|
65
|
+
1. [Option A]
|
|
66
|
+
2. [Option B]
|
|
67
|
+
3. [Option C]
|
|
68
|
+
4. Something else
|
|
69
|
+
|
|
70
|
+
**Wait for response before proceeding.**
|
|
71
|
+
</intake>
|
|
72
|
+
|
|
73
|
+
<routing>
|
|
74
|
+
| Response | Workflow |
|
|
75
|
+
|----------|----------|
|
|
76
|
+
| 1, "keyword", "keyword" | `workflows/option-a.md` |
|
|
77
|
+
| 2, "keyword", "keyword" | `workflows/option-b.md` |
|
|
78
|
+
| 3, "keyword", "keyword" | `workflows/option-c.md` |
|
|
79
|
+
| 4, other | Clarify, then select |
|
|
80
|
+
|
|
81
|
+
**After reading the workflow, follow it exactly.**
|
|
82
|
+
</routing>
|
|
83
|
+
|
|
84
|
+
<reference_index>
|
|
85
|
+
All domain knowledge in `references/`:
|
|
86
|
+
|
|
87
|
+
**Category A:** file-a.md, file-b.md
|
|
88
|
+
**Category B:** file-c.md, file-d.md
|
|
89
|
+
</reference_index>
|
|
90
|
+
|
|
91
|
+
<workflows_index>
|
|
92
|
+
| Workflow | Purpose |
|
|
93
|
+
|----------|---------|
|
|
94
|
+
| option-a.md | [What it does] |
|
|
95
|
+
| option-b.md | [What it does] |
|
|
96
|
+
| option-c.md | [What it does] |
|
|
97
|
+
</workflows_index>
|
|
98
|
+
```
|
|
99
|
+
</skill_md_template>
|
|
100
|
+
|
|
101
|
+
<workflow_template>
|
|
102
|
+
## Workflow Template
|
|
103
|
+
|
|
104
|
+
```markdown
|
|
105
|
+
# Workflow: [Name]
|
|
106
|
+
|
|
107
|
+
<required_reading>
|
|
108
|
+
**Read these reference files NOW:**
|
|
109
|
+
1. references/relevant-file.md
|
|
110
|
+
2. references/another-file.md
|
|
111
|
+
</required_reading>
|
|
112
|
+
|
|
113
|
+
<process>
|
|
114
|
+
## Step 1: [Name]
|
|
115
|
+
[What to do]
|
|
116
|
+
|
|
117
|
+
## Step 2: [Name]
|
|
118
|
+
[What to do]
|
|
119
|
+
|
|
120
|
+
## Step 3: [Name]
|
|
121
|
+
[What to do]
|
|
122
|
+
</process>
|
|
123
|
+
|
|
124
|
+
<success_criteria>
|
|
125
|
+
This workflow is complete when:
|
|
126
|
+
- [ ] Criterion 1
|
|
127
|
+
- [ ] Criterion 2
|
|
128
|
+
- [ ] Criterion 3
|
|
129
|
+
</success_criteria>
|
|
130
|
+
```
|
|
131
|
+
</workflow_template>
|
|
132
|
+
|
|
133
|
+
<when_to_use_this_pattern>
|
|
134
|
+
## When to Use This Pattern
|
|
135
|
+
|
|
136
|
+
**Use router + workflows + references when:**
|
|
137
|
+
- Multiple distinct workflows (build vs debug vs ship)
|
|
138
|
+
- Different workflows need different references
|
|
139
|
+
- Essential principles must not be skipped
|
|
140
|
+
- Skill has grown beyond 200 lines
|
|
141
|
+
|
|
142
|
+
**Use simple single-file skill when:**
|
|
143
|
+
- One workflow
|
|
144
|
+
- Small reference set
|
|
145
|
+
- Under 200 lines total
|
|
146
|
+
- No essential principles to enforce
|
|
147
|
+
</when_to_use_this_pattern>
|
|
148
|
+
|
|
149
|
+
<key_insight>
|
|
150
|
+
## The Key Insight
|
|
151
|
+
|
|
152
|
+
**SKILL.md is always loaded. Use this guarantee.**
|
|
153
|
+
|
|
154
|
+
Put unavoidable content in SKILL.md:
|
|
155
|
+
- Essential principles
|
|
156
|
+
- Intake question
|
|
157
|
+
- Routing logic
|
|
158
|
+
|
|
159
|
+
Put workflow-specific content in workflows/:
|
|
160
|
+
- Step-by-step procedures
|
|
161
|
+
- Required references for that workflow
|
|
162
|
+
- Success criteria for that workflow
|
|
163
|
+
|
|
164
|
+
Put reusable knowledge in references/:
|
|
165
|
+
- Patterns and examples
|
|
166
|
+
- Technical details
|
|
167
|
+
- Domain expertise
|
|
168
|
+
</key_insight>
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
Skills have three structural components: YAML frontmatter (metadata), pure XML body structure (content organization), and progressive disclosure (file organization). This reference defines requirements and best practices for each component.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<xml_structure_requirements>
|
|
6
|
+
<critical_rule>
|
|
7
|
+
**Remove ALL markdown headings (#, ##, ###) from skill body content.** Replace with semantic XML tags. Keep markdown formatting WITHIN content (bold, italic, lists, code blocks, links).
|
|
8
|
+
</critical_rule>
|
|
9
|
+
|
|
10
|
+
<required_tags>
|
|
11
|
+
Every skill MUST have these three tags:
|
|
12
|
+
|
|
13
|
+
- **`<objective>`** - What the skill does and why it matters (1-3 paragraphs)
|
|
14
|
+
- **`<quick_start>`** - Immediate, actionable guidance (minimal working example)
|
|
15
|
+
- **`<success_criteria>`** or **`<when_successful>`** - How to know it worked
|
|
16
|
+
</required_tags>
|
|
17
|
+
|
|
18
|
+
<conditional_tags>
|
|
19
|
+
Add based on skill complexity and domain requirements:
|
|
20
|
+
|
|
21
|
+
- **`<context>`** - Background/situational information
|
|
22
|
+
- **`<workflow>` or `<process>`** - Step-by-step procedures
|
|
23
|
+
- **`<advanced_features>`** - Deep-dive topics (progressive disclosure)
|
|
24
|
+
- **`<validation>`** - How to verify outputs
|
|
25
|
+
- **`<examples>`** - Multi-shot learning
|
|
26
|
+
- **`<anti_patterns>`** - Common mistakes to avoid
|
|
27
|
+
- **`<security_checklist>`** - Non-negotiable security patterns
|
|
28
|
+
- **`<testing>`** - Testing workflows
|
|
29
|
+
- **`<common_patterns>`** - Code examples and recipes
|
|
30
|
+
- **`<reference_guides>` or `<detailed_references>`** - Links to reference files
|
|
31
|
+
|
|
32
|
+
See [use-xml-tags.md](use-xml-tags.md) for detailed guidance on each tag.
|
|
33
|
+
</conditional_tags>
|
|
34
|
+
|
|
35
|
+
<tag_selection_intelligence>
|
|
36
|
+
**Simple skills** (single domain, straightforward):
|
|
37
|
+
- Required tags only
|
|
38
|
+
- Example: Text extraction, file format conversion
|
|
39
|
+
|
|
40
|
+
**Medium skills** (multiple patterns, some complexity):
|
|
41
|
+
- Required tags + workflow/examples as needed
|
|
42
|
+
- Example: Document processing with steps, API integration
|
|
43
|
+
|
|
44
|
+
**Complex skills** (multiple domains, security, APIs):
|
|
45
|
+
- Required tags + conditional tags as appropriate
|
|
46
|
+
- Example: Payment processing, authentication systems, multi-step workflows
|
|
47
|
+
</tag_selection_intelligence>
|
|
48
|
+
|
|
49
|
+
<xml_nesting>
|
|
50
|
+
Properly nest XML tags for hierarchical content:
|
|
51
|
+
|
|
52
|
+
```xml
|
|
53
|
+
<examples>
|
|
54
|
+
<example number="1">
|
|
55
|
+
<input>User input</input>
|
|
56
|
+
<output>Expected output</output>
|
|
57
|
+
</example>
|
|
58
|
+
</examples>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Always close tags:
|
|
62
|
+
```xml
|
|
63
|
+
<objective>
|
|
64
|
+
Content here
|
|
65
|
+
</objective>
|
|
66
|
+
```
|
|
67
|
+
</xml_nesting>
|
|
68
|
+
|
|
69
|
+
<tag_naming_conventions>
|
|
70
|
+
Use descriptive, semantic names:
|
|
71
|
+
- `<workflow>` not `<steps>`
|
|
72
|
+
- `<success_criteria>` not `<done>`
|
|
73
|
+
- `<anti_patterns>` not `<dont_do>`
|
|
74
|
+
|
|
75
|
+
Be consistent within your skill. If you use `<workflow>`, don't also use `<process>` for the same purpose (unless they serve different roles).
|
|
76
|
+
</tag_naming_conventions>
|
|
77
|
+
</xml_structure_requirements>
|
|
78
|
+
|
|
79
|
+
<yaml_requirements>
|
|
80
|
+
<required_fields>
|
|
81
|
+
```yaml
|
|
82
|
+
---
|
|
83
|
+
name: skill-name-here
|
|
84
|
+
description: What it does and when to use it (third person, specific triggers)
|
|
85
|
+
---
|
|
86
|
+
```
|
|
87
|
+
</required_fields>
|
|
88
|
+
|
|
89
|
+
<name_field>
|
|
90
|
+
**Validation rules**:
|
|
91
|
+
- Maximum 64 characters
|
|
92
|
+
- Lowercase letters, numbers, hyphens only
|
|
93
|
+
- No XML tags
|
|
94
|
+
- No reserved words: "antigravity", "agent"
|
|
95
|
+
- Must match directory name exactly
|
|
96
|
+
|
|
97
|
+
**Examples**:
|
|
98
|
+
- ✅ `process-pdfs`
|
|
99
|
+
- ✅ `manage-facebook-ads`
|
|
100
|
+
- ✅ `setup-stripe-payments`
|
|
101
|
+
- ❌ `PDF_Processor` (uppercase)
|
|
102
|
+
- ❌ `helper` (vague)
|
|
103
|
+
- ❌ `antigravity-helper` (reserved word)
|
|
104
|
+
</name_field>
|
|
105
|
+
|
|
106
|
+
<description_field>
|
|
107
|
+
**Validation rules**:
|
|
108
|
+
- Non-empty, maximum 1024 characters
|
|
109
|
+
- No XML tags
|
|
110
|
+
- Third person (never first or second person)
|
|
111
|
+
- Include what it does AND when to use it
|
|
112
|
+
|
|
113
|
+
**Critical rule**: Always write in third person.
|
|
114
|
+
- ✅ "Processes Excel files and generates reports"
|
|
115
|
+
- ❌ "I can help you process Excel files"
|
|
116
|
+
- ❌ "You can use this to process Excel files"
|
|
117
|
+
|
|
118
|
+
**Structure**: Include both capabilities and triggers.
|
|
119
|
+
|
|
120
|
+
**Effective examples**:
|
|
121
|
+
```yaml
|
|
122
|
+
description: Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
description: Analyze Excel spreadsheets, create pivot tables, generate charts. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
description: Generate descriptive commit messages by analyzing git diffs. Use when the user asks for help writing commit messages or reviewing staged changes.
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Avoid**:
|
|
134
|
+
```yaml
|
|
135
|
+
description: Helps with documents
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
```yaml
|
|
139
|
+
description: Processes data
|
|
140
|
+
```
|
|
141
|
+
</description_field>
|
|
142
|
+
</yaml_requirements>
|
|
143
|
+
|
|
144
|
+
<naming_conventions>
|
|
145
|
+
Use **verb-noun convention** for skill names:
|
|
146
|
+
|
|
147
|
+
<pattern name="create">
|
|
148
|
+
Building/authoring tools
|
|
149
|
+
|
|
150
|
+
Examples: `create-agent-skills`, `create-hooks`, `create-landing-pages`
|
|
151
|
+
</pattern>
|
|
152
|
+
|
|
153
|
+
<pattern name="manage">
|
|
154
|
+
Managing external services or resources
|
|
155
|
+
|
|
156
|
+
Examples: `manage-facebook-ads`, `manage-zoom`, `manage-stripe`, `manage-supabase`
|
|
157
|
+
</pattern>
|
|
158
|
+
|
|
159
|
+
<pattern name="setup">
|
|
160
|
+
Configuration/integration tasks
|
|
161
|
+
|
|
162
|
+
Examples: `setup-stripe-payments`, `setup-meta-tracking`
|
|
163
|
+
</pattern>
|
|
164
|
+
|
|
165
|
+
<pattern name="generate">
|
|
166
|
+
Generation tasks
|
|
167
|
+
|
|
168
|
+
Examples: `generate-ai-images`
|
|
169
|
+
</pattern>
|
|
170
|
+
|
|
171
|
+
<avoid_patterns>
|
|
172
|
+
- Vague: `helper`, `utils`, `tools`
|
|
173
|
+
- Generic: `documents`, `data`, `files`
|
|
174
|
+
- Reserved words: `antigravity-helper`, `agent-tools`
|
|
175
|
+
- Inconsistent: Directory `facebook-ads` but name `facebook-ads-manager`
|
|
176
|
+
</avoid_patterns>
|
|
177
|
+
</naming_conventions>
|
|
178
|
+
|
|
179
|
+
<progressive_disclosure>
|
|
180
|
+
<principle>
|
|
181
|
+
SKILL.md serves as an overview that points to detailed materials as needed. This keeps context window usage efficient.
|
|
182
|
+
</principle>
|
|
183
|
+
|
|
184
|
+
<practical_guidance>
|
|
185
|
+
- Keep SKILL.md body under 500 lines
|
|
186
|
+
- Split content into separate files when approaching this limit
|
|
187
|
+
- Keep references one level deep from SKILL.md
|
|
188
|
+
- Add table of contents to reference files over 100 lines
|
|
189
|
+
</practical_guidance>
|
|
190
|
+
|
|
191
|
+
<pattern name="high_level_guide">
|
|
192
|
+
Quick start in SKILL.md, details in reference files:
|
|
193
|
+
|
|
194
|
+
```markdown
|
|
195
|
+
---
|
|
196
|
+
name: pdf-processing
|
|
197
|
+
description: Extracts text and tables from PDF files, fills forms, and merges documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
<objective>
|
|
201
|
+
Extract text and tables from PDF files, fill forms, and merge documents using Python libraries.
|
|
202
|
+
</objective>
|
|
203
|
+
|
|
204
|
+
<quick_start>
|
|
205
|
+
Extract text with pdfplumber:
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
import pdfplumber
|
|
209
|
+
with pdfplumber.open("file.pdf") as pdf:
|
|
210
|
+
text = pdf.pages[0].extract_text()
|
|
211
|
+
```
|
|
212
|
+
</quick_start>
|
|
213
|
+
|
|
214
|
+
<advanced_features>
|
|
215
|
+
**Form filling**: See [forms.md](forms.md)
|
|
216
|
+
**API reference**: See [reference.md](reference.md)
|
|
217
|
+
</advanced_features>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Antigravity loads forms.md or reference.md only when needed.
|
|
221
|
+
</pattern>
|
|
222
|
+
|
|
223
|
+
<pattern name="domain_organization">
|
|
224
|
+
For skills with multiple domains, organize by domain to avoid loading irrelevant context:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
bigquery-skill/
|
|
228
|
+
├── SKILL.md (overview and navigation)
|
|
229
|
+
└── reference/
|
|
230
|
+
├── finance.md (revenue, billing metrics)
|
|
231
|
+
├── sales.md (opportunities, pipeline)
|
|
232
|
+
├── product.md (API usage, features)
|
|
233
|
+
└── marketing.md (campaigns, attribution)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
When user asks about revenue, Antigravity reads only finance.md. Other files stay on filesystem consuming zero tokens.
|
|
237
|
+
</pattern>
|
|
238
|
+
|
|
239
|
+
<pattern name="conditional_details">
|
|
240
|
+
Show basic content in SKILL.md, link to advanced in reference files:
|
|
241
|
+
|
|
242
|
+
```xml
|
|
243
|
+
<objective>
|
|
244
|
+
Process DOCX files with creation and editing capabilities.
|
|
245
|
+
</objective>
|
|
246
|
+
|
|
247
|
+
<quick_start>
|
|
248
|
+
<creating_documents>
|
|
249
|
+
Use docx-js for new documents. See [docx-js.md](docx-js.md).
|
|
250
|
+
</creating_documents>
|
|
251
|
+
|
|
252
|
+
<editing_documents>
|
|
253
|
+
For simple edits, modify XML directly.
|
|
254
|
+
|
|
255
|
+
**For tracked changes**: See [redlining.md](redlining.md)
|
|
256
|
+
**For OOXML details**: See [ooxml.md](ooxml.md)
|
|
257
|
+
</editing_documents>
|
|
258
|
+
</quick_start>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Antigravity reads redlining.md or ooxml.md only when the user needs those features.
|
|
262
|
+
</pattern>
|
|
263
|
+
|
|
264
|
+
<critical_rules>
|
|
265
|
+
**Keep references one level deep**: All reference files should link directly from SKILL.md. Avoid nested references (SKILL.md → advanced.md → details.md) as Antigravity may only partially read deeply nested files.
|
|
266
|
+
|
|
267
|
+
**Add table of contents to long files**: For reference files over 100 lines, include a table of contents at the top.
|
|
268
|
+
|
|
269
|
+
**Use pure XML in reference files**: Reference files should also use pure XML structure (no markdown headings in body).
|
|
270
|
+
</critical_rules>
|
|
271
|
+
</progressive_disclosure>
|
|
272
|
+
|
|
273
|
+
<file_organization>
|
|
274
|
+
<filesystem_navigation>
|
|
275
|
+
Antigravity navigates your skill directory using bash commands:
|
|
276
|
+
|
|
277
|
+
- Use forward slashes: `reference/guide.md` (not `reference\guide.md`)
|
|
278
|
+
- Name files descriptively: `form_validation_rules.md` (not `doc2.md`)
|
|
279
|
+
- Organize by domain: `reference/finance.md`, `reference/sales.md`
|
|
280
|
+
</filesystem_navigation>
|
|
281
|
+
|
|
282
|
+
<directory_structure>
|
|
283
|
+
Typical skill structure:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
skill-name/
|
|
287
|
+
├── SKILL.md (main entry point, pure XML structure)
|
|
288
|
+
├── references/ (optional, for progressive disclosure)
|
|
289
|
+
│ ├── guide-1.md (pure XML structure)
|
|
290
|
+
│ ├── guide-2.md (pure XML structure)
|
|
291
|
+
│ └── examples.md (pure XML structure)
|
|
292
|
+
└── scripts/ (optional, for utility scripts)
|
|
293
|
+
├── validate.py
|
|
294
|
+
└── process.py
|
|
295
|
+
```
|
|
296
|
+
</directory_structure>
|
|
297
|
+
</file_organization>
|
|
298
|
+
|
|
299
|
+
<anti_patterns>
|
|
300
|
+
<pitfall name="markdown_headings_in_body">
|
|
301
|
+
❌ Do NOT use markdown headings in skill body:
|
|
302
|
+
|
|
303
|
+
```markdown
|
|
304
|
+
# PDF Processing
|
|
305
|
+
|
|
306
|
+
## Quick start
|
|
307
|
+
Extract text...
|
|
308
|
+
|
|
309
|
+
## Advanced features
|
|
310
|
+
Form filling...
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
✅ Use pure XML structure:
|
|
314
|
+
|
|
315
|
+
```xml
|
|
316
|
+
<objective>
|
|
317
|
+
PDF processing with text extraction, form filling, and merging.
|
|
318
|
+
</objective>
|
|
319
|
+
|
|
320
|
+
<quick_start>
|
|
321
|
+
Extract text...
|
|
322
|
+
</quick_start>
|
|
323
|
+
|
|
324
|
+
<advanced_features>
|
|
325
|
+
Form filling...
|
|
326
|
+
</advanced_features>
|
|
327
|
+
```
|
|
328
|
+
</pitfall>
|
|
329
|
+
|
|
330
|
+
<pitfall name="vague_descriptions">
|
|
331
|
+
- ❌ "Helps with documents"
|
|
332
|
+
- ✅ "Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction."
|
|
333
|
+
</pitfall>
|
|
334
|
+
|
|
335
|
+
<pitfall name="inconsistent_pov">
|
|
336
|
+
- ❌ "I can help you process Excel files"
|
|
337
|
+
- ✅ "Processes Excel files and generates reports"
|
|
338
|
+
</pitfall>
|
|
339
|
+
|
|
340
|
+
<pitfall name="wrong_naming_convention">
|
|
341
|
+
- ❌ Directory: `facebook-ads`, Name: `facebook-ads-manager`
|
|
342
|
+
- ✅ Directory: `manage-facebook-ads`, Name: `manage-facebook-ads`
|
|
343
|
+
- ❌ Directory: `stripe-integration`, Name: `stripe`
|
|
344
|
+
- ✅ Directory: `setup-stripe-payments`, Name: `setup-stripe-payments`
|
|
345
|
+
</pitfall>
|
|
346
|
+
|
|
347
|
+
<pitfall name="deeply_nested_references">
|
|
348
|
+
Keep references one level deep from SKILL.md. Antigravity may only partially read nested files (SKILL.md → advanced.md → details.md).
|
|
349
|
+
</pitfall>
|
|
350
|
+
|
|
351
|
+
<pitfall name="windows_paths">
|
|
352
|
+
Always use forward slashes: `scripts/helper.py` (not `scripts\helper.py`)
|
|
353
|
+
</pitfall>
|
|
354
|
+
|
|
355
|
+
<pitfall name="missing_required_tags">
|
|
356
|
+
Every skill must have: `<objective>`, `<quick_start>`, and `<success_criteria>` (or `<when_successful>`).
|
|
357
|
+
</pitfall>
|
|
358
|
+
</anti_patterns>
|
|
359
|
+
|
|
360
|
+
<validation_checklist>
|
|
361
|
+
Before finalizing a skill, verify:
|
|
362
|
+
|
|
363
|
+
- ✅ YAML frontmatter valid (name matches directory, description in third person)
|
|
364
|
+
- ✅ No markdown headings in body (pure XML structure)
|
|
365
|
+
- ✅ Required tags present: objective, quick_start, success_criteria
|
|
366
|
+
- ✅ Conditional tags appropriate for complexity level
|
|
367
|
+
- ✅ All XML tags properly closed
|
|
368
|
+
- ✅ Progressive disclosure applied (SKILL.md < 500 lines)
|
|
369
|
+
- ✅ Reference files use pure XML structure
|
|
370
|
+
- ✅ File paths use forward slashes
|
|
371
|
+
- ✅ Descriptive file names
|
|
372
|
+
</validation_checklist>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Using Scripts in Skills
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Scripts are executable code that Antigravity runs as-is rather than regenerating each time. They ensure reliable, error-free execution of repeated operations.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<when_to_use>
|
|
8
|
+
Use scripts when:
|
|
9
|
+
- The same code runs across multiple skill invocations
|
|
10
|
+
- Operations are error-prone when rewritten from scratch
|
|
11
|
+
- Complex shell commands or API interactions are involved
|
|
12
|
+
- Consistency matters more than flexibility
|
|
13
|
+
|
|
14
|
+
Common script types:
|
|
15
|
+
- **Deployment** - Deploy to Vercel, publish packages, push releases
|
|
16
|
+
- **Setup** - Initialize projects, install dependencies, configure environments
|
|
17
|
+
- **API calls** - Authenticated requests, webhook handlers, data fetches
|
|
18
|
+
- **Data processing** - Transform files, batch operations, migrations
|
|
19
|
+
- **Build processes** - Compile, bundle, test runners
|
|
20
|
+
</when_to_use>
|
|
21
|
+
|
|
22
|
+
<script_structure>
|
|
23
|
+
Scripts live in `scripts/` within the skill directory:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
skill-name/
|
|
27
|
+
├── SKILL.md
|
|
28
|
+
├── workflows/
|
|
29
|
+
├── references/
|
|
30
|
+
├── templates/
|
|
31
|
+
└── scripts/
|
|
32
|
+
├── deploy.sh
|
|
33
|
+
├── setup.py
|
|
34
|
+
└── fetch-data.ts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A well-structured script includes:
|
|
38
|
+
1. Clear purpose comment at top
|
|
39
|
+
2. Input validation
|
|
40
|
+
3. Error handling
|
|
41
|
+
4. Idempotent operations where possible
|
|
42
|
+
5. Clear output/feedback
|
|
43
|
+
</script_structure>
|
|
44
|
+
|
|
45
|
+
<script_example>
|
|
46
|
+
```bash
|
|
47
|
+
#!/bin/bash
|
|
48
|
+
# deploy.sh - Deploy project to Vercel
|
|
49
|
+
# Usage: ./deploy.sh [environment]
|
|
50
|
+
# Environments: preview (default), production
|
|
51
|
+
|
|
52
|
+
set -euo pipefail
|
|
53
|
+
|
|
54
|
+
ENVIRONMENT="${1:-preview}"
|
|
55
|
+
|
|
56
|
+
# Validate environment
|
|
57
|
+
if [[ "$ENVIRONMENT" != "preview" && "$ENVIRONMENT" != "production" ]]; then
|
|
58
|
+
echo "Error: Environment must be 'preview' or 'production'"
|
|
59
|
+
exit 1
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
echo "Deploying to $ENVIRONMENT..."
|
|
63
|
+
|
|
64
|
+
if [[ "$ENVIRONMENT" == "production" ]]; then
|
|
65
|
+
vercel --prod
|
|
66
|
+
else
|
|
67
|
+
vercel
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
echo "Deployment complete."
|
|
71
|
+
```
|
|
72
|
+
</script_example>
|
|
73
|
+
|
|
74
|
+
<workflow_integration>
|
|
75
|
+
Workflows reference scripts like this:
|
|
76
|
+
|
|
77
|
+
```xml
|
|
78
|
+
<process>
|
|
79
|
+
## Step 5: Deploy
|
|
80
|
+
|
|
81
|
+
1. Ensure all tests pass
|
|
82
|
+
2. Run `scripts/deploy.sh production`
|
|
83
|
+
3. Verify deployment succeeded
|
|
84
|
+
4. Update user with deployment URL
|
|
85
|
+
</process>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The workflow tells Antigravity WHEN to run the script. The script handles HOW the operation executes.
|
|
89
|
+
</workflow_integration>
|
|
90
|
+
|
|
91
|
+
<best_practices>
|
|
92
|
+
**Do:**
|
|
93
|
+
- Make scripts idempotent (safe to run multiple times)
|
|
94
|
+
- Include clear usage comments
|
|
95
|
+
- Validate inputs before executing
|
|
96
|
+
- Provide meaningful error messages
|
|
97
|
+
- Use `set -euo pipefail` in bash scripts
|
|
98
|
+
|
|
99
|
+
**Don't:**
|
|
100
|
+
- Hardcode secrets or credentials (use environment variables)
|
|
101
|
+
- Create scripts for one-off operations
|
|
102
|
+
- Skip error handling
|
|
103
|
+
- Make scripts do too many unrelated things
|
|
104
|
+
- Forget to make scripts executable (`chmod +x`)
|
|
105
|
+
</best_practices>
|
|
106
|
+
|
|
107
|
+
<security_considerations>
|
|
108
|
+
- Never embed API keys, tokens, or secrets in scripts
|
|
109
|
+
- Use environment variables for sensitive configuration
|
|
110
|
+
- Validate and sanitize any user-provided inputs
|
|
111
|
+
- Be cautious with scripts that delete or modify data
|
|
112
|
+
- Consider adding `--dry-run` options for destructive operations
|
|
113
|
+
</security_considerations>
|