name: "✨ Feature"
description: "Propose a new feature or improvement."
title: "[FEAT] "
labels:
  - "type: feature"
  - "status: triage"

body:
  - type: textarea
    id: motivation
    attributes:
      label: "Why?"
      description: >
        What problem does this feature solve?
        Which use case is currently impossible or cumbersome?
      placeholder: |
        As a user, I cannot…
        The current limitation of the `xxx` module forces me to…
    validations:
      required: true

  - type: textarea
    id: description
    attributes:
      label: "What?"
      description: "Precise description of the desired feature."
      placeholder: |
        Add a method `xxx` on `YyyStruct` that…
        The `zzz` module should expose a trait enabling…
    validations:
      required: true

  - type: textarea
    id: acceptance-criteria
    attributes:
      label: "Acceptance criteria"
      description: >
        Verifiable conditions. Each criterion should map to
        a unit test or documentation test.
      placeholder: |
        - [ ] `cargo test` passes — coverage ≥ 85 %
        - [ ] `cargo clippy -- -D warnings`: 0 errors
        - [ ] `cargo fmt --check`: no diff
        - [ ] Doctests compile and pass
        - [ ] Existing public API unchanged (verified by `cargo-semver-checks`)
        - [ ] `CHANGELOG.md` updated
      render: markdown
    validations:
      required: true

  - type: textarea
    id: api-sketch
    attributes:
      label: "API sketch (optional)"
      description: >
        Proposed signatures, usage examples, or trait definitions.
        Need not be final.
      placeholder: |
        ```rust
        pub trait MyFormatter {
            fn format(&self, config: &AppConfig) -> String;
        }

        impl Builder {
            pub fn set_formatter<F: MyFormatter>(mut self, f: F) -> Self {
                ...
            }
        }
        ```
      render: markdown
    validations:
      required: false

  - type: input
    id: related-dd
    attributes:
      label: "Related Design Decisions"
      description: "DD issue numbers covering the associated architecture choices."
      placeholder: "#xx (DD-010), #xx (DD-012)"
    validations:
      required: false

  - type: checkboxes
    id: scope
    attributes:
      label: "Affected scopes"
      description: "Apply the matching `scope:` labels manually after creation."
      options:
        - label: "`api` — public traits or types"
        - label: "`docs` — rustdoc, examples, guides"
        - label: "`tests` — unit tests, integration tests, doctests"
        - label: "`ci` — GitHub Actions, coverage, semver-checks"

  - type: dropdown
    id: priority
    attributes:
      label: "Priority"
      description: "Apply the matching `priority:` label after creation."
      options:
        - "none — nice-to-have, outside immediate roadmap"
        - "low — in the next version"
        - "medium — in the target version"
        - "high — blocks the release"
    validations:
      required: true

  - type: dropdown
    id: effort
    attributes:
      label: "Estimated effort"
      description: "Apply the matching `effort:` label after creation."
      options:
        - "XS — < 1 h"
        - "S  — half-day"
        - "M  — 1 day"
        - "L  — 2–3 days"
        - "XL — > 3 days"
    validations:
      required: true

  - type: dropdown
    id: breaking
    attributes:
      label: "Breaking change?"
      description: >
        If yes, replace `type: feature` with `type: breaking`
        and update the version constraints accordingly.
        `cargo-semver-checks` will be run in CI to confirm.
      options:
        - "No — backward-compatible"
        - "Yes — requires a minor or major version bump"
    validations:
      required: true

  - type: checkboxes
    id: submit-checklist
    attributes:
      label: "Pre-submission checklist"
      options:
        - label: "The feature does not already exist (checked docs and open issues)"
          required: true
        - label: "The backward-compatibility constraint has been assessed"
          required: true
        - label: "A DD issue is created or referenced if architecture choices are involved"
