Skip to content

Add GitHub Action installation skill#9

Merged
hawkeyexl merged 3 commits intomainfrom
github-action
Mar 24, 2026
Merged

Add GitHub Action installation skill#9
hawkeyexl merged 3 commits intomainfrom
github-action

Conversation

@hawkeyexl
Copy link
Copy Markdown
Contributor

@hawkeyexl hawkeyexl commented Mar 23, 2026

Introduce a new phase in the workflow to offer and install the Doc Detective GitHub Action for continuous integration, contingent on the project being an initialized GitHub repository. This enhancement streamlines the setup process for users.

Summary by CodeRabbit

  • New Features

    • Adds a user-invocable installer to create/configure a Doc Detective GitHub Actions workflow.
    • Integrates offering/installing the workflow into init and bootstrap flows when the repo is GitHub-backed.
  • Behavior

    • Phase runs only for GitHub-backed repos (skips otherwise). Interactive mode prompts; CI mode proceeds non-interactively and forwards flags (e.g., --ci, --exit-on-fail).
    • Handles existing workflow conflicts (prompt/overwrite vs timestamped file), supports triggers, PR/issue creation, failure handling, and integrations.
  • Documentation

    • Adds detailed usage, examples, entry/exit criteria, and a full action reference.

Copilot AI review requested due to automatic review settings March 23, 2026 18:27
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Walkthrough

Adds a new doc-detective:install-github-action command and integrates it as a conditional final phase into init and bootstrap workflows; the phase detects GitHub repos, prompts interactively (or auto-proceeds in --ci), invokes the installer, writes/handles workflow files, and reports results.

Changes

Cohort / File(s) Summary
Init workflow Phase 6 updates
commands/doc-detective-init.md, commands/doc-detective-init.toml, plugins/doc-detective/skills/doc-detective-init/SKILL.md, skills/doc-detective-init/SKILL.md, src/skills/doc-detective-init/SKILL.md
Insert Phase 6 "Install GitHub Action": run-only-if GitHub repo, interactive prompt (skip if declined), auto-proceed in --ci, invoke /doc-detective-install-github-action with flag threading; update exit checklist and related commands.
Bootstrap workflow Phase 7 updates
plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md, skills/doc-detective-project-bootstrap/SKILL.md, src/skills/doc-detective-project-bootstrap/SKILL.md
Insert Phase 7 "Install GitHub Action" with same conditional/prompting/flag-threading behavior as init; update phase order and exit criteria.
New command: installer docs & config
commands/doc-detective-install-github-action.md, commands/doc-detective-install-github-action.toml
Add CLI command docs and TOML: options (--trigger, --exit-on-fail, --create-pr-on-change, --create-issue-on-fail, --integrations, --ci), entry/exit criteria, phase control flow, and file-write/conflict rules.
New installer skill docs (multi-location)
plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md, skills/doc-detective-install-github-action/SKILL.md, src/skills/doc-detective-install-github-action/SKILL.md
Comprehensive skill spec: Detect → Configure → Write → Report phases, repo/GitHub detection rules, YAML generation rules, conflict handling (--ci vs interactive), examples, and manual follow-ups.
Action reference & templates
plugins/doc-detective/skills/doc-detective-install-github-action/references/action-reference.md, skills/doc-detective-install-github-action/references/action-reference.md, src/skills/doc-detective-install-github-action/references/action-reference.md
Add full doc-detective/github-action@v1 reference: inputs, outputs, required permissions per feature, platform limitations, supported integrations, and multiple ready-to-use workflow templates.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Init as Init/Bootstrap
    participant Installer as Installer
    participant FS as Filesystem
    participant GH as GitHub

    User->>Init: run init/bootstrap (interactive or --ci)
    Init->>FS: detect .git and remotes
    alt github.com remote present
        Init->>User: prompt to install (interactive)
        User-->>Init: accept / decline (or auto-proceed in --ci)
        Init->>Installer: invoke /doc-detective-install-github-action (--ci / --exit-on-fail)
        Installer->>FS: detect existing config & workflows
        Installer->>GH: (optionally) create PR/issue or report permission needs
        Installer->>FS: write .github/workflows/doc-detective.yml (or timestamped file)
        Installer->>Init: report results & manual follow-ups
    else
        Init-->>User: skip Phase (silent)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jstjoe

Poem

🐰 I hop through docs with nimble feet,
New phase arrives to make CI sweet,
Init asks kindly, CI strides on,
A workflow written, a branch-to-dawn,
Hooray — the Action's now complete!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add GitHub Action installation skill' directly and clearly summarizes the main change: introducing a new GitHub Action installation skill, which aligns with the primary objective and the substantial file additions for this functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch github-action

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Install GitHub Action” phase to the Doc Detective bootstrap/init workflows and introduces a new skill/command that generates a Doc Detective GitHub Actions workflow for CI when the project is a GitHub repository.

