@girardelli/architect 2.1.0 → 4.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.
- package/README.md +105 -116
- package/__test_agent_output__/INDEX.md +1 -0
- package/__test_agent_output__/agents/AGENT-ORCHESTRATOR.md +1 -0
- package/__test_agent_output__/agents/DATABASE-ENGINEER.md +174 -0
- package/__test_agent_output__/agents/QA-TEST-ENGINEER.md +138 -0
- package/__test_agent_output__/agents/SECURITY-AUDITOR.md +106 -0
- package/__test_agent_output__/agents/TECH-DEBT-CONTROLLER.md +104 -0
- package/__test_agent_output__/agents/TYPESCRIPT-BACKEND-DEVELOPER.md +135 -0
- package/__test_agent_output__/guards/CODE-REVIEW-CHECKLIST.md +95 -0
- package/__test_agent_output__/guards/PREFLIGHT.md +200 -0
- package/__test_agent_output__/guards/QUALITY-GATES.md +1 -0
- package/__test_agent_output__/rules/00-general.md +229 -0
- package/__test_agent_output__/rules/01-architecture.md +191 -0
- package/__test_agent_output__/rules/02-security.md +402 -0
- package/__test_agent_output__/rules/03-nestjs.md +124 -0
- package/__test_agent_output__/templates/ADR.md +95 -0
- package/__test_agent_output__/templates/BDD.md +58 -0
- package/__test_agent_output__/templates/C4.md +68 -0
- package/__test_agent_output__/templates/TDD.md +86 -0
- package/__test_agent_output__/templates/THREAT-MODEL.md +82 -0
- package/__test_agent_output__/workflows/fix-bug.md +228 -0
- package/__test_agent_output__/workflows/new-feature.md +311 -0
- package/__test_agent_output__/workflows/review.md +95 -0
- package/__test_context_7RvUrO/src/modules/empty/empty.ts +0 -0
- package/__test_context_Rf5fNJ/src/modules/mixed/mixed.ts +5 -0
- package/__test_context_WRCnYH/src/modules/test/test.ts +10 -0
- package/__test_context_YsnVS3/src/modules/test/test.ts +10 -0
- package/__test_context_w7XZeH/src/modules/mixed/mixed.ts +5 -0
- package/__test_context_y5noh6/src/modules/empty/empty.ts +0 -0
- package/__test_framework__24OjAu/package.json +1 -0
- package/__test_framework__3ZDZsx/pyproject.toml +8 -0
- package/__test_framework__4T54Jn/package.json +1 -0
- package/__test_framework__4tlXu9/pyproject.toml +8 -0
- package/__test_framework__6boWqQ/Pipfile +6 -0
- package/__test_framework__6gygMU/pom.xml +10 -0
- package/__test_framework__6kxj0N/go.mod +8 -0
- package/__test_framework__7CEoXw/pom.xml +10 -0
- package/__test_framework__85DDz0/Pipfile +6 -0
- package/__test_framework__9WrRIr/pom.xml +7 -0
- package/__test_framework__ANqGKl/Gemfile +5 -0
- package/__test_framework__BCXTEM/go.mod +3 -0
- package/__test_framework__BHiPNq/setup.py +2 -0
- package/__test_framework__BqkiKv/package.json +1 -0
- package/__test_framework__C5yd8X/Pipfile.lock +1 -0
- package/__test_framework__C5yd8X/requirements.txt +1 -0
- package/__test_framework__C87d3a/manage.py +1 -0
- package/__test_framework__C87d3a/requirements.txt +2 -0
- package/__test_framework__DXNwc5/build.gradle +7 -0
- package/__test_framework__GhHSt3/build.gradle.kts +4 -0
- package/__test_framework__GzklJP/Cargo.toml +7 -0
- package/__test_framework__H4hd13/go.mod +8 -0
- package/__test_framework__HKjOXO/composer.json +1 -0
- package/__test_framework__HaDN45/Gemfile +3 -0
- package/__test_framework__IBO7YG/pyproject.toml +9 -0
- package/__test_framework__JwSOyF/pyproject.toml +6 -0
- package/__test_framework__K6HrCr/build.gradle +2 -0
- package/__test_framework__KzRPlh/pubspec.yaml +9 -0
- package/__test_framework__L6uIym/pyproject.toml +6 -0
- package/__test_framework__LOdoGK/requirements.txt +4 -0
- package/__test_framework__LgHzss/package.json +1 -0
- package/__test_framework__M76M6q/Gemfile +5 -0
- package/__test_framework__Mr9vWW/composer.json +1 -0
- package/__test_framework__N03Gnv/package.json +1 -0
- package/__test_framework__Num4UE/requirements +1 -0
- package/__test_framework__OAGw3Y/build.gradle +7 -0
- package/__test_framework__OQc8yG/pubspec.yaml +9 -0
- package/__test_framework__OwKZcd/requirements.txt +3 -0
- package/__test_framework__P0gFv7/requirements +1 -0
- package/__test_framework__PN55Rq/package.json +1 -0
- package/__test_framework__PQiqX8/pubspec.yaml +3 -0
- package/__test_framework__RBHsg7/composer.json +1 -0
- package/__test_framework__RHxif4/Cargo.toml +7 -0
- package/__test_framework__T0v0p1/Cargo.toml +4 -0
- package/__test_framework__Tu0clt/Pipfile.lock +1 -0
- package/__test_framework__Tu0clt/requirements.txt +1 -0
- package/__test_framework__TwDj9P/Cargo.toml +4 -0
- package/__test_framework__VQJNC4/pom.xml +7 -0
- package/__test_framework__W6sm05/package.json +1 -0
- package/__test_framework__W7vBLy/pyproject.toml +4 -0
- package/__test_framework__WNJOWT/setup.py +2 -0
- package/__test_framework__WSJs7U/package.json +1 -0
- package/__test_framework__YQ5VpA/build.gradle.kts +4 -0
- package/__test_framework__ZNEUEs/package.json +1 -0
- package/__test_framework__Znt922/pom.xml +7 -0
- package/__test_framework__azyg0h/pom.xml +7 -0
- package/__test_framework__c6otLr/package.json +1 -0
- package/__test_framework__cl9S9G/build.gradle +2 -0
- package/__test_framework__eilvV4/composer.json +1 -0
- package/__test_framework__gQZxXO/manage.py +1 -0
- package/__test_framework__gQZxXO/requirements.txt +2 -0
- package/__test_framework__ghvl26/poetry.lock +1 -0
- package/__test_framework__ghvl26/pyproject.toml +2 -0
- package/__test_framework__hR7b9U/Makefile +11 -0
- package/__test_framework__iESVsi/composer.json +1 -0
- package/__test_framework__jm6TJy/package.json +1 -0
- package/__test_framework__kBUpjs/pyproject.toml +9 -0
- package/__test_framework__kqoZrw/requirements.txt +4 -0
- package/__test_framework__lWkoyO/pyproject.toml +4 -0
- package/__test_framework__mTKnUO/package.json +1 -0
- package/__test_framework__nCeZwe/Makefile +11 -0
- package/__test_framework__oljsU0/package.json +1 -0
- package/__test_framework__osRG4q/go.mod +3 -0
- package/__test_framework__pCHH4F/package.json +1 -0
- package/__test_framework__pExx6E/Gemfile +3 -0
- package/__test_framework__pyBoGd/pyproject.toml +5 -0
- package/__test_framework__qw16VQ/package.json +1 -0
- package/__test_framework__rRayrG/package.json +1 -0
- package/__test_framework__s82zO5/package.json +1 -0
- package/__test_framework__tp8MFK/pyproject.toml +5 -0
- package/__test_framework__w44k4w/composer.json +1 -0
- package/__test_framework__yefPZY/poetry.lock +1 -0
- package/__test_framework__yefPZY/pyproject.toml +2 -0
- package/__test_framework__zCiyDT/requirements.txt +3 -0
- package/__test_framework__zGZN3j/pubspec.yaml +3 -0
- package/__test_framework__zXpnxL/package.json +1 -0
- package/architect-run.sh +431 -0
- package/assets/banner-v3.html +561 -0
- package/dist/agent-generator/context-enricher.d.ts +58 -0
- package/dist/agent-generator/context-enricher.d.ts.map +1 -0
- package/dist/agent-generator/context-enricher.js +581 -0
- package/dist/agent-generator/context-enricher.js.map +1 -0
- package/dist/agent-generator/domain-inferrer.d.ts +52 -0
- package/dist/agent-generator/domain-inferrer.d.ts.map +1 -0
- package/dist/agent-generator/domain-inferrer.js +575 -0
- package/dist/agent-generator/domain-inferrer.js.map +1 -0
- package/dist/agent-generator/framework-detector.d.ts +40 -0
- package/dist/agent-generator/framework-detector.d.ts.map +1 -0
- package/dist/agent-generator/framework-detector.js +611 -0
- package/dist/agent-generator/framework-detector.js.map +1 -0
- package/dist/agent-generator/index.d.ts +33 -0
- package/dist/agent-generator/index.d.ts.map +1 -0
- package/dist/agent-generator/index.js +477 -0
- package/dist/agent-generator/index.js.map +1 -0
- package/dist/agent-generator/stack-detector.d.ts +12 -0
- package/dist/agent-generator/stack-detector.d.ts.map +1 -0
- package/dist/agent-generator/stack-detector.js +128 -0
- package/dist/agent-generator/stack-detector.js.map +1 -0
- package/dist/agent-generator/templates/core/agents.d.ts +17 -0
- package/dist/agent-generator/templates/core/agents.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/agents.js +1252 -0
- package/dist/agent-generator/templates/core/agents.js.map +1 -0
- package/dist/agent-generator/templates/core/architecture-rules.d.ts +7 -0
- package/dist/agent-generator/templates/core/architecture-rules.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/architecture-rules.js +274 -0
- package/dist/agent-generator/templates/core/architecture-rules.js.map +1 -0
- package/dist/agent-generator/templates/core/general-rules.d.ts +8 -0
- package/dist/agent-generator/templates/core/general-rules.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/general-rules.js +301 -0
- package/dist/agent-generator/templates/core/general-rules.js.map +1 -0
- package/dist/agent-generator/templates/core/index-md.d.ts +7 -0
- package/dist/agent-generator/templates/core/index-md.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/index-md.js +246 -0
- package/dist/agent-generator/templates/core/index-md.js.map +1 -0
- package/dist/agent-generator/templates/core/orchestrator.d.ts +8 -0
- package/dist/agent-generator/templates/core/orchestrator.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/orchestrator.js +422 -0
- package/dist/agent-generator/templates/core/orchestrator.js.map +1 -0
- package/dist/agent-generator/templates/core/preflight.d.ts +8 -0
- package/dist/agent-generator/templates/core/preflight.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/preflight.js +213 -0
- package/dist/agent-generator/templates/core/preflight.js.map +1 -0
- package/dist/agent-generator/templates/core/quality-gates.d.ts +11 -0
- package/dist/agent-generator/templates/core/quality-gates.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/quality-gates.js +254 -0
- package/dist/agent-generator/templates/core/quality-gates.js.map +1 -0
- package/dist/agent-generator/templates/core/security-rules.d.ts +7 -0
- package/dist/agent-generator/templates/core/security-rules.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/security-rules.js +528 -0
- package/dist/agent-generator/templates/core/security-rules.js.map +1 -0
- package/dist/agent-generator/templates/core/skills-generator.d.ts +6 -0
- package/dist/agent-generator/templates/core/skills-generator.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/skills-generator.js +207 -0
- package/dist/agent-generator/templates/core/skills-generator.js.map +1 -0
- package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts +7 -0
- package/dist/agent-generator/templates/core/workflow-fix-bug.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/workflow-fix-bug.js +237 -0
- package/dist/agent-generator/templates/core/workflow-fix-bug.js.map +1 -0
- package/dist/agent-generator/templates/core/workflow-new-feature.d.ts +8 -0
- package/dist/agent-generator/templates/core/workflow-new-feature.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/workflow-new-feature.js +321 -0
- package/dist/agent-generator/templates/core/workflow-new-feature.js.map +1 -0
- package/dist/agent-generator/templates/core/workflow-review.d.ts +7 -0
- package/dist/agent-generator/templates/core/workflow-review.d.ts.map +1 -0
- package/dist/agent-generator/templates/core/workflow-review.js +104 -0
- package/dist/agent-generator/templates/core/workflow-review.js.map +1 -0
- package/dist/agent-generator/templates/domain/index.d.ts +22 -0
- package/dist/agent-generator/templates/domain/index.d.ts.map +1 -0
- package/dist/agent-generator/templates/domain/index.js +1176 -0
- package/dist/agent-generator/templates/domain/index.js.map +1 -0
- package/dist/agent-generator/templates/stack/index.d.ts +8 -0
- package/dist/agent-generator/templates/stack/index.d.ts.map +1 -0
- package/dist/agent-generator/templates/stack/index.js +695 -0
- package/dist/agent-generator/templates/stack/index.js.map +1 -0
- package/dist/agent-generator/templates/template-helpers.d.ts +75 -0
- package/dist/agent-generator/templates/template-helpers.d.ts.map +1 -0
- package/dist/agent-generator/templates/template-helpers.js +726 -0
- package/dist/agent-generator/templates/template-helpers.js.map +1 -0
- package/dist/agent-generator/types.d.ts +196 -0
- package/dist/agent-generator/types.d.ts.map +1 -0
- package/dist/agent-generator/types.js +27 -0
- package/dist/agent-generator/types.js.map +1 -0
- package/dist/analyzer.d.ts +5 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +35 -4
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzers/forecast.d.ts +85 -0
- package/dist/analyzers/forecast.d.ts.map +1 -0
- package/dist/analyzers/forecast.js +337 -0
- package/dist/analyzers/forecast.js.map +1 -0
- package/dist/analyzers/git-cache.d.ts +7 -0
- package/dist/analyzers/git-cache.d.ts.map +1 -0
- package/dist/analyzers/git-cache.js +41 -0
- package/dist/analyzers/git-cache.js.map +1 -0
- package/dist/analyzers/git-history.d.ts +113 -0
- package/dist/analyzers/git-history.d.ts.map +1 -0
- package/dist/analyzers/git-history.js +333 -0
- package/dist/analyzers/git-history.js.map +1 -0
- package/dist/analyzers/index.d.ts +10 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +7 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/analyzers/temporal-scorer.d.ts +72 -0
- package/dist/analyzers/temporal-scorer.d.ts.map +1 -0
- package/dist/analyzers/temporal-scorer.js +140 -0
- package/dist/analyzers/temporal-scorer.js.map +1 -0
- package/dist/cli.d.ts +2 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +287 -82
- package/dist/cli.js.map +1 -1
- package/dist/html-reporter.d.ts +3 -1
- package/dist/html-reporter.d.ts.map +1 -1
- package/dist/html-reporter.js +594 -100
- package/dist/html-reporter.js.map +1 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -4
- package/dist/index.js.map +1 -1
- package/dist/project-summarizer.d.ts +18 -0
- package/dist/project-summarizer.d.ts.map +1 -0
- package/dist/project-summarizer.js +306 -0
- package/dist/project-summarizer.js.map +1 -0
- package/dist/refactor-reporter.js +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -3
- package/src/agent-generator/context-enricher.ts +643 -0
- package/src/agent-generator/domain-inferrer.ts +625 -0
- package/src/agent-generator/framework-detector.ts +669 -0
- package/src/agent-generator/index.ts +555 -0
- package/src/agent-generator/stack-detector.ts +103 -0
- package/src/agent-generator/templates/core/agents.ts +1293 -0
- package/src/agent-generator/templates/core/architecture-rules.ts +287 -0
- package/src/agent-generator/templates/core/general-rules.ts +306 -0
- package/src/agent-generator/templates/core/index-md.ts +260 -0
- package/src/agent-generator/templates/core/orchestrator.ts +459 -0
- package/src/agent-generator/templates/core/preflight.ts +215 -0
- package/src/agent-generator/templates/core/quality-gates.ts +256 -0
- package/src/agent-generator/templates/core/security-rules.ts +543 -0
- package/src/agent-generator/templates/core/skills-generator.ts +236 -0
- package/src/agent-generator/templates/core/workflow-fix-bug.ts +239 -0
- package/src/agent-generator/templates/core/workflow-new-feature.ts +323 -0
- package/src/agent-generator/templates/core/workflow-review.ts +106 -0
- package/src/agent-generator/templates/domain/index.ts +1201 -0
- package/src/agent-generator/templates/stack/index.ts +705 -0
- package/src/agent-generator/templates/template-helpers.ts +776 -0
- package/src/agent-generator/types.ts +232 -0
- package/src/analyzer.ts +38 -4
- package/src/analyzers/forecast.ts +496 -0
- package/src/analyzers/git-cache.ts +52 -0
- package/src/analyzers/git-history.ts +488 -0
- package/src/analyzers/index.ts +33 -0
- package/src/analyzers/temporal-scorer.ts +227 -0
- package/src/cli.ts +336 -83
- package/src/html-reporter.ts +616 -108
- package/src/index.ts +92 -9
- package/src/project-summarizer.ts +347 -0
- package/src/refactor-reporter.ts +1 -1
- package/src/types.ts +10 -0
- package/tests/agent-generator.test.ts +411 -0
- package/tests/analyzers-integration.test.ts +174 -0
- package/tests/architect-adapter-enrichment.test.ts +9 -0
- package/tests/context-enricher.test.ts +971 -0
- package/tests/forecast.test.ts +509 -0
- package/tests/framework-detector.test.ts +1172 -0
- package/tests/git-history.test.ts +254 -0
- package/tests/scanner.test.ts +7 -8
- package/tests/scorer.test.ts +588 -0
- package/tests/stack-detector.test.ts +241 -0
- package/tests/template-generation.test.ts +706 -0
- package/tests/template-helpers.test.ts +1152 -0
- package/tests/temporal-scorer.test.ts +307 -0
- package/dist/agent-generator.d.ts +0 -95
- package/dist/agent-generator.d.ts.map +0 -1
- package/dist/agent-generator.js +0 -1295
- package/dist/agent-generator.js.map +0 -1
- package/src/agent-generator.ts +0 -1401
package/README.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
# Architect
|
|
2
2
|
|
|
3
|
-
**AI-powered architecture analysis, refactoring, and agent system generator**
|
|
3
|
+
**AI-powered architecture analysis, refactoring, and context-aware agent system generator**
|
|
4
4
|
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
7
|
[](https://www.npmjs.com/package/@girardelli/architect)
|
|
8
|
+
[]()
|
|
8
9
|
[](LICENSE)
|
|
9
10
|
|
|
10
|
-
Understand your codebase architecture in seconds. Detect anti-patterns, get refactoring plans, and generate AI agent configurations — all from a single command.
|
|
11
|
+
Understand your codebase architecture in seconds. Detect anti-patterns, get refactoring plans, and generate **context-aware AI agent configurations** that actually understand your stack, domain, and toolchain — all from a single command.
|
|
11
12
|
|
|
12
|
-
## What's New in
|
|
13
|
+
## What's New in v3.1
|
|
13
14
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
15
|
+
- **Context-Aware Agent Generation** — Agents are no longer generic. Templates adapt to your detected stack (Python/FastAPI generates pytest examples, not Jest; Go generates `go test`, not `npm test`)
|
|
16
|
+
- **Framework Detection Engine** — 61 frameworks across 10+ ecosystems detected from dependency files (package.json, pyproject.toml, requirements.txt, pubspec.yaml, go.mod, Cargo.toml, pom.xml, Gemfile, composer.json)
|
|
17
|
+
- **Domain Inference** — Detects business domain (fintech, healthtech, e-commerce, tax, HR, etc.) from project metadata, README, and code structure. Generates domain-specific BDD scenarios, threat models, and compliance requirements (LGPD, PCI-DSS, HIPAA, SOX)
|
|
18
|
+
- **Stack-Aware Templates** — C4 Level 4 code blocks, TDD test examples, ADR decisions, quality gates, and forbidden actions all adapt to the detected language and framework
|
|
19
|
+
- **Skills Generator** — Detects architectural patterns in your codebase (adapters, factories, extractors, repositories) and generates `skills/PROJECT-PATTERNS.md`
|
|
20
|
+
- **Enriched Context** — Module extraction, endpoint detection, toolchain commands, project structure analysis, and critical path identification feed into every generated template
|
|
21
|
+
- **Premium HTML Report** — Dark-themed responsive report with interactive D3.js dependency graph, health radar, bubble charts, and collapsible refactoring steps
|
|
19
22
|
|
|
20
23
|
## Quick Start
|
|
21
24
|
|
|
@@ -28,81 +31,92 @@ npm install -g @girardelli/architect
|
|
|
28
31
|
architect analyze ./src
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
## Features
|
|
32
|
-
|
|
33
|
-
### 📊 Architecture Analysis
|
|
34
|
-
- **Quality Score** — 0-100 score with weighted breakdown (Modularity, Coupling, Cohesion, Layering)
|
|
35
|
-
- **Anti-Pattern Detection** — God Class, Circular Dependencies, Leaky Abstractions, Feature Envy, Shotgun Surgery
|
|
36
|
-
- **Layer Detection** — Automatically identifies API, Service, Data, UI, and Infrastructure layers
|
|
37
|
-
- **Dependency Graph** — Interactive D3.js force-directed graph visualization
|
|
38
|
-
- **Framework Detection** — NestJS, React, Angular, Vue, Next.js, Express, Django, Flask, Spring Boot, and more
|
|
39
|
-
- **Multi-Language** — TypeScript, JavaScript, Python, Java, Go, Ruby, PHP, Rust, SQL
|
|
40
|
-
|
|
41
|
-
### 🔧 Refactoring Plan
|
|
42
|
-
- **Tier 1 (Quick Wins)** — Low-risk improvements for immediate impact
|
|
43
|
-
- **Tier 2 (Strategic)** — Larger refactoring with architecture-level benefits
|
|
44
|
-
- **Score Impact** — Before/after predictions for each refactoring step
|
|
45
|
-
- **File Operations** — CREATE, MOVE, MODIFY, DELETE with detailed descriptions
|
|
46
|
-
|
|
47
|
-
### 🤖 AI Agent System
|
|
48
|
-
- **Stack Detection** — Identifies languages, frameworks, backend/frontend/mobile/database
|
|
49
|
-
- **Agent Suggestions** — Orchestrator, Backend Developer, Frontend Developer, Database Engineer, Security Auditor, QA, Tech Debt Controller
|
|
50
|
-
- **Rules & Guards** — Architecture rules, security rules, preflight checks, quality gates
|
|
51
|
-
- **Workflows** — Development, bug-fix, code review workflows
|
|
52
|
-
- **Skills** — [skills.sh](https://skills.sh) recommendations mapped to your stack (TDD, debugging, security, performance, etc.)
|
|
53
|
-
- **Audit Mode** — If `.agent/` exists, audits and suggests improvements
|
|
54
|
-
- **Interactive UI** — Toggle cards for selecting which items to generate
|
|
55
|
-
- **Command Builder** — Dynamic CLI command updates based on selection
|
|
56
|
-
|
|
57
|
-
### 📄 Premium HTML Report
|
|
58
|
-
- Dark-themed responsive design with Inter font
|
|
59
|
-
- Animated score gauge with gradient
|
|
60
|
-
- Interactive D3.js dependency graph
|
|
61
|
-
- Bubble chart for anti-pattern severity
|
|
62
|
-
- Collapsible refactoring steps with code previews
|
|
63
|
-
- Toggle cards for agent system selection
|
|
64
|
-
- Single self-contained HTML file (no external dependencies)
|
|
34
|
+
## Core Features
|
|
65
35
|
|
|
66
|
-
|
|
36
|
+
### Architecture Analysis
|
|
67
37
|
|
|
68
|
-
|
|
69
|
-
**The unified command** — runs architecture analysis, refactoring plan, and agent suggestions.
|
|
38
|
+
Architect scans your codebase and produces a quality score (0-100) with weighted breakdown across four dimensions: Modularity, Coupling, Cohesion, and Layering. It detects anti-patterns (God Class, Circular Dependencies, Leaky Abstractions, Feature Envy, Shotgun Surgery) with severity levels and specific file locations, and automatically identifies architectural layers (API, Service, Data, UI, Infrastructure).
|
|
70
39
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
40
|
+
The analysis supports TypeScript, JavaScript, Python, Java, Kotlin, Go, Ruby, PHP, Rust, Dart, and SQL. Framework detection covers 61 frameworks across all major ecosystems — from NestJS and React to FastAPI, Spring Boot, Flutter, Gin, Actix Web, and Rails.
|
|
41
|
+
|
|
42
|
+
### Refactoring Plan
|
|
74
43
|
|
|
75
|
-
|
|
76
|
-
architect analyze ./src --output docs/report.html
|
|
44
|
+
Each analysis produces a tiered refactoring plan with score impact predictions. Tier 1 contains quick wins (low-risk, immediate impact), Tier 2 covers strategic refactoring with architecture-level benefits. Every step includes before/after score predictions and specific file operations (CREATE, MOVE, MODIFY, DELETE).
|
|
77
45
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
46
|
+
### Context-Aware Agent System
|
|
47
|
+
|
|
48
|
+
This is what sets Architect apart. The `.agent/` directory it generates isn't a generic template — it's deeply customized to your project.
|
|
49
|
+
|
|
50
|
+
**What gets generated (20+ files):**
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
.agent/
|
|
54
|
+
├── INDEX.md # Project overview with badges and links
|
|
55
|
+
├── agents/
|
|
56
|
+
│ ├── AGENT-ORCHESTRATOR.md # 5-phase protocol, dispatch table, quality gates
|
|
57
|
+
│ ├── {STACK}-BACKEND-DEVELOPER.md # Stack-specific backend agent
|
|
58
|
+
│ ├── {FRAMEWORK}-FRONTEND-DEVELOPER.md
|
|
59
|
+
│ ├── FLUTTER-UI-DEVELOPER.md # (if mobile detected)
|
|
60
|
+
│ ├── DATABASE-ENGINEER.md # (if database detected)
|
|
61
|
+
│ ├── SECURITY-AUDITOR.md # STRIDE threats, compliance, integrations
|
|
62
|
+
│ ├── QA-TEST-ENGINEER.md # Coverage tracking, test scenarios
|
|
63
|
+
│ └── TECH-DEBT-CONTROLLER.md # Score targets, anti-pattern tracking
|
|
64
|
+
├── rules/
|
|
65
|
+
│ ├── 00-general.md # Golden rules, naming, forbidden actions (stack-aware)
|
|
66
|
+
│ ├── 01-architecture.md # Anti-pattern prevention, module structure
|
|
67
|
+
│ ├── 02-security.md # OWASP, secrets, input validation
|
|
68
|
+
│ └── {stack}-rules.md # Stack-specific rules (Python, TypeScript, etc.)
|
|
69
|
+
├── guards/
|
|
70
|
+
│ ├── PREFLIGHT.md # Pre-action checklist with detected toolchain
|
|
71
|
+
│ ├── QUALITY-GATES.md # Build/test/coverage/score gates
|
|
72
|
+
│ └── CODE-REVIEW-CHECKLIST.md # Domain-specific review items
|
|
73
|
+
├── workflows/
|
|
74
|
+
│ ├── new-feature.md # Feature development workflow
|
|
75
|
+
│ ├── fix-bug.md # Bug fix workflow
|
|
76
|
+
│ └── review.md # Code review workflow
|
|
77
|
+
├── templates/
|
|
78
|
+
│ ├── C4.md # Architecture template (framework-aware Level 4)
|
|
79
|
+
│ ├── BDD.md # BDD scenarios (domain-aware)
|
|
80
|
+
│ ├── TDD.md # TDD examples (pytest/junit/go_test/jest per stack)
|
|
81
|
+
│ ├── ADR.md # Decision records (stack-aware context)
|
|
82
|
+
│ └── THREAT-MODEL.md # STRIDE model (domain-specific threats)
|
|
83
|
+
└── skills/
|
|
84
|
+
└── PROJECT-PATTERNS.md # Detected patterns (adapters, factories, etc.)
|
|
81
85
|
```
|
|
82
86
|
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
**What makes it context-aware:**
|
|
88
|
+
|
|
89
|
+
A Python/FastAPI project gets pytest examples in TDD, `class ABC` interfaces in C4, SQLAlchemy references in ADR, `type: ignore` in forbidden actions, and `pytest` in quality gates. A TypeScript/NestJS project gets Jest, `interface`, TypeORM/Prisma, `@ts-ignore`, and `npm run build`. A Go project gets `go test`, `type ... interface`, GORM, `interface{}` warnings, and `go build`. The same command produces fundamentally different output based on what it detects.
|
|
90
|
+
|
|
91
|
+
**Domain inference feeds into every template.** A fintech project gets PCI-DSS compliance gates, fraud-prevention BDD scenarios, and encryption-focused threat models. A healthtech project gets HIPAA checks and patient data protection rules. Domain confidence is boosted by reading pyproject.toml descriptions, README keywords, and project names.
|
|
92
|
+
|
|
93
|
+
## CLI Commands
|
|
94
|
+
|
|
95
|
+
### `architect analyze [path]`
|
|
96
|
+
The unified command — architecture analysis, refactoring plan, and agent suggestions in one report.
|
|
85
97
|
|
|
86
98
|
```bash
|
|
87
|
-
architect
|
|
99
|
+
architect analyze ./src # HTML report (default)
|
|
100
|
+
architect analyze ./src --output docs/report.html # Custom path
|
|
101
|
+
architect analyze ./src --format json # JSON output
|
|
102
|
+
architect analyze ./src --format markdown # Markdown output
|
|
88
103
|
```
|
|
89
104
|
|
|
90
105
|
### `architect agents [path]`
|
|
91
106
|
Generate or audit the `.agent/` directory for AI coding assistants.
|
|
92
107
|
|
|
93
108
|
```bash
|
|
94
|
-
# Generate agent
|
|
95
|
-
architect agents ./
|
|
96
|
-
|
|
97
|
-
# With specific selections
|
|
98
|
-
architect agents ./ --agents ORCHESTRATOR,QA-TEST-ENGINEER --rules 00-general,01-architecture
|
|
109
|
+
architect agents ./ # Generate full .agent/
|
|
110
|
+
architect agents ./ --agents ORCHESTRATOR,QA # Specific agents only
|
|
99
111
|
```
|
|
100
112
|
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
If `.agent/` already exists, Architect audits it and only generates missing files.
|
|
114
|
+
|
|
115
|
+
### `architect refactor [path]`
|
|
116
|
+
Generate a standalone refactoring plan.
|
|
103
117
|
|
|
104
118
|
### `architect score [path]`
|
|
105
|
-
Calculate architecture quality score.
|
|
119
|
+
Calculate architecture quality score (quick mode).
|
|
106
120
|
|
|
107
121
|
### `architect anti-patterns [path]`
|
|
108
122
|
Detect anti-patterns with severity levels.
|
|
@@ -110,32 +124,8 @@ Detect anti-patterns with severity levels.
|
|
|
110
124
|
### `architect layers [path]`
|
|
111
125
|
Analyze layer structure and distribution.
|
|
112
126
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
🏗️ Architect — Architecture Analysis
|
|
117
|
-
📂 Path: /path/to/project/src
|
|
118
|
-
📋 Command: analyze
|
|
119
|
-
📄 Format: html
|
|
120
|
-
|
|
121
|
-
✅ HTML report saved to: architect-report.html
|
|
122
|
-
📊 Score: 82/100
|
|
123
|
-
⚠️ Anti-patterns: 1
|
|
124
|
-
🔧 Refactoring steps: 2
|
|
125
|
-
🤖 Suggested agents: 6
|
|
126
|
-
|
|
127
|
-
═══════════════════════════════════════
|
|
128
|
-
SCORE: 82/100
|
|
129
|
-
═══════════════════════════════════════
|
|
130
|
-
├─ Modularity: 95
|
|
131
|
-
├─ Coupling: 50
|
|
132
|
-
├─ Cohesion: 95
|
|
133
|
-
└─ Layering: 85
|
|
134
|
-
|
|
135
|
-
📁 Files: 12 | 📝 Lines: 1,521
|
|
136
|
-
⚠️ Anti-patterns: 1
|
|
137
|
-
🤖 Agents: 6 suggested | No .agent/ found
|
|
138
|
-
```
|
|
127
|
+
### `architect diagram [path]`
|
|
128
|
+
Generate architecture diagram in Mermaid format.
|
|
139
129
|
|
|
140
130
|
## Configuration
|
|
141
131
|
|
|
@@ -143,7 +133,7 @@ Create `.architect.json` in your project root:
|
|
|
143
133
|
|
|
144
134
|
```json
|
|
145
135
|
{
|
|
146
|
-
"ignore": ["node_modules", "dist", ".git", "coverage"],
|
|
136
|
+
"ignore": ["node_modules", "dist", ".git", "coverage", "__pycache__", ".venv"],
|
|
147
137
|
"frameworks": { "detect": true },
|
|
148
138
|
"antiPatterns": {
|
|
149
139
|
"godClass": { "linesThreshold": 500, "methodsThreshold": 10 },
|
|
@@ -158,6 +148,22 @@ Create `.architect.json` in your project root:
|
|
|
158
148
|
}
|
|
159
149
|
```
|
|
160
150
|
|
|
151
|
+
## Supported Frameworks (61)
|
|
152
|
+
|
|
153
|
+
| Ecosystem | Frameworks |
|
|
154
|
+
|-----------|-----------|
|
|
155
|
+
| **Node.js/TypeScript** | NestJS, Express, Fastify, Koa, Hapi, Next.js, Nuxt |
|
|
156
|
+
| **Python** | FastAPI, Django, Flask, Starlette, Sanic, Litestar, aiohttp, Tornado, DRF |
|
|
157
|
+
| **Java/Kotlin** | Spring Boot, Quarkus, Micronaut, Ktor |
|
|
158
|
+
| **Go** | Gin, Echo, Fiber, Chi, Gorilla Mux |
|
|
159
|
+
| **Rust** | Actix Web, Axum, Rocket |
|
|
160
|
+
| **Ruby** | Ruby on Rails, Sinatra |
|
|
161
|
+
| **PHP** | Laravel, Symfony, Slim |
|
|
162
|
+
| **Dart/Flutter** | Flutter, Shelf, Dart Frog |
|
|
163
|
+
| **ORM/Database** | TypeORM, Prisma, Sequelize, Mongoose, Knex, Drizzle, SQLAlchemy, SQLModel, Tortoise ORM, Peewee |
|
|
164
|
+
| **Testing** | Jest, Vitest, Mocha, pytest, unittest, Hypothesis, RSpec |
|
|
165
|
+
| **Tooling** | ESLint, Prettier, Biome, Ruff, Black, Flake8, Pylint, mypy |
|
|
166
|
+
|
|
161
167
|
## CI/CD Integration
|
|
162
168
|
|
|
163
169
|
### GitHub Actions
|
|
@@ -191,7 +197,7 @@ npm install -D @girardelli/architect
|
|
|
191
197
|
{
|
|
192
198
|
"scripts": {
|
|
193
199
|
"architect": "architect analyze ./src --output docs/architect-report.html",
|
|
194
|
-
"architect:
|
|
200
|
+
"architect:score": "architect score ./src"
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
203
|
```
|
|
@@ -209,41 +215,28 @@ const report = await architect.analyze('./src');
|
|
|
209
215
|
// Refactoring plan
|
|
210
216
|
const plan = architect.refactor(report, './src');
|
|
211
217
|
|
|
212
|
-
// Agent suggestions (dry-run
|
|
218
|
+
// Agent suggestions (dry-run)
|
|
213
219
|
const agents = architect.suggestAgents('./');
|
|
214
220
|
|
|
215
|
-
// Generate
|
|
221
|
+
// Generate HTML report
|
|
216
222
|
const htmlGenerator = new HtmlReportGenerator();
|
|
217
223
|
const html = htmlGenerator.generateHtml(report, plan, agents);
|
|
218
224
|
```
|
|
219
225
|
|
|
220
|
-
## Supported Frameworks
|
|
221
|
-
|
|
222
|
-
| Framework | Detection Method |
|
|
223
|
-
|-----------|-----------------|
|
|
224
|
-
| NestJS | `@nestjs/core` in dependencies |
|
|
225
|
-
| React | `react` in dependencies |
|
|
226
|
-
| Angular | `@angular/core` in dependencies |
|
|
227
|
-
| Vue.js | `vue` in dependencies |
|
|
228
|
-
| Next.js | `next` in dependencies |
|
|
229
|
-
| Express.js | `express` in dependencies |
|
|
230
|
-
| TypeORM | `typeorm` in dependencies |
|
|
231
|
-
| Prisma | `@prisma/client` in dependencies |
|
|
232
|
-
| Spring Boot | `spring-boot` in pom.xml |
|
|
233
|
-
| Django | `django` in requirements.txt |
|
|
234
|
-
| Flask | `flask` in requirements.txt |
|
|
235
|
-
| Flutter | `flutter` in pubspec.yaml |
|
|
236
|
-
|
|
237
226
|
## Development
|
|
238
227
|
|
|
239
228
|
```bash
|
|
240
229
|
npm install
|
|
241
230
|
npm run build # Compile TypeScript
|
|
242
231
|
npm run dev # Watch mode
|
|
243
|
-
npm test # Run tests
|
|
232
|
+
npm test # Run tests (337 tests, 9 suites)
|
|
244
233
|
npm run lint # ESLint
|
|
245
234
|
```
|
|
246
235
|
|
|
236
|
+
## Roadmap
|
|
237
|
+
|
|
238
|
+
- **v4.0** — Agent Runtime: orchestrated execution with I/O contracts, pipeline engine, and human approval gates
|
|
239
|
+
|
|
247
240
|
## Author
|
|
248
241
|
|
|
249
242
|
**Camilo Girardelli**
|
|
@@ -262,7 +255,3 @@ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for gui
|
|
|
262
255
|
MIT License - Copyright (c) 2026 Camilo Girardelli / Girardelli Tecnologia
|
|
263
256
|
|
|
264
257
|
See [LICENSE](LICENSE) for details.
|
|
265
|
-
|
|
266
|
-
---
|
|
267
|
-
|
|
268
|
-
**Architect** — Architecture analysis, refactoring plans, and AI agent generation for every developer.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Index
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Existing Orchestrator
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
antigravity:
|
|
3
|
+
trigger: 'on_demand'
|
|
4
|
+
description: 'Database Engineer — Schema, migrations, performance'
|
|
5
|
+
agent_card:
|
|
6
|
+
id: 'database-engineer'
|
|
7
|
+
name: 'Database Engineer'
|
|
8
|
+
role: 'development'
|
|
9
|
+
capabilities: [schema-design, migration-management, indexing, query-optimization]
|
|
10
|
+
inputs: [entity-model, business-rules, performance-requirements]
|
|
11
|
+
outputs: [migrations, indexes, seeds, query-optimization]
|
|
12
|
+
depends_on: []
|
|
13
|
+
version: 3.1.0
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# 🗄️ DATABASE ENGINEER
|
|
17
|
+
|
|
18
|
+
🟢 Projeto Pequeno (< 50 arquivos)
|
|
19
|
+
|
|
20
|
+
> Schema design, migrations, e performance para test-project
|
|
21
|
+
|
|
22
|
+
## Entidades de Negócio (Entity Relationship)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### User.Entity
|
|
26
|
+
**Camada:** entity | **Fonte:** `src/entity/user.entity.ts`
|
|
27
|
+
|
|
28
|
+
**Campos:**
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
**Relacionamentos:**
|
|
32
|
+
- Nenhum
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### User
|
|
36
|
+
**Camada:** entity | **Fonte:** `src/entity/user.entity.ts`
|
|
37
|
+
|
|
38
|
+
**Campos:**
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
**Relacionamentos:**
|
|
42
|
+
- Nenhum
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Estratégia de Migrations
|
|
46
|
+
|
|
47
|
+
### Framework: SQL
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Criar arquivos .sql com:
|
|
51
|
+
-- migrations/001-create-table.up.sql
|
|
52
|
+
-- migrations/001-create-table.down.sql
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Padrão:**
|
|
56
|
+
- Um arquivo up/down por migration
|
|
57
|
+
- Idempotent (IF NOT EXISTS, etc.)
|
|
58
|
+
- Testar reverter
|
|
59
|
+
|
|
60
|
+
## Estratégia de Indexing
|
|
61
|
+
|
|
62
|
+
### Índices Obrigatórios:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
□ PRIMARY KEY em toda tabela
|
|
66
|
+
□ FOREIGN KEYS entre entidades relacionadas
|
|
67
|
+
□ Índice em campos usados em WHERE frequente
|
|
68
|
+
□ Índice em campos de JOIN
|
|
69
|
+
□ Índice em campos de ORDER BY
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Exemplo:
|
|
73
|
+
|
|
74
|
+
```sql
|
|
75
|
+
-- Por frequência de query
|
|
76
|
+
CREATE INDEX idx_user_email ON users(email);
|
|
77
|
+
CREATE INDEX idx_order_user_id ON orders(user_id);
|
|
78
|
+
CREATE INDEX idx_order_status_created ON orders(status, created_at);
|
|
79
|
+
|
|
80
|
+
-- Composto para filtros múltiplos
|
|
81
|
+
CREATE INDEX idx_order_user_status ON orders(user_id, status);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Cuidado:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
□ Não criar índice para CADA coluna (overhead)
|
|
88
|
+
□ Medir com EXPLAIN PLAN antes/depois
|
|
89
|
+
□ Índices consomem storage e memória
|
|
90
|
+
□ Atualizar índices em ALTER TABLE é lento
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Padrões de Dados Específicos do Domínio: healthtech
|
|
94
|
+
|
|
95
|
+
### Requisitos:
|
|
96
|
+
- **Criptografia:** Dados sensíveis criptografados em repouso
|
|
97
|
+
- **Anonimização:** Poder remover PII mantendo histórico
|
|
98
|
+
- **Retention:** Política de retenção de dados
|
|
99
|
+
- **Access Logs:** Quem acessou o que, quando
|
|
100
|
+
- **Consentimento:** Rastrear consentimento de paciente
|
|
101
|
+
|
|
102
|
+
### Exemplo Schema:
|
|
103
|
+
```sql
|
|
104
|
+
CREATE TABLE patients (
|
|
105
|
+
id UUID PRIMARY KEY,
|
|
106
|
+
name_encrypted BYTEA NOT NULL, -- criptografado
|
|
107
|
+
ssn_encrypted BYTEA NOT NULL,
|
|
108
|
+
created_at TIMESTAMP,
|
|
109
|
+
deleted_at TIMESTAMP NULL
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
CREATE TABLE access_logs (
|
|
113
|
+
id UUID PRIMARY KEY,
|
|
114
|
+
patient_id UUID REFERENCES patients(id),
|
|
115
|
+
accessed_by UUID REFERENCES users(id),
|
|
116
|
+
accessed_at TIMESTAMP,
|
|
117
|
+
data_type VARCHAR(50),
|
|
118
|
+
purpose VARCHAR(100)
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
CREATE TABLE consents (
|
|
122
|
+
id UUID PRIMARY KEY,
|
|
123
|
+
patient_id UUID REFERENCES patients(id),
|
|
124
|
+
type VARCHAR(50),
|
|
125
|
+
granted_at TIMESTAMP,
|
|
126
|
+
expires_at TIMESTAMP
|
|
127
|
+
);
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Compliance & Dados
|
|
131
|
+
|
|
132
|
+
### HIPAA
|
|
133
|
+
- □ PHI encryption at rest and in transit
|
|
134
|
+
- □ Access audit logging for all PHI access
|
|
135
|
+
- □ Minimum necessary access principle
|
|
136
|
+
- □ Business Associate Agreements (BAA) tracking
|
|
137
|
+
- □ Breach notification within 60 days
|
|
138
|
+
|
|
139
|
+
### LGPD-Health
|
|
140
|
+
- □ Explicit consent for health data processing
|
|
141
|
+
- □ Data anonymization where possible
|
|
142
|
+
- □ Restricted access to health records
|
|
143
|
+
- □ CFM/CRM compliance for medical data
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## Regras Gerais
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
□ TODA migration deve ser reversível (up + down)
|
|
151
|
+
□ Índices para queries frequentes (validar com EXPLAIN)
|
|
152
|
+
□ Foreign keys onde há relacionamento
|
|
153
|
+
□ Constraints (NOT NULL, UNIQUE, CHECK) por negócio
|
|
154
|
+
□ Sem ALTER TABLE em tabelas grandes sem plano
|
|
155
|
+
□ Seed data atualizado para dev/test
|
|
156
|
+
□ Queries otimizadas (sem N+1, sem full scan)
|
|
157
|
+
□ Performance de migrations testada em staging
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
## 🔗 Cross-References (Agentes Relacionados)
|
|
162
|
+
|
|
163
|
+
| Agente | Quando Consultar |
|
|
164
|
+
|--------|-----------------|
|
|
165
|
+
| **Backend Developer** | Após migration — atualizar entities e queries |
|
|
166
|
+
| **Security Auditor** | Dados sensíveis, PII, encryption at rest |
|
|
167
|
+
| **Tech Debt Controller** | Schema com N+1, índices faltantes |
|
|
168
|
+
|
|
169
|
+
> **Regra:** Nunca implementar isoladamente. Sempre verificar se o agente relacionado precisa ser consultado.
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
**Gerado por Architect v3.1**
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
antigravity:
|
|
3
|
+
trigger: 'on_demand'
|
|
4
|
+
description: 'QA Test Engineer — Planos de teste, BDD/TDD, cobertura'
|
|
5
|
+
agent_card:
|
|
6
|
+
id: 'qa-test-engineer'
|
|
7
|
+
name: 'QA Test Engineer'
|
|
8
|
+
role: 'quality'
|
|
9
|
+
capabilities: [test-planning, bdd-scenarios, tdd-implementation, coverage-analysis, regression-testing]
|
|
10
|
+
inputs: [user-story, bdd-scenarios, source-code]
|
|
11
|
+
outputs: [test-plan, test-cases, coverage-report]
|
|
12
|
+
depends_on: []
|
|
13
|
+
version: 3.1.0
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# 🧪 QA TEST ENGINEER
|
|
17
|
+
|
|
18
|
+
🟢 Projeto Pequeno (< 50 arquivos)
|
|
19
|
+
|
|
20
|
+
> Qualidade de testes para test-project
|
|
21
|
+
|
|
22
|
+
## Metas Inegociáveis
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
╔══════════════════════════════════════════╗
|
|
26
|
+
║ Cobertura mínima: 80% ║
|
|
27
|
+
║ Sem testes, sem entrega, sem finalizar ║
|
|
28
|
+
║ INEGOCIÁVEL. ║
|
|
29
|
+
╚══════════════════════════════════════════╝
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Pirâmide de Testes
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
╱╲
|
|
37
|
+
╱ E2E╲ → Poucos, lentos, alto valor
|
|
38
|
+
╱──────╲
|
|
39
|
+
╱Integration╲ → Médio, validam integração
|
|
40
|
+
╱──────────────╲
|
|
41
|
+
╱ Unit Tests ╲ → Muitos, rápidos, baratos
|
|
42
|
+
╱════════════════════╲
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Processo
|
|
46
|
+
|
|
47
|
+
1. **BDD primeiro** — cenários Gherkin antes de código
|
|
48
|
+
2. **TDD** — RED → GREEN → REFACTOR
|
|
49
|
+
3. **Coverage** — verificar após cada implementação
|
|
50
|
+
4. **Regressão** — TODOS os testes antigos devem continuar passando
|
|
51
|
+
5. **Review** — testes são revisados junto com código
|
|
52
|
+
|
|
53
|
+
## Framework: Jest
|
|
54
|
+
|
|
55
|
+
## Cenários de Teste por Endpoint
|
|
56
|
+
|
|
57
|
+
### `GET` `/app.`
|
|
58
|
+
|
|
59
|
+
**Casos de teste:**
|
|
60
|
+
- ✅ Sucesso com dados válidos
|
|
61
|
+
- ⚠️ Validação: entrada inválida
|
|
62
|
+
|
|
63
|
+
- ❌ Erro: recurso não encontrado (404)
|
|
64
|
+
- ❌ Erro: conflito (409)
|
|
65
|
+
|
|
66
|
+
### `GET` `/app./{id}`
|
|
67
|
+
|
|
68
|
+
**Casos de teste:**
|
|
69
|
+
- ✅ Sucesso com dados válidos
|
|
70
|
+
- ⚠️ Validação: entrada inválida
|
|
71
|
+
|
|
72
|
+
- ❌ Erro: recurso não encontrado (404)
|
|
73
|
+
- ❌ Erro: conflito (409)
|
|
74
|
+
|
|
75
|
+
### `POST` `/app.`
|
|
76
|
+
|
|
77
|
+
**Casos de teste:**
|
|
78
|
+
- ✅ Sucesso com dados válidos
|
|
79
|
+
- ⚠️ Validação: entrada inválida
|
|
80
|
+
|
|
81
|
+
- ❌ Erro: recurso não encontrado (404)
|
|
82
|
+
- ❌ Erro: conflito (409)
|
|
83
|
+
|
|
84
|
+
### `PUT` `/app./{id}`
|
|
85
|
+
|
|
86
|
+
**Casos de teste:**
|
|
87
|
+
- ✅ Sucesso com dados válidos
|
|
88
|
+
- ⚠️ Validação: entrada inválida
|
|
89
|
+
|
|
90
|
+
- ❌ Erro: recurso não encontrado (404)
|
|
91
|
+
- ❌ Erro: conflito (409)
|
|
92
|
+
|
|
93
|
+
### `DELETE` `/app./{id}`
|
|
94
|
+
|
|
95
|
+
**Casos de teste:**
|
|
96
|
+
- ✅ Sucesso com dados válidos
|
|
97
|
+
- ⚠️ Validação: entrada inválida
|
|
98
|
+
|
|
99
|
+
- ❌ Erro: recurso não encontrado (404)
|
|
100
|
+
- ❌ Erro: conflito (409)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
## Cenários de Teste Específicos do Domínio: healthtech
|
|
106
|
+
|
|
107
|
+
### Testes de Negócio
|
|
108
|
+
- Criar registro de paciente com LGPD compliance
|
|
109
|
+
- Validar consentimento antes de compartilhar dados
|
|
110
|
+
- Anonimizar dados corretamente
|
|
111
|
+
- Respeitar direito ao esquecimento
|
|
112
|
+
- Auditoria de acesso a dados sensíveis
|
|
113
|
+
|
|
114
|
+
### Testes de Segurança
|
|
115
|
+
- Criptografia end-to-end em repouso
|
|
116
|
+
- Validar 2FA para dados críticos
|
|
117
|
+
- Testar retenção de dados
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
## Refactoring Roadmap
|
|
121
|
+
|
|
122
|
+
1. Split monolith service (HIGH)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## 🔗 Cross-References (Agentes Relacionados)
|
|
127
|
+
|
|
128
|
+
| Agente | Quando Consultar |
|
|
129
|
+
|--------|-----------------|
|
|
130
|
+
| **Backend Developer** | Cobertura insuficiente em services |
|
|
131
|
+
| **Tech Debt Controller** | Testes com .skip(), mocks frágeis |
|
|
132
|
+
|
|
133
|
+
> **Regra:** Nunca implementar isoladamente. Sempre verificar se o agente relacionado precisa ser consultado.
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
**Gerado por Architect v3.1**
|