Skip to content

openspec-continue-change hard-coded artifact patterns override schema instruction field #777

@pacaplan

Description

@pacaplan

Problem

When a schema's instruction field directs the agent to invoke a specific skill (e.g., "IMPORTANT: You MUST use the flokay:design skill for this step."), the openspec-continue-change skill ignores this directive and writes the artifact directly using hard-coded patterns.

This means schemas cannot delegate artifact creation to custom skills — a critical capability for workflows like Flokay that require collaborative, multi-step processes (e.g., brainstorming approaches before writing a design document).

Root Cause

openspec-continue-change/SKILL.md lines 94-107 contain hard-coded artifact creation guidance that takes precedence over the schema's instruction field:

**Artifact Creation Guidelines**

The artifact types and their purpose depend on the schema. Use the `instruction` field
from the instructions output to understand what to create.

Common artifact patterns:

**spec-driven schema** (proposal → specs → design → tasks):
- **proposal.md**: Ask user about the change if not clear. Fill in Why, What Changes, Capabilities, Impact.
- **specs/<capability>/spec.md**: Create one spec per capability...
- **design.md**: Document technical decisions, architecture, and implementation approach.
- **tasks.md**: Break down implementation into checkboxed tasks.

For other schemas, follow the `instruction` field from the CLI output.

The implicit logic: if the schema matches the "spec-driven" pattern, use the hard-coded one-liners; only fall back to the instruction field for "other schemas." Since most custom schemas (like Flokay) resemble the spec-driven pattern, the agent uses the hard-coded shortcut instead of reading the actual instruction.

openspec-ff-change/SKILL.md has a milder version of the same issue — line 88 says "Follow the instruction field" but lacks explicit guidance about skill invocation, so the agent treats "You MUST use skill X" as informational context rather than a directive to invoke a skill via the Skill tool.

Impact

  • Schema authors cannot delegate artifact creation to custom skills
  • The instruction field in schema.yaml artifacts is effectively ignored for common artifact types
  • Workflows that require interactive/collaborative artifact creation (brainstorming, evaluation, multi-step design) are broken — the agent just writes the artifact directly

Expected Behavior

When openspec instructions <artifact-id> returns an instruction field that references a skill (e.g., "You MUST use the flokay:design skill"), the orchestrating skills should invoke that skill using the Skill tool instead of writing the artifact directly.

Suggested Fix

  1. openspec-continue-change: Remove or demote the hard-coded artifact patterns (lines 98-107). Add explicit skill-delegation guidance: "If the instruction field references a skill (e.g., 'You MUST use the X skill'), invoke that skill using the Skill tool instead of writing the artifact yourself."

  2. openspec-ff-change: Add the same skill-delegation guidance.

  3. Consider a convention in the instruction field (e.g., skill: flokay:design) that the orchestrating skills can parse unambiguously, rather than relying on natural language detection of "You MUST use..." directives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions