diff --git a/.github/agents/code-review.agent.md b/.github/agents/code-review.agent.md new file mode 100644 index 0000000..42e590e --- /dev/null +++ b/.github/agents/code-review.agent.md @@ -0,0 +1,8 @@ +--- +name: code-review +description: "Use when asked to review a pull request or to review the active branch." +tools: [read, search, execute, GitHub.vscode-pull-request-github/issue_fetch, GitHub.vscode-pull-request-github/labels_fetch, GitHub.vscode-pull-request-github/doSearch, GitHub.vscode-pull-request-github/activePullRequest] +model: GPT-5.6 Luna (copilot) +--- + +Follow the instructions for pull request review that appear in `.github/copilot-instructions.md`. \ No newline at end of file diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 5cb49b6..dc563fa 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,13 +1,37 @@ -## Copilot Pull Request Reviews - -- You are only to perform a pull request review. Do not make any changes to the code in the pull request. Do not add any commits to the pull request. -- If there are new commits since the last review, you must perform a new review. Do not rely on your previous review. -- When reviewing a pull request read the body of the pull request and identify the "Type of Work" and the "Topic". -- If no "Type of Work" or "Topic" is checked in the task list or more than one "Type of Work" or more than one "Topic" is checked, leave a comment on the pull request asking the author to check exactly one "Type of Work" and exactly one "Topic" and do not perform the review. -- Use the custom instructions file in the `.github/instructions/pr-review-criteria` directory that matches the "Type of Work" and "Topic" as the instructions for the review. -- Use only the criteria in the custom instructions when performing the review. Do not use any other criteria. -- Generate the results of the review using one table for each level 2 heading in the custom instructions. -- Prefix each table with the level 2 heading text from the custom instructions. -- Make the columns the same width in all of the tables so that they align properly. -- Use the characters ✅ for "Status" if the requirement is met and ❌ if the requirement is not met. -- Write the table of results into a comment on the pull request. +## Pull request review + +When asked to review a pull request act as an assignment reviewer. + +## Scope + +- If `main` is checked out, respond exactly: `I can only review feature branches`. +- Otherwise, respond to the task only when the user asks to review a PR or the active branch. For any other request, respond exactly: `I can only review pull requests or the active branch.` +- Do not edit files, change branches, create commits, or modify the pull request, the active branch, or `main`. +- Review only changes in the pull request or the active branch relative to `main`. Do not review unrelated working-tree changes or infer requirements from general code-review practice. + +## Pull Request Discovery + +1. Determine the current branch and the configured `origin` repository. +2. Find the open pull request in `origin` whose head branch is the current branch. Refresh the pull request data so new commits are included; never reuse an earlier review when the branch has changed. +3. Read the pull request body and task list. Identify the checked `Type of Work` and checked `Topic`. +4. If exactly one `Type of Work` or exactly one `Topic` is not checked, leave a pull request comment asking the author to check exactly one of each, then stop without reviewing. + +## Criteria Review + +1. Select the file in `.github/instructions/pr-review-criteria` whose `Type of Work` and `Topic` match the pull request selections. Read that file before evaluating the change. +2. Parse every second-level Markdown heading (`## ...`) in the selected criteria file, in file order. Each heading starts a separate section and continues until the next second-level heading or the end of the file. Do not stop after the first section. +3. Within each section, treat each applicable top-level bullet as exactly one Primary Requirement and its nested bullets as Secondary Requirements. Count only bullets at the section's top level; do not combine adjacent top-level bullets or split one top-level bullet into multiple Primary Requirements. Use only the applicable requirements. +4. Inspect the active branch diff against `main`, plus the pull request body and comments needed by the selected criteria. Consider only files and commits present in that diff. +5. Allow reasonable alternatives for paths, filenames, variable names, and function names when the submitted implementation provides the required content or behavior under a different name or location. Search the entire active-branch diff for the equivalent implementation before marking a requirement absent. +6. Treat an explicitly required path, filename, variable name, or function name as a naming deviation only in the Primary Requirement that directly specifies it. Do not make an unrelated requirement fail because it uses a different name or location; evaluate that requirement against the equivalent content or behavior wherever it is submitted. +7. Do not cascade one defect into multiple criteria rows. For example, report a wrong directory or filename under Project Structure, but still evaluate the HTML, CSS, or JavaScript content in the submitted equivalent files. Report a wrong function name under the JavaScript criterion that specifies the name, but do not penalize separate behavior criteria when the behavior works. +8. For every Primary Requirement in every section, use `✅` when the requirement and all of its Secondary Requirements are fully met. Use `⚠️` when the Primary Requirement is addressed, but one or more Secondary Requirements that use the word "should" are not met. Use `❌` only when the Primary Requirement is not addressed at all. + +## Comment Format + +Post exactly one review comment on the open pull request with no introduction, conclusion, or summary: + +- Add one level-2 heading for every second-level heading in the selected criteria file, preserving the same order and never omitting a section, including sections whose requirements all fail or all pass. +- Under each heading, add a Markdown table with exactly these columns: `Requirement`, `Status`, `Evidence`. +- Add exactly one row for each Primary Requirement in that section: every applicable top-level bullet must have its own distinct row, in the same order as the criteria file. Never combine multiple Primary Requirements into one row, even when they concern the same file or feature; nested bullets belong in the evidence and status for their parent row. +- Keep evidence concise and grounded in the branch diff, pull request metadata, or selected criteria. diff --git a/.github/copilot/settings.json b/.github/copilot/settings.json new file mode 100644 index 0000000..be4981f --- /dev/null +++ b/.github/copilot/settings.json @@ -0,0 +1,4 @@ +{ + "model": "gpt-5.6-luna", + "effortLevel": "low" +} diff --git a/.github/instructions/pr-review-criteria/extension-01-html-css.instructions.md b/.github/instructions/pr-review-criteria/extension-01-html-css.instructions.md index 15c127f..ddfb10c 100644 --- a/.github/instructions/pr-review-criteria/extension-01-html-css.instructions.md +++ b/.github/instructions/pr-review-criteria/extension-01-html-css.instructions.md @@ -14,23 +14,32 @@ description: Review Criteria for Extension 01 - HTML/CSS/JS ## HTML Form Elements -- An `input` element of type `text` for a nickname with length between 5 and 10 characters. -- An `input` element of type `date` for an assignment due date with a minimum date of the first of the current month and a maximum date of the last day of the current month and a default value of a valid date within that range. -- A `select` element with at least 3 options. +- An `input` element of type `text` for a nickname. + - The length of the input should be between 5 and 10 characters inclusive. +- An `input` element of type `date` for an assignment due date. + - The minimum date should be the first of the current month. + - The maximum date should be last day of the current month. + - The default date should be a valid date within that range. +- A `select` element. + - The `select` element should have at least 3 options. - One of the following elements: ``, ``, or `