Token导航 LogoToken导航

Agent Skill · 研究检索

openspec-constitution-guard(Openspec 宪法卫士)

openspec-constitution-guard 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

openspec-constitution-guard 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 58,786。

总安装 404周安装 17GitHub Stars 1下载 141核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:openspec-constitution-guard(Openspec 宪法卫士)
来源仓库:https://github.com/cyberelf/agent_skills
仓库路径:skills/openspec-constitution-guard
安装命令:
npx skills add https://github.com/cyberelf/agent_skills --skill openspec-constitution-guard
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cyberelf/agent_skills --skill openspec-constitution-guard

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

openspec-constitution-guard 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。通过 npx skills add 命令从 agent_skills 仓库安装该技能。

安装前需确认权限范围、维护状态,以及是否会触发联网或文件操作。建议结合原始 README 继续核验具体搜索逻辑和使用方式。

来源仓库内路径:skills/openspec-constitution-guard

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/cyberelf/agent_skills --skill openspec-constit…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

openspec-constitution-guard 怎么安装?

在终端执行 npx skills add https://github.com/cyberelf/agent_skills --skill openspec-constitution-guar…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

openspec-constitution-guard 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

openspec-constitution-guard 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

openspec-constitution-guard 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

openspec-constitution-guard 用的人多吗?

公开数据是累计安装 404 次,近一周安装 17 次,下载 141 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

openspec-constitution-guard 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
openspec-constitution-guard

Openspec 宪法卫士 · 本页

4041操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

OpenSpec Constitution Guard

This skill ensures OpenSpec workflows enforce project-specific quality assurance criteria derived from AGENTS.md constitution files by injecting them into openspec/config.yaml.

Purpose

OpenSpec workflows (/opsx:apply, /opsx:verify, /opsx:archive, etc.) include generic validation. This skill enriches them with project-specific quality gates extracted from AGENTS.md files across the workspace, ensuring all artifacts pass the project's defined testing and QA criteria before handoff.

When to Use

Trigger this skill when:

  • Initializing openspec for the first time in a project (openspec init)
  • An AGENTS.md file is created, modified, or deleted in the project
  • User explicitly requests to sync constitution quality gates with openspec config
  • Validating that openspec configuration is up-to-date with constitution requirements

Detection: When to Run

To detect if guards need composition:

  1. Check if openspec/config.yaml exists
  2. Look for <!-- CONSTITUTION-GUARD:START marker in the config file
  3. If marker is missing → first-time setup needed
  4. If AGENTS.md files have changed since Last Updated date → refresh needed

Workflow

Step 1: Locate All Constitution Files

Find all AGENTS.md files in the workspace:

find . -name "AGENTS.md" -type f | grep -v node_modules | grep -v .venv | grep -v target | grep -v openspec/AGENTS.md

Exclude openspec/AGENTS.md as it contains OpenSpec usage instructions already referenced by the system, not project-specific quality criteria.

Read each remaining file to understand its scope (root project, backend, frontend, specific module, etc.).

Step 2: Read and Understand Quality Criteria

For each AGENTS.md file, identify sections related to quality assurance. Look for:

  • Headings containing: "Quality", "Testing", "Checks", "Validation", "Assurance", "Checklist"
  • Command examples (typically in backticks or code blocks)
  • Goals or acceptance criteria (e.g., "Zero errors", "All tests pass")
  • Architecture patterns and coding standards that should be enforced

Key information to extract:

  1. Automated commands - What tools/commands must be run (e.g., pytest, npm run lint)
  2. Success criteria - What constitutes passing (e.g., "zero warnings")
  3. Architecture rules - Patterns that must be followed (e.g., "service layer separation")
  4. Testing requirements - Coverage expectations, test types needed
  5. Stack identification - What technology stack does this constitution govern

Step 3: Interpret Criteria for Artifacts

Map the extracted criteria to specific OpenSpec artifacts in the config.yaml rules:

For proposal Artifact

Extract rules that validate design decisions:

  • Architecture patterns that must be followed
  • Type safety requirements
  • Naming conventions
  • What requires a proposal vs direct fix
  • Breaking change documentation requirements
For specs Artifact

Extract rules that validate specification quality:

  • Required sections in specs
  • Format requirements (e.g., "Given/When/Then")
  • Edge cases that must be documented
  • API contract requirements
For design Artifact

Extract rules that validate technical design:

  • Design patterns to follow
  • System architecture requirements
  • Integration points to consider
  • Technology choices and their justification
For tasks Artifact

Extract rules that validate implementation planning:

  • Task breakdown requirements
  • Testing tasks that must be included
  • Documentation tasks
  • Deployment considerations
For General Context

Extract information that should be available to all artifacts:

  • Tech stack information
  • Coding conventions
  • Team practices
  • Backwards compatibility requirements

Step 4: Compose the config.yaml

