foliko 1.0.85 → 1.0.87
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/agents/code-assistant.json +14 -0
- package/.agent/agents/email-assistant.json +14 -0
- package/.agent/agents/file-assistant.json +15 -0
- package/.agent/agents/system-assistant.json +15 -0
- package/.agent/agents/web-assistant.json +12 -0
- package/.agent/data/ambient/goals.json +50 -0
- package/.agent/data/ambient/memories.json +7 -0
- package/.agent/data/default.json +21 -311
- package/.agent/data/plugins-state.json +162 -174
- package/.agent/data/scheduler/tasks.json +1 -0
- package/.agent/data/weixin.json +6 -0
- package/.agent/mcp_config.json +1 -0
- package/.agent/package.json +8 -0
- package/.agent/plugins/__pycache__/test_plugin.cpython-312.pyc +0 -0
- package/.agent/plugins/daytona/README.md +89 -0
- package/.agent/plugins/daytona/index.js +377 -0
- package/.agent/plugins/daytona/package.json +12 -0
- package/.agent/plugins/marknative/README.md +134 -0
- package/.agent/plugins/marknative/index.js +228 -0
- package/.agent/plugins/marknative/package.json +12 -0
- package/.agent/plugins/marknative/update-readme.js +134 -0
- package/.agent/plugins/system-info/index.js +387 -0
- package/.agent/plugins/system-info/package.json +4 -0
- package/.agent/plugins/system-info/test.js +40 -0
- package/.agent/plugins/temp-repo/LICENSE +201 -0
- package/.agent/plugins/test_plugin.py +304 -0
- package/.agent/plugins.json +14 -5
- package/.agent/python-scripts/test_sample.py +24 -0
- package/.agent/skills/agent-browser/SKILL.md +311 -0
- package/.agent/skills/agent-browser/TEST_PLAN.md +200 -0
- package/.agent/skills/sysinfo/SKILL.md +38 -0
- package/.agent/skills/sysinfo/system-info.sh +130 -0
- package/.agent/skills/workflow/SKILL.md +324 -0
- package/.agent/workflows/email-digest.json +50 -0
- package/.agent/workflows/file-backup.json +21 -0
- package/.agent/workflows/get-ip-notify.json +32 -0
- package/.agent/workflows/news-aggregator.json +93 -0
- package/.agent/workflows/news-dashboard-v2.json +94 -0
- package/.agent/workflows/notification-batch.json +32 -0
- package/.claude/settings.local.json +8 -7
- package/.env.example +56 -56
- package/README.md +441 -441
- package/examples/test-chat-debug.js +102 -0
- package/examples/test-chat-result.js +76 -0
- package/examples/test-chat-stream-diff.js +63 -0
- package/examples/test-concurrent-chat.js +60 -0
- package/examples/test-long-chat.js +77 -0
- package/examples/test-session-chat.js +93 -0
- package/package.json +2 -2
- package/plugins/ambient-agent/EventWatcher.js +4 -4
- package/plugins/extension-executor-plugin.js +44 -1
- package/plugins/file-system-plugin.js +44 -5
- package/plugins/session-plugin.js +21 -0
- package/plugins/weixin-plugin.js +278 -29
- package/skills/find-skills/AGENTS.md +162 -162
- package/skills/find-skills/SKILL.md +133 -133
- package/skills/foliko-dev/SKILL.md +67 -0
- package/skills/python-plugin-dev/SKILL.md +238 -238
- package/src/core/agent-chat.js +106 -58
- package/src/core/agent.js +3 -61
- package/src/utils/index.js +1 -1
- package/.agent/.shared/ui-ux-pro-max/data/charts.csv +0 -26
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +0 -97
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +0 -101
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +0 -31
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +0 -97
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +0 -24
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +0 -45
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +0 -53
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +0 -56
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +0 -53
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +0 -53
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +0 -51
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +0 -59
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +0 -52
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +0 -54
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +0 -61
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +0 -54
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +0 -51
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +0 -50
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +0 -59
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +0 -58
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +0 -31
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +0 -258
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +0 -1067
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +0 -106
- package/.agent/ARCHITECTURE.md +0 -288
- package/.agent/agents/ambient-agent.md +0 -57
- package/.agent/agents/debugger.md +0 -55
- package/.agent/agents/email-assistant.md +0 -49
- package/.agent/agents/file-manager.md +0 -42
- package/.agent/agents/python-developer.md +0 -60
- package/.agent/agents/scheduler.md +0 -59
- package/.agent/agents/web-developer.md +0 -45
- package/.agent/data/puppeteer-sessions/undefined.json +0 -6
- package/.agent/mcp_config_updated.json +0 -12
- package/.agent/rules/GEMINI.md +0 -273
- package/.agent/rules/allow-rule.md +0 -77
- package/.agent/rules/log-rule.md +0 -83
- package/.agent/rules/security-rule.md +0 -93
- package/.agent/scripts/auto_preview.py +0 -148
- package/.agent/scripts/checklist.py +0 -217
- package/.agent/scripts/session_manager.py +0 -120
- package/.agent/scripts/verify_all.py +0 -327
- package/.agent/skills/api-patterns/SKILL.md +0 -81
- package/.agent/skills/api-patterns/api-style.md +0 -42
- package/.agent/skills/api-patterns/auth.md +0 -24
- package/.agent/skills/api-patterns/documentation.md +0 -26
- package/.agent/skills/api-patterns/graphql.md +0 -41
- package/.agent/skills/api-patterns/rate-limiting.md +0 -31
- package/.agent/skills/api-patterns/response.md +0 -37
- package/.agent/skills/api-patterns/rest.md +0 -40
- package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
- package/.agent/skills/api-patterns/security-testing.md +0 -122
- package/.agent/skills/api-patterns/trpc.md +0 -41
- package/.agent/skills/api-patterns/versioning.md +0 -22
- package/.agent/skills/app-builder/SKILL.md +0 -75
- package/.agent/skills/app-builder/agent-coordination.md +0 -71
- package/.agent/skills/app-builder/feature-building.md +0 -53
- package/.agent/skills/app-builder/project-detection.md +0 -34
- package/.agent/skills/app-builder/scaffolding.md +0 -118
- package/.agent/skills/app-builder/tech-stack.md +0 -40
- package/.agent/skills/app-builder/templates/SKILL.md +0 -39
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -122
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -122
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -169
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -134
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -119
- package/.agent/skills/architecture/SKILL.md +0 -55
- package/.agent/skills/architecture/context-discovery.md +0 -43
- package/.agent/skills/architecture/examples.md +0 -94
- package/.agent/skills/architecture/pattern-selection.md +0 -68
- package/.agent/skills/architecture/patterns-reference.md +0 -50
- package/.agent/skills/architecture/trade-off-analysis.md +0 -77
- package/.agent/skills/clean-code/SKILL.md +0 -201
- package/.agent/skills/doc.md +0 -177
- package/.agent/skills/frontend-design/SKILL.md +0 -418
- package/.agent/skills/frontend-design/animation-guide.md +0 -331
- package/.agent/skills/frontend-design/color-system.md +0 -311
- package/.agent/skills/frontend-design/decision-trees.md +0 -418
- package/.agent/skills/frontend-design/motion-graphics.md +0 -306
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
- package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
- package/.agent/skills/frontend-design/typography-system.md +0 -345
- package/.agent/skills/frontend-design/ux-psychology.md +0 -1116
- package/.agent/skills/frontend-design/visual-effects.md +0 -383
- package/.agent/skills/i18n-localization/SKILL.md +0 -154
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/.agent/skills/mcp-builder/SKILL.md +0 -176
- package/.agent/skills/web-design-guidelines/SKILL.md +0 -57
- package/.agent/workflows/brainstorm.md +0 -113
- package/.agent/workflows/create.md +0 -59
- package/.agent/workflows/debug.md +0 -103
- package/.agent/workflows/deploy.md +0 -176
- package/.agent/workflows/enhance.md +0 -63
- package/.agent/workflows/orchestrate.md +0 -237
- package/.agent/workflows/plan.md +0 -89
- package/.agent/workflows/preview.md +0 -81
- package/.agent/workflows/simple-test.md +0 -42
- package/.agent/workflows/status.md +0 -86
- package/.agent/workflows/structured-orchestrate.md +0 -180
- package/.agent/workflows/test.md +0 -144
- package/.agent/workflows/ui-ux-pro-max.md +0 -296
- /package/.agent/plugins/{puppeteer-plugin → temp-repo/puppeteer-plugin}/README.md +0 -0
- /package/.agent/plugins/{puppeteer-plugin → temp-repo/puppeteer-plugin}/index.js +0 -0
- /package/.agent/plugins/{puppeteer-plugin → temp-repo/puppeteer-plugin}/package.json +0 -0
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: clean-code
|
|
3
|
-
description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
|
|
4
|
-
allowed-tools: Read, Write, Edit
|
|
5
|
-
version: 2.0
|
|
6
|
-
priority: CRITICAL
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Clean Code - Pragmatic AI Coding Standards
|
|
10
|
-
|
|
11
|
-
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Core Principles
|
|
16
|
-
|
|
17
|
-
| Principle | Rule |
|
|
18
|
-
|-----------|------|
|
|
19
|
-
| **SRP** | Single Responsibility - each function/class does ONE thing |
|
|
20
|
-
| **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
|
|
21
|
-
| **KISS** | Keep It Simple - simplest solution that works |
|
|
22
|
-
| **YAGNI** | You Aren't Gonna Need It - don't build unused features |
|
|
23
|
-
| **Boy Scout** | Leave code cleaner than you found it |
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Naming Rules
|
|
28
|
-
|
|
29
|
-
| Element | Convention |
|
|
30
|
-
|---------|------------|
|
|
31
|
-
| **Variables** | Reveal intent: `userCount` not `n` |
|
|
32
|
-
| **Functions** | Verb + noun: `getUserById()` not `user()` |
|
|
33
|
-
| **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
|
|
34
|
-
| **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
|
|
35
|
-
|
|
36
|
-
> **Rule:** If you need a comment to explain a name, rename it.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Function Rules
|
|
41
|
-
|
|
42
|
-
| Rule | Description |
|
|
43
|
-
|------|-------------|
|
|
44
|
-
| **Small** | Max 20 lines, ideally 5-10 |
|
|
45
|
-
| **One Thing** | Does one thing, does it well |
|
|
46
|
-
| **One Level** | One level of abstraction per function |
|
|
47
|
-
| **Few Args** | Max 3 arguments, prefer 0-2 |
|
|
48
|
-
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Code Structure
|
|
53
|
-
|
|
54
|
-
| Pattern | Apply |
|
|
55
|
-
|---------|-------|
|
|
56
|
-
| **Guard Clauses** | Early returns for edge cases |
|
|
57
|
-
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
58
|
-
| **Composition** | Small functions composed together |
|
|
59
|
-
| **Colocation** | Keep related code close |
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## AI Coding Style
|
|
64
|
-
|
|
65
|
-
| Situation | Action |
|
|
66
|
-
|-----------|--------|
|
|
67
|
-
| User asks for feature | Write it directly |
|
|
68
|
-
| User reports bug | Fix it, don't explain |
|
|
69
|
-
| No clear requirement | Ask, don't assume |
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Anti-Patterns (DON'T)
|
|
74
|
-
|
|
75
|
-
| ❌ Pattern | ✅ Fix |
|
|
76
|
-
|-----------|-------|
|
|
77
|
-
| Comment every line | Delete obvious comments |
|
|
78
|
-
| Helper for one-liner | Inline the code |
|
|
79
|
-
| Factory for 2 objects | Direct instantiation |
|
|
80
|
-
| utils.ts with 1 function | Put code where used |
|
|
81
|
-
| "First we import..." | Just write code |
|
|
82
|
-
| Deep nesting | Guard clauses |
|
|
83
|
-
| Magic numbers | Named constants |
|
|
84
|
-
| God functions | Split by responsibility |
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## 🔴 Before Editing ANY File (THINK FIRST!)
|
|
89
|
-
|
|
90
|
-
**Before changing a file, ask yourself:**
|
|
91
|
-
|
|
92
|
-
| Question | Why |
|
|
93
|
-
|----------|-----|
|
|
94
|
-
| **What imports this file?** | They might break |
|
|
95
|
-
| **What does this file import?** | Interface changes |
|
|
96
|
-
| **What tests cover this?** | Tests might fail |
|
|
97
|
-
| **Is this a shared component?** | Multiple places affected |
|
|
98
|
-
|
|
99
|
-
**Quick Check:**
|
|
100
|
-
```
|
|
101
|
-
File to edit: UserService.ts
|
|
102
|
-
└── Who imports this? → UserController.ts, AuthController.ts
|
|
103
|
-
└── Do they need changes too? → Check function signatures
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
> 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
|
|
107
|
-
> 🔴 **Never leave broken imports or missing updates.**
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Summary
|
|
112
|
-
|
|
113
|
-
| Do | Don't |
|
|
114
|
-
|----|-------|
|
|
115
|
-
| Write code directly | Write tutorials |
|
|
116
|
-
| Let code self-document | Add obvious comments |
|
|
117
|
-
| Fix bugs immediately | Explain the fix first |
|
|
118
|
-
| Inline small things | Create unnecessary files |
|
|
119
|
-
| Name things clearly | Use abbreviations |
|
|
120
|
-
| Keep functions small | Write 100+ line functions |
|
|
121
|
-
|
|
122
|
-
> **Remember: The user wants working code, not a programming lesson.**
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## 🔴 Self-Check Before Completing (MANDATORY)
|
|
127
|
-
|
|
128
|
-
**Before saying "task complete", verify:**
|
|
129
|
-
|
|
130
|
-
| Check | Question |
|
|
131
|
-
|-------|----------|
|
|
132
|
-
| ✅ **Goal met?** | Did I do exactly what user asked? |
|
|
133
|
-
| ✅ **Files edited?** | Did I modify all necessary files? |
|
|
134
|
-
| ✅ **Code works?** | Did I test/verify the change? |
|
|
135
|
-
| ✅ **No errors?** | Lint and TypeScript pass? |
|
|
136
|
-
| ✅ **Nothing forgotten?** | Any edge cases missed? |
|
|
137
|
-
|
|
138
|
-
> 🔴 **Rule:** If ANY check fails, fix it before completing.
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## Verification Scripts (MANDATORY)
|
|
143
|
-
|
|
144
|
-
> 🔴 **CRITICAL:** Each agent runs ONLY their own skill's scripts after completing work.
|
|
145
|
-
|
|
146
|
-
### Agent → Script Mapping
|
|
147
|
-
|
|
148
|
-
| Agent | Script | Command |
|
|
149
|
-
|-------|--------|---------|
|
|
150
|
-
| **frontend-specialist** | UX Audit | `python .agent/skills/frontend-design/scripts/ux_audit.py .` |
|
|
151
|
-
| **frontend-specialist** | A11y Check | `python .agent/skills/frontend-design/scripts/accessibility_checker.py .` |
|
|
152
|
-
| **backend-specialist** | API Validator | `python .agent/skills/api-patterns/scripts/api_validator.py .` |
|
|
153
|
-
| **mobile-developer** | Mobile Audit | `python .agent/skills/mobile-design/scripts/mobile_audit.py .` |
|
|
154
|
-
| **database-architect** | Schema Validate | `python .agent/skills/database-design/scripts/schema_validator.py .` |
|
|
155
|
-
| **security-auditor** | Security Scan | `python .agent/skills/vulnerability-scanner/scripts/security_scan.py .` |
|
|
156
|
-
| **seo-specialist** | SEO Check | `python .agent/skills/seo-fundamentals/scripts/seo_checker.py .` |
|
|
157
|
-
| **seo-specialist** | GEO Check | `python .agent/skills/geo-fundamentals/scripts/geo_checker.py .` |
|
|
158
|
-
| **performance-optimizer** | Lighthouse | `python .agent/skills/performance-profiling/scripts/lighthouse_audit.py <url>` |
|
|
159
|
-
| **test-engineer** | Test Runner | `python .agent/skills/testing-patterns/scripts/test_runner.py .` |
|
|
160
|
-
| **test-engineer** | Playwright | `python .agent/skills/webapp-testing/scripts/playwright_runner.py <url>` |
|
|
161
|
-
| **Any agent** | Lint Check | `python .agent/skills/lint-and-validate/scripts/lint_runner.py .` |
|
|
162
|
-
| **Any agent** | Type Coverage | `python .agent/skills/lint-and-validate/scripts/type_coverage.py .` |
|
|
163
|
-
| **Any agent** | i18n Check | `python .agent/skills/i18n-localization/scripts/i18n_checker.py .` |
|
|
164
|
-
|
|
165
|
-
> ❌ **WRONG:** `test-engineer` running `ux_audit.py`
|
|
166
|
-
> ✅ **CORRECT:** `frontend-specialist` running `ux_audit.py`
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
### 🔴 Script Output Handling (READ → SUMMARIZE → ASK)
|
|
171
|
-
|
|
172
|
-
**When running a validation script, you MUST:**
|
|
173
|
-
|
|
174
|
-
1. **Run the script** and capture ALL output
|
|
175
|
-
2. **Parse the output** - identify errors, warnings, and passes
|
|
176
|
-
3. **Summarize to user** in this format:
|
|
177
|
-
|
|
178
|
-
```markdown
|
|
179
|
-
## Script Results: [script_name.py]
|
|
180
|
-
|
|
181
|
-
### ❌ Errors Found (X items)
|
|
182
|
-
- [File:Line] Error description 1
|
|
183
|
-
- [File:Line] Error description 2
|
|
184
|
-
|
|
185
|
-
### ⚠️ Warnings (Y items)
|
|
186
|
-
- [File:Line] Warning description
|
|
187
|
-
|
|
188
|
-
### ✅ Passed (Z items)
|
|
189
|
-
- Check 1 passed
|
|
190
|
-
- Check 2 passed
|
|
191
|
-
|
|
192
|
-
**Should I fix the X errors?**
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
4. **Wait for user confirmation** before fixing
|
|
196
|
-
5. **After fixing** → Re-run script to confirm
|
|
197
|
-
|
|
198
|
-
> 🔴 **VIOLATION:** Running script and ignoring output = FAILED task.
|
|
199
|
-
> 🔴 **VIOLATION:** Auto-fixing without asking = Not allowed.
|
|
200
|
-
> 🔴 **Rule:** Always READ output → SUMMARIZE → ASK → then fix.
|
|
201
|
-
|
package/.agent/skills/doc.md
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# Antigravity Skills
|
|
2
|
-
|
|
3
|
-
> **Guide to creating and using Skills in the Antigravity Kit**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 📋 Overview
|
|
8
|
-
|
|
9
|
-
While Antigravity's base models (like Gemini) are powerful generalists, they don't know your specific project context or your team's standards. Loading every rule or tool into the agent's context window leads to "tool bloat," higher costs, latency, and confusion.
|
|
10
|
-
|
|
11
|
-
**Antigravity Skills** solve this through **Progressive Disclosure**. A Skill is a package of specialized knowledge that remains dormant until needed. This information is only loaded into the agent's context when your specific request matches the skill's description.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 📁 Structure and Scope
|
|
16
|
-
|
|
17
|
-
Skills are folder-based packages. You can define these scopes based on your needs:
|
|
18
|
-
|
|
19
|
-
| Scope | Path | Description |
|
|
20
|
-
| ------------- | --------------------------------- | ------------------------------------ |
|
|
21
|
-
| **Workspace** | `<workspace-root>/.agent/skills/` | Available only in a specific project |
|
|
22
|
-
|
|
23
|
-
### Skill Directory Structure
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
my-skill/
|
|
27
|
-
├── SKILL.md # (Required) Metadata & instructions
|
|
28
|
-
├── scripts/ # (Optional) Python or Bash scripts
|
|
29
|
-
├── references/ # (Optional) Text, documentation, templates
|
|
30
|
-
└── assets/ # (Optional) Images or logos
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 🔍 Example 1: Code Review Skill
|
|
36
|
-
|
|
37
|
-
This is an instruction-only skill; you only need to create the `SKILL.md` file.
|
|
38
|
-
|
|
39
|
-
### Step 1: Create the directory
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
mkdir -p .agent/skills/code-review
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Step 2: Create SKILL.md
|
|
46
|
-
|
|
47
|
-
```markdown
|
|
48
|
-
---
|
|
49
|
-
name: code-review
|
|
50
|
-
description: Reviews code changes for bugs, style issues, and best practices. Use when reviewing PRs or checking code quality.
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
# Code Review Skill
|
|
54
|
-
|
|
55
|
-
When reviewing code, follow these steps:
|
|
56
|
-
|
|
57
|
-
## Review checklist
|
|
58
|
-
|
|
59
|
-
1. **Correctness**: Does the code do what it's supposed to?
|
|
60
|
-
2. **Edge cases**: Are error conditions handled?
|
|
61
|
-
3. **Style**: Does it follow project conventions?
|
|
62
|
-
4. **Performance**: Are there obvious inefficiencies?
|
|
63
|
-
|
|
64
|
-
## How to provide feedback
|
|
65
|
-
|
|
66
|
-
- Be specific about what needs to change
|
|
67
|
-
- Explain why, not just what
|
|
68
|
-
- Suggest alternatives when possible
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
> **Note**: The `SKILL.md` file contains metadata (name, description) at the top, followed by the instructions. The agent will only read the metadata and load the full instructions only when needed.
|
|
72
|
-
|
|
73
|
-
### Try it out
|
|
74
|
-
|
|
75
|
-
Create a file `demo_bad_code.py`:
|
|
76
|
-
|
|
77
|
-
```python
|
|
78
|
-
import time
|
|
79
|
-
|
|
80
|
-
def get_user_data(users, id):
|
|
81
|
-
# Find user by ID
|
|
82
|
-
for u in users:
|
|
83
|
-
if u['id'] == id:
|
|
84
|
-
return u
|
|
85
|
-
return None
|
|
86
|
-
|
|
87
|
-
def process_payments(items):
|
|
88
|
-
total = 0
|
|
89
|
-
for i in items:
|
|
90
|
-
# Calculate tax
|
|
91
|
-
tax = i['price'] * 0.1
|
|
92
|
-
total = total + i['price'] + tax
|
|
93
|
-
time.sleep(0.1) # Simulate slow network call
|
|
94
|
-
return total
|
|
95
|
-
|
|
96
|
-
def run_batch():
|
|
97
|
-
users = [{'id': 1, 'name': 'Alice'}, {'id': 2, 'name': 'Bob'}]
|
|
98
|
-
items = [{'price': 10}, {'price': 20}, {'price': 100}]
|
|
99
|
-
|
|
100
|
-
u = get_user_data(users, 3)
|
|
101
|
-
print("User found: " + u['name']) # Will crash if None
|
|
102
|
-
|
|
103
|
-
print("Total: " + str(process_payments(items)))
|
|
104
|
-
|
|
105
|
-
if __name__ == "__main__":
|
|
106
|
-
run_batch()
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
**Prompt**: `review the @demo_bad_code.py file`
|
|
110
|
-
|
|
111
|
-
The Agent will automatically identify the `code-review` skill, load the information, and follow the instructions.
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## 📄 Example 2: License Header Skill
|
|
116
|
-
|
|
117
|
-
This skill uses a reference file in the `resources/` (or `references/`) directory.
|
|
118
|
-
|
|
119
|
-
### Step 1: Create the directory
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
mkdir -p .agent/skills/license-header-adder/resources
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Step 2: Create the template file
|
|
126
|
-
|
|
127
|
-
**`.agent/skills/license-header-adder/resources/HEADER.txt`**:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
/*
|
|
131
|
-
* Copyright (c) 2026 YOUR_COMPANY_NAME LLC.
|
|
132
|
-
* All rights reserved.
|
|
133
|
-
* This code is proprietary and confidential.
|
|
134
|
-
*/
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Step 3: Create SKILL.md
|
|
138
|
-
|
|
139
|
-
**`.agent/skills/license-header-adder/SKILL.md`**:
|
|
140
|
-
|
|
141
|
-
```markdown
|
|
142
|
-
---
|
|
143
|
-
name: license-header-adder
|
|
144
|
-
description: Adds the standard corporate license header to new source files.
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
# License Header Adder
|
|
148
|
-
|
|
149
|
-
This skill ensures that all new source files have the correct copyright header.
|
|
150
|
-
|
|
151
|
-
## Instructions
|
|
152
|
-
|
|
153
|
-
1. **Read the Template**: Read the content of `resources/HEADER.txt`.
|
|
154
|
-
2. **Apply to File**: When creating a new file, prepend this exact content.
|
|
155
|
-
3. **Adapt Syntax**:
|
|
156
|
-
- For C-style languages (Java, TS), keep the `/* */` block.
|
|
157
|
-
- For Python/Shell, convert to `#` comments.
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Try it out
|
|
161
|
-
|
|
162
|
-
**Prompt**: `Create a new Python script named data_processor.py that prints 'Hello World'.`
|
|
163
|
-
|
|
164
|
-
The Agent will read the template, convert the comments to Python style, and automatically add it to the top of the file.
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## 🎯 Conclusion
|
|
169
|
-
|
|
170
|
-
By creating Skills, you transform a general AI model into an expert for your project:
|
|
171
|
-
|
|
172
|
-
- ✅ Systematize best practices
|
|
173
|
-
- ✅ Adhere to code review rules
|
|
174
|
-
- ✅ Automatically add license headers
|
|
175
|
-
- ✅ The Agent automatically knows how to work with your team
|
|
176
|
-
|
|
177
|
-
Instead of constantly reminding the AI to "remember to add the license" or "fix the commit format," now the Agent will do it automatically!
|