Skip to content

[Feat]: CLI config and three-tier skill path resolution (global + project) #246

Description

@rosspeili

Feature Description

Add persistent CLI configuration (global + per-project) and wire three-tier skill path resolution through the loader and all CLI commands that scan disk.

Tiers (aligned with #234 / trust doc vocabulary):

Tier Source Default behavior
Bundled PyPI wheel site-packages/skills/ Always on; read-only in config
Project Repo ./skills/ or explicit project root Auto-detect via walk-up; overridable in project config
External User-added directory(ies) Optional; operator responsibility

Config files (v1 — names negotiable in PR):

  • Global: ~/.config/skillware/config.yaml (or OS-appropriate XDG path)
  • Project: .skillware.yaml in repo root (walk up from cwd)

Schema sketch (v1):

paths:
  project: auto
  external: []
resolution:
  order: [project, external, bundled]
legacy:
  honor_skillware_skill_path: true

Behavior:

Out of scope:

Rationale

Rationale

Today roots are implicit (SKILLWARE_SKILL_PATH → cwd walk → bundled). Operators cannot see or persist project vs external paths; shadowing is silent. Pip-only users need bundled registry as a reliable default; project teams need scoped ./skills/; power users need external folders.

This is the backend for: bundled read-only default, optional project/external paths, multi-root scan, conflict visibility, and consistent errors across CLI and library.

Affected paths (optional)

skillware/core/discovery.py, skillware/core/loader.py, skillware/core/config.py, skillware/cli.py, tests/test_loader.py, tests/test_cli.py, tests/test_discovery.py, docs/usage/cli.md, docs/usage/README.md, docs/security/skill-trust-model.md, docs/contributing/ai_native_workflow.md

Implementation Idea

Implementation Idea

  1. Config module — load global → project (walk-up) → env merge rules.
  2. Extend discovery.pyget_skill_roots(config) with tier label, path, skill IDs.
  3. Loader — _all_skill_roots() reads config; backward compat when no config file.
  4. Shadowing helper — warn when project/external overrides bundled.
  5. Optional skillware config show (read-only; editor is [CLI]: Interactive paths editor and grouped help submenus #247).
  6. Tests with tmp_path: global config, project .skillware.yaml, env var, bundled fallback, shadow warning.
  7. Docs — path resolution in cli.md; trust doc cross-link ([Docs]: Operator expectations for bundled vs external skills #243).

Acceptance criteria

  • Global and project YAML config load and merge predictably (document precedence).
  • Bundled wheel root always included; not writable via config.
  • Project + external roots participate in load_skill, list, test.
  • Shadowing produces operator-visible warning ([Feat]: Skill load trust tiers — origin metadata and warnings for non-bundled skills (sub-issue of #17) #110 minimal v1).
  • Skill-not-found errors list searched roots/tiers with actionable tip.
  • SKILLWARE_SKILL_PATH documented when config also present.
  • Tests cover config merge, shadowing, CLI/loader parity.
  • docs/usage/cli.md and trust doc updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliskillware CLI, interactive menu, or docs/usage/cli.md.core frameworkChanges to loader, env, base classes, or model adapters.enhancementNew feature or request.help wantedExtra attention is needed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions