aiwcli 0.9.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 (204) hide show
  1. package/README.md +1248 -0
  2. package/bin/dev.cmd +3 -0
  3. package/bin/dev.js +16 -0
  4. package/bin/run.cmd +3 -0
  5. package/bin/run.js +19 -0
  6. package/dist/commands/branch.d.ts +45 -0
  7. package/dist/commands/branch.js +488 -0
  8. package/dist/commands/clean.d.ts +34 -0
  9. package/dist/commands/clean.js +186 -0
  10. package/dist/commands/clear.d.ts +51 -0
  11. package/dist/commands/clear.js +835 -0
  12. package/dist/commands/init/index.d.ts +107 -0
  13. package/dist/commands/init/index.js +565 -0
  14. package/dist/commands/launch.d.ts +21 -0
  15. package/dist/commands/launch.js +108 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +1 -0
  18. package/dist/lib/base-command.d.ts +114 -0
  19. package/dist/lib/base-command.js +153 -0
  20. package/dist/lib/bmad-installer.d.ts +38 -0
  21. package/dist/lib/bmad-installer.js +145 -0
  22. package/dist/lib/claude-settings-types.d.ts +102 -0
  23. package/dist/lib/claude-settings-types.js +5 -0
  24. package/dist/lib/config.d.ts +25 -0
  25. package/dist/lib/config.js +46 -0
  26. package/dist/lib/debug.d.ts +39 -0
  27. package/dist/lib/debug.js +74 -0
  28. package/dist/lib/env-compat.d.ts +26 -0
  29. package/dist/lib/env-compat.js +35 -0
  30. package/dist/lib/errors.d.ts +126 -0
  31. package/dist/lib/errors.js +145 -0
  32. package/dist/lib/generic-merge.d.ts +74 -0
  33. package/dist/lib/generic-merge.js +105 -0
  34. package/dist/lib/git/branch.d.ts +67 -0
  35. package/dist/lib/git/branch.js +155 -0
  36. package/dist/lib/git/index.d.ts +11 -0
  37. package/dist/lib/git/index.js +13 -0
  38. package/dist/lib/git/safety-checks.d.ts +44 -0
  39. package/dist/lib/git/safety-checks.js +102 -0
  40. package/dist/lib/git/types.d.ts +31 -0
  41. package/dist/lib/git/types.js +6 -0
  42. package/dist/lib/git/worktree.d.ts +67 -0
  43. package/dist/lib/git/worktree.js +220 -0
  44. package/dist/lib/gitignore-manager.d.ts +10 -0
  45. package/dist/lib/gitignore-manager.js +60 -0
  46. package/dist/lib/hooks-merger.d.ts +28 -0
  47. package/dist/lib/hooks-merger.js +94 -0
  48. package/dist/lib/ide-path-resolver.d.ts +102 -0
  49. package/dist/lib/ide-path-resolver.js +129 -0
  50. package/dist/lib/index.d.ts +13 -0
  51. package/dist/lib/index.js +22 -0
  52. package/dist/lib/output.d.ts +51 -0
  53. package/dist/lib/output.js +76 -0
  54. package/dist/lib/paths.d.ts +66 -0
  55. package/dist/lib/paths.js +136 -0
  56. package/dist/lib/quiet.d.ts +12 -0
  57. package/dist/lib/quiet.js +17 -0
  58. package/dist/lib/settings-hierarchy.d.ts +42 -0
  59. package/dist/lib/settings-hierarchy.js +105 -0
  60. package/dist/lib/spawn.d.ts +105 -0
  61. package/dist/lib/spawn.js +157 -0
  62. package/dist/lib/spinner.d.ts +19 -0
  63. package/dist/lib/spinner.js +34 -0
  64. package/dist/lib/stdin.d.ts +48 -0
  65. package/dist/lib/stdin.js +60 -0
  66. package/dist/lib/template-installer.d.ts +92 -0
  67. package/dist/lib/template-installer.js +375 -0
  68. package/dist/lib/template-linter.d.ts +49 -0
  69. package/dist/lib/template-linter.js +173 -0
  70. package/dist/lib/template-merger.d.ts +47 -0
  71. package/dist/lib/template-merger.js +173 -0
  72. package/dist/lib/template-resolver.d.ts +20 -0
  73. package/dist/lib/template-resolver.js +60 -0
  74. package/dist/lib/terminal.d.ts +102 -0
  75. package/dist/lib/terminal.js +245 -0
  76. package/dist/lib/tty-detection.d.ts +62 -0
  77. package/dist/lib/tty-detection.js +83 -0
  78. package/dist/lib/user-utils.d.ts +5 -0
  79. package/dist/lib/user-utils.js +23 -0
  80. package/dist/lib/version.d.ts +99 -0
  81. package/dist/lib/version.js +144 -0
  82. package/dist/lib/watch-templates.d.ts +6 -0
  83. package/dist/lib/watch-templates.js +73 -0
  84. package/dist/lib/windsurf-hooks-hierarchy.d.ts +30 -0
  85. package/dist/lib/windsurf-hooks-hierarchy.js +66 -0
  86. package/dist/lib/windsurf-hooks-merger.d.ts +26 -0
  87. package/dist/lib/windsurf-hooks-merger.js +53 -0
  88. package/dist/lib/windsurf-hooks-types.d.ts +33 -0
  89. package/dist/lib/windsurf-hooks-types.js +5 -0
  90. package/dist/templates/CLAUDE.md +174 -0
  91. package/dist/templates/_shared/.claude/commands/handoff.md +14 -0
  92. package/dist/templates/_shared/.claude/settings.json +61 -0
  93. package/dist/templates/_shared/.codex/workflows/handoff.md +14 -0
  94. package/dist/templates/_shared/.windsurf/workflows/handoff.md +14 -0
  95. package/dist/templates/_shared/hooks/__init__.py +16 -0
  96. package/dist/templates/_shared/hooks/archive_plan.py +270 -0
  97. package/dist/templates/_shared/hooks/context_enforcer.py +621 -0
  98. package/dist/templates/_shared/hooks/context_monitor.py +322 -0
  99. package/dist/templates/_shared/hooks/file-suggestion.py +188 -0
  100. package/dist/templates/_shared/hooks/task_create_capture.py +194 -0
  101. package/dist/templates/_shared/hooks/task_update_capture.py +254 -0
  102. package/dist/templates/_shared/hooks/user_prompt_submit.py +157 -0
  103. package/dist/templates/_shared/lib/__init__.py +1 -0
  104. package/dist/templates/_shared/lib/base/__init__.py +49 -0
  105. package/dist/templates/_shared/lib/base/__pycache__/constants.cpython-313.pyc +0 -0
  106. package/dist/templates/_shared/lib/base/atomic_write.py +180 -0
  107. package/dist/templates/_shared/lib/base/constants.py +299 -0
  108. package/dist/templates/_shared/lib/base/inference.py +189 -0
  109. package/dist/templates/_shared/lib/base/utils.py +216 -0
  110. package/dist/templates/_shared/lib/context/__init__.py +119 -0
  111. package/dist/templates/_shared/lib/context/__pycache__/__init__.cpython-313.pyc +0 -0
  112. package/dist/templates/_shared/lib/context/__pycache__/cache.cpython-313.pyc +0 -0
  113. package/dist/templates/_shared/lib/context/__pycache__/context_manager.cpython-313.pyc +0 -0
  114. package/dist/templates/_shared/lib/context/__pycache__/event_log.cpython-313.pyc +0 -0
  115. package/dist/templates/_shared/lib/context/cache.py +446 -0
  116. package/dist/templates/_shared/lib/context/context_manager.py +1171 -0
  117. package/dist/templates/_shared/lib/context/discovery.py +486 -0
  118. package/dist/templates/_shared/lib/context/event_log.py +308 -0
  119. package/dist/templates/_shared/lib/context/plan_archive.py +247 -0
  120. package/dist/templates/_shared/lib/context/task_sync.py +367 -0
  121. package/dist/templates/_shared/lib/handoff/__init__.py +22 -0
  122. package/dist/templates/_shared/lib/handoff/document_generator.py +307 -0
  123. package/dist/templates/_shared/lib/templates/README.md +215 -0
  124. package/dist/templates/_shared/lib/templates/__init__.py +40 -0
  125. package/dist/templates/_shared/lib/templates/formatters.py +147 -0
  126. package/dist/templates/_shared/lib/templates/plan_context.py +119 -0
  127. package/dist/templates/_shared/scripts/save_handoff.py +99 -0
  128. package/dist/templates/_shared/workflows/handoff.md +212 -0
  129. package/dist/templates/cc-native/.claude/agents/cc-native/ACCESSIBILITY-TESTER.md +80 -0
  130. package/dist/templates/cc-native/.claude/agents/cc-native/ARCHITECT-REVIEWER.md +75 -0
  131. package/dist/templates/cc-native/.claude/agents/cc-native/ASSUMPTION-CHAIN-TRACER.md +239 -0
  132. package/dist/templates/cc-native/.claude/agents/cc-native/CLARITY-AUDITOR.md +109 -0
  133. package/dist/templates/cc-native/.claude/agents/cc-native/CODE-REVIEWER.md +71 -0
  134. package/dist/templates/cc-native/.claude/agents/cc-native/COMPLETENESS-CHECKER.md +104 -0
  135. package/dist/templates/cc-native/.claude/agents/cc-native/CONTEXT-EXTRACTOR.md +93 -0
  136. package/dist/templates/cc-native/.claude/agents/cc-native/DEVILS-ADVOCATE.md +223 -0
  137. package/dist/templates/cc-native/.claude/agents/cc-native/DOCUMENTATION-REVIEWER.md +73 -0
  138. package/dist/templates/cc-native/.claude/agents/cc-native/FEASIBILITY-ANALYST.md +93 -0
  139. package/dist/templates/cc-native/.claude/agents/cc-native/FRESH-PERSPECTIVE.md +103 -0
  140. package/dist/templates/cc-native/.claude/agents/cc-native/HANDOFF-READINESS.md +145 -0
  141. package/dist/templates/cc-native/.claude/agents/cc-native/HIDDEN-COMPLEXITY-DETECTOR.md +248 -0
  142. package/dist/templates/cc-native/.claude/agents/cc-native/INCENTIVE-MAPPER.md +235 -0
  143. package/dist/templates/cc-native/.claude/agents/cc-native/PENETRATION-TESTER.md +80 -0
  144. package/dist/templates/cc-native/.claude/agents/cc-native/PERFORMANCE-ENGINEER.md +76 -0
  145. package/dist/templates/cc-native/.claude/agents/cc-native/PLAN-ORCHESTRATOR.md +141 -0
  146. package/dist/templates/cc-native/.claude/agents/cc-native/PRECEDENT-FINDER.md +240 -0
  147. package/dist/templates/cc-native/.claude/agents/cc-native/REVERSIBILITY-ANALYST.md +211 -0
  148. package/dist/templates/cc-native/.claude/agents/cc-native/RISK-ASSESSOR.md +101 -0
  149. package/dist/templates/cc-native/.claude/agents/cc-native/SECOND-ORDER-ANALYST.md +197 -0
  150. package/dist/templates/cc-native/.claude/agents/cc-native/SIMPLICITY-GUARDIAN.md +97 -0
  151. package/dist/templates/cc-native/.claude/agents/cc-native/SKEPTIC.md +349 -0
  152. package/dist/templates/cc-native/.claude/agents/cc-native/STAKEHOLDER-ADVOCATE.md +106 -0
  153. package/dist/templates/cc-native/.claude/agents/cc-native/TRADE-OFF-ILLUMINATOR.md +205 -0
  154. package/dist/templates/cc-native/.claude/commands/cc-native/fresh-perspective.md +8 -0
  155. package/dist/templates/cc-native/.claude/commands/cc-native/specdev.md +10 -0
  156. package/dist/templates/cc-native/.claude/settings.json +119 -0
  157. package/dist/templates/cc-native/.windsurf/workflows/cc-native/fix.md +8 -0
  158. package/dist/templates/cc-native/.windsurf/workflows/cc-native/fresh-perspective.md +8 -0
  159. package/dist/templates/cc-native/.windsurf/workflows/cc-native/implement.md +8 -0
  160. package/dist/templates/cc-native/.windsurf/workflows/cc-native/research.md +8 -0
  161. package/dist/templates/cc-native/CC-NATIVE-README.md +192 -0
  162. package/dist/templates/cc-native/MIGRATION.md +86 -0
  163. package/dist/templates/cc-native/TEMPLATE-SCHEMA.md +331 -0
  164. package/dist/templates/cc-native/_cc-native/docs/PERMISSION_REQUEST_VERIFICATION.md +147 -0
  165. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/add_plan_context.cpython-313.pyc +0 -0
  166. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/archive_plan.cpython-313.pyc +0 -0
  167. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-agent-review.cpython-313.pyc +0 -0
  168. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-plan-review.cpython-313.pyc +0 -0
  169. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/test_permission_request.cpython-313.pyc +0 -0
  170. package/dist/templates/cc-native/_cc-native/hooks/add_plan_context.py +150 -0
  171. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.py +746 -0
  172. package/dist/templates/cc-native/_cc-native/hooks/suggest-fresh-perspective.py +339 -0
  173. package/dist/templates/cc-native/_cc-native/lib/__init__.py +57 -0
  174. package/dist/templates/cc-native/_cc-native/lib/__pycache__/__init__.cpython-313.pyc +0 -0
  175. package/dist/templates/cc-native/_cc-native/lib/__pycache__/orchestrator.cpython-313.pyc +0 -0
  176. package/dist/templates/cc-native/_cc-native/lib/__pycache__/state.cpython-313.pyc +0 -0
  177. package/dist/templates/cc-native/_cc-native/lib/__pycache__/utils.cpython-313.pyc +0 -0
  178. package/dist/templates/cc-native/_cc-native/lib/async_archive.py +68 -0
  179. package/dist/templates/cc-native/_cc-native/lib/atomic_write.py +98 -0
  180. package/dist/templates/cc-native/_cc-native/lib/constants.py +45 -0
  181. package/dist/templates/cc-native/_cc-native/lib/orchestrator.py +273 -0
  182. package/dist/templates/cc-native/_cc-native/lib/reviewers/__init__.py +28 -0
  183. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/__init__.cpython-313.pyc +0 -0
  184. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/agent.cpython-313.pyc +0 -0
  185. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/base.cpython-313.pyc +0 -0
  186. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/codex.cpython-313.pyc +0 -0
  187. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/gemini.cpython-313.pyc +0 -0
  188. package/dist/templates/cc-native/_cc-native/lib/reviewers/agent.py +164 -0
  189. package/dist/templates/cc-native/_cc-native/lib/reviewers/base.py +89 -0
  190. package/dist/templates/cc-native/_cc-native/lib/reviewers/codex.py +119 -0
  191. package/dist/templates/cc-native/_cc-native/lib/reviewers/gemini.py +103 -0
  192. package/dist/templates/cc-native/_cc-native/lib/state.py +251 -0
  193. package/dist/templates/cc-native/_cc-native/lib/utils.py +830 -0
  194. package/dist/templates/cc-native/_cc-native/plan-review.config.json +76 -0
  195. package/dist/templates/cc-native/_cc-native/scripts/__pycache__/aggregate_agents.cpython-313.pyc +0 -0
  196. package/dist/templates/cc-native/_cc-native/scripts/aggregate_agents.py +151 -0
  197. package/dist/templates/cc-native/_cc-native/workflows/fresh-perspective.md +134 -0
  198. package/dist/templates/cc-native/_cc-native/workflows/specdev.md +9 -0
  199. package/dist/types/exit-codes.d.ts +11 -0
  200. package/dist/types/exit-codes.js +10 -0
  201. package/dist/types/index.d.ts +5 -0
  202. package/dist/types/index.js +7 -0
  203. package/oclif.manifest.json +405 -0
  204. package/package.json +109 -0
@@ -0,0 +1,76 @@
1
+ {
2
+ "planReview": {
3
+ "enabled": true,
4
+ "reviewers": {
5
+ "codex": {
6
+ "enabled": true,
7
+ "model": "o4-mini",
8
+ "timeout": 120
9
+ },
10
+ "gemini": {
11
+ "enabled": false,
12
+ "model": "",
13
+ "timeout": 120
14
+ }
15
+ },
16
+ "blockOnFail": false,
17
+ "display": {
18
+ "maxIssues": 12,
19
+ "maxMissingSections": 12,
20
+ "maxQuestions": 12
21
+ }
22
+ },
23
+ "agentReview": {
24
+ "enabled": true,
25
+ "timeout": 120,
26
+ "blockOnFail": true,
27
+ "maxTurns": 3,
28
+ "orchestrator": {
29
+ "enabled": true,
30
+ "model": "haiku",
31
+ "timeout": 30,
32
+ "maxTurns": 6
33
+ },
34
+ "legacyMode": false,
35
+ "reviewIterations": {
36
+ "simple": 1,
37
+ "medium": 1,
38
+ "high": 2
39
+ },
40
+ "earlyExitOnAllPass": true,
41
+ "display": {
42
+ "maxIssues": 12,
43
+ "maxMissingSections": 12,
44
+ "maxQuestions": 12
45
+ }
46
+ },
47
+ "agentSelection": {
48
+ "simple": { "min": 3, "max": 3 },
49
+ "medium": { "min": 8, "max": 8 },
50
+ "high": { "min": 12, "max": 12 },
51
+ "fallbackCount": 3
52
+ },
53
+ "agentDefaults": {
54
+ "model": "sonnet"
55
+ },
56
+ "complexityCategories": [
57
+ "code", "infrastructure", "documentation",
58
+ "life", "business", "design", "research"
59
+ ],
60
+ "sanitization": {
61
+ "maxSessionIdLength": 32,
62
+ "maxTitleLength": 50
63
+ },
64
+ "planContext": {
65
+ "enabled": true,
66
+ "offerClarifyingQuestions": true
67
+ },
68
+ "stuckDetection": {
69
+ "enabled": true,
70
+ "errorThreshold": 3,
71
+ "fileEditThreshold": 4,
72
+ "testFailureThreshold": 3,
73
+ "cooldown": 10,
74
+ "maxSuggestions": 3
75
+ }
76
+ }
@@ -0,0 +1,151 @@
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 aggregate_agents(agents_dir: Path | None = None) -> list[dict[str, Any]]:
97
+ """Read all agent files and return aggregated metadata.
98
+
99
+ Scans the agents directory for .md files, extracts frontmatter from each,
100
+ and returns a list of agent configurations.
101
+
102
+ Args:
103
+ agents_dir: Path to agents directory. If None, uses default
104
+ .claude/agents relative to project root.
105
+
106
+ Returns:
107
+ List of agent configuration dicts with fields:
108
+ - name: Agent identifier (lowercase)
109
+ - description: Full description for Task tool
110
+ - model: Claude model (haiku/sonnet/opus)
111
+ - focus: Brief focus for orchestrator
112
+ - enabled: Whether agent is available
113
+ - categories: Work categories for filtering
114
+ - tools: Available tools
115
+ """
116
+ if agents_dir is None:
117
+ # Default to .claude/agents/cc-native relative to this script's location
118
+ # Script is at: _cc-native/scripts/aggregate_agents.py
119
+ # Agents are at: .claude/agents/cc-native/
120
+ script_dir = Path(__file__).parent
121
+ agents_dir = script_dir.parent.parent / ".claude" / "agents" / "cc-native"
122
+
123
+ agents = []
124
+
125
+ if not agents_dir.exists():
126
+ return agents
127
+
128
+ for file in agents_dir.glob("*.md"):
129
+ try:
130
+ content = file.read_text(encoding="utf-8")
131
+ frontmatter = extract_frontmatter(content)
132
+ if frontmatter and frontmatter.get("name"):
133
+ # Ensure categories is always a list
134
+ if "categories" not in frontmatter:
135
+ frontmatter["categories"] = ["code"]
136
+ elif isinstance(frontmatter["categories"], str):
137
+ frontmatter["categories"] = [frontmatter["categories"]]
138
+ agents.append(frontmatter)
139
+ except Exception:
140
+ # Skip files that can't be read or parsed
141
+ continue
142
+
143
+ return agents
144
+
145
+
146
+ if __name__ == "__main__":
147
+ import json
148
+ import sys
149
+
150
+ agents = aggregate_agents()
151
+ json.dump(agents, sys.stdout, indent=2)
@@ -0,0 +1,134 @@
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 |
@@ -0,0 +1,9 @@
1
+ Read this spec and interview me in detail using the AskUserQuestionTool about literally anything:
2
+ - Technical implementation
3
+ - UI & UX
4
+ - Concerns
5
+ - Tradeoffs, etc.
6
+
7
+ But make sure the questions are not obvious
8
+
9
+ Be very in-depth and continue interviewing me continually until it's complete, then write the spec to the file.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Exit codes for AI Workflow CLI commands.
3
+ * Used consistently across all commands for scripting and automation.
4
+ */
5
+ export declare const EXIT_CODES: {
6
+ readonly SUCCESS: 0;
7
+ readonly GENERAL_ERROR: 1;
8
+ readonly INVALID_USAGE: 2;
9
+ readonly ENVIRONMENT_ERROR: 3;
10
+ };
11
+ export type ExitCode = (typeof EXIT_CODES)[keyof typeof EXIT_CODES];
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Exit codes for AI Workflow CLI commands.
3
+ * Used consistently across all commands for scripting and automation.
4
+ */
5
+ export const EXIT_CODES = {
6
+ SUCCESS: 0,
7
+ GENERAL_ERROR: 1,
8
+ INVALID_USAGE: 2,
9
+ ENVIRONMENT_ERROR: 3,
10
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Shared type definitions for AI Workflow CLI.
3
+ * Re-exports all types from this module.
4
+ */
5
+ export { EXIT_CODES, type ExitCode } from './exit-codes.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared type definitions for AI Workflow CLI.
3
+ * Re-exports all types from this module.
4
+ */
5
+ // Exit code constants and types
6
+ export { EXIT_CODES } from './exit-codes.js';
7
+ // Future type re-exports will be added here as the codebase grows