Dev

From Pageloom/weft-id · View interactive version

Dev is an AI agent skill from the GitHub repository Pageloom/weft-id. Dev Agent - Implement draft security advisories (always first), open GitHub issues (bugs before enhancements) and roadmap backlog items (features last)

How to use this skill

Skill file

Dev Agent - Backlog Implementation Mode

Implement open GitHub issues and draft security advisories (bugs first) and backlog items from the roadmap repo, Pageloom/weft-id-roadmap (features second).

Quick Reference

Before You Start

Read .claude/THOUGHT_ERRORS.md to avoid past mistakes.

Workflow

  1. Check GitHub first - security advisories before everything, then bugs before features. List the draft security advisories and the open security, bug and enhancement issues (commands under "Reading open work" in .claude/references/issue-tracking.md). Draft advisories always come first, regardless of severity: a low advisory outranks a critical bug. The exception is a draft whose summary starts with [Deferred]: list it last, after the issues, and work it only if the user picks it Then work the issues in label order (security, bug, enhancement), highest severity first within each
  2. If nothing is open, read the roadmap for features: the items of the top stage, in priority order ("Reading" in .claude/references/roadmap.md). Items with iteration sub-issues or effort L/XL belong to /lead
  3. Present available items and ask which to implement
  4. Create implementation plan and get user approval
  5. Implement following architectural principles
  6. Run all checks (format, lint, types, tests)
  7. On completion: close the issue through the commit (Fixes #N, or Fixes Pageloom/weft-id-roadmap#N for a backlog item)

Architectural Principles

Request → Router → Service → Database → PostgreSQL

List View Conventions

All list/table views follow these rules:

Layout: Full-width using {% block content_wrapper %}mx-auto px-4 py-8{% endblock %} before {% block content %}. No max-w-* on the outer div.

Navigation: The primary identifier (name, event type, error type) is an <a href> link to the detail page. No separate "Actions" column with icons or "View" links.

Link styling: class="text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300"

Row hover: Every data <tr> in <tbody> gets class="hover:bg-gray-50 dark:hover:bg-gray-700" (combine with any conditional classes like opacity).

Dates: Use fmt_relative() for all date/time columns. Show relative text, full datetime on hover:

{% set rel = fmt_relative(item.created_at) %}
<td class="..." title="{{ rel[1] }}">{{ rel[0] }}</td>

Reference templates: saml_idp_list.html (canonical example), users_list.html (with search, filters, pagination).

Multiselect List Conventions

Lists with bulk actions (e.g., group member management) follow additional rules:

Reference templates: groups_members.html (remove pattern), groups_members_add.html (add pattern).

Versioning & Docker

Continuous Development

During active development, use watch mode for immediate feedback:

make watch-tests    # Auto-rerun only affected tests on file changes

This runs only tests affected by your changes, providing fast feedback (seconds instead of minutes). First run builds coverage database, then intelligently selects relevant tests.

After Adding Migrations

When you create a new migration file in db-init/migrations/, apply it to the running dev database before running tests:

make migrate                            # Apply pending migrations to dev DB

Database tests run against the actual schema. If you skip this step, any test that touches the affected table will fail with a missing-column error.

Migration Safety

Migrations must be backwards compatible (safe to apply on a running instance). The compliance checker (--check migration-safety) flags dangerous operations:

For breaking changes, use a multi-step approach: add new column, deploy code that uses it, backfill, then drop old column in a later migration.

If a migration intentionally contains a breaking change (e.g., cleanup after a prior code deploy), add -- migration-safety: ignore on its own line to suppress the check.

Before Committing

make fix                                # Lint, format, type check, compliance
make test                               # Tests (full suite)

Both must pass.

Note: E2E tests (make e2e) are separate and not required before every commit.

Run them when changes affect: login flows, SAML SSO, SLO, MFA, cross-tenant behavior, or group-based SP access.

Testing Requirements

Off-List Requests

Distinguish between:

Completion

When done:

Headless Mode

When invoked programmatically (via Agent tool), skip all interactive workflows:

Instead:

  1. Read .claude/THOUGHT_ERRORS.md
  2. Execute the task described in your prompt
  3. Follow all architectural principles and coding standards above
  4. If a migration was created, run make migrate before tests
  5. If templates changed, run make build-css
  6. Run make fix (lint, format, types, compliance) and fix any issues
  7. Run make test and fix any failures. Both must pass.

Report back:


Start Here

List the draft security advisories first (they take precedence over everything, except [Deferred] ones, which go last), then open GitHub issues, then the roadmap's top stage if none are open, and present available items in that order.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.