P9-1~P9-4 머지 후 사용자가 직접 도그푸딩 하며 수집한 16 항목 UX 피드백을 20 개 single-PR 사이즈 task spec 으로 분해. 각 spec 은 frontmatter (depends_on / unblocks / source_feedback), Goal, Allowed deps, Public surface, Behavior contract, Test plan, DoD, Out of scope 절 포함. 추가: - p9-fb-01 ~ 20-*.md: 분해된 task spec 20 개 - p9-dogfooding-feedback.md: master index + 우선순위 + 권장 실행 순서 + spec PR vs impl PR 절 - INDEX.md: p9-fb-01 ~ 20 link 추가 - docs/superpowers/plans/2026-05-02-p9-fb-06-reset-command.md: 첫 후속 작업 (kebab reset 명령) 의 6-task 구현 plan - .gitignore: .worktrees/ 추가 (superpowers worktree skill 용) 피드백 항목 → task spec 매핑은 p9-dogfooding-feedback.md 의 표 참조. 실행 시작 task: p9-fb-06 (reset 명령) — 도그푸딩 막힘 강도 1위. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
61 lines
2.1 KiB
Markdown
61 lines
2.1 KiB
Markdown
---
|
|
phase: P9
|
|
component: kebab-cli + kebab-app
|
|
task_id: p9-fb-18
|
|
title: "CLI ask --session / --repl"
|
|
status: planned
|
|
depends_on: [p9-fb-15, p9-fb-17]
|
|
unblocks: []
|
|
contract_source: ../../docs/superpowers/specs/2026-04-27-kebab-final-form-design.md
|
|
contract_sections: [§7 RAG, §externalAI]
|
|
source_feedback: p9-dogfooding-feedback.md item 14
|
|
---
|
|
|
|
# p9-fb-18 — CLI ask multi-turn
|
|
|
|
## Goal
|
|
|
|
CLI 에서도 conversation history 사용. `--session <id>` (영속) + `--repl` (in-memory loop).
|
|
|
|
## Allowed dependencies
|
|
|
|
- 기존 kebab-cli deps + p9-fb-17 의 ChatSessionRepo.
|
|
|
|
## Public surface
|
|
|
|
CLI:
|
|
```
|
|
kebab ask "Q" [--session <id>] [--repl]
|
|
```
|
|
|
|
- 둘 다 없음: 단발 (현 동작 유지).
|
|
- `--session foo`: SQLite chat_sessions 에 `foo` 가 있으면 history 로 사용 + 새 turn append. 없으면 새 session 생성.
|
|
- `--repl`: stdin loop. 각 question 후 답변 출력. `:q` 또는 EOF 종료. `--session` 결합 시 영속, 아니면 in-memory.
|
|
- `--repl` 에서 빈 줄 + `:` 명령: `:q` (quit), `:new` (session reset, in-memory), `:save <id>` (현 in-memory → session 저장 + 이후 영속).
|
|
|
|
`--json` 모드: line-delimited 답변 JSON. 각 줄 `answer.v1` (이미 정의), `conversation_id` + `turn_index` 필드 추가 (p9-fb-15 의 schema bump 와 함께).
|
|
|
|
## Behavior contract
|
|
|
|
- session 없이 단발 호출은 wire schema `answer.v1` 의 `conversation_id` 필드 = null. 호환.
|
|
- `--repl` 에서 Ctrl-C → graceful exit. session 저장된 상태면 finalized.
|
|
|
|
## Test plan
|
|
|
|
| kind | description |
|
|
|------|-------------|
|
|
| unit | `--session foo` 첫 호출 → 새 session 생성 |
|
|
| unit | `--session foo` 두번째 호출 → 이전 turn history 로 prompt 빌드 |
|
|
| integration | `--repl` stdin "Q1\nQ2\n:q\n" → 2 답변 + clean exit |
|
|
|
|
## DoD
|
|
|
|
- [ ] `cargo test -p kebab-cli` 통과
|
|
- [ ] `answer.v1` schema 갱신 (conversation_id / turn_index 추가, optional)
|
|
- [ ] README **명령** 표 + **외부 AI 통합** 절 — `--session` 으로 Claude Code skill / MCP 가 multi-turn 가능
|
|
|
|
## Out of scope
|
|
|
|
- session list / show / delete CLI 명령 (P+)
|
|
- session export (markdown / JSON dump)
|