Skip to content

feat(cron): expand skill commands in cron job prompts#868

Open
chenhg5 wants to merge 1 commit into
mainfrom
feat/issue-856-cron-skill-expansion
Open

feat(cron): expand skill commands in cron job prompts#868
chenhg5 wants to merge 1 commit into
mainfrom
feat/issue-856-cron-skill-expansion

Conversation

@chenhg5
Copy link
Copy Markdown
Owner

@chenhg5 chenhg5 commented May 6, 2026

Summary

  • When a cron job's prompt starts with "/", parse it as a slash command
  • Resolve through the skill registry to find matching skill
  • Use BuildSkillInvocationPrompt to expand into full skill instructions
  • Unknown slash commands pass through unchanged to the agent

This allows cron jobs to invoke skills like /daily-brief for today, which will be expanded into full skill instructions before being sent to the agent.

Test plan

  • go build ./... passes
  • go vet ./... passes
  • go test ./... passes (all tests)
  • Added regression test TestExecuteCronJob_ExpandsSkillCommand
  • Added regression test TestExecuteCronJob_UnknownSlashCommandPassthrough

Closes #856

🤖 Generated with Claude Code

When a cron job's prompt starts with "/", parse it as a slash command
and attempt to resolve it through the skill registry. If the command
matches a known skill, use BuildSkillInvocationPrompt to expand it into
full skill instructions before sending to the agent.

This allows cron jobs to invoke skills just like regular chat messages.
Unknown slash commands (not registered skills) pass through unchanged
to the agent.

Changes:
- Add skill expansion logic in ExecuteCronJob before creating Message
- Log expanded skill name and args for debugging
- Add regression tests for skill expansion and unknown command passthrough

Closes #856

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@chenhg5 chenhg5 left a comment

Choose a reason for hiding this comment

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

LGTM — clean skill command expansion for cron prompts.

The inline approach (resolve in ExecuteCronJob using e.skills.Resolve + BuildSkillInvocationPrompt) is simpler than #860's separate expandCronSkillPrompt method. Unknown slash commands correctly pass through to the agent unchanged.

✅ Logging on expansion (good for debugging)
✅ Two regression tests: expansion + passthrough for unknown commands
✅ Closes #856

⚠️ Overlap with #860 (zzl360): #860 implements this same feature. See comment on #860.

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.

Cron slash skill prompts are not expanded

2 participants