feat: Enhance spec management with new hooks and settings features

- Updated test cycle execution steps to streamline agent execution.
- Improved HookDialog component with enhanced validation messages and localization.
- Introduced SpecDialog component for better spec management.
- Added new hooks for fetching and updating specs list and frontmatter.
- Implemented API functions for specs list retrieval and index rebuilding.
- Added localization support for new specs settings and hooks.
- Enhanced SpecsSettingsPage to manage project and personal specs effectively.
- Updated CLI commands to support keyword-based spec loading.
- Improved spec index builder to categorize specs by workflow stages.
This commit is contained in:
catlog22
2026-02-26 22:52:33 +08:00
parent 6155fcc7b8
commit 151b81ee4a
51 changed files with 731 additions and 690 deletions

View File

@@ -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

View File

@@ -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"`
---

View File

@@ -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

View File

@@ -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}

View File

@@ -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

View File

@@ -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"
---

View File

@@ -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)
---

View File

@@ -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
---

View File

@@ -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
---

View File

@@ -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

View File

@@ -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`
---

View File

@@ -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"`
---

View File

@@ -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}

View File

@@ -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`
---

View File

@@ -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`
---