openspec-task-loop
SKILL.md
OpenSpec Task Loop
Repo Sync Before Edits (mandatory)
Before creating/updating/deleting files in an existing repository, sync the current branch with remote:
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin
git pull --rebase origin "$branch"
If the working tree is not clean, stash first, sync, then restore:
git stash push -u -m "pre-sync"
branch="$(git rev-parse --abbrev-ref HEAD)"
git fetch origin && git pull --rebase origin "$branch"
git stash pop
If origin is missing, pull is unavailable, or rebase/stash conflicts occur, stop and ask the user before continuing.
Overview
Run OpenSpec as one task = one change. Keep scope tight, generate artifacts, implement, verify, and archive before moving to the next task.
Workflow Decision
- If
/opsx:*commands are supported in the current coding tool: use native OPSX flow. - If not supported: use manual fallback by creating files under
openspec/changes/<change-id>/.
Core Loop (Single Task)
For each selected task from tasks.md:
-
Select exactly one task
- Keep one atomic unit of value (usually 1–3 dev days).
- If too large, split before proceeding.
-
Create a task-scoped change
- Use change id format:
task-<task-id>-<short-slug>(example:task-2-3-pin-crud).
- Use change id format:
-
Plan with OpenSpec artifacts
proposal.md: intent, scope, acceptance criteria, out-of-scope.specs/.../spec.md: requirements and GIVEN/WHEN/THEN scenarios.design.md: implementation approach and tradeoffs.tasks.md: implementation checklist for this single task.
-
Implement only this task scope
- Do not include unrelated refactors.
- Update checkboxes as work completes.
-
Verify before archive
- Validate completeness, correctness, coherence.
- Fix critical mismatches before archive.
-
Archive and sync
- Merge delta specs if needed.
- Archive change folder.
- Mark the parent project task complete.
Native OPSX Command Path
Use this sequence per task:
/opsx:new task-<task-id>-<slug>
/opsx:ff <change-id> # or /opsx:continue for stepwise control
/opsx:apply <change-id>
/opsx:verify <change-id>
/opsx:archive <change-id>
Rules:
- Prefer
/opsx:continuewhen requirements are still unclear. - Prefer
/opsx:ffwhen scope is clear and small. - If implementation reveals drift, update artifacts before continuing.
Manual Fallback Path (No /opsx Support)
If slash commands are unavailable:
- Ensure OpenSpec tree exists (
openspec/changes,openspec/specs). - Scaffold one change folder with:
proposal.mddesign.mdtasks.mdspecs/<capability>/spec.md
- Use templates from
references/openspec-task-templates.md. - Implement task and update checkboxes.
- Run local validation/tests.
- Merge spec deltas into
openspec/specs/and move change toopenspec/changes/archive/<date>-<change-id>/.
Quality Gate (must pass before archive)
- Scope remained single-task and atomic
- Acceptance criteria satisfied
- Spec scenarios reflected in tests or executable checks
- No unrelated files changed
- Parent
tasks.mdupdated with completion state - Archive note includes what changed and why
Output Format for Updates
When reporting progress, use:
Task: <id + title>
Change: <openspec change id>
Status: planning | implementing | verifying | archived
Done:
- ...
Next:
- ...
Risks/Notes:
- ...
Resources
references/openspec-task-templates.md— proposal/spec/design/tasks templates for manual mode.scripts/new_task_change.sh— optional scaffold script for manual mode.
Weekly Installs
22
Repository
luongnv89/skillsGitHub Stars
1
First Seen
Feb 13, 2026
Security Audits
Installed on
github-copilot21
codex21
kimi-cli21
gemini-cli21
opencode21
amp21