opencode-skills-antigravity 0.0.3 → 0.0.4

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.
@@ -0,0 +1,348 @@
1
+ ---
2
+ name: hono
3
+ description: "Build ultra-fast web APIs and full-stack apps with Hono — runs on Cloudflare Workers, Deno, Bun, Node.js, and any WinterCG-compatible runtime."
4
+ category: backend
5
+ risk: safe
6
+ source: community
7
+ date_added: "2026-03-18"
8
+ author: suhaibjanjua
9
+ tags: [hono, edge, cloudflare-workers, bun, deno, api, typescript, web-standards]
10
+ tools: [claude, cursor, gemini]
11
+ ---
12
+
13
+ # Hono Web Framework
14
+
15
+ ## Overview
16
+
17
+ Hono (炎, "flame" in Japanese) is a small, ultrafast web framework built on Web Standards (`Request`/`Response`/`fetch`). It runs anywhere: Cloudflare Workers, Deno Deploy, Bun, Node.js, AWS Lambda, and any WinterCG-compatible runtime — with the same code. Hono's router is one of the fastest available, and its middleware system, built-in JSX support, and RPC client make it a strong choice for edge APIs, BFFs, and lightweight full-stack apps.
18
+
19
+ ## When to Use This Skill
20
+
21
+ - Use when building a REST or RPC API for edge deployment (Cloudflare Workers, Deno Deploy)
22
+ - Use when you need a minimal but type-safe server framework for Bun or Node.js
23
+ - Use when building a Backend for Frontend (BFF) layer with low latency requirements
24
+ - Use when migrating from Express but wanting better TypeScript support and edge compatibility
25
+ - Use when the user asks about Hono routing, middleware, `c.req`, `c.json`, or `hc()` RPC client
26
+
27
+ ## How It Works
28
+
29
+ ### Step 1: Project Setup
30
+
31
+ **Cloudflare Workers (recommended for edge):**
32
+ ```bash
33
+ npm create hono@latest my-api
34
+ # Select: cloudflare-workers
35
+ cd my-api
36
+ npm install
37
+ npm run dev # Wrangler local dev
38
+ npm run deploy # Deploy to Cloudflare
39
+ ```
40
+
41
+ **Bun / Node.js:**
42
+ ```bash
43
+ mkdir my-api && cd my-api
44
+ bun init
45
+ bun add hono
46
+ ```
47
+
48
+ ```typescript
49
+ // src/index.ts (Bun)
50
+ import { Hono } from 'hono';
51
+
52
+ const app = new Hono();
53
+
54
+ app.get('/', c => c.text('Hello Hono!'));
55
+
56
+ export default {
57
+ port: 3000,
58
+ fetch: app.fetch,
59
+ };
60
+ ```
61
+
62
+ ### Step 2: Routing
63
+
64
+ ```typescript
65
+ import { Hono } from 'hono';
66
+
67
+ const app = new Hono();
68
+
69
+ // Basic methods
70
+ app.get('/posts', c => c.json({ posts: [] }));
71
+ app.post('/posts', c => c.json({ created: true }, 201));
72
+ app.put('/posts/:id', c => c.json({ updated: true }));
73
+ app.delete('/posts/:id', c => c.json({ deleted: true }));
74
+
75
+ // Route params and query strings
76
+ app.get('/posts/:id', async c => {
77
+ const id = c.req.param('id');
78
+ const format = c.req.query('format') ?? 'json';
79
+ return c.json({ id, format });
80
+ });
81
+
82
+ // Wildcard
83
+ app.get('/static/*', c => c.text('static file'));
84
+
85
+ export default app;
86
+ ```
87
+
88
+ **Chained routing:**
89
+ ```typescript
90
+ app
91
+ .get('/users', listUsers)
92
+ .post('/users', createUser)
93
+ .get('/users/:id', getUser)
94
+ .patch('/users/:id', updateUser)
95
+ .delete('/users/:id', deleteUser);
96
+ ```
97
+
98
+ ### Step 3: Middleware
99
+
100
+ Hono middleware works exactly like `fetch` interceptors — before and after handlers:
101
+
102
+ ```typescript
103
+ import { Hono } from 'hono';
104
+ import { logger } from 'hono/logger';
105
+ import { cors } from 'hono/cors';
106
+ import { bearerAuth } from 'hono/bearer-auth';
107
+
108
+ const app = new Hono();
109
+
110
+ // Built-in middleware
111
+ app.use('*', logger());
112
+ app.use('/api/*', cors({ origin: 'https://myapp.com' }));
113
+ app.use('/api/admin/*', bearerAuth({ token: process.env.API_TOKEN! }));
114
+
115
+ // Custom middleware
116
+ app.use('*', async (c, next) => {
117
+ c.set('requestId', crypto.randomUUID());
118
+ await next();
119
+ c.header('X-Request-Id', c.get('requestId'));
120
+ });
121
+ ```
122
+
123
+ **Available built-in middleware:** `logger`, `cors`, `csrf`, `etag`, `cache`, `basicAuth`, `bearerAuth`, `jwt`, `compress`, `bodyLimit`, `timeout`, `prettyJSON`, `secureHeaders`.
124
+
125
+ ### Step 4: Request and Response Helpers
126
+
127
+ ```typescript
128
+ app.post('/submit', async c => {
129
+ // Parse body
130
+ const body = await c.req.json<{ name: string; email: string }>();
131
+ const form = await c.req.formData();
132
+ const text = await c.req.text();
133
+
134
+ // Headers and cookies
135
+ const auth = c.req.header('authorization');
136
+ const token = getCookie(c, 'session');
137
+
138
+ // Responses
139
+ return c.json({ ok: true }); // JSON
140
+ return c.text('hello'); // plain text
141
+ return c.html('<h1>Hello</h1>'); // HTML
142
+ return c.redirect('/dashboard', 302); // redirect
143
+ return new Response(stream, { status: 200 }); // raw Response
144
+ });
145
+ ```
146
+
147
+ ### Step 5: Zod Validator Middleware
148
+
149
+ ```typescript
150
+ import { zValidator } from '@hono/zod-validator';
151
+ import { z } from 'zod';
152
+
153
+ const createPostSchema = z.object({
154
+ title: z.string().min(1).max(200),
155
+ body: z.string().min(1),
156
+ tags: z.array(z.string()).default([]),
157
+ });
158
+
159
+ app.post(
160
+ '/posts',
161
+ zValidator('json', createPostSchema),
162
+ async c => {
163
+ const data = c.req.valid('json'); // fully typed
164
+ const post = await db.post.create({ data });
165
+ return c.json(post, 201);
166
+ }
167
+ );
168
+ ```
169
+
170
+ ### Step 6: Route Groups and App Composition
171
+
172
+ ```typescript
173
+ // src/routes/posts.ts
174
+ import { Hono } from 'hono';
175
+
176
+ const posts = new Hono();
177
+
178
+ posts.get('/', async c => { /* list posts */ });
179
+ posts.post('/', async c => { /* create post */ });
180
+ posts.get('/:id', async c => { /* get post */ });
181
+
182
+ export default posts;
183
+ ```
184
+
185
+ ```typescript
186
+ // src/index.ts
187
+ import { Hono } from 'hono';
188
+ import posts from './routes/posts';
189
+ import users from './routes/users';
190
+
191
+ const app = new Hono().basePath('/api');
192
+
193
+ app.route('/posts', posts);
194
+ app.route('/users', users);
195
+
196
+ export default app;
197
+ ```
198
+
199
+ ### Step 7: RPC Client (End-to-End Type Safety)
200
+
201
+ Hono's RPC mode exports route types that the `hc` client consumes — similar to tRPC but using fetch conventions:
202
+
203
+ ```typescript
204
+ // server: src/routes/posts.ts
205
+ import { Hono } from 'hono';
206
+ import { zValidator } from '@hono/zod-validator';
207
+ import { z } from 'zod';
208
+
209
+ const posts = new Hono()
210
+ .get('/', c => c.json({ posts: [{ id: '1', title: 'Hello' }] }))
211
+ .post(
212
+ '/',
213
+ zValidator('json', z.object({ title: z.string() })),
214
+ async c => {
215
+ const { title } = c.req.valid('json');
216
+ return c.json({ id: '2', title }, 201);
217
+ }
218
+ );
219
+
220
+ export default posts;
221
+ export type PostsType = typeof posts;
222
+ ```
223
+
224
+ ```typescript
225
+ // client: src/client.ts
226
+ import { hc } from 'hono/client';
227
+ import type { PostsType } from '../server/routes/posts';
228
+
229
+ const client = hc<PostsType>('/api/posts');
230
+
231
+ // Fully typed — autocomplete on routes, params, and responses
232
+ const { posts } = await client.$get().json();
233
+ const newPost = await client.$post({ json: { title: 'New Post' } }).json();
234
+ ```
235
+
236
+ ## Examples
237
+
238
+ ### Example 1: JWT Auth Middleware
239
+
240
+ ```typescript
241
+ import { Hono } from 'hono';
242
+ import { jwt, sign } from 'hono/jwt';
243
+
244
+ const app = new Hono();
245
+ const SECRET = process.env.JWT_SECRET!;
246
+
247
+ app.post('/login', async c => {
248
+ const { email, password } = await c.req.json();
249
+ const user = await validateUser(email, password);
250
+ if (!user) return c.json({ error: 'Invalid credentials' }, 401);
251
+
252
+ const token = await sign({ sub: user.id, exp: Math.floor(Date.now() / 1000) + 3600 }, SECRET);
253
+ return c.json({ token });
254
+ });
255
+
256
+ app.use('/api/*', jwt({ secret: SECRET }));
257
+ app.get('/api/me', async c => {
258
+ const payload = c.get('jwtPayload');
259
+ const user = await getUserById(payload.sub);
260
+ return c.json(user);
261
+ });
262
+
263
+ export default app;
264
+ ```
265
+
266
+ ### Example 2: Cloudflare Workers with D1 Database
267
+
268
+ ```typescript
269
+ // src/index.ts
270
+ import { Hono } from 'hono';
271
+
272
+ type Bindings = {
273
+ DB: D1Database;
274
+ API_TOKEN: string;
275
+ };
276
+
277
+ const app = new Hono<{ Bindings: Bindings }>();
278
+
279
+ app.get('/users', async c => {
280
+ const { results } = await c.env.DB.prepare('SELECT * FROM users LIMIT 50').all();
281
+ return c.json(results);
282
+ });
283
+
284
+ app.post('/users', async c => {
285
+ const { name, email } = await c.req.json();
286
+ await c.env.DB.prepare('INSERT INTO users (name, email) VALUES (?, ?)')
287
+ .bind(name, email)
288
+ .run();
289
+ return c.json({ created: true }, 201);
290
+ });
291
+
292
+ export default app;
293
+ ```
294
+
295
+ ### Example 3: Streaming Response
296
+
297
+ ```typescript
298
+ import { stream, streamText } from 'hono/streaming';
299
+
300
+ app.get('/stream', c =>
301
+ streamText(c, async stream => {
302
+ for (const chunk of ['Hello', ' ', 'World']) {
303
+ await stream.write(chunk);
304
+ await stream.sleep(100);
305
+ }
306
+ })
307
+ );
308
+ ```
309
+
310
+ ## Best Practices
311
+
312
+ - ✅ Use route groups (sub-apps) to keep handlers in separate files — `app.route('/users', usersRouter)`
313
+ - ✅ Use `zValidator` for all request body, query, and param validation
314
+ - ✅ Type Cloudflare Workers bindings with the `Bindings` generic: `new Hono<{ Bindings: Env }>()`
315
+ - ✅ Use the RPC client (`hc`) when your frontend and backend share the same repo
316
+ - ✅ Prefer returning `c.json()`/`c.text()` over `new Response()` for cleaner code
317
+ - ❌ Don't use Node.js-specific APIs (`fs`, `path`, `process`) if you want edge portability
318
+ - ❌ Don't add heavy dependencies — Hono's value is its tiny footprint on edge runtimes
319
+ - ❌ Don't skip middleware typing — use generics (`Variables`, `Bindings`) to keep `c.get()` type-safe
320
+
321
+ ## Security & Safety Notes
322
+
323
+ - Always validate input with `zValidator` before using data from requests.
324
+ - Use Hono's built-in `csrf` middleware on mutation endpoints when serving HTML/forms.
325
+ - For Cloudflare Workers, store secrets in `wrangler.toml` `[vars]` (non-secret) or `wrangler secret put` (secret) — never hardcode them in source.
326
+ - When using `bearerAuth` or `jwt`, ensure tokens are validated server-side — do not trust client-provided user IDs.
327
+ - Rate-limit sensitive endpoints (auth, password reset) with Cloudflare Rate Limiting or a custom middleware.
328
+
329
+ ## Common Pitfalls
330
+
331
+ - **Problem:** Handler returns `undefined` — response is empty
332
+ **Solution:** Always `return` a response from handlers: `return c.json(...)` not just `c.json(...)`.
333
+
334
+ - **Problem:** Middleware runs after the response is sent
335
+ **Solution:** Call `await next()` before post-response logic; Hono runs code after `next()` as the response travels back up the chain.
336
+
337
+ - **Problem:** `c.env` is undefined on Node.js
338
+ **Solution:** Cloudflare `env` bindings only exist in Workers. Use `process.env` on Node.js.
339
+
340
+ - **Problem:** Route not matching — gets a 404
341
+ **Solution:** Check that `app.route('/prefix', subRouter)` uses the same prefix your client calls. Sub-routers should **not** repeat the prefix in their own routes.
342
+
343
+ ## Related Skills
344
+
345
+ - `@cloudflare-workers-expert` — Deep dive into Cloudflare Workers platform specifics
346
+ - `@trpc-fullstack` — Alternative RPC approach for TypeScript full-stack apps
347
+ - `@zod-validation-expert` — Detailed Zod schema patterns used with `@hono/zod-validator`
348
+ - `@nodejs-backend-patterns` — When you need a Node.js-specific backend (not edge)
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: openclaw-github-repo-commander
3
+ description: "7-stage super workflow for GitHub repo audit, cleanup, PR review, and competitor analysis"
4
+ category: development-and-testing
5
+ risk: safe
6
+ source: community
7
+ date_added: "2026-03-18"
8
+ author: wd041216-bit
9
+ tags: [github, git, repository, audit, cleanup, workflow, devtools, automation, code-review, security]
10
+ tools: [claude, cursor]
11
+ ---
12
+ # OpenClaw GitHub Repo Commander
13
+
14
+ ## Overview
15
+
16
+ A structured 7-stage super workflow for comprehensive GitHub repository management. This skill automates repository auditing, cleanup, competitor benchmarking, and optimization — turning a messy repo into a clean, well-documented, production-ready project.
17
+
18
+ ## When to Use This Skill
19
+
20
+ - Use when you need to audit a repository for secrets, junk files, or low-quality content
21
+ - Use when the user says "clean up my repo", "optimize my GitHub project", or "audit this library"
22
+ - Use when reviewing or creating pull requests with structured analysis
23
+ - Use when comparing your project against competitors on GitHub
24
+ - Use when running `/super-workflow` or `/openclaw-github-repo-commander` on a repo URL
25
+
26
+ ## How It Works
27
+
28
+ ### Stage 1: Intake
29
+ Clone the target repository, define success criteria, and establish baseline metrics.
30
+
31
+ ### Stage 2: Execution
32
+ Run `scripts/repo-audit.sh` — automated checks for:
33
+ - Hardcoded secrets (`ghp_`, `sk-`, `AKIA`, etc.)
34
+ - Tracked `node_modules/` or build artifacts
35
+ - Empty directories
36
+ - Large files (>1MB)
37
+ - Missing `.gitignore` coverage
38
+ - Broken internal README links
39
+
40
+ ### Stage 3: Reflection
41
+ Deep manual review beyond automation: content quality, documentation consistency, structural issues, version mismatches.
42
+
43
+ ### Stage 4: Competitor Analysis
44
+ Search GitHub for similar repositories. Compare documentation standards, feature coverage, star counts, and community adoption.
45
+
46
+ ### Stage 5: Synthesis
47
+ Consolidate all findings into a prioritized action plan (P0 critical / P1 important / P2 nice-to-have).
48
+
49
+ ### Stage 6: Iteration
50
+ Execute the plan: delete low-value files, fix security issues, upgrade documentation, add CI workflows, update changelogs.
51
+
52
+ ### Stage 7: Validation
53
+ Re-run the audit script (target: 7/7 PASS), verify all changes, push to GitHub, and deliver a full report.
54
+
55
+ ## Examples
56
+
57
+ ### Example 1: Full Repo Audit
58
+
59
+ ```
60
+ /openclaw-github-repo-commander https://github.com/owner/my-repo
61
+ ```
62
+
63
+ Runs all 7 stages and produces a detailed before/after report.
64
+
65
+ ### Example 2: Quick Cleanup
66
+
67
+ ```
68
+ Clean up my GitHub repo — remove junk files, fix secrets, add .gitignore
69
+ ```
70
+
71
+ ### Example 3: Competitor Benchmarking
72
+
73
+ ```
74
+ Compare my skill repo with the top 5 similar repos on GitHub
75
+ ```
76
+
77
+ ## Best Practices
78
+
79
+ - ✅ Always run Stage 7 validation before pushing
80
+ - ✅ Use semantic commit messages: `chore:`, `fix:`, `docs:`
81
+ - ✅ Check the `pr_todo.json` file for pending reviewer requests
82
+ - ❌ Don't skip Stage 4 — competitor analysis reveals blind spots
83
+ - ❌ Don't commit `node_modules/` or `.env` files
84
+
85
+ ## Security & Safety Notes
86
+
87
+ - The audit script scans for common secret patterns but excludes `.github/workflows/` to avoid false positives
88
+ - All `gh` CLI operations use the user's existing authentication — no credentials are stored by this skill
89
+ - The skill never modifies files without explicit user confirmation in Stage 6
90
+
91
+ ## Source Repository
92
+
93
+ [github.com/wd041216-bit/openclaw-github-repo-commander](https://github.com/wd041216-bit/openclaw-github-repo-commander)
94
+
95
+ **License**: MIT | **Version**: 4.0.0