Skip to content

Commit 17cb774

Browse files
authored
Merge pull request #7 from LLM-Coding/feature/tier1-tier2-mitigations
chore: Tier 1+2 mitigations — ESLint, Prettier, Hooks, CI, CodeQL
2 parents 44d32e1 + b229d2a commit 17cb774

16 files changed

Lines changed: 2383 additions & 210 deletions

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-and-build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
cache: npm
19+
20+
- run: npm ci
21+
22+
- name: Lint
23+
run: npx eslint src/
24+
25+
- name: Format check
26+
run: npx prettier --check src/
27+
28+
- name: Dependency audit
29+
run: npm audit --audit-level=high
30+
31+
- name: Build
32+
run: npm run build

.github/workflows/codeql.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 6 * * 1"
10+
11+
jobs:
12+
analyze:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
strategy:
17+
matrix:
18+
language: [javascript]
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Initialize CodeQL
23+
uses: github/codeql-action/init@v3
24+
with:
25+
languages: ${{ matrix.language }}
26+
27+
- name: Autobuild
28+
uses: github/codeql-action/autobuild@v3
29+
30+
- name: Perform CodeQL Analysis
31+
uses: github/codeql-action/analyze@v3

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"printWidth": 120,
6+
"tabWidth": 2
7+
}

CLAUDE.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm run preview # Preview production build locally
1212
npm run docs # Render AsciiDoc docs with Asciidoctor
1313
```
1414

15-
No test framework is configured. No linter is configured.
15+
No test framework is configured. ESLint + Prettier are configured (see `eslint.config.js`, `.prettierrc`). Pre-commit hooks via husky + lint-staged.
1616

1717
## Architecture
1818

@@ -48,26 +48,30 @@ GitHub Actions workflow (`.github/workflows/deploy.yml`) builds the React app an
4848
_Generated by `/risk-assess` on 2026-02-11_
4949

5050
### Module: vibe-coding-risk-radar
51-
| Dimension | Score | Level | Evidence |
52-
|-----------|-------|-------|----------|
53-
| Code Type | 0 | UI / CSS / Docs | Only .jsx components, .css styling, .js config — no auth, API, or DB code |
54-
| Language | 2 | Dynamically typed | 5 .jsx + 4 .js files (JavaScript) |
55-
| Deployment | 2 | Public-facing app | Static site on GitHub Pages, publicly accessible |
56-
| Data Sensitivity | 0 | Public data | No real data processing, PII/PHI mentions only in documentation text |
57-
| Blast Radius | 0 | Cosmetic / Tech debt | Static visualization tool, no data storage or user accounts |
51+
52+
| Dimension | Score | Level | Evidence |
53+
| ---------------- | ----- | -------------------- | ------------------------------------------------------------------------- |
54+
| Code Type | 0 | UI / CSS / Docs | Only .jsx components, .css styling, .js config — no auth, API, or DB code |
55+
| Language | 2 | Dynamically typed | 5 .jsx + 4 .js files (JavaScript) |
56+
| Deployment | 2 | Public-facing app | Static site on GitHub Pages, publicly accessible |
57+
| Data Sensitivity | 0 | Public data | No real data processing, PII/PHI mentions only in documentation text |
58+
| Blast Radius | 0 | Cosmetic / Tech debt | Static visualization tool, no data storage or user accounts |
5859

5960
**Tier: 2 — Moderat** (determined by Language = 2 and Deployment = 2)
6061

6162
### Mitigations: vibe-coding-risk-radar (Tier 2)
62-
| Measure | Status | Details |
63-
|---------|--------|---------|
64-
| Linter & Formatter | ❌ Missing | No .eslintrc, .prettierrc, or lint script |
65-
| Type Checking | ❌ Missing | No tsconfig.json (plain JS, not TS) |
66-
| Pre-Commit Hooks | ❌ Missing | No .husky/, no .pre-commit-config.yaml |
67-
| Dependency Check | ❌ Missing | No audit step in CI |
68-
| CI Build & Unit Tests | ⚠️ Partial | CI builds (deploy.yml) but no test framework configured |
69-
| SAST (Semgrep/CodeQL) | ❌ Missing | No SAST in CI workflows |
70-
| AI Code Review | ✅ Present | claude-code-review.yml workflow |
71-
| Property-Based Tests | ❌ Missing | No test framework at all |
72-
| SonarQube Quality Gate | ❌ Missing | No sonar-project.properties |
73-
| Sampling Review | ❌ Missing | No branch protection / review requirement |
63+
64+
_Updated by `/risk-mitigate` on 2026-02-11_
65+
66+
| Measure | Status | Details |
67+
| ---------------------- | ---------- | ---------------------------------------------------- |
68+
| Linter & Formatter | ✅ Set up | eslint.config.js + .prettierrc |
69+
| Type Checking | ⬜ N/A | Plain JS project, no TypeScript |
70+
| Pre-Commit Hooks | ✅ Set up | husky + lint-staged (eslint --fix, prettier --write) |
71+
| Dependency Check | ✅ Set up | npm audit --audit-level=high in ci.yml |
72+
| CI Build & Unit Tests | ✅ Set up | ci.yml: lint, format check, audit, build |
73+
| SAST (CodeQL) | ✅ Set up | codeql.yml: weekly + on push/PR |
74+
| AI Code Review | ✅ Present | claude-code-review.yml |
75+
| Property-Based Tests | ⬜ Pending | No test framework configured |
76+
| SonarQube Quality Gate | ⬜ Pending | Needs SonarCloud account |
77+
| Sampling Review | ⬜ Pending | No branch protection configured |

eslint.config.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import reactHooks from "eslint-plugin-react-hooks";
4+
import reactRefresh from "eslint-plugin-react-refresh";
5+
import prettier from "eslint-config-prettier";
6+
7+
export default [
8+
{ ignores: ["dist/"] },
9+
js.configs.recommended,
10+
{
11+
files: ["**/*.{js,jsx}"],
12+
languageOptions: {
13+
ecmaVersion: 2024,
14+
sourceType: "module",
15+
globals: { ...globals.browser },
16+
parserOptions: { ecmaFeatures: { jsx: true } },
17+
},
18+
plugins: {
19+
"react-hooks": reactHooks,
20+
"react-refresh": reactRefresh,
21+
},
22+
rules: {
23+
...reactHooks.configs.recommended.rules,
24+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
25+
"no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^[A-Z]" }],
26+
},
27+
},
28+
prettier,
29+
];

0 commit comments

Comments
 (0)