Skip to content

Conversation

@cheolwanpark
Copy link
Contributor

@cheolwanpark cheolwanpark commented Jan 31, 2026

Summary
Fix /opsx:archive template to properly invoke sync via Skill tool instead of referencing slash command logic

Problem
The archive template told the agent to "execute /opsx:sync logic" - but agents can't directly execute slash commands. They must use the Skill tool to invoke skills programmatically.
This caused the agent to improvise sync behavior incorrectly, resulting in malformed spec files without ## Purpose section. openspec list --specs would show 0 requirements even when specs existed.

Fix
Replace command references with explicit Skill tool invocations:

- If user chooses sync, execute /opsx:sync logic
+ If user chooses sync, use the Skill tool to invoke `openspec-sync-specs`

Summary by CodeRabbit

  • Improvements
    • Refined the synchronization flow used during archival for more consistent handling of delta specs.
    • Clarified final guidance wording around sync options so instructions are more actionable.
    • Delta-spec analysis summary is now shown before prompting; archival proceeds regardless of the sync choice.

✏️ Tip: You can customize this high-level summary in your review settings.

Update archive skill templates to properly instruct the AI to use
the Skill tool to invoke sync commands instead of executing command
logic directly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cheolwanpark cheolwanpark requested a review from TabishB as a code owner January 31, 2026 12:10
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Replaced two direct /opsx:sync invocations in archival skill templates with a Task-tool/subagent prompt that instructs a general-purpose subagent to use the Skill tool to invoke openspec-sync-specs and produce a delta-spec analysis; archival flow and user prompt behavior otherwise unchanged.

Changes

Cohort / File(s) Summary
Archival sync templates
src/core/templates/skill-templates.ts
Replaced two direct /opsx:sync invocations with a Task tool call using subagent_type: "general-purpose" and a prompt instructing the subagent to call the Skill tool to run openspec-sync-specs and analyze delta specs. Adjusted final guidance text to reflect Task-tool-based sync flow; archival path logic unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Agent as Agent (archival skill)
    participant TaskTool as Task Tool (subagent)
    participant Skill as Skill Tool (openspec-sync-specs)
    participant Archive as Archive Process

    User->>Agent: Request archive / choose to sync
    Agent->>TaskTool: Launch Task (subagent_type: "general-purpose") with prompt to invoke Skill and analyze delta specs (include delta summary)
    TaskTool->>Skill: Invoke openspec-sync-specs (via Skill tool)
    Skill-->>TaskTool: Delta-spec analysis & sync actions result
    TaskTool-->>Agent: Return analysis summary / sync decision outcome
    Agent->>User: Show delta-spec analysis summary and ask final confirmation
    Agent->>Archive: Proceed with archival (regardless of sync choice)
    Archive-->>User: Archive result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I nibbled prompts and hopped in code,

Sent a subagent down the syncy road,
Delta specs reviewed with a twitch of an ear,
Archive marched on — steady and clear,
Hooray! The rabbit cheers: sync via Task, not fear.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing direct skill/command invocations with proper Skill tool usage in archive templates.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@greptile-apps
Copy link

greptile-apps bot commented Jan 31, 2026

Greptile Overview

Greptile Summary

This PR updates archive templates to use the Skill tool for programmatic sync invocation instead of referencing slash command logic. This prevents agents from improvising incorrect sync behavior that could result in malformed spec files.

Key changes:

  • Updated 3 locations in skill-templates.ts to use Skill tool invocation
  • Replaced vague "execute /opsx:sync logic" with explicit Skill tool instructions

Issues found:

  • Line 2158 correctly uses skill name openspec-sync-specs
  • Lines 2835 and 2929 incorrectly use command ID opsx:sync instead of skill name openspec-sync-specs
  • The Skill tool requires the registered skill name, not the slash command ID

Confidence Score: 3/5

  • Safe to merge after fixing skill name inconsistencies on lines 2835 and 2929
  • The PR correctly addresses the core issue of using Skill tool for sync invocation, but introduces an inconsistency where two locations use the wrong skill identifier (opsx:sync instead of openspec-sync-specs). This will cause runtime errors when agents try to invoke the sync skill from those code paths.
  • src/core/templates/skill-templates.ts needs the skill name corrected on lines 2835 and 2929

Important Files Changed

Filename Overview
src/core/templates/skill-templates.ts Fixes Skill tool invocation for sync, but introduces inconsistency in skill name usage across templates

Sequence Diagram

