Skip to content

AutoERP Development

Documentation of the AI-assisted development process for EspoCRM-based ERP systems. Only two inputs are accepted: recorded meetings with screen sharing and e-mails. The architect prepares the full design first; implementation then runs in agile loops driven by detailed specifications. After go-live, iterative changes follow the same evidence-first path.

graph LR
    A["Meeting recording + e-mail"] --> B["Evidence intake<br/>transcript + citation"]
    B --> C["Architect<br/>E2E design + spec"]
    C --> D["Spec review<br/>manual check"]
    D --> E["Sprint backlog<br/>tasks from spec"]
    E --> F["Build<br/>PHPStan+tests+lint"]
    F --> G["UI click tests (click-test)"]
    G --> H[Release + openspec archive]
    H --> I[Iterative change proposal]
    I --> B

Key Principles

1. Evidence-first

  • Work is derived only from recorded meetings (with screen sharing) and e-mails. Every requirement carries source (meeting timestamp or message-id).
  • Store transcripts and link them inside openspec/specs or openspec/changes.

2. Spec-first with manual review

  • AI can draft specs, but nothing is built without a manual check by architect/PM against the evidence.
  • Everything flows through OpenSpec (current truth vs. delta changes) and openspec validate --strict.

3. Automation with quality gates

  • Each module has its own PHPStan rules (autoerp/<module>/phpstan/*.neon) and often PHPUnit; FE parts run lint (ESLint/Stylelint) per package.json.
  • UI validation uses click-test (Chrome DevTools MCP) – UI only, API allowed only for prerequisites/cleanup.

4. Iterative changes

  • After go-live, new asks go through meeting/e-mail → change proposal → sprint. Specs are archived after release (openspec archive).

Process Documentation

Phase Doc Purpose
Evidence Client Analysis Recordings, transcripts, gap analysis with sources
Specification Specifikace First OpenSpec, Gherkin, manual review
Build Development Process Gates (PHPStan, PHPUnit, lint, click-test)
Iteration Iterative Development Sprints, change proposals, release management
Changes Change Proposals Delta changes with evidence + archiving

Technical references

Section Purpose
Agent Architecture Multi-agent AI architecture & knowledge core
Data Model Structure of specifications and JSON schemas
Integrations EspoCRM API + external services
Example analyses Sample client analyses

Process Overview

Evidence + analysis

inputs:
  - Meeting recordings (video + screen)
  - E-mail threads
outputs:
  - Transcript with timestamps
  - Gap Analysis + Solution Proposal with `source`
  - Split: baseline vs. iterative backlog
➡️ See Client Analysis

Specification & review

outputs:
  - openspec/specs/<module>/spec.md
  - openspec/changes/<id>/proposal.md + delta spec
validation:
  - `openspec validate --strict`
  - Manual architect/PM review
➡️ See Specifikace First

Sprint build

gates:
  - PHPStan matching target EspoCRM version (autoerp/<module>/phpstan/*.neon)
  - PHPUnit if present
  - FE lint (npm run lint / lint:js / lint:css) for Autocrm/FE parts
➡️ See Development Process

Validation & release

qa:
  - Unit/integration tests
  - UI click-test scenarios (repo /home/david/tmp/click-test)
release:
  - attach reports to MR
  - `openspec archive <change>` after deploy
➡️ See Iterative Development


Quality & Testing

  • PHPStan: choose profile by EspoCRM target (phpstan-8.4.2.neon, phpstan-9.1.9.neon, ...). Respect custom rules (BindService, EntityManager RT). No merge without it.
  • PHPUnit: run when phpunit.xml exists; add tests when logic changes.
  • Frontend lint: Autocrm offers npm run lint, lint:js, lint:css. Use Node/NPM versions from package.json.
  • Click-test: UI only; API only for prerequisites/cleanup; scenario ID = MD filename. Report + symlink + checklist required (see click-test/AGENTS.md).

Quick Start

New project

  1. 📼 Get meeting recording + e-mail recap, create transcript.
  2. 🗺️ Run gap analysis with source links.
  3. 📝 Draft & review OpenSpec (baseline).
  4. 📋 Fill sprint backlog from OpenSpec.
  5. 🔨 Build with PHPStan/tests/lint.
  6. 🧪 Run click-test scenarios + report.
  7. 🚀 Release + openspec archive.

Existing project / change

  1. 📥 Request from meeting/e-mail → change proposal (openspec/changes/).
  2. openspec validate --strict + manual review.
  3. 🔨 Implement in sprint with gates (PHPStan/tests/lint).
  4. 🧪 Click-test + report + checklist.
  5. 📦 Release + archive specification.

AI Agent workflow

graph TD
    Evidence["Meeting/e-mail evidence"] --> Analyst
    Analyst --> Architect["Architect Agent<br/>OpenSpec draft"]
    Architect --> ManualReview["PM/architect review"]
    ManualReview --> Builder["Builder Agent<br/>Implementation + tests"]
    Builder --> QA["QA Agent<br/>click-test report"]
    QA --> Deploy["Deployed system + openspec archive"]

Slash commands

Command Purpose
/openspec:proposal Create new change proposal
/openspec:apply Implement approved proposal
/openspec:archive Archive completed change

Next Steps

  1. 🎯 Start with Client Analysis
  2. 📐 Learn the Specifikace First methodology
  3. 🔧 Review the Development Process
  4. 🔄 Learn Iterative Development
  5. 📝 Master Change Proposals