@ggailabs/cli-context 0.5.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/LICENSE +21 -0
- package/README.md +197 -0
- package/dist/generators/agents/agentConfig.d.ts +4 -0
- package/dist/generators/agents/agentConfig.d.ts.map +1 -0
- package/dist/generators/agents/agentConfig.js +180 -0
- package/dist/generators/agents/agentConfig.js.map +1 -0
- package/dist/generators/agents/agentGenerator.d.ts +9 -0
- package/dist/generators/agents/agentGenerator.d.ts.map +1 -0
- package/dist/generators/agents/agentGenerator.js +97 -0
- package/dist/generators/agents/agentGenerator.js.map +1 -0
- package/dist/generators/agents/agentTypes.d.ts +4 -0
- package/dist/generators/agents/agentTypes.d.ts.map +1 -0
- package/dist/generators/agents/agentTypes.js +25 -0
- package/dist/generators/agents/agentTypes.js.map +1 -0
- package/dist/generators/agents/index.d.ts +4 -0
- package/dist/generators/agents/index.d.ts.map +1 -0
- package/dist/generators/agents/index.js +12 -0
- package/dist/generators/agents/index.js.map +1 -0
- package/dist/generators/agents/templates/index.d.ts +4 -0
- package/dist/generators/agents/templates/index.d.ts.map +1 -0
- package/dist/generators/agents/templates/index.js +8 -0
- package/dist/generators/agents/templates/index.js.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/agents/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/agents/templates/indexTemplate.js +36 -0
- package/dist/generators/agents/templates/indexTemplate.js.map +1 -0
- package/dist/generators/agents/templates/playbookTemplate.d.ts +4 -0
- package/dist/generators/agents/templates/playbookTemplate.d.ts.map +1 -0
- package/dist/generators/agents/templates/playbookTemplate.js +99 -0
- package/dist/generators/agents/templates/playbookTemplate.js.map +1 -0
- package/dist/generators/agents/templates/types.d.ts +14 -0
- package/dist/generators/agents/templates/types.d.ts.map +1 -0
- package/dist/generators/agents/templates/types.js +3 -0
- package/dist/generators/agents/templates/types.js.map +1 -0
- package/dist/generators/documentation/documentationGenerator.d.ts +15 -0
- package/dist/generators/documentation/documentationGenerator.d.ts.map +1 -0
- package/dist/generators/documentation/documentationGenerator.js +188 -0
- package/dist/generators/documentation/documentationGenerator.js.map +1 -0
- package/dist/generators/documentation/guideRegistry.d.ts +6 -0
- package/dist/generators/documentation/guideRegistry.d.ts.map +1 -0
- package/dist/generators/documentation/guideRegistry.js +82 -0
- package/dist/generators/documentation/guideRegistry.js.map +1 -0
- package/dist/generators/documentation/index.d.ts +2 -0
- package/dist/generators/documentation/index.d.ts.map +1 -0
- package/dist/generators/documentation/index.js +6 -0
- package/dist/generators/documentation/index.js.map +1 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.js +490 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/architectureTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/architectureTemplate.js +66 -0
- package/dist/generators/documentation/templates/architectureTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/common.d.ts +7 -0
- package/dist/generators/documentation/templates/common.d.ts.map +1 -0
- package/dist/generators/documentation/templates/common.js +58 -0
- package/dist/generators/documentation/templates/common.js.map +1 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.js +40 -0
- package/dist/generators/documentation/templates/dataFlowTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +44 -0
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/glossaryTemplate.js +41 -0
- package/dist/generators/documentation/templates/glossaryTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/index.d.ts +15 -0
- package/dist/generators/documentation/templates/index.d.ts.map +1 -0
- package/dist/generators/documentation/templates/index.js +30 -0
- package/dist/generators/documentation/templates/index.js.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/indexTemplate.js +42 -0
- package/dist/generators/documentation/templates/indexTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/migrationTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/migrationTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/migrationTemplate.js +422 -0
- package/dist/generators/documentation/templates/migrationTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/onboardingTemplate.js +431 -0
- package/dist/generators/documentation/templates/onboardingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts +3 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.js +65 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/securityTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/securityTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/securityTemplate.js +39 -0
- package/dist/generators/documentation/templates/securityTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/testingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/testingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/testingTemplate.js +45 -0
- package/dist/generators/documentation/templates/testingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/toolingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/toolingTemplate.js +42 -0
- package/dist/generators/documentation/templates/toolingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.js +292 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/types.d.ts +23 -0
- package/dist/generators/documentation/templates/types.d.ts.map +1 -0
- package/dist/generators/documentation/templates/types.js +3 -0
- package/dist/generators/documentation/templates/types.js.map +1 -0
- package/dist/generators/plans/index.d.ts +2 -0
- package/dist/generators/plans/index.d.ts.map +1 -0
- package/dist/generators/plans/index.js +6 -0
- package/dist/generators/plans/index.js.map +1 -0
- package/dist/generators/plans/planGenerator.d.ts +22 -0
- package/dist/generators/plans/planGenerator.d.ts.map +1 -0
- package/dist/generators/plans/planGenerator.js +109 -0
- package/dist/generators/plans/planGenerator.js.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts +3 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.js +37 -0
- package/dist/generators/plans/templates/indexTemplate.js.map +1 -0
- package/dist/generators/plans/templates/planTemplate.d.ts +3 -0
- package/dist/generators/plans/templates/planTemplate.d.ts.map +1 -0
- package/dist/generators/plans/templates/planTemplate.js +166 -0
- package/dist/generators/plans/templates/planTemplate.js.map +1 -0
- package/dist/generators/plans/templates/types.d.ts +19 -0
- package/dist/generators/plans/templates/types.d.ts.map +1 -0
- package/dist/generators/plans/templates/types.js +3 -0
- package/dist/generators/plans/templates/types.js.map +1 -0
- package/dist/generators/shared/contextGenerator.d.ts +7 -0
- package/dist/generators/shared/contextGenerator.d.ts.map +1 -0
- package/dist/generators/shared/contextGenerator.js +13 -0
- package/dist/generators/shared/contextGenerator.js.map +1 -0
- package/dist/generators/shared/directoryTemplateHelpers.d.ts +2 -0
- package/dist/generators/shared/directoryTemplateHelpers.d.ts.map +1 -0
- package/dist/generators/shared/directoryTemplateHelpers.js +12 -0
- package/dist/generators/shared/directoryTemplateHelpers.js.map +1 -0
- package/dist/generators/shared/generatorUtils.d.ts +16 -0
- package/dist/generators/shared/generatorUtils.d.ts.map +1 -0
- package/dist/generators/shared/generatorUtils.js +119 -0
- package/dist/generators/shared/generatorUtils.js.map +1 -0
- package/dist/generators/shared/index.d.ts +4 -0
- package/dist/generators/shared/index.d.ts.map +1 -0
- package/dist/generators/shared/index.js +10 -0
- package/dist/generators/shared/index.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +571 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/defaults.d.ts +3 -0
- package/dist/prompts/defaults.d.ts.map +1 -0
- package/dist/prompts/defaults.js +95 -0
- package/dist/prompts/defaults.js.map +1 -0
- package/dist/services/baseLLMClient.d.ts +12 -0
- package/dist/services/baseLLMClient.d.ts.map +1 -0
- package/dist/services/baseLLMClient.js +80 -0
- package/dist/services/baseLLMClient.js.map +1 -0
- package/dist/services/fill/fillService.d.ts +46 -0
- package/dist/services/fill/fillService.d.ts.map +1 -0
- package/dist/services/fill/fillService.js +254 -0
- package/dist/services/fill/fillService.js.map +1 -0
- package/dist/services/init/initService.d.ts +37 -0
- package/dist/services/init/initService.d.ts.map +1 -0
- package/dist/services/init/initService.js +167 -0
- package/dist/services/init/initService.js.map +1 -0
- package/dist/services/llmClientFactory.d.ts +8 -0
- package/dist/services/llmClientFactory.d.ts.map +1 -0
- package/dist/services/llmClientFactory.js +23 -0
- package/dist/services/llmClientFactory.js.map +1 -0
- package/dist/services/openRouterClient.d.ts +9 -0
- package/dist/services/openRouterClient.d.ts.map +1 -0
- package/dist/services/openRouterClient.js +49 -0
- package/dist/services/openRouterClient.js.map +1 -0
- package/dist/services/plan/planService.d.ts +57 -0
- package/dist/services/plan/planService.d.ts.map +1 -0
- package/dist/services/plan/planService.js +334 -0
- package/dist/services/plan/planService.js.map +1 -0
- package/dist/services/shared/llmConfig.d.ts +22 -0
- package/dist/services/shared/llmConfig.d.ts.map +1 -0
- package/dist/services/shared/llmConfig.js +38 -0
- package/dist/services/shared/llmConfig.js.map +1 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/cliUI.d.ts +27 -0
- package/dist/utils/cliUI.d.ts.map +1 -0
- package/dist/utils/cliUI.js +252 -0
- package/dist/utils/cliUI.js.map +1 -0
- package/dist/utils/fileMapper.d.ts +11 -0
- package/dist/utils/fileMapper.d.ts.map +1 -0
- package/dist/utils/fileMapper.js +146 -0
- package/dist/utils/fileMapper.js.map +1 -0
- package/dist/utils/gitService.d.ts +50 -0
- package/dist/utils/gitService.d.ts.map +1 -0
- package/dist/utils/gitService.js +470 -0
- package/dist/utils/gitService.js.map +1 -0
- package/dist/utils/i18n.d.ts +171 -0
- package/dist/utils/i18n.d.ts.map +1 -0
- package/dist/utils/i18n.js +381 -0
- package/dist/utils/i18n.js.map +1 -0
- package/dist/utils/promptLoader.d.ts +12 -0
- package/dist/utils/promptLoader.d.ts.map +1 -0
- package/dist/utils/promptLoader.js +81 -0
- package/dist/utils/promptLoader.js.map +1 -0
- package/dist/utils/versionChecker.d.ts +15 -0
- package/dist/utils/versionChecker.d.ts.map +1 -0
- package/dist/utils/versionChecker.js +49 -0
- package/dist/utils/versionChecker.js.map +1 -0
- package/package.json +76 -0
- package/prompts/update_plan_prompt.md +41 -0
- package/prompts/update_scaffold_prompt.md +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 AI Coders
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# cli-context
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/cli-context)
|
|
4
|
+
[](https://github.com/vinilana/ai-coders-context/actions/workflows/ci.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
<img width="663" height="192" alt="image" src="https://github.com/user-attachments/assets/4b07f61d-6800-420a-ae91-6e952cbc790d" />
|
|
8
|
+
|
|
9
|
+
A lightweight CLI that scaffolds living documentation and AI-agent playbooks for any repository—no LLMs or API keys required. The generated structure gives teams a consistent starting point for knowledge sharing while keeping everything under version control.
|
|
10
|
+
|
|
11
|
+
## ⚙️ Requirements
|
|
12
|
+
|
|
13
|
+
- Node.js 20+ (we currently test on 20, 22, 23, and 24)
|
|
14
|
+
|
|
15
|
+
## ✨ What You Get
|
|
16
|
+
|
|
17
|
+
- 📚 `docs/` folder with a documentation index plus ready-to-edit guides (overview, architecture, workflow, testing)
|
|
18
|
+
- 🤖 `agents/` folder containing playbooks for common engineering agents and a handy index
|
|
19
|
+
- 🔁 Repeatable scaffolding that you can re-run as the project evolves
|
|
20
|
+
- 🧭 Repository-aware templates that highlight top-level directories for quick orientation
|
|
21
|
+
- 🧠 AI-ready front matter and `agent-update` markers so assistants know exactly what to refresh
|
|
22
|
+
|
|
23
|
+
## 📦 Installation
|
|
24
|
+
|
|
25
|
+
Use `npx` to run the CLI without installing globally:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx cli-context
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or add it to your dev dependencies:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install --save-dev cli-context
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## 🚀 Quick Start
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Launch the interactive wizard
|
|
41
|
+
npx cli-context
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Scaffold docs and agents into ./.context
|
|
45
|
+
npx cli-context init ./my-repo
|
|
46
|
+
|
|
47
|
+
# Only generate docs
|
|
48
|
+
npx cli-context init ./my-repo docs
|
|
49
|
+
|
|
50
|
+
# Only generate agent playbooks, with a custom output directory
|
|
51
|
+
npx cli-context init ./my-repo agents --output ./knowledge-base
|
|
52
|
+
|
|
53
|
+
# Fill docs and agents with the repo context (preview the first 3 updates)
|
|
54
|
+
npx cli-context fill ./my-repo --output ./.context --limit 3
|
|
55
|
+
|
|
56
|
+
# Draft a collaboration plan seeded with agent and doc touchpoints
|
|
57
|
+
npx cli-context plan release-readiness --output ./.context
|
|
58
|
+
|
|
59
|
+
# Let the LLM enrich an existing plan with the latest context
|
|
60
|
+
npx cli-context plan release-readiness --output ./.context --fill --dry-run
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
> ℹ️ The CLI pings npm for fresh releases at startup. Set `AI_CONTEXT_DISABLE_UPDATE_CHECK=true` to skip the check.
|
|
64
|
+
|
|
65
|
+
After running the command, inspect the generated structure:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
.context/
|
|
69
|
+
├── agents/
|
|
70
|
+
│ ├── README.md
|
|
71
|
+
│ ├── code-reviewer.md
|
|
72
|
+
│ └── ...
|
|
73
|
+
└── docs/
|
|
74
|
+
├── README.md
|
|
75
|
+
├── architecture.md
|
|
76
|
+
└── ...
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Customize the Markdown files to reflect your project’s specifics and commit them alongside the code.
|
|
80
|
+
|
|
81
|
+
## 🧠 Guided Updates for AI Assistants
|
|
82
|
+
|
|
83
|
+
Need help filling in the scaffold? Use [`prompts/update_scaffold_prompt.md`](./prompts/update_scaffold_prompt.md) as the canonical instruction set for any LLM or CLI agent. It walks through:
|
|
84
|
+
|
|
85
|
+
- Gathering repository context and locating `agent-update`/`agent-fill` markers.
|
|
86
|
+
- Updating documentation sections while satisfying the YAML front matter criteria.
|
|
87
|
+
- Aligning agent playbooks with the refreshed docs and recording evidence for maintainers.
|
|
88
|
+
|
|
89
|
+
Share that prompt verbatim with your assistant to keep updates consistent across teams.
|
|
90
|
+
|
|
91
|
+
### Available Doc Guides & Agent Types
|
|
92
|
+
|
|
93
|
+
The scaffold includes the following guides and playbooks out of the box:
|
|
94
|
+
|
|
95
|
+
- Docs: `project-overview`, `architecture`, `development-workflow`, `testing-strategy`, `glossary`, `data-flow`, `security`, `tooling`
|
|
96
|
+
- Agents: `code-reviewer`, `bug-fixer`, `feature-developer`, `refactoring-specialist`, `test-writer`, `documentation-writer`, `performance-optimizer`, `security-auditor`, `backend-specialist`, `frontend-specialist`, `architect-specialist`
|
|
97
|
+
|
|
98
|
+
### AI Marker Reference
|
|
99
|
+
|
|
100
|
+
- `<!-- agent-update:start:section-id --> … <!-- agent-update:end -->` wrap the sections that AI assistants should rewrite with up-to-date project knowledge.
|
|
101
|
+
- `<!-- agent-fill:slot-id --> … <!-- /agent-fill -->` highlight inline placeholders that must be replaced with concrete details before removing the wrapper.
|
|
102
|
+
- `<!-- agent-readonly:context -->` flags guidance that should remain as-is; treat the adjacent content as instructions rather than editable prose.
|
|
103
|
+
|
|
104
|
+
When contributing, focus edits inside `agent-update` regions or `agent-fill` placeholders and leave `agent-readonly` guidance untouched unless you have explicit maintainer approval.
|
|
105
|
+
|
|
106
|
+
## 🛠 Commands
|
|
107
|
+
|
|
108
|
+
### `init`
|
|
109
|
+
Scaffold documentation and/or agent playbooks.
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
Usage: cli-context init <repo-path> [type]
|
|
113
|
+
|
|
114
|
+
Arguments:
|
|
115
|
+
repo-path Path to the repository you want to scan
|
|
116
|
+
type "docs", "agents", or "both" (default)
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
-o, --output <dir> Output directory (default: ./.context)
|
|
120
|
+
--exclude <patterns...> Glob patterns to skip during the scan
|
|
121
|
+
--include <patterns...> Glob patterns to explicitly include
|
|
122
|
+
-v, --verbose Print detailed progress information
|
|
123
|
+
-h, --help Display help for command
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### `fill`
|
|
127
|
+
Use an LLM to refresh scaffolded docs and agent playbooks automatically.
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
Usage: cli-context fill <repo-path>
|
|
131
|
+
|
|
132
|
+
Options:
|
|
133
|
+
-o, --output <dir> Scaffold directory containing docs/ and agents/ (default: ./.context)
|
|
134
|
+
-k, --api-key <key> API key for the selected LLM provider
|
|
135
|
+
-m, --model <model> LLM model to use (default: x-ai/grok-4-fast)
|
|
136
|
+
-p, --provider <name> Provider (openrouter only)
|
|
137
|
+
--base-url <url> Custom base URL for OpenRouter
|
|
138
|
+
--prompt <file> Instruction prompt to follow (optional; uses bundled instructions when omitted)
|
|
139
|
+
--limit <number> Maximum number of files to update in one run
|
|
140
|
+
-h, --help Display help for command
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Under the hood, the command loads the prompt above, iterates over every Markdown file in `.context/docs` and `.context/agents`, and asks the LLM to produce the fully updated content.
|
|
144
|
+
|
|
145
|
+
### `plan`
|
|
146
|
+
Create a collaboration plan that links documentation guides and agent playbooks, or fill an existing plan with LLM assistance.
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
Usage: cli-context plan <plan-name>
|
|
150
|
+
|
|
151
|
+
Options:
|
|
152
|
+
-o, --output <dir> Scaffold directory containing docs/ and agents/ (default: ./.context)
|
|
153
|
+
--title <title> Custom title for the plan document
|
|
154
|
+
--summary <text> Seed the plan with a short summary or goal statement
|
|
155
|
+
-f, --force Overwrite the plan if it already exists (scaffold mode)
|
|
156
|
+
--fill Use an LLM to fill or update the plan instead of scaffolding
|
|
157
|
+
-r, --repo <path> Repository root to summarize for additional context (fill mode)
|
|
158
|
+
-k, --api-key <key> API key for the selected LLM provider (fill mode)
|
|
159
|
+
-m, --model <model> LLM model to use (default: x-ai/grok-4-fast)
|
|
160
|
+
-p, --provider <name> Provider (openrouter only)
|
|
161
|
+
--base-url <url> Custom base URL for OpenRouter
|
|
162
|
+
--prompt <file> Instruction prompt to follow (optional; uses bundled instructions when omitted)
|
|
163
|
+
--dry-run Preview changes without writing files
|
|
164
|
+
--include <patterns...> Glob patterns to include during repository analysis
|
|
165
|
+
--exclude <patterns...> Glob patterns to exclude from repository analysis
|
|
166
|
+
-h, --help Display help for command
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
In scaffold mode the command creates `.context/plans/<plan-name>.md`, keeps a `plans/README.md` index, and reminds contributors to consult the agent handbook before delegating work to an AI assistant. In fill mode it will scaffold the plan automatically if it does not exist, then read the plan plus its referenced docs and agent playbooks, send that context to the LLM, and either preview or write the updated Markdown.
|
|
170
|
+
|
|
171
|
+
💡 Tip: run `npx cli-context` with no arguments to enter an interactive mode that guides you through scaffold and LLM-fill options.
|
|
172
|
+
|
|
173
|
+
Prefer driving the update elsewhere? Just grab [`prompts/update_scaffold_prompt.md`](./prompts/update_scaffold_prompt.md) and run it in your favorite playground or agent host. When you’re ready to automate, drop your API key in `.env` (for example `OPENROUTER_API_KEY` and `OPENROUTER_MODEL`) and let `fill` handle the edits inline.
|
|
174
|
+
|
|
175
|
+
## 🧰 Local Development
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
git clone https://github.com/vinilana/ai-coders-context.git
|
|
179
|
+
cd ai-coders-context
|
|
180
|
+
npm install
|
|
181
|
+
npm run build
|
|
182
|
+
npm run test
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
During development you can run the CLI directly against TypeScript sources:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npm run dev -- ./path/to/repo
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 🤝 Contributing
|
|
192
|
+
|
|
193
|
+
See [`AGENTS.md`](./AGENTS.md) for contributor guidelines, coding standards, and release tips. Pull requests are welcome!
|
|
194
|
+
|
|
195
|
+
## 📄 License
|
|
196
|
+
|
|
197
|
+
MIT © Vinícius Lana
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentConfig.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/agentConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CA2F9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,CAmF5D,CAAC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_BEST_PRACTICES = exports.AGENT_RESPONSIBILITIES = void 0;
|
|
4
|
+
exports.AGENT_RESPONSIBILITIES = {
|
|
5
|
+
'code-reviewer': [
|
|
6
|
+
'Review code changes for quality, style, and best practices',
|
|
7
|
+
'Identify potential bugs and security issues',
|
|
8
|
+
'Ensure code follows project conventions',
|
|
9
|
+
'Provide constructive feedback and suggestions'
|
|
10
|
+
],
|
|
11
|
+
'bug-fixer': [
|
|
12
|
+
'Analyze bug reports and error messages',
|
|
13
|
+
'Identify root causes of issues',
|
|
14
|
+
'Implement targeted fixes with minimal side effects',
|
|
15
|
+
'Test fixes thoroughly before deployment'
|
|
16
|
+
],
|
|
17
|
+
'feature-developer': [
|
|
18
|
+
'Implement new features according to specifications',
|
|
19
|
+
'Design clean, maintainable code architecture',
|
|
20
|
+
'Integrate features with existing codebase',
|
|
21
|
+
'Write comprehensive tests for new functionality'
|
|
22
|
+
],
|
|
23
|
+
'refactoring-specialist': [
|
|
24
|
+
'Identify code smells and improvement opportunities',
|
|
25
|
+
'Refactor code while maintaining functionality',
|
|
26
|
+
'Improve code organization and structure',
|
|
27
|
+
'Optimize performance where applicable'
|
|
28
|
+
],
|
|
29
|
+
'test-writer': [
|
|
30
|
+
'Write comprehensive unit and integration tests',
|
|
31
|
+
'Ensure good test coverage across the codebase',
|
|
32
|
+
'Create test utilities and fixtures',
|
|
33
|
+
'Maintain and update existing tests'
|
|
34
|
+
],
|
|
35
|
+
'documentation-writer': [
|
|
36
|
+
'Create clear, comprehensive documentation',
|
|
37
|
+
'Update existing documentation as code changes',
|
|
38
|
+
'Write helpful code comments and examples',
|
|
39
|
+
'Maintain README and API documentation'
|
|
40
|
+
],
|
|
41
|
+
'performance-optimizer': [
|
|
42
|
+
'Identify performance bottlenecks',
|
|
43
|
+
'Optimize code for speed and efficiency',
|
|
44
|
+
'Implement caching strategies',
|
|
45
|
+
'Monitor and improve resource usage'
|
|
46
|
+
],
|
|
47
|
+
'security-auditor': [
|
|
48
|
+
'Identify security vulnerabilities',
|
|
49
|
+
'Implement security best practices',
|
|
50
|
+
'Review dependencies for security issues',
|
|
51
|
+
'Ensure data protection and privacy compliance'
|
|
52
|
+
],
|
|
53
|
+
'backend-specialist': [
|
|
54
|
+
'Design and implement server-side architecture',
|
|
55
|
+
'Create and maintain APIs and microservices',
|
|
56
|
+
'Optimize database queries and data models',
|
|
57
|
+
'Implement authentication and authorization',
|
|
58
|
+
'Handle server deployment and scaling'
|
|
59
|
+
],
|
|
60
|
+
'frontend-specialist': [
|
|
61
|
+
'Design and implement user interfaces',
|
|
62
|
+
'Create responsive and accessible web applications',
|
|
63
|
+
'Optimize client-side performance and bundle sizes',
|
|
64
|
+
'Implement state management and routing',
|
|
65
|
+
'Ensure cross-browser compatibility'
|
|
66
|
+
],
|
|
67
|
+
'architect-specialist': [
|
|
68
|
+
'Design overall system architecture and patterns',
|
|
69
|
+
'Define technical standards and best practices',
|
|
70
|
+
'Evaluate and recommend technology choices',
|
|
71
|
+
'Plan system scalability and maintainability',
|
|
72
|
+
'Create architectural documentation and diagrams'
|
|
73
|
+
],
|
|
74
|
+
'devops-specialist': [
|
|
75
|
+
'Design and maintain CI/CD pipelines',
|
|
76
|
+
'Implement infrastructure as code',
|
|
77
|
+
'Configure monitoring and alerting systems',
|
|
78
|
+
'Manage container orchestration and deployments',
|
|
79
|
+
'Optimize cloud resources and cost efficiency'
|
|
80
|
+
],
|
|
81
|
+
'database-specialist': [
|
|
82
|
+
'Design and optimize database schemas',
|
|
83
|
+
'Create and manage database migrations',
|
|
84
|
+
'Optimize query performance and indexing',
|
|
85
|
+
'Ensure data integrity and consistency',
|
|
86
|
+
'Implement backup and recovery strategies'
|
|
87
|
+
],
|
|
88
|
+
'mobile-specialist': [
|
|
89
|
+
'Develop native and cross-platform mobile applications',
|
|
90
|
+
'Optimize mobile app performance and battery usage',
|
|
91
|
+
'Implement mobile-specific UI/UX patterns',
|
|
92
|
+
'Handle app store deployment and updates',
|
|
93
|
+
'Integrate push notifications and offline capabilities'
|
|
94
|
+
]
|
|
95
|
+
};
|
|
96
|
+
exports.AGENT_BEST_PRACTICES = {
|
|
97
|
+
'code-reviewer': [
|
|
98
|
+
'Focus on maintainability and readability',
|
|
99
|
+
'Consider the broader impact of changes',
|
|
100
|
+
'Be constructive and specific in feedback'
|
|
101
|
+
],
|
|
102
|
+
'bug-fixer': [
|
|
103
|
+
'Reproduce the bug before fixing',
|
|
104
|
+
'Write tests to prevent regression',
|
|
105
|
+
'Document the fix for future reference'
|
|
106
|
+
],
|
|
107
|
+
'feature-developer': [
|
|
108
|
+
'Follow existing patterns and conventions',
|
|
109
|
+
'Consider edge cases and error handling',
|
|
110
|
+
'Write tests alongside implementation'
|
|
111
|
+
],
|
|
112
|
+
'refactoring-specialist': [
|
|
113
|
+
'Make small, incremental changes',
|
|
114
|
+
'Ensure tests pass after each refactor',
|
|
115
|
+
'Preserve existing functionality exactly'
|
|
116
|
+
],
|
|
117
|
+
'test-writer': [
|
|
118
|
+
'Write tests that are clear and maintainable',
|
|
119
|
+
'Test both happy path and edge cases',
|
|
120
|
+
'Use descriptive test names'
|
|
121
|
+
],
|
|
122
|
+
'documentation-writer': [
|
|
123
|
+
'Keep documentation up-to-date with code',
|
|
124
|
+
'Write from the user\'s perspective',
|
|
125
|
+
'Include practical examples'
|
|
126
|
+
],
|
|
127
|
+
'performance-optimizer': [
|
|
128
|
+
'Measure before optimizing',
|
|
129
|
+
'Focus on actual bottlenecks',
|
|
130
|
+
'Don\'t sacrifice readability unnecessarily'
|
|
131
|
+
],
|
|
132
|
+
'security-auditor': [
|
|
133
|
+
'Follow security best practices',
|
|
134
|
+
'Stay updated on common vulnerabilities',
|
|
135
|
+
'Consider the principle of least privilege'
|
|
136
|
+
],
|
|
137
|
+
'backend-specialist': [
|
|
138
|
+
'Design APIs according the specification of the project',
|
|
139
|
+
'Implement proper error handling and logging',
|
|
140
|
+
'Use appropriate design patterns and clean architecture',
|
|
141
|
+
'Consider scalability and performance from the start',
|
|
142
|
+
'Implement comprehensive testing for business logic'
|
|
143
|
+
],
|
|
144
|
+
'frontend-specialist': [
|
|
145
|
+
'Follow modern frontend development patterns',
|
|
146
|
+
'Optimize for accessibility and user experience',
|
|
147
|
+
'Implement responsive design principles',
|
|
148
|
+
'Use component-based architecture effectively',
|
|
149
|
+
'Optimize performance and loading times'
|
|
150
|
+
],
|
|
151
|
+
'architect-specialist': [
|
|
152
|
+
'Consider long-term maintainability and scalability',
|
|
153
|
+
'Balance technical debt with business requirements',
|
|
154
|
+
'Document architectural decisions and rationale',
|
|
155
|
+
'Promote code reusability and modularity',
|
|
156
|
+
'Stay updated on industry trends and technologies'
|
|
157
|
+
],
|
|
158
|
+
'devops-specialist': [
|
|
159
|
+
'Automate everything that can be automated',
|
|
160
|
+
'Implement infrastructure as code for reproducibility',
|
|
161
|
+
'Monitor system health proactively',
|
|
162
|
+
'Design for failure and implement proper fallbacks',
|
|
163
|
+
'Keep security and compliance in every deployment'
|
|
164
|
+
],
|
|
165
|
+
'database-specialist': [
|
|
166
|
+
'Always benchmark queries before and after optimization',
|
|
167
|
+
'Plan migrations with rollback strategies',
|
|
168
|
+
'Use appropriate indexing strategies for workloads',
|
|
169
|
+
'Maintain data consistency across transactions',
|
|
170
|
+
'Document schema changes and their business impact'
|
|
171
|
+
],
|
|
172
|
+
'mobile-specialist': [
|
|
173
|
+
'Test on real devices, not just simulators',
|
|
174
|
+
'Optimize for battery life and data usage',
|
|
175
|
+
'Follow platform-specific design guidelines',
|
|
176
|
+
'Implement proper offline-first strategies',
|
|
177
|
+
'Plan for app store review requirements early'
|
|
178
|
+
]
|
|
179
|
+
};
|
|
180
|
+
//# sourceMappingURL=agentConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentConfig.js","sourceRoot":"","sources":["../../../src/generators/agents/agentConfig.ts"],"names":[],"mappings":";;;AAEa,QAAA,sBAAsB,GAAgC;IACjE,eAAe,EAAE;QACf,4DAA4D;QAC5D,6CAA6C;QAC7C,yCAAyC;QAC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|
2
|
+
export declare class AgentGenerator {
|
|
3
|
+
private readonly docTouchpoints;
|
|
4
|
+
constructor(..._legacyArgs: unknown[]);
|
|
5
|
+
generateAgentPrompts(repoStructure: RepoStructure, outputDir: string, selectedAgentTypes?: string[], verbose?: boolean): Promise<number>;
|
|
6
|
+
private resolveAgentSelection;
|
|
7
|
+
private buildContext;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=agentGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentGenerator.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/agentGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgB5C,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAW7B;gBAEU,GAAG,WAAW,EAAE,OAAO,EAAE;IAG/B,oBAAoB,CACxB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAC7B,OAAO,GAAE,OAAe,GACvB,OAAO,CAAC,MAAM,CAAC;IAuBlB,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,YAAY;CAerB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AgentGenerator = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const shared_1 = require("../shared");
|
|
39
|
+
const agentTypes_1 = require("./agentTypes");
|
|
40
|
+
const templates_1 = require("./templates");
|
|
41
|
+
const guideRegistry_1 = require("../documentation/guideRegistry");
|
|
42
|
+
class AgentGenerator {
|
|
43
|
+
constructor(..._legacyArgs) {
|
|
44
|
+
this.docTouchpoints = [
|
|
45
|
+
{
|
|
46
|
+
title: 'Documentation Index',
|
|
47
|
+
path: '../docs/README.md',
|
|
48
|
+
marker: 'agent-update:docs-index'
|
|
49
|
+
},
|
|
50
|
+
...guideRegistry_1.DOCUMENT_GUIDES.map(guide => ({
|
|
51
|
+
title: guide.title,
|
|
52
|
+
path: `../docs/${guide.file}`,
|
|
53
|
+
marker: guide.marker
|
|
54
|
+
}))
|
|
55
|
+
];
|
|
56
|
+
}
|
|
57
|
+
async generateAgentPrompts(repoStructure, outputDir, selectedAgentTypes, verbose = false) {
|
|
58
|
+
const agentsDir = path.join(outputDir, 'agents');
|
|
59
|
+
await shared_1.GeneratorUtils.ensureDirectoryAndLog(agentsDir, verbose, 'Generating agent scaffold in');
|
|
60
|
+
const context = this.buildContext(repoStructure);
|
|
61
|
+
const agentTypes = this.resolveAgentSelection(selectedAgentTypes);
|
|
62
|
+
let created = 0;
|
|
63
|
+
for (const agentType of agentTypes) {
|
|
64
|
+
const content = (0, templates_1.renderAgentPlaybook)(agentType, context.topLevelDirectories, this.docTouchpoints);
|
|
65
|
+
const filePath = path.join(agentsDir, `${agentType}.md`);
|
|
66
|
+
await shared_1.GeneratorUtils.writeFileWithLogging(filePath, content, verbose, `Created ${agentType}.md`);
|
|
67
|
+
created += 1;
|
|
68
|
+
}
|
|
69
|
+
const indexPath = path.join(agentsDir, 'README.md');
|
|
70
|
+
const indexContent = (0, templates_1.renderAgentIndex)(agentTypes);
|
|
71
|
+
await shared_1.GeneratorUtils.writeFileWithLogging(indexPath, indexContent, verbose, 'Created README.md');
|
|
72
|
+
created += 1;
|
|
73
|
+
return created;
|
|
74
|
+
}
|
|
75
|
+
resolveAgentSelection(selected) {
|
|
76
|
+
if (!selected || selected.length === 0) {
|
|
77
|
+
return agentTypes_1.AGENT_TYPES;
|
|
78
|
+
}
|
|
79
|
+
const allowed = new Set(agentTypes_1.AGENT_TYPES);
|
|
80
|
+
const filtered = selected.filter((agent) => allowed.has(agent));
|
|
81
|
+
return (filtered.length > 0 ? filtered : agentTypes_1.AGENT_TYPES);
|
|
82
|
+
}
|
|
83
|
+
buildContext(repoStructure) {
|
|
84
|
+
const directorySet = new Set();
|
|
85
|
+
repoStructure.directories.forEach(dir => {
|
|
86
|
+
const [firstSegment] = dir.relativePath.split(/[\\/]/).filter(Boolean);
|
|
87
|
+
if (firstSegment) {
|
|
88
|
+
directorySet.add(firstSegment);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
topLevelDirectories: Array.from(directorySet).sort()
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.AgentGenerator = AgentGenerator;
|
|
97
|
+
//# sourceMappingURL=agentGenerator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentGenerator.js","sourceRoot":"","sources":["../../../src/generators/agents/agentGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,sCAA2C;AAC3C,6CAAsD;AACtD,2CAAoE;AACpE,kEAAiE;AAYjE,MAAa,cAAc;IAczB,YAAY,GAAG,WAAsB;QAbpB,mBAAc,GAAoB;YACjD;gBACE,KAAK,EAAE,qBAAqB;gBAC5B,IAAI,EAAE,mBAAmB;gBACzB,MAAM,EAAE,yBAAyB;aAClC;YACD,GAAG,+BAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC/B,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,WAAW,KAAK,CAAC,IAAI,EAAE;gBAC7B,MAAM,EAAE,KAAK,CAAC,MAAM;aACrB,CAAC,CAAC;SACJ,CAAC;IAEsC,CAAC;IAGzC,KAAK,CAAC,oBAAoB,CACxB,aAA4B,EAC5B,SAAiB,EACjB,kBAA6B,EAC7B,UAAmB,KAAK;QAExB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACjD,MAAM,uBAAc,CAAC,qBAAqB,CAAC,SAAS,EAAE,OAAO,EAAE,8BAA8B,CAAC,CAAC;QAE/F,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACjD,MAAM,UAAU,GAAG,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;QAElE,IAAI,OAAO,GAAG,CAA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AAU,CAAC;QAEvC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACtC,MAAM,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACvE,IAAI,YAAY,EAAE,CAAC;gBACjB,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO;YACL,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE;SACrD,CAAC;IACJ,CAAC;CAEF;AAtED,wCAsEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const AGENT_TYPES: readonly ["code-reviewer", "bug-fixer", "feature-developer", "refactoring-specialist", "test-writer", "documentation-writer", "performance-optimizer", "security-auditor", "backend-specialist", "frontend-specialist", "architect-specialist", "devops-specialist", "database-specialist", "mobile-specialist"];
|
|
2
|
+
export type AgentType = typeof AGENT_TYPES[number];
|
|
3
|
+
export declare const IMPORTANT_FILES: string[];
|
|
4
|
+
//# sourceMappingURL=agentTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentTypes.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/agentTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,kTAed,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;AAEnD,eAAO,MAAM,eAAe,UAI3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMPORTANT_FILES = exports.AGENT_TYPES = void 0;
|
|
4
|
+
exports.AGENT_TYPES = [
|
|
5
|
+
'code-reviewer',
|
|
6
|
+
'bug-fixer',
|
|
7
|
+
'feature-developer',
|
|
8
|
+
'refactoring-specialist',
|
|
9
|
+
'test-writer',
|
|
10
|
+
'documentation-writer',
|
|
11
|
+
'performance-optimizer',
|
|
12
|
+
'security-auditor',
|
|
13
|
+
'backend-specialist',
|
|
14
|
+
'frontend-specialist',
|
|
15
|
+
'architect-specialist',
|
|
16
|
+
'devops-specialist',
|
|
17
|
+
'database-specialist',
|
|
18
|
+
'mobile-specialist'
|
|
19
|
+
];
|
|
20
|
+
exports.IMPORTANT_FILES = [
|
|
21
|
+
'package.json', 'tsconfig.json', 'webpack.config.js',
|
|
22
|
+
'next.config.js', 'tailwind.config.js', 'README.md',
|
|
23
|
+
'.gitignore', 'Dockerfile', 'docker-compose.yml'
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=agentTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentTypes.js","sourceRoot":"","sources":["../../../src/generators/agents/agentTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,eAAe;IACf,WAAW;IACX,mBAAmB;IACnB,wBAAwB;IACxB,aAAa;IACb,sBAAsB;IACtB,uBAAuB;IACvB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;CACX,CAAC;AAIE,QAAA,eAAe,GAAG;IAC7B,cAAc,EAAE,eAAe,EAAE,mBAAmB;IACpD,gBAAgB,EAAE,oBAAoB,EAAE,WAAW;IACnD,YAAY,EAAE,YAAY,EAAE,oBAAoB;CACjD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_BEST_PRACTICES = exports.AGENT_RESPONSIBILITIES = exports.IMPORTANT_FILES = exports.AGENT_TYPES = exports.AgentGenerator = void 0;
|
|
4
|
+
var agentGenerator_1 = require("./agentGenerator");
|
|
5
|
+
Object.defineProperty(exports, "AgentGenerator", { enumerable: true, get: function () { return agentGenerator_1.AgentGenerator; } });
|
|
6
|
+
var agentTypes_1 = require("./agentTypes");
|
|
7
|
+
Object.defineProperty(exports, "AGENT_TYPES", { enumerable: true, get: function () { return agentTypes_1.AGENT_TYPES; } });
|
|
8
|
+
Object.defineProperty(exports, "IMPORTANT_FILES", { enumerable: true, get: function () { return agentTypes_1.IMPORTANT_FILES; } });
|
|
9
|
+
var agentConfig_1 = require("./agentConfig");
|
|
10
|
+
Object.defineProperty(exports, "AGENT_RESPONSIBILITIES", { enumerable: true, get: function () { return agentConfig_1.AGENT_RESPONSIBILITIES; } });
|
|
11
|
+
Object.defineProperty(exports, "AGENT_BEST_PRACTICES", { enumerable: true, get: function () { return agentConfig_1.AGENT_BEST_PRACTICES; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/agents/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,2CAAuE;AAA9D,yGAAA,WAAW,OAAA;AAAa,6GAAA,eAAe,OAAA;AAChD,6CAA6E;AAApE,qHAAA,sBAAsB,OAAA;AAAE,mHAAA,oBAAoB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderAgentIndex = exports.renderAgentPlaybook = void 0;
|
|
4
|
+
var playbookTemplate_1 = require("./playbookTemplate");
|
|
5
|
+
Object.defineProperty(exports, "renderAgentPlaybook", { enumerable: true, get: function () { return playbookTemplate_1.renderAgentPlaybook; } });
|
|
6
|
+
var indexTemplate_1 = require("./indexTemplate");
|
|
7
|
+
Object.defineProperty(exports, "renderAgentIndex", { enumerable: true, get: function () { return indexTemplate_1.renderAgentIndex; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/generators/agents/templates/index.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA;AAC5B,iDAAmD;AAA1C,iHAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/agents/templates/indexTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAyBzE"}
|