Create or update openspec/config.yaml with the constitution guards. The file should include:

  1. Context section: Project-wide information injected into ALL artifacts
  2. Rules section: Per-artifact specific validation rules
  3. Constitution metadata: Source files and update timestamp

Template structure:

# openspec/config.yaml

# Schema selection (if you have a preferred one)
schema: spec-driven

# <!-- CONSTITUTION-GUARD:START - Auto-generated from AGENTS.md files -->
# Context injected into ALL artifacts
context: |
  [PROJECT-WIDE CONTEXT]

# Per-artifact validation rules
rules:
  proposal:
    - [PROPOSAL-SPECIFIC RULES]

  specs:
    - [SPECS-SPECIFIC RULES]

  design:
    - [DESIGN-SPECIFIC RULES]

  tasks:
    - [TASKS-SPECIFIC RULES]

# Constitution metadata
# Source Constitutions:
# - [List each AGENTS.md file path]
# Last Updated: [YYYY-MM-DD]
# <!-- CONSTITUTION-GUARD:END -->

Step 5: Update Configuration File

  1. Check if openspec/config.yaml exists

- If not, create it with initial configuration - If yes, read current content

  1. Locate the <!-- CONSTITUTION-GUARD:START marker
  2. If existing guard block found, replace it entirely
  3. If no existing block, append to the file
  4. Preserve any existing schema: declaration at the top
  5. Ensure proper YAML formatting is maintained

Critical: Always validate YAML syntax after generation to ensure the file is parseable.

Example Outputs

Example: Basic Configuration

After reading constitutions with Python backend and TypeScript frontend:

# openspec/config.yaml

schema: spec-driven

# <!-- CONSTITUTION-GUARD:START - Auto-generated from AGENTS.md files -->
# Context injected into ALL artifacts
context: |
  Tech stack: Python (FastAPI, Pydantic), TypeScript (React, Node.js), PostgreSQL
  Architecture: Service layer pattern - business logic in services/, API routes are thin
  Type safety: Strict typing required (no Any/any types)
  API style: RESTful with OpenAPI docs
  Testing: pytest + React Testing Library
  We value backwards compatibility for all public APIs

# Per-artifact validation rules
rules:
  proposal:
    - Include rollback plan for breaking changes
    - Mark breaking changes with **BREAKING** prefix
    - Identify affected teams/systems
    - Verify alignment with service layer architecture

  specs:
    - Use Given/When/Then format for scenarios
    - Document all edge cases and error conditions
    - Reference existing patterns before proposing new ones
    - Include API contract changes if applicable

  design:
    - Maintain service layer separation (logic in services/, not api/)
    - Use Pydantic models for all new data structures
    - Ensure strict typing (no Any types in Python/TypeScript)
    - Document integration points with existing services

  tasks:
    - Include unit test tasks for all new service logic
    - Include integration test tasks for API changes
    - Add type checking verification tasks
    - Include documentation update tasks

# Source Constitutions:
# - AGENTS.md
# - backend/AGENTS.md
# - frontend/AGENTS.md
# Last Updated: 2026-02-09
# <!-- CONSTITUTION-GUARD:END -->

Example: With Automated Check Commands

After reading constitutions with specific test commands:

# openspec/config.yaml

schema: spec-driven

# <!-- CONSTITUTION-GUARD:START - Auto-generated from AGENTS.md files -->
context: |
  Tech stack: Python (uv, FastAPI), TypeScript (Vite, React), PostgreSQL
  Automated checks required before completion:
  - Python: uv run pytest, uv run ruff check ., uv run pyright .
  - TypeScript: npm run lint, npm run tsc, npx playwright test
  Architecture: Microservices with event-driven communication
  All services must be independently deployable

rules:
  proposal:
    - Identify service boundaries affected
    - Document event schema changes
    - Include deployment strategy
    - Consider backwards compatibility for events

  specs:
    - Document event payloads in Given/When/Then scenarios
    - Include failure/retry scenarios
    - Specify service dependencies

  design:
    - Show event flow diagrams for cross-service changes
    - Use async/await patterns for I/O operations
    - Maintain service independence

  tasks:
    - Before marking complete, run: uv run pytest (Python)
    - Before marking complete, run: npm run lint && npm run tsc (TypeScript)
    - Include E2E test tasks for cross-service scenarios
    - Add event contract validation tasks

# Source Constitutions:
# - AGENTS.md
# - services/user/AGENTS.md
# - services/order/AGENTS.md
# Last Updated: 2026-02-09
# <!-- CONSTITUTION-GUARD:END -->

Example: Complex Multi-Stack Project

After reading constitutions from root, backend (Python), frontend (React), and mobile (Swift):

# openspec/config.yaml

schema: spec-driven

