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
160 changes: 160 additions & 0 deletions .agents/skills/defold-api-fetch/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
---
name: defold-api-fetch
description: "Fetches Defold API documentation. Use when working with Defold engine APIs, looking up Lua/C++ functions, or needing API reference for game development."
---

# Defold API Reference

Fetch documentation from the links below (the URLs point to plain Markdown files).

## Lua APIs (Most Common)

| Namespace | URL |
|-----------|-----|
| go (Game object) | https://defold.com/llms/apis/go-lua.md |
| gui (GUI) | https://defold.com/llms/apis/gui-lua.md |
| msg (Message) | https://defold.com/llms/apis/msg-lua.md |
| vmath (Vector math) | https://defold.com/llms/apis/vmath-lua.md |
| sprite (Sprite) | https://defold.com/llms/apis/sprite-lua.md |
| factory (Factory) | https://defold.com/llms/apis/factory-lua.md |
| collectionfactory (Collection factory) | https://defold.com/llms/apis/collectionfactory-lua.md |
| collectionproxy (Collection proxy) | https://defold.com/llms/apis/collectionproxy-lua.md |
| physics (Collision object) | https://defold.com/llms/apis/physics-lua.md |
| sound (Sound) | https://defold.com/llms/apis/sound-lua.md |
| timer (Timer) | https://defold.com/llms/apis/timer-lua.md |
| sys (System) | https://defold.com/llms/apis/sys-lua.md |
| resource (Resource) | https://defold.com/llms/apis/resource-lua.md |
| render (Render) | https://defold.com/llms/apis/render-lua.md |
| particlefx (Particle effects) | https://defold.com/llms/apis/particlefx-lua.md |
| label (Label) | https://defold.com/llms/apis/label-lua.md |
| tilemap (Tilemap) | https://defold.com/llms/apis/tilemap-lua.md |
| model (Model) | https://defold.com/llms/apis/model-lua.md |
| camera (Camera) | https://defold.com/llms/apis/camera-lua.md |
| window (Window) | https://defold.com/llms/apis/window-lua.md |
| buffer (Buffer) | https://defold.com/llms/apis/buffer-lua.md |
| graphics (Graphics) | https://defold.com/llms/apis/graphics-lua.md |
| image (Image) | https://defold.com/llms/apis/image-lua.md |
| json (JSON) | https://defold.com/llms/apis/json-lua.md |
| http (HTTP) | https://defold.com/llms/apis/http-lua.md |
| html5 (HTML5) | https://defold.com/llms/apis/html5-lua.md |
| crash (Crash) | https://defold.com/llms/apis/crash-lua.md |
| profiler (Profiler) | https://defold.com/llms/apis/profiler-lua.md |
| liveupdate (LiveUpdate) | https://defold.com/llms/apis/liveupdate-lua.md |
| builtins (Built-ins) | https://defold.com/llms/apis/builtins-lua.md |
| types (Types) | https://defold.com/llms/apis/types-lua.md |

## Lua Standard Library

| Namespace | URL |
|-----------|-----|
| base (Base) | https://defold.com/llms/apis/base-lua.md |
| coroutine (Coroutine) | https://defold.com/llms/apis/coroutine-lua.md |
| debug (Debug) | https://defold.com/llms/apis/debug-lua.md |
| io (Io) | https://defold.com/llms/apis/io-lua.md |
| math (Math) | https://defold.com/llms/apis/math-lua.md |
| os (Os) | https://defold.com/llms/apis/os-lua.md |
| package (Package) | https://defold.com/llms/apis/package-lua.md |
| string (String) | https://defold.com/llms/apis/string-lua.md |
| table (Table) | https://defold.com/llms/apis/table-lua.md |
| bit (BitOp) | https://defold.com/llms/apis/bit-lua.md |
| socket (LuaSocket) | https://defold.com/llms/apis/socket-lua.md |
| zlib (Zlib) | https://defold.com/llms/apis/zlib-lua.md |

## Box2D Physics

| Namespace | URL |
|-----------|-----|
| b2d | https://defold.com/llms/apis/b2d-lua.md |
| b2d.body | https://defold.com/llms/apis/b2d.body-lua.md |

## Editor Scripting

| Namespace | URL |
|-----------|-----|
| editor (Editor) | https://defold.com/llms/apis/editor-lua.md |

## Extension APIs

