Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,44 @@

All notable changes to the Specify CLI and templates are documented here.

# [0.12.15+adlc3] - 2026-07-15

### Added

- **Skill Check step in preset commands**: All 11 preset command files in
`agentic-sdlc` (9 `adlc.spec.*` + `adlc.spec.specify`) and `agentic-quick`
(`adlc.quick.implement`) now include a generic "Skill Check" step before the
extension hook checks. This bridges the ambient AGENTS.md "Strict Compliance"
directive ("You MUST check if a skill applies BEFORE responding") into the
command's procedural flow, preventing the "STOP. execute extension hooks"
tunnel from overriding it. The step is fully generic — it does not name
any specific skill.
- **team-ai-directives discovery hooks**: The `team-ai-directives` extension
now declares `before_specify` and `before_plan` hooks (mandatory) in its
`extension.yml`. On install/update, `register_hooks()` writes these to
`.specify/extensions.yml`, so the spec workflow's existing hook-check logic
auto-invokes `/team.discover` before `/spec.specify` and `/spec.plan`.
Previously the hooks were documented in `team.discover.md` but never
declared in the manifest — leaving personas, rules, examples, and team
skills undiscovered.
- **Test**: `test_team_ai_directives_declares_hooks` in
`test_bundled_extension_hooks.py` verifies the manifest declares both hooks
with the correct command and `optional: false`.

### Changed

- **Strengthened AGENTS.md injection**: The "Strict Compliance" bullet injected
by `update-agent-context.sh` / `.ps1` / `.py` now reads "This is not optional
and applies to every interaction" (previously just "If a skill applies, you
MUST invoke it immediately"). Makes the directive harder to deprioritize
against procedural command outlines.

### Migration

- Existing workspaces: run `specify extension update team-ai-directives` to
populate the new `before_specify` / `before_plan` hooks in
`.specify/extensions.yml`.

