Przejdź do treści
Biblioteka skilli
Produktywność osobista · Planowanie

Qcompact

/Qcompact

Zapisuje stan pracy i przekazuje sesję do dalszej pracy, zachowując kontekst przed zakończeniem.

Repozytorium
qe-framework ↗
Licencja
MIT
Ostatnia zmiana repozytorium
12.10.2026

Ocena i bezpieczeństwo

95/ 100Klasa: dobry
Format20 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 12.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Zapisuje stan pracy i przekazuje sesję do dalszej pracy, zachowując kontekst przed zakończeniem.

Oryginalny opis (EN)

Context preservation and session handoff. Use when the user wants to save state, handoff, save context, end session, or continue later.

Jak działa

  1. Role
  2. Per-Session Layout (Auto-Named)
  3. Operating Modes
  4. Automatic Mode Details
  5. Manual Mode Details
  6. Save Location Summary
  7. Will
  8. Will Not
Sekcje z nagłówków SKILL.md, w oryginale · 155 linii, 893 słów
Podgląd SKILL.md
---
name: Qcompact
user_invocable: true
description: Context preservation and session handoff. Use when the user wants to save state, handoff, save context, end session, or continue later.
invocation_trigger: When the context window is full or under pressure (Orange/Red zone).
recommendedModel: haiku
---

> **`.qe` reads → DB:** `.qe/` content is stored in the SQLite store (`qe_files`), so a path may have **no file on disk**. Read `.qe/` content with `node scripts/qe-cat.mjs <path>` (or `--ls`/`--exists`) and structured state with `node scripts/qe-query.mjs …` — do not assume the raw file exists. See `QE_CONVENTIONS.md`.


# Qcompact — Context Preservation & Handoff

## Role
A skill that automatically preserves context under context window pressure, and generates detailed handoff documents on user request.

## Per-Session Layout (Auto-Named)
Multiple terminals on the same project save into separate `sessions/{sid}/` directories so they never clobber each other. The 8-char `sid` is auto-derived from the Claude session id by the SessionStart hook and surfaced as `[Session] sid:XXXXXXXX` in additionalContext — there is no manual `--name` flag. When no sid is available the `_unknown` bucket is used; pre-partition flat files were one-shot migrated into `_legacy`.

SessionStart may also surface `[Session State] ...` with the active plan,
resume source, and Codex background job status. Treat that line as an advisory
shortcut only; the resolver functions below remain the source of truth.

## Operating Modes

### Automatic Mode (Background Call)
Ecompact-executor detects context pressure and runs automatically in the background.
- Saves quietly without notifying the user
- Triggered when entering the `CONTEXT_BUDGET.md` warning zone (70%+ of the active context window by default)
- Saves current state to `.qe/context/sessions/{sid}/snapshot.md`
- Accumulates decisions in `.qe/context/sessions/{sid}/decisions.md`

### Manual Mode (User Invocation)
Calling `{adapter.commandPrefix}Qcompact` directly generates a detailed handoff document.
- Delegates `mode=handoff` to Ecompact-executor
- Creates `.qe/handoffs/sessions/{sid}/HANDOFF_{date}_{time}.md`
- Displays saved context + handoff summary to the user

---

## Automatic Mode Details

### Save Location
`.qe/context/sessions/{sid}/` (auto-named per Claude session)

### Saved Content

#### `snapshot.md` — Context Snapshot
Overwritten on each save (only the latest state is retained):

```markdown
# Context Snapshot
> Saved at: 2026-03-14 10:30

## Current Task
- In-progress task UUID and title
- Checklist progress (completed/total)
- Checklist item currently being worked on

## Key Decisions
- Major decisions made this session
- Directions explicitly instructed by the user

## Changed Files
- Files created/modified/deleted this session

## Pending Items
- Work not yet finished
- What to do next

## Notes
- Constraints or requirements to remember specifically
```

#### `decisions.md` — Accumulated Decision History
Accumulated per session (reverse order, newest first):

```markdown
## [2026-03-14] Session
- Decided to separate framework data into .qe/ folder
- Changed agent prefix from A → E
- Branded as QE framework (Query Executor)
```

---

## Manual Mode Details

### CREATE Workflow

