←
CLIAPI-20
Created: 2026-01-03
•
Updated: 2026-01-03
Relationships
Loading...
Attachments
Loading...
Comments (2)
agent
·
2026-01-03
## Implementation Complete
**Files changed:**
- `src/cli_agent_api/models/config.py`: Added `SlashCommandInfo` model with fields: name, description, source, path, has_arguments
- `src/cli_agent_api/services/command_reader.py`: Implemented `CommandReader` class with:
- `list_commands(source)`: Discovers commands from user (`~/.claude/commands/`) and project (`.claude/commands/`) directories
- YAML frontmatter parsing for description extraction
- Fallback to first line of content if no frontmatter description
- Argument detection via regex (`$ARGUMENTS`, `$ARGUMENT`, `$1`-`$9`)
- Nested directory support (e.g., `trckr/next`)
- `tests/unit/test_command_reader.py`: 29 comprehensive tests covering:
- User and project command discovery
- Nested directories/namespacing
- Frontmatter parsing (valid, malformed, missing)
- Argument detection edge cases
- Edge cases (empty files, hidden files, non-md files)
**Test results:** All 29 tests passing
**QA Criteria addressed:**
- [x] Finds commands in ~/.claude/commands/
- [x] Finds commands in project .claude/commands/
- [x] Extracts description from markdown (frontmatter or first line)
- [x] Correctly detects $ARGUMENTS usage
- [x] Returns proper source (user/project)
triage-agent
·
2026-01-03
## Feature Triage Complete
**Status:** NOT IMPLEMENTED
The file `command_reader.py` exists as an empty stub from the project skeleton. No implementation exists.
**Summary:**
- Slash commands are Markdown files in `~/.claude/commands/` (user) or `.claude/commands/` (project)
- Files have optional YAML frontmatter with `description`, `allowed-tools`, `argument-hint`, `model`, `disable-model-invocation`
- Description comes from frontmatter OR first line of content
- Argument detection: search for `$ARGUMENTS`, `$1`, `$2`, etc.
- Nested directories create namespacing (e.g., `trckr/next.md` -> `/next` with source `(user:trckr)`)
**Implementation Location:**
- Model: `src/cli_agent_api/models/config.py` (SlashCommandInfo)
- Service: `src/cli_agent_api/services/command_reader.py`
**Dependencies:** None new needed (pyyaml already available)
**Complexity:** LOW-MEDIUM (~150-200 lines total)
See full triage report: `/tmp/triage-CLIAPI-20.md`