Skip to content

Enhance plugin resolution and drift detection mechanisms#15

Merged
dtoms merged 7 commits into
af-mainfrom
dtoms-hook-cleanup
May 12, 2026
Merged

Enhance plugin resolution and drift detection mechanisms#15
dtoms merged 7 commits into
af-mainfrom
dtoms-hook-cleanup

Conversation

@dtoms
Copy link
Copy Markdown
Collaborator

@dtoms dtoms commented May 12, 2026

This pull request standardizes environment variable and path references from APPFOLIO_SPECKIT_PLUGIN_ROOT to CLAUDE_PLUGIN_ROOT throughout the documentation and extension hook scripts. It also introduces new documentation on version and schema drift detection, and clarifies when to bump the init_schema version. Additionally, it updates test instructions and documents the removal of certain git commit hooks.

Key changes include:

Environment variable and path standardization:

  • Replaced all references to APPFOLIO_SPECKIT_PLUGIN_ROOT with CLAUDE_PLUGIN_ROOT in extension hook markdown files and documentation to reflect the new environment variable and path convention. This affects hook dispatch logic and user instructions across multiple files, ensuring consistency and clarity for plugin root resolution. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]

Schema and version drift detection:

  • Added documentation on the new init_schema staleness warning and version drift detection mechanisms, including when and how to bump the init_schema integer in extension.yml and how the CLI handles mismatches to prompt users for re-initialization. [1] [2]

Test and hook documentation updates:

  • Updated test deselection instructions and documented the removal of git commit hooks, providing clarity on which hooks remain and how they are managed. [1] [2] [3]

Plugin root resolution improvement:

  • Changed the local plugin installation instructions to use a dedicated script for resolving the plugin root, improving reliability and maintainability.

General documentation improvements:

  • Clarified and expanded documentation in FORK.md and related files to guide contributors on extension management, hook architecture, and integration processes. [1] [2]

These changes collectively improve maintainability, user experience, and documentation clarity for the extension and its integration workflow.## Description

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

dtoms and others added 7 commits May 11, 2026 09:26
Replaces the inline find/sort/sed one-liner with a dedicated script that
reads plugin.json (authoritative), validates name == "sdd", and uses
semver-aware version sorting with pre-release awareness.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename APPFOLIO_SPECKIT_PLUGIN_ROOT to CLAUDE_PLUGIN_ROOT to align with
Claude Code plugin conventions. Switch hook instructions from cat to the
Read tool so the output enters conversation context rather than shell
output. Wire common.md to resolve-plugin-root.sh and add explicit guidance
to bind the resolved path in context once, then reuse.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eturn step

Remove the Step 1 cat of .specify/extensions.yml from all before-hooks —
the lifecycle machinery already enforces hook ordering, reading the
manifest inside each hook is redundant context bloat. Add a Final Step:
Return section to each hook telling Claude to hand off silently rather
than narrate what it resolved. Apply the CLAUDE_PLUGIN_ROOT rename and
Read tool directive consistently with the rest of the extension.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The hook changes in this PR depend on CLI behavior that will ship in
0.6.1.6. Once that release is tagged from af-main, users running older
CLIs will be prompted to upgrade.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reflect the env var rename in the hook architecture description and point
the dev setup instructions at resolve-plugin-root.sh instead of the
inline find/sort/sed command.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ersion

Print FORCE_UPGRADE_VERSION (0.0.0) from `specify-af version` when the
repo schema (init-options.json speckit_version) is behind the CLI, or
when the installed sdd plugin's minimum_cli_version exceeds the CLI.
The deployed check-version.sh sorts 0.0.0 below its MINIMUM, fires
VERSION_FAIL, and common.md surfaces the re-init prompt.

Also warns on every invocation (except init) when the project's installed
AF extension init_schema differs from the CLI-bundled value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…NIMUM

Rewrite check-version.sh to check two drift axes:
- CLI vs sdd plugin's minimum_cli_version (VERSION_FAIL)
- repo schema (init-options.json speckit_version) vs CLI (SCHEMA_STALE)

MINIMUM is now read dynamically from plugin.json rather than hardcoded.
common.md handles both VERSION_FAIL and SCHEMA_STALE with a unified
re-init prompt showing the relevant version values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dtoms dtoms merged commit c4608d9 into af-main May 12, 2026
2 of 5 checks passed
@dtoms dtoms deleted the dtoms-hook-cleanup branch May 12, 2026 01: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.

1 participant