Skip to content

feat: implement runnable prompts auto-discovery#21

Merged
danielmeppiel merged 4 commits into
mainfrom
runnable-prompts
Oct 30, 2025
Merged

feat: implement runnable prompts auto-discovery#21
danielmeppiel merged 4 commits into
mainfrom
runnable-prompts

Conversation

@danielmeppiel
Copy link
Copy Markdown
Collaborator

  • 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 ' without requiring scripts to be defined in apm.yml. Explicit scripts still take precedence for granular control and advanced use cases.

Copilot AI review requested due to automatic review settings October 29, 2025 16:24
- 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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml always 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 means apm list won'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.md should 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:

Comment thread src/apm_cli/core/script_runner.py
Comment thread src/apm_cli/output/script_formatters.py
Comment thread src/apm_cli/core/script_runner.py
Comment thread src/apm_cli/core/script_runner.py Outdated
Comment thread src/apm_cli/core/script_runner.py
Comment thread tests/test_runnable_prompts.py
Comment thread tests/test_runnable_prompts.py
Comment thread tests/test_runnable_prompts.py
Comment thread tests/integration/test_runnable_prompts_integration.py
Comment thread tests/integration/test_runnable_prompts_integration.py
@danielmeppiel danielmeppiel merged commit 950f17d into main Oct 30, 2025
7 checks passed
@danielmeppiel danielmeppiel deleted the runnable-prompts branch February 27, 2026 09:42
sergio-sisternes-epam pushed a commit that referenced this pull request May 19, 2026
feat: implement runnable prompts auto-discovery
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