Session start

From ahmadulhoq/agentskel · View interactive version

Session start is an AI agent skill from the GitHub repository ahmadulhoq/agentskel. Session initialization procedure. Checks memory mount, reads all required memory files, validates skeleton version, checks dependency freshness, and surfaces alerts. Must be executed at the start of every session before any other work.

How to use this skill

Skill file

Session Start Procedure

**Execute every step below in order. Do not skip steps. Do not start any user task

until this procedure is complete.**

Step 1 — Check memory mount

```bash

git -C .memory pull --ff-only origin ai-memory 2>/dev/null || true

```

If the pull fails (e.g. network unavailable, diverged history), warn the user

but proceed — stale memory is better than no memory. Then continue to Step 2.

1. Run git branch -r | grep origin/ai-memory

2. Found → tell the user:

> "This project has AI memory but it's not mounted. Run ./scripts/install-agent.sh

> (or git worktree add .memory ai-memory) to load it, then restart this session."

3. Not found → tell the user:

> "This project has no AI memory. A tech lead needs to run the setup-skeleton

> workflow first. See the agentskel README for setup instructions."

4. End session. Do not attempt any work without memory files.

Step 1b — Link external skills (auto-recover after pull)

External skill packs (e.g. Google's android/skills) install into a shared per-machine store at ~/.agentskel/skills/ and are surfaced to each project via gitignored symlinks under .agents/skills/. After a teammate pulls a sync that introduced new external skill entries — or after a fresh clone — the manifest exists but the symlinks do not yet. Detect and auto-recover before reading anything else.

This step makes external skills available without the teammate having to remember a manual install step. The script is safe to re-run.

Step 2 — Read memory files

Read now (essential — do not skip):

Check only (deferred — loaded by workflows when needed):

Step 3 — Surface alerts

before starting any work.

user: "N items pending triage in NEEDS_REVIEW.md — classify as SACRED or TECH_DEBT."

surface a one-line banner so the user is reminded the mode is active (they can

toggle it off before starting work if they've changed their mind):

Direct-Commit Mode is ON. Commits go directly to [Default Branch] (no PR) for trivial work.

Autopilot Mode is ON. Agent will proceed within the approved plan without per-step approvals. Significant changes, destructive ops, and out-of-scope work still pause.

Both banners must appear if both modes are on. Skip silently if both are off.

See docs/AUTONOMY-MODES.md for full mode definitions.

Step 4 — Check skeleton version

Skeleton Path in CONFIG.md → $CLAUDE_PLUGIN_ROOT → ../agentskel → GitHub fetch fallback).

(unless the user explicitly says to skip the sync this session).

Step 5 — Check freshness timestamps (from `.memory/CONFIG.md`)

and suggest running update-conventions. Do not auto-run it.

is >7 days ago or absent, warn the user:

> "Blueprint hasn't been synced in over 7 days. Other project agents may have

> posted Knowledge Bus entries or updated domain specs since then."

This is a warning only — do not block. Step 6 will pull the latest.

Step 6 — Check blueprint (if configured)

6a — Detect blueprint changes

```bash

git -C [BLUEPRINT_PATH] pull --ff-only 2>/dev/null || true

```

```bash

git -C [BLUEPRINT_PATH] log --after="[LAST_BLUEPRINT_SYNC]" --oneline

```

> "Blueprint has been updated since your last session. N new commits — review the changes below before starting work."

Show the commit list and any changed spec files (specs/, parity/).

6b — Check blueprint skeleton version

> "Blueprint's skeleton is behind (v[BLUEPRINT_SKEL_VERSION] vs v[CURRENT_SKEL_VERSION]).

> Someone needs to run sync-skeleton from the blueprint repo to update it."

This is informational — do not block the session. The project agent cannot

sync the blueprint's skeleton; that must be done from the blueprint repo directly.

6c — Check Knowledge Bus

archive/, and .gitkeep).

1. Target Platforms — does it list this project's platform?

2. Action Required — are there unchecked action items for this platform?

individually with their Change Summary and Action Required sections:

> "N unprocessed Knowledge Bus entries targeting [PLATFORM]. These require

> action before or during this session."

List each entry's filename, origin agent, impact level, and the specific

unchecked action item for this platform.

already checked, note them as informational only (no action needed).

user to run the janitor workflow to archive them.

Step 7 — Check git state

continue in-progress work or return to [DEFAULT_BRANCH] for a new task.

any new task. Never stash, discard, or overwrite without explicit instruction.

Step 8 — Confirm ready

stale checks, or pending bus entries found. Ask what they'd like to work on.

Session Reload

Re-execute this entire procedure (Steps 1–8) when any of the following triggers

occur mid-session:

| Trigger | When | Why |

|---------|------|-----|

| Post-sync | Immediately after sync-skeleton completes | Rules, skills, and workflows may have changed. The agent must internalize the updated .agents/ files. |

| Post-setup | Immediately after setup-skeleton completes | Everything was just installed — the agent needs to read it all. |

| Stale session | Before starting any workflow, if Timestamp (UTC) in RESUME.md is >24 hours ago | Long-running sessions lose context over time. A reload ensures the agent is working with fresh memory. |

Full reload: When triggered by post-sync or post-setup, also re-read all files

in .agents/rules/ (rules may have changed). For stale-session triggers, the

standard Steps 1–8 are sufficient.

After reload, update RESUME.md Timestamp (UTC) to the current time.


Common Rationalizations

| Rationalization | Why it's wrong | Do this instead |

|---|---|---|

| "I already know this codebase" | Your context was reset. LESSONS.md has mistakes you'll repeat without reading it. | Read ALL files in Step 2. |

| "The user's request is urgent, I'll read memory later" | Memory reading takes 30 seconds. Skipping costs 10 minutes of wrong assumptions. | Read first, act second. |

| "I'll just read the files I need for this task" | CONFIG.md has freshness checks, SACRED.md has constraints you don't know about yet. | Read every file in Step 2 — no exceptions. |

| "Memory pull failed, so I'll skip the memory step" | Stale memory is better than no memory. | Proceed with local files. |

| "The skeleton version check isn't important right now" | Version drift causes silent failures. The check takes 5 seconds. | Always run Step 4. |

| "I read these files last session" | Sessions don't share context. You are a new instance. | Read them again. |

| "The user said 'skip session start'" | Only skeleton sync (Step 4) can be skipped by user request. Steps 1-3 are never optional. | Execute Steps 1-3 always. |


Gate: Do not begin any user task until all steps above are checked off.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.