-
Notifications
You must be signed in to change notification settings - Fork 155
Added import code review agent skill #2160
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
rohitkumarbhagat
wants to merge
13
commits into
datacommonsorg:master
Choose a base branch
from
rohitkumarbhagat:code-review-agent
base: master
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
13 commits
Select commit
Hold shift + click to select a range
049efc2
Add import review signal mining skill
rohitkumarbhagat 82d2679
Add Data Commons import review skill
rohitkumarbhagat 0123785
Clarify import validation guidance and review contracts
rohitkumarbhagat 9d11e9c
Document import review signal merge workflow
rohitkumarbhagat db44eaf
Strengthen data import code review guidelines
rohitkumarbhagat d8bcc2e
Require isolated Python environments in import code reviews
rohitkumarbhagat 1bfc2af
Document agent skill authoring conventions
rohitkumarbhagat ad56c55
Clarify import diagnostics authoring
rohitkumarbhagat 576a5d4
Discover skill link entrypoints from installed skills
rohitkumarbhagat c11cd8b
Merge branch 'master' into code-review-agent
rohitkumarbhagat 0a0b0f6
lint fix
rohitkumarbhagat 6511158
Allow explicitly authorized review publishing
rohitkumarbhagat 7e56eea
Document shared download utility guidance
rohitkumarbhagat 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 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
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
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
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,95 @@ | ||
| # DC import diagnostics authoring | ||
|
|
||
| Use this guide when extending | ||
| [dc-import-diagnostics](../skills/dc-import-diagnostics/SKILL.md) or its | ||
| troubleshooting guidance. | ||
|
|
||
| ## Preserve the routing boundary | ||
|
|
||
| - Factual inspection uses the operation routes in `SKILL.md`. | ||
| - Failed, stalled, or unexpected-output requests load the | ||
| [troubleshooting entry point](../skills/dc-import-diagnostics/troubleshooting/troubleshooting.md). | ||
| - A named failure domain or suspected cause routes directly to its guide. | ||
| - An unknown scenario gathers only enough evidence to identify the failure | ||
| domain. | ||
|
|
||
| Keep `SKILL.md` responsible for global scope, safety, and information routes. | ||
| Keep `troubleshooting.md` responsible for domain selection and the bounded | ||
| fallback. | ||
|
|
||
| | User request | Route | | ||
| |---|---| | ||
| | "Show the current ImportStatus." | Use the factual route in `SKILL.md`. | | ||
| | "Why did this import fail?" | Open the troubleshooting entry point. | | ||
| | "Check whether this Batch job ran out of memory." | Open the Batch runtime guide and test that hypothesis first. | | ||
|
|
||
| ## Keep diagnosis hypothesis-driven | ||
|
|
||
| ### Investigation loop | ||
|
|
||
| ```text | ||
| triage | ||
| → identify the failure domain | ||
| → choose a plausible hypothesis | ||
| → verify or refute | ||
| ├─ confirmed → state the likely cause → mitigate or fix | ||
| ├─ refuted → test the next plausible hypothesis | ||
| └─ unknown → report missing evidence or the next useful check | ||
| ``` | ||
|
|
||
| This approach follows the iterative hypothesis-testing model in Google SRE's | ||
| [Effective Troubleshooting](https://sre.google/sre-book/effective-troubleshooting/). | ||
| This guide remains the source of truth for repository-specific structure. | ||
|
|
||
| ### Apply a hypothesis | ||
|
|
||
| For each hypothesis, keep together: | ||
|
|
||
| - when to consider it; | ||
| - evidence that confirms or refutes it; and | ||
| - mitigation when confirmed. | ||
|
|
||
| During investigation: | ||
|
|
||
| - A user-supplied hypothesis changes investigation order, not the evidence | ||
| needed to confirm it. | ||
| - Treat indirect signals as clues. | ||
| - Treat unavailable evidence as unknown, not refuted. | ||
| - Test only plausible hypotheses. Do not gather all evidence up front. | ||
|
|
||
| Example: | ||
|
|
||
| 1. A failed Batch job routes to the Batch runtime guide. | ||
| 2. If out of memory is plausible, follow | ||
| [Out of memory](../skills/dc-import-diagnostics/troubleshooting/batch-runtime.md#out-of-memory) | ||
| to verify or refute it. | ||
| 3. If confirmed, use that guide's mitigation. | ||
| 4. If refuted, test the next plausible runtime hypothesis. | ||
|
|
||
| ### Separate diagnosis from evidence collection | ||
|
|
||
| | Location | Owns | | ||
| |---|---| | ||
| | Domain guide | Hypotheses, evidence interpretation, and mitigation | | ||
| | Operational reference, such as [Cloud Batch operations](../skills/dc-import-diagnostics/references/batch.md) | Commands, identifiers, bounds, and evidence-retrieval failure handling | | ||
|
|
||
| - Add a new evidence operation to its operational reference, then link the | ||
| hypothesis to it. | ||
| - For example, a troubleshooting guide may request bounded Batch logs. Keep | ||
| the command, filters, and bounds in `batch.md`. | ||
| - Do not repeat skill-wide safety or remediation policy in each guide. | ||
| - Do not impose a fixed playbook schema. Use the smallest structure that makes | ||
| the issue clear. | ||
|
|
||
| ## Add a troubleshooting guide | ||
|
|
||
| 1. Add one guide for a coherent failure domain or related set of issues. | ||
| 2. Link it from `troubleshooting/troubleshooting.md` using the symptom language | ||
| users will provide. | ||
| 3. Link its evidence steps to the relevant operational reference sections. | ||
| 4. Add representative cases to the | ||
| [diagnostics golden queries](../evals/dc-import-diagnostics.md). | ||
|
|
||
| The contract tests ensure every troubleshooting guide is reachable from the | ||
| entry point and every referenced file or section exists. Do not add schemas, | ||
| IDs, templates, or exhaustive prose tests without a demonstrated need. |
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,91 @@ | ||
| # Repository agent skill authoring | ||
|
|
||
| Use this guide when adding or reorganizing skills under `agents/`. | ||
|
|
||
| ## Repository locations | ||
|
|
||
| | Content | Location | | ||
| |---|---| | ||
| | Runtime skill entry point | `agents/skills/<skill>/SKILL.md` | | ||
| | Skill-specific references | `agents/skills/<skill>/references/` | | ||
| | Shared agent-readable references | `agents/common/references/` | | ||
| | Shared configuration | `agents/common/config/` | | ||
| | Shared Python helpers and tests | `agents/common/scripts/` | | ||
| | Python helper wrapper | `agents/common/run_python.sh` | | ||
| | Starter prompts | `agents/prompts/` | | ||
| | Human maintenance guidance | `agents/docs/` | | ||
| | Golden evaluation queries | `agents/evals/` | | ||
|
|
||
| Keep contributor guidance in `agents/docs/`, outside runtime skill | ||
| directories. | ||
|
|
||
| ## Register and expose skills | ||
|
|
||
| - Register each skill's canonical directory path in `.agents/skills.json`. | ||
| - Add human entry points, starter prompts, and authoring guides to | ||
| `agents/README.md` when they need to be discoverable. | ||
| - Remove obsolete names instead of adding aliases unless compatibility is | ||
| explicitly required. | ||
|
|
||
| ## Keep ownership clear | ||
|
|
||
| - Keep instructions and operations used by one skill inside that skill. | ||
| - Move content to `agents/common/` only when it has another real consumer. | ||
| - Keep common references consumer-neutral. Skills may link to common | ||
| references; common references must not link into skill directories. | ||
| - Keep shared configuration and reusable Python execution helpers in | ||
| `agents/common/`. | ||
| - Prefer a service or domain reference over a separate file for every command. | ||
| Do not introduce a recipe hierarchy unless a concrete need emerges. | ||
|
|
||
| ## Keep runtime guidance focused | ||
|
|
||
| - Describe the user problem and the skill's capability, not its file inventory. | ||
| - State clear `Use when` and `Do not use for` boundaries. | ||
| - Keep scope, safety, and common routes in `SKILL.md`. Link details needed only | ||
| in some cases. | ||
| - Write routes using terms users will recognize. Clarify ambiguous terms instead | ||
| of silently choosing a meaning. | ||
| - Use source-relative Markdown links. Referenced sections must have unique, | ||
| plain ATX headings; link text does not need to match the heading. | ||
|
|
||
| ## Useful authoring tips | ||
|
|
||
| These tips complement the target agent's guidance. Follow client-specific rules | ||
| when they differ. | ||
|
|
||
| - Use representative user requests to shape triggers, routes, and tests. For | ||
| example, "Why did this import fail?" should route to troubleshooting. | ||
| - Focus on repository knowledge, procedures, and non-obvious edge cases. Skip | ||
| background the agent already handles well. | ||
| - State the situation and action together. For example, "If no Batch job ID | ||
| exists, inspect Scheduler." | ||
| - Use short sentences and consistent terms. | ||
| - Prefer one source for detailed information. Repeat small details when useful. | ||
| For example, keep a full Batch command in `batch.md` and a short route to it | ||
| in `SKILL.md`. | ||
| - Be prescriptive when mistakes are risky. Allow judgment otherwise. | ||
| - Improve skills based on observed failures. | ||
|
|
||
| For diagnostics-specific routing and troubleshooting conventions, see | ||
| [DC import diagnostics authoring](dc-import-diagnostics-authoring.md). | ||
|
|
||
| ## Validate changes | ||
|
|
||
| - Add or update golden queries in `agents/evals/` for important routing | ||
| behavior. | ||
| - Keep structural and behavioral assertions in | ||
| `agents/common/scripts/skill_contract_test.py` or the relevant operational | ||
| test. | ||
| - Rely on the contract tests for reachable Markdown links, section fragments, | ||
| registered skill paths, and the common-to-skill dependency boundary. | ||
| - Avoid contracts for prose wording, document counts, schemas, or deleted | ||
| historical paths. | ||
|
|
||
| Run: | ||
|
|
||
| ```sh | ||
| .env/bin/python -m unittest discover -v -s agents/common/scripts -p '*_test.py' | ||
| ./run_tests.sh -l | ||
| git diff --check | ||
| ``` |
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,14 @@ | ||
| # Start a Data Commons import code review | ||
|
|
||
| Use the `dc-import-code-review` skill to review the request below. | ||
|
|
||
| - Resolve the exact staged, unstaged, all-local, branch-comparison, or pull | ||
| request target before reviewing. | ||
| - Review only changed files under `scripts/**` and `statvar_imports/**`. | ||
| - Treat the repository as read-only. Treat GitHub as read-only unless the user | ||
| explicitly and unambiguously asks to publish the completed review. If the | ||
| publishing intent is unclear, ask before any GitHub write. | ||
|
|
||
| ## Request | ||
|
|
||
| <IMPORT_REVIEW_REQUEST> |
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,13 @@ | ||
| # Start Data Commons import review-signal mining | ||
|
|
||
| Use the `dc-import-review-signal-miner` skill with these inputs: | ||
|
|
||
| - Start time, inclusive: `<START_TIME>` in ISO 8601 UTC. | ||
| - End time, exclusive: `<END_TIME>` in ISO 8601 UTC. | ||
| - Output directory: `<OUTPUT_DIRECTORY>`. | ||
| - Reviewer identities, optional: `<REVIEWERS>` as comma-separated GitHub | ||
| logins, numeric user IDs, or both. | ||
|
|
||
| Follow the skill's import-path boundary, conservative signal criteria, output | ||
| contracts, and read-only safety rules. Produce only the complete comments | ||
| report and the considered-signals projection. |
Oops, something went wrong.
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.