claudiao 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +387 -0
  2. package/dist/commands/create.d.ts +2 -0
  3. package/dist/commands/create.js +260 -0
  4. package/dist/commands/doctor.d.ts +1 -0
  5. package/dist/commands/doctor.js +138 -0
  6. package/dist/commands/init.d.ts +3 -0
  7. package/dist/commands/init.js +252 -0
  8. package/dist/commands/install-plugin.d.ts +1 -0
  9. package/dist/commands/install-plugin.js +35 -0
  10. package/dist/commands/list.d.ts +3 -0
  11. package/dist/commands/list.js +123 -0
  12. package/dist/commands/remove.d.ts +6 -0
  13. package/dist/commands/remove.js +121 -0
  14. package/dist/commands/update.d.ts +4 -0
  15. package/dist/commands/update.js +141 -0
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +156 -0
  18. package/dist/lib/__tests__/frontmatter.test.d.ts +1 -0
  19. package/dist/lib/__tests__/frontmatter.test.js +180 -0
  20. package/dist/lib/__tests__/paths.test.d.ts +1 -0
  21. package/dist/lib/__tests__/paths.test.js +29 -0
  22. package/dist/lib/__tests__/symlinks.test.d.ts +1 -0
  23. package/dist/lib/__tests__/symlinks.test.js +142 -0
  24. package/dist/lib/format.d.ts +13 -0
  25. package/dist/lib/format.js +47 -0
  26. package/dist/lib/frontmatter.d.ts +9 -0
  27. package/dist/lib/frontmatter.js +45 -0
  28. package/dist/lib/paths.d.ts +33 -0
  29. package/dist/lib/paths.js +111 -0
  30. package/dist/lib/plugins.d.ts +3 -0
  31. package/dist/lib/plugins.js +24 -0
  32. package/dist/lib/symlinks.d.ts +8 -0
  33. package/dist/lib/symlinks.js +56 -0
  34. package/dist/lib/templates.d.ts +26 -0
  35. package/dist/lib/templates.js +75 -0
  36. package/dist/types.d.ts +25 -0
  37. package/dist/types.js +1 -0
  38. package/package.json +47 -0
  39. package/templates/CLAUDE-CODE-BEST-PRACTICES.md +508 -0
  40. package/templates/CLOUD-CLI-GUIDE.md +405 -0
  41. package/templates/agents/architect.md +128 -0
  42. package/templates/agents/aws-specialist.md +104 -0
  43. package/templates/agents/azure-specialist.md +117 -0
  44. package/templates/agents/database-specialist.md +104 -0
  45. package/templates/agents/dod-specialist.md +101 -0
  46. package/templates/agents/gcp-specialist.md +124 -0
  47. package/templates/agents/idea-refiner.md +146 -0
  48. package/templates/agents/implementation-planner.md +149 -0
  49. package/templates/agents/nodejs-specialist.md +105 -0
  50. package/templates/agents/pr-reviewer.md +132 -0
  51. package/templates/agents/product-owner.md +88 -0
  52. package/templates/agents/project-manager.md +95 -0
  53. package/templates/agents/prompt-engineer.md +115 -0
  54. package/templates/agents/python-specialist.md +103 -0
  55. package/templates/agents/react-specialist.md +94 -0
  56. package/templates/agents/security-specialist.md +145 -0
  57. package/templates/agents/test-specialist.md +157 -0
  58. package/templates/agents/uxui-specialist.md +102 -0
  59. package/templates/global-CLAUDE.md +100 -0
  60. package/templates/skills/architecture-decision/SKILL.md +102 -0
  61. package/templates/skills/meet-dod/SKILL.md +124 -0
  62. package/templates/skills/pm-templates/SKILL.md +125 -0
  63. package/templates/skills/pr-template/SKILL.md +87 -0
  64. package/templates/skills/product-templates/SKILL.md +97 -0
  65. package/templates/skills/python-patterns/SKILL.md +123 -0
  66. package/templates/skills/security-checklist/SKILL.md +80 -0
  67. package/templates/skills/sql-templates/SKILL.md +93 -0
  68. package/templates/skills/ui-review-checklist/SKILL.md +73 -0
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: python-patterns
3
+ description: Patterns e boilerplates Python prontos — Repository Pattern, Settings, FastAPI estruturado, pytest fixtures. Use quando iniciar módulos ou precisar de referência.
4
+ allowed-tools: Read, Write, Edit, Grep, Glob, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ # Python Patterns
9
+
10
+ Patterns e boilerplates Python prontos para uso.
11
+
12
+ ## Quando ativar
13
+
14
+ Ative quando o usuário estiver:
15
+ - Criando novo módulo/serviço Python
16
+ - Configurando projeto FastAPI ou Django
17
+ - Implementando Repository Pattern com SQLAlchemy
18
+ - Criando fixtures de teste com pytest
19
+ - Configurando settings com Pydantic
20
+
21
+ ## Patterns
22
+
23
+ ### Repository Pattern (SQLAlchemy 2.0 + async)
24
+
25
+ ```python
26
+ from sqlalchemy import select
27
+ from sqlalchemy.ext.asyncio import AsyncSession
28
+
29
+ class BaseRepository[T]:
30
+ def __init__(self, session: AsyncSession, model: type[T]) -> None:
31
+ self._session = session
32
+ self._model = model
33
+
34
+ async def get_by_id(self, id: int) -> T | None:
35
+ stmt = select(self._model).where(self._model.id == id)
36
+ result = await self._session.execute(stmt)
37
+ return result.scalar_one_or_none()
38
+
39
+ async def list_all(self, *, offset: int = 0, limit: int = 100) -> list[T]:
40
+ stmt = select(self._model).offset(offset).limit(limit)
41
+ result = await self._session.execute(stmt)
42
+ return list(result.scalars().all())
43
+
44
+ async def create(self, entity: T) -> T:
45
+ self._session.add(entity)
46
+ await self._session.flush()
47
+ return entity
48
+ ```
49
+
50
+ ### Pydantic Settings
51
+
52
+ ```python
53
+ from pydantic_settings import BaseSettings, SettingsConfigDict
54
+
55
+ class Settings(BaseSettings):
56
+ model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
57
+
58
+ # App
59
+ app_name: str = "my-service"
60
+ debug: bool = False
61
+ log_level: str = "INFO"
62
+
63
+ # Database
64
+ database_url: str
65
+ db_pool_size: int = 5
66
+ db_max_overflow: int = 10
67
+
68
+ # Redis
69
+ redis_url: str = "redis://localhost:6379"
70
+
71
+ # Auth
72
+ jwt_secret: str
73
+ jwt_expiration_minutes: int = 60
74
+
75
+ settings = Settings()
76
+ ```
77
+
78
+ ### FastAPI App Structure
79
+
80
+ ```python
81
+ # app/main.py
82
+ from contextlib import asynccontextmanager
83
+ from fastapi import FastAPI
84
+
85
+ @asynccontextmanager
86
+ async def lifespan(app: FastAPI):
87
+ # startup
88
+ yield
89
+ # shutdown
90
+
91
+ app = FastAPI(title="My Service", lifespan=lifespan)
92
+
93
+ # app/api/deps.py
94
+ from typing import Annotated
95
+ from fastapi import Depends
96
+ from sqlalchemy.ext.asyncio import AsyncSession
97
+
98
+ async def get_session() -> AsyncSession:
99
+ async with async_session_maker() as session:
100
+ yield session
101
+
102
+ SessionDep = Annotated[AsyncSession, Depends(get_session)]
103
+ ```
104
+
105
+ ### Pytest Fixtures
106
+
107
+ ```python
108
+ # conftest.py
109
+ import pytest
110
+ from httpx import ASGITransport, AsyncClient
111
+
112
+ @pytest.fixture
113
+ async def client(app):
114
+ transport = ASGITransport(app=app)
115
+ async with AsyncClient(transport=transport, base_url="http://test") as ac:
116
+ yield ac
117
+
118
+ @pytest.fixture
119
+ async def db_session(engine):
120
+ async with async_session_maker(bind=engine) as session:
121
+ yield session
122
+ await session.rollback()
123
+ ```
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: security-checklist
3
+ description: Checklist de segurança pré-deploy — OWASP Top 10, headers, auth, secrets, dependências. Use antes de deploy ou review de segurança.
4
+ allowed-tools: Read, Write, Edit, Grep, Glob, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ # Security Checklist
9
+
10
+ Checklist de segurança para validar antes de deploy ou em review de segurança.
11
+
12
+ ## Quando ativar
13
+
14
+ Ative quando o usuário estiver:
15
+ - Preparando deploy para produção
16
+ - Fazendo review de segurança
17
+ - Auditando um módulo ou API
18
+ - Pedindo checklist de segurança
19
+
20
+ ## Checklist: Pré-Deploy
21
+
22
+ ### Autenticação e Autorização
23
+ - [ ] Endpoints protegidos com auth (JWT, session, API key)
24
+ - [ ] Autorização por role/permission verificada no backend (não só no frontend)
25
+ - [ ] Tokens com expiração adequada (access: 15min, refresh: 7d)
26
+ - [ ] Rate limiting em endpoints de login/register/forgot-password
27
+ - [ ] Logout invalida token/session no backend
28
+
29
+ ### Input Validation
30
+ - [ ] Todos inputs validados no backend (Zod, class-validator, Pydantic)
31
+ - [ ] Queries parametrizadas (sem string concatenation)
32
+ - [ ] File upload: validação de tipo, tamanho e nome
33
+ - [ ] Sanitização de HTML/markdown (se renderizado)
34
+
35
+ ### Secrets e Configuração
36
+ - [ ] Sem secrets no código (API keys, passwords, tokens)
37
+ - [ ] `.env` no `.gitignore`
38
+ - [ ] Secrets em secrets manager (AWS SSM, Azure Key Vault, GCP Secret Manager)
39
+ - [ ] Variáveis de ambiente diferentes por ambiente (dev/staging/prod)
40
+
41
+ ### Headers e CORS
42
+ - [ ] CORS restrito aos domínios necessários (não `*` em APIs autenticadas)
43
+ - [ ] `Content-Security-Policy` configurado
44
+ - [ ] `X-Content-Type-Options: nosniff`
45
+ - [ ] `Strict-Transport-Security` (HSTS)
46
+ - [ ] `X-Frame-Options: DENY` (ou CSP frame-ancestors)
47
+
48
+ ### Dependências
49
+ - [ ] `npm audit` / `pip audit` sem vulnerabilidades críticas
50
+ - [ ] Lockfile commitado (package-lock.json, yarn.lock)
51
+ - [ ] Dependências com versões fixas (não `^` ou `*` em produção)
52
+
53
+ ### Database
54
+ - [ ] Migrations reversíveis
55
+ - [ ] Sem dados sensíveis em plaintext (passwords hashed com bcrypt/argon2)
56
+ - [ ] Backups configurados e testados
57
+ - [ ] Conexão via SSL
58
+
59
+ ### Logging e Monitoring
60
+ - [ ] Sem PII em logs (email, CPF, cartão, senhas)
61
+ - [ ] Audit trail para ações críticas (login, pagamento, delete)
62
+ - [ ] Alertas configurados para erros 5xx e latência
63
+ - [ ] Error tracking (Sentry, Bugsnag)
64
+
65
+ ### Infra
66
+ - [ ] HTTPS obrigatório (redirect HTTP → HTTPS)
67
+ - [ ] Firewall/security groups restritivos
68
+ - [ ] Containers rodando como non-root
69
+ - [ ] Imagens Docker com base slim e sem ferramentas de debug
70
+
71
+ ## Comando rápido de auditoria
72
+
73
+ ```bash
74
+ # Node.js
75
+ npm audit --production
76
+ npx eslint --config .eslintrc.js --rule '{"no-eval": "error"}' src/
77
+
78
+ # Buscar secrets no código
79
+ grep -rn "password\|secret\|api_key\|token" --include="*.ts" --include="*.js" src/ | grep -v node_modules | grep -v ".test."
80
+ ```
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: sql-templates
3
+ description: Templates SQL prontos para diagnóstico de performance, migrations zero-downtime, e operações comuns em PostgreSQL
4
+ allowed-tools: Read, Grep, Glob, Bash, Write, Edit
5
+ model: sonnet
6
+ ---
7
+
8
+ # SQL Templates
9
+
10
+ Templates SQL prontos para uso em diagnóstico e operações de banco PostgreSQL.
11
+
12
+ ## Quando ativar
13
+
14
+ Ative quando o usuário estiver:
15
+ - Investigando query lenta ou problema de performance
16
+ - Criando migration que altera tabelas em produção
17
+ - Precisando de templates para operações comuns de banco
18
+
19
+ ## Templates
20
+
21
+ ### Diagnóstico de Query Lenta
22
+
23
+ ```sql
24
+ -- 1. Analise o plano de execução
25
+ EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) SELECT ...;
26
+
27
+ -- 2. Verifique estatísticas da tabela
28
+ SELECT schemaname, relname, seq_scan, idx_scan, n_live_tup, n_dead_tup
29
+ FROM pg_stat_user_tables WHERE relname = 'sua_tabela';
30
+
31
+ -- 3. Liste indexes existentes
32
+ SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'sua_tabela';
33
+
34
+ -- 4. Queries mais lentas (requer pg_stat_statements)
35
+ SELECT query, calls, mean_exec_time, total_exec_time
36
+ FROM pg_stat_statements ORDER BY mean_exec_time DESC LIMIT 20;
37
+
38
+ -- 5. Locks ativos
39
+ SELECT pid, usename, query, state, wait_event_type, wait_event
40
+ FROM pg_stat_activity WHERE state != 'idle' ORDER BY query_start;
41
+ ```
42
+
43
+ ### Migration Zero-Downtime (Expand-Contract)
44
+
45
+ ```sql
46
+ -- EXPAND: Adicione coluna sem NOT NULL (não trava tabela)
47
+ ALTER TABLE users ADD COLUMN email_normalized VARCHAR(255);
48
+
49
+ -- MIGRATE: Backfill em batches (evita lock longo)
50
+ UPDATE users SET email_normalized = LOWER(TRIM(email))
51
+ WHERE id BETWEEN $start AND $end;
52
+
53
+ -- VALIDATE: Verifique consistência
54
+ SELECT COUNT(*) FROM users WHERE email_normalized IS NULL;
55
+
56
+ -- CONTRACT: Aplique constraints (após backfill completo)
57
+ ALTER TABLE users ALTER COLUMN email_normalized SET NOT NULL;
58
+ ```
59
+
60
+ ### Criação Segura de Index
61
+
62
+ ```sql
63
+ -- SEMPRE use CONCURRENTLY em produção (não bloqueia writes)
64
+ CREATE INDEX CONCURRENTLY idx_users_email ON users (email);
65
+
66
+ -- Verifique se o index foi criado com sucesso (CONCURRENTLY pode falhar silenciosamente)
67
+ SELECT indexname, indexdef FROM pg_indexes
68
+ WHERE tablename = 'users' AND indexname = 'idx_users_email';
69
+
70
+ -- Se falhou, drope o index inválido e tente novamente
71
+ DROP INDEX CONCURRENTLY IF EXISTS idx_users_email;
72
+ ```
73
+
74
+ ### Health Check Rápido
75
+
76
+ ```sql
77
+ -- Tabelas maiores (espaço em disco)
78
+ SELECT relname, pg_size_pretty(pg_total_relation_size(relid))
79
+ FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC LIMIT 10;
80
+
81
+ -- Bloat de tabelas (dead tuples acumulados)
82
+ SELECT relname, n_dead_tup, n_live_tup,
83
+ ROUND(n_dead_tup::numeric / GREATEST(n_live_tup, 1) * 100, 2) AS dead_pct
84
+ FROM pg_stat_user_tables WHERE n_dead_tup > 1000 ORDER BY n_dead_tup DESC;
85
+
86
+ -- Conexões ativas
87
+ SELECT state, COUNT(*) FROM pg_stat_activity GROUP BY state;
88
+
89
+ -- Cache hit ratio (deve ser > 99%)
90
+ SELECT ROUND(
91
+ SUM(heap_blks_hit) / GREATEST(SUM(heap_blks_hit) + SUM(heap_blks_read), 1) * 100, 2
92
+ ) AS cache_hit_ratio FROM pg_statio_user_tables;
93
+ ```
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: ui-review-checklist
3
+ description: Checklist completo para revisão de UI — hierarquia visual, acessibilidade, responsividade, estados interativos. Use antes de PR de frontend.
4
+ allowed-tools: Read, Grep, Glob, Bash, Edit
5
+ model: sonnet
6
+ ---
7
+
8
+ # UI Review Checklist
9
+
10
+ Checklist estruturado para revisão de interfaces antes de merge/deploy.
11
+
12
+ ## Quando ativar
13
+
14
+ Ative quando o usuário estiver:
15
+ - Revisando PR de frontend
16
+ - Fazendo QA visual de componentes
17
+ - Auditando acessibilidade
18
+ - Verificando responsividade
19
+
20
+ ## Checklist
21
+
22
+ ### Hierarquia Visual
23
+ - [ ] Hierarquia clara (títulos, subtítulos, corpo)
24
+ - [ ] Espaçamento consistente (múltiplos de 4px ou 8px)
25
+ - [ ] Tipografia com no máximo 2-3 tamanhos por tela
26
+ - [ ] Alinhamento consistente (grid/flexbox)
27
+
28
+ ### Cores e Contraste
29
+ - [ ] Contraste texto/fundo passa WCAG AA (4.5:1 para texto, 3:1 para UI)
30
+ - [ ] Usa design tokens (sem cores hardcoded)
31
+ - [ ] Dark mode funciona (se aplicável)
32
+ - [ ] Informação não depende apenas de cor (use ícones/texto também)
33
+
34
+ ### Estados Interativos
35
+ - [ ] Hover em elementos clicáveis
36
+ - [ ] Focus ring visível para navegação por teclado
37
+ - [ ] Active/pressed state
38
+ - [ ] Disabled state (visual + funcional)
39
+ - [ ] Loading state em botões durante requests
40
+ - [ ] Cursor correto (pointer, not-allowed, etc.)
41
+
42
+ ### Estados de Conteúdo
43
+ - [ ] Loading (skeleton screens > spinners)
44
+ - [ ] Empty state (mensagem + CTA)
45
+ - [ ] Error state (mensagem clara + ação de recuperação)
46
+ - [ ] Success state (feedback de confirmação)
47
+
48
+ ### Responsividade
49
+ - [ ] Mobile (320px) — sem scroll horizontal
50
+ - [ ] Tablet (768px)
51
+ - [ ] Desktop (1024px+)
52
+ - [ ] Touch targets mínimo 44x44px em mobile
53
+
54
+ ### Acessibilidade
55
+ - [ ] Semântica HTML correta (button, nav, main, article)
56
+ - [ ] ARIA labels em elementos interativos
57
+ - [ ] Alt text em imagens
58
+ - [ ] Navegação completa por teclado (Tab, Enter, Escape)
59
+ - [ ] Screen reader faz sentido (teste com VoiceOver/NVDA)
60
+ - [ ] `prefers-reduced-motion` respeitado em animações
61
+
62
+ ### Forms
63
+ - [ ] Labels associados a inputs
64
+ - [ ] Validação inline (não apenas on submit)
65
+ - [ ] Mensagens de erro específicas (não "campo inválido")
66
+ - [ ] Autocomplete attributes corretos
67
+ - [ ] Tab order lógico
68
+
69
+ ### Performance Visual
70
+ - [ ] Imagens otimizadas (WebP/AVIF, lazy loading)
71
+ - [ ] Fonts com `font-display: swap`
72
+ - [ ] Nenhum layout shift visível (CLS)
73
+ - [ ] Transições suaves (não abrutas)