Skip to content

Commit 006b597

Browse files
committed
fix(preset): restore constitution command with hook-based architecture, v0.5.13
1 parent a9c5857 commit 006b597

3 files changed

Lines changed: 110 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ All notable changes to the Specify CLI and templates are documented here.
44

55
# [Unreleased]
66

7-
# [0.5.12] - 2025-04-23
7+
# [0.5.13] - 2026-04-23
8+
9+
### Fixed
10+
11+
- **Restored constitution command**: `adlc.spec.constitution` command now restored to agentic-sdlc preset
12+
- Uses hook-based architecture (`before_constitution` hook)
13+
- Integrates with team-ai-directives extension for team principles loading
14+
- Follows same pattern as other preset commands (adlc.spec.plan, adlc.spec.clarify, etc.)
15+
- No custom scripts required - pure hook-based loading
16+
17+
# [0.5.12] - 2026-04-23
818

919
### Changed
1020

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
description: Create or update the project constitution with team principles, ensuring governance alignment across the project.
3+
handoffs:
4+
- label: Specify Feature
5+
agent: adlc.spec.specify
6+
prompt: Create the feature specification based on the updated constitution
7+
send: true
8+
---
9+
10+
## User Input
11+
12+
```text
13+
$ARGUMENTS
14+
```
15+
16+
You **MUST** consider the user input before proceeding (if not empty).
17+
18+
### Parameters
19+
20+
Parse the following parameters from `$ARGUMENTS`:
21+
22+
## Pre-Execution Hooks
23+
24+
**Check for extension hooks (before constitution)**:
25+
- Check if `{REPO_ROOT}/.specify/extensions.yml` exists in the project root
26+
- If it exists, read it and look for entries under the `hooks.before_constitution` key
27+
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
28+
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
29+
- For hooks with conditions, skip condition evaluation (leave to HookExecutor)
30+
- For hooks without conditions, treat as executable
31+
32+
**For each executable hook**:
33+
- **Optional hook** (`optional: true`):
34+
```
35+
## Extension Hooks
36+
37+
**Optional Pre-Hook**: {extension}
38+
Command: `/{command}`
39+
Description: {description}
40+
41+
This is an optional hook. You can choose to skip it.
42+
```
43+
Wait for the result of the hook command before proceeding to the Outline.
44+
45+
- **Mandatory hook** (`optional: false`):
46+
```
47+
## Extension Hooks
48+
49+
**Mandatory Pre-Hook**: {extension}
50+
Command: `/{command}`
51+
Description: {description}
52+
53+
You **MUST** execute this hook before proceeding.
54+
```
55+
Wait for the result of the hook command before proceeding to the Outline.
56+
57+
## Outline
58+
59+
You are updating or creating the project constitution at `{REPO_ROOT}/constitution.md`. This document defines the governance principles, decision-making framework, and team conventions for the project.
60+
61+
Follow this execution flow:
62+
63+
1. **Check for existing constitution**:
64+
- Look for `{REPO_ROOT}/constitution.md`
65+
- If it exists, load it to understand current governance principles
66+
- If not, you'll create from template
67+
68+
2. **Load team constitution principles** (via pre-execution hook):
69+
- The `before_constitution` hook should have loaded team principles from team-ai-directives
70+
- Extract core principles from the hook output (look for "Team Constitution Principles" block)
71+
- These principles should inform your project-level governance decisions
72+
73+
3. **Determine update scope** (from user input or existing constitution):
74+
- **New constitution**: Create from `presets/agentic-sdlc/templates/constitution-template.md`
75+
- **Amend existing**: Update specific principles/sections as requested
76+
- **Full review**: Validate all principles against team constitution
77+
78+
4. **Draft the constitution**:
79+
- Replace template placeholders with project-specific values
80+
- Incorporate team principles where applicable
81+
- Ensure governance sections are complete (principles, roles, processes, escalation)
82+
83+
5. **Output the constitution**:
84+
- Write to `{REPO_ROOT}/constitution.md`
85+
- Confirm the file location in your response
86+
87+
## Post-Execution
88+
89+
Report the constitution status:
90+
91+
```markdown
92+
## Constitution Updated
93+
94+
- **Location**: `{REPO_ROOT}/constitution.md`
95+
- **Principles**: Number of core principles defined
96+
- **Team Alignment**: How team principles were incorporated
97+
- **Version**: Updated version number (semver: MAJOR for governance changes, MINOR for new principles, PATCH for clarifications)
98+
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentic-sdlc-specify-cli"
3-
version = "0.5.11"
3+
version = "0.5.13"
44
description = "Specify CLI (tikalk fork). Agentic SDLC toolkit for Spec-Driven Development with pre-installed extensions and AI integrations."
55
requires-python = ">=3.11"
66
dependencies = [

0 commit comments

Comments
 (0)