Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a4c6bfa
feat: add MCP bridge for E2E test debugging
pythoninthegrass Jan 28, 2026
e168805
docs: update backlog task metadata
pythoninthegrass Jan 28, 2026
42070bb
test(e2e): add search ranking and playlist rename tests
pythoninthegrass Jan 28, 2026
5222096
docs: complete task-229 and task-230
pythoninthegrass Jan 28, 2026
3f8fd94
feat: initial zig-core scaffold for Rust to Zig migration
pythoninthegrass Jan 28, 2026
0ec1483
docs(zig): keep metadata in rust (lofty)
pythoninthegrass Jan 28, 2026
ffed372
build(zig): use pkg-config for taglib
pythoninthegrass Jan 28, 2026
b54a180
build(tauri): build zig-core first
pythoninthegrass Jan 28, 2026
6f362f7
feat(ffi): add rust bindings for zig library
pythoninthegrass Jan 28, 2026
5a6d4d9
fix(build): use pkg-config for taglib linkage
pythoninthegrass Jan 28, 2026
3502f51
fix(ffi): remove unused imports
pythoninthegrass Jan 28, 2026
f70fcd5
test(ffi): add integration tests for zig library
pythoninthegrass Jan 28, 2026
2b693c4
chore: update generated schemas and lock file
pythoninthegrass Jan 28, 2026
62081a9
refactor(ffi): remove old unused ffi module directory
pythoninthegrass Jan 28, 2026
a979076
test(ffi): add real audio test fixtures
pythoninthegrass Jan 29, 2026
e70952c
test(ffi): add comprehensive FFI integration tests with real audio
pythoninthegrass Jan 29, 2026
31726f7
docs: add FFI validation results report
pythoninthegrass Jan 29, 2026
1a73822
feat(zig): add scanner module skeletons
pythoninthegrass Jan 29, 2026
c09e204
feat(zig): add database module skeletons
pythoninthegrass Jan 29, 2026
490d1bf
feat(zig): add Last.fm module skeletons
pythoninthegrass Jan 29, 2026
4f0046e
feat(zig): add commented FFI exports for artwork cache
pythoninthegrass Jan 29, 2026
b4cdb3b
docs: add Zig migration skeleton implementation summary
pythoninthegrass Jan 29, 2026
fadc635
chore: mark tasks 237-246 as Done with implementation notes
pythoninthegrass Jan 29, 2026
d78e873
docs: update development workflow to prioritize task runner
pythoninthegrass Jan 29, 2026
0d1be7b
feat(zig): implement Phase 1 migration modules
pythoninthegrass Jan 29, 2026
36f5cd7
feat(zig): implement scan orchestration module (Task 240)
pythoninthegrass Jan 29, 2026
844ca76
ci (zig.yml): update info task to use semantic commands
pythoninthegrass Jan 29, 2026
c60680f
feat(zig): implement Last.fm client module (Task 246)
pythoninthegrass Jan 29, 2026
55ec3cb
feat(zig): implement DB query modules (Tasks 242-244)
pythoninthegrass Jan 29, 2026
9343de5
docs: mark Zig migration tasks 238-246 as Done
pythoninthegrass Jan 29, 2026
1843d37
feat(zig): wire artwork cache FFI for scanner
pythoninthegrass Jan 29, 2026
d4dc631
refactor: split into Cargo workspace (mt-core + mt-tauri)
pythoninthegrass Jan 29, 2026
09fff0c
feat(zig): add inventory scanner and Last.fm FFI exports
pythoninthegrass Jan 29, 2026
207c777
fix(ci): update workflow paths for workspace structure
pythoninthegrass Jan 29, 2026
b5f9694
fix(ci): add Zig setup for workspace builds
pythoninthegrass Jan 29, 2026
3eaca1f
fix(ci): install TagLib dependency for zig-core build
pythoninthegrass Jan 29, 2026
8a92762
fix(ci): add Homebrew to PATH for self-hosted macOS runner
pythoninthegrass Jan 29, 2026
981206c
docs: add skills, update backlog tasks
pythoninthegrass Jan 29, 2026
3d14850
fix (ci): github path env var
pythoninthegrass Jan 29, 2026
46b9594
chore (ci): skip test artifact uploads due to transient network errors
pythoninthegrass Jan 29, 2026
a5b99c5
fix(test): stabilize library store search test in browser mode
pythoninthegrass Jan 29, 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
73 changes: 73 additions & 0 deletions .agents/skills/discover-zig/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
name: discover-zig
description: Automatically discover Zig programming skills when working with Zig. Activates for zig development tasks.
---

