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,112 @@
|
|
|
1
|
+
# Using Templates in Skills
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Templates are reusable output structures that Antigravity copies and fills in. They ensure consistent, high-quality outputs without regenerating structure each time.
|
|
5
|
+
</purpose>
|
|
6
|
+
|
|
7
|
+
<when_to_use>
|
|
8
|
+
Use templates when:
|
|
9
|
+
- Output should have consistent structure across invocations
|
|
10
|
+
- The structure matters more than creative generation
|
|
11
|
+
- Filling placeholders is more reliable than blank-page generation
|
|
12
|
+
- Users expect predictable, professional-looking outputs
|
|
13
|
+
|
|
14
|
+
Common template types:
|
|
15
|
+
- **Plans** - Project plans, implementation plans, migration plans
|
|
16
|
+
- **Specifications** - Technical specs, feature specs, API specs
|
|
17
|
+
- **Documents** - Reports, proposals, summaries
|
|
18
|
+
- **Configurations** - Config files, settings, environment setups
|
|
19
|
+
- **Scaffolds** - File structures, boilerplate code
|
|
20
|
+
</when_to_use>
|
|
21
|
+
|
|
22
|
+
<template_structure>
|
|
23
|
+
Templates live in `templates/` within the skill directory:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
skill-name/
|
|
27
|
+
├── SKILL.md
|
|
28
|
+
├── workflows/
|
|
29
|
+
├── references/
|
|
30
|
+
└── templates/
|
|
31
|
+
├── plan-template.md
|
|
32
|
+
├── spec-template.md
|
|
33
|
+
└── report-template.md
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
A template file contains:
|
|
37
|
+
1. Clear section markers
|
|
38
|
+
2. Placeholder indicators (use `{{placeholder}}` or `[PLACEHOLDER]`)
|
|
39
|
+
3. Inline guidance for what goes where
|
|
40
|
+
4. Example content where helpful
|
|
41
|
+
</template_structure>
|
|
42
|
+
|
|
43
|
+
<template_example>
|
|
44
|
+
```markdown
|
|
45
|
+
# {{PROJECT_NAME}} Implementation Plan
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
{{1-2 sentence summary of what this plan covers}}
|
|
49
|
+
|
|
50
|
+
## Goals
|
|
51
|
+
- {{Primary goal}}
|
|
52
|
+
- {{Secondary goals...}}
|
|
53
|
+
|
|
54
|
+
## Scope
|
|
55
|
+
**In scope:**
|
|
56
|
+
- {{What's included}}
|
|
57
|
+
|
|
58
|
+
**Out of scope:**
|
|
59
|
+
- {{What's explicitly excluded}}
|
|
60
|
+
|
|
61
|
+
## Phases
|
|
62
|
+
|
|
63
|
+
### Phase 1: {{Phase name}}
|
|
64
|
+
**Duration:** {{Estimated duration}}
|
|
65
|
+
**Deliverables:**
|
|
66
|
+
- {{Deliverable 1}}
|
|
67
|
+
- {{Deliverable 2}}
|
|
68
|
+
|
|
69
|
+
### Phase 2: {{Phase name}}
|
|
70
|
+
...
|
|
71
|
+
|
|
72
|
+
## Success Criteria
|
|
73
|
+
- [ ] {{Measurable criterion 1}}
|
|
74
|
+
- [ ] {{Measurable criterion 2}}
|
|
75
|
+
|
|
76
|
+
## Risks
|
|
77
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
78
|
+
|------|------------|--------|------------|
|
|
79
|
+
| {{Risk}} | {{H/M/L}} | {{H/M/L}} | {{Strategy}} |
|
|
80
|
+
```
|
|
81
|
+
</template_example>
|
|
82
|
+
|
|
83
|
+
<workflow_integration>
|
|
84
|
+
Workflows reference templates like this:
|
|
85
|
+
|
|
86
|
+
```xml
|
|
87
|
+
<process>
|
|
88
|
+
## Step 3: Generate Plan
|
|
89
|
+
|
|
90
|
+
1. Read `templates/plan-template.md`
|
|
91
|
+
2. Copy the template structure
|
|
92
|
+
3. Fill each placeholder based on gathered requirements
|
|
93
|
+
4. Review for completeness
|
|
94
|
+
</process>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The workflow tells Antigravity WHEN to use the template. The template provides WHAT structure to produce.
|
|
98
|
+
</workflow_integration>
|
|
99
|
+
|
|
100
|
+
<best_practices>
|
|
101
|
+
**Do:**
|
|
102
|
+
- Keep templates focused on structure, not content
|
|
103
|
+
- Use clear placeholder syntax consistently
|
|
104
|
+
- Include brief inline guidance where sections might be ambiguous
|
|
105
|
+
- Make templates complete but minimal
|
|
106
|
+
|
|
107
|
+
**Don't:**
|
|
108
|
+
- Put excessive example content that might be copied verbatim
|
|
109
|
+
- Create templates for outputs that genuinely need creative generation
|
|
110
|
+
- Over-constrain with too many required sections
|
|
111
|
+
- Forget to update templates when requirements change
|
|
112
|
+
</best_practices>
|
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
<overview>
|
|
2
|
+
This reference covers patterns for complex workflows, validation loops, and feedback cycles in skill authoring. All patterns use pure XML structure.
|
|
3
|
+
</overview>
|
|
4
|
+
|
|
5
|
+
<complex_workflows>
|
|
6
|
+
<principle>
|
|
7
|
+
Break complex operations into clear, sequential steps. For particularly complex workflows, provide a checklist.
|
|
8
|
+
</principle>
|
|
9
|
+
|
|
10
|
+
<pdf_forms_example>
|
|
11
|
+
```xml
|
|
12
|
+
<objective>
|
|
13
|
+
Fill PDF forms with validated data from JSON field mappings.
|
|
14
|
+
</objective>
|
|
15
|
+
|
|
16
|
+
<workflow>
|
|
17
|
+
Copy this checklist and check off items as you complete them:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Task Progress:
|
|
21
|
+
- [ ] Step 1: Analyze the form (run analyze_form.py)
|
|
22
|
+
- [ ] Step 2: Create field mapping (edit fields.json)
|
|
23
|
+
- [ ] Step 3: Validate mapping (run validate_fields.py)
|
|
24
|
+
- [ ] Step 4: Fill the form (run fill_form.py)
|
|
25
|
+
- [ ] Step 5: Verify output (run verify_output.py)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
<step_1>
|
|
29
|
+
**Analyze the form**
|
|
30
|
+
|
|
31
|
+
Run: `python scripts/analyze_form.py input.pdf`
|
|
32
|
+
|
|
33
|
+
This extracts form fields and their locations, saving to `fields.json`.
|
|
34
|
+
</step_1>
|
|
35
|
+
|
|
36
|
+
<step_2>
|
|
37
|
+
**Create field mapping**
|
|
38
|
+
|
|
39
|
+
Edit `fields.json` to add values for each field.
|
|
40
|
+
</step_2>
|
|
41
|
+
|
|
42
|
+
<step_3>
|
|
43
|
+
**Validate mapping**
|
|
44
|
+
|
|
45
|
+
Run: `python scripts/validate_fields.py fields.json`
|
|
46
|
+
|
|
47
|
+
Fix any validation errors before continuing.
|
|
48
|
+
</step_3>
|
|
49
|
+
|
|
50
|
+
<step_4>
|
|
51
|
+
**Fill the form**
|
|
52
|
+
|
|
53
|
+
Run: `python scripts/fill_form.py input.pdf fields.json output.pdf`
|
|
54
|
+
</step_4>
|
|
55
|
+
|
|
56
|
+
<step_5>
|
|
57
|
+
**Verify output**
|
|
58
|
+
|
|
59
|
+
Run: `python scripts/verify_output.py output.pdf`
|
|
60
|
+
|
|
61
|
+
If verification fails, return to Step 2.
|
|
62
|
+
</step_5>
|
|
63
|
+
</workflow>
|
|
64
|
+
```
|
|
65
|
+
</pdf_forms_example>
|
|
66
|
+
|
|
67
|
+
<when_to_use>
|
|
68
|
+
Use checklist pattern when:
|
|
69
|
+
- Workflow has 5+ sequential steps
|
|
70
|
+
- Steps must be completed in order
|
|
71
|
+
- Progress tracking helps prevent errors
|
|
72
|
+
- Easy resumption after interruption is valuable
|
|
73
|
+
</when_to_use>
|
|
74
|
+
</complex_workflows>
|
|
75
|
+
|
|
76
|
+
<feedback_loops>
|
|
77
|
+
<validate_fix_repeat_pattern>
|
|
78
|
+
<principle>
|
|
79
|
+
Run validator → fix errors → repeat. This pattern greatly improves output quality.
|
|
80
|
+
</principle>
|
|
81
|
+
|
|
82
|
+
<document_editing_example>
|
|
83
|
+
```xml
|
|
84
|
+
<objective>
|
|
85
|
+
Edit OOXML documents with XML validation at each step.
|
|
86
|
+
</objective>
|
|
87
|
+
|
|
88
|
+
<editing_process>
|
|
89
|
+
<step_1>
|
|
90
|
+
Make your edits to `word/document.xml`
|
|
91
|
+
</step_1>
|
|
92
|
+
|
|
93
|
+
<step_2>
|
|
94
|
+
**Validate immediately**: `python ooxml/scripts/validate.py unpacked_dir/`
|
|
95
|
+
</step_2>
|
|
96
|
+
|
|
97
|
+
<step_3>
|
|
98
|
+
If validation fails:
|
|
99
|
+
- Review the error message carefully
|
|
100
|
+
- Fix the issues in the XML
|
|
101
|
+
- Run validation again
|
|
102
|
+
</step_3>
|
|
103
|
+
|
|
104
|
+
<step_4>
|
|
105
|
+
**Only proceed when validation passes**
|
|
106
|
+
</step_4>
|
|
107
|
+
|
|
108
|
+
<step_5>
|
|
109
|
+
Rebuild: `python ooxml/scripts/pack.py unpacked_dir/ output.docx`
|
|
110
|
+
</step_5>
|
|
111
|
+
|
|
112
|
+
<step_6>
|
|
113
|
+
Test the output document
|
|
114
|
+
</step_6>
|
|
115
|
+
</editing_process>
|
|
116
|
+
|
|
117
|
+
<validation>
|
|
118
|
+
Never skip validation. Catching errors early prevents corrupted output files.
|
|
119
|
+
</validation>
|
|
120
|
+
```
|
|
121
|
+
</document_editing_example>
|
|
122
|
+
|
|
123
|
+
<why_it_works>
|
|
124
|
+
- Catches errors early before changes are applied
|
|
125
|
+
- Machine-verifiable with objective verification
|
|
126
|
+
- Plan can be iterated without touching originals
|
|
127
|
+
- Reduces total iteration cycles
|
|
128
|
+
</why_it_works>
|
|
129
|
+
</validate_fix_repeat_pattern>
|
|
130
|
+
|
|
131
|
+
<plan_validate_execute_pattern>
|
|
132
|
+
<principle>
|
|
133
|
+
When Antigravity performs complex, open-ended tasks, create a plan in a structured format, validate it, then execute.
|
|
134
|
+
|
|
135
|
+
Workflow: analyze → **create plan file** → **validate plan** → execute → verify
|
|
136
|
+
</principle>
|
|
137
|
+
|
|
138
|
+
<batch_update_example>
|
|
139
|
+
```xml
|
|
140
|
+
<objective>
|
|
141
|
+
Apply batch updates to spreadsheet with plan validation.
|
|
142
|
+
</objective>
|
|
143
|
+
|
|
144
|
+
<workflow>
|
|
145
|
+
<plan_phase>
|
|
146
|
+
<step_1>
|
|
147
|
+
Analyze the spreadsheet and requirements
|
|
148
|
+
</step_1>
|
|
149
|
+
|
|
150
|
+
<step_2>
|
|
151
|
+
Create `changes.json` with all planned updates
|
|
152
|
+
</step_2>
|
|
153
|
+
</plan_phase>
|
|
154
|
+
|
|
155
|
+
<validation_phase>
|
|
156
|
+
<step_3>
|
|
157
|
+
Validate the plan: `python scripts/validate_changes.py changes.json`
|
|
158
|
+
</step_3>
|
|
159
|
+
|
|
160
|
+
<step_4>
|
|
161
|
+
If validation fails:
|
|
162
|
+
- Review error messages
|
|
163
|
+
- Fix issues in changes.json
|
|
164
|
+
- Validate again
|
|
165
|
+
</step_4>
|
|
166
|
+
|
|
167
|
+
<step_5>
|
|
168
|
+
Only proceed when validation passes
|
|
169
|
+
</step_5>
|
|
170
|
+
</validation_phase>
|
|
171
|
+
|
|
172
|
+
<execution_phase>
|
|
173
|
+
<step_6>
|
|
174
|
+
Apply changes: `python scripts/apply_changes.py changes.json`
|
|
175
|
+
</step_6>
|
|
176
|
+
|
|
177
|
+
<step_7>
|
|
178
|
+
Verify output
|
|
179
|
+
</step_7>
|
|
180
|
+
</execution_phase>
|
|
181
|
+
</workflow>
|
|
182
|
+
|
|
183
|
+
<success_criteria>
|
|
184
|
+
- Plan validation passes with zero errors
|
|
185
|
+
- All changes applied successfully
|
|
186
|
+
- Output verification confirms expected results
|
|
187
|
+
</success_criteria>
|
|
188
|
+
```
|
|
189
|
+
</batch_update_example>
|
|
190
|
+
|
|
191
|
+
<implementation_tip>
|
|
192
|
+
Make validation scripts verbose with specific error messages:
|
|
193
|
+
|
|
194
|
+
**Good error message**:
|
|
195
|
+
"Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
196
|
+
|
|
197
|
+
**Bad error message**:
|
|
198
|
+
"Invalid field"
|
|
199
|
+
|
|
200
|
+
Specific errors help Antigravity fix issues without guessing.
|
|
201
|
+
</implementation_tip>
|
|
202
|
+
|
|
203
|
+
<when_to_use>
|
|
204
|
+
Use plan-validate-execute when:
|
|
205
|
+
- Operations are complex and error-prone
|
|
206
|
+
- Changes are irreversible or difficult to undo
|
|
207
|
+
- Planning can be validated independently
|
|
208
|
+
- Catching errors early saves significant time
|
|
209
|
+
</when_to_use>
|
|
210
|
+
</plan_validate_execute_pattern>
|
|
211
|
+
</feedback_loops>
|
|
212
|
+
|
|
213
|
+
<conditional_workflows>
|
|
214
|
+
<principle>
|
|
215
|
+
Guide Antigravity through decision points with clear branching logic.
|
|
216
|
+
</principle>
|
|
217
|
+
|
|
218
|
+
<document_modification_example>
|
|
219
|
+
```xml
|
|
220
|
+
<objective>
|
|
221
|
+
Modify DOCX files using appropriate method based on task type.
|
|
222
|
+
</objective>
|
|
223
|
+
|
|
224
|
+
<workflow>
|
|
225
|
+
<decision_point_1>
|
|
226
|
+
Determine the modification type:
|
|
227
|
+
|
|
228
|
+
**Creating new content?** → Follow "Creation workflow"
|
|
229
|
+
**Editing existing content?** → Follow "Editing workflow"
|
|
230
|
+
</decision_point_1>
|
|
231
|
+
|
|
232
|
+
<creation_workflow>
|
|
233
|
+
<objective>Build documents from scratch</objective>
|
|
234
|
+
|
|
235
|
+
<steps>
|
|
236
|
+
1. Use docx-js library
|
|
237
|
+
2. Build document from scratch
|
|
238
|
+
3. Export to .docx format
|
|
239
|
+
</steps>
|
|
240
|
+
</creation_workflow>
|
|
241
|
+
|
|
242
|
+
<editing_workflow>
|
|
243
|
+
<objective>Modify existing documents</objective>
|
|
244
|
+
|
|
245
|
+
<steps>
|
|
246
|
+
1. Unpack existing document
|
|
247
|
+
2. Modify XML directly
|
|
248
|
+
3. Validate after each change
|
|
249
|
+
4. Repack when complete
|
|
250
|
+
</steps>
|
|
251
|
+
</editing_workflow>
|
|
252
|
+
</workflow>
|
|
253
|
+
|
|
254
|
+
<success_criteria>
|
|
255
|
+
- Correct workflow chosen based on task type
|
|
256
|
+
- All steps in chosen workflow completed
|
|
257
|
+
- Output file validated and verified
|
|
258
|
+
</success_criteria>
|
|
259
|
+
```
|
|
260
|
+
</document_modification_example>
|
|
261
|
+
|
|
262
|
+
<when_to_use>
|
|
263
|
+
Use conditional workflows when:
|
|
264
|
+
- Different task types require different approaches
|
|
265
|
+
- Decision points are clear and well-defined
|
|
266
|
+
- Workflows are mutually exclusive
|
|
267
|
+
- Guiding Antigravity to correct path improves outcomes
|
|
268
|
+
</when_to_use>
|
|
269
|
+
</conditional_workflows>
|
|
270
|
+
|
|
271
|
+
<validation_scripts>
|
|
272
|
+
<principles>
|
|
273
|
+
Validation scripts are force multipliers. They catch errors that Antigravity might miss and provide actionable feedback for fixing issues.
|
|
274
|
+
</principles>
|
|
275
|
+
|
|
276
|
+
<characteristics_of_good_validation>
|
|
277
|
+
<verbose_errors>
|
|
278
|
+
**Good**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
279
|
+
|
|
280
|
+
**Bad**: "Invalid field"
|
|
281
|
+
|
|
282
|
+
Verbose errors help Antigravity fix issues in one iteration instead of multiple rounds of guessing.
|
|
283
|
+
</verbose_errors>
|
|
284
|
+
|
|
285
|
+
<specific_feedback>
|
|
286
|
+
**Good**: "Line 47: Expected closing tag `</paragraph>` but found `</section>`"
|
|
287
|
+
|
|
288
|
+
**Bad**: "XML syntax error"
|
|
289
|
+
|
|
290
|
+
Specific feedback pinpoints exact location and nature of the problem.
|
|
291
|
+
</specific_feedback>
|
|
292
|
+
|
|
293
|
+
<actionable_suggestions>
|
|
294
|
+
**Good**: "Required field 'customer_name' is missing. Add: {\"customer_name\": \"value\"}"
|
|
295
|
+
|
|
296
|
+
**Bad**: "Missing required field"
|
|
297
|
+
|
|
298
|
+
Actionable suggestions show Antigravity exactly what to fix.
|
|
299
|
+
</actionable_suggestions>
|
|
300
|
+
|
|
301
|
+
<available_options>
|
|
302
|
+
When validation fails, show available valid options:
|
|
303
|
+
|
|
304
|
+
**Good**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
|
|
305
|
+
|
|
306
|
+
**Bad**: "Invalid status"
|
|
307
|
+
|
|
308
|
+
Showing valid options eliminates guesswork.
|
|
309
|
+
</available_options>
|
|
310
|
+
</characteristics_of_good_validation>
|
|
311
|
+
|
|
312
|
+
<implementation_pattern>
|
|
313
|
+
```xml
|
|
314
|
+
<validation>
|
|
315
|
+
After making changes, validate immediately:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
python scripts/validate.py output_dir/
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
If validation fails, fix errors before continuing. Validation errors include:
|
|
322
|
+
|
|
323
|
+
- **Field not found**: "Field 'signature_date' not found. Available fields: customer_name, order_total, signature_date_signed"
|
|
324
|
+
- **Type mismatch**: "Field 'order_total' expects number, got string"
|
|
325
|
+
- **Missing required field**: "Required field 'customer_name' is missing"
|
|
326
|
+
- **Invalid value**: "Invalid status 'pending_review'. Valid statuses: active, paused, archived"
|
|
327
|
+
|
|
328
|
+
Only proceed when validation passes with zero errors.
|
|
329
|
+
</validation>
|
|
330
|
+
```
|
|
331
|
+
</implementation_pattern>
|
|
332
|
+
|
|
333
|
+
<benefits>
|
|
334
|
+
- Catches errors before they propagate
|
|
335
|
+
- Reduces iteration cycles
|
|
336
|
+
- Provides learning feedback
|
|
337
|
+
- Makes debugging deterministic
|
|
338
|
+
- Enables confident execution
|
|
339
|
+
</benefits>
|
|
340
|
+
</validation_scripts>
|
|
341
|
+
|
|
342
|
+
<iterative_refinement>
|
|
343
|
+
<principle>
|
|
344
|
+
Many workflows benefit from iteration: generate → validate → refine → validate → finalize.
|
|
345
|
+
</principle>
|
|
346
|
+
|
|
347
|
+
<implementation_example>
|
|
348
|
+
```xml
|
|
349
|
+
<objective>
|
|
350
|
+
Generate reports with iterative quality improvement.
|
|
351
|
+
</objective>
|
|
352
|
+
|
|
353
|
+
<workflow>
|
|
354
|
+
<iteration_1>
|
|
355
|
+
**Generate initial draft**
|
|
356
|
+
|
|
357
|
+
Create report based on data and requirements.
|
|
358
|
+
</iteration_1>
|
|
359
|
+
|
|
360
|
+
<iteration_2>
|
|
361
|
+
**Validate draft**
|
|
362
|
+
|
|
363
|
+
Run: `python scripts/validate_report.py draft.md`
|
|
364
|
+
|
|
365
|
+
Fix any structural issues, missing sections, or data errors.
|
|
366
|
+
</iteration_2>
|
|
367
|
+
|
|
368
|
+
<iteration_3>
|
|
369
|
+
**Refine content**
|
|
370
|
+
|
|
371
|
+
Improve clarity, add supporting data, enhance visualizations.
|
|
372
|
+
</iteration_3>
|
|
373
|
+
|
|
374
|
+
<iteration_4>
|
|
375
|
+
**Final validation**
|
|
376
|
+
|
|
377
|
+
Run: `python scripts/validate_report.py final.md`
|
|
378
|
+
|
|
379
|
+
Ensure all quality criteria met.
|
|
380
|
+
</iteration_4>
|
|
381
|
+
|
|
382
|
+
<iteration_5>
|
|
383
|
+
**Finalize**
|
|
384
|
+
|
|
385
|
+
Export to final format and deliver.
|
|
386
|
+
</iteration_5>
|
|
387
|
+
</workflow>
|
|
388
|
+
|
|
389
|
+
<success_criteria>
|
|
390
|
+
- Final validation passes with zero errors
|
|
391
|
+
- All quality criteria met
|
|
392
|
+
- Report ready for delivery
|
|
393
|
+
</success_criteria>
|
|
394
|
+
```
|
|
395
|
+
</implementation_example>
|
|
396
|
+
|
|
397
|
+
<when_to_use>
|
|
398
|
+
Use iterative refinement when:
|
|
399
|
+
- Quality improves with multiple passes
|
|
400
|
+
- Validation provides actionable feedback
|
|
401
|
+
- Time permits iteration
|
|
402
|
+
- Perfect output matters more than speed
|
|
403
|
+
</when_to_use>
|
|
404
|
+
</iterative_refinement>
|
|
405
|
+
|
|
406
|
+
<checkpoint_pattern>
|
|
407
|
+
<principle>
|
|
408
|
+
For long workflows, add checkpoints where Antigravity can pause and verify progress before continuing.
|
|
409
|
+
</principle>
|
|
410
|
+
|
|
411
|
+
<implementation_example>
|
|
412
|
+
```xml
|
|
413
|
+
<workflow>
|
|
414
|
+
<phase_1>
|
|
415
|
+
**Data collection** (Steps 1-3)
|
|
416
|
+
|
|
417
|
+
1. Extract data from source
|
|
418
|
+
2. Transform to target format
|
|
419
|
+
3. **CHECKPOINT**: Verify data completeness
|
|
420
|
+
|
|
421
|
+
Only continue if checkpoint passes.
|
|
422
|
+
</phase_1>
|
|
423
|
+
|
|
424
|
+
<phase_2>
|
|
425
|
+
**Data processing** (Steps 4-6)
|
|
426
|
+
|
|
427
|
+
4. Apply business rules
|
|
428
|
+
5. Validate transformations
|
|
429
|
+
6. **CHECKPOINT**: Verify processing accuracy
|
|
430
|
+
|
|
431
|
+
Only continue if checkpoint passes.
|
|
432
|
+
</phase_2>
|
|
433
|
+
|
|
434
|
+
<phase_3>
|
|
435
|
+
**Output generation** (Steps 7-9)
|
|
436
|
+
|
|
437
|
+
7. Generate output files
|
|
438
|
+
8. Validate output format
|
|
439
|
+
9. **CHECKPOINT**: Verify final output
|
|
440
|
+
|
|
441
|
+
Proceed to delivery only if checkpoint passes.
|
|
442
|
+
</phase_3>
|
|
443
|
+
</workflow>
|
|
444
|
+
|
|
445
|
+
<checkpoint_validation>
|
|
446
|
+
At each checkpoint:
|
|
447
|
+
1. Run validation script
|
|
448
|
+
2. Review output for correctness
|
|
449
|
+
3. Verify no errors or warnings
|
|
450
|
+
4. Only proceed when validation passes
|
|
451
|
+
</checkpoint_validation>
|
|
452
|
+
```
|
|
453
|
+
</implementation_example>
|
|
454
|
+
|
|
455
|
+
<benefits>
|
|
456
|
+
- Prevents cascading errors
|
|
457
|
+
- Easier to diagnose issues
|
|
458
|
+
- Clear progress indicators
|
|
459
|
+
- Natural pause points for review
|
|
460
|
+
- Reduces wasted work from early errors
|
|
461
|
+
</benefits>
|
|
462
|
+
</checkpoint_pattern>
|
|
463
|
+
|
|
464
|
+
<error_recovery>
|
|
465
|
+
<principle>
|
|
466
|
+
Design workflows with clear error recovery paths. Antigravity should know what to do when things go wrong.
|
|
467
|
+
</principle>
|
|
468
|
+
|
|
469
|
+
<implementation_example>
|
|
470
|
+
```xml
|
|
471
|
+
<workflow>
|
|
472
|
+
<normal_path>
|
|
473
|
+
1. Process input file
|
|
474
|
+
2. Validate output
|
|
475
|
+
3. Save results
|
|
476
|
+
</normal_path>
|
|
477
|
+
|
|
478
|
+
<error_recovery>
|
|
479
|
+
**If validation fails in step 2:**
|
|
480
|
+
- Review validation errors
|
|
481
|
+
- Check if input file is corrupted → Return to step 1 with different input
|
|
482
|
+
- Check if processing logic failed → Fix logic, return to step 1
|
|
483
|
+
- Check if output format wrong → Fix format, return to step 2
|
|
484
|
+
|
|
485
|
+
**If save fails in step 3:**
|
|
486
|
+
- Check disk space
|
|
487
|
+
- Check file permissions
|
|
488
|
+
- Check file path validity
|
|
489
|
+
- Retry save with corrected conditions
|
|
490
|
+
</error_recovery>
|
|
491
|
+
|
|
492
|
+
<escalation>
|
|
493
|
+
**If error persists after 3 attempts:**
|
|
494
|
+
- Document the error with full context
|
|
495
|
+
- Save partial results if available
|
|
496
|
+
- Report issue to user with diagnostic information
|
|
497
|
+
</escalation>
|
|
498
|
+
</workflow>
|
|
499
|
+
```
|
|
500
|
+
</implementation_example>
|
|
501
|
+
|
|
502
|
+
<when_to_use>
|
|
503
|
+
Include error recovery when:
|
|
504
|
+
- Workflows interact with external systems
|
|
505
|
+
- File operations could fail
|
|
506
|
+
- Network calls could timeout
|
|
507
|
+
- User input could be invalid
|
|
508
|
+
- Errors are recoverable
|
|
509
|
+
</when_to_use>
|
|
510
|
+
</error_recovery>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{SKILL_NAME}}
|
|
3
|
+
description: {{What it does}} Use when {{trigger conditions}}.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<essential_principles>
|
|
7
|
+
## {{Core Concept}}
|
|
8
|
+
|
|
9
|
+
{{Principles that ALWAYS apply, regardless of which workflow runs}}
|
|
10
|
+
|
|
11
|
+
### 1. {{First principle}}
|
|
12
|
+
{{Explanation}}
|
|
13
|
+
|
|
14
|
+
### 2. {{Second principle}}
|
|
15
|
+
{{Explanation}}
|
|
16
|
+
|
|
17
|
+
### 3. {{Third principle}}
|
|
18
|
+
{{Explanation}}
|
|
19
|
+
</essential_principles>
|
|
20
|
+
|
|
21
|
+
<intake>
|
|
22
|
+
**Ask the user:**
|
|
23
|
+
|
|
24
|
+
What would you like to do?
|
|
25
|
+
1. {{First option}}
|
|
26
|
+
2. {{Second option}}
|
|
27
|
+
3. {{Third option}}
|
|
28
|
+
|
|
29
|
+
**Wait for response before proceeding.**
|
|
30
|
+
</intake>
|
|
31
|
+
|
|
32
|
+
<routing>
|
|
33
|
+
| Response | Workflow |
|
|
34
|
+
|----------|----------|
|
|
35
|
+
| 1, "{{keywords}}" | `workflows/{{first-workflow}}.md` |
|
|
36
|
+
| 2, "{{keywords}}" | `workflows/{{second-workflow}}.md` |
|
|
37
|
+
| 3, "{{keywords}}" | `workflows/{{third-workflow}}.md` |
|
|
38
|
+
|
|
39
|
+
**After reading the workflow, follow it exactly.**
|
|
40
|
+
</routing>
|
|
41
|
+
|
|
42
|
+
<quick_reference>
|
|
43
|
+
## {{Skill Name}} Quick Reference
|
|
44
|
+
|
|
45
|
+
{{Brief reference information always useful to have visible}}
|
|
46
|
+
</quick_reference>
|
|
47
|
+
|
|
48
|
+
<reference_index>
|
|
49
|
+
## Domain Knowledge
|
|
50
|
+
|
|
51
|
+
All in `references/`:
|
|
52
|
+
- {{reference-1.md}} - {{purpose}}
|
|
53
|
+
- {{reference-2.md}} - {{purpose}}
|
|
54
|
+
</reference_index>
|
|
55
|
+
|
|
56
|
+
<workflows_index>
|
|
57
|
+
## Workflows
|
|
58
|
+
|
|
59
|
+
All in `workflows/`:
|
|
60
|
+
|
|
61
|
+
| Workflow | Purpose |
|
|
62
|
+
|----------|---------|
|
|
63
|
+
| {{first-workflow}}.md | {{purpose}} |
|
|
64
|
+
| {{second-workflow}}.md | {{purpose}} |
|
|
65
|
+
| {{third-workflow}}.md | {{purpose}} |
|
|
66
|
+
</workflows_index>
|
|
67
|
+
|
|
68
|
+
<success_criteria>
|
|
69
|
+
A well-executed {{skill name}}:
|
|
70
|
+
- {{First criterion}}
|
|
71
|
+
- {{Second criterion}}
|
|
72
|
+
- {{Third criterion}}
|
|
73
|
+
</success_criteria>
|