hatch3r 1.0.0 → 1.2.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 +93 -322
- package/agents/hatch3r-a11y-auditor.md +24 -6
- package/agents/hatch3r-architect.md +20 -1
- package/agents/hatch3r-ci-watcher.md +31 -8
- package/agents/hatch3r-context-rules.md +14 -2
- package/agents/hatch3r-dependency-auditor.md +21 -5
- package/agents/hatch3r-devops.md +37 -6
- package/agents/hatch3r-docs-writer.md +19 -3
- package/agents/hatch3r-fixer.md +171 -0
- package/agents/hatch3r-implementer.md +84 -11
- package/agents/hatch3r-learnings-loader.md +69 -13
- package/agents/hatch3r-lint-fixer.md +19 -14
- package/agents/hatch3r-perf-profiler.md +18 -1
- package/agents/hatch3r-researcher.md +440 -5
- package/agents/hatch3r-reviewer.md +97 -5
- package/agents/hatch3r-security-auditor.md +23 -5
- package/agents/hatch3r-test-writer.md +21 -10
- package/checks/README.md +49 -0
- package/checks/code-quality.md +49 -0
- package/checks/performance.md +58 -0
- package/checks/security.md +58 -0
- package/checks/testing.md +53 -0
- package/commands/board/pickup-azure-devops.md +81 -0
- package/commands/board/pickup-delegation-multi.md +197 -0
- package/commands/board/pickup-delegation.md +100 -0
- package/commands/board/pickup-github.md +82 -0
- package/commands/board/pickup-gitlab.md +81 -0
- package/commands/board/pickup-modes.md +143 -0
- package/commands/board/pickup-post-impl.md +120 -0
- package/commands/board/shared-azure-devops.md +149 -0
- package/commands/board/shared-board-overview.md +215 -0
- package/commands/board/shared-github.md +169 -0
- package/commands/board/shared-gitlab.md +142 -0
- package/commands/hatch3r-agent-customize.md +40 -2
- package/commands/hatch3r-api-spec.md +294 -32
- package/commands/hatch3r-benchmark.md +386 -32
- package/commands/hatch3r-board-fill.md +161 -25
- package/commands/hatch3r-board-groom.md +595 -0
- package/commands/hatch3r-board-init.md +203 -46
- package/commands/hatch3r-board-pickup.md +79 -457
- package/commands/hatch3r-board-refresh.md +98 -27
- package/commands/hatch3r-board-shared.md +87 -238
- package/commands/hatch3r-bug-plan.md +16 -3
- package/commands/hatch3r-codebase-map.md +43 -10
- package/commands/hatch3r-command-customize.md +6 -0
- package/commands/hatch3r-context-health.md +5 -0
- package/commands/hatch3r-cost-tracking.md +5 -0
- package/commands/hatch3r-debug.md +426 -0
- package/commands/hatch3r-dep-audit.md +7 -1
- package/commands/hatch3r-feature-plan.md +74 -12
- package/commands/hatch3r-healthcheck.md +17 -1
- package/commands/hatch3r-hooks.md +16 -10
- package/commands/hatch3r-learn.md +15 -9
- package/commands/hatch3r-migration-plan.md +333 -33
- package/commands/hatch3r-onboard.md +327 -38
- package/commands/hatch3r-project-spec.md +46 -10
- package/commands/hatch3r-quick-change.md +336 -0
- package/commands/hatch3r-recipe.md +6 -0
- package/commands/hatch3r-refactor-plan.md +29 -13
- package/commands/hatch3r-release.md +13 -3
- package/commands/hatch3r-revision.md +395 -0
- package/commands/hatch3r-roadmap.md +18 -3
- package/commands/hatch3r-rule-customize.md +6 -0
- package/commands/hatch3r-security-audit.md +17 -1
- package/commands/hatch3r-skill-customize.md +6 -0
- package/commands/hatch3r-test-plan.md +532 -0
- package/commands/hatch3r-workflow.md +113 -38
- package/dist/cli/index.js +5184 -2593
- package/dist/cli/index.js.map +1 -0
- package/github-agents/hatch3r-docs-agent.md +1 -0
- package/github-agents/hatch3r-lint-agent.md +1 -0
- package/github-agents/hatch3r-security-agent.md +1 -0
- package/github-agents/hatch3r-test-agent.md +1 -0
- package/hooks/hatch3r-ci-failure.md +30 -0
- package/hooks/hatch3r-file-save.md +22 -0
- package/hooks/hatch3r-post-merge.md +23 -0
- package/hooks/hatch3r-pre-commit.md +23 -0
- package/hooks/hatch3r-pre-push.md +22 -0
- package/hooks/hatch3r-session-start.md +22 -0
- package/mcp/mcp.json +22 -3
- package/package.json +4 -7
- package/prompts/hatch3r-bug-triage.md +1 -0
- package/prompts/hatch3r-code-review.md +1 -0
- package/prompts/hatch3r-pr-description.md +1 -0
- package/rules/hatch3r-accessibility-standards.md +1 -0
- package/rules/hatch3r-agent-orchestration.md +326 -53
- package/rules/hatch3r-agent-orchestration.mdc +225 -0
- package/rules/hatch3r-api-design.md +4 -1
- package/rules/hatch3r-browser-verification.md +33 -1
- package/rules/hatch3r-browser-verification.mdc +29 -0
- package/rules/hatch3r-ci-cd.md +5 -1
- package/rules/hatch3r-ci-cd.mdc +4 -1
- package/rules/hatch3r-code-standards.md +18 -0
- package/rules/hatch3r-code-standards.mdc +10 -1
- package/rules/hatch3r-component-conventions.md +4 -1
- package/rules/hatch3r-data-classification.md +1 -0
- package/rules/hatch3r-deep-context.md +94 -0
- package/rules/hatch3r-deep-context.mdc +69 -0
- package/rules/hatch3r-dependency-management.md +13 -0
- package/rules/hatch3r-feature-flags.md +4 -1
- package/rules/hatch3r-git-conventions.md +1 -0
- package/rules/hatch3r-i18n.md +4 -1
- package/rules/hatch3r-learning-consult.md +4 -2
- package/rules/hatch3r-learning-consult.mdc +3 -2
- package/rules/hatch3r-migrations.md +12 -0
- package/rules/hatch3r-observability.md +293 -1
- package/rules/hatch3r-performance-budgets.md +5 -2
- package/rules/hatch3r-performance-budgets.mdc +1 -1
- package/rules/hatch3r-secrets-management.md +11 -3
- package/rules/hatch3r-secrets-management.mdc +10 -3
- package/rules/hatch3r-security-patterns.md +23 -3
- package/rules/hatch3r-security-patterns.mdc +8 -2
- package/rules/hatch3r-testing.md +1 -0
- package/rules/hatch3r-theming.md +4 -1
- package/rules/hatch3r-tooling-hierarchy.md +42 -15
- package/rules/hatch3r-tooling-hierarchy.mdc +27 -4
- package/skills/hatch3r-a11y-audit/SKILL.md +1 -0
- package/skills/hatch3r-agent-customize/SKILL.md +3 -0
- package/skills/hatch3r-api-spec/SKILL.md +1 -0
- package/skills/hatch3r-architecture-review/SKILL.md +6 -2
- package/skills/hatch3r-bug-fix/SKILL.md +4 -1
- package/skills/hatch3r-ci-pipeline/SKILL.md +1 -0
- package/skills/hatch3r-command-customize/SKILL.md +1 -0
- package/skills/hatch3r-context-health/SKILL.md +2 -1
- package/skills/hatch3r-cost-tracking/SKILL.md +1 -0
- package/skills/hatch3r-dep-audit/SKILL.md +6 -2
- package/skills/hatch3r-feature/SKILL.md +9 -2
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +130 -21
- package/skills/hatch3r-incident-response/SKILL.md +11 -5
- package/skills/hatch3r-issue-workflow/SKILL.md +12 -7
- package/skills/hatch3r-logical-refactor/SKILL.md +1 -0
- package/skills/hatch3r-migration/SKILL.md +1 -0
- package/skills/hatch3r-perf-audit/SKILL.md +2 -1
- package/skills/hatch3r-pr-creation/SKILL.md +20 -10
- package/skills/hatch3r-qa-validation/SKILL.md +2 -1
- package/skills/hatch3r-recipe/SKILL.md +1 -0
- package/skills/hatch3r-refactor/SKILL.md +7 -1
- package/skills/hatch3r-release/SKILL.md +15 -11
- package/skills/hatch3r-rule-customize/SKILL.md +1 -0
- package/skills/hatch3r-skill-customize/SKILL.md +1 -0
- package/skills/hatch3r-visual-refactor/SKILL.md +1 -0
- package/dist/cli/hooks-ZOTFDEA3.js +0 -59
- package/rules/hatch3r-error-handling.md +0 -17
- package/rules/hatch3r-error-handling.mdc +0 -15
package/rules/hatch3r-i18n.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: hatch3r-i18n
|
|
3
|
+
type: rule
|
|
2
4
|
description: Internationalization, localization, and RTL support conventions for the project
|
|
5
|
+
scope: conditional
|
|
3
6
|
globs: src/**/*.vue, src/**/*.tsx, src/**/*.jsx, src/**/*.ts
|
|
4
|
-
|
|
7
|
+
tags: [implementation]
|
|
5
8
|
---
|
|
6
9
|
# Internationalization & RTL
|
|
7
10
|
|
|
@@ -3,14 +3,15 @@ id: hatch3r-learning-consult
|
|
|
3
3
|
type: rule
|
|
4
4
|
description: Auto-consult project learnings before implementation
|
|
5
5
|
scope: always
|
|
6
|
+
tags: [core]
|
|
6
7
|
---
|
|
7
8
|
# Learning Consultation
|
|
8
9
|
|
|
9
|
-
Before implementing any task, check
|
|
10
|
+
Before implementing any task, check `.agents/learnings/` for relevant past learnings.
|
|
10
11
|
|
|
11
12
|
## Consultation Process
|
|
12
13
|
|
|
13
|
-
1. If
|
|
14
|
+
1. If `.agents/learnings/` exists and contains files:
|
|
14
15
|
- Scan learning file frontmatter for matching `tags` or `area` that overlap with the current task.
|
|
15
16
|
- Read the `## Applies When` section of potential matches.
|
|
16
17
|
- Surface relevant learnings to the developer/agent before implementation begins.
|
|
@@ -20,6 +21,7 @@ Before implementing any task, check `/.agents/learnings/` for relevant past lear
|
|
|
20
21
|
|
|
21
22
|
- During `hatch3r-board-pickup` Step 6: consult learnings before implementation delegation.
|
|
22
23
|
- During `hatch3r-board-fill` Step 4: consult learnings when scoping and estimating issues.
|
|
24
|
+
- During `hatch3r-board-groom` Step 4c: consult learnings when re-scoping or reclassifying existing issues.
|
|
23
25
|
- During any skill execution: check for relevant pitfalls before coding.
|
|
24
26
|
|
|
25
27
|
## Learning Priority
|
|
@@ -4,11 +4,11 @@ alwaysApply: true
|
|
|
4
4
|
---
|
|
5
5
|
# Learning Consultation
|
|
6
6
|
|
|
7
|
-
Before implementing any task, check
|
|
7
|
+
Before implementing any task, check `.agents/learnings/` for relevant past learnings.
|
|
8
8
|
|
|
9
9
|
## Consultation Process
|
|
10
10
|
|
|
11
|
-
1. If
|
|
11
|
+
1. If `.agents/learnings/` exists and contains files:
|
|
12
12
|
- Scan learning file frontmatter for matching `tags` or `area` that overlap with the current task.
|
|
13
13
|
- Read the `## Applies When` section of potential matches.
|
|
14
14
|
- Surface relevant learnings to the developer/agent before implementation begins.
|
|
@@ -18,6 +18,7 @@ Before implementing any task, check `/.agents/learnings/` for relevant past lear
|
|
|
18
18
|
|
|
19
19
|
- During `hatch3r-board-pickup` Step 6: consult learnings before implementation delegation.
|
|
20
20
|
- During `hatch3r-board-fill` Step 4: consult learnings when scoping and estimating issues.
|
|
21
|
+
- During `hatch3r-board-groom` Step 4c: consult learnings when re-scoping or reclassifying existing issues.
|
|
21
22
|
- During any skill execution: check for relevant pitfalls before coding.
|
|
22
23
|
|
|
23
24
|
## Learning Priority
|
|
@@ -3,6 +3,7 @@ id: hatch3r-migrations
|
|
|
3
3
|
type: rule
|
|
4
4
|
description: Database migration and schema change patterns for the project
|
|
5
5
|
scope: always
|
|
6
|
+
tags: [implementation, brownfield]
|
|
6
7
|
---
|
|
7
8
|
# Migrations
|
|
8
9
|
|
|
@@ -15,3 +16,14 @@ scope: always
|
|
|
15
16
|
- Document schema changes in project data model spec.
|
|
16
17
|
- Rollback plan required for every migration. Never run destructive migrations without backup verification.
|
|
17
18
|
- Hot documents must stay within size limits after migration.
|
|
19
|
+
|
|
20
|
+
## Data Validation During Migration
|
|
21
|
+
|
|
22
|
+
- Validate data integrity after each migration step, not just at the end. Check that migrated records match the expected schema, required fields are populated, and no data was silently dropped.
|
|
23
|
+
- Include count checks: the number of records processed should match the number of records in the source collection. Log discrepancies as errors, not warnings.
|
|
24
|
+
- For large datasets, migrate in batches with progress checkpoints. If a batch fails, resume from the last checkpoint rather than restarting the entire migration.
|
|
25
|
+
|
|
26
|
+
## Migration Coordination in Multi-Service Environments
|
|
27
|
+
|
|
28
|
+
- When a migration affects shared data (e.g., a schema used by multiple services), coordinate the migration order across services. The consuming services must be deployed with backward-compatible readers before the migration runs.
|
|
29
|
+
- Never assume that all service instances will be running the same code version during a migration window. Design migrations to tolerate mixed-version reads and writes during the rollout period.
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: hatch3r-observability
|
|
3
|
+
type: rule
|
|
2
4
|
description: Logging, metrics, and tracing conventions for the project
|
|
3
|
-
|
|
5
|
+
scope: conditional
|
|
6
|
+
tags: [devops]
|
|
4
7
|
---
|
|
5
8
|
# Observability
|
|
6
9
|
|
|
@@ -163,3 +166,292 @@ Every telemetry-producing service must declare resource attributes at startup:
|
|
|
163
166
|
- Attribute values should be low-cardinality. Never use unbounded values (full URLs with query params, raw SQL, user-generated content) as attribute values.
|
|
164
167
|
- For high-cardinality identifiers (user IDs, request IDs), use span attributes sparingly and rely on correlated logs for detail.
|
|
165
168
|
- Prefer semantic convention attributes over custom attributes. When custom attributes are necessary, prefix them with your organization or project namespace (e.g., `myapp.feature.flag_key`).
|
|
169
|
+
|
|
170
|
+
### AI Agent Semantic Conventions
|
|
171
|
+
|
|
172
|
+
Follow the [OpenTelemetry GenAI Semantic Conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/) (experimental, introduced 2024) for instrumenting AI/LLM agent systems. These conventions provide consistent attribute naming for generative AI operations, enabling interoperability across agent frameworks and observability backends.
|
|
173
|
+
|
|
174
|
+
#### `gen_ai.*` Span Attributes
|
|
175
|
+
|
|
176
|
+
Use these attributes on all spans that represent interactions with generative AI models:
|
|
177
|
+
|
|
178
|
+
| Attribute | Type | Description | Example |
|
|
179
|
+
|-----------|------|-------------|---------|
|
|
180
|
+
| `gen_ai.system` | string | The GenAI provider system name | `openai`, `anthropic`, `azure_openai` |
|
|
181
|
+
| `gen_ai.request.model` | string | Model name as specified in the request | `gpt-4o`, `claude-sonnet-4-20250514` |
|
|
182
|
+
| `gen_ai.response.model` | string | Model name as returned in the response (may differ from request) | `gpt-4o-2024-08-06` |
|
|
183
|
+
| `gen_ai.request.max_tokens` | int | Maximum number of tokens requested for generation | `4096` |
|
|
184
|
+
| `gen_ai.request.temperature` | float | Temperature parameter sent in the request | `0.7` |
|
|
185
|
+
| `gen_ai.request.top_p` | float | Top-p (nucleus sampling) parameter | `0.9` |
|
|
186
|
+
| `gen_ai.response.finish_reasons` | string[] | Reasons the model stopped generating | `["stop"]`, `["length"]`, `["tool_calls"]` |
|
|
187
|
+
| `gen_ai.usage.input_tokens` | int | Number of tokens in the input/prompt | `1250` |
|
|
188
|
+
| `gen_ai.usage.output_tokens` | int | Number of tokens in the generated output | `530` |
|
|
189
|
+
|
|
190
|
+
- Always set `gen_ai.system` and `gen_ai.request.model` on every GenAI span. These are required for meaningful filtering and cost attribution.
|
|
191
|
+
- Record `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` from the API response to enable token usage dashboards and cost tracking.
|
|
192
|
+
- Use `gen_ai.response.finish_reasons` to detect truncated outputs (`length`) and trigger re-prompting or alerting logic.
|
|
193
|
+
|
|
194
|
+
#### Agent Invocation Spans
|
|
195
|
+
|
|
196
|
+
Instrument the full lifecycle of an agent invocation with a dedicated span. This span is the parent for all LLM calls, tool executions, and sub-agent delegations within a single agent run.
|
|
197
|
+
|
|
198
|
+
- **Span name pattern:** `agent.{agent_name}.invoke` (e.g., `agent.code_reviewer.invoke`, `agent.research_assistant.invoke`)
|
|
199
|
+
- **Required attributes:**
|
|
200
|
+
|
|
201
|
+
| Attribute | Type | Description | Example |
|
|
202
|
+
|-----------|------|-------------|---------|
|
|
203
|
+
| `agent.id` | string | Unique identifier for this agent invocation | `agent-run-a1b2c3d4` |
|
|
204
|
+
| `agent.name` | string | Logical name of the agent | `code_reviewer` |
|
|
205
|
+
| `agent.parent_id` | string | ID of the parent agent (for sub-agent delegation chains) | `agent-run-x9y8z7` |
|
|
206
|
+
| `agent.task` | string | High-level description of the agent's assigned task | `review PR #42` |
|
|
207
|
+
| `agent.framework` | string | Agent framework in use | `langchain`, `autogen`, `custom` |
|
|
208
|
+
|
|
209
|
+
- **Span events for state transitions:** Record span events to mark key lifecycle transitions within the agent invocation:
|
|
210
|
+
- `agent.planning` — Agent begins task decomposition or reasoning.
|
|
211
|
+
- `agent.tool_selection` — Agent selects a tool to invoke.
|
|
212
|
+
- `agent.awaiting_human` — Agent pauses for human-in-the-loop confirmation.
|
|
213
|
+
- `agent.delegating` — Agent spawns a sub-agent.
|
|
214
|
+
- `agent.completed` — Agent finishes its task and produces a final output.
|
|
215
|
+
- `agent.error` — Agent encounters a non-recoverable error. Include `exception.type` and `exception.message` attributes on the event.
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
const agentSpan = tracer.startSpan('agent.code_reviewer.invoke', {
|
|
219
|
+
attributes: {
|
|
220
|
+
'agent.id': invocationId,
|
|
221
|
+
'agent.name': 'code_reviewer',
|
|
222
|
+
'agent.parent_id': parentAgentId ?? '',
|
|
223
|
+
'agent.task': `review PR #${prNumber}`,
|
|
224
|
+
'agent.framework': 'custom',
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
agentSpan.addEvent('agent.planning');
|
|
229
|
+
// ... agent reasoning and tool calls happen as child spans ...
|
|
230
|
+
agentSpan.addEvent('agent.completed');
|
|
231
|
+
agentSpan.end();
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Tool Call Spans
|
|
235
|
+
|
|
236
|
+
Every tool invocation by an agent creates a child span of the agent invocation span. This enables tracing the full sequence of tool calls within an agent run, measuring tool latency, and detecting tool failures.
|
|
237
|
+
|
|
238
|
+
- **Span name pattern:** `tool.{tool_name}.execute` (e.g., `tool.file_read.execute`, `tool.web_search.execute`)
|
|
239
|
+
- **Required attributes:**
|
|
240
|
+
|
|
241
|
+
| Attribute | Type | Description | Example |
|
|
242
|
+
|-----------|------|-------------|---------|
|
|
243
|
+
| `tool.name` | string | Canonical name of the tool | `file_read`, `git_diff`, `web_search` |
|
|
244
|
+
| `tool.input_hash` | string | SHA-256 hash of the tool input (for deduplication, not logging raw input) | `sha256:3a7f...` |
|
|
245
|
+
| `tool.output_status` | string | Outcome of the tool execution | `success`, `error`, `timeout`, `rejected` |
|
|
246
|
+
| `tool.duration_ms` | float | Wall-clock execution time of the tool in milliseconds | `142.5` |
|
|
247
|
+
| `tool.parameters_count` | int | Number of parameters passed to the tool | `3` |
|
|
248
|
+
|
|
249
|
+
- **Parent-child relationship:** Tool spans must be children of the invoking agent span. Use `context.with(trace.setSpan(context.active(), agentSpan))` to propagate the agent span context to tool execution.
|
|
250
|
+
- Set span status to `ERROR` when `tool.output_status` is `error` or `timeout`. Attach exception details as a span event.
|
|
251
|
+
- For tools that perform I/O (HTTP requests, file system operations, database queries), create nested child spans using the appropriate semantic conventions (`http.*`, `db.*`) under the tool span.
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
const toolSpan = tracer.startSpan(
|
|
255
|
+
'tool.git_diff.execute',
|
|
256
|
+
{ attributes: { 'tool.name': 'git_diff' } },
|
|
257
|
+
trace.setSpan(context.active(), agentSpan),
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
const startTime = performance.now();
|
|
261
|
+
try {
|
|
262
|
+
const result = await tools.gitDiff(params);
|
|
263
|
+
toolSpan.setAttributes({
|
|
264
|
+
'tool.output_status': 'success',
|
|
265
|
+
'tool.duration_ms': performance.now() - startTime,
|
|
266
|
+
'tool.input_hash': hashInput(params),
|
|
267
|
+
});
|
|
268
|
+
} catch (err) {
|
|
269
|
+
toolSpan.setAttributes({
|
|
270
|
+
'tool.output_status': 'error',
|
|
271
|
+
'tool.duration_ms': performance.now() - startTime,
|
|
272
|
+
});
|
|
273
|
+
toolSpan.setStatus({ code: SpanStatusCode.ERROR, message: err.message });
|
|
274
|
+
toolSpan.recordException(err);
|
|
275
|
+
throw err;
|
|
276
|
+
} finally {
|
|
277
|
+
toolSpan.end();
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### LLM Request/Response Tracing
|
|
282
|
+
|
|
283
|
+
Instrument every LLM API call with a dedicated span. These spans are typically children of an agent invocation span and capture model, token usage, and latency data for cost analysis and performance monitoring.
|
|
284
|
+
|
|
285
|
+
- **Span name pattern:** `gen_ai.{operation}` (e.g., `gen_ai.chat`, `gen_ai.completion`, `gen_ai.embeddings`)
|
|
286
|
+
- **Required attributes:** All applicable `gen_ai.*` attributes from the table above, plus:
|
|
287
|
+
|
|
288
|
+
| Attribute | Type | Description | Example |
|
|
289
|
+
|-----------|------|-------------|---------|
|
|
290
|
+
| `gen_ai.operation.name` | string | The specific API operation | `chat`, `completion`, `embeddings` |
|
|
291
|
+
| `gen_ai.request.stop_sequences` | string[] | Stop sequences sent in the request | `["\n\n", "END"]` |
|
|
292
|
+
| `server.address` | string | Hostname of the GenAI API endpoint | `api.openai.com` |
|
|
293
|
+
| `server.port` | int | Port of the GenAI API endpoint | `443` |
|
|
294
|
+
|
|
295
|
+
- **Input/output token tracking:** Always capture `gen_ai.usage.input_tokens` and `gen_ai.usage.output_tokens` from the API response. Aggregate these in metrics for cost dashboards:
|
|
296
|
+
- Counter: `gen_ai.tokens_total` with labels `{direction=input|output, model, agent_name}`
|
|
297
|
+
- Histogram: `gen_ai.request_duration_ms` with labels `{model, operation, agent_name}`
|
|
298
|
+
|
|
299
|
+
- **Model version tracking:** Record both `gen_ai.request.model` (what was requested) and `gen_ai.response.model` (what was actually used). API providers may silently route to different model versions; capturing both enables drift detection.
|
|
300
|
+
|
|
301
|
+
- **Error handling and retry spans:** When an LLM request fails and is retried, each attempt is a separate child span under the same parent. Record the error on the failed span and create a new span for the retry:
|
|
302
|
+
- Set `gen_ai.request.retries` (int) on the final successful span to indicate total retry count.
|
|
303
|
+
- Record `http.response.status_code` on failed spans to distinguish rate-limit errors (429) from server errors (500+).
|
|
304
|
+
- Use exponential backoff; the retry span's start time naturally captures the wait duration.
|
|
305
|
+
|
|
306
|
+
```typescript
|
|
307
|
+
const llmSpan = tracer.startSpan(
|
|
308
|
+
'gen_ai.chat',
|
|
309
|
+
{
|
|
310
|
+
attributes: {
|
|
311
|
+
'gen_ai.system': 'openai',
|
|
312
|
+
'gen_ai.operation.name': 'chat',
|
|
313
|
+
'gen_ai.request.model': 'gpt-4o',
|
|
314
|
+
'gen_ai.request.max_tokens': 4096,
|
|
315
|
+
'gen_ai.request.temperature': 0.2,
|
|
316
|
+
'server.address': 'api.openai.com',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
trace.setSpan(context.active(), agentSpan),
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
try {
|
|
323
|
+
const response = await openai.chat.completions.create({ /* ... */ });
|
|
324
|
+
llmSpan.setAttributes({
|
|
325
|
+
'gen_ai.response.model': response.model,
|
|
326
|
+
'gen_ai.response.finish_reasons': response.choices.map(c => c.finish_reason),
|
|
327
|
+
'gen_ai.usage.input_tokens': response.usage.prompt_tokens,
|
|
328
|
+
'gen_ai.usage.output_tokens': response.usage.completion_tokens,
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
// Record token usage in metrics for cost tracking
|
|
332
|
+
tokenCounter.add(response.usage.prompt_tokens, {
|
|
333
|
+
direction: 'input', model: response.model, agent_name: agentName,
|
|
334
|
+
});
|
|
335
|
+
tokenCounter.add(response.usage.completion_tokens, {
|
|
336
|
+
direction: 'output', model: response.model, agent_name: agentName,
|
|
337
|
+
});
|
|
338
|
+
} catch (err) {
|
|
339
|
+
llmSpan.setStatus({ code: SpanStatusCode.ERROR, message: err.message });
|
|
340
|
+
llmSpan.recordException(err);
|
|
341
|
+
throw err;
|
|
342
|
+
} finally {
|
|
343
|
+
llmSpan.end();
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
- Never log raw prompt content or full model responses as span attributes — these are high-cardinality and may contain sensitive data. Use `gen_ai.usage.*` token counts for cost tracking and correlated logs for prompt debugging in non-production environments.
|
|
348
|
+
- In production, sample GenAI spans at a higher rate than general spans (e.g., 50-100%) because each call is expensive and lower volume than typical HTTP traffic. Adjust sampling based on call volume and observability budget.
|
|
349
|
+
|
|
350
|
+
### Tool Call Audit Trail
|
|
351
|
+
|
|
352
|
+
Maintain a structured audit log for every tool invocation in agentic workflows. This log is separate from tracing spans and serves as an immutable compliance and debugging record.
|
|
353
|
+
|
|
354
|
+
#### Schema Definition
|
|
355
|
+
|
|
356
|
+
Every tool call audit log entry must include the following fields:
|
|
357
|
+
|
|
358
|
+
| Field | Type | Description |
|
|
359
|
+
|-------|------|-------------|
|
|
360
|
+
| `tool.name` | string | Name of the tool invoked |
|
|
361
|
+
| `tool.input_hash` | string | SHA-256 hash of the tool input (for privacy, never log raw input) |
|
|
362
|
+
| `tool.output_status` | string | Outcome of the tool execution: `success`, `error`, `timeout`, or `denied` |
|
|
363
|
+
| `tool.duration_ms` | float | Execution time in milliseconds |
|
|
364
|
+
| `agent.id` | string | ID of the agent that invoked the tool |
|
|
365
|
+
| `agent.name` | string | Human-readable agent name |
|
|
366
|
+
| `correlation.id` | string | Trace correlation ID linking this entry to the broader workflow |
|
|
367
|
+
| `timestamp` | string | ISO 8601 timestamp of the invocation |
|
|
368
|
+
| `session.id` | string | Session identifier for grouping related tool calls |
|
|
369
|
+
|
|
370
|
+
#### Logging Requirements
|
|
371
|
+
|
|
372
|
+
- Log every tool invocation at `info` level with the full schema above.
|
|
373
|
+
- Log tool failures at `error` level with additional `error.type` and `error.message` fields describing the failure.
|
|
374
|
+
- Aggregate tool call counts per agent per session for anomaly detection (e.g., an agent invoking an unusual number of tools may indicate a loop or misconfiguration).
|
|
375
|
+
- Retain audit logs for a minimum of 90 days to support post-incident investigation and compliance review.
|
|
376
|
+
|
|
377
|
+
#### Example Log Entry
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"timestamp": "2026-02-15T14:32:07.891Z",
|
|
382
|
+
"level": "info",
|
|
383
|
+
"correlation.id": "agent-run-550e8400-e29b-41d4-a716-446655440000",
|
|
384
|
+
"session.id": "sess-8f14e45f-ceea-467f-a8f0-3b5c6d7e8f9a",
|
|
385
|
+
"agent.id": "agent-run-a1b2c3d4",
|
|
386
|
+
"agent.name": "code_reviewer",
|
|
387
|
+
"tool.name": "git_diff",
|
|
388
|
+
"tool.input_hash": "sha256:3a7f2c9e8b1d4f6a0e5c7b9d2f4a6e8c0b3d5f7a9e1c3b5d7f9a2c4e6b8d0f",
|
|
389
|
+
"tool.output_status": "success",
|
|
390
|
+
"tool.duration_ms": 142.5
|
|
391
|
+
}
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Correlation IDs for Agent Workflows
|
|
395
|
+
|
|
396
|
+
Correlation IDs provide the connective thread linking all telemetry signals (logs, spans, metrics) across a multi-agent workflow. Every participant in the workflow uses the same correlation ID, enabling end-to-end traceability from the initial trigger through all agent delegations and tool calls.
|
|
397
|
+
|
|
398
|
+
#### ID Generation
|
|
399
|
+
|
|
400
|
+
- Use UUIDv4 for correlation IDs. Generate the ID at the workflow entry point (the first agent invocation or the orchestrator that initiates the run).
|
|
401
|
+
- Format: `{workflow-type}-{uuid}` (e.g., `agent-run-550e8400-e29b-41d4-a716-446655440000`, `review-flow-7c9e6679-7425-40de-944b-e07fc1f90ae7`).
|
|
402
|
+
- The workflow-type prefix provides human-readable context when scanning logs and makes it possible to filter by workflow category without parsing the full ID.
|
|
403
|
+
|
|
404
|
+
#### Propagation
|
|
405
|
+
|
|
406
|
+
- The correlation ID propagates from the parent agent to all sub-agents via context. Pass it explicitly when delegating to sub-agents or invoking tools.
|
|
407
|
+
- Every log entry, span, and metric produced during the workflow must include the `correlation.id` attribute.
|
|
408
|
+
- When crossing process boundaries (e.g., HTTP calls between services), propagate the correlation ID via a custom header (`X-Correlation-ID`) alongside standard W3C Trace Context headers.
|
|
409
|
+
|
|
410
|
+
#### Parent-Child Span Linking
|
|
411
|
+
|
|
412
|
+
- The parent agent's span ID becomes the `parent_span_id` attribute on child agent spans, establishing a clear hierarchy in trace visualizations.
|
|
413
|
+
- For cross-workflow references (e.g., an agent run triggered by a CI pipeline event), use OpenTelemetry `SpanLink` to connect the agent workflow trace to the originating trace without creating a parent-child relationship.
|
|
414
|
+
- SpanLinks preserve the independence of each workflow trace while enabling navigation between related workflows in the observability backend.
|
|
415
|
+
|
|
416
|
+
#### Implementation Pattern
|
|
417
|
+
|
|
418
|
+
```typescript
|
|
419
|
+
import { randomUUID } from 'node:crypto';
|
|
420
|
+
import { context, trace, SpanStatusCode } from '@opentelemetry/api';
|
|
421
|
+
|
|
422
|
+
function generateCorrelationId(workflowType: string): string {
|
|
423
|
+
return `${workflowType}-${randomUUID()}`;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
async function runAgentWorkflow(task: string): Promise<void> {
|
|
427
|
+
const correlationId = generateCorrelationId('agent-run');
|
|
428
|
+
const tracer = trace.getTracer('agent-orchestrator');
|
|
429
|
+
|
|
430
|
+
const rootSpan = tracer.startSpan('agent.orchestrator.invoke', {
|
|
431
|
+
attributes: {
|
|
432
|
+
'correlation.id': correlationId,
|
|
433
|
+
'agent.name': 'orchestrator',
|
|
434
|
+
'agent.task': task,
|
|
435
|
+
},
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
const ctx = trace.setSpan(context.active(), rootSpan);
|
|
439
|
+
|
|
440
|
+
try {
|
|
441
|
+
// Sub-agent inherits the correlation ID from context
|
|
442
|
+
await context.with(ctx, async () => {
|
|
443
|
+
await delegateToSubAgent('code_reviewer', {
|
|
444
|
+
correlationId,
|
|
445
|
+
parentSpanId: rootSpan.spanContext().spanId,
|
|
446
|
+
task: 'review changes',
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
} catch (err) {
|
|
450
|
+
rootSpan.setStatus({ code: SpanStatusCode.ERROR, message: (err as Error).message });
|
|
451
|
+
rootSpan.recordException(err as Error);
|
|
452
|
+
throw err;
|
|
453
|
+
} finally {
|
|
454
|
+
rootSpan.end();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
```
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: hatch3r-performance-budgets
|
|
3
|
+
type: rule
|
|
2
4
|
description: Performance budgets and targets for the project
|
|
3
|
-
|
|
5
|
+
scope: conditional
|
|
6
|
+
tags: [performance]
|
|
4
7
|
---
|
|
5
8
|
# Performance Budgets
|
|
6
9
|
|
|
@@ -105,5 +108,5 @@ Targets align with Google's "Good" thresholds (measured at p75 from real user da
|
|
|
105
108
|
| Memory / CPU | Chrome DevTools, profiler | Infrastructure metrics (Prometheus) |
|
|
106
109
|
| Visual regression | Playwright screenshot diffing | RUM CLS tracking |
|
|
107
110
|
|
|
108
|
-
- Automated regression detection: compare each PR's metrics against the
|
|
111
|
+
- Automated regression detection: compare each PR's metrics against the default branch baseline (`board.defaultBranch` from `.agents/hatch.json`; fallback: `"main"`). Flag regressions > 5% in any budget metric.
|
|
109
112
|
- Review performance budgets quarterly and tighten thresholds as the application matures.
|
|
@@ -105,5 +105,5 @@ Targets align with Google's "Good" thresholds (measured at p75 from real user da
|
|
|
105
105
|
| Memory / CPU | Chrome DevTools, profiler | Infrastructure metrics (Prometheus) |
|
|
106
106
|
| Visual regression | Playwright screenshot diffing | RUM CLS tracking |
|
|
107
107
|
|
|
108
|
-
- Automated regression detection: compare each PR's metrics against the
|
|
108
|
+
- Automated regression detection: compare each PR's metrics against the default branch baseline (`board.defaultBranch` from `.agents/hatch.json`; fallback: `"main"`). Flag regressions > 5% in any budget metric.
|
|
109
109
|
- Review performance budgets quarterly and tighten thresholds as the application matures.
|
|
@@ -3,6 +3,7 @@ id: hatch3r-secrets-management
|
|
|
3
3
|
type: rule
|
|
4
4
|
description: Secret management, rotation, and secure handling patterns for the project
|
|
5
5
|
scope: always
|
|
6
|
+
tags: [security]
|
|
6
7
|
---
|
|
7
8
|
# Secrets Management
|
|
8
9
|
|
|
@@ -42,9 +43,13 @@ scope: always
|
|
|
42
43
|
## CI/CD Secret Injection
|
|
43
44
|
|
|
44
45
|
- **GitHub Actions:** Store secrets in repository or organization settings. Reference via `${{ secrets.SECRET_NAME }}`. Never echo secrets in workflow logs — use masking (`::add-mask::`). Use environment-scoped secrets for production deployments with required reviewers.
|
|
46
|
+
- **Azure DevOps Pipelines:** Store secrets as pipeline variables marked "secret" or in Azure Key Vault linked variable groups. Reference via `$(SECRET_NAME)`. Use service connections with scoped permissions. Never log secret variables — Azure automatically masks variables marked as secret.
|
|
45
47
|
- **GitLab CI:** Store in project or group CI/CD variables. Mark as "Protected" (only available on protected branches) and "Masked" (redacted from logs). Use file-type variables for multi-line secrets (certificates, keys).
|
|
46
|
-
- **General CI principles:** Secrets must not appear in build logs, artifacts, or cached layers. Pin CI action versions by SHA (not
|
|
47
|
-
- **Ephemeral secrets:** For CI jobs that need temporary cloud access, use OIDC federation
|
|
48
|
+
- **General CI principles:** Secrets must not appear in build logs, artifacts, or cached layers. Pin CI action/task versions by SHA or exact version (not mutable tags) to prevent supply chain attacks on secret-accessing workflows. Rotate CI secrets on the same schedule as application secrets.
|
|
49
|
+
- **Ephemeral secrets:** For CI jobs that need temporary cloud access, use OIDC federation instead of long-lived credentials:
|
|
50
|
+
- **GitHub Actions:** `aws-actions/configure-aws-credentials` with OIDC
|
|
51
|
+
- **Azure DevOps:** Workload Identity Federation with service connections
|
|
52
|
+
- **GitLab CI:** OIDC ID tokens via `id_tokens` keyword
|
|
48
53
|
|
|
49
54
|
## Application-Level Secret Handling
|
|
50
55
|
|
|
@@ -59,7 +64,10 @@ scope: always
|
|
|
59
64
|
|
|
60
65
|
- **gitleaks:** Run `gitleaks detect` in CI on every push and PR. Configure `.gitleaks.toml` with project-specific rules and allowlists for false positives (test fixtures, documentation examples).
|
|
61
66
|
- **TruffleHog:** Use `trufflehog git` for historical scanning of the full repository. Run quarterly or on suspected compromise. Focus on high-entropy strings and known secret patterns.
|
|
62
|
-
- **
|
|
67
|
+
- **Platform secret scanning:** Enable the platform's built-in secret scanning and push protection:
|
|
68
|
+
- **GitHub:** GitHub Secret Scanning with push protection. Configure custom patterns for project-specific secret formats.
|
|
69
|
+
- **Azure DevOps:** Microsoft Defender for DevOps or Credential Scanner task in pipelines.
|
|
70
|
+
- **GitLab:** GitLab Secret Detection CI template (`Secret-Detection.gitlab-ci.yml`). Configure custom rulesets for project-specific patterns.
|
|
63
71
|
- **Pre-commit hooks:** Install a local pre-commit hook (e.g., `gitleaks protect --staged`) to catch secrets before they reach the remote. This is defense-in-depth — CI scanning is still required.
|
|
64
72
|
- **Remediation SLA:** Secrets detected in CI must be rotated immediately (within 1 hour for production secrets). Assume any secret that reached a commit is compromised, even if the commit was force-pushed away — git history is recoverable.
|
|
65
73
|
|
|
@@ -40,9 +40,13 @@ alwaysApply: true
|
|
|
40
40
|
## CI/CD Secret Injection
|
|
41
41
|
|
|
42
42
|
- **GitHub Actions:** Store secrets in repository or organization settings. Reference via `${{ secrets.SECRET_NAME }}`. Never echo secrets in workflow logs — use masking (`::add-mask::`). Use environment-scoped secrets for production deployments with required reviewers.
|
|
43
|
+
- **Azure DevOps Pipelines:** Store secrets as pipeline variables marked "secret" or in Azure Key Vault linked variable groups. Reference via `$(SECRET_NAME)`. Use service connections with scoped permissions. Never log secret variables — Azure automatically masks variables marked as secret.
|
|
43
44
|
- **GitLab CI:** Store in project or group CI/CD variables. Mark as "Protected" (only available on protected branches) and "Masked" (redacted from logs). Use file-type variables for multi-line secrets (certificates, keys).
|
|
44
|
-
- **General CI principles:** Secrets must not appear in build logs, artifacts, or cached layers. Pin CI action versions by SHA (not
|
|
45
|
-
- **Ephemeral secrets:** For CI jobs that need temporary cloud access, use OIDC federation
|
|
45
|
+
- **General CI principles:** Secrets must not appear in build logs, artifacts, or cached layers. Pin CI action/task versions by SHA or exact version (not mutable tags) to prevent supply chain attacks on secret-accessing workflows. Rotate CI secrets on the same schedule as application secrets.
|
|
46
|
+
- **Ephemeral secrets:** For CI jobs that need temporary cloud access, use OIDC federation instead of long-lived credentials:
|
|
47
|
+
- **GitHub Actions:** `aws-actions/configure-aws-credentials` with OIDC
|
|
48
|
+
- **Azure DevOps:** Workload Identity Federation with service connections
|
|
49
|
+
- **GitLab CI:** OIDC ID tokens via `id_tokens` keyword
|
|
46
50
|
|
|
47
51
|
## Application-Level Secret Handling
|
|
48
52
|
|
|
@@ -57,7 +61,10 @@ alwaysApply: true
|
|
|
57
61
|
|
|
58
62
|
- **gitleaks:** Run `gitleaks detect` in CI on every push and PR. Configure `.gitleaks.toml` with project-specific rules and allowlists for false positives (test fixtures, documentation examples).
|
|
59
63
|
- **TruffleHog:** Use `trufflehog git` for historical scanning of the full repository. Run quarterly or on suspected compromise. Focus on high-entropy strings and known secret patterns.
|
|
60
|
-
- **
|
|
64
|
+
- **Platform secret scanning:** Enable the platform's built-in secret scanning and push protection:
|
|
65
|
+
- **GitHub:** GitHub Secret Scanning with push protection. Configure custom patterns for project-specific secret formats.
|
|
66
|
+
- **Azure DevOps:** Microsoft Defender for DevOps or Credential Scanner task in pipelines.
|
|
67
|
+
- **GitLab:** GitLab Secret Detection CI template (`Secret-Detection.gitlab-ci.yml`). Configure custom rulesets for project-specific patterns.
|
|
61
68
|
- **Pre-commit hooks:** Install a local pre-commit hook (e.g., `gitleaks protect --staged`) to catch secrets before they reach the remote. This is defense-in-depth — CI scanning is still required.
|
|
62
69
|
- **Remediation SLA:** Secrets detected in CI must be rotated immediately (within 1 hour for production secrets). Assume any secret that reached a commit is compromised, even if the commit was force-pushed away — git history is recoverable.
|
|
63
70
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: hatch3r-security-patterns
|
|
3
|
+
type: rule
|
|
2
4
|
description: Security patterns including input validation, auth enforcement, and AI/agentic security for the project
|
|
3
|
-
|
|
5
|
+
scope: always
|
|
6
|
+
tags: [security]
|
|
4
7
|
---
|
|
5
8
|
# Security Patterns
|
|
6
9
|
|
|
@@ -61,6 +64,11 @@ alwaysApply: true
|
|
|
61
64
|
- Enforce parameter schemas on every tool call. Reject calls with unexpected, missing, or out-of-range arguments.
|
|
62
65
|
- Rate-limit tool invocations per agent per time window. Alert on anomalous tool usage patterns.
|
|
63
66
|
- Sandbox tool execution: restrict file system access, network egress, and subprocess spawning.
|
|
67
|
+
- **MCP server filesystem scope:** MCP servers with filesystem access must be scoped to the minimum necessary directories:
|
|
68
|
+
- Restrict filesystem access to the project directory. MCP servers should never have access to the home directory, system directories, or unrelated project directories.
|
|
69
|
+
- Document which MCP servers have filesystem access and define their intended scope (read-only vs read-write, which directories).
|
|
70
|
+
- Configure `allowedDirectories` in MCP server configs where supported. If the server does not support directory restrictions, document this as a known risk and apply compensating controls (monitoring, read-only mode).
|
|
71
|
+
- Audit MCP server filesystem access on configuration changes. Verify that added servers do not expand the filesystem attack surface beyond the project boundary.
|
|
64
72
|
|
|
65
73
|
### ASI03 — Identity & Privilege Abuse
|
|
66
74
|
|
|
@@ -75,6 +83,12 @@ alwaysApply: true
|
|
|
75
83
|
- Verify package integrity (checksums, signatures) before loading tools or plugins.
|
|
76
84
|
- Audit third-party prompt templates for injected instructions before use.
|
|
77
85
|
- Maintain an allowlist of approved MCP servers and tool sources.
|
|
86
|
+
- **`npx -y` safety:** The `-y` flag auto-confirms installation of unknown packages without prompts, creating a supply chain attack vector:
|
|
87
|
+
- Never use `npx -y` with untrusted, unknown, or typo-squattable package names.
|
|
88
|
+
- Always pin explicit versions when using npx: `npx package@1.2.3` instead of `npx package`.
|
|
89
|
+
- Prefer `npm exec --package=package@version -- command` for critical tooling — it provides explicit version control and avoids silent auto-install.
|
|
90
|
+
- In CI pipelines, install tools as explicit `devDependencies` with pinned versions rather than relying on `npx` at runtime.
|
|
91
|
+
- Verify the package name and publisher on the npm registry before first use. Typosquatting attacks exploit `npx -y` by registering names similar to popular packages.
|
|
78
92
|
|
|
79
93
|
### ASI05 — Unexpected Code Execution
|
|
80
94
|
|
|
@@ -168,7 +182,10 @@ alwaysApply: true
|
|
|
168
182
|
|
|
169
183
|
- Maintain a software bill of materials (SBOM) for all direct and transitive dependencies.
|
|
170
184
|
- Run `npm audit` (or equivalent) in CI on every build. Block merges with critical or high vulnerabilities.
|
|
171
|
-
- Subscribe to security advisories for all critical dependencies
|
|
185
|
+
- Subscribe to security advisories for all critical dependencies using the platform's built-in tools or third-party equivalents:
|
|
186
|
+
- **GitHub:** Dependabot alerts and security advisories
|
|
187
|
+
- **Azure DevOps:** Microsoft Defender for DevOps or WhiteSource/Mend integration
|
|
188
|
+
- **GitLab:** GitLab Dependency Scanning CI template, or Snyk integration
|
|
172
189
|
- Remove unused dependencies. Unused code with known vulnerabilities is still a risk.
|
|
173
190
|
- Pin dependency versions in lockfiles. Review lockfile changes in PRs with the same scrutiny as code changes.
|
|
174
191
|
- Establish SLAs for vulnerability remediation: critical within 24 hours, high within 1 week, moderate within 1 sprint.
|
|
@@ -189,7 +206,10 @@ alwaysApply: true
|
|
|
189
206
|
- CI/CD pipelines: require code review for all changes, enforce branch protection, sign commits where feasible.
|
|
190
207
|
- Never deserialize untrusted data without validation. Use schemas (zod, JSON Schema) to validate structure before processing.
|
|
191
208
|
- Protect CI/CD secrets and permissions: restrict who can modify pipeline configuration, require approval for deployment steps.
|
|
192
|
-
- Pin
|
|
209
|
+
- Pin CI actions/tasks by commit SHA or exact version, not mutable tags:
|
|
210
|
+
- **GitHub Actions:** Pin by commit SHA (e.g., `actions/checkout@abc123`)
|
|
211
|
+
- **Azure DevOps:** Pin pipeline tasks by exact version (e.g., `task@2`)
|
|
212
|
+
- **GitLab CI:** Pin included templates by SHA or tag reference
|
|
193
213
|
|
|
194
214
|
### A09 — Security Logging and Monitoring Failures
|
|
195
215
|
|
|
@@ -168,7 +168,10 @@ alwaysApply: true
|
|
|
168
168
|
|
|
169
169
|
- Maintain a software bill of materials (SBOM) for all direct and transitive dependencies.
|
|
170
170
|
- Run `npm audit` (or equivalent) in CI on every build. Block merges with critical or high vulnerabilities.
|
|
171
|
-
- Subscribe to security advisories for all critical dependencies
|
|
171
|
+
- Subscribe to security advisories for all critical dependencies using the platform's built-in tools or third-party equivalents:
|
|
172
|
+
- **GitHub:** Dependabot alerts and security advisories
|
|
173
|
+
- **Azure DevOps:** Microsoft Defender for DevOps or WhiteSource/Mend integration
|
|
174
|
+
- **GitLab:** GitLab Dependency Scanning CI template, or Snyk integration
|
|
172
175
|
- Remove unused dependencies. Unused code with known vulnerabilities is still a risk.
|
|
173
176
|
- Pin dependency versions in lockfiles. Review lockfile changes in PRs with the same scrutiny as code changes.
|
|
174
177
|
- Establish SLAs for vulnerability remediation: critical within 24 hours, high within 1 week, moderate within 1 sprint.
|
|
@@ -189,7 +192,10 @@ alwaysApply: true
|
|
|
189
192
|
- CI/CD pipelines: require code review for all changes, enforce branch protection, sign commits where feasible.
|
|
190
193
|
- Never deserialize untrusted data without validation. Use schemas (zod, JSON Schema) to validate structure before processing.
|
|
191
194
|
- Protect CI/CD secrets and permissions: restrict who can modify pipeline configuration, require approval for deployment steps.
|
|
192
|
-
- Pin
|
|
195
|
+
- Pin CI actions/tasks by commit SHA or exact version, not mutable tags:
|
|
196
|
+
- **GitHub Actions:** Pin by commit SHA (e.g., `actions/checkout@abc123`)
|
|
197
|
+
- **Azure DevOps:** Pin pipeline tasks by exact version (e.g., `task@2`)
|
|
198
|
+
- **GitLab CI:** Pin included templates by SHA or tag reference
|
|
193
199
|
|
|
194
200
|
### A09 — Security Logging and Monitoring Failures
|
|
195
201
|
|
package/rules/hatch3r-testing.md
CHANGED
package/rules/hatch3r-theming.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
+
id: hatch3r-theming
|
|
3
|
+
type: rule
|
|
2
4
|
description: Theming, dark mode, and color system conventions for the project
|
|
5
|
+
scope: conditional
|
|
3
6
|
globs: src/**/*.vue, src/**/*.tsx, src/**/*.jsx, src/**/*.css, src/**/*.scss
|
|
4
|
-
|
|
7
|
+
tags: [implementation]
|
|
5
8
|
---
|
|
6
9
|
# Theming & Dark Mode
|
|
7
10
|
|