@quantbrasil/cli 0.1.0-beta.6 → 0.1.0-beta.7

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.
@@ -1,8 +1,8 @@
1
1
  # Portfolio Reference
2
2
 
3
3
  Use this reference whenever the user mentions portfolios, carteiras, holdings,
4
- watchlists, target weights, positions, historical return, beta, VaR, risk, or a
5
- saved composition.
4
+ watchlists, target weights, positions, historical return, beta, VaR, risk,
5
+ screening universes, or a saved composition.
6
6
 
7
7
  ## Domain model
8
8
 
@@ -11,8 +11,14 @@ saved composition.
11
11
  is not an investable composition and does not define weights or positions.
12
12
  - `Holding` is a portfolio used as an investable composition. It can be based on
13
13
  target weights or positions.
14
+ - `System Portfolio` is a backend-managed portfolio-backed universe exposed by
15
+ slug for screening discovery and runs.
16
+ - `Screening Universe` is exactly one system portfolio, watchlist, or holding
17
+ selected for indicator screening.
14
18
  - A theoretical portfolio is a holding with target weights. Save it first, then
15
19
  run metrics on the returned holding id.
20
+ - A holding used as a screening universe contributes only its asset set; target
21
+ weights and positions do not affect indicator screening.
16
22
  - Target weights and positions are independent: target weights describe intended
17
23
  allocation, while positions describe actual ownership.
18
24
  - Position quantities are shares, units, or coin amounts. Do not pass monetary
@@ -24,6 +30,10 @@ saved composition.
24
30
  non-investable saved lists.
25
31
  - Use `quantbrasil holdings ...` for investable compositions, target weights,
26
32
  positions, historical return, beta, VaR, and risk/return checks.
33
+ - Use `quantbrasil screening universes` to discover system portfolios,
34
+ watchlists, and holdings available for screening.
35
+ - Use `quantbrasil screening run` with exactly one selector to run indicator
36
+ screening over that selected asset set.
27
37
  - Use `quantbrasil holdings list` when the user names a saved holding but does
28
38
  not provide an id.
29
39
  - Use `quantbrasil watchlists list` when the user names a saved watchlist but
@@ -36,6 +46,7 @@ Do not use these patterns:
36
46
  - `quantbrasil portfolios ...`
37
47
  - `quantbrasil analytics ...`
38
48
  - ad-hoc asset lists passed directly into metric commands
49
+ - ad-hoc asset lists passed directly into screening commands
39
50
  - running holding metrics on a watchlist
40
51
 
41
52
  ## Holdings
