session-begin
Skill2 starsChanged 9 months agoApache-2.0View on GitHub
Pre-flight checklist for work sessions — loads context, runs health scripts, surfaces warnings, and gates on acknowledgment before work begins.
- Reads credentials
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 10 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Start of every AI work session
- Very specific: line 82
If secrets need decrypting: ask user for passphrase, run: echo "<passphrase>" | node scripts/secrets/decrypt-secrets.js --stdin Verify …
- Distinctive: line 86
If already decrypted or no encrypted file: skip.
- Very specific: line 100
Read SESSION_CONTEXT.md — status, blockers, goals
- Distinctive: line 104
Read ROADMAP.md lines 1-100 (Active Sprint only)
- Very specific: line 108
Verify SESSION_CONTEXT.md's documented branch matches git branch --show-current.
- Very specific: line 134
Check if .research/research-index.jsonl exists and is non-empty.
- Distinctive: line 190
Check for anomalies (best-effort — skip files that don't exist):
- Very specific: line 192
Override trend: Read .claude/override-log.jsonl.
- Very specific: line 194
Hook warnings: Read .claude/state/hook-warnings-log.jsonl.
- Very specific: line 196
Health grade drop: Read .claude/state/health-score-log.jsonl.
- Very specific: line 199
If anomalies found, present and recommend /alerts --full.
- Very specific: line 204
Read .claude/hook-warnings.json.
- Very specific: line 218
After all acknowledgments: Run node scripts/sync-warnings-ack.js to sync lastCleared with per-type acks.
- Very specific: line 223
Check for state files written by session-start.js passive-surfacing fixes:
- Very specific: line 225
Build failures: Read .claude/state/session-start-failures.json.
- Very specific: line 236
Pending test registry: Read .claude/state/pending-test-registry.json.
- Distinctive: line 237
If it exists, remind: "Test registry needs update.
- Very specific: line 239
Pending decisions: Read .claude/hook-warnings.json for decision-documentation type entries.
- Distinctive: line 242
All items require acknowledgment: before proceeding. Do not skip silently.
- Distinctive: line 246
Read Technical Debt INDEX.
- Distinctive: line 275
After the summary: "Which goal would you like to focus on, or something else?" Reference the surfaced goals — do not use a generic …
- Distinctive: line 290
Scope explosion: If 3+ scripts failed or 3+ findings surfaced, present a triage list: "Multiple issues found.
- Distinctive: line 293
Disengagement: If user says "skip" or "let's work" mid-checklist, stop immediately.
- Very specific: line 295
Compaction recovery: If compaction occurs mid-session-begin, re-read SESSION_CONTEXT.md.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Session Begin Pre-Flight
Pre-flight checklist that orients the session: loads context, validates environment, runs health scripts, surfaces warnings, and hands off to the user with a goal-selection prompt.
Time budget: Session-begin SHOULD complete in under 5 minutes. If script issues or staleness require extended remediation, present findings and defer fixes to user decision.
Critical Rules (MUST follow)
- Duplicate detection first — MUST check before any action (see below).
- Never double-increment — MUST verify the session counter wasn't already incremented in this conversation or after compaction before incrementing.
- Announce session number — MUST output "Session #N started on [branch]" after incrementing.
- Script failures escalate to user — MUST present failures with options (fix now / defer / ignore). Do not decide unilaterally.
- Stale docs are a user decision — MUST present discrepancies and ask "Update now or defer?" Do not auto-fix.
- Scope explosion guard — if 3+ scripts failed or 3+ actionable findings surfaced, MUST present a triage list before acting on any.
Duplicate Detection (MUST — before anything)
Check all three:
- Have I already completed this checklist in the current conversation?
- Was SESSION_CONTEXT.md "Last Updated" modified today? (date-only field — sub-day relies on checks #1 and #3)
- Did I already increment the session counter in this conversation?
If ANY true: "Session #N already active. What would you like to work on?" If ALL false: Proceed with full checklist.
When to Use
- Start of every AI work session
- User explicitly invokes
/session-begin
When NOT to Use
- Mid-session health check →
/alerts - Session closure →
/session-end - State snapshot →
/checkpoint - Already ran this session → duplicate detection catches it
Hook Boundary
The SessionStart hook handles: consolidation, cross-session validation, dependency install, build. This skill handles: context loading, counter increment, script health checks, warning gates, goal selection. If the hook already completed a step (check its output), skip it.
Warm-Up (MUST — first output after duplicate detection passes)
"Starting Session #N pre-flight on [branch]. Will load context, run 8 health scripts, and surface any warnings."
Phase 1: Environment Setup (MUST)
1.1 Secrets Decryption Check (SHOULD — remote sessions only)
if [ -f ".env.local.encrypted" ] && [ ! -f ".env.local" ]; then
echo "Encrypted secrets found but not decrypted"
fiIf secrets need decrypting: ask user for passphrase, run:
echo "<passphrase>" | node scripts/secrets/decrypt-secrets.js --stdin Verify
.env.local exists. Never store or log the passphrase.
If already decrypted or no encrypted file: skip.
1.2 Cross-Session Validation (handled by hook)
Handled by SessionStart hook. If "Cross-Session Warning" appears: check
git status, git log --oneline -5, run npm run hooks:health. Update
SESSION_CONTEXT.md if prior session missed /session-end.
Phase 2: Context Loading (MUST)
2.1 Load Session Context (MUST)
- Read SESSION_CONTEXT.md — status, blockers, goals
- Increment session counter (MUST — verify not already incremented first)
- Output: "Session #N started on [branch]"
- Read ROADMAP.md lines 1-100 (Active Sprint only)
2.2 Branch Validation (MUST)
Verify SESSION_CONTEXT.md's documented branch matches
git branch --show-current. If mismatch, warn user before proceeding.
2.3 Stale Documentation Check (MUST)
git log --oneline -30Compare commits against ROADMAP.md Active Sprint checkboxes. If discrepancies found, present them: "Docs appear stale: [specifics]. Update now or defer?"
Let the user decide. Do not auto-update.
2.4 Session Gap Detection (handled by scripts)
Automated via npm run session:gaps in Phase 3. If gaps detected, run
npm run session:gaps:fix and present suggestions.
2.5 Consolidation Status (handled by hook)
Automated by SessionStart hook. If it failed (check hook output), run:
node scripts/run-consolidation.js --apply
2.6 Prior Research Surface (SHOULD)
Check if .research/research-index.jsonl exists and is non-empty. If so, read
the last 5 entries and present a brief summary:
Prior research: N topics analyzed. Most recent: {topic} ({date}).
This is non-blocking — if the file is missing or empty, skip silently. The
purpose is to surface prior /repo-analysis, /website-analysis, and
/deep-research work so the user knows what context is available.
Phase 3: Health Scripts (MUST)
Output: "Running 8 health scripts..."
npm run patterns:check
npm run review:check
npm run lessons:surface
npm run session:gaps
npm run roadmap:hygiene
npm run reviews:lifecycle
npm run hooks:analytics -- --since=$(date -d '7 days ago' +%Y-%m-%d)
node scripts/run-github-health.js --quickAfter all scripts: "Scripts complete: N passed, M failed, K warnings."
If any script fails (MUST): Present to user: "Script X failed: [error]. Fix now / Defer / Ignore?" Do not silently decide.
Record results — these must be marked as "Ran" or "Failed (reason)" in
/session-end audit.
3.1 Cross-Document Dependency Check (SHOULD)
npm run crossdoc:check3.2 Task Dependencies (SHOULD)
node scripts/tasks/resolve-dependencies.js 2>/dev/null || trueNote: Velocity reporting was removed in commit
7e74fada(/alerts --fullconsolidation). Do not re-addscripts/velocity/references without first restoring the script.
Phase 4: Warning Gates (MUST)
4.1 Hook Anomaly Gate (MUST)
Check for anomalies (best-effort — skip files that don't exist):
- Override trend: Read
.claude/override-log.jsonl. Count overrides in last 7 days vs previous 7 days. If 50%+ higher and 5+ more → warn. - Hook warnings: Read
.claude/state/hook-warnings-log.jsonl. If 10+ in last 7 days → warn. - Health grade drop: Read
.claude/state/health-score-log.jsonl. If grade dropped 2+ levels → warn.
If anomalies found, present and recommend /alerts --full. If none: skip
silently.
4.2 Warning Acknowledgment Gate (MUST)
Read .claude/hook-warnings.json. If unacknowledged warnings exist (added since
lastCleared):
Unacknowledged hook warnings (N):
1. [type] message (occurrences)
2. ...
Acknowledge all? [Y] or review individually? [R]Y: Record timestamp in hook-warnings.json, proceed. R: Present each
for individual decision. No warnings: Skip silently.
After all acknowledgments: Run node scripts/sync-warnings-ack.js to sync
lastCleared with per-type acks. This updates the statusline unacked count.
4.3 Infrastructure Failure Gate (MUST)
Check for state files written by session-start.js passive-surfacing fixes:
Build failures: Read
.claude/state/session-start-failures.json. If it exists and has entries, present each failure with itsFix:command:Session-start build failures (N): 1. [description] — Fix: [command] 2. ... Fix now / Acknowledge / Defer?- Pending test registry: Read
.claude/state/pending-test-registry.json. If it exists, remind: "Test registry needs update. Run: npm run tests:registry" - Pending decisions: Read
.claude/hook-warnings.jsonfordecision-documentationtype entries. Surface undocumented decisions.
All items require acknowledgment before proceeding. Do not skip silently.
4.4 Technical Debt Snapshot (SHOULD)
Read Technical Debt INDEX. Note S0/S1 counts for the summary.
Phase 5: Summary & Goal Selection (MUST)
Summary Template
Present using this format:
Session #N — Pre-Flight Summary
Branch: [branch]
| Script | Status |
|--------|--------|
| patterns:check | Pass/Fail |
| review:check | Pass/Warn |
| ... | ... |
Warnings: N acknowledged | Tech Debt: N S0, M S1
Next Goals (from SESSION_CONTEXT.md):
[list ALL goals from both "Immediate Priority" and "After Debt-Runner"
sections — do not truncate or cap the list]Goal Selection (MUST)
After the summary: "Which goal would you like to focus on, or something else?" Reference the surfaced goals — do not use a generic open-ended prompt.
Closure Signal (MUST)
"Session #N pre-flight complete. [N] scripts ran, [M] warnings acknowledged. Ready to work."
Done when: Session counter incremented, context loaded, all scripts ran (or failures escalated to user), warnings acknowledged, goal selected.
Guard Rails
- Scope explosion: If 3+ scripts failed or 3+ findings surfaced, present a triage list: "Multiple issues found. Which to address now vs defer?" Do not auto-fix multiple issues.
- Disengagement: If user says "skip" or "let's work" mid-checklist, stop immediately. Present what's completed vs remaining. Proceed to goal selection.
- Compaction recovery: If compaction occurs mid-session-begin, re-read SESSION_CONTEXT.md. If counter was already incremented, do not re-increment. Resume from the last unfinished phase.
Integration
- Neighbors:
session-end(receives session context),checkpoint(mid-session state),alerts(detailed health drill-down)- Note:
/alertsuses.claude/tmp/alerts-progress-{date}.jsonfor compaction resilience. If this file exists and is <2h old, alerts will offer to resume a previous session.
- Note:
- Handoff to session-end: SESSION_CONTEXT.md updated with session number and current work. Script results marked as "Ran" or "Failed."
- Reference material: See REFERENCE.md for skill routing, code review procedures, and anti-pattern guidance.
Version History
| Version | Date | Description |
| 2.0 | 2026-03-16 | Skill-audit rewrite: 31 decisions, 51→73 score |
| 1.0 | 2026-02-25 | Initial implementation |
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- find-skillsSkill
- add-debtSkill
- alertsSkill
- analyzeSkill
- artifacts-builderSkill
- audit-agent-qualitySkill
- audit-aggregatorSkill
- audit-ai-optimizationSkill
- audit-codeSkill
- audit-comprehensiveSkill
- audit-documentationSkill
- audit-engineering-productivitySkill
- audit-enhancementsSkill
- audit-healthSkill
- audit-performanceSkill
- audit-processSkill
- audit-refactoringSkill
- audit-securitySkill
- brainstormSkill
- checkpointSkill
- code-reviewerSkill
- comprehensive-ecosystem-auditSkill
- content-research-writerSkill
- convergence-loopSkill
- create-auditSkill
- data-effectiveness-auditSkill
- debt-runnerSkill
- decrypt-secretsSkill
- deep-planSkill
- deep-researchSkill
- developer-growth-analysisSkill
- doc-ecosystem-auditSkill
- doc-optimizerSkill
- docs-maintainSkill
- document-analysisSkill
- ecosystem-healthSkill
- Excel AnalysisSkill
- find-skillsSkill
- frontend-designSkill
- gh-fix-ciSkill
- github-healthSkill
- health-ecosystem-auditSkill
- hook-ecosystem-auditSkill
- market-research-reportsSkill
- mcp-builderSkill
- media-analysisSkill
- multi-ai-auditSkill
- pre-commit-fixerSkill
- pr-ecosystem-auditSkill
- pr-retroSkill
- pr-reviewSkill
- quick-fixSkill
- recallSkill
- repo-analysisSkill
- repo-synthesisSkill
- script-ecosystem-auditSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

