# WORKFLOW.md

# Inveetaire Development Workflow

Version : 1.0

Status : ACTIVE

---

# Purpose

This document defines the mandatory development workflow for every AI assistant and developer contributing to the Inveetaire platform.

Every implementation must follow this workflow.

No shortcuts are allowed.

---

# Development Philosophy

Develop small.

Review often.

Commit frequently.

Never implement multiple unrelated features in one session.

Every coding session has one clear objective.

---

# The Golden Rule

One AI Session

=

One Task ID

Never implement two unrelated tasks together.

Example

GOOD

GUEST-003

Implement Guest Import.

BAD

Guest Import

Vendor Dashboard

Printer Configuration

Authentication Fix

All in one session.

---

# Overall Workflow

Requirement

↓

Architecture

↓

Database

↓

Implementation

↓

Review

↓

Testing

↓

Commit

↓

Stop

---

# Step 1

Understand the Request

Before writing code

AI must identify

Task ID

Feature

Module

Acceptance Criteria

Dependencies

If Task ID does not exist

STOP.

Ask for clarification.

---

# Step 2

Read Documentation

Always read

AI.md

↓

PROJECT.md

↓

PRD

↓

SAD

↓

DDD

↓

PDD

↓

ADR

↓

MIB

↓

TCS

Only read documents relevant to the current task.

---

# Step 3

Understand Dependencies

Before coding

Check

Previous Tasks

Database

Related Services

Routes

Views

Configuration

Never assume.

---

# Step 4

Implementation

Implement only

One Task.

Do not improve unrelated files.

Do not refactor unrelated modules.

Do not rename existing structures.

---

# Step 5

Self Review

Check

Architecture

Security

Performance

Validation

Workspace Isolation

Audit

Coding Standard

If one item fails

Fix first.

---

# Step 6

Testing

Run

Manual Testing

Validation Testing

Permission Testing

Workspace Testing

Edge Cases

If testing fails

Fix.

Retest.

---

# Step 7

Definition of Done

A Task is complete only if

Acceptance Criteria passed

Security passed

Manual Test passed

Workspace isolation verified

Audit logging implemented

No debug code

No TODO comments

TCS compliant

---

# Step 8

Prepare Summary

Every completed task must include

Task ID

Summary

Files Created

Files Modified

Database Changes

Routes Added

Views Added

Testing Performed

Known Limitations

Remaining Tasks

---

# Step 8A

Terminal and Git Rules

AI may run read-only terminal commands freely:

File structure checks

git status, git log, git diff

PHP syntax validation

File content verification

AI must STATE and WAIT for approval before:

Creating or deleting any file or directory

Running git add

Running git commit

Running git push

Running any database command

Running any install command

Git Responsibility Split

AI prepares the commit message.

User executes git add and git commit.

User executes git push.

Unless the user explicitly says "commit and push" in the current message.

The phrase "Implement INIT-XXX" does NOT authorize git operations.

---

# Step 8B

Scope Boundary Rule

AI must treat the Task ID as a hard boundary.

Every line of code written must map to a requirement
inside the current Task ID specification in MIB.

If a requirement is not in the Task ID:

Do not implement it.

Flag it in the summary as out of scope.

Note the Task ID it belongs to.

There are no exceptions.

Not even for small additions.

---

# Development Lifecycle

Idea

↓

Requirement

↓

Approved Task

↓

Implementation

↓

Review

↓

Testing

↓

Merge

↓

Release

Never skip a stage.

---

# Module Workflow

Every module follows

Planning

↓

Database

↓

Model

↓

Service

↓

Validation

↓

Controller

↓

View

↓

Testing

↓

Documentation

Never reverse this order.

---

# Database Workflow

When database changes are required

Check PDD

↓

Check ADR

↓

Create Migration

↓

Update Model

↓

Update Service

↓

Update Validation

↓

Update Controller

↓

Update Views

Never modify database directly.

---

# Bug Fix Workflow

Understand Bug

↓

Reproduce

↓

Find Root Cause

↓

Fix Root Cause

↓

Regression Test

↓

Commit

Never patch symptoms only.

---

# Refactoring Workflow

Review Existing Code

↓

Identify Improvement

↓

Preserve Behaviour

↓

Refactor

↓

Regression Test

↓

Commit

Never change business logic while refactoring.

---

# Feature Workflow

Read Requirement

↓

Read MIB Task

↓

Implement

↓

Review

↓

Test

↓

Done

Never redesign the feature.

---

# AI Escalation Workflow

If AI encounters

Conflicting documents

Missing requirements

Architecture conflict

Database conflict

Unexpected dependency

Then

STOP

Explain the issue

List possible solutions

Wait for user approval

Never guess.

---

# Commit Workflow

AI prepares the commit message.

User reviews the staged files.

User executes git add.

User executes git commit.

User executes git push.

One Task

↓

One Commit

↓

One Summary

Never combine unrelated work.

Never let AI push without explicit instruction.

---

# Version Workflow

Development

↓

Internal Testing

↓

Release Candidate

↓

Production

Every release must be traceable.

---

# Emergency Workflow

If a critical production issue occurs

Stop new feature development

↓

Investigate

↓

Fix

↓

Test

↓

Deploy

↓

Resume development

Production stability has priority.

---

# Daily Development Checklist

Before Coding

□ Read Task ID

□ Read Documentation

□ Understand Dependencies

□ Verify Acceptance Criteria

□ Start Implementation

After Coding

□ Self Review

□ Manual Test

□ Security Check

□ Remove Debug Code

□ Verify Workspace Isolation

□ Complete Summary

□ Ready to Commit

---

# Final Principle

Never rush implementation.

A feature implemented correctly once is cheaper than fixing it many times.

Consistency is more valuable than speed.

The architecture is already complete.

The goal is to implement it faithfully.