Changes:

  • Add a GitHub Action installation phase to doc-detective-init and doc-detective-project-bootstrap.
  • Introduce the new doc-detective-install-github-action skill plus an in-repo action reference document.
  • Regenerate downstream build artifacts (skills/, plugins/, and commands/) from src/.

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/skills/doc-detective-project-bootstrap/SKILL.md Adds Phase 7 to offer/install the GitHub Action after injection.
src/skills/doc-detective-install-github-action/SKILL.md New skill spec describing how to detect context and write a workflow YAML.
src/skills/doc-detective-install-github-action/references/action-reference.md Adds a self-contained reference for doc-detective/github-action@v1 inputs/outputs/templates.
src/skills/doc-detective-init/SKILL.md Adds Phase 6 to offer/install the GitHub Action after fix loop completion.
skills/doc-detective-project-bootstrap/SKILL.md Built artifact copy of the updated bootstrap skill.
skills/doc-detective-install-github-action/SKILL.md Built artifact copy of the new install skill.
skills/doc-detective-install-github-action/references/action-reference.md Built artifact copy of the action reference.
skills/doc-detective-init/SKILL.md Built artifact copy of the updated init skill.
plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md Plugin artifact copy of the updated bootstrap skill.
plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md Plugin artifact copy of the new install skill.
plugins/doc-detective/skills/doc-detective-install-github-action/references/action-reference.md Plugin artifact copy of the action reference.
plugins/doc-detective/skills/doc-detective-init/SKILL.md Plugin artifact copy of the updated init skill.
commands/doc-detective-install-github-action.md Generated user-facing command doc for the new install skill.
commands/doc-detective-install-github-action.toml Generated Gemini CLI command TOML for the new install command.
commands/doc-detective-init.md Regenerated command doc reflecting the new Phase 6 in init.
commands/doc-detective-init.toml Regenerated command TOML reflecting the new Phase 6 in init.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md (1)

10-11: ⚠️ Potential issue | 🟡 Minor

Duplicate user-invocable field in frontmatter.

The field appears twice: once inside metadata (line 10) and once at the top level (line 11). This could cause parsing inconsistencies. Remove the duplicate.

🛠️ Proposed fix
   references: https://doc-detective.com, https://github.com/doc-detective/doc-detective, https://github.com/doc-detective/doc-detective-common
   user-invocable: 'false'
