session-aware
Skill4 starsChanged 10 months agoMITView on GitHub
Manages session types, state tracking, and transition enforcement for all development work. Wraps other skills with session awareness.
In this repository67 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-onboardingSkill
- agent-workitem-automationSkill
- architecture-testingSkill
- aspire-integration-testingSkill
- automated-standards-enforcementSkill
- best-practice-introductionSkill
- branching-strategy-and-conventionsSkill
- broken-windowSkill
- change-risk-rollbackSkill
- ci-cd-conformanceSkill
- component-boundary-ownershipSkill
- contract-consistency-validationSkill
- csharp-best-practicesSkill
- deployment-provenanceSkill
- documentation-as-codeSkill
- documentation-scaffoldSkill
- dotnet-bespoke-code-minimisationSkill
- dotnet-best-practicesSkill
- dotnet-domain-primitivesSkill
- dotnet-efcore-practicesSkill
- dotnet-healthchecksSkill
- dotnet-logging-serilogSkill
- dotnet-mapping-standardSkill
- dotnet-open-source-first-governanceSkill
- dotnet-source-generation-firstSkill
- dotnet-specification-patternSkill
- dotnet-testing-assertionsSkill
- environment-traceabilitySkill
- finishing-a-development-branch-iddSkill
- greenfield-baselineSkill
- impacted-scope-enforcementSkill
- incremental-change-impactSkill
- incremental-deploymentSkill
- innersource-governance-bootstrapSkill
- issue-driven-deliverySkill
- library-extraction-stabilisationSkill
- local-dev-experienceSkill
- markdown-authorSkill
- modern-csharp-coding-standardsSkill
- monorepo-orchestration-setupSkill
- observability-logging-baselineSkill
- pair-programmingSkill
- persona-switchingSkill
- process-skill-routerSkill
- quality-gate-enforcementSkill
- release-tagging-planSkill
- repo-best-practices-bootstrapSkill
- repository-foundation-bootstrapSkill
- requirements-gatheringSkill
- runtime-tooling-validationSkill
- safe-brownfield-refactorSkill
- scoped-colocationSkill
- security-processesSkill
- selective-build-testSkill
- semantic-version-impactSkill
- skills-first-workflowSkill
- static-analysis-securitySkill
- structured-review-workflowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Core principle: Every interaction happens in a session context.
- Very specific: line 95
Load session state: - Read .session-state/session.json
- Distinctive: line 97
Validate transition: - Check if transition is valid from current state
- Distinctive: line 240
If user questions settled decisions:
- Distinctive: line 255
If scope expansion detected:
- Distinctive: line 290
No merge conflicts - state is transient
≈ “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.
Files
Session-Aware Workflow
Overview
The session-aware skill adds session type recognition, state management, and transition enforcement to all interactions. It ensures work flows through appropriate phases (Vision → Guardrails → Plan → Implement) with clear boundaries and handoffs.
Core principle: Every interaction happens in a session context. Transitions between sessions are explicit and validated.
Session Types
| Type | Purpose | Duration | Output | Checkpoint |
| vision | Project kickoff | 1 session | Vision docs, tech stack, backlog | "Scope locked, ready for guardrails" |
| guardrails | Tooling/standards | 1 session | Repo setup, ways of working | "Ready for feature planning" |
| plan | Breakdown/estimation | Variable | Tasks, acceptance criteria | Per feature approved |
| brainstorm | Open discussion | Variable | Ideas, options explored | Ready to plan |
| whiteboard | Exploration | As needed | Insights, parked branches | Refined into formal doc |
| implement | Coding/execution | Variable | Working code | Ready for test/review |
Valid Transitions
vision → guardrails, whiteboard, brainstorm
guardrails → plan, whiteboard, brainstorm, vision
plan → implement, whiteboard, brainstorm, vision, guardrails
brainstorm → vision, guardrails, plan, implement, whiteboard (universal)
whiteboard → vision, guardrails, plan, implement, brainstorm (universal)
implement → whiteboard, brainstorm, plan (blockers only)
None → vision, guardrails, plan, brainstorm, whiteboardKey rules:
brainstormandwhiteboardare universal - can go anywhereimplementcan only go to whiteboard/brainstorm/plan (for blockers)- Can loop back to earlier stages if needed
Intent Detection Patterns
When user sends a message, detect intent from keywords:
INTENT_PATTERNS = {
"vision": [
"build me a", "i want a new", "start a project", "create a new",
"from scratch", "new project", "starting fresh",
"what should i build", "help me design", "project vision",
"product vision", "app idea", "game concept",
"what tech stack", "which framework", "choose between",
],
"guardrails": [
"setup repo", "configure", "tooling", "standards",
"project setup", "initial setup", "way of working",
"coding standards", "git workflow", "ci/cd", "linting",
"testing approach", "code review process",
],
"plan": [
"plan this", "plan the", "create a plan for", "planning session",
"break down", "break this into", "estimate", "task breakdown",
"implementation plan", "how to implement", "steps to",
"design the", "feature breakdown", "user stories for",
],
"brainstorm": [
"brainstorm", "brainstorming", "ideation", "design thinking",
"let's discuss", "what are the options", "pros and cons",
"compare", "alternatives for", "different approaches to",
"explore ideas", "conceptual", "theoretical",
],
"whiteboard": [
"whiteboard", "wb:", "whiteboard this", "spawn a whiteboard",
"explore", "not sure", "what do you think", "rough this out",
"sketch this out", "let me think about", "i need to think through",
"park this", "side note", "another thought", "while we're at it",
],
"implement": [
"implement", "code this", "write the code", "build this",
"start coding", "get to work", "execute this",
"write the function", "create the class", "add this feature",
"fix this bug", "implement the", "code the",
],
}
# Priority order for ambiguous matches
PRIORITY_ORDER = ["vision", "guardrails", "plan", "brainstorm", "whiteboard", "implement"]Agent Behavior
When processing user input:
- Load session state - Read
.session-state/session.json - Detect intent - Match keywords against patterns
- Validate transition - Check if transition is valid from current state
- Handle result - Continue session, handoff, or reject
Loading Session State
def load_session_state():
try:
with open(".session-state/session.json", "r") as f:
return json.load(f)
except FileNotFoundError:
return {"current_session": None, "history": []}Detecting Intent
def detect_intent(user_message, session_state):
msg_lower = user_message.lower()
for intent in PRIORITY_ORDER:
patterns = INTENT_PATTERNS.get(intent, [])
if any(p in msg_lower for p in patterns):
# Disambiguate with context if needed
if intent == "discuss" and session_state.get("type") == "plan":
return "plan"
return intent
return NoneValidating Transitions
VALID_TRANSITIONS = {
"vision": ["guardrails", "whiteboard", "brainstorm"],
"guardrails": ["plan", "whiteboard", "brainstorm", "vision"],
"plan": ["implement", "whiteboard", "brainstorm", "vision", "guardrails"],
"brainstorm": ["vision", "guardrails", "plan", "implement", "whiteboard"],
"whiteboard": ["vision", "guardrails", "plan", "implement", "brainstorm"],
"implement": ["whiteboard", "brainstorm", "plan"],
None: ["vision", "guardrails", "plan", "brainstorm", "whiteboard"],
}
def validate_transition(intent, current_type):
if current_type is None:
return True
return intent in VALID_TRANSITIONS.get(current_type, [])Session State Schema
{
"current_session": {
"type": "plan",
"feature": "inventory-system",
"started_at": "2025-01-28T10:30:00Z",
"tracking_file": "docs/plans/inventory-implementation.md"
},
"history": [
{
"type": "vision",
"started_at": "2025-01-27T09:00:00Z",
"ended_at": "2025-01-27T11:30:00Z",
"output": "docs/design/vision.md",
"handed_off_to": "guardrails"
}
],
"branch": "feature/inventory",
"worktree": "C:/Projects/cozy-fantasy-rpg/"
}Announcement Patterns
Entering a Session
"→ ENTERING {SESSION_TYPE} mode
Context: {brief context}
Tracking file: {path}
Type 'done', 'pause', or 'switch to {OTHER}' when ready"Invalid Transition
"⚠️ INVALID TRANSITION
You're in: {CURRENT_SESSION}
Requested: {REQUESTED_SESSION}
Valid next steps from {CURRENT}:
- {OPTION_1}
- {OPTION_2}
- {OPTION_3}
Options:
1. Continue {CURRENT}
2. Handoff to {VALID_OPTION}
3. Whiteboard to explore first"Session Drift Detected
"⚠️ SESSION DRIFT DETECTED
You're questioning: {TOPIC}
Current session: {CURRENT}
This should have been resolved in: {EARLIER_SESSION}
Session history shows:
- Vision (completed)
- Guardrails (completed)
- Plan (completed) → architecture decided
- Implementation (current)
Recommendation: Whiteboard the concern, then either:
- Return to Implementation (affirm decision)
- Reopen Planning (revisit decision)"Handoff Between Sessions
"→ HANDOFF: {CURRENT} → {NEW_SESSION}
Completing: {CURRENT}
- Output: {tracking_file}
- Duration: {duration}
Entering: {NEW_SESSION}
- Context: {why this transition}
- Next steps: {what to expect}"Special Behaviors
During Implementation
If user questions settled decisions:
"⚠️ DECISION RECONSIDERATION
You're questioning: {DECISION}
This was settled in: {EARLIER_SESSION}
Options:
1. Accept previous decision (continue)
2. Whiteboard to explore concern
3. Reopen {EARLIER_SESSION} to revisit"During Planning
If scope expansion detected:
"⚠️ SCOPE CHANGE DETECTED
This request would alter the scope of the approved plan:
- Current plan: {plan_file}
- Agreed scope: {scope_summary}
- Requested change: {what user wants}
- Impact: {how this changes things}
Recommendation: Whiteboard this change before proceeding"When Switching Modes
Always announce:
"Switching from {CURRENT} to {NEW} mode...
Reason: {why the switch}
State saved: {tracking_file}"Concurrency Model
Each worktree has independent session state:
| Worktree | Branch | Session State |
| Main | main | .session-state/session.json (local) |
| Worktree 1 | feature/inventory | .session-state/session.json (local) |
| Worktree 2 | whiteboard/combat | .session-state/session.json (local) |
Rules:
- Each worktree has its own
.session-state/session.json - Session state is never committed to git
- No merge conflicts - state is transient
- Handoffs only occur within a worktree
Error Handling
Corrupted or Missing Session State
def load_session_state():
try:
with open(".session-state/session.json", "r") as f:
return json.load(f)
except (FileNotFoundError, json.JSONDecodeError):
return {"current_session": None, "history": []}Unable to Determine Intent
"I'm not sure what type of session you want.
Are you trying to:
1. Start a new project (vision)
2. Plan some work (plan)
3. Explore ideas (whiteboard/brainstorm)
4. Write code (implement)
Please clarify and I'll proceed."Session Lifecycle
1. START SESSION
- Create .session-state/session.json
- Set type, started_at, tracking_file
2. WORK IN SESSION
- Update session.json as needed
- Track progress
3. COMPLETE SESSION
- Move current_session to history
- Set ended_at, output, handed_off_to
- Delete session.json or leave for next sessionIntegration with Other Skills
Session-aware wraps existing skills:
User: "plan the inventory system"
↓
[Session-aware detects: intent=plan]
↓
[Session-aware creates session state, announces entry]
↓
[Delegates to 'plan' skill]
↓
[Plan skill executes with session context]
↓
[Session-aware maintains state throughout]Skills remain unchanged - session-aware is a wrapper that:
- Pre-processes: Detects intent, validates state
- Post-processes: Updates state, announces transitions
- Delegates: Invokes the appropriate skill
Checklist for Agents
When processing user input:
- Load
.session-state/session.json - Detect intent from keywords
- Validate transition against VALID_TRANSITIONS
- Announce mode changes explicitly
- Update session state after transitions
- Detect and warn on scope changes during planning
- Detect and warn on decision reconsideration during implementation
- Clean up session state when complete
Related Skills
whiteboard- Lightweight exploration spacesbrainstorming- Structured exploration with interview workflowplan- Formal planning sessionsnote- Quick memory capture
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
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.

