bps-kit 1.0.9 → 1.0.11
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/CHANGELOG.md +11 -0
- package/bin/cli.js +14 -2
- package/bin/convert_to_vscode.js +103 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ Todas as mudanças notáveis neste projeto serão documentadas neste arqui
|
|
|
5
5
|
O formato é baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.0.0/),
|
|
6
6
|
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
|
7
7
|
|
|
8
|
+
## [1.0.11] - 2026-03-08
|
|
9
|
+
### Corrigido
|
|
10
|
+
- Expurgo do `node_modules/` do tracking source do sistema de repositórios do Git.
|
|
11
|
+
- Refinamentos drásticos na estrutura nativa tratada do Copilot (`--vscode` flag): Personas (Agents) baseadas em sistema consolidado foram re-desmembradas e alocadas organicamente em `.github/agents/`. Workflows foram mapeadas em `.github/prompts/*.prompt.md`.
|
|
12
|
+
- Instaladores agora emitem alertas amarelos prevenidos na interface se estiverem sobrescrevendo diretórios (`.agents/` ou `.github/`) previamente rastreados durante um setup de perfil repetido.
|
|
13
|
+
|
|
14
|
+
## [1.0.10] - 2026-03-08
|
|
15
|
+
### Corrigido
|
|
16
|
+
- Resolução do erro `MODULE_NOT_FOUND` reportado ao disparar a CLI contendo as flags combinadas de `--extra` / `--basic` e `--vscode`.
|
|
17
|
+
- O utilitário conversor do GitHub Copilot havia ficado ilhado na pasta ignorada do NPM (`src/`) pois fazia parte da raiz template de desenvolvedor invés da build da CLI final. Foi realocado para a diretriz `bin/` operante.
|
|
18
|
+
|
|
8
19
|
## [1.0.9] - 2026-03-08
|
|
9
20
|
### Modificado
|
|
10
21
|
- Refatoração visual completa do `README.md` com adição de emblemas (badges) e seções formatadas.
|
package/bin/cli.js
CHANGED
|
@@ -40,6 +40,14 @@ async function runInstaller() {
|
|
|
40
40
|
const spinner = ora('Montando diretórios base...').start();
|
|
41
41
|
|
|
42
42
|
try {
|
|
43
|
+
if (options.vscode && await fs.pathExists(path.join(DEST_BASE, '.github'))) {
|
|
44
|
+
spinner.warn(chalk.yellow('Aviso: Pasta .github detectada. Os artefatos do Copilot serão sobrescritos se existirem.'));
|
|
45
|
+
spinner.start('Montando diretórios base...');
|
|
46
|
+
} else if (!options.vscode && await fs.pathExists(DEST_AGENTS)) {
|
|
47
|
+
spinner.warn(chalk.yellow('Aviso: Pasta .agents já existe. O BPS Kit a sobrescreverá.'));
|
|
48
|
+
spinner.start('Montando diretórios base...');
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
// 1. Setup Base Directories
|
|
44
52
|
await fs.ensureDir(DEST_AGENTS);
|
|
45
53
|
|
|
@@ -95,7 +103,7 @@ async function runInstaller() {
|
|
|
95
103
|
// 5. Conversor para VS Code se solicitado
|
|
96
104
|
if (options.vscode) {
|
|
97
105
|
spinner.text = `Transformando arquitetura para padrão GitHub Copilot (VS Code)...`;
|
|
98
|
-
const { convertToVsCode } = require('
|
|
106
|
+
const { convertToVsCode } = require('./convert_to_vscode');
|
|
99
107
|
await convertToVsCode(DEST_AGENTS, DEST_BASE);
|
|
100
108
|
}
|
|
101
109
|
|
|
@@ -112,7 +120,11 @@ async function runInstaller() {
|
|
|
112
120
|
console.log(chalk.cyan('======================================================'));
|
|
113
121
|
|
|
114
122
|
console.log(chalk.yellow('\n💡 Next Steps:'));
|
|
115
|
-
|
|
123
|
+
if (options.vscode) {
|
|
124
|
+
console.log(chalk.white('1. O GitHub Copilot Agent já deve estar lendo o `.github/copilot-instructions.md`.'));
|
|
125
|
+
} else {
|
|
126
|
+
console.log(chalk.white('1. O sistema Antigravity já deve estar lendo o `.agents/rules/GEMINI.md`.'));
|
|
127
|
+
}
|
|
116
128
|
console.log(chalk.white('2. Para auto-calibrar a sua IA baseada nos arquivos deste repositório, basta pedir para ele:\n'));
|
|
117
129
|
console.log(chalk.dim(' "Rode a workflow setup-brain para otimizar minhas skills neste projeto"'));
|
|
118
130
|
console.log('\n🌟 Boa codificação estruturada!\n');
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const fs = require('fs-extra');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Converte toda a estrutura .agents importada para .github estrutural do Copilot
|
|
7
|
+
* @param {string} destAgents O diretorio destino onde a copy crua (.agents) aportou
|
|
8
|
+
* @param {string} destBase A raiz do repositorio final
|
|
9
|
+
*/
|
|
10
|
+
async function convertToVsCode(destAgents, destBase) {
|
|
11
|
+
const gitHubDir = path.join(destBase, '.github');
|
|
12
|
+
const copilotInstructionsDir = path.join(gitHubDir, 'instructions');
|
|
13
|
+
|
|
14
|
+
await fs.ensureDir(copilotInstructionsDir);
|
|
15
|
+
|
|
16
|
+
console.log(chalk.dim(' [VS Code] Convertendo arquivos para sintaxe do Copilot...'));
|
|
17
|
+
|
|
18
|
+
// 1. Converter a rule master GEMINI.md em copilot-instructions.md
|
|
19
|
+
const geminiPath = path.join(destAgents, 'rules', 'GEMINI.md');
|
|
20
|
+
if (await fs.pathExists(geminiPath)) {
|
|
21
|
+
let content = await fs.readFile(geminiPath, 'utf8');
|
|
22
|
+
// Adaptamos os caminhos na rule principal para o contexto do .github/ do VS Code
|
|
23
|
+
content = content.replace(/\.\/\.agents\/skills\//g, './.github/instructions/');
|
|
24
|
+
content = content.replace(/\.\/\.agents\/vault\//g, './.copilot-vault/');
|
|
25
|
+
content = content.replace(/\.\/\.agents\/rules\/GEMINI\.md/g, './.github/copilot-instructions.md');
|
|
26
|
+
|
|
27
|
+
// As workflows no VS Code estao desabrigadas da pasta nativa, sugerimos le-las do vault ou inline
|
|
28
|
+
content += `\n\n## 🔄 Workflows Base\nAs workflows antigas de Cursor (/brainstorm, etc) agora devem ser invocadas naturalmente no chat: "Rode o fluxo de brainstorm". Consulte o AGENTS.md para contexto.\n`;
|
|
29
|
+
|
|
30
|
+
await fs.writeFile(path.join(gitHubDir, 'copilot-instructions.md'), content);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 2. Converter as skills nativas (ativas) em glob .instructions.md
|
|
34
|
+
const skillsDest = path.join(destAgents, 'skills');
|
|
35
|
+
if (await fs.pathExists(skillsDest)) {
|
|
36
|
+
const skillsDirs = await fs.readdir(skillsDest);
|
|
37
|
+
for (const skillName of skillsDirs) {
|
|
38
|
+
const skillFile = path.join(skillsDest, skillName, 'SKILL.md');
|
|
39
|
+
if (await fs.pathExists(skillFile)) {
|
|
40
|
+
let content = await fs.readFile(skillFile, 'utf8');
|
|
41
|
+
|
|
42
|
+
// Injetamos um frontmatter basico aceitavel pelo Copilot apontando para tudo (**/*)
|
|
43
|
+
// para que a Skill ative independente do arquivo no Workspace se for convocada.
|
|
44
|
+
const vsCodeContent = `---
|
|
45
|
+
description: ${skillName.replace(/-/g, ' ')}
|
|
46
|
+
applyTo: "**/*"
|
|
47
|
+
---
|
|
48
|
+
${content}`;
|
|
49
|
+
await fs.writeFile(path.join(copilotInstructionsDir, `${skillName}.instructions.md`), vsCodeContent);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 3. Converter o Vault Index (Tudo que esta no index vira uma mera instruction text base local)
|
|
55
|
+
const vaultIndexSrc = path.join(destAgents, 'VAULT_INDEX.md');
|
|
56
|
+
if (await fs.pathExists(vaultIndexSrc)) {
|
|
57
|
+
let content = await fs.readFile(vaultIndexSrc, 'utf8');
|
|
58
|
+
content = content.replace(/\.\/\.agents\/vault\//g, './.copilot-vault/');
|
|
59
|
+
await fs.writeFile(path.join(copilotInstructionsDir, 'VAULT_INDEX.instructions.md'), content);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 4. Mover o Vault inteiro para uma pasta customizada oculta que nao polua a base restrita do Git / do Copilot local
|
|
63
|
+
const vaultSrc = path.join(destAgents, 'vault');
|
|
64
|
+
const copilotVaultDir = path.join(destBase, '.copilot-vault');
|
|
65
|
+
if (await fs.pathExists(vaultSrc)) {
|
|
66
|
+
await fs.move(vaultSrc, copilotVaultDir, { overwrite: true });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 5. Mover as 20 personas (AGENTS) para a pasta especializada do Copilot `.github/agents/`
|
|
70
|
+
const agentsSrc = path.join(destAgents, 'agents');
|
|
71
|
+
const copilotAgentsDir = path.join(gitHubDir, 'agents');
|
|
72
|
+
if (await fs.pathExists(agentsSrc)) {
|
|
73
|
+
await fs.ensureDir(copilotAgentsDir);
|
|
74
|
+
const agentFiles = await fs.readdir(agentsSrc);
|
|
75
|
+
for (const agent of agentFiles) {
|
|
76
|
+
if (agent.endsWith('.md')) {
|
|
77
|
+
const content = await fs.readFile(path.join(agentsSrc, agent), 'utf8');
|
|
78
|
+
// Adicionando a extensão recomendada .agent.md se necessario, mas o VSCode aceita .md na pasta /agents
|
|
79
|
+
await fs.writeFile(path.join(copilotAgentsDir, agent), content);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 6. Converter Workflows em Copilot Prompts locados em `.github/prompts/`
|
|
85
|
+
const workflowsSrc = path.join(destAgents, 'workflows');
|
|
86
|
+
const copilotPromptsDir = path.join(gitHubDir, 'prompts');
|
|
87
|
+
if (await fs.pathExists(workflowsSrc)) {
|
|
88
|
+
await fs.ensureDir(copilotPromptsDir);
|
|
89
|
+
const workflowFiles = await fs.readdir(workflowsSrc);
|
|
90
|
+
for (const workflow of workflowFiles) {
|
|
91
|
+
if (workflow.endsWith('.md')) {
|
|
92
|
+
const content = await fs.readFile(path.join(workflowsSrc, workflow), 'utf8');
|
|
93
|
+
// O copilot aceita prompts em .github/prompts/{name}.prompt.md
|
|
94
|
+
await fs.writeFile(path.join(copilotPromptsDir, workflow.replace('.md', '.prompt.md')), content);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Limpeza pesada! Como o ambiente ja foi migrado de .agents para .github e .copilot-vault, delete a origem da instalacao hibrida.
|
|
100
|
+
await fs.remove(destAgents);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
module.exports = { convertToVsCode };
|