Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,14 @@

**[template-docusaurus](starter-templates/template-docusaurus/)** - Docusaurus 3 docs template with offline Lunr search, OpenAPI plugin, and classic theme optimized for technical docs.
`bun create starter-app` · `npx create-starter-app`

### 🧠 Agent Skills

Every package has a matching [Agent Skill](skills/) — setup, the calls worth knowing, recipes, and a troubleshooting table, written from the source rather than the README. Install all of them, or just the one you need:

```bash
npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent
npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent --skill ask-manage-storage
```

See [skills/README.md](skills/README.md) for the full index.
43 changes: 43 additions & 0 deletions skills/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Skills

One [Agent Skill](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview) per package in this repo, in the same shape as [emilkowalski/skills](https://github.com/emilkowalski/skills): a `SKILL.md` with setup, the calls worth knowing, recipes, and a troubleshooting table — plus an `API.md` for the packages with a large enough surface to warrant one.

Each skill is written from the package's source, not just its README, so the troubleshooting rows cover the real gotchas (flags the README gets wrong, exports that live on a subpath, stubs that return success unconditionally).

## Install

All of them:

```bash
npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent
```

Just one:

```bash
npx skills@latest add https://github.com/OpenSourceAGI/dev-tools-starter-agent --skill ask-manage-storage
```

## Reference

| Skill | Package | Covers |
| --- | --- | --- |
| [ask-about-system](./ask-about-system/SKILL.md) | `about-system-info` | The system-info CLI and library: blocks, settings file, cache, shell greeting |
| [ask-api2ai](./ask-api2ai/SKILL.md) | `api2ai-mcp-generator` | Generating MCP servers from OpenAPI, tool filtering, the three-layer security model |
| [ask-app-store-buttons](./ask-app-store-buttons/SKILL.md) | `react-app-store-buttons` | Download badges, `appId` vs `href`, native deep links, OS highlighting |
| [ask-cloudflare-to-claude-fix](./ask-cloudflare-to-claude-fix/SKILL.md) | `cloudflare-to-claude-fix` | Queue consumer, routine `/fire` API, secrets, retries and the DLQ |
| [ask-code-tree-graph](./ask-code-tree-graph/SKILL.md) | `code-tree-graph` | `DependencyGraph`, `FileTreeView`, `TypeTable`, and the AST engine |
| [ask-create-cloud-db](./ask-create-cloud-db/SKILL.md) | `create-cloud-db` | Turso database creation and the `.env` rewrite |
| [ask-create-starter-app](./ask-create-starter-app/SKILL.md) | `create-starter-app` | The template menu, how templates resolve, which ids actually exist |
| [ask-export-svg-typescript](./ask-export-svg-typescript/SKILL.md) | `export-svg-icons-typescript` | SVG folder → tree-shakable TS barrel, runtime color and size options |
| [ask-git0](./ask-git0/SKILL.md) | `git0-repo-downloader` | Search, download, auto-install, IDE launch, rate limits |
| [ask-manage-storage](./ask-manage-storage/SKILL.md) | `manage-storage` | S3 / R2 / B2 through one call, provider detection, edge credentials |
| [ask-open-ready](./ask-open-ready/SKILL.md) | `open-when-ready` | Dev-server wrapper: ready/error detection, flags, log locations |
| [ask-server-shell-setup](./ask-server-shell-setup/SKILL.md) | `server-shell-setup` | The bootstrap installer, components, fish aliases |
| [ask-shadcn-theme-menu](./ask-shadcn-theme-menu/SKILL.md) | `shadcn-theme-menu` | Theme provider and switchers, color themes vs dark mode |
| [ask-verify-phone-sms](./ask-verify-phone-sms/SKILL.md) | `verify-phone-sms` | SNS-backed SMS verification, endpoints, auth, VoIP blocking |
| [ask-web2mobile](./ask-web2mobile/SKILL.md) | `web2mobile-wrapper` | Website → Expo WebView app, asset generation, EAS build/submit |

## Adding a skill for a new package

Create `skills/ask-<name>/SKILL.md` with YAML frontmatter — `name` matching the directory, and a `description` that names the package, lists what the skill covers, and ends with a `Use when …` clause naming concrete symptoms. That description is the only thing an agent sees when deciding whether to load the skill, so it does the triggering work. Keep the body to setup → which call to reach for → recipes → a symptom/cause/fix table, and split exhaustive prop or option tables into `API.md`.
73 changes: 73 additions & 0 deletions skills/ask-about-system/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# about-system API Reference

Exact CLI flags, block names, settings keys, and cache TTLs.

## CLI

| Argument | Description |
| --- | --- |
| *(none)* | Print every block in `display_order`. |
| `cpu,ram_used,…` | Positional comma-separated block list — print only these. |
| `--json` | Emit the info object as JSON instead of the emoji line. |
| `--install` | Append the greeting to the detected shell's config file. |
| `--refresh` | Clear the cache before collecting. |
| `--set <path> <value>` | Write a settings value, e.g. `--set colors.user blue`. |
| `--settings-show` | Print the current settings JSON. |
| `--settings-reset` | Restore default settings. |
| `--settings-init` | Write a fresh settings file. |
| `--help` | Usage. |

## Entry points

| Import | Exports |
| --- | --- |
| `about-system` | `getSystemInfo(options?)`, `loadCache()`, `saveCache(cache)` |
| `about-system/api` | `infoFunctions`, `getSystemInfo`, `loadCache`, `saveCache` |
| `about-system/cli` | CLI entry (`about-system` bin) |
| `about-system/types` | `SystemInfo`, `SystemInfoOptions`, `Platform`, `InfoContext`, `GetSystemInfoFunction`, `DisplaySystemInfoFunction`, `PlatformAvailability` |

## Info blocks

`infoFunctions` keys, also usable as CLI positional filters and `display_order` entries:

| Block | Output |
| --- | --- |
| `user`, `hostname`, `device`, `kernel`, `os` | `👤 user`, `🏠 host`, `💻 MacBook Pro`, `🔧 5.15.0`, `⚡ Ubuntu 22.04` |
| `cpu`, `gpu`, `bench`, `cpu_bench_info`, `gpu_bench`, `gpu_bench_info` | Model strings plus Geekbench lookups from the bundled `bench/*.json` |
| `disk_used`, `ram_used`, `memory_available`, `swap_used`, `mount_points` | `📁 75%`, `💾 8/16GB`, and related storage/memory readouts |
| `top_process`, `load_average`, `uptime`, `users_logged_in` | `🔝 15% chrome`, load, `⏱️ 2d 5h 30m` |
| `ip`, `iplocal`, `city`, `domain`, `isp`, `network_interfaces` | Public/local IP, geo-IP city, reverse DNS, ISP |
| `shell`, `pacman`, `ports`, `containers`, `services_running` | Shell, package managers, open ports, Docker containers, systemd services |
| `temperature`, `battery`, `screen_resolution` | Sensors and display |

Note the two internal renames: `os` maps to `os_info`, `pacman` maps to `packages`.

## Settings file

- Linux/macOS: `~/.config/systeminfo-settings.json`
- Windows: `%APPDATA%\systeminfo-settings.json`

| Key | Shape | Notes |
| --- | --- | --- |
| `display_order` | `string[][]` | Array of lines, each an array of block names. Controls order and line breaks. |
| `colors` | `{ [block]: color }` | `red`, `orange`, `yellow`, `green`, `blue`, `cyan`, `purple`, `magenta`, `gray`, `lightblue`; `multicolor` for `ports`. |
| `emojis` | `{ [block]: string }` | Include the trailing space, e.g. `"🚀 "`. |
| `labels` | `{ [block]: string }` | Text label used when emojis are off. |
| `display` | `{ show_emojis, single_line, line_wrap_length }` | |
| `network` | `{ show_offline_message }` | |
| `advanced` | `{ debug }` | |

## Cache

File: `systeminfo-cache.json` in the OS temp dir (`os.tmpdir()`).

| Block group | TTL |
| --- | --- |
| `top_process` | 5 s |
| `ram_used` | 10 s |
| `temperature` | 30 s |
| `disk_used`, `battery` | 1 min |
| `ip`, `ports`, `containers`, `services_running`, `network_interfaces` | 5 min |
| `pacman`, `mount_points` | 10 min |
| `kernel` | 1 h |
| `cpu`, `gpu`, `os`, `device` | 24 h |
68 changes: 68 additions & 0 deletions skills/ask-about-system/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: ask-about-system
description: Guide to about-system (packages/about-system-info), the cross-platform system-info CLI and library — install and run it, pick specific info blocks, JSON output, the settings file (colors, emojis, labels, display order), the cache, the shell-greeting installer, and the programmatic API. Use when working with about-system or troubleshooting it — blocks that print empty, a greeting that doesn't run on terminal start, stale or wrong values, `infoFunctions` import errors, or `--set` changes that seem ignored.
---

# Working With about-system

The CLI and library in `packages/about-system-info`, published to npm as **`about-system`** (the directory name is not the package name). It prints 30+ system metrics as one emoji line, on Linux, macOS, Windows, and Android/Termux. Full block list, settings keys, and cache TTLs live in [API.md](API.md); read it when you need an exact block name, setting path, or default.

## Setup

```bash
npx about-system # run once, no install
npm install -g about-system # then: about-system
about-system --install # add it as a shell greeting
```

The package is **ESM-only** (`"type": "module"`) and ships four entry points: `.` (library), `./api` (raw info functions), `./cli`, `./types`.

## Picking the right call

| You want | Call |
| --- | --- |
| Everything, formatted | `about-system` |
| Only some blocks | `about-system cpu,ram_used,disk_used` — positional, comma-separated, no flag |
| Machine-readable output | `about-system --json` |
| One value in a script/dashboard | `import { getSystemInfo } from "about-system"` → `(await getSystemInfo()).cpu` |
| One block, cheaply, no full sweep | `import { infoFunctions } from "about-system/api"` → `infoFunctions.cpu({ cache: {} })` |
| Run on every terminal launch | `about-system --install` |
| Change a color/emoji/label | `about-system --set colors.user blue` |
| Force fresh values | `about-system --refresh` |

## Recipes

**Programmatic, whole snapshot** — `getSystemInfo()` is async, loads the on-disk cache itself, and returns a `SystemInfo` object:

```ts
import { getSystemInfo } from "about-system";
const info = await getSystemInfo();
console.log(info.cpu, info.ram_used);
```

**Individual blocks** — `infoFunctions` is a map keyed by block name (`cpu`, `ram_used`, `uptime`, `ports`, `containers`, …). Pass a context so repeated calls share a cache; blocks that shell out or hit the network return promises:

```ts
import { infoFunctions } from "about-system/api";
const context = { cache: {} };
const cpu = infoFunctions.cpu(context);
const uptime = infoFunctions.uptime();
```

**Customize the line** — `--set <path> <value>` writes into the settings JSON: `display.show_emojis false`, `colors.cpu orange`, `emojis.cpu "🚀 "`, `labels.ram_used "Memory"`, `display_order` (edit the file directly for nested arrays). `--settings-show` prints the current file, `--settings-reset` restores defaults, `--settings-init` writes a fresh one.

**Types** — `import type { SystemInfo, SystemInfoOptions, Platform, InfoContext } from "about-system/types"`.

## Troubleshooting

| Symptom | Cause → fix |
| --- | --- |
| `infoFunctions is not exported` / undefined import | The root entry exports only `getSystemInfo`, `loadCache`, `saveCache` and types. `infoFunctions` lives in the `about-system/api` subpath — the README's root import is wrong. |
| `--cache-clear` does nothing / unknown flag | That flag in the README doesn't exist. The real one is `--refresh`. |
| Values are stale (IP, disk, uptime) | Cached by design, per-block TTL (IP 5 min, CPU/OS/device 24 h, top process 5 s). Run `--refresh`, or delete `systeminfo-cache.json` in the OS temp dir. |
| A block prints empty | The underlying tool isn't on that platform/PATH (`docker` for `containers`, `nvidia-smi`/`system_profiler` for `gpu`, `ss`/`netstat` for `ports`). Empty is the intended fallback, not a crash — drop the block from `display_order` if you don't want the gap. |
| Network blocks (`ip`, `city`, `isp`, `domain`) all blank | No outbound network, or the lookup timed out. They share one cached IP-info fetch; everything else still renders. |
| Greeting didn't appear after `--install` | The line is appended to the config of the shell that was detected (`~/.bashrc`, `~/.zshrc`, `~/.config/fish/config.fish`, `~/.config/nushell/config.nu`). Open a new shell, or if you use PowerShell add the printed line to `$PROFILE` yourself. |
| `--set` seems ignored | You set a key the renderer doesn't read (typo in the path) or the block isn't in `display_order`. Check with `--settings-show`; reset with `--settings-reset` if the file got malformed. |
| `ERR_REQUIRE_ESM` when importing | ESM-only package. Use `import`, or `await import("about-system")` from CJS. |
| Emoji render as boxes | Terminal font lacks the glyphs — `about-system --set display.show_emojis false` falls back to text labels. |
80 changes: 80 additions & 0 deletions skills/ask-api2ai/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# api2ai API Reference

## CLI

```
api2ai <openapi-spec> [output-folder] [options]
```

| Option | Default | Description |
| --- | --- | --- |
| `--name <name>` | `api-mcp-server` | Server name |
| `--base-url <url>` | from spec | Override the API base URL |
| `--port <port>` | `3000` | Server port |
| `--allow-mutations` | off | Enable `POST`/`PUT`/`PATCH`/`DELETE` tools by default |
| `--include-tags <tags>` | — | Comma-separated allowlist of tags |
| `--exclude-tags <tags>` | — | Comma-separated denylist of tags |
| `--approve-writes` | off | Drop the approval requirement for restricted tools |
| `--help` | — | Usage |

## Programmatic

```js
import { generateMcpServer, extractTools, loadOpenApiSpec } from "api2ai";
```

| Function | Purpose |
| --- | --- |
| `generateMcpServer(spec, outDir, options)` | Write a complete server; resolves to `{ toolCount, … }` |
| `loadOpenApiSpec(pathOrUrl)` | Load and parse a spec |
| `extractTools(spec, options)` | Get the tool list without generating files |

Options: `serverName`, `baseUrl`, `port`, `allowMutations`, `includeTags`, `excludeTags`, `excludeOperationIds`, `filterFn(tool)`. Each `tool` exposes at least `method`, `pathTemplate`, `operationId`, and `riskLevel`.

## Risk levels

| Level | Assigned when | Default |
| --- | --- | --- |
| `low` | `GET`/`HEAD`/`OPTIONS`, no dangerous keywords | Enabled, no approval |
| `medium` | Any mutating method | Blocked unless `ALLOW_RESTRICTED_TOOLS=true` |
| `high` | Admin, auth, billing, payments, tokens, secrets, user management | Blocked, approval required |

## Generated output

```
my-mcp-server/
├── .env / .env.example / .gitignore
├── package.json
├── README.md
└── src/
├── index.js # server + tool registrations
├── http-client.js # hardened HTTP client
├── tools-config.js # tools with risk metadata
└── policy.js # runtime policy
```

## Generated server endpoints

| Endpoint | Purpose |
| --- | --- |
| `GET /inspector` | Interactive tool testing UI (no auth — restrict in production) |
| `POST /mcp` | MCP protocol endpoint |
| `GET /sse` | Server-Sent Events transport |
| `GET /health` | Health check |

## Generated server environment variables

| Variable | Default | Description |
| --- | --- | --- |
| `PORT` | `3000` | Server port |
| `NODE_ENV` | `development` | |
| `API_BASE_URL` | from spec | Upstream base URL |
| `API_KEY` | — | Bearer token for the upstream API |
| `API_AUTH_HEADER` | — | Custom auth header as `Name:value` |
| `MCP_URL` | — | Public URL used by widgets |
| `ALLOWED_ORIGINS` | — | CORS origins in production |
| `ALLOW_RESTRICTED_TOOLS` | `false` | Unlock medium/high-risk tools |
| `REQUIRE_APPROVALS` | `true` | Approval gate for restricted tools |
| `ALLOWED_API_HOSTS` | spec host | Outbound host allowlist |
| `REQUEST_TIMEOUT_MS` | `30000` | Outbound timeout |
| `MAX_RESPONSE_BYTES` | `10485760` | Response size cap |
Loading