# Constitution

> Constitution is an open-source agent skill for developer tools. Guides the agent to write and extend a project's golden-principles.yaml rule file. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/tansuasici/claude-code-kit/tree/main/.claude/skills/constitution
- **Repository:** https://github.com/tansuasici/claude-code-kit
- **GitHub stars:** 6
- **License:** MIT
- **Skill name:** constitution
- **Collection:** https://github.com/tansuasici/claude-code-kit
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

This skill helps an agent create or extend a project's golden-principles.yaml, a file of deterministic, grep-checkable coding rules. It can start from scratch for a new repository or infer candidate rules from existing code, and it proposes each rule with its severity, detection pattern and fix hint so the user can accept, edit or skip it before anything is written.

The workflow runs in phases: it inventories the primary language and architecture signals such as database clients, web frameworks, test runners and type-checking config, selects matching principle categories from a library, and then walks through candidates one at a time. Nothing is written to disk until all proposals have been confirmed. The skill only edits the principles file and, with explicit approval, a pointer section in CLAUDE.md; it does not change code or settings.

The skill expects a repository with a recognizable package manifest and works with the schema read by the companion quality-audit skill, which runs the rules against the codebase. It also documents an unattended mode for bootstrapping a baseline file.

## When your agent uses it

> Author or extend the project's golden-principles.yaml — interactively for new repos, or by inferring and confirming candidates from existing code. Use when defining project coding principles or quality gates. Pairs with /quality-audit, which reads the file.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/tansuasici/claude-code-kit/tree/HEAD/.claude/skills/constitution)
- [License: MIT](https://github.com/tansuasici/claude-code-kit/tree/HEAD/.claude/skills/constitution)

## Features

- **Interactive rule proposals:** Presents each candidate rule with its id, severity, detection pattern and fix hint for individual acceptance.
- **Stack-aware category selection:** Chooses rule categories based on detected language and architecture signals in the repository.
- **Additive file merging:** Appends accepted rules to an existing file while preserving comments, ordering and existing entries.
- **Severity-weighted schema:** Defines each rule with critical, major or minor severity and a grep or command based detection.
- **Companion audit integration:** Produces a file that the quality-audit skill reads to measure drift against the principles.
- **Unattended bootstrap mode:** Offers a headless run that auto-accepts library rules for baseline files in CI.

## Good for

- Set up a golden-principles file for a new TypeScript project
- Infer coding rules from an existing codebase and confirm them
- Add type-safety or testing quality gates to an existing repo
- Create a baseline principles file in a CI smoke test

## Install

### Claude Code

This skill ships in the `claude-code-kit` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add tansuasici/claude-code-kit
/plugin install claude-code-kit@claude-code-kit
```

Or copy only this skill to `~/.claude/skills/constitution`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/constitution &&
cp -R "$tmp/.claude/skills/constitution" ~/.claude/skills/constitution &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/constitution` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/constitution` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/constitution &&
cp -R "$tmp/.claude/skills/constitution" ~/.agents/skills/constitution &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/constitution` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/constitution` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/constitution &&
cp -R "$tmp/.claude/skills/constitution" ~/.cursor/skills/constitution &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/constitution` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/tansuasici/claude-code-kit.git --path .claude/skills/constitution
```

Or copy the folder to `~/.gemini/skills/constitution` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/constitution`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/constitution &&
cp -R "$tmp/.claude/skills/constitution" ~/.copilot/skills/constitution &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/constitution` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/tansuasici/claude-code-kit.git
```

Then copy `claude-code-kit/.claude/skills/constitution` into your agent's skills folder as `constitution`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Constitution trigger?

It is meant for defining project coding principles or quality gates, and is invoked with /constitution or when the user asks to set up principles or bootstrap quality rules.

### Does Constitution change my code?

No. It writes only the golden-principles.yaml file and, with explicit approval, a pointer section in CLAUDE.md when the file is newly created.

### Can Constitution overwrite existing rules?

No. Re-running only proposes new categories and appends accepted rules; it does not edit, remove or reorder existing entries.

### Where is the file saved?

By default in .claude/golden-principles.yaml, or at the repo root if a path is passed explicitly.

### How do I install Constitution in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/constitution to use it in all your projects, or to .claude/skills/constitution in one project. Or install the claude-code-kit plugin, which includes it: /plugin marketplace add tansuasici/claude-code-kit, then /plugin install claude-code-kit@claude-code-kit.

### Does Constitution run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Constitution?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Constitution?

The closest alternatives to Constitution are Writing rules, Quality audit, Skill generator, Rules and Principle encode lessons in structure.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Writing rules](https://ai-powered.com/skills/writing-rules-xiaolai): Writing rules is an open-source agent skill for developer tools.
- [Quality audit](https://ai-powered.com/skills/quality-audit): Quality audit is an open-source agent skill for developer tools.
- [Skill generator](https://ai-powered.com/skills/skill-generator): Skill generator is an open-source agent skill for developer tools.
- [Rules](https://ai-powered.com/skills/rules-xiaolai): Rules is an open-source agent skill for developer tools.
- [Principle encode lessons in structure](https://ai-powered.com/skills/principle-encode-lessons-in-structure): Principle encode lessons in structure is an open-source agent skill for developer tools.
- [Manage patterns and rules](https://ai-powered.com/skills/manage-patterns-and-rules): Manage patterns and rules is an open-source agent skill for developer tools.
- [Correct](https://ai-powered.com/skills/correct): Correct is an open-source agent skill for developer tools.
- [Code simplifier](https://ai-powered.com/skills/code-simplifier): Code simplifier is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/constitution
