chati-dev 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +48 -36
  2. package/framework/agents/{clarity → planning}/architect.md +1 -1
  3. package/framework/agents/{clarity → planning}/brief.md +1 -1
  4. package/framework/agents/{clarity → planning}/brownfield-wu.md +1 -1
  5. package/framework/agents/{clarity → planning}/detail.md +1 -1
  6. package/framework/agents/{clarity → planning}/greenfield-wu.md +1 -1
  7. package/framework/agents/{clarity → planning}/phases.md +1 -1
  8. package/framework/agents/{clarity → planning}/tasks.md +1 -1
  9. package/framework/agents/{clarity → planning}/ux.md +1 -1
  10. package/framework/agents/quality/qa-planning.md +5 -5
  11. package/framework/constitution.md +6 -6
  12. package/framework/context/governance.md +3 -3
  13. package/framework/context/quality.md +1 -1
  14. package/framework/context/root.md +1 -1
  15. package/framework/data/entity-registry.yaml +9 -9
  16. package/framework/domains/agents/qa-implementation.yaml +1 -1
  17. package/framework/domains/constitution.yaml +2 -2
  18. package/framework/domains/global.yaml +1 -1
  19. package/framework/hooks/mode-governance.js +5 -5
  20. package/framework/hooks/model-governance.js +38 -18
  21. package/framework/hooks/prism-engine.js +1 -1
  22. package/framework/hooks/session-digest.js +1 -1
  23. package/framework/i18n/en.yaml +1 -3
  24. package/framework/i18n/es.yaml +1 -3
  25. package/framework/i18n/fr.yaml +1 -3
  26. package/framework/i18n/pt.yaml +1 -3
  27. package/framework/intelligence/context-engine.md +3 -3
  28. package/framework/orchestrator/chati.md +148 -78
  29. package/framework/quality-gates/planning-gate.md +1 -1
  30. package/framework/schemas/context.schema.json +1 -1
  31. package/framework/schemas/session.schema.json +3 -3
  32. package/framework/tasks/architect-api-design.md +1 -1
  33. package/framework/tasks/architect-consolidate.md +1 -1
  34. package/framework/tasks/architect-db-design.md +1 -1
  35. package/framework/tasks/architect-design.md +1 -1
  36. package/framework/tasks/architect-security-review.md +1 -1
  37. package/framework/tasks/architect-stack-selection.md +1 -1
  38. package/framework/tasks/brief-consolidate.md +1 -1
  39. package/framework/tasks/brief-constraint-identify.md +1 -1
  40. package/framework/tasks/brief-extract-requirements.md +1 -1
  41. package/framework/tasks/brief-stakeholder-map.md +1 -1
  42. package/framework/tasks/brief-validate-completeness.md +1 -1
  43. package/framework/tasks/brownfield-wu-architecture-map.md +1 -1
  44. package/framework/tasks/brownfield-wu-deep-discovery.md +1 -1
  45. package/framework/tasks/brownfield-wu-dependency-scan.md +1 -1
  46. package/framework/tasks/brownfield-wu-migration-plan.md +1 -1
  47. package/framework/tasks/brownfield-wu-report.md +1 -1
  48. package/framework/tasks/brownfield-wu-risk-assess.md +1 -1
  49. package/framework/tasks/detail-acceptance-criteria.md +1 -1
  50. package/framework/tasks/detail-consolidate.md +1 -1
  51. package/framework/tasks/detail-edge-case-analysis.md +1 -1
  52. package/framework/tasks/detail-expand-prd.md +1 -1
  53. package/framework/tasks/detail-nfr-extraction.md +1 -1
  54. package/framework/tasks/greenfield-wu-analyze-empty.md +1 -1
  55. package/framework/tasks/greenfield-wu-report.md +1 -1
  56. package/framework/tasks/greenfield-wu-scaffold-detection.md +1 -1
  57. package/framework/tasks/greenfield-wu-tech-stack-assess.md +1 -1
  58. package/framework/tasks/orchestrator-deviation.md +3 -3
  59. package/framework/tasks/orchestrator-escalate.md +2 -2
  60. package/framework/tasks/orchestrator-handoff.md +6 -6
  61. package/framework/tasks/orchestrator-health.md +1 -1
  62. package/framework/tasks/orchestrator-mode-switch.md +20 -20
  63. package/framework/tasks/orchestrator-resume.md +6 -6
  64. package/framework/tasks/orchestrator-route.md +7 -7
  65. package/framework/tasks/orchestrator-status.md +8 -8
  66. package/framework/tasks/orchestrator-suggest-mode.md +13 -13
  67. package/framework/tasks/phases-breakdown.md +1 -1
  68. package/framework/tasks/phases-dependency-mapping.md +1 -1
  69. package/framework/tasks/phases-mvp-scoping.md +1 -1
  70. package/framework/tasks/qa-impl-regression-check.md +2 -2
  71. package/framework/tasks/qa-planning-consolidate.md +3 -3
  72. package/framework/tasks/qa-planning-coverage-plan.md +1 -1
  73. package/framework/tasks/qa-planning-gate-define.md +7 -7
  74. package/framework/tasks/qa-planning-risk-matrix.md +1 -1
  75. package/framework/tasks/qa-planning-test-strategy.md +1 -1
  76. package/framework/tasks/tasks-acceptance-write.md +1 -1
  77. package/framework/tasks/tasks-consolidate.md +1 -1
  78. package/framework/tasks/tasks-decompose.md +1 -1
  79. package/framework/tasks/tasks-estimate.md +1 -1
  80. package/framework/tasks/ux-a11y-check.md +1 -1
  81. package/framework/tasks/ux-component-map.md +1 -1
  82. package/framework/tasks/ux-consolidate.md +1 -1
  83. package/framework/tasks/ux-user-flow.md +1 -1
  84. package/framework/tasks/ux-wireframe.md +1 -1
  85. package/framework/workflows/brownfield-discovery.yaml +7 -7
  86. package/framework/workflows/brownfield-fullstack.yaml +9 -9
  87. package/framework/workflows/brownfield-service.yaml +5 -5
  88. package/framework/workflows/brownfield-ui.yaml +5 -5
  89. package/framework/workflows/greenfield-fullstack.yaml +9 -9
  90. package/package.json +2 -2
  91. package/scripts/bundle-framework.js +1 -1
  92. package/scripts/health-check.js +8 -8
  93. package/scripts/populate-entity-registry.js +1 -1
  94. package/scripts/validate-agents.js +1 -1
  95. package/scripts/validate-tasks.js +1 -1
  96. package/src/autonomy/autonomous-gate.js +1 -1
  97. package/src/autonomy/progress-reporter.js +9 -9
  98. package/src/config/mcp-configs.js +16 -85
  99. package/src/context/engine.js +2 -2
  100. package/src/context/layers/l1-global.js +3 -3
  101. package/src/dashboard/layout.js +7 -7
  102. package/src/dashboard/renderer.js +2 -2
  103. package/src/gates/g1-planning-complete.js +9 -9
  104. package/src/installer/core.js +11 -11
  105. package/src/installer/templates.js +1 -1
  106. package/src/installer/validator.js +8 -8
  107. package/src/intelligence/registry-manager.js +4 -4
  108. package/src/memory/session-digest.js +1 -1
  109. package/src/orchestrator/agent-selector.js +10 -10
  110. package/src/orchestrator/intent-classifier.js +4 -4
  111. package/src/orchestrator/pipeline-manager.js +3 -3
  112. package/src/orchestrator/pipeline-state.js +1 -1
  113. package/src/orchestrator/session-manager.js +3 -3
  114. package/src/tasks/executor.js +1 -1
  115. package/src/tasks/loader.js +1 -1
  116. package/src/terminal/handoff-parser.js +127 -0
  117. package/src/terminal/index.js +9 -0
  118. package/src/terminal/prompt-builder.js +313 -0
  119. package/src/terminal/run-agent.js +248 -0
  120. package/src/terminal/run-parallel.js +238 -0
  121. package/src/terminal/spawner.js +29 -18
  122. package/src/wizard/i18n.js +1 -3
  123. package/src/wizard/index.js +10 -15
  124. package/src/wizard/questions.js +7 -70
@@ -2,11 +2,13 @@
2
2
  * MCP Registry and Configuration
3
3
  * Defines available MCPs and their agent dependencies
4
4
  */
5
+
6
+ export const DEFAULT_MCPS = ['context7', 'browser'];
7
+
5
8
  export const MCP_CONFIGS = {
6
9
  browser: {
7
10
  name: 'Browser (Playwright)',
8
11
  description: 'Web automation and testing',
9
- defaultSelected: true,
10
12
  requiresEnv: [],
11
13
  claudeConfig: {
12
14
  command: 'npx',
@@ -16,104 +18,33 @@ export const MCP_CONFIGS = {
16
18
  context7: {
17
19
  name: 'Context7',
18
20
  description: 'Library documentation search',
19
- defaultSelected: true,
20
21
  requiresEnv: [],
21
22
  claudeConfig: {
22
23
  command: 'npx',
23
24
  args: ['-y', '@context7/mcp'],
24
25
  },
25
26
  },
26
- exa: {
27
- name: 'Exa',
28
- description: 'Advanced web search',
29
- defaultSelected: true,
30
- requiresEnv: ['EXA_API_KEY'],
31
- claudeConfig: {
32
- command: 'npx',
33
- args: ['-y', '@exa/mcp'],
34
- env: { EXA_API_KEY: '${EXA_API_KEY}' },
35
- },
36
- },
37
- 'desktop-commander': {
38
- name: 'Desktop Commander',
39
- description: 'File system access',
40
- defaultSelected: false,
41
- requiresEnv: [],
42
- claudeConfig: {
43
- command: 'npx',
44
- args: ['-y', '@anthropic/desktop-commander-mcp'],
45
- },
46
- },
47
- 'sequential-thinking': {
48
- name: 'Sequential Thinking',
49
- description: 'Step-by-step reasoning',
50
- defaultSelected: false,
51
- requiresEnv: [],
52
- claudeConfig: {
53
- command: 'npx',
54
- args: ['-y', '@anthropic/sequential-thinking-mcp'],
55
- },
56
- },
57
- github: {
58
- name: 'GitHub',
59
- description: 'GitHub API integration',
60
- defaultSelected: false,
61
- requiresEnv: ['GITHUB_TOKEN'],
62
- claudeConfig: {
63
- command: 'npx',
64
- args: ['-y', '@anthropic/github-mcp'],
65
- env: { GITHUB_TOKEN: '${GITHUB_TOKEN}' },
66
- },
67
- },
68
27
  };
69
28
 
70
29
  /**
71
30
  * Agent-MCP dependency matrix
72
31
  */
73
32
  export const AGENT_MCP_DEPS = {
74
- orchestrator: { required: [], optional: ['git'] },
75
- 'greenfield-wu': { required: [], optional: [] },
76
- 'brownfield-wu': { required: ['git'], optional: ['browser'] },
77
- brief: { required: [], optional: [] },
78
- detail: { required: [], optional: ['exa'] },
79
- architect: { required: ['context7'], optional: ['exa', 'git'] },
80
- ux: { required: [], optional: ['browser'] },
81
- phases: { required: [], optional: [] },
82
- tasks: { required: [], optional: [] },
83
- 'qa-planning': { required: [], optional: [] },
84
- dev: { required: ['context7', 'git'], optional: ['browser', 'coderabbit'] },
85
- 'qa-implementation':{ required: ['git'], optional: ['browser', 'coderabbit'] },
86
- devops: { required: ['git', 'github'], optional: [] },
33
+ orchestrator: { required: [], optional: [] },
34
+ 'greenfield-wu': { required: [], optional: [] },
35
+ 'brownfield-wu': { required: [], optional: ['browser'] },
36
+ brief: { required: [], optional: [] },
37
+ detail: { required: [], optional: [] },
38
+ architect: { required: ['context7'], optional: [] },
39
+ ux: { required: [], optional: ['browser'] },
40
+ phases: { required: [], optional: [] },
41
+ tasks: { required: [], optional: [] },
42
+ 'qa-planning': { required: [], optional: [] },
43
+ dev: { required: ['context7'], optional: ['browser'] },
44
+ 'qa-implementation': { required: [], optional: ['browser'] },
45
+ devops: { required: [], optional: [] },
87
46
  };
88
47
 
89
- /**
90
- * Get list of MCPs for selection prompt
91
- */
92
- export function getMCPChoices() {
93
- return Object.entries(MCP_CONFIGS).map(([key, config]) => ({
94
- value: key,
95
- label: config.name,
96
- hint: config.description,
97
- initialValue: config.defaultSelected,
98
- }));
99
- }
100
-
101
- /**
102
- * Check MCP warnings for selected project type and MCPs
103
- */
104
- export function getMCPWarnings(projectType, selectedMCPs) {
105
- const warnings = [];
106
-
107
- if (projectType === 'brownfield' && !selectedMCPs.includes('git')) {
108
- warnings.push({
109
- level: 'critical',
110
- message: "You selected Brownfield but did not enable 'git' MCP. The brownfield-wu agent requires git for codebase analysis.",
111
- });
112
- }
113
-
114
- return warnings;
115
- }
116
-
117
48
  /**
118
49
  * Generate MCP config for Claude Code (.claude/mcp.json)
119
50
  */
@@ -23,7 +23,7 @@ const LAYER_TIMEOUT_MS = 100;
23
23
  * @param {object} input
24
24
  * @param {string} input.domainsDir - Path to chati.dev/domains/
25
25
  * @param {number} input.remainingPercent - Context window remaining (0-100)
26
- * @param {string} [input.mode] - Current mode (clarity, build, deploy)
26
+ * @param {string} [input.mode] - Current mode (planning, build, deploy)
27
27
  * @param {string} [input.agent] - Active agent name
28
28
  * @param {string} [input.workflow] - Active workflow name
29
29
  * @param {string} [input.pipelinePosition] - Current pipeline step
@@ -43,7 +43,7 @@ export function runPrism(input) {
43
43
  // 2. Build context for layer processors
44
44
  const ctx = {
45
45
  domainsDir: input.domainsDir,
46
- mode: input.mode || 'clarity',
46
+ mode: input.mode || 'planning',
47
47
  bracket: bracket.bracket,
48
48
  agent: input.agent || null,
49
49
  workflow: input.workflow || null,
@@ -2,7 +2,7 @@
2
2
  * L1 Global Layer — ALWAYS active.
3
3
  *
4
4
  * Loads global rules: coding standards, bracket-specific behavioral rules,
5
- * mode governance constraints (clarity/build/deploy).
5
+ * mode governance constraints (planning/build/deploy).
6
6
  */
7
7
 
8
8
  import { loadGlobalDomain, extractRules } from '../domain-loader.js';
@@ -11,14 +11,14 @@ import { loadGlobalDomain, extractRules } from '../domain-loader.js';
11
11
  * Process L1: load global rules + mode governance.
12
12
  * @param {object} ctx - Pipeline context
13
13
  * @param {string} ctx.domainsDir - Path to chati.dev/domains/
14
- * @param {string} ctx.mode - Current mode (clarity, build, deploy)
14
+ * @param {string} ctx.mode - Current mode (planning, build, deploy)
15
15
  * @param {string} ctx.bracket - Current bracket (FRESH, MODERATE, etc.)
16
16
  * @returns {{ layer: string, rules: Array, mode: string, modeRules: object }}
17
17
  */
18
18
  export function processL1(ctx) {
19
19
  const domain = loadGlobalDomain(ctx.domainsDir);
20
20
  const rules = extractRules(domain);
21
- const mode = ctx.mode || 'clarity';
21
+ const mode = ctx.mode || 'planning';
22
22
 
23
23
  const modeRules = domain?.modes?.[mode] || {};
24
24
  const bracketRules = domain?.brackets?.[ctx.bracket] || {};
@@ -21,7 +21,7 @@ function formatScore(score, status) {
21
21
  */
22
22
  function formatState(state) {
23
23
  const stateMap = {
24
- clarity: brand('CLARITY'),
24
+ planning: brand('PLANNING'),
25
25
  build: yellow('BUILD'),
26
26
  validate: bold('VALIDATE'),
27
27
  deploy: green('DEPLOY'),
@@ -73,12 +73,12 @@ export function buildProjectInfo(data) {
73
73
  }
74
74
 
75
75
  /**
76
- * Build CLARITY section with agent scores
76
+ * Build PLANNING section with agent scores
77
77
  */
78
- export function buildClaritySection(data) {
78
+ export function buildPlanningSection(data) {
79
79
  const scores = data.agentScores || {};
80
80
 
81
- const clarityAgents = [
81
+ const planningAgents = [
82
82
  ['WU', scores['greenfield-wu'] || scores['brownfield-wu'] || { status: 'pending', score: 0 }],
83
83
  ['Brief', scores['brief'] || { status: 'pending', score: 0 }],
84
84
  ['Detail', scores['detail'] || { status: 'pending', score: 0 }],
@@ -89,16 +89,16 @@ export function buildClaritySection(data) {
89
89
  ['QA-P', scores['qa-planning'] || { status: 'pending', score: 0 }],
90
90
  ];
91
91
 
92
- const row1 = clarityAgents.slice(0, 4)
92
+ const row1 = planningAgents.slice(0, 4)
93
93
  .map(([name, info]) => `${dim(name.padEnd(8))} ${formatScore(info.score, info.status)}`)
94
94
  .join(' ');
95
95
 
96
- const row2 = clarityAgents.slice(4)
96
+ const row2 = planningAgents.slice(4)
97
97
  .map(([name, info]) => `${dim(name.padEnd(8))} ${formatScore(info.score, info.status)}`)
98
98
  .join(' ');
99
99
 
100
100
  return [
101
- brand('│') + ` ${brand('── CLARITY')} ${'─'.repeat(46)}` + brand('│'),
101
+ brand('│') + ` ${brand('── PLANNING')} ${'─'.repeat(46)}` + brand('│'),
102
102
  brand('│') + ` │ ${row1}` + ' '.repeat(5) + brand('│'),
103
103
  brand('│') + ` │ ${row2}` + ' '.repeat(5) + brand('│'),
104
104
  brand('│') + ` ${'─'.repeat(57)}` + brand('│'),
@@ -2,7 +2,7 @@ import { readDashboardData } from './data-reader.js';
2
2
  import {
3
3
  buildHeader,
4
4
  buildProjectInfo,
5
- buildClaritySection,
5
+ buildPlanningSection,
6
6
  buildBuildSection,
7
7
  buildValidateSection,
8
8
  buildIntelligenceSection,
@@ -25,7 +25,7 @@ export async function renderDashboard(targetDir) {
25
25
  ...buildHeader(data),
26
26
  ...buildProjectInfo(data),
27
27
  '',
28
- ...buildClaritySection(data),
28
+ ...buildPlanningSection(data),
29
29
  '',
30
30
  ...buildBuildSection(data),
31
31
  '',
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @fileoverview G1 — Planning Complete Gate
3
3
  *
4
- * Pre-BUILD gate that validates the CLARITY phase is fully completed.
4
+ * Pre-BUILD gate that validates the PLANNING phase is fully completed.
5
5
  * Checks that all required artifacts exist and QA-Planning has approved.
6
6
  */
7
7
 
@@ -31,7 +31,7 @@ export class PlanningCompleteGate extends GateBase {
31
31
  }
32
32
 
33
33
  /**
34
- * Collect evidence by checking filesystem for CLARITY artifacts.
34
+ * Collect evidence by checking filesystem for PLANNING artifacts.
35
35
  *
36
36
  * @param {string} projectDir
37
37
  * @returns {object} Evidence about artifact presence, session state, and handoff
@@ -99,7 +99,7 @@ export class PlanningCompleteGate extends GateBase {
99
99
  const allCriteria = [
100
100
  ...REQUIRED_ARTIFACTS.map(a => `${a.label} exists`),
101
101
  'QA-Planning handoff with passing score',
102
- 'Session shows clarity completed',
102
+ 'Session shows planning completed',
103
103
  ];
104
104
 
105
105
  const criteriaResults = [];
@@ -130,16 +130,16 @@ export class PlanningCompleteGate extends GateBase {
130
130
 
131
131
  // Check session state
132
132
  if (evidence.sessionState) {
133
- const clarityAgents = ['brief', 'detail', 'architect', 'ux', 'phases', 'tasks', 'qa-planning'];
134
- const completed = clarityAgents.filter(a =>
133
+ const planningAgents = ['brief', 'detail', 'architect', 'ux', 'phases', 'tasks', 'qa-planning'];
134
+ const completed = planningAgents.filter(a =>
135
135
  evidence.sessionState.completedAgents.includes(a)
136
136
  );
137
137
 
138
- if (completed.length === clarityAgents.length) {
139
- criteriaResults.push('Session shows clarity completed');
138
+ if (completed.length === planningAgents.length) {
139
+ criteriaResults.push('Session shows planning completed');
140
140
  } else {
141
- const missing = clarityAgents.filter(a => !completed.includes(a));
142
- warnings.push(`Incomplete clarity agents: ${missing.join(', ')}`);
141
+ const missing = planningAgents.filter(a => !completed.includes(a));
142
+ warnings.push(`Incomplete planning agents: ${missing.join(', ')}`);
143
143
  }
144
144
  }
145
145
 
@@ -34,7 +34,7 @@ export async function installFramework(config) {
34
34
  // Copy framework structure
35
35
  const frameworkDirs = [
36
36
  'orchestrator',
37
- 'agents/clarity', 'agents/quality', 'agents/build', 'agents/deploy',
37
+ 'agents/planning', 'agents/quality', 'agents/build', 'agents/deploy',
38
38
  'templates', 'workflows', 'quality-gates',
39
39
  'schemas', 'frameworks', 'intelligence', 'patterns',
40
40
  'hooks', 'domains', 'domains/agents', 'domains/workflows',
@@ -120,15 +120,15 @@ function copyFrameworkFiles(destDir) {
120
120
  const filesToCopy = [
121
121
  'constitution.md',
122
122
  'orchestrator/chati.md',
123
- // CLARITY agents
124
- 'agents/clarity/greenfield-wu.md',
125
- 'agents/clarity/brownfield-wu.md',
126
- 'agents/clarity/brief.md',
127
- 'agents/clarity/detail.md',
128
- 'agents/clarity/architect.md',
129
- 'agents/clarity/ux.md',
130
- 'agents/clarity/phases.md',
131
- 'agents/clarity/tasks.md',
123
+ // PLANNING agents
124
+ 'agents/planning/greenfield-wu.md',
125
+ 'agents/planning/brownfield-wu.md',
126
+ 'agents/planning/brief.md',
127
+ 'agents/planning/detail.md',
128
+ 'agents/planning/architect.md',
129
+ 'agents/planning/ux.md',
130
+ 'agents/planning/phases.md',
131
+ 'agents/planning/tasks.md',
132
132
  // Quality agents
133
133
  'agents/quality/qa-planning.md',
134
134
  'agents/quality/qa-implementation.md',
@@ -297,7 +297,7 @@ Read it to understand routing, session management, and agent activation.
297
297
  Governance rules are in \`chati.dev/constitution.md\` (10 Articles).
298
298
 
299
299
  ## Agents
300
- - CLARITY: chati.dev/agents/clarity/ (8 agents)
300
+ - PLANNING: chati.dev/agents/planning/ (8 agents)
301
301
  - Quality: chati.dev/agents/quality/ (2 agents)
302
302
  - BUILD: chati.dev/agents/build/ (1 agent)
303
303
  - DEPLOY: chati.dev/agents/deploy/ (1 agent)
@@ -10,7 +10,7 @@ export function generateSessionYaml(config) {
10
10
  project: {
11
11
  name: projectName,
12
12
  type: projectType,
13
- state: 'clarity',
13
+ state: 'planning',
14
14
  },
15
15
  execution_mode: 'interactive',
16
16
  current_agent: '',
@@ -24,14 +24,14 @@ export async function validateInstallation(targetDir) {
24
24
  // Check all 13 agents (orchestrator + 12 specialized)
25
25
  const agentFiles = [
26
26
  'orchestrator/chati.md',
27
- 'agents/clarity/greenfield-wu.md',
28
- 'agents/clarity/brownfield-wu.md',
29
- 'agents/clarity/brief.md',
30
- 'agents/clarity/detail.md',
31
- 'agents/clarity/architect.md',
32
- 'agents/clarity/ux.md',
33
- 'agents/clarity/phases.md',
34
- 'agents/clarity/tasks.md',
27
+ 'agents/planning/greenfield-wu.md',
28
+ 'agents/planning/brownfield-wu.md',
29
+ 'agents/planning/brief.md',
30
+ 'agents/planning/detail.md',
31
+ 'agents/planning/architect.md',
32
+ 'agents/planning/ux.md',
33
+ 'agents/planning/phases.md',
34
+ 'agents/planning/tasks.md',
35
35
  'agents/quality/qa-planning.md',
36
36
  'agents/quality/qa-implementation.md',
37
37
  'agents/build/dev.md',
@@ -140,10 +140,10 @@ export function runHealthCheck(targetDir) {
140
140
  // 4. Agent check
141
141
  const agentPaths = [
142
142
  'orchestrator/chati.md',
143
- 'agents/clarity/greenfield-wu.md', 'agents/clarity/brownfield-wu.md',
144
- 'agents/clarity/brief.md', 'agents/clarity/detail.md',
145
- 'agents/clarity/architect.md', 'agents/clarity/ux.md',
146
- 'agents/clarity/phases.md', 'agents/clarity/tasks.md',
143
+ 'agents/planning/greenfield-wu.md', 'agents/planning/brownfield-wu.md',
144
+ 'agents/planning/brief.md', 'agents/planning/detail.md',
145
+ 'agents/planning/architect.md', 'agents/planning/ux.md',
146
+ 'agents/planning/phases.md', 'agents/planning/tasks.md',
147
147
  'agents/quality/qa-planning.md', 'agents/quality/qa-implementation.md',
148
148
  'agents/build/dev.md', 'agents/deploy/devops.md',
149
149
  ];
@@ -19,7 +19,7 @@ export function buildSessionDigest(projectDir, sessionState) {
19
19
  timestamp,
20
20
  date: dateStr,
21
21
  project: sessionState.project || {},
22
- mode: sessionState.mode || 'clarity',
22
+ mode: sessionState.mode || 'planning',
23
23
  pipeline: sessionState.pipeline || {},
24
24
  agents: {},
25
25
  summary: {},
@@ -9,15 +9,15 @@ import { INTENT_TYPES } from './intent-classifier.js';
9
9
  * The complete agent pipeline in execution order.
10
10
  */
11
11
  export const AGENT_PIPELINE = [
12
- { name: 'greenfield-wu', phase: 'clarity', group: 'wu', parallel: false },
13
- { name: 'brownfield-wu', phase: 'clarity', group: 'wu', parallel: false },
14
- { name: 'brief', phase: 'clarity', group: 'clarity', parallel: false },
15
- { name: 'detail', phase: 'clarity', group: 'clarity-parallel', parallel: true },
16
- { name: 'architect', phase: 'clarity', group: 'clarity-parallel', parallel: true },
17
- { name: 'ux', phase: 'clarity', group: 'clarity-parallel', parallel: true },
18
- { name: 'phases', phase: 'clarity', group: 'clarity', parallel: false },
19
- { name: 'tasks', phase: 'clarity', group: 'clarity', parallel: false },
20
- { name: 'qa-planning', phase: 'clarity', group: 'quality', parallel: false },
12
+ { name: 'greenfield-wu', phase: 'planning', group: 'wu', parallel: false },
13
+ { name: 'brownfield-wu', phase: 'planning', group: 'wu', parallel: false },
14
+ { name: 'brief', phase: 'planning', group: 'planning', parallel: false },
15
+ { name: 'detail', phase: 'planning', group: 'planning-parallel', parallel: true },
16
+ { name: 'architect', phase: 'planning', group: 'planning-parallel', parallel: true },
17
+ { name: 'ux', phase: 'planning', group: 'planning-parallel', parallel: true },
18
+ { name: 'phases', phase: 'planning', group: 'planning', parallel: false },
19
+ { name: 'tasks', phase: 'planning', group: 'planning', parallel: false },
20
+ { name: 'qa-planning', phase: 'planning', group: 'quality', parallel: false },
21
21
  { name: 'dev', phase: 'build', group: 'build', parallel: false },
22
22
  { name: 'qa-implementation', phase: 'build', group: 'quality', parallel: false },
23
23
  { name: 'devops', phase: 'deploy', group: 'deploy', parallel: false },
@@ -58,7 +58,7 @@ function getAgentsByGroup(group) {
58
58
  *
59
59
  * @param {object} context
60
60
  * @param {string} context.intent - Classified intent
61
- * @param {string} context.mode - Current mode (clarity/build/deploy)
61
+ * @param {string} context.mode - Current mode (planning/build/deploy)
62
62
  * @param {string} [context.currentAgent] - Currently active agent
63
63
  * @param {string[]} [context.completedAgents] - Already completed agents
64
64
  * @param {boolean} [context.isGreenfield] - true for new projects, false for existing
@@ -83,7 +83,7 @@ const WEIGHTS = {
83
83
  * Context boost multipliers based on current mode.
84
84
  */
85
85
  const MODE_CONTEXT_BOOST = {
86
- clarity: {
86
+ planning: {
87
87
  [INTENT_TYPES.PLANNING]: 1.5,
88
88
  [INTENT_TYPES.IMPLEMENTATION]: 0.5,
89
89
  },
@@ -198,11 +198,11 @@ function buildReasoning(intent, keywords, context) {
198
198
  * Get intent-to-phase mapping.
199
199
  *
200
200
  * @param {string} intent
201
- * @returns {string} Target phase (clarity, build, deploy)
201
+ * @returns {string} Target phase (planning, build, deploy)
202
202
  */
203
203
  export function getIntentPhase(intent) {
204
204
  const phaseMap = {
205
- [INTENT_TYPES.PLANNING]: 'clarity',
205
+ [INTENT_TYPES.PLANNING]: 'planning',
206
206
  [INTENT_TYPES.IMPLEMENTATION]: 'build',
207
207
  [INTENT_TYPES.REVIEW]: 'build',
208
208
  [INTENT_TYPES.DEPLOY]: 'deploy',
@@ -243,7 +243,7 @@ export function checkModeAlignment(intent, currentMode) {
243
243
  }
244
244
 
245
245
  // Check if mode change is allowed
246
- const modeOrder = ['clarity', 'build', 'deploy'];
246
+ const modeOrder = ['planning', 'build', 'deploy'];
247
247
  const currentIndex = modeOrder.indexOf(currentMode);
248
248
  const targetIndex = modeOrder.indexOf(targetPhase);
249
249
 
@@ -8,7 +8,7 @@ import { AGENT_PIPELINE, getNextAgent } from './agent-selector.js';
8
8
  /**
9
9
  * Pipeline phases in order.
10
10
  */
11
- export const PIPELINE_PHASES = ['clarity', 'build', 'deploy'];
11
+ export const PIPELINE_PHASES = ['planning', 'build', 'deploy'];
12
12
 
13
13
  /**
14
14
  * Agent status values.
@@ -35,7 +35,7 @@ const QA_IMPLEMENTATION_THRESHOLD = 90;
35
35
  * @returns {object} Pipeline state
36
36
  */
37
37
  export function initPipeline(options = {}) {
38
- const { isGreenfield = true, mode = 'clarity' } = options;
38
+ const { isGreenfield = true, mode = 'planning' } = options;
39
39
 
40
40
  const agents = {};
41
41
  for (const agentDef of AGENT_PIPELINE) {
@@ -257,7 +257,7 @@ export function checkPhaseTransition(pipelineState) {
257
257
  const { phase, agents } = pipelineState;
258
258
 
259
259
  // Check based on current phase
260
- if (phase === 'clarity') {
260
+ if (phase === 'planning') {
261
261
  // Need QA-Planning to be completed with score >= 95
262
262
  const qaPlanning = agents['qa-planning'];
263
263
  if (!qaPlanning) {
@@ -44,7 +44,7 @@ export function loadPipelineState(projectDir) {
44
44
 
45
45
  // Extract pipeline-relevant fields
46
46
  const state = {
47
- phase: session.mode || 'clarity',
47
+ phase: session.mode || 'planning',
48
48
  isGreenfield: session.project_type === 'greenfield',
49
49
  startedAt: session.started_at || null,
50
50
  completedAt: session.completed_at || null,
@@ -16,7 +16,7 @@ const SESSION_FILE = '.chati/session.yaml';
16
16
  */
17
17
  const DEFAULT_SESSION = {
18
18
  version: '1.0',
19
- mode: 'clarity',
19
+ mode: 'planning',
20
20
  language: 'en',
21
21
  project_type: 'greenfield',
22
22
  started_at: null,
@@ -65,7 +65,7 @@ export function initSession(projectDir, options = {}) {
65
65
 
66
66
  const session = {
67
67
  ...DEFAULT_SESSION,
68
- mode: options.mode || 'clarity',
68
+ mode: options.mode || 'planning',
69
69
  language: options.language || 'en',
70
70
  project_type: options.isGreenfield === false ? 'brownfield' : 'greenfield',
71
71
  started_at: new Date().toISOString(),
@@ -383,7 +383,7 @@ export function validateSession(projectDir) {
383
383
  }
384
384
 
385
385
  // Validate mode
386
- const validModes = ['clarity', 'build', 'validate', 'deploy', 'completed'];
386
+ const validModes = ['planning', 'build', 'validate', 'deploy', 'completed'];
387
387
  if (!validModes.includes(session.mode)) {
388
388
  return {
389
389
  exists: true,
@@ -186,7 +186,7 @@ function sanitizeSessionState(state) {
186
186
  if (!state) return null;
187
187
 
188
188
  return {
189
- mode: state.mode || 'clarity',
189
+ mode: state.mode || 'planning',
190
190
  current_agent: state.current_agent || null,
191
191
  pipeline_position: state.pipeline_position || null,
192
192
  completed_agents: state.completed_agents || [],
@@ -59,7 +59,7 @@ export function parseTaskContent(content, source = 'unknown') {
59
59
  id: meta.id,
60
60
  agent: meta.agent,
61
61
  trigger: meta.trigger || 'orchestrator',
62
- phase: meta.phase || 'clarity',
62
+ phase: meta.phase || 'planning',
63
63
  requires_input: meta.requires_input === true || meta.requires_input === 'true',
64
64
  parallelizable: meta.parallelizable === true || meta.parallelizable === 'true',
65
65
  outputs: parseArray(meta.outputs),