> **Note:** Extension APIs (`extension-*`) require the corresponding extension to be added as a dependency in `game.project`. To learn how to install and configure a specific extension, use the `defold-docs-fetch` skill to look up its documentation page.

| Extension | URL |
|-----------|-----|
| crypt (Crypt) | https://defold.com/llms/apis/extension-crypt_crypt.md |
| safearea (SafeArea) | https://defold.com/llms/apis/extension-safearea_safearea.md |
| poki_sdk (Poki SDK) | https://defold.com/llms/apis/extension-poki-sdk_poki_sdk.md |
| websocket (WebSocket) | https://defold.com/llms/apis/extension-websocket_websocket.md |
| webview (WebView) | https://defold.com/llms/apis/extension-webview_webview.md |
| iap (In-App Purchase) | https://defold.com/llms/apis/extension-iap_iap.md |
| push (Push) | https://defold.com/llms/apis/extension-push_push.md |
| facebook (Facebook) | https://defold.com/llms/apis/extension-facebook_facebook.md |
| firebase (Firebase) | https://defold.com/llms/apis/extension-firebase_firebase.md |
| firebase (Firebase Analytics) | https://defold.com/llms/apis/extension-firebase-analytics_firebase.md |
| firebase (Firebase RemoteConfig) | https://defold.com/llms/apis/extension-firebase-remoteconfig_firebase.md |
| admob (AdMob) | https://defold.com/llms/apis/extension-admob_admob.md |
| ironsource (IronSource) | https://defold.com/llms/apis/extension-ironsource_ironsource.md |
| gpgs (Google Play Games) | https://defold.com/llms/apis/extension-gpgs_gpgs.md |
| steam (Steam) | https://defold.com/llms/apis/extension-steam_steam.md |
| review (Review) | https://defold.com/llms/apis/extension-review_review.md |
| iac (Inter-App Communication) | https://defold.com/llms/apis/extension-iac_iac.md |
| adinfo (Ad Info) | https://defold.com/llms/apis/extension-adinfo_adinfo.md |
| permissions (Permissions) | https://defold.com/llms/apis/extension-permissions_permissions.md |
| camera (Camera Extension) | https://defold.com/llms/apis/extension-camera_camera.md |
| networkinfo (Network Info) | https://defold.com/llms/apis/extension-network-info_networkinfo.md |
| spine (Spine) | https://defold.com/llms/apis/extension-spine_spine.md |
| spine gui (Spine GUI) | https://defold.com/llms/apis/extension-spine_gui.md |
| rive (Rive) | https://defold.com/llms/apis/extension-rive_rive.md |
| fmod (FMOD) | https://defold.com/llms/apis/extension-fmod_fmod.md |
| fontgen (Font Gen) | https://defold.com/llms/apis/extension-fontgen_fontgen.md |
| crazygames (CrazyGames) | https://defold.com/llms/apis/extension-crazygames_crazygames.md |
| pad (Play Asset Delivery) | https://defold.com/llms/apis/extension-pad_pad.md |
| instantapp (Google Play Instant) | https://defold.com/llms/apis/extension-googleplayinstant_instantapp.md |
| siwa (Sign in with Apple) | https://defold.com/llms/apis/extension-siwa_siwa.md |
| zendesk (Zendesk) | https://defold.com/llms/apis/extension-zendesk_zendesk.md |
| xsolla (Xsolla) | https://defold.com/llms/apis/extension-xsolla_shop.md |
| realtime (Photon Realtime) | https://defold.com/llms/apis/extension-photon-realtime_realtime.md |
| odin (ODIN Voice) | https://defold.com/llms/apis/extension-odin_odin.md |
| adpf (Android ADPF) | https://defold.com/llms/apis/extension-adpf_adpf.md |

## C++ Native Extension APIs

