fea/SKILL.md

72 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: fea
description: Issue-driven feature planning workflow via Gitea. Reads issue as prompt, discusses requirements via issue comments, publishes implementation plan to wiki. Triggered with /fea owner/repo#number.
user-invocable: true
argument-hint: <owner/repo#issue-number>
---
# Issue-Driven Feature Planning Skill
You orchestrate a multi-phase feature planning workflow using Gitea issues and wiki. The argument `$ARGUMENTS` is in the format `owner/repo#number` (e.g. `pushok/mpns#12`).
Read `.claude/skills/fea/referencies/gitea-dto.md` before every invocation — it defines which fields to extract from Gitea responses and how to classify comments.
## Argument Parsing
Parse `$ARGUMENTS` into three variables:
- `owner` — everything before `/`
- `repo` — between `/` and `#`
- `issue_number` — after `#` (integer)
If parsing fails, tell the user: "Expected format: `/fea owner/repo#12`"
## Context Loading
Every invocation starts by loading context:
1. **Fetch issue** via `mcp__gitea__get_issue_by_index` with `owner`, `repo`, `index=issue_number`
2. **Fetch comments** via `mcp__gitea__get_issue_comments_by_index` with `owner`, `repo`, `index=issue_number`
3. **Extract fields** per `.referencies/gitea-dto.md` — discard everything else
4. **Classify comments** into bot vs user per `.referencies/gitea-dto.md` rules
The issue `title` + `body` is the feature prompt (replaces the old `prompt.md`).
## Phase Detection
Detect the current phase from the comment history:
1. **No bot comments at all** → Phase 1: Explore & Ask
2. **Latest bot comment has `### Questions`, no user comment posted after it** → Phase 2: Waiting for answers
3. **Latest bot comment has `### Questions`, user comment exists after it** → Phase 3: Process answers
4. **Latest bot comment has `<!-- status:ready -->`, no plan-published marker** → Phase 4: Generate plan
5. **Bot comment with `# Implementation Plan` exists** → Done: tell user the plan is already published, show the wiki link
## Phase 1: Explore & Ask
Issue understanding phase described at:
- `references/phases/phase1-understanding.md`
## Phase 2: Waiting for Answers
The latest bot comment has questions but no user reply after it. Tell the user:
"Waiting for your answers on the issue. Reply to the questions comment and re-run `/fea $ARGUMENTS`."
## Phase 3: Process Answers
Conversation reconstruction analyzing and responce phase described at:
- `references/phases/phase3-conversation.md`
## Phase 4: Generate Plan
Feature planning:
- `references/phases/phase4-planning.md`
## Important Rules
- ALWAYS read `.referencies/gitea-dto.md` and extract only listed fields — do not pass raw Gitea JSON to agents
- Bot comments MUST start with `<!-- mpns-feature-bot -->` on the very first line
- Session numbering: count existing bot Q&A comments to determine next session number
- Questions should be thoughtful and specific — 37 per session
- Use Russian where the issue is written in Russian
- Each session should make meaningful progress toward clarity
- Wiki page content must be base64-encoded for `create_wiki_page` / `update_wiki_page`
- Never post duplicate bot comments — check existing comments before posting
- When posting markdown in comments, ensure code blocks and formatting render correctly on Gitea