|
| 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 | +``` |
0 commit comments