diff --git a/.agents/skills/pr-description/SKILL.md b/.agents/skills/pr-description/SKILL.md index f9b0fac9c..c6486c782 100644 --- a/.agents/skills/pr-description/SKILL.md +++ b/.agents/skills/pr-description/SKILL.md @@ -62,6 +62,16 @@ Write 1-3 concise sentences explaining the reason for the change. Tie it to the Name affected screens, flows, platforms, users, modules, or developer workflows. Use a short sentence or compact bullets. If impact is unclear, leave a placeholder comment instead of guessing. +### Risk Classification + +Add the appropriate `risk:*` label when the PR is opened. If the label is unknown, escalate instead of guessing. + +- `risk:low` for config, copy, or minor UI tweaks with low blast radius. +- `risk:medium` for feature work or refactors touching multiple files. +- `risk:high` for auth, payments, migrations, or security-sensitive code. + +If the branch or user request does not make the risk obvious, leave the template placeholder and call out the uncertainty in Notes. + ### How did you test this? List commands run and manual checks performed. Keep the existing checklist from the template and check only items that are supported by evidence or explicitly provided by the user. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a0878d3de..bfe6fc5da 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -35,6 +35,25 @@ _**Why** did you make these changes? This is your opportunity to provide the rat _Does your code affect something downstream? Are there side effects people should know about? Tag any developers that should be kept abreast of this change._ --> +--- + +### Layer 2: Risk Classification + +Author applies a risk label when opening the PR. When in doubt, escalate. + +| Label | When to use | +| --- | --- | +| `risk:low` | Config, copy, minor UI tweaks. Low blast radius. | +| `risk:medium` | Feature work, refactors touching multiple files. | +| `risk:high` | Auth, payments, migrations, security-sensitive code. | + +**Setup** + +- [ ] Create `risk:low`, `risk:medium`, `risk:high` labels in the repo +- [ ] Add risk criteria to contributing guide or PR template +- [ ] Add reminder in PR template to apply the label before requesting review +- [ ] Define who can override/escalate (suggested: tech lead) + ## How did you test this? ## 💎 Libraries used diff --git a/cli/index.js b/cli/index.js index 2d3bd1d36..35f2bc4c0 100755 --- a/cli/index.js +++ b/cli/index.js @@ -3,7 +3,11 @@ const { consola } = require('consola'); const { showMoreDetails } = require('./utils.js'); const { cloneLatestTemplateRelease } = require('./clone-repo.js'); -const { setupProject, installDependencies } = require('./setup-project.js'); +const { + setupProject, + installDependencies, + installPushgate, +} = require('./setup-project.js'); const pkg = require('./package.json'); const { name: packageName } = pkg; @@ -27,6 +31,9 @@ const createRootstrapApp = async () => { // install project dependencies using pnpm await installDependencies(projectName); + // install Pushgate hook (best-effort) + await installPushgate(projectName); + // show instructions to run the project + link to the documentation showMoreDetails(projectName); }; diff --git a/cli/setup-project.js b/cli/setup-project.js index cbde3776b..5cc0c70f0 100755 --- a/cli/setup-project.js +++ b/cli/setup-project.js @@ -1,8 +1,6 @@ const { execShellCommand, runCommand, - UPSTREAM_REPOSITORY, - TEMPLATE_REPOSITORY, } = require('./utils.js'); const { consola } = require('consola'); const fs = require('fs-extra'); @@ -25,6 +23,20 @@ const installDependencies = async (projectName) => { }); }; +const installPushgate = async (projectName) => { + consola.start('Installing Pushgate pre-push hook'); + try { + await execShellCommand( + `cd ${projectName} && curl -fsSL https://raw.githubusercontent.com/rootstrap/ai-pushgate/main/install.sh | bash` + ); + consola.success('Pushgate pre-push hook installed'); + } catch (error) { + consola.warn( + 'Could not auto-install Pushgate. Run installer manually from the project root.' + ); + } +}; + const removeUnrelatedFiles = () => { projectFilesManager.removeFiles([ '.git', @@ -227,4 +239,5 @@ const setupProject = async (projectName) => { module.exports = { setupProject, installDependencies, + installPushgate, };