Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
307060c
Update deps, async play_music, Progress rewrite
kino14910 May 20, 2026
f45587c
update
kino14910 May 20, 2026
6a9ecda
feat: 新增音频播放基础功能与元数据解析
kino14910 May 21, 2026
cbf9e2f
feat: 实现完整音乐播放功能,添加音量控制和元数据展示
kino14910 May 22, 2026
9e51639
feat: 添加音乐文件夹扫描与批量导入播放功能
kino14910 May 23, 2026
d5d73ec
feat: 完成音乐播放器核心功能开发
kino14910 May 23, 2026
8af9d2e
Update TrackList.svelte
kino14910 May 23, 2026
deda3e9
feat: add media library pages and shared components
kino14910 May 24, 2026
2d050a6
Add Heading, parse album artist, UI refactor
kino14910 May 25, 2026
3d86a76
add settings and extension
kino14910 May 25, 2026
9642880
Refactor settings page
kino14910 May 25, 2026
2ce78b0
fix styles
kino14910 May 26, 2026
c6f67e9
refactor(library): move startup scan to Tauri setup with event-driven…
kino14910 May 28, 2026
45cc9c5
feat(player): extend Track model with id/url and implement playback q…
kino14910 May 28, 2026
4cecbb2
refactor: simplify state architecture and isolate player playlist
kino14910 May 30, 2026
89a3507
Add QueueDrawer
kino14910 May 30, 2026
0c37e7b
feat: implement isolated player playlist and queue management
kino14910 May 30, 2026
9b69b88
Add SearchBar, global search & responsive lists
kino14910 May 30, 2026
6564133
refactor: implement derived music maps and toggleable album grouping
kino14910 May 30, 2026
d765c6e
Add media session controls and tray settings
kino14910 May 31, 2026
7ae4274
Update player.svelte.ts
kino14910 May 31, 2026
a81722c
refactor some styles
kino14910 May 31, 2026
3b3beac
Update deps; add shortcuts, config, media controls
kino14910 May 31, 2026
f8c20e1
Add Tauri backend services, SQLite repos
kino14910 Jun 1, 2026
3f77fde
refactor(audio): refactor audio & playback queue, add queue model
kino14910 Jun 3, 2026
0dbb3f0
refactor: replace String error type with AppError across commands and…
kino14910 Jun 3, 2026
6c91cc2
eat: Add an AudioEngine trait and a WebAudioEngine implementation
kino14910 Jun 3, 2026
1fd3fcf
Refactor playback, events, repos and async I/O
kino14910 Jun 5, 2026
2a79e69
bugs fix
kino14910 Jun 5, 2026
f8b0aa6
Add plugin system
kino14910 Jun 5, 2026
a343b6f
Complete plugin system and a lyrics plugin
kino14910 Jun 7, 2026
bdb6a1e
remove version
kino14910 Jun 7, 2026
b271dff
Add plugin settings, migration and code cleanup
kino14910 Jun 8, 2026
84298a6
rename project title
kino14910 Jun 8, 2026
129ccfb
update
kino14910 Jun 11, 2026
d7604c6
change lyrics to crate
kino14910 Jun 11, 2026
86dfdd7
Delete path from struct and interface
kino14910 Jun 18, 2026
015b5ef
update
kino14910 Jun 18, 2026
f58b78c
Add @tanstack/svelte-virtual
kino14910 Jun 18, 2026
5a75707
Introduce ManifestRegistry and manifest-driven plugins
kino14910 Jun 21, 2026
883192f
fix manifast
kino14910 Jun 21, 2026
d6bf0b5
Refactor virtualizers and add plugin route
kino14910 Jun 22, 2026
19ff7ce
feat: dynamic plugin loading
kino14910 Jun 24, 2026
51f173d
add equalizer
kino14910 Jun 26, 2026
a8dc588
add fonts locally instead of fetching
kino14910 Jun 28, 2026
cdc9aff
add skills
kino14910 Jul 8, 2026
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
66 changes: 66 additions & 0 deletions .agents/skills/svelte-code-writer/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: svelte-code-writer
description: CLI tools for Svelte 5 documentation lookup and code analysis. MUST be used whenever creating, editing or analyzing any Svelte component (.svelte) or Svelte module (.svelte.ts/.svelte.js). If possible, this skill should be executed within the svelte-file-editor agent for optimal results.
---

# Svelte 5 Code Writer

## CLI Tools

You have access to `@sveltejs/mcp` CLI for Svelte-specific assistance. Use these commands via `npx`:

### List Documentation Sections

```bash
npx @sveltejs/mcp list-sections
```

Lists all available Svelte 5 and SvelteKit documentation sections with titles and paths.

### Get Documentation

```bash
npx @sveltejs/mcp get-documentation "<section1>,<section2>,..."
```

Retrieves full documentation for specified sections. Use after `list-sections` to fetch relevant docs.

**Example:**

```bash
npx @sveltejs/mcp get-documentation "$state,$derived,$effect"
```

### Svelte Autofixer

```bash
npx @sveltejs/mcp svelte-autofixer "<code_or_path>" [options]
```

Analyzes Svelte code and suggests fixes for common issues.

**Options:**

- `--async` - Enable async Svelte mode (default: false)
- `--svelte-version` - Target version: 4 or 5 (default: 5)

**Examples:**

```bash
# Analyze inline code (escape $ as \$)
npx @sveltejs/mcp svelte-autofixer '<script>let count = \$state(0);</script>'

# Analyze a file
npx @sveltejs/mcp svelte-autofixer ./src/lib/Component.svelte

# Target Svelte 4
npx @sveltejs/mcp svelte-autofixer ./Component.svelte --svelte-version 4
```

**Important:** When passing code with runes (`$state`, `$derived`, etc.) via the terminal, escape the `$` character as `\$` to prevent shell variable substitution.

## Workflow

1. **Uncertain about syntax?** Run `list-sections` then `get-documentation` for relevant topics
2. **Reviewing/debugging?** Run `svelte-autofixer` on the code to detect issues
3. **Always validate** - Run `svelte-autofixer` before finalizing any Svelte component
176 changes: 176 additions & 0 deletions .agents/skills/svelte-core-bestpractices/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
name: svelte-core-bestpractices
description: Guidance on writing fast, robust, modern Svelte code. Load this skill whenever in a Svelte project and asked to write/edit or analyze a Svelte component or module. Covers reactivity, event handling, styling, integration with libraries and more.
---

## `$state`

Only use the `$state` rune for variables that should be _reactive_ — in other words, variables that cause an `$effect`, `$derived` or template expression to update. Everything else can be a normal variable.

Objects and arrays (`$state({...})` or `$state([...])`) are made deeply reactive, meaning mutation will trigger updates. This has a trade-off: in exchange for fine-grained reactivity, the objects must be proxied, which has performance overhead. In cases where you're dealing with large objects that are only ever reassigned (rather than mutated), use `$state.raw` instead. This is often the case with API responses, for example.

## `$derived`

To compute something from state, use `$derived` rather than `$effect`:

```js
// do this
let square = $derived(num * num);

// don't do this
let square;

$effect(() => {
square = num * num;
});
```

> [!NOTE] `$derived` is given an expression, _not_ a function. If you need to use a function (because the expression is complex, for example) use `$derived.by`.

Deriveds are writable — you can assign to them, just like `$state`, except that they will re-evaluate when their expression changes.

If the derived expression is an object or array, it will be returned as-is — it is _not_ made deeply reactive. You can, however, use `$state` inside `$derived.by` in the rare cases that you need this.

## `$effect`

Effects are an escape hatch and should mostly be avoided. In particular, avoid updating state inside effects.

- If you need to sync state to an external library such as D3, it is often neater to use [`{@attach ...}`](references/@attach.md)
- If you need to run some code in response to user interaction, put the code directly in an event handler or use a [function binding](references/bind.md) as appropriate
- If you need to log values for debugging purposes, use [`$inspect`](references/$inspect.md)
- If you need to observe something external to Svelte, use [`createSubscriber`](references/svelte-reactivity.md)

Never wrap the contents of an effect in `if (browser) {...}` or similar — effects do not run on the server.

## `$props`

Treat props as though they will change. For example, values that depend on props should usually use `$derived`:

```js
// @errors: 2451
let { type } = $props();

// do this
let color = $derived(type === 'danger' ? 'red' : 'green');

// don't do this — `color` will not update if `type` changes
let color = type === 'danger' ? 'red' : 'green';
```

## `$inspect.trace`

`$inspect.trace` is a debugging tool for reactivity. If something is not updating properly or running more than it should you can add `$inspect.trace(label)` as the first line of an `$effect` or `$derived.by` (or any function they call) to trace their dependencies and discover which one triggered an update.

## Events

Any element attribute starting with `on` is treated as an event listener:

```svelte
<button onclick={() => {...}}>click me</button>

<!-- attribute shorthand also works -->
<button {onclick}>...</button>

<!-- so do spread attributes -->
<button {...props}>...</button>
```

If you need to attach listeners to `window` or `document` you can use `<svelte:window>` and `<svelte:document>`:

```svelte
<svelte:window onkeydown={...} />
<svelte:document onvisibilitychange={...} />
```

Avoid using `onMount` or `$effect` for this.

## Snippets

[Snippets](references/snippet.md) are a way to define reusable chunks of markup that can be instantiated with the [`{@render ...}`](references/@render.md) tag, or passed to components as props. They must be declared within the template.

```svelte
{#snippet greeting(name)}
<p>hello {name}!</p>
{/snippet}

{@render greeting('world')}
```

> [!NOTE] Snippets declared at the top level of a component (i.e. not inside elements or blocks) can be referenced inside `<script>`. A snippet that doesn't reference component state is also available in a `<script module>`, in which case it can be exported for use by other components.

## Each blocks

Prefer to use [keyed each blocks](references/each.md) — this improves performance by allowing Svelte to surgically insert or remove items rather than updating the DOM belonging to existing items.

> [!NOTE] The key _must_ uniquely identify the object. Do not use the index as a key.

Avoid destructuring if you need to mutate the item (with something like `bind:value={item.count}`, for example).

## Using JavaScript variables in CSS

If you have a JS variable that you want to use inside CSS you can set a CSS custom property with the `style:` directive.

```svelte
<div style:--columns={columns}>...</div>
```

You can then reference `var(--columns)` inside the component's `<style>`.

## Styling child components

The CSS in a component's `<style>` is scoped to that component. If a parent component needs to control the child's styles, the preferred way is to use CSS custom properties:

```svelte
<!-- Parent.svelte -->
<Child --color="red" />

<!-- Child.svelte -->
<h1>Hello</h1>

<style>
h1 {
color: var(--color);
}
</style>
```

If this is impossible (for example, the child component comes from a library) you can use `:global` to override styles:

```svelte
<div>
<Child />
</div>

<style>
div :global {
h1 {
color: red;
}
}
</style>
```

## Context

Consider using context instead of declaring state in a shared module. This will scope the state to the part of the app that needs it, and eliminate the possibility of it leaking between users when server-side rendering.

Use `createContext` rather than `setContext` and `getContext`, as it provides type safety.

## Async Svelte

If using version 5.36 or higher, you can use [await expressions](references/await-expressions.md) and [hydratable](references/hydratable.md) to use promises directly inside components. Note that these require the `experimental.async` option to be enabled in `svelte.config.js` as they are not yet considered fully stable.

## Avoid legacy features

Always use runes mode for new code, and avoid features that have more modern replacements:

- use `$state` instead of implicit reactivity (e.g. `let count = 0; count += 1`)
- use `$derived` and `$effect` instead of `$:` assignments and statements (but only use effects when there is no better solution)
- use `$props` instead of `export let`, `$$props` and `$$restProps`
- use `onclick={...}` instead of `on:click={...}`
- use `{#snippet ...}` and `{@render ...}` instead of `<slot>` and `$$slots` and `<svelte:fragment>`
- use `<DynamicComponent>` instead of `<svelte:component this={DynamicComponent}>`
- use `import Self from './ThisComponent.svelte'` and `<Self>` instead of `<svelte:self>`
- use classes with `$state` fields to share reactivity between components, instead of using stores
- use `{@attach ...}` instead of `use:action`
- use clsx-style arrays and objects in `class` attributes, instead of the `class:` directive
53 changes: 53 additions & 0 deletions .agents/skills/svelte-core-bestpractices/references/$inspect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
> [!NOTE] `$inspect` only works during development. In a production build it becomes a noop.

The `$inspect` rune is roughly equivalent to `console.log`, with the exception that it will re-run whenever its argument changes. `$inspect` tracks reactive state deeply, meaning that updating something inside an object or array using fine-grained reactivity will cause it to re-fire (demo:

```svelte
<script>
let count = $state(0);
let message = $state('hello');

$inspect(count, message); // will console.log when `count` or `message` change
</script>

<button onclick={() => count++}>Increment</button>
<input bind:value={message} />
```

On updates, a stack trace will be printed, making it easy to find the origin of a state change (unless you're in the playground, due to technical limitations).

## $inspect(...).with

`$inspect` returns a property `with`, which you can invoke with a callback, which will then be invoked instead of `console.log`. The first argument to the callback is either `"init"` or `"update"`; subsequent arguments are the values passed to `$inspect` (demo:

```svelte
<script>
let count = $state(0);

$inspect(count).with((type, count) => {
if (type === 'update') {
debugger; // or `console.trace`, or whatever you want
}
});
</script>

<button onclick={() => count++}>Increment</button>
```

## $inspect.trace(...)

This rune, added in 5.14, causes the surrounding function to be _traced_ in development. Any time the function re-runs as part of an [effect]($effect) or a [derived]($derived), information will be printed to the console about which pieces of reactive state caused the effect to fire.

```svelte
<script>
import { doSomeWork } from './elsewhere';

$effect(() => {
+++// $inspect.trace must be the first statement of a function body+++
+++$inspect.trace();+++
doSomeWork();
});
</script>
```

`$inspect.trace` takes an optional first argument which will be used as the label.
Loading