diff --git a/.claude/agents/cli-explore-agent.md b/.claude/agents/cli-explore-agent.md index 84032f42..c0d61b9f 100644 --- a/.claude/agents/cli-explore-agent.md +++ b/.claude/agents/cli-explore-agent.md @@ -54,14 +54,11 @@ Phase 4: Output Generation - Other schemas as specified in prompt Read and memorize schema requirements BEFORE any analysis begins (feeds Phase 3 validation). -3. **Project Context Loading** (from init.md products): - - Read `.workflow/project-tech.json` (if exists): +3. **Project Context Loading** (from spec system): + - Load exploration specs using: `ccw spec load --keywords exploration` - Extract: `tech_stack`, `architecture`, `key_components`, `overview` - Usage: Align analysis scope and patterns with actual project technology choices - - Read `.workflow/specs/*.md` (if exists): - - Extract: `conventions`, `constraints`, `quality_rules`, `learnings` - - Usage: Apply as constraints during pattern analysis, integration point evaluation, and recommendations - - If either file does not exist, proceed with fresh analysis (no error). + - If no specs are returned, proceed with fresh analysis (no error). 4. **Task Keyword Search** (initial file discovery): ```bash diff --git a/.claude/agents/cli-lite-planning-agent.md b/.claude/agents/cli-lite-planning-agent.md index 921ce86a..8e5b1ccb 100644 --- a/.claude/agents/cli-lite-planning-agent.md +++ b/.claude/agents/cli-lite-planning-agent.md @@ -54,9 +54,8 @@ When invoked with `process_docs: true` in input context: ## Input Context -**Project Context** (read from init.md products at startup): -- `.workflow/project-tech.json` → tech_stack, architecture, key_components -- `.workflow/specs/*.md` → conventions, constraints, quality_rules +**Project Context** (loaded from spec system at startup): +- Load specs using: `ccw spec load --keywords "exploration architecture"` → tech_stack, architecture, key_components, conventions, constraints, quality_rules ```javascript { diff --git a/.claude/agents/context-search-agent.md b/.claude/agents/context-search-agent.md index f983d240..2f18a9ce 100644 --- a/.claude/agents/context-search-agent.md +++ b/.claude/agents/context-search-agent.md @@ -77,14 +77,11 @@ if (file_exists(contextPackagePath)) { **1.1b Project Context Loading** (MANDATORY): ```javascript -// Load project-level context (from workflow:init products) +// Load project-level context (from spec system) // These provide foundational constraints for ALL context gathering -const projectTech = file_exists('.workflow/project-tech.json') - ? JSON.parse(Read('.workflow/project-tech.json')) // tech_stack, architecture_type, key_components, build_system, test_framework - : null; -const projectGuidelines = file_exists('.workflow/specs/*.md') - ? JSON.parse(Read('.workflow/specs/*.md')) // coding_conventions, naming_rules, forbidden_patterns, quality_gates - : null; +const projectSpecs = Bash('ccw spec load --keywords "exploration architecture" --stdin'); +const projectTech = projectSpecs?.tech_stack ? projectSpecs : null; +const projectGuidelines = projectSpecs?.coding_conventions ? projectSpecs : null; // Usage: // - projectTech → Populate project_context fields (tech_stack, architecture_patterns) diff --git a/.claude/agents/debug-explore-agent.md b/.claude/agents/debug-explore-agent.md index 0f8b7ba0..7e39a17e 100644 --- a/.claude/agents/debug-explore-agent.md +++ b/.claude/agents/debug-explore-agent.md @@ -35,9 +35,8 @@ Phase 5: Fix & Verification ## Phase 1: Bug Analysis -**Load Project Context** (from init.md products): -- Read `.workflow/project-tech.json` (if exists) for tech stack context -- Read `.workflow/specs/*.md` (if exists) for coding constraints +**Load Project Context** (from spec system): +- Load exploration specs using: `ccw spec load --keywords exploration` for tech stack context and coding constraints **Session Setup**: ```javascript diff --git a/.claude/commands/workflow/init-guidelines.md b/.claude/commands/workflow/init-guidelines.md index b268d580..d8035259 100644 --- a/.claude/commands/workflow/init-guidelines.md +++ b/.claude/commands/workflow/init-guidelines.md @@ -98,22 +98,18 @@ if (isPopulated) { ### Step 2: Load Project Context ```javascript -const projectTech = JSON.parse(Read('.workflow/project-tech.json')) +// Load project context via ccw spec load for planning context +const projectContext = Bash('ccw spec load --keywords planning 2>/dev/null || echo "{}"') +const specData = JSON.parse(projectContext) -// Extract key info for generating smart questions -const languages = projectTech.technology_analysis?.technology_stack?.languages - || projectTech.overview?.technology_stack?.languages || [] +// 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 = projectTech.technology_analysis?.technology_stack?.frameworks - || projectTech.overview?.technology_stack?.frameworks || [] -const testFrameworks = projectTech.technology_analysis?.technology_stack?.test_frameworks - || projectTech.overview?.technology_stack?.test_frameworks || [] -const archStyle = projectTech.technology_analysis?.architecture?.style - || projectTech.overview?.architecture?.style || 'Unknown' -const archPatterns = projectTech.technology_analysis?.architecture?.patterns - || projectTech.overview?.architecture?.patterns || [] -const buildTools = projectTech.technology_analysis?.technology_stack?.build_tools - || projectTech.overview?.technology_stack?.build_tools || [] +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 3: Multi-Round Interactive Questionnaire diff --git a/.claude/skills/team-issue/roles/explorer.md b/.claude/skills/team-issue/roles/explorer.md index c8ae76aa..9923a318 100644 --- a/.claude/skills/team-issue/roles/explorer.md +++ b/.claude/skills/team-issue/roles/explorer.md @@ -148,7 +148,7 @@ Priority: ## MANDATORY FIRST STEPS 1. Run: ccw tool exec get_modules_by_depth '{}' 2. Execute ACE searches based on issue keywords -3. Read: .workflow/project-tech.json (if exists) +3. Run: ccw spec load --keywords exploration ## Exploration Focus - Identify files directly related to this issue diff --git a/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md b/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md index 2e487aca..b6ea82ee 100644 --- a/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md +++ b/.claude/skills/team-ultra-analyze/roles/explorer/commands/explore.md @@ -81,7 +81,7 @@ Session: ${sessionFolder} ## MANDATORY FIRST STEPS 1. Run: ccw tool exec get_modules_by_depth '{}' 2. Execute searches: ${strategy.searches.map(s => `"${s}"`).join(', ')} -3. Read: .workflow/project-tech.json (if exists) +3. Run: ccw spec load --keywords exploration ## Exploration Focus (${perspective} angle) - **Depth**: ${strategy.depth} diff --git a/.claude/skills/team-ultra-analyze/roles/explorer/role.md b/.claude/skills/team-ultra-analyze/roles/explorer/role.md index fcc02bc9..505bca78 100644 --- a/.claude/skills/team-ultra-analyze/roles/explorer/role.md +++ b/.claude/skills/team-ultra-analyze/roles/explorer/role.md @@ -138,7 +138,7 @@ Session: ## MANDATORY FIRST STEPS 1. Run: ccw tool exec get_modules_by_depth '{}' 2. Execute relevant searches based on topic keywords -3. Read: .workflow/project-tech.json (if exists) +3. Run: ccw spec load --keywords exploration ## Exploration Focus ( angle) diff --git a/.claude/skills/workflow-execute/phases/06-review.md b/.claude/skills/workflow-execute/phases/06-review.md index 91e772d5..0cb28090 100644 --- a/.claude/skills/workflow-execute/phases/06-review.md +++ b/.claude/skills/workflow-execute/phases/06-review.md @@ -93,10 +93,11 @@ rg "password|token|secret|auth" -g "*.{ts,js,py}" rg "eval|exec|innerHTML|dangerouslySetInnerHTML" -g "*.{ts,js,tsx}" # Gemini security analysis +ccw spec load --keywords execution ccw cli -p " PURPOSE: Security audit of completed implementation TASK: Review code for security vulnerabilities, insecure patterns, auth/authz issues -CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../specs/*.md +CONTEXT: @.summaries/IMPL-*.md,../.. EXPECTED: Security findings report with severity levels RULES: Focus on OWASP Top 10, authentication, authorization, data validation, injection risks " --tool gemini --mode write --cd ${sessionPath} @@ -104,10 +105,11 @@ RULES: Focus on OWASP Top 10, authentication, authorization, data validation, in **Architecture Review** (`architecture`): ```bash +ccw spec load --keywords execution ccw cli -p " PURPOSE: Architecture compliance review TASK: Evaluate adherence to architectural patterns, identify technical debt, review design decisions -CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../specs/*.md +CONTEXT: @.summaries/IMPL-*.md,../.. EXPECTED: Architecture assessment with recommendations RULES: Check for patterns, separation of concerns, modularity, scalability " --tool qwen --mode write --cd ${sessionPath} @@ -115,10 +117,11 @@ RULES: Check for patterns, separation of concerns, modularity, scalability **Quality Review** (`quality`): ```bash +ccw spec load --keywords execution ccw cli -p " PURPOSE: Code quality and best practices review TASK: Assess code readability, maintainability, adherence to best practices -CONTEXT: @.summaries/IMPL-*.md,../.. @../../project-tech.json @../../specs/*.md +CONTEXT: @.summaries/IMPL-*.md,../.. EXPECTED: Quality assessment with improvement suggestions RULES: Check for code smells, duplication, complexity, naming conventions " --tool gemini --mode write --cd ${sessionPath} @@ -136,10 +139,11 @@ for task_file in ${sessionPath}/.task/*.json; do done # Cross-check implementation against requirements +ccw spec load --keywords execution ccw cli -p " PURPOSE: Verify all requirements and acceptance criteria are met TASK: Cross-check implementation summaries against original requirements -CONTEXT: @.task/IMPL-*.json,.summaries/IMPL-*.md,../.. @../../project-tech.json @../../specs/*.md +CONTEXT: @.task/IMPL-*.json,.summaries/IMPL-*.md,../.. EXPECTED: - Requirements coverage matrix - Acceptance criteria verification diff --git a/.claude/skills/workflow-lite-plan/SKILL.md b/.claude/skills/workflow-lite-plan/SKILL.md index f6b990e2..93bddbda 100644 --- a/.claude/skills/workflow-lite-plan/SKILL.md +++ b/.claude/skills/workflow-lite-plan/SKILL.md @@ -126,17 +126,11 @@ if (autoYes) { After collecting preferences, enhance context and dispatch: ```javascript -// Step 1: Check for project context files -const hasProjectTech = fileExists('.workflow/project-tech.json') -const hasProjectGuidelines = fileExists('.workflow/specs/*.md') +// Step 1: Load project context via ccw spec +Bash('ccw spec load --keywords planning') // Step 2: Log available context -if (hasProjectTech) { - console.log('Project tech context available: .workflow/project-tech.json') -} -if (hasProjectGuidelines) { - console.log('Project guidelines available: .workflow/specs/*.md') -} +console.log('Project context loaded via: ccw spec load --keywords planning') // Step 3: Dispatch to phase (workflowPreferences available as context) if (mode === 'plan') { diff --git a/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md b/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md index 889a8b98..7a2767bf 100644 --- a/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md +++ b/.claude/skills/workflow-lite-plan/phases/01-lite-plan.md @@ -494,9 +494,9 @@ Generate implementation plan and write plan.json. ## Output Schema Reference Execute: cat ~/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json (get schema reference before generating plan) -## Project Context (MANDATORY - Read Both Files) -1. Read: .workflow/project-tech.json (technology stack, architecture, key components) -2. Read: .workflow/specs/*.md (user-defined constraints and conventions) +## Project Context (MANDATORY - Load via ccw spec) +Execute: ccw spec load --keywords planning +This loads technology stack, architecture, key components, and user-defined constraints/conventions. **CRITICAL**: All generated tasks MUST comply with constraints in specs/*.md diff --git a/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md b/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md index a9176452..bb420559 100644 --- a/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md +++ b/.claude/skills/workflow-lite-plan/phases/02-lite-execute.md @@ -485,7 +485,8 @@ ${(t.test?.success_metrics || []).length > 0 ? `\n**Success metrics**: ${t.test. context.push(`### Artifacts\nPlan: ${executionContext.session.artifacts.plan}`) } // Project guidelines (user-defined constraints from /workflow:session:solidify) - context.push(`### Project Guidelines\n@.workflow/specs/*.md`) + // Loaded via: ccw spec load --keywords planning + context.push(`### Project Guidelines\n(Loaded via ccw spec load --keywords planning)`) if (context.length > 0) sections.push(`## Context\n${context.join('\n\n')}`) sections.push(`Complete each task according to its "Done when" checklist.`) diff --git a/.claude/skills/workflow-multi-cli-plan/SKILL.md b/.claude/skills/workflow-multi-cli-plan/SKILL.md index 189544d0..51b68074 100644 --- a/.claude/skills/workflow-multi-cli-plan/SKILL.md +++ b/.claude/skills/workflow-multi-cli-plan/SKILL.md @@ -100,17 +100,11 @@ if (autoYes) { After collecting preferences, enhance context and dispatch: ```javascript -// Step 1: Check for project context files -const hasProjectTech = fileExists('.workflow/project-tech.json') -const hasProjectGuidelines = fileExists('.workflow/specs/*.md') +// Step 1: Load project context via ccw spec +Bash('ccw spec load --keywords planning') // Step 2: Log available context -if (hasProjectTech) { - console.log('Project tech context available: .workflow/project-tech.json') -} -if (hasProjectGuidelines) { - console.log('Project guidelines available: .workflow/specs/*.md') -} +console.log('Project context loaded via: ccw spec load --keywords planning') // Step 3: Dispatch to phase (workflowPreferences available as context) if (mode === 'plan') { diff --git a/.claude/skills/workflow-plan/phases/02-context-gathering.md b/.claude/skills/workflow-plan/phases/02-context-gathering.md index f38b8b18..1509f9b6 100644 --- a/.claude/skills/workflow-plan/phases/02-context-gathering.md +++ b/.claude/skills/workflow-plan/phases/02-context-gathering.md @@ -203,7 +203,7 @@ This is the PRIMARY context source - all subsequent analysis must align with use Execute complete context-search-agent workflow (Phase 1-3) for implementation planning. Key emphasis: -- Load project-tech.json and specs/*.md FIRST (per your spec Phase 1.1b) +- Run: ccw spec load --keywords exploration FIRST (per your spec Phase 1.1b) - Synthesize exploration results with project context - Generate prioritized_context with user_intent alignment - Apply specs/*.md constraints during conflict detection diff --git a/.claude/skills/workflow-plan/phases/04-task-generation.md b/.claude/skills/workflow-plan/phases/04-task-generation.md index 57cdaaaf..f14e43c0 100644 --- a/.claude/skills/workflow-plan/phases/04-task-generation.md +++ b/.claude/skills/workflow-plan/phases/04-task-generation.md @@ -170,21 +170,21 @@ Output: Session ID: ${sessionId} MCP Capabilities: {exa_code, exa_web, code_index} -## PROJECT CONTEXT (MANDATORY - load before planning-notes) -These files provide project-level constraints that apply to ALL tasks: +## PROJECT CONTEXT (MANDATORY - load via ccw spec) +Execute: ccw spec load --keywords planning -1. **.workflow/project-tech.json** (auto-generated tech analysis) - - Contains: tech_stack, architecture_type, key_components, build_system, test_framework - - Usage: Populate plan.json shared_context, align task tech choices, set correct test commands - - If missing: Fall back to context-package.project_context +This loads: +- Technology stack, architecture, key components, build system, test framework +- User-maintained rules and constraints (coding_conventions, naming_rules, forbidden_patterns, quality_gates) -2. **.workflow/specs/*.md** (user-maintained rules and constraints) - - Contains: coding_conventions, naming_rules, forbidden_patterns, quality_gates, custom_constraints - - Usage: Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps, - acceptance criteria, and convergence.verification MUST respect these guidelines - - If empty/missing: No additional constraints (proceed normally) +Usage: +- Populate plan.json shared_context, align task tech choices, set correct test commands +- Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps, + acceptance criteria, and convergence.verification MUST respect these guidelines -Loading order: project-tech.json → specs/*.md → planning-notes.md → context-package.json +If spec load returns empty: Proceed normally with context-package.project_context + +Loading order: ccw spec load → planning-notes.md → context-package.json ## USER CONFIGURATION (from Step 4.0) Execution Method: ${userConfig.executionMethod} // agent|hybrid|cli diff --git a/.claude/skills/workflow-tdd/phases/02-context-gathering.md b/.claude/skills/workflow-tdd/phases/02-context-gathering.md index db9b85df..b6b01505 100644 --- a/.claude/skills/workflow-tdd/phases/02-context-gathering.md +++ b/.claude/skills/workflow-tdd/phases/02-context-gathering.md @@ -221,8 +221,7 @@ Execute complete context-search-agent workflow for TDD implementation planning: ### Phase 1: Initialization & Pre-Analysis 1. **Project State Loading**: - - Read and parse .workflow/project-tech.json. Use its overview section as the foundational project_context. - - Read and parse .workflow/specs/*.md. Load conventions, constraints, and learnings into a project_guidelines section. + - Run: \`ccw spec load --keywords execution\` to load project context, tech stack, and guidelines. - If files don't exist, proceed with fresh analysis. 2. **Detection**: Check for existing context-package (early exit if valid) 3. **Foundation**: Initialize CodexLens, get project structure, load docs diff --git a/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md b/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md index dbec10a3..bf3922e2 100644 --- a/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md +++ b/.claude/skills/workflow-tdd/phases/05-tdd-task-generation.md @@ -231,18 +231,14 @@ MCP Capabilities: {exa_code, exa_web, code_index} ## PROJECT CONTEXT (MANDATORY - load before planning-notes) These files provide project-level constraints that apply to ALL tasks: -1. **.workflow/project-tech.json** (auto-generated tech analysis) - - Contains: tech_stack, architecture_type, key_components, build_system, test_framework +1. **ccw spec load --keywords execution** (project specs and tech analysis) + - Contains: tech_stack, architecture_type, key_components, build_system, test_framework, coding_conventions, naming_rules, forbidden_patterns, quality_gates, custom_constraints - Usage: Populate plan.json shared_context, align task tech choices, set correct test commands - - If missing: Fall back to context-package.project_context - -2. **.workflow/specs/*.md** (user-maintained rules and constraints) - - Contains: coding_conventions, naming_rules, forbidden_patterns, quality_gates, custom_constraints - - Usage: Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps, + - Apply as HARD CONSTRAINTS on all generated tasks — task implementation steps, acceptance criteria, and convergence.verification MUST respect these guidelines - If empty/missing: No additional constraints (proceed normally) -Loading order: project-tech.json → specs/*.md → planning-notes.md → context-package.json +Loading order: \`ccw spec load --keywords execution\` → planning-notes.md → context-package.json ## USER CONFIGURATION (from Phase 0) Execution Method: ${userConfig.executionMethod} // agent|hybrid|cli diff --git a/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md b/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md index 28534cd5..ac8f2e4d 100644 --- a/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +++ b/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md @@ -345,8 +345,7 @@ Execute complete context-search-agent workflow for implementation planning: ### Phase 1: Initialization & Pre-Analysis 1. **Project State Loading**: - - Read and parse .workflow/project-tech.json. Use its overview section as the foundational project_context. - - Read and parse .workflow/specs/*.md. Load conventions, constraints, and learnings into a project_guidelines section. + - Run: \`ccw spec load --keywords execution\` to load project context, tech stack, and guidelines. - If files don't exist, proceed with fresh analysis. 2. **Detection**: Check for existing context-package (early exit if valid) 3. **Foundation**: Initialize CodexLens, get project structure, load docs diff --git a/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md b/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md index 85dc4c78..218fb1fb 100644 --- a/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md +++ b/.claude/skills/workflow-test-fix/phases/05-test-cycle-execute.md @@ -244,8 +244,7 @@ Task( ${selectedStrategy} - ${strategyDescription} ## PROJECT CONTEXT (MANDATORY) - 1. Read: .workflow/project-tech.json (tech stack, test framework, build system) - 2. Read: .workflow/specs/*.md (constraints — apply as HARD CONSTRAINTS on fixes) + 1. Run: \`ccw spec load --keywords execution\` (tech stack, test framework, build system, constraints) ## MANDATORY FIRST STEPS 1. Read test results: ${session.test_results_path} diff --git a/.codex/prompts/prep-cycle.md b/.codex/prompts/prep-cycle.md index d7b73e1f..47b28f48 100644 --- a/.codex/prompts/prep-cycle.md +++ b/.codex/prompts/prep-cycle.md @@ -21,10 +21,8 @@ Check these items. Report results as a checklist. ### 1.2 Strongly Recommended (warn if missing) -- **project-tech.json**: Check `{projectRoot}/.workflow/project-tech.json` - - If missing: Read `package.json` / `tsconfig.json` / `pyproject.toml` and generate a minimal version. Ask user: "检测到项目使用 [tech stack], 是否正确?需要补充什么?" -- **specs/*.md**: Check `{projectRoot}/.workflow/specs/*.md` - - If missing: Scan for `.eslintrc`, `.prettierrc`, `ruff.toml` etc. Ask user: "未找到 specs/*.md, 是否有特定的编码规范需要遵循?" +- **Project specs**: Run `ccw spec load --keywords execution` to load project context + - If spec system unavailable: Read `package.json` / `tsconfig.json` / `pyproject.toml` and generate a minimal version. Ask user: "检测到项目使用 [tech stack], 是否正确?需要补充什么?" - **Test framework**: Detect from config files (jest.config, vitest.config, pytest.ini, etc.) - If missing: Ask user: "未检测到测试框架配置,请指定测试命令(如 `npm test`, `pytest`),或输入 'skip' 跳过测试验证" @@ -38,8 +36,8 @@ Print formatted checklist: ✓ 项目根目录: D:\myproject ✓ 工作空间: .workflow/.cycle/ 就绪 ⚠ Git: 3 个未提交变更 -✓ project-tech.json: 已检测 (Express + TypeORM + PostgreSQL) -⚠ specs/*.md: 未找到 (已跳过) +✓ Project specs: 已加载 (ccw spec load --keywords execution) +⚠ specs: 未找到 (已跳过) ✓ 测试框架: jest (npm test) ``` @@ -166,13 +164,13 @@ Read the user's `$TASK` and score each dimension: > 请选择适用的或添加自定义约束" **上下文不足 (score 0-1)**: -> "我从项目中检测到: [tech stack from project-tech.json]。还有其他需要知道的技术细节吗?例如现有的认证机制、相关的工具库、数据模型等" +> "我从项目中检测到: [tech stack from loaded specs]。还有其他需要知道的技术细节吗?例如现有的认证机制、相关的工具库、数据模型等" ### 2.4 Auto-Enhancement For dimensions still at score 1 after Q&A, auto-enhance from codebase: - **Scope**: Use `Glob` and `Grep` to find related files, list them -- **Context**: Read `project-tech.json` and key config files +- **Context**: Run `ccw spec load --keywords execution` to load project context - **Constraints**: Infer from `specs/*.md` and existing patterns ### 2.5 Assemble Refined Task diff --git a/.codex/prompts/prep-loop.md b/.codex/prompts/prep-loop.md deleted file mode 100644 index cda3ffd0..00000000 --- a/.codex/prompts/prep-loop.md +++ /dev/null @@ -1,464 +0,0 @@ ---- -description: "Interactive pre-flight checklist for ccw-loop. Discovers .task/*.json from collaborative-plan-with-file, analyze-with-file, brainstorm-to-cycle sessions; validates, transforms to ccw-loop task format, writes prep-package.json + .task/*.json, then launches the loop." -argument-hint: '[SOURCE=""] [MAX_ITER=10]' ---- - -# Pre-Flight Checklist for CCW Loop - -You are an interactive preparation assistant. Your job is to discover and consume task artifacts from upstream planning/analysis/brainstorm skills, validate them, transform into ccw-loop's task format, and launch an **unattended** development loop. Follow each step sequentially. **Ask the user questions when information is missing.** - ---- - -## Step 1: Source Discovery - -### 1.1 Auto-Detect Available Sessions - -Scan for upstream artifacts from the three supported source skills: - -```javascript -const projectRoot = Bash('git rev-parse --show-toplevel 2>/dev/null || pwd').trim() - -// Source 1: collaborative-plan-with-file -const cplanSessions = Glob(`${projectRoot}/.workflow/.planning/CPLAN-*/.task/*.json`) - .map(p => ({ - path: p.replace(/\/\.task\/[^/]+$/, '/.task'), - source: 'collaborative-plan-with-file', - type: 'task-dir', - session: p.match(/CPLAN-[^/]+/)?.[0], - mtime: fs.statSync(p).mtime - })) - // Deduplicate by session - .filter((v, i, a) => a.findIndex(x => x.session === v.session) === i) - -// Source 2: analyze-with-file -const anlSessions = Glob(`${projectRoot}/.workflow/.analysis/ANL-*/.task/*.json`) - .map(p => ({ - path: p.replace(/\/\.task\/[^/]+$/, '/.task'), - source: 'analyze-with-file', - type: 'task-dir', - session: p.match(/ANL-[^/]+/)?.[0], - mtime: fs.statSync(p).mtime - })) - .filter((v, i, a) => a.findIndex(x => x.session === v.session) === i) - -// Source 3: brainstorm-to-cycle -const bsSessions = Glob(`${projectRoot}/.workflow/.brainstorm/*/cycle-task.md`) - .map(p => ({ - path: p, - source: 'brainstorm-to-cycle', - type: 'markdown', - session: p.match(/\.brainstorm\/([^/]+)/)?.[1], - mtime: fs.statSync(p).mtime - })) - -const allSources = [...cplanSessions, ...anlSessions, ...bsSessions] - .sort((a, b) => b.mtime - a.mtime) // Most recent first -``` - -### 1.2 Display Discovered Sources - -``` -可用的上游任务源 -════════════════ - -collaborative-plan-with-file: - 1. CPLAN-auth-redesign-20260208 .task/ (5 tasks, 2h ago) - 2. CPLAN-api-cleanup-20260205 .task/ (3 days ago) - -analyze-with-file: - 3. ANL-perf-audit-20260207 .task/ (8 tasks, 1d ago) - -brainstorm-to-cycle: - 4. BS-notification-system cycle-task.md (1d ago) - -手动输入: - 5. 自定义路径 (输入 .task/ 目录路径或任务描述) -``` - -### 1.3 User Selection - -Ask the user to select a source: - -> "请选择任务来源(输入编号),或输入 .task/ 目录的完整路径: -> 也可以输入 'manual' 手动输入任务描述(不使用上游任务文件)" - -**If `$SOURCE` argument provided**, skip discovery and use directly: - -```javascript -if (options.SOURCE) { - // Validate path exists - if (!fs.existsSync(options.SOURCE)) { - console.error(`Path not found: ${options.SOURCE}`) - return - } - selectedSource = { - path: options.SOURCE, - source: inferSource(options.SOURCE), - type: fs.statSync(options.SOURCE).isDirectory() ? 'task-dir' : 'markdown' - } -} -``` - ---- - -## Step 2: Source Validation & Task Loading - -### 2.1 For .task/ Sources (collaborative-plan / analyze-with-file) - -```javascript -function validateAndLoadTaskDir(taskDirPath) { - const taskFiles = Glob(`${taskDirPath}/*.json`).sort() - const tasks = [] - const errors = [] - - for (let i = 0; i < taskFiles.length; i++) { - try { - const content = Read(taskFiles[i]) - const task = JSON.parse(content) - - // Required fields check (task-schema.json: id, title, description, depends_on, convergence) - const requiredFields = ['id', 'title', 'description'] - const missing = requiredFields.filter(f => !task[f]) - if (missing.length > 0) { - errors.push(`${taskFiles[i]}: missing fields: ${missing.join(', ')}`) - continue - } - - // Validate task structure - if (task.id && task.title && task.description) { - tasks.push(task) - } - } catch (e) { - errors.push(`${taskFiles[i]}: invalid JSON: ${e.message}`) - } - } - - return { tasks, errors, total_files: taskFiles.length } -} -``` - -Display validation results: - -``` -JSONL 验证 -══════════ -目录: .workflow/.planning/CPLAN-auth-redesign-20260208/.task/ -来源: collaborative-plan-with-file - -✓ 5/5 任务文件解析成功 -✓ 必需字段完整 (id, title, description) -✓ 3 个任务含收敛标准 (convergence) -⚠ 2 个任务缺少收敛标准 (将使用默认) - -任务列表: - TASK-001 [high] Implement JWT token service (feature, 3 files) - TASK-002 [high] Add OAuth2 Google strategy (feature, 2 files) - TASK-003 [medium] Create user session middleware (feature, 4 files) - TASK-004 [low] Add rate limiting to auth endpoints (enhancement, 2 files) - TASK-005 [low] Write integration tests (testing, 5 files) -``` - -### 2.2 For Markdown Sources (brainstorm-to-cycle) - -```javascript -function loadBrainstormTask(mdPath) { - const content = Read(mdPath) - - // Extract enriched task description from cycle-task.md - // Format: # Generated Task \n\n **Idea**: ... \n\n --- \n\n {enrichedTask} - const taskMatch = content.match(/---\s*\n([\s\S]+)$/) - const enrichedTask = taskMatch ? taskMatch[1].trim() : content - - // Parse into a single composite task - return { - tasks: [{ - id: 'TASK-001', - title: extractTitle(content), - description: enrichedTask, - type: 'feature', - priority: 'high', - effort: 'large', - source: { tool: 'brainstorm-to-cycle', path: mdPath } - }], - errors: [], - is_composite: true // Single large task from brainstorm - } -} -``` - -Display: - -``` -Brainstorm 任务加载 -══════════════════ -文件: .workflow/.brainstorm/notification-system/cycle-task.md -来源: brainstorm-to-cycle - -ℹ 脑暴输出为复合任务描述(非结构化 JSONL) - 标题: Build real-time notification system - 类型: feature (composite) - -是否需要将其拆分为多个子任务?(Y/n) -``` - -If user selects **Y** (split), analyze the task description and generate sub-tasks: - -```javascript -// Analyze and decompose the composite task into 3-7 sub-tasks -// Use mcp__ace-tool__search_context to find relevant patterns -// Generate structured tasks with convergence criteria -``` - -If user selects **n** (keep as single), use as-is. - -### 2.3 Validation Gate - -If validation has errors: - -``` -⚠ 验证发现 {N} 个问题: - Line 3: missing fields: description - Line 7: invalid JSON - -选项: - 1. 跳过有问题的行,继续 ({valid_count} 个有效任务) - 2. 取消,手动修复后重试 -``` - -**Block if 0 valid tasks.** Warn and continue if some tasks invalid. - ---- - -## Step 3: Task Transformation - -Transform unified task JSON files -> ccw-loop `develop.tasks[]` format. - -```javascript -function transformToCcwLoopTasks(sourceTasks) { - const now = getUtc8ISOString() - - return sourceTasks.map((task, index) => ({ - // Core fields (ccw-loop native) - id: task.id || `task-${String(index + 1).padStart(3, '0')}`, - description: task.title - ? `${task.title}: ${task.description}` - : task.description, - tool: inferTool(task), // 'gemini' | 'qwen' | 'codex' - mode: 'write', - status: 'pending', - priority: mapPriority(task.priority), // 1 (high) | 2 (medium) | 3 (low) - files_changed: (task.files || []).map(f => f.path || f), - created_at: now, - completed_at: null, - - // Extended fields (preserved from source for agent reference) - _source: task.source || { tool: 'manual' }, - _convergence: task.convergence || null, - _type: task.type || 'feature', - _effort: task.effort || 'medium', - _depends_on: task.depends_on || [] - })) -} - -function inferTool(task) { - // Default to gemini for write tasks - return 'gemini' -} - -function mapPriority(priority) { - switch (priority) { - case 'high': case 'critical': return 1 - case 'medium': return 2 - case 'low': return 3 - default: return 2 - } -} -``` - -Display transformed tasks: - -``` -任务转换 -════════ -源格式: .task/*.json (collaborative-plan-with-file) -目标格式: ccw-loop develop.tasks - - task-001 [P1] Implement JWT token service: Create JWT service... gemini/write pending - task-002 [P1] Add OAuth2 Google strategy: Implement passport... gemini/write pending - task-003 [P2] Create user session middleware: Add Express... gemini/write pending - task-004 [P3] Add rate limiting to auth endpoints: Implement... gemini/write pending - task-005 [P3] Write integration tests: Create test suite... gemini/write pending - -共 5 个任务 (2 high, 1 medium, 2 low) -``` - -### 3.1 Task Reordering (Optional) - -Ask: "是否需要调整任务顺序或移除某些任务?(输入编号排列如 '1,3,2,5' 或回车保持当前顺序)" - ---- - -## Step 4: Auto-Loop Configuration - -### 4.1 Present Defaults - -``` -自动循环配置 -════════════ -模式: 全自动 (develop → debug → validate → complete) -最大迭代: $MAX_ITER (默认 10) -超时: 10 分钟/action - -收敛标准 (从源任务汇总): - ${tasksWithConvergence} 个任务含收敛标准 → 自动验证 - ${tasksWithoutConvergence} 个任务无收敛标准 → 使用默认 (测试通过) - -需要调整参数吗?(直接回车使用默认值) -``` - -### 4.2 Customization (if requested) - -> "请选择要调整的项目: -> 1. 最大迭代次数 (当前: 10) -> 2. 每个 action 超时 (当前: 10 分钟) -> 3. 全部使用默认值" - ---- - -## Step 5: Final Confirmation - -``` -══════════════════════════════════════════════ - Pre-Flight 检查完成 -══════════════════════════════════════════════ - -来源: collaborative-plan-with-file (CPLAN-auth-redesign-20260208) -任务数: 5 个 (2 high, 1 medium, 2 low) -验证: ✓ 5/5 任务格式正确 -收敛: 3/5 任务含收敛标准 -自动模式: ON (最多 10 次迭代) - -任务摘要: - 1. [P1] Implement JWT token service - 2. [P1] Add OAuth2 Google strategy - 3. [P2] Create user session middleware - 4. [P3] Add rate limiting to auth endpoints - 5. [P3] Write integration tests - -══════════════════════════════════════════════ -``` - -Ask: "确认启动?(Y/n)" -- If **Y** → proceed to Step 6 -- If **n** → ask which part to revise - ---- - -## Step 6: Write Artifacts - -### 6.1 Write prep-package.json - -Write to `{projectRoot}/.workflow/.loop/prep-package.json`: - -```json -{ - "version": "1.0.0", - "generated_at": "{ISO8601_UTC+8}", - "prep_status": "ready", - "target_skill": "ccw-loop", - - "environment": { - "project_root": "{projectRoot}", - "tech_stack": "{detected tech stack}", - "test_framework": "{detected test framework}" - }, - - "source": { - "tool": "collaborative-plan-with-file", - "session_id": "CPLAN-auth-redesign-20260208", - "task_dir": "{projectRoot}/.workflow/.planning/CPLAN-auth-redesign-20260208/.task", - "task_count": 5, - "tasks_with_convergence": 3 - }, - - "tasks": { - "total": 5, - "by_priority": { "high": 2, "medium": 1, "low": 2 }, - "by_type": { "feature": 3, "enhancement": 1, "testing": 1 } - }, - - "auto_loop": { - "enabled": true, - "no_confirmation": true, - "max_iterations": 10, - "timeout_per_action_ms": 600000 - } -} -``` - -### 6.2 Write .task/*.json - -Write transformed tasks to `{projectRoot}/.workflow/.loop/.task/` directory (one file per task, following task-schema.json): - -```javascript -const taskDir = `${projectRoot}/.workflow/.loop/.task` -Bash(`mkdir -p ${taskDir}`) - -for (const task of transformedTasks) { - const fileName = `TASK-${task.id.replace(/^task-/, '')}.json` - Write(`${taskDir}/${fileName}`, JSON.stringify(task, null, 2)) -} -``` - -Confirm: - -``` -ok prep-package.json -> .workflow/.loop/prep-package.json -ok .task/ directory -> .workflow/.loop/.task/ (5 task files) -``` - ---- - -## Step 7: Launch Loop - -Invoke the skill: - -``` -$ccw-loop --auto TASK="Execute tasks from {source.tool} session {source.session_id}" -``` - -其中: -- `$ccw-loop` — 展开为 skill 调用 -- `--auto` — 启用全自动模式 -- Skill 端会检测 `prep-package.json` 并加载 `.task/*.json` - -**Skill 端会做以下检查**(见 Phase 1 Step 1.1): -1. 检测 `prep-package.json` 是否存在 -2. 验证 `prep_status === "ready"` -3. 验证 `target_skill === "ccw-loop"` -4. 校验 `project_root` 与当前项目一致 -5. 校验文件时效(24h 内生成) -6. 验证 `.task/` 目录存在且含有效任务文件 -7. 全部通过 -> 加载预构建任务列表;任一失败 -> 回退到默认 INIT 行为 - -Print: - -``` -启动 ccw-loop (自动模式)... - prep-package.json → Phase 1 自动加载并校验 - .task/*.json → 5 个预构建任务加载到 develop.tasks - 循环: develop → validate → complete (最多 10 次迭代) -``` - ---- - -## Error Handling - -| 情况 | 处理 | -|------|------| -| 无可用上游会话 | 提示用户先运行 collaborative-plan / analyze-with-file / brainstorm,或选择手动输入 | -| JSONL 格式全部无效 | 报告错误,**不启动 loop** | -| JSONL 部分无效 | 警告无效文件,用有效任务继续 | -| brainstorm cycle-task.md 为空 | 报告错误,建议完成 brainstorm 流程 | -| 用户取消确认 | 保存 prep-package.json (prep_status="cancelled"),提示可修改后重新运行 | -| Skill 端 prep-package 校验失败 | Skill 打印警告,回退到无 prep 的默认 INIT 行为(不阻塞执行) | diff --git a/.codex/prompts/prep-plan.md b/.codex/prompts/prep-plan.md index 74a46a35..6c511f42 100644 --- a/.codex/prompts/prep-plan.md +++ b/.codex/prompts/prep-plan.md @@ -21,10 +21,8 @@ Check these items. Report results as a checklist. ### 1.2 Strongly Recommended (warn if missing) -- **project-tech.json**: Check `{projectRoot}/.workflow/project-tech.json` - - If missing: WARN — Phase 1 will call `workflow:init` to generate it. Ask user: "检测到项目使用 [tech stack from package.json], 是否正确?需要补充什么?" -- **specs/*.md**: Check `{projectRoot}/.workflow/specs/*.md` - - If missing: WARN — will be generated as empty scaffold. Ask: "有特定的编码规范需要遵循吗?" +- **Project specs**: Run `ccw spec load --keywords planning` to load project context + - If spec system unavailable: WARN — Phase 1 will call `workflow:init` to initialize. Ask user: "检测到项目使用 [tech stack from package.json], 是否正确?需要补充什么?" - **Test framework**: Detect from config files (jest.config, vitest.config, pytest.ini, etc.) - If missing: Ask: "未检测到测试框架,请指定测试命令(如 `npm test`),或输入 'skip' 跳过" @@ -38,8 +36,8 @@ Print formatted checklist: ✓ 项目根目录: D:\myproject ✓ .workflow/ 目录就绪 ⚠ Git: 3 个未提交变更 -✓ project-tech.json: 已检测 (Express + TypeORM + PostgreSQL) -⚠ specs/*.md: 未找到 (Phase 1 将生成空模板) +✓ Project specs: 已加载 (ccw spec load --keywords planning) +⚠ specs: 未找到 (Phase 1 将初始化) ✓ 测试框架: jest (npm test) ``` @@ -156,13 +154,13 @@ Each dimension scores 0-2 (0=missing, 1=vague, 2=clear). **Total minimum: 6/10 t > "有哪些限制条件?常见约束:不破坏现有 API / 使用现有数据库 / 不引入新依赖 / 保持现有模式。请选择或自定义" **上下文不足 (score 0-1)**: -> "我从项目中检测到: [tech stack from project-tech.json]。还有需要知道的技术细节吗?" +> "我从项目中检测到: [tech stack from loaded specs]。还有需要知道的技术细节吗?" ### 2.4 Auto-Enhancement For dimensions still at score 1 after Q&A, auto-enhance from codebase: - **Scope**: Use `Glob` and `Grep` to find related files -- **Context**: Read `project-tech.json` and key config files +- **Context**: Run `ccw spec load --keywords planning` to load project context - **Constraints**: Infer from `specs/*.md` ### 2.5 Assemble Structured Description diff --git a/.codex/skills/analyze-with-file/SKILL.md b/.codex/skills/analyze-with-file/SKILL.md index 7cac83ee..f3d38e47 100644 --- a/.codex/skills/analyze-with-file/SKILL.md +++ b/.codex/skills/analyze-with-file/SKILL.md @@ -85,7 +85,7 @@ Step 1: Topic Understanding Step 2: Exploration (Inline, No Agents) ├─ Detect codebase → search relevant modules, patterns - │ ├─ Read project-tech.json / specs/*.md (if exists) + │ ├─ Run `ccw spec load --keywords exploration` (if spec system available) │ └─ Use Grep, Glob, Read, mcp__ace-tool__search_context ├─ Multi-perspective analysis (if selected, serial) │ ├─ Single: Comprehensive analysis @@ -297,7 +297,7 @@ const hasCodebase = Bash(` if (hasCodebase !== 'none') { // 1. Read project metadata (if exists) - // - .workflow/project-tech.json (tech stack info) + // - Run `ccw spec load --keywords exploration` (load project specs) // - .workflow/specs/*.md (project conventions) // 2. Search codebase for relevant content diff --git a/.codex/skills/brainstorm-with-file/SKILL.md b/.codex/skills/brainstorm-with-file/SKILL.md index d2994694..22f4a453 100644 --- a/.codex/skills/brainstorm-with-file/SKILL.md +++ b/.codex/skills/brainstorm-with-file/SKILL.md @@ -282,7 +282,7 @@ Use built-in tools to understand the codebase structure before spawning perspect **Context Gathering Activities**: 1. **Get project structure** - Execute `ccw tool exec get_modules_by_depth '{}'` 2. **Search for related code** - Use Grep/Glob to find files matching topic keywords -3. **Read project tech context** - Load `{projectRoot}/.workflow/project-tech.json` if available +3. **Read project tech context** - Run `ccw spec load --keywords "exploration planning"` if spec system available 4. **Analyze patterns** - Identify common code patterns and architecture decisions **exploration-codebase.json Structure**: @@ -358,8 +358,8 @@ const agentIds = perspectives.map(perspective => { ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords "exploration planning"` +3. Read project tech context from loaded specs --- @@ -566,7 +566,7 @@ const deepDiveAgent = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-explore-agent.md (MUST read first) 2. Read: ${sessionFolder}/perspectives.json (prior findings) -3. Read: ${projectRoot}/.workflow/project-tech.json +3. Run: `ccw spec load --keywords "exploration planning"` --- diff --git a/.codex/skills/collaborative-plan-with-file/SKILL.md b/.codex/skills/collaborative-plan-with-file/SKILL.md index 0ce3f772..0936fea1 100644 --- a/.codex/skills/collaborative-plan-with-file/SKILL.md +++ b/.codex/skills/collaborative-plan-with-file/SKILL.md @@ -194,7 +194,7 @@ Use built-in tools directly to understand the task scope and identify sub-domain **Analysis Activities**: 1. **Search for references** — Find related documentation, README files, and architecture guides - Use: `mcp__ace-tool__search_context`, Grep, Glob, Read - - Read: `.workflow/project-tech.json`, `.workflow/specs/*.md` (if exists) + - Run: `ccw spec load --keywords planning` (if spec system available) 2. **Extract task keywords** — Identify key terms and concepts from the task description 3. **Identify ambiguities** — List any unclear points or multiple possible interpretations 4. **Clarify with user** — If ambiguities found, use AskUserQuestion for clarification diff --git a/.codex/skills/issue-discover/SKILL.md b/.codex/skills/issue-discover/SKILL.md index 023c2078..a9fa27bf 100644 --- a/.codex/skills/issue-discover/SKILL.md +++ b/.codex/skills/issue-discover/SKILL.md @@ -231,8 +231,7 @@ const agentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/{agent-type}.md (MUST read first) -2. Read: {projectRoot}/.workflow/project-tech.json -3. Read: {projectRoot}/.workflow/specs/*.md +2. Execute: ccw spec load --keywords exploration ## TASK CONTEXT ${taskContext} diff --git a/.codex/skills/req-plan-with-file/SKILL.md b/.codex/skills/req-plan-with-file/SKILL.md index 2db940b6..93c4b8ff 100644 --- a/.codex/skills/req-plan-with-file/SKILL.md +++ b/.codex/skills/req-plan-with-file/SKILL.md @@ -268,7 +268,7 @@ const hasCodebase = bash(` // 2. Codebase Exploration (only when hasCodebase !== 'none') if (hasCodebase !== 'none') { // Read project metadata (if exists) - // .workflow/project-tech.json, .workflow/specs/*.md + // Run `ccw spec load --keywords planning` // Search codebase for requirement-relevant context // Use: mcp__ace-tool__search_context, Grep, Glob, Read diff --git a/.codex/skills/review-cycle/SKILL.md b/.codex/skills/review-cycle/SKILL.md index 47b9e62b..bc758653 100644 --- a/.codex/skills/review-cycle/SKILL.md +++ b/.codex/skills/review-cycle/SKILL.md @@ -303,8 +303,7 @@ const agentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/{agent-type}.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Execute: ccw spec load --keywords "exploration execution" --- diff --git a/.codex/skills/review-cycle/phases/02-parallel-review.md b/.codex/skills/review-cycle/phases/02-parallel-review.md index eb0b0931..cb6d6c5c 100644 --- a/.codex/skills/review-cycle/phases/02-parallel-review.md +++ b/.codex/skills/review-cycle/phases/02-parallel-review.md @@ -94,8 +94,7 @@ dimensions.forEach(dimension => { 3. Get target files: Read resolved_files from review-state.json 4. Validate file access: bash(ls -la ${targetFiles.join(' ')}) 5. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference) -6. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context) -7. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints and conventions to validate against) +6. Execute: ccw spec load --keywords "exploration execution" (technology stack and constraints) --- @@ -217,8 +216,7 @@ dimensions.forEach(dimension => { 4. Get changed files: bash(cd ${workflowDir} && git log --since="${sessionCreatedAt}" --name-only --pretty=format: | sort -u) 5. Read review state: ${reviewStateJsonPath} 6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-dimension-results-schema.json (get output schema reference) -7. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context) -8. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints and conventions to validate against) +7. Execute: ccw spec load --keywords "exploration execution" (technology stack and constraints) --- @@ -336,8 +334,7 @@ const deepDiveAgentId = spawn_agent({ 4. Identify related code: bash(grep -r "import.*${basename(file)}" ${projectDir}/src --include="*.ts") 5. Read test files: bash(find ${projectDir}/tests -name "*${basename(file, '.ts')}*" -type f) 6. Execute: cat ~/.ccw/workflows/cli-templates/schemas/review-deep-dive-results-schema.json (get output schema reference) -7. Read: ${projectRoot}/.workflow/project-tech.json (technology stack and architecture context) -8. Read: ${projectRoot}/.workflow/specs/*.md (user-defined constraints for remediation compliance) +7. Execute: ccw spec load --keywords "exploration execution" (technology stack and constraints for remediation) --- diff --git a/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md b/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md index caf249a3..c918b7fc 100644 --- a/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md +++ b/.codex/skills/review-cycle/phases/07-fix-parallel-planning.md @@ -105,8 +105,7 @@ const agentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-planning-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Execute: ccw spec load --keywords planning --- diff --git a/.codex/skills/review-cycle/phases/08-fix-execution.md b/.codex/skills/review-cycle/phases/08-fix-execution.md index bc29818f..5fc07fdd 100644 --- a/.codex/skills/review-cycle/phases/08-fix-execution.md +++ b/.codex/skills/review-cycle/phases/08-fix-execution.md @@ -60,8 +60,7 @@ const execAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-execution-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Execute: ccw spec load --keywords execution --- diff --git a/.codex/skills/team-planex/agents/executor.md b/.codex/skills/team-planex/agents/executor.md index f4ea4649..93fa1e8a 100644 --- a/.codex/skills/team-planex/agents/executor.md +++ b/.codex/skills/team-planex/agents/executor.md @@ -38,8 +38,7 @@ completion report. ### Step 1: Load Context After reading role definition: -- Read: `.workflow/project-tech.json` -- Read: `.workflow/specs/*.md` +- Run: `ccw spec load --keywords execution` - Extract issue ID, solution file path, session dir from task message ### Step 2: Load Solution diff --git a/.codex/skills/team-planex/agents/planner.md b/.codex/skills/team-planex/agents/planner.md index 271c1087..9d847853 100644 --- a/.codex/skills/team-planex/agents/planner.md +++ b/.codex/skills/team-planex/agents/planner.md @@ -48,8 +48,7 @@ Outputs `ISSUE_READY:{issueId}` after each solution and waits for orchestrator t ### Step 1: Load Context After reading role definition, load project context: -- Read: `.workflow/project-tech.json` -- Read: `.workflow/specs/*.md` +- Run: `ccw spec load --keywords planning` - Extract session directory and artifacts directory from task message ### Step 2: Parse Input @@ -82,7 +81,7 @@ spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/issue-plan-agent.md (MUST read first) -2. Read: .workflow/project-tech.json +2. Run: `ccw spec load --keywords planning` --- diff --git a/.codex/skills/team-planex/orchestrator.md b/.codex/skills/team-planex/orchestrator.md index 50b9be6b..21f88812 100644 --- a/.codex/skills/team-planex/orchestrator.md +++ b/.codex/skills/team-planex/orchestrator.md @@ -85,8 +85,7 @@ const plannerAgent = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/planex-planner.md (MUST read first) -2. Read: .workflow/project-tech.json -3. Read: .workflow/specs/*.md +2. Run: `ccw spec load --keywords "planning execution"` --- @@ -156,8 +155,7 @@ while (true) { ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/planex-executor.md (MUST read first) -2. Read: .workflow/project-tech.json -3. Read: .workflow/specs/*.md +2. Run: `ccw spec load --keywords "planning execution"` --- diff --git a/.codex/skills/workflow-test-fix-cycle/SKILL.md b/.codex/skills/workflow-test-fix-cycle/SKILL.md index 399aa0ba..60998e31 100644 --- a/.codex/skills/workflow-test-fix-cycle/SKILL.md +++ b/.codex/skills/workflow-test-fix-cycle/SKILL.md @@ -88,8 +88,7 @@ const agentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/{agent-type}.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords "planning execution"` ## TASK CONTEXT ${taskContext} diff --git a/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md b/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md index ffe45002..9537e9d8 100644 --- a/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md +++ b/.codex/skills/workflow-test-fix-cycle/phases/01-test-fix-gen.md @@ -75,8 +75,7 @@ const contextAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/test-context-search-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords planning` --- @@ -102,8 +101,7 @@ const contextAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/context-search-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords planning` --- @@ -176,8 +174,7 @@ const analysisAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-execution-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords planning` --- @@ -245,8 +242,7 @@ const taskGenAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/action-planning-agent.md (MUST read first) -2. Read: ${projectRoot}/.workflow/project-tech.json -3. Read: ${projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords planning` --- diff --git a/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md b/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md index 35091d57..ef1dcdd9 100644 --- a/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md +++ b/.codex/skills/workflow-test-fix-cycle/phases/02-test-cycle-execute.md @@ -90,8 +90,7 @@ const analysisAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/cli-planning-agent.md (MUST read first) -2. Read: {projectRoot}/.workflow/project-tech.json -3. Read: {projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords planning` --- @@ -157,8 +156,7 @@ const fixAgentId = spawn_agent({ ### MANDATORY FIRST STEPS (Agent Execute) 1. **Read role definition**: ~/.codex/agents/test-fix-agent.md (MUST read first) -2. Read: {projectRoot}/.workflow/project-tech.json -3. Read: {projectRoot}/.workflow/specs/*.md +2. Run: `ccw spec load --keywords execution` --- diff --git a/ccw/frontend/src/components/specs/HookDialog.tsx b/ccw/frontend/src/components/specs/HookDialog.tsx index 03ed5e2f..682f1ea7 100644 --- a/ccw/frontend/src/components/specs/HookDialog.tsx +++ b/ccw/frontend/src/components/specs/HookDialog.tsx @@ -111,19 +111,19 @@ export function HookDialog({ const newErrors: Record = {}; if (!formData.name.trim()) { - newErrors.name = formatMessage({ id: 'hooks.validation.nameRequired' }); + newErrors.name = formatMessage({ id: 'specs.hooks.validation.nameRequired', defaultMessage: 'Name is required' }); } if (!formData.command.trim()) { - newErrors.command = formatMessage({ id: 'hooks.validation.commandRequired' }); + newErrors.command = formatMessage({ id: 'specs.hooks.validation.commandRequired', defaultMessage: 'Command is required' }); } if (formData.timeout && formData.timeout < 1000) { - newErrors.timeout = formatMessage({ id: 'hooks.validation.timeoutMin' }); + newErrors.timeout = formatMessage({ id: 'specs.hooks.validation.timeoutMin', defaultMessage: 'Minimum timeout is 1000ms' }); } if (formData.timeout && formData.timeout > 300000) { - newErrors.timeout = formatMessage({ id: 'hooks.validation.timeoutMax' }); + newErrors.timeout = formatMessage({ id: 'specs.hooks.validation.timeoutMax', defaultMessage: 'Maximum timeout is 300000ms' }); } setErrors(newErrors); @@ -153,11 +153,11 @@ export function HookDialog({ {isEditing - ? formatMessage({ id: 'hooks.dialog.editTitle' }) - : formatMessage({ id: 'hooks.dialog.createTitle' })} + ? formatMessage({ id: 'specs.hooks.dialog.editTitle', defaultMessage: 'Edit Hook' }) + : formatMessage({ id: 'specs.hooks.dialog.createTitle', defaultMessage: 'Create Hook' })} - {formatMessage({ id: 'hooks.dialog.description' })} + {formatMessage({ id: 'specs.hooks.dialog.description', defaultMessage: 'Configure the hook trigger event, command, and other settings.' })} @@ -165,13 +165,13 @@ export function HookDialog({ {/* Name field */}
updateField('name', e.target.value)} - placeholder={formatMessage({ id: 'hooks.placeholders.name' })} + placeholder={formatMessage({ id: 'specs.hooks.placeholders.name', defaultMessage: 'Enter hook name' })} className={errors.name ? 'border-destructive' : ''} disabled={isLoading} /> @@ -183,7 +183,7 @@ export function HookDialog({ {/* Event type field */}

- {formatMessage({ id: 'hints.hookEvents' })} + {formatMessage({ id: 'specs.hints.hookEvents', defaultMessage: 'Select when this hook should be triggered' })}

{/* Scope field */}

- {formatMessage({ id: 'hints.hookScope' })} + {formatMessage({ id: 'specs.hints.hookScope', defaultMessage: 'Global hooks apply to all projects, project hooks only to current project' })}

{/* Command field */}
updateField('command', e.target.value)} - placeholder={formatMessage({ id: 'hooks.placeholders.command' })} + placeholder={formatMessage({ id: 'specs.hooks.placeholders.command', defaultMessage: 'Enter command to execute' })} className={cn('font-mono', errors.command ? 'border-destructive' : '')} disabled={isLoading} /> @@ -258,20 +258,20 @@ export function HookDialog({

{errors.command}

)}

- {formatMessage({ id: 'hints.hookCommand' })} + {formatMessage({ id: 'specs.hints.hookCommand', defaultMessage: 'Command to execute, can use environment variables' })}

{/* Description field */}