Skip to content

Add update-skill --hook for automatic agent-toolkit skill updates - #10797

Merged
luigi617 merged 9 commits into
feat-automatic-skill-updatefrom
automatic-skill-update-command
Nov 11, 2026
Merged

luigi617 merged 9 commits into
feat-automatic-skill-updatefrom
automatic-skill-update-command

Conversation

@luigi617

@luigi617 luigi617 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Adds a --hook flag to aws agent-toolkit update-skill, for an agent's session start hook to keep AWS skills up to date automatically. Installed hooks run update-skill --hook --agent <agent>, so each hook only updates its own agent's skills. Installing the hooks into agent configs comes in a follow-up PR.

When automatic updates are turned on, a hook run:

  • Updates installed AWS skills in the agent given with --agent, or in every detected agent when --agent isn't set (the same as update-skill --all).
  • Installs new aws-core skills into skills directories that already have toolkit-installed skills. Directories the toolkit didn't create are left alone.
  • Checks each skills directory at most once every 24 hours, or 1 hour after a failed check. Directories are tracked separately in state.json by real path, so agents sharing a directory share one check.
  • Leaves installed skills that are no longer in the catalog untouched, without reporting them.
  • Prints a short summary in the format the --agent agent expects (Claude Code, Gemini CLI, Codex, Cursor, Kiro), as plain text for other agents or without --agent, and nothing if nothing changed.

--hook implies --all and can't be combined with --skill-name. An invalid --agent gives the same error as update-skill before the run starts.

Other changes:

  • Gemini CLI paths resolve against GEMINI_CLI_HOME when it's set.

Intentional design:

  • A core skill removed with remove-skill is installed again at the next check.
  • Updates replace the whole skill directory, so edits to a toolkit-installed skill are overwritten.

Testing:

  • Added unit tests for hook output per agent, the check interval and retry, per-directory results, skills dropped from the catalog, new core skill installs, lock handling, and GEMINI_CLI_HOME paths.
  • Tested manually on Linux, macOS and Windows.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@luigi617
luigi617 added this pull request to stack #10785 October 22, 2026 04:44
@luigi617
luigi617 force-pushed the automatic-skill-update-command branch 2 times, most recently from 76ca45c to e3e93d0 Compare October 22, 2026 17:20
@luigi617
luigi617 marked this pull request as ready for review October 22, 2026 17:50
@luigi617
luigi617 requested a review from a team as a code owner October 22, 2026 17:50
@luigi617
luigi617 force-pushed the automatic-skill-update-command branch from abdb544 to 3ca581a Compare November 3, 2026 21:18
Base automatically changed from automatic-skill-update-safe-update to feat-automatic-skill-update November 5, 2026 19:09
@luigi617
luigi617 force-pushed the automatic-skill-update-command branch from 3ca581a to 436fcaf Compare November 5, 2026 19:10

@AndrewAsseily AndrewAsseily left a comment

Copy link
Copy Markdown
Contributor

# Agents stop a hook after 60 seconds and report it as an error. A failed
# check is tried again after HOOK_RETRY_INTERVAL, so fail fast instead of
# retrying.
HOOK_CLIENT_CONFIG = Config(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All the agent toolkit operations are noAuth but since this config doesn't set signature_version, botocore still loads credentials when it creates the client and so if the default profile's aws login session has expired every hook run fails. Could we add signature_version=UNSIGNED?

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.

Addressed in 2b6cc29

@luigi617
luigi617 force-pushed the automatic-skill-update-command branch from 436fcaf to a02e194 Compare November 5, 2026 20:28
Luigi Liu added 8 commits November 6, 2026 14:36
Runs as an agent's session start hook: updates installed AWS skills,
installs new aws-core skills into agents that already have AWS skills,
prints what the agent expects, records the run and always succeeds. Hook
runs take turns and skip a run right after another for the same agent.

Installing the hooks into agent configs comes separately.
Record hook runs by agent id instead of the path of the agent's hook file,
so this command does not need to know where hooks are installed. Removes
hook_config_path and is_hook_supported from hooks.py, leaving the agent
ids and the output formatting the hook run uses.
Reverts 00c606b. last_hook_run stays keyed by the path of the agent's
hook config, as defined in automatic-skill-update-safe-update, so separate
config directories of one agent keep separate records. hook_config_path
only locates that file; it does not install or manage hooks.
@luigi617
luigi617 force-pushed the automatic-skill-update-command branch from a02e194 to 7fbe912 Compare November 6, 2026 19:37
@luigi617
luigi617 merged commit ad152f9 into feat-automatic-skill-update Nov 11, 2026
109 checks passed
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