forinda/tasky/use-asset-manager

Claude Code and agent skill by forinda/tasky

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when code reads template files / JSON fixtures via fs.readFile + path arithmetic — switch to assets.<ns>.<key>() and the kick.config.ts assetMap.

Install

npx vskill@latest install forinda/tasky/use-asset-manager

SKILL.md

The same SKILL.md was published earlier as forinda/tasky/use-asset-manager.

Configure kick.config.ts:

ts
export default defineConfig({
assetMap: {
mails: { src: 'src/templates/mails' },
reports: { src: 'src/templates/reports', glob: '**/*.{ejs,html}' },
},
})

Consume via the typed Proxy — no __dirname arithmetic, dev/prod paths handled:

ts
import { assets } from '@forinda/kickjs'
const html = await assets.mails.welcome() // typed: tsc errors on bad key

Class-field decorator (lazy getter, swappable in tests):

ts
class WelcomeMailService {
@Asset('mails/welcome') private welcomeTemplate!: () => Promise<string>
async send(to: string) {
const body = await this.welcomeTemplate()
}
}

Dynamic dispatch (CMS templates, codegen) — resolveAsset(ns, key) throws UnknownAssetError with { namespace, key } fields when the key is missing.

Test fixtures — swap via env override + cache clear:

ts
beforeEach(() => {
process.env.KICK_ASSETS_ROOT = path.resolve('__fixtures__/assets')
clearAssetCache()
})
afterEach(() => {
delete process.env.KICK_ASSETS_ROOT
clearAssetCache()
})

Red flags:

  • Hand-rolled process.env.NODE_ENV === 'production' ? join(__dirname, '../templates') : join(__dirname, 'templates') — exactly what the asset manager replaces.
  • keys: 'strip' setting in assetMap.<ns> when basenames may collide — silent last-walk-wins data loss. Default 'auto' keeps extensions only for colliding groups.
  • Non-default Vite outDir without mirroring in kick.config.ts — manifest writes at dist/.kickjs-assets.json but the resolver can't find it. Mirror via build.outDir.
  • Forgetting to re-run kick typegen after adding files — assets.mails.newTemplate is a tsc error even though the file ships. kick dev does this on-change; one-shot CI builds need kick build (or kick build:assets for manifest-only).
  • Same-name welcome.ejs + welcome/login.ejs — directory wins in the typed surface; the .ejs file still copies but isn't addressable.

Nuances:

  • Resolution pipeline (cached): KICK_ASSETS_ROOT env override > built manifest at build.outDir / dist / build / out > dev-fallback in-memory walk. Manifest presence = "running from built dist."
  • Dev-mode glob matcher is a lite implementation — **/*, **/*.ext, **/*.{a,b} are guaranteed; exotic globs warn-once and accept everything. Run kick build:assets to exercise the real glob engine.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/forinda/tasky/use-asset-manager/badge)](https://verified-skill.com/skills/forinda/tasky/use-asset-manager)

Something wrong with this skill or its page? Tell us.