speckit-sync-backfill
Generate a new spec from unspecced code feature (backfill)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Generate a new spec from unspecced code feature (backfill)
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Push the LLM to reconsider, refine, and improve its recent output. Use when user asks for deeper critique or mentions a known deeper critique method, e.g. socratic, first principles, pre-mortem, red team.
System architect and technical design leader. Use when the user asks to talk to Winston or requests the architect.
Senior software engineer for story execution and code implementation. Use when the user asks to talk to Amelia or requests the developer agent.
Facilitate interactive brainstorming sessions using diverse creative techniques and ideation methods. Use when the user says help me brainstorm or help me ideate.
Review code changes adversarially using parallel review layers (Blind Hunter, Edge Case Hunter, Acceptance Auditor) with structured triage into actionable categories. Use when the user says "run code review" or "review this code"
Break requirements into epics and user stories. Use when the user says "create the epics and stories list"
| name | speckit-sync-backfill |
| description | Generate a new spec from unspecced code feature (backfill) |
| compatibility | Requires spec-kit project structure with .specify/ directory |
| metadata | {"author":"github-spec-kit","source":"sync:commands/backfill.md"} |
Generate a complete spec from an existing, unspecced code feature. Extracts intent from implementation, tests, and documentation.
$ARGUMENTS
The argument should be one of:
If a feature name is provided, search for relevant files:
Find all files related to the feature:
# Commands
find src -name "*[Feature]*Command.cs" -o -name "*[Feature]*.cs"
# Services
find src -name "*[Feature]*Service.cs"
# Tests
find tests -name "*[Feature]*Tests.cs"
# Docs
find docs -name "*[feature]*"
Read the discovered files and extract:
From Commands:
From Services:
From Tests:
From Existing Docs:
From the command/service analysis, generate user stories:
### User Story 1 - [Primary Use Case] (Priority: P1)
As a user, I want to [action from main command]
so that [benefit inferred from feature purpose].
**Acceptance Scenarios**:
1. **Given** [precondition from tests], **When** [action], **Then** [expected result].
Convert implementation behaviors to requirements:
From method signatures:
public async Task<ReconcileResult> ReconcileAsync(string profileName, ...)
→ FR-001: System MUST support reconciliation per profile.
From validation:
if (!_authService.IsAuthenticated) throw ...
→ FR-002: System MUST validate authentication before reconciliation.
From business logic:
var matches = _fuzzyMatcher.FindMatches(transactions, registryRows, threshold: 0.85);
→ FR-003: System MUST use fuzzy matching with configurable threshold to match transactions.
Follow the standard spec template:
# Feature Specification: [Feature Name]
**Feature Branch**: `[spec-id]`
**Created**: [today's date]
**Status**: Backfilled
**Source**: Generated from existing implementation
## Backfill Notice
> ⚠️ This spec was generated from existing code via `speckit.sync.backfill`.
> It documents current behavior, not original intent.
> Review carefully and update to reflect desired behavior.
## User Scenarios & Testing
### User Story 1 - [Story] (Priority: P1)
[generated user story]
## Requirements
### Functional Requirements
- **FR-001**: [extracted requirement]
- **FR-002**: [extracted requirement]
### CLI Commands
- **FR-0XX**: System MUST provide `fina [command]` command...
## Key Entities
- **[Entity]**: [description from code]
## Dependencies
- **Spec [XXX]**: [dependency identified from imports/services]
## Success Criteria
- **SC-001**: [derived from tests or obvious metrics]
## Implementation Notes
> These notes capture current implementation details that may or may not
> belong in the spec long-term.
- [implementation detail 1]
- [implementation detail 2]
Find the next available spec number:
ls specs/ | grep -E '^[0-9]+' | sort -n | tail -1
Suggest: {next_number}-{feature-name}
Create plan.md documenting the implementation architecture:
# Implementation Plan: [Feature Name]
**Branch**: `[spec-id]` | **Date**: [today] | **Spec**: [spec.md](spec.md)
**Context**: Backfilled from existing implementation. Documents current architecture.
## Summary
[Brief description of what the feature does]
## Technical Context
**Language/Version**: [detected from project]
**Primary Dependencies**:
- [Service 1] — [purpose]
- [Service 2] — [purpose]
**Performance Goals**: [if identifiable from code/tests]
## Architecture
### Service Layer
[Main Service] ├── [Dependency 1] ├── [Dependency 2] └── [Dependency 3]
### Flow
1. [Step 1]
2. [Step 2]
3. [Step 3]
### Key Design Decisions
1. **[Decision 1]**: [rationale from code/comments]
2. **[Decision 2]**: [rationale]
## Project Structure
```text
src/[paths discovered]
tests/[paths discovered]
[Test file locations]
[Any TODOs or comments suggesting future work]
### 8. Generate Quickstart
For user-facing features (CLI commands), create `quickstart.md`:
```markdown
# Quickstart: [Feature Name]
[One-line description of what users can do]
## Prerequisites
1. [Prerequisite 1]
2. [Prerequisite 2]
## Basic Usage
```bash
# [Primary use case]
fina [command] [args]
| Option | Description |
|---|---|
--option1 | [description] |
--option2 | [description] |
fina [command] [example]
fina [command] [example]
Skip `quickstart.md` for internal/non-user-facing features.
### 9. Output Options
**Preview Mode (default):**
Display generated spec, plan, quickstart, and tasks for review.
**Create Mode (`--create`):**
1. Create `specs/{id}/spec.md`
2. Create `specs/{id}/plan.md`
3. Create `specs/{id}/quickstart.md` (if user-facing)
4. Create `specs/{id}/tasks.md` (with review task)
5. Report location
### 10. Generate Review Task
Add a task to review the backfilled spec:
```markdown
# Tasks
## Review Backfilled Spec
- [ ] Review generated user stories for accuracy
- [ ] Verify requirements match intended behavior (not just current behavior)
- [ ] Remove implementation notes that don't belong in spec
- [ ] Add any missing requirements
- [ ] Mark spec status as "Draft" or "Approved"
/speckit.sync.backfill reconciliation
/speckit.sync.backfill src/Fina.App/Services/Reconciliation/ReconciliationService.cs
/speckit.sync.backfill reconciliation --create
/speckit.sync.backfill hints --spec-id 014
plan.md documents architecture decisions; useful for onboarding and future changesquickstart.md is user documentation; skip for internal-only features