Loading...
Loading...
Transform reverse-engineering documentation into GitHub Spec Kit format. Initializes .specify/ directory, creates constitution.md, generates specifications from reverse-engineered docs, and sets up for /speckit slash commands. This is Step 3 of 6 in the reverse engineering process.
npx skill4agent add jschulte/claude-plugins create-specsdocs/reverse-engineering/.specify/.specify/specs/###-feature-name/spec.md/speckit.planplan.md/speckit.taskstasks.md.stackshift-state.jsondocs/reverse-engineering//speckitdocs/reverse-engineering/functional-specification.md.specify/memory/constitution.md.specify/specs/###-feature-name/spec.mdplan.md/speckit.*# Check thoroughness level (set in Gear 1)
THOROUGHNESS=$(cat .stackshift-state.json | jq -r '.config.gear3_thoroughness // "specs"')
# Check route
ROUTE=$(cat .stackshift-state.json | jq -r '.path')
# Check spec output location (Greenfield may have custom location)
SPEC_OUTPUT=$(cat .stackshift-state.json | jq -r '.config.spec_output_location // "."')
echo "Route: $ROUTE"
echo "Spec output: $SPEC_OUTPUT"
echo "Thoroughness: $THOROUGHNESS"
# Determine what to execute
case "$THOROUGHNESS" in
"specs")
echo "Will generate: Specs only"
GENERATE_PLANS=false
GENERATE_TASKS=false
;;
"specs+plans")
echo "Will generate: Specs + Plans"
GENERATE_PLANS=true
GENERATE_TASKS=false
;;
"specs+plans+tasks")
echo "Will generate: Specs + Plans + Tasks (complete roadmap)"
GENERATE_PLANS=true
GENERATE_TASKS=true
;;
*)
echo "Unknown thoroughness: $THOROUGHNESS, defaulting to specs only"
GENERATE_PLANS=false
GENERATE_TASKS=false
;;
esac
# If custom location, ensure .specify directory exists there
if [ "$SPEC_OUTPUT" != "." ]; then
echo "Creating .specify/ structure at custom location..."
mkdir -p "$SPEC_OUTPUT/.specify/specs"
mkdir -p "$SPEC_OUTPUT/.specify/memory"
mkdir -p "$SPEC_OUTPUT/.specify/templates"
mkdir -p "$SPEC_OUTPUT/.specify/scripts"
fi| Route | Config | Specs Written To |
|---|---|---|
| Greenfield | spec_output_location set | |
| Greenfield | Not set (default) | |
| Brownfield | Always current | |
spec_output_location: "."spec_output_location: "~/git/my-new-app"spec_output_location: "~/git/my-app-docs"spec_output_location: "./new-version"/speckit.*# Install Spec Kit scripts to enable /speckit.* commands
if [ -f ~/git/stackshift/scripts/install-speckit-scripts.sh ]; then
~/git/stackshift/scripts/install-speckit-scripts.sh .
elif [ -f ~/stackshift/scripts/install-speckit-scripts.sh ]; then
~/stackshift/scripts/install-speckit-scripts.sh .
else
# Download directly if script not available
mkdir -p .specify/scripts/bash
BASE_URL="https://raw.githubusercontent.com/github/spec-kit/main/scripts"
curl -sSLf "$BASE_URL/bash/check-prerequisites.sh" -o .specify/scripts/bash/check-prerequisites.sh
curl -sSLf "$BASE_URL/bash/setup-plan.sh" -o .specify/scripts/bash/setup-plan.sh
curl -sSLf "$BASE_URL/bash/create-new-feature.sh" -o .specify/scripts/bash/create-new-feature.sh
curl -sSLf "$BASE_URL/bash/update-agent-context.sh" -o .specify/scripts/bash/update-agent-context.sh
curl -sSLf "$BASE_URL/bash/common.sh" -o .specify/scripts/bash/common.sh
chmod +x .specify/scripts/bash/*.sh
echo "✅ Downloaded GitHub Spec Kit scripts"
fi/speckit.analyzescripts/bash/check-prerequisites.sh/speckit.implementscripts/bash/check-prerequisites.sh/speckit.planscripts/bash/setup-plan.sh/speckit.specifyscripts/bash/create-new-feature.sh/speckit.analyze# Use the web reconciliation prompt to create all specs with 100% coverage
cat web/reconcile-specs.mddocs/reverse-engineering/functional-specification.md.specify/memory/constitution.md.specify/specs/###-feature-name/spec.mdplan.mdspecify init.specify/memory/constitution.md.specify/specs/###-feature-name/spec.md.specify/specs/###-feature-name/plan.md.claude/commands/speckit.*.md# Copy this prompt into Claude.ai:
cat web/reconcile-specs.md
# This will manually create all specs with 100% coveragespecify init.specify/
├── memory/
│ └── constitution.md # Project principles (will be generated)
├── templates/ # AI agent configs
├── scripts/ # Automation utilities
└── specs/ # Feature directories (will be generated)
├── 001-feature-name/
│ ├── spec.md # Feature specification
│ ├── plan.md # Implementation plan
│ └── tasks.md # Task breakdown (generated by /speckit.tasks)
└── 002-another-feature/
└── ....specify/specs/NNN-feature-name/docs/reverse-engineering/functional-specification.md.specify/memory/constitution.md/speckit.constitutionAfter generating initial constitution, user can run:
> /speckit.constitution
To refine and update the constitution interactivelydocs/reverse-engineering/functional-specification.md.specify/specs/FEATURE-ID/subagent_type=stackshift:technical-writerspecs/001-user-authentication/
├── spec.md # Feature specification
└── plan.md # Implementation plan# Feature: User Authentication
## Status
⚠️ **PARTIAL** - Backend complete, frontend missing login UI
## Overview
[Description of what this feature does]
## User Stories
- As a user, I want to register an account so that I can save my data
- As a user, I want to log in so that I can access my dashboard
## Acceptance Criteria
- [ ] User can register with email and password
- [x] User can log in with credentials
- [ ] User can reset forgotten password
- [x] JWT tokens issued on successful login
## Technical Requirements
- Authentication method: JWT
- Password hashing: bcrypt
- Session duration: 24 hours
- API endpoints:
- POST /api/auth/register
- POST /api/auth/login
- POST /api/auth/reset-password
## Implementation Status
**Completed:**
- ✅ Backend API endpoints (all 3)
- ✅ Database user model
- ✅ JWT token generation
**Missing:**
- ❌ Frontend login page
- ❌ Frontend registration page
- ❌ Password reset UI
- ❌ Token refresh mechanism
## Dependencies
None
## Related Specifications
- user-profile.md (depends on authentication)
- authorization.md (extends authentication)/speckit.specifyAfter generating initial specs, user can run:
> /speckit.specify
To create additional specifications or refine existing onesplan.md.specify/specs/FEATURE-ID/plan.md# Implementation Plan: User Authentication Frontend
## Goal
Complete the frontend UI for user authentication (login, registration, password reset)
## Current State
- Backend API fully functional
- No frontend UI components exist
- User lands on placeholder page
## Target State
- Complete login page with form validation
- Registration page with email verification
- Password reset flow (email + new password)
- Responsive design for mobile/desktop
## Technical Approach
1. Create React components using existing UI library
2. Integrate with backend API endpoints
3. Add form validation with Zod
4. Implement JWT token storage (localStorage)
5. Add route protection for authenticated pages
## Tasks
- [ ] Create LoginPage component
- [ ] Create RegistrationPage component
- [ ] Create PasswordResetPage component
- [ ] Add form validation
- [ ] Integrate with API endpoints
- [ ] Add loading and error states
- [ ] Write component tests
- [ ] Update routing configuration
## Risks & Mitigations
- Risk: Token storage in localStorage (XSS vulnerability)
- Mitigation: Consider httpOnly cookies instead
- Risk: No rate limiting on frontend
- Mitigation: Add rate limiting to API endpoints
## Testing Strategy
- Unit tests for form validation logic
- Integration tests for API calls
- E2E tests for complete auth flow
## Success Criteria
- All acceptance criteria from specification met
- No security vulnerabilities
- Pass all tests
- UI matches design system/speckit.planAfter generating initial plans, user can run:
> /speckit.plan
To create or refine implementation plans/speckit.analyze# Check consistency between specs and implementation
> /speckit.analyze
# Identifies:
# - Specs marked COMPLETE but implementation missing
# - Implementation exists but not in spec
# - Inconsistencies between related specs# Generate tasks from implementation plan
> /speckit.tasks
# Implement a specific feature
> /speckit.implement <specification-name>
# Runs through implementation plan step-by-step
# Updates implementation status as it progresses# Resolve underspecified areas
> /speckit.clarify
# Interactive Q&A to fill in missing details
# Similar to our complete-spec skill.specify/
├── memory/
│ └── constitution.md # Project principles
├── templates/
├── scripts/
└── specs/ # Feature directories
├── 001-user-authentication/
│ ├── spec.md # ⚠️ PARTIAL
│ └── plan.md # Implementation plan
├── 002-fish-management/
│ ├── spec.md # ⚠️ PARTIAL
│ └── plan.md
├── 003-analytics-dashboard/
│ ├── spec.md # ❌ MISSING
│ └── plan.md
└── 004-photo-upload/
├── spec.md # ⚠️ PARTIAL
└── plan.md
docs/reverse-engineering/ # Keep original docs for reference
├── functional-specification.md
├── data-architecture.md
└── ...greenfield_location~/git/my-new-app~/git/my-app/
├── [original code]
├── .specify/ # Created here first
└── docs/~/git/my-new-app/
├── .specify/ # COPIED from original repo
├── README.md
└── .gitignore/speckit.*| Original Doc | Spec Kit Artifact | Location |
|---|---|---|
| functional-specification.md | constitution.md | |
| functional-specification.md | Individual feature specs | |
| data-architecture.md | Technical details in specs | Embedded in specifications |
| operations-guide.md | Operational notes in constitution | |
| technical-debt-analysis.md | Implementation plans | |
docs/reverse-engineering/.specify/memory//speckitfind .specify/specs -name "spec.md" -type f | sort// For each PARTIAL/MISSING feature
Task({
subagent_type: 'general-purpose',
model: 'sonnet',
description: `Create plan for ${featureName}`,
prompt: `
Read: .specify/specs/${featureId}/spec.md
Generate implementation plan following /speckit.plan template:
- Assess current state (what exists vs missing)
- Define target state (all acceptance criteria)
- Determine technical approach
- Break into implementation phases
- Identify risks and mitigations
- Define success criteria
Save to: .specify/specs/${featureId}/plan.md
Target: 300-500 lines, detailed but not prescriptive
`
});find .specify/specs -name "plan.md" -type f | sort// For each plan
Task({
subagent_type: 'general-purpose',
model: 'sonnet',
description: `Create tasks for ${featureName}`,
prompt: `
Read: .specify/specs/${featureId}/spec.md
Read: .specify/specs/${featureId}/plan.md
Generate COMPREHENSIVE task breakdown:
- Break into 5-10 logical phases
- Each task has: status, file path, acceptance criteria, code examples
- Include Testing phase (unit, integration, E2E)
- Include Documentation phase
- Include Edge Cases section
- Include Dependencies section
- Include Acceptance Checklist
- Include Priority Actions
Target: 300-500 lines (be thorough!)
Save to: .specify/specs/${featureId}/tasks.md
`
});{
"config": {
"gear3_thoroughness": "specs+plans+tasks", // or "specs" or "specs+plans"
"plan_parallel_limit": 5,
"task_parallel_limit": 3
}
}.specify/constitution.md.specify/specs//speckit.*plan.md/speckit.taskstasks.md/speckit.analyze# This skill runs
1. specify init my-app
2. Generate constitution.md from functional-specification.md
3. Create individual feature specs from functional requirements
4. Mark implementation status (✅/⚠️/❌)
5. Generate implementation plans for gaps
# User can then run
> /speckit.analyze
# Shows: "5 PARTIAL features, 3 MISSING features, 2 inconsistencies"
> /speckit.implement user-authentication
# Walks through implementation plan step-by-step
> /speckit.specify
# Add new features as needed.specify/specs//speckitstackshift:technical-writer--ai claudespecify init/speckit.*