feat: implement runnable prompts auto-discovery#21
Merged
Conversation
- Add automatic prompt discovery for installed prompts - Support running prompts without manual apm.yml configuration - Implement 3-tier execution priority: explicit scripts > auto-discovery > error - Add runtime detection (copilot > codex) with helpful error messages - Generate proper runtime commands with defaults (Copilot CLI, Codex CLI) - Add comprehensive unit tests (16 tests) and integration tests (8 tests) - Fix STATUS_SYMBOLS missing keys (default, eyes, folder, cogs) Prompts can now be run immediately after installation with 'apm run <prompt-name>' without requiring scripts to be defined in apm.yml. Explicit scripts still take precedence for granular control and advanced use cases.
67d87a9 to
2c405a4
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements runnable prompts, a feature that allows auto-discovery and immediate execution of installed prompt files without requiring manual script configuration in apm.yml. The implementation follows a convention-over-configuration approach with fallback discovery.
Key changes:
- Auto-discovery mechanism for prompt files across local and dependency directories
- Runtime detection with priority order (copilot > codex)
- Command generation with runtime-specific defaults
- Backwards compatibility maintained - explicit scripts in
apm.ymlalways take precedence
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/core/script_runner.py |
Core implementation of auto-discovery, runtime detection, and command generation logic |
src/apm_cli/output/script_formatters.py |
Added formatting method for auto-discovery messages |
src/apm_cli/utils/console.py |
Added new emoji icons for UI elements |
tests/test_runnable_prompts.py |
Comprehensive unit tests for discovery, runtime detection, and command generation |
tests/integration/test_runnable_prompts_integration.py |
Integration tests for install-and-run workflows |
RUNNABLE-PROMPTS-PLAN.md |
Detailed implementation plan and architecture documentation |
VIRTUAL-PACKAGES-PLAN.md |
Architecture plan for virtual package resolution |
Comments suppressed due to low confidence (3)
src/apm_cli/core/script_runner.py:176
- The
list_scripts()method doesn't include auto-discoverable prompts, which meansapm listwon't show them. Users might install prompts that become runnable via auto-discovery but won't see them in the list output. Consider extending this method to also discover and include prompt files, or add a separate method to list discoverable prompts.
def list_scripts(self) -> Dict[str, str]:
"""List all available scripts from apm.yml.
Returns:
Dict mapping script names to their commands
"""
config = self._load_config()
return config.get('scripts', {}) if config else {}
tests/test_runnable_prompts.py:1
- The PR introduces a significant new feature (runnable prompts with auto-discovery) but the documentation files in the
docs/directory haven't been updated. According to the project's coding guidelines (Rule 1), documentation should be updated to reflect codebase changes. Specifically,docs/prompts.mdshould be updated to explain the auto-discovery behavior and precedence rules.
"""Unit tests for runnable prompts feature."""
src/apm_cli/output/script_formatters.py:332
- Except block directly handles BaseException.
except:
14 tasks
sergio-sisternes-epam
pushed a commit
that referenced
this pull request
May 19, 2026
feat: implement runnable prompts auto-discovery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompts can now be run immediately after installation with 'apm run ' without requiring scripts to be defined in apm.yml. Explicit scripts still take precedence for granular control and advanced use cases.