| Namespace | URL |
|-----------|-----|
| dmExtension (Extension) | https://defold.com/llms/apis/engine-extension-src-dmsdk-extension-extension-h.md |
| dmScript (Script) | https://defold.com/llms/apis/engine-script-src-dmsdk-script-script-h.md |
| dmBuffer (Buffer) | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-buffer-h.md |
| dmGameObject | https://defold.com/llms/apis/engine-gameobject-src-dmsdk-gameobject-gameobject-h.md |
| dmGraphics | https://defold.com/llms/apis/engine-graphics-src-dmsdk-graphics-graphics-h.md |
| dmGui | https://defold.com/llms/apis/engine-gui-src-dmsdk-gui-gui-h.md |
| dmRender | https://defold.com/llms/apis/engine-render-src-dmsdk-render-render-h.md |
| dmResource | https://defold.com/llms/apis/engine-resource-src-dmsdk-resource-resource-h.md |
| dmSound | https://defold.com/llms/apis/engine-sound-src-dmsdk-sound-sound-h.md |
| dmPhysics | https://defold.com/llms/apis/engine-physics-src-dmsdk-physics-physics-h.md |
| dmVMath | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-vmath-h.md |
| Hash | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-hash-h.md |
| Log | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-log-h.md |
| dmMutex | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-mutex-h.md |
| dmThread | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-thread-h.md |
| dmSocket | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-socket-h.md |
| dmHttpClient | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-http_client-h.md |
| dmConfigFile | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-configfile-h.md |
| dmCrypt | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-crypt-h.md |
| dmImage | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-image-h.md |
| dmMessage | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-message-h.md |
| dmProfile | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-profile-h.md |
| dmSys | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-sys-h.md |
| dmTime | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-time-h.md |
| dmTransform | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-transform-h.md |
| dmURI | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-uri-h.md |
| dmAndroid | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-android-h.md |
| Array | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-array-h.md |
| Hashtable | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-hashtable-h.md |
| dmMemory | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-memory-h.md |
| dmWebServer | https://defold.com/llms/apis/engine-dlib-src-dmsdk-dlib-webserver-h.md |

## Usage

When you need API documentation:

1. Identify the namespace (e.g., `go`, `gui`, `vmath`)
2. Fetch the corresponding URL (all URLs are plain Markdown — fetch and read the raw content)
3. Example: fetch `https://defold.com/llms/apis/go-lua.md`
1 change: 1 addition & 0 deletions .agents/skills/defold-assets-search/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
assets/
92 changes: 92 additions & 0 deletions .agents/skills/defold-assets-search/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
name: defold-assets-search
description: "Searches the Defold Asset Store for community libraries and extensions. Use BEFORE writing custom modules for pathfinding, RNG, UI, save/load, localization, tweening, input handling, etc. Helps find, compare, and install Defold dependencies."
---

# Defold Asset Store Search

Search the Defold community Asset Store to find existing libraries instead of writing custom code.

## When to use

**ALWAYS search the Asset Store first** when a task requires functionality like:
- Pathfinding (A*, navigation)
- Random number generation
- UI components / GUI frameworks
- Save/load systems
- Localization / i18n
- Tweening / easing
- Input handling / gestures
- Camera control
- Screen management
- Event systems
- Dialogue / narrative systems
- Physics helpers (AABB, raycasting)
- Any other reusable game module

## Procedure

### Step 1: Generate and search the index

The index file is `.agents/skills/defold-assets-search/assets/dependencies_index.tsv`. If it already exists and is less than 24 hours old, use it directly. Otherwise, regenerate it by running `python .agents/skills/defold-assets-search/scripts/generate_index.py` from the project root. The TSV columns:

```
id title author description tags stars api example_code manifest_url latest_zip
```

Use `Grep` to search the generated TSV file by keyword with `literal: true` for single keywords, or Rust-style regex alternation `keyword1|keyword2` (no backslashes before `|`) for multiple keywords. Search not only the user's exact terms but also synonyms and related words (e.g., RNG → random, i18n → localization, tween → easing, pathfinding → A*). Entries are sorted by stars (descending).

### Step 2: Research candidates in depth

For each candidate found in Step 1 (up to top 5 by stars):
1. **Skip `scene3d`** — this module is deprecated and should NOT be suggested.
2. If the `example_code` column has a URL, fetch the URL to study the library's README, usage examples, and features.
3. If the `api` column has a URL, fetch it too for API details.
4. Use the gathered information to understand what each library actually does and how it compares to alternatives.
5. If you need more details (all available versions, sub-dependencies, etc.), fetch the `manifest_url` from the index.

### Step 3: Present candidates to the user

After studying all candidates, show the user **2-3 best candidates** with:
- Title, author, stars count
- Brief description based on your research (not just the short TSV description)
- Key features / pros / cons
- Your recommendation and reasoning

Ask the user which one to use, or recommend the best one.

### Step 4: Install the dependency

