Skip to content

Commit a6528aa

Browse files
authored
fix release github action (#53)
* Atualiza CLAUDE.md com novas features, comandos e estrutura * Ajusta pipeline para empacotar e publicar DevMaid.CLI no NuGet
1 parent 9a190bb commit a6528aa

3 files changed

Lines changed: 58 additions & 17 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ jobs:
2727
run: dotnet restore
2828

2929
- name: Build and create NuGet package
30-
run: dotnet publish -c Release
30+
run: dotnet pack DevMaid.CLI/DevMaid.CLI.csproj -c Release --no-restore
3131

3232
- name: Extract version
3333
id: version
3434
run: |
35-
$nupkg = Get-ChildItem bin/Release/*.nupkg | Select-Object -First 1
36-
$version = $nupkg.BaseName -replace 'DevMaid\.', ''
35+
$nupkg = Get-ChildItem DevMaid.CLI/bin/Release/*.nupkg | Select-Object -First 1
36+
$version = $nupkg.BaseName -replace '^DevMaid\.CLI\.', ''
3737
echo "version=$version" >> $env:GITHUB_OUTPUT
3838
shell: pwsh
3939

4040
- name: Publish to NuGet.org
41-
run: dotnet nuget push bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
41+
run: dotnet nuget push DevMaid.CLI/bin/Release/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
4242
env:
4343
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}
4444

CLAUDE.md

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DevMaid Development Guidelines
22

3-
Auto-generated from codebase. Last updated: 2026-04-04
3+
Auto-generated from codebase. Last updated: 2026-04-07
44

55
## Idioma
66

@@ -14,6 +14,7 @@ Exceção: não traduza nomes de skills, comandos do openspec (ex: `openspec-pro
1414
- System.CommandLine 2.0.5 — CLI argument parsing and subcommand routing
1515
- Npgsql 10.0.2 — PostgreSQL ADO.NET driver
1616
- CsvHelper 33.1.0 — CSV export for query results
17+
- Spectre.Console.Cli 0.55.0 — Interactive TUI prompts (selection menus, styled output)
1718
- Microsoft.Extensions.Hosting 10.0.5 — Generic host + DI container
1819
- Microsoft.Extensions.Configuration — JSON / env-var config pipeline
1920
- Microsoft.Extensions.Logging — Structured logging (wrapped by custom ILogger)
@@ -27,9 +28,10 @@ Exceção: não traduza nomes de skills, comandos do openspec (ex: `openspec-pro
2728
DevMaid/
2829
├── DevMaid.Core/ ← Business logic, interfaces, models (class library)
2930
│ ├── Interfaces/ ← IConfigurationService, IDatabaseService, IFileService,
30-
│ │ IProcessExecutor, IWingetService
31+
│ │ IProcessExecutor, IWingetService, IPgPassService
3132
│ ├── Models/ ← OperationResult<T>, DatabaseConnectionConfig,
32-
│ │ OperationProgress, WingetOperationOptions, etc.
33+
│ │ OperationProgress, WingetOperationOptions,
34+
│ │ PgPassEntry, PgPassResult, etc.
3335
│ ├── Services/ ← Concrete implementations of all interfaces
3436
│ │ └── ServiceCollectionExtensions.cs ← AddDevMaidServices() DI registration
3537
│ ├── Logging/ ← Custom ILogger + MicrosoftExtensionsLoggerAdapter
@@ -45,29 +47,41 @@ DevMaid/
4547
│ │ ├── OpenCodeCommand.cs
4648
│ │ ├── WingetCommand.cs
4749
│ │ ├── DatabaseCommand.cs
50+
│ │ ├── PgPassCommand.cs ← Subcomando de DatabaseCommand (pgpass add/list/remove)
51+
│ │ ├── DockerCommand.cs ← Docker utilities (postgres container)
4852
│ │ ├── QueryCommand.cs
4953
│ │ ├── CleanCommand.cs
5054
│ │ └── WindowsFeaturesCommand.cs
5155
│ ├── CommandOptions/ ← Strongly-typed options DTOs per command
52-
│ ├── Services/ ← Static facade wrappers (ConfigurationService, Logger, etc.)
53-
│ └── SecurityUtils.cs ← Input validation (path traversal, PostgreSQL identifiers)
56+
│ ├── Services/ ← Static facade wrappers (ConfigurationService, Logger,
57+
│ │ DockerService, DockerConstants, PostgresPasswordHandler)
58+
│ └── SecurityUtils.cs ← Input validation (path traversal, PostgreSQL identifiers,
59+
│ host/port, wildcard *)
5460
5561
├── DevMaid.Tests/ ← MSTest project (references DevMaid.CLI)
5662
│ └── Commands/ ← One test class per command
5763
5864
├── DevMaid.CodeAnalysis/ ← Standalone Roslyn analysis utility
5965
60-
├── specs/ ← Feature specs (speckit SDD workflow)
61-
│ ├── README.md ← Master index of all specs
62-
│ └── <NNN>-<slug>/ ← spec.md, plan.md, tasks.md per feature
66+
├── openspec/ ← OpenSpec workflow (substituiu specs/ e .specify/)
67+
│ ├── config.yaml ← Configuração do projeto (schema, idioma pt-BR)
68+
│ ├── specs/ ← Especificações canônicas por feature
69+
│ │ ├── pgpass-cli-setup/
70+
│ │ ├── pgpass-wildcard-validation/
71+
│ │ ├── docker-postgres/
72+
│ │ └── opencode-default-model/
73+
│ └── changes/
74+
│ └── archive/ ← Changes implementados e arquivados
75+
76+
├── .opencode/
77+
│ ├── skills/ ← Skills OpenSpec (openspec-propose, openspec-apply-change, etc.)
78+
│ └── command/ ← Slash commands customizados
6379
6480
├── docs/
6581
│ ├── pt-BR/ ← Primary documentation (Portuguese, source of truth)
6682
│ └── en/ ← Secondary documentation (English)
6783
68-
└── .specify/
69-
├── memory/constitution.md ← Project constitution (governing principles)
70-
└── templates/ ← speckit templates (spec, plan, tasks, agent)
84+
└── opencode.json ← Configuração local do OpenCode (modelo padrão, etc.)
7185
```
7286

7387
## Commands
@@ -101,6 +115,10 @@ devmaid --help
101115
devmaid database backup <dbname> [--host] [--port] [--username] [--password] [--output]
102116
devmaid database restore <dbname> --input <file> [connection options]
103117
devmaid database backup --all [connection options]
118+
devmaid database pgpass add <banco> [--host] [--port] [--username] [--password]
119+
devmaid database pgpass list
120+
devmaid database pgpass remove <banco> [--host] [--port] [--username]
121+
devmaid docker postgres
104122
devmaid table-parser -d <db> -t <table> -H <host> -u <user>
105123
devmaid file combine -i "<glob>" -o <output>
106124
devmaid query run -f <sql-file> -d <db> [--all] [--servers]
@@ -111,6 +129,7 @@ devmaid claude install
111129
devmaid claude settings mcp-database
112130
devmaid claude settings win-env
113131
devmaid opencode settings mcp-database
132+
devmaid opencode settings default-model [model-id] [--global]
114133
devmaid windowsfeatures export -o <file>
115134
devmaid windowsfeatures import -i <file>
116135
devmaid windowsfeatures list
@@ -127,7 +146,7 @@ devmaid windowsfeatures list
127146
- **External processes**: Always `UseShellExecute = false`, capture stdout/stderr via redirect — never shell out to `cmd.exe` or `powershell.exe`
128147
- **Test naming**: `<MethodName>_<StateUnderTest>_<ExpectedBehavior>` (e.g., `BackupAsync_ComOpcoesValidas_DeveCriarArquivoDump`)
129148
- **XML doc comments**: Required on all public members (enforced by `GenerateDocumentationFile true`)
130-
- **Configuration**: Read from `%LocalAppData%\DevMaid\appsettings.json`; never hard-code connection strings; use `SecurityUtils.IsValidPath()` and `SecurityUtils.IsValidPostgreSQLIdentifier()` before using any user-supplied input
149+
- **Configuration**: Read from `%LocalAppData%\DevMaid\appsettings.json`; never hard-code connection strings; use `SecurityUtils.IsValidPath()` and `SecurityUtils.IsValidPostgreSQLIdentifier()` before using any user-supplied input; `SecurityUtils.IsValidHost()` and `SecurityUtils.IsValidPort()` para conexões; `*` é aceito como curinga em host/port/username no pgpass
131150
- **Async**: All service methods that touch I/O or external processes must be `async Task<T>` and accept `CancellationToken`
132151
- **Progress reporting**: Use `IProgress<OperationProgress>` for operations expected to take > 2s
133152
- **Logging**: Use `ILogger` from `DevMaid.Core/Logging/ILogger.cs` — not `Microsoft.Extensions.Logging.ILogger` directly in Core
@@ -140,8 +159,31 @@ devmaid windowsfeatures list
140159
- All inputs validated before use: paths via `SecurityUtils.IsValidPath()`, PostgreSQL identifiers via `SecurityUtils.IsValidPostgreSQLIdentifier()`.
141160
- Exit codes: `0` success, `1` general error, `2` invalid args, `3` external dependency not found, `130` user cancellation.
142161

162+
## OpenSpec Workflow
163+
164+
O projeto usa o workflow **OpenSpec** para gerenciar features e mudanças:
165+
166+
- **`openspec/config.yaml`** — schema e configurações (idioma pt-BR obrigatório em todos os artefatos)
167+
- **`openspec/specs/<slug>/spec.md`** — especificações canônicas por feature (substituiu `specs/`)
168+
- **`openspec/changes/`** — mudanças em andamento (proposal, design, tasks)
169+
- **`openspec/changes/archive/`** — mudanças implementadas e arquivadas
170+
171+
Skills disponíveis em `.opencode/skills/`:
172+
- `openspec-propose` — cria proposta completa com todos os artefatos
173+
- `openspec-apply-change` — implementa tasks de uma mudança
174+
- `openspec-continue-change` — avança para o próximo artefato
175+
- `openspec-ff-change` — cria todos os artefatos de uma vez
176+
- `openspec-verify-change` — valida implementação antes de arquivar
177+
- `openspec-archive-change` — arquiva mudança concluída
178+
- `openspec-sync-specs` — sincroniza delta specs com specs principais
179+
- `openspec-explore` — modo de exploração / pensamento colaborativo
180+
143181
## Recent Changes
144182

183+
- docker-postgres (2026-04-05): Added `DockerCommand``docker postgres` inicia/cria container PostgreSQL local via Docker
184+
- pgpass-wildcard-fields (2026-04-04): `SecurityUtils.IsValidHost/Port/Username` aceitam `*` como curinga; `database pgpass add/list/remove` suportam wildcard
185+
- pgpass-cli-setup (2026-04-04): Added `PgPassCommand` — gerenciamento de `pgpass.conf` com subcomandos `add`, `list`, `remove`; `IPgPassService` + `PgPassService`
186+
- opencode-default-model (2026-04-07): Added `opencode settings default-model` — define modelo padrão via argumento ou menu interativo (Spectre.Console); suporte a `--global`
145187
- 009-windows-features-manager: Added `WindowsFeaturesCommand` — dism.exe wrapper for export/import/list of Windows optional features
146188
- 008-project-cleaner: Added `CleanCommand` — recursive `bin/` and `obj/` directory deletion
147189
- 007-sql-query-csv-export: Added `QueryCommand` — SQL file execution with CSV export, multi-server support

DevMaid.CLI/Commands/OpenCodeCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using System.Diagnostics;
44
using System.Text.Json;
55
using System.Text.Json.Nodes;
6-
76
using Spectre.Console;
87

98
namespace DevMaid.CLI.Commands;

0 commit comments

Comments
 (0)