-user-invocable: false
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md` around
lines 10 - 11, Frontmatter contains a duplicated "user-invocable" key; remove
the duplicate entry so only a single "user-invocable" field remains (choose
either the one under the "metadata" block or the top-level one) and ensure the
remaining "user-invocable" value is a boolean (false) to avoid parsing
inconsistencies when reading the SKILL.md frontmatter.
🧹 Nitpick comments (1)
skills/doc-detective-project-bootstrap/SKILL.md (1)

125-127: Consider clarifying when --exit-on-fail is "appropriate".

The guidance "Pass --exit-on-fail if appropriate for the project context" is vague. Consider specifying concrete conditions (e.g., "when the bootstrap was invoked from a CI pipeline" or "when --ci is set").

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/doc-detective-project-bootstrap/SKILL.md` around lines 125 - 127,
Clarify when to pass --exit-on-fail by replacing the vague phrase with a
concrete rule: state that /doc-detective-install-github-action should receive
--exit-on-fail when running in non-interactive or CI contexts (e.g., when the
parent bootstrap was invoked with --ci) or whenever the caller requires the
process to fail-fast on any installation error; keep the guidance to always pass
--ci when bootstrap used --ci and add an explicit example sentence referencing
the flags --ci and --exit-on-fail and the invocation
/doc-detective-install-github-action to make the condition unambiguous.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/doc-detective/skills/doc-detective-init/SKILL.md`:
- Around line 136-139: The docs are ambiguous about when to forward the
--exit-on-fail flag to /doc-detective-install-github-action; update SKILL.md to
define a deterministic rule: always forward --exit-on-fail when init is run with
--ci (non-interactive/CI runs), and when run interactively (no --ci) prompt the
user with a documented default of not forwarding (default: do not pass
--exit-on-fail unless the user explicitly confirms); clearly state the rule and
show examples of invoking /doc-detective-install-github-action with matching
flags (--ci and --exit-on-fail) for both CI and interactive cases.

In `@skills/doc-detective-install-github-action/SKILL.md`:
- Line 57: The exit criterion "Required permissions documented in workflow
comments" is not actionable because Phase 2/3 steps don't require adding
comments; either add an explicit step or template comment block in Phase 2/3
instructing the author to insert the permissions comments (e.g., a suggested
comment header showing required permissions) or change the checklist line to a
clearer, verifiable criterion such as "permissions correctly set" so the
workflow verifies permission settings rather than documentation; update the
SKILL.md checklist accordingly and ensure any referenced Phase 2/3 step names or
the checklist item text ("Required permissions documented in workflow comments")
are updated to match the chosen approach.

---

Outside diff comments:
In `@plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md`:
- Around line 10-11: Frontmatter contains a duplicated "user-invocable" key;
remove the duplicate entry so only a single "user-invocable" field remains
(choose either the one under the "metadata" block or the top-level one) and
ensure the remaining "user-invocable" value is a boolean (false) to avoid
parsing inconsistencies when reading the SKILL.md frontmatter.

---

Nitpick comments:
In `@skills/doc-detective-project-bootstrap/SKILL.md`:
- Around line 125-127: Clarify when to pass --exit-on-fail by replacing the
vague phrase with a concrete rule: state that
/doc-detective-install-github-action should receive --exit-on-fail when running
in non-interactive or CI contexts (e.g., when the parent bootstrap was invoked
with --ci) or whenever the caller requires the process to fail-fast on any
installation error; keep the guidance to always pass --ci when bootstrap used
--ci and add an explicit example sentence referencing the flags --ci and
--exit-on-fail and the invocation /doc-detective-install-github-action to make
the condition unambiguous.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 83f8ef71-e338-4902-b27e-0bc70d24c97c

📥 Commits

Reviewing files that changed from the base of the PR and between 5e13e3a and b466fe5.

📒 Files selected for processing (19)
  • commands/doc-detective-init.md
  • commands/doc-detective-init.toml
  • commands/doc-detective-install-github-action.md
  • commands/doc-detective-install-github-action.toml
  • plugins/doc-detective/skills/doc-detective-doc-testing/scripts/doc-detective-validate-test.js
  • plugins/doc-detective/skills/doc-detective-init/SKILL.md
  • plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md
  • plugins/doc-detective/skills/doc-detective-install-github-action/references/action-reference.md
  • plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md
  • skills/doc-detective-doc-testing/scripts/doc-detective-validate-test.js
  • skills/doc-detective-init/SKILL.md
  • skills/doc-detective-install-github-action/SKILL.md
  • skills/doc-detective-install-github-action/references/action-reference.md
  • skills/doc-detective-project-bootstrap/SKILL.md
  • src/skills/doc-detective-doc-testing/scripts/doc-detective-validate-test.js
  • src/skills/doc-detective-init/SKILL.md
  • src/skills/doc-detective-install-github-action/SKILL.md
  • src/skills/doc-detective-install-github-action/references/action-reference.md
  • src/skills/doc-detective-project-bootstrap/SKILL.md

- Clarify --exit-on-fail passthrough criteria in init and bootstrap skills:
  always pass in --ci mode, prompt in interactive mode
- Fix non-actionable exit criterion in install-github-action skill:
  change from 'permissions documented in comments' to 'permissions correctly set'
- Rebuild artifacts
@hawkeyexl
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@hawkeyexl
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/skills/doc-detective-init/SKILL.md`:
- Around line 131-132: Update the condition wording to detect a Git repository
when the .git path exists regardless of type (file or directory) instead of
requiring ".git/" as a directory; keep the requirement that a remote URL
references "github.com" and that Phase 6 should be skipped silently
otherwise—replace the phrase ".git/" with a neutral check like ".git (file or
directory) exists" or "the .git path exists (supports worktrees where .git is a
file)" and retain the github.com remote check and silent skip for Phase 6.

In `@src/skills/doc-detective-project-bootstrap/SKILL.md`:
- Around line 121-122: Update the condition wording to detect a Git repository
even when .git is a file (worktrees) by changing the check from requiring a
`.git/` directory to checking that a `.git` entry exists as either a file or
directory, or by recommending using a git-aware check (e.g., `git rev-parse
--is-inside-work-tree`) before verifying a remote references `github.com`;
specifically replace the phrase requiring `.git/` with language like "`.git`
exists as a file or directory (or use a git-aware check) and a remote URL
references `github.com`" so the detection in the SKILL.md condition handles
worktrees correctly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e370613a-d281-4dfd-995e-d11948595dc2

📥 Commits

Reviewing files that changed from the base of the PR and between b466fe5 and ef2bfa9.

