Skip to content

Add a namespaced categorical-tag query to skern skill list #96

@Sophylax

Description

@Sophylax

Summary

Add a generic, namespaced categorical-tag query to skern skill list. skern already filters on flat --tag (exact
match); this adds tags of the form category:value, so a caller can narrow a skill set by structured dimensions
without skern knowing what any category means. Fully domain-agnostic. (How untagged skills are treated and how
multiple flags combine are deliberate design questions — see below.)

Scope

  • New repeatable --category category:value flag on skern skill list, with a matcher beside hasTag in
    internal/cli/skill_helpers.go.
  • Category-agnostic: split each tag on the first : to derive its namespace; never enumerate or special-case
    known categories.
  • Base match: for a requested category, a skill matches if it carries category:value. How a skill with no tag
    in that category is treated is a design question (below), not assumed here.
  • Keep the existing --tag flag unchanged. Add --json contract coverage. Touches internal/cli/skill_list.go,
    internal/cli/skill_helpers.go, and tests.

Open design questions (settle before implementation)

Two semantics decisions shape the flag surface and the matcher:

1. Untagged / category-absent handling. When a skill has no tag in a requested category, does it match
("absent = applies to all") or not — and is that the default, or opt-in behind a flag (e.g. --include-untagged,
vs a stricter default)? This changes the base matcher.

2. Combination of multiple flags.

  • Multiple values in the same category (e.g. --category lang:python --category lang:go) — OR within the category
    (match if the skill has any requested value)? This is the likely-needed narrowing case.
  • Multiple distinct categories (e.g. --category lang:python --category topic:testing) — AND across categories
    (the skill must satisfy each)?
  • A natural model is OR within a category, AND across categories. Confirm, and decide the flag shape: repeated
    --category cat:val, a comma list cat:a,b, or both.

Acceptance criteria

  • skern skill list --category <…> --json applies the agreed combination + untagged-handling semantics.
  • Untagged / category-absent skills are handled per the agreed rule (default or flag).
  • Edge cases handled: tag with no colon, empty value, skill with zero tags.
  • --json contract covered; passes the manual-test-verification gate.

Dependencies

None to build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions