github/spec-kit · error · ValueError

{type(self).__name__}.config is not set.

Error message

{type(self).__name__}.config is not set.

What it means

SkillsIntegration.skills_dest() derives the skills output directory from config['folder'] and config['commands_subdir'] (default 'skills'). If the subclass's config class attribute is missing, None, or empty, this ValueError fires, naming the offending class. It is an authoring error in the integration class, not a user environment problem.

Source

Thrown at src/specify_cli/integrations/base.py:1598

            return None
        args = [self._resolve_executable(), "-p", prompt]
        self._apply_extra_args_env_var(args)
        if model:
            args.extend(["--model", model])
        if output_json:
            args.extend(["--output-format", "json"])
        return args

    def skills_dest(self, project_root: Path) -> Path:
        """Return the absolute path to the skills output directory.

        Derived from ``config["folder"]`` and the configured
        ``commands_subdir`` (defaults to ``"skills"``).

        Raises ``ValueError`` when ``config`` or ``folder`` is missing.
        """
        if not self.config:
            raise ValueError(f"{type(self).__name__}.config is not set.")
        folder = self.config.get("folder")
        if not folder:
            raise ValueError(
                f"{type(self).__name__}.config is missing required 'folder' entry."
            )
        subdir = self.config.get("commands_subdir", "skills")
        return project_root / folder / subdir

    def build_command_invocation(self, command_name: str, args: str = "") -> str:
        """Build the agent's native invocation for a hyphenated skill name."""
        stem = command_name
        if stem.startswith("speckit."):
            stem = stem[len("speckit."):]

        prefix = "$" if is_dollar_skills_agent(self.key, True) else "/"
        invocation = prefix + "speckit-" + stem.replace(".", "-")
        if args:
            invocation = f"{invocation} {args}"

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Add a config class attribute to the subclass with at least name, folder, commands_subdir, install_url, requires_cli.
  2. If you meant to use a ready integration, instantiate the built-in one instead of the base class.
  3. Add a unit test asserting cls.config is truthy for every registered integration.

Example fix

# before
class MyAgentIntegration(SkillsIntegration):
    key = "my-agent"
    # config missing
# after
class MyAgentIntegration(SkillsIntegration):
    key = "my-agent"
    config = {
        "name": "My Agent",
        "folder": ".my-agent/",
        "commands_subdir": "skills",
        "install_url": None,
        "requires_cli": False,
    }
Defensive patterns

Strategy: type-guard

Validate before calling

def integration_config_ok(integration) -> bool:
    return bool(getattr(integration, "config", None))

Type guard

from specify_cli.integrations.base import SkillsIntegration

def has_skills_config(integration: SkillsIntegration) -> bool:
    return bool(integration.config)

Try / catch

try:
    dest = integration.skills_dest(project_root)
except ValueError as exc:
    if ".config is not set" in str(exc):
        raise SystemExit(f"{type(integration).__name__} needs a config class attribute") from None
    raise

Prevention

When it happens

Trigger: Defining a SkillsIntegration subclass without a config dict, or with config = None / {} (falsy); instantiating an abstract/base skills integration directly.

Common situations: Writing a new skills-based agent integration and forgetting the config class attribute; refactoring that renames or deletes config; tests instantiating a partially-configured subclass.

Related errors


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/807c1ad6f4a4c379. Report an issue: GitHub.