Get the FREE Ultimate OpenClaw Setup Guide →

migrating-agent-systems

Scanned
npx machina-cli add skill wayne930242/Reflexive-Claude-Code/migrating-agent-systems --openclaw
Files (1)
SKILL.md
6.7 KB

Migrating Agent Systems

Overview

Migrating agent systems IS orchestrating component creation through skills.

Don't create files directly—invoke the appropriate skill for each component type.

Core principle: Skills encode best practices. Direct file creation bypasses them.

Violating the letter of the rules is violating the spirit of the rules.

Task Initialization (MANDATORY)

Before ANY action, create task list using TaskCreate:

TaskCreate for EACH task below:
- Subject: "[migrating-agent-systems] Task N: <action>"
- ActiveForm: "<doing action>"

Tasks:

  1. Project discovery
  2. Architecture planning
  3. Create constitution (CLAUDE.md)
  4. Create rules
  5. Create hooks
  6. Create skills (if needed)
  7. Validate system

Announce: "Created 7 tasks. Starting execution..."

Execution rules:

  1. TaskUpdate status="in_progress" BEFORE starting each task
  2. TaskUpdate status="completed" ONLY after verification passes
  3. If task fails → stay in_progress, diagnose, retry
  4. NEVER skip to next task until current is completed
  5. At end, TaskList to confirm all completed

Task 1: Project Discovery

Goal: Understand the project before configuring agent system.

Invoke project-discovery skill (if available) or manually:

Discover:

  • Tech stack (language, framework, build tools)
  • Project structure (key directories)
  • Existing workflows (CI/CD, testing, linting)
  • Conventions (naming, architecture patterns)

Output: Discovery report with key findings.

Verification: Have documented tech stack and structure.

Task 2: Architecture Planning

Goal: Design the agent system components.

Invoke agent-architect skill (if available) or manually plan:

Component Planning

ComponentPurposeNeeded?
CLAUDE.mdConstitution with lawsAlways
RulesPath-scoped conventionsIf conventions exist
HooksQuality gatesIf linting/formatting needed
SkillsProject-specific capabilitiesIf repeated workflows
AgentsSpecialized subagentsIf isolated tasks needed

Output: List of components to create with details.

Verification: Have component list with rationale for each.

Task 3: Create Constitution (CLAUDE.md)

Goal: Create the project's CLAUDE.md with appropriate laws.

CRITICAL: Invoke the writing-claude-md skill.

Do not write CLAUDE.md directly. The skill ensures:

  • Proper <law> block format
  • Verifiable, actionable laws
  • Self-Reinforcing Display law
  • Quality review via claudemd-reviewer

Typical laws to consider:

  • Communication style (language, verbosity)
  • Code conventions (if critical)
  • Version sync requirements
  • Documentation requirements

Verification: CLAUDE.md created and passes claudemd-reviewer.

Task 4: Create Rules

Goal: Create rule files for project conventions.

For each convention identified in discovery:

CRITICAL: Invoke the writing-rules skill.

Common rules:

  • Code style (paths: **/*.ts)
  • API conventions (paths: src/api/**)
  • Test conventions (paths: **/*.test.ts)

Skip if: No conventions need enforcement.

Verification: All planned rules created.

Task 5: Create Hooks

Goal: Create quality gate hooks.

For each quality check needed:

CRITICAL: Invoke the writing-hooks skill.

Common hooks:

  • Linting (ESLint, Ruff)
  • Formatting (Prettier)
  • Type checking (TypeScript, mypy)

Skip if: No quality gates needed.

Verification: All planned hooks created and working.

Task 6: Create Skills (if needed)

Goal: Create project-specific skills.

Only create skills for:

  • Repeated workflows specific to this project
  • Complex processes that need documentation
  • Team knowledge that should be encoded

CRITICAL: Invoke the writing-skills skill.

Skip if: No project-specific capabilities needed.

Verification: All planned skills created.

Task 7: Validate System

Goal: Verify the entire agent system works.

Checklist:

  • CLAUDE.md exists with <law> block
  • Laws display at start of responses
  • Rules inject on matching files
  • Hooks block violations
  • Skills activate on triggers

Test sequence:

  1. Start new Claude Code session
  2. Verify laws display
  3. Work on files matching rules—verify injection
  4. Write violating code—verify hook blocks

