agentleFS
ci4meci4me/CQRSTemplate/.agents/skills/local-dev-testing/SKILL.md

local-dev-testing

Skill0 starsChanged 6 months agoMITView on GitHub

Set up and test the CQRSTemplate app locally. Use when starting the dev server, creating test accounts, or running manual tests.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    JWT_SECRET_KEY: Must be 48+ bytes hex. Use openssl rand -hex 48.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Local Development & Testing

Prerequisites

  • PHP 8.3+ (CI currently tests on 8.4), MySQL 8.0, Composer installed
  • Database ci4_cqrs created with user access

Quick Start

# 1. Start MySQL
sudo systemctl start mysql

# 2. Install dependencies (also wires git hooks)
composer install

# 3. Configure .env
cp -n env .env
# Edit .env with database credentials and JWT key:
#   database.default.hostname = localhost
#   database.default.database = ci4_cqrs
#   database.default.username = ci4user
#   database.default.password = ci4pass
#   database.default.DBDriver = MySQLi
#   JWT_SECRET_KEY = <output of: openssl rand -hex 48>

# 4. Run migrations and seed
php spark migrate --all
php spark db:seed DatabaseSeeder

# 5. Start dev server
php spark serve --port 8080

Test Accounts

Seeded by UserSeeder (php spark db:seed UserSeeder):

EmailPasswordRole
admin@example.compassword123admin
customer@example.compassword123customer

Key URLs

URLDescription
http://localhost:8080/auth/registerRegister new account
http://localhost:8080/auth/loginLogin
http://localhost:8080/dashboardDashboard (requires auth)
http://localhost:8080/cookiesCookie CRUD (requires auth)
http://localhost:8080/admin/usersUser management (admin only)

Running Quality Checks

composer check      # PHPStan + PHPCS + PHPUnit (run before PRs)
composer phpstan     # PHPStan Level 8 only
composer phpcs       # PHPCS (PSR-12 + Slevomat) only
composer test        # PHPUnit only

Common Gotchas

  • JWT_SECRET_KEY: Must be 48+ bytes hex. Use openssl rand -hex 48. Do NOT use base64 (= signs break CI4 .env parser).
  • CSRF: Session-based with token randomization. All forms need <?= csrf_field() ?>.
  • Session auth: Web routes (/cookies, /dashboard, /admin/*) require login. Unauthenticated requests redirect to /auth/login.
  • Admin routes: /admin/* requires admin role. Customer accounts get 403.
  • Pre-commit hooks: Auto-installed by composer install. Located in .githooks/. Run PHPStan + PHPCS on staged files.
  • Coverage threshold: CI enforces 90% coverage. Run composer test:coverage to check locally.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.