takomi 2.1.13 → 2.1.15
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/.pi/agents/architect.md +73 -73
- package/.pi/agents/coder.md +70 -70
- package/.pi/agents/designer.md +72 -72
- package/.pi/agents/orchestrator.md +122 -122
- package/.pi/agents/reviewer.md +71 -71
- package/.pi/extensions/oauth-router/provider.ts +3 -1
- package/.pi/extensions/takomi-context-manager/config.ts +48 -48
- package/.pi/extensions/takomi-context-manager/context-router.ts +57 -57
- package/.pi/extensions/takomi-context-manager/diagnostics-tools.ts +28 -28
- package/.pi/extensions/takomi-context-manager/diagnostics.ts +55 -55
- package/.pi/extensions/takomi-context-manager/extension-conflicts.ts +56 -56
- package/.pi/extensions/takomi-context-manager/index.ts +56 -56
- package/.pi/extensions/takomi-context-manager/model-policy-gate.ts +228 -206
- package/.pi/extensions/takomi-context-manager/policy-registry.ts +97 -97
- package/.pi/extensions/takomi-context-manager/policy-tools.ts +35 -35
- package/.pi/extensions/takomi-context-manager/prerequisite-gates.ts +39 -39
- package/.pi/extensions/takomi-context-manager/prompt-rewriter.ts +100 -100
- package/.pi/extensions/takomi-context-manager/skill-registry.ts +87 -87
- package/.pi/extensions/takomi-context-manager/skill-tools.ts +80 -80
- package/.pi/extensions/takomi-context-manager/state.ts +68 -68
- package/.pi/extensions/takomi-context-manager/types.ts +77 -77
- package/.pi/extensions/takomi-runtime/command-text.ts +10 -2
- package/.pi/extensions/takomi-runtime/commands.ts +78 -5
- package/.pi/extensions/takomi-runtime/routing-policy.ts +187 -145
- package/.pi/extensions/takomi-subagents/native-render.ts +41 -41
- package/.pi/extensions/takomi-subagents/pi-subagents-internal.ts +35 -32
- package/.pi/extensions/takomi-subagents/run-types.ts +25 -25
- package/.pi/prompts/build-prompt.md +259 -259
- package/.pi/prompts/design-prompt.md +95 -95
- package/.pi/prompts/genesis-prompt.md +140 -140
- package/.pi/prompts/prime-prompt.md +110 -110
- package/.pi/themes/takomi-aurora.json +88 -88
- package/README.md +2 -4
- package/assets/.agent/skills/21st-dev-components/SKILL.md +244 -244
- package/assets/.agent/skills/anti-gravity/SKILL.md +112 -0
- package/assets/.agent/skills/gemini/SKILL.md +14 -223
- package/assets/.agent/skills/git-commit-generation/SKILL.md +195 -0
- package/package.json +1 -1
- package/src/pi-takomi-core/validation.ts +135 -135
|
@@ -1,244 +1,244 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: 21st-dev-components
|
|
3
|
-
description: Use when the user wants to build a React site or app section from 21st.dev components, clone the structure of a reference site with 21st.dev building blocks, browse 21st.dev manually and return copied prompts/code, or says things like "build me a site like this", "use 21st.dev", "copy prompt", "component URL", "hero from 21st", or "match this landing page with ready-made components".
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# 21st.dev Reference-to-Component Skill
|
|
7
|
-
|
|
8
|
-
This skill routes between two flows:
|
|
9
|
-
|
|
10
|
-
- **Auto mode**: the user provides a reference site URL and wants the agent to inspect it, infer the required sections, choose matching 21st.dev components automatically, and integrate them.
|
|
11
|
-
- **Manual mode**: the user wants guided collection. The agent lists the sections, tells the user what to fetch from 21st.dev, then integrates the returned handoff.
|
|
12
|
-
|
|
13
|
-
Use this skill only for **React-family** projects. If the repo is not React-based, explain that v1 of this skill is React-only and stop.
|
|
14
|
-
|
|
15
|
-
## Bundled Resources
|
|
16
|
-
|
|
17
|
-
- `references/categories.md`
|
|
18
|
-
Use for section-to-category mapping and direct 21st.dev category URLs.
|
|
19
|
-
- `references/manual-handoff-template.md`
|
|
20
|
-
Use when the user is gathering components manually.
|
|
21
|
-
- `references/section-detection-rubric.md`
|
|
22
|
-
Use during Auto mode after crawling the reference site.
|
|
23
|
-
- `scripts/resolve-21st-component.mjs`
|
|
24
|
-
Resolve a 21st.dev component page into normalized metadata.
|
|
25
|
-
- `scripts/fetch-21st-source.mjs`
|
|
26
|
-
Fetch raw source from 21st CDN URLs.
|
|
27
|
-
- `scripts/build-manual-handoff-template.mjs`
|
|
28
|
-
Generate a manual handoff markdown file for the user.
|
|
29
|
-
|
|
30
|
-
## Raw Code Resolution Standard
|
|
31
|
-
|
|
32
|
-
Do not derive 21st.dev CDN source URLs by string concatenation or by manually modifying the community page URL.
|
|
33
|
-
|
|
34
|
-
Always treat the user-facing 21st.dev component page as the source of truth, then resolve it into metadata before fetching code.
|
|
35
|
-
|
|
36
|
-
### Required workflow
|
|
37
|
-
1. Start with the 21st.dev community component URL.
|
|
38
|
-
2. Run the resolver script on that page URL.
|
|
39
|
-
3. Read `codeUrl` and `demoCodeUrl` from the resolver output.
|
|
40
|
-
4. Fetch source from those returned URLs.
|
|
41
|
-
5. Only fall back to manual copy/paste if resolution succeeds but raw source cannot be fetched in the current environment.
|
|
42
|
-
|
|
43
|
-
### Command
|
|
44
|
-
```bash
|
|
45
|
-
node scripts/resolve-21st-component.mjs --url "<21st-component-url>" --json
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Why this rule exists
|
|
49
|
-
21st.dev community URLs do not always map cleanly to CDN paths. Mismatches can include:
|
|
50
|
-
- author slug differences between page URL and CDN path
|
|
51
|
-
- internal user IDs in CDN paths instead of public author names
|
|
52
|
-
- timestamped filenames such as `code.1748367465506.tsx`
|
|
53
|
-
- version query params such as `?v=1`
|
|
54
|
-
- demo paths that are not reliably predictable
|
|
55
|
-
|
|
56
|
-
Because of this, the correct standard is:
|
|
57
|
-
|
|
58
|
-
**community page URL -> resolve metadata -> fetch `codeUrl` / `demoCodeUrl`**
|
|
59
|
-
|
|
60
|
-
not:
|
|
61
|
-
|
|
62
|
-
**community page URL -> manually transform into CDN URL**
|
|
63
|
-
|
|
64
|
-
### Manual fallback rule
|
|
65
|
-
If the resolver returns metadata but the environment cannot fetch the raw source files, ask the user for one of these:
|
|
66
|
-
- pasted code from the 21st.dev Copy Code action
|
|
67
|
-
- downloaded component source
|
|
68
|
-
- permission to use an alternate environment that can fetch the returned CDN URLs
|
|
69
|
-
|
|
70
|
-
This resolution step is mandatory in both Auto mode and Manual mode whenever the environment allows it.
|
|
71
|
-
|
|
72
|
-
## Mode Router
|
|
73
|
-
|
|
74
|
-
### Use Auto mode when
|
|
75
|
-
|
|
76
|
-
- The user gives a live reference site URL.
|
|
77
|
-
- The user says "build me something like this", "clone this layout", or "crawl this site and rebuild it".
|
|
78
|
-
- The user expects the agent to choose components automatically.
|
|
79
|
-
|
|
80
|
-
### Use Manual mode when
|
|
81
|
-
|
|
82
|
-
- The user says they will browse 21st.dev themselves.
|
|
83
|
-
- The user pastes 21st.dev component URLs, copied prompts, code fences, or a markdown handoff file.
|
|
84
|
-
- The user wants the agent to tell them exactly what sections to gather.
|
|
85
|
-
|
|
86
|
-
If Auto mode fails because the site is blocked, brittle, or the 21st lookup is weak, fall back to Manual mode immediately and generate the handoff template instead of dead-ending.
|
|
87
|
-
|
|
88
|
-
## Auto Mode Workflow
|
|
89
|
-
|
|
90
|
-
### Step 1: Crawl the reference site in a browser
|
|
91
|
-
|
|
92
|
-
Use the browser-first workflow from the `webapp-testing` skill. Do not rely only on raw HTML if the page is clearly client-rendered.
|
|
93
|
-
|
|
94
|
-
What to inspect:
|
|
95
|
-
- header / navbar / announcement bars
|
|
96
|
-
- hero block
|
|
97
|
-
- feature grids or card rows
|
|
98
|
-
- social proof / logos
|
|
99
|
-
- testimonials
|
|
100
|
-
- pricing
|
|
101
|
-
- FAQ
|
|
102
|
-
- forms / auth blocks
|
|
103
|
-
- footer
|
|
104
|
-
- app shell elements such as sidebar, table, tabs, or modals
|
|
105
|
-
|
|
106
|
-
Load `references/section-detection-rubric.md` if the page structure is not obvious.
|
|
107
|
-
|
|
108
|
-
### Step 2: Build a page anatomy model
|
|
109
|
-
|
|
110
|
-
Write down the major sections in visual order. For each section, capture:
|
|
111
|
-
- section name
|
|
112
|
-
- rough structure
|
|
113
|
-
- visual tone
|
|
114
|
-
- obvious dependencies such as carousels, motion, video, maps, charts, or forms
|
|
115
|
-
|
|
116
|
-
### Step 3: Map sections to 21st.dev categories
|
|
117
|
-
|
|
118
|
-
Load `references/categories.md` and map each detected section to one or more category slugs.
|
|
119
|
-
|
|
120
|
-
Rules:
|
|
121
|
-
- Match structure first, style second.
|
|
122
|
-
- Use one primary category and optional supporting categories.
|
|
123
|
-
- Decorative elements like shaders, backgrounds, or borders are secondary, not the main section match.
|
|
124
|
-
|
|
125
|
-
### Step 4: Discover and resolve candidate components
|
|
126
|
-
|
|
127
|
-
Search 21st.dev for each mapped category. Once you have likely component URLs:
|
|
128
|
-
|
|
129
|
-
1. Resolve each page:
|
|
130
|
-
```bash
|
|
131
|
-
node scripts/resolve-21st-component.mjs --url "<21st-component-url>" --json
|
|
132
|
-
```
|
|
133
|
-
2. Inspect:
|
|
134
|
-
- dependency count
|
|
135
|
-
- component/demo CDN URLs
|
|
136
|
-
- tags
|
|
137
|
-
- author
|
|
138
|
-
- registry dependency hints
|
|
139
|
-
|
|
140
|
-
### Step 5: Choose the best match automatically
|
|
141
|
-
|
|
142
|
-
Default behavior is **not** to ask the user to choose.
|
|
143
|
-
|
|
144
|
-
Prefer:
|
|
145
|
-
- closest structural match
|
|
146
|
-
- lowest dependency burden
|
|
147
|
-
- compatibility with the current repo
|
|
148
|
-
- easier adaptation to the existing styling system
|
|
149
|
-
|
|
150
|
-
### Step 6: Fetch source and integrate
|
|
151
|
-
|
|
152
|
-
Fetch component/demo source from the resolved `codeUrl` and `demoCodeUrl` values. Do not guess CDN paths manually.
|
|
153
|
-
|
|
154
|
-
Fetch component/demo source from CDN URLs:
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
node scripts/fetch-21st-source.mjs --url "<code-url>" --url "<demo-code-url>" --out-dir tmp/21st
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Then integrate into the repo:
|
|
161
|
-
- adapt file paths to the existing project structure
|
|
162
|
-
- prefer the repo's current component locations
|
|
163
|
-
- prefer existing Tailwind, TypeScript, and shadcn conventions when present
|
|
164
|
-
- if shadcn conventions are absent, adapt rather than forcing `/components/ui`
|
|
165
|
-
- if required dependencies or setup are missing, install/configure them first
|
|
166
|
-
|
|
167
|
-
### Step 7: Report what was selected
|
|
168
|
-
|
|
169
|
-
When you finish, state:
|
|
170
|
-
- which sections were detected
|
|
171
|
-
- which 21st.dev components were selected
|
|
172
|
-
- which dependencies were added
|
|
173
|
-
- any sections that required partial custom adaptation
|
|
174
|
-
|
|
175
|
-
## Manual Mode Workflow
|
|
176
|
-
|
|
177
|
-
### Step 1: Break the page into sections
|
|
178
|
-
|
|
179
|
-
Identify the target sections from the user's request or reference URL:
|
|
180
|
-
- header / navbar
|
|
181
|
-
- hero
|
|
182
|
-
- features
|
|
183
|
-
- testimonials
|
|
184
|
-
- pricing
|
|
185
|
-
- footer
|
|
186
|
-
- sidebar
|
|
187
|
-
- CTA
|
|
188
|
-
- forms
|
|
189
|
-
- tables
|
|
190
|
-
- auth
|
|
191
|
-
- FAQ
|
|
192
|
-
|
|
193
|
-
### Step 2: Tell the user what to collect
|
|
194
|
-
|
|
195
|
-
Use `references/categories.md` to give the exact 21st.dev category links.
|
|
196
|
-
|
|
197
|
-
Generate a checklist file when useful:
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
node scripts/build-manual-handoff-template.mjs --sections "header,hero,features,pricing,footer" --out 21st-handoff.md
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Point the user at the template in `references/manual-handoff-template.md` if they want to paste directly in chat instead of using a file.
|
|
204
|
-
|
|
205
|
-
### Step 3: Accept one combined handoff
|
|
206
|
-
|
|
207
|
-
The handoff can contain:
|
|
208
|
-
- 21st.dev URLs
|
|
209
|
-
- copied prompt blocks
|
|
210
|
-
- code fences
|
|
211
|
-
- dependency lists
|
|
212
|
-
- placement notes
|
|
213
|
-
|
|
214
|
-
Do not make the user re-explain the same page structure if the handoff already contains it.
|
|
215
|
-
|
|
216
|
-
### Step 4: Parse and integrate
|
|
217
|
-
|
|
218
|
-
For each returned section:
|
|
219
|
-
- resolve the component URL if present
|
|
220
|
-
- read normalized metadata first, especially `codeUrl`, `demoCodeUrl`, and dependencies
|
|
221
|
-
- fetch source from the resolved raw URLs when needed
|
|
222
|
-
- merge copied prompt/code information with repo context
|
|
223
|
-
- install dependencies
|
|
224
|
-
- adapt imports, component paths, and utility functions to the current repo
|
|
225
|
-
|
|
226
|
-
## Integration Rules
|
|
227
|
-
|
|
228
|
-
- v1 supports React projects broadly.
|
|
229
|
-
- Preserve the repo's existing file layout whenever possible.
|
|
230
|
-
- If Tailwind or TypeScript is missing and the chosen component requires it, explain exactly what must be added before integration.
|
|
231
|
-
- If the component assumes shadcn utilities like `cn` or `@/lib/utils`, either map them to the repo equivalent or add a minimal compatible helper.
|
|
232
|
-
- If one section cannot be matched cleanly, integrate the rest and flag the unmatched section explicitly.
|
|
233
|
-
|
|
234
|
-
## Failure Handling
|
|
235
|
-
|
|
236
|
-
- Bad reference URL or blocked crawl: switch to Manual mode and generate a handoff template.
|
|
237
|
-
- 21st.dev page resolves but source URLs are missing: use the copied prompt path or ask for the component's copied prompt/code only for that section.
|
|
238
|
-
- Resolver succeeds but the environment cannot fetch the raw CDN URLs: ask the user for pasted Copy Code output, downloaded source, or permission to use another environment for fetch.
|
|
239
|
-
- Non-React target repo: explain the limitation and stop.
|
|
240
|
-
|
|
241
|
-
## Output Defaults
|
|
242
|
-
|
|
243
|
-
- **Auto mode**: inspect, choose, fetch, integrate, report.
|
|
244
|
-
- **Manual mode**: generate checklist, ingest handoff, integrate, report.
|
|
1
|
+
---
|
|
2
|
+
name: 21st-dev-components
|
|
3
|
+
description: Use when the user wants to build a React site or app section from 21st.dev components, clone the structure of a reference site with 21st.dev building blocks, browse 21st.dev manually and return copied prompts/code, or says things like "build me a site like this", "use 21st.dev", "copy prompt", "component URL", "hero from 21st", or "match this landing page with ready-made components".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 21st.dev Reference-to-Component Skill
|
|
7
|
+
|
|
8
|
+
This skill routes between two flows:
|
|
9
|
+
|
|
10
|
+
- **Auto mode**: the user provides a reference site URL and wants the agent to inspect it, infer the required sections, choose matching 21st.dev components automatically, and integrate them.
|
|
11
|
+
- **Manual mode**: the user wants guided collection. The agent lists the sections, tells the user what to fetch from 21st.dev, then integrates the returned handoff.
|
|
12
|
+
|
|
13
|
+
Use this skill only for **React-family** projects. If the repo is not React-based, explain that v1 of this skill is React-only and stop.
|
|
14
|
+
|
|
15
|
+
## Bundled Resources
|
|
16
|
+
|
|
17
|
+
- `references/categories.md`
|
|
18
|
+
Use for section-to-category mapping and direct 21st.dev category URLs.
|
|
19
|
+
- `references/manual-handoff-template.md`
|
|
20
|
+
Use when the user is gathering components manually.
|
|
21
|
+
- `references/section-detection-rubric.md`
|
|
22
|
+
Use during Auto mode after crawling the reference site.
|
|
23
|
+
- `scripts/resolve-21st-component.mjs`
|
|
24
|
+
Resolve a 21st.dev component page into normalized metadata.
|
|
25
|
+
- `scripts/fetch-21st-source.mjs`
|
|
26
|
+
Fetch raw source from 21st CDN URLs.
|
|
27
|
+
- `scripts/build-manual-handoff-template.mjs`
|
|
28
|
+
Generate a manual handoff markdown file for the user.
|
|
29
|
+
|
|
30
|
+
## Raw Code Resolution Standard
|
|
31
|
+
|
|
32
|
+
Do not derive 21st.dev CDN source URLs by string concatenation or by manually modifying the community page URL.
|
|
33
|
+
|
|
34
|
+
Always treat the user-facing 21st.dev component page as the source of truth, then resolve it into metadata before fetching code.
|
|
35
|
+
|
|
36
|
+
### Required workflow
|
|
37
|
+
1. Start with the 21st.dev community component URL.
|
|
38
|
+
2. Run the resolver script on that page URL.
|
|
39
|
+
3. Read `codeUrl` and `demoCodeUrl` from the resolver output.
|
|
40
|
+
4. Fetch source from those returned URLs.
|
|
41
|
+
5. Only fall back to manual copy/paste if resolution succeeds but raw source cannot be fetched in the current environment.
|
|
42
|
+
|
|
43
|
+
### Command
|
|
44
|
+
```bash
|
|
45
|
+
node scripts/resolve-21st-component.mjs --url "<21st-component-url>" --json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Why this rule exists
|
|
49
|
+
21st.dev community URLs do not always map cleanly to CDN paths. Mismatches can include:
|
|
50
|
+
- author slug differences between page URL and CDN path
|
|
51
|
+
- internal user IDs in CDN paths instead of public author names
|
|
52
|
+
- timestamped filenames such as `code.1748367465506.tsx`
|
|
53
|
+
- version query params such as `?v=1`
|
|
54
|
+
- demo paths that are not reliably predictable
|
|
55
|
+
|
|
56
|
+
Because of this, the correct standard is:
|
|
57
|
+
|
|
58
|
+
**community page URL -> resolve metadata -> fetch `codeUrl` / `demoCodeUrl`**
|
|
59
|
+
|
|
60
|
+
not:
|
|
61
|
+
|
|
62
|
+
**community page URL -> manually transform into CDN URL**
|
|
63
|
+
|
|
64
|
+
### Manual fallback rule
|
|
65
|
+
If the resolver returns metadata but the environment cannot fetch the raw source files, ask the user for one of these:
|
|
66
|
+
- pasted code from the 21st.dev Copy Code action
|
|
67
|
+
- downloaded component source
|
|
68
|
+
- permission to use an alternate environment that can fetch the returned CDN URLs
|
|
69
|
+
|
|
70
|
+
This resolution step is mandatory in both Auto mode and Manual mode whenever the environment allows it.
|
|
71
|
+
|
|
72
|
+
## Mode Router
|
|
73
|
+
|
|
74
|
+
### Use Auto mode when
|
|
75
|
+
|
|
76
|
+
- The user gives a live reference site URL.
|
|
77
|
+
- The user says "build me something like this", "clone this layout", or "crawl this site and rebuild it".
|
|
78
|
+
- The user expects the agent to choose components automatically.
|
|
79
|
+
|
|
80
|
+
### Use Manual mode when
|
|
81
|
+
|
|
82
|
+
- The user says they will browse 21st.dev themselves.
|
|
83
|
+
- The user pastes 21st.dev component URLs, copied prompts, code fences, or a markdown handoff file.
|
|
84
|
+
- The user wants the agent to tell them exactly what sections to gather.
|
|
85
|
+
|
|
86
|
+
If Auto mode fails because the site is blocked, brittle, or the 21st lookup is weak, fall back to Manual mode immediately and generate the handoff template instead of dead-ending.
|
|
87
|
+
|
|
88
|
+
## Auto Mode Workflow
|
|
89
|
+
|
|
90
|
+
### Step 1: Crawl the reference site in a browser
|
|
91
|
+
|
|
92
|
+
Use the browser-first workflow from the `webapp-testing` skill. Do not rely only on raw HTML if the page is clearly client-rendered.
|
|
93
|
+
|
|
94
|
+
What to inspect:
|
|
95
|
+
- header / navbar / announcement bars
|
|
96
|
+
- hero block
|
|
97
|
+
- feature grids or card rows
|
|
98
|
+
- social proof / logos
|
|
99
|
+
- testimonials
|
|
100
|
+
- pricing
|
|
101
|
+
- FAQ
|
|
102
|
+
- forms / auth blocks
|
|
103
|
+
- footer
|
|
104
|
+
- app shell elements such as sidebar, table, tabs, or modals
|
|
105
|
+
|
|
106
|
+
Load `references/section-detection-rubric.md` if the page structure is not obvious.
|
|
107
|
+
|
|
108
|
+
### Step 2: Build a page anatomy model
|
|
109
|
+
|
|
110
|
+
Write down the major sections in visual order. For each section, capture:
|
|
111
|
+
- section name
|
|
112
|
+
- rough structure
|
|
113
|
+
- visual tone
|
|
114
|
+
- obvious dependencies such as carousels, motion, video, maps, charts, or forms
|
|
115
|
+
|
|
116
|
+
### Step 3: Map sections to 21st.dev categories
|
|
117
|
+
|
|
118
|
+
Load `references/categories.md` and map each detected section to one or more category slugs.
|
|
119
|
+
|
|
120
|
+
Rules:
|
|
121
|
+
- Match structure first, style second.
|
|
122
|
+
- Use one primary category and optional supporting categories.
|
|
123
|
+
- Decorative elements like shaders, backgrounds, or borders are secondary, not the main section match.
|
|
124
|
+
|
|
125
|
+
### Step 4: Discover and resolve candidate components
|
|
126
|
+
|
|
127
|
+
Search 21st.dev for each mapped category. Once you have likely component URLs:
|
|
128
|
+
|
|
129
|
+
1. Resolve each page:
|
|
130
|
+
```bash
|
|
131
|
+
node scripts/resolve-21st-component.mjs --url "<21st-component-url>" --json
|
|
132
|
+
```
|
|
133
|
+
2. Inspect:
|
|
134
|
+
- dependency count
|
|
135
|
+
- component/demo CDN URLs
|
|
136
|
+
- tags
|
|
137
|
+
- author
|
|
138
|
+
- registry dependency hints
|
|
139
|
+
|
|
140
|
+
### Step 5: Choose the best match automatically
|
|
141
|
+
|
|
142
|
+
Default behavior is **not** to ask the user to choose.
|
|
143
|
+
|
|
144
|
+
Prefer:
|
|
145
|
+
- closest structural match
|
|
146
|
+
- lowest dependency burden
|
|
147
|
+
- compatibility with the current repo
|
|
148
|
+
- easier adaptation to the existing styling system
|
|
149
|
+
|
|
150
|
+
### Step 6: Fetch source and integrate
|
|
151
|
+
|
|
152
|
+
Fetch component/demo source from the resolved `codeUrl` and `demoCodeUrl` values. Do not guess CDN paths manually.
|
|
153
|
+
|
|
154
|
+
Fetch component/demo source from CDN URLs:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
node scripts/fetch-21st-source.mjs --url "<code-url>" --url "<demo-code-url>" --out-dir tmp/21st
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Then integrate into the repo:
|
|
161
|
+
- adapt file paths to the existing project structure
|
|
162
|
+
- prefer the repo's current component locations
|
|
163
|
+
- prefer existing Tailwind, TypeScript, and shadcn conventions when present
|
|
164
|
+
- if shadcn conventions are absent, adapt rather than forcing `/components/ui`
|
|
165
|
+
- if required dependencies or setup are missing, install/configure them first
|
|
166
|
+
|
|
167
|
+
### Step 7: Report what was selected
|
|
168
|
+
|
|
169
|
+
When you finish, state:
|
|
170
|
+
- which sections were detected
|
|
171
|
+
- which 21st.dev components were selected
|
|
172
|
+
- which dependencies were added
|
|
173
|
+
- any sections that required partial custom adaptation
|
|
174
|
+
|
|
175
|
+
## Manual Mode Workflow
|
|
176
|
+
|
|
177
|
+
### Step 1: Break the page into sections
|
|
178
|
+
|
|
179
|
+
Identify the target sections from the user's request or reference URL:
|
|
180
|
+
- header / navbar
|
|
181
|
+
- hero
|
|
182
|
+
- features
|
|
183
|
+
- testimonials
|
|
184
|
+
- pricing
|
|
185
|
+
- footer
|
|
186
|
+
- sidebar
|
|
187
|
+
- CTA
|
|
188
|
+
- forms
|
|
189
|
+
- tables
|
|
190
|
+
- auth
|
|
191
|
+
- FAQ
|
|
192
|
+
|
|
193
|
+
### Step 2: Tell the user what to collect
|
|
194
|
+
|
|
195
|
+
Use `references/categories.md` to give the exact 21st.dev category links.
|
|
196
|
+
|
|
197
|
+
Generate a checklist file when useful:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
node scripts/build-manual-handoff-template.mjs --sections "header,hero,features,pricing,footer" --out 21st-handoff.md
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Point the user at the template in `references/manual-handoff-template.md` if they want to paste directly in chat instead of using a file.
|
|
204
|
+
|
|
205
|
+
### Step 3: Accept one combined handoff
|
|
206
|
+
|
|
207
|
+
The handoff can contain:
|
|
208
|
+
- 21st.dev URLs
|
|
209
|
+
- copied prompt blocks
|
|
210
|
+
- code fences
|
|
211
|
+
- dependency lists
|
|
212
|
+
- placement notes
|
|
213
|
+
|
|
214
|
+
Do not make the user re-explain the same page structure if the handoff already contains it.
|
|
215
|
+
|
|
216
|
+
### Step 4: Parse and integrate
|
|
217
|
+
|
|
218
|
+
For each returned section:
|
|
219
|
+
- resolve the component URL if present
|
|
220
|
+
- read normalized metadata first, especially `codeUrl`, `demoCodeUrl`, and dependencies
|
|
221
|
+
- fetch source from the resolved raw URLs when needed
|
|
222
|
+
- merge copied prompt/code information with repo context
|
|
223
|
+
- install dependencies
|
|
224
|
+
- adapt imports, component paths, and utility functions to the current repo
|
|
225
|
+
|
|
226
|
+
## Integration Rules
|
|
227
|
+
|
|
228
|
+
- v1 supports React projects broadly.
|
|
229
|
+
- Preserve the repo's existing file layout whenever possible.
|
|
230
|
+
- If Tailwind or TypeScript is missing and the chosen component requires it, explain exactly what must be added before integration.
|
|
231
|
+
- If the component assumes shadcn utilities like `cn` or `@/lib/utils`, either map them to the repo equivalent or add a minimal compatible helper.
|
|
232
|
+
- If one section cannot be matched cleanly, integrate the rest and flag the unmatched section explicitly.
|
|
233
|
+
|
|
234
|
+
## Failure Handling
|
|
235
|
+
|
|
236
|
+
- Bad reference URL or blocked crawl: switch to Manual mode and generate a handoff template.
|
|
237
|
+
- 21st.dev page resolves but source URLs are missing: use the copied prompt path or ask for the component's copied prompt/code only for that section.
|
|
238
|
+
- Resolver succeeds but the environment cannot fetch the raw CDN URLs: ask the user for pasted Copy Code output, downloaded source, or permission to use another environment for fetch.
|
|
239
|
+
- Non-React target repo: explain the limitation and stop.
|
|
240
|
+
|
|
241
|
+
## Output Defaults
|
|
242
|
+
|
|
243
|
+
- **Auto mode**: inspect, choose, fetch, integrate, report.
|
|
244
|
+
- **Manual mode**: generate checklist, ingest handoff, integrate, report.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anti-gravity
|
|
3
|
+
description: Use when the user asks to run Anti-Gravity CLI (agy) for Gemini-like code review, plan review, design critique, or large-context analysis. Anti-Gravity replaces the legacy Gemini CLI workflow.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Anti-Gravity Skill Guide
|
|
7
|
+
|
|
8
|
+
## When to Use Anti-Gravity
|
|
9
|
+
- When the user asks for Gemini-like analysis, review, planning, design critique, or broad context work.
|
|
10
|
+
- When a second-model perspective is useful.
|
|
11
|
+
- When the task can be expressed as a short, direct `agy` prompt.
|
|
12
|
+
|
|
13
|
+
## Tested Behavior in This Harness
|
|
14
|
+
`agy -p` may produce an empty captured stdout inside the Pi/sandbox harness even when the model answered successfully. The reliable way to verify output here is:
|
|
15
|
+
1. run `agy -p` with a short exact prompt,
|
|
16
|
+
2. capture a log with `--log-file`,
|
|
17
|
+
3. read the created conversation id from the log,
|
|
18
|
+
4. inspect `C:/Users/johno/.gemini/antigravity-cli/brain/<conversation-id>/.system_generated/logs/transcript.jsonl` for the final model response.
|
|
19
|
+
|
|
20
|
+
The CLI stores conversation state under:
|
|
21
|
+
`C:/Users/johno/.gemini/antigravity-cli/`
|
|
22
|
+
|
|
23
|
+
If the harness reports `Access is denied` while renaming files in `conversations/`, the response may still be present in the transcript. Prefer checking the transcript before retrying.
|
|
24
|
+
|
|
25
|
+
## Core CLI Modes
|
|
26
|
+
- `agy -p "prompt"` or `agy --print "prompt"` — run a single prompt and print/respond non-interactively.
|
|
27
|
+
- `agy --prompt "prompt"` — alias for print mode.
|
|
28
|
+
- `agy -c` or `agy --continue` — continue the most recent conversation.
|
|
29
|
+
- `agy --conversation <ID>` — resume a previous conversation by ID.
|
|
30
|
+
- `agy -i "prompt"` or `agy --prompt-interactive "prompt"` — start interactively and continue the session.
|
|
31
|
+
- `agy --sandbox` — run with terminal restrictions enabled.
|
|
32
|
+
|
|
33
|
+
## Workspace and Safety Flags
|
|
34
|
+
- `--add-dir <DIR>` — add a directory to the workspace; repeat for multiple directories.
|
|
35
|
+
- `--log-file <PATH>` — write CLI logs to a known path for debugging and transcript discovery.
|
|
36
|
+
- `--print-timeout <DURATION>` — set print-mode wait time, e.g. `60s`, `5m`.
|
|
37
|
+
- `--dangerously-skip-permissions` — auto-approve tool permission requests. Use only when explicitly appropriate.
|
|
38
|
+
|
|
39
|
+
## Prompting Rules
|
|
40
|
+
Anti-Gravity follows instructions better when prompts are short and strict.
|
|
41
|
+
|
|
42
|
+
Use this style:
|
|
43
|
+
```text
|
|
44
|
+
Do not use tools. Return exactly AGY_OK and nothing else.
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
For shell-like requests:
|
|
48
|
+
```text
|
|
49
|
+
Return only the names of files and folders in the current directory, one per line, with no commentary.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Avoid vague prompts such as:
|
|
53
|
+
```text
|
|
54
|
+
Can you look around and tell me what's here?
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Reliable Pi/Harness Pattern
|
|
58
|
+
Use this when running from Pi/tooling and stdout is unreliable:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
rm -f C:/Temp/agy-run.log
|
|
62
|
+
agy -p "Do not use tools. Return exactly AGY_OK and nothing else." \
|
|
63
|
+
--print-timeout 60s \
|
|
64
|
+
--log-file C:/Temp/agy-run.log
|
|
65
|
+
|
|
66
|
+
conv=$(grep -oE 'conversation=[0-9a-f-]+' C:/Temp/agy-run.log | tail -1 | cut -d= -f2)
|
|
67
|
+
read "C:/Users/johno/.gemini/antigravity-cli/brain/$conv/.system_generated/logs/transcript.jsonl"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Expected successful indicators:
|
|
71
|
+
- process exits `0`, and
|
|
72
|
+
- transcript contains a `MODEL` entry with the requested answer.
|
|
73
|
+
|
|
74
|
+
## Human Terminal Pattern
|
|
75
|
+
When the user runs Anti-Gravity directly in PowerShell, this can print normally:
|
|
76
|
+
|
|
77
|
+
```powershell
|
|
78
|
+
agy -p "reply me with exactly the list of files in this directory and nothing more"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Common Use Cases
|
|
82
|
+
|
|
83
|
+
### Direct exact response
|
|
84
|
+
```bash
|
|
85
|
+
agy -p "Do not use tools. Return exactly AGY_OK and nothing else."
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Focused review
|
|
89
|
+
```bash
|
|
90
|
+
agy -p "Review this plan for missing risks. Return 5 bullets max."
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Resume prior work
|
|
94
|
+
```bash
|
|
95
|
+
agy --conversation <conversation-id> -p "Continue the prior review. Focus only on deployment risks."
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Multi-directory analysis
|
|
99
|
+
```bash
|
|
100
|
+
agy --add-dir src --add-dir docs -p "Map the feature flow across these directories. Return concise bullets."
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Troubleshooting
|
|
104
|
+
- Empty stdout in Pi does not necessarily mean failure; inspect the transcript.
|
|
105
|
+
- `Access is denied` under `conversations/` is a local storage/permission issue, not necessarily a model failure.
|
|
106
|
+
- If the prompt requires tool use, expect Anti-Gravity to narrate tool intent unless instructed otherwise.
|
|
107
|
+
- Use `--log-file` on every automated run so the conversation id and failure mode are recoverable.
|
|
108
|
+
|
|
109
|
+
## Notes
|
|
110
|
+
- Treat Anti-Gravity as the canonical successor to the old Gemini CLI skill.
|
|
111
|
+
- Do not use deprecated Gemini CLI flags or model names.
|
|
112
|
+
- Prefer exact, bounded prompts over broad exploratory ones.
|