AgentSkillsCN

speckit.constitution

根据交互式输入或既定原则,创建或更新项目宪法,确保所有依赖模板始终保持同步。当您启动新的Speckit项目,或对项目原则进行更新时,可使用此技能。

SKILL.md
--- frontmatter
name: speckit.constitution
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync. Use when starting a new Speckit project or updating project principles.

Speckit Constitution Command Executor

This skill executes the official GitHub Speckit /speckit.constitution command.

Execution Protocol

When this skill is invoked, you MUST:

1. Load the Original Command File

Read and parse .opencode/commands/speckit.constitution.md from the current project directory.

2. Process OpenCode Command Syntax

The command file uses special syntax that MUST be processed before execution:

SyntaxAction
$ARGUMENTSReplace with user-provided arguments after the command
$1, $2, etc.Replace with positional arguments
@filepathRead the file at filepath and insert its full contents
!command``Execute the shell command and insert its stdout

3. Execute the Processed Instructions

After syntax processing, follow all instructions in the command file exactly as written, including:

  • Running any .specify/scripts/*.ps1 or .specify/scripts/*.sh scripts mentioned
  • Reading/writing files as specified
  • Interacting with the user as directed
  • Producing all required outputs

4. Maintain Speckit Workflow Integrity

  • Honor the handoffs defined in the command's YAML frontmatter
  • Suggest the next command in the workflow when complete
  • Preserve all Speckit conventions (file paths, naming, structure)

User Input

text
$ARGUMENTS

Fallback

If .opencode/commands/speckit.constitution.md does not exist, check for:

  • .opencode/command/speckit.constitution.md (legacy path)
  • .specify/commands/speckit.constitution.md (alternative path)

If no command file is found, report an error and suggest running specify init first.