getaura 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +25 -2
  2. package/dist/index.js +24230 -0
  3. package/dist/index.js.map +1 -0
  4. package/package.json +50 -4
  5. package/templates/README.md +94 -0
  6. package/templates/configs/env-example-header.txt +6 -0
  7. package/templates/configs/eslint.config.mjs +12 -0
  8. package/templates/configs/example.test.ts +21 -0
  9. package/templates/configs/husky-pre-commit +16 -0
  10. package/templates/configs/prettierignore +18 -0
  11. package/templates/configs/prettierrc.json +3 -0
  12. package/templates/configs/security-headers.md +41 -0
  13. package/templates/configs/vitest.config.ts +19 -0
  14. package/templates/docs/index.md +55 -0
  15. package/templates/github/dependabot.yml +25 -0
  16. package/templates/github/workflows/aura-weekly.yml +55 -0
  17. package/templates/github/workflows/aura.yml +90 -0
  18. package/templates/github/workflows/ci.yml +86 -0
  19. package/templates/guides/add-aura-key-to-github.md +34 -0
  20. package/templates/guides/github-security.md +63 -0
  21. package/templates/guides/install-github-cli.md +50 -0
  22. package/templates/guides/rotate-anthropic-key.md +33 -0
  23. package/templates/guides/rotate-aws-key.md +39 -0
  24. package/templates/guides/rotate-database-key.md +39 -0
  25. package/templates/guides/rotate-generic-key.md +37 -0
  26. package/templates/guides/rotate-github-token.md +36 -0
  27. package/templates/guides/rotate-google-key.md +45 -0
  28. package/templates/guides/rotate-openai-key.md +33 -0
  29. package/templates/guides/rotate-resend-key.md +32 -0
  30. package/templates/guides/rotate-sendgrid-key.md +32 -0
  31. package/templates/guides/rotate-slack-key.md +48 -0
  32. package/templates/guides/rotate-stripe-key.md +41 -0
  33. package/templates/guides/rotate-supabase-key.md +46 -0
  34. package/templates/guides/rotate-vercel-key.md +44 -0
  35. package/templates/guides/transfer-ownership.md +55 -0
  36. package/templates/pr/add-agent-rules.md +16 -0
  37. package/templates/pr/add-aura-workflow.md +18 -0
  38. package/templates/pr/add-brief.md +17 -0
  39. package/templates/pr/add-ci.md +16 -0
  40. package/templates/pr/add-env-example.md +18 -0
  41. package/templates/pr/add-linting.md +16 -0
  42. package/templates/pr/add-pre-commit.md +16 -0
  43. package/templates/pr/add-readme.md +16 -0
  44. package/templates/pr/add-security-headers.md +16 -0
  45. package/templates/pr/enable-dependency-updates.md +16 -0
  46. package/templates/pr/fix-vulnerable-deps.md +19 -0
  47. package/templates/pr/foundation.md +19 -0
  48. package/templates/pr/install-skills.md +18 -0
  49. package/templates/pr/move-misplaced-files.md +18 -0
  50. package/templates/pr/remove-dead-files.md +18 -0
  51. package/templates/pr/setup-testing.md +19 -0
  52. package/templates/pr/token-efficiency.md +18 -0
  53. package/templates/readme/README.md +73 -0
  54. package/templates/rules/agent-rules.md +43 -0
  55. package/templates/skills/aura/SKILL.md +76 -0
  56. package/templates/skills/database-migrations/SKILL.md +92 -0
  57. package/templates/skills/docs-and-readme/SKILL.md +40 -0
  58. package/templates/skills/error-handling/SKILL.md +79 -0
  59. package/templates/skills/folder-structure/SKILL.md +51 -0
  60. package/templates/skills/pre-launch-checklist/SKILL.md +60 -0
  61. package/templates/skills/secrets-and-env/SKILL.md +52 -0
  62. package/templates/skills/secure-api-routes/SKILL.md +92 -0
  63. package/templates/skills/writing-tests/SKILL.md +77 -0
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "getaura",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Aura helps you and your coding agent follow best practices while you vibe code.",
5
+ "type": "module",
6
+ "bin": {
7
+ "aura": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "templates",
12
+ "README.md"
13
+ ],
14
+ "engines": {
15
+ "node": ">=22"
16
+ },
17
+ "license": "UNLICENSED",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/JohnFazio1/aura.git"
21
+ },
22
+ "keywords": [
23
+ "vibe coding",
24
+ "claude code",
25
+ "codex",
26
+ "cursor",
27
+ "pi",
28
+ "best practices",
29
+ "security",
30
+ "cli"
31
+ ],
32
+ "scripts": {
33
+ "build": "tsup",
34
+ "dev": "tsup --watch",
35
+ "typecheck": "tsc -p .",
36
+ "test": "vitest run"
37
+ },
38
+ "dependencies": {
39
+ "@clack/prompts": "^1.8.1",
40
+ "commander": "^15.0.0",
41
+ "picocolors": "^1.1.1",
42
+ "yaml": "^2.9.1"
43
+ },
44
+ "devDependencies": {
45
+ "@getaura/shared": "workspace:*",
46
+ "@types/node": "^26.6.5",
47
+ "tsup": "^8.5.1",
48
+ "typescript": "^7.0.2",
49
+ "vitest": "^5.0.3",
50
+ "zod": "^4.6.5"
51
+ }
52
+ }
@@ -0,0 +1,94 @@
1
+ # Aura templates
2
+
3
+ Files the Aura CLI copies into a user's repository, usually through a pull request. Each file is plain text with `{{name}}` placeholders that the CLI fills in.
4
+
5
+ ## Placeholder rules
6
+
7
+ - The CLI replaces a placeholder only when its name is in the list below. Use a regex like `/\{\{([a-z_]+)\}\}/g` and leave any match whose name isn't known untouched.
8
+ - This keeps GitHub Actions expressions such as `${{ github.base_ref }}` and `${{ secrets.AURA_PILOT_KEY }}` intact. Those always have a space after `{{` and contain dots, so they never match, but the known-names rule is what guarantees it.
9
+ - A known placeholder with no value is replaced with an empty string.
10
+ - Values are inserted as-is (no escaping). List values are complete markdown bullet lists.
11
+ - Skills (`skills/`) and guides (`guides/`) contain no placeholders and are copied verbatim.
12
+
13
+ ## Placeholders
14
+
15
+ | Name | Meaning | Example |
16
+ | --- | --- | --- |
17
+ | `{{product_name}}` | Product name from the brief | `Tidy Invoices` |
18
+ | `{{product_summary}}` | 2–3 sentences from the brief | `Tidy Invoices helps freelancers…` |
19
+ | `{{stack_list}}` | Markdown bullet list of the detected stack | `- Next.js 16 (App Router)` |
20
+ | `{{package_manager}}` | `npm`, `pnpm`, `yarn` or `bun` | `pnpm` |
21
+ | `{{run}}` | Prefix to run a package.json script. Must be `bun run` for Bun (`bun test` runs Bun's own test runner, not the script) | `npm run`, `pnpm`, `yarn`, `bun run` |
22
+ | `{{install_cmd}}` | Clean, lockfile-respecting install | `npm ci`, `pnpm install --frozen-lockfile`, `yarn install --immutable` (Berry) or `yarn install --frozen-lockfile` (v1), `bun install --frozen-lockfile` |
23
+ | `{{commands_list}}` | Markdown bullet list of dev, test, lint and build commands | ``- `pnpm dev`: start the dev server`` |
24
+ | `{{skills_list}}` | Markdown bullet list of installed skills, one line each | ``- `writing-tests`: add tests for every new feature`` |
25
+ | `{{skills_dir}}` | Where skills are installed | `.claude/skills` or `.agents/skills` |
26
+ | `{{node_version}}` | Node.js major version for CI | `22` |
27
+ | `{{env_vars_list}}` | Markdown bullet list of env vars with a short description, never values | ``- `STRIPE_SECRET_KEY`: Stripe API key (server only)`` |
28
+ | `{{date}}` | Date of generation, ISO format | `2026-10-09` |
29
+ | `{{aura_version}}` | Aura CLI version | `0.1.0` |
30
+ | `{{setup_node_cache}}` | `cache` value for actions/setup-node: the package manager for npm, pnpm and yarn; empty for Bun (setup-node can't cache Bun) | `pnpm` |
31
+ | `{{dependabot_ecosystem}}` | Dependabot ecosystem: `bun` for Bun projects, `npm` for npm, pnpm and yarn | `npm` |
32
+ | `{{src_alias_path}}` | Folder the `@/` import alias points to, relative to the project root | `.` or `src` |
33
+ | `{{details}}` | Generated markdown for a PR body (files deleted, packages upgraded, skills installed, changes bundled). Empty string when there's nothing to list | `- Deleted \`lib/old-utils.ts\`` |
34
+
35
+ ## Files
36
+
37
+ ### Skills (`skills/<name>/SKILL.md`)
38
+
39
+ Agent Skills format: YAML frontmatter with `name` (matches the folder) and `description` (when to use it), then instructions. Installed into `.claude/skills/` (Claude Code) and `.agents/skills/` (Codex, Cursor, Pi).
40
+
41
+ | Skill | Use |
42
+ | --- | --- |
43
+ | `aura` | Running Aura, reading its JSON, explaining findings, completing task files |
44
+ | `writing-tests` | Vitest unit tests, route handlers, server actions, Playwright |
45
+ | `secure-api-routes` | Auth, ownership checks, zod validation, webhooks, rate limits, `aura-ignore: public` |
46
+ | `database-migrations` | Supabase migrations, row level security, indexes, policy tests |
47
+ | `secrets-and-env` | `process.env`, `NEXT_PUBLIC_` rules, `.env.example`, leaks |
48
+ | `error-handling` | Error, loading, empty and not-found states; safe logging |
49
+ | `docs-and-readme` | Keeping README, `docs/index.md` and `.aura/brief.md` current |
50
+ | `folder-structure` | Target layout for Next.js App Router and Supabase |
51
+ | `pre-launch-checklist` | Checks before going live |
52
+
53
+ ### Agent rules
54
+
55
+ - `rules/agent-rules.md`: body written into `CLAUDE.md`, `AGENTS.md` or `.cursor/rules/aura.mdc`. The CLI wraps it in `<!-- aura:start -->` / `<!-- aura:end -->` and adds the `.mdc` frontmatter for Cursor. Uses `##` headings so it fits inside an existing file.
56
+
57
+ ### Docs and README
58
+
59
+ - `docs/index.md`: `docs/index.md` in the user's repo, the first file agents read.
60
+ - `readme/README.md`: `README.md` for the `add-readme` action.
61
+
62
+ ### GitHub (`github/`)
63
+
64
+ - `github/workflows/ci.yml` → `.github/workflows/ci.yml` (`add-ci`). Lint, test, build, typecheck; skips missing scripts. Sets up pnpm or Bun when their lockfile exists. For pnpm without a `packageManager` field in package.json it installs pnpm 10.
65
+ - `github/workflows/aura.yml` → `.github/workflows/aura.yml` (`add-aura-workflow`). PR scan with sticky comment; fails when the score drops.
66
+ - `github/workflows/aura-weekly.yml` → `.github/workflows/aura-weekly.yml` (`add-aura-workflow`). Monday 13:00 UTC summary issue.
67
+ - `github/dependabot.yml` → `.github/dependabot.yml` (`enable-dependency-updates`).
68
+
69
+ ### Configs (`configs/`)
70
+
71
+ | File | Destination | Action |
72
+ | --- | --- | --- |
73
+ | `eslint.config.mjs` | `eslint.config.mjs` (needs `eslint` 9+ and `eslint-config-next` 16+) | `add-linting` |
74
+ | `prettierrc.json` | `.prettierrc.json` | `add-linting` |
75
+ | `prettierignore` | `.prettierignore` | `add-linting` |
76
+ | `vitest.config.ts` | `vitest.config.ts` | `setup-testing` |
77
+ | `example.test.ts` | `lib/example.test.ts` or `src/lib/example.test.ts` | `setup-testing` |
78
+ | `husky-pre-commit` | `.husky/pre-commit` (Husky 9; make it executable) | `add-pre-commit` |
79
+ | `security-headers.md` | Not copied. Snippet the CLI or agent merges into `next.config` | `add-security-headers` |
80
+ | `env-example-header.txt` | Top of `.env.example` | `add-env-example` |
81
+
82
+ ### Guides (`guides/<topic>.md`)
83
+
84
+ Printed by `aura guide <topic>`. Frontmatter: `title`, `summary` (one sentence), `services` (array). Body: numbered steps and a "Check it worked" section.
85
+
86
+ Topics: `rotate-stripe-key`, `rotate-supabase-key`, `rotate-openai-key`, `rotate-anthropic-key`, `rotate-github-token`, `rotate-aws-key`, `rotate-google-key`, `rotate-vercel-key`, `rotate-resend-key`, `rotate-sendgrid-key`, `rotate-slack-key`, `rotate-database-key`, `rotate-generic-key`, `github-security`, `transfer-ownership`, `install-github-cli`, `add-aura-key-to-github`.
87
+
88
+ Mapping from secret service ids to guides: `github` → `rotate-github-token`; `database` → `rotate-database-key`; services without their own guide (`twilio`, `aura`, `generic`, anything new) → `rotate-generic-key`; every other service → `rotate-<service>-key`.
89
+
90
+ ### PR bodies (`pr/<action>.md`)
91
+
92
+ One per PR action id: `add-brief`, `add-agent-rules`, `install-skills`, `token-efficiency`, `add-ci`, `setup-testing`, `add-env-example`, `add-linting`, `add-pre-commit`, `add-readme`, `enable-dependency-updates`, `fix-vulnerable-deps`, `add-security-headers`, `remove-dead-files`, `move-misplaced-files`, `add-aura-workflow`, `foundation`.
93
+
94
+ Sections: "What this does", "Why it matters", "What to check before merging", then the footer `Opened by [Aura](https://github.com/JohnFazio1/aura) · {{aura_version}}`. The PR title is set by the CLI. `{{details}}` appears in `install-skills`, `token-efficiency`, `setup-testing`, `add-env-example`, `fix-vulnerable-deps`, `remove-dead-files`, `move-misplaced-files` and `foundation`.
@@ -0,0 +1,6 @@
1
+ # Environment variables for this app.
2
+ # Copy this file to .env.local and fill in the values. Never commit .env.local.
3
+ # Each variable has a comment saying what it's for and where to get it.
4
+ # Variables starting with NEXT_PUBLIC_ are visible in the browser: never put secrets in them.
5
+ # When you add a variable, add it here (name and comment, no value) and in Vercel
6
+ # (Project → Settings → Environment Variables).
@@ -0,0 +1,12 @@
1
+ // ESLint flat config for Next.js (eslint-config-next 16 or later, ESLint 9 or later).
2
+ import { defineConfig, globalIgnores } from "eslint/config";
3
+ import nextVitals from "eslint-config-next/core-web-vitals";
4
+ import nextTs from "eslint-config-next/typescript";
5
+
6
+ const eslintConfig = defineConfig([
7
+ ...nextVitals,
8
+ ...nextTs,
9
+ globalIgnores([".next/**", "out/**", "build/**", "coverage/**", "next-env.d.ts"]),
10
+ ]);
11
+
12
+ export default eslintConfig;
@@ -0,0 +1,21 @@
1
+ import { describe, expect, it } from "vitest";
2
+
3
+ // A small example to show the shape of a test. Replace it with tests for your own code,
4
+ // for example by importing a function from "@/lib/..." instead of defining one here.
5
+ function slugify(text: string): string {
6
+ return text
7
+ .toLowerCase()
8
+ .trim()
9
+ .replace(/[^a-z0-9]+/g, "-")
10
+ .replace(/^-+|-+$/g, "");
11
+ }
12
+
13
+ describe("slugify", () => {
14
+ it("turns a title into a URL-friendly slug", () => {
15
+ expect(slugify("Hello, World!")).toBe("hello-world");
16
+ });
17
+
18
+ it("returns an empty string for text with no letters or numbers", () => {
19
+ expect(slugify(" !! ")).toBe("");
20
+ });
21
+ });
@@ -0,0 +1,16 @@
1
+ # Aura pre-commit hook: blocks commits that contain secrets, then runs lint.
2
+
3
+ # 1. Secret check on staged changes.
4
+ if [ -x node_modules/.bin/aura ] || command -v aura >/dev/null 2>&1; then
5
+ npx --no-install aura check-staged || {
6
+ echo "Aura found a secret in your staged changes. Remove it and read it from an environment variable instead."
7
+ exit 1
8
+ }
9
+ else
10
+ echo "Aura is not installed, so the secret check was skipped. Run {{install_cmd}} to install it."
11
+ fi
12
+
13
+ # 2. Lint, only if package.json has a lint script.
14
+ if node -e "process.exit(require('./package.json').scripts?.lint ? 0 : 1)" 2>/dev/null; then
15
+ {{run}} lint || exit 1
16
+ fi
@@ -0,0 +1,18 @@
1
+ # Build output and dependencies
2
+ .next/
3
+ out/
4
+ build/
5
+ dist/
6
+ coverage/
7
+ node_modules/
8
+
9
+ # Lockfiles and generated files
10
+ package-lock.json
11
+ pnpm-lock.yaml
12
+ yarn.lock
13
+ bun.lock
14
+ next-env.d.ts
15
+
16
+ # Supabase local state and Aura's local files
17
+ supabase/.temp/
18
+ .aura/
@@ -0,0 +1,3 @@
1
+ {
2
+ "printWidth": 100
3
+ }
@@ -0,0 +1,41 @@
1
+ # Security headers for next.config
2
+
3
+ These headers tell browsers to block common attacks: loading your site over plain HTTP, embedding it in another site to trick users into clicking (clickjacking), guessing file types, and leaking full URLs to other sites.
4
+
5
+ Add `headers()` to the existing config in `next.config.ts` (or `next.config.mjs`). If the config already has a `headers()` function, add the entry below to the array it returns instead of creating a second one.
6
+
7
+ ```ts
8
+ import type { NextConfig } from "next";
9
+
10
+ const securityHeaders = [
11
+ // Always use HTTPS for two years. Vercel serves HTTPS by default.
12
+ { key: "Strict-Transport-Security", value: "max-age=63072000" },
13
+ // Don't let browsers guess file types.
14
+ { key: "X-Content-Type-Options", value: "nosniff" },
15
+ // Don't allow other sites to show this app in a frame.
16
+ { key: "X-Frame-Options", value: "DENY" },
17
+ // Send only the origin, not the full URL, to other sites.
18
+ { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" },
19
+ // Turn off browser features the app doesn't use.
20
+ { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=()" },
21
+ ];
22
+
23
+ const nextConfig: NextConfig = {
24
+ // ...keep your existing options here
25
+ async headers() {
26
+ return [{ source: "/:path*", headers: securityHeaders }];
27
+ },
28
+ };
29
+
30
+ export default nextConfig;
31
+ ```
32
+
33
+ ## Before merging
34
+
35
+ - If the app is meant to be embedded in another site (an iframe widget), remove the `X-Frame-Options` line.
36
+ - If the app uses the camera, microphone or location, change that feature's value to `(self)`, for example `camera=(self)`.
37
+ - Once every subdomain of your domain uses HTTPS, you can add `; includeSubDomains` to the `Strict-Transport-Security` value.
38
+
39
+ ## Content Security Policy
40
+
41
+ A Content Security Policy (CSP) is left out on purpose. A strict CSP is the strongest protection against injected scripts, but it often breaks apps that load analytics, payment widgets, fonts or inline scripts. Add it as a separate follow-up, start with `Content-Security-Policy-Report-Only` to see what would break, and test on a preview deployment before enforcing it.
@@ -0,0 +1,19 @@
1
+ import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ import { configDefaults, defineConfig } from "vitest/config";
4
+
5
+ const root = path.dirname(fileURLToPath(import.meta.url));
6
+
7
+ export default defineConfig({
8
+ resolve: {
9
+ alias: {
10
+ // Matches the "@/*" path in tsconfig.json.
11
+ "@": path.resolve(root, "{{src_alias_path}}"),
12
+ },
13
+ },
14
+ test: {
15
+ environment: "node",
16
+ // Playwright end-to-end tests run separately.
17
+ exclude: [...configDefaults.exclude, "e2e/**", "tests/e2e/**", ".next/**"],
18
+ },
19
+ });
@@ -0,0 +1,55 @@
1
+ # {{product_name}} docs
2
+
3
+ Start here. This page points to everything else so you only open the files you need. Keep it short: links and one-line facts. Update it in the same change as the code.
4
+
5
+ ## Key documents
6
+
7
+ - [Product brief](../.aura/brief.md): what we're building, for whom, and what's out of scope. The source of truth.
8
+ - [README](../README.md): setup, commands, environment variables, deployment.
9
+ - Agent rules: `CLAUDE.md` or `AGENTS.md` at the repo root.
10
+
11
+ ## Stack
12
+
13
+ {{stack_list}}
14
+
15
+ ## Where things live
16
+
17
+ <!-- One line per area. Example: "Billing logic: lib/billing.ts. Stripe webhook: app/api/stripe/webhook/route.ts." -->
18
+
19
+ - Routes and pages: `app/`
20
+ - Components: `components/` (`ui/` for generic, one folder per feature)
21
+ - Business logic and integrations: `lib/`
22
+ - Supabase clients: `lib/supabase/`
23
+ - Database migrations: `supabase/migrations/`
24
+ - Tests: next to the code (`*.test.ts`) and `e2e/`
25
+
26
+ ## Architecture notes
27
+
28
+ <!-- Fill in as the project grows. Keep each note to a few lines. -->
29
+
30
+ ### Data model
31
+
32
+ _Main tables and how they relate._
33
+
34
+ ### Auth and permissions
35
+
36
+ _How users sign in, roles, and which tables are shared between users._
37
+
38
+ ### Key flows
39
+
40
+ _The few flows that matter most (sign up, core action, payment) and the files involved._
41
+
42
+ ## Integrations
43
+
44
+ <!-- One line per service: what it's used for, env vars, where the code is. -->
45
+
46
+ | Service | Used for | Env vars | Code |
47
+ | --- | --- | --- | --- |
48
+ | Supabase | Database and auth | see `.env.example` | `lib/supabase/` |
49
+ | Vercel | Hosting | set in the Vercel dashboard | n/a |
50
+
51
+ ## Gotchas
52
+
53
+ <!-- Non-obvious things that cost time. One line each. -->
54
+
55
+ _Last generated by Aura on {{date}}._
@@ -0,0 +1,25 @@
1
+ # Dependabot keeps dependencies up to date with small pull requests.
2
+ # Security updates are separate: turn them on under
3
+ # Settings → Advanced Security → Dependabot security updates.
4
+ version: 2
5
+ updates:
6
+ - package-ecosystem: "{{dependabot_ecosystem}}"
7
+ directory: "/"
8
+ schedule:
9
+ interval: "weekly"
10
+ # Wait a few days before proposing a brand-new release, so a compromised
11
+ # or broken version is usually caught before it reaches you.
12
+ cooldown:
13
+ default-days: 3
14
+ groups:
15
+ minor-and-patch:
16
+ update-types: ["minor", "patch"]
17
+ open-pull-requests-limit: 5
18
+
19
+ - package-ecosystem: "github-actions"
20
+ directory: "/"
21
+ schedule:
22
+ interval: "monthly"
23
+ groups:
24
+ github-actions:
25
+ patterns: ["*"]
@@ -0,0 +1,55 @@
1
+ # Weekly Aura summary: every Monday, opens a GitHub issue with a plain-language
2
+ # summary of the week's merged pull requests and commits, plus the score trend.
3
+ # You can also run it by hand from the Actions tab.
4
+ # Note: GitHub pauses scheduled workflows after 60 days without any repo activity.
5
+ # If summaries stop arriving, re-enable this workflow in the Actions tab.
6
+ name: Aura weekly summary
7
+
8
+ on:
9
+ schedule:
10
+ - cron: "0 13 * * 1" # Mondays at 13:00 UTC
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+ issues: write
16
+ pull-requests: read
17
+
18
+ jobs:
19
+ summary:
20
+ name: Weekly summary
21
+ runs-on: ubuntu-latest
22
+ timeout-minutes: 20
23
+ steps:
24
+ - uses: actions/checkout@v5
25
+ with:
26
+ fetch-depth: 0
27
+
28
+ - name: Choose pnpm version
29
+ id: pnpm
30
+ if: hashFiles('pnpm-lock.yaml') != ''
31
+ run: node -e "const p=require('./package.json');console.log('version='+(p.packageManager?'':'10'))" >> "$GITHUB_OUTPUT"
32
+
33
+ - name: Set up pnpm
34
+ if: hashFiles('pnpm-lock.yaml') != ''
35
+ uses: pnpm/action-setup@v4
36
+ with:
37
+ version: ${{ steps.pnpm.outputs.version }}
38
+
39
+ - name: Set up Bun
40
+ if: hashFiles('bun.lock', 'bun.lockb') != ''
41
+ uses: oven-sh/setup-bun@v2
42
+
43
+ - uses: actions/setup-node@v5
44
+ with:
45
+ node-version: '{{node_version}}'
46
+ cache: '{{setup_node_cache}}'
47
+
48
+ - name: Install dependencies
49
+ run: {{install_cmd}}
50
+
51
+ - name: Post weekly summary
52
+ env:
53
+ AURA_KEY: ${{ secrets.AURA_PILOT_KEY }}
54
+ GH_TOKEN: ${{ github.token }}
55
+ run: npx --yes getaura@{{aura_version}} summary --days 7 --post
@@ -0,0 +1,90 @@
1
+ # Aura score: scans every pull request, compares it with the base branch and
2
+ # posts the result as a comment. The check fails when the score drops more than
3
+ # the allowed amount (ciMaxDrop in .aura/config.json, default 0; loosen it with
4
+ # `aura config ciMaxDrop 3`). Aura's version is pinned so scores only change when
5
+ # your code does; upgrade it deliberately by re-running `aura apply add-aura-workflow`.
6
+ # Needs the AURA_PILOT_KEY repository secret for plain-language explanations
7
+ # (run `aura guide add-aura-key-to-github`). It still scores without it.
8
+ name: Aura score
9
+
10
+ on:
11
+ pull_request:
12
+ push:
13
+ branches: [main]
14
+
15
+ permissions:
16
+ contents: read
17
+ pull-requests: write
18
+
19
+ concurrency:
20
+ group: aura-${{ github.ref }}
21
+ cancel-in-progress: true
22
+
23
+ jobs:
24
+ aura:
25
+ name: Aura score
26
+ runs-on: ubuntu-latest
27
+ timeout-minutes: 20
28
+ steps:
29
+ - uses: actions/checkout@v5
30
+ with:
31
+ fetch-depth: 0
32
+
33
+ - name: Choose pnpm version
34
+ id: pnpm
35
+ if: hashFiles('pnpm-lock.yaml') != ''
36
+ run: node -e "const p=require('./package.json');console.log('version='+(p.packageManager?'':'10'))" >> "$GITHUB_OUTPUT"
37
+
38
+ - name: Set up pnpm
39
+ if: hashFiles('pnpm-lock.yaml') != ''
40
+ uses: pnpm/action-setup@v4
41
+ with:
42
+ version: ${{ steps.pnpm.outputs.version }}
43
+
44
+ - name: Set up Bun
45
+ if: hashFiles('bun.lock', 'bun.lockb') != ''
46
+ uses: oven-sh/setup-bun@v2
47
+
48
+ - uses: actions/setup-node@v5
49
+ with:
50
+ node-version: '{{node_version}}'
51
+ cache: '{{setup_node_cache}}'
52
+
53
+ - name: Install dependencies
54
+ run: {{install_cmd}}
55
+
56
+ - name: Run Aura scan (pull request)
57
+ id: scan
58
+ if: github.event_name == 'pull_request'
59
+ continue-on-error: true
60
+ env:
61
+ AURA_KEY: ${{ secrets.AURA_PILOT_KEY }}
62
+ BASE_REF: ${{ github.base_ref }}
63
+ run: npx --yes getaura@{{aura_version}} scan --ci --base "origin/$BASE_REF" --comment-file aura-comment.md
64
+
65
+ - name: Post Aura comment
66
+ # Runs even when the scan failed. Skipped for forks and Dependabot,
67
+ # whose pull requests can't write comments.
68
+ if: >-
69
+ always()
70
+ && github.event_name == 'pull_request'
71
+ && github.event.pull_request.head.repo.full_name == github.repository
72
+ && github.actor != 'dependabot[bot]'
73
+ && hashFiles('aura-comment.md') != ''
74
+ continue-on-error: true
75
+ env:
76
+ GH_TOKEN: ${{ github.token }}
77
+ PR_NUMBER: ${{ github.event.pull_request.number }}
78
+ run: gh pr comment "$PR_NUMBER" --body-file aura-comment.md --edit-last --create-if-none
79
+
80
+ - name: Fail if the score dropped
81
+ if: github.event_name == 'pull_request' && steps.scan.outcome == 'failure'
82
+ run: |
83
+ echo "The Aura score dropped more than allowed, or the scan failed. See the comment on the pull request."
84
+ exit 1
85
+
86
+ - name: Run Aura scan (main)
87
+ if: github.event_name == 'push'
88
+ env:
89
+ AURA_KEY: ${{ secrets.AURA_PILOT_KEY }}
90
+ run: npx --yes getaura@{{aura_version}} scan --ci
@@ -0,0 +1,86 @@
1
+ # Runs lint, tests, build and type checking on every pull request and on main.
2
+ # Steps whose script doesn't exist in package.json are skipped, not failed.
3
+ # If the build needs environment variables, add them under
4
+ # Settings → Secrets and variables → Actions and map them in the build step's env.
5
+ name: CI
6
+
7
+ on:
8
+ pull_request:
9
+ push:
10
+ branches: [main]
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ concurrency:
16
+ group: ci-${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ checks:
21
+ name: Lint, test, build
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 20
24
+ steps:
25
+ - uses: actions/checkout@v5
26
+
27
+ - name: Choose pnpm version
28
+ id: pnpm
29
+ if: hashFiles('pnpm-lock.yaml') != ''
30
+ # Uses the packageManager field in package.json when present, otherwise pnpm 10.
31
+ run: node -e "const p=require('./package.json');console.log('version='+(p.packageManager?'':'10'))" >> "$GITHUB_OUTPUT"
32
+
33
+ - name: Set up pnpm
34
+ if: hashFiles('pnpm-lock.yaml') != ''
35
+ uses: pnpm/action-setup@v4
36
+ with:
37
+ version: ${{ steps.pnpm.outputs.version }}
38
+
39
+ - name: Set up Bun
40
+ if: hashFiles('bun.lock', 'bun.lockb') != ''
41
+ uses: oven-sh/setup-bun@v2
42
+
43
+ - uses: actions/setup-node@v5
44
+ with:
45
+ node-version: '{{node_version}}'
46
+ cache: '{{setup_node_cache}}'
47
+
48
+ - name: Install dependencies
49
+ run: {{install_cmd}}
50
+
51
+ - name: Lint
52
+ run: |
53
+ if node -e "process.exit(require('./package.json').scripts?.lint ? 0 : 1)"; then
54
+ {{run}} lint
55
+ else
56
+ echo "No lint script in package.json, skipping."
57
+ fi
58
+
59
+ - name: Test
60
+ run: |
61
+ if node -e "process.exit(require('./package.json').scripts?.test ? 0 : 1)"; then
62
+ {{run}} test
63
+ else
64
+ echo "No test script in package.json, skipping."
65
+ fi
66
+
67
+ - name: Build
68
+ run: |
69
+ if node -e "process.exit(require('./package.json').scripts?.build ? 0 : 1)"; then
70
+ {{run}} build
71
+ else
72
+ echo "No build script in package.json, skipping."
73
+ fi
74
+ env:
75
+ NEXT_TELEMETRY_DISABLED: 1
76
+
77
+ # Runs after the build so Next.js has generated next-env.d.ts and route types.
78
+ - name: Typecheck
79
+ run: |
80
+ if node -e "process.exit(require('./package.json').scripts?.typecheck ? 0 : 1)"; then
81
+ {{run}} typecheck
82
+ elif [ -f tsconfig.json ]; then
83
+ npx --no-install tsc --noEmit
84
+ else
85
+ echo "No tsconfig.json, skipping."
86
+ fi
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: Add your Aura key to GitHub
3
+ summary: Store your Aura pilot key as a GitHub Actions secret so pull request checks include plain-language explanations.
4
+ services: [github, aura]
5
+ ---
6
+
7
+ # Add your Aura key to GitHub
8
+
9
+ The Aura workflow scores every pull request. With your pilot key stored as a repository secret, its comments also include plain-language explanations. The key is stored encrypted and never shown in logs.
10
+
11
+ ## Option 1: in the browser
12
+
13
+ 1. Open your repository on GitHub → **Settings → Secrets and variables → Actions**.
14
+ 2. Click **New repository secret**.
15
+ 3. Name: `AURA_PILOT_KEY`
16
+ 4. Secret: paste your Aura pilot key (it starts with `aura_`).
17
+ 5. Click **Add secret**.
18
+
19
+ ## Option 2: in the terminal
20
+
21
+ From your project folder, run:
22
+
23
+ ```bash
24
+ gh secret set AURA_PILOT_KEY
25
+ ```
26
+
27
+ Paste the key when asked and press Enter. Don't put the key in the command itself, so it doesn't end up in your terminal history.
28
+
29
+ ## Check it worked
30
+
31
+ - **Settings → Secrets and variables → Actions** lists `AURA_PILOT_KEY` (the value stays hidden), or `gh secret list` shows it.
32
+ - Open or update a pull request. The **Aura score** comment includes explanations.
33
+
34
+ Pull requests from Dependabot and from forks can't read repository secrets or post comments. The Aura check still runs on them, without a comment. That's expected.