Skip to content

Commit 31ba393

Browse files
authored
feat(slash-commands): add generator for AI assistant native slash commands (#19)
* docs(tasks): add spec/tasks for slash commands helper * feat(slash-commands): bootstrap config and detection - add command format enum and agent registry for 14 tools - implement auto-detection helpers with deterministic ordering - add targeted pytest coverage and close Task 1.0 foundations Related to Task 1.0 in Spec * feat: implement Markdown and TOML command generators with override support - Add CommandGenerator base class with Markdown and TOML subclasses - Implement agent override support for descriptions, arguments, and enabled flags - Add placeholder replacement for $ARGUMENTS and {{args}} - Support argument merging for agent-specific overrides - Add comprehensive test coverage for both generator types - Update MarkdownPrompt to include agent_overrides field Related to T2.4 in Spec * feat: add output normalization and snapshot regression tests - Add _normalize_output function for consistent whitespace/encoding - Normalize line endings to LF, remove trailing whitespace - Add snapshot-style regression tests for both generators - Tests verify output structure, valid TOML, and no trailing whitespace Related to T2.5 in Spec * chore: mark task 2.0 complete - all generator subtasks finished - All subtasks 2.1-2.5 are complete - Demo criteria satisfied: generators transform MarkdownPrompt objects - All tests passing: pytest tests/test_generators.py -v * feat: implement slash command writer with multi-agent support - Add SlashCommandWriter class orchestrating prompt loading and generation - Support single and multi-agent generation with dry-run mode - Create parent directories automatically - Add comprehensive test coverage for writer functionality - Export writer interface from slash_commands package Related to T3.0 in Spec * chore: remove generated test files * feat: implement Typer CLI with auto-detection and selection flows - Add Typer CLI app with comprehensive command options - Support --agents, --list-agents, --dry-run, --prompts-dir flags - Auto-detect configured agents from filesystem - Add comprehensive test coverage for CLI functionality - Register CLI entry point in pyproject.toml - Export CLI from slash_commands package Related to T4.0 in Spec * feat: implement overwrite handling with backup support - Add prompt_overwrite_action and create_backup utilities - Implement overwrite detection and handling in SlashCommandWriter - Add support for cancel, overwrite, backup, and overwrite-all actions - Track backups created and report them in CLI summary - Add tests for overwrite handling scenarios - Update CLI to honor --yes flag for auto-overwrite Related to T5.1, T5.2, T5.3 in Spec * docs: add slash command generator documentation - Create comprehensive documentation for slash command generator - Document CLI usage, supported agents, and file formats - Add overview of overwrite handling and backup features - Update README with link to new documentation Related to T5.4 in Spec * docs: mark task 5.0 and all subtasks complete - All overwrite handling features implemented and tested - Documentation added for slash command generator - Dependencies verified and tests passing Related to T5.0 completion in Spec * fix: add missing tomli-w dependency and update documentation - Add tomli-w>=1.0.0 to dependencies for TOML generation - Update documentation to use 'uv run' prefix for all commands - Clarify that uv projects require 'uv run' to execute scripts Fixes issue where sdd-generate-commands was not found * feat: Fix critical audit issues and add detection path option - Implement interactive overwrite prompt using questionary.select() - Add interactive agent selection UI with checkboxes - Fix documentation agent list to match actual 14 agents - Update directory structure examples to reflect actual agents - Fix backup timestamp format to use YYYYMMDD-HHMMSS - Update TOML format example to match actual generator output - Add --detection-path option for flexible agent detection - Add integration tests for interactive flows - Add questionary dependency to pyproject.toml - Add spec addendum documenting detection default location oversight - Add task 8.0 to fix default detection to home directory All tests passing (56 tests) * docs: Add reference links to supported agents table Add Reference column with home and documentation links for all 14 agents * feat: implement consistent exit codes and improved error handling - Implement consistent exit codes (0=success, 1=user cancel, 2=validation error, 3=I/O error) - Add comprehensive error messages with guidance for common failure scenarios - Expand troubleshooting section in docs with detailed solutions - Update examples to show actual command output and file structures - Add backup file cleanup documentation - Add --target-dir alias for --base-path option Related to task 7.0 in Spec 0003 * feat: change default paths to home directory and unify option names - Replace --base-path/--target-dir with single --target-path option - Set --target-path default to home directory instead of current directory - Set --detection-path default to home directory instead of current directory - Update all tests to use --target-path instead of --base-path - Update documentation to reflect new default behavior - Add detection path section to documentation Related to task 8.0 in Spec 0003 * feat: improve --list-agents output with Rich table - Add Rich table formatting for --list-agents output - Add Target Path column showing command directory for each agent - Add Detected column showing whether agent detection directories exist - Use checkmarks (✓) and crosses (✗) to indicate detection status - Apply color styling to table columns * feat: improve list-agents table formatting - Add ~/ prefix to target paths to show home directory relative paths - Change ✗ marks to red color for better visual distinction - Use Rich markup syntax for colored checkmarks and crosses * fix: correct detection logic to check command directory - Change detection logic to check if command directory exists - Previously checked detection directories which could be misleading - Now shows ✓ only when the actual command directory exists - Fixes issue where agents were marked as detected when command dir didn't exist * fix: correct agent command directories based on official documentation - Change Cursor from .cursorrules/commands to .cursor/commands - Change Amp from .amp/commands to .agents/commands - Change Auggie CLI from .auggie/commands to .augment/commands - Change Kilo Code from .kilo/commands to .kilocode/rules - Change opencode from .opencode/commands to .config/opencode/commands - Update detection directories to match command directories - Update tests to match new configurations * refactor: remove unsupported agents and update remaining paths - Remove amazon-q-developer, amp, auggie-cli, crush, github-copilot, kilo-code, opencode, qwen-code, roo-code - Rename codebuddy-cli to vs-code - Update paths to verified working locations: - Cursor: .cursor/rules/.mdc - Codex: .codex/prompts - Windsurf: .codeium/windsurf/global_workflows - VS Code: .config/Code/User/prompts/.prompt.md - Update tests to match new configuration - Reduce from 15 to 6 supported agents * fix(config): correct Cursor agent command directory and file extension Update Cursor agent configuration to use .cursor/commands instead of .cursor/rules and change file extension from .mdc to .md. Also remove legacy .cursorrules from detection directories. This aligns with official Cursor documentation for slash commands. * feat(slash-commands): add version and updated_at metadata to generated commands Add two new metadata fields to all generated slash command files: - version: reads from pyproject.toml via centralized __version__ constant - updated_at: ISO format timestamp of when command was generated Centralize version management by reading from pyproject.toml in mcp_server/__init__.py instead of hardcoding. Generators now import and use this version, making it the single source of truth. Both Markdown and TOML generators include these fields in their metadata sections, and tests verify their presence. * refactor(generators): align TOML format with official Gemini CLI spec Refactored TomlCommandGenerator to match the official Gemini CLI custom commands spec (https://geminicli.com/docs/cli/custom-commands/). Changes: - Simplify TOML structure to flat format with prompt and description fields - Preserve {{args}} placeholder for Gemini CLI context-aware injection - Add metadata fields for version tracking (ignored by Gemini CLI) - Remove unused helper methods and simplify implementation - Update tests to validate new structure and {{args}} preservation Benefits: - Commands are now properly detected by Gemini CLI - Maintains version tracking capabilities for our tooling - Follows official Gemini CLI specification exactly - All 58 tests passing * feat(slash-commands): add cleanup command for generated files Add a new cleanup command to the slash command generator that can detect and remove generated command files and backups based on metadata. Features: - Detect generated files via metadata (source_prompt, version) - Support both Markdown and TOML file formats - Detect backup files by timestamp pattern - Rich table formatting for file listing - Confirmation prompt with warning panel - Dry-run mode for safety - Comprehensive test coverage The cleanup command uses Rich formatting with tables for file listings and panels for warnings and summaries, improving the user experience compared to plain text output. * docs(tasks): add spec and task list for code review fixes Add specification document 0004-spec-review-fixes.md detailing the code review findings that need to be addressed, along with a comprehensive task list breaking down the implementation into 5 demoable units of work with 23 actionable subtasks. The spec covers fixes for: - Package discovery configuration - TOML reading documentation - Generated content validation tests - Centralized version management - Troubleshooting documentation * feat: add slash_commands to package discovery configuration - Added slash_commands to packages list in pyproject.toml - Verified package installs successfully with uv pip install -e . - Verified CLI works without import errors - Verified slash_commands directory is included in installed package Related to T1.0 in Spec 0004 * docs: document TOML reading approach and Python version requirements - Added Python Version Requirements section to docs - Clarified Python 3.12+ requirement and tomllib availability - Added comment to writer.py explaining tomllib is from stdlib - Verified tomllib import works correctly - All tests pass successfully Related to T2.0 in Spec 0004 * test: add generated content validation tests - Created tests/test_validation.py with validation tests - Added test_toml_round_trip_parsing to verify TOML can be parsed back - Added test_yaml_frontmatter_parsing to validate YAML structure - Added test_invalid_toml_content_caught to catch invalid TOML - Added test_invalid_yaml_content_caught to catch invalid YAML - All 75 tests pass including 5 new validation tests Related to T3.0 in Spec 0004 * refactor: centralize version management - Created __version__.py at project root for centralized version management - Updated slash_commands/generators.py to import from __version__ instead of mcp_server - Updated mcp_server/__init__.py to import from shared __version__.py module - Version now read from pyproject.toml via single source of truth - All 75 tests pass successfully Related to T4.0 in Spec 0004 * docs: enhance troubleshooting documentation and Python version requirements - Enhanced Python Version Requirements section with detailed explanations - Added 'Why Python 3.12+' subsection with clear rationale - Added 'No Additional Dependencies Required' subsection explaining tomllib benefits - Verified all troubleshooting scenarios are documented - Verified documentation renders correctly as markdown - All 75 tests pass successfully Related to T5.0 in Spec 0004 * docs(slash-command-generator): align documentation with actual implementation - Corrected supported agents count from 14 to 6 actual agents - Added comprehensive documentation for cleanup command - Added missing vs-code agent to supported agents table - Documented interactive agent selection feature - Documented command_prefix metadata field - Updated directory structure examples to match actual paths - Updated examples to show actual CLI output format - Removed undocumented environment variables section * test(coverage): add pytest-cov configuration and documentation - Configure pytest-cov to report coverage for mcp_server and slash_commands modules - Add HTML coverage report generation - Update CI workflow to include slash_commands in coverage reporting - Add htmlcov directory to .gitignore - Update CONTRIBUTING.md with coverage viewing instructions - Update docs/operations.md with coverage command and HTML report details Provides 85% overall coverage across both modules with terminal and HTML reporting. * refactor(version): support both local and installed package modes - Update __version__.py to handle both local development and installed package scenarios using importlib.metadata fallback - Add fallback imports in mcp_server/__init__.py and slash_commands/generators.py to use importlib.metadata when __version__ is not available - Include __version__.py in wheel package via force-include Enables the package to work correctly when installed via uvx --from git+ URL or from PyPI, while maintaining backward compatibility with local development. * feat(server): add command-line argument parsing for transport and port - Add sys.argv parsing to main() function - Support --transport argument to choose between stdio and http - Support --port argument for HTTP transport - Add __main__ block to allow direct execution Enables running the MCP server via uvx with transport and port options: uvx spec-driven-development-mcp --transport http --port 8000 * docs: reorganize README with clearer usage options - Restructure Hands-On Usage section into three clear options: Option 1: Manual Copy-Paste (No Tooling Required) Option 2: Native Slash Commands (Recommended) Option 3: MCP Server (Advanced) - Add git URL examples for running via uvx --from - Improve organization from simplest to most automated - Add PyPI notes for future simplified syntax Provides a clearer progression for users choosing their preferred workflow integration method. * fix: address CodeRabbitAI review comments - Use argparse for CLI argument parsing in server.py - Use cross-platform webbrowser command in CONTRIBUTING.md - Fix agent count and hyphenation in tasks file - Fix test ordering assertions to follow SUPPORTED_AGENTS order - Add explicit UTF-8 encoding to conftest.py - Use iter_detection_dirs() in detection.py - Clarify TOML dependency documentation - Remove Qwen Code reference from docs - Simplify test_writer.py fixture - Add command prefix assertion in test_validation.py - Show actual agent keys in error messages - Preserve intentional blank lines in normalization - Add argument deduplication in generators.py * fix: update typer version constraint to match available PyPI version - Change typer>=0.20.0 to typer>=0.19.0 to match latest available version (0.19.2) * chore: update all packages to latest compatible versions Updated 16 packages including: - fastmcp v2.12.4 -> v2.12.5 - pydantic v2.12.0 -> v2.12.3 - ruff v0.14.0 -> v2.14.1 - cyclopts v3.24.0 -> v4.0.0 - coverage v7.10.7 -> v7.11.0 - And 11 other packages * fix: address additional CodeRabbit review comments - Fix dry-run file count to report actual file count regardless of mode - Add explicit UTF-8 encoding when writing generated files - Fix single-element tuple in test detection_dirs - Move prompts directory from packages to force-include in pyproject.toml * ci: add pre-push test hook and fix dry_run file count bug - Add local pre-commit hook to run pytest before push - Fix writer to correctly report files_written=0 in dry_run mode - Prevents CI test failures from incorrect file counting * fix: address remaining CodeRabbit AI review comments - Fix coverage exclude pattern for __main__ guard in pyproject.toml - Add PackageNotFoundError handling for version fallback in generators.py - Store only basename in source_path to avoid leaking absolute paths - Fix agents=None to default to all supported agents in writer.py These changes address 4 remaining CodeRabbit AI review comments that were not covered in the previous fixes. * fix: address PR review feedback for slash command generator - Fix agent argument overrides to actually override existing args - Sanitize prompt.name to prevent path traversal - Use safe_dump for YAML generation - Remove unused helper function - Show actual supported agent keys in error messages - Prefer Typer-controlled exits over sys.exit - Use agent.iter_detection_dirs() for consistency - Respect empty agent lists in find_generated_files - Normalize path types to strings in return values - Use UTC timestamps in backup filenames * fix: normalize path return types to strings in find_generated_files - Use os.fspath() to convert Path objects to strings - Update tests to verify string return type - Ensures consistent return types for JSON serialization * fix(install): add fallback to find prompts in installed package When running the tool via uvx, the prompts directory may not be available relative to the current working directory. This commit adds a fallback mechanism to locate prompts in the installed package directory when the specified prompts directory doesn't exist. Changes: - Add _find_package_prompts_dir() helper function to locate prompts in package root - Update _load_prompts() to fall back to package prompts when specified directory doesn't exist - Update tests to mock fallback function for error cases - Add test to verify fallback behavior works correctly This enables the tool to work seamlessly when installed via uvx without requiring --prompts-dir to be specified. * docs: add TLDR section to README showing quick start workflow Add a concise TLDR section at the top of the README that shows: - How to install prompts via uvx - Example of running /generate-spec with an idea - Continuing through the workflow with task list and management - The end goal (profit) This makes it easier for new users to quickly understand and get started with the spec-driven development workflow. * docs: replace Profit with SHIP IT meme in TLDR * docs(specs): add spec for fixing bundled prompts directory resolution - Fix prompts directory resolution for remote installation via uvx - Enable automatic detection of bundled prompts in installed packages - Maintain backward compatibility with custom prompts directories - Improve error messages for better user experience * docs(specs): add task list for fixing bundled prompts directory resolution - Add tasks-0005-spec-fix-bundled-prompts-path.md - Task list covers updating importlib.resources usage - Includes CLI changes to distinguish default vs explicit paths - Ensures backward compatibility and proper error handling * feat: add importlib.resources support for bundled prompts resolution - Import importlib.resources module in writer.py - Add strategy using importlib.resources.files() to locate bundled prompts - Keep existing fallback strategy using Path(__file__).parent.parent - Add proper error handling for importlib edge cases - Add unit test test_writer_finds_bundled_prompts for importlib.resources path resolution Related to task 1.0 in tasks-0005-spec-fix-bundled-prompts-path.md * fix: only fall back to bundled prompts for default directory Update CLI and Writer to distinguish between explicitly provided prompts directory and default directory. Only attempt fallback to bundled prompts when using the default path (not explicitly provided). - Change CLI prompts_dir default from Path("prompts") to None - Add is_explicit_prompts_dir flag to track user intent - Update Writer._load_prompts() to skip fallback for explicit paths - Improve error messages to distinguish default vs explicit paths - Add test for explicit path error handling - Update existing tests to pass is_explicit_prompts_dir parameter - Mark completed tasks in task list This fixes the issue where explicitly providing an invalid path would attempt to fall back to bundled prompts, causing confusing behavior. * docs(tasks): update task list for bundled prompts resolution - Mark tasks 3.0 and 4.0 as completed - Mark all subtasks of 3.0 and 4.0 as completed - Progress on task 5.0: completed subtasks 5.1-5.4 - Task 5.5 (manual uvx test) remains pending * docs(tasks): mark all tasks complete for bundled prompts resolution - All 5 main tasks completed - Manual uvx test confirmed working - Spec implementation complete * docs: improve README with numbered steps and supported AI tools table * fix(review): address PR review feedback - Fix README repository URLs and CLI command examples - Fix pyproject.toml coverage exclude pattern regex - Add explicit UTF-8 encoding to test fixtures - Fix documentation wording (CLI interface → CLI) * fix(writer): improve importlib.resources package anchor path Use slash_commands module as anchor for importlib.resources instead of spec_driven_development_mcp to provide more reliable path resolution when finding bundled prompts directory. - Navigate from slash_commands package to parent then to prompts dir - Add explicit test for _find_package_prompts_dir() with importlib - Improve comments explaining the traversal approach This makes the package prompts discovery more robust across different installation scenarios (wheel, editable install, etc.).
1 parent 3213088 commit 31ba393

32 files changed

+6437
-752
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: uv sync --all-groups --frozen
4040

4141
- name: Run tests with coverage
42-
run: uv run pytest -vv --cov=mcp_server --cov-report=term-missing:skip-covered --cov-report=xml
42+
run: uv run pytest -vv --cov=mcp_server --cov=slash_commands --cov-report=term-missing:skip-covered --cov-report=xml
4343

4444

4545
- name: Upload coverage.xml artifact

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
__pycache__
33
.venv
44

5-
# Misc
6-
temp/
5+
# Coverage
6+
htmlcov
77
.coverage
88
coverage.xml
9+
10+
# Misc
11+
temp/

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,13 @@ repos:
3232
stages: [commit-msg]
3333
args:
3434
- "--extends=@commitlint/config-conventional"
35+
36+
- repo: local
37+
hooks:
38+
- id: run-tests
39+
name: Run pytest before push
40+
entry: pytest
41+
language: system
42+
stages: [pre-push]
43+
pass_filenames: false
44+
always_run: true

CONTRIBUTING.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pre-commit install
3232
### Common Commands
3333

3434
```bash
35-
# Run tests
35+
# Run tests with coverage
3636
uv run pytest
3737

3838
# Run full pre-commit checks across the repo
@@ -55,14 +55,19 @@ See `docs/operations.md` for more details on transports and configuration.
5555

5656
## Testing
5757

58-
- Tests use `pytest`.
58+
- Tests use `pytest` with coverage reporting via `pytest-cov`.
5959
- Before submitting a PR, run:
6060

6161
```bash
62+
# Run tests with coverage report
6263
uv run pytest
63-
uv run pre-commit run --all-files
64+
65+
# View HTML coverage report (opens in default browser)
66+
uv run python -m webbrowser htmlcov/index.html
6467
```
6568

69+
The test suite generates both terminal and HTML coverage reports showing which code paths are tested.
70+
6671
## Branching and Commit Conventions
6772

6873
### Branch Naming

README.md

Lines changed: 81 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,35 @@
99
</p>
1010

1111
<p align="center">
12-
<a href="https://github.com/liatrio-labs/spec-driven-workflow-mcp/actions/workflows/ci.yml"><img src="https://github.com/liatrio-labs/spec-driven-workflow-mcp/actions/workflows/ci.yml/badge.svg" alt="CI Status"/></a>
13-
<a href="https://github.com/liatrio-labs/spec-driven-workflow-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"/></a>
14-
<a href="https://github.com/liatrio-labs/spec-driven-workflow-mcp/stargazers"><img src="https://img.shields.io/github/stars/liatrio-labs/spec-driven-workflow-mcp?style=social" alt="GitHub stars"/></a>
12+
<a href="https://github.com/liatrio-labs/spec-driven-workflow/actions/workflows/ci.yml"><img src="https://github.com/liatrio-labs/spec-driven-workflow/actions/workflows/ci.yml/badge.svg" alt="CI Status"/></a>
13+
<a href="https://github.com/liatrio-labs/spec-driven-workflow/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"/></a>
14+
<a href="https://github.com/liatrio-labs/spec-driven-workflow/stargazers"><img src="https://img.shields.io/github/stars/liatrio-labs/spec-driven-workflow?style=social" alt="GitHub stars"/></a>
1515
<a href="docs/operations.md"><img src="https://img.shields.io/badge/docs-Operations-blue" alt="Documentation"/></a>
1616
</p>
1717

18+
## TLDR
19+
20+
1. Install the workflow prompts as slash commands in all your [local AI tools](#supported-ai-tools):
21+
22+
```bash
23+
uvx --from git+https://github.com/liatrio-labs/spec-driven-workflow sdd-generate-commands generate --yes
24+
```
25+
26+
2. In your AI tool of choice, use `/generate-spec` with your idea:
27+
28+
```text
29+
/generate-spec I want to add user authentication to my app
30+
```
31+
32+
→ AI asks clarifying questions → You provide answers → Spec created in `tasks/0001-spec-user-auth.md`
33+
34+
3. Continue the flow:
35+
36+
- Run `/generate-task-list-from-spec` → Task list created in `tasks/tasks-0001-spec-user-auth.md`
37+
- Use `/manage-tasks` → Execute tasks one-by-one with proof artifacts
38+
39+
4. **SHIP IT** 🚢💨
40+
1841
## Highlights
1942

2043
- **Prompt-first workflow:** Use curated prompts to go from idea → spec → task list → implementation-ready backlog.
@@ -115,19 +138,57 @@ sequenceDiagram
115138
- **Status Keys:** `[ ]` not started, `[~]` in progress, `[x]` complete, mirroring the manage-tasks guidance.
116139
- **Proof Artifacts:** URLs, CLI commands, screenshots, or tests captured per task to demonstrate working software.
117140

118-
## Hands-On Usage (No MCP Required)
141+
## Hands-On Usage
142+
143+
The SDD workflow can be used in three ways, from simplest to most automated:
144+
145+
### Option 1: Manual Copy-Paste (No Tooling Required)
119146

120147
1. **Kick off a spec:** Copy or reference `prompts/generate-spec.md` inside your preferred AI chat. Provide the feature idea, answer the clarifying questions, and review the generated spec before saving it under `/tasks`.
121148
2. **Plan the work:** Point the assistant to the new spec and walk through `prompts/generate-task-list-from-spec.md`. Approve parent tasks first, then request the detailed subtasks and relevant files. Commit the result to `/tasks`.
122149
3. **Execute with discipline:** Follow `prompts/manage-tasks.md` while implementing. Update statuses as you work, attach proof artifacts, and pause for reviews at each demoable slice.
123150

124-
### Slash Command Integration (TBD)
151+
### Option 2: Native Slash Commands (Recommended)
152+
153+
#### Supported AI Tools
154+
155+
The slash command generator currently supports the following AI coding assistants:
156+
157+
| AI Tool | Command Install Location |
158+
|--------------|--------------------------------------------------|
159+
| Claude Code | `~/.claude/commands` |
160+
| Codex CLI | `~/.codex/prompts` |
161+
| Cursor | `~/.cursor/commands` |
162+
| Gemini CLI | `~/.gemini/commands` |
163+
| VS Code | `~/.config/Code/User/prompts` |
164+
| Windsurf | `~/.codeium/windsurf/global_workflows` |
125165

126-
Guides are coming for wiring these prompts as first-class slash commands in popular IDEs and AI tools (Windsurf, VS Code, Cursor, Claude Code, Codex, and more).
166+
For full setup and agent-specific details, see [docs/slash-command-generator.md](./docs/slash-command-generator.md).
127167

128-
## Optional: Automate with the MCP Server
168+
#### Slash Command Installation
129169

130-
Prefer tighter tooling? This repository also ships an MCP server that exposes the same prompts programmatically. Treat it as an accelerator—everything above works without it.
170+
Generate slash commands for your AI coding assistant and use the prompts as native commands:
171+
172+
```bash
173+
# Clone and install locally
174+
git clone https://github.com/liatrio-labs/spec-driven-workflow.git
175+
cd spec-driven-workflow
176+
uv sync
177+
uv run sdd-generate-commands generate --yes
178+
179+
# Or run directly from the git repo via uvx
180+
uvx --from git+https://github.com/liatrio-labs/spec-driven-workflow sdd-generate-commands generate --yes
181+
```
182+
183+
This will auto-detect your configured AI assistants (Claude Code, Cursor, Windsurf, etc.) and generate command files in your home directory.
184+
185+
**Note**: Once available on PyPI, you'll be able to run `uvx spec-driven-development-mcp sdd-generate-commands generate --yes` for a one-liner installation.
186+
187+
See [docs/slash-command-generator.md](./docs/slash-command-generator.md) for details.
188+
189+
### Option 3: MCP Server (Advanced)
190+
191+
Run the prompts as an MCP server for programmatic access. This option is most useful for custom integrations and tools that support MCP.
131192
132193
> Note: MCP prompt support is not uniformly supported across AI tools. See [docs/mcp-prompt-support.md](./docs/mcp-prompt-support.md) for details.
133194
@@ -141,8 +202,8 @@ Prefer tighter tooling? This repository also ships an MCP server that exposes th
141202
142203
```bash
143204
# Clone the repository
144-
git clone https://github.com/liatrio-labs/spec-driven-workflow-mcp.git
145-
cd spec-driven-workflow-mcp
205+
git clone https://github.com/liatrio-labs/spec-driven-workflow.git
206+
cd spec-driven-workflow
146207
147208
# Install dependencies
148209
uv sync
@@ -153,7 +214,11 @@ uv sync
153214
**STDIO (local development):**
154215
155216
```bash
217+
# From local clone
156218
uvx fastmcp run server.py
219+
220+
# Or run directly from the git repo via uvx
221+
uvx --from git+https://github.com/liatrio-labs/spec-driven-workflow spec-driven-development-mcp
157222
```
158223
159224
**With MCP Inspector:**
@@ -165,9 +230,15 @@ uvx fastmcp dev server.py
165230
**HTTP Transport:**
166231
167232
```bash
233+
# Use fastmcp CLI for HTTP transport
168234
uvx fastmcp run server.py --transport http --port 8000
235+
236+
# Or run directly from the git repo via uvx
237+
uvx --from git+https://github.com/liatrio-labs/spec-driven-workflow spec-driven-development-mcp --transport http --port 8000
169238
```
170239
240+
**Note**: Once available on PyPI, you'll be able to run `uvx spec-driven-development-mcp` for a one-liner installation with optional `--transport` and `--port` arguments. The `fastmcp run` approach remains available for development and advanced options.
241+
171242
See [docs/operations.md](docs/operations.md) and [CONTRIBUTING.md](CONTRIBUTING.md) for advanced configuration, deployment, and contribution guidelines.
172243

173244
## References

__version__.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""Centralized version management for the project.
2+
3+
This module reads the version from pyproject.toml to ensure a single source of truth.
4+
"""
5+
6+
from __future__ import annotations
7+
8+
import tomllib
9+
from importlib.metadata import version as get_package_version
10+
from pathlib import Path
11+
12+
13+
def _get_version() -> str:
14+
"""Get the version from pyproject.toml."""
15+
pyproject_path = Path(__file__).parent / "pyproject.toml"
16+
if pyproject_path.exists():
17+
# Local development mode
18+
with pyproject_path.open("rb") as f:
19+
data = tomllib.load(f)
20+
return data["project"]["version"]
21+
else:
22+
# Installed package mode
23+
return get_package_version("spec-driven-development-mcp")
24+
25+
26+
__version__ = _get_version()

docs/operations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ uv run pytest
147147
### Run with Coverage
148148

149149
```bash
150-
uv run pytest --cov=mcp_server --cov-report=html
150+
uv run pytest --cov=mcp_server --cov=slash_commands --cov-report=html
151151
```
152152

153-
### Run Specific Test File
153+
Open `htmlcov/index.html` in your browser to view the detailed coverage report.
154154

155155
```bash
156156
uv run pytest tests/test_prompts.py -v

0 commit comments

Comments
 (0)