Agent skill

Spec Setup

by catlog22 in catlog22/Claude-Code-Workflow

Initialize project-level state and configure specs via interactive questionnaire.

MITAuto-check: notes

Install Spec Setup

skills CLI
$ npx skills add catlog22/Claude-Code-Workflow --skill spec-setup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install catlog22/Claude-Code-Workflow spec-setup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/spec-setup .claude/skills/spec-setup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
spec-setup
GitHub stars
2.1k
Token cost
~6.5k tokens
SKILL.md length
559 words
Files
1
Skills in repo
82
Repo updated
First seen
Licence
MIT

At a glance

Initialize project-level state and configure specs via interactive questionnaire.

  • Works in 7 steps: Parse Input and Check Existing State → Get Project Metadata → Invoke cli-explore-agent (Subagent) → …
  • SKILL.md covers Overview, Usage, Execution Process and Implementation, plus 2 more sections
  • Calls git

What it does

Spec Setup is an agent skill from catlog22/Claude-Code-Workflow. Initialize project-level state and configure specs via interactive questionnaire.

Its SKILL.md is about 6.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: JSON-driven multi-agent cadence-team development framework with intelligent CLI orchestration (Gemini/Qwen/Codex), context-first architecture, and automated workflow execution. The licence is MIT.

Example prompts

  • “/spec-setup”

