ai-ml-series

A writing guide for a 25-chapter course that teaches PHP developers how to add artificial intelligence and machine learning to applications. Machine learning means software finding patterns in data to make predictions or decisions.

In plain words
What is it for?
Use it when writing lessons about PHP machine-learning libraries, Python tools, OpenAI APIs, TensorFlow, ONNX Runtime, and computer-vision tools such as OpenCV.
Why use it?
It gives developers moving from ordinary web development a structured path from basic concepts to practical projects and production deployment.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/dalehurley/codewithphp/ai-ml-series
Clone the repo
git clone --depth 1 https://github.com/dalehurley/codewithphp

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 7,679 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.07679
Opus 5 $0.00000 $0.03839
Sonnet 5 $0.00000 $0.01536
Haiku 4.5 $0.00000 $0.00768

Measured 2d ago against content hash dea4c1e852a5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-ml-series scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ai-ml-series.mdc · 505 lines

How it starts

The opening of the file, as written. The whole thing — 505 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI/ML for PHP Developers Series

Series Overview

A comprehensive 25-chapter course teaching PHP developers how to integrate artificial intelligence and machine learning into their applications. The series progresses from fundamental concepts to advanced implementations, covering theory, practical projects, and production deployment.

Target Audience

  • PHP developers (intermediate to advanced) with little to no AI/ML experience
  • Web developers wanting to add intelligent features to applications
  • Developers transitioning from traditional web development to AI-enhanced applications

Core Technologies & Libraries

PHP Libraries

  • PHP-ML: Pure PHP machine learning library for basic algorithms
  • Rubix ML: Comprehensive ML library with 40+ algorithms covering the entire ML lifecycle
  • PHP extensions for TensorFlow and ONNX Runtime (where applicable)

External Tools & Services

  • Python Integration: scikit-learn, pandas, TensorFlow, PyTorch (via API/CLI)
  • OpenAI API: GPT models for NLP tasks
  • TensorFlow: Deep learning models and inference
  • OpenCV: Computer vision tasks (typically via Python bridge)

Dependencies

  • PHP 8.4+ (always)
  • Composer for dependency management
  • Optional: Python 3.10+ for advanced ML tasks
  • Docker (for deployment chapters)

Chapter Progression

The series follows a carefully structured learning path:

  1. Foundations (Chapters 1-4): Introduction, environment setup, core concepts, data preprocessing
  2. Basic ML (Chapters 5-8): First models, classification, evaluation, PHP ML libraries
  3. Advanced ML (Chapters 9-12): Complex algorithms, neural networks, Python integration, deep learning
  4. NLP Track (Chapters 13-15): Text processing, classification, language models
  5. Computer Vision Track (Chapters 16-18): Image basics, classification, object detection
  6. Predictive Analytics (Chapters 19-20): Time series, forecasting
  7. Recommender Systems (Chapters 21-22): Theory and implementation
  8. Production (Chapters 23-24): Integration, deployment, scaling
  9. Capstone (Chapter 25): Comprehensive project and future trends

Read the full file on GitHub · 505 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 505 lines · 0 tokens per session scan A dea4c1e852a5

Subscribe to this mod's changes

ai-ml-series is a cursor rule published in the GitHub repository dalehurley/codewithphp (5 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 7,679 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.