devflow-file-standards

Dimon94/cc-devflow

๐Ÿš€ One-command requirement development flow for Claude Code - Complete workflow system with sub-agents, quality gates, and intelligent automation

96 stars
25 forks
Shell
20 views

SKILL.md


name: devflow-file-standards description: File naming conventions, directory structure, and YAML frontmatter standards for CC-DevFlow. Consolidates shared conventions from all agents.

DevFlow File Standards

Purpose

Consolidate file naming, directory structure, and format conventions that are shared across multiple agents and commands. This skill does NOT duplicate agent-specific standards.

Requirement IDs

Format

REQ-\d{3}    # e.g., REQ-001, REQ-042, REQ-123

Usage

  • Flow commands: All /flow-* commands accept REQ-ID as argument
  • Git branches: feature/REQ-XXX-{slug-title}
  • Directory paths: devflow/requirements/REQ-XXX/
  • Status tracking: orchestration_status.json contains reqId field

Source

  • Enforced by: All 13 agents
  • Validated by: .claude/scripts/check-prerequisites.sh

Task IDs

Format

T\d{3}    # e.g., T001, T042, T123

Usage in TASKS.md

- [ ] **T001** [P] Task description
- [ ] **T010** [US1] User story 1 task

Labels

  • [P]: Parallel execution possible
  • [US#]: User story number (e.g., [US1], [US2])

Source

  • Generated by: planner agent
  • Format defined in: .claude/docs/templates/TASKS_TEMPLATE.md

Directory Structure

Requirements

devflow/requirements/REQ-XXX/
โ”œโ”€โ”€ research/                        # /flow-init ่พ“ๅ‡บ
โ”‚   โ”œโ”€โ”€ research.md                  # consolidate-research.sh ็”Ÿๆˆ
โ”‚   โ”œโ”€โ”€ tasks.json                   # generate-research-tasks.sh ็”Ÿๆˆ
โ”‚   โ”œโ”€โ”€ internal/
โ”‚   โ”‚   โ””โ”€โ”€ codebase-overview.md
โ”‚   โ”œโ”€โ”€ mcp/                         # MCP ๆœๅŠกๅ™จ่ฐƒๆŸฅ๏ผˆๅฏ้€‰๏ผ‰
โ”‚   โ””โ”€โ”€ codebase-tech-analysis.md   # /flow-tech ่พ“ๅ‡บ
โ”œโ”€โ”€ PRD.md                           # /flow-prd ่พ“ๅ‡บ (prd-writer agent)
โ”œโ”€โ”€ TECH_DESIGN.md                   # /flow-tech ่พ“ๅ‡บ (tech-architect agent)
โ”œโ”€โ”€ data-model.md                    # /flow-tech ่พ“ๅ‡บ (extract-data-model.sh)
โ”œโ”€โ”€ contracts/                       # /flow-tech ่พ“ๅ‡บ (export-contracts.sh)
โ”‚   โ”œโ”€โ”€ api-users.yaml               # OpenAPI contracts
โ”‚   โ””โ”€โ”€ api-auth.yaml
โ”œโ”€โ”€ quickstart.md                    # /flow-tech ่พ“ๅ‡บ (generate-quickstart.sh)
โ”œโ”€โ”€ UI_PROTOTYPE.html                # /flow-ui ่พ“ๅ‡บ (ui-designer agent, ๅฏ้€‰)
โ”œโ”€โ”€ EPIC.md                          # /flow-epic ่พ“ๅ‡บ (planner agent)
โ”œโ”€โ”€ TASKS.md                         # /flow-epic ่พ“ๅ‡บ (planner agent)
โ”œโ”€โ”€ reviews/                         # /flow-qa ่พ“ๅ‡บ
โ”‚   โ”œโ”€โ”€ TEST_PLAN.md                 # qa-tester agent
โ”‚   โ”œโ”€โ”€ TEST_REPORT.md               # qa-tester agent
โ”‚   โ””โ”€โ”€ SECURITY_REPORT.md           # security-reviewer agent
โ”œโ”€โ”€ EXECUTION_LOG.md                 # ไบ‹ไปถๆ—ฅๅฟ— (ๆ‰€ๆœ‰ flow ๅ‘ฝไปค่ฟฝๅŠ )
โ”œโ”€โ”€ orchestration_status.json        # ็Šถๆ€่ทŸ่ธช (ๆ‰€ๆœ‰ flow ๅ‘ฝไปคๆ›ดๆ–ฐ)
โ””โ”€โ”€ README.md                        # ๅทฅไฝœๆตๆŒ‡ๅ—

### Bugs

devflow/bugs/BUG-XXX/ โ”œโ”€โ”€ BUG_ANALYSIS.md # /flow-fix ่พ“ๅ‡บ (bug-analyzer agent) โ”œโ”€โ”€ PLAN.md # /flow-fix ่พ“ๅ‡บ (planner agent) โ”œโ”€โ”€ TASKS.md # /flow-fix ่พ“ๅ‡บ (planner agent) โ”œโ”€โ”€ EXECUTION_LOG.md โ””โ”€โ”€ status.json # ็ฑปไผผ orchestration_status.json


### Source
- Created by: `.claude/scripts/create-requirement.sh`
- Template: `.claude/docs/templates/` ็›ฎๅฝ•
- Enforced by: All flow commands

## YAML Frontmatter

### Document Types

#### PRD.md
```yaml
---
reqId: REQ-123
title: User Authentication
version: 1.0.0
createdAt: 2025-10-31T12:34:56Z
updatedAt: 2025-10-31T15:20:30Z
status: approved
author: prd-writer agent
---

TECH_DESIGN.md

---
reqId: REQ-123
version: 1.0.0
architecture: Microservices
techStack:
  - Node.js
  - PostgreSQL
  - Redis
createdAt: 2025-10-31T14:10:00Z
author: tech-architect agent
---

EPIC.md

---
reqId: REQ-123
title: User Authentication Epic
version: 1.0.0
estimatedEffort: 5 days
createdAt: 2025-10-31T16:00:00Z
author: planner agent
---

TASKS.md

---
reqId: REQ-123
totalTasks: 25
completedTasks: 0
version: 1.0.0
createdAt: 2025-10-31T16:30:00Z
updatedAt: 2025-10-31T16:30:00Z
author: planner agent
---

Source

  • Enforced by: prd-writer, tech-architect, planner agents
  • Parsed by: .claude/scripts/check-prerequisites.sh, .claude/scripts/generate-status-report.sh

orchestration_status.json

Structure (Requirements)

{
  "reqId": "REQ-123",
  "title": "User Authentication",
  "status": "initialized",
  "phase": "planning",
  "phase0_complete": false,
  "phase1_complete": false,
  "completedSteps": [],
  "createdAt": "2025-10-31T12:34:56Z",
  "updatedAt": "2025-10-31T12:34:56Z"
}

Status Values

initialized                โ†’ /flow-init ๅฎŒๆˆ
prd_generation_in_progress โ†’ /flow-prd ๆ‰ง่กŒไธญ
prd_generation_failed      โ†’ /flow-prd ๅคฑ่ดฅ๏ผˆๅฏ้‡่ฏ•๏ผ‰
prd_complete               โ†’ /flow-prd ๅฎŒๆˆ

tech_design_in_progress    โ†’ /flow-tech ๆ‰ง่กŒไธญ
tech_design_failed         โ†’ /flow-tech ๅคฑ่ดฅ
tech_design_complete       โ†’ /flow-tech ๅฎŒๆˆ

epic_generation_in_progress โ†’ /flow-epic ๆ‰ง่กŒไธญ
epic_generation_failed      โ†’ /flow-epic ๅคฑ่ดฅ
epic_complete               โ†’ /flow-epic ๅฎŒๆˆ

development_in_progress     โ†’ /flow-dev ๆ‰ง่กŒไธญ
development_complete        โ†’ /flow-dev ๅฎŒๆˆ

qa_in_progress              โ†’ /flow-qa ๆ‰ง่กŒไธญ
qa_complete                 โ†’ /flow-qa ๅฎŒๆˆ

released                    โ†’ /flow-release ๅฎŒๆˆ

Phase Values

planning       โ†’ ้œ€ๆฑ‚่ง„ๅˆ’้˜ถๆฎต (init, prd)
design         โ†’ ๆŠ€ๆœฏ่ฎพ่ฎก้˜ถๆฎต (tech, ui)
epic_planning  โ†’ ไปปๅŠก่ง„ๅˆ’้˜ถๆฎต (epic)
implementation โ†’ ๅผ€ๅ‘้˜ถๆฎต (dev)
qa             โ†’ ่ดจ้‡ไฟ้šœ้˜ถๆฎต (qa)
release        โ†’ ๅ‘ๅธƒ้˜ถๆฎต (release)

Source

  • Updated by: All flow commands
  • Read by: cc-devflow-orchestrator skill, check-prerequisites.sh
  • Schema: Implicitly defined across all flow command docs

status.json (for Bugs)

Structure

{
  "bugId": "BUG-456",
  "title": "Fix login timeout",
  "status": "initialized",
  "phase": "analysis",
  "severity": "high",
  "createdAt": "2025-10-31T12:34:56Z",
  "updatedAt": "2025-10-31T12:34:56Z"
}

Severity Values

critical  โ†’ ไธฅ้‡๏ผŒ็ณป็ปŸไธๅฏ็”จ
high      โ†’ ้ซ˜๏ผŒๆ ธๅฟƒๅŠŸ่ƒฝๅ—ๅฝฑๅ“
medium    โ†’ ไธญ๏ผŒ้ƒจๅˆ†ๅŠŸ่ƒฝๅ—ๅฝฑๅ“
low       โ†’ ไฝŽ๏ผŒ่ฝปๅพฎ้—ฎ้ข˜

Source

  • Used by: /flow-fix command
  • Updated by: bug-analyzer agent

File Naming Patterns

Markdown Documents

UPPERCASE_WITH_UNDERSCORES.md    # Primary documents (PRD.md, EPIC.md, TASKS.md)
lowercase-with-dashes.md         # Supporting documents (data-model.md, quickstart.md)

Scripts

kebab-case.sh                    # All bash scripts (check-prerequisites.sh)
kebab-case.ts                    # All TypeScript scripts (skill-activation-prompt.ts)

Directories

lowercase                        # Top-level (devflow/, research/, contracts/)
kebab-case                       # Multi-word (codebase-tech-analysis/)

Source

  • Implicitly enforced by: All agents and scripts
  • No explicit validator

Contract Files

Format

api-{resource}.yaml              # OpenAPI 3.0 format
graphql-{schema}.graphql         # GraphQL schema

Example

contracts/
โ”œโ”€โ”€ api-users.yaml               # User management API
โ”œโ”€โ”€ api-auth.yaml                # Authentication API
โ””โ”€โ”€ graphql-schema.graphql       # GraphQL schema (if used)

Source

  • Generated by: tech-architect agent via export-contracts.sh
  • Referenced by: planner agent in TASKS.md (Phase 2 contract tests)

Special Files

.gitignore Patterns (for devflow/)

# โœ… Should be committed
devflow/requirements/**/PRD.md
devflow/requirements/**/EPIC.md
devflow/requirements/**/TASKS.md
devflow/requirements/**/orchestration_status.json

# โŒ Should NOT be committed
devflow/requirements/**/.env
devflow/requirements/**/secrets/
devflow/requirements/**/node_modules/

.claude/tsc-cache/ (PostToolUse tracking)

.claude/tsc-cache/
โ””โ”€โ”€ {session_id}/
    โ”œโ”€โ”€ edited-files.log         # Timestamp:path:repo
    โ””โ”€โ”€ affected-repos.txt       # List of affected repos (e.g., devflow/REQ-123)

Source

  • Generated by: PostToolUse hook (post-tool-use-tracker.sh)
  • Read by: check-prerequisites.sh (for REQ_ID inference)

Agent-Specific Standards (NOT in this skill)

This skill does NOT contain agent-specific content standards:

  • prd-writer: INVEST principles, Anti-Expansion mandate, Given-When-Then โ†’ See prd-writer agent
  • tech-architect: Architecture patterns, tech stack justification, Phase -1 Gates โ†’ See tech-architect agent
  • ui-designer: 80+ design masters, responsive design rules, NO PLACEHOLDER โ†’ See ui-designer agent
  • planner: Task breakdown methodology, TDD sequence, Phase -1 Gates enforcement โ†’ See planner agent
  • qa-tester: Test strategy, coverage requirements, performance benchmarks โ†’ See qa-tester agent

Rationale: Those are agent execution standards (how to generate content), not file format standards (how to name/structure files).

Usage Examples

Query 1: "What's the format of REQ-ID?"

Answer: REQ-\d{3} (e.g., REQ-001, REQ-042, REQ-123)

Query 2: "Where does PRD.md go?"

Answer: devflow/requirements/REQ-XXX/PRD.md

Query 3: "What fields are in orchestration_status.json?"

Answer: reqId, title, status, phase, phase0_complete, phase1_complete, completedSteps, createdAt, updatedAt

Query 4: "How do I name a contract file?"

Answer: api-{resource}.yaml (e.g., api-users.yaml, api-auth.yaml)

Query 5: "What's the YAML frontmatter for TASKS.md?"

Answer: reqId, totalTasks, completedTasks, version, createdAt, updatedAt, author

Design Principle

This skill does NOT contain:

  • โŒ Agent execution standards (PRD content rules, tech design methodology, etc.)
  • โŒ Detailed Phase Gate logic (that's in flow command files)
  • โŒ Complete template contents (that's in .claude/docs/templates/)

This skill ONLY contains:

  • โœ… File naming conventions (shared across all agents)
  • โœ… Directory structure (created by scripts, used by all agents)
  • โœ… YAML frontmatter format (enforced by multiple agents)
  • โœ… orchestration_status.json schema (updated by all flow commands)
  • โœ… Cross-cutting file format standards

Rationale: Avoid duplication ("ไธ้‡ไธๆผ" principle). Agents own content standards, this skill owns format standards.