📒 Files selected for processing (13)
  • commands/doc-detective-init.md
  • commands/doc-detective-init.toml
  • commands/doc-detective-install-github-action.md
  • commands/doc-detective-install-github-action.toml
  • plugins/doc-detective/skills/doc-detective-init/SKILL.md
  • plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md
  • plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md
  • skills/doc-detective-init/SKILL.md
  • skills/doc-detective-install-github-action/SKILL.md
  • skills/doc-detective-project-bootstrap/SKILL.md
  • src/skills/doc-detective-init/SKILL.md
  • src/skills/doc-detective-install-github-action/SKILL.md
  • src/skills/doc-detective-project-bootstrap/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • commands/doc-detective-install-github-action.toml

- Update init, bootstrap, and install-github-action skills to detect .git
  as either a file or directory (Git worktrees use a .git file)
- Rebuild artifacts
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
plugins/doc-detective/skills/doc-detective-init/SKILL.md (1)

10-11: ⚠️ Potential issue | 🟡 Minor

Duplicate YAML frontmatter key: user-invocable appears twice.

Similar to the bootstrap skill file, the frontmatter contains both user-invocable: 'true' (line 10, quoted) and user-invocable: true (line 11, unquoted). This duplication should be removed.

Proposed fix
   references: https://doc-detective.com, https://github.com/doc-detective/doc-detective
   user-invocable: 'true'
-user-invocable: true
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/doc-detective/skills/doc-detective-init/SKILL.md` around lines 10 -
11, Remove the duplicate YAML frontmatter key `user-invocable` in SKILL.md by
keeping a single boolean entry (prefer unquoted true: user-invocable: true) and
deleting the other line (`user-invocable: 'true'`), ensuring the frontmatter
contains only one `user-invocable` key.
plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md (1)

10-11: ⚠️ Potential issue | 🟡 Minor

Duplicate YAML frontmatter key: user-invocable appears twice.

The frontmatter contains both user-invocable: 'false' (line 10, quoted) and user-invocable: false (line 11, unquoted). YAML parsers will typically use the last occurrence, but this duplication is likely unintentional and should be cleaned up.

Proposed fix
   references: https://doc-detective.com, https://github.com/doc-detective/doc-detective, https://github.com/doc-detective/doc-detective-common
   user-invocable: 'false'
-user-invocable: false
 ---
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md` around
lines 10 - 11, Remove the duplicate YAML frontmatter key by keeping a single
consistent `user-invocable` entry in SKILL.md; choose either the boolean form
(user-invocable: false) or the quoted string (user-invocable: 'false') and
delete the other so the frontmatter contains only one `user-invocable` field.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md`:
- Around line 10-11: Remove the duplicate frontmatter key by keeping a single
canonical user-invocable declaration: delete the redundant string-valued
`user-invocable` inside the metadata block and retain the top-level boolean
`user-invocable: true` so the SKILL frontmatter is valid YAML and unambiguous;
ensure the remaining frontmatter parses correctly after removal.

---

Outside diff comments:
In `@plugins/doc-detective/skills/doc-detective-init/SKILL.md`:
- Around line 10-11: Remove the duplicate YAML frontmatter key `user-invocable`
in SKILL.md by keeping a single boolean entry (prefer unquoted true:
user-invocable: true) and deleting the other line (`user-invocable: 'true'`),
ensuring the frontmatter contains only one `user-invocable` key.

In `@plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md`:
- Around line 10-11: Remove the duplicate YAML frontmatter key by keeping a
single consistent `user-invocable` entry in SKILL.md; choose either the boolean
form (user-invocable: false) or the quoted string (user-invocable: 'false') and
delete the other so the frontmatter contains only one `user-invocable` field.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0805eba6-69e5-4c29-b16e-2cb5ffd31b20

📥 Commits

Reviewing files that changed from the base of the PR and between ef2bfa9 and 3a9f6cc.

📒 Files selected for processing (13)
  • commands/doc-detective-init.md
  • commands/doc-detective-init.toml
  • commands/doc-detective-install-github-action.md
  • commands/doc-detective-install-github-action.toml
  • plugins/doc-detective/skills/doc-detective-init/SKILL.md
  • plugins/doc-detective/skills/doc-detective-install-github-action/SKILL.md
  • plugins/doc-detective/skills/doc-detective-project-bootstrap/SKILL.md
  • skills/doc-detective-init/SKILL.md
  • skills/doc-detective-install-github-action/SKILL.md
  • skills/doc-detective-project-bootstrap/SKILL.md
  • src/skills/doc-detective-init/SKILL.md
  • src/skills/doc-detective-install-github-action/SKILL.md
  • src/skills/doc-detective-project-bootstrap/SKILL.md
✅ Files skipped from review due to trivial changes (1)
  • commands/doc-detective-install-github-action.toml

@hawkeyexl hawkeyexl merged commit 5ca1834 into main Mar 24, 2026
2 checks passed
@hawkeyexl hawkeyexl deleted the github-action branch March 24, 2026 18:14
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.

2 participants