Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .agents/skills/check-changed-folders/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: check-changed-folders
description: Run typecheck, tests, and builds for Rudder's core and plugin workspaces on the current branch versus main, verify the centralized agent-instruction layout, and verify agent attribution. Use when asked to run "/check", to validate a branch before commit/PR, or whenever a user asks to run checks before publishing.
description: Run typecheck, tests, and builds for Rudder's core and plugin workspaces on the current branch versus main, verify Claude/Codex provider parity, verify the centralized agent-instruction layout, and verify agent attribution. Use when asked to run "/check", to validate a branch before commit/PR, whenever a user asks to run checks before publishing, or whenever changes affect provider-facing plugin surfaces such as manifests, hooks, skills, MCP servers, apps, or UI.
---

# Check Changed Folders

Identify what changed on the branch, verify the centralized agent-instruction layout and agent attribution, run the package checks, and report pass/fail status with actionable failure output.
Identify what changed on the branch, verify provider parity, the centralized agent-instruction layout, and agent attribution, run the package checks, and report pass/fail status with actionable failure output.
The root npm scripts validate the core package and the Rudder plugin workspace.
Checks are therefore repo-wide rather than per-package.

Expand All @@ -20,7 +20,7 @@ git diff --name-only
git diff --name-only --cached
```

If anything under `src/`, `bin/`, `test/`, or a build/config file (`package.json`, `tsconfig*.json`, `.github/`) changed, the package checks below apply.
If anything under `src/`, `bin/`, `test/`, `ui/`, `.claude-plugin/`, `.codex-plugin/`, `hooks/`, `skills/`, or a build/config file (`package.json`, `tsconfig*.json`, `.mcp.json`, `.github/`) changed, the package checks below apply.

2. Verify the centralized agent-instruction layout before running checks:

Expand All @@ -33,39 +33,51 @@ git diff --name-only --cached
- `.codex/skills` -> `../.agents/skills`
- If any link is missing or resolves outside `.agents/`, mark the check as failed and report the broken path.

3. Verify agent attribution.
3. Verify provider parity.

- Treat Claude and Codex as supported providers for the same Rudder plugin package.
- When a change adds, removes, or modifies a provider-facing component—manifest metadata, skills, hooks, MCP servers, apps, UI, or packaged artifacts—inspect both provider manifests and runtime paths.
- Require equivalent discovery, launch behavior, packaged resources, and user-facing capability across providers.
Provider-specific schema or environment-variable differences are allowed, but they must remain explicit implementation details rather than functional gaps.
- Add or update a regression assertion in `test/plugin-package.test.ts` or the relevant runtime test that exercises both provider paths.
If provider-facing behavior changes without parity coverage, fail this check.
- Permit a provider-specific exception only when the user explicitly requests it or the provider cannot support the capability.
Report the reason, the affected provider, and the test that protects the supported behavior.

4. Verify agent attribution.
If a coding agent wrote code included in the
branch, inspect `git log origin/main..HEAD` and require every such agent to appear as a commit author or in a `Co-authored-by:` trailer.
Missing agent attribution on committed work fails the check.
If the agent-written work is still uncommitted, report attribution as pending and name the trailer that must be added when committing.
Human-only changes are not subject to this check.

4. Install dependencies if `node_modules/` does not exist: run `npm install`.
5. Install dependencies if `node_modules/` does not exist: run `npm install`.

5. Run the package checks (the same set `prepublishOnly` runs, so green means publishable):
6. Run the package checks (the same set `prepublishOnly` runs, so green means publishable):

```bash
npm run typecheck
npm test
npm run build
```

6. Surface and address open PR comments.
7. Surface and address open PR comments.
If the current branch has an open GitHub PR, always invoke the `address-pr-comments` skill before finishing.
That skill fetches open review comments (Greptile, human reviewers) for the PR, dedupes them, and fixes/declines/defers each one.
Only if `gh` is unavailable or there is no PR for the current branch, treat this step as `skipped`.
If any comment is acted on, re-run the checks before reporting.

7. Report concise results:
8. Report concise results:

- State whether typecheck, tests, and build passed, failed, or were skipped.
- Include dedicated results for agent-instruction layout, agent attribution, and PR comments (`passed`, `failed`, `pending`, or `skipped`) and why.
- Include dedicated results for provider parity, agent-instruction layout, agent attribution, and PR comments (`passed`, `failed`, `pending`, or `skipped`) and why.
- For failures, include the key error output and which command failed.
- Distinguish real failures (broken agent links, missing agent attribution, type errors, test failures, unaddressed P0/P1 PR comments) from environment issues (missing CLI tools, no PR).
- Distinguish real failures (provider drift, missing parity coverage, broken agent links, missing agent attribution, type errors, test failures, unaddressed P0/P1 PR comments) from environment issues (missing CLI tools, no PR).

## Notes

- Default comparison branch is `origin/main` (not local `main`, which may be stale).
- Provider parity means equivalent behavior and coverage, not necessarily byte-identical provider configuration.
- The `.agents/` layout is a required gate, not an optional reminder.
- Agent attribution is required only when an agent contributed code.
- If nothing relevant changed, state that no checks were required.
4 changes: 2 additions & 2 deletions .agents/skills/check-changed-folders/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface:
display_name: "Check"
short_description: "Run checks and verify agent attribution and the shared workflow layout."
default_prompt: "Use $check-changed-folders to verify agent attribution and the .agents-based workflow layout, then run typecheck, tests, and build."
short_description: "Validate provider parity, layout, attribution, and builds."
default_prompt: "Use $check-changed-folders to verify Claude/Codex provider parity, attribution, and the shared workflow layout, then run the repository checks."
13 changes: 13 additions & 0 deletions .claude-mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mcpServers": {
"rudder": {
"command": "node",
"args": [
"--input-type=module",
"-e",
"import { resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; const root = process.env.PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || process.cwd(); await import(pathToFileURL(resolve(root, 'dist/rudder-mcp-server.mjs')).href)"
],
"cwd": "."
}
}
}
1 change: 1 addition & 0 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"coverage"
],
"skills": "./skills/",
"mcpServers": "./.claude-mcp.json",
"hooks": "./hooks/hooks.json"
}
2 changes: 2 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"coverage"
],
"skills": "./skills/",
"mcpServers": "./.mcp.json",
"interface": {
"displayName": "Rudder",
"shortDescription": "Tests from intent and changes",
"longDescription": "Rudder combines the intent captured in your coding session with the current worktree, then guides your existing coding agent through a fresh-slate unit-test workflow. It discovers the repository's native test and coverage tooling, generates focused tests for changed production behavior, and asks concrete follow-up questions until the configured coverage target is met.",
"developerName": "RudderCode",
"category": "Productivity",
"capabilities": [
"Interactive",
"Write"
],
"websiteURL": "https://github.com/RudderCode/Rudder",
Expand Down
11 changes: 11 additions & 0 deletions .mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"rudder": {
"command": "node",
"args": [
"--input-type=module",
"-e",
"import { resolve } from 'node:path'; import { pathToFileURL } from 'node:url'; const root = process.env.PLUGIN_ROOT || process.env.CLAUDE_PLUGIN_ROOT || process.cwd(); await import(pathToFileURL(resolve(root, 'dist/rudder-mcp-server.mjs')).href)"
],
"cwd": "."
}
}
8 changes: 5 additions & 3 deletions almanac/architecture/automation/contributor-automation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Contributor Automation"
summary: "Contributor automation connects centralized agent skills, local check flows, PR-comment remediation, CI validation, and Danger-based agent guards into one guarded branch workflow."
summary: "Contributor automation connects centralized agent skills, provider-parity checks, local check flows, PR-comment remediation, CI validation, and Danger-based agent guards into one guarded branch workflow."
topics: [architecture, automation, contributor-workflow, validation]
sources:
- id: agents-readme
Expand Down Expand Up @@ -29,14 +29,16 @@ sources:
path: dangerfile.ts
---

Rudder's contributor automation is a set of local and CI gates for a repository that currently has one root plugin package and centralized agent workflows. `.agents/skills/` is the only reusable-workflow source, with `.claude/skills` and `.codex/skills` as compatibility symlinks [@agents-readme]. The `check-changed-folders` skill validates branches, verifies layout and attribution, runs local package checks, and delegates PR-comment remediation when a PR exists [@check-skill]. The `prepare-package-release` skill synchronizes package and plugin versions, ingests the complete range since the previous release, Gardens the whole CodeAlmanac wiki, and validates the prepared release [@release-skill]. GitHub Actions repeats package validation on branch pushes, while the Danger workflow enforces protected paths and inline agent guards for agent-authored pull requests [@test-workflow] [@danger-workflow] [@dangerfile].
Rudder's contributor automation is a set of local and CI gates for a repository that currently has one root plugin package and centralized agent workflows. `.agents/skills/` is the only reusable-workflow source, with `.claude/skills` and `.codex/skills` as compatibility symlinks [@agents-readme]. The `check-changed-folders` skill validates branches, verifies provider parity, layout, and attribution, runs local package checks, and delegates PR-comment remediation when a PR exists [@check-skill]. The `prepare-package-release` skill synchronizes package and plugin versions, ingests the complete range since the previous release, Gardens the whole CodeAlmanac wiki, and validates the prepared release [@release-skill]. GitHub Actions repeats package validation on branch pushes, while the Danger workflow enforces protected paths and inline agent guards for agent-authored pull requests [@test-workflow] [@danger-workflow] [@dangerfile].

## Local Check Surface

The check surface is centralized in `.agents/skills/check-changed-folders/SKILL.md` [@check-skill]. It starts by fetching `origin/main`, collecting changed files from the merge-base diff plus unstaged and staged local changes, and treating Rudder as repo-wide rather than per-package [@check-skill]. When files under `src/`, `bin/`, `test/`, package or TypeScript configuration, or `.github/` change, the package checks apply [@check-skill].
The check surface is centralized in `.agents/skills/check-changed-folders/SKILL.md` [@check-skill]. It starts by fetching `origin/main`, collecting changed files from the merge-base diff plus unstaged and staged local changes, and treating Rudder as repo-wide rather than per-package [@check-skill]. When files under `src/`, `bin/`, `test/`, `ui/`, `.claude-plugin/`, `.codex-plugin/`, `hooks/`, `skills/`, package or TypeScript configuration, `.mcp.json`, or `.github/` change, the package checks apply [@check-skill].

The centralized layout itself is a hard gate. The check skill requires `AGENTS.md` as canonical guidance, `.agents/skills/` as the only reusable workflow source, `skills/<skill-name>/agents/openai.yaml` metadata for shared skills, `.claude/skills` and `.codex/skills` symlinks to `.agents/skills`, and no `.claude/commands` aliases [@agents-readme] [@check-skill]. The [Run Checks](../../guides/contributor/run-checks) guide turns this architecture into the step-by-step contributor procedure.

Provider parity is a hard local gate for provider-facing changes. The check skill treats Claude and Codex as supported providers for the same package, requires equivalent discovery, launch behavior, packaged resources, and user-facing capability, and requires regression coverage in `test/plugin-package.test.ts` or the relevant runtime test for both provider paths [@check-skill]. Provider-specific schema or environment-variable differences are allowed only when they do not become functional gaps; exceptions need an explicit user request or an unsupported provider capability, plus a reported reason and protective test for the supported path [@check-skill].

Before package checks, the local flow also checks that each coding agent represented in committed work is listed as a commit author or `Co-authored-by` trailer. Agent-written uncommitted work is reported as pending attribution until it is committed; human-only changes are outside this gate [@check-skill].

## Package Checks
Expand Down
Loading
Loading