Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,6 @@ log/
# .env
# .env.local
# .env.*.local

# Weave planning tool runtime state
.weave/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ The generator supports the following AI coding assistants:
- macOS: `~/Library/Application Support/Code - Insiders/User/prompts`
- Windows: `%APPDATA%\Code - Insiders\User\prompts`
- **OpenCode CLI**: Commands installed to `~/.config/opencode/command`
- **Pi**: Commands installed to `~/.pi/prompts`
- **Amazon Q**: Commands installed to `~/.aws/amazonq/prompts` (Windows & macOS/Linux)
- **Kiro CLI**: Prompts installed to `~/.kiro/prompts`
- Invoke with `@prompt-name` (e.g., `@generate-spec`)
Expand Down
1 change: 1 addition & 0 deletions docs/slash-command-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ The following agents are supported:
| `kiro-cli` | Kiro CLI | Kiro | `.md` | `.kiro/prompts` | [Home](https://kiro.dev/cli/) · [Docs](https://kiro.dev/docs/cli/) |
| `kiro-ide` | Kiro IDE | Kiro IDE | `.md` | `.kiro/steering` | [Home](https://kiro.dev/) · [Docs](https://kiro.dev/docs/) |
| `opencode` | OpenCode CLI | Markdown | `.md` | `.config/opencode/command` | [Home](https://opencode.ai) · [Docs](https://opencode.ai/docs/commands) |
| `pi` | Pi | Pi | `.md` | `.pi/prompts` | [Home](https://pi.ai/) |
| `vs-code` | VS Code | Markdown | `.prompt.md` | Platform-specific (see note below) | [Home](https://code.visualstudio.com/) · [Docs](https://code.visualstudio.com/docs) |
| `vs-code-insiders` | VS Code Insiders | Markdown | `.prompt.md` | Platform-specific (see note below) | [Home](https://code.visualstudio.com/insiders/) · [Docs](https://code.visualstudio.com/docs) |
| `windsurf` | Windsurf | Markdown | `.md` | `.codeium/windsurf/global_workflows` | [Home](https://windsurf.com/editor) · [Docs](https://docs.windsurf.com/) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 09-audit-pi-subagent-support.md

## Executive Summary

- Overall Status: PASS
- Required Gate Failures: 0
- Flagged Risks: 1

## Gateboard

| Gate | Status | Why it failed (<=10 words) | Exact fix target |
| --- | --- | --- | --- |
| Requirement-to-test traceability | PASS | All FRs mapped to test artifacts | — |
| Proof artifact verifiability | PASS | All artifacts are observable and reproducible | — |
| Repository standards consistency | PASS | AGENTS.md + README.md + generator docs read; no conflicts | — |
| Open question resolution | PASS | Both open questions resolved with explicit assumptions in spec | — |
| Regression-risk blind spots | FLAG | No negative test for invalid `CommandFormat` in factory | See Findings |
| Non-goal leakage | PASS | Tasks stay within spec boundaries | — |

## Standards Evidence Table (Required)

| Source File | Read | Standards Extracted | Conflicts |
| --- | --- | --- | --- |
| `AGENTS.md` | yes | `uv run` for all Python; integration tests via Docker script only; unit tests via `uv run pytest tests/ -v -m "not integration"` | none |
| `README.md` | yes | `uvx` install pattern; `slash-man generate` CLI entry point; Supported AI Tools bullet list format | none |
| `docs/slash-command-generator.md` | yes | Agents table format (alphabetical, 6 columns); per-agent section pattern; Conventional Commits (`feat(pi): ...`) | none |
| `CONTRIBUTING.md` | not found | — | — |
| `.github/pull_request_template.md` | not found | — | — |

## Findings

### FLAG Findings

1. **Regression-risk: `CommandGenerator.create()` factory has no test for `CommandFormat.PI` dispatch**
- Risk: If the `elif format == CommandFormat.PI` branch is accidentally omitted or misspelled, the factory silently falls through to `raise ValueError`, but no unit test directly exercises `CommandGenerator.create(CommandFormat.PI)`.
- Suggested remediation: Add a sub-task to `test_generators.py` that calls `CommandGenerator.create(CommandFormat.PI)` and asserts the returned object is an instance of `PiCommandGenerator`. This is a one-liner and closes the gap. (Low effort, high confidence.)

## User-Approved Remediation Plan

- **Approved | Completed** — `test_command_generator_factory_creates_pi_generator()` added as the final bullet in task 3.1 of `09-tasks-pi-subagent-support.md`.
131 changes: 131 additions & 0 deletions docs/specs/09-spec-pi-subagent-support/09-proofs/09-task-all-proofs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Task Proofs - Pi Subagent Support (Spec 09)

## Task Summary

This spec adds Pi as a fully supported agent in slash-command-manager. Three parent tasks were completed:

1. **Task 1.0** — Registered `CommandFormat.PI` enum value and Pi agent tuple in `_SUPPORTED_AGENT_DATA`
2. **Task 2.0** — Implemented `PiCommandGenerator` class with minimal YAML frontmatter (`description` + optional `argument-hint`), `$ARGUMENTS` preservation, and factory registration
3. **Task 3.0** — Added 7 Pi unit tests, updated integration test fixtures, and updated README + docs

## What This Proves

- Pi is registered as a discoverable agent (`--list-agents` shows it)
- `PiCommandGenerator` produces correct Pi-format files (only `description`/`argument-hint` in frontmatter, no `name`/`enabled`/`tags`/`arguments`/`meta`)
- `$ARGUMENTS` is preserved as-is in Pi output (Pi handles it natively)
- All 236 unit tests pass with no regressions
- Integration test fixtures include Pi for Docker-isolated testing

---

## Artifact: Pi appears in --list-agents

**What it proves:** Pi is registered in `_SUPPORTED_AGENT_DATA` and discoverable via CLI.

**Why it matters:** This is the primary user-facing proof that the agent is available.

**Command:**

```bash
uv run slash-man generate --list-agents
```

**Result summary:** Pi row appears in the agents table with `~/.pi/prompts` as the target directory.

```
│ pi │ Pi │ ~/.pi/prompts │ ✗ │
```

---

## Artifact: Pi unit tests — 7/7 passing

**What it proves:** `PiCommandGenerator` correctly handles all required behaviors: basic generation, agent overrides, argument-hint, no-args omission, `$ARGUMENTS` preservation, snapshot regression, and factory dispatch.

**Why it matters:** These tests are the authoritative spec for Pi's output format.

**Command:**

```bash
uv run pytest tests/test_generators.py -v -m "not integration" -k pi
```

**Result summary:** All 7 Pi-specific tests pass.

```
tests/test_generators.py::test_pi_generator_basic_generation PASSED
tests/test_generators.py::test_pi_generator_applies_agent_overrides PASSED
tests/test_generators.py::test_pi_generator_argument_hint_with_args PASSED
tests/test_generators.py::test_pi_generator_no_argument_hint_when_no_args PASSED
tests/test_generators.py::test_pi_generator_preserves_arguments_placeholder PASSED
tests/test_generators.py::test_pi_generator_snapshot_regression PASSED
tests/test_generators.py::test_command_generator_factory_creates_pi_generator PASSED

7 passed, 20 deselected in 0.01s
```

---

## Artifact: Full unit test suite — 236/236 passing

**What it proves:** No regressions introduced by the Pi implementation.

**Why it matters:** Confirms all existing generators, config, and writer tests still pass.

**Command:**

```bash
uv run pytest tests/ -v -m "not integration"
```

**Result summary:** 236 passed, 35 deselected (integration tests skipped as expected).

```
====================== 236 passed, 35 deselected in 0.82s ======================
```

---

## Artifact: End-to-end Pi generation

**What it proves:** `PiCommandGenerator` produces correctly formatted files with only `description` and `argument-hint` in frontmatter.

**Why it matters:** Confirms Pi compatibility — no `name`, `enabled`, `tags`, `arguments`, or `meta` fields leak into the output.

**Command:**

```bash
uv run slash-man generate --agent pi --prompts-dir tests/integration/fixtures/prompts --target-path /tmp/pi-test --yes
cat /tmp/pi-test/.pi/prompts/test-prompt-1.md
```

**Result summary:** 3 files written to `.pi/prompts/`. Frontmatter contains only `description` and `argument-hint`.

```
---
description: First test prompt for integration testing
argument-hint: <input_arg>
---

# Test Prompt 1

This is the first test prompt file used for integration testing.
...
```

---

## Artifact: Documentation updated

**What it proves:** README and docs/slash-command-generator.md both list Pi.

**Why it matters:** User-facing and contributor-facing documentation is accurate.

- `README.md` "Supported AI Tools" section: `- **Pi**: Commands installed to ~/.pi/prompts`
- `docs/slash-command-generator.md` agents table: `| pi | Pi | Pi | .md | .pi/prompts | [Home](https://pi.ai/) |`

---

## Reviewer Conclusion

All three parent tasks are complete. Pi is fully registered, implemented, tested (7 unit tests + integration fixture updates), and documented. The full unit suite passes with no regressions. Integration tests include Pi in `test_generate_all_supported_agents` and will be verified via `uv run scripts/run_integration_tests.py` (Docker-isolated).
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# 09 Questions Round 1 - Pi Subagent Support

Please answer each question below (select one or more options, or add your own notes). Feel free to add additional context under any question.

## 1. What Is Pi?

I couldn't find an AI coding assistant called "Pi" with a documented slash command system. Can you clarify what Pi is?

- [ ] (A) Pi by Inflection AI (conversational AI assistant)
- [ ] (B) A new/beta AI coding tool with its own CLI or IDE integration
- [ ] (C) An internal or custom tool you've built or are building
- [ ] (D) A tool known by another name that you're referring to as "Pi"

**Recommended answer(s):** None — I genuinely don't know which tool this is. Your answer drives the entire spec.

## 2. Pi's Command Directory

Where does Pi expect slash command files to be placed?

- [ ] (A) `~/.pi/commands/` or similar dot-directory under home
- [ ] (B) A project-local directory (e.g., `.pi/commands/` relative to workspace)
- [ ] (C) Platform-specific paths (different on macOS/Linux/Windows)
- [ ] (D) I'm not sure yet — needs research

**Recommended answer(s):** [(B)]

**Why this is recommended:**

- Most agents in this project use project-local directories (e.g., `.claude/commands`, `.cursor/commands`)
- Project-local is the most common pattern for AI coding assistants with slash commands

## 3. Command File Format

What format does Pi expect for its command/prompt files?

- [ ] (A) Markdown with YAML frontmatter (like Claude Code, Cursor, Codex)
- [ ] (B) TOML (like Gemini CLI)
- [ ] (C) Plain markdown without frontmatter (like Kiro CLI)
- [ ] (D) A custom/unique format (please describe)
- [ ] (E) I'm not sure yet — needs research

**Recommended answer(s):** [(A)]

**Why this is recommended:**

- YAML frontmatter + Markdown is the most common format across supported agents (7 of 11 use it)
- Reusing `CommandFormat.MARKDOWN` means no new generator code is needed, keeping scope minimal

## 4. File Extension

What file extension does Pi use for command files?

- [ ] (A) `.md` (like Claude Code, Cursor, Codex, etc.)
- [ ] (B) `.prompt.md` (like VS Code)
- [ ] (C) `.toml` (like Gemini CLI)
- [ ] (D) Something else (please specify)

**Recommended answer(s):** [(A)]

**Why this is recommended:**

- `.md` is the most common extension across supported agents
- Reduces friction and follows established patterns

## 5. Detection Directories

Which directory presence indicates Pi is installed in a project?

- [ ] (A) `.pi/` directory in project root
- [ ] (B) Multiple directories (like Windsurf's `.codeium/` + `.codeium/windsurf/`)
- [ ] (C) A config file rather than a directory
- [ ] (D) I'm not sure — needs research

**Recommended answer(s):** [(A)]

**Why this is recommended:**

- Single detection directory is the simplest and most common pattern
- Follows the convention of most existing agents

## 6. Agent-Specific Overrides or Special Behavior

Does Pi require any special handling compared to standard markdown agents?

- [ ] (A) No special handling — standard markdown format works fine
- [ ] (B) Pi needs agent-specific frontmatter fields (please describe)
- [ ] (C) Pi has unique metadata or comment-based annotations
- [ ] (D) Pi has tool-permission or capability declarations in commands
- [ ] (E) I'm not sure yet

**Recommended answer(s):** [(A)]

**Why this is recommended:**

- Starting without special handling keeps scope minimal
- Special behavior can be added in a follow-up spec if needed
- The existing override system in `MarkdownPrompt` already supports per-agent customization via frontmatter

## 7. Reference Documentation

Do you have a link to Pi's documentation for its command/prompt system?

- [ ] (A) Yes — I'll provide the URL
- [ ] (B) No public docs yet, but I can describe the format
- [ ] (C) I'll research and get back to you
Loading