Skip to content

feat: Add expand parameter to sample_sequences() (closes #73)#83

Merged
evansenter merged 1 commit into
mainfrom
feat/sample-sequences-expand
Jan 10, 2026
Merged

feat: Add expand parameter to sample_sequences() (closes #73)#83
evansenter merged 1 commit into
mainfrom
feat/sample-sequences-expand

Conversation

@evansenter

Copy link
Copy Markdown
Owner

Summary

  • Adds expand parameter to sample_sequences() so users can match patterns like "git → Edit" instead of just "Bash → Edit"
  • Extracts _get_effective_name() to shared module-level helper with debug logging for JSON parse failures
  • Adds behavioral tests verifying actual matching behavior (not just response structure)

Test plan

  • All 383 tests pass (make check)
  • Verified expand=True matches Bash commands
  • Verified expand=True matches Skill names
  • Verified expand=True matches Task subagent_type
  • Verified hyphenated skill names (e.g., "pr-review") are valid

🤖 Generated with Claude Code

Adds `expand` parameter to `sample_sequences()` so users can match patterns
like "git → Edit" instead of just "Bash → Edit". Uses the same expansion
logic as `get_tool_sequences()`:
- Bash → specific command (e.g., "git", "make")
- Skill → skill name (e.g., "commit", "pr-review")
- Task → subagent type (e.g., "Explore", "Plan")

Changes:
- Extract `_get_effective_name()` to module-level shared helper with debug logging
- Add `expand` parameter to patterns.sample_sequences() and MCP tool
- Add `--expand` flag to CLI sample-sequences command
- Update validation to allow hyphens in expanded skill names
- Add `expanded` and `status` fields to all response paths
- Add `base_tool` field when tool name differs from effective name
- Add 4 behavioral tests for Bash/Skill/Task expansion and hyphen validation
- Update guide.md documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Jan 10, 2026

Copy link
Copy Markdown

Prompt: evansenter/dotfiles/.../claude-review.md

Code Review

Summary

This PR adds an expand parameter to sample_sequences() to allow matching against expanded tool names (Bash commands, Skill names, Task subagent types) rather than just base tool names. It extracts _get_effective_name() to a shared module-level helper with debug logging and adds comprehensive behavioral tests.

Issues Found

Critical

None

Important

None

Suggestions

None

Verdict

APPROVE - Code looks good, no issues found. The implementation correctly addresses issue #73 by:

  1. Adding the expand parameter to sample_sequences() with proper documentation
  2. Reusing the existing _get_effective_name() logic from compute_sequence_patterns()
  3. Adding status and expanded fields to all return paths for consistency
  4. Updating validation to allow hyphens in tool names for expanded skill names like "pr-review"
  5. Including comprehensive tests that verify actual matching behavior
  6. Updating CLI, MCP server, and documentation

Automated review by Claude Code

@evansenter evansenter merged commit 1e0e685 into main Jan 10, 2026
3 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.

1 participant