بنقرة واحدة
refacil-archive
Archive a completed change — move artifacts to archive and sync specs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Archive a completed change — move artifacts to archive and sync specs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Guided complete flow to investigate and fix bugs — delegates investigation and fix to the refacil-debugger sub-agent in two passes separated by user confirmation
Internal reference — SDD-AI prerequisites shared by all other refacil skills (do not invoke manually)
Validate that the implementation meets the specs — builds a briefing with testCommand and CA/CR criteria, delegates to the refacil-validator sub-agent for the report, and handles corrections with user approval
Implement the tasks of a proposed change — verifies artifacts and working branch, builds a structured briefing, and delegates to the refacil-implementer sub-agent to execute the implementation in isolated context
Run the SDD implementation cycle autonomously after /refacil:propose was approved by the human — chains apply → test → verify → review → archive → up-code in a single invocation, and notifies the user via WhatsApp through Kapso when finished (success or failure). Use when the user says "autopilot", "ejecuta el resto del flujo", "termina solo", "modo autónomo", or indicates they will step away from the computer.
Interactive guide for the SDD-AI methodology — explains which command to use based on what you need to do
| name | refacil:archive |
| description | Archive a completed change — move artifacts to archive and sync specs |
| user-invocable | true |
This command archives completed SDD changes through refacil-sdd-ai sdd archive <changeName>, syncs refacil-sdd/specs/, and enforces team pre-verification checks.
Prerequisites: sdd profile from refacil-prereqs/SKILL.md + rules from METHODOLOGY-CONTRACT.md.
Try to read refacil-sdd/.autopilot-active. If the file exists and its changeName field matches the change being archived → autopilotMode = true, extract taskReference from the file. Otherwise autopilotMode = false (normal mode, ask user as usual).
Before archiving, run refacil-sdd-ai sdd status <changeName> --json and parse the JSON to get the change status.
Verify the change is truly complete:
Tasks completed: Use the tasksProgress (or tasks) field from the JSON — verify that tasks.pending === 0. If there are incomplete tasks, inform the user and ask if they want to continue anyway.
Current /refacil:test evidence: Do not re-run the test suite by default. Run refacil-sdd-ai sdd get-memory <changeName> --json and verify that:
memory.lastStep is test, verify, or review (test evidence remains valid after later validation phases if it is still fresh).memory.commandsRun is present and non-empty.memory.criteriaRun is an array with at least one covered CA/CR criterion.memory.touchedFiles, when present, still covers the files currently changed for this SDD change./refacil:test evidence. Use reliable timestamps, hashes, or an equivalent snapshot when available. If freshness cannot be proven, treat the evidence as stale.If the evidence is current, archive may continue and should report Tests: PASS (from /refacil:test evidence: <commandsRun>).
If evidence is missing or stale:
autopilotMode = false: stop and ask the user whether to run /refacil:test now or explicitly continue without current test evidence. Do not silently run tests.autopilotMode = true: abort archiving with a clear error: Cannot archive in autopilot: current /refacil:test evidence is missing or stale. Do not ask the user and do not re-run tests.Working tree scope hygiene: Run git status and check whether there are files unrelated to the current change scope. It is expected to have uncommitted changes in this step. If unrelated files are detected, warn the user and ask whether to continue archiving anyway. Do not suggest commit in this step; commit/push decisions are handled in refacil:up-code.
Review approved (blocking): Verify that the .review-passed file exists in the change folder (refacil-sdd/changes/[change-name]/.review-passed) following METHODOLOGY-CONTRACT.md §8 (dotfile; do not conclude by listings without dotfiles). If it does NOT exist, stop the archiving and inform the user:
Cannot archive: the change does not have an approved review.
Run /refacil:review first.
This verification is mandatory and blocking — it cannot be skipped.
If any of checks 1-3 fail, inform the user but allow them to decide whether to continue, except missing/stale test evidence in autopilot mode, which is blocking. If check 4 fails, archiving cannot continue.
autopilotMode = true: use taskReference from refacil-sdd/.autopilot-active directly. Do NOT ask the user. Set taskReferences = [taskReference] and continue.
autopilotMode = false (normal): ask the user for the task reference(s) associated with the change (URL, issue/ticket number, or short task name):
Task reference(s) associated with this change (URL, ticket number, or task name; if multiple, separate with commas):
Rules:
https://tracker.company.com/TASK-123), identifier (TASK-123, INC-9001), or short descriptive name (checkout-adjustment).URL: starts with http:// or https:// and has at least one non-space character after the protocol.identifier: matches ^[A-Za-z][A-Za-z0-9_-]*-\d+$ (examples: BP-4610, INC-9001).short name: 3-80 characters, includes at least one letter, and is not only symbols/spaces.Cannot archive without at least one task reference.
Provide the task URL, identifier, or name that originated this change to continue.
---, ???, 123, _), reject it and ask again:
Invalid task reference format.
Use one of: URL (https://...), identifier (ABC-123), or short task name (3-80 chars, includes letters).
taskReferences to use when writing review.yaml in the following steps.Inspect the change folder in refacil-sdd/changes/:
proposal.md, specs.md, design.md, and tasks.md) → regular change, even when the folder name starts with fix-.
fix-seginf-20 containing proposal.md + specs.md + design.md + tasks.md → treat as regular change and follow Step 2B.summary.md exists and the full SDD artifact set is absent) → bug fix.
fix-null-pointer-pay containing only summary.md (and optionally .review-passed) → treat as bug fix and follow Step 2A.Depending on the type, follow the corresponding step:
Minimal bug fixes only contain summary.md (and optionally .review-passed) and do not include the full SDD artifact set. The CLI refacil-sdd-ai sdd archive handles the folder move internally with its own findProjectRoot(), so use the CLI for the move, and only write specs/review.yaml yourself (the CLI does not cover those).
Read artifacts before archiving: read summary.md and .review-passed from refacil-sdd/changes/[fix-name]/ now, before the CLI moves the folder. The archived path will be different.
Archive with the CLI — let the CLI handle the move (it preserves memory.yaml by moving the complete change directory):
refacil-sdd-ai sdd archive [fix-name]
The CLI resolves the repo root internally, skips spec sync for fix-* (no specs.md in the change folder), preserves memory.yaml if present, moves the folder to refacil-sdd/changes/archive/[ISO-date]-[fix-name]/, and exits with code 0 on success. If it exits non-zero, stop and report the error to the user.
Document in specs: using the content read in step 0, create an individual spec at $(git rev-parse --show-toplevel)/refacil-sdd/specs/[descriptive-name]/spec.md.
Spec folder name: Use a short, clear kebab-case description of the bug (e.g. fix-session-timeout-redis, fix-null-pointer-payment-callback). Do NOT use ticket IDs (REF-123, TASK-456, etc.) — the name must be descriptive so /refacil:explore can find and understand the fix without external context.
Content of spec.md (Refacil SDD spec layout):
# [descriptive-name] Specification
## Purpose
Fix [clear bug description] to restore expected behavior without introducing regressions.
## Requirements
### Requirement: [main expected behavior]
The system SHALL [correct behavior after the fix].
#### Scenario: Bug fixed in original condition
- **WHEN** [condition that previously failed]
- **THEN** the system SHALL [expected result]
#### Scenario: Normal flow remains stable
- **WHEN** [normal condition]
- **THEN** the system SHALL [normal behavior without regression]
Persist review metadata separately: create $(git rev-parse --show-toplevel)/refacil-sdd/specs/[descriptive-name]/review.yaml with the fields from .review-passed plus the task references from Step 1.5:
verdict: APROBADO|APROBADO CON OBSERVACIONES
date: 2026-04-10T00:00:00.000Z
changeName: fix-...
summary: "..."
failCount: 0
blockers: false
taskReferences:
- https://tracker.company.com/TASK-123
- TASK-123
Continue to Step 3.
refacil-sdd-ai sdd archive normalizes the provided changeName to lowercase before validation/path resolution. Prefer lowercase names for consistency across commands and records.
Spec sync (CLI — mandatory, same language as change artifacts):
sdd archive runs refacil-sdd-ai sdd sync-spec <changeName> automatically before moving the folder.specs.md or specs/**/*.md into refacil-sdd/specs/<changeName>/spec.md using catalog headings that match the change artifact language (Spanish vs English section titles — see sdd sync-spec / METHODOLOGY-CONTRACT).refacil-sdd-ai sdd sync-spec <changeName>.Verify spec sync output (after archive, or run sync-spec manually first):
refacil-sdd/specs/<changeName>/spec.md exists and matches the language of the archived change specs.Persist review evidence (before or after archive):
refacil-sdd/changes/<changeName>/.review-passed (dotfile — use ls -la or read by explicit path, not directory listing).refacil-sdd/specs/<specName>/review.yaml with its fields plus taskReferences from Step 1.5:
verdict: APROBADO|APROBADO CON OBSERVACIONES
date: 2026-04-10T00:00:00.000Z
changeName: change-name
summary: "..."
failCount: 0
blockers: false
taskReferences:
- https://tracker.company.com/TASK-123
- TASK-123
review.yaml already exists, update only the fields that changed without removing others.Record archived state — run this command while the change directory is still at its original path (refacil-sdd/changes/<changeName>/), before the CLI move in step 4. After the move that path no longer exists and set-memory would fail to locate the change:
refacil-sdd-ai sdd set-memory <changeName> --state archived --actor archive-skill
If the command fails, continue silently — it must not block the flow.
Run the CLI archive: refacil-sdd-ai sdd archive <changeName> — sync-spec, preserves memory.yaml if present, then moves the complete change directory to refacil-sdd/changes/archive/<date>-<changeName>/.
Verify the command completed successfully (exit 0) and the original folder no longer exists.
Continue to Step 3.
The goal is for refacil-sdd/specs/ to document how the system works TODAY.
Before showing the summary, run a final cleanup verification (applies to both bug fixes and regular changes):
$(git rev-parse --show-toplevel)/refacil-sdd/changes/[original-name]/ must NOT exist (only the archived version must survive in refacil-sdd/changes/archive/...).=== Change archived ===
Change: [name]
Type: [Bug fix | Regular change]
Location: refacil-sdd/changes/archive/[date]-[name]/
Original folder deleted: YES
Specs synced: YES
Tests: PASS (from /refacil:test evidence)
The change has been completed and archived successfully.
After confirming the archiving:
autopilotMode = false (normal): ask the user:
The next step is to push the change and create the PR.
Do you want me to continue with /refacil:up-code?
autopilotMode = true: proceed to /refacil:up-code immediately without asking./refacil:up-code. Do not describe it in text or wait for the user to type it. (See METHODOLOGY-CONTRACT.md §5.).review-passed metadata must be persisted separately in YAML (review.yaml) inside each spec folderrefacil-sdd/changes/[name]/ must NOT survive archiving — neither for bug fixes (Step 2A) nor for regular changes (Step 2B). Use the native CLI move and verify explicitly. If residue remains, stop and report it instead of performing an automatic destructive cleanup.