# <!-- CONSTITUTION-GUARD:START - Auto-generated from AGENTS.md files -->
context: |
  Multi-platform project with shared API

  Backend (Python):
  - FastAPI + SQLAlchemy + Alembic
  - Service layer required for all business logic
  - Commands: uv run pytest, uv run ruff check ., uv run mypy .

  Web Frontend (TypeScript/React):
  - Vite + React + TanStack Query
  - Commands: npm run lint, npm run type-check, npm test

  Mobile (Swift):
  - SwiftUI + Combine
  - Commands: swift test, swiftlint

  Shared API contracts documented in docs/api/
  Zero tolerance for breaking changes without migration plan

rules:
  proposal:
    - Mark platform scope (backend/web/mobile/api)
    - For API changes, document impact on all clients
    - Include migration strategy for breaking changes
    - Specify API versioning approach if needed

  specs:
    - Use platform-specific scenario tags: [Backend], [Web], [Mobile]
    - Document API contract changes in OpenAPI format
    - Include backwards compatibility scenarios
    - Reference existing patterns from project codebase

  design:
    - Show component/service interaction diagrams
    - Maintain service layer in backend (no logic in routes)
    - Use proper state management patterns per platform
    - Document data flow for cross-platform features

  tasks:
    - Group tasks by platform with clear labels
    - Backend: Include pytest, ruff, mypy verification
    - Web: Include lint, type-check, unit test tasks
    - Mobile: Include SwiftLint and unit test tasks
    - For API changes, include contract validation task
    - Include platform-specific E2E test tasks

# Source Constitutions:
# - AGENTS.md
# - backend/AGENTS.md
# - frontend/AGENTS.md
# - mobile/AGENTS.md
# Last Updated: 2026-02-09
# <!-- CONSTITUTION-GUARD:END -->

Interpretation Guidelines

When reading AGENTS.md files with varying structures:

  1. Look for imperative language: "MUST", "SHALL", "required", "always"
  2. Identify command patterns: Anything in backticks that looks like a shell command
  3. Find success criteria: Phrases like "zero errors", "all pass", "no warnings"
  4. Recognize stack indicators: Framework names, file extensions, folder names
  5. Extract checklists: Bullet points with checkboxes or numbered items

Categorizing Extracted Information

For Context (applies to all artifacts):

  • Technology stack descriptions
  • Architectural principles
  • Naming conventions
  • Team practices
  • Backwards compatibility requirements
  • General coding standards

For Rules (specific to artifacts):

  • Specific format requirements (e.g., "Use Given/When/Then")
  • Required sections in artifacts
  • Validation commands to run
  • Architecture patterns to enforce
  • Testing requirements
  • Documentation standards

If a constitution section is ambiguous, interpret conservatively—include the check rather than omit it.

All constitution items should be derived from project AGENTS.md files only, DO NOT include OpenSpec's own AGENTS.md or any common sense or best practices from other materials.

How OpenSpec Uses the Configuration

When an OpenSpec command generates or works with an artifact, your configuration is automatically injected:

Context Injection (ALL artifacts)

<context>
Tech stack: Python (FastAPI, Pydantic), TypeScript (React, Node.js), PostgreSQL
Architecture: Service layer pattern - business logic in services/, API routes are thin
Type safety: Strict typing required (no Any/any types)
...
</context>

<template>
[Schema's built-in template for this artifact]
</template>

Rules Injection (matching artifact only)

For /opsx:continue proposal or when generating a proposal:

<rules>
- Include rollback plan for breaking changes
- Mark breaking changes with **BREAKING** prefix
- Identify affected teams/systems
- Verify alignment with service layer architecture
</rules>

This ensures every artifact is generated with your project's specific requirements in mind.

Related OpenSpec Commands

Understanding which commands work with which artifacts:

CommandPurposeAffected Artifacts
/opsx:newStart a changeCreates change directory
/opsx:continueCreate next artifactproposal → specs → design → tasks
/opsx:ffFast-forward (create all planning)proposal, specs, design, tasks
/opsx:applyImplement tasksWorks from tasks.md
/opsx:verifyValidate implementationChecks against all artifacts
/opsx:syncMerge specs to mainUpdates openspec/specs/
/opsx:archiveComplete changeFinalizes and archives

Your constitution rules in config.yaml affect the quality and validation of artifacts throughout this workflow.

Maintenance

When updating guards:

  1. Re-read all AGENTS.md files
  2. Extract updated quality criteria
  3. Locate the <!-- CONSTITUTION-GUARD:START block in config.yaml
  4. Replace the entire block with newly generated content
  5. Preserve any existing schema: declaration at the top
  6. Validate YAML syntax
  7. Update the Last Updated timestamp
  8. Test with openspec new test-change to verify configuration loads correctly

Validation After Update

After updating config.yaml, verify it works:

# Check YAML syntax
python -c "import yaml; yaml.safe_load(open('openspec/config.yaml'))"

# Test with a dummy change
openspec new test-validation
# Check if context and rules are properly injected in artifacts

If you see errors about context or rules not being injected, check YAML indentation and structure.

平台分布

Codex

35%
按下载量换算49

Claude

30.43%
按下载量换算43

Cursor

19.41%
按下载量换算27

Gemini CLI

9.25%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills