aiwcli 0.10.3 → 0.11.0

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 (189) hide show
  1. package/bin/run.js +1 -1
  2. package/dist/commands/clear.js +28 -131
  3. package/dist/commands/init/index.js +3 -3
  4. package/dist/lib/gitignore-manager.d.ts +32 -0
  5. package/dist/lib/gitignore-manager.js +141 -2
  6. package/dist/templates/CLAUDE.md +8 -8
  7. package/dist/templates/_shared/.claude/commands/handoff-resume.md +64 -0
  8. package/dist/templates/_shared/.claude/commands/handoff.md +16 -10
  9. package/dist/templates/_shared/.claude/settings.json +7 -7
  10. package/dist/templates/_shared/hooks-ts/_utils/git-state.ts +2 -0
  11. package/dist/templates/_shared/hooks-ts/archive_plan.ts +159 -0
  12. package/dist/templates/_shared/hooks-ts/context_monitor.ts +147 -0
  13. package/dist/templates/_shared/hooks-ts/file-suggestion.ts +130 -0
  14. package/dist/templates/_shared/hooks-ts/pre_compact.ts +49 -0
  15. package/dist/templates/_shared/hooks-ts/session_end.ts +104 -0
  16. package/dist/templates/_shared/hooks-ts/session_start.ts +144 -0
  17. package/dist/templates/_shared/hooks-ts/task_create_capture.ts +48 -0
  18. package/dist/templates/_shared/hooks-ts/task_update_capture.ts +74 -0
  19. package/dist/templates/_shared/hooks-ts/user_prompt_submit.ts +83 -0
  20. package/dist/templates/_shared/lib-ts/CLAUDE.md +318 -0
  21. package/dist/templates/_shared/lib-ts/base/atomic-write.ts +12 -12
  22. package/dist/templates/_shared/lib-ts/base/constants.ts +22 -15
  23. package/dist/templates/_shared/lib-ts/base/hook-utils.ts +129 -50
  24. package/dist/templates/_shared/lib-ts/base/inference.ts +28 -21
  25. package/dist/templates/_shared/lib-ts/base/logger.ts +31 -15
  26. package/dist/templates/_shared/lib-ts/base/state-io.ts +9 -7
  27. package/dist/templates/_shared/lib-ts/base/stop-words.ts +131 -131
  28. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +139 -0
  29. package/dist/templates/_shared/lib-ts/base/utils.ts +69 -69
  30. package/dist/templates/_shared/lib-ts/context/context-formatter.ts +30 -24
  31. package/dist/templates/_shared/lib-ts/context/context-selector.ts +50 -32
  32. package/dist/templates/_shared/lib-ts/context/context-store.ts +76 -48
  33. package/dist/templates/_shared/lib-ts/context/plan-manager.ts +61 -37
  34. package/dist/templates/_shared/lib-ts/context/task-tracker.ts +10 -6
  35. package/dist/templates/_shared/lib-ts/handoff/document-generator.ts +11 -10
  36. package/dist/templates/_shared/lib-ts/handoff/handoff-reader.ts +159 -0
  37. package/dist/templates/_shared/lib-ts/templates/formatters.ts +6 -4
  38. package/dist/templates/_shared/lib-ts/types.ts +68 -55
  39. package/dist/templates/_shared/scripts/resolve_context.ts +24 -0
  40. package/dist/templates/_shared/scripts/resume_handoff.ts +321 -0
  41. package/dist/templates/_shared/scripts/save_handoff.ts +21 -21
  42. package/dist/templates/_shared/scripts/status_line.ts +733 -0
  43. package/dist/templates/cc-native/.claude/settings.json +175 -185
  44. package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +15 -17
  45. package/dist/templates/cc-native/_cc-native/agents/CLAUDE.md +0 -2
  46. package/dist/templates/cc-native/_cc-native/hooks/CLAUDE.md +109 -135
  47. package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.ts +119 -0
  48. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +921 -0
  49. package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.ts +61 -0
  50. package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +157 -0
  51. package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +709 -0
  52. package/dist/templates/cc-native/_cc-native/lib-ts/cc-native-state.ts +199 -0
  53. package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +124 -0
  54. package/dist/templates/cc-native/_cc-native/lib-ts/config.ts +57 -0
  55. package/dist/templates/cc-native/_cc-native/lib-ts/constants.ts +83 -0
  56. package/dist/templates/cc-native/_cc-native/lib-ts/debug.ts +80 -0
  57. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +119 -0
  58. package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +162 -0
  59. package/dist/templates/cc-native/_cc-native/lib-ts/nul +3 -0
  60. package/dist/templates/cc-native/_cc-native/lib-ts/orchestrator.ts +249 -0
  61. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/agent.ts +155 -0
  62. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/codex.ts +130 -0
  63. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/gemini.ts +106 -0
  64. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/index.ts +10 -0
  65. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/types.ts +23 -0
  66. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +243 -0
  67. package/dist/templates/cc-native/_cc-native/lib-ts/tsconfig.json +18 -0
  68. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +310 -0
  69. package/dist/templates/cc-native/_cc-native/lib-ts/verdict.ts +72 -0
  70. package/dist/templates/cc-native/_cc-native/plan-review.config.json +1 -9
  71. package/oclif.manifest.json +1 -1
  72. package/package.json +1 -1
  73. package/dist/templates/_shared/hooks/__init__.py +0 -16
  74. package/dist/templates/_shared/hooks/__pycache__/__init__.cpython-313.pyc +0 -0
  75. package/dist/templates/_shared/hooks/__pycache__/archive_plan.cpython-313.pyc +0 -0
  76. package/dist/templates/_shared/hooks/__pycache__/context_enforcer.cpython-313.pyc +0 -0
  77. package/dist/templates/_shared/hooks/__pycache__/context_monitor.cpython-313.pyc +0 -0
  78. package/dist/templates/_shared/hooks/__pycache__/file-suggestion.cpython-313.pyc +0 -0
  79. package/dist/templates/_shared/hooks/__pycache__/pre_compact.cpython-313.pyc +0 -0
  80. package/dist/templates/_shared/hooks/__pycache__/session_end.cpython-313.pyc +0 -0
  81. package/dist/templates/_shared/hooks/__pycache__/session_start.cpython-313.pyc +0 -0
  82. package/dist/templates/_shared/hooks/__pycache__/task_create_atomicity.cpython-313.pyc +0 -0
  83. package/dist/templates/_shared/hooks/__pycache__/task_create_capture.cpython-313.pyc +0 -0
  84. package/dist/templates/_shared/hooks/__pycache__/task_update_capture.cpython-313.pyc +0 -0
  85. package/dist/templates/_shared/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
  86. package/dist/templates/_shared/hooks/archive_plan.py +0 -177
  87. package/dist/templates/_shared/hooks/context_monitor.py +0 -270
  88. package/dist/templates/_shared/hooks/file-suggestion.py +0 -215
  89. package/dist/templates/_shared/hooks/pre_compact.py +0 -104
  90. package/dist/templates/_shared/hooks/session_end.py +0 -173
  91. package/dist/templates/_shared/hooks/session_start.py +0 -206
  92. package/dist/templates/_shared/hooks/task_create_capture.py +0 -108
  93. package/dist/templates/_shared/hooks/task_update_capture.py +0 -145
  94. package/dist/templates/_shared/hooks/user_prompt_submit.py +0 -139
  95. package/dist/templates/_shared/lib/__init__.py +0 -1
  96. package/dist/templates/_shared/lib/__pycache__/__init__.cpython-313.pyc +0 -0
  97. package/dist/templates/_shared/lib/base/__init__.py +0 -65
  98. package/dist/templates/_shared/lib/base/__pycache__/__init__.cpython-313.pyc +0 -0
  99. package/dist/templates/_shared/lib/base/__pycache__/atomic_write.cpython-313.pyc +0 -0
  100. package/dist/templates/_shared/lib/base/__pycache__/constants.cpython-313.pyc +0 -0
  101. package/dist/templates/_shared/lib/base/__pycache__/hook_utils.cpython-313.pyc +0 -0
  102. package/dist/templates/_shared/lib/base/__pycache__/inference.cpython-313.pyc +0 -0
  103. package/dist/templates/_shared/lib/base/__pycache__/logger.cpython-313.pyc +0 -0
  104. package/dist/templates/_shared/lib/base/__pycache__/stop_words.cpython-313.pyc +0 -0
  105. package/dist/templates/_shared/lib/base/__pycache__/subprocess_utils.cpython-313.pyc +0 -0
  106. package/dist/templates/_shared/lib/base/__pycache__/utils.cpython-313.pyc +0 -0
  107. package/dist/templates/_shared/lib/base/atomic_write.py +0 -180
  108. package/dist/templates/_shared/lib/base/constants.py +0 -358
  109. package/dist/templates/_shared/lib/base/hook_utils.py +0 -339
  110. package/dist/templates/_shared/lib/base/inference.py +0 -307
  111. package/dist/templates/_shared/lib/base/logger.py +0 -305
  112. package/dist/templates/_shared/lib/base/stop_words.py +0 -221
  113. package/dist/templates/_shared/lib/base/subprocess_utils.py +0 -46
  114. package/dist/templates/_shared/lib/base/utils.py +0 -263
  115. package/dist/templates/_shared/lib/context/__init__.py +0 -102
  116. package/dist/templates/_shared/lib/context/__pycache__/__init__.cpython-313.pyc +0 -0
  117. package/dist/templates/_shared/lib/context/__pycache__/cache.cpython-313.pyc +0 -0
  118. package/dist/templates/_shared/lib/context/__pycache__/context_extractor.cpython-313.pyc +0 -0
  119. package/dist/templates/_shared/lib/context/__pycache__/context_formatter.cpython-313.pyc +0 -0
  120. package/dist/templates/_shared/lib/context/__pycache__/context_manager.cpython-313.pyc +0 -0
  121. package/dist/templates/_shared/lib/context/__pycache__/context_selector.cpython-313.pyc +0 -0
  122. package/dist/templates/_shared/lib/context/__pycache__/context_store.cpython-313.pyc +0 -0
  123. package/dist/templates/_shared/lib/context/__pycache__/discovery.cpython-313.pyc +0 -0
  124. package/dist/templates/_shared/lib/context/__pycache__/event_log.cpython-313.pyc +0 -0
  125. package/dist/templates/_shared/lib/context/__pycache__/plan_archive.cpython-313.pyc +0 -0
  126. package/dist/templates/_shared/lib/context/__pycache__/plan_manager.cpython-313.pyc +0 -0
  127. package/dist/templates/_shared/lib/context/__pycache__/task_sync.cpython-313.pyc +0 -0
  128. package/dist/templates/_shared/lib/context/__pycache__/task_tracker.cpython-313.pyc +0 -0
  129. package/dist/templates/_shared/lib/context/context_formatter.py +0 -317
  130. package/dist/templates/_shared/lib/context/context_selector.py +0 -508
  131. package/dist/templates/_shared/lib/context/context_store.py +0 -653
  132. package/dist/templates/_shared/lib/context/plan_manager.py +0 -303
  133. package/dist/templates/_shared/lib/context/task_tracker.py +0 -188
  134. package/dist/templates/_shared/lib/handoff/__init__.py +0 -22
  135. package/dist/templates/_shared/lib/handoff/__pycache__/__init__.cpython-313.pyc +0 -0
  136. package/dist/templates/_shared/lib/handoff/__pycache__/document_generator.cpython-313.pyc +0 -0
  137. package/dist/templates/_shared/lib/handoff/document_generator.py +0 -278
  138. package/dist/templates/_shared/lib/templates/README.md +0 -206
  139. package/dist/templates/_shared/lib/templates/__init__.py +0 -36
  140. package/dist/templates/_shared/lib/templates/__pycache__/__init__.cpython-313.pyc +0 -0
  141. package/dist/templates/_shared/lib/templates/__pycache__/formatters.cpython-313.pyc +0 -0
  142. package/dist/templates/_shared/lib/templates/__pycache__/persona_questions.cpython-313.pyc +0 -0
  143. package/dist/templates/_shared/lib/templates/__pycache__/plan_context.cpython-313.pyc +0 -0
  144. package/dist/templates/_shared/lib/templates/formatters.py +0 -146
  145. package/dist/templates/_shared/lib/templates/plan_context.py +0 -73
  146. package/dist/templates/_shared/scripts/__pycache__/save_handoff.cpython-313.pyc +0 -0
  147. package/dist/templates/_shared/scripts/__pycache__/status_line.cpython-313.pyc +0 -0
  148. package/dist/templates/_shared/scripts/save_handoff.py +0 -357
  149. package/dist/templates/_shared/scripts/status_line.py +0 -716
  150. package/dist/templates/cc-native/.claude/commands/cc-native/fresh-perspective.md +0 -8
  151. package/dist/templates/cc-native/.windsurf/workflows/cc-native/fresh-perspective.md +0 -8
  152. package/dist/templates/cc-native/MIGRATION.md +0 -86
  153. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/add_plan_context.cpython-313.pyc +0 -0
  154. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-plan-review.cpython-313.pyc +0 -0
  155. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/mark_questions_asked.cpython-313.pyc +0 -0
  156. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/plan_accepted.cpython-313.pyc +0 -0
  157. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/plan_questions_early.cpython-313.pyc +0 -0
  158. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/suggest-fresh-perspective.cpython-313.pyc +0 -0
  159. package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.py +0 -130
  160. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.py +0 -954
  161. package/dist/templates/cc-native/_cc-native/hooks/plan_questions_early.py +0 -81
  162. package/dist/templates/cc-native/_cc-native/hooks/suggest-fresh-perspective.py +0 -340
  163. package/dist/templates/cc-native/_cc-native/lib/CLAUDE.md +0 -265
  164. package/dist/templates/cc-native/_cc-native/lib/__init__.py +0 -53
  165. package/dist/templates/cc-native/_cc-native/lib/__pycache__/__init__.cpython-313.pyc +0 -0
  166. package/dist/templates/cc-native/_cc-native/lib/__pycache__/atomic_write.cpython-313.pyc +0 -0
  167. package/dist/templates/cc-native/_cc-native/lib/__pycache__/constants.cpython-313.pyc +0 -0
  168. package/dist/templates/cc-native/_cc-native/lib/__pycache__/debug.cpython-313.pyc +0 -0
  169. package/dist/templates/cc-native/_cc-native/lib/__pycache__/orchestrator.cpython-313.pyc +0 -0
  170. package/dist/templates/cc-native/_cc-native/lib/__pycache__/state.cpython-313.pyc +0 -0
  171. package/dist/templates/cc-native/_cc-native/lib/__pycache__/utils.cpython-313.pyc +0 -0
  172. package/dist/templates/cc-native/_cc-native/lib/constants.py +0 -45
  173. package/dist/templates/cc-native/_cc-native/lib/debug.py +0 -139
  174. package/dist/templates/cc-native/_cc-native/lib/orchestrator.py +0 -362
  175. package/dist/templates/cc-native/_cc-native/lib/reviewers/__init__.py +0 -28
  176. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/__init__.cpython-313.pyc +0 -0
  177. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/agent.cpython-313.pyc +0 -0
  178. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/base.cpython-313.pyc +0 -0
  179. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/codex.cpython-313.pyc +0 -0
  180. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/gemini.cpython-313.pyc +0 -0
  181. package/dist/templates/cc-native/_cc-native/lib/reviewers/agent.py +0 -215
  182. package/dist/templates/cc-native/_cc-native/lib/reviewers/base.py +0 -88
  183. package/dist/templates/cc-native/_cc-native/lib/reviewers/codex.py +0 -124
  184. package/dist/templates/cc-native/_cc-native/lib/reviewers/gemini.py +0 -108
  185. package/dist/templates/cc-native/_cc-native/lib/state.py +0 -268
  186. package/dist/templates/cc-native/_cc-native/lib/utils.py +0 -1071
  187. package/dist/templates/cc-native/_cc-native/scripts/__pycache__/aggregate_agents.cpython-313.pyc +0 -0
  188. package/dist/templates/cc-native/_cc-native/scripts/aggregate_agents.py +0 -168
  189. package/dist/templates/cc-native/_cc-native/workflows/fresh-perspective.md +0 -134
@@ -1,168 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Aggregate Agents - Auto-detect agent configurations from frontmatter.
4
-
5
- Reads all agent markdown files from .claude/agents/ and extracts their
6
- YAML frontmatter to provide agent configuration for the hook system.
7
-
8
- Used by cc-native-plan-review.py to auto-detect available agents
9
- instead of requiring manual config.json entries.
10
-
11
- Note: Uses simple YAML parsing without external dependencies.
12
- """
13
-
14
- import re
15
- from pathlib import Path
16
- from typing import Any
17
-
18
-
19
- def parse_simple_yaml(yaml_str: str) -> dict[str, Any]:
20
- """Parse simple YAML frontmatter without external dependencies.
21
-
22
- Supports:
23
- - Key: value pairs
24
- - Lists (using - item syntax)
25
- - Boolean values (true/false)
26
- - Nested lists under keys
27
-
28
- Args:
29
- yaml_str: YAML string to parse
30
-
31
- Returns:
32
- Parsed dict
33
- """
34
- result: dict[str, Any] = {}
35
- current_key = None
36
- current_list: list[str] | None = None
37
-
38
- for line in yaml_str.split('\n'):
39
- # Skip empty lines
40
- if not line.strip():
41
- continue
42
-
43
- # Check if this is a list item (starts with -)
44
- list_match = re.match(r'^(\s*)-\s+(.+)$', line)
45
- if list_match:
46
- indent = len(list_match.group(1))
47
- value = list_match.group(2).strip()
48
- if current_key and indent > 0:
49
- if current_list is None:
50
- current_list = []
51
- result[current_key] = current_list
52
- current_list.append(value)
53
- continue
54
-
55
- # Check if this is a key: value pair
56
- kv_match = re.match(r'^(\w+):\s*(.*)$', line)
57
- if kv_match:
58
- key = kv_match.group(1)
59
- value = kv_match.group(2).strip()
60
- current_key = key
61
- current_list = None
62
-
63
- if value:
64
- # Parse the value
65
- if value.lower() == 'true':
66
- result[key] = True
67
- elif value.lower() == 'false':
68
- result[key] = False
69
- elif value.isdigit():
70
- result[key] = int(value)
71
- else:
72
- result[key] = value
73
- # If no value, it might be followed by a list
74
-
75
- return result
76
-
77
-
78
- def extract_frontmatter(content: str) -> dict[str, Any] | None:
79
- """Extract YAML frontmatter from markdown content.
80
-
81
- Args:
82
- content: Raw markdown file content
83
-
84
- Returns:
85
- Parsed frontmatter as dict, or None if no valid frontmatter found
86
- """
87
- match = re.match(r'^---\s*\n(.*?)\n---\s*\n', content, re.DOTALL)
88
- if not match:
89
- return None
90
- try:
91
- return parse_simple_yaml(match.group(1))
92
- except Exception:
93
- return None
94
-
95
-
96
- def extract_body(content: str) -> str:
97
- """Extract markdown body (after frontmatter) from content.
98
-
99
- Args:
100
- content: Raw markdown file content
101
-
102
- Returns:
103
- Markdown body content (everything after the closing ---)
104
- """
105
- match = re.match(r'^---\s*\n.*?\n---\s*\n(.*)$', content, re.DOTALL)
106
- if match:
107
- return match.group(1).strip()
108
- return content.strip()
109
-
110
-
111
- def aggregate_agents(agents_dir: Path | None = None) -> list[dict[str, Any]]:
112
- """Read all agent files and return aggregated metadata.
113
-
114
- Scans the agents directory for .md files, extracts frontmatter from each,
115
- and returns a list of agent configurations.
116
-
117
- Args:
118
- agents_dir: Path to agents directory. If None, uses default
119
- _cc-native/agents/ relative to this script.
120
-
121
- Returns:
122
- List of agent configuration dicts with fields:
123
- - name: Agent identifier (lowercase)
124
- - description: Full description for Task tool
125
- - model: Claude model (haiku/sonnet/opus)
126
- - focus: Brief focus for orchestrator
127
- - enabled: Whether agent is available
128
- - categories: Work categories for filtering
129
- - system_prompt: Full markdown body (persona content)
130
- """
131
- if agents_dir is None:
132
- # Default to _cc-native/agents/ relative to this script's location
133
- # Script is at: _cc-native/scripts/aggregate_agents.py
134
- # Agents are at: _cc-native/agents/
135
- script_dir = Path(__file__).parent
136
- agents_dir = script_dir.parent / "agents"
137
-
138
- agents = []
139
-
140
- if not agents_dir.exists():
141
- return agents
142
-
143
- for file in agents_dir.glob("*.md"):
144
- try:
145
- content = file.read_text(encoding="utf-8")
146
- frontmatter = extract_frontmatter(content)
147
- if frontmatter and frontmatter.get("name"):
148
- # Ensure categories is always a list
149
- if "categories" not in frontmatter:
150
- frontmatter["categories"] = ["code"]
151
- elif isinstance(frontmatter["categories"], str):
152
- frontmatter["categories"] = [frontmatter["categories"]]
153
- # Extract markdown body as system_prompt
154
- frontmatter["system_prompt"] = extract_body(content)
155
- agents.append(frontmatter)
156
- except Exception:
157
- # Skip files that can't be read or parsed
158
- continue
159
-
160
- return agents
161
-
162
-
163
- if __name__ == "__main__":
164
- import json
165
- import sys
166
-
167
- agents = aggregate_agents()
168
- json.dump(agents, sys.stdout, indent=2)
@@ -1,134 +0,0 @@
1
- # Fresh Perspective Workflow
2
-
3
- ## Purpose
4
-
5
- Combat **code bias**—the tendency to anchor problem-solving to existing patterns when you can see the current implementation. This workflow provides an unbiased perspective by:
6
-
7
- 1. Extracting only the essential problem context (stripping implementation details)
8
- 2. Sending that abstracted context to an agent with NO file access
9
- 3. Receiving first-principles analysis unclouded by "how it's currently done"
10
-
11
- ## When to Use
12
-
13
- - When you feel stuck going in circles
14
- - Before starting a large implementation (sanity check)
15
- - When incremental fixes aren't working
16
- - When you suspect you might be over-engineering
17
- - When you want validation of your approach from a fresh viewpoint
18
-
19
- ## Process
20
-
21
- ### Step 1: Explain the Code Bias Problem
22
-
23
- Before extracting context, briefly explain to the user:
24
-
25
- > **Why Fresh Perspective?**
26
- >
27
- > When we see existing code, we unconsciously anchor to current patterns. This makes us likely to propose incremental improvements rather than potentially better approaches. The Fresh Perspective agent has NO access to your codebase—it can only see an abstracted problem description. This intentional blindness helps surface solutions you might not consider because you're "too close" to the current implementation.
28
-
29
- ### Step 2: Extract Context (Using context-extractor Agent)
30
-
31
- Invoke the `context-extractor` agent (model: haiku, tools: none) to extract abstracted context from the recent conversation.
32
-
33
- **Prompt for context-extractor:**
34
- ```
35
- Review the conversation context and extract the following into JSON format:
36
- - problem: What is being solved (abstract, no code references)
37
- - stack: Technologies and frameworks in use
38
- - constraints: Hard constraints that cannot change
39
- - success_criteria: How success will be measured
40
-
41
- Strip all implementation details, file names, function names, and code snippets.
42
- Preserve only the problem essence.
43
- ```
44
-
45
- ### Step 3: User Reviews Extracted Context
46
-
47
- Present the extracted context to the user using AskUserQuestion:
48
-
49
- **Header:** "Context Check"
50
- **Question:** "Here's the abstracted context I'll send to the Fresh Perspective agent. Would you like to edit it before proceeding?"
51
- **Options:**
52
- - "Looks good, proceed" — Description: "Send this context as-is"
53
- - "Let me edit it" — Description: "I'll provide corrections or additions"
54
-
55
- Display the extracted JSON so the user can see exactly what will be sent:
56
-
57
- ```
58
- Extracted Context:
59
- ─────────────────
60
- Problem: [extracted problem]
61
- Stack: [extracted stack]
62
- Constraints: [extracted constraints]
63
- Success Criteria: [extracted success_criteria]
64
- ```
65
-
66
- If user chooses to edit, use AskUserQuestion to gather their corrections.
67
-
68
- ### Step 4: Invoke Fresh Perspective Agent
69
-
70
- Invoke the `fresh-perspective` agent (model: sonnet, tools: none) with ONLY the reviewed context.
71
-
72
- **Critical:** The fresh-perspective agent has `tools: ""` which means it cannot read any files. This is intentional—do not attempt to provide additional context.
73
-
74
- **Prompt for fresh-perspective:**
75
- ```
76
- Analyze this problem from first principles and provide your perspective:
77
-
78
- {reviewed_context_json}
79
-
80
- Remember: You have NO access to the codebase. Approach this as if designing from scratch.
81
- Provide structured output with: Understanding, Proposed Approach, Key Design Decisions,
82
- Suggested Patterns, Questions to Consider, and Comparison Points.
83
- ```
84
-
85
- ### Step 5: Display Advisory Output
86
-
87
- Present the Fresh Perspective analysis with a clear disclaimer:
88
-
89
- ```markdown
90
- # Fresh Perspective Analysis
91
-
92
- > **Advisory Only:** This analysis was generated without seeing your code.
93
- > Use your judgment on what applies to your specific situation.
94
-
95
- [Agent's structured output here]
96
-
97
- ---
98
-
99
- **Next Steps:**
100
- - Compare these suggestions against your current implementation
101
- - Consider the questions raised before proceeding
102
- - Decide which insights apply to your specific context
103
- ```
104
-
105
- ### Step 6: Save Artifact
106
-
107
- Write the analysis to: `_output/cc-native/fresh-perspective/{YYYY-MM-DD}/{HHmmss}-analysis.md`
108
-
109
- Include:
110
- - Timestamp
111
- - Extracted context (what was sent)
112
- - Full agent response
113
- - User's original problem description (if different from extracted)
114
-
115
- ## Output Files
116
-
117
- All artifacts go to `_output/cc-native/fresh-perspective/`:
118
- - `{date}/{timestamp}-analysis.md` — Complete analysis record
119
-
120
- ## Success Criteria
121
-
122
- - [ ] Context was successfully abstracted (no code references leaked)
123
- - [ ] User reviewed and approved the context before agent invocation
124
- - [ ] Fresh Perspective agent provided structured analysis
125
- - [ ] Output clearly marked as advisory
126
- - [ ] Artifact saved for future reference
127
-
128
- ## Relationship with Other Workflows
129
-
130
- | Workflow | When | Focus |
131
- |----------|------|-------|
132
- | **Fresh Perspective** | When stuck, before big implementations | Alternative approaches, first principles |
133
- | Skeptic Review | During plan review | Problem-solution alignment, assumptions |
134
- | Plan Review | After writing plan | Quality, completeness, issues |