agent-enderun 1.10.2 โ 1.11.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 +34 -44
- package/dist/framework-mcp/src/constants.d.ts +47 -0
- package/dist/framework-mcp/src/constants.js +65 -0
- package/dist/framework-mcp/src/constants.js.map +1 -0
- package/dist/framework-mcp/src/index.js +26 -5
- package/dist/framework-mcp/src/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/locking.d.ts +3 -9
- package/dist/framework-mcp/src/tools/control_plane/locking.js.map +1 -1
- package/dist/framework-mcp/src/tools/control_plane/registry.d.ts +2 -8
- package/dist/framework-mcp/src/tools/control_plane/registry.js.map +1 -1
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.d.ts +2 -2
- package/dist/framework-mcp/src/tools/dashboard/start_dashboard.js.map +1 -1
- package/dist/framework-mcp/src/tools/definitions.js +30 -0
- package/dist/framework-mcp/src/tools/definitions.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js +12 -4
- package/dist/framework-mcp/src/tools/file_system/batch_surgical_edit.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/patch_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js +6 -2
- package/dist/framework-mcp/src/tools/file_system/patch_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/read_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/read_file.js +43 -26
- package/dist/framework-mcp/src/tools/file_system/read_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/replace_text.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/replace_text.js +7 -3
- package/dist/framework-mcp/src/tools/file_system/replace_text.js.map +1 -1
- package/dist/framework-mcp/src/tools/file_system/write_file.d.ts +2 -2
- package/dist/framework-mcp/src/tools/file_system/write_file.js +27 -15
- package/dist/framework-mcp/src/tools/file_system/write_file.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/get_status.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/get_status.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/orchestrate.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/orchestrate.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/run_tests.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/run_tests.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_contract_hash.js.map +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.d.ts +2 -2
- package/dist/framework-mcp/src/tools/framework/update_memory.js +1 -1
- package/dist/framework-mcp/src/tools/framework/update_memory.js.map +1 -1
- package/dist/framework-mcp/src/tools/index.d.ts +1 -2
- package/dist/framework-mcp/src/tools/index.js +33 -25
- package/dist/framework-mcp/src/tools/index.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/log_action.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/log_action.js.map +1 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.d.ts +2 -2
- package/dist/framework-mcp/src/tools/messaging/send_message.js +14 -1
- package/dist/framework-mcp/src/tools/messaging/send_message.js.map +1 -1
- package/dist/framework-mcp/src/tools/observability/check_ports.d.ts +2 -2
- package/dist/framework-mcp/src/tools/observability/check_ports.js.map +1 -1
- package/dist/framework-mcp/src/tools/quality/check_lint.d.ts +5 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js +29 -0
- package/dist/framework-mcp/src/tools/quality/check_lint.js.map +1 -0
- package/dist/framework-mcp/src/tools/search/get_gaps.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_gaps.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/get_map.js +1 -1
- package/dist/framework-mcp/src/tools/search/get_map.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/grep_search.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/grep_search.js +45 -28
- package/dist/framework-mcp/src/tools/search/grep_search.js.map +1 -1
- package/dist/framework-mcp/src/tools/search/list_dir.d.ts +2 -2
- package/dist/framework-mcp/src/tools/search/list_dir.js.map +1 -1
- package/dist/framework-mcp/src/tools/shell/run_command.d.ts +2 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js +47 -0
- package/dist/framework-mcp/src/tools/shell/run_command.js.map +1 -0
- package/dist/framework-mcp/src/tools/types.d.ts +95 -28
- package/dist/framework-mcp/src/utils/metrics.d.ts +20 -0
- package/dist/framework-mcp/src/utils/metrics.js +24 -6
- package/dist/framework-mcp/src/utils/metrics.js.map +1 -1
- package/dist/framework-mcp/src/utils/security.d.ts +1 -3
- package/dist/framework-mcp/src/utils/security.js +21 -18
- package/dist/framework-mcp/src/utils/security.js.map +1 -1
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js +19 -14
- package/dist/framework-mcp/tests/tools/file_system/file_system_tools.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js +1 -1
- package/dist/framework-mcp/tests/tools/messaging/send_message.test.js.map +1 -1
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +36 -0
- package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.d.ts +1 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js +43 -0
- package/dist/framework-mcp/tests/tools/shell/run_command.test.js.map +1 -0
- package/dist/src/cli/adapters/core.d.ts +1 -1
- package/dist/src/cli/adapters/core.js +4 -0
- package/dist/src/cli/adapters/core.js.map +1 -1
- package/dist/src/cli/adapters/index.d.ts +1 -0
- package/dist/src/cli/adapters/index.js +1 -0
- package/dist/src/cli/adapters/index.js.map +1 -1
- package/dist/src/cli/adapters/paths.d.ts +15 -0
- package/dist/src/cli/adapters/paths.js +101 -0
- package/dist/src/cli/adapters/paths.js.map +1 -0
- package/dist/src/cli/adapters/scaffold.d.ts +1 -1
- package/dist/src/cli/adapters/scaffold.js +10 -7
- package/dist/src/cli/adapters/scaffold.js.map +1 -1
- package/dist/src/cli/commands/check.js +15 -36
- package/dist/src/cli/commands/check.js.map +1 -1
- package/dist/src/cli/commands/dashboard/data-service.d.ts +8 -0
- package/dist/src/cli/commands/dashboard/data-service.js +37 -0
- package/dist/src/cli/commands/dashboard/data-service.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-core.d.ts +5 -2
- package/dist/src/cli/commands/init/scaffold-core.js +28 -6
- package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
- package/dist/src/cli/commands/init/scaffold-standards.js +6 -1
- package/dist/src/cli/commands/init/scaffold-standards.js.map +1 -1
- package/dist/src/cli/commands/init.js +30 -6
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/orchestrate.d.ts +11 -6
- package/dist/src/cli/commands/orchestrate.js +148 -128
- package/dist/src/cli/commands/orchestrate.js.map +1 -1
- package/dist/src/cli/commands/plan.d.ts +3 -1
- package/dist/src/cli/commands/plan.js +79 -22
- package/dist/src/cli/commands/plan.js.map +1 -1
- package/dist/src/cli/index.js +11 -15
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/utils/compliance.js +0 -1
- package/dist/src/cli/utils/compliance.js.map +1 -1
- package/dist/src/cli/utils/config-schema.d.ts +7 -7
- package/dist/src/cli/utils/fs.js +1 -1
- package/dist/src/cli/utils/fs.js.map +1 -1
- package/dist/src/cli/utils/memory.d.ts +1 -1
- package/dist/src/cli/utils/memory.js +28 -8
- package/dist/src/cli/utils/memory.js.map +1 -1
- package/dist/src/cli/utils/pkg.d.ts +19 -0
- package/dist/src/cli/utils/pkg.js +29 -5
- package/dist/src/cli/utils/pkg.js.map +1 -1
- package/dist/src/modules/adapters/definitions.js +3 -3
- package/dist/src/modules/adapters/definitions.js.map +1 -1
- package/dist/src/modules/agents/definitions.js +2 -1
- package/dist/src/modules/agents/definitions.js.map +1 -1
- package/dist/src/modules/agents/registry/analyst.js +1 -1
- package/dist/src/modules/agents/registry/analyst.js.map +1 -1
- package/dist/src/modules/agents/registry/architect.js +1 -0
- package/dist/src/modules/agents/registry/architect.js.map +1 -1
- package/dist/src/modules/agents/registry/backend.js +7 -6
- package/dist/src/modules/agents/registry/backend.js.map +1 -1
- package/dist/src/modules/agents/registry/database.js +4 -3
- package/dist/src/modules/agents/registry/database.js.map +1 -1
- package/dist/src/modules/agents/registry/devops.js +1 -1
- package/dist/src/modules/agents/registry/devops.js.map +1 -1
- package/dist/src/modules/agents/registry/git.js +1 -1
- package/dist/src/modules/agents/registry/git.js.map +1 -1
- package/dist/src/modules/agents/registry/manager.js +3 -2
- package/dist/src/modules/agents/registry/manager.js.map +1 -1
- package/dist/src/modules/agents/registry/native.js +1 -1
- package/dist/src/modules/agents/registry/native.js.map +1 -1
- package/dist/src/modules/agents/registry/quality.js +1 -0
- package/dist/src/modules/agents/registry/quality.js.map +1 -1
- package/dist/src/modules/agents/registry/security.js +1 -0
- package/dist/src/modules/agents/registry/security.js.map +1 -1
- package/dist/src/shared/constants.d.ts +113 -0
- package/dist/src/shared/constants.js +178 -0
- package/dist/src/shared/constants.js.map +1 -0
- package/dist/tests/adapters/paths.test.d.ts +1 -0
- package/dist/tests/adapters/paths.test.js +63 -0
- package/dist/tests/adapters/paths.test.js.map +1 -0
- package/dist/tests/approve.test.js +5 -9
- package/dist/tests/approve.test.js.map +1 -1
- package/dist/tests/cli/init/unified_init.test.d.ts +1 -0
- package/dist/tests/cli/init/unified_init.test.js +47 -0
- package/dist/tests/cli/init/unified_init.test.js.map +1 -0
- package/dist/tests/fs-utils.test.js +1 -1
- package/dist/tests/fs-utils.test.js.map +1 -1
- package/dist/tests/memory-utils.test.js +1 -1
- package/dist/tests/memory-utils.test.js.map +1 -1
- package/dist/tests/shared/constants.test.d.ts +1 -0
- package/dist/tests/shared/constants.test.js +17 -0
- package/dist/tests/shared/constants.test.js.map +1 -0
- package/dist/tests/trace.test.js +2 -2
- package/dist/tests/trace.test.js.map +1 -1
- package/framework-mcp/dist/constants.js +64 -0
- package/framework-mcp/dist/index.js +109 -0
- package/framework-mcp/dist/tools/control_plane/locking.js +64 -0
- package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
- package/framework-mcp/dist/tools/dashboard/start_dashboard.js +29 -0
- package/framework-mcp/dist/tools/definitions.js +300 -0
- package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +59 -0
- package/framework-mcp/dist/tools/file_system/patch_file.js +25 -0
- package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
- package/framework-mcp/dist/tools/file_system/replace_text.js +43 -0
- package/framework-mcp/dist/tools/file_system/write_file.js +38 -0
- package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
- package/framework-mcp/dist/tools/framework/get_status.js +5 -0
- package/framework-mcp/dist/tools/framework/orchestrate.js +5 -0
- package/framework-mcp/dist/tools/framework/run_tests.js +25 -0
- package/framework-mcp/dist/tools/framework/update_contract_hash.js +5 -0
- package/framework-mcp/dist/tools/framework/update_memory.js +8 -0
- package/framework-mcp/dist/tools/index.js +62 -0
- package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
- package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
- package/framework-mcp/dist/tools/messaging/log_action.js +22 -0
- package/framework-mcp/dist/tools/messaging/send_message.js +87 -0
- package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
- package/framework-mcp/dist/tools/observability/get_health.js +19 -0
- package/framework-mcp/dist/tools/quality/check_lint.js +28 -0
- package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
- package/framework-mcp/dist/tools/search/get_map.js +43 -0
- package/framework-mcp/dist/tools/search/grep_search.js +76 -0
- package/framework-mcp/dist/tools/search/list_dir.js +28 -0
- package/framework-mcp/dist/tools/shell/run_command.js +46 -0
- package/framework-mcp/dist/tools/types.js +1 -0
- package/framework-mcp/dist/utils/cli.js +20 -0
- package/framework-mcp/dist/utils/compliance.js +29 -0
- package/framework-mcp/dist/utils/fs.js +44 -0
- package/framework-mcp/dist/utils/metrics.js +56 -0
- package/framework-mcp/dist/utils/security.js +60 -0
- package/framework-mcp/package.json +19 -0
- package/framework-mcp/src/constants.ts +78 -0
- package/framework-mcp/src/declarations.d.ts +17 -0
- package/framework-mcp/src/index.ts +132 -0
- package/framework-mcp/src/tools/control_plane/locking.ts +71 -0
- package/framework-mcp/src/tools/control_plane/registry.ts +38 -0
- package/framework-mcp/src/tools/dashboard/start_dashboard.ts +33 -0
- package/framework-mcp/src/tools/definitions.ts +302 -0
- package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +79 -0
- package/framework-mcp/src/tools/file_system/patch_file.ts +33 -0
- package/framework-mcp/src/tools/file_system/read_file.ts +58 -0
- package/framework-mcp/src/tools/file_system/replace_text.ts +52 -0
- package/framework-mcp/src/tools/file_system/write_file.ts +45 -0
- package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
- package/framework-mcp/src/tools/framework/get_status.ts +7 -0
- package/framework-mcp/src/tools/framework/orchestrate.ts +7 -0
- package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
- package/framework-mcp/src/tools/framework/update_contract_hash.ts +7 -0
- package/framework-mcp/src/tools/framework/update_memory.ts +10 -0
- package/framework-mcp/src/tools/index.ts +66 -0
- package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
- package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
- package/framework-mcp/src/tools/messaging/log_action.ts +28 -0
- package/framework-mcp/src/tools/messaging/send_message.ts +89 -0
- package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
- package/framework-mcp/src/tools/observability/get_health.ts +24 -0
- package/framework-mcp/src/tools/quality/check_lint.ts +33 -0
- package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
- package/framework-mcp/src/tools/search/get_map.ts +48 -0
- package/framework-mcp/src/tools/search/grep_search.ts +76 -0
- package/framework-mcp/src/tools/search/list_dir.ts +34 -0
- package/framework-mcp/src/tools/shell/run_command.ts +56 -0
- package/framework-mcp/src/tools/types.ts +89 -0
- package/framework-mcp/src/utils/cli.ts +20 -0
- package/framework-mcp/src/utils/compliance.ts +37 -0
- package/framework-mcp/src/utils/fs.ts +45 -0
- package/framework-mcp/src/utils/metrics.ts +73 -0
- package/framework-mcp/src/utils/security.ts +66 -0
- package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +212 -0
- package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
- package/framework-mcp/tests/tools/quality/check_lint.test.ts +46 -0
- package/framework-mcp/tests/tools/shell/run_command.test.ts +55 -0
- package/framework-mcp/tsconfig.json +14 -0
- package/package.json +9 -7
- package/src/cli/adapters/core.ts +7 -1
- package/src/cli/adapters/index.ts +1 -0
- package/src/cli/adapters/paths.ts +134 -0
- package/src/cli/adapters/scaffold.ts +17 -7
- package/src/cli/commands/check.ts +16 -38
- package/src/cli/commands/dashboard/data-service.ts +48 -0
- package/src/cli/commands/init/scaffold-core.ts +45 -6
- package/src/cli/commands/init/scaffold-standards.ts +6 -1
- package/src/cli/commands/init.ts +32 -6
- package/src/cli/commands/orchestrate.ts +151 -127
- package/src/cli/commands/plan.ts +89 -23
- package/src/cli/index.ts +14 -19
- package/src/cli/utils/compliance.ts +8 -9
- package/src/cli/utils/fs.ts +1 -1
- package/src/cli/utils/memory.ts +32 -7
- package/src/cli/utils/pkg.ts +42 -13
- package/src/modules/adapters/definitions.ts +4 -3
- package/src/modules/agents/definitions.ts +2 -1
- package/src/modules/agents/registry/analyst.ts +1 -1
- package/src/modules/agents/registry/architect.ts +1 -0
- package/src/modules/agents/registry/backend.ts +7 -6
- package/src/modules/agents/registry/database.ts +4 -3
- package/src/modules/agents/registry/devops.ts +1 -1
- package/src/modules/agents/registry/git.ts +1 -1
- package/src/modules/agents/registry/manager.ts +3 -2
- package/src/modules/agents/registry/native.ts +1 -1
- package/src/modules/agents/registry/quality.ts +1 -0
- package/src/modules/agents/registry/security.ts +1 -0
- package/src/shared/constants.ts +212 -0
- package/templates/prompts/bug-fix-recipe.md +20 -0
- package/templates/prompts/contract-design-recipe.md +21 -0
- package/templates/prompts/db-management-recipe.md +25 -0
- package/templates/prompts/deployment-recipe.md +23 -0
- package/templates/prompts/new-feature-recipe.md +19 -0
- package/templates/prompts/performance-optimization-recipe.md +23 -0
- package/templates/prompts/pull-request-template.md +21 -0
- package/templates/prompts/refactoring-recipe.md +21 -0
- package/templates/prompts/security-audit-recipe.md +20 -0
- package/templates/standards/architecture-standards.md +23 -0
- package/templates/standards/auth-standards.md +125 -0
- package/templates/standards/crud-governance.md +21 -0
- package/templates/standards/deployment-standards.md +21 -0
- package/templates/standards/frontend-standards.md +37 -0
- package/templates/standards/github-actions-standards.md +43 -0
- package/templates/standards/i18n-standards.md +17 -0
- package/templates/standards/kysely-standards.md +47 -0
- package/templates/standards/llm-governance.md +15 -0
- package/templates/standards/logging-and-secrets.md +34 -0
- package/templates/standards/mobile-standards.md +23 -0
- package/templates/standards/observability-standards.md +15 -0
- package/templates/standards/performance-standards.md +15 -0
- package/templates/standards/pino-standards.md +46 -0
- package/templates/standards/playwright-standards.md +54 -0
- package/templates/standards/quality-standards.md +31 -0
- package/templates/standards/react-query-standards.md +72 -0
- package/templates/standards/react-router-standards.md +62 -0
- package/templates/standards/security-audit-standards.md +16 -0
- package/templates/standards/security-standards.md +21 -0
- package/templates/standards/swagger-standards.md +50 -0
- package/templates/standards/tailwind-standards.md +20 -0
- package/templates/standards/testing-standards.md +31 -0
- package/templates/standards/typeorm-standards.md +49 -0
- package/templates/standards/vitest-standards.md +110 -0
- package/bin/validate-agent-army.js +0 -148
- package/src/cli/commands/app.ts +0 -56
- package/src/cli/utils/app-backend.ts +0 -257
- package/src/cli/utils/app-docs.ts +0 -83
- package/src/cli/utils/app-frontend.ts +0 -263
- package/src/cli/utils/app-inferrer.ts +0 -63
- package/src/cli/utils/app-mobile.ts +0 -113
- package/src/cli/utils/app-types.ts +0 -248
- package/src/cli/utils/app.ts +0 -6
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# CI/CD Pipeline Standards (GitHub Actions)
|
|
2
|
+
|
|
3
|
+
> Automated quality gates and deployment pipelines.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
GitHub Actions CI/CD pipeline for automated testing, type-checking, and quality assurance.
|
|
8
|
+
|
|
9
|
+
## Pipeline Structure
|
|
10
|
+
|
|
11
|
+
```yaml
|
|
12
|
+
name: CI/CD Pipeline
|
|
13
|
+
on: [push, pull_request]
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
quality:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
21
|
+
with: { node-version: '22' }
|
|
22
|
+
- run: npm ci
|
|
23
|
+
- run: npm run lint
|
|
24
|
+
- run: npm run typecheck
|
|
25
|
+
- run: npm test
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quality Gates
|
|
29
|
+
|
|
30
|
+
1. **TypeScript Check**: Zero type errors (`tsc --noEmit`)
|
|
31
|
+
2. **Lint Check**: ESLint must pass with zero warnings
|
|
32
|
+
3. **Unit Tests**: All tests must pass
|
|
33
|
+
4. **Coverage**: Minimum 80% line coverage
|
|
34
|
+
|
|
35
|
+
## Best Practices
|
|
36
|
+
|
|
37
|
+
1. Run tests on every push and pull request
|
|
38
|
+
2. Cache node_modules for faster builds
|
|
39
|
+
3. Use matrix builds for multi-version testing
|
|
40
|
+
4. Never deploy without passing quality gates
|
|
41
|
+
5. Keep pipeline runs under 10 minutes
|
|
42
|
+
|
|
43
|
+
> **Note**: Deployment is managed by the development team, not automated by this pipeline.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# ๐ Corporate Multi-Language (i18n) Standards
|
|
2
|
+
|
|
3
|
+
This document defines the localization and multi-language management rules for projects managed by Agent Enderun.
|
|
4
|
+
|
|
5
|
+
## 1. Centralized Management
|
|
6
|
+
- **Hardcoded Forbidden:** No text visible to the user shall be written directly into the code (JSX/HTML/TS).
|
|
7
|
+
- **Locales Directory:** All languages are stored as JSON files under `apps/web/public/locales/` or `apps/web/src/locales/`.
|
|
8
|
+
- **Key-Value Standard:** Meaningful and hierarchical keys are used (e.g., `common.buttons.save`, `errors.auth.invalid_password`).
|
|
9
|
+
|
|
10
|
+
## 2. Technical Implementation
|
|
11
|
+
- **i18next:** The `next-i18next` or `react-i18next` library is standard in projects.
|
|
12
|
+
- **Dynamic Content:** i18n interpolation (`{{name}}`) must be used for text containing variables.
|
|
13
|
+
- **Pluralization:** Singular/plural cases must be managed using the i18n library's own rules.
|
|
14
|
+
|
|
15
|
+
## 3. Auditing
|
|
16
|
+
- When the `@frontend` agent creates a new UI component, it automatically moves texts to the relevant JSON files.
|
|
17
|
+
- Missing translation key (missing key) checks are performed by `@quality`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Kysely ORM Standards
|
|
2
|
+
|
|
3
|
+
> Type-safe SQL query builder for TypeScript. Use for database operations.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Kysely, SqliteDialect } from 'kysely';
|
|
9
|
+
import Database from 'better-sqlite3';
|
|
10
|
+
import type { DB } from './types';
|
|
11
|
+
|
|
12
|
+
const dialect = new SqliteDialect({
|
|
13
|
+
database: new Database(process.env.DATABASE_PATH || './dev.db'),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const db = new Kysely<DB>({ dialect });
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Table Definitions
|
|
20
|
+
|
|
21
|
+
Define types in `src/database/kysely/types.ts`:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
export interface UsersTable {
|
|
25
|
+
id: string;
|
|
26
|
+
email: string;
|
|
27
|
+
full_name: string;
|
|
28
|
+
role: string;
|
|
29
|
+
password_hash: string;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
deleted_at: string | null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface DB {
|
|
36
|
+
users: UsersTable;
|
|
37
|
+
customers: CustomersTable;
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Best Practices
|
|
42
|
+
|
|
43
|
+
1. Always use `where("deleted_at", "is", null)` for soft-delete
|
|
44
|
+
2. Use `returningAll()` after insert/update
|
|
45
|
+
3. Use `db.fn.countAll()` for pagination
|
|
46
|
+
4. Keep types in sync with actual schema
|
|
47
|
+
5. Use transactions for multi-step operations
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ๐ค LLM Governance and Data Protection
|
|
2
|
+
|
|
3
|
+
This document outlines the security and discipline rules for interacting with Large Language Models within Enderun-managed projects.
|
|
4
|
+
|
|
5
|
+
## 1. Trust Zone
|
|
6
|
+
- **Input Sanitization:** All user-provided data must be sanitized before being sent to an LLM context to prevent Prompt Injection attacks.
|
|
7
|
+
- **PII Protection:** Absolutely no Personally Identifiable Information (PII) or customer-sensitive credentials should ever be included in prompts.
|
|
8
|
+
|
|
9
|
+
## 2. Token Discipline
|
|
10
|
+
- **Context Pruning:** Agents must proactively clear unnecessary context and follow the memory pruning protocol (`.enderun/memory/archive/`) to maintain prompt efficiency.
|
|
11
|
+
- **Prompt Scoping:** Prompts should be scoped to the minimum required knowledge to prevent "Context Drift".
|
|
12
|
+
|
|
13
|
+
## 3. Autonomous Behavior
|
|
14
|
+
- **Human-in-the-Loop:** Any action marked as `ACTION` category requiring state mutation must trigger an approval flow.
|
|
15
|
+
- **Escalation:** If an agent encounters an ambiguity that exceeds its capability (capability < 9), it must stop and escalate to `@manager`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# ๐ชต Corporate Logging and Secret Management (.env) Standards
|
|
2
|
+
|
|
3
|
+
This document defines the logging discipline and sensitive data (secret) management rules for projects managed by the Agent Enderun army.
|
|
4
|
+
|
|
5
|
+
## 1. Logging Discipline (Zero Console Policy)
|
|
6
|
+
- **console.log Forbidden:** The use of `console.log`, `console.warn`, or `console.error` in production code is strictly forbidden.
|
|
7
|
+
- **Enterprise Logger Usage:** All logging operations must be performed via the project's central logger system (`src/shared/logger.ts`).
|
|
8
|
+
```typescript
|
|
9
|
+
import { logger } from "@/shared/logger";
|
|
10
|
+
|
|
11
|
+
logger.info("User logged in", { userId: "..." });
|
|
12
|
+
logger.error("Database connection error", { error: "..." });
|
|
13
|
+
```
|
|
14
|
+
- **Log Levels:**
|
|
15
|
+
- `DEBUG`: Detailed technical information during development.
|
|
16
|
+
- `INFO`: Normal system flow (e.g., service started, task completed).
|
|
17
|
+
- `WARN`: Situations that are not errors but require attention.
|
|
18
|
+
- `ERROR`: Errors that do not break system operation but require investigation.
|
|
19
|
+
- `FATAL`: Critical errors that cause system crashes.
|
|
20
|
+
|
|
21
|
+
## 2. Secret Management and .env Discipline
|
|
22
|
+
- **Sensitive Data (Secrets):** API keys, database passwords, JWT secrets, and private keys are NEVER hardcoded into the code.
|
|
23
|
+
- **.env Usage:** All sensitive data and environment-specific settings are managed via the `.env` file.
|
|
24
|
+
- **.env.example:** An up-to-date `.env.example` file must always exist in the root directory of the project. This file should contain only the keys, not the actual values.
|
|
25
|
+
- **Dynamic Checks:** Agents must verify the absence of a value in the `.env` file before application runtime.
|
|
26
|
+
|
|
27
|
+
## 3. Security and PII (Personally Identifiable Information) Discipline
|
|
28
|
+
- **Git Ignored:** The `.env` file must always be included in `.gitignore` and never committed to the source control system.
|
|
29
|
+
- **Secret Masking:** Sensitive technical data such as passwords, credit card numbers, or API keys must never be written clearly in logs (they must be masked using `***` or similar).
|
|
30
|
+
- **PII Governance (GDPR/KVKK):**
|
|
31
|
+
- Real user data (Emails, Phone Numbers, Full Names, National IDs) must NEVER be logged or stored in agent memories.
|
|
32
|
+
- If a task requires processing PII, use anonymized placeholders or unique hashes in logs.
|
|
33
|
+
- **@security** agent must audit any new log entry for potential PII leakage.
|
|
34
|
+
- **Zero-Trust Memory:** Ajan hafฤฑzalarฤฑ (PROJECT_MEMORY.md) asla gerรงek mรผลteri verisi iรงermemelidir; sadece teknik meta-data ve mimari kararlar saklanmalฤฑdฤฑr.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# ๐ฑ Corporate Mobile Development Standards (React Native / Expo)
|
|
2
|
+
|
|
3
|
+
This document defines the strict rules and performance standards in mobile application development processes.
|
|
4
|
+
|
|
5
|
+
## 1. Technology Stack and Structure
|
|
6
|
+
- **Framework:** Expo (Managed Workflow) and React Native.
|
|
7
|
+
- **Styling:** `react-native-reanimated` and type-safe style objects or Tailwind (NativeWind).
|
|
8
|
+
- **Navigation:** Expo Router (File-based navigation) and Safe Link structures.
|
|
9
|
+
|
|
10
|
+
## 2. Design for Every Screen (Responsive Mobile Layout)
|
|
11
|
+
- **Screen Resolution Independence:** Fixed `px` widths and heights should never be used. Instead, flexbox ratios, percentage widths, and dynamic values from the `useWindowDimensions` hook should be used.
|
|
12
|
+
- **SafeArea Security:** All screen structures must be wrapped with `SafeAreaProvider` and `SafeAreaView` (or dynamic `insets` object) from `react-native-safe-area-context` to prevent collision with notched screens, status bars, and home indicators.
|
|
13
|
+
- **Font Sizes and Accessibility:** To prevent text truncation or overflow when system font sizes are changed (Accessibility Font Scaling), `numberOfLines` / `ellipsizeMode` should be used in `Text` components or containers providing dynamic height should be designed.
|
|
14
|
+
- **Orientation Adaptation:** Interfaces should be adaptable to both portrait and landscape usage scenarios; especially on tablets, double-column (Master-Detail) or Grid layouts should be adjusted based on dynamic screen aspect ratios.
|
|
15
|
+
|
|
16
|
+
## 3. Performance and Fluidity
|
|
17
|
+
- **Performant Lists:** To maintain performance in large data lists, `FlashList` (Shopify) must be used instead of `ScrollView` or `FlatList`.
|
|
18
|
+
- **Image Resources:** Images should be cached with `expo-image`, WebP formats should be preferred for fast loading, and aspect ratios (`contentFit`) should be preserved when scaling.
|
|
19
|
+
- **Touch Targets:** All touch interaction areas must be at least `44dp x 44dp`.
|
|
20
|
+
|
|
21
|
+
## 4. Hardware and Offline Operation
|
|
22
|
+
- **Permissions:** Sensitive permissions (location, camera, notifications) should only be requested when the feature is used, and the reason should be clearly shown to the user.
|
|
23
|
+
- **Offline First:** Network requests should be cached with `React Query`; MMKV (or SQLite) should be used for local persistent storage.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ๐ Observability and Monitoring Standards
|
|
2
|
+
|
|
3
|
+
This document defines the requirements for logging, tracing, and observability within Enderun-managed projects.
|
|
4
|
+
|
|
5
|
+
## 1. Traceability
|
|
6
|
+
- **Trace ID Enforcement:** Every single request, message, or task delegated between agents must include the active `Trace ID` in its metadata.
|
|
7
|
+
- **Context Logging:** Logs must be structured in JSON format where possible, containing at least: `timestamp`, `level`, `agentName`, `traceId`, `action`, and `message`.
|
|
8
|
+
|
|
9
|
+
## 2. Audit Trail
|
|
10
|
+
- **High-Risk Actions:** All administrative or high-risk actions (e.g., DB changes, User role updates) must be recorded in `observability/audit_log.md` with a timestamp, actor agent, and outcome.
|
|
11
|
+
- **Immutable Logs:** Audit logs should be appended only and never modified or deleted.
|
|
12
|
+
|
|
13
|
+
## 3. Monitoring
|
|
14
|
+
- **Health Checks:** Ajanlar periyodik olarak `get_system_health` aracฤฑnฤฑ รงaฤฤฑrmalฤฑdฤฑr.
|
|
15
|
+
- **Alerting:** Critical errors or timeouts must immediately trigger an `ALERT` message to the `@manager` agent for escalation.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ๐ Performance Monitoring Standards
|
|
2
|
+
|
|
3
|
+
This document defines the metrics and monitoring requirements to ensure the Enderun Army operates at peak efficiency.
|
|
4
|
+
|
|
5
|
+
## 1. Core Metrics
|
|
6
|
+
- **Task Latency (Completion Time):** Time from task delegation (`PENDING`) to completion (`SUCCESS`) must be tracked.
|
|
7
|
+
- **Token Consumption:** The total LLM tokens used per `Trace ID` must be logged and analyzed to identify inefficient prompts.
|
|
8
|
+
- **Agent Error Rates:** The frequency of `FAILED` or `RETRY` statuses per agent must be monitored.
|
|
9
|
+
|
|
10
|
+
## 2. Telemetry Implementation
|
|
11
|
+
- **Standardized Logging:** Every task completion event must include the `Trace ID`, the duration (in milliseconds), and the tool/agent interaction summary.
|
|
12
|
+
- **Performance Budgeting:** Each agent role has an estimated token budget. Budget overflows must be reported by the `@analyst` agent.
|
|
13
|
+
|
|
14
|
+
## 3. Bottleneck Identification
|
|
15
|
+
- **Critical Path Analysis:** Agents identified as bottlenecking the orchestration loop (frequent `WAITING` or `BLOCKED` states) must be reviewed for logic optimization.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Logging Standards
|
|
2
|
+
|
|
3
|
+
> Structured logging with Pino for Node.js applications.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Pino is a fast, low-overhead structured logger. All logs must be in JSON format for production.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install pino
|
|
13
|
+
npm install -D pino-pretty
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Configuration
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { pino } from "pino";
|
|
20
|
+
|
|
21
|
+
const logger = pino({
|
|
22
|
+
transport: process.env.NODE_ENV === "development"
|
|
23
|
+
? { target: "pino-pretty", options: { colorize: true, translateTime: "HH:MM:ss Z" } }
|
|
24
|
+
: undefined,
|
|
25
|
+
level: process.env.LOG_LEVEL || "info",
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { logger };
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
logger.info("Server started on port 4000");
|
|
35
|
+
logger.error({ err }, "Failed to connect to database");
|
|
36
|
+
logger.warn({ userId, action: "rate_limit" }, "Rate limit exceeded");
|
|
37
|
+
logger.debug({ query, params }, "Executing database query");
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Best Practices
|
|
41
|
+
|
|
42
|
+
1. Always pass Error objects as first argument: `logger.error({ err }, "msg")`
|
|
43
|
+
2. Use structured context objects instead of string interpolation
|
|
44
|
+
3. Never log sensitive data (passwords, tokens, PII)
|
|
45
|
+
4. Use child loggers for request-scoped logging
|
|
46
|
+
5. Set appropriate log levels (debug for dev, info for prod)
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# E2E Testing Standards (Playwright)
|
|
2
|
+
|
|
3
|
+
> End-to-end testing for web applications.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Playwright provides cross-browser E2E testing with auto-waiting and network interception.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -D @playwright/test
|
|
13
|
+
npx playwright install
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Test Structure
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
e2e/
|
|
20
|
+
โโโ auth.spec.ts # Login/logout flows
|
|
21
|
+
โโโ customers.spec.ts # Customer CRUD flows
|
|
22
|
+
โโโ navigation.spec.ts # Navigation & routing
|
|
23
|
+
โโโ fixtures/
|
|
24
|
+
โโโ auth.fixture.ts # Authenticated test context
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example Test
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { test, expect } from "@playwright/test";
|
|
31
|
+
|
|
32
|
+
test("user can login and see dashboard", async ({ page }) => {
|
|
33
|
+
await page.goto("/login");
|
|
34
|
+
await page.fill("[name=email]", "admin@example.com");
|
|
35
|
+
await page.fill("[name=password]", "password123");
|
|
36
|
+
await page.click("button[type=submit]");
|
|
37
|
+
await expect(page.locator("text=Dashboard")).toBeVisible();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test("admin can view customers list", async ({ page }) => {
|
|
41
|
+
await page.goto("/customers");
|
|
42
|
+
await expect(page.locator("table")).toBeVisible();
|
|
43
|
+
await expect(page.locator("text=Northwind")).toBeVisible();
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Best Practices
|
|
48
|
+
|
|
49
|
+
1. Test critical user flows (login, CRUD, navigation)
|
|
50
|
+
2. Use page objects for reusable test actions
|
|
51
|
+
3. Run tests in CI pipeline on every push
|
|
52
|
+
4. Use fixtures for authenticated test contexts
|
|
53
|
+
5. Keep tests independent โ no shared state
|
|
54
|
+
6. Use data-testid attributes for reliable selectors
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# โ๏ธ Corporate Code Quality and Discipline (Linting & Standards)
|
|
2
|
+
|
|
3
|
+
This document defines the technical discipline rules that all code produced by the Agent Enderun army must comply with. The goal is zero errors, maximum readability, and sustainability.
|
|
4
|
+
|
|
5
|
+
## 1. TypeScript Discipline
|
|
6
|
+
- **Strict Mode:** `strict: true` is mandatory in all projects.
|
|
7
|
+
- **No Explicit Any:** The use of `any` is strictly forbidden. `unknown` should be used for uncertain types and verified with type guards.
|
|
8
|
+
- **Exhaustive Checks:** All cases must be checked (exhaustive) in `switch-case` structures, or safety must be provided with the `never` type.
|
|
9
|
+
|
|
10
|
+
## 2. ESLint and Static Analysis
|
|
11
|
+
- **Zero Warnings:** No ESLint warnings or errors can exist in the codebase.
|
|
12
|
+
- **Naming Conventions:**
|
|
13
|
+
- Variables and functions: `camelCase`
|
|
14
|
+
- Classes and Types: `PascalCase`
|
|
15
|
+
- Constants: `UPPER_SNAKE_CASE`
|
|
16
|
+
- File names: `kebab-case`
|
|
17
|
+
- **Imports:** Unused imports should be automatically cleaned, and the import order should be regular.
|
|
18
|
+
|
|
19
|
+
## 3. Formatting (Prettier)
|
|
20
|
+
- **Consistency:** Uniform formatting is mandatory in all files.
|
|
21
|
+
- **Indentation:** 4 spaces.
|
|
22
|
+
- **Quotes:** Use of double quotes (`"`).
|
|
23
|
+
- **Semicolons:** Each statement must end with a semicolon (`;`).
|
|
24
|
+
|
|
25
|
+
## 4. Error Handling
|
|
26
|
+
- **No Silent Failures:** Empty `catch` blocks are forbidden. Every error must at least be logged or passed to the upper layer.
|
|
27
|
+
- **Custom Errors:** Project-specific `AppError` classes should be used for business logic errors.
|
|
28
|
+
|
|
29
|
+
## 5. Audit Loop
|
|
30
|
+
- **Pre-commit:** `npm run lint` and `npm run type-check` must be run before code is committed.
|
|
31
|
+
- **@quality Audit:** All changes are audited by the `@quality` agent according to these standards.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# React Query (TanStack Query) Standards
|
|
2
|
+
|
|
3
|
+
> Server state management for React applications.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
React Query handles server state: caching, background refetching, optimistic updates, and pagination.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @tanstack/react-query
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Provider Setup
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
19
|
+
|
|
20
|
+
const queryClient = new QueryClient({
|
|
21
|
+
defaultOptions: {
|
|
22
|
+
queries: {
|
|
23
|
+
staleTime: 1000 * 60 * 5,
|
|
24
|
+
retry: 2,
|
|
25
|
+
refetchOnWindowFocus: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
31
|
+
return (
|
|
32
|
+
<QueryClientProvider client={queryClient}>
|
|
33
|
+
{children}
|
|
34
|
+
</QueryClientProvider>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Hook Pattern
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
43
|
+
|
|
44
|
+
// Fetch
|
|
45
|
+
export function useCustomers(page = 1) {
|
|
46
|
+
return useQuery({
|
|
47
|
+
queryKey: ["customers", { page }],
|
|
48
|
+
queryFn: () => fetch(`/api/v1/customers?page=${page}`).then(r => r.json()),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Mutation with cache invalidation
|
|
53
|
+
export function useCreateCustomer() {
|
|
54
|
+
const queryClient = useQueryClient();
|
|
55
|
+
return useMutation({
|
|
56
|
+
mutationFn: (data) => fetch("/api/v1/customers", {
|
|
57
|
+
method: "POST",
|
|
58
|
+
body: JSON.stringify(data),
|
|
59
|
+
}).then(r => r.json()),
|
|
60
|
+
onSuccess: () => queryClient.invalidateQueries({ queryKey: ["customers"] }),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Best Practices
|
|
66
|
+
|
|
67
|
+
1. Use query keys as arrays: `["resource", params]`
|
|
68
|
+
2. Set appropriate stale times based on data volatility
|
|
69
|
+
3. Use `onMutate` for optimistic updates
|
|
70
|
+
4. Keep API calls in dedicated hooks
|
|
71
|
+
5. Use `enabled` option for dependent queries
|
|
72
|
+
6. Implement error boundaries for query errors
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# React Router Standards
|
|
2
|
+
|
|
3
|
+
> Client-side routing for React applications.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
React Router v7 provides declarative routing with nested layouts, loaders, and actions.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install react-router-dom
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Basic Setup
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
19
|
+
|
|
20
|
+
const router = createBrowserRouter([
|
|
21
|
+
{
|
|
22
|
+
path: "/",
|
|
23
|
+
element: <Layout />,
|
|
24
|
+
children: [
|
|
25
|
+
{ index: true, element: <Dashboard /> },
|
|
26
|
+
{ path: "customers", element: <Customers /> },
|
|
27
|
+
{ path: "customers/:id", element: <CustomerDetail /> },
|
|
28
|
+
{ path: "users", element: <Users /> },
|
|
29
|
+
{ path: "settings", element: <Settings /> },
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
export function App() {
|
|
35
|
+
return <RouterProvider router={router} />;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Protected Routes
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
function ProtectedRoute({ children, roles }: { children: React.ReactNode; roles?: string[] }) {
|
|
43
|
+
const { user } = useAuth();
|
|
44
|
+
|
|
45
|
+
if (!user) return <Navigate to="/login" replace />;
|
|
46
|
+
if (roles && !roles.includes(user.role)) return <Navigate to="/" replace />;
|
|
47
|
+
|
|
48
|
+
return <>{children}</>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Usage in router
|
|
52
|
+
{ path: "admin", element: <ProtectedRoute roles={["ADMIN"]}><AdminPanel /></ProtectedRoute> }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Best Practices
|
|
56
|
+
|
|
57
|
+
1. Use nested routes for consistent layouts
|
|
58
|
+
2. Implement lazy loading with `React.lazy()` for route splitting
|
|
59
|
+
3. Use route loaders for data fetching
|
|
60
|
+
4. Protect admin routes with role-based guards
|
|
61
|
+
5. Keep routes organized in a single configuration
|
|
62
|
+
6. Use `useNavigate` for programmatic navigation
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# ๐ก๏ธ Security Audit Standards
|
|
2
|
+
|
|
3
|
+
This document defines the security audit procedures required for all Agent Enderun-managed projects to ensure a "Defense-in-Depth" posture.
|
|
4
|
+
|
|
5
|
+
## 1. Automated Vulnerability Scanning
|
|
6
|
+
- **Dependency Audit:** All projects must execute `npm audit` within the CI/CD pipeline. Any high/critical vulnerability must block deployment.
|
|
7
|
+
- **Static Analysis (SAST):** Use `eslint-plugin-security` to detect potential vulnerabilities (e.g., insecure crypto, command injection risks) in the codebase.
|
|
8
|
+
|
|
9
|
+
## 2. Agent Governance (Prompt Security)
|
|
10
|
+
- **Prompt Sanitization:** All user-provided inputs must pass through `src/cli/utils/string.ts` sanitizers before being injected into system prompts.
|
|
11
|
+
- **Tool Allowlist:** Agents must only have access to a strictly defined, minimal toolset required for their role.
|
|
12
|
+
- **Approval Flow:** Any agent requesting an action that modifies persistent state (File write, DB mutation) must be routed through the `@manager` approval gate.
|
|
13
|
+
|
|
14
|
+
## 3. Secret Management
|
|
15
|
+
- **Environment Isolation:** No secrets in code. Use `.env` files exclusively.
|
|
16
|
+
- **CI/CD Secrets:** Production secrets must be managed via GitHub Secrets/Action Variables, never committed to the repository.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ๐ก๏ธ Corporate Security and Data Protection Standards
|
|
2
|
+
|
|
3
|
+
This document defines the security protocols and data protection standards for projects managed by Agent Enderun.
|
|
4
|
+
|
|
5
|
+
## 1. Database Security (RLS)
|
|
6
|
+
- **Row Level Security (RLS):** All user data must be protected with RLS policies. A user cannot access another user's data except through a permission protocol approved by `@manager`.
|
|
7
|
+
- **SQL Injection:** Raw SQL queries are strictly forbidden (Kysely mandatory).
|
|
8
|
+
- **Encryption at Rest:** Sensitive data (PII) must be stored encrypted in the database.
|
|
9
|
+
|
|
10
|
+
## 2. Authentication and Authorization
|
|
11
|
+
- **JWT / Session:** Only secure authentication methods approved by the `@security` agent are used.
|
|
12
|
+
- **Role Based Access Control (RBAC):** Authorization schemes must be managed centrally under `apps/backend/src/security/roles.ts`.
|
|
13
|
+
|
|
14
|
+
## 3. API Security
|
|
15
|
+
- **CORS:** Only allowed domains can access the API.
|
|
16
|
+
- **Rate Limiting:** Rate limiting must be applied for all API endpoints.
|
|
17
|
+
- **Input Validation:** All inputs (request body, params) must be strictly validated with Zod or a similar library.
|
|
18
|
+
|
|
19
|
+
## 4. Secret Management
|
|
20
|
+
- **No Hardcoded Secrets:** API keys, passwords, or secret keys can never be stored in the code.
|
|
21
|
+
- **.env Discipline:** All secret variables must be managed via the `.env` file, and this file must never be pushed to git.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# API Documentation Standards
|
|
2
|
+
|
|
3
|
+
> OpenAPI/Swagger documentation for Fastify APIs.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Auto-generated API documentation using @fastify/swagger and @fastify/swagger-ui.
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @fastify/swagger @fastify/swagger-ui
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import swagger from "@fastify/swagger";
|
|
19
|
+
import swaggerUi from "@fastify/swagger-ui";
|
|
20
|
+
|
|
21
|
+
await app.register(swagger, {
|
|
22
|
+
openapi: {
|
|
23
|
+
info: {
|
|
24
|
+
title: "API Name",
|
|
25
|
+
version: "1.0.0",
|
|
26
|
+
description: "Enterprise API documentation",
|
|
27
|
+
},
|
|
28
|
+
servers: [{ url: process.env.API_URL || "http://localhost:4000" }],
|
|
29
|
+
components: {
|
|
30
|
+
securitySchemes: {
|
|
31
|
+
bearerAuth: {
|
|
32
|
+
type: "http",
|
|
33
|
+
scheme: "bearer",
|
|
34
|
+
bearerFormat: "JWT",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
await app.register(swaggerUi, { routePrefix: "/docs" });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Best Practices
|
|
45
|
+
|
|
46
|
+
1. Define all request/response schemas using Zod or TypeBox
|
|
47
|
+
2. Group routes by tags (Users, Customers, Reports)
|
|
48
|
+
3. Include error responses in schema definitions
|
|
49
|
+
4. Version your API (e.g., /api/v1/, /api/v2/)
|
|
50
|
+
5. Keep documentation up to date with code changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# ๐ Corporate Tailwind CSS Standards
|
|
2
|
+
|
|
3
|
+
This document defines the rules required to maintain code quality and design discipline in projects using Tailwind CSS.
|
|
4
|
+
|
|
5
|
+
## 1. Design Discipline and Constraints
|
|
6
|
+
- **No Arbitrary Values:** The use of arbitrary values like `h-[123px]` or `bg-[#fafafa]` is forbidden. All values must be fed from the theme in `tailwind.config.ts`.
|
|
7
|
+
- **Utility-First, Not Utility-Only:** Class structures that become too complex should be managed with `@apply` or by dividing them into components (Atomic Design).
|
|
8
|
+
- **Prettier Plugin:** `prettier-plugin-tailwindcss` must be used for class ordering.
|
|
9
|
+
|
|
10
|
+
## 2. Responsive and Mobile-First
|
|
11
|
+
- **Mobile-First:** Styles should be written for mobile first, then expanded with `sm:`, `md:`, and `lg:` prefixes.
|
|
12
|
+
- **Consistency:** Consistent breakpoint usage across the project (standard Tailwind breakpoints) is mandatory.
|
|
13
|
+
|
|
14
|
+
## 3. Clean Code and Organization
|
|
15
|
+
- **Clean Templates:** If there are more than 10 Tailwind classes in HTML/JSX, these classes should be organized with tools like `cva` (Class Variance Authority) or `clsx`/`tailwind-merge`.
|
|
16
|
+
- **Component Isolation:** UI components must be collected under `apps/web/src/components/ui/`, and each component must contain its own Tailwind classes.
|
|
17
|
+
|
|
18
|
+
## 4. Performance and Accessibility
|
|
19
|
+
- **JIT Mode:** Just-in-Time mode should always be used.
|
|
20
|
+
- **Contrast:** WCAG AA standards must be complied with when choosing theme colors.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ๐งช Corporate Testing Standards
|
|
2
|
+
|
|
3
|
+
This document defines the testing discipline and scope rules for projects managed by Agent Enderun. Code quality must be ensured with automated tests.
|
|
4
|
+
|
|
5
|
+
## 1. Test Pyramid and Strategy
|
|
6
|
+
- **Unit Tests:** Written for the smallest parts of business logic. Must be fast and isolated.
|
|
7
|
+
- **Integration Tests:** Audits the compatibility of services with the database or external APIs.
|
|
8
|
+
- **E2E Tests:** Simulates critical user flows (Login, Checkout, etc.) in a real browser environment.
|
|
9
|
+
|
|
10
|
+
## 2. Writing Rules and Naming
|
|
11
|
+
- **Framework:** Vitest (Unit/Integration) and Playwright (E2E) are standard.
|
|
12
|
+
- **File Naming:** The `[module-name].test.ts` format is used.
|
|
13
|
+
- **Pattern (Given-When-Then):**
|
|
14
|
+
```typescript
|
|
15
|
+
it("should create a user when valid data is provided", async () => {
|
|
16
|
+
// Given
|
|
17
|
+
const userData = { ... };
|
|
18
|
+
// When
|
|
19
|
+
const result = await userService.create(userData);
|
|
20
|
+
// Then
|
|
21
|
+
expect(result.id).toBeDefined();
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 3. Scope and Success Criteria
|
|
26
|
+
- **Critical Path Coverage:** Auth, Payment, and Data Mutation processes must have 100% test coverage.
|
|
27
|
+
- **Zero Mock Policy (Internal):** Real contracts and test databases should be used between internal project services instead of mocks. External services (Stripe, Twilio, etc.) can be mocked.
|
|
28
|
+
|
|
29
|
+
## 4. Auditing
|
|
30
|
+
- The `@quality` agent verifies that the relevant test file is updated in each new function.
|
|
31
|
+
- Code that does not pass tests (`npm run test`) is never approved.
|