بنقرة واحدة
project-migrate
// Migrate existing FIRE project to latest version. Adds constitution.md, updates schema, and optionally detects monorepo modules.
// Migrate existing FIRE project to latest version. Adds constitution.md, updates schema, and optionally detects monorepo modules.
Execute work items based on their assigned mode (autopilot, confirm, validate). Supports single-item and multi-item (batch/wide) runs.
Plan the scope of a run by discovering available work items and suggesting groupings. Invoked before run-execute.
Display current run status and progress. Shows work item, mode, duration, and files changed.
Display current FIRE project status and validate integrity of intents, work items, and runs.
Review code written during a run, auto-fix no-brainer issues, and suggest improvements requiring confirmation. Invoked after tests pass.
Generate implementation walkthrough for human review after run completion. Documents decisions, changes, and verification steps.
| name | project-migrate |
| description | Migrate existing FIRE project to latest version. Adds constitution.md, updates schema, and optionally detects monorepo modules. |
| version | 1.0.0 |
<action>Read .specs-fire/state.yaml</action>
<action>Check project.fire_version field</action>
<action>Read FIRE flow version from memory-bank.yaml</action>
<version_detection>
| Check | Meaning |
|-------|---------|
| project.fire_version missing | Pre-0.1.8 project |
| project.fire_version < current | Needs migration |
| project.fire_version == current | Up to date |
Also check for feature indicators:
| Missing Feature | Added In |
|-----------------|----------|
| constitution.md | 0.1.8 |
| workspace.structure | 0.1.8 |
</version_detection>
<check if="already up to date">
<output>Project is already at the latest version ({current_version}). No migration needed.</output>
<exit/>
</check>
<output>
Current version: {project_fire_version or "pre-0.1.8"}
Latest version: {fire_flow_version}
Migration required.
</output>
Determine what needs to be migrated:
<check_constitution>
Does .specs-fire/standards/constitution.md exist?
If no → needs_constitution = true
</check_constitution>
<check_schema>
Does state.yaml have workspace.structure field?
If no → needs_schema_update = true
</check_schema>
<check_monorepo>
Is this actually a monorepo? Check for:
- nx.json, turbo.json, pnpm-workspace.yaml, lerna.json
- package.json with "workspaces"
- Multiple package/dependency manifests
If detected → is_monorepo = true
</check_monorepo>
<output>
Migration Plan:
┌─────────────────────────────────────────────────────┐
│ Changes to be made: │
{{#if needs_constitution}}
│ ✓ Create constitution.md (universal policies) │
{{/if}}
{{#if needs_schema_update}}
│ ✓ Update state.yaml schema │
{{/if}}
{{#if is_monorepo}}
│ ? Monorepo detected — offer module standards │
{{/if}}
│ │
│ Will NOT change: │
│ • Existing intents and work items │
│ • Existing runs and logs │
│ • Existing standards (only add new ones) │
└─────────────────────────────────────────────────────┘
</output>
Create backup: cp -r .specs-fire .specs-fire-backup-{timestamp}
Backup created: .specs-fire-backup-{timestamp}
Ready to migrate. Backup saved.
Proceed with migration? [Y/n]
</ask>
How should I create constitution.md?
[a] Auto-generate — analyze project (git, CI, existing patterns)
[d] Default — use standard template
[c] Custom — I'll provide the content
</ask>
<check if="response == a">
<action>Analyze project for constitution content:</action>
<substep>Check .gitignore, CI config for workflow hints</substep>
<substep>Check existing PR templates, CONTRIBUTING.md</substep>
<substep>Infer commit style from git log</substep>
<action>Generate constitution.md from findings</action>
</check>
<check if="response == d">
<action>Create constitution.md from default template</action>
</check>
<check if="response == c">
<ask>Please describe your key policies (git workflow, PR process, security).</ask>
<action>Generate constitution.md from input</action>
</check>
<action>Write to .specs-fire/standards/constitution.md</action>
<output>Created: .specs-fire/standards/constitution.md</output>
Read current state.yaml
Add missing fields with defaults:
project.fire_version: "{current_fire_flow_version}"
workspace.structure: "monolith" (or "monorepo" if detected)
Write updated state.yaml (preserve all existing data)
Updated: .specs-fire/state.yaml
Discover modules (same as project-init):
Check workspace config for project list
Scan packages/*, apps/*, services/*, libs/*
Analyze each module's tech stack
<ask>
This appears to be a monorepo. Found {{module_count}} modules:
{{#each modules}}
• {{path}} ({{language}})
{{/each}}
Create module-specific standards?
[y] Yes — create for all modules
[s] Select — choose which modules
[n] No — skip for now
</ask>
<check if="response == y or response == s">
<action>For each selected module:</action>
<substep>Create {module}/.specs-fire/standards/</substep>
<substep>Generate tech-stack.md with detected settings</substep>
</check>
Verify migration completed:
Read state.yaml — valid YAML?
Check new files exist
Ensure no existing files corrupted
<check if="verification fails">
<output>Migration failed. Restoring from backup...</output>
<action>rm -rf .specs-fire && mv .specs-fire-backup-{timestamp} .specs-fire</action>
<output>Restored. Please report this issue.</output>
<exit status="error"/>
</check>
Migration complete!
Changes made:
{{#each changes_made}}
✓ {{description}}
{{/each}}
Backup preserved at: .specs-fire-backup-{timestamp}
(Delete once you've verified everything works)
New features available:
• Constitution: Universal policies in constitution.md
{{#if is_monorepo}}
• Monorepo: Module-specific standards supported
{{/if}}
</output>
<safety_guarantees> Backup created before any changes Idempotent — running twice is safe Verify after — validates migration succeeded Restore on failure — automatic rollback Never deletes — only adds, never removes </safety_guarantees>
<success_criteria> Current version detected correctly Backup created before changes constitution.md added if missing state.yaml schema updated if needed Monorepo modules detected and offered (if applicable) Migration verified successfully No existing data lost or corrupted </success_criteria>