primocode 9.8.0-beta.2 → 9.8.0-beta.4
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 +20 -5
- package/bin/primocode.js +322 -53
- package/comandos/explicar.md +14 -0
- package/comandos/publicar.md +10 -0
- package/comandos/revisar.md +13 -0
- package/kits/landing/index.html +162 -0
- package/kits/landing/script.js +199 -0
- package/kits/landing/style.css +219 -0
- package/lib/act.js +43 -10
- package/lib/checkpoint.js +134 -0
- package/lib/comandos.js +104 -0
- package/lib/config.js +18 -4
- package/lib/kits.js +95 -0
- package/lib/mencoes.js +98 -0
- package/lib/perigo.js +256 -0
- package/package.json +4 -2
- package/skills/design-de-verdade/LICENSE.txt +177 -0
- package/skills/design-de-verdade/SKILL.md +40 -0
package/lib/perigo.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* perigo.js — o que não tem volta pede licença antes.
|
|
3
|
+
*
|
|
4
|
+
* Até aqui o PrimoCode rodava qualquer `run_shell` e escrevia qualquer arquivo
|
|
5
|
+
* sem perguntar. Para quase tudo isso é certo: quem não programa não sabe
|
|
6
|
+
* responder "autoriza `npm install`?", e uma pergunta que ninguém sabe
|
|
7
|
+
* responder vira um "sim" automático. O problema é o resto — o `rm -rf ~`, o
|
|
8
|
+
* `git push --force`, o `curl … | sh`. Esses não se desfazem.
|
|
9
|
+
*
|
|
10
|
+
* Por isso a régua é estreita DE PROPÓSITO: perigoso é o que apaga, reescreve
|
|
11
|
+
* história ou sai da pasta do projeto. `rm -rf node_modules` dentro do projeto
|
|
12
|
+
* NÃO é perigoso — se fosse, o Primo perguntaria dez vezes por dia, e na
|
|
13
|
+
* décima primeira a pessoa diria sim sem ler. Falso positivo aqui é tão ruim
|
|
14
|
+
* quanto falso negativo: ele treina a pessoa a não ler a pergunta.
|
|
15
|
+
*
|
|
16
|
+
* Os três modos (/permissoes):
|
|
17
|
+
* auto — o padrão. Roda tudo, mas SEMPRE pergunta antes do perigoso.
|
|
18
|
+
* perguntar — pergunta antes de todo comando e de toda escrita de arquivo.
|
|
19
|
+
* livre — nunca pergunta. Nem o perigoso.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
'use strict';
|
|
23
|
+
|
|
24
|
+
const os = require('os');
|
|
25
|
+
const path = require('path');
|
|
26
|
+
|
|
27
|
+
const MODOS = ['auto', 'perguntar', 'livre'];
|
|
28
|
+
const COMANDOS = new Set(['run_shell', 'run_in_new_terminal']);
|
|
29
|
+
const ESCRITAS = new Set(['write_file', 'edit_file', 'multi_edit']);
|
|
30
|
+
|
|
31
|
+
function normalizarModo(m) {
|
|
32
|
+
const s = String(m || '').trim().toLowerCase();
|
|
33
|
+
const apelido = { ask: 'perguntar', suggest: 'perguntar', full: 'livre', 'full-auto': 'livre', yolo: 'livre' };
|
|
34
|
+
const n = apelido[s] || s;
|
|
35
|
+
return MODOS.includes(n) ? n : 'auto';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* Quebra o comando em trechos (separados por ; && || | e quebra de linha) e
|
|
39
|
+
cada trecho em palavras — respeitando aspas. Sem respeitar aspas,
|
|
40
|
+
`git commit -m "tira o rm -rf /"` viraria um trecho `rm -rf /` e o Primo
|
|
41
|
+
pararia para perguntar sobre uma mensagem de commit. */
|
|
42
|
+
function trechos(cmd) {
|
|
43
|
+
const saida = [];
|
|
44
|
+
let palavras = [], atual = '', aspa = null, temPalavra = false;
|
|
45
|
+
const fechaPalavra = () => { if (temPalavra) palavras.push(atual); atual = ''; temPalavra = false; };
|
|
46
|
+
const fechaTrecho = (sep) => { fechaPalavra(); if (palavras.length) saida.push({ palavras, sep }); palavras = []; };
|
|
47
|
+
const s = String(cmd || '');
|
|
48
|
+
for (let i = 0; i < s.length; i++) {
|
|
49
|
+
const ch = s[i];
|
|
50
|
+
if (aspa) {
|
|
51
|
+
if (ch === aspa) aspa = null;
|
|
52
|
+
else if (ch === '\\' && aspa === '"' && i + 1 < s.length) atual += s[++i];
|
|
53
|
+
else atual += ch;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
if (ch === '"' || ch === "'") { aspa = ch; temPalavra = true; continue; }
|
|
57
|
+
if (ch === '\\' && i + 1 < s.length) { atual += s[++i]; temPalavra = true; continue; }
|
|
58
|
+
if (ch === ';' || ch === '\n') { fechaTrecho(';'); continue; }
|
|
59
|
+
if (ch === '&' && s[i + 1] === '&') { fechaTrecho(';'); i++; continue; }
|
|
60
|
+
if (ch === '|' && s[i + 1] === '|') { fechaTrecho(';'); i++; continue; }
|
|
61
|
+
if (ch === '|') { fechaTrecho('|'); continue; }
|
|
62
|
+
if (ch === '&') { fechaTrecho(';'); continue; }
|
|
63
|
+
if (/\s/.test(ch)) { fechaPalavra(); continue; }
|
|
64
|
+
atual += ch; temPalavra = true;
|
|
65
|
+
}
|
|
66
|
+
fechaTrecho(';');
|
|
67
|
+
return saida;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const TEMPORARIAS = [...new Set(['/tmp', '/private/tmp', os.tmpdir()])];
|
|
71
|
+
|
|
72
|
+
function dentro(pai, filho) {
|
|
73
|
+
const r = path.relative(pai, filho);
|
|
74
|
+
return !!r && !r.startsWith('..') && !path.isAbsolute(r);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function expandir(alvo) {
|
|
78
|
+
const home = os.homedir();
|
|
79
|
+
return String(alvo).replace(/^~(?=\/|$)/, home).replace(/^\$\{?HOME\}?(?=\/|$)/, home);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** O alvo cai FORA do projeto (ou é o projeto inteiro, ou um curinga que o esvazia)? */
|
|
83
|
+
function alvoRuim(alvo, cwd, projeto, { recursivo, raizOk = false }) {
|
|
84
|
+
const a = String(alvo);
|
|
85
|
+
if (/^\.?\/?\*$|^\.\*$/.test(a)) return recursivo ? 'apaga tudo o que tem na pasta' : null;
|
|
86
|
+
const e = expandir(a);
|
|
87
|
+
// Variável que não é o HOME: não dá para saber aonde aponta, e "não sei"
|
|
88
|
+
// num rm é motivo de perguntar.
|
|
89
|
+
if (/\$/.test(e)) return 'apaga um caminho que depende de variável';
|
|
90
|
+
const alvoAbs = path.resolve(cwd, e.replace(/\/\*$/, ''));
|
|
91
|
+
const rel = path.relative(projeto, alvoAbs);
|
|
92
|
+
if (e === '/' || alvoAbs === path.parse(alvoAbs).root) return 'apaga a partir da raiz do computador';
|
|
93
|
+
if (alvoAbs === os.homedir()) return 'apaga a sua pasta pessoal inteira';
|
|
94
|
+
if (rel === '') return raizOk ? null : 'apaga a pasta do projeto inteira';
|
|
95
|
+
// A pasta temporária é descartável por definição: limpar lá não é perigo.
|
|
96
|
+
// (Mas nunca o que mora dentro da sua pasta pessoal.)
|
|
97
|
+
if (!dentro(os.homedir(), alvoAbs) && TEMPORARIAS.some((t) => dentro(t, alvoAbs))) return null;
|
|
98
|
+
if (rel.startsWith('..') || path.isAbsolute(rel)) return `apaga algo fora da pasta do projeto (${a})`;
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Palavras que vêm ANTES do comando de verdade e não mudam o que ele faz.
|
|
103
|
+
const PREFIXOS = new Set(['env', 'nohup', 'time', 'command', 'exec', 'nice', 'xargs']);
|
|
104
|
+
|
|
105
|
+
function analisarTrecho(palavras, estado) {
|
|
106
|
+
let p = palavras.slice();
|
|
107
|
+
// `VAR=x cmd`, `env -i cmd`, `xargs -0 rm`: pula até o comando.
|
|
108
|
+
while (p.length && (PREFIXOS.has(p[0]) || /^[A-Za-z_]\w*=/.test(p[0]) || (estado.pulandoFlags && /^-/.test(p[0])))) {
|
|
109
|
+
estado.pulandoFlags = PREFIXOS.has(p[0]) && p[0] !== 'command';
|
|
110
|
+
p.shift();
|
|
111
|
+
}
|
|
112
|
+
estado.pulandoFlags = false;
|
|
113
|
+
if (!p.length) return null;
|
|
114
|
+
const cmd = path.basename(p[0]);
|
|
115
|
+
const args = p.slice(1);
|
|
116
|
+
const flags = args.filter((x) => /^-/.test(x));
|
|
117
|
+
const alvos = args.filter((x) => !/^-/.test(x));
|
|
118
|
+
const tem = (re) => flags.some((f) => re.test(f));
|
|
119
|
+
|
|
120
|
+
if (cmd === 'sudo' || cmd === 'doas') return 'usa sudo: mexe como administrador no computador inteiro';
|
|
121
|
+
if (cmd === 'cd') { estado.cwd = path.resolve(estado.cwd, expandir(alvos[0] || os.homedir())); return null; }
|
|
122
|
+
if ((cmd === 'sh' || cmd === 'bash' || cmd === 'zsh') && args[0] === '-c' && args[1]) {
|
|
123
|
+
return analisarComando(args[1], estado.cwd, estado.projeto);
|
|
124
|
+
}
|
|
125
|
+
if (cmd === 'rm' || cmd === 'rmdir' || cmd === 'trash') {
|
|
126
|
+
const recursivo = cmd === 'rmdir' || tem(/^-[a-zA-Z]*[rR]|^--recursive$/);
|
|
127
|
+
for (const a of alvos) {
|
|
128
|
+
const r = alvoRuim(a, estado.cwd, estado.projeto, { recursivo });
|
|
129
|
+
if (r) return r;
|
|
130
|
+
}
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
if (cmd === 'find' && args.includes('-delete')) {
|
|
134
|
+
for (const a of alvos.slice(0, 1)) {
|
|
135
|
+
const r = alvoRuim(a, estado.cwd, estado.projeto, { recursivo: true, raizOk: true });
|
|
136
|
+
if (r) return r.replace(/^apaga/, 'apaga com find');
|
|
137
|
+
}
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
if (cmd === 'git') {
|
|
141
|
+
const sub = alvos[0];
|
|
142
|
+
if (sub === 'push' && (tem(/^--force$|^-[a-zA-Z]*f/) || alvos.some((a) => /^\+/.test(a)))) {
|
|
143
|
+
return 'git push --force: reescreve o histórico no GitHub, e o que estava lá some';
|
|
144
|
+
}
|
|
145
|
+
if (sub === 'reset' && flags.includes('--hard')) return 'git reset --hard: joga fora o que não foi salvo em commit';
|
|
146
|
+
if (sub === 'clean' && tem(/^-[a-zA-Z]*f/) && !tem(/^-[a-zA-Z]*n|^--dry-run$/)) {
|
|
147
|
+
return 'git clean: apaga arquivos que o git não guardou';
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
if (cmd === 'dd') return 'dd: escreve direto no disco';
|
|
152
|
+
if (/^mkfs(\.|$)/.test(cmd) || cmd === 'newfs' || cmd === 'fdisk') return 'formata um disco';
|
|
153
|
+
if (cmd === 'diskutil' && /^(erase|zero|secureErase|partitionDisk|reformat)/i.test(alvos[0] || '')) return 'diskutil: apaga um disco';
|
|
154
|
+
if ((cmd === 'chmod' || cmd === 'chown') && tem(/^-[a-zA-Z]*R/)) {
|
|
155
|
+
for (const a of alvos) {
|
|
156
|
+
const e = path.resolve(estado.cwd, expandir(a));
|
|
157
|
+
if (e === '/' || e === os.homedir()) return `${cmd} -R em ${a}: muda a permissão de tudo`;
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
if (cmd === 'kill' && args.includes('-1')) return 'kill -1: encerra todos os seus programas';
|
|
162
|
+
if (['shutdown', 'reboot', 'halt', 'poweroff'].includes(cmd)) return 'desliga ou reinicia o computador';
|
|
163
|
+
if (['npm', 'pnpm', 'yarn'].includes(cmd) && alvos[0] === 'publish' && !flags.includes('--dry-run')) return `${cmd} publish: publica o pacote para o mundo inteiro`;
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function analisarComando(comando, cwd, projeto) {
|
|
168
|
+
const s = String(comando || '');
|
|
169
|
+
// Baixar e rodar na hora: o que roda é o que o site mandar naquele segundo.
|
|
170
|
+
if (/\b(curl|wget)\b[^;&]*\|\s*(sudo\s+)?(env\s+)?(ba|z|da|k)?sh\b/.test(s)) {
|
|
171
|
+
return 'baixa um script da internet e roda sem ler';
|
|
172
|
+
}
|
|
173
|
+
const estado = { cwd, projeto, pulandoFlags: false };
|
|
174
|
+
for (const t of trechos(s)) {
|
|
175
|
+
const r = analisarTrecho(t.palavras, estado);
|
|
176
|
+
if (r) return r;
|
|
177
|
+
}
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Esta ação é perigosa?
|
|
183
|
+
* @returns {{perigoso: boolean, motivo: string}}
|
|
184
|
+
*/
|
|
185
|
+
function classificar(nome, args, { projectDir } = {}) {
|
|
186
|
+
const a = args || {};
|
|
187
|
+
const projeto = path.resolve(projectDir || process.cwd());
|
|
188
|
+
let motivo = null;
|
|
189
|
+
if (COMANDOS.has(nome)) {
|
|
190
|
+
const cwd = a.cwd ? path.resolve(projeto, expandir(a.cwd)) : projeto;
|
|
191
|
+
motivo = analisarComando(a.command, cwd, projeto);
|
|
192
|
+
} else if (ESCRITAS.has(nome) && a.path) {
|
|
193
|
+
const alvo = path.resolve(projeto, expandir(a.path));
|
|
194
|
+
const rel = path.relative(projeto, alvo);
|
|
195
|
+
if (rel.startsWith('..') || path.isAbsolute(rel) || /^[a-zA-Z]:[\\/]/.test(String(a.path))) {
|
|
196
|
+
motivo = `mexe num arquivo fora da pasta do projeto (${a.path})`;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return { perigoso: !!motivo, motivo: motivo || '' };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function novo() { return { liberados: new Set(), negados: new Set() }; }
|
|
203
|
+
|
|
204
|
+
/* Uma pergunta por vez. Subagentes rodam em paralelo (Promise.all) e dois
|
|
205
|
+
pedidos ao mesmo tempo no mesmo terminal se atropelariam. */
|
|
206
|
+
let fila = Promise.resolve();
|
|
207
|
+
function emFila(fn) { const p = fila.then(fn, fn); fila = p.catch(() => {}); return p; }
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* O portão. Devolve {ok:true} ou {ok:false, error, motivo}.
|
|
211
|
+
*
|
|
212
|
+
* `perguntar(frase, {tipo, motivo, primeira})` → 'agora' | 'sessao' | 'nao',
|
|
213
|
+
* o mesmo contrato do portão do desktop (lib/permissao.js).
|
|
214
|
+
*/
|
|
215
|
+
async function portao(estado, { modo, nome, args, projectDir, subagent = false, perguntar = null }) {
|
|
216
|
+
const m = normalizarModo(modo);
|
|
217
|
+
if (m === 'livre') return { ok: true };
|
|
218
|
+
const { perigoso, motivo: motivoPerigo } = classificar(nome, args, { projectDir });
|
|
219
|
+
const tipo = perigoso ? 'perigo' : (m === 'perguntar' && COMANDOS.has(nome)) ? 'comando'
|
|
220
|
+
: (m === 'perguntar' && ESCRITAS.has(nome)) ? 'arquivo' : null;
|
|
221
|
+
if (!tipo) return { ok: true };
|
|
222
|
+
|
|
223
|
+
const motivo = perigoso ? motivoPerigo
|
|
224
|
+
: tipo === 'comando' ? `rodar: ${String((args || {}).command || '').slice(0, 80)}`
|
|
225
|
+
: `escrever ${String((args || {}).path || 'um arquivo')}`;
|
|
226
|
+
const recusa = (texto) => ({ ok: false, motivo, error: texto });
|
|
227
|
+
|
|
228
|
+
// Escrever fora da pasta o tools.js já recusa sozinho: perguntar seria
|
|
229
|
+
// pedir um "sim" que não serve para nada.
|
|
230
|
+
if (perigoso && ESCRITAS.has(nome)) {
|
|
231
|
+
return recusa(`Recusado: ${motivo}. O PrimoCode só escreve dentro da pasta do projeto — use /dir se a pessoa quiser trabalhar em outra pasta.`);
|
|
232
|
+
}
|
|
233
|
+
if (subagent) {
|
|
234
|
+
return recusa(`Recusado: ${motivo}. Subagente não tem como pedir autorização — `
|
|
235
|
+
+ 'deixe esse passo para o agente principal e diga no seu resumo o que falta fazer.');
|
|
236
|
+
}
|
|
237
|
+
const chave = `${nome}:${JSON.stringify(args || {})}`;
|
|
238
|
+
const negado = `A pessoa não autorizou: ${motivo}. Siga por outro caminho ou pergunte.`;
|
|
239
|
+
if (estado.negados.has(chave)) return recusa(negado);
|
|
240
|
+
// "A sessão inteira" libera o TIPO de pergunta: no perigoso, aquele motivo
|
|
241
|
+
// (um push --force autorizado não autoriza um rm -rf ~); no modo
|
|
242
|
+
// perguntar, os comandos ou as escritas comuns.
|
|
243
|
+
const liberacao = perigoso ? `perigo:${motivo}` : tipo;
|
|
244
|
+
if (estado.liberados.has(liberacao)) return { ok: true };
|
|
245
|
+
if (typeof perguntar !== 'function') {
|
|
246
|
+
return recusa(`Recusado: ${motivo}. Isso precisa de autorização e não há ninguém para autorizar neste modo.`);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const resposta = await emFila(() => perguntar(motivo, { tipo, motivo, primeira: false }));
|
|
250
|
+
if (resposta === 'sessao') { estado.liberados.add(liberacao); return { ok: true }; }
|
|
251
|
+
if (resposta === 'agora') return { ok: true };
|
|
252
|
+
estado.negados.add(chave);
|
|
253
|
+
return recusa(negado);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
module.exports = { classificar, portao, novo, normalizarModo, trechos, MODOS };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "primocode",
|
|
3
|
-
"version": "9.8.0-beta.
|
|
3
|
+
"version": "9.8.0-beta.4",
|
|
4
4
|
"description": "PrimoCode — agente de engenharia com IA e cursor próprio. Requer conta Conecta Primo AI (Premium ou Super). Cria arquivos, roda comandos, controla navegador e desktop: abre apps, clica em botões e ícones pelo nome, digita e usa atalhos.",
|
|
5
5
|
"main": "bin/primocode.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"start": "node bin/primocode.js",
|
|
11
|
-
"test": "node test/tools.test.js && node test/ui.test.js && node test/entrada.test.js && node test/transparencia.test.js && node test/permissao.test.js && node test/compatibilidade.test.js && node test/skills.test.js && node test/estudio.test.js && node test/voz.test.js && node test/voz-conversa.test.js && node test/modo.test.js && node test/pasta.test.js && node test/projeto.test.js && node test/nome-projeto.test.js && node test/api-propria.test.js && node test/claude-engine.test.js && node test/codex.test.js && node test/conferir.test.js && node test/catalogo.test.js && node test/desktop.test.js && node test/seta.test.js && node test/effort.test.js && node test/regressao.test.js && node test/memoria-conversa.test.js && node test/repeticao.test.js && node test/autonomia.test.js && node test/referencia.test.js && node test/parar.test.js && node test/continuar.test.js && node test/pipeline.test.js && node test/app.test.js && node test/aplicativo.test.js && node test/conta.test.mjs && node test/nuvem.test.js && node test/prazo.test.js && node test/primeira-vez.test.js && node test/janela.test.js && node test/fala.test.js && node test/especialistas.test.js && node test/empurrao.test.js && node test/terminal-novo.test.js && node test/markdown.test.js && node test/coerencia.test.js"
|
|
11
|
+
"test": "node test/tools.test.js && node test/ui.test.js && node test/entrada.test.js && node test/transparencia.test.js && node test/permissao.test.js && node test/compatibilidade.test.js && node test/skills.test.js && node test/comandos.test.js && node test/estudio.test.js && node test/voz.test.js && node test/voz-conversa.test.js && node test/modo.test.js && node test/pasta.test.js && node test/projeto.test.js && node test/nome-projeto.test.js && node test/kits.test.js && node test/api-propria.test.js && node test/claude-engine.test.js && node test/codex.test.js && node test/conferir.test.js && node test/catalogo.test.js && node test/desktop.test.js && node test/seta.test.js && node test/effort.test.js && node test/regressao.test.js && node test/memoria-conversa.test.js && node test/repeticao.test.js && node test/autonomia.test.js && node test/desfazer.test.js && node test/referencia.test.js && node test/parar.test.js && node test/continuar.test.js && node test/pipeline.test.js && node test/app.test.js && node test/aplicativo.test.js && node test/conta.test.mjs && node test/nuvem.test.js && node test/prazo.test.js && node test/primeira-vez.test.js && node test/janela.test.js && node test/fala.test.js && node test/especialistas.test.js && node test/empurrao.test.js && node test/terminal-novo.test.js && node test/markdown.test.js && node test/coerencia.test.js && node test/contexto.test.js && node test/perigo.test.js"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=18.17.0"
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
"app/",
|
|
31
31
|
"studio/",
|
|
32
32
|
"skills/",
|
|
33
|
+
"kits/",
|
|
33
34
|
"voz/",
|
|
34
35
|
"README.md",
|
|
36
|
+
"comandos/",
|
|
35
37
|
"!**/__pycache__",
|
|
36
38
|
"!**/*.pyc",
|
|
37
39
|
"!**/*.pyo",
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
nome: Design de verdade
|
|
3
|
+
descricao: cada site com identidade própria, e não a cara de "feito por IA"
|
|
4
|
+
quando: landing, landing page, site, página, pagina, design, interface, tela, layout, visual, bonito, bonita, identidade, marca
|
|
5
|
+
autor: adaptado de "frontend-design" (Anthropic, anthropics/skills, Apache-2.0 — ver LICENSE.txt); resumido e traduzido pelo PrimoCode
|
|
6
|
+
---
|
|
7
|
+
Trabalhe como o diretor de arte de um estúdio conhecido por dar a cada cliente uma identidade que
|
|
8
|
+
ninguém confunde. O cliente já recusou propostas com cara de modelo pronto.
|
|
9
|
+
|
|
10
|
+
**Comece pelo assunto.** O ramo, os materiais e o vocabulário do negócio são de onde vem a escolha
|
|
11
|
+
visual. Um brinquedo para meninas de 8 anos e um painel de analista financeiro não se parecem em nada.
|
|
12
|
+
Use o conteúdo real do pedido em tudo, e não texto genérico.
|
|
13
|
+
|
|
14
|
+
**Planeje antes de escrever código**, em poucas linhas:
|
|
15
|
+
- cor: 4 a 6 cores com nome e hex;
|
|
16
|
+
- tipo: 1 ou 2 fontes escolhidas para ESTE negócio (não as de sempre), com papéis claros;
|
|
17
|
+
- layout: a ideia em uma frase, e se o conteúdo alinha à esquerda ou ao centro;
|
|
18
|
+
- o único elemento memorável da página.
|
|
19
|
+
Depois releia o plano. O que você faria igual para qualquer página parecida, troque, e diga o que trocou.
|
|
20
|
+
|
|
21
|
+
**As marcas de página gerada por IA.** Evite estas, a não ser que o pedido peça:
|
|
22
|
+
- fundo creme com serifa e destaque terracota; ou fundo quase preto com um único destaque neon;
|
|
23
|
+
- conteúdo picado em cards idênticos, com o mesmo arredondado e a mesma sombra em tudo;
|
|
24
|
+
- rótulo em CAIXA ALTA espaçada acima de todo título, e textos "A · B · C" com ponto no meio;
|
|
25
|
+
- uma única palavra do título em itálico ou em outra cor;
|
|
26
|
+
- números 01 / 02 / 03 quando o conteúdo não é uma sequência de verdade;
|
|
27
|
+
- a mesma entrada com fade subindo em toda seção, e hover em todo card;
|
|
28
|
+
- uma seta "→" em todo botão.
|
|
29
|
+
|
|
30
|
+
**Contenção.** Gaste a ousadia num lugar só: um elemento marcante, o resto calmo. Antes de entregar,
|
|
31
|
+
tire um enfeite. Movimento só num momento orquestrado (a abertura, por exemplo) ou em resposta a uma
|
|
32
|
+
ação da pessoa.
|
|
33
|
+
|
|
34
|
+
**Piso de qualidade, sem anunciar:** funciona no celular, foco de teclado visível, respeita "reduzir
|
|
35
|
+
movimento", contraste acessível, linhas de texto com menos de 80 caracteres.
|
|
36
|
+
|
|
37
|
+
**Texto é design.** Escreva do ponto de vista de quem usa, com palavras simples. O botão diz o que
|
|
38
|
+
acontece ("Agendar horário", e não "Enviar"). Específico vence esperto. Voz ativa, sem enrolação.
|
|
39
|
+
|
|
40
|
+
**Confira com os olhos:** abra a página, tire um print e critique o que viu antes de dizer que terminou.
|