.build/codex/skills/session-lifecycle-patterns/SKILL.md
Manage AI agent session lifecycles with structured phases (FRAME, SHAPE, BUILD, PROVE), context preservation across sessions, handoff protocols, and session metadata tracking. Triggers on session management, agent lifecycle, or multi-session workflow requests.
npx skillsauth add organvm-iv-taxis/a-i--skills session-lifecycle-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Structure AI agent sessions for predictable outcomes, context preservation, and clean handoffs.
FRAME → SHAPE → BUILD → PROVE → DONE
↑ ↑ ↑ ↑
└───────┴───────┴───────┘
(back-transitions allowed)
| Phase | Purpose | Activities | Gate | |-------|---------|-----------|------| | FRAME | Understand context | Explore code, read docs, ask questions | Can articulate the problem | | SHAPE | Design approach | Create plan, identify files, consider tradeoffs | Plan reviewed and approved | | BUILD | Implement | Write code, create files, apply changes | Implementation complete | | PROVE | Verify | Run tests, validate output, check quality | All checks pass | | DONE | Close | Summarize, commit, document decisions | Session artifacts preserved |
VALID_TRANSITIONS = {
"FRAME": ["SHAPE"],
"SHAPE": ["FRAME", "BUILD"], # Can go back to reframe
"BUILD": ["SHAPE", "PROVE"], # Can go back to reshape
"PROVE": ["BUILD", "DONE"], # Can go back to fix
"DONE": [], # Terminal
}
def can_transition(current: str, target: str) -> bool:
return target in VALID_TRANSITIONS.get(current, [])
session:
id: "sess_2026-03-20_a1b2c3"
started: "2026-03-20T10:58:00Z"
ended: "2026-03-20T12:30:00Z"
phase_history:
- phase: FRAME
entered: "2026-03-20T10:58:00Z"
duration_minutes: 15
- phase: SHAPE
entered: "2026-03-20T11:13:00Z"
duration_minutes: 20
- phase: BUILD
entered: "2026-03-20T11:33:00Z"
duration_minutes: 45
- phase: PROVE
entered: "2026-03-20T12:18:00Z"
duration_minutes: 12
scope:
organ: IV
repo: a-i--skills
task: "Create python-packaging-patterns skill"
artifacts:
files_created: [skills/development/python-packaging-patterns/SKILL.md]
files_modified: []
commits: ["abc123"]
decisions:
- "Chose hatchling as recommended build backend"
- "Included namespace package pattern for multi-repo use"
Maintain context as the session progresses through phases:
class SessionContext:
def __init__(self):
self.discoveries: list[str] = [] # FRAME findings
self.plan: dict = {} # SHAPE output
self.changes: list[str] = [] # BUILD artifacts
self.evidence: list[str] = [] # PROVE results
def frame_discovery(self, finding: str):
self.discoveries.append(finding)
def shape_decision(self, key: str, value: str, rationale: str):
self.plan[key] = {"value": value, "rationale": rationale}
For multi-session work, preserve essential context at session end:
## Session Close Summary
### What was accomplished
- Created 6 Wave 0 skills (python-packaging-patterns through vector-search-patterns)
### What remains
- 18 more Wave 0 skills in Batches 2-4
- Waves 1-4 pending
### Key decisions
- Using governance_norm_group: repo-hygiene for packaging/config skills
- Using organ_affinity: [all] for cross-cutting infrastructure skills
### Blockers
- None
### Next session should start by
- Reading this summary
- Continuing with Wave 0 Batch 2
FRAME (80%) → SHAPE (20%) → DONE
Heavy on reading, light on planning, no implementation. Produces understanding and a plan for a future BUILD session.
FRAME (10%) → SHAPE (15%) → BUILD (55%) → PROVE (20%) → DONE
Quick reorientation, then focused building and verification.
FRAME (40%) → BUILD (30%) → PROVE (30%) → DONE
Heavy investigation, targeted fix, thorough verification.
FRAME (30%) → PROVE (70%) → DONE
Mostly reading and validating existing work.
When work spans multiple sessions, each session references the chain:
chain:
id: "skill-fortification-campaign"
session_index: 3
total_sessions_estimated: 15
previous_session: "sess_2026-03-20_wave0-batch1"
completed_items: ["A1", "A2", "A3", "A4", "A5", "A6"]
remaining_items: ["A7", "A8", "A13", "A14", "B1", "B2", ...]
At session end, produce a handoff document:
| Signal | Healthy | Unhealthy | |--------|---------|-----------| | Phase transitions | Sequential with occasional back-steps | Skipping phases, staying in one phase | | FRAME duration | 10-30% of session | <5% or >50% | | PROVE evidence | Concrete test/validation output | "I think this works" | | Context preserved | Summary written at DONE | Session ends abruptly | | Scope creep | Stays within stated scope | Expanding mid-BUILD |
development
Optimize resumes and CVs for impact, ATS compatibility, and audience targeting. Supports multiple formats (chronological, functional, hybrid), accomplishment framing (STAR/XYZ), and tailoring for specific roles. Triggers on resume review, CV update, job application prep, or career document requests.
testing
Transfer context between AI agent sessions with structured handoff protocols, state serialization, and decision log preservation. Covers multi-agent coordination, context compression, and continuity patterns. Triggers on agent handoff, session transfer, or multi-agent continuity requests.
tools
Craft compelling fiction and creative nonfiction with attention to structure, voice, prose style, and revision. Supports short stories, novel chapters, essays, and hybrid forms. Triggers on creative writing, fiction writing, story craft, prose style, or literary technique requests.
devops
Transform AI conversations and chat transcripts into publishable content including blog posts, documentation, tutorials, and knowledge base entries. Covers extraction, restructuring, and editorial refinement. Triggers on conversation-to-content, transcript processing, or chat-to-doc requests.