@bookedsolid/reagent 0.6.0 → 0.7.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.
- package/agents/ai-platforms/ai-deepseek-specialist.md +83 -0
- package/agents/ai-platforms/ai-elevenlabs-specialist.md +75 -0
- package/agents/ai-platforms/ai-grok-specialist.md +71 -0
- package/agents/ai-platforms/ai-local-llm-specialist.md +95 -0
- package/agents/ai-platforms/ai-video-ai-specialist.md +103 -0
- package/agents/engineering/cto-advisory.md +44 -0
- package/agents/engineering/qa-engineer-automation.md +77 -0
- package/agents/engineering/qa-engineer-manual.md +48 -0
- package/agents/engineering/qa-lead.md +124 -0
- package/agents/engineering/security-engineer-appsec.md +47 -0
- package/agents/engineering/security-engineer-compliance.md +47 -0
- package/dist/cli/commands/catalyze/gap-detector.d.ts +6 -0
- package/dist/cli/commands/catalyze/gap-detector.d.ts.map +1 -0
- package/dist/cli/commands/catalyze/gap-detector.js +359 -0
- package/dist/cli/commands/catalyze/gap-detector.js.map +1 -0
- package/dist/cli/commands/catalyze/index.d.ts +15 -0
- package/dist/cli/commands/catalyze/index.d.ts.map +1 -0
- package/dist/cli/commands/catalyze/index.js +149 -0
- package/dist/cli/commands/catalyze/index.js.map +1 -0
- package/dist/cli/commands/catalyze/report-generator.d.ts +17 -0
- package/dist/cli/commands/catalyze/report-generator.d.ts.map +1 -0
- package/dist/cli/commands/catalyze/report-generator.js +290 -0
- package/dist/cli/commands/catalyze/report-generator.js.map +1 -0
- package/dist/cli/commands/catalyze/stack-analyzer.d.ts +6 -0
- package/dist/cli/commands/catalyze/stack-analyzer.d.ts.map +1 -0
- package/dist/cli/commands/catalyze/stack-analyzer.js +267 -0
- package/dist/cli/commands/catalyze/stack-analyzer.js.map +1 -0
- package/dist/cli/commands/catalyze/types.d.ts +40 -0
- package/dist/cli/commands/catalyze/types.d.ts.map +1 -0
- package/dist/cli/commands/catalyze/types.js +2 -0
- package/dist/cli/commands/catalyze/types.js.map +1 -0
- package/dist/cli/commands/init/agents.d.ts.map +1 -1
- package/dist/cli/commands/init/agents.js +9 -0
- package/dist/cli/commands/init/agents.js.map +1 -1
- package/dist/cli/commands/init/claude-hooks.d.ts.map +1 -1
- package/dist/cli/commands/init/claude-hooks.js +27 -0
- package/dist/cli/commands/init/claude-hooks.js.map +1 -1
- package/dist/cli/commands/init/commands.d.ts.map +1 -1
- package/dist/cli/commands/init/commands.js +9 -0
- package/dist/cli/commands/init/commands.js.map +1 -1
- package/dist/cli/commands/init/discord.d.ts +21 -0
- package/dist/cli/commands/init/discord.d.ts.map +1 -0
- package/dist/cli/commands/init/discord.js +87 -0
- package/dist/cli/commands/init/discord.js.map +1 -0
- package/dist/cli/commands/init/index.d.ts.map +1 -1
- package/dist/cli/commands/init/index.js +61 -17
- package/dist/cli/commands/init/index.js.map +1 -1
- package/dist/cli/commands/init/profiles.d.ts +39 -0
- package/dist/cli/commands/init/profiles.d.ts.map +1 -0
- package/dist/cli/commands/init/profiles.js +132 -0
- package/dist/cli/commands/init/profiles.js.map +1 -0
- package/dist/cli/index.js +27 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/native-tools.d.ts.map +1 -1
- package/dist/gateway/native-tools.js +25 -0
- package/dist/gateway/native-tools.js.map +1 -1
- package/dist/pm/discord-notifier.d.ts +52 -0
- package/dist/pm/discord-notifier.d.ts.map +1 -0
- package/dist/pm/discord-notifier.js +122 -0
- package/dist/pm/discord-notifier.js.map +1 -0
- package/package.json +1 -1
- package/profiles/astro/README.md +44 -0
- package/profiles/astro/agents.txt +3 -0
- package/profiles/astro/gates.yaml +15 -0
- package/profiles/astro/hooks/astro-ssr-guard.sh +73 -0
- package/profiles/drupal/README.md +53 -0
- package/profiles/drupal/agents.txt +4 -0
- package/profiles/drupal/gates.yaml +15 -0
- package/profiles/drupal/hooks/drupal-coding-standards.sh +70 -0
- package/profiles/drupal/hooks/hook-update-guard.sh +65 -0
- package/profiles/lit-wc/README.md +48 -0
- package/profiles/lit-wc/agents.txt +4 -0
- package/profiles/lit-wc/gates.yaml +15 -0
- package/profiles/lit-wc/hooks/cem-integrity-gate.sh +48 -0
- package/profiles/lit-wc/hooks/shadow-dom-guard.sh +76 -0
- package/profiles/nextjs/README.md +44 -0
- package/profiles/nextjs/agents.txt +4 -0
- package/profiles/nextjs/gates.yaml +15 -0
- package/profiles/nextjs/hooks/server-component-drift.sh +73 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# profiles/lit-wc/hooks/shadow-dom-guard.sh
|
|
3
|
+
# PostToolUse hook for Write — validates Shadow DOM usage patterns in Lit/Web Components.
|
|
4
|
+
# Warns on anti-patterns: direct document queries, missing :host scoping, unsafe customElements.define.
|
|
5
|
+
# Advisory only — exits 0 after printing warnings.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
HOOK_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
10
|
+
LIB="$HOOK_DIR/../../../hooks/_lib/common.sh"
|
|
11
|
+
if [[ -f "$LIB" ]]; then
|
|
12
|
+
# shellcheck source=hooks/_lib/common.sh
|
|
13
|
+
source "$LIB"
|
|
14
|
+
check_halt
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Read tool input from stdin
|
|
18
|
+
INPUT=$(cat)
|
|
19
|
+
TOOL_NAME=$(printf '%s' "$INPUT" | grep -o '"tool_name":"[^"]*"' | head -1 | cut -d'"' -f4 2>/dev/null || echo "")
|
|
20
|
+
FILE_PATH=$(printf '%s' "$INPUT" | grep -o '"path":"[^"]*"' | head -1 | cut -d'"' -f4 2>/dev/null || echo "")
|
|
21
|
+
|
|
22
|
+
# Only run on Write tool
|
|
23
|
+
if [[ "$TOOL_NAME" != "Write" && "$TOOL_NAME" != "Edit" ]]; then
|
|
24
|
+
exit 0
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Only target .ts, .js files (web component source)
|
|
28
|
+
if [[ -z "$FILE_PATH" ]]; then
|
|
29
|
+
exit 0
|
|
30
|
+
fi
|
|
31
|
+
case "$FILE_PATH" in
|
|
32
|
+
*.ts|*.js) ;;
|
|
33
|
+
*) exit 0 ;;
|
|
34
|
+
esac
|
|
35
|
+
|
|
36
|
+
# Only warn if file exists (was just written)
|
|
37
|
+
if [[ ! -f "$FILE_PATH" ]]; then
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
CONTENT=$(cat "$FILE_PATH" 2>/dev/null || echo "")
|
|
42
|
+
WARNINGS=()
|
|
43
|
+
|
|
44
|
+
# Check 1: document.querySelector / document.getElementById inside HTMLElement/LitElement subclass
|
|
45
|
+
if printf '%s' "$CONTENT" | grep -qE 'extends\s+(HTMLElement|LitElement)'; then
|
|
46
|
+
if printf '%s' "$CONTENT" | grep -qE 'document\.(querySelector|getElementById|getElementsBy)'; then
|
|
47
|
+
WARNINGS+=("SHADOW DOM: 'document.querySelector/getElementById' found inside a web component. Use 'this.shadowRoot?.querySelector()' instead to avoid escaping the shadow boundary.")
|
|
48
|
+
fi
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
# Check 2: CSS selectors without :host scoping (look for <style> or css`` template literals with bare selectors)
|
|
52
|
+
if printf '%s' "$CONTENT" | grep -qE "css\`[^$]*\`|<style>"; then
|
|
53
|
+
# Look for top-level selectors that are NOT :host or :root
|
|
54
|
+
if printf '%s' "$CONTENT" | grep -qE '^\s*(\.[\w-]+|#[\w-]+|\w+\s*\{)' && \
|
|
55
|
+
! printf '%s' "$CONTENT" | grep -qE '^\s*:host'; then
|
|
56
|
+
WARNINGS+=("SHADOW DOM: CSS without ':host' scoping detected. All styles in web components should be scoped via ':host { }' to prevent style leakage.")
|
|
57
|
+
fi
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# Check 3: customElements.define without guard
|
|
61
|
+
if printf '%s' "$CONTENT" | grep -qE 'customElements\.define\('; then
|
|
62
|
+
if ! printf '%s' "$CONTENT" | grep -qE 'customElements\.get\(|!customElements\.get\('; then
|
|
63
|
+
WARNINGS+=("SHADOW DOM: 'customElements.define()' called without checking 'customElements.get(name)' first. This will throw if the element is defined twice (e.g., in tests or HMR). Guard with: if (!customElements.get('my-el')) customElements.define('my-el', MyEl)")
|
|
64
|
+
fi
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
# Print warnings as advisories
|
|
68
|
+
if [[ ${#WARNINGS[@]} -gt 0 ]]; then
|
|
69
|
+
printf '\n[shadow-dom-guard] Web Component advisory warnings for %s:\n' "$FILE_PATH" >&2
|
|
70
|
+
for warning in "${WARNINGS[@]}"; do
|
|
71
|
+
printf ' WARN: %s\n' "$warning" >&2
|
|
72
|
+
done
|
|
73
|
+
printf '\n' >&2
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
exit 0
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# nextjs profile
|
|
2
|
+
|
|
3
|
+
Reagent profile for Next.js projects using the App Router (Next.js 13+).
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Install this profile when your project:
|
|
8
|
+
|
|
9
|
+
- Uses Next.js with the App Router (`app/` directory)
|
|
10
|
+
- Has a mix of Server and Client Components
|
|
11
|
+
- Uses `next build` and `next lint` as quality gates
|
|
12
|
+
|
|
13
|
+
## What this profile installs
|
|
14
|
+
|
|
15
|
+
### Hooks
|
|
16
|
+
|
|
17
|
+
- **server-component-drift.sh** — PostToolUse/Write: warns on React client hooks in files missing `'use client'`, `dangerouslySetInnerHTML` usage, and unnecessary `'use client'` in data-fetching-only files.
|
|
18
|
+
|
|
19
|
+
### Quality gates (gates.yaml)
|
|
20
|
+
|
|
21
|
+
| Gate | Command | On failure |
|
|
22
|
+
| ----------------- | ------------------ | ---------- |
|
|
23
|
+
| next-build | `npx next build` | block |
|
|
24
|
+
| next-lint | `npx next lint` | block |
|
|
25
|
+
| nextjs-type-check | `npx tsc --noEmit` | block |
|
|
26
|
+
|
|
27
|
+
### Agents
|
|
28
|
+
|
|
29
|
+
- `nextjs-specialist` — Next.js App Router, RSC, streaming
|
|
30
|
+
- `frontend-specialist` — general frontend patterns
|
|
31
|
+
- `performance-engineer` — Core Web Vitals and bundle optimization
|
|
32
|
+
- `security-engineer-appsec` — XSS, CSRF, and Next.js security headers
|
|
33
|
+
|
|
34
|
+
## Recommended additions
|
|
35
|
+
|
|
36
|
+
- Playwright e2e tests (`npx playwright test`)
|
|
37
|
+
- `@next/bundle-analyzer` for bundle analysis
|
|
38
|
+
- Lighthouse CI for CWV regression
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
reagent init --profile nextjs
|
|
44
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
gates:
|
|
2
|
+
- name: next-build
|
|
3
|
+
command: npx next build
|
|
4
|
+
description: Next.js production build must succeed
|
|
5
|
+
on_failure: block
|
|
6
|
+
|
|
7
|
+
- name: next-lint
|
|
8
|
+
command: npx next lint
|
|
9
|
+
description: Next.js ESLint checks must pass
|
|
10
|
+
on_failure: block
|
|
11
|
+
|
|
12
|
+
- name: nextjs-type-check
|
|
13
|
+
command: npx tsc --noEmit
|
|
14
|
+
description: TypeScript must compile without errors
|
|
15
|
+
on_failure: block
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# profiles/nextjs/hooks/server-component-drift.sh
|
|
3
|
+
# PostToolUse hook for Write — detects server component drift in Next.js App Router.
|
|
4
|
+
# Warns on client-only hooks in server components, and dangerouslySetInnerHTML.
|
|
5
|
+
# Advisory only — exits 0 after printing warnings.
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
HOOK_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
10
|
+
LIB="$HOOK_DIR/../../../hooks/_lib/common.sh"
|
|
11
|
+
if [[ -f "$LIB" ]]; then
|
|
12
|
+
source "$LIB"
|
|
13
|
+
check_halt
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
INPUT=$(cat)
|
|
17
|
+
TOOL_NAME=$(printf '%s' "$INPUT" | grep -o '"tool_name":"[^"]*"' | head -1 | cut -d'"' -f4 2>/dev/null || echo "")
|
|
18
|
+
FILE_PATH=$(printf '%s' "$INPUT" | grep -o '"path":"[^"]*"' | head -1 | cut -d'"' -f4 2>/dev/null || echo "")
|
|
19
|
+
|
|
20
|
+
if [[ "$TOOL_NAME" != "Write" && "$TOOL_NAME" != "Edit" ]]; then
|
|
21
|
+
exit 0
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
# Only target .tsx and .ts files
|
|
25
|
+
if [[ -z "$FILE_PATH" ]]; then
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
case "$FILE_PATH" in
|
|
29
|
+
*.tsx|*.ts) ;;
|
|
30
|
+
*) exit 0 ;;
|
|
31
|
+
esac
|
|
32
|
+
|
|
33
|
+
if [[ ! -f "$FILE_PATH" ]]; then
|
|
34
|
+
exit 0
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
CONTENT=$(cat "$FILE_PATH" 2>/dev/null || echo "")
|
|
38
|
+
WARNINGS=()
|
|
39
|
+
|
|
40
|
+
# Check 1: Client hooks in files without 'use client' directive
|
|
41
|
+
HAS_USE_CLIENT=0
|
|
42
|
+
if printf '%s' "$CONTENT" | head -3 | grep -qE "^['\"]use client['\"]"; then
|
|
43
|
+
HAS_USE_CLIENT=1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
if [[ $HAS_USE_CLIENT -eq 0 ]]; then
|
|
47
|
+
if printf '%s' "$CONTENT" | grep -qE '\b(useState|useEffect|useContext|useReducer|useCallback|useMemo|useRef|useTransition|useDeferredValue|useId)\s*[(<(]'; then
|
|
48
|
+
WARNINGS+=("NEXTJS SERVER COMPONENT: React hook (useState/useEffect/etc.) found in file without 'use client' directive at the top. Either add '\"use client\"' as the first line, or move client-side logic to a child component.")
|
|
49
|
+
fi
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Check 2: dangerouslySetInnerHTML anywhere
|
|
53
|
+
if printf '%s' "$CONTENT" | grep -qE 'dangerouslySetInnerHTML'; then
|
|
54
|
+
WARNINGS+=("NEXTJS SECURITY: 'dangerouslySetInnerHTML' detected. This is an XSS risk unless the content is explicitly sanitized. If needed, use a sanitization library like DOMPurify and document why this is safe.")
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Check 3: 'use client' in a file that only does data fetching (likely unnecessary)
|
|
58
|
+
if [[ $HAS_USE_CLIENT -eq 1 ]]; then
|
|
59
|
+
if printf '%s' "$CONTENT" | grep -qE '\b(fetch|prisma\.|db\.|supabase\.|sql`|pool\.query)\b' && \
|
|
60
|
+
! printf '%s' "$CONTENT" | grep -qE '\b(useState|useEffect|onClick|onChange|onSubmit)\b'; then
|
|
61
|
+
WARNINGS+=("NEXTJS SERVER COMPONENT: 'use client' is declared but this file appears to only do data fetching with no interactive UI. Consider removing 'use client' and using a Server Component — this avoids sending data-fetching code to the browser.")
|
|
62
|
+
fi
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
if [[ ${#WARNINGS[@]} -gt 0 ]]; then
|
|
66
|
+
printf '\n[server-component-drift] Next.js advisory warnings for %s:\n' "$FILE_PATH" >&2
|
|
67
|
+
for warning in "${WARNINGS[@]}"; do
|
|
68
|
+
printf ' WARN: %s\n' "$warning" >&2
|
|
69
|
+
done
|
|
70
|
+
printf '\n' >&2
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
exit 0
|