Commit Graph
6 Commits
Author SHA1 Message Date
Willie e780fbf1ab fix(sync): honour agent frontmatter targets when syncing agents
The agent discovery already parsed the `targets` frontmatter list into
DiscoveredResource.Targets, but no agent sync path ever applied it, so an
agent declared for one tool was still delivered to every agent-capable
target. Agents have no shared schema across harnesses, so this gives authors
a way to keep a per-tool variant of the same agent without cross-polluting
targets. Applied in CLI sync (global and project), the dashboard sync
handler, doctor's expected count and the target summary so all views agree.

Refs #267
2026-09-02 13:36:30 +08:00
Willie 6d1f675a17 fix(sync): strip .md extension in agent filter matching and add tests
FilterAgents matched against FlatName which includes .md (e.g.
"tutor.md"), so user patterns like "tutor" or "team-*" silently
matched nothing. Strip the .md suffix before pattern comparison so
agent filters behave consistently with skill filters.

Add FilterAgents unit tests (include, exclude, combined, nested,
glob, invalid pattern) and integration tests for both filter paths:
- include/exclude config patterns (4 tests)
- .agentignore disabled state (3 tests: explicit, glob, nested)
2026-04-09 14:14:05 +08:00
Willie f5af6c3909 feat(ui): unify skills/agents under /resources route and API
- Rename route /skills → /resources (pages, detail, new)
- Rename API /api/skills → /api/resources with response keys
  skills → resources, skill → resource
- Rename SkillDetailPage → ResourceDetailPage, variable skill → resource
- KindBadge: show full 'Skill'/'Agent' text, remove size prop
- Show 'local' type badge when source type is empty
- Dashboard: remove Sync Mode stat card, use 4-col grid
- Resources: remove redundant Skills/Agents filter chips (tabs handle it)
- Agent audit: add ?kind=agent support to /api/audit endpoint
- Agent sync matrix: include agents in /api/sync-matrix with
  builtin target path fallback and include/exclude filtering
- FilterAgents: new function in internal/sync/filter.go
- Agent sync: apply include/exclude filters before syncing
2026-04-09 01:26:30 +08:00
Willie 7858cb2c40 feat(api): add sync-matrix API and ClassifySkillForTarget
Backend for Filter Studio feature:
- ClassifySkillForTarget() in internal/sync/classify.go — determines
  skill sync status per target (synced/excluded/not_included/
  skill_target_mismatch) with reason strings
- firstMatchingPattern() helper in filter.go for exclude reason reporting
- GET /api/sync-matrix — returns full skill×target classification matrix
- POST /api/sync-matrix/preview — what-if preview with draft patterns
- 8 classify unit tests + 7 handler tests (empty, filters, query param,
  preview, invalid pattern, missing target)
2026-03-17 04:48:42 +08:00
Willie a29e198725 feat: add target filter CLI, skill-level targets field, and Web UI support
- CLI: `target <name> --add-include/--add-exclude/--remove-include/--remove-exclude`
- SKILL.md `targets` frontmatter restricts sync to specified targets
- Cross-mode matching (e.g. "claude" matches "claude-code" project target)
- Web UI: inline filter editor on Targets page, target badges on Skills pages
- API: PATCH /api/targets/{name} for filter updates
- Fix drift detection in doctor/status/handler to account for skill-level targets
- `check` warns about unknown target names in skill-level targets field
- Docs: update skill-format, target command, configuration, creating-skills
2026-02-15 23:29:30 +08:00
Willie bd75ef8939 feat: support target include/exclude filters across sync, UI, and docs 2026-02-14 00:21:48 +08:00