Verification: All components work together.

Skill Invocation Reference

ComponentSkill to Invoke
CLAUDE.mdwriting-claude-md
Ruleswriting-rules
Hookswriting-hooks
Skillswriting-skills
Agentswriting-subagents

NEVER create these files directly. Always use the skill.

Red Flags - STOP

These thoughts mean you're rationalizing. STOP and reconsider:

  • "I can write CLAUDE.md directly"
  • "Skip discovery, I know this stack"
  • "Don't need rules, just laws"
  • "Hooks are overkill"
  • "Skip validation, I used the skills"

All of these mean: You're about to create a weak agent system. Follow the process.

Common Rationalizations

ExcuseReality
"Write directly"Skills encode best practices. Use them.
"Skip discovery"Assumptions lead to misfit systems. Discover first.
"Just laws"Laws + rules + hooks = defense in depth.
"Hooks overkill"Hooks catch what humans miss. Worth it.
"Skip validation"Untested systems fail in production. Validate.

Flowchart: Agent System Migration

digraph migrate_agent {
    rankdir=TB;

    start [label="Setup agent\nsystem", shape=doublecircle];
    discover [label="Task 1: Project\ndiscovery", shape=box];
    plan [label="Task 2: Architecture\nplanning", shape=box];
    claude_md [label="Task 3: Create\nCLAUDE.md", shape=box];
    rules [label="Task 4: Create\nrules", shape=box];
    hooks [label="Task 5: Create\nhooks", shape=box];
    skills [label="Task 6: Create\nskills", shape=box];
    validate [label="Task 7: Validate\nsystem", shape=box];
    valid [label="All\nworking?", shape=diamond];
    done [label="System ready", shape=doublecircle];

    start -> discover;
    discover -> plan;
    plan -> claude_md;
    claude_md -> rules;
    rules -> hooks;
    hooks -> skills;
    skills -> validate;
    validate -> valid;
    valid -> done [label="yes"];
    valid -> plan [label="no\nrevisit"];
}

References

  • project-discovery skill for analyzing projects
  • agent-architect skill for planning components
  • All writing-* skills for creating components

Source

git clone https://github.com/wayne930242/Reflexive-Claude-Code/blob/main/plugins/rcc/skills/migrating-agent-systems/SKILL.mdView on GitHub

Overview

Migrating Agent Systems orchestrates component creation for Claude Code agent setups. It enforces governance by using dedicated skills for each component instead of direct file edits, embedding best practices. It defines a mandatory 7-task initialization flow and a strict execution protocol to guide discovery, architecture, constitution, rules, hooks, skills, and validation.

How This Skill Works

Before any action, the skill issues TaskCreate for seven tasks with clear subjects and actions. During execution, each task is updated to in_progress before starting and marked completed only after verification passes; if a task fails, it diagnoses and retries without skipping ahead. The process ends with a TaskList confirmation that all tasks are completed.

When to Use It

  • Setting up a new Claude Code agent system
  • Migrating an existing agent system to new requirements
  • Configuring CLAUDE.md constitution with proper laws
  • Creating conventions with rules and hooks
  • Validating and finalizing the agent system governance

Quick Start

  1. Step 1: Create the task list for all 7 tasks using TaskCreate with Subject and ActiveForm for each
  2. Step 2: Announce: 'Created 7 tasks. Starting execution...'
  3. Step 3: Execute tasks in order: set status to in_progress, verify results, then set to completed; diagnose and retry on failures; finalize with TaskList

Best Practices

  • Run project discovery first to map tech stack and structure
  • Always invoke the project-specific skills (project-discovery, agent-architect, writing-claude-md, writing-rules, writing-hooks) rather than manual file edits
  • Follow the 7-task initialization and the execution rules exactly
  • Document verification for each task (evidence) and log findings
  • Confirm completion with a final TaskList check

Example Use Cases

  • A team migrating an existing Claude Code agent to a new project folder with updated laws and rules
  • Setting up a fresh Claude Code agent system for a greenfield project and wiring governance from the start
  • Reconfiguring rules/hooks to align with a stricter linting and formatting policy
  • Adding or updating CLAUDE.md with revised laws after architecture changes
  • Running a full task-driven migration to ensure governance and traceability

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers