Skip to content
Agentmart
Submit a tool

plan-0-v2-constitution

Establish or refresh the project constitution and align the supporting norms documents before any planning phases begin.

Skill by AI-Substrate

IndexedMIT
Write a review

Chalk Labs

Need help deploying plan-0-v2-constitution?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ai-substrate-plan-0-v2-constitution

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Establish or refresh the project constitution and align the supporting norms documents before any planning phases begin. Re-entrant command that preserves user customizations during updates. Domain-aware v2.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/plan-0-v2-constitution

What's inside

Skill name
plan-0-v2-constitution
Description
Establish or refresh the project constitution and align the supporting norms documents before any planning phases begin. Re-entrant command that preserves user customizations during updates. Domain-aware v2.
License
MIT
Instructions
467 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

Please deep think / ultrathink as this is a complex task.

# plan-0-constitution (alias: phase-0-constitution)

**Re-entrancy Support**: This command is now re-entrant and will intelligently preserve user customizations when updating existing constitution files. Mark your custom content with `<!-- USER CONTENT START -->` and `<!-- USER CONTENT END -->` for guaranteed preservation across updates.

````md
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding (if not empty).

User input:

$ARGUMENTS

You are updating the project doctrine files in `docs/project-rules/`:
- `docs/project-rules/constitution.md`  (Constitution – guiding principles and governance)
- `docs/project-rules/rules.md`         (Rules – normative MUST/SHOULD statements)
- `docs/project-rules/idioms.md`        (Idioms – recurring patterns and examples)
- `docs/project-rules/architecture.md`  (Architecture – structure, boundaries, interaction contracts)

If any document uses placeholder tokens like `[ALL_CAPS_IDENTIFIER]`, your responsibility is to gather the values, fill or intentionally defer them, and keep all three files mutually consistent. Downstream templates or command prompts may reference these files; when they exist, update them last so they reflect the newly agreed doctrine.

--------------------------------
## Execution Flow (deterministic)
1) Resolve repository paths and detect mode
   - If your environment supplies a repository metadata helper (e.g., a prerequisites script defined in command front matter), run it once and parse the returned JSON. Otherwise derive values from the current working directory.
   - Set constants:
     CONST = `docs/project-rules/constitution.md`
     RULES = `docs/project-rules/rules.md`
     IDIOMS = `docs/project-rules/idioms.md`
     ARCH  = `docs/project-rules/architecture.md`
     TMPL  = `templates/`  # Optional helper content if present
   - Ensure parent directories exist; create them atomically when missing.

   **Domain Detection** (additive — skip if no domains present):
   - Check if `docs/domains/registry.md` exists → read all registered domains
   - Check if `docs/domains/domain-map.md` exists → read the domain architecture diagram
   - If domains directory exists but no registry → read `docs/domains/*/domain.md` files directly
   - If NO domain infrastructure exists: note "Domain system not yet initialized" — do NOT auto-create domain files (use `/plan-v2-extract-domain` when ready)
   - Store domain context for use in Steps 4 and 6 (governance and architecture sections)

   **Re-entrancy Detection**:
   - Check if any of CONST, RULES, IDIOMS, ARCH already exist
   - If ANY exist: **UPDATE MODE** - Will preserve user customizations
   - If NONE exist: **CREATE MODE** - Will create fresh documents
   - Display mode to user: "🔄 Updating existing constitution..." or "✨ Creating new constitution..."

2) Launch parallel context gatherers

**IMPORTANT**: Use **parallel subagent gatherers** for faster doctrine loading.

**Strategy**: Launch 4 parallel subagents (single message with 4 Task tool calls) to gather doctrine context concurrently.

**Subagent 1: Doctrine Loader (Re-entrancy Aware)**
"Load existing doctrine files and categorize content for preservation.

**Tasks**:
- For each of CONST, RULES, IDIOMS, ARCH:
  * If file exists:
    - Read fully and extract version number, [PLACEHOLDER] tokens, section headings, TODOs
    - Identify sections marked with `<!-- USER CONTENT START -->` and `<!-- USER CONTENT END -->`
    - Categorize each section as: 'generated' (safe to update), 'custom' (must preserve), or 'mixed' (needs merge)
    - Extract any filled placeholder values that replaced `[ALL_CAPS_TOKENS]`
    - Note custom sections not in standard template
  * If missing: Note for creation with minimal outline

**Categorization Rules**:
- Content between USER CONTENT markers = 'custom'
- Standard template sections without modifications = 'generated'
- Standard sections with significant user additions = 'mixed'
- Entirely new user-added sections = 'custom'

**Output**: JSON with {file_path, exists, version, placeholders[], headings[], todos[],
  sections[{name, type, content, preserve}], custom_additions[], filled_values{}}

**Return**: Results for all 4 files with preservation metadata."

**Subagent 2: Context Gatherer**
"Gather project governance and quality inputs from documentation.

**Priority order**: $ARGUMENTS > README.md > CONTRIBUTING.md > other handbooks

**Extract**:
- Guiding principles and values
- Quality/verification strategy and testing philosophy
- Delivery practices and governance rules
- Record source for each value (argument, README, etc.)

**Output**: JSON with {principles[], quality_strategy, delivery_practices, governance, sources{}}
Flag unknowns as 'UNKNOWN: <reason>' for TODO handling."

**Subagent 3: Template Scanner**
"Inventory templates and commands that reference doctrine.

**Scan**:
- skills/**/SKILL.md (and any `.claude/commands/*.md`) for references to constitution, rules, idioms, architecture
- templates/ directory for similar references

**Output**: JSON with {file_path, references_to[], link_format, expected_paths[]}
Note any hardcoded paths or placeholders that need updating."

**Subagent 4: Version Analyzer**
"Determine semantic version bump.

**Given**:
- Current versions from Subagent 1
- Changes from Subagent 2 ($ARGUMENTS and context)

**Apply rules**:
- MAJOR: Breaking changes to principles or governance
- MINOR: New principles/sections or materially expanded guidance
- PATCH: Clarifications or formatting adjustments

**Output**: JSON with {current_version, new_version, bump_type, rationale}
Include amendment date as ISO 8601."

**Wait for All Gatherers**: Block until all 4 subagents complete.

3) Synthesize gathered context and prepare merge strategy
   - Merge outputs from all 4 subagents into unified doctrine view
   - Conflict resolution: $ARGUMENTS > explicit docs > inferred > UNKNOWN

From AI-Substrate/harness-engineering, MIT.

More from AI-Substrate/harness-engineering

Signals

Stars
0
Forks
0
Open issues
42
Last commit (this folder)
Jul 6, 2026 (3 months ago)
Last release
Aug 30, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from AI-Substrate

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get plan-0-v2-constitution running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying plan-0-v2-constitution?

CallGet help
Cite this page

plan-0-v2-constitution skill. Agent Mart. https://agentmart.dev/skills/ai-substrate-plan-0-v2-constitution (last updated 2026-10-24)