diff --git a/.gitignore b/.gitignore index ddda1de2c..80c749109 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,8 @@ yarn-debug.log* /app/assets/builds/* !/app/assets/builds/.keep -spec/examples.txt \ No newline at end of file +spec/examples.txt + +# AI tooling artifacts +.playwright-cli/ +review-screenshots/ diff --git a/.windsurf/skills/login-to-core/SKILL.md b/.windsurf/skills/login-to-core/SKILL.md new file mode 100644 index 000000000..00da726b0 --- /dev/null +++ b/.windsurf/skills/login-to-core/SKILL.md @@ -0,0 +1,9 @@ +--- +name: login-to-core +description: Log in to CORE local using playwright +--- + +Check playwright-cli --help for available commands. +Navigate to http://localhost:3000. +Username is 'support@example.com' +Password is stored inside .env.template as REVIEW_APP_USER_PASSWORD diff --git a/.windsurf/workflows/fix-tests.md b/.windsurf/workflows/fix-tests.md new file mode 100644 index 000000000..e924280ba --- /dev/null +++ b/.windsurf/workflows/fix-tests.md @@ -0,0 +1,11 @@ +--- +auto_execution_mode: 0 +description: Fix failing tests +--- +For doing markups of PRs after they've been reviewed: +1. Use GitHub MCP to find the PR and the status of the last run +2. Start by summarising each test fail, grouping them by test fails that seem to be from the same root cause +3. Wait for me to provide any guidance +4. Then, go through each test fail group one by one, and suggest a fix for the test passing. Provide some example code if possible. +5. If I say yes, make the change, if I say no, move on to the next test fail. +6. Do this until all test fails are resolved \ No newline at end of file diff --git a/.windsurf/workflows/pr-comments.md b/.windsurf/workflows/pr-comments.md new file mode 100644 index 000000000..91da768b4 --- /dev/null +++ b/.windsurf/workflows/pr-comments.md @@ -0,0 +1,11 @@ +--- +auto_execution_mode: 0 +description: Respond to PR comments +--- +For doing markups of PRs after they've been reviewed: +1. Use GitHub MCP to find the PR and the PR reviews - this should be ones since the last commit +2. Start by summarising each comment, categorising them into "Small Nitpick", "Bug catch", "Large Refactor" +3. Wait for me to provide any guidance +4. Then, go through each comment one by one, asking me if I want to make this change. +5. If I say yes, make the change, if I say no, move on to the next comment. +6. Do this until all comments are done \ No newline at end of file diff --git a/.windsurf/workflows/raise-pull-request.md b/.windsurf/workflows/raise-pull-request.md new file mode 100644 index 000000000..5ebd2b836 --- /dev/null +++ b/.windsurf/workflows/raise-pull-request.md @@ -0,0 +1,13 @@ +--- +auto_execution_mode: 0 +description: Raise a pull request for this branch +--- +You are a senior software engineer performing raising a pull request for this branch + +You need to: +1. Figure out the ticket number you're working on, this will be in the branch name +2. Create a pull request for this branch on Github +3. The title of the pull request should be based on the ticket number and other pull requests +4. The description should be a summary of the changes, use git diff on main to get the changes. +5. Follow the description of other PRs raised by me. Copy my writing style. +6. Assign the pull request to me. Don't add reviewers. \ No newline at end of file diff --git a/.windsurf/workflows/take-screenshots.md b/.windsurf/workflows/take-screenshots.md new file mode 100644 index 000000000..4265219a5 --- /dev/null +++ b/.windsurf/workflows/take-screenshots.md @@ -0,0 +1,14 @@ +--- +auto_execution_mode: 0 +description: Take screenshots of what I changed and save them to review-screenshots +--- + +Check playwright-cli --help for available commands. +Check the git diff to see what changed. +Figure out what pages could have changed. +Take screenshots of those pages. A server will be running at http://localhost:3000/. +Ensure the question text, any error text and the submit button are all visible. +Save the screenshots to the review-screenshots folder. +Present them to me for review. Present all at once with links to the screenshots. +When presenting use `code` to show me the screenshot. +After I've confirmed them all, run ./clear-review-screenshots.sh. This is a dangerous command. \ No newline at end of file diff --git a/clear-review-screenshots.sh b/clear-review-screenshots.sh new file mode 100755 index 000000000..e18ce2d90 --- /dev/null +++ b/clear-review-screenshots.sh @@ -0,0 +1,2 @@ +rm -r review-screenshots +rm -r .playwright-cli \ No newline at end of file diff --git a/docs/windsurf.md b/docs/windsurf.md new file mode 100644 index 000000000..26c54242a --- /dev/null +++ b/docs/windsurf.md @@ -0,0 +1,64 @@ +--- +nav_order: 16 +--- + +# Windsurf + +Windsurf is a tool that allows you to generate code based on your existing codebase. + +When prompted by you, it can run what it calls 'workflows', which are scripts that you feed into the LLM to perform useful tasks for you. + +It can also draw on 'skills', which are small scripts that perform specific tasks. The difference is that skills are run automatically by the LLM when it deems it appropriate. + +It's good to have open as a second window to call on if needed. Rubymine is (for now) the primary IDE for development. + +## Setup + +1. Install Windsurf +2. Open the repository in Windsurf +3. To see what workflows have been added, look inside the .windsurf/workflows directory. +4. To see what skills have been added, look inside the .windsurf/skills directory. +5. When it's time to complete a task for a workflow, give it a run by starting by typing "/workflow-name" into the Cascade window. + +## Workflow specific setup +### GitHub MCP +Allows workflows to view the GitHub repository to see state of pull requests and pipeline runs. + +To setup, access your MCP config file and add the following: + +```json +{ + "mcpServers": { + "github-mcp-server": { + "args": [ + "run", + "-i", + "--rm", + "-e", + "GITHUB_TOOLSETS=default,actions", + "-e", + "GITHUB_PERSONAL_ACCESS_TOKEN=", + "ghcr.io/github/github-mcp-server" + ], + "disabled": false, + "command": "docker" + } + } +} +``` + +For the PAT token, recommended scopes are repo:* and workflow. + +### Playwright + +Screenshot pipelines need playwright-cli. Install playwright cli globally like so: + +```bash +npm install -g @playwright/cli@latest +``` + +See more: https://github.com/microsoft/playwright-cli. + +You may want to add playwright-cli * to the Windsurf allowlist so it can run commands automatically. + +Right now the script tells the LLM that a server is already running on port 3000. Make sure this is true before running the script with the changes you want screenshots of. \ No newline at end of file