Skip to content

Pattern miner: Add cross-repository monitor archetype from contribution-check pattern - #320

Merged
pelikhan merged 1 commit into
mainfrom
pattern-miner/cross-repo-monitor-1bad64ff9880e354
Oct 7, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pattern-miner/cross-repo-monitor-1bad64ff9880e354

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/copilot-instructions.md

Mined pattern: cross-repository monitor/orchestrator

Upstream evidence

  • githubnext-agentics/files/workflows/contribution-check.md — a schedule-triggered orchestrator that reads PRs from ${{ vars.TARGET_REPOSITORY }}, dispatches each PR to a stateless sub-agent (.github/agents/contribution-checker.agent.md) for evaluation, compiles results into one report issue in the home repo, and writes add-labels/add-comment back to the target repo using target-repo:.
  • github-gh-aw/files/.github/aw/workflow-patterns.md (lines 284-293) — the "Cross-Repository Pattern" section explicitly documents this as a recommended architecture: enable the needed GitHub toolsets for the external repo, configure PAT/GitHub App auth for cross-repo writes in safe-outputs:, set target-repo explicitly, and document required token scopes in the prompt.

One upstream workflow demonstrates the shape, and upstream documentation explicitly describes it as a recommended pattern, satisfying the mining threshold.

Why the library did not already cover it

  • No existing archetype's recommended_triggers/recommended_safe_outputs represented reading one repository and writing to another with a target-repo-based split (checked via a text search of current-library.json for target-repo, TARGET_REPOSITORY, cross-repo, orchestrator).
  • contribution-guidelines-checker has a one-line tip mentioning target-repo as an aside, but no archetype is built around the monitor/orchestrator shape itself (pre-filter → dispatch → compile report → write back cross-repo).

What changed in patterns/

  • Added patterns/archetypes/cross-repo-monitor.json (new curated archetype, success_rate: null, count: 0) describing the schedule-triggered monitor/orchestrator shape, with safe outputs issues, add-labels, add-comment, and tips covering target-repo, pre-filtering in steps:, per-item dispatch, report compilation with close-older-issues, and token-scope documentation.
  • Appended cross-repo-monitor to archetypes in patterns/manifest.json.
  • Added the matching runtime entry to patterns/workflow-generation.json (icon, capabilities, instructions: [workflow-patterns.md], body).
  • Updated .github/copilot-instructions.md: bumped the archetype count to 34 and added cross-repo-monitor to the curated-archetypes list, so test/copilot-instructions.test.js stays in sync.

Small refinement

  • patterns/archetypes/issue-hierarchy-manager.json: added one tip about create-issue's group: true option (groups several new findings as linked sub-issues under one parent). Evidenced by two upstream workflows — githubnext-agentics/files/workflows/issue-arborist.md (group: true with max: 5) and githubnext-agentics/files/workflows/duplicate-code-detector.md (group: true with max: 3) — plus the documented option in github-gh-aw/files/.github/aw/safe-outputs-content.md (line 102). No existing archetype's tips mentioned group: true.

Validation

  • npm test: 19 test files, 329 tests passed (including test/copilot-instructions.test.js and test/patterns.test.js, which assert every manifest archetype id has a matching file and is listed in the instructions).
  • npm run build: succeeded; dist/patterns/archetypes/cross-repo-monitor.json is emitted alongside the other archetype files.

Candidates deliberately left out

  • A rotating "focus area" dimension (seen in repository-quality-improver.md, efficiency-improver.md, tech-content-editorial-board.md) is already captured via the cache-memory rotation tips on code-health-auditor and performance-nut.
  • The open-PR-cap pre_activation gate (11 upstream workflows) is already present as a tip on code-improvement, documentation-updater, daily-test-improver, repo-maintainer, performance-nut, and link-checker.
  • A dedicated "discussion task miner" archetype (discussion-task-miner.md) was considered but only one upstream workflow demonstrates it with no corroborating documented pattern beyond the general issue/discussion safe-output reference, so it did not meet the two-workflow-or-documented-pattern bar as a standalone archetype.
  • A "wiki writer/coder" pair (agentic-wiki-writer.md, agentic-wiki-coder.md) uses the gollum trigger and repo-memory, but gollum is not documented as a supported trigger anywhere in the mined github-gh-aw docs, so it was left out pending confirmed trigger support.

Generated by Pattern Miner · copilot · auto · 311.5 AIC · ⌖ 17.7 AIC · ⊞ 8.3K · ◷

…ping tip

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protected files were modified in this pull request and require manual scrutiny before merge.

Please verify that each protected-file change is intentional, policy-compliant, and safe:

  • Protected files: .github/copilot-instructions.md

@pelikhan
pelikhan marked this pull request as ready for review October 7, 2026 11:24
@pelikhan
pelikhan merged commit c933261 into main Oct 7, 2026
1 check passed
@pelikhan
pelikhan deleted the pattern-miner/cross-repo-monitor-1bad64ff9880e354 branch October 7, 2026 11:24

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer dispatch: auto → both (docs change in .github/copilot-instructions.md + structured pattern data in patterns/*.json, no TS/JS/CSS code touched).

Reviewed the new cross-repo-monitor archetype, the issue-hierarchy-manager tip addition, and the manifest/instructions updates.

Findings: no blocking issues.

  • All modified/added JSON (manifest.json, workflow-generation.json, cross-repo-monitor.json, issue-hierarchy-manager.json) parses correctly and follows the existing archetype schema (id, recommended_triggers, recommended_safe_outputs/recommended_tools, permissions, capabilities, body template placeholders).
  • .github/copilot-instructions.md count bump (33→34) and curated-archetype list addition match the new manifest entry, consistent with what test/copilot-instructions.test.js and test/patterns.test.js assert (archetype count, curated vs. empirical listing, every manifest id having a matching archetype file).
  • The new archetype's body template references target-repo safe outputs in prose ("pre-configured target-repo safe outputs"), but — same as the existing contribution-guidelines-checker precedent — the generator (src/js/workflow.js) has no logic that actually injects target-repo: into generated safe-output blocks; it's left as a manual follow-up, matching the pattern already established elsewhere in this codebase rather than a regression introduced here.
  • icon: "repo" and prompt_style: "role-steps" reuse existing conventions; no new vocabulary introduced.

Nothing here warrants REQUEST_CHANGES. (Note: this PR shows as already merged at review time.)

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • github.com
  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "github.com"
    - "registry.npmjs.org"

See Network Configuration for more information.

Generated by Specialist PR Review for #320 · copilot · auto · 95.5 AIC · ⌖ 7.4 AIC · ⊞ 7.9K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant