Instruction file imported from rhanka/assistant (
.cursor/rules/workflow.mdc). Copyright stays with the author.
WORKFLOW
Principles
- FIRST: Read
.cursor/rules/MASTER.mdcfor consolidated rules overview - SECOND: Read
README.mdfor project overview and setup - THIRD: Read
TODO.mdfor current priorities and items - FOURTH: Read
RELEASE.mdfor target version and scope - Propose a short action plan before coding. Request human approval when "⚠ approval".
- apply
workflow.mdcfor coding practice andtesting.mdcfor testing practice andsecurity.mdcfor security - be conform to
architecture.mdcarchitecture directives
FEATURE
- Read the target
TODO.mditem (Next or Now). - Create feature branch with
BRANCH.mddocumenting plan and tasks, asking relevant question before to start - Post a 3–6 step plan as the first PR comment.
- Implement with guardrails (preview, dry-run, logs).
- Test before commit - ensure all changes work as expected.
- Update
TODO.md(check item, reference PR) andRELEASE.md(scope).
MAINTENANCE
- Small chores/refactors/docs. Same flow as FEATURE.
RELEASE
- Collect merged PRs since last tag (Conventional Commits).
- Update
RELEASE.md(notes, risks, rollback). - Open
release/x.y.zPR with release checklist. - Tag + publish after human approval.
Guardrails
- Never perform destructive DB/system actions without "⚠ approval".
- For Playwright/Cursor, always simulate before executing a critical action.
- Always test before commit - no exceptions to this rule.
- Use Make for testing - always run
make test.unitbefore commit (seetesting.mdc)
Development Conventions
- Commits: Conventional Commits (feat:, fix:, chore:, refactor:, docs:, test:)
- Branches:
feat/<slug>,fix/<slug>,boot/<slug>,release/x.y.z. Open only one at once - PR: one capability per PR; checklist; clear description (objective + short plan)
- Never proceed more than one item of
TODO.md - Be minimalist in changes (don't refacto the whole to avoid regressions)
- Commit messages and PR descriptions MUST be in English
Commit Guidelines
- Atomic commits : One logical change per commit
- File count limit : Maximum 10-15 files per commit
- Commit frequency : Commit every 2-3 logical changes
- Before major work : Commit current progress
- Commit message format :
type: concise description
Commit Workflow (MANDATORY)
- Check status first : Always run
git statusbefore committing - Selective staging : Use
git add <specific-files>for files you know you modified - Remove deleted files : Use
git rm <deleted-files>for files you know you deleted - Verify staging : Run
git statusagain to confirm what's staged - ABSOLUTELY NO
git add .: Never usegit add .- first check withgit statusandgit add <files> && git rm <removed-files>for explicit staging - Commit with context : Include clear description of what changed and why
- ONE task per commit : Complete ONE logical task, then commit. Do NOT chain multiple tasks without committing.
- File count limit : Maximum 10-15 files per commit - split large changes into multiple commits
- Update current work: update BRANCH.md and commit it to be sure of remaining work at every step
- Consolidate CI debug commits (MANDATORY): When experimenting with CI workflows (e.g., tweaking
.github/workflows/*.yml), avoid piling multiple temporaryfix:/test:commits.
- Small last-commit adjustments: prefer
git commit --amend --no-edit(or edit message as needed). - Multiple debug commits: use
git commit --amend --no-edit, stage intentionally withgit add <files> && git rm <removed-files>, and create ONE clean commit. - After amending or soft reset (history rewrite), you MUST push with
git push --force-with-leaseto update the remote safely. This keeps the history readable and compliant with atomic commit rules.
Next Step Proposal (MANDATORY)
After completing any task, ALWAYS propose the next step by following the workflow:
- Check current status : What was just completed
- Identify next priority : What comes next according to TODO.md or current context
- Propose specific action : Clear, actionable next step
- Wait for approval : Do not proceed without user confirmation
Feature Completion Workflow (MANDATORY)
After implementing all commits for a feature:
- Push to GitHub :
git push origin <branch-name> - Tech Debt: if any component was updated, please ensure
components.mdcwas applied and update tech debt files. - Final security validation : Execute comprehensive security validation (see
security.mdcfor detailed workflow) - Verify CI : Push and Monitor GitHub Actions(using
curlorghfor detailed logs) - Plan remaining actions : If commits need additional substantial work, document in BRANCH.md - else commit --amend and git push --force until CI success
- Final cleanup : When everything works:
- Remove BRANCH.md
- Check off feature in TODO.md
- Update RELEASE.md
- Create final commit with BRANCH.md content in commit message
- Push final state
- Create a PR if not existing and update PR message with last BRANCH.md content
CI Monitoring (MANDATORY)
- After any push to a feature branch or PR update, automatically verify GitHub Actions runs.
- Primary method: use GitHub API via curl for basic status checks. Minimal, non-interactive checks:
- Latest run for current branch:
curl -s "https://api.github.com/repos/<ORG>/<REPO>/actions/runs?branch=$BRANCH&per_page=1" | grep -E '"event"|"status"|"conclusion"'
- Job list for a specific run id:
curl -s "https://api.github.com/repos/<ORG>/<REPO>/actions/runs/<RUN_ID>/jobs" | grep -E '"name"|"conclusion"'
- Latest run for current branch:
- Secondary method: When curl is insufficient (e.g., accessing detailed logs, artifacts, or when API rate limits are hit), use
ghCLI:- Install:
sudo apt install ghorsudo snap install gh - Authenticate:
gh auth login(requires GitHub token withrepoandworkflowscopes) - Access logs:
gh run view <RUN_ID> --log-failedorgh run view <RUN_ID> --log - Download artifacts:
gh run download <RUN_ID>
- Install:
- If status is "skipped" unexpectedly, inspect workflow conditions/filters; for path-based workflows, ensure common files (Makefile, docker-compose.yml, packages/config, packages/schemas, CI files) are included in filters.
- If quick tweaks are needed, prefer
git commit --amend --no-editand push withgit push --force-with-lease. - If multiple debug commits were created, consolidate with
git reset --soft HEAD~N, commit once, thengit push --force-with-lease. - Push command: Always use
git push origin <branch-name>explicitly, nevergit push --set-upstream.
Quality Gates
- Before commit: Run
make test.unit(enforced by testing.mdc) - Before PR: Run
make checkto validate consistency - CI/CD: All tests must pass, guides must be consistent
- Architecture: Verify
makecommands work before any changes
Dependency Management
- Package-lock updates: Always use
make update.<package>.lockto update package-lock.json files - Docker-only: Never run
npm installdirectly - all dependency management must go through Docker - Available commands:
make update.api.lock- Update API package-lock.jsonmake update.ui.lock- Update UI package-lock.json
- Clean environment: Remove local
node_modulesif they exist outside Docker containers
Tech-Debt Management
Component Lifecycle Integration
- MANDATORY: Avoid updating componants not directly related to current developpement (e.g don't change os and langage version unless upgrade required but propose it before acting)
- MANDATORY: Update tech-debt files when updating components during development
- Scope: All component upgrades (npm, pip, Docker images, OS versions)
- Location:
.components/tech-debt-<service>.mdfiles - Integration: Tech-debt updates must be part of component upgrade workflow
Tech-Debt Update Workflow
- Before upgrade: Check current tech-debt status with
make audit.components.<service> - During upgrade: Update component version in package.json/pyproject.toml
- After upgrade: Update tech-debt file with new current version and re-audit
- Validation: Run tests to ensure upgrade doesn't break functionality
- Documentation: Update tech-debt file with new breaking change assessment
Tech-Debt Update Commands
- Audit current state:
make audit.components.<service> - Check latest versions:
make audit.npm.latest PACKAGE=<name>ormake audit.pip.latest PACKAGE=<name> - Update tech-debt: Manually update
.components/tech-debt-<service>.mdfiles - Verify upgrade: Run service tests after component upgrade
Breaking Change Assessment
- Major version upgrades: Always assess for breaking changes before upgrading
- Documentation required: Update breaking change section in tech-debt files
- Testing mandatory: Run full test suite after major version upgrades
- Rollback plan: Document rollback strategy for major upgrades
Quality Gates for Tech-Debt Updates
- Before commit: Tech-debt files must reflect current component versions
- After upgrade: Breaking change assessment must be updated
- Test validation: All tests must pass after component upgrade
- Documentation sync: Tech-debt files must match actual component versions
Vulnerability Management Lifecycle
Vulnerability Register Maintenance
- Documentation mandatory: All HIGH/CRITICAL/ERROR findings must be documented in
.security/vulnerability-register.yaml - Categories required: Each vulnerability must have a valid category (false_positive, accepted_risk, planned_mitigation, technical_debt)
- Justification mandatory: Every vulnerability must include justification for acceptance or deferral
- Timeline required: Fix goals must be specified (1d, 1w, 1m, 1y)
Vulnerability Lifecycle Stages
- Discovery: Found by security scans (SAST, SCA, Container, IaC)
- Assessment: Categorized and risk-assessed
- Documentation: Added to vulnerability register with justification
- Mitigation: Fixed or accepted with timeline
- Verification: Re-scanned to confirm resolution
- Cleanup: Removed from register after successful mitigation
Post-Mitigation Cleanup
- Remove resolved vulnerabilities: After successful fix, remove entry from vulnerability register
- Update metadata: Update
last_updatedtimestamp in register metadata - Document resolution: Add resolution details to commit message or documentation
- Verify compliance: Ensure all security scans pass after cleanup
Register Maintenance Rules
- Regular review: Review vulnerability register monthly for outdated entries
- Timeline validation: Check if fix goals are realistic and achievable
- Risk reassessment: Periodically reassess risk levels of accepted vulnerabilities
- Documentation updates: Keep justifications and timelines current
Feature Branch Management
Branch Documentation
- REQUIRED: Create
BRANCH.mdfor each feature branch (final two steps should be always test strategy completion fromtesting.mdcand Github CI execution check) - LOCATION: Root of feature branch (not committed to main)
- PURPOSE: Track progress, plan, and commit mapping
BRANCH.md Structure
# Feature: [Name]
## Objective
Brief description of what this feature accomplishes
## Plan / Todo
- [ ] Task 1: Description
- [ ] Task 2: Description
- [ ] Task 3: Description
## Commits & Progress
- [x] **Commit 1** (hash): Task 1 completed
- [x] **Commit 2** (hash): Task 2 completed
- [ ] **Commit 3**: Task 3 in progress
## Status
- **Progress**: X/Y tasks completed
- **Current**: Working on Task 3
- **Next**: Complete Task 3, then Task 4
Branch Workflow
- Create branch → Create
BRANCH.mdwith plan - Before commit → Update
BRANCH.mdwith new task - After commit → Link commit hash to completed task
- Before merge → Ensure all tasks are completed and documented
- After merge → Archive
BRANCH.mdor move to docs/
Quality Gates
- Branch creation:
BRANCH.mdmust exist before first commit - Commit mapping: Every commit must be linked to a task
- Progress tracking: Status must be updated after each commit
- Merge readiness: All tasks must be completed and documented
Branch Documentation in Commits
- Intermediate commits: Include and update
BRANCH.mdin each commit - Final commit: Copy
BRANCH.mdcontent to commit message, then remove file - Commit message format: Include complete development history and commit mapping
- New branch: Start with fresh
BRANCH.mdfor next feature
Final Commit Workflow
- Copy BRANCH.md content to commit message
- Remove BRANCH.md from working directory (not before CI github test check)
- Commit with complete development history
- Create pull request and document it with BRANCH.md content
Guide Maintenance
IMPORTANT: When updating documentation, follow this hierarchy:
Update Order (MANDATORY)
.mdcfiles FIRST - Update rules when constraints change- Documentation SECOND - Update
.mdfiles to match rules - Implementation THIRD - Update code to follow rules
Consistency Validation
- Before commit: Run
make checkto validate consistency - CI/CD: GitHub Actions validates guide consistency automatically
- Manual check: Use
make scripts.validate-guidesfor specific validation
File Responsibilities
.mdcfiles: Define rules and constraints (AI source of truth).mdfiles: Explain how to follow rules (user guides)- Both must be consistent - no contradictions allowed
Maintenance Workflow
When Rules Change
- Update
.mdcfile FIRST - Update rules when constraints change - Update documentation SECOND - Update
.mdfiles to match rules - Verify consistency - Run
make checkto validate
When Documentation Improves
- Check if it's a rule change
- If YES → Update
.mdcfile FIRST, then documentation - If NO → Update documentation only
- If YES → Update
- Verify rule compliance - All documentation must reflect current
.mdcrules
Validation Commands
- Automatic:
make check(i18n + guide validation) - Individual:
make scripts.i18n,make scripts.validate-guides - Manual:
./scripts/validate_guides.sh
Validation Commands
- Automatic:
make check(i18n + guide validation) - Individual:
make scripts.i18n,make scripts.validate-guides - Manual:
./scripts/validate_guides.sh