# [0.12.15+adlc2] - 2026-07-15

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ trap 'rm -f "$TMP_SECTION"' EXIT
echo "## Team Directives & Constitution"
echo
echo "This project is bound by the team-ai-directives knowledge base."
echo "- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately."
echo "- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately. This is not optional and applies to every interaction."
echo "- **Team Constitution**: Read and strictly adhere to the principles in \`$TEAM_DIRECTIVES/context_modules/constitution.md\`. When creating or updating the project's constitution, you MUST inherit and align with these principles."
echo "- **Rules, Personas & Examples**: Use the \`team-discover\` skill to find and load relevant rules, personas, or examples before making changes."
echo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ if ($TeamDirectives) {
$lines += '## Team Directives & Constitution'
$lines += ''
$lines += 'This project is bound by the team-ai-directives knowledge base.'
$lines += '- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately.'
$lines += '- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately. This is not optional and applies to every interaction.'
$lines += "- **Team Constitution**: Read and strictly adhere to the principles in \`$TeamDirectives/context_modules/constitution.md\`. When creating or updating the project's constitution, you MUST inherit and align with these principles."
$lines += "- **Rules, Personas & Examples**: Use the \`team-discover\` skill to find and load relevant rules, personas, or examples before making changes."
$lines += ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def _build_section(
"## Team Directives & Constitution",
"",
"This project is bound by the team-ai-directives knowledge base.",
"- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately.",
"- **Strict Compliance**: You MUST check if a skill applies BEFORE responding to any task or question. If a skill applies, you MUST invoke it immediately. This is not optional and applies to every interaction.",
f"- **Team Constitution**: Read and strictly adhere to the principles in `{team_directives}/context_modules/constitution.md`. When creating or updating the project's constitution, you MUST inherit and align with these principles.",
"- **Rules, Personas & Examples**: Use the `team-discover` skill to find and load relevant rules, personas, or examples before making changes.",
"",
Expand Down
5 changes: 5 additions & 0 deletions extensions/team-ai-directives/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 4.2.0 - 2026-07-15

- **Register discovery hooks**: Add `hooks:` block to `extension.yml` declaring `before_specify` and `before_plan` hooks (both mandatory, `optional: false`) pointing at `adlc.team-ai-directives.discover`. This makes `register_hooks(manifest)` populate `extensions.yml` during install/update, so the spec workflow's pre-execution hook checks auto-invoke team-discover before `/spec.specify` and `/spec.plan`. Previously the `team.discover.md` command file documented these hooks but the manifest never declared them — a documentation/reality gap that left team context (personas, rules, examples, skills) undiscovered.
- **Migration**: Existing workspaces should run `specify extension update team-ai-directives` to write the new hooks to `.specify/extensions.yml`.

## 4.0.0 - 2026-07-09

- Repackage team-ai-directives as a bundled spec-kit extension with governance commands and skills.
Expand Down
12 changes: 11 additions & 1 deletion extensions/team-ai-directives/extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ schema_version: "1.0"
extension:
id: "team-ai-directives"
name: "Team AI Directives"
version: "4.1.0"
version: "4.2.0"
description: "Bundled governance extension for team-ai-directives: discover, curate, evolve, repair, verify, and manage team skills. Governance commands and skills are bundled here; domain skills remain in the external knowledge base."
author: "Agentic SDLC Team"
repository: "https://github.com/tikalk/agentic-sdlc-spec-kit"
Expand Down Expand Up @@ -62,6 +62,16 @@ handoffs:
prompt: "Run health checks on the repaired knowledge base"
send: false

hooks:
before_specify:
command: adlc.team-ai-directives.discover
optional: false
description: "Discover team context before specification"
before_plan:
command: adlc.team-ai-directives.discover
optional: false
description: "Discover team context before planning"

tags:
- "team-ai-directives"
- "governance"
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-quick/commands/adlc.quick.implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ Display:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
2. Read `{REPO_ROOT}/.specify/extensions.yml` and find `hooks.before_implement`.
3. Skip any hook with `enabled: false`. Skip any hook with a non-empty `condition`.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.analyze.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.brainstorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ handoffs:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.clarify.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.constitution.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ handoffs:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.converge.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.specify.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ scripts:

**Execute ONLY read-only discovery hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to Mission Brief Extraction.
2. Read `{REPO_ROOT}/.specify/extensions.yml` and find `hooks.before_specify`.
Expand Down
2 changes: 2 additions & 0 deletions presets/agentic-sdlc/commands/adlc.spec.tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ scripts:

**STOP. Before reading User Input or doing ANY other work, execute extension hooks.**

**Skill Check**: Review the available skills listed in your system context. If any skill applies to this task, invoke it immediately via the skill tool and wait for its output before proceeding. This step enforces the "Strict Compliance" directive in AGENTS.md.

0. Determine `{REPO_ROOT}` by running `git rev-parse --show-toplevel 2>/dev/null`. If that fails, walk up from the current directory until you find a `.git` directory or `.specify/init-options.json` and use that parent as `{REPO_ROOT}`.
1. If `{REPO_ROOT}/.specify/extensions.yml` does not exist, state `No hooks file found` and skip to User Input.
If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agentic-sdlc-specify-cli"
version = "0.12.15+adlc2"
version = "0.12.15+adlc3"
description = "Specify CLI (tikalk fork). Agentic SDLC toolkit for Spec-Driven Development with pre-installed extensions and AI integrations."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
42 changes: 42 additions & 0 deletions tests/test_bundled_extension_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,45 @@ def test_hook_update_replaces_existing_hook(temp_project, extension_with_hooks):

assert before_hook["description"] == "Updated description"
assert before_hook["optional"] is True # Should be updated


def test_team_ai_directives_declares_hooks():
"""Test that the bundled team-ai-directives extension declares hooks.

The extension must register before_specify and before_plan hooks so that
team-discover is auto-invoked by the spec workflow's pre-execution hook
checks. Without these declarations, register_hooks() writes nothing and
the agent never triggers team-discover during /spec.specify or /spec.plan.
"""
ext_yml = (
Path(__file__).resolve().parent.parent
/ "extensions"
/ "team-ai-directives"
/ "extension.yml"
)
assert ext_yml.exists(), "team-ai-directives/extension.yml must exist"

manifest = yaml.safe_load(ext_yml.read_text())
assert "hooks" in manifest, (
"team-ai-directives extension.yml must declare a 'hooks' block "
"so that register_hooks() populates extensions.yml during install"
)

hooks = manifest["hooks"]
assert "before_specify" in hooks, (
"team-ai-directives must register a before_specify hook to auto-invoke "
"team-discover before /spec.specify"
)
assert hooks["before_specify"]["command"] == "adlc.team-ai-directives.discover"
assert hooks["before_specify"]["optional"] is False, (
"before_specify hook should be mandatory (optional: false)"
)

assert "before_plan" in hooks, (
"team-ai-directives must register a before_plan hook to auto-invoke "
"team-discover before /spec.plan"
)
assert hooks["before_plan"]["command"] == "adlc.team-ai-directives.discover"
assert hooks["before_plan"]["optional"] is False, (
"before_plan hook should be mandatory (optional: false)"
)
Loading