Back to list
bnomei

kirby-forms-and-frontend-actions

by bnomei

CLI-first MCP server for composer-based Kirby CMS projects — inspect blueprints/templates/plugins, interact with a real Kirby runtime, and use a bundled Kirby knowledge base.

20🍴 0📅 Jan 20, 2026

SKILL.md


name: kirby-forms-and-frontend-actions description: Implements frontend forms and actions in Kirby (contact forms, file uploads, email with attachments, creating pages from frontend). Use when handling user input or building submission flows.

Kirby Forms and Frontend Actions

KB entry points

  • kirby://kb/scenarios/39-basic-contact-form
  • kirby://kb/scenarios/40-frontend-file-uploads
  • kirby://kb/scenarios/41-email-with-attachments
  • kirby://kb/scenarios/42-creating-pages-from-frontend
  • kirby://kb/scenarios/43-user-registration-and-login

Required inputs

  • Form fields and validation rules.
  • Spam protection choice and error handling expectations.
  • Storage target and email settings.
  • Upload constraints (MIME/size) if files are involved.

Default controller flow

  • Verify CSRF and require the expected POST fields.
  • Validate and normalize input; return errors early.
  • Apply a single spam guard (default: honeypot).
  • Persist data or send email, then redirect with a success state.

Error payload shape

return [
  'errors' => ['email' => 'Invalid email'],
  'old' => $data,
];

Upload storage convention

  • Store files under a dedicated page (e.g. page('uploads')) or the current page.
  • Normalize filenames and enforce MIME/size limits before saving.

Common pitfalls

  • Missing CSRF verification on POST handlers.
  • Accepting uploads without MIME or size checks.

Workflow

  1. Clarify the form type, validation rules, spam protection, storage target, and email requirements.
  2. Call kirby:kirby_init and read kirby://roots.
  3. Inspect existing templates/controllers/snippets for patterns:
    • kirby:kirby_templates_index
    • kirby:kirby_controllers_index
    • kirby:kirby_snippets_index
  4. Read relevant config options via kirby://config/{option} (e.g. email, routes) when needed.
  5. Search the KB with kirby:kirby_search (examples: "basic contact form", "frontend file uploads", "email with attachments", "creating pages from frontend").
  6. Implement controller-driven validation and CSRF checks; keep templates thin and escape output.
  7. For uploads, enforce MIME/size limits and store files in safe locations.
  8. Verify by submitting forms in a browser and rendering success/error states with kirby:kirby_render_page.

Score

Total Score

75/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon