swellai 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 (130) hide show
  1. package/README.md +711 -0
  2. package/dist/agents/linear-agent.d.ts +32 -0
  3. package/dist/agents/linear-agent.d.ts.map +1 -0
  4. package/dist/agents/linear-agent.js +263 -0
  5. package/dist/agents/linear-agent.js.map +1 -0
  6. package/dist/agents/planning-agent.d.ts +36 -0
  7. package/dist/agents/planning-agent.d.ts.map +1 -0
  8. package/dist/agents/planning-agent.js +248 -0
  9. package/dist/agents/planning-agent.js.map +1 -0
  10. package/dist/cli/index.d.ts +3 -0
  11. package/dist/cli/index.d.ts.map +1 -0
  12. package/dist/cli/index.js +102 -0
  13. package/dist/cli/index.js.map +1 -0
  14. package/dist/cli/install.d.ts +11 -0
  15. package/dist/cli/install.d.ts.map +1 -0
  16. package/dist/cli/install.js +257 -0
  17. package/dist/cli/install.js.map +1 -0
  18. package/dist/cli/manifest.d.ts +27 -0
  19. package/dist/cli/manifest.d.ts.map +1 -0
  20. package/dist/cli/manifest.js +65 -0
  21. package/dist/cli/manifest.js.map +1 -0
  22. package/dist/index.d.ts +17 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +17 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/lib/claude-agent-sdk.d.ts +73 -0
  27. package/dist/lib/claude-agent-sdk.d.ts.map +1 -0
  28. package/dist/lib/claude-agent-sdk.js +114 -0
  29. package/dist/lib/claude-agent-sdk.js.map +1 -0
  30. package/dist/lib/conversation-logger.d.ts +66 -0
  31. package/dist/lib/conversation-logger.d.ts.map +1 -0
  32. package/dist/lib/conversation-logger.js +159 -0
  33. package/dist/lib/conversation-logger.js.map +1 -0
  34. package/dist/lib/opencode.d.ts +68 -0
  35. package/dist/lib/opencode.d.ts.map +1 -0
  36. package/dist/lib/opencode.js +151 -0
  37. package/dist/lib/opencode.js.map +1 -0
  38. package/dist/lib/turso-schema.d.ts +13 -0
  39. package/dist/lib/turso-schema.d.ts.map +1 -0
  40. package/dist/lib/turso-schema.js +69 -0
  41. package/dist/lib/turso-schema.js.map +1 -0
  42. package/dist/lib/turso.d.ts +56 -0
  43. package/dist/lib/turso.d.ts.map +1 -0
  44. package/dist/lib/turso.js +144 -0
  45. package/dist/lib/turso.js.map +1 -0
  46. package/dist/lib/types.d.ts +31 -0
  47. package/dist/lib/types.d.ts.map +1 -0
  48. package/dist/lib/types.js +20 -0
  49. package/dist/lib/types.js.map +1 -0
  50. package/dist/lib/utils.d.ts +34 -0
  51. package/dist/lib/utils.d.ts.map +1 -0
  52. package/dist/lib/utils.js +72 -0
  53. package/dist/lib/utils.js.map +1 -0
  54. package/dist/scripts/build-templates.d.ts +17 -0
  55. package/dist/scripts/build-templates.d.ts.map +1 -0
  56. package/dist/scripts/build-templates.js +132 -0
  57. package/dist/scripts/build-templates.js.map +1 -0
  58. package/dist/scripts/claude-agent-runner.d.ts +28 -0
  59. package/dist/scripts/claude-agent-runner.d.ts.map +1 -0
  60. package/dist/scripts/claude-agent-runner.js +278 -0
  61. package/dist/scripts/claude-agent-runner.js.map +1 -0
  62. package/dist/src/agents/linear-agent.d.ts +32 -0
  63. package/dist/src/agents/linear-agent.d.ts.map +1 -0
  64. package/dist/src/agents/linear-agent.js +285 -0
  65. package/dist/src/agents/linear-agent.js.map +1 -0
  66. package/dist/src/agents/planning-agent.d.ts +36 -0
  67. package/dist/src/agents/planning-agent.d.ts.map +1 -0
  68. package/dist/src/agents/planning-agent.js +248 -0
  69. package/dist/src/agents/planning-agent.js.map +1 -0
  70. package/dist/src/cli/index.d.ts +3 -0
  71. package/dist/src/cli/index.d.ts.map +1 -0
  72. package/dist/src/cli/index.js +102 -0
  73. package/dist/src/cli/index.js.map +1 -0
  74. package/dist/src/cli/install.d.ts +11 -0
  75. package/dist/src/cli/install.d.ts.map +1 -0
  76. package/dist/src/cli/install.js +257 -0
  77. package/dist/src/cli/install.js.map +1 -0
  78. package/dist/src/cli/manifest.d.ts +27 -0
  79. package/dist/src/cli/manifest.d.ts.map +1 -0
  80. package/dist/src/cli/manifest.js +65 -0
  81. package/dist/src/cli/manifest.js.map +1 -0
  82. package/dist/src/index.d.ts +17 -0
  83. package/dist/src/index.d.ts.map +1 -0
  84. package/dist/src/index.js +17 -0
  85. package/dist/src/index.js.map +1 -0
  86. package/dist/src/lib/claude-agent-sdk.d.ts +73 -0
  87. package/dist/src/lib/claude-agent-sdk.d.ts.map +1 -0
  88. package/dist/src/lib/claude-agent-sdk.js +114 -0
  89. package/dist/src/lib/claude-agent-sdk.js.map +1 -0
  90. package/dist/src/lib/conversation-logger.d.ts +66 -0
  91. package/dist/src/lib/conversation-logger.d.ts.map +1 -0
  92. package/dist/src/lib/conversation-logger.js +159 -0
  93. package/dist/src/lib/conversation-logger.js.map +1 -0
  94. package/dist/src/lib/opencode.d.ts +153 -0
  95. package/dist/src/lib/opencode.d.ts.map +1 -0
  96. package/dist/src/lib/opencode.js +153 -0
  97. package/dist/src/lib/opencode.js.map +1 -0
  98. package/dist/src/lib/turso-schema.d.ts +13 -0
  99. package/dist/src/lib/turso-schema.d.ts.map +1 -0
  100. package/dist/src/lib/turso-schema.js +69 -0
  101. package/dist/src/lib/turso-schema.js.map +1 -0
  102. package/dist/src/lib/turso.d.ts +56 -0
  103. package/dist/src/lib/turso.d.ts.map +1 -0
  104. package/dist/src/lib/turso.js +144 -0
  105. package/dist/src/lib/turso.js.map +1 -0
  106. package/dist/src/lib/types.d.ts +31 -0
  107. package/dist/src/lib/types.d.ts.map +1 -0
  108. package/dist/src/lib/types.js +20 -0
  109. package/dist/src/lib/types.js.map +1 -0
  110. package/dist/src/lib/utils.d.ts +34 -0
  111. package/dist/src/lib/utils.d.ts.map +1 -0
  112. package/dist/src/lib/utils.js +72 -0
  113. package/dist/src/lib/utils.js.map +1 -0
  114. package/package.json +63 -0
  115. package/templates/.env.example +51 -0
  116. package/templates/agents/codebase-analyzer.md +121 -0
  117. package/templates/agents/codebase-locator.md +105 -0
  118. package/templates/agents/coding-agent.md +187 -0
  119. package/templates/agents/debug-agent.md +300 -0
  120. package/templates/prompts/consolidate-and-create-linear.md +282 -0
  121. package/templates/prompts/implementation.md +94 -0
  122. package/templates/prompts/plan-generation.md +171 -0
  123. package/templates/prompts/review.md +39 -0
  124. package/templates/prompts/verify.md +80 -0
  125. package/templates/scripts/claude-agent-runner.js +12887 -0
  126. package/templates/scripts/detect-runtime.sh +95 -0
  127. package/templates/scripts/linear-agent.js +1753 -0
  128. package/templates/scripts/planning-agent.js +1738 -0
  129. package/templates/workflows/claude-implement.yml +931 -0
  130. package/templates/workflows/claude-plan.yml +301 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Shared TypeScript interfaces and types for the multi-provider plan generation system.
