check-post 0.0.0-stage → 0.2.0

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 (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +147 -2
  3. package/dist/cli.js +51 -0
  4. package/dist/commands/init.js +219 -0
  5. package/dist/commands/list.js +50 -0
  6. package/dist/commands/run.js +149 -0
  7. package/dist/commands/shared.js +12 -0
  8. package/dist/commands/status.js +31 -0
  9. package/dist/core/adapters/claude-code.js +145 -0
  10. package/dist/core/adapters/index.js +14 -0
  11. package/dist/core/adapters/types.js +1 -0
  12. package/dist/core/discovery.js +183 -0
  13. package/dist/core/events.js +1 -0
  14. package/dist/core/gate.js +111 -0
  15. package/dist/core/process.js +20 -0
  16. package/dist/core/project.js +67 -0
  17. package/dist/core/runners/ai.js +91 -0
  18. package/dist/core/runners/command.js +48 -0
  19. package/dist/core/scheduler.js +158 -0
  20. package/dist/core/stage-file.js +61 -0
  21. package/dist/core/types.js +64 -0
  22. package/dist/ui/format.js +46 -0
  23. package/dist/ui/plain.js +47 -0
  24. package/dist/ui/tui/App.js +207 -0
  25. package/package.json +67 -4
  26. package/presets/angular/01-lint.md +4 -0
  27. package/presets/angular/02-unit-test.md +4 -0
  28. package/presets/angular/03-build.md +4 -0
  29. package/presets/angular/04-security/01-secrets.md +19 -0
  30. package/presets/angular/04-security/02-xss-audit.md +17 -0
  31. package/presets/angular/04-security/03-env-audit.md +11 -0
  32. package/presets/angular/04-security/04-dependency.md +5 -0
  33. package/presets/angular/04-security/_group.md +4 -0
  34. package/presets/angular/05-code-standard.md +15 -0
  35. package/presets/angular/context.md +2 -0
  36. package/presets/nextjs/01-lint.md +4 -0
  37. package/presets/nextjs/02-unit-test.md +4 -0
  38. package/presets/nextjs/03-build.md +4 -0
  39. package/presets/nextjs/04-security/01-secrets.md +19 -0
  40. package/presets/nextjs/04-security/02-xss-audit.md +16 -0
  41. package/presets/nextjs/04-security/03-env-audit.md +11 -0
  42. package/presets/nextjs/04-security/04-dependency.md +5 -0
  43. package/presets/nextjs/04-security/_group.md +4 -0
  44. package/presets/nextjs/05-code-standard.md +15 -0
  45. package/presets/nextjs/context.md +1 -0
  46. package/presets/node/01-lint.md +4 -0
  47. package/presets/node/02-unit-test.md +4 -0
  48. package/presets/node/03-build.md +4 -0
  49. package/presets/node/04-security/01-secrets.md +19 -0
  50. package/presets/node/04-security/02-injection-audit.md +15 -0
  51. package/presets/node/04-security/03-env-audit.md +11 -0
  52. package/presets/node/04-security/04-dependency.md +5 -0
  53. package/presets/node/04-security/_group.md +4 -0
  54. package/presets/node/05-code-standard.md +15 -0
  55. package/presets/node/context.md +1 -0
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "check-post",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Local CI/CD pipeline whose stages are Markdown files, run by an AI CLI (Claude Code). A green gate means ready to deploy.",
5
+ "keywords": [
6
+ "ci",
7
+ "cd",
8
+ "pipeline",
9
+ "claude",
10
+ "claude-code",
11
+ "ai",
12
+ "security-audit",
13
+ "code-review",
14
+ "cli",
15
+ "markdown"
16
+ ],
17
+ "homepage": "https://github.com/raisulkhairi/check-post#readme",
18
+ "bugs": {
19
+ "url": "https://github.com/raisulkhairi/check-post/issues"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/raisulkhairi/check-post.git"
24
+ },
25
+ "license": "MIT",
26
+ "author": "Raisul khairi",
27
+ "type": "module",
28
+ "bin": {
29
+ "check-post": "dist/cli.js",
30
+ "checkpost": "dist/cli.js"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "presets"
35
+ ],
36
+ "engines": {
37
+ "node": ">=22"
38
+ },
39
+ "scripts": {
40
+ "build": "rm -rf dist && tsc -p tsconfig.json && chmod +x dist/cli.js",
41
+ "dev": "tsx src/cli.tsx",
42
+ "test": "vitest run",
43
+ "prepare": "npm run build",
44
+ "prepublishOnly": "npm test",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit"
46
+ },
47
+ "dependencies": {
48
+ "@inquirer/prompts": "8.8.1",
49
+ "commander": "15.1.0",
50
+ "execa": "10.2.1",
51
+ "gray-matter": "4.0.3",
52
+ "ink": "8.0.0",
53
+ "picocolors": "1.1.1",
54
+ "react": "19.3.1",
55
+ "zod": "4.6.7"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "26.6.6",
59
+ "@types/react": "19.3.0",
60
+ "tsx": "4.23.15",
61
+ "typescript": "7.0.2",
62
+ "vite": "8.3.8",
63
+ "vitest": "5.1.1"
64
+ },
65
+ "publishConfig": {
66
+ "registry": "https://registry.npmjs.org/",
67
+ "access": "public"
68
+ }
69
+ }
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run lint
3
+ timeout: 10m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm test
3
+ timeout: 15m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run build
3
+ timeout: 20m
4
+ ---
@@ -0,0 +1,19 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Secrets & API keys
5
+
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
+
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
+
15
+ Severity:
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -0,0 +1,17 @@
1
+ ---
2
+ paths: ["src/**/*.ts", "src/**/*.html"]
3
+ fail_on: high
4
+ ---
5
+ # XSS audit (Angular)
6
+
7
+ Angular sanitizes automatically, so focus on the gaps that bypass it:
8
+ - `DomSanitizer.bypassSecurityTrustHtml/Url/ResourceUrl/Script/Style` with data that users or an API can control
9
+ - `[innerHTML]`, `[outerHTML]`, `[srcdoc]` bindings with data from users, query params, or an API without clear sanitization
10
+ - Direct DOM manipulation: `ElementRef.nativeElement.innerHTML`, `Renderer2.setProperty(..., 'innerHTML', ...)`, `document.write`, `insertAdjacentHTML`
11
+ - `[href]`/`[src]` built from user input (risk of `javascript:` URLs)
12
+ - `eval`, `new Function`, `setTimeout` with a string
13
+
14
+ Severity:
15
+ - high: data from users/query params/an API flows into one of the sinks above without sanitization
16
+ - medium: the data source is unclear
17
+ - low: static or fully controlled data
@@ -0,0 +1,11 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Environment configuration audit
5
+
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -0,0 +1,5 @@
1
+ ---
2
+ run: npm audit --omit=dev --audit-level=high
3
+ timeout: 5m
4
+ allow_failure: true
5
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ parallel: true
3
+ ---
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -0,0 +1,15 @@
1
+ ---
2
+ fail_on: medium
3
+ ---
4
+ # Code standard
5
+
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
+
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
+
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -0,0 +1,2 @@
1
+ This project is an Angular application (standalone components, TypeScript). Templates live in `*.html`
2
+ files or the `template` property, logic in `*.ts`. Ignore `node_modules/`, `dist/`, `coverage/`, and `.angular/`.
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run lint
3
+ timeout: 10m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm test
3
+ timeout: 15m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run build
3
+ timeout: 20m
4
+ ---
@@ -0,0 +1,19 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Secrets & API keys
5
+
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
+
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
+
15
+ Severity:
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -0,0 +1,16 @@
1
+ ---
2
+ paths: ["src/**/*.{ts,tsx,js,jsx}", "app/**/*.{ts,tsx,js,jsx}", "pages/**/*.{ts,tsx,js,jsx}", "components/**/*.{ts,tsx,js,jsx}"]
3
+ fail_on: high
4
+ ---
5
+ # XSS audit (React/Next.js)
6
+
7
+ Check for:
8
+ - `dangerouslySetInnerHTML` with data from users, query strings, a CMS, or an API without sanitization (e.g. DOMPurify)
9
+ - `href`/`src` built from user input (risk of `javascript:` URLs)
10
+ - `searchParams`/`params` data rendered or used in redirects without validation
11
+ - `eval`, `new Function`, direct `innerHTML` manipulation
12
+
13
+ Severity:
14
+ - high: untrusted data flows into a sink without sanitization
15
+ - medium: the data source is unclear
16
+ - low: static or fully controlled data
@@ -0,0 +1,11 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Environment configuration audit
5
+
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -0,0 +1,5 @@
1
+ ---
2
+ run: npm audit --omit=dev --audit-level=high
3
+ timeout: 5m
4
+ allow_failure: true
5
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ parallel: true
3
+ ---
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -0,0 +1,15 @@
1
+ ---
2
+ fail_on: medium
3
+ ---
4
+ # Code standard
5
+
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
+
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
+
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -0,0 +1 @@
1
+ This project is a Next.js application (React, TypeScript). Ignore `node_modules/`, `.next/`, `out/`, and `coverage/`.
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run lint
3
+ timeout: 10m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm test
3
+ timeout: 15m
4
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ run: npm run build
3
+ timeout: 20m
4
+ ---
@@ -0,0 +1,19 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Secrets & API keys
5
+
6
+ Look for credentials hardcoded in committed source code:
7
+ - API keys, tokens, passwords, private keys, connection strings containing passwords
8
+ - URLs with embedded credentials (`https://user:pass@...`)
9
+ - JWTs or bearer tokens written inline
10
+
11
+ How to work:
12
+ 1. Use Grep with patterns such as `api[_-]?key`, `secret`, `token`, `password`, `Bearer `, `-----BEGIN`, `sk_live`, `AKIA`.
13
+ 2. Read the context of every match to confirm the value is actually secret.
14
+
15
+ Severity:
16
+ - critical: a real secret that looks active
17
+ - high: very likely a real secret
18
+ - low: placeholder or example (e.g. `xxx`, `changeme`, `your-api-key`)
19
+ Ignore test, mock, and fixture files unless the value looks like a real secret.
@@ -0,0 +1,15 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Injection audit
5
+
6
+ Check for:
7
+ - SQL/NoSQL queries built by string concatenation or template literals from request input
8
+ - `child_process.exec`/`execSync` with request input
9
+ - File paths from request input without normalization (path traversal)
10
+ - Endpoints without input validation or without authorization checks on other users' data
11
+
12
+ Severity:
13
+ - critical/high: request input flows into a sink without validation
14
+ - medium: validation exists but is weak
15
+ - low: hardening
@@ -0,0 +1,11 @@
1
+ ---
2
+ fail_on: high
3
+ ---
4
+ # Environment configuration audit
5
+
6
+ Never read the contents of env files or other secret files; work with variable NAMES only.
7
+ Check that:
8
+ 1. Environment config files that hold secrets are listed in `.gitignore`.
9
+ 2. No secret value (key, token, password) is hardcoded as a fallback, e.g. `process.env.X || "real-value"`.
10
+ 3. Variables exposed to the browser (client bundle) contain no secrets.
11
+ 4. If an example file exists (`.env.example` etc.), its variable names match the ones used in code.
@@ -0,0 +1,5 @@
1
+ ---
2
+ run: npm audit --omit=dev --audit-level=high
3
+ timeout: 5m
4
+ allow_failure: true
5
+ ---
@@ -0,0 +1,4 @@
1
+ ---
2
+ parallel: true
3
+ ---
4
+ Focus on security. Report only problems that actually exist in the code, with file and line.
@@ -0,0 +1,15 @@
1
+ ---
2
+ fail_on: medium
3
+ ---
4
+ # Code standard
5
+
6
+ Read the project's convention documents if present (`AGENTS.md`, `CLAUDE.md`, `CONTRIBUTING.md`, `README.md`),
7
+ then check the code in `src/` against those conventions.
8
+
9
+ General rules on top of that:
10
+ - No unnecessary `any` types
11
+ - No leftover `console.log` in production code
12
+ - No large blocks of commented-out code
13
+
14
+ Report at most the 15 most important findings. Use medium for violations of explicitly written conventions,
15
+ low for style suggestions.
@@ -0,0 +1 @@
1
+ This project is a Node.js application/API. Ignore `node_modules/`, `dist/`, `build/`, and `coverage/`.