Smith constitution

From ATTCKDigital/smith · View interactive version

Smith constitution is an AI agent skill from the GitHub repository ATTCKDigital/smith. Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.

How to use this skill

Skill file

Workflow requirement (Smith 20+): This skill must be invoked from inside an active top-level workflow (/smith-new, /smith-bugfix, /smith-debug, /smith-build). The workflow-gate hook will block standalone invocation. To use this skill standalone, start a top-level workflow first.

Vault Logging

Throughout this action, log significant events to the vault session log. Read the session log path from .smith/vault/.current-session. If the file is missing or the vault is not initialized, skip all logging silently.

Timestamps are UTC. HH:MM:SS comes from date -u +%H:%M:%S — never a local clock, never a time from memory. The append already runs through a shell, so read the clock in that same command (TS=$(date -u +%H:%M:%S)) and spend no extra tool call. Substitute the resulting value: an unexpanded $(...) reaching the log is a known regression and will not parse. Every hook-written stamp in this log is date -u, so a local-clock entry lands hours away from its neighbours and skews the workflow window hooks/workflow_summary_lib.py derives from them.

Append entries using this format:

### [HH:MM:SS] /smith-constitution <event>

**User Request:**
> <verbatim user message that triggered this action>

**Synthesized Input:** <brief summary>
**Outcome:** <what happened>
**Artifacts:** <files modified>
**Systems affected:** <system IDs>

Log at these points:

  1. On invocation — what is being changed (new constitution or amendment)
  2. After amendments applied — summary of principles added, modified, or removed
  3. After propagation — which templates or artifacts were updated as a result

User Input

$ARGUMENTS

You MUST consider the user input before proceeding (if not empty).

Outline

You are updating the project constitution at .specify/memory/constitution.md. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. [PROJECT_NAME], [PRINCIPLE_1_NAME]). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.

Follow this execution flow:

  1. Load the existing constitution template at .specify/memory/constitution.md.

IMPORTANT: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.

  1. Collect/derive values for placeholders:
  1. Draft the updated constitution content:
  1. Consistency propagation checklist (convert prior checklist into active validations):
  1. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
  1. Validation before final output:
  1. Write the completed constitution back to .specify/memory/constitution.md (overwrite).
  1. Output a final summary to the user with:

Formatting & Style Requirements:

If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.

If critical info missing (e.g., ratification date truly unknown), insert TODO(<FIELD_NAME>): explanation and include in the Sync Impact Report under deferred items.

Do not create a new template; always operate on the existing .specify/memory/constitution.md file.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.