mt5api 0.0.1__tar.gz

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 (110) hide show
  1. mt5api-0.0.1/.agents/skills/local-qa/SKILL.md +19 -0
  2. mt5api-0.0.1/.agents/skills/local-qa/scripts/qa.sh +26 -0
  3. mt5api-0.0.1/.agents/skills/mt5-account/SKILL.md +55 -0
  4. mt5api-0.0.1/.agents/skills/mt5-health/SKILL.md +47 -0
  5. mt5api-0.0.1/.agents/skills/mt5-history/SKILL.md +111 -0
  6. mt5api-0.0.1/.agents/skills/mt5-market/SKILL.md +122 -0
  7. mt5api-0.0.1/.agents/skills/mt5-symbols/SKILL.md +69 -0
  8. mt5api-0.0.1/.agents/skills/speckit-analyze/SKILL.md +86 -0
  9. mt5api-0.0.1/.agents/skills/speckit-checklist/SKILL.md +106 -0
  10. mt5api-0.0.1/.agents/skills/speckit-clarify/SKILL.md +99 -0
  11. mt5api-0.0.1/.agents/skills/speckit-constitution/SKILL.md +89 -0
  12. mt5api-0.0.1/.agents/skills/speckit-implement/SKILL.md +78 -0
  13. mt5api-0.0.1/.agents/skills/speckit-plan/SKILL.md +71 -0
  14. mt5api-0.0.1/.agents/skills/speckit-specify/SKILL.md +75 -0
  15. mt5api-0.0.1/.agents/skills/speckit-tasks/SKILL.md +79 -0
  16. mt5api-0.0.1/.agents/skills/speckit-taskstoissues/SKILL.md +131 -0
  17. mt5api-0.0.1/.claude/agents/codex.md +986 -0
  18. mt5api-0.0.1/.claude/agents/copilot.md +1194 -0
  19. mt5api-0.0.1/.claude/commands/speckit.analyze.md +184 -0
  20. mt5api-0.0.1/.claude/commands/speckit.checklist.md +294 -0
  21. mt5api-0.0.1/.claude/commands/speckit.clarify.md +181 -0
  22. mt5api-0.0.1/.claude/commands/speckit.constitution.md +82 -0
  23. mt5api-0.0.1/.claude/commands/speckit.implement.md +135 -0
  24. mt5api-0.0.1/.claude/commands/speckit.plan.md +89 -0
  25. mt5api-0.0.1/.claude/commands/speckit.specify.md +256 -0
  26. mt5api-0.0.1/.claude/commands/speckit.tasks.md +137 -0
  27. mt5api-0.0.1/.claude/commands/speckit.taskstoissues.md +30 -0
  28. mt5api-0.0.1/.claude/settings.json +15 -0
  29. mt5api-0.0.1/.github/FUNDING.yml +3 -0
  30. mt5api-0.0.1/.github/dependabot.yml +17 -0
  31. mt5api-0.0.1/.github/renovate.json +13 -0
  32. mt5api-0.0.1/.github/workflows/ci.yml +98 -0
  33. mt5api-0.0.1/.github/workflows/claude-code.yml +57 -0
  34. mt5api-0.0.1/.gitignore +210 -0
  35. mt5api-0.0.1/.specify/memory/constitution.md +73 -0
  36. mt5api-0.0.1/.specify/scripts/bash/check-prerequisites.sh +166 -0
  37. mt5api-0.0.1/.specify/scripts/bash/common.sh +156 -0
  38. mt5api-0.0.1/.specify/scripts/bash/create-new-feature.sh +297 -0
  39. mt5api-0.0.1/.specify/scripts/bash/setup-plan.sh +61 -0
  40. mt5api-0.0.1/.specify/scripts/bash/update-agent-context.sh +799 -0
  41. mt5api-0.0.1/.specify/templates/agent-file-template.md +28 -0
  42. mt5api-0.0.1/.specify/templates/checklist-template.md +40 -0
  43. mt5api-0.0.1/.specify/templates/plan-template.md +105 -0
  44. mt5api-0.0.1/.specify/templates/spec-template.md +115 -0
  45. mt5api-0.0.1/.specify/templates/tasks-template.md +250 -0
  46. mt5api-0.0.1/AGENTS.md +65 -0
  47. mt5api-0.0.1/CLAUDE.md +1 -0
  48. mt5api-0.0.1/LICENSE +21 -0
  49. mt5api-0.0.1/PKG-INFO +109 -0
  50. mt5api-0.0.1/README.md +79 -0
  51. mt5api-0.0.1/docs/api/dataframe.md +165 -0
  52. mt5api-0.0.1/docs/api/deployment.md +61 -0
  53. mt5api-0.0.1/docs/api/index.md +74 -0
  54. mt5api-0.0.1/docs/api/mt5.md +324 -0
  55. mt5api-0.0.1/docs/api/rest-api.md +206 -0
  56. mt5api-0.0.1/docs/api/trading.md +399 -0
  57. mt5api-0.0.1/docs/api/utils.md +117 -0
  58. mt5api-0.0.1/docs/index.md +65 -0
  59. mt5api-0.0.1/mkdocs.yml +76 -0
  60. mt5api-0.0.1/mt5api/__init__.py +3 -0
  61. mt5api-0.0.1/mt5api/__main__.py +71 -0
  62. mt5api-0.0.1/mt5api/auth.py +74 -0
  63. mt5api-0.0.1/mt5api/dependencies.py +132 -0
  64. mt5api-0.0.1/mt5api/formatters.py +159 -0
  65. mt5api-0.0.1/mt5api/main.py +183 -0
  66. mt5api-0.0.1/mt5api/middleware.py +224 -0
  67. mt5api-0.0.1/mt5api/models.py +408 -0
  68. mt5api-0.0.1/mt5api/routers/__init__.py +7 -0
  69. mt5api-0.0.1/mt5api/routers/account.py +72 -0
  70. mt5api-0.0.1/mt5api/routers/health.py +87 -0
  71. mt5api-0.0.1/mt5api/routers/history.py +139 -0
  72. mt5api-0.0.1/mt5api/routers/market.py +188 -0
  73. mt5api-0.0.1/mt5api/routers/symbols.py +101 -0
  74. mt5api-0.0.1/pyproject.toml +201 -0
  75. mt5api-0.0.1/specs/041-mt5-rest-api/contracts/openapi.yaml +622 -0
  76. mt5api-0.0.1/specs/041-mt5-rest-api/data-model.md +583 -0
  77. mt5api-0.0.1/specs/041-mt5-rest-api/plan.md +373 -0
  78. mt5api-0.0.1/specs/041-mt5-rest-api/quickstart.md +651 -0
  79. mt5api-0.0.1/specs/041-mt5-rest-api/research.md +689 -0
  80. mt5api-0.0.1/specs/041-mt5-rest-api/spec.md +181 -0
  81. mt5api-0.0.1/specs/041-mt5-rest-api/tasks.md +318 -0
  82. mt5api-0.0.1/specs/042-mt5-core-client/spec.md +97 -0
  83. mt5api-0.0.1/specs/043-mt5-dataframe-client/spec.md +96 -0
  84. mt5api-0.0.1/specs/044-mt5-trading-client/spec.md +94 -0
  85. mt5api-0.0.1/specs/045-mt5-utils/spec.md +90 -0
  86. mt5api-0.0.1/specs/046-mt5-api-service/spec.md +104 -0
  87. mt5api-0.0.1/specs/047-api-auth-rate-limit/spec.md +93 -0
  88. mt5api-0.0.1/specs/048-api-response-format/spec.md +93 -0
  89. mt5api-0.0.1/specs/049-api-routing-models/spec.md +91 -0
  90. mt5api-0.0.1/specs/050-api-runtime-deploy/spec.md +90 -0
  91. mt5api-0.0.1/specs/051-api-error-logging/spec.md +91 -0
  92. mt5api-0.0.1/specs/052-api-dependencies/spec.md +93 -0
  93. mt5api-0.0.1/tests/__init__.py +1 -0
  94. mt5api-0.0.1/tests/conftest.py +262 -0
  95. mt5api-0.0.1/tests/test_account.py +78 -0
  96. mt5api-0.0.1/tests/test_auth.py +89 -0
  97. mt5api-0.0.1/tests/test_cli.py +124 -0
  98. mt5api-0.0.1/tests/test_config.py +34 -0
  99. mt5api-0.0.1/tests/test_dependencies.py +157 -0
  100. mt5api-0.0.1/tests/test_formatters.py +184 -0
  101. mt5api-0.0.1/tests/test_health.py +111 -0
  102. mt5api-0.0.1/tests/test_history.py +195 -0
  103. mt5api-0.0.1/tests/test_integration.py +80 -0
  104. mt5api-0.0.1/tests/test_lifespan.py +30 -0
  105. mt5api-0.0.1/tests/test_main.py +55 -0
  106. mt5api-0.0.1/tests/test_market.py +386 -0
  107. mt5api-0.0.1/tests/test_middleware.py +170 -0
  108. mt5api-0.0.1/tests/test_models.py +24 -0
  109. mt5api-0.0.1/tests/test_symbols.py +129 -0
  110. mt5api-0.0.1/uv.lock +1779 -0
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: local-qa
3
+ description: Run local QA for the repository. Use when asked to run formatting, linting, testing, or pre-commit checks, when verifying local QA, or whenever any file has been updated and local QA should be re-run.
4
+ ---
5
+
6
+ # Local QA (format, lint, and test)
7
+
8
+ Run the local QA script from the directory of this file:
9
+
10
+ ```bash
11
+ ./scripts/qa.sh
12
+ ```
13
+
14
+ ## Procedure
15
+
16
+ - Execute the script exactly as shown above when this skill is triggered.
17
+ - Capture and summarize key output (success/failure, major warnings, and any files modified).
18
+ - If the script fails due to missing tooling, report the missing tool(s) and stop unless the user asks to install or fix them.
19
+ - Do not run additional commands unless the user requests them.
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euox pipefail
4
+ cd "$(git rev-parse --show-toplevel)"
5
+
6
+ # Python
7
+ uv run ruff format .
8
+ uv run ruff check --fix .
9
+ uv run pyright .
10
+ uv run pytest
11
+
12
+ # Markdown
13
+ npx prettier --write './**/*.md'
14
+
15
+ # GitHub Actions
16
+ case "${OSTYPE}" in
17
+ darwin* | linux* )
18
+ zizmor --fix=safe .github/workflows
19
+ git ls-files -z -- '.github/workflows/*.yml' | xargs -0 -t actionlint
20
+ git ls-files -z -- '.github/workflows/*.yml' | xargs -0 -t yamllint -d '{"extends": "relaxed", "rules": {"line-length": "disable"}}'
21
+ checkov --framework=all --output=github_failed_only --directory=.
22
+ ;;
23
+ * )
24
+ echo "GitHub Actions linting is only supported on Linux and macOS."
25
+ ;;
26
+ esac
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: mt5-account
3
+ description: Retrieve MT5 trading account information or terminal details from the MT5 API. Use when the user wants to check account balance, equity, margin, leverage, or terminal status.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # MT5 Account & Terminal
8
+
9
+ Query account and terminal information endpoints on the mt5api.
10
+
11
+ ## Configuration
12
+
13
+ The API base URL defaults to `http://localhost:8000`. Set `MT5_API_URL` to override.
14
+ All endpoints require the `X-API-Key` header. Set `MT5_API_KEY` in the environment.
15
+
16
+ ## Endpoints
17
+
18
+ ### Account Info
19
+
20
+ Get current trading account details (balance, equity, margin, leverage, etc.).
21
+
22
+ ```bash
23
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
24
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/account" | python -m json.tool
25
+ ```
26
+
27
+ Returns a `DataResponse` containing account fields such as:
28
+
29
+ - `login` - Account number
30
+ - `balance` - Account balance
31
+ - `equity` - Account equity
32
+ - `margin` - Used margin
33
+ - `margin_free` - Free margin
34
+ - `margin_level` - Margin level percentage
35
+ - `leverage` - Account leverage
36
+ - `currency` - Account currency
37
+ - `server` - Trade server name
38
+ - `name` - Account holder name
39
+
40
+ ### Terminal Info
41
+
42
+ Get MetaTrader 5 terminal information.
43
+
44
+ ```bash
45
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
46
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/terminal" | python -m json.tool
47
+ ```
48
+
49
+ Returns a `DataResponse` with terminal details such as build number, platform, data path, and connection status.
50
+
51
+ ## Procedure
52
+
53
+ 1. Determine whether the user needs account info or terminal info.
54
+ 2. Run the appropriate `curl` command.
55
+ 3. Parse and summarize the JSON response, highlighting key financial metrics (balance, equity, margin) for account queries or connection status for terminal queries.
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: mt5-health
3
+ description: Check MT5 API health status and retrieve MT5 terminal version information. Use when verifying API availability, checking MT5 terminal connectivity, or retrieving version details.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # MT5 Health & Version
8
+
9
+ Query the mt5api health check and version endpoints.
10
+
11
+ ## Configuration
12
+
13
+ The API base URL defaults to `http://localhost:8000`. Set `MT5_API_URL` to override.
14
+ Authenticated endpoints require the `X-API-Key` header. Set `MT5_API_KEY` in the environment.
15
+
16
+ ## Endpoints
17
+
18
+ ### Health Check (public, no auth required)
19
+
20
+ ```bash
21
+ curl -s "${MT5_API_URL:-http://localhost:8000}/api/v1/health" | python -m json.tool
22
+ ```
23
+
24
+ Returns:
25
+
26
+ | Field | Type | Description |
27
+ | ------------- | ------- | ------------------------------ |
28
+ | status | string | `healthy` or `unhealthy` |
29
+ | mt5_connected | bool | MT5 terminal connection status |
30
+ | mt5_version | string? | MT5 terminal version string |
31
+ | api_version | string | API version (e.g., `1.0.0`) |
32
+
33
+ ### MT5 Version (requires API key)
34
+
35
+ ```bash
36
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
37
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/version" | python -m json.tool
38
+ ```
39
+
40
+ Returns a `DataResponse` with version data.
41
+
42
+ ## Procedure
43
+
44
+ 1. Determine which endpoint the user needs (health check or version).
45
+ 2. Run the appropriate `curl` command above.
46
+ 3. Parse and summarize the JSON response for the user.
47
+ 4. If the health status is `unhealthy`, note that the MT5 terminal may not be running or reachable.
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: mt5-history
3
+ description: Query open positions, pending orders, historical orders, and historical deals from the MT5 API. Use when the user wants to check current trades, pending orders, or trade history.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # MT5 Positions, Orders & History
8
+
9
+ Query trading state and history endpoints on the mt5api.
10
+
11
+ ## Configuration
12
+
13
+ The API base URL defaults to `http://localhost:8000`. Set `MT5_API_URL` to override.
14
+ All endpoints require the `X-API-Key` header. Set `MT5_API_KEY` in the environment.
15
+
16
+ ## Endpoints
17
+
18
+ ### Open Positions
19
+
20
+ Get current open positions with optional filters.
21
+
22
+ ```bash
23
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
24
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/positions" | python -m json.tool
25
+ ```
26
+
27
+ | Parameter | Type | Required | Description |
28
+ | --------- | ------ | -------- | ------------------------- |
29
+ | symbol | string | no | Filter by symbol |
30
+ | group | string | no | Filter by group pattern |
31
+ | ticket | int | no | Filter by position ticket |
32
+
33
+ Example with symbol filter:
34
+
35
+ ```bash
36
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
37
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/positions?symbol=EURUSD" | python -m json.tool
38
+ ```
39
+
40
+ ### Pending Orders
41
+
42
+ Get current pending orders with optional filters.
43
+
44
+ ```bash
45
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
46
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/orders" | python -m json.tool
47
+ ```
48
+
49
+ | Parameter | Type | Required | Description |
50
+ | --------- | ------ | -------- | ----------------------- |
51
+ | symbol | string | no | Filter by symbol |
52
+ | group | string | no | Filter by group pattern |
53
+ | ticket | int | no | Filter by order ticket |
54
+
55
+ ### Historical Orders
56
+
57
+ Get historical orders filtered by date range or ticket/position.
58
+
59
+ ```bash
60
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
61
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/history/orders?date_from=2024-01-01T00:00:00Z&date_to=2024-01-31T23:59:59Z" \
62
+ | python -m json.tool
63
+ ```
64
+
65
+ | Parameter | Type | Required | Description |
66
+ | --------- | -------- | -------- | ------------------------------------------------- |
67
+ | date_from | datetime | cond. | Start date (required if no ticket/position) |
68
+ | date_to | datetime | cond. | End date (required if no ticket/position) |
69
+ | ticket | int | cond. | Filter by ticket (alternative to date range) |
70
+ | position | int | cond. | Filter by position ID (alternative to date range) |
71
+ | symbol | string | no | Filter by symbol |
72
+ | group | string | no | Filter by group pattern |
73
+
74
+ Either `(date_from AND date_to)` or `(ticket OR position)` must be provided.
75
+
76
+ Example by ticket:
77
+
78
+ ```bash
79
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
80
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/history/orders?ticket=123456" \
81
+ | python -m json.tool
82
+ ```
83
+
84
+ ### Historical Deals
85
+
86
+ Get historical deals filtered by date range or ticket/position.
87
+
88
+ ```bash
89
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
90
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/history/deals?date_from=2024-01-01T00:00:00Z&date_to=2024-01-31T23:59:59Z" \
91
+ | python -m json.tool
92
+ ```
93
+
94
+ | Parameter | Type | Required | Description |
95
+ | --------- | -------- | -------- | ------------------------------------------------- |
96
+ | date_from | datetime | cond. | Start date (required if no ticket/position) |
97
+ | date_to | datetime | cond. | End date (required if no ticket/position) |
98
+ | ticket | int | cond. | Filter by ticket (alternative to date range) |
99
+ | position | int | cond. | Filter by position ID (alternative to date range) |
100
+ | symbol | string | no | Filter by symbol |
101
+ | group | string | no | Filter by group pattern |
102
+
103
+ Either `(date_from AND date_to)` or `(ticket OR position)` must be provided.
104
+
105
+ ## Procedure
106
+
107
+ 1. Identify the user's query: open positions, pending orders, historical orders, or historical deals.
108
+ 2. Gather required filters (dates, symbol, ticket, or position).
109
+ 3. Construct and run the `curl` command with the appropriate query parameters.
110
+ 4. Parse the JSON response and summarize the results (number of records, P/L for positions, order types, deal volumes, etc.).
111
+ 5. For historical queries, remind the user that either a date range or a ticket/position filter is required.
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: mt5-market
3
+ description: Fetch historical OHLCV rates, tick data, or market depth (DOM) from the MT5 API. Use when the user needs candlestick data, price history, tick-level data, or order book depth for a trading symbol.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # MT5 Market Data
8
+
9
+ Query market data endpoints on the mt5api for historical rates, ticks, and market depth.
10
+
11
+ ## Configuration
12
+
13
+ The API base URL defaults to `http://localhost:8000`. Set `MT5_API_URL` to override.
14
+ All endpoints require the `X-API-Key` header. Set `MT5_API_KEY` in the environment.
15
+
16
+ ## Endpoints
17
+
18
+ ### Rates from Date
19
+
20
+ Get historical OHLCV candles starting from a specific date.
21
+
22
+ ```bash
23
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
24
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/rates/from?symbol=EURUSD&timeframe=60&date_from=2024-01-01T00:00:00Z&count=100" \
25
+ | python -m json.tool
26
+ ```
27
+
28
+ | Parameter | Type | Required | Description |
29
+ | --------- | -------- | -------- | ---------------------------------------------- |
30
+ | symbol | string | yes | Symbol name |
31
+ | timeframe | int | yes | Timeframe in minutes (1, 5, 15, 60, 240, 1440) |
32
+ | date_from | datetime | yes | Start date (ISO 8601) |
33
+ | count | int | yes | Number of candles (1–100000) |
34
+
35
+ ### Rates from Position
36
+
37
+ Get historical OHLCV candles starting from a bar index.
38
+
39
+ ```bash
40
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
41
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/rates/from-pos?symbol=EURUSD&timeframe=60&start_pos=0&count=100" \
42
+ | python -m json.tool
43
+ ```
44
+
45
+ | Parameter | Type | Required | Description |
46
+ | --------- | ---- | -------- | -------------------------------- |
47
+ | symbol | str | yes | Symbol name |
48
+ | timeframe | int | yes | Timeframe in minutes |
49
+ | start_pos | int | yes | Start position (0 = current bar) |
50
+ | count | int | yes | Number of candles (1–100000) |
51
+
52
+ ### Rates in Range
53
+
54
+ Get historical OHLCV candles for a date range.
55
+
56
+ ```bash
57
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
58
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/rates/range?symbol=EURUSD&timeframe=60&date_from=2024-01-01T00:00:00Z&date_to=2024-01-31T23:59:59Z" \
59
+ | python -m json.tool
60
+ ```
61
+
62
+ | Parameter | Type | Required | Description |
63
+ | --------- | -------- | -------- | --------------------- |
64
+ | symbol | string | yes | Symbol name |
65
+ | timeframe | int | yes | Timeframe in minutes |
66
+ | date_from | datetime | yes | Start date (ISO 8601) |
67
+ | date_to | datetime | yes | End date (ISO 8601) |
68
+
69
+ ### Ticks from Date
70
+
71
+ Get tick-level data starting from a date.
72
+
73
+ ```bash
74
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
75
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/ticks/from?symbol=EURUSD&date_from=2024-01-02T10:00:00Z&count=500" \
76
+ | python -m json.tool
77
+ ```
78
+
79
+ | Parameter | Type | Required | Default | Description |
80
+ | --------- | -------- | -------- | ------- | ----------------------------------- |
81
+ | symbol | string | yes | | Symbol name |
82
+ | date_from | datetime | yes | | Start date (ISO 8601) |
83
+ | count | int | yes | | Number of ticks (1–100000) |
84
+ | flags | int | no | 6 | Tick flags (2=INFO, 4=TRADE, 6=ALL) |
85
+
86
+ ### Ticks in Range
87
+
88
+ Get tick-level data for a date range.
89
+
90
+ ```bash
91
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
92
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/ticks/range?symbol=EURUSD&date_from=2024-01-02T10:00:00Z&date_to=2024-01-02T11:00:00Z" \
93
+ | python -m json.tool
94
+ ```
95
+
96
+ | Parameter | Type | Required | Default | Description |
97
+ | --------- | -------- | -------- | ------- | ----------------------------------- |
98
+ | symbol | string | yes | | Symbol name |
99
+ | date_from | datetime | yes | | Start date (ISO 8601) |
100
+ | date_to | datetime | yes | | End date (ISO 8601) |
101
+ | flags | int | no | 6 | Tick flags (2=INFO, 4=TRADE, 6=ALL) |
102
+
103
+ ### Market Book (DOM)
104
+
105
+ Get market depth (order book) for a symbol.
106
+
107
+ ```bash
108
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
109
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/market-book/EURUSD" | python -m json.tool
110
+ ```
111
+
112
+ | Parameter | Type | Required | Description |
113
+ | --------- | ------ | -------- | ----------- |
114
+ | symbol | string | yes | Symbol name |
115
+
116
+ ## Procedure
117
+
118
+ 1. Identify which market data endpoint the user needs.
119
+ 2. Gather the required parameters (symbol, timeframe, dates, count).
120
+ 3. Construct and run the appropriate `curl` command.
121
+ 4. Parse the JSON response and summarize the data (number of records, date range covered, OHLCV summary, etc.).
122
+ 5. If the user requests Parquet format, append `format=parquet` as a query parameter (use `?` if the URL has no existing parameters, or `&` if it does) and note the binary response.
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: mt5-symbols
3
+ description: List available trading symbols, get detailed symbol information, or fetch the latest tick for a symbol from the MT5 API. Use when the user wants to browse symbols, look up symbol details, or check current prices.
4
+ allowed-tools: Bash
5
+ ---
6
+
7
+ # MT5 Symbols
8
+
9
+ Query symbol-related endpoints on the mt5api.
10
+
11
+ ## Configuration
12
+
13
+ The API base URL defaults to `http://localhost:8000`. Set `MT5_API_URL` to override.
14
+ All endpoints require the `X-API-Key` header. Set `MT5_API_KEY` in the environment.
15
+
16
+ ## Endpoints
17
+
18
+ ### List Symbols
19
+
20
+ ```bash
21
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
22
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/symbols" | python -m json.tool
23
+ ```
24
+
25
+ Optional query parameters:
26
+
27
+ | Parameter | Type | Description |
28
+ | --------- | ------ | --------------------------------------------- |
29
+ | group | string | Symbol group filter (e.g., `*USD*`, `Forex*`) |
30
+
31
+ Example with filter:
32
+
33
+ ```bash
34
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
35
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/symbols?group=*USD*" | python -m json.tool
36
+ ```
37
+
38
+ ### Get Symbol Info
39
+
40
+ ```bash
41
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
42
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/symbols/EURUSD" | python -m json.tool
43
+ ```
44
+
45
+ Path parameters:
46
+
47
+ | Parameter | Type | Description |
48
+ | --------- | ------ | ---------------------------- |
49
+ | symbol | string | Symbol name (e.g., `EURUSD`) |
50
+
51
+ ### Get Latest Tick
52
+
53
+ ```bash
54
+ curl -s -H "X-API-Key: ${MT5_API_KEY}" \
55
+ "${MT5_API_URL:-http://localhost:8000}/api/v1/symbols/EURUSD/tick" | python -m json.tool
56
+ ```
57
+
58
+ Path parameters:
59
+
60
+ | Parameter | Type | Description |
61
+ | --------- | ------ | ----------- |
62
+ | symbol | string | Symbol name |
63
+
64
+ ## Procedure
65
+
66
+ 1. Identify which symbol operation the user needs (list, info, or tick).
67
+ 2. Substitute the correct symbol name and optional filters into the URL.
68
+ 3. Run the `curl` command and parse the JSON response.
69
+ 4. Summarize the results, highlighting key fields such as bid/ask prices, spread, symbol properties, or available symbols.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: speckit-analyze
3
+ description: Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
4
+ allowed-tools: Bash, Read, Grep, Glob
5
+ ---
6
+
7
+ # Spec-Kit Analyze
8
+
9
+ Cross-artifact consistency and quality analysis for feature specifications. Validation step after creating tasks.md.
10
+
11
+ ## When to Use
12
+
13
+ - After creating tasks.md with `speckit-tasks`
14
+ - Before starting implementation with `speckit-implement`
15
+ - Need to identify gaps or conflicts before coding
16
+
17
+ ## Execution Workflow
18
+
19
+ **STRICTLY READ-ONLY** - Does not modify any files.
20
+
21
+ 1. **Initialize analysis context**: Run `.specify/scripts/bash/check-prerequisites.sh --json --require-tasks --include-tasks` to get FEATURE_DIR and AVAILABLE_DOCS. Derive paths:
22
+ - SPEC = FEATURE_DIR/spec.md
23
+ - PLAN = FEATURE_DIR/plan.md
24
+ - TASKS = FEATURE_DIR/tasks.md
25
+ - CONSTITUTION = .specify/memory/constitution.md
26
+ 2. **Load artifacts** (progressive disclosure - minimal context):
27
+ - From spec.md: Overview, Functional Requirements, Non-Functional Requirements, User Stories, Edge Cases
28
+ - From plan.md: Architecture/stack choices, Data Model references, Phases, Technical constraints
29
+ - From tasks.md: Task IDs, Descriptions, Phase grouping, Parallel markers `[P]`, File paths
30
+ - From constitution.md: Project principles, MUST/SHOULD requirements
31
+ 3. **Build semantic models** (internal representations):
32
+ - Requirements inventory with stable keys
33
+ - User story/action inventory with acceptance criteria
34
+ - Task coverage mapping (maps tasks to requirements)
35
+ - Constitution rule set (principle names and normative statements)
36
+ 4. **Detection passes** (maximum 50 findings total - aggregate overflow):
37
+ - **Duplication**: Near-duplicate requirements, lower-quality phrasing
38
+ - **Ambiguity**: Vague adjectives (fast, scalable, secure, intuitive, robust), unresolved placeholders (TODO, ???, `<placeholder>`)
39
+ - **Underspecification**: Requirements missing object/outcome, user stories missing acceptance criteria, tasks referencing undefined files
40
+ - **Constitution Alignment**: Conflicts with MUST principles (ALWAYS CRITICAL), missing mandated sections/gates
41
+ - **Coverage Gaps**: Requirements with zero tasks, tasks with no mapped requirement, missing non-functional task coverage
42
+ - **Inconsistency**: Terminology drift, data entities in plan but not spec, task ordering contradictions, conflicting requirements
43
+ 5. **Severity assignment**:
44
+ - CRITICAL: Violates constitution MUST, missing core spec artifact, requirement with zero coverage blocking baseline
45
+ - HIGH: Duplicate or conflicting requirement, ambiguous security/performance attribute, untestable acceptance criterion
46
+ - MEDIUM: Terminology drift, missing non-functional task coverage, underspecified edge case
47
+ - LOW: Style/wording improvements, minor redundancy
48
+ 6. **Produce compact analysis report** (Markdown, no file writes):
49
+ - Findings table: ID, Category, Severity, Location(s), Summary, Recommendation
50
+ - Coverage summary: Requirement → Tasks mapping
51
+ - Constitution alignment issues table
52
+ - Unmapped tasks table
53
+ - Metrics: Total requirements, total tasks, coverage %, ambiguity count, duplication count, critical/high/medium/low issues
54
+ 7. **Next actions**:
55
+ - If CRITICAL: Must resolve before implementation
56
+ - If only LOW/MEDIUM: May proceed with improvements recommended
57
+ - Provide explicit command suggestions
58
+ 8. **Offer remediation**: Ask if user wants concrete edit suggestions (not applied automatically)
59
+
60
+ ## Key Points
61
+
62
+ - **NEVER modify files** - read-only analysis
63
+ - **Constitution violations are ALWAYS CRITICAL** - non-negotiable
64
+ - **Progressive disclosure** - load artifacts incrementally, don't dump all content
65
+ - **Token-efficient output** - tables over prose, limit to 50 findings, aggregate overflow
66
+ - **Deterministic results** - rerunning without changes produces consistent IDs and counts
67
+ - **Coverage % guidelines**:
68
+ - 100%: Perfect (rare)
69
+ - 80-99%: Excellent
70
+ - 60-79%: Good (review gaps)
71
+ - < 60%: Poor (significant gaps)
72
+ - **Report zero issues gracefully** - emit success report with coverage statistics
73
+
74
+ ## Next Steps
75
+
76
+ After analysis:
77
+
78
+ - **Fix CRITICAL** - Update spec/plan/tasks
79
+ - **Start implementation** - Use `speckit-implement`
80
+ - **Re-analyze** - After fixes to verify
81
+
82
+ ## See Also
83
+
84
+ - `speckit-plan` - Create technical implementation strategy
85
+ - `speckit-tasks` - Break plan into actionable tasks
86
+ - `speckit-implement` - Execute implementation plan
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: speckit-checklist
3
+ description: Generate a custom checklist for the current feature based on user requirements.
4
+ allowed-tools: Bash, Read, Write, Grep, Glob
5
+ ---
6
+
7
+ # Spec-Kit Checklist
8
+
9
+ Generate requirement quality validation checklists. "Unit Tests for English" - validates requirements are complete, clear, and consistent.
10
+
11
+ ## Core Concept: Unit Tests for Requirements
12
+
13
+ **CRITICAL:** Checklists test **REQUIREMENTS QUALITY**, not implementation.
14
+
15
+ **❌ NOT for verification/testing:**
16
+
17
+ - "Verify button clicks correctly"
18
+ - "Test error handling works"
19
+ - "Confirm API returns 200"
20
+ - Checking if code matches spec
21
+
22
+ **✅ FOR requirements quality:**
23
+
24
+ - "Are visual hierarchy requirements defined for all card types?" [Completeness]
25
+ - "Is 'prominent display' quantified with specific sizing?" [Clarity]
26
+ - "Are hover state requirements consistent across interactive elements?" [Consistency]
27
+ - "Are accessibility requirements defined for keyboard navigation?" [Coverage]
28
+ - "Does spec define fallback when logo image fails to load?" [Edge Cases]
29
+
30
+ **Metaphor:** If your spec is code written in English, the checklist is its unit test suite.
31
+
32
+ ## When to Use
33
+
34
+ - After creating spec.md or plan.md
35
+ - Before implementation to validate requirements
36
+ - For PR review quality gates
37
+ - Need to ensure requirements are implementation-ready
38
+
39
+ ## Execution Workflow
40
+
41
+ 1. **Setup**: Run `.specify/scripts/bash/check-prerequisites.sh --json` to get FEATURE_DIR and AVAILABLE_DOCS
42
+ 2. **Clarify intent** (dynamic, up to 3 questions):
43
+ - Generate from user phrasing + extracted signals from spec/plan/tasks
44
+ - Only ask about information that materially changes checklist content
45
+ - Skip if already unambiguous in user input
46
+ - Generation algorithm:
47
+ - Extract signals: domain keywords, risk indicators, stakeholder hints, explicit deliverables
48
+ - Cluster into candidate focus areas (max 4) ranked by relevance
49
+ - Identify probable audience & timing if not explicit
50
+ - Detect missing dimensions: scope breadth, depth/rigor, risk emphasis, exclusion boundaries
51
+ - Formulate questions from archetypes: scope refinement, risk prioritization, depth calibration, audience framing, boundary exclusion, scenario class gap
52
+ - Question formatting: compact table with Option | Candidate | Why It Matters
53
+ - Defaults when interaction impossible: Depth=Standard, Audience=Reviewer (PR)
54
+ 3. **Understand user request**: Combine user input + clarifying answers to derive checklist theme, must-have items, focus selections
55
+ 4. **Load feature context**: Read spec.md, plan.md (if exists), tasks.md (if exists) - only necessary portions, summarize long sections
56
+ 5. **Generate checklist**:
57
+ - Create `FEATURE_DIR/checklists/` directory if doesn't exist
58
+ - Generate unique filename: `[domain].md` (e.g., ux.md, api.md, security.md)
59
+ - Each run creates NEW file (never overwrites existing checklists)
60
+ - Number items sequentially starting from CHK001
61
+ - **Soft cap: 40 items** - if more candidates, prioritize by risk/impact and merge near-duplicates
62
+ 6. **Checklist structure** - Group items by requirement quality dimensions:
63
+ - Requirement Completeness (are all necessary requirements documented?)
64
+ - Requirement Clarity (are requirements specific and unambiguous?)
65
+ - Requirement Consistency (do requirements align without conflicts?)
66
+ - Acceptance Criteria Quality (are success criteria measurable?)
67
+ - Scenario Coverage (are all flows/cases addressed?)
68
+ - Edge Case Coverage (are boundary conditions defined?)
69
+ - Non-Functional Requirements (are performance, security, accessibility specified?)
70
+ - Dependencies & Assumptions (are they documented and validated?)
71
+ - Ambiguities & Conflicts (what needs clarification?)
72
+ 7. **Item structure**: Each item follows pattern:
73
+ - `- [ ] CHK### - [Question about requirement quality]? [Dimension, Reference]`
74
+ - Question format focusing on what's WRITTEN (or missing) in spec
75
+ - Quality dimension marker: [Completeness/Clarity/Consistency/Coverage/Measurability/etc.]
76
+ - Traceability: [Spec §X.Y] or [Gap] or [Ambiguity] or [Conflict]
77
+ - MINIMUM: ≥80% of items MUST include traceability reference
78
+ 8. **Report**: Output full path, item count, focus areas, depth level, actor/timing
79
+
80
+ ## Key Points
81
+
82
+ - **Test requirements, NOT implementation**
83
+ - WRONG: "Verify landing page displays 3 episode cards"
84
+ - CORRECT: "Are the number and layout of featured episodes explicitly specified? [Completeness, Spec §FR-001]"
85
+ - **Question format** - "Are requirements X...?" not "Does system X...?"
86
+ - **Add traceability** - Reference spec sections or mark gaps (≥80% requirement)
87
+ - **Focus scope** - One domain per checklist (UX, API, Security, etc.)
88
+ - **Balance depth** - 15-40 items for focused, actionable validation
89
+ - **Content consolidation** - Soft cap 40 items, merge near-duplicates, prioritize by risk/impact
90
+ - **Prohibited patterns** - Any item starting with "Verify", "Test", "Confirm", "Check" + implementation behavior
91
+ - **Required patterns** - "Are [requirement type] defined/specified/documented for [scenario]?"
92
+
93
+ ## Next Steps
94
+
95
+ After creating checklist:
96
+
97
+ - **Use for PR reviews** - Validate spec/plan before approval
98
+ - **Self-review** - Author validates own requirements
99
+ - **QA validation** - Ensure testable acceptance criteria
100
+ - **Implementation** - Use `speckit-implement` after validation
101
+
102
+ ## See Also
103
+
104
+ - `speckit-specify` - Create feature specifications
105
+ - `speckit-plan` - Create technical implementation strategy
106
+ - `speckit-implement` - Execute implementation plan