/zulfiqar:re-entryfrom zulfiqar
Keeps a project legible for a future cold agent session. Invoke when the user asks to: set up/scaffold this repo, audit project hygiene, log progress, record a decision, get project state, or reconcile a folder after a work session (update docs + surface dead code for deletion). Also fires on first-touch of a repo with no AGENTS.md / docs/PROGRESS.md. NOT a per-edit autosave.
Ships in zulfiqar. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You make repos legible to a future agent session that has zero context. A bare agent tends to:
NOTES.md, TODO.md, scratch.md) that vanish into greps.PROGRESS.md, PROGRESS-v2.md, STATUS.md).AGENTS.md/CLAUDE.md past the point where a long instructions file gets silently truncated or deprioritized.This skill fixes those gaps with a small, opinionated convention and these modes: init, log, decide, sweep, reconcile, handoff.
| Mode | When | What it does |
|---|---|---|
init | First touch of a new or unstructured repo | Scaffold AGENTS.md + docs/PROGRESS.md + docs/decisions/ + tmp/ + .gitignore additions |
log | After a substantial work block, before a handoff, or whenever the user says "log this" | Append a dated entry to docs/PROGRESS.md |
decide | When making a meaningful architectural / dependency / convention choice | Write the next docs/decisions/NNNN-<slug>.md (AgDR Y-statement) |
sweep | Periodic (weekly-ish) or when the user says "tidy up", "audit", "things feel messy" | Run the audit checklist on organization/docs; propose pruning (read-only) |
reconcile | On an established folder after a work session — user says "reconcile this", "we changed a lot, clean it up", "update the docs and kill the dead code" | Reconstruct what changed this session, propose deleting old/superseded source code that conflicts with the new work, and update docs to match. Code-touching → strictly confirm-first |
handoff | End of a session | Compose handoff (delegates to a handoff skill/command if present in this environment), optionally append to PROGRESS.md |
Default to the mode the user named explicitly. If they invoke this skill with no mode, ask which one — don't guess.
.git/, package.json, pyproject.toml, Cargo.toml, go.mod, or similar. If none, ask the user whether this is the right directory.AGENTS.md, CLAUDE.md, docs/PROGRESS.md, docs/decisions/, tmp/, .claudeignore. Don't clobber any of them.CLAUDE.md and AGENTS.md both exist as real files (not a symlink or a duplicate mirroring the other), flag this — they're likely to drift. Offer to either symlink one to the other, or keep them as duplicates with a one-line header noting which is canonical (symlinks break on a Windows clone, so a real-duplicate-with-header is the safer default for a repo that must clone cleanly cross-platform).initScaffold the canonical layout. Skip any file that already exists; never overwrite.
project-root/
├── AGENTS.md # primary agent context (≤300 lines)
├── CLAUDE.md -> AGENTS.md # symlink, or a duplicate with a header note, so multiple agent ecosystems read one source of truth
├── docs/
│ ├── PROGRESS.md # append-only dated work log
│ └── decisions/
│ └── 0001-record-agent-decisions.md
├── tmp/ # gitignored scratch
│ └── .gitkeep
└── .gitignore # ensure tmp/, *.local.*, .visual-baselines/ are listed
AGENTS.md at root using the template below. Fill in what you can detect (project name from package.json/etc., test command from scripts, build command). Leave clearly-marked TODOs for what you can't.CLAUDE.md to AGENTS.md — symlink (ln -s AGENTS.md CLAUDE.md) if the environment/repo tolerates symlinks, otherwise a real duplicate file with a one-line header ("mirrors AGENTS.md — edit that file, not this one"). If CLAUDE.md already exists as a real file with independent content, ask the user before replacing.docs/PROGRESS.md with the template below. Seed with one entry: today's date + "Initialized project structure via re-entry init."docs/decisions/0001-record-agent-decisions.md as the first AgDR, formally adopting the convention.tmp/.gitkeep so the directory exists in git but stays empty..gitignore — add tmp/, *.local.md, *.local.json, .visual-baselines/, CLAUDE.local.md if not already present. Use Edit not Write to preserve existing entries.Do not start a dev server, run tests, or make any non-filesystem changes during init.
AGENTS.md templateKeep under 300 lines total. Four sections, in this order:
# <Project name>
> Agent context. Human-facing docs are in README.md.
## Project overview
<2-3 sentences: what it is, who it's for, current phase. Strip marketing.>
## Build / test / push
- Install: `<command>`
- Run dev: `<command>`
- Test: `<command>`
- Lint / typecheck: `<command>`
- Deploy / preview URL: `<url or command>`
## Development workflow
- Source lives in: `<path>`
- Tests mirror source structure at: `<path>`
- Branch convention: `<convention>`
- Where plans/progress/decisions go: see `docs/PROGRESS.md`, `docs/decisions/`
- Scratch / ephemeral notes: `tmp/` (gitignored)
## Common pitfalls / prohibited patterns
- DON'T <thing the model should never do>
- ALWAYS <thing the model should always do>
- Known dead-ends: <approaches that were tried and failed; link to PROGRESS entries>
If the project has a non-trivial domain or stack, progressive-disclose into docs/:
docs/STACK.md — versions, key libraries, why-chosendocs/TESTING.md — how the test suite is structureddocs/CONVENTIONS.md — code style not enforced by linterReference these from AGENTS.md with one-line pointers; don't inline.
docs/PROGRESS.md template# Progress log
Append-only. Most recent first. Date stamps as `## YYYY-MM-DD`.
Never edit past entries — supersede with a new one if facts change.
This is portable long-term memory: track failed approaches so future sessions don't re-attempt them.
---
## YYYY-MM-DD
- <what changed, in past tense>
- Decisions: <link to docs/decisions/NNNN-*.md if any>
- Dead-ends: <approaches tried that didn't work — important>
- Open questions: <only if blocking future work>
docs/decisions/0001-record-agent-decisions.md template (AgDR)---
id: 0001
timestamp: YYYY-MM-DDTHH:MM:SSZ
agent: <agent name, e.g. claude-code, codex>
model: <model-id>
trigger: re-entry init
status: executed
---
# AgDR-0001: Record agent decisions
In the context of a multi-session agent-driven project, facing the risk of repeated dead-ends and undocumented reasoning, I decided to adopt the Agent Decision Record (AgDR) format to achieve durable, queryable decision history, accepting the overhead of writing one document per significant decision.
## Context
This project will be worked on by one or more agents across many sessions. Without durable decision records, each session re-derives the same trade-offs.
## Options considered
| Option | Pros | Cons |
|---|---|---|
| Inline decisions in commit messages | Cheap, always present | Hard to query; no structured metadata |
| ADRs in `docs/adr/` | Established format | Designed for humans; lacks agent metadata |
| AgDRs in `docs/decisions/` | Required metadata, Y-statement body | Slightly more overhead |
## Decision
Use AgDR format with YAML frontmatter (`id`, `timestamp`, `agent`, `model`, `trigger`, `status`) and a Y-statement opening.
## Consequences
- Easier: replaying why a decision was made, even months later
- Easier: detecting when a decision has been superseded
- Harder: writing one AgDR per significant choice — slight ceremony cost
- Revisit: if AgDRs aren't being written, downgrade to plain inline notes in PROGRESS.md
logAppend a dated entry to docs/PROGRESS.md. Don't create the file if missing — instead suggest re-entry init first.
## YYYY-MM-DD as the date header. If today's header already exists, append bullets under it instead of duplicating the header.docs/plans/ doc instead.log proactively (without being asked)decideWrite the next docs/decisions/NNNN-<slug>.md AgDR. Use the same template as the 0001 example above. Increment NNNN by reading the highest existing number in docs/decisions/.
status: superseded and link to the new one).Do NOT write an AgDR for: bug fixes, small refactors, file moves, formatting choices, anything you'd be embarrassed to bring up at a code review.
sweepAudit the project's organization state and propose changes. This is read-only by default; only apply changes when the user confirms.
Report each finding with file path, severity (info / warn / fix), and a proposed action.
AGENTS.md / CLAUDE.md drift — both exist as real files with diverging content, not a symlink or an intentionally-labeled duplicate. Diff them; propose merging into one canonical file.NOTES.md, TODO.md, scratch.md, temp.md anywhere outside tmp/. Propose rename or move.tmp/ files — anything in tmp/ not modified in 14+ days. List them; propose deletion or promotion to docs/.docs/plans/*.md not referenced anywhere in PROGRESS.md or AGENTS.md. Flag as possibly abandoned.docs/PROGRESS-archive-YYYY.md.status: executed..gitignore gaps — tmp/ not in gitignore; .visual-baselines/ not in gitignore; *.local.* not in gitignore.docs/.## re-entry sweep — 2026-MM-DD
Findings:
1. [WARN] docs/PROGRESS.md — no entries in 21 days, but 12 commits since last entry.
2. [FIX] NOTES.md at root — should move to tmp/<task>-notes.md.
3. [INFO] tmp/ contains 4 files > 14 days old: <list>.
Apply? (y / pick numbers / n)
Only apply changes after user confirmation. Never auto-delete user files.
reconcileFor an established folder you've been actively working in this session. Unlike sweep (which only audits docs/organization and never touches code), reconcile looks at what the work actually changed and brings the repo back into a coherent state: it proposes removing old/dead/superseded source code that now conflicts with or is replaced by the new work, and updates the docs to match reality. This is the only mode that may touch source files — and it does so only after explicit confirmation, one batch at a time.
git status and git diff --stat (and git diff for specifics) to see uncommitted work.git log --oneline -20 for commits made this session.auth.js still present after auth.ts replaced it; Component.old.tsx; a v1 alongside a v2).## re-entry reconcile — 2026-MM-DD
Changed this session: <1-3 line summary>
Proposed code deletions (CONFLICTS with / SUPERSEDED by new work):
1. [DELETE] src/lib/auth-legacy.ts — replaced by src/lib/auth.ts this session; 0 remaining imports (verified).
2. [DELETE] src/components/OldCard.tsx — superseded by Card.tsx; only referenced by the deleted page.
3. [REVIEW] utils/format.js — `formatV1()` now unused, but `formatDate()` still imported in 3 files → delete only the one export?
Proposed doc updates:
4. README.md — "uses JWT cookies" → now bearer tokens (matches this session's change).
5. docs/PROGRESS.md — append today's entry (what changed + dead-ends).
Apply? (all / pick numbers / just docs / n)
reconcile[REVIEW] with the specifics, don't assert [DELETE].just docs).[REVIEW].docs/PROGRESS.md (via log mode's rules) as part of the doc batch, capturing what was removed and why.handoffCompose a handoff for the next session.
handoff skill/command exists in the user's environment, invoke it — don't reimplement.docs/PROGRESS.md as today's entry. Default to yes unless the user just logged.[YYYY-MM-DD] inline prefix.PROGRESS-v2.md, STATUS.md, WHATS-NEXT.md. Update the canonical file.tmp/ — notes.md, todo.md, scratch.md, temp.md. Use task-descriptive names: oauth-migration-plan.md, redis-vs-postgres-investigation.md.init mode that the user didn't ask for — if you'd add an opinionated structure (e.g. .github/workflows/), ask first.handoff skill/command (if present) — kept as the source of truth for handoff blocks. re-entry handoff delegates to it rather than reimplementing.re-entry init for project-org scaffolding. Both can run on the same project without conflict.re-entry sweep will flag an oversized memory/notes file as a finding, but doesn't write memory entries directly; defer to whatever memory convention this environment already has.docs/, tmp/, .gitignore, AGENTS.md, CLAUDE.md — except in reconcile mode, which may delete superseded/dead source, and only after the user confirms the labeled deletion batch (never silently, never unproven).What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (mohamed-alaboudi/zulfiqar) — no native marketplace selected
npx claudepluginhub p/mohamed-alaboudi-zulfqar-of-coding20 skills in this plugin
/bookendApply the "bookend" transform to a prompt — keep its body, then restate the objective + top hard constraints + the explicit task at the very END, task LAST. For prompts you didn't generate; other skills that already compose their own output (a plan writer, a handoff writer) should bookend it themselves rather than have this run on top./brainstormingUse before creative implementation to turn an uncertain request into an approved design. Not for prompt writing, mechanical edits, or requirements already fixed by an accepted specification./common-groundSurface hidden project assumptions and persist them into docs/common-ground.md with an OPEN/WORKING/ESTABLISHED tier, so a long project stays honest about what's assumed vs known. Modes: default (surface + file), --list, --check, --graph.