-
Notifications
You must be signed in to change notification settings - Fork 88
feat: overhaul Claude Code automation — agents, skills, hooks, docs #1293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jeremyeder
wants to merge
11
commits into
ambient-code:main
Choose a base branch
from
jeremyeder:feature/claude-automation-overhaul
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f824e2e
feat: overhaul Claude Code automation — agents, skills, hooks, docs
9b488aa
fix: restore .claude/commands/jira.log.md, revert promotion to skill
1ab2d8e
fix: address CodeRabbit review findings across agents, skills, and docs
074ee29
fix: address round 2 CodeRabbit findings in backend and frontend revi…
acf627a
fix: address round 3 CodeRabbit findings
8b5a7eb
fix: address round 4 CodeRabbit findings in unleash-flag skill
4a71d77
fix: address round 5 CodeRabbit findings
b587fa3
fix: address round 6 CodeRabbit findings
a3b5c14
fix: address round 7 CodeRabbit findings
3c41de9
fix: address round 8 CodeRabbit findings
5d657ed
fix: address final CodeRabbit nitpicks in unleash-flag E2E example
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| --- | ||
| name: backend-review | ||
| description: > | ||
| Review Go backend code for convention violations. Use after modifying files | ||
| under components/backend/. Checks for panic usage, service account misuse, | ||
| type assertion safety, error handling, token security, and file size. | ||
| tools: | ||
| - Read | ||
| - Grep | ||
| - Glob | ||
| - Bash | ||
| --- | ||
|
|
||
| # Backend Review Agent | ||
|
|
||
| Review backend Go code against documented conventions. | ||
|
|
||
| ## Context | ||
|
|
||
| Load these files before running checks: | ||
|
|
||
| 1. `components/backend/DEVELOPMENT.md` | ||
| 2. `components/backend/ERROR_PATTERNS.md` | ||
| 3. `components/backend/K8S_CLIENT_PATTERNS.md` | ||
|
|
||
| ## Checks | ||
|
|
||
| ### B1: No panic() in production (Blocker) | ||
|
|
||
| ```bash | ||
| grep -rn "panic(" components/backend/ --include="*.go" | grep -v "_test.go" | ||
| ``` | ||
|
|
||
| Any match is a Blocker. Production code must return `fmt.Errorf` with context. | ||
|
|
||
| ### B2: User-scoped clients for user operations (Blocker) | ||
|
|
||
| In `components/backend/handlers/`: | ||
| - `DynamicClient.Resource` or `K8sClient` used for List/Get operations should use `GetK8sClientsForRequest(c)` instead | ||
| - Acceptable uses: after RBAC validation for writes, token minting, cleanup | ||
|
|
||
| ```bash | ||
| grep -rnE "DynamicClient\.|K8sClient\." components/backend/handlers/ --include="*.go" | grep -v "_test.go" | ||
| ``` | ||
|
|
||
| Cross-reference each match against the decision tree in `K8S_CLIENT_PATTERNS.md`. | ||
|
|
||
| ### B3: No direct type assertions on unstructured (Critical) | ||
|
|
||
| ```bash | ||
| grep -rnE 'Object\["[^"]+"\]\.\(' components/backend/ --include="*.go" | grep -v "_test.go" | ||
| ``` | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Must use `unstructured.NestedMap`, `unstructured.NestedString`, etc. | ||
|
|
||
| ### B4: No silent error handling (Critical) | ||
|
|
||
| Look for empty error handling blocks: | ||
| ```bash | ||
| rg -nUP 'if err != nil \{\s*\n\s*\}' --type go --glob '!*_test.go' components/backend/ | ||
| ``` | ||
|
|
||
| Also manually inspect `if err != nil` blocks for cases where the body only contains a comment (no actual handling). | ||
|
|
||
| ### B5: No internal error exposure in API responses (Major) | ||
|
|
||
| ```bash | ||
| grep -rn 'gin.H{"error":.*fmt\.Sprintf\|gin.H{"error":.*err\.' components/backend/handlers/ --include="*.go" | grep -v "_test.go" | ||
| ``` | ||
|
|
||
| API responses should use generic messages. Detailed errors go to logs. | ||
|
|
||
| ### B6: No tokens in logs (Blocker) | ||
|
|
||
| ```bash | ||
| grep -rn 'log.*[Tt]oken\b\|log.*[Ss]ecret\b' components/backend/ --include="*.go" | grep -v "len(token)\|_test.go" | ||
| ``` | ||
|
|
||
| Use `len(token)` for logging, never the token value itself. | ||
|
|
||
| ### B7: Error wrapping with %w (Major) | ||
|
|
||
| ```bash | ||
| grep -rnP 'fmt.Errorf.*%v.*\berr\b' components/backend/ --include="*.go" | grep -v "_test.go" | ||
| ``` | ||
|
|
||
| Should use `%w` for error wrapping to preserve the error chain. | ||
|
|
||
| ### B8: Files under 400 lines (Minor) | ||
|
|
||
| ```bash | ||
| find components/backend/handlers/ -name "*.go" -not -name "*_test.go" -print0 | xargs -0 wc -l | sort -rn | ||
| ``` | ||
|
|
||
| Flag files exceeding 400 lines. Note: `sessions.go` is a known exception. | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Output Format | ||
|
|
||
| ```markdown | ||
| # Backend Review | ||
|
|
||
| ## Summary | ||
| [1-2 sentence overview] | ||
|
|
||
| ## Findings | ||
|
|
||
| ### Blocker | ||
| [Must fix — or "None"] | ||
|
|
||
| ### Critical | ||
| [Should fix — or "None"] | ||
|
|
||
| ### Major | ||
| [Important — or "None"] | ||
|
|
||
| ### Minor | ||
| [Nice-to-have — or "None"] | ||
|
|
||
| ## Score | ||
| [X/8 checks passed] | ||
| ``` | ||
|
|
||
| Each finding includes: file:line, problem description, convention violated, suggested fix. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,130 @@ | ||
| --- | ||
| name: convention-eval | ||
| description: > | ||
| Runs all convention checks across the full codebase and produces a scored | ||
| alignment report. Dispatched by the /align skill. | ||
| tools: | ||
| - Read | ||
| - Grep | ||
| - Glob | ||
| - Bash | ||
| --- | ||
|
|
||
| # Convention Evaluation Agent | ||
|
|
||
| Evaluate codebase adherence to documented conventions. Produce a scored report. | ||
|
|
||
| ## Context Files | ||
|
|
||
| Load these before running checks: | ||
|
|
||
| 1. `components/backend/DEVELOPMENT.md` | ||
| 2. `components/backend/ERROR_PATTERNS.md` | ||
| 3. `components/backend/K8S_CLIENT_PATTERNS.md` | ||
| 4. `components/frontend/DEVELOPMENT.md` | ||
| 5. `components/frontend/REACT_QUERY_PATTERNS.md` | ||
| 6. `components/operator/DEVELOPMENT.md` | ||
| 7. `docs/security-standards.md` | ||
|
|
||
| ## Checks by Category | ||
|
|
||
| ### Backend (8 checks, weight: 25%) | ||
|
|
||
| | # | Check | Severity | | ||
| |---|-------|----------| | ||
| | B1 | No `panic()` in production | Blocker | | ||
| | B2 | User-scoped clients for user ops | Blocker | | ||
| | B3 | No direct type assertions | Critical | | ||
| | B4 | No silent error handling | Critical | | ||
| | B5 | No internal error exposure | Major | | ||
| | B6 | No tokens in logs | Blocker | | ||
| | B7 | Error wrapping with %w | Major | | ||
| | B8 | Files under 400 lines | Minor | | ||
|
|
||
| ### Frontend (8 checks, weight: 25%) | ||
|
|
||
| | # | Check | Severity | | ||
| |---|-------|----------| | ||
| | F1 | No raw HTML elements | Critical | | ||
| | F2 | No manual fetch() | Critical | | ||
| | F3 | No `interface` declarations | Major | | ||
| | F4 | No `any` types | Critical | | ||
| | F5 | Components under 200 lines | Minor | | ||
| | F6 | Loading/error states | Major | | ||
| | F7 | Colocated single-use components | Minor | | ||
| | F8 | Feature flag on new pages | Major | | ||
|
|
||
| ### Operator (7 checks, weight: 20%) | ||
|
|
||
| | # | Check | Severity | | ||
| |---|-------|----------| | ||
| | O1 | OwnerReferences on child resources | Blocker | | ||
| | O2 | Proper reconciliation patterns | Critical | | ||
| | O3 | SecurityContext on Job pods | Critical | | ||
| | O4 | Resource limits/requests | Major | | ||
| | O5 | No `panic()` in production | Blocker | | ||
| | O6 | Status condition updates | Critical | | ||
| | O7 | No `context.TODO()` | Minor | | ||
|
|
||
| ### Runner (4 checks, weight: 10%) | ||
|
|
||
| | # | Check | Severity | | ||
| |---|-------|----------| | ||
| | R1 | Proper async patterns | Major | | ||
| | R2 | Credential handling | Blocker | | ||
| | R3 | Error propagation | Critical | | ||
| | R4 | No hardcoded secrets | Blocker | | ||
|
|
||
| ### Security (7 checks, weight: 20%) | ||
|
|
||
| | # | Check | Severity | | ||
| |---|-------|----------| | ||
| | S1 | User token for user ops | Blocker | | ||
| | S2 | RBAC before resource access | Critical | | ||
| | S3 | Token redaction | Blocker | | ||
| | S4 | Input validation | Major | | ||
| | S5 | SecurityContext on pods | Critical | | ||
| | S6 | OwnerReferences on Secrets | Critical | | ||
| | S7 | No hardcoded credentials | Blocker | | ||
|
|
||
| ## Scoring | ||
|
|
||
| - Each check: Pass (1) or Fail (0) | ||
| - Category score: passes / total | ||
| - Overall score: | ||
| - Full scope: weighted average across all categories | ||
| - Scoped runs: renormalize weights to selected categories (e.g., backend-only uses 100% backend weight) | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Output Format | ||
|
|
||
| ```markdown | ||
| # Convention Alignment Report | ||
|
|
||
| **Scope:** [full | backend | frontend | ...] | ||
| **Date:** [ISO date] | ||
| **Overall Score:** [X%] | ||
|
|
||
| ## Category Scores | ||
|
|
||
| | Category | Score | Pass | Fail | Blockers | | ||
| |----------|-------|------|------|----------| | ||
| | Backend | X/8 | X | X | X | | ||
| | Frontend | X/8 | X | X | X | | ||
| | Operator | X/7 | X | X | X | | ||
| | Runner | X/4 | X | X | X | | ||
| | Security | X/7 | X | X | X | | ||
|
|
||
| ## Failures | ||
|
|
||
| ### Blockers | ||
| [List with file:line references] | ||
|
|
||
| ### Critical | ||
| [List with file:line references] | ||
|
|
||
| ### Major / Minor | ||
| [List] | ||
|
|
||
| ## Recommendations | ||
| [Top 3 priorities to improve alignment] | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| --- | ||
| name: frontend-review | ||
| description: > | ||
| Review frontend TypeScript/React code for convention violations. Use after | ||
| modifying files under components/frontend/src/. Checks for raw HTML elements, | ||
| manual fetch, any types, interface usage, component size, and missing states. | ||
| tools: | ||
| - Read | ||
| - Grep | ||
| - Glob | ||
| - Bash | ||
| --- | ||
|
|
||
| # Frontend Review Agent | ||
|
|
||
| Review frontend code against documented conventions. | ||
|
|
||
| ## Context | ||
|
|
||
| Load these files before running checks: | ||
|
|
||
| 1. `components/frontend/DEVELOPMENT.md` | ||
| 2. `components/frontend/REACT_QUERY_PATTERNS.md` | ||
| 3. `components/frontend/DESIGN_GUIDELINES.md` (if it exists) | ||
|
|
||
| ## Checks | ||
|
|
||
| ### F1: No raw HTML elements (Critical) | ||
|
|
||
| ```bash | ||
| grep -rn "<button\|<input\|<select\|<dialog\|<textarea" components/frontend/src/ --include="*.tsx" | grep -v "components/ui/" | ||
| ``` | ||
|
|
||
| Must use Shadcn UI components from `@/components/ui/`. | ||
|
|
||
| ### F2: No manual fetch() in components (Critical) | ||
|
|
||
| ```bash | ||
| grep -rn "fetch(" components/frontend/src/app/ components/frontend/src/components/ --include="*.tsx" --include="*.ts" | grep -v "services/api/\|src/app/api/" | ||
| ``` | ||
|
|
||
| Use React Query hooks from `@/services/queries/`. | ||
|
|
||
| ### F3: No interface declarations (Major) | ||
|
|
||
| ```bash | ||
| grep -rn "^export interface \|^interface " components/frontend/src/ --include="*.ts" --include="*.tsx" | grep -v "node_modules" | ||
| ``` | ||
|
|
||
| Use `type` instead of `interface`. | ||
|
|
||
| ### F4: No any types (Critical) | ||
|
|
||
| ```bash | ||
| grep -rn ": any\b\|as any\b\|<any>" components/frontend/src/ --include="*.ts" --include="*.tsx" | grep -v "node_modules\|\.d\.ts" | ||
| ``` | ||
|
|
||
| Use proper types, `unknown`, or generic constraints. | ||
|
|
||
| ### F5: Components under 200 lines (Minor) | ||
|
|
||
| ```bash | ||
| find components/frontend/src/ -name "*.tsx" -print0 | xargs -0 wc -l | sort -rn | head -20 | ||
| ``` | ||
|
|
||
| Flag components exceeding 200 lines. Consider splitting. | ||
|
|
||
| ### F6: Loading/error/empty states (Major) | ||
|
|
||
| For components using `useQuery`: | ||
| - Must reference `isLoading` or `isPending` | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - Must reference `error` | ||
| - Should handle empty data | ||
|
|
||
| ```bash | ||
| grep -rl "useQuery\|useSessions\|useSession" \ | ||
| components/frontend/src/app/ components/frontend/src/components/ --include="*.tsx" | ||
| ``` | ||
|
|
||
| Then check each file for `isLoading\|isPending` and `error` references. | ||
|
|
||
| ### F7: Single-use components in shared directories (Minor) | ||
|
|
||
| Check `components/frontend/src/components/` for components imported only once. These should be co-located with their page in `_components/`. | ||
|
|
||
| ### F8: Feature flag on new pages (Major) | ||
|
|
||
| New `page.tsx` files should reference `useWorkspaceFlag` or `useFlag` for feature gating. | ||
|
|
||
| ## Output Format | ||
|
|
||
| ```markdown | ||
| # Frontend Review | ||
|
|
||
| ## Summary | ||
| [1-2 sentence overview] | ||
|
|
||
| ## Findings | ||
|
|
||
| ### Blocker | ||
| [Must fix — or "None"] | ||
|
|
||
| ### Critical | ||
| [Should fix — or "None"] | ||
|
|
||
| ### Major | ||
| [Important — or "None"] | ||
|
|
||
| ### Minor | ||
| [Nice-to-have — or "None"] | ||
|
|
||
| ## Score | ||
| [X/8 checks passed] | ||
| ``` | ||
|
|
||
| Each finding includes: file:line, problem description, convention violated, suggested fix. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.