@@ -0,0 +1,122 @@
1
+ [
2
+ {
3
+ "query": "Qual foi o último preço da PETR4 no QuantBrasil?",
4
+ "should_trigger": true,
5
+ "expected_behavior": "Use quantbrasil market price PETR4 before generic web or finance search."
6
+ },
7
+ {
8
+ "query": "Mostra o preço e a análise técnica da VALE3.",
9
+ "should_trigger": true,
10
+ "expected_behavior": "Use assets overview with the price and technicals sections."
11
+ },
12
+ {
13
+ "query": "Quero preço, fundamentos e rankings de ITUB4.",
14
+ "should_trigger": true,
15
+ "expected_behavior": "Use assets overview with only valid sections: price,fundamentals,rankings."
16
+ },
17
+ {
18
+ "query": "Mostra valuation e resumo da PETR4 pela CLI.",
19
+ "should_trigger": true,
20
+ "expected_behavior": "Do not pass invalid sections like valuation or summary; inspect capabilities or explain the supported asset overview sections."
21
+ },
22
+ {
23
+ "query": "Crie uma watchlist chamada Dividendos e adicione PETR4 e VALE3.",
24
+ "should_trigger": true,
25
+ "expected_behavior": "Use watchlists create followed by watchlists add-assets with explicit tickers."
26
+ },
27
+ {
28
+ "query": "Atualize os pesos alvo da carteira Longo Prazo para PETR4 50 e VALE3 50.",
29
+ "should_trigger": true,
30
+ "expected_behavior": "Resolve the holding id if needed, then use holdings set-targets; do not use a generic portfolio command."
31
+ },
32
+ {
33
+ "query": "Liste minhas carteiras e calcule o retorno histórico da carteira Longo Prazo.",
34
+ "should_trigger": true,
35
+ "expected_behavior": "Use holdings list to resolve the saved holding, then holdings historical-return."
36
+ },
37
+ {
38
+ "query": "Qual é o beta da minha carteira contra o Ibovespa?",
39
+ "should_trigger": true,
40
+ "expected_behavior": "Use holdings beta for a saved holding; do not calculate beta for a watchlist."
41
+ },
42
+ {
43
+ "query": "Quais universos salvos eu posso usar no screening de indicadores?",
44
+ "should_trigger": true,
45
+ "expected_behavior": "Use screening universes and present system portfolios, watchlists, and holdings."
46
+ },
47
+ {
48
+ "query": "Rode um screening de IFR na carteira do sistema Ações Mais Líquidas.",
49
+ "should_trigger": true,
50
+ "expected_behavior": "Use screening run with one explicit --system selector and a ScreenerRequest JSON payload."
51
+ },
52
+ {
53
+ "query": "A CLI retornou auth_failed quando tentei buscar PETR4.",
54
+ "should_trigger": true,
55
+ "expected_behavior": "Load error guidance; explain auth login or QUANTBRASIL_API_KEY without inspecting credential files."
56
+ },
57
+ {
58
+ "query": "A CLI disse rate_limited ao rodar várias métricas de carteira.",
59
+ "should_trigger": true,
60
+ "expected_behavior": "Load errors and costs guidance; avoid retry loops and recommend waiting or narrowing heavy calls."
61
+ },
62
+ {
63
+ "query": "Meu terminal diz quantbrasil: command not found.",
64
+ "should_trigger": true,
65
+ "expected_behavior": "Report that the CLI binary is not on PATH and ask the user to install it or fix PATH; do not inspect the repo."
66
+ },
67
+ {
68
+ "query": "Apague uma carteira salva da minha conta.",
69
+ "should_trigger": true,
70
+ "expected_behavior": "Load unsupported guidance and explain that deleting holdings is not public in the CLI."
71
+ },
72
+ {
73
+ "query": "Exporte uma resposta JSON grande para arquivo usando a CLI.",
74
+ "should_trigger": true,
75
+ "expected_behavior": "Load unsupported guidance and explain that --output file export is not public yet."
76
+ },
77
+ {
78
+ "query": "Rode um filtro com estes tickers avulsos: PETR4, VALE3 e BBAS3.",
79
+ "should_trigger": true,
80
+ "expected_behavior": "Load unsupported guidance; do not invent ad-hoc ticker-list screening."
81
+ },
82
+ {
83
+ "query": "What's the latest PETR4 price in QuantBrasil?",
84
+ "should_trigger": true,
85
+ "expected_behavior": "Use quantbrasil market price PETR4."
86
+ },
87
+ {
88
+ "query": "Show me the price and technical overview for VALE3.",
89
+ "should_trigger": true,
90
+ "expected_behavior": "Use assets overview with price and technicals sections."
91
+ },
92
+ {
93
+ "query": "Run a screen over these ad-hoc tickers: PETR4, VALE3, BBAS3.",
94
+ "should_trigger": true,
95
+ "expected_behavior": "Load unsupported guidance; do not invent ad-hoc ticker-list screening."
96
+ },
97
+ {
98
+ "query": "Implemente um novo comando na CLI dentro do repositório do QuantBrasil.",
99
+ "should_trigger": false,
100
+ "expected_behavior": "Handle as code implementation work, not as a market-data CLI usage task."
101
+ },
102
+ {
103
+ "query": "Revise este pull request procurando bugs no backend.",
104
+ "should_trigger": false,
105
+ "expected_behavior": "Handle as code review work, not as a QuantBrasil CLI data task."
106
+ },
107
+ {
108
+ "query": "Procure na web a cotação de hoje do dólar contra o real.",
109
+ "should_trigger": false,
110
+ "expected_behavior": "Use external lookup because the user explicitly requested the web and this is not a QuantBrasil-supported asset workflow."
111
+ },
112
+ {
113
+ "query": "Explique conceitualmente o que significa beta de uma carteira.",
114
+ "should_trigger": false,
115
+ "expected_behavior": "Answer conceptually; no CLI call is needed unless the user asks for a saved holding metric."
116
+ },
117
+ {
118
+ "query": "Monte uma planilha para meus gastos mensais.",
119
+ "should_trigger": false,
120
+ "expected_behavior": "Use spreadsheet/document workflow, not the QuantBrasil CLI skill."
121
+ }
122
+ ]
@@ -5,6 +5,7 @@ Unsupported in the public CLI:
5
5
  - `--output <file>` response export
6
6
  - deleting watchlists or holdings
7
7
  - value-based position input for traded assets
8
+ - ad-hoc ticker-list screening
8
9
 
9
10
  Not a supported pattern:
10
11
 
@@ -19,5 +20,6 @@ Use the public surface only:
19
20
  - `capabilities`
20
21
  - `market`
21
22
  - `assets`
23
+ - `screening`
22
24
  - `watchlists`
23
25
  - `holdings`
@@ -8,6 +8,7 @@
8
8
  - watchlist details or changes → `watchlists ...`
9
9
  - holding details or changes → `holdings ...`
10
10
  - holding return, beta, risk, VaR, or comparison → `holdings historical-return|beta|var`
11
+ - indicator screening over saved asset sets → `screening universes`, then `screening run`
11
12
 
12
13
  ## Find supported ticker, then get price
13
14
 
@@ -75,6 +76,26 @@ quantbrasil holdings beta 93 --years 1
75
76
  quantbrasil holdings var 93 --years 1 --confidence 95
76
77
  ```
77
78
 
79
+ ## Run indicator screening
80
+
81
+ 1. Discover available universes.
82
+ 2. Pick exactly one system portfolio, watchlist, or holding.
83
+ 3. Run screening with a full `ScreenerRequest` JSON file.
84
+
85
+ ```bash
86
+ quantbrasil screening universes
87
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json
88
+ quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25
89
+ quantbrasil screening run --holding 182 --query-file ./screening.json --sort ticker
90
+ ```
91
+
92
+ Rules:
93
+
94
+ - screening universes are portfolio-backed only: system portfolios, watchlists, or holdings
95
+ - a holding used as a screening universe contributes only its asset set
96
+ - do not invent ad-hoc ticker-list screening commands
97
+ - use `--json` when the result will be parsed by an agent or script
98
+
78
99
  ## Analyze a theoretical composition
79
100
 
80
101
  Create a holding with target weights, then run holding metrics on its id.