3
+ */
4
+ /**
5
+ * Provider-specific default models
6
+ */
7
+ export const DEFAULT_MODELS = {
8
+ anthropic: "claude-opus-4-5",
9
+ openai: "gpt-5.2-pro",
10
+ google: "gemini-2.5-flash",
11
+ };
12
+ /**
13
+ * Environment variable names for API keys by provider
14
+ */
15
+ export const API_KEY_ENV_VARS = {
16
+ anthropic: ["ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN"],
17
+ openai: ["OPENAI_API_KEY"],
18
+ google: ["GOOGLE_GENERATIVE_AI_API_KEY"],
19
+ };
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwBH;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAA6B;IACtD,SAAS,EAAE,iBAAiB;IAC5B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,SAAS,EAAE,CAAC,mBAAmB,EAAE,yBAAyB,CAAC;IAC3D,MAAM,EAAE,CAAC,gBAAgB,CAAC;IAC1B,MAAM,EAAE,CAAC,8BAA8B,CAAC;CACzC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared utility functions for the multi-provider plan generation system.
3
+ */
4
+ import { type Part, type Provider } from "./types.js";
5
+ /**
6
+ * Extract text from message parts
7
+ *
8
+ * @param parts - Array of message parts from OpenCode SDK
9
+ * @returns Concatenated text from all text-type parts
10
+ */
11
+ export declare function extractTextFromParts(parts: Part[]): string;
12
+ /**
13
+ * Validate that all required environment variables are set
14
+ *
15
+ * @param requiredVars - Array of environment variable names to check
16
+ * @throws Error if any required variables are missing
17
+ */
18
+ export declare function validateEnvVars(requiredVars: string[]): void;
19
+ /**
20
+ * Get API key from environment variables for a specific provider
21
+ *
22
+ * @param provider - The AI provider (anthropic, openai, google)
23
+ * @returns The API key for the provider
24
+ * @throws Error if no API key is found for the provider
25
+ */
26
+ export declare function getApiKey(provider: Provider): string;
27
+ /**
28
+ * Validate that a provider is supported
29
+ *
30
+ * @param provider - The provider name to validate
31
+ * @throws Error if the provider is not supported
32
+ */
33
+ export declare function validateProvider(provider: string): asserts provider is Provider;
34
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAoB,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,CAO1D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI,CAa5D;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAiBpD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAS/E"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Shared utility functions for the multi-provider plan generation system.
3
+ */
4
+ import { API_KEY_ENV_VARS } from "./types.js";
5
+ /**
6
+ * Extract text from message parts
7
+ *
8
+ * @param parts - Array of message parts from OpenCode SDK
9
+ * @returns Concatenated text from all text-type parts
10
+ */
11
+ export function extractTextFromParts(parts) {
12
+ if (!Array.isArray(parts))
13
+ return "";
14
+ return parts
15
+ .filter((part) => part.type === "text")
16
+ .map((part) => part.text || "")
17
+ .join("\n");
18
+ }
19
+ /**
20
+ * Validate that all required environment variables are set
21
+ *
22
+ * @param requiredVars - Array of environment variable names to check
23
+ * @throws Error if any required variables are missing
24
+ */
25
+ export function validateEnvVars(requiredVars) {
26
+ const missingVars = requiredVars.filter((varName) => !process.env[varName]);
27
+ if (missingVars.length > 0) {
28
+ const errorMsg = [
29
+ "Error: Missing required environment variables:",
30
+ ...missingVars.map((varName) => ` - ${varName}`),
31
+ "",
32
+ "Please set all required environment variables and try again.",
33
+ ].join("\n");
34
+ throw new Error(errorMsg);
35
+ }
36
+ }
37
+ /**
38
+ * Get API key from environment variables for a specific provider
39
+ *
40
+ * @param provider - The AI provider (anthropic, openai, google)
41
+ * @returns The API key for the provider
42
+ * @throws Error if no API key is found for the provider
43
+ */
44
+ export function getApiKey(provider) {
45
+ const envVars = API_KEY_ENV_VARS[provider];
46
+ for (const envVar of envVars) {
47
+ const apiKey = process.env[envVar];
48
+ if (apiKey) {
49
+ return apiKey;
50
+ }
51
+ }
52
+ const errorMsg = [
53
+ `Error: No API key found for provider "${provider}"`,
54
+ `Required environment variables (at least one):`,
55
+ ...envVars.map((envVar) => ` - ${envVar}`),
56
+ ].join("\n");
57
+ throw new Error(errorMsg);
58
+ }
59
+ /**
60
+ * Validate that a provider is supported
61
+ *
62
+ * @param provider - The provider name to validate
63
+ * @throws Error if the provider is not supported
64
+ */
65
+ export function validateProvider(provider) {
66
+ const validProviders = ["anthropic", "openai", "google"];
67
+ if (!validProviders.includes(provider)) {
68
+ throw new Error(`Error: Unsupported provider "${provider}". ` +
69
+ `Supported providers: ${validProviders.join(", ")}`);
70
+ }
71
+ }
72
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAA4B,MAAM,YAAY,CAAC;AAExE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;SACtC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;SAC9B,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,YAAsB;IACpD,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAE5E,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG;YACf,gDAAgD;YAChD,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,EAAE,CAAC;YACjD,EAAE;YACF,8DAA8D;SAC/D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEb,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAkB;IAC1C,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAE3C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG;QACf,yCAAyC,QAAQ,GAAG;QACpD,gDAAgD;QAChD,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,EAAE,CAAC;KAC5C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,MAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAC/C,MAAM,cAAc,GAAe,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAErE,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAoB,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,gCAAgC,QAAQ,KAAK;YAC3C,wBAAwB,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtD,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "swellai",
3
+ "version": "1.0.0",
4
+ "description": "Install claude-parallel workflows, scripts, and agents into any repository",
5
+ "type": "module",
6
+ "bin": {
7
+ "swellai": "./dist/cli/index.js"
8
+ },
9
+ "files": [
10
+ "dist/",
11
+ "templates/"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc",
15
+ "build:templates": "bun run scripts/build-templates.ts",
16
+ "type-check": "tsc --noEmit",
17
+ "lint": "biome lint .",
18
+ "lint:fix": "biome lint . --write",
19
+ "format": "biome format .",
20
+ "format:fix": "biome format . --write",
21
+ "check": "biome check .",
22
+ "check:fix": "biome check . --write",
23
+ "planning-agent": "bun run src/agents/planning-agent.ts",
24
+ "linear-agent": "bun run src/agents/linear-agent.ts",
25
+ "claude-agent-runner": "bun run scripts/claude-agent-runner.ts",
26
+ "prepare": "husky"
27
+ },
28
+ "keywords": [
29
+ "claude",
30
+ "parallel",
31
+ "github-actions",
32
+ "ai",
33
+ "automation",
34
+ "installer",
35
+ "cli"
36
+ ],
37
+ "author": "",
38
+ "license": "MIT",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/mkrueger12/claude-parallel"
42
+ },
43
+ "dependencies": {
44
+ "@anthropic-ai/claude-agent-sdk": "^0.1.70",
45
+ "@libsql/client": "^0.15.0",
46
+ "@linear/sdk": "^30.0.0",
47
+ "@opencode-ai/sdk": "^1.0.153"
48
+ },
49
+ "devDependencies": {
50
+ "@biomejs/biome": "^2.3.10",
51
+ "@types/node": "^25.0.2",
52
+ "bun-types": "^1.3.5",
53
+ "husky": "^9.1.7",
54
+ "typescript": "^5.9.3"
55
+ },
56
+ "engines": {
57
+ "node": ">=20.0.0",
58
+ "bun": ">=1.0.0"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ }
63
+ }
@@ -0,0 +1,51 @@
1
+ # Claude Parallel Configuration
2
+ # Copy this file to .env and fill in your values
3
+
4
+ # Authentication (choose one)
5
+ # Preferred for local runs - get from https://claude.ai/settings
6
+ CLAUDE_CODE_OAUTH_TOKEN=
7
+
8
+ # OR fallback option - get from https://console.anthropic.com
9
+ ANTHROPIC_API_KEY=
10
+
11
+ # For multi-provider planning
12
+ # Get from https://platform.openai.com/api-keys
13
+ OPENAI_API_KEY=
14
+
15
+ # Get from https://aistudio.google.com/app/apikey
16
+ GOOGLE_GENERATIVE_AI_API_KEY=
17
+
18
+ # Linear integration
19
+ # Get from https://linear.app/settings/api
20
+ LINEAR_API_KEY=
21
+
22
+ # Linear team ID or team key (e.g., "ENG" or "PRODUCT")
23
+ # Find in Linear URL: https://linear.app/{workspace}/{team-key}/...
24
+ LINEAR_TEAM_ID=
25
+
26
+ # Optional: Linear project ID
27
+ LINEAR_PROJECT_ID=
28
+
29
+ # GitHub Personal Access Token with repo and issues:write permissions
30
+ # Get from https://github.com/settings/tokens
31
+ GH_PAT=
32
+
33
+ # ==============================================================================
34
+ # Turso Database Configuration (Optional - for conversation logging)
35
+ # ==============================================================================
36
+ # Turso is used to log agent conversations for debugging and analytics.
37
+ # Logging is completely optional - if these aren't set, logging is disabled.
38
+ #
39
+ # Setup:
40
+ # 1. Install Turso CLI: curl -sSfL https://get.tur.so/install.sh | bash
41
+ # 2. Create a database: turso db create claude-parallel-logs
42
+ # 3. Get URL: turso db show --url claude-parallel-logs
43
+ # 4. Get token: turso db tokens create claude-parallel-logs
44
+ #
45
+ # What gets logged:
46
+ # - Session metadata (agent type, model, provider, timestamps, status)
47
+ # - Messages (user prompts and AI responses with sequence ordering)
48
+ # - Tool executions (tool names, inputs, outputs, timing, and errors)
49
+ #
50
+ TURSO_DATABASE_URL=
51
+ TURSO_AUTH_TOKEN=
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: codebase-analyzer
3
+ description: Analyzes codebase implementation details. Call the codebase-analyzer agent when you need to find detailed information about specific components. As always, the more detailed your request prompt, the better!
4
+ tools: Read, LS, Grep, Glob
5
+ ---
6
+
7
+
8
+ You are a specialist at understanding HOW code works. Your job is to analyze implementation details, trace data flow, and explain technical workings with precise file:line references.
9
+
10
+ ## Core Responsibilities
11
+
12
+ 1. **Analyze Implementation Details**
13
+ - Read specific files to understand logic
14
+ - Identify key functions and their purposes
15
+ - Trace method calls and data transformations
16
+ - Note important algorithms or patterns
17
+
18
+ 2. **Trace Data Flow**
19
+ - Follow data from entry to exit points
20
+ - Map transformations and validations
21
+ - Identify state changes and side effects
22
+ - Document API contracts between components
23
+
24
+ 3. **Identify Architectural Patterns**
25
+ - Recognize design patterns in use
26
+ - Note architectural decisions
27
+ - Identify conventions and best practices
28
+ - Find integration points between systems
29
+
30
+ ## Analysis Strategy
31
+
32
+ ### Step 1: Read Entry Points
33
+ - Start with main files mentioned in the request
34
+ - Look for exports, public methods, or route handlers
35
+ - Identify the "surface area" of the component
36
+
37
+ ### Step 2: Follow the Code Path
38
+ - Trace function calls step by step
39
+ - Read each file involved in the flow
40
+ - Note where data is transformed
41
+ - Identify external dependencies
42
+ - Take time to ultrathink about how all these pieces connect and interact
43
+
44
+ ### Step 3: Understand Key Logic
45
+ - Focus on business logic, not boilerplate
46
+ - Identify validation, transformation, error handling
47
+ - Note any complex algorithms or calculations
48
+ - Look for configuration or feature flags
49
+
50
+ ## Output Format
51
+
52
+ Structure your analysis like this:
53
+
54
+ ```
55
+ ## Analysis: [Feature/Component Name]
56
+
57
+ ### Overview
58
+ [2-3 sentence summary of how it works]
59
+
60
+ ### Entry Points
61
+ - `api/routes.js:45` - POST /webhooks endpoint
62
+ - `handlers/webhook.js:12` - handleWebhook() function
63
+
64
+ ### Core Implementation
65
+
66
+ #### 1. Request Validation (`handlers/webhook.js:15-32`)
67
+ - Validates signature using HMAC-SHA256
68
+ - Checks timestamp to prevent replay attacks
69
+ - Returns 401 if validation fails
70
+
71
+ #### 2. Data Processing (`services/webhook-processor.js:8-45`)
72
+ - Parses webhook payload at line 10
73
+ - Transforms data structure at line 23
74
+ - Queues for async processing at line 40
75
+
76
+ #### 3. State Management (`stores/webhook-store.js:55-89`)
77
+ - Stores webhook in database with status 'pending'
78
+ - Updates status after processing
79
+ - Implements retry logic for failures
80
+
81
+ ### Data Flow
82
+ 1. Request arrives at `api/routes.js:45`
83
+ 2. Routed to `handlers/webhook.js:12`
84
+ 3. Validation at `handlers/webhook.js:15-32`
85
+ 4. Processing at `services/webhook-processor.js:8`
86
+ 5. Storage at `stores/webhook-store.js:55`
87
+
88
+ ### Key Patterns
89
+ - **Factory Pattern**: WebhookProcessor created via factory at `factories/processor.js:20`
90
+ - **Repository Pattern**: Data access abstracted in `stores/webhook-store.js`
91
+ - **Middleware Chain**: Validation middleware at `middleware/auth.js:30`
92
+
93
+ ### Configuration
94
+ - Webhook secret from `config/webhooks.js:5`
95
+ - Retry settings at `config/webhooks.js:12-18`
96
+ - Feature flags checked at `utils/features.js:23`
97
+
98
+ ### Error Handling
99
+ - Validation errors return 401 (`handlers/webhook.js:28`)
100
+ - Processing errors trigger retry (`services/webhook-processor.js:52`)
101
+ - Failed webhooks logged to `logs/webhook-errors.log`
102
+ ```
103
+
104
+ ## Important Guidelines
105
+
106
+ - **Always include file:line references** for claims
107
+ - **Read files thoroughly** before making statements
108
+ - **Trace actual code paths** don't assume
109
+ - **Focus on "how"** not "what" or "why"
110
+ - **Be precise** about function names and variables
111
+ - **Note exact transformations** with before/after
112
+
113
+ ## What NOT to Do
114
+
115
+ - Don't guess about implementation
116
+ - Don't skip error handling or edge cases
117
+ - Don't ignore configuration or dependencies
118
+ - Don't make architectural recommendations
119
+ - Don't analyze code quality or suggest improvements
120
+
121
+ Remember: You're explaining HOW the code currently works, with surgical precision and exact references. Help users understand the implementation as it exists today.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: codebase-locator
3
+ description: Locates files, directories, and components relevant to a feature or task. Call `codebase-locator` with human language prompt describing what you're looking for. Basically a "Super Grep/Glob/LS tool" — Use it if you find yourself desiring to use one of these tools more than once.
4
+ tools: LS, Grep, Glob
5
+ ---
6
+
7
+
8
+ You are a specialist at finding WHERE code lives in a codebase. Your job is to locate relevant files and organize them by purpose, NOT to analyze their contents.
9
+
10
+ ## Core Responsibilities
11
+
12
+ 1. **Find Files by Topic/Feature**
13
+ - Search for files containing relevant keywords
14
+ - Look for directory patterns and naming conventions
15
+ - Check common locations (src/, lib/, pkg/, etc.)
16
+
17
+ 2. **Categorize Findings**
18
+ - Implementation files (core logic)
19
+ - Test files (unit, integration, e2e)
20
+ - Configuration files
21
+ - Documentation files
22
+ - Type definitions/interfaces
23
+ - Examples/samples
24
+
25
+ 3. **Return Structured Results**
26
+ - Group files by their purpose
27
+ - Provide full paths from repository root
28
+ - Note which directories contain clusters of related files
29
+
30
+ ## Search Strategy
31
+
32
+ ### Initial Broad Search
33
+
34
+ First, think deeply about the most effective search patterns for the requested feature or topic, considering:
35
+ - Common naming conventions in this codebase
36
+ - Language-specific directory structures
37
+ - Related terms and synonyms that might be used
38
+
39
+ 1. Start with using your grep tool for finding keywords.
40
+ 2. Optionally, use glob for file patterns
41
+ 3. LS and Glob your way to victory as well!
42
+
43
+ ### Refine by Language/Framework
44
+ - **JavaScript/TypeScript**: Look in src/, lib/, components/, pages/, api/
45
+ - **Python**: Look in src/, lib/, pkg/, module names matching feature
46
+ - **Go**: Look in pkg/, internal/, cmd/
47
+ - **General**: Check for feature-specific directories - I believe in you, you are a smart cookie :)
48
+
49
+ ### Common Patterns to Find
50
+ - `*service*`, `*handler*`, `*controller*` - Business logic
51
+ - `*test*`, `*spec*` - Test files
52
+ - `*.config.*`, `*rc*` - Configuration
53
+ - `*.d.ts`, `*.types.*` - Type definitions
54
+ - `README*`, `*.md` in feature dirs - Documentation
55
+
56
+ ## Output Format
57
+
58
+ Structure your findings like this:
59
+
60
+ ```
61
+ ## File Locations for [Feature/Topic]
62
+
63
+ ### Implementation Files
64
+ - `src/services/feature.js` - Main service logic
65
+ - `src/handlers/feature-handler.js` - Request handling
66
+ - `src/models/feature.js` - Data models
67
+
68
+ ### Test Files
69
+ - `src/services/__tests__/feature.test.js` - Service tests
70
+ - `e2e/feature.spec.js` - End-to-end tests
71
+
72
+ ### Configuration
73
+ - `config/feature.json` - Feature-specific config
74
+ - `.featurerc` - Runtime configuration
75
+
76
+ ### Type Definitions
77
+ - `types/feature.d.ts` - TypeScript definitions
78
+
79
+ ### Related Directories
80
+ - `src/services/feature/` - Contains 5 related files
81
+ - `docs/feature/` - Feature documentation
82
+
83
+ ### Entry Points
84
+ - `src/index.js` - Imports feature module at line 23
85
+ - `api/routes.js` - Registers feature routes
86
+ ```
87
+
88
+ ## Important Guidelines
89
+
90
+ - **Don't read file contents** - Just report locations
91
+ - **Be thorough** - Check multiple naming patterns
92
+ - **Group logically** - Make it easy to understand code organization
93
+ - **Include counts** - "Contains X files" for directories
94
+ - **Note naming patterns** - Help user understand conventions
95
+ - **Check multiple extensions** - .js/.ts, .py, .go, etc.
96
+
97
+ ## What NOT to Do
98
+
99
+ - Don't analyze what the code does
100
+ - Don't read files to understand implementation
101
+ - Don't make assumptions about functionality
102
+ - Don't skip test or config files
103
+ - Don't ignore documentation
104
+
105
+ Remember: You're a file finder, not a code analyzer. Help users quickly understand WHERE everything is so they can dive deeper with other tools.
@@ -0,0 +1,187 @@
1
+ ---
2
+ name: coding-agent
3
+ description: the coding implements a single item from features.json.
4
+ ---
5
+
6
+ ## YOUR ROLE - CODING AGENT
7
+
8
+ You are continuing work on a long-running autonomous development task.
9
+ This is a FRESH context window - you have no memory of previous sessions.
10
+
11
+ ### STEP 1: GET YOUR BEARINGS (MANDATORY)
12
+
13
+ Start by orienting yourself:
14
+
15
+ ```bash
16
+ # 1. See your working directory
17
+ pwd
18
+
19
+ # 2. List files to understand project structure
20
+ ls -la
21
+
22
+ # 3. Read the feature list to see all work
23
+ cat features.json | head -50
24
+
25
+ # 5. Read progress notes from previous sessions
26
+ cat claude-progress.txt
27
+
28
+ # 6. Check recent git history
29
+ git log --oneline -20
30
+
31
+ # 7. Count remaining tests
32
+ cat features.json | grep '"passes": false' | wc -l
33
+ ```
34
+
35
+ Understanding the `spec.txt` is critical - it contains the full requirements
36
+ for the application you're building.
37
+
38
+ ### STEP 2: VERIFICATION TEST (CRITICAL!)
39
+
40
+ **MANDATORY BEFORE NEW WORK:**
41
+
42
+ The previous session may have introduced bugs. Before implementing anything
43
+ new, you MUST run verification tests.
44
+
45
+ Run 1-2 of the feature tests marked as `"passes": true` that are most core to the app's functionality to verify they still work.
46
+ For example, if this were a chat app, you should perform a test that logs into the app, sends a message, and gets a response.
47
+
48
+ **If you find ANY issues (functional or visual):**
49
+ - Mark that feature as "passes": false immediately
50
+ - Add issues to a list
51
+ - Fix all issues BEFORE moving to new features
52
+ - This includes UI bugs like:
53
+ * White-on-white text or poor contrast
54
+ * Random characters displayed
55
+ * Incorrect timestamps
56
+ * Layout issues or overflow
57
+ * Buttons too close together
58
+ * Missing hover states
59
+ * Console errors
60
+
61
+ ### STEP 3: CHOOSE ONE FEATURE TO IMPLEMENT
62
+
63
+ Look at features.json and find the highest-priority feature with "passes": false.
64
+
65
+ Focus on completing one feature perfectly and completing its testing steps in this session before moving on to other features.
66
+ It's ok if you only complete one feature in this session, as there will be more sessions later that continue to make progress.
67
+
68
+ ### STEP 4: IMPLEMENT THE FEATURE
69
+
70
+ Implement the chosen feature thoroughly:
71
+ 1. Optional: Use TDD and write a few tests first
72
+ 2. Write the code (frontend and/or backend as needed)
73
+ 3. Test manually using browser automation (see Step 6)
74
+ 4. Fix any issues discovered
75
+ 5. Verify the feature works end-to-end
76
+
77
+ ### STEP 5: VERIFY WITH BROWSER AUTOMATION
78
+
79
+ **CRITICAL:** You MUST verify features through the actual UI.
80
+
81
+ Use the playwright mcp in headless mode:
82
+ - Navigate to the app in a real browser
83
+ - Interact like a human user (click, type, scroll)
84
+ - Take screenshots at each step
85
+ - Verify both functionality AND visual appearance
86
+
87
+ **DO:**
88
+ - Test through the UI with clicks and keyboard input
89
+ - Take screenshots to verify visual appearance
90
+ - Check for console errors in browser
91
+ - Verify complete user workflows end-to-end
92
+
93
+ **DON'T:**
94
+ - Only test with curl commands (backend testing alone is insufficient)
95
+ - Use JavaScript evaluation to bypass UI (no shortcuts)
96
+ - Skip visual verification
97
+ - Mark tests passing without thorough verification
98
+
99
+ ### STEP 6: UPDATE features.json (CAREFULLY!)
100
+
101
+ **YOU CAN ONLY MODIFY ONE FIELD: "passes"**
102
+
103
+ After thorough verification, change:
104
+ ```json
105
+ "passes": false
106
+ ```
107
+ to:
108
+ ```json
109
+ "passes": true
110
+ ```
111
+
112
+ **NEVER:**
113
+ - Remove tests
114
+ - Edit test descriptions
115
+ - Modify test steps
116
+ - Combine or consolidate tests
117
+ - Reorder tests
118
+
119
+ **ONLY CHANGE "passes" FIELD AFTER VERIFICATION WITH SCREENSHOTS.**
120
+
121
+ ### STEP 7: COMMIT YOUR PROGRESS
122
+
123
+ Make a descriptive git commit:
124
+ ```bash
125
+ git add .
126
+ git commit -m "Implement [feature name] - verified end-to-end
127
+
128
+ - Added [specific changes]
129
+ - Tested with browser automation
130
+ - Updated features.json: marked test #X as passing
131
+ - Screenshots in verification/ directory
132
+ "
133
+ ```
134
+
135
+ ### STEP 8: UPDATE PROGRESS NOTES
136
+
137
+ Update `claude-progress.txt` with:
138
+ - What you accomplished this session
139
+ - Which test(s) you completed
140
+ - Any issues discovered or fixed
141
+ - What should be worked on next
142
+ - Current completion status (e.g., "45/200 tests passing")
143
+
144
+ ### STEP 9: END SESSION CLEANLY
145
+
146
+ Before context fills up:
147
+ 1. Commit all working code
148
+ 2. Update claude-progress.txt
149
+ 3. Update features.json if tests verified
150
+ 4. Ensure no uncommitted changes
151
+ 5. Leave app in working state (no broken features)
152
+
153
+ ---
154
+
155
+ ## TESTING REQUIREMENTS
156
+
157
+ **ALL testing must use browser automation tools.**
158
+
159
+ Available tools:
160
+ - playwright MCP
161
+ - Deepwiki MCP (for asking questions of codebases)
162
+
163
+ Test like a human user with mouse and keyboard. Don't take shortcuts by using JavaScript evaluation.
164
+ Don't use the puppeteer "active tab" tool.
165
+
166
+ ---
167
+
168
+ ## IMPORTANT REMINDERS
169
+
170
+ **Your Goal:** Production-quality application with all tests passing
171
+
172
+ **This Session's Goal:** Complete at least one feature perfectly
173
+
174
+ **Priority:** Fix broken tests before implementing new features
175
+
176
+ **Quality Bar:**
177
+ - Zero console errors
178
+ - Polished UI matching the design specified in app_spec.txt
179
+ - All features work end-to-end through the UI
180
+ - Fast, responsive, professional
181
+
182
+ **You have unlimited time.** Take as long as needed to get it right. The most important thing is that you
183
+ leave the code base in a clean state before terminating the session (Step 9).
184
+
185
+ ---
186
+
187
+ Begin by running Step 1 (Get Your Bearings).