1. The `latest_zip` column contains the dependency URL to add to `game.project`.
2. Open `game.project` and add the URL to the `[project] dependencies` field (comma-separated list).
3. Run the `defold-project-setup` skill to download the dependency into `.deps/`.
4. Tell the user: **"In the Defold editor, go to Project → Fetch Libraries to sync."**
5. After the dependency is downloaded, scan its folder in `.deps/` for `.script_api` files and `.lua` modules to learn the full API. Use this to show usage examples or suggest how to apply the library in the context of the user's original request.

## Community defaults

These libraries are the de facto standard choices in the Defold community:

| Need | Library | Author |
|------|---------|--------|
| GUI framework | **Druid** | Insality |
| Screen management | **Monarch** | Björn Ritzl |
| General-purpose utilities (especially `flow` and `broadcast`) | **Ludobits** | Björn Ritzl |
| OS/window functions | **DefOS** | Brian Kramer |
| Ready-made render script with shadows & post-processing | **Light and Shadows** | Igor Suntsev |
| High-quality 2D downscale (UI, sprites) | **Sharp Sprite** | Indiesoft LLC |

**Camera** — a separate camera library is NOT needed. The built-in Defold camera component and its API already cover all common use cases.

Prefer these over alternatives unless the user has a specific reason to choose otherwise.

## Notable authors and libraries

| Author | Known for | Libraries |
|--------|-----------|-----------|
| **Insality** | Best-in-class Lua modules with detailed API docs | Druid (UI), Panthera (animation), Defold-Event, Defold-Saver, Defold-Tweener, Defold-Lang, Defold-Log, Defold-Token, Defold-Quest, Decore |
| **Björn Ritzl** | Defold core team, prolific contributor | Monarch (screens), Orthographic (camera), Gooey (GUI), Rich Text, Defold-Input, DefTest |
| **Selim Anaç** | High-performance native extensions | A* Pathfinding, DAABBCC (AABB tree), PCG Random, Graph Pathfinder, Tile Raycast |
| **Brian Kramer** | Practical game utilities | DefOS, DefSave, DefMath, DefGlot, DefBlend |
| **Roman Silin** | 3D game tools | Illumination, Kinematic Walker, Operator (camera), Narrator (Ink), TrenchFold |
| **Indiesoft LLC** | Visual effects and platform tools | Hyper Trails, Sharp Sprite, YaGames, ResZip, Dissolve FX, SplitMix64 |
69 changes: 69 additions & 0 deletions .agents/skills/defold-assets-search/scripts/generate_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""Download Defold Asset Store JSON and generate a compact TSV index.

Usage:
python .agents/skills/defold-assets-search/scripts/generate_index.py

Output:
.agents/skills/defold-assets-search/assets/dependencies_index.tsv
"""

import json
import os
import urllib.request

SOURCE_URL = "https://insality.github.io/asset-store/dependencies_store.json"
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
OUTPUT_DIR = os.path.join(SCRIPT_DIR, os.pardir, "assets")
OUTPUT_FILE = os.path.join(OUTPUT_DIR, "dependencies_index.tsv")


def main() -> None:
print(f"Downloading {SOURCE_URL} ...")
with urllib.request.urlopen(SOURCE_URL) as resp:
raw = json.loads(resp.read().decode("utf-8"))

# The JSON has an "items" key containing the list
data: list[dict] = raw.get("items", raw) if isinstance(raw, dict) else raw

os.makedirs(OUTPUT_DIR, exist_ok=True)

# Exclude unlisted entries
entries = [e for e in data if not e.get("unlisted", False)]

# Sort by stars descending (None → 0)
entries.sort(key=lambda e: e.get("stars") or 0, reverse=True)

header = "id\ttitle\tauthor\tdescription\ttags\tstars\tapi\texample_code\tmanifest_url\tlatest_zip"
lines: list[str] = [header]

for e in entries:
latest_zip = ""
content = e.get("content") or []
if content:
latest_zip = content[-1]

tags_str = ", ".join(e.get("tags") or [])
desc = (e.get("description") or "").replace("\t", " ").replace("\n", " ")

line = "\t".join([
e.get("id") or "",
e.get("title") or "",
e.get("author") or "",
desc,
tags_str,
str(e.get("stars") or 0),
e.get("api") or "",
e.get("example_code") or "",
e.get("manifest_url") or "",
latest_zip,
])
lines.append(line)

with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
f.write("\n".join(lines) + "\n")

print(f"Generated {OUTPUT_FILE} with {len(entries)} entries.")


if __name__ == "__main__":
main()
Loading
Loading