@zik000/archai 0.1.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.
- package/README.md +378 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +28 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +128 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/generate.d.ts +7 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +165 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +160 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/generator/claude-cli.d.ts +19 -0
- package/dist/generator/claude-cli.d.ts.map +1 -0
- package/dist/generator/claude-cli.js +168 -0
- package/dist/generator/claude-cli.js.map +1 -0
- package/dist/generator/prompt-builder.d.ts +18 -0
- package/dist/generator/prompt-builder.d.ts.map +1 -0
- package/dist/generator/prompt-builder.js +122 -0
- package/dist/generator/prompt-builder.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold/copy-core-agents.d.ts +2 -0
- package/dist/scaffold/copy-core-agents.d.ts.map +1 -0
- package/dist/scaffold/copy-core-agents.js +74 -0
- package/dist/scaffold/copy-core-agents.js.map +1 -0
- package/dist/scaffold/create-config.d.ts +12 -0
- package/dist/scaffold/create-config.d.ts.map +1 -0
- package/dist/scaffold/create-config.js +154 -0
- package/dist/scaffold/create-config.js.map +1 -0
- package/dist/scaffold/create-project-description.d.ts +12 -0
- package/dist/scaffold/create-project-description.d.ts.map +1 -0
- package/dist/scaffold/create-project-description.js +104 -0
- package/dist/scaffold/create-project-description.js.map +1 -0
- package/dist/scaffold/create-structure.d.ts +2 -0
- package/dist/scaffold/create-structure.d.ts.map +1 -0
- package/dist/scaffold/create-structure.js +146 -0
- package/dist/scaffold/create-structure.js.map +1 -0
- package/dist/utils/detect-project.d.ts +11 -0
- package/dist/utils/detect-project.d.ts.map +1 -0
- package/dist/utils/detect-project.js +124 -0
- package/dist/utils/detect-project.js.map +1 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +30 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validate-config.d.ts +23 -0
- package/dist/utils/validate-config.d.ts.map +1 -0
- package/dist/utils/validate-config.js +109 -0
- package/dist/utils/validate-config.js.map +1 -0
- package/package.json +59 -0
- package/templates/ARCHAI_README.md +326 -0
- package/templates/PROMPTS.md +480 -0
- package/templates/core-agents/cleanup-agent.md +132 -0
- package/templates/core-agents/code-reviewer.md +191 -0
- package/templates/core-agents/deep-analyst.md +170 -0
- package/templates/core-agents/finalization-agent.md +175 -0
- package/templates/core-agents/implementation-agent.md +173 -0
- package/templates/core-agents/iteration-controller.md +320 -0
- package/templates/core-agents/plan-validator.md +125 -0
- package/templates/core-agents/task-orchestrator.md +191 -0
- package/templates/core-agents/tdd-designer.md +205 -0
- package/templates/specialist-meta.md +275 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
export async function buildGenerationPrompt(config, specialist) {
|
|
3
|
+
// Read project description
|
|
4
|
+
let projectDescription = '';
|
|
5
|
+
try {
|
|
6
|
+
projectDescription = await fs.readFile('.knowledge/context/project-description.md', 'utf-8');
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
projectDescription = 'Project description not found.';
|
|
10
|
+
}
|
|
11
|
+
// Read the full config for context
|
|
12
|
+
let configContent = config.rawContent || '';
|
|
13
|
+
if (specialist) {
|
|
14
|
+
return buildSpecialistPrompt(config, specialist, projectDescription, configContent);
|
|
15
|
+
}
|
|
16
|
+
// Overview prompt
|
|
17
|
+
return `
|
|
18
|
+
# Specialist Generation Request
|
|
19
|
+
|
|
20
|
+
## Project: ${config.projectName}
|
|
21
|
+
## Type: ${config.projectType}
|
|
22
|
+
## Languages: ${config.languages}
|
|
23
|
+
## Frameworks: ${config.frameworks}
|
|
24
|
+
|
|
25
|
+
## Project Description
|
|
26
|
+
${projectDescription}
|
|
27
|
+
|
|
28
|
+
## Specialists to Generate
|
|
29
|
+
${config.specialists.map(s => `- ${s.name}: ${s.focus}`).join('\n')}
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
function buildSpecialistPrompt(config, specialist, projectDescription, configContent) {
|
|
33
|
+
return `
|
|
34
|
+
You are generating a specialist agent definition for the archai multi-agent system.
|
|
35
|
+
|
|
36
|
+
# Task
|
|
37
|
+
Generate a complete markdown agent definition file for a "${specialist.name}-specialist" agent.
|
|
38
|
+
|
|
39
|
+
# Project Context
|
|
40
|
+
- **Name**: ${config.projectName}
|
|
41
|
+
- **Type**: ${config.projectType}
|
|
42
|
+
- **Languages**: ${config.languages}
|
|
43
|
+
- **Frameworks**: ${config.frameworks}
|
|
44
|
+
- **Testing**: ${config.testing}
|
|
45
|
+
|
|
46
|
+
## Project Description
|
|
47
|
+
${projectDescription}
|
|
48
|
+
|
|
49
|
+
## Full Project Configuration
|
|
50
|
+
${configContent}
|
|
51
|
+
|
|
52
|
+
## Specialist Requirements
|
|
53
|
+
- **Name**: ${specialist.name}-specialist
|
|
54
|
+
- **Focus**: ${specialist.focus}
|
|
55
|
+
- **Key Concerns**:
|
|
56
|
+
${specialist.key_concerns.map(c => ` - ${c}`).join('\n') || ' - General best practices'}
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
# Output Format
|
|
61
|
+
|
|
62
|
+
Generate a complete agent definition following this structure:
|
|
63
|
+
|
|
64
|
+
\`\`\`markdown
|
|
65
|
+
---
|
|
66
|
+
name: ${specialist.name}-specialist
|
|
67
|
+
description: "[Brief description of when to use this specialist]"
|
|
68
|
+
tools: Read, Grep, Glob, Edit, Bash
|
|
69
|
+
model: sonnet
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
You are a {DOMAIN} expert specializing in {SPECIFIC_TECHNOLOGIES}.
|
|
73
|
+
|
|
74
|
+
## Project Context: ${config.projectName}
|
|
75
|
+
|
|
76
|
+
{Relevant project context}
|
|
77
|
+
|
|
78
|
+
**Stack relevant to this specialist:**
|
|
79
|
+
{List technologies this specialist works with}
|
|
80
|
+
|
|
81
|
+
**Key Files:**
|
|
82
|
+
{List files/directories this specialist focuses on}
|
|
83
|
+
|
|
84
|
+
## Domain Expertise
|
|
85
|
+
|
|
86
|
+
### Core Concepts
|
|
87
|
+
{Domain-specific concepts}
|
|
88
|
+
|
|
89
|
+
### Best Practices
|
|
90
|
+
{Patterns and practices}
|
|
91
|
+
|
|
92
|
+
### Common Pitfalls
|
|
93
|
+
{Things to avoid}
|
|
94
|
+
|
|
95
|
+
### Code Patterns
|
|
96
|
+
{Example patterns with code}
|
|
97
|
+
|
|
98
|
+
## When Working on {DOMAIN}
|
|
99
|
+
|
|
100
|
+
1. {Guidance 1}
|
|
101
|
+
2. {Guidance 2}
|
|
102
|
+
...
|
|
103
|
+
|
|
104
|
+
## Testing Approach
|
|
105
|
+
|
|
106
|
+
{How to test code in this domain}
|
|
107
|
+
|
|
108
|
+
## Output
|
|
109
|
+
|
|
110
|
+
When called for {DOMAIN} work, provide:
|
|
111
|
+
1. Domain-specific analysis
|
|
112
|
+
2. Recommended patterns
|
|
113
|
+
3. Pitfall warnings
|
|
114
|
+
4. Testing strategy
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
IMPORTANT: Output ONLY the markdown content starting with --- frontmatter. Do not include any explanation before or after. The output should be ready to save directly to a .md file.
|
|
118
|
+
|
|
119
|
+
Generate the complete agent definition now. Be specific to the project and technologies. Include real, practical guidance.
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=prompt-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.js","sourceRoot":"","sources":["../../src/generator/prompt-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAmB1B,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAc,EAAE,UAAuB;IACjF,2BAA2B;IAC3B,IAAI,kBAAkB,GAAG,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,kBAAkB,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB,GAAG,gCAAgC,CAAC;IACxD,CAAC;IAED,mCAAmC;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IAE5C,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAAC;IACtF,CAAC;IAED,kBAAkB;IAClB,OAAO;;;cAGK,MAAM,CAAC,WAAW;WACrB,MAAM,CAAC,WAAW;gBACb,MAAM,CAAC,SAAS;iBACf,MAAM,CAAC,UAAU;;;EAGhC,kBAAkB;;;EAGlB,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;CAClE,CAAC;AACF,CAAC;AAED,SAAS,qBAAqB,CAC5B,MAAc,EACd,UAAsB,EACtB,kBAA0B,EAC1B,aAAqB;IAErB,OAAO;;;;4DAImD,UAAU,CAAC,IAAI;;;cAG7D,MAAM,CAAC,WAAW;cAClB,MAAM,CAAC,WAAW;mBACb,MAAM,CAAC,SAAS;oBACf,MAAM,CAAC,UAAU;iBACpB,MAAM,CAAC,OAAO;;;EAG7B,kBAAkB;;;EAGlB,aAAa;;;cAGD,UAAU,CAAC,IAAI;eACd,UAAU,CAAC,KAAK;;EAE7B,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,4BAA4B;;;;;;;;;;QAUjF,UAAU,CAAC,IAAI;;;;;;;;sBAQD,MAAM,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8CvC,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { init } from './commands/init.js';
|
|
2
|
+
export { generate } from './commands/generate.js';
|
|
3
|
+
export { doctor } from './commands/doctor.js';
|
|
4
|
+
export { scaffoldProject } from './scaffold/create-structure.js';
|
|
5
|
+
export { copyCoreAgents } from './scaffold/copy-core-agents.js';
|
|
6
|
+
export { createConfigTemplate } from './scaffold/create-config.js';
|
|
7
|
+
export { createProjectDescription } from './scaffold/create-project-description.js';
|
|
8
|
+
export { detectProject } from './utils/detect-project.js';
|
|
9
|
+
export { validateConfig } from './utils/validate-config.js';
|
|
10
|
+
export { logger } from './utils/logger.js';
|
|
11
|
+
export { buildGenerationPrompt } from './generator/prompt-builder.js';
|
|
12
|
+
export { runClaudeCli, checkClaudeCliAvailable } from './generator/claude-cli.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// archai - Multi-Agent Development Workflow Setup
|
|
2
|
+
// https://github.com/xxx/archai
|
|
3
|
+
export { init } from './commands/init.js';
|
|
4
|
+
export { generate } from './commands/generate.js';
|
|
5
|
+
export { doctor } from './commands/doctor.js';
|
|
6
|
+
export { scaffoldProject } from './scaffold/create-structure.js';
|
|
7
|
+
export { copyCoreAgents } from './scaffold/copy-core-agents.js';
|
|
8
|
+
export { createConfigTemplate } from './scaffold/create-config.js';
|
|
9
|
+
export { createProjectDescription } from './scaffold/create-project-description.js';
|
|
10
|
+
export { detectProject } from './utils/detect-project.js';
|
|
11
|
+
export { validateConfig } from './utils/validate-config.js';
|
|
12
|
+
export { logger } from './utils/logger.js';
|
|
13
|
+
export { buildGenerationPrompt } from './generator/prompt-builder.js';
|
|
14
|
+
export { runClaudeCli, checkClaudeCliAvailable } from './generator/claude-cli.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,gCAAgC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AAEpF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-core-agents.d.ts","sourceRoot":"","sources":["../../src/scaffold/copy-core-agents.ts"],"names":[],"mappings":"AAoBA,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CA4DpD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
// Core agents that are always installed
|
|
7
|
+
const CORE_AGENTS = [
|
|
8
|
+
'iteration-controller',
|
|
9
|
+
'deep-analyst',
|
|
10
|
+
'plan-validator',
|
|
11
|
+
'tdd-designer',
|
|
12
|
+
'implementation-agent',
|
|
13
|
+
'code-reviewer',
|
|
14
|
+
'cleanup-agent',
|
|
15
|
+
'finalization-agent',
|
|
16
|
+
'task-orchestrator',
|
|
17
|
+
];
|
|
18
|
+
export async function copyCoreAgents() {
|
|
19
|
+
// Find templates directory (relative to compiled JS location)
|
|
20
|
+
// In dev: src/scaffold/copy-core-agents.ts -> templates/
|
|
21
|
+
// In dist: dist/scaffold/copy-core-agents.js -> templates/
|
|
22
|
+
const templatesDir = path.resolve(__dirname, '../../templates/core-agents');
|
|
23
|
+
// Ensure target directory exists
|
|
24
|
+
await fs.ensureDir('.claude/agents');
|
|
25
|
+
// Copy each core agent
|
|
26
|
+
for (const agent of CORE_AGENTS) {
|
|
27
|
+
const sourcePath = path.join(templatesDir, `${agent}.md`);
|
|
28
|
+
const targetPath = `.claude/agents/${agent}.md`;
|
|
29
|
+
if (await fs.pathExists(sourcePath)) {
|
|
30
|
+
await fs.copy(sourcePath, targetPath);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
// If template doesn't exist, create a placeholder
|
|
34
|
+
console.warn(`Warning: Template for ${agent} not found at ${sourcePath}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// Copy specialist meta-template
|
|
38
|
+
const metaSource = path.join(templatesDir, '../specialist-meta.md');
|
|
39
|
+
if (await fs.pathExists(metaSource)) {
|
|
40
|
+
await fs.copy(metaSource, '.claude/templates/specialist-meta.md');
|
|
41
|
+
}
|
|
42
|
+
// Create README for agents folder
|
|
43
|
+
const readmeContent = `# Agent Definitions
|
|
44
|
+
|
|
45
|
+
This folder contains the agent definitions for the archai multi-agent system.
|
|
46
|
+
|
|
47
|
+
## Core Agents (9)
|
|
48
|
+
|
|
49
|
+
| Agent | Purpose |
|
|
50
|
+
|-------|---------|
|
|
51
|
+
| iteration-controller | Orchestrates the 3-phase workflow |
|
|
52
|
+
| deep-analyst | Deep analysis before implementation |
|
|
53
|
+
| plan-validator | Validates plans, finds gaps |
|
|
54
|
+
| tdd-designer | Designs tests before code |
|
|
55
|
+
| implementation-agent | Autonomous code implementation |
|
|
56
|
+
| code-reviewer | Post-implementation review |
|
|
57
|
+
| cleanup-agent | Pre-commit cleanup |
|
|
58
|
+
| finalization-agent | Commit, push, CI/CD |
|
|
59
|
+
| task-orchestrator | Epic/task lifecycle |
|
|
60
|
+
|
|
61
|
+
## Specialist Agents
|
|
62
|
+
|
|
63
|
+
Generated by \`archai generate\` based on your project configuration.
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
In Claude Code:
|
|
68
|
+
\`\`\`
|
|
69
|
+
Use iteration-controller for: [your task]
|
|
70
|
+
\`\`\`
|
|
71
|
+
`;
|
|
72
|
+
await fs.writeFile('.claude/agents/README.md', readmeContent);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=copy-core-agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-core-agents.js","sourceRoot":"","sources":["../../src/scaffold/copy-core-agents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,wCAAwC;AACxC,MAAM,WAAW,GAAG;IAClB,sBAAsB;IACtB,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,oBAAoB;IACpB,mBAAmB;CACpB,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,8DAA8D;IAC9D,yDAAyD;IACzD,2DAA2D;IAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;IAE5E,iCAAiC;IACjC,MAAM,EAAE,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAErC,uBAAuB;IACvB,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,KAAK,KAAK,CAAC,CAAC;QAC1D,MAAM,UAAU,GAAG,kBAAkB,KAAK,KAAK,CAAC;QAEhD,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,kDAAkD;YAClD,OAAO,CAAC,IAAI,CAAC,yBAAyB,KAAK,iBAAiB,UAAU,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,gCAAgC;IAChC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAAC;IACpE,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACpC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,sCAAsC,CAAC,CAAC;IACpE,CAAC;IAED,kCAAkC;IAClC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BvB,CAAC;IAEA,MAAM,EAAE,CAAC,SAAS,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface WizardAnswers {
|
|
2
|
+
projectName: string;
|
|
3
|
+
projectType: string;
|
|
4
|
+
languages: string;
|
|
5
|
+
frameworks: string;
|
|
6
|
+
testFramework: string;
|
|
7
|
+
isMonorepo: boolean;
|
|
8
|
+
packageManager: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createConfigTemplate(answers: WizardAnswers): Promise<void>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=create-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-config.d.ts","sourceRoot":"","sources":["../../src/scaffold/create-config.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FhF"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
export async function createConfigTemplate(answers) {
|
|
3
|
+
const pmCommands = getPackageManagerCommands(answers.packageManager || 'other');
|
|
4
|
+
const config = `# archai Project Configuration
|
|
5
|
+
|
|
6
|
+
> Fill in this file, then run: \`archai generate\`
|
|
7
|
+
> Look for [TODO] markers for fields that need your input.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Project Info
|
|
12
|
+
|
|
13
|
+
**Name:** ${answers.projectName}
|
|
14
|
+
**Type:** ${answers.projectType || '[TODO: web, mobile, cli, game, ml, devops]'}
|
|
15
|
+
**Monorepo:** ${answers.isMonorepo ? 'Yes' : 'No'}
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Tech Stack
|
|
20
|
+
|
|
21
|
+
**Languages:** ${answers.languages || '[TODO: TypeScript, Python, Go, etc.]'}
|
|
22
|
+
**Frameworks:** ${answers.frameworks || '[TODO: React, Express, Django, etc.]'}
|
|
23
|
+
**Testing:** ${answers.testFramework || '[TODO: vitest, jest, pytest, etc.]'}
|
|
24
|
+
|
|
25
|
+
### Additional Technologies
|
|
26
|
+
<!-- List any other important tech (databases, caching, etc.) -->
|
|
27
|
+
-
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
**Package Manager:** ${answers.packageManager || '[TODO: npm, pnpm, yarn, pip, cargo, go]'}
|
|
34
|
+
|
|
35
|
+
| Command | Script |
|
|
36
|
+
|---------|--------|
|
|
37
|
+
| Install | ${pmCommands.install || '[TODO]'} |
|
|
38
|
+
| Build | ${pmCommands.build || '[TODO]'} |
|
|
39
|
+
| Test | ${pmCommands.test || '[TODO]'} |
|
|
40
|
+
| Lint | ${pmCommands.lint || '[TODO]'} |
|
|
41
|
+
| Dev | ${pmCommands.dev || '[TODO]'} |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Project Structure
|
|
46
|
+
|
|
47
|
+
**Source Directory:** src/
|
|
48
|
+
**Tests Directory:** tests/
|
|
49
|
+
|
|
50
|
+
### Key Files
|
|
51
|
+
<!-- List important files agents should know about -->
|
|
52
|
+
| File | Purpose |
|
|
53
|
+
|------|---------|
|
|
54
|
+
| | |
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Specialists to Generate
|
|
59
|
+
|
|
60
|
+
<!--
|
|
61
|
+
List the specialist agents you want Claude to create.
|
|
62
|
+
Examples: frontend, backend, database, api, auth, payments, etc.
|
|
63
|
+
-->
|
|
64
|
+
|
|
65
|
+
### 1. [TODO: Specialist Name]
|
|
66
|
+
**Focus:** [What this specialist handles]
|
|
67
|
+
**Key Concerns:**
|
|
68
|
+
- [Concern 1]
|
|
69
|
+
- [Concern 2]
|
|
70
|
+
|
|
71
|
+
### 2. [Add more as needed]
|
|
72
|
+
**Focus:**
|
|
73
|
+
**Key Concerns:**
|
|
74
|
+
-
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Permissions
|
|
79
|
+
|
|
80
|
+
<!-- Commands agents are allowed to run -->
|
|
81
|
+
- ${answers.packageManager ? `${answers.packageManager} *` : '[TODO: package manager commands]'}
|
|
82
|
+
- npx *
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Notes
|
|
87
|
+
|
|
88
|
+
<!-- Any other context for agents -->
|
|
89
|
+
|
|
90
|
+
`;
|
|
91
|
+
await fs.writeFile('archai.config.md', config);
|
|
92
|
+
}
|
|
93
|
+
function getPackageManagerCommands(pm) {
|
|
94
|
+
const commands = {
|
|
95
|
+
npm: {
|
|
96
|
+
install: 'npm install',
|
|
97
|
+
build: 'npm run build',
|
|
98
|
+
test: 'npm test',
|
|
99
|
+
lint: 'npm run lint',
|
|
100
|
+
dev: 'npm run dev',
|
|
101
|
+
},
|
|
102
|
+
pnpm: {
|
|
103
|
+
install: 'pnpm install',
|
|
104
|
+
build: 'pnpm build',
|
|
105
|
+
test: 'pnpm test',
|
|
106
|
+
lint: 'pnpm lint',
|
|
107
|
+
dev: 'pnpm dev',
|
|
108
|
+
},
|
|
109
|
+
yarn: {
|
|
110
|
+
install: 'yarn',
|
|
111
|
+
build: 'yarn build',
|
|
112
|
+
test: 'yarn test',
|
|
113
|
+
lint: 'yarn lint',
|
|
114
|
+
dev: 'yarn dev',
|
|
115
|
+
},
|
|
116
|
+
bun: {
|
|
117
|
+
install: 'bun install',
|
|
118
|
+
build: 'bun run build',
|
|
119
|
+
test: 'bun test',
|
|
120
|
+
lint: 'bun run lint',
|
|
121
|
+
dev: 'bun run dev',
|
|
122
|
+
},
|
|
123
|
+
pip: {
|
|
124
|
+
install: 'pip install -r requirements.txt',
|
|
125
|
+
build: 'python -m build',
|
|
126
|
+
test: 'pytest',
|
|
127
|
+
lint: 'ruff check .',
|
|
128
|
+
dev: 'python main.py',
|
|
129
|
+
},
|
|
130
|
+
cargo: {
|
|
131
|
+
install: 'cargo build',
|
|
132
|
+
build: 'cargo build --release',
|
|
133
|
+
test: 'cargo test',
|
|
134
|
+
lint: 'cargo clippy',
|
|
135
|
+
dev: 'cargo run',
|
|
136
|
+
},
|
|
137
|
+
go: {
|
|
138
|
+
install: 'go mod download',
|
|
139
|
+
build: 'go build',
|
|
140
|
+
test: 'go test ./...',
|
|
141
|
+
lint: 'golangci-lint run',
|
|
142
|
+
dev: 'go run .',
|
|
143
|
+
},
|
|
144
|
+
other: {
|
|
145
|
+
install: '',
|
|
146
|
+
build: '',
|
|
147
|
+
test: '',
|
|
148
|
+
lint: '',
|
|
149
|
+
dev: '',
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
return commands[pm] || commands.other;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=create-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-config.js","sourceRoot":"","sources":["../../src/scaffold/create-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAY1B,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,OAAsB;IAC/D,MAAM,UAAU,GAAG,yBAAyB,CAAC,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,CAAC;IAEhF,MAAM,MAAM,GAAG;;;;;;;;;YASL,OAAO,CAAC,WAAW;YACnB,OAAO,CAAC,WAAW,IAAI,4CAA4C;gBAC/D,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;;;;;;iBAMhC,OAAO,CAAC,SAAS,IAAI,sCAAsC;kBAC1D,OAAO,CAAC,UAAU,IAAI,sCAAsC;eAC/D,OAAO,CAAC,aAAa,IAAI,oCAAoC;;;;;;;;;;uBAUrD,OAAO,CAAC,cAAc,IAAI,yCAAyC;;;;cAI5E,UAAU,CAAC,OAAO,IAAI,QAAQ;YAChC,UAAU,CAAC,KAAK,IAAI,QAAQ;WAC7B,UAAU,CAAC,IAAI,IAAI,QAAQ;WAC3B,UAAU,CAAC,IAAI,IAAI,QAAQ;UAC5B,UAAU,CAAC,GAAG,IAAI,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwChC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC,kCAAkC;;;;;;;;;CAS9F,CAAC;IAEA,MAAM,EAAE,CAAC,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,yBAAyB,CAAC,EAAU;IAC3C,MAAM,QAAQ,GAA2C;QACvD,GAAG,EAAE;YACH,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,aAAa;SACnB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,UAAU;SAChB;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,WAAW;YACjB,GAAG,EAAE,UAAU;SAChB;QACD,GAAG,EAAE;YACH,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,eAAe;YACtB,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,aAAa;SACnB;QACD,GAAG,EAAE;YACH,OAAO,EAAE,iCAAiC;YAC1C,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,gBAAgB;SACtB;QACD,KAAK,EAAE;YACL,OAAO,EAAE,aAAa;YACtB,KAAK,EAAE,uBAAuB;YAC9B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,WAAW;SACjB;QACD,EAAE,EAAE;YACF,OAAO,EAAE,iBAAiB;YAC1B,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,mBAAmB;YACzB,GAAG,EAAE,UAAU;SAChB;QACD,KAAK,EAAE;YACL,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE;YACR,GAAG,EAAE,EAAE;SACR;KACF,CAAC;IAEF,OAAO,QAAQ,CAAC,EAAE,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface WizardAnswers {
|
|
2
|
+
projectName: string;
|
|
3
|
+
projectType: string;
|
|
4
|
+
languages: string;
|
|
5
|
+
frameworks: string;
|
|
6
|
+
testFramework: string;
|
|
7
|
+
isMonorepo: boolean;
|
|
8
|
+
packageManager: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createProjectDescription(answers: WizardAnswers): Promise<void>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=create-project-description.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-project-description.d.ts","sourceRoot":"","sources":["../../src/scaffold/create-project-description.ts"],"names":[],"mappings":"AAEA,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGpF"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
export async function createProjectDescription(answers) {
|
|
3
|
+
const template = `# Project Description
|
|
4
|
+
|
|
5
|
+
> This file provides context to all agents. Fill it in thoroughly.
|
|
6
|
+
> After filling, run: \`archai generate\`
|
|
7
|
+
|
|
8
|
+
## Project Overview
|
|
9
|
+
|
|
10
|
+
**Name:** ${answers.projectName}
|
|
11
|
+
|
|
12
|
+
**One-line description:**
|
|
13
|
+
[What does this project do in one sentence?]
|
|
14
|
+
|
|
15
|
+
**Detailed description:**
|
|
16
|
+
[2-3 paragraphs explaining the project, its purpose, target users, and core functionality]
|
|
17
|
+
|
|
18
|
+
## Tech Stack
|
|
19
|
+
|
|
20
|
+
**Languages:** ${answers.languages || '[TODO: Add your languages - e.g., TypeScript, Python, Go]'}
|
|
21
|
+
**Frameworks:** ${answers.frameworks || '[TODO: Add your frameworks - e.g., React, Express, Django]'}
|
|
22
|
+
**Testing:** ${answers.testFramework || '[TODO: Add your test framework - e.g., vitest, jest, pytest]'}
|
|
23
|
+
|
|
24
|
+
## Architecture
|
|
25
|
+
|
|
26
|
+
**High-level architecture:**
|
|
27
|
+
[Describe how the system is structured - client/server, microservices, monolith, etc.]
|
|
28
|
+
|
|
29
|
+
\`\`\`
|
|
30
|
+
[ASCII diagram of your architecture - optional but helpful]
|
|
31
|
+
\`\`\`
|
|
32
|
+
|
|
33
|
+
**Key modules/packages:**
|
|
34
|
+
${answers.isMonorepo ? `- \`packages/\` - Shared libraries
|
|
35
|
+
- \`apps/\` - Applications` : `- \`src/\` - Main source code`}
|
|
36
|
+
|
|
37
|
+
## Domain Concepts
|
|
38
|
+
|
|
39
|
+
**Core entities:**
|
|
40
|
+
[List the main domain objects/concepts in your system]
|
|
41
|
+
|
|
42
|
+
- **Entity1**: Description
|
|
43
|
+
- **Entity2**: Description
|
|
44
|
+
|
|
45
|
+
**Key workflows:**
|
|
46
|
+
[Describe the main user flows or system processes]
|
|
47
|
+
|
|
48
|
+
1. Workflow name: Brief description
|
|
49
|
+
2. ...
|
|
50
|
+
|
|
51
|
+
## Technical Constraints
|
|
52
|
+
|
|
53
|
+
**Performance requirements:**
|
|
54
|
+
- [e.g., "Must handle 1000 concurrent users"]
|
|
55
|
+
- [e.g., "Page load under 3 seconds"]
|
|
56
|
+
|
|
57
|
+
**Compatibility requirements:**
|
|
58
|
+
- [e.g., "Modern browsers only", "iOS 14+"]
|
|
59
|
+
|
|
60
|
+
**Security considerations:**
|
|
61
|
+
- [e.g., "Authentication required", "Data encryption"]
|
|
62
|
+
|
|
63
|
+
## Development Guidelines
|
|
64
|
+
|
|
65
|
+
**Code style:**
|
|
66
|
+
[Any specific conventions, patterns to follow - or reference to style guide]
|
|
67
|
+
|
|
68
|
+
**What to avoid:**
|
|
69
|
+
[Anti-patterns, deprecated approaches, things NOT to do]
|
|
70
|
+
|
|
71
|
+
**Testing philosophy:**
|
|
72
|
+
[How thorough should tests be? What must be tested?]
|
|
73
|
+
|
|
74
|
+
## External Integrations
|
|
75
|
+
|
|
76
|
+
List any third-party services/APIs:
|
|
77
|
+
|
|
78
|
+
| Service | Purpose | Notes |
|
|
79
|
+
|---------|---------|-------|
|
|
80
|
+
| [Service name] | [What it's used for] | [Any special notes] |
|
|
81
|
+
|
|
82
|
+
## Current State
|
|
83
|
+
|
|
84
|
+
**What's working:**
|
|
85
|
+
- [Feature 1]
|
|
86
|
+
- [Feature 2]
|
|
87
|
+
|
|
88
|
+
**Known issues:**
|
|
89
|
+
- [Issue 1]
|
|
90
|
+
- [Issue 2]
|
|
91
|
+
|
|
92
|
+
**Upcoming priorities:**
|
|
93
|
+
- [Priority 1]
|
|
94
|
+
- [Priority 2]
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
> Delete this section after filling: This file is read by all agents.
|
|
99
|
+
> The more detail you provide, the better the agents will understand your project.
|
|
100
|
+
`;
|
|
101
|
+
await fs.ensureDir('.knowledge/context');
|
|
102
|
+
await fs.writeFile('.knowledge/context/project-description.md', template);
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=create-project-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-project-description.js","sourceRoot":"","sources":["../../src/scaffold/create-project-description.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAY1B,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAAsB;IACnE,MAAM,QAAQ,GAAG;;;;;;;YAOP,OAAO,CAAC,WAAW;;;;;;;;;;iBAUd,OAAO,CAAC,SAAS,IAAI,2DAA2D;kBAC/E,OAAO,CAAC,UAAU,IAAI,4DAA4D;eACrF,OAAO,CAAC,aAAa,IAAI,8DAA8D;;;;;;;;;;;;EAYpG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;2BACI,CAAC,CAAC,CAAC,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE5D,CAAC;IAEA,MAAM,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IACzC,MAAM,EAAE,CAAC,SAAS,CAAC,2CAA2C,EAAE,QAAQ,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-structure.d.ts","sourceRoot":"","sources":["../../src/scaffold/create-structure.ts"],"names":[],"mappings":"AAwCA,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAqBrD"}
|