agentleFS
Will-SW74Will-SW74/passdown-os/.claude/skills/spectra-commit/SKILL.md

spectra-commit

Skill0 starsChanged 4 months agoMITView on GitHub

Commit files related to a specific Spectra change

5 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

31 rules. About 0 are common, 23 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈23

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Commit files related to a specific Spectra change.

    line 12
  2. Distinctive:

    If a name is provided, use it.

    line 24
  3. Very specific:

    If ambiguous, run spectra list --json to get available changes.

    line 27
  4. Distinctive:

    Always announce: "Committing for change: <name>"

    line 29
  5. Very specific:

    Check for .spectra/touched/<change-name>.json.

    line 33
  6. Distinctive:

    If the file does not exist, proceed without source file data — only artifact files will be included.

    line 50
  7. Very specific:

    Run git status --porcelain and filter the output to files under openspec/changes/<name>/.

    line 54
  8. Distinctive:

    If no tracking file was found, show a warning instead of the Source Files section:

    line 84
  9. Distinctive:

    If there are no artifact files AND no tracked source files, inform the user that there is nothing to commit and STOP.

    line 92
  10. Distinctive:

    Use the AskUserQuestion tool to ask the user how to proceed.

    line 96
  11. Distinctive:

    Include all dirty files: Add all unrelated files to the commit as well

    line 100
  12. Distinctive:

    Archive first, then commit together: Run archive before committing — archive file moves will be included in this commit

    line 102
  13. Distinctive:

    If the user selects "Customize":

    line 104
  14. Distinctive:

    Ask which files to add or remove

    line 106
  15. Distinctive:

    If the user selects "Archive first, then commit together":

    line 109
  16. Very specific:

    Read the tasks file at openspec/changes/<name>/tasks.md.

    line 118
  17. Distinctive:

    If all tasks are complete: skip to 6a-ii.

    line 120
  18. Distinctive:

    If incomplete tasks exist:

    line 121
  19. Distinctive:

    Use the AskUserQuestion tool to ask: "These tasks are still incomplete.

    line 123
  20. Distinctive:

    If AskUserQuestion tool is not available, ask the same question as plain text and wait for the user's response.

    line 127
  21. Very specific:

    Check whether delta specs exist at openspec/changes/<name>/specs/.

    line 131
  22. Distinctive:

    If no delta specs exist (directory is empty or absent): skip to 6a-iii.

    line 133
  23. Distinctive:

    If delta specs exist:

    line 134
  24. Distinctive:

    Use the AskUserQuestion tool to ask: "Delta specs found.

    line 135
  25. Very specific:

    Yes: run spectra sync <name> before proceeding

    line 136
  26. Distinctive:

    After archive completes successfully:

    line 150
  27. Distinctive:

    Add these archive-related file changes to the commit set

    line 153
  28. Very specific:

    Read the proposal file at openspec/changes/<name>/proposal.md.

    line 181
  29. Very specific:

    If the archive sub-flow was executed (user selected "Archive first, then commit together"), add Archived: yes to the message body:

    line 192
  30. Distinctive:

    If the tracking file is missing, warn but don't block — artifact-only commits are valid

    line 257
  31. Distinctive:

    If AskUserQuestion tool is not available, ask the same questions as plain text and wait for the user's response

    line 259

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Commit files related to a specific Spectra change.

This is a utility skill (not a workflow step). It reads source file tracking data and artifact changes to stage and commit only the files belonging to one change — useful when multiple changes are in progress simultaneously.

Input: Optionally specify a change name after /spectra-commit (e.g., /spectra-commit add-auth). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

Prerequisites: This skill requires git. Run git --version. If git is not available (command not found or similar error), inform the user to install git and STOP.

Steps

  1. Select the change

    If a name is provided, use it. Otherwise:

    • Infer from conversation context if the user mentioned a change
    • Auto-select if only one active change exists
    • If ambiguous, run spectra list --json to get available changes. Use the AskUserQuestion tool to let the user select

    Always announce: "Committing for change: <name>"

  2. Read tracking file

    Check for .spectra/touched/<change-name>.json. If it exists, parse it to get source files grouped by task.

    Expected format:

    {
      "change": "<change-name>",
      "touched": [
        {
          "task_id": "1",
          "task_desc": "Task description",
          "files": ["src/file1.ts", "src/file2.ts"]
        }
      ]
    }

    If the file does not exist, proceed without source file data — only artifact files will be included.

  3. Collect artifact files

    Run git status --porcelain and filter the output to files under openspec/changes/<name>/. These are the change's artifact files (proposal, design, tasks, specs, etc.).

  4. Identify unrelated dirty files

    From the full git status --porcelain output, any dirty files NOT in the artifact set and NOT in the tracking file are "unrelated changes."

  5. Display commit plan

    Show the file list grouped into sections:

    ## Commit Plan: <change-name>
    
    ### Change Artifacts
    - M  openspec/changes/<name>/proposal.md
    - M  openspec/changes/<name>/tasks.md
    
    ### Source Files
    **Task 1: <task description>**
    - M  src/lib/components/search.svelte
    - A  src/lib/stores/search.ts
    
    **Task 3: <task description>**
    - M  src/routes/+page.svelte
    
    ### Unrelated Changes (not included)
    - M  src/lib/utils/format.ts
    - ??  tmp/scratch.js

    If no tracking file was found, show a warning instead of the Source Files section:

    ### Source Files
    ⚠ No source file tracking data found.
    Only artifact files will be committed. Use `spectra task done` during apply to enable source file tracking.

    If there are no artifact files AND no tracked source files, inform the user that there is nothing to commit and STOP.

  6. User confirmation

    Use the AskUserQuestion tool to ask the user how to proceed.

    Options:

    • Commit as shown: Proceed with the displayed artifact + source files
    • Include all dirty files: Add all unrelated files to the commit as well
    • Customize: Let the user add or remove specific files from the commit set
    • Archive first, then commit together: Run archive before committing — archive file moves will be included in this commit

    If the user selects "Customize":

    • Show a numbered list of all dirty files (included and excluded)
    • Ask which files to add or remove
    • Re-display the updated commit plan for confirmation

    If the user selects "Archive first, then commit together":

    • Proceed to step 6a (Archive sub-flow) before continuing to step 7

6a. Archive sub-flow (only when the user selected "Archive first, then commit together")

This sub-flow executes three checks in sequence before returning to the main commit flow.

**6a-i. Incomplete task handling**

Read the tasks file at `openspec/changes/<name>/tasks.md`. Count `- [x]` (complete) and `- [ ]` (incomplete) checkboxes.

- If **all tasks are complete**: skip to 6a-ii.
- If **incomplete tasks exist**:
  - Display the list of incomplete tasks
  - Use the **AskUserQuestion tool** to ask: "These tasks are still incomplete. Mark all as complete before archiving?"
    - **Yes**: set a flag to pass `--mark-tasks-complete` to `spectra archive`
    - **No**: proceed without the flag (archive will continue with a warning)

  If **AskUserQuestion tool** is not available, ask the same question as plain text and wait for the user's response.

**6a-ii. Delta spec sync check**

Check whether delta specs exist at `openspec/changes/<name>/specs/`.

- If **no delta specs exist** (directory is empty or absent): skip to 6a-iii.
- If **delta specs exist**:
  - Use the **AskUserQuestion tool** to ask: "Delta specs found. Sync to main specs before archiving?"
    - **Yes**: run `spectra sync <name>` before proceeding
    - **No**: proceed without syncing

  If **AskUserQuestion tool** is not available, ask the same question as plain text and wait for the user's response.

**6a-iii. Archive execution and file collection**

Execute the archive:

```bash
spectra archive <name>          # without --mark-tasks-complete
spectra archive <name> --mark-tasks-complete  # if user chose to mark tasks complete in 6a-i
```

After archive completes successfully:

1. Re-run `git status --porcelain` to capture all file changes produced by the archive (deletions from `openspec/changes/<name>/`, additions in `openspec/archived/`)
2. Add these archive-related file changes to the commit set
3. Display an **updated commit plan** showing all sections:

```
## Updated Commit Plan: <change-name> (with archive)

### Change Artifacts (archived)
- D  docs/specs/changes/<name>/proposal.md
- D  docs/specs/changes/<name>/tasks.md
- ...

### Archived Files
- A  docs/specs/archived/<name>/proposal.md
- A  docs/specs/archived/<name>/tasks.md
- ...

### Source Files
(same as before)

### Spec Sync Changes (if sync was performed)
- M  docs/specs/specs/<spec-name>/spec.md
- ...
```

Then continue to step 7.

7. Generate commit message

Read the proposal file at openspec/changes/<name>/proposal.md. Extract the first sentence from the Why section (or Problem/Summary section if Why is absent).

Generate a message in this format:

spectra(<change-name>): <summary>

Change: <change-name>
Tasks: <completed>/<total> complete

If the archive sub-flow was executed (user selected "Archive first, then commit together"), add Archived: yes to the message body:

spectra(<change-name>): <summary>

Change: <change-name>
Tasks: <completed>/<total> complete
Archived: yes

Task progress comes from reading the tasks file and counting - [x] vs - [ ] checkboxes.

Show the generated message to the user and allow editing before proceeding.

  1. Selective staging

    Stage each confirmed file individually:

    git add <file1>
    git add <file2>
    ...

    NEVER use git add . or git add -A. Each file must be staged explicitly.

  2. Commit

    git commit -m "<message>"
  3. Show result

    git log --oneline -1

    Display the commit hash and message to confirm.

Output On Success

## Committed: <change-name>

**Commit:** <short-hash> spectra(<change-name>): <summary>
**Files:** <N> files committed (<A> artifacts, <S> source files)
**Tasks:** <completed>/<total> complete

Output On Nothing To Commit

## Nothing to Commit

**Change:** <change-name>

No dirty files found for this change (no modified artifacts, no tracked source files).

Guardrails

  • NEVER use git add . or git add -A — every file must be staged individually with git add <file>
  • NEVER commit files the user hasn't confirmed — always show the file list and get explicit confirmation first
  • Always show the full file list before committing — no silent staging
  • If the tracking file is missing, warn but don't block — artifact-only commits are valid
  • The "Unrelated Changes" section is informational only — these files are excluded by default
  • If AskUserQuestion tool is not available, ask the same questions as plain text and wait for the user's response

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.