AI Session Guide
Step-by-step workflow for AI-assisted HRMS development with copy-paste prompts
AI Session Guide
This guide provides exact steps and copy-paste prompts for working with AI coding assistants (Cursor, Claude Code) on the HRMS project.
Before Your First Session (One-Time Setup)
Required Once
Complete these steps before your first development session.
Step 1: Create State Files in Code Repository
Copy these templates to your hrms code repository root:
| Template Source | Copy To |
|---|---|
| PROJECT_STATE.md Template | hrms/PROJECT_STATE.md |
| WHAT_EXISTS.md Template | hrms/WHAT_EXISTS.md |
Step 2: Create CLAUDE.md
Copy the CLAUDE.md template from AI Coding Agents Guide to:
hrms/CLAUDE.mdClaude Code automatically reads this file at session start.
Step 3: Create .cursorrules (For Cursor Users)
Copy the rules from Constraints to:
hrms/.cursorrulesCursor automatically applies these rules.
Step 4: Initial State File Setup
Fill in PROJECT_STATE.md with:
## Current Phase
**Phase 00: Empty Shell** (or your actual starting phase)
## Current Step
Step 1 of XX
## What I'm About To Do
Set up the monorepo structure following phase-00-empty-shell.mdxStarting Any Session
Step 1: Open Your AI Tool
- Cursor: Open the
hrmsfolder - Claude Code: Start a new session in the
hrmsdirectory
Step 2: Provide the Start Prompt
Copy and paste this exact prompt:
Read these files in order:
1. PROJECT_STATE.md
2. WHAT_EXISTS.md
Then tell me:
- Current phase and step
- What was last completed
- What's next to do
- Any blockers or notes from previous session
Do NOT start coding until I confirm your understanding is correct.Step 3: Verify AI Understanding
AI will respond with its understanding. Check:
- Is the phase correct?
- Is the step correct?
- Does it know what's already built?
If correct: Reply "Correct. Proceed with [current step]."
If incorrect: Correct it: "No, we're actually on Phase X, Step Y. Re-read the state files."
Phase-Specific Context Loading
Which Files to Provide
For each phase, provide these docs to your AI:
Phase 00: Empty Shell
Context to provide:
@phase-00-empty-shell.mdx
@boilerplate-definition.mdxStart prompt:
We're starting Phase 00: Empty Shell.
I've provided the phase spec and boilerplate definition.
Read them, then tell me:
1. What we're building in this phase
2. The steps involved
3. The gate (verification) for each step
Don't start coding until I approve your plan.Phase 01: Multi-Tenant Auth
Context to provide:
@phase-01-multi-tenant-auth.mdx
@patterns.mdx
@database-schema.mdx (if needed)Start prompt:
We're starting Phase 01: Multi-Tenant Auth.
I've provided the phase spec and patterns.
Read them, then tell me:
1. What auth system we're implementing
2. The database models involved
3. How multi-tenancy works
4. The steps and gates
Don't start coding until I approve your plan.Phase 01.5: Design System
Context to provide:
@phase-01.5-design-system.mdx
@18-design-system/index.mdx
@18-design-system/design-tokens.mdx
@18-design-system/components/index.mdx
@17-ui-screenshots/index.mdxStart prompt:
We're starting Phase 01.5: Design System.
I've provided the phase spec, design tokens, and UI screenshots.
Read them, then tell me:
1. The design system we're implementing (Apple-Screver Hybrid)
2. Key color tokens and typography
3. Component patterns to follow
4. How to validate against the screenshots
Don't start coding until I approve your plan.Phase 02: Employee Entity
Context to provide:
@phase-02-employee-entity.mdx
@patterns.mdx
@service-patterns.mdxStart prompt:
We're starting Phase 02: Employee Entity.
I've provided the phase spec and code patterns.
Read them, then tell me:
1. The Employee model structure
2. CRUD operations needed
3. API endpoints to create
4. The exact patterns to follow
Don't start coding until I approve your plan.Phase 03: Org Structure
Context to provide:
@phase-03-org-structure.mdx
@patterns.mdx
@service-patterns.mdx
@domain-models.mdx (for flexible org model reference)Start prompt:
We're starting Phase 03: Org Structure.
I've provided the phase spec and domain models.
Read them, then tell me:
1. How the flexible org structure works
2. Manager relationships (primary, dotted-line, additional)
3. Team and department membership
4. The OrgService operations
Don't start coding until I approve your plan.Phases 04-09: General Template
Context to provide:
@phase-XX-[name].mdx
@patterns.mdx
@service-patterns.mdx
@[relevant-reference].mdx (if applicable)Start prompt:
We're starting Phase XX: [Name].
I've provided the phase spec and relevant patterns.
Read them, then tell me:
1. What we're building
2. Dependencies on previous phases
3. Database changes (if any)
4. API endpoints and frontend routes
5. Steps and gates
Don't start coding until I approve your plan.During Development
Every 30 Minutes: Checkpoint
Set a timer. Every 30 minutes, ask the AI:
CHECKPOINT:
1. What step are we on?
2. Have you drifted from the plan?
3. What's your current progress?
4. Any blockers?
Update PROJECT_STATE.md with current status.When AI Goes Off Track
If AI starts doing something unexpected:
STOP.
You're going off track. We're supposed to be doing [X],
but you're doing [Y].
Re-read PROJECT_STATE.md and confirm what the current step is.
Do NOT continue until I approve.When AI Suggests "Improvements"
If AI suggests refactoring, optimizing, or improving existing code:
Is this improvement in the current step's scope?
If NO: Do not make this change. Add it to a "future enhancements"
note in PROJECT_STATE.md and continue with the current task.
If YES: Show me the specific step that requires this change.When You Need More Context
If AI is missing information:
You need more context. I'm providing [document name].
Read it, then tell me how it affects our current work.Ending a Session
Step 1: Request State Update
We're ending this session.
Update PROJECT_STATE.md with:
1. Mark completed steps with ✅ and timestamp
2. Update "Current Step" to where we stopped
3. Write a "Handoff Note" describing:
- What was just completed
- What's next
- Any blockers or issues
- Files that need attention
Show me the updated content before committing.Step 2: Review and Commit
After AI shows the update:
# Review the changes
git diff PROJECT_STATE.md WHAT_EXISTS.md
# Commit (use conventional commit format!)
git add PROJECT_STATE.md WHAT_EXISTS.md
git commit -m "chore: update state after [brief description]"Commit Message Format (Required)
ENFORCED BY CI
All commits must use conventional commit format. GitHub Actions will reject non-conforming commits.
Quick Reference
<type>: <description>| Type | Use When | Version Bump |
|---|---|---|
feat | Adding a feature | Minor (0.X.0) |
fix | Fixing a bug | Patch (0.0.X) |
docs | Documentation changes | Patch |
refactor | Code restructure | Patch |
test | Adding tests | Patch |
chore | Maintenance | Patch |
Copy-Paste Examples
# Features
git commit -m "feat: add employee dashboard"
git commit -m "feat: implement time-off request workflow"
# Bug fixes
git commit -m "fix: resolve login timeout issue"
git commit -m "fix: correct date format in reports"
# Documentation
git commit -m "docs: update API endpoint guide"
git commit -m "docs: add troubleshooting section"
# Refactoring
git commit -m "refactor: simplify auth middleware"
git commit -m "refactor: extract validation utilities"
# Breaking changes (add ! for major version bump)
git commit -m "feat!: redesign authentication API"Invalid Commits (CI Will Reject)
# These will FAIL:
git commit -m "update stuff" # No type
git commit -m "Feature: add login" # Wrong case (Feature vs feat)
git commit -m "feat add login" # Missing colon
git commit -m "FEAT: add login" # Uppercase
git commit -m "wip" # Not descriptivePrompt for AI
If AI creates a bad commit message:
STOP. That commit message doesn't follow conventional commits.
Correct format: <type>: <description>
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
Change to: "[correct message]"Step 3: Phase Completion (If Applicable)
If you completed a phase:
We've completed Phase XX.
1. Update PROJECT_STATE.md - move phase to "Completed Phases"
2. Update WHAT_EXISTS.md with all new:
- Database models
- API endpoints
- Frontend routes
- Established patterns
3. Create git tag: git tag phase-XX-name
4. Show me both files before committing.Quick Reference Prompts
Session Start
Read PROJECT_STATE.md and WHAT_EXISTS.md.
Tell me: current phase, current step, what's next.
Wait for my approval before coding.Before Any Edit
Before editing this file, confirm:
1. Is it in the locked files list?
2. What pattern am I copying from?
3. What's the gate for this step?Checkpoint (Every 30 min)
CHECKPOINT: What step are we on? Any drift? Update PROJECT_STATE.md.Stop AI
STOP. You're off track. Re-read PROJECT_STATE.md.
Do NOT continue until I approve.End Session
Ending session. Update PROJECT_STATE.md with completed steps,
current position, and handoff note. Show me before commit.Complete Phase
Phase XX complete. Update both state files, create git tag,
show me before commit.Troubleshooting
AI Doesn't Follow Patterns
You're not following the established pattern.
Look at [file path] for the correct pattern.
Your code should match EXACTLY:
- Same import structure
- Same class decorators
- Same method signatures
- Same error handling
Fix it before continuing.AI Creates Duplicate Code
STOP. Check if this already exists.
Search for: [component/service name]
Check WHAT_EXISTS.md for existing implementations.
If it exists, use the existing one. Do NOT create a duplicate.AI Wants to Add New Dependencies
STOP. New dependencies require approval.
Is [package name] in the locked tech stack?
Check: constraints.mdx or boilerplate-definition.mdx
If not listed, explain why it's needed and wait for approval.AI Context Seems Lost
Your context seems lost. Let's reset.
1. Read PROJECT_STATE.md
2. Read WHAT_EXISTS.md
3. Tell me what you understand about our current state
4. Wait for my confirmation before continuingDeployment Checkpoint Prompts
When deploying changes, AI must pause at 4 checkpoints for your approval.
Checkpoint 1: Before Push
After AI commits changes, it will ask:
🛑 CHECKPOINT 1 - Code Ready
I've completed:
- Created branch: feature/[name]
- Made code changes
- Committed: "[message]"
**Please verify:** Review the code diff above.
**When ready:** Reply "OK to push" to continue.Checkpoint 2: Before Merge
After preview deploys, AI will ask:
🛑 CHECKPOINT 2 - Preview Ready
Preview URL: https://hrms-docs-pr-N-xxx.run.app
**Please verify:** Open the preview and check the feature works.
**When ready:** Reply "OK to merge" to continue.Checkpoint 3: Before Production
After staging deploys, AI will ask:
🛑 CHECKPOINT 3 - Staging Ready
Staging URL: https://hrms-docs-staging-xxx.run.app
**Please verify:** Test in staging environment.
**When ready:** Reply "OK to deploy" to deploy to production.Checkpoint 4: Confirm Complete
After production deploys, AI will ask:
🛑 CHECKPOINT 4 - Production Live
Production URL: https://docs.hrms.bluewoo.com
**Please verify:** Confirm feature is live in production.
**When ready:** Reply "Complete" to finish.Your Responses
| Checkpoint | You Say |
|---|---|
| 1 | "OK to push" |
| 2 | "OK to merge" |
| 3 | "OK to deploy" |
| 4 | "Complete" |
Next Steps
- Documentation Map - Understand which docs to read when
- Troubleshooting - Common errors and solutions
- Live State Tracking - Deep dive into state management
- Development Workflow - Complete deployment guide