Requirements

  • Pre-approved tools (allowed-tools): spawn_agent, wait_agent, send_message, followup_task, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Parse Input and Check Existing State
  2. Get Project Metadata
  3. Invoke cli-explore-agent (Subagent)
  4. Initialize Spec System (if not --skip-specs)
  5. Multi-Round Interactive Questionnaire (if not --skip-specs)
  6. Write specs/*.md (if not --skip-specs)
  7. Display Summary

What it can do on your machine

Read from SKILL.md and the folder at commit 07491b0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • spawn_agent
    • wait_agent
    • send_message
    • followup_task
    • close_agent
    • request_user_input
    • Read
    • Write
    • Edit
    • Bash

    …and 2 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Spec Setup loads about 6.5k tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 559 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~6.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: spawn_agent, wait_agent, send_message, followup_task, close_agent, request_user_input, Read, Write, 

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from catlog22/Claude-Code-Workflow at commit 07491b0, republished under its MIT licence (© catlog22). 559 words, ~6,484 tokens.

Download SKILL.mdSave it as .claude/skills/spec-setup/SKILL.md (or your agent's skills folder).
name
spec-setup
description
Initialize project-level state and configure specs via interactive questionnaire.
allowed-tools
spawn_agent, wait_agent, send_message, followup_task, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep
argument-hint
[--regenerate] [--skip-specs] [--reset]

Workflow Spec Setup Command

Overview

Initialize .workflow/project-tech.json and .ccw/specs/*.md with comprehensive project understanding by delegating analysis to cli-explore-agent, then interactively configure project guidelines through a multi-round questionnaire.

Dual File System:

  • project-tech.json: Auto-generated technical analysis (stack, architecture, components)
  • specs/*.md: User-maintained rules and constraints (created and populated interactively)

Design Principle: Questions are dynamically generated based on the project's tech stack, architecture, and patterns -- not generic boilerplate.

Note: This command may be called by other workflow commands. Upon completion, return immediately to continue the calling workflow without interrupting the task flow.

Usage

bash
$spec-setup                 # Initialize (skip if exists)
$spec-setup --regenerate    # Force regeneration of project-tech.json
$spec-setup --skip-specs    # Initialize project-tech only, skip spec initialization and questionnaire
$spec-setup --reset         # Reset specs content before questionnaire

Execution Process

Input Parsing:
   |- Parse --regenerate flag -> regenerate = true | false
   |- Parse --skip-specs flag -> skipSpecs = true | false
   +- Parse --reset flag -> reset = true | false

Decision:
   |- BOTH_EXIST + no --regenerate + no --reset -> Exit: "Already initialized"
   |- EXISTS + --regenerate -> Backup existing -> Continue analysis
   |- EXISTS + --reset -> Reset specs, keep project-tech -> Skip to questionnaire
   +- NOT_FOUND -> Continue full flow

Full Flow:
   |- Step 1: Parse input and check existing state
   |- Step 2: Get project metadata (name, root)
   |- Step 3: Invoke cli-explore-agent (subagent)
   |   |- Structural scan (get_modules_by_depth.sh, find, wc)
   |   |- Semantic analysis (Gemini CLI)
   |   |- Synthesis and merge
   |   +- Write .workflow/project-tech.json
   |- Step 4: Initialize Spec System (if not --skip-specs)
   |   |- Check if specs/*.md exist
   |   |- If NOT_FOUND -> Run ccw spec init
   |   +- Run ccw spec rebuild
   |- Step 5: Multi-Round Interactive Questionnaire (if not --skip-specs)
   |   |- Check if guidelines already populated -> Ask: "Append / Reset / Cancel"
   |   |- Load project context from project-tech.json
   |   |- Round 1: Coding Conventions (coding_style, naming_patterns)
   |   |- Round 2: File & Documentation Conventions (file_structure, documentation)
   |   |- Round 3: Architecture & Tech Constraints (architecture, tech_stack)
   |   |- Round 4: Performance & Security Constraints (performance, security)
   |   +- Round 5: Quality Rules (quality_rules)
   |- Step 6: Write specs/*.md (if not --skip-specs)
   +- Step 7: Display Summary

Output:
   |- .workflow/project-tech.json (+ .backup if regenerate)
   +- .ccw/specs/*.md (scaffold or configured, unless --skip-specs)

Implementation

Step 1: Parse Input and Check Existing State

Parse flags:

javascript
const regenerate = $ARGUMENTS.includes('--regenerate')
const skipSpecs = $ARGUMENTS.includes('--skip-specs')
const reset = $ARGUMENTS.includes('--reset')

Check existing state:

bash
bash(test -f .workflow/project-tech.json && echo "TECH_EXISTS" || echo "TECH_NOT_FOUND")
bash(test -f .ccw/specs/coding-conventions.md && echo "SPECS_EXISTS" || echo "SPECS_NOT_FOUND")

If BOTH_EXIST and no --regenerate and no --reset: Exit early

Project already initialized:
- Tech analysis: .workflow/project-tech.json
- Guidelines: .ccw/specs/*.md

Use $spec-setup --regenerate to rebuild tech analysis
Use $spec-setup --reset to reconfigure guidelines
Use $spec-add to add individual rules
Use $workflow-status --project to view state
Step 2: Get Project Metadata
bash
bash(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
bash(git rev-parse --show-toplevel 2>/dev/null || pwd)
bash(mkdir -p .workflow)
Step 3: Invoke cli-explore-agent (Subagent)

For --regenerate: Backup and preserve existing data

bash
bash(cp .workflow/project-tech.json .workflow/project-tech.json.backup)

Delegate analysis to subagent:

javascript
let exploreAgent = null

try {
  exploreAgent = spawn_agent({
    agent_type: "cli_explore_agent",
    message: `
## TASK ASSIGNMENT

### MANDATORY FIRST STEPS (Agent Execute)
1. Read: .workflow/project-tech.json (if exists, for --regenerate)

---

Analyze project for workflow initialization and generate .workflow/project-tech.json.

## MANDATORY FIRST STEPS
1. Execute: cat ~/.ccw/workflows/cli-templates/schemas/project-tech-schema.json (get schema reference)
2. Execute: ccw tool exec get_modules_by_depth '{}' (get project structure)

## Task
Generate complete project-tech.json following the schema structure:
- project_name: "${projectName}"
- initialized_at: ISO 8601 timestamp
- overview: {
    description: "Brief project description",
    technology_stack: {
      languages: [{name, file_count, primary}],
      frameworks: ["string"],
      build_tools: ["string"],
      test_frameworks: ["string"]
    },
    architecture: {style, layers: [], patterns: []},
    key_components: [{name, path, description, importance}]
  }
- features: []
- development_index: ${regenerate ? 'preserve from backup' : '{feature: [], enhancement: [], bugfix: [], refactor: [], docs: []}'}
- statistics: ${regenerate ? 'preserve from backup' : '{total_features: 0, total_sessions: 0, last_updated: ISO timestamp}'}
- _metadata: {initialized_by: "cli-explore-agent", analysis_timestamp: ISO timestamp, analysis_mode: "deep-scan"}

## Analysis Requirements

**Technology Stack**:
- Languages: File counts, mark primary
- Frameworks: From package.json, requirements.txt, go.mod, etc.
- Build tools: npm, cargo, maven, webpack, vite
- Test frameworks: jest, pytest, go test, junit

**Architecture**:
- Style: MVC, microservices, layered (from structure & imports)
- Layers: presentation, business-logic, data-access
- Patterns: singleton, factory, repository
- Key components: 5-10 modules {name, path, description, importance}

## Execution
1. Structural scan: get_modules_by_depth.sh, find, wc -l
2. Semantic analysis: Gemini for patterns/architecture
3. Synthesis: Merge findings
4. ${regenerate ? 'Merge with preserved development_index and statistics from .workflow/project-tech.json.backup' : ''}
5. Write JSON: Write('.workflow/project-tech.json', jsonContent)
6. Report: Return brief completion summary

Project root: ${projectRoot}
`
  })

  // Wait for completion
  const result = wait_agent({ timeout_ms: 1800000 })

  if (result.timed_out) {
    // Status probe
    followup_task({ target: exploreAgent, message: "STATUS_CHECK: Report current progress, findings so far, and estimated remaining work." })
    const status = wait_agent({ timeout_ms: 180000 })  // 3 min
    if (status.timed_out) {
      // Force finalize
      followup_task({ target: exploreAgent, message: "FINALIZE: Output all current findings immediately. Time limit reached.", interrupt: true })
      const forced = wait_agent({ timeout_ms: 180000 })  // 3 min
      if (forced.timed_out) {
        close_agent({ target: exploreAgent })
        throw new Error('Agent timeout')
      }
    }
  }

} finally {
  if (exploreAgent) close_agent({ target: exploreAgent })
}
Step 4: Initialize Spec System (if not --skip-specs)
javascript
// Skip spec initialization if --skip-specs flag is provided
if (!skipSpecs) {
  // Initialize spec system if not already initialized
  const specsCheck = Bash('test -f .ccw/specs/coding-conventions.md && echo EXISTS || echo NOT_FOUND')
  if (specsCheck.includes('NOT_FOUND')) {
    console.log('Initializing spec system...')
    Bash('ccw spec init')
    Bash('ccw spec rebuild')
  }
} else {
  console.log('Skipping spec initialization and questionnaire (--skip-specs)')
}

If --skip-specs is provided, skip directly to Step 7 (Display Summary) with limited output.

Step 5: Multi-Round Interactive Questionnaire (if not --skip-specs)
Step 5.0: Check Existing Guidelines

If guidelines already have content, ask the user how to proceed:

javascript
// Check if specs already have content via ccw spec list
const specsList = Bash('ccw spec list --json 2>/dev/null || echo "{}"')
const specsData = JSON.parse(specsList)
const isPopulated = (specsData.total || 0) > 5  // More than seed docs

if (isPopulated && !reset) {
  const mode = functions.request_user_input({
    questions: [{
      header: "Guidelines",
      id: "mode",
      question: "Project guidelines already contain entries. How would you like to proceed?",
      options: [
        { label: "Append(Recommended)", description: "Keep existing entries and add new ones from the wizard" },
        { label: "Reset", description: "Clear all existing entries and start fresh" },
        { label: "Cancel", description: "Exit without changes" }
      ]
    }]
  })  // BLOCKS (wait for user response)

  // If Cancel -> exit
  // If Reset -> clear all arrays before proceeding
  // If Append -> keep existing, wizard adds to them
}

// If --reset flag was provided, clear existing entries before proceeding
if (reset) {
  // Reset specs content
  console.log('Resetting existing guidelines...')
}
Step 5.1: Load Project Context
javascript
// Load project context via ccw spec load for planning context
const projectContext = Bash('ccw spec load --category planning 2>/dev/null || echo "{}"')
const specData = JSON.parse(projectContext)

// Extract key info from loaded specs for generating smart questions
const languages = specData.overview?.technology_stack?.languages || []
const primaryLang = languages.find(l => l.primary)?.name || languages[0]?.name || 'Unknown'
const frameworks = specData.overview?.technology_stack?.frameworks || []
const testFrameworks = specData.overview?.technology_stack?.test_frameworks || []
const archStyle = specData.overview?.architecture?.style || 'Unknown'
const archPatterns = specData.overview?.architecture?.patterns || []
const buildTools = specData.overview?.technology_stack?.build_tools || []
Step 5.2: Multi-Round Questionnaire

Each round uses request_user_input with project-aware options. The user can always select "Other" to provide custom input.

CRITICAL: After each round, collect the user's answers and convert them into guideline entries. Do NOT batch all rounds -- process each round's answers before proceeding to the next.


Round 1: Coding Conventions

Generate options dynamically based on detected language/framework:

javascript
// Build language-specific coding style options
const codingStyleOptions = []

if (['TypeScript', 'JavaScript'].includes(primaryLang)) {
  codingStyleOptions.push(
    { label: "Strict TypeScript", description: "Use strict mode, no 'any' type, explicit return types for public APIs" },
    { label: "Functional style", description: "Prefer pure functions, immutability, avoid class-based patterns where possible" },
    { label: "Const over let", description: "Always use const; only use let when reassignment is truly needed" }
  )
} else if (primaryLang === 'Python') {
  codingStyleOptions.push(
    { label: "Type hints", description: "Use type hints for all function signatures and class attributes" },
    { label: "Functional style", description: "Prefer pure functions, list comprehensions, avoid mutable state" },
    { label: "PEP 8 strict", description: "Strict PEP 8 compliance with max line length 88 (Black formatter)" }
  )
} else if (primaryLang === 'Go') {
  codingStyleOptions.push(
    { label: "Error wrapping", description: "Always wrap errors with context using fmt.Errorf with %w" },
    { label: "Interface first", description: "Define interfaces at the consumer side, not the provider" },
    { label: "Table-driven tests", description: "Use table-driven test pattern for all unit tests" }
  )
}
// Add universal options
codingStyleOptions.push(
  { label: "Early returns", description: "Prefer early returns / guard clauses over deep nesting" }
)

// Round 1: Coding Conventions
const round1 = functions.request_user_input({
  questions: [
    {
      header: "Code Style",
      id: "coding_style",
      question: `Your project uses ${primaryLang}. Which coding style conventions do you follow?`,
      options: codingStyleOptions.slice(0, 3) // Max 3 options
    },
    {
      header: "Naming",
      id: "naming",
      question: `What naming conventions does your ${primaryLang} project use?`,
      options: [
        { label: "camelCase variables", description: "Variables and functions use camelCase (e.g., getUserName)" },
        { label: "PascalCase types", description: "Classes, interfaces, type aliases use PascalCase (e.g., UserService)" },
        { label: "UPPER_SNAKE constants", description: "Constants use UPPER_SNAKE_CASE (e.g., MAX_RETRIES)" }
      ]
    }
  ]
})  // BLOCKS (wait for user response)

Process Round 1 answers -> add to conventions.coding_style and conventions.naming_patterns arrays.


Round 2: File Structure & Documentation
javascript
// Round 2: File Structure & Documentation
const round2 = functions.request_user_input({
  questions: [
    {
      header: "File Org",
      id: "file_structure",
      question: `Your project has a ${archStyle} architecture. What file organization rules apply?`,
      options: [
        { label: "Co-located tests", description: "Test files live next to source files (e.g., foo.ts + foo.test.ts)" },
        { label: "Separate test dir", description: "Tests in a dedicated __tests__ or tests/ directory" },
        { label: "One export per file", description: "Each file exports a single main component/class/function" }
      ]
    },
    {
      header: "Docs",
      id: "documentation",
      question: "What documentation standards does your project follow?",
      options: [
        { label: "JSDoc/docstring public APIs", description: "All public functions and classes must have JSDoc/docstrings" },
        { label: "Inline comments for why", description: "Comments explain 'why', not 'what' -- code should be self-documenting" },
        { label: "No comment requirement", description: "Code should be self-explanatory; comments only for non-obvious logic" }
      ]
    }
  ]
})  // BLOCKS (wait for user response)

Process Round 2 answers -> add to conventions.file_structure and conventions.documentation.


Round 3: Architecture & Tech Stack Constraints
javascript
// Build architecture-specific options
const archOptions = []

if (archStyle.toLowerCase().includes('monolith')) {
  archOptions.push(
    { label: "No circular deps", description: "Modules must not have circular dependencies" },
    { label: "Layer boundaries", description: "Strict layer separation: UI -> Service -> Data (no skipping layers)" }
  )
} else if (archStyle.toLowerCase().includes('microservice')) {
  archOptions.push(
    { label: "Service isolation", description: "Services must not share databases or internal state" },
    { label: "API contracts", description: "All inter-service communication through versioned API contracts" }
  )
}
archOptions.push(
  { label: "Stateless services", description: "Service/business logic must be stateless (state in DB/cache only)" },
  { label: "Dependency injection", description: "Use dependency injection for testability, no hardcoded dependencies" }
)

// Round 3: Architecture & Tech Stack Constraints
const round3 = functions.request_user_input({
  questions: [
    {
      header: "Architecture",
      id: "architecture",
      question: `Your ${archStyle} architecture uses ${archPatterns.join(', ') || 'various'} patterns. What architecture constraints apply?`,
      options: archOptions.slice(0, 3)
    },
    {
      header: "Tech Stack",
      id: "tech_stack",
      question: `Tech stack: ${frameworks.join(', ')}. What technology constraints apply?`,
      options: [
        { label: "No new deps without review", description: "Adding new dependencies requires explicit justification and review" },
        { label: "Pin dependency versions", description: "All dependencies must use exact versions, not ranges" },
        { label: "Prefer native APIs", description: "Use built-in/native APIs over third-party libraries when possible" }
      ]
    }
  ]
})  // BLOCKS (wait for user response)

Process Round 3 answers -> add to constraints.architecture and constraints.tech_stack.


Round 4: Performance & Security Constraints
javascript
// Round 4: Performance & Security Constraints
const round4 = functions.request_user_input({
  questions: [
    {
      header: "Performance",
      id: "performance",
      question: "What performance requirements does your project have?",
      options: [
        { label: "API response time", description: "API endpoints must respond within 200ms (p95)" },
        { label: "Bundle size limit", description: "Frontend bundle size must stay under 500KB gzipped" },
        { label: "No N+1 queries", description: "Database access must avoid N+1 query patterns" }
      ]
    },
    {
      header: "Security",
      id: "security",
      question: "What security requirements does your project enforce?",
      options: [
        { label: "Input sanitization", description: "All user input must be validated and sanitized before use" },
        { label: "No secrets in code", description: "No API keys, passwords, or tokens in source code -- use env vars" },
        { label: "Auth on all endpoints", description: "All API endpoints require authentication unless explicitly public" }
      ]
    }
  ]
})  // BLOCKS (wait for user response)

Process Round 4 answers -> add to constraints.performance and constraints.security.


Round 5: Quality Rules
javascript
// Round 5: Quality Rules
const round5 = functions.request_user_input({
  questions: [
    {
      header: "Quality",
      id: "quality",
      question: `Testing with ${testFrameworks.join(', ') || 'your test framework'}. What quality rules apply?`,
      options: [
        { label: "Min test coverage", description: "Minimum 80% code coverage for new code; no merging below threshold" },
        { label: "No skipped tests", description: "Tests must not be skipped (.skip/.only) in committed code" },
        { label: "Lint must pass", description: "All code must pass linter checks before commit (enforced by pre-commit)" }
      ]
    }
  ]
})  // BLOCKS (wait for user response)

Process Round 5 answers -> add to quality_rules array as { rule, scope, enforced_by } objects.

Show full SKILL.md (242 more words)Show less
Step 6: Write specs/*.md (if not --skip-specs)

For each category of collected answers, append rules to the corresponding spec MD file. Each spec file uses YAML frontmatter with readMode, priority, category, and keywords.

Category Assignment: Based on the round and question type:

  • Round 1-2 (conventions): category: general (applies to all stages)
  • Round 3 (architecture/tech): category: planning (planning phase)
  • Round 4 (performance/security): category: execution (implementation phase)
  • Round 5 (quality): category: execution (testing phase)
javascript
// Helper: append rules to a spec MD file with category support
// Uses .ccw/specs/ directory (same as frontend/backend spec-index-builder)
function appendRulesToSpecFile(filePath, rules, defaultCategory = 'general') {
  if (rules.length === 0) return

  // Ensure .ccw/specs/ directory exists
  const specDir = path.dirname(filePath)
  if (!fs.existsSync(specDir)) {
    fs.mkdirSync(specDir, { recursive: true })
  }

  // Check if file exists
  if (!file_exists(filePath)) {
    // Create file with frontmatter including category
    const frontmatter = `---
title: ${filePath.includes('conventions') ? 'Coding Conventions' : filePath.includes('constraints') ? 'Architecture Constraints' : 'Quality Rules'}
readMode: optional
priority: medium
category: ${defaultCategory}
scope: project
dimension: specs
keywords: [${defaultCategory}, ${filePath.includes('conventions') ? 'convention' : filePath.includes('constraints') ? 'constraint' : 'quality'}]
---

# ${filePath.includes('conventions') ? 'Coding Conventions' : filePath.includes('constraints') ? 'Architecture Constraints' : 'Quality Rules'}

`
    Write(filePath, frontmatter)
  }

  const existing = Read(filePath)
  // Append new rules as markdown list items after existing content
  const newContent = existing.trimEnd() + '\n' + rules.map(r => `- ${r}`).join('\n') + '\n'
  Write(filePath, newContent)
}

// Write conventions (general category) - use .ccw/specs/ (same as frontend/backend)
appendRulesToSpecFile('.ccw/specs/coding-conventions.md',
  [...newCodingStyle, ...newNamingPatterns, ...newFileStructure, ...newDocumentation],
  'general')

// Write constraints (planning category)
appendRulesToSpecFile('.ccw/specs/architecture-constraints.md',
  [...newArchitecture, ...newTechStack, ...newPerformance, ...newSecurity],
  'planning')

// Write quality rules (execution category)
if (newQualityRules.length > 0) {
  const qualityPath = '.ccw/specs/quality-rules.md'
  if (!file_exists(qualityPath)) {
    Write(qualityPath, `---
title: Quality Rules
readMode: required
priority: high
category: execution
scope: project
dimension: specs
keywords: [execution, quality, testing, coverage, lint]
---

# Quality Rules

`)
  }
  appendRulesToSpecFile(qualityPath,
    newQualityRules.map(q => `${q.rule} (scope: ${q.scope}, enforced by: ${q.enforced_by})`),
    'execution')
}

// Rebuild spec index after writing
Bash('ccw spec rebuild')
Answer Processing Rules

When converting user selections to guideline entries:

  1. Selected option -> Use the option's description as the guideline string (it's more precise than the label)
  2. "Other" with custom text -> Use the user's text directly as the guideline string
  3. Deduplication -> Skip entries that already exist in the guidelines (exact string match)
  4. Quality rules -> Convert to { rule: description, scope: "all", enforced_by: "code-review" } format
Step 7: Display Summary
javascript
const projectTech = JSON.parse(Read('.workflow/project-tech.json'));

if (skipSpecs) {
  // Minimal summary for --skip-specs mode
  console.log(`
Project initialized successfully (tech analysis only)

## Project Overview
Name: ${projectTech.project_name}
Description: ${projectTech.overview.description}

### Technology Stack
Languages: ${projectTech.overview.technology_stack.languages.map(l => l.name).join(', ')}
Frameworks: ${projectTech.overview.technology_stack.frameworks.join(', ')}

### Architecture
Style: ${projectTech.overview.architecture.style}
Components: ${projectTech.overview.key_components.length} core modules

---
Files created:
- Tech analysis: .workflow/project-tech.json
- Specs: (skipped via --skip-specs)
${regenerate ? '- Backup: .workflow/project-tech.json.backup' : ''}

Next steps:
- Use $spec-setup (without --skip-specs) to configure guidelines
- Use $spec-add to create individual specs
- Use $workflow-plan to start planning
`);
} else {
  // Full summary with guidelines stats
  const countConventions = newCodingStyle.length + newNamingPatterns.length
    + newFileStructure.length + newDocumentation.length
  const countConstraints = newArchitecture.length + newTechStack.length
    + newPerformance.length + newSecurity.length
  const countQuality = newQualityRules.length

  // Get updated spec list
  const specsList = Bash('ccw spec list --json 2>/dev/null || echo "{}"')

  console.log(`
Project initialized and guidelines configured

## Project Overview
Name: ${projectTech.project_name}
Description: ${projectTech.overview.description}

### Technology Stack
Languages: ${projectTech.overview.technology_stack.languages.map(l => l.name).join(', ')}
Frameworks: ${projectTech.overview.technology_stack.frameworks.join(', ')}

### Architecture
Style: ${projectTech.overview.architecture.style}
Components: ${projectTech.overview.key_components.length} core modules

### Guidelines Summary
- Conventions: ${countConventions} rules added to coding-conventions.md
- Constraints: ${countConstraints} rules added to architecture-constraints.md
- Quality rules: ${countQuality} rules added to quality-rules.md

Spec index rebuilt. Use \`ccw spec list\` to view all specs.

---
Files created:
- Tech analysis: .workflow/project-tech.json
- Specs: .ccw/specs/ (configured)
${regenerate ? '- Backup: .workflow/project-tech.json.backup' : ''}

Next steps:
- Use $spec-add to add individual rules later
- Specs are auto-loaded via hook on each prompt
- Use $workflow-plan to start planning
`);
}

Error Handling

SituationAction
Agent FailureFall back to basic initialization with placeholder overview
Missing ToolsAgent uses Qwen fallback or bash-only
Empty ProjectCreate minimal JSON with all gaps identified
No project-tech.json (when --reset without prior init)Run full flow from Step 2
User cancels mid-wizardSave whatever was collected so far (partial is better than nothing)
File write failureReport error, suggest manual edit
  • $spec-add - Interactive wizard to create individual specs with scope selection
  • $session-sync - Quick-sync session work to specs and project-tech
  • $workflow-plan - Start planning with initialized project context
  • $workflow-status --project - View project state and guidelines

© catlog22, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .codex/skills/spec-setup of catlog22/Claude-Code-Workflow.

Open the folder on GitHubat commit 07491b0

Compare with similar skills

Spec Setup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Spec Setup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Spec Setup this skillcatlog22/Claude-Code-Workflow2.1k—~6.5kAutomated safety check: NotesMIT
Spec Writergarrytan/gstack136k—~14kAutomated safety check: NotesMIT
Micro Interaction SpecOwl-Listener/designer-skills2.9k1 repos~467Automated safety check: PassMIT
Specgarden-co/classic-jazz2.5k—~1.3kAutomated safety check: PassMIT
Spec Driven Workflowalirezarezvani/claude-skills28k—~3.9kAutomated safety check: PassMIT
Import On Interactionthedaviddias/Front-End-Checklist74k—~537Automated safety check: PassMIT

Similar skills

  • Spec Writer

    garrytan/gstack

    Converts a vague idea into a precise, executable spec in five phases, files it as an issue and can start an agent on it in a fresh worktree.

    136k GitHub stars~14k tokensUpdated today
    DevelopmentAuto-check: notes
  • Micro Interaction Spec

    Owl-Listener/designer-skills

    Specify one micro-interaction completely — trigger, rules, feedback, loops, and modes.

    2.9k GitHub starsUsed in 1 repo~467 tokens
    Frontend & DesignAuto-check passed
  • Spec

    garden-co/classic-jazz

    Implement features using Spec Driven Development (SDD) workflow.

    2.5k GitHub stars~1.3k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Spec Driven Workflow

    alirezarezvani/claude-skills

    A skill your agent uses when the user asks to write specs before code, define acceptance criteria, plan features before implementation, generate tests from specifications, or follow spec-first…

    28k GitHub stars~3.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Import On Interaction

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing slow initial loads caused by optional features.

    74k GitHub stars~537 tokensUpdated yesterday
    Auto-check passed
  • Sparc Spec

    ruvnet/ruflo

    Run the SPARC Specification phase — gather requirements, define acceptance criteria, identify constraints, and store the spec in memory

    74k GitHub stars~1.1k tokensUpdated today
    Product & Project ManagementAuto-check: notes

More from catlog22/Claude-Code-Workflow

All 82 skills in this repo
  • Prompt Generator

    catlog22/Claude-Code-Workflow

    Generate or convert Claude Code prompt files — command orchestrators, skill files, agent role definitions, or style conversion of existing files.

    2.1k GitHub starsUsed in 1 repo~4.7k tokens
    Auto-check: notes
  • Ccw Help

    catlog22/Claude-Code-Workflow

    CCW command help system. An agent skill from catlog22/Claude-Code-Workflow.

    2.1k GitHub stars~2.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Team Ultra Analyze

    catlog22/Claude-Code-Workflow

    Deep collaborative analysis team skill. An agent skill from catlog22/Claude-Code-Workflow.

    2.1k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check: notes
  • Brainstorm

    catlog22/Claude-Code-Workflow

    Unified brainstorming skill with dual-mode operation — auto mode (framework generation, parallel multi-role analysis, cross-role synthesis) and single role analysis.

    2.1k GitHub stars~4.8k tokensUpdated 3 mo ago
    Auto-check: notes
  • Ccw Chain

    catlog22/Claude-Code-Workflow

    Chain-based CCW workflow orchestrator. An agent skill from catlog22/Claude-Code-Workflow.

    2.1k GitHub stars~1.1k tokensUpdated 3 mo ago
    Auto-check: notes
  • Delegation Check

    catlog22/Claude-Code-Workflow

    Check workflow delegation prompts against agent role definitions for content separation violations.

    2.1k GitHub stars~2.8k tokensUpdated 3 mo ago
    Auto-check: notes

Questions about Spec Setup

What does Spec Setup do?

Initialize project-level state and configure specs via interactive questionnaire. Spec Setup is an agent skill from catlog22/Claude-Code-Workflow. Initialize project-level state and configure specs via interactive questionnaire.

How do I install Spec Setup in Claude Code?

Run `npx skills add catlog22/Claude-Code-Workflow --skill spec-setup -a claude-code`. Or copy the skill folder (.codex/skills/spec-setup in catlog22/Claude-Code-Workflow) into .claude/skills/spec-setup in your project. Claude Code loads it when a task matches its description.

How do I install Spec Setup in Codex?

Run `npx skills add catlog22/Claude-Code-Workflow --skill spec-setup -a codex`. Or copy the skill folder (.codex/skills/spec-setup in catlog22/Claude-Code-Workflow) into .agents/skills/spec-setup in your project. Codex loads it when a task matches its description.

Can I use Spec Setup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add catlog22/Claude-Code-Workflow --skill spec-setup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/spec-setup, .gemini/skills/spec-setup, .github/skills/spec-setup and .opencode/skills/spec-setup in your project.

What does Spec Setup need to run?

Going by SKILL.md and its folder, Spec Setup needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: spawn_agent, wait_agent, send_message, followup_task, close_agent, request_user_input, Read, Write, Edit, Bash, Glob, Grep.

Does Spec Setup access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Spec Setup safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Spec Setup use?

Spec Setup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Spec Setup use?

About 6.5k tokens (SKILL.md is roughly 26k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Spec Setup?

Skills that share tags, products or a category with Spec Setup: Spec Writer (garrytan/gstack, 136k stars), Micro Interaction Spec (Owl-Listener/designer-skills, 2.9k stars), Spec (garden-co/classic-jazz, 2.5k stars) and Spec Driven Workflow (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Spec Setup?

catlog22 (a GitHub user) maintains it in catlog22/Claude-Code-Workflow, which has 2,130 GitHub stars. The repository holds 82 skills in this directory. The repository was last updated on June 18, 2026.

Source: catlog22/Claude-Code-Workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.