# Zig Skills Discovery

Provides automatic access to comprehensive zig skills.

## When This Skill Activates

This skill auto-activates when you're working with:
- Zig
- systems programming
- comptime
- allocators
- C interop
- build.zig
- zon package manager

## Available Skills

### Quick Reference

The Zig category contains 6 skills:

1. **zig-build-system**
2. **zig-c-interop**
3. **zig-memory-management**
4. **zig-package-management**
5. **zig-project-setup**
6. **zig-testing**

### Load Full Category Details

For complete descriptions and workflows:

```bash
cat ~/.claude/skills/zig/INDEX.md
```

This loads the full Zig category index with:
- Detailed skill descriptions
- Usage triggers for each skill
- Common workflow combinations
- Cross-references to related skills

### Load Specific Skills

Load individual skills as needed:

```bash
cat ~/.claude/skills/zig/zig-build-system.md
cat ~/.claude/skills/zig/zig-c-interop.md
cat ~/.claude/skills/zig/zig-memory-management.md
```

## Progressive Loading

This gateway skill enables progressive loading:
- **Level 1**: Gateway loads automatically (you're here now)
- **Level 2**: Load category INDEX.md for full overview
- **Level 3**: Load specific skills as needed

## Usage Instructions

1. **Auto-activation**: This skill loads automatically when Claude Code detects zig work
2. **Browse skills**: Run `cat ~/.claude/skills/zig/INDEX.md` for full category overview
3. **Load specific skills**: Use bash commands above to load individual skills

---

**Next Steps**: Run `cat ~/.claude/skills/zig/INDEX.md` to see full category details.
89 changes: 89 additions & 0 deletions .agents/skills/zig-best-practices/C-INTEROP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# C Interoperability in Zig

Zig can directly import C headers, call C functions, and expose Zig functions to C. Use these patterns when integrating with existing C libraries or system APIs.

## When to Use

- Wrapping C libraries (raylib, SDL, curl)
- Calling platform-specific system APIs
- Passing callbacks to C code
- Writing Zig libraries callable from C

## Importing C Headers

Use `@cImport` to import C headers directly:

```zig
const ray = @cImport({
@cInclude("raylib.h");
});

pub fn main() void {
ray.InitWindow(800, 450, "window title");
defer ray.CloseWindow();

ray.SetTargetFPS(60);
while (!ray.WindowShouldClose()) {
ray.BeginDrawing();
defer ray.EndDrawing();
ray.ClearBackground(ray.RAYWHITE);
}
}
```

Configure include paths in `build.zig`:

```zig
exe.addIncludePath(.{ .cwd_relative = "/usr/local/include" });
exe.linkSystemLibrary("raylib");
```

## Extern Functions (System APIs)

Call platform APIs without bindings using `extern`:

```zig
const win = @import("std").os.windows;

extern "user32" fn MessageBoxA(
?win.HWND,
[*:0]const u8,
[*:0]const u8,
u32,
) callconv(.winapi) i32;
```

## C Callbacks

Pass Zig functions to C libraries using `callconv(.C)`:

```zig
fn writeCallback(
data: *anyopaque,
size: c_uint,
nmemb: c_uint,
user_data: *anyopaque,
) callconv(.C) c_uint {
const buffer: *std.ArrayList(u8) = @alignCast(@ptrCast(user_data));
const typed_data: [*]u8 = @ptrCast(data);
buffer.appendSlice(typed_data[0 .. nmemb * size]) catch return 0;
return nmemb * size;
}
```

Key points:
- `callconv(.C)` makes the function callable from C
- `*anyopaque` is Zig's equivalent of `void*`
- Use `@alignCast` and `@ptrCast` to recover typed pointers
- Return 0 on error (C convention) since Zig errors can't cross FFI boundary

## C Types Mapping

| C Type | Zig Type |
|--------|----------|
| `void*` | `*anyopaque` |
| `char*` | `[*:0]const u8` (null-terminated) |
| `size_t` | `usize` |
| `int` | `c_int` |
| `unsigned int` | `c_uint` |
| `NULL` | `null` |
70 changes: 70 additions & 0 deletions .agents/skills/zig-best-practices/DEBUGGING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Debugging Memory in Zig

Use GeneralPurposeAllocator (GPA) to detect memory leaks with stack traces showing allocation origins.

## When to Use

- Debugging memory leaks in development
- Validating cleanup logic in complex systems
- Investigating use-after-free or double-free bugs

## GeneralPurposeAllocator Pattern

```zig
const std = @import("std");

pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer std.debug.assert(gpa.deinit() == .ok);
const allocator = gpa.allocator();

// Use allocator for all allocations
const data = try allocator.alloc(u8, 1024);
defer allocator.free(data);

// Any leaked allocations will be reported at deinit
}
```

## Configuration Options

```zig
var gpa = std.heap.GeneralPurposeAllocator(.{
.stack_trace_depth = 10, // Stack frames to capture (default: 8)
.enable_memory_limit = true,
.requested_memory_limit = 1024 * 1024, // 1MB limit
}){};
```

## Leak Report Output

When leaks occur, GPA prints:

```
error: memory leak detected
Leak at 0x7f... (1024 bytes)
src/main.zig:42:25
src/main.zig:38:18
...
```

## Testing with Leak Detection

`std.testing.allocator` wraps GPA and fails tests on leaks:

```zig
test "no memory leaks" {
const allocator = std.testing.allocator;
var list: std.ArrayListUnmanaged(u32) = .empty;
defer list.deinit(allocator);

try list.append(allocator, 42);
// Test fails if list.deinit is missing
}
```

## Production vs Debug

- Use GPA in debug builds for safety
- Switch to `std.heap.page_allocator` or arena in release for performance
- `std.heap.c_allocator` when interfacing heavily with C code
63 changes: 63 additions & 0 deletions .agents/skills/zig-best-practices/GENERICS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Generic Data Structures in Zig

Use comptime type parameters to create reusable generic containers. Return a type from a function to build type-safe collections.

## When to Use

- Implementing custom containers (queues, stacks, trees)
- Building type-safe wrappers around allocations
- Creating domain-specific collections

## Pattern: Type-Returning Function

```zig
pub fn Queue(comptime Child: type) type {
return struct {
const Self = @This();
const Node = struct {
data: Child,
next: ?*Node,
};

allocator: std.mem.Allocator,
start: ?*Node,
end: ?*Node,

pub fn init(allocator: std.mem.Allocator) Self {
return Self{ .allocator = allocator, .start = null, .end = null };
}

pub fn enqueue(self: *Self, value: Child) !void {
const node = try self.allocator.create(Node);
node.* = .{ .data = value, .next = null };
if (self.end) |end| end.next = node else self.start = node;
self.end = node;
}

pub fn dequeue(self: *Self) ?Child {
const start = self.start orelse return null;
defer self.allocator.destroy(start);
if (start.next) |next| self.start = next else {
self.start = null;
self.end = null;
}
return start.data;
}
};
}
```

## Key Techniques

- `@This()` returns the enclosing struct type for self-reference
- Nested `Node` struct keeps implementation details private
- Allocator passed to init, stored for later operations
- `defer` for cleanup in dequeue prevents leaks

## Usage

```zig
var queue = Queue(u32).init(allocator);
try queue.enqueue(42);
const value = queue.dequeue(); // ?u32
```
Loading