#### Step 1: Delegate to Ecompact-executor
Call Ecompact-executor with a complete delegation packet and `mode=handoff`.
- Create `.qe/handoffs/` directory (if not present)
- Create `HANDOFF_{date}_{time}.md` file
- Auto-collect current task state, git changes, and decisions

#### Step 2: Write Handoff Document
1. **Current status summary** — what the situation is right now
2. **Important context** — key information the next agent must know
3. **Immediate next steps** — clear, actionable first step
4. **Decisions** — choices that include not just the outcome but the reason

#### Step 3: Verify
- No `[TODO: ...]` placeholders remain
- Required sections exist and are filled in
- No potentially confidential information (API keys, passwords, tokens)
- Referenced files exist
- Rebuild the derived index once — `node scripts/lib/doc-index.mjs` (single scan-based rebuild; never append to `.qe/index.md`). See `core/DOC_CONVENTIONS.md`.

#### Step 4: Report to User
- Handoff file location
- Summary of captured context
- First action item for the next session

### RESUME Workflow

#### Step 1: Look Up Handoff
Use the shared resolver — `resolveResumeContext(projectRoot, overrideSid)` in `hooks/scripts/lib/session-resolver.mjs` — the **same function `{adapter.commandPrefix}Qresume` uses**, so handoff lookup here and restore there cannot diverge. It scans the active sid across both `.qe/context/` and `.qe/handoffs/` first, and when the active sid is empty in both, falls back to the newest other bucket (durable handoffs are unioned in, so a handoff saved under a prior sid is reachable). Read `latestHandoff` from the returned descriptor; when `source: 'fallback'`, tell the user which bucket was loaded.

On Codex, render the same workflow as `$Qresume` / `$Qresume --from {sid}` in
handoffs. Do not emit Claude-only slash commands in Codex-facing text.

#### Step 2: Check Freshness
| Level | Meaning |
|-------|---------|
| FRESH | Safe to resume — minimal changes |
| SLIGHTLY_STALE | Review changes before resuming |
| STALE | Carefully verify context |
| VERY_STALE | Consider creating a new handoff |

#### Step 3: Load Handoff and Start Work
- Read the handoff document and start from item #1 of "Immediate next steps"
- If there are chained handoffs, also reference previous ones

### Handoff Chaining
In long-running projects, link handoffs to each other to maintain context lineage:
```
HANDOFF_1.md → HANDOFF_2.md → HANDOFF_3.md
```

---

## Save Location Summary

| Mode | Location | Purpose |
|------|----------|---------|
| Automatic | `.qe/context/sessions/{sid}/snapshot.md` | Latest context for this terminal (overwrite) |
| Automatic | `.qe/context/sessions/{sid}/decisions.md` | Accumulated decisions for this terminal |
| Manual | `.qe/handoffs/sessions/{sid}/HANDOFF_*.md` | Detailed handoff document for this terminal |

## Will
- Automatic: save context snapshot, accumulate decisions
- Manual: generate detailed handoff document, verify, chain
- Delegate to Ecompact-executor (automatic)
- Delegate to Ecompact-executor (manual handoff)

## Will Not
- Save entire conversation (extract key points only)
- Copy entire code (record file paths only)
- Notify user (during automatic execution)
- Include confidential information

Wersje

W bazie nie ma innych skilli o nazwie Qcompact.

Migawka bazy z 28.10.2026 · wersja paczki fa3f053ae3ec (skrót SHA-256 całej paczki)

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95session-checkpoint
    Zapisuje stan sesji przed kompakcją kontekstu, zmianą zadania lub zakończeniem pracy, w pięciu krokach.
  • 100vibe-save
    Zapisuje stan pracy z sesji przez vibe3 jako ręczne przekazanie, bez automatycznego utrwalania.
  • 95handoff
    Zapisuje plik przekazania sesji przed zakończeniem fragmentu pracy, żeby następna sesja wznowiła ją od razu.
  • 100forward
    Przekazuje bieżącą sesję następnej, robiąc podsumowanie i handoff przed zakończeniem pracy.
  • 100session-handoff
    Pakuje kontekst bieżącej sesji, by inny agent mógł kontynuować pracę bez zaczynania od zera.
  • 100context-saver
    Zapisuje stan bieżącej pracy sesji do czytelnego dokumentu przekazania na dysku (docs/context/CONTEXT-{topic}.md), by kolejna sesja lub inna osoba mogła kontynuować dokładnie w tym miejscu.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.