sequenceDiagram
    participant User
    participant Agent
    participant SkillTool as Skill Tool
    participant Archive as Archive Template
    participant Sync as openspec-sync-specs

    User->>Agent: /opsx:archive <change-name>
    Agent->>Archive: Execute archive logic
    Archive->>Archive: Check for delta specs
    
    alt Delta specs exist and changes needed
        Archive->>User: Prompt: "Sync now (recommended)" or "Archive without syncing"
        User->>Archive: Choose "Sync now"
        Archive->>Agent: Invoke sync via Skill tool
        Agent->>SkillTool: Skill("openspec-sync-specs", change-name)
        SkillTool->>Sync: Execute sync skill
        Sync->>Sync: Read delta specs
        Sync->>Sync: Apply changes to main specs
        Sync-->>Agent: Sync complete
    else No changes or user skips
        Archive->>Archive: Continue without sync
    end
    
    Archive->>Archive: Move change to archive/YYYY-MM-DD-<name>
    Archive->>User: Display summary
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

- If already synced: "Archive now", "Sync anyway", "Cancel"

If user chooses sync, execute \`/opsx:sync\` logic. Proceed to archive regardless of choice.
If user chooses sync, use the Skill tool to invoke \`opsx:sync\` with the change name. Proceed to archive regardless of choice.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent skill name - should be openspec-sync-specs not opsx:sync

Line 2158 correctly uses openspec-sync-specs, but this line and line 2929 use opsx:sync (the slash command ID). The Skill tool requires the actual skill name openspec-sync-specs as registered in skill-generation.ts:58.

Suggested change
If user chooses sync, use the Skill tool to invoke \`opsx:sync\` with the change name. Proceed to archive regardless of choice.
If user chooses sync, use the Skill tool to invoke `openspec-sync-specs` with the change name. Proceed to archive regardless of choice.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/core/templates/skill-templates.ts
Line: 2835:2835

Comment:
Inconsistent skill name - should be `openspec-sync-specs` not `opsx:sync`

Line 2158 correctly uses `openspec-sync-specs`, but this line and line 2929 use `opsx:sync` (the slash command ID). The Skill tool requires the actual skill name `openspec-sync-specs` as registered in `skill-generation.ts:58`.

```suggestion
   If user chooses sync, use the Skill tool to invoke `openspec-sync-specs` with the change name. Proceed to archive regardless of choice.
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also right ^

- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use /opsx:sync approach (agent-driven)
- If sync is requested, use the Skill tool to invoke \`opsx:sync\` (agent-driven)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent skill name - should be openspec-sync-specs not opsx:sync

Same issue as line 2835. The skill name is openspec-sync-specs, not the command ID opsx:sync.

Suggested change
- If sync is requested, use the Skill tool to invoke \`opsx:sync\` (agent-driven)
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/core/templates/skill-templates.ts
Line: 2929:2929

Comment:
Inconsistent skill name - should be `openspec-sync-specs` not `opsx:sync`

Same issue as line 2835. The skill name is `openspec-sync-specs`, not the command ID `opsx:sync`.

```suggestion
- If sync is requested, use the Skill tool to invoke `openspec-sync-specs` (agent-driven)
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/core/templates/skill-templates.ts`:
- Line 2835: The Skill tool invocations currently call the slash command string
"opsx:sync" which fails in Skill-only contexts; update all Skill tool
invocations in this template to use the skill identifier "openspec-sync-specs"
instead of "opsx:sync" (search for occurrences of the literal "opsx:sync" in
skill-templates.ts and replace them with "openspec-sync-specs" where the Skill
tool is invoked so calls to the Skill tool use the correct skill ID).

@cheolwanpark
Copy link
Contributor Author

I've verified it is working with '/opsx:sync'. Claude code treats slash command same as a skill.

@TabishB
Copy link
Contributor

TabishB commented Jan 31, 2026

@cheolwanpark Yes i get that claude code treats slash commands the same as skill but I think semantically it needs to match if we mention a skill tool we should mention a skill instead of a slash command.

Skill tool terminates after completion and doesn't return control to the
caller, causing archive to not continue after sync. Changed to spawn a
subagent via Task tool which properly returns control after completion.

Also updated opsx:sync references to openspec-sync-specs for semantic
coherence across templates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@cheolwanpark
Copy link
Contributor Author

Fixed the semantic mismatch. Now skill tool references use openspec-sync-specs instead of opsx:sync.

Also fixed another issue. The skill tool terminates after completion and doesn't return control to the caller, causing the archive step to not continue after sync. Changed to spawn a subagent via Task tool which properly returns control, allowing the archive flow to continue.

@TabishB would appreciate a review when you get a chance!

@TabishB TabishB merged commit 1d34e72 into Fission-AI:main Feb 1, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants