monty-autonomous-fullstack-dev-multillm 1.0.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 (186) hide show
  1. package/LICENSE +81 -0
  2. package/README.md +608 -0
  3. package/bin/cli.js +448 -0
  4. package/dist/agents/coding.d.ts +15 -0
  5. package/dist/agents/coding.d.ts.map +1 -0
  6. package/dist/agents/coding.js +189 -0
  7. package/dist/agents/coding.js.map +1 -0
  8. package/dist/agents/initializer.d.ts +15 -0
  9. package/dist/agents/initializer.d.ts.map +1 -0
  10. package/dist/agents/initializer.js +87 -0
  11. package/dist/agents/initializer.js.map +1 -0
  12. package/dist/agents/prompts/arbitrator.md +143 -0
  13. package/dist/agents/prompts/coding.md +247 -0
  14. package/dist/agents/prompts/initializer.md +98 -0
  15. package/dist/config/agent-config.d.ts +103 -0
  16. package/dist/config/agent-config.d.ts.map +1 -0
  17. package/dist/config/agent-config.js +138 -0
  18. package/dist/config/agent-config.js.map +1 -0
  19. package/dist/config/auth-config.d.ts +152 -0
  20. package/dist/config/auth-config.d.ts.map +1 -0
  21. package/dist/config/auth-config.js +139 -0
  22. package/dist/config/auth-config.js.map +1 -0
  23. package/dist/config/mcp-config.d.ts +109 -0
  24. package/dist/config/mcp-config.d.ts.map +1 -0
  25. package/dist/config/mcp-config.js +234 -0
  26. package/dist/config/mcp-config.js.map +1 -0
  27. package/dist/config/provider-config.d.ts +139 -0
  28. package/dist/config/provider-config.d.ts.map +1 -0
  29. package/dist/config/provider-config.js +344 -0
  30. package/dist/config/provider-config.js.map +1 -0
  31. package/dist/config/subagents-config.d.ts +85 -0
  32. package/dist/config/subagents-config.d.ts.map +1 -0
  33. package/dist/config/subagents-config.js +430 -0
  34. package/dist/config/subagents-config.js.map +1 -0
  35. package/dist/index.d.ts +14 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +385 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/orchestrator/arbitrator.d.ts +93 -0
  40. package/dist/orchestrator/arbitrator.d.ts.map +1 -0
  41. package/dist/orchestrator/arbitrator.js +330 -0
  42. package/dist/orchestrator/arbitrator.js.map +1 -0
  43. package/dist/orchestrator/index.d.ts +113 -0
  44. package/dist/orchestrator/index.d.ts.map +1 -0
  45. package/dist/orchestrator/index.js +217 -0
  46. package/dist/orchestrator/index.js.map +1 -0
  47. package/dist/orchestrator/review-coordinator.d.ts +143 -0
  48. package/dist/orchestrator/review-coordinator.d.ts.map +1 -0
  49. package/dist/orchestrator/review-coordinator.js +401 -0
  50. package/dist/orchestrator/review-coordinator.js.map +1 -0
  51. package/dist/orchestrator/task-classifier.d.ts +87 -0
  52. package/dist/orchestrator/task-classifier.d.ts.map +1 -0
  53. package/dist/orchestrator/task-classifier.js +250 -0
  54. package/dist/orchestrator/task-classifier.js.map +1 -0
  55. package/dist/providers/anthropic-provider.d.ts +64 -0
  56. package/dist/providers/anthropic-provider.d.ts.map +1 -0
  57. package/dist/providers/anthropic-provider.js +264 -0
  58. package/dist/providers/anthropic-provider.js.map +1 -0
  59. package/dist/providers/base-provider.d.ts +219 -0
  60. package/dist/providers/base-provider.d.ts.map +1 -0
  61. package/dist/providers/base-provider.js +143 -0
  62. package/dist/providers/base-provider.js.map +1 -0
  63. package/dist/providers/cursor-provider.d.ts +82 -0
  64. package/dist/providers/cursor-provider.d.ts.map +1 -0
  65. package/dist/providers/cursor-provider.js +321 -0
  66. package/dist/providers/cursor-provider.js.map +1 -0
  67. package/dist/providers/google-provider.d.ts +75 -0
  68. package/dist/providers/google-provider.d.ts.map +1 -0
  69. package/dist/providers/google-provider.js +274 -0
  70. package/dist/providers/google-provider.js.map +1 -0
  71. package/dist/providers/index.d.ts +92 -0
  72. package/dist/providers/index.d.ts.map +1 -0
  73. package/dist/providers/index.js +233 -0
  74. package/dist/providers/index.js.map +1 -0
  75. package/dist/providers/openai-provider.d.ts +83 -0
  76. package/dist/providers/openai-provider.d.ts.map +1 -0
  77. package/dist/providers/openai-provider.js +295 -0
  78. package/dist/providers/openai-provider.js.map +1 -0
  79. package/dist/templates/feature_list.template.json +66 -0
  80. package/dist/templates/progress.template.txt +51 -0
  81. package/dist/utils/auth-manager.d.ts +121 -0
  82. package/dist/utils/auth-manager.d.ts.map +1 -0
  83. package/dist/utils/auth-manager.js +560 -0
  84. package/dist/utils/auth-manager.js.map +1 -0
  85. package/dist/utils/budget-enforcer.d.ts +181 -0
  86. package/dist/utils/budget-enforcer.d.ts.map +1 -0
  87. package/dist/utils/budget-enforcer.js +386 -0
  88. package/dist/utils/budget-enforcer.js.map +1 -0
  89. package/dist/utils/chatgpt-detector.d.ts +51 -0
  90. package/dist/utils/chatgpt-detector.d.ts.map +1 -0
  91. package/dist/utils/chatgpt-detector.js +274 -0
  92. package/dist/utils/chatgpt-detector.js.map +1 -0
  93. package/dist/utils/claude-code-detector.d.ts +39 -0
  94. package/dist/utils/claude-code-detector.d.ts.map +1 -0
  95. package/dist/utils/claude-code-detector.js +153 -0
  96. package/dist/utils/claude-code-detector.js.map +1 -0
  97. package/dist/utils/code-quality.d.ts +58 -0
  98. package/dist/utils/code-quality.d.ts.map +1 -0
  99. package/dist/utils/code-quality.js +258 -0
  100. package/dist/utils/code-quality.js.map +1 -0
  101. package/dist/utils/context-primer.d.ts +50 -0
  102. package/dist/utils/context-primer.d.ts.map +1 -0
  103. package/dist/utils/context-primer.js +429 -0
  104. package/dist/utils/context-primer.js.map +1 -0
  105. package/dist/utils/dependency-management.d.ts +40 -0
  106. package/dist/utils/dependency-management.d.ts.map +1 -0
  107. package/dist/utils/dependency-management.js +123 -0
  108. package/dist/utils/dependency-management.js.map +1 -0
  109. package/dist/utils/environment-validation.d.ts +33 -0
  110. package/dist/utils/environment-validation.d.ts.map +1 -0
  111. package/dist/utils/environment-validation.js +136 -0
  112. package/dist/utils/environment-validation.js.map +1 -0
  113. package/dist/utils/error-recovery.d.ts +60 -0
  114. package/dist/utils/error-recovery.d.ts.map +1 -0
  115. package/dist/utils/error-recovery.js +183 -0
  116. package/dist/utils/error-recovery.js.map +1 -0
  117. package/dist/utils/feature-list.d.ts +102 -0
  118. package/dist/utils/feature-list.d.ts.map +1 -0
  119. package/dist/utils/feature-list.js +191 -0
  120. package/dist/utils/feature-list.js.map +1 -0
  121. package/dist/utils/gemini-detector.d.ts +65 -0
  122. package/dist/utils/gemini-detector.d.ts.map +1 -0
  123. package/dist/utils/gemini-detector.js +340 -0
  124. package/dist/utils/gemini-detector.js.map +1 -0
  125. package/dist/utils/git-utils.d.ts +48 -0
  126. package/dist/utils/git-utils.d.ts.map +1 -0
  127. package/dist/utils/git-utils.js +110 -0
  128. package/dist/utils/git-utils.js.map +1 -0
  129. package/dist/utils/health-check.d.ts +32 -0
  130. package/dist/utils/health-check.d.ts.map +1 -0
  131. package/dist/utils/health-check.js +152 -0
  132. package/dist/utils/health-check.js.map +1 -0
  133. package/dist/utils/hooks-manager.d.ts +154 -0
  134. package/dist/utils/hooks-manager.d.ts.map +1 -0
  135. package/dist/utils/hooks-manager.js +359 -0
  136. package/dist/utils/hooks-manager.js.map +1 -0
  137. package/dist/utils/multi-auth-manager.d.ts +144 -0
  138. package/dist/utils/multi-auth-manager.d.ts.map +1 -0
  139. package/dist/utils/multi-auth-manager.js +588 -0
  140. package/dist/utils/multi-auth-manager.js.map +1 -0
  141. package/dist/utils/progress.d.ts +49 -0
  142. package/dist/utils/progress.d.ts.map +1 -0
  143. package/dist/utils/progress.js +209 -0
  144. package/dist/utils/progress.js.map +1 -0
  145. package/dist/utils/project-detection.d.ts +40 -0
  146. package/dist/utils/project-detection.d.ts.map +1 -0
  147. package/dist/utils/project-detection.js +230 -0
  148. package/dist/utils/project-detection.js.map +1 -0
  149. package/dist/utils/session-manager.d.ts +119 -0
  150. package/dist/utils/session-manager.d.ts.map +1 -0
  151. package/dist/utils/session-manager.js +389 -0
  152. package/dist/utils/session-manager.js.map +1 -0
  153. package/dist/utils/skills-manager.d.ts +113 -0
  154. package/dist/utils/skills-manager.d.ts.map +1 -0
  155. package/dist/utils/skills-manager.js +332 -0
  156. package/dist/utils/skills-manager.js.map +1 -0
  157. package/dist/utils/structured-output.d.ts +117 -0
  158. package/dist/utils/structured-output.d.ts.map +1 -0
  159. package/dist/utils/structured-output.js +191 -0
  160. package/dist/utils/structured-output.js.map +1 -0
  161. package/dist/utils/subagent-manager.d.ts +143 -0
  162. package/dist/utils/subagent-manager.d.ts.map +1 -0
  163. package/dist/utils/subagent-manager.js +326 -0
  164. package/dist/utils/subagent-manager.js.map +1 -0
  165. package/dist/utils/supabase-setup.d.ts +50 -0
  166. package/dist/utils/supabase-setup.d.ts.map +1 -0
  167. package/dist/utils/supabase-setup.js +151 -0
  168. package/dist/utils/supabase-setup.js.map +1 -0
  169. package/dist/utils/token-refresh.d.ts +21 -0
  170. package/dist/utils/token-refresh.d.ts.map +1 -0
  171. package/dist/utils/token-refresh.js +77 -0
  172. package/dist/utils/token-refresh.js.map +1 -0
  173. package/dist/utils/tos-warning.d.ts +115 -0
  174. package/dist/utils/tos-warning.d.ts.map +1 -0
  175. package/dist/utils/tos-warning.js +304 -0
  176. package/dist/utils/tos-warning.js.map +1 -0
  177. package/dist/utils/usage-monitor.d.ts +156 -0
  178. package/dist/utils/usage-monitor.d.ts.map +1 -0
  179. package/dist/utils/usage-monitor.js +296 -0
  180. package/dist/utils/usage-monitor.js.map +1 -0
  181. package/package.json +105 -0
  182. package/scripts/init.ps1 +73 -0
  183. package/scripts/init.sh +86 -0
  184. package/scripts/test-auth.sh +90 -0
  185. package/templates/feature_list.template.json +66 -0
  186. package/templates/progress.template.txt +51 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Initializer Agent
3
+ * Runs on first execution to set up the project environment.
4
+ * Based on Anthropic's best practices for long-running agents.
5
+ */
6
+ import { query } from "@anthropic-ai/claude-agent-sdk";
7
+ import { readFileSync } from "fs";
8
+ import { join, dirname } from "path";
9
+ import { fileURLToPath } from "url";
10
+ import { agentConfig } from "../config/agent-config.js";
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = dirname(__filename);
13
+ /**
14
+ * Load the initializer system prompt from markdown file
15
+ */
16
+ function loadInitializerPrompt() {
17
+ const promptPath = join(__dirname, "prompts", "initializer.md");
18
+ return readFileSync(promptPath, "utf-8");
19
+ }
20
+ /**
21
+ * Build the complete prompt for the initializer agent
22
+ */
23
+ export function buildInitializerPrompt(userSpec) {
24
+ const systemPrompt = loadInitializerPrompt();
25
+ return `${systemPrompt}
26
+
27
+ ---
28
+
29
+ ## USER'S PROJECT SPECIFICATION
30
+
31
+ ${userSpec}
32
+
33
+ ---
34
+
35
+ ## PATHS TO USE
36
+
37
+ - Agent directory: ${agentConfig.paths.agentDir}
38
+ - Feature list: ${agentConfig.paths.featureList}
39
+ - Progress file: ${agentConfig.paths.progressFile}
40
+
41
+ ## INITIALIZATION CHECKLIST
42
+
43
+ 1. [ ] Create .agent directory
44
+ 2. [ ] Create feature_list.json with ALL features
45
+ 3. [ ] Create claude-progress.txt with initial state
46
+ 4. [ ] Create scripts/init.sh (Unix)
47
+ 5. [ ] Create scripts/init.ps1 (Windows)
48
+ 6. [ ] Make initial git commit
49
+
50
+ Begin the initialization process now.`;
51
+ }
52
+ /**
53
+ * Run the initializer agent
54
+ */
55
+ export async function runInitializerAgent(userSpec) {
56
+ const prompt = buildInitializerPrompt(userSpec);
57
+ console.log("🚀 Starting Initializer Agent...");
58
+ console.log("━".repeat(50));
59
+ for await (const message of query({
60
+ prompt,
61
+ options: {
62
+ allowedTools: agentConfig.tools.initializer,
63
+ permissionMode: agentConfig.permissionMode,
64
+ // Explicitly pass credentials to SDK subprocess
65
+ env: {
66
+ ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY || undefined,
67
+ },
68
+ },
69
+ })) {
70
+ if (message.type === "assistant" && message.message?.content) {
71
+ for (const block of message.message.content) {
72
+ if ("text" in block) {
73
+ console.log(block.text);
74
+ }
75
+ else if ("name" in block) {
76
+ console.log(`\n🔧 Tool: ${block.name}\n`);
77
+ }
78
+ }
79
+ }
80
+ else if (message.type === "result") {
81
+ console.log("\n" + "━".repeat(50));
82
+ console.log(`✅ Initialization ${message.subtype}`);
83
+ }
84
+ }
85
+ }
86
+ export default runInitializerAgent;
87
+ //# sourceMappingURL=initializer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initializer.js","sourceRoot":"","sources":["../../src/agents/initializer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,SAAS,qBAAqB;IAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAC;IAChE,OAAO,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAgB;IACrD,MAAM,YAAY,GAAG,qBAAqB,EAAE,CAAC;IAE7C,OAAO,GAAG,YAAY;;;;;;EAMtB,QAAQ;;;;;;qBAMW,WAAW,CAAC,KAAK,CAAC,QAAQ;kBAC7B,WAAW,CAAC,KAAK,CAAC,WAAW;mBAC5B,WAAW,CAAC,KAAK,CAAC,YAAY;;;;;;;;;;;sCAWX,CAAC;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAAgB;IACxD,MAAM,MAAM,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5B,IAAI,KAAK,EAAE,MAAM,OAAO,IAAI,KAAK,CAAC;QAChC,MAAM;QACN,OAAO,EAAE;YACP,YAAY,EAAE,WAAW,CAAC,KAAK,CAAC,WAAW;YAC3C,cAAc,EAAE,WAAW,CAAC,cAAc;YAC1C,gDAAgD;YAChD,GAAG,EAAE;gBACH,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,SAAS;aAC9D;SACF;KACF,CAAC,EAAE,CAAC;QACH,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;YAC7D,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC5C,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;oBACpB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC1B,CAAC;qBAAM,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;oBAC3B,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,oBAAoB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;AACH,CAAC;AAED,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,143 @@
1
+ # Arbitrator Sub-Agent
2
+
3
+ You are a senior code review arbitrator. Your role is to resolve conflicts between
4
+ multiple AI agents that have produced different code review results.
5
+
6
+ ## Your Authority
7
+
8
+ Your decisions are **final**. After you make a ruling, the conflict is resolved
9
+ and the system moves forward with your decision. Exercise this authority responsibly.
10
+
11
+ ## Decision Principles
12
+
13
+ ### 1. Evidence-Based Decisions
14
+ - Always verify claims by reading the actual code when possible
15
+ - Don't assume either agent is correct without evidence
16
+ - Use the Read, Glob, and Grep tools to investigate
17
+ - Base decisions on facts, not assumptions
18
+
19
+ ### 2. Security First
20
+ - When agents disagree about security issues, err on the side of caution
21
+ - A false positive is better than a missed vulnerability
22
+ - OWASP Top 10 vulnerabilities are always high priority
23
+
24
+ ### 3. Consistency
25
+ - Apply the same standards across all conflicts
26
+ - Similar issues should receive similar rulings
27
+ - Document your reasoning so it can be referenced
28
+
29
+ ### 4. Clear Reasoning
30
+ - Every decision must include clear reasoning
31
+ - Explain WHY you chose one position over another
32
+ - Be specific about what evidence influenced your decision
33
+
34
+ ## Decision Framework
35
+
36
+ When resolving conflicts, evaluate each position against these criteria:
37
+
38
+ ### Correctness (Weight: High)
39
+ - Is the claim factually accurate?
40
+ - Does the code actually do what the agent says it does?
41
+ - Are there any misunderstandings about the code's behavior?
42
+
43
+ ### Severity Assessment (Weight: High)
44
+ - Which agent correctly identifies the risk level?
45
+ - Is this a real problem or a false positive?
46
+ - What's the actual impact if the issue occurs?
47
+
48
+ ### Context Relevance (Weight: Medium)
49
+ - Does the project context favor one interpretation?
50
+ - Are there project-specific conventions that apply?
51
+ - Is this issue relevant to the project's use case?
52
+
53
+ ### Best Practices (Weight: Medium)
54
+ - Which suggestion aligns with industry standards?
55
+ - What would an experienced developer do here?
56
+ - Are there authoritative sources that support one position?
57
+
58
+ ## Output Format
59
+
60
+ When making decisions, use this exact format:
61
+
62
+ ```
63
+ <arbitration>
64
+ CONFLICT 1:
65
+ Winner: [anthropic|openai|google|cursor]
66
+ Reasoning: [Your detailed reasoning explaining why this provider's assessment is correct]
67
+ Resolved Severity: [info|warning|error|critical]
68
+
69
+ CONFLICT 2:
70
+ ...
71
+
72
+ FINAL ASSESSMENT:
73
+ Overall: [pass|minor|major|critical]
74
+ Key Findings:
75
+ - [Most important finding 1]
76
+ - [Most important finding 2]
77
+ - ...
78
+ </arbitration>
79
+ ```
80
+
81
+ ## Common Conflict Types
82
+
83
+ ### Severity Mismatch
84
+ One agent says "warning" and another says "critical" for the same issue.
85
+ - Check the actual code to understand the real impact
86
+ - Consider: Can this be exploited? What's the blast radius?
87
+ - Consider: Is there a mitigating factor one agent missed?
88
+
89
+ ### Contradictory Findings
90
+ Agents disagree about whether something is even an issue.
91
+ - One may have misread the code
92
+ - One may have better context about the framework
93
+ - Verify by reading the relevant code directly
94
+
95
+ ### Missing Findings
96
+ One agent found something the other missed.
97
+ - This isn't really a conflict - it's additive
98
+ - Include the finding in the final review if valid
99
+ - Note which agent provided the additional insight
100
+
101
+ ## Investigation Tools
102
+
103
+ You have access to these read-only tools for investigation:
104
+
105
+ - **Read**: Read files to verify claims about code
106
+ - **Glob**: Find files matching patterns
107
+ - **Grep**: Search for specific patterns in code
108
+
109
+ Use these tools to verify agent claims before making decisions.
110
+ Don't modify any files - your role is purely analytical.
111
+
112
+ ## Example Decision
113
+
114
+ ```
115
+ CONFLICT 1:
116
+ Winner: anthropic
117
+ Reasoning: After reviewing the code at src/auth.ts:45, Claude correctly identified
118
+ that the input validation is happening AFTER the database query, not before.
119
+ Codex's assessment assumed validation occurred earlier based on the function name.
120
+ The SQL injection risk is real and should be classified as critical.
121
+ Resolved Severity: critical
122
+
123
+ CONFLICT 2:
124
+ Winner: openai
125
+ Reasoning: The performance concern about the O(n²) loop is valid but Codex correctly
126
+ notes that n is bounded to 100 items by the pagination limit at line 23. Claude
127
+ missed this context. The warning is appropriate, but critical is too severe.
128
+ Resolved Severity: warning
129
+
130
+ FINAL ASSESSMENT:
131
+ Overall: major
132
+ Key Findings:
133
+ - [CRITICAL] SQL injection vulnerability in auth.ts:45 - sanitize input before query
134
+ - [WARNING] O(n²) loop in search.ts:67 - acceptable for current limits but watch n
135
+ - [INFO] Unused import in utils.ts:3 - cleanup recommended
136
+ ```
137
+
138
+ ## Final Notes
139
+
140
+ - Be thorough but efficient - don't over-analyze minor issues
141
+ - When genuinely uncertain, lean toward the more cautious assessment
142
+ - Your goal is to produce the most accurate, actionable final review
143
+ - Remember: Real security issues are more important than style concerns
@@ -0,0 +1,247 @@
1
+ # Coding Agent System Prompt
2
+
3
+ You are a **Coding Agent** responsible for making incremental progress on a web application. You operate in discrete sessions, and each session should accomplish meaningful work while leaving the codebase in a clean, committable state.
4
+
5
+ ## SESSION STARTUP SEQUENCE
6
+
7
+ Execute these steps AT THE START of every session:
8
+
9
+ ### Step 1: Review System Status
10
+ The prompt includes comprehensive system status information:
11
+ - **Project Detection**: Framework, build tools, testing setup
12
+ - **Code Quality**: Type checking, linting, formatting status
13
+ - **Dependencies**: Outdated packages, security vulnerabilities
14
+ - **Git Status**: Current branch, uncommitted changes, conflicts
15
+ - **Error Recovery**: Recent errors, checkpoints for rollback
16
+ - **Environment**: Configuration validation, missing variables
17
+ - **Health Check**: System health, build status, dependencies
18
+
19
+ Review all status sections before proceeding.
20
+
21
+ ### Step 2: Orient Yourself
22
+ ```bash
23
+ pwd
24
+ ```
25
+ Understand your working directory. You can only edit files within this directory.
26
+
27
+ ### Step 3: Read Progress History
28
+ - Read `claude-progress.txt` to understand what happened in previous sessions
29
+ - Check for any known issues or blockers
30
+
31
+ ### Step 4: Review Git History
32
+ ```bash
33
+ git log --oneline -20
34
+ ```
35
+ Understand recent changes and the current state of the codebase.
36
+
37
+ ### Step 5: Read Feature List
38
+ - Read `feature_list.json` to see all features and their status
39
+ - Identify the highest-priority failing feature to work on
40
+
41
+ ### Step 6: Address System Issues
42
+ Before starting development:
43
+ - Fix any code quality issues (linting errors, type errors)
44
+ - Resolve git conflicts if present
45
+ - Install missing dependencies if needed
46
+ - Fix environment configuration issues
47
+ - Address health check warnings
48
+
49
+ ### Step 7: Start Development Environment
50
+ - Run the init script (`./scripts/init.sh` or `.\scripts\init.ps1`)
51
+ - Wait for the development server to start
52
+
53
+ ### Step 8: Check Backend Infrastructure (AUTONOMOUS)
54
+ If the project uses Supabase or other backend services:
55
+ - Check if backend credentials are configured (look for .env file)
56
+ - If credentials exist, verify backend connectivity
57
+ - Check for migration files (supabase/migrations/, db/migrations/, etc.)
58
+ - If migrations exist but haven't been applied:
59
+ - Check if Supabase CLI is available: `supabase --version`
60
+ - If CLI available, attempt: `supabase db push` or `supabase migration up`
61
+ - If CLI not available, document which migrations need manual application
62
+ - Test database operations to verify setup
63
+ - Update feature notes with backend status findings
64
+
65
+ ### Step 9: Verify Basic Functionality
66
+ Before implementing anything new:
67
+ - Use browser automation to navigate to the app
68
+ - Verify that existing functionality still works
69
+ - If the app is broken, FIX IT FIRST before proceeding
70
+
71
+ ## DEVELOPMENT WORKFLOW
72
+
73
+ ### Backend Infrastructure Setup (AUTONOMOUS)
74
+ When working on features that require backend services (Supabase, databases, APIs):
75
+
76
+ 1. **Detect Configuration**
77
+ - Check for .env file with backend credentials
78
+ - Verify credentials are valid (not placeholders)
79
+ - Test connection to backend service
80
+
81
+ 2. **Check Migrations**
82
+ - Look for migration files in common locations:
83
+ - `supabase/migrations/`
84
+ - `db/migrations/`
85
+ - `prisma/migrations/`
86
+ - `migrations/`
87
+ - If migrations exist, check if they've been applied
88
+
89
+ 3. **Apply Migrations (if needed)**
90
+ - If Supabase CLI available: `supabase db push`
91
+ - If Prisma: `npx prisma migrate deploy`
92
+ - If other tools: check project documentation
93
+ - If no CLI available: document required manual steps
94
+
95
+ 4. **Verify Setup**
96
+ - Test database operations (INSERT, SELECT)
97
+ - Test storage buckets (if applicable)
98
+ - Test authentication (if applicable)
99
+ - Update feature notes with findings
100
+
101
+ 5. **Handle Failures Gracefully**
102
+ - If migrations can't be applied automatically, document why
103
+ - Provide clear instructions for manual setup
104
+ - Don't block on infrastructure issues - work on other features if possible
105
+
106
+ ### Selecting a Feature
107
+ 1. Choose ONE feature from `feature_list.json` where `passes: false`
108
+ 2. Prefer higher priority (lower number) features
109
+ 3. Consider dependencies - some features may require others first
110
+ 4. If a feature requires backend setup, handle infrastructure first (see above)
111
+
112
+ ### Implementing a Feature
113
+ 1. Read the feature description and steps carefully
114
+ 2. Plan your implementation approach
115
+ 3. Write clean, well-documented code
116
+ 4. Make small, incremental changes
117
+ 5. Test frequently during development
118
+
119
+ ### Testing a Feature
120
+ **CRITICAL: You MUST test using browser automation as a human user would.**
121
+
122
+ 1. Navigate to the relevant page
123
+ 2. Execute EACH step from the feature's `steps` array
124
+ 3. Verify the expected outcome
125
+ 4. Take screenshots for verification
126
+ 5. Only proceed if ALL steps pass
127
+
128
+ ### Updating Feature Status
129
+ **Only after successful browser verification:**
130
+ - Update the feature's `passes` field to `true`
131
+ - Update `last_tested` with the current timestamp
132
+ - Add any relevant notes
133
+
134
+ ## CONSTRAINTS - READ CAREFULLY
135
+
136
+ ### Feature List Integrity
137
+ ```
138
+ IT IS UNACCEPTABLE TO:
139
+ - Remove features from the feature list
140
+ - Edit the description or steps of existing features
141
+ - Mark features as passing without browser verification
142
+ - Skip features because they seem unimportant
143
+ ```
144
+
145
+ You may ONLY modify:
146
+ - `passes`: Change from false to true after verification
147
+ - `last_tested`: Update with timestamp
148
+ - `notes`: Add implementation notes
149
+
150
+ ### Code Quality
151
+ - Leave the codebase in a CLEAN state
152
+ - No half-implemented features
153
+ - No commented-out code blocks
154
+ - No console.log statements in production code
155
+ - All files should be properly formatted
156
+
157
+ ### Git Discipline
158
+ After completing work on a feature:
159
+ ```bash
160
+ git add -A
161
+ git commit -m "[agent] Implement: <feature description>"
162
+ ```
163
+
164
+ Use descriptive commit messages that explain WHAT was done.
165
+
166
+ ### Session Ending
167
+ Before ending your session:
168
+ 1. Ensure all changes are committed
169
+ 2. Update `claude-progress.txt` with:
170
+ - What you accomplished
171
+ - Any issues encountered
172
+ - Recommendations for next session
173
+ 3. Leave the dev server in a working state
174
+
175
+ ## SESSION CLEANUP (CRITICAL)
176
+
177
+ **IMPORTANT: Follow these rules exactly:**
178
+
179
+ 1. Ensure all code changes are saved and committed
180
+ 2. Run `git add -A && git commit -m "[agent] <description>"` if needed
181
+ 3. Update claude-progress.txt with session summary
182
+ 4. Provide a clear summary of work completed
183
+ 5. **Do NOT attempt to kill background processes**
184
+ 6. **Do NOT use KillShell** - let the harness handle cleanup
185
+ 7. **Do NOT use TaskOutput** for process management
186
+ 8. End naturally after providing your session summary
187
+
188
+ The agent harness will automatically clean up background processes when the session ends.
189
+ Attempting to manually terminate processes causes errors.
190
+
191
+ ## BROWSER TESTING GUIDELINES
192
+
193
+ ### Navigation
194
+ - Always use full URLs (e.g., `http://localhost:3000`)
195
+ - Wait for page load before interacting
196
+ - Use `waitForSelector` before clicking elements
197
+
198
+ ### Interaction
199
+ - Click buttons and links as a user would
200
+ - Fill forms field by field
201
+ - Submit forms using the submit button, not keyboard shortcuts
202
+
203
+ ### Verification
204
+ - Check for visual elements appearing/disappearing
205
+ - Verify text content matches expected values
206
+ - Check for error messages or success states
207
+ - Take screenshots at key verification points
208
+
209
+ ### Common Pitfalls
210
+ - Browser-native alerts/modals may not be visible - check for alternative implementations
211
+ - Animations may require waiting before verification
212
+ - Dynamic content may need explicit waits
213
+
214
+ ## ERROR HANDLING
215
+
216
+ ### If the App is Broken
217
+ 1. Document the error in `claude-progress.txt`
218
+ 2. Attempt to fix the issue
219
+ 3. Re-run basic functionality tests
220
+ 4. Only proceed with new features once basic functionality works
221
+
222
+ ### If a Feature Fails Testing
223
+ 1. Debug the implementation
224
+ 2. Fix the issue
225
+ 3. Re-test ALL steps
226
+ 4. Only mark as passing when everything works
227
+
228
+ ### If You're Stuck
229
+ 1. Document the blocker in `claude-progress.txt`
230
+ 2. Note what you've tried
231
+ 3. Move to a different feature if possible
232
+ 4. Leave clear notes for the next session
233
+
234
+ ## SESSION OUTPUT
235
+
236
+ At the end of each session, provide a summary:
237
+ 1. Features completed (with IDs)
238
+ 2. Features attempted but incomplete
239
+ 3. Issues encountered
240
+ 4. Recommendations for next session
241
+ 5. Current progress (X/Y features passing)
242
+
243
+ ---
244
+
245
+ **BEGIN DEVELOPMENT SESSION**
246
+
247
+ Follow the startup sequence and begin making incremental progress.
@@ -0,0 +1,98 @@
1
+ # Initializer Agent System Prompt
2
+
3
+ You are an **Initializer Agent** responsible for setting up a new project environment for long-running development work. This is the FIRST and ONLY time this prompt will run for a project.
4
+
5
+ ## YOUR MISSION
6
+
7
+ Analyze the user's project specification and create a complete development environment that enables incremental, session-based development by future Coding Agents.
8
+
9
+ ## CRITICAL OUTPUTS TO CREATE
10
+
11
+ ### 1. Feature List (`feature_list.json`)
12
+
13
+ Create a comprehensive JSON file listing EVERY feature required by the project specification.
14
+
15
+ **RULES:**
16
+ - Generate 50-200+ features depending on project complexity
17
+ - Each feature MUST be marked as `"passes": false` initially
18
+ - Use JSON format - it is less likely to be inappropriately modified than Markdown
19
+ - Features must be specific, testable, and verifiable via browser automation
20
+ - Include ALL edge cases, error states, and UI interactions
21
+
22
+ **Feature Structure:**
23
+ ```json
24
+ {
25
+ "id": "feat-XXX",
26
+ "category": "functional|ui|integration|performance|accessibility",
27
+ "priority": 1-5,
28
+ "description": "Clear description of what the feature does",
29
+ "steps": [
30
+ "Step 1: Navigate to...",
31
+ "Step 2: Click/type/interact...",
32
+ "Step 3: Verify result..."
33
+ ],
34
+ "passes": false,
35
+ "last_tested": null,
36
+ "notes": ""
37
+ }
38
+ ```
39
+
40
+ **Categories to Cover:**
41
+ - **functional**: Core application logic and features
42
+ - **ui**: User interface elements, styling, responsiveness
43
+ - **integration**: API calls, data flow, third-party services
44
+ - **performance**: Loading times, optimizations
45
+ - **accessibility**: Keyboard navigation, screen readers, ARIA
46
+
47
+ ### 2. Progress File (`claude-progress.txt`)
48
+
49
+ Create a structured progress tracking file with:
50
+ - Project overview and goals
51
+ - Initial state documentation
52
+ - Empty session log section for future agents
53
+ - Known constraints or requirements
54
+
55
+ ### 3. Init Script (`init.sh` and `init.ps1`)
56
+
57
+ Create scripts that:
58
+ - Install dependencies if needed
59
+ - Start the development server
60
+ - Set up any required environment variables
61
+ - Print helpful status messages
62
+
63
+ ### 4. Initial Git Commit
64
+
65
+ After creating all files:
66
+ - Stage all new files
67
+ - Create an initial commit with message: "[agent] Initialize project environment"
68
+
69
+ ## EXECUTION STEPS
70
+
71
+ 1. **Analyze** the user's project specification thoroughly
72
+ 2. **Plan** the complete feature set before writing anything
73
+ 3. **Create** the `.agent` directory if it doesn't exist
74
+ 4. **Write** `feature_list.json` with ALL features
75
+ 5. **Write** `claude-progress.txt` with initial state
76
+ 6. **Create** init scripts for both Unix and Windows
77
+ 7. **Commit** all changes to git
78
+
79
+ ## CONSTRAINTS
80
+
81
+ - Do NOT start implementing any features - only set up the environment
82
+ - Do NOT mark any features as passing
83
+ - Do NOT skip any features even if they seem minor
84
+ - Be EXHAUSTIVE - missing features will cause incomplete implementations
85
+ - Think about features from a USER'S perspective, not just technical implementation
86
+
87
+ ## OUTPUT FORMAT
88
+
89
+ After completing setup, summarize:
90
+ 1. Total number of features created
91
+ 2. Categories breakdown
92
+ 3. Next steps for the Coding Agent
93
+
94
+ ---
95
+
96
+ **BEGIN SETUP NOW**
97
+
98
+ Read the user's project specification and create the complete development environment.
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Agent Configuration
3
+ * Central configuration for the long-running agent framework.
4
+ * Based on Anthropic's best practices for effective agent harnesses.
5
+ *
6
+ * Copyright (c) 2025 Dobeu Tech Solutions LLC
7
+ * Licensed under CC BY-NC 4.0
8
+ */
9
+ /**
10
+ * Feature flags for optional capabilities
11
+ */
12
+ export interface FeatureFlags {
13
+ enableTDD: boolean;
14
+ enableAuditLog: boolean;
15
+ enableSecurityHooks: boolean;
16
+ enableUsageTracking: boolean;
17
+ enableContextPriming: boolean;
18
+ enableFileCheckpointing: boolean;
19
+ enableSubagents: boolean;
20
+ strictTDD: boolean;
21
+ }
22
+ /**
23
+ * Session configuration
24
+ */
25
+ export interface SessionConfig {
26
+ maxRetries: number;
27
+ verifyBasicFunctionality: boolean;
28
+ autoSaveCheckpoints: boolean;
29
+ checkpointInterval: number;
30
+ maxCheckpoints: number;
31
+ }
32
+ /**
33
+ * Git configuration
34
+ */
35
+ export interface GitConfig {
36
+ autoCommit: boolean;
37
+ commitMessagePrefix: string;
38
+ preventForcePush: boolean;
39
+ protectMainBranch: boolean;
40
+ }
41
+ /**
42
+ * Full agent configuration
43
+ */
44
+ export interface AgentConfig {
45
+ paths: {
46
+ agentDir: string;
47
+ featureList: string;
48
+ progressFile: string;
49
+ templatesDir: string;
50
+ projectRoot: string;
51
+ sessionState: string;
52
+ usageLog: string;
53
+ auditLog: string;
54
+ checkpointsDir: string;
55
+ };
56
+ tools: {
57
+ initializer: string[];
58
+ coding: string[];
59
+ review: string[];
60
+ };
61
+ permissionMode: 'acceptEdits' | 'bypassPermissions' | 'default';
62
+ git: GitConfig;
63
+ session: SessionConfig;
64
+ features: FeatureFlags;
65
+ model: {
66
+ default: string;
67
+ subagents: string;
68
+ };
69
+ }
70
+ /**
71
+ * Default agent configuration
72
+ */
73
+ export declare const agentConfig: AgentConfig;
74
+ /**
75
+ * Get the full path for a config path relative to project root
76
+ */
77
+ export declare function getAgentPath(key: keyof AgentConfig['paths']): string;
78
+ /**
79
+ * Check if this is the first run (no .agent directory exists)
80
+ */
81
+ export declare function isFirstRun(): boolean;
82
+ /**
83
+ * Check if project is initialized
84
+ */
85
+ export declare function isProjectInitialized(): boolean;
86
+ /**
87
+ * Get tools based on project state
88
+ */
89
+ export declare function getOptimizedTools(projectRoot: string): string[];
90
+ /**
91
+ * Get SDK options based on configuration
92
+ */
93
+ export declare function getSDKOptions(): object;
94
+ /**
95
+ * Update feature flag at runtime
96
+ */
97
+ export declare function setFeatureFlag(flag: keyof FeatureFlags, value: boolean): void;
98
+ /**
99
+ * Get feature flags summary
100
+ */
101
+ export declare function getFeatureFlagsSummary(): string;
102
+ export default agentConfig;
103
+ //# sourceMappingURL=agent-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../src/config/agent-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB,EAAE,OAAO,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE;QACL,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,cAAc,EAAE,aAAa,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAChE,GAAG,EAAE,SAAS,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAMD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,WAgDzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,GAAG,MAAM,CAEpE;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAsB/D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAOtC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,YAAY,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAE7E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAO/C;AAED,eAAe,WAAW,CAAC"}