xcoder-dna 0.0.0-stage → 1.3.1
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/LICENSE +21 -0
- package/README.md +87 -2
- package/dist/agents/ai-chat-debate.d.ts +36 -0
- package/dist/agents/ai-chat-debate.js +300 -0
- package/dist/agents/ai-chat-report-writer.d.ts +7 -0
- package/dist/agents/ai-chat-report-writer.js +100 -0
- package/dist/agents/duplicate-detector.d.ts +41 -0
- package/dist/agents/duplicate-detector.js +65 -0
- package/dist/agents/genesis-agent.d.ts +61 -0
- package/dist/agents/genesis-agent.js +340 -0
- package/dist/agents/samurai-agent.d.ts +53 -0
- package/dist/agents/samurai-agent.js +279 -0
- package/dist/agents/sub-agent.d.ts +56 -0
- package/dist/agents/sub-agent.js +353 -0
- package/dist/backlog/backlog-requirement-validator.d.ts +10 -0
- package/dist/backlog/backlog-requirement-validator.js +60 -0
- package/dist/backlog/backlog-store.d.ts +29 -0
- package/dist/backlog/backlog-store.js +148 -0
- package/dist/backlog/po-agent.d.ts +16 -0
- package/dist/backlog/po-agent.js +121 -0
- package/dist/backlog/types.d.ts +25 -0
- package/dist/backlog/types.js +4 -0
- package/dist/bench/run.d.ts +11 -0
- package/dist/bench/run.js +185 -0
- package/dist/bench/types.d.ts +50 -0
- package/dist/bench/types.js +1 -0
- package/dist/cli/swarm.d.ts +10 -0
- package/dist/cli/swarm.js +100 -0
- package/dist/cli/task.d.ts +14 -0
- package/dist/cli/task.js +121 -0
- package/dist/cli/wbc-arg.d.ts +6 -0
- package/dist/cli/wbc-arg.js +40 -0
- package/dist/cli/wbc.d.ts +45 -0
- package/dist/cli/wbc.js +98 -0
- package/dist/commands/license.d.ts +9 -0
- package/dist/commands/license.js +140 -0
- package/dist/commands/release.d.ts +44 -0
- package/dist/commands/release.js +180 -0
- package/dist/commands/test.d.ts +50 -0
- package/dist/commands/test.js +385 -0
- package/dist/config/loadConfig.d.ts +82 -0
- package/dist/config/loadConfig.js +240 -0
- package/dist/config/secure-mode.d.ts +29 -0
- package/dist/config/secure-mode.js +63 -0
- package/dist/config/user-config.d.ts +39 -0
- package/dist/config/user-config.js +202 -0
- package/dist/engine/reasoning-engine.d.ts +21 -0
- package/dist/engine/reasoning-engine.js +59 -0
- package/dist/events/bus.d.ts +22 -0
- package/dist/events/bus.js +18 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +77 -0
- package/dist/indexing/ignoreRules.d.ts +1 -0
- package/dist/indexing/ignoreRules.js +53 -0
- package/dist/instance-swarm/instance-swarm-orchestrator.d.ts +57 -0
- package/dist/instance-swarm/instance-swarm-orchestrator.js +204 -0
- package/dist/instance-swarm/protocol-name-resolver.d.ts +23 -0
- package/dist/instance-swarm/protocol-name-resolver.js +64 -0
- package/dist/license/gate.d.ts +31 -0
- package/dist/license/gate.js +188 -0
- package/dist/license/http-client.d.ts +43 -0
- package/dist/license/http-client.js +195 -0
- package/dist/license/manager.d.ts +39 -0
- package/dist/license/manager.js +175 -0
- package/dist/license/receipt.d.ts +27 -0
- package/dist/license/receipt.js +108 -0
- package/dist/license/state-codec.d.ts +72 -0
- package/dist/license/state-codec.js +218 -0
- package/dist/license/state-paths.d.ts +17 -0
- package/dist/license/state-paths.js +64 -0
- package/dist/license/store.d.ts +44 -0
- package/dist/license/store.js +223 -0
- package/dist/license/trust-anchor.d.ts +24 -0
- package/dist/license/trust-anchor.js +74 -0
- package/dist/license/types.d.ts +34 -0
- package/dist/license/types.js +19 -0
- package/dist/llm/budget.d.ts +23 -0
- package/dist/llm/budget.js +58 -0
- package/dist/llm/client.d.ts +53 -0
- package/dist/llm/client.js +122 -0
- package/dist/llm/factory.d.ts +14 -0
- package/dist/llm/factory.js +32 -0
- package/dist/orchestrator/defect-logger.d.ts +31 -0
- package/dist/orchestrator/defect-logger.js +101 -0
- package/dist/orchestrator/defect-manager.d.ts +118 -0
- package/dist/orchestrator/defect-manager.js +338 -0
- package/dist/orchestrator/defect-migration.d.ts +14 -0
- package/dist/orchestrator/defect-migration.js +174 -0
- package/dist/orchestrator/defect-store.d.ts +48 -0
- package/dist/orchestrator/defect-store.js +76 -0
- package/dist/orchestrator/healing.d.ts +14 -0
- package/dist/orchestrator/healing.js +11 -0
- package/dist/orchestrator/interactive-steering.d.ts +64 -0
- package/dist/orchestrator/interactive-steering.js +107 -0
- package/dist/orchestrator/interrupt-handler.d.ts +30 -0
- package/dist/orchestrator/interrupt-handler.js +70 -0
- package/dist/orchestrator/lesson-manager.d.ts +25 -0
- package/dist/orchestrator/lesson-manager.js +122 -0
- package/dist/orchestrator/progress-summary.d.ts +15 -0
- package/dist/orchestrator/progress-summary.js +106 -0
- package/dist/orchestrator/reasoning-score.d.ts +49 -0
- package/dist/orchestrator/reasoning-score.js +117 -0
- package/dist/orchestrator/swarm.d.ts +36 -0
- package/dist/orchestrator/swarm.js +77 -0
- package/dist/orchestrator/task-factory.d.ts +15 -0
- package/dist/orchestrator/task-factory.js +176 -0
- package/dist/orchestrator/validation-gate.d.ts +23 -0
- package/dist/orchestrator/validation-gate.js +155 -0
- package/dist/protocol/react-contract.d.ts +136 -0
- package/dist/protocol/react-contract.js +698 -0
- package/dist/protocol/wks-protocol-manager.d.ts +22 -0
- package/dist/protocol/wks-protocol-manager.js +72 -0
- package/dist/sdlc-runtime/conversation-runner.d.ts +8 -0
- package/dist/sdlc-runtime/conversation-runner.js +64 -0
- package/dist/sdlc-runtime/dag-utils.d.ts +15 -0
- package/dist/sdlc-runtime/dag-utils.js +67 -0
- package/dist/sdlc-runtime/defect-integration.d.ts +7 -0
- package/dist/sdlc-runtime/defect-integration.js +99 -0
- package/dist/sdlc-runtime/execution-loop.d.ts +38 -0
- package/dist/sdlc-runtime/execution-loop.js +274 -0
- package/dist/sdlc-runtime/lesson-recorder.d.ts +9 -0
- package/dist/sdlc-runtime/lesson-recorder.js +27 -0
- package/dist/sdlc-runtime/plan-initializer.d.ts +47 -0
- package/dist/sdlc-runtime/plan-initializer.js +135 -0
- package/dist/sdlc-runtime/progress-persister.d.ts +10 -0
- package/dist/sdlc-runtime/progress-persister.js +34 -0
- package/dist/sdlc-runtime/protocol-loader.d.ts +10 -0
- package/dist/sdlc-runtime/protocol-loader.js +21 -0
- package/dist/sdlc-runtime/reporting.d.ts +24 -0
- package/dist/sdlc-runtime/reporting.js +68 -0
- package/dist/sdlc-runtime/sdlc-orchestrator.d.ts +59 -0
- package/dist/sdlc-runtime/sdlc-orchestrator.js +170 -0
- package/dist/sdlc-runtime/sdlc-skill.d.ts +44 -0
- package/dist/sdlc-runtime/sdlc-skill.js +148 -0
- package/dist/sdlc-runtime/steering-handler.d.ts +14 -0
- package/dist/sdlc-runtime/steering-handler.js +51 -0
- package/dist/sdlc-runtime/trace-recorder.d.ts +10 -0
- package/dist/sdlc-runtime/trace-recorder.js +7 -0
- package/dist/security/index.d.ts +16 -0
- package/dist/security/index.js +12 -0
- package/dist/security/input-screen.d.ts +30 -0
- package/dist/security/input-screen.js +75 -0
- package/dist/security/tool-call-guard.d.ts +16 -0
- package/dist/security/tool-call-guard.js +163 -0
- package/dist/security/untrusted-content.d.ts +34 -0
- package/dist/security/untrusted-content.js +63 -0
- package/dist/skills/advanced-dfir/SKILL.md +85 -0
- package/dist/skills/advanced-pentest-lab/SKILL.md +88 -0
- package/dist/skills/analyst/SKILL.md +55 -0
- package/dist/skills/architect/SKILL.md +54 -0
- package/dist/skills/aws/SKILL.md +92 -0
- package/dist/skills/azure/SKILL.md +90 -0
- package/dist/skills/bylaw-context.d.ts +45 -0
- package/dist/skills/bylaw-context.js +61 -0
- package/dist/skills/bylaw-review.d.ts +20 -0
- package/dist/skills/bylaw-review.js +101 -0
- package/dist/skills/conversation/SKILL.md +29 -0
- package/dist/skills/design-patterns/SKILL.md +190 -0
- package/dist/skills/devops/SKILL.md +55 -0
- package/dist/skills/directives.d.ts +20 -0
- package/dist/skills/directives.js +313 -0
- package/dist/skills/docker/SKILL.md +76 -0
- package/dist/skills/docker-expert/SKILL.md +56 -0
- package/dist/skills/enterprise-systems-analyst/SKILL.md +83 -0
- package/dist/skills/enterprise-systems-analyst/references/crm.md +41 -0
- package/dist/skills/enterprise-systems-analyst/references/erp.md +40 -0
- package/dist/skills/enterprise-systems-analyst/references/financial-systems.md +35 -0
- package/dist/skills/enterprise-systems-analyst/references/hcm.md +38 -0
- package/dist/skills/enterprise-systems-analyst/references/mrp.md +37 -0
- package/dist/skills/enterprise-systems-analyst/references/scm.md +32 -0
- package/dist/skills/ethical-hacking-methodology/SKILL.md +119 -0
- package/dist/skills/externalSkillLoader.d.ts +25 -0
- package/dist/skills/externalSkillLoader.js +65 -0
- package/dist/skills/externalSkillRegistry.d.ts +33 -0
- package/dist/skills/externalSkillRegistry.js +94 -0
- package/dist/skills/filesystem-management/SKILL.md +61 -0
- package/dist/skills/first-run-seed.d.ts +26 -0
- package/dist/skills/first-run-seed.js +75 -0
- package/dist/skills/git-vcs/SKILL.md +84 -0
- package/dist/skills/kafka/SKILL.md +89 -0
- package/dist/skills/kubernetes/SKILL.md +93 -0
- package/dist/skills/kubernetes-expert/SKILL.md +54 -0
- package/dist/skills/openshift/SKILL.md +93 -0
- package/dist/skills/pentester/SKILL.md +59 -0
- package/dist/skills/performance-tester/SKILL.md +57 -0
- package/dist/skills/playwright-ui-tester/SKILL.md +67 -0
- package/dist/skills/programmer/SKILL.md +58 -0
- package/dist/skills/project-scaffolding/SKILL.md +133 -0
- package/dist/skills/qa-engineer/SKILL.md +91 -0
- package/dist/skills/rca/SKILL.md +58 -0
- package/dist/skills/redhat/SKILL.md +92 -0
- package/dist/skills/rosa/SKILL.md +80 -0
- package/dist/skills/scrum-framework/SKILL.md +74 -0
- package/dist/skills/scrum-framework/references/artifacts_and_quality.md +79 -0
- package/dist/skills/scrum-framework/references/roles_and_events.md +105 -0
- package/dist/skills/scrum-master-agent/SKILL.md +74 -0
- package/dist/skills/scrum-master-agent/references/behaviors.md +56 -0
- package/dist/skills/sdlc-skill.d.ts +1 -0
- package/dist/skills/sdlc-skill.js +4 -0
- package/dist/skills/secops/SKILL.md +52 -0
- package/dist/skills/secure-architect.bylaws.d.ts +68 -0
- package/dist/skills/secure-architect.bylaws.js +525 -0
- package/dist/skills/seed-skills.d.ts +48 -0
- package/dist/skills/seed-skills.js +213 -0
- package/dist/skills/skill-authoring/SKILL.md +123 -0
- package/dist/skills/skill-header.d.ts +51 -0
- package/dist/skills/skill-header.js +163 -0
- package/dist/skills/skill-path-guard.d.ts +41 -0
- package/dist/skills/skill-path-guard.js +95 -0
- package/dist/skills/skillRouter.d.ts +51 -0
- package/dist/skills/skillRouter.js +90 -0
- package/dist/skills/skills-root.d.ts +64 -0
- package/dist/skills/skills-root.js +168 -0
- package/dist/skills/software-architect/SKILL.md +77 -0
- package/dist/skills/software-engineer/SKILL.md +74 -0
- package/dist/skills/solid-principles/SKILL.md +94 -0
- package/dist/skills/task-planning/SKILL.md +115 -0
- package/dist/skills/tester/SKILL.md +54 -0
- package/dist/skills/ubuntu/SKILL.md +87 -0
- package/dist/skills/ui-ux-design/SKILL.md +114 -0
- package/dist/skills/workspace-context/SKILL.md +103 -0
- package/dist/sprint/controller.d.ts +37 -0
- package/dist/sprint/controller.js +220 -0
- package/dist/sprint/dag-builder.d.ts +14 -0
- package/dist/sprint/dag-builder.js +105 -0
- package/dist/sprint/reporter.d.ts +11 -0
- package/dist/sprint/reporter.js +97 -0
- package/dist/sprint/state-store.d.ts +10 -0
- package/dist/sprint/state-store.js +71 -0
- package/dist/sprint/types.d.ts +24 -0
- package/dist/sprint/types.js +4 -0
- package/dist/store/file-version-store.d.ts +24 -0
- package/dist/store/file-version-store.js +73 -0
- package/dist/store/task-store.d.ts +90 -0
- package/dist/store/task-store.js +166 -0
- package/dist/task-ingest/architect-detailer.d.ts +43 -0
- package/dist/task-ingest/architect-detailer.js +141 -0
- package/dist/task-ingest/detail-schema.d.ts +9 -0
- package/dist/task-ingest/detail-schema.js +195 -0
- package/dist/task-ingest/detailed-run.d.ts +36 -0
- package/dist/task-ingest/detailed-run.js +108 -0
- package/dist/task-ingest/extract-id.d.ts +9 -0
- package/dist/task-ingest/extract-id.js +24 -0
- package/dist/task-ingest/index.d.ts +23 -0
- package/dist/task-ingest/index.js +14 -0
- package/dist/task-ingest/ingest.d.ts +45 -0
- package/dist/task-ingest/ingest.js +163 -0
- package/dist/task-ingest/list-ingested.d.ts +13 -0
- package/dist/task-ingest/list-ingested.js +30 -0
- package/dist/task-ingest/pending-filter.d.ts +30 -0
- package/dist/task-ingest/pending-filter.js +59 -0
- package/dist/task-ingest/scanner.d.ts +56 -0
- package/dist/task-ingest/scanner.js +216 -0
- package/dist/task-ingest/source-reader.d.ts +25 -0
- package/dist/task-ingest/source-reader.js +93 -0
- package/dist/task-ingest/spec-builder.d.ts +34 -0
- package/dist/task-ingest/spec-builder.js +89 -0
- package/dist/task-ingest/wbs-extract.d.ts +50 -0
- package/dist/task-ingest/wbs-extract.js +226 -0
- package/dist/task-ingest/wbs-parser.d.ts +36 -0
- package/dist/task-ingest/wbs-parser.js +170 -0
- package/dist/tools/apiTestTool.d.ts +37 -0
- package/dist/tools/apiTestTool.js +128 -0
- package/dist/tools/ast-tools.d.ts +183 -0
- package/dist/tools/ast-tools.js +853 -0
- package/dist/tools/browse-tool.d.ts +105 -0
- package/dist/tools/browse-tool.js +394 -0
- package/dist/tools/credential.d.ts +17 -0
- package/dist/tools/credential.js +32 -0
- package/dist/tools/dependency-graph.d.ts +23 -0
- package/dist/tools/dependency-graph.js +164 -0
- package/dist/tools/edit-tool.d.ts +34 -0
- package/dist/tools/edit-tool.js +95 -0
- package/dist/tools/file-header-manager.d.ts +27 -0
- package/dist/tools/file-header-manager.js +153 -0
- package/dist/tools/fs-tools.d.ts +154 -0
- package/dist/tools/fs-tools.js +337 -0
- package/dist/tools/git-tools.d.ts +79 -0
- package/dist/tools/git-tools.js +348 -0
- package/dist/tools/github-tool.d.ts +48 -0
- package/dist/tools/github-tool.js +147 -0
- package/dist/tools/globTool.d.ts +20 -0
- package/dist/tools/globTool.js +34 -0
- package/dist/tools/grepTool.d.ts +19 -0
- package/dist/tools/grepTool.js +44 -0
- package/dist/tools/index-freshness.d.ts +58 -0
- package/dist/tools/index-freshness.js +190 -0
- package/dist/tools/index-glob.d.ts +48 -0
- package/dist/tools/index-glob.js +175 -0
- package/dist/tools/load-skill-tool.d.ts +15 -0
- package/dist/tools/load-skill-tool.js +114 -0
- package/dist/tools/patch-tools.d.ts +58 -0
- package/dist/tools/patch-tools.js +153 -0
- package/dist/tools/playwright-tool.d.ts +66 -0
- package/dist/tools/playwright-tool.js +121 -0
- package/dist/tools/project-detect.d.ts +20 -0
- package/dist/tools/project-detect.js +87 -0
- package/dist/tools/prompt-guidance.d.ts +22 -0
- package/dist/tools/prompt-guidance.js +23 -0
- package/dist/tools/scheduleTool.d.ts +19 -0
- package/dist/tools/scheduleTool.js +181 -0
- package/dist/tools/search-tools.d.ts +27 -0
- package/dist/tools/search-tools.js +78 -0
- package/dist/tools/sed-tool.d.ts +66 -0
- package/dist/tools/sed-tool.js +402 -0
- package/dist/tools/shell-result.d.ts +11 -0
- package/dist/tools/shell-result.js +1 -0
- package/dist/tools/shell-tool.d.ts +45 -0
- package/dist/tools/shell-tool.js +141 -0
- package/dist/tools/siteCrawlerTool.d.ts +32 -0
- package/dist/tools/siteCrawlerTool.js +205 -0
- package/dist/tools/tool-registry.d.ts +67 -0
- package/dist/tools/tool-registry.js +596 -0
- package/dist/tools/validate-tool.d.ts +23 -0
- package/dist/tools/validate-tool.js +201 -0
- package/dist/tools/workspace-index.d.ts +46 -0
- package/dist/tools/workspace-index.js +173 -0
- package/dist/types.d.ts +222 -0
- package/dist/types.js +7 -0
- package/dist/updater/index.d.ts +14 -0
- package/dist/updater/index.js +120 -0
- package/dist/util/banner.d.ts +25 -0
- package/dist/util/banner.js +140 -0
- package/dist/util/command-suggester.d.ts +6 -0
- package/dist/util/command-suggester.js +25 -0
- package/dist/util/confirm-interrupt.d.ts +10 -0
- package/dist/util/confirm-interrupt.js +31 -0
- package/dist/util/continue-trigger.d.ts +11 -0
- package/dist/util/continue-trigger.js +20 -0
- package/dist/util/env-info.d.ts +18 -0
- package/dist/util/env-info.js +37 -0
- package/dist/util/file-access-log.d.ts +35 -0
- package/dist/util/file-access-log.js +140 -0
- package/dist/util/footer-manager.d.ts +124 -0
- package/dist/util/footer-manager.js +195 -0
- package/dist/util/footer-renderer.d.ts +67 -0
- package/dist/util/footer-renderer.js +319 -0
- package/dist/util/footer-state.d.ts +34 -0
- package/dist/util/footer-state.js +18 -0
- package/dist/util/footer-text.d.ts +51 -0
- package/dist/util/footer-text.js +74 -0
- package/dist/util/ids.d.ts +1 -0
- package/dist/util/ids.js +4 -0
- package/dist/util/levenshtein.d.ts +6 -0
- package/dist/util/levenshtein.js +34 -0
- package/dist/util/logger.d.ts +10 -0
- package/dist/util/logger.js +41 -0
- package/dist/util/logs.d.ts +26 -0
- package/dist/util/logs.js +88 -0
- package/dist/util/output-handler.d.ts +89 -0
- package/dist/util/output-handler.js +193 -0
- package/dist/util/output-interceptor.d.ts +18 -0
- package/dist/util/output-interceptor.js +49 -0
- package/dist/util/output-paths.d.ts +43 -0
- package/dist/util/output-paths.js +121 -0
- package/dist/util/package-json.d.ts +6 -0
- package/dist/util/package-json.js +36 -0
- package/dist/util/process-kill.d.ts +27 -0
- package/dist/util/process-kill.js +148 -0
- package/dist/util/protocol-error-logger.d.ts +33 -0
- package/dist/util/protocol-error-logger.js +73 -0
- package/dist/util/redact.d.ts +25 -0
- package/dist/util/redact.js +103 -0
- package/dist/util/scroll-region-guard.d.ts +33 -0
- package/dist/util/scroll-region-guard.js +63 -0
- package/dist/util/spinner.d.ts +15 -0
- package/dist/util/spinner.js +49 -0
- package/dist/util/terminal-output.d.ts +34 -0
- package/dist/util/terminal-output.js +1 -0
- package/dist/util/terminal-silent.d.ts +6 -0
- package/dist/util/terminal-silent.js +20 -0
- package/dist/util/terminal.d.ts +56 -0
- package/dist/util/terminal.js +124 -0
- package/dist/util/text-sanitize.d.ts +8 -0
- package/dist/util/text-sanitize.js +45 -0
- package/dist/util/thinking-spinner.d.ts +27 -0
- package/dist/util/thinking-spinner.js +189 -0
- package/dist/util/tool-error-logger.d.ts +33 -0
- package/dist/util/tool-error-logger.js +77 -0
- package/dist/util/tty.d.ts +13 -0
- package/dist/util/tty.js +16 -0
- package/dist/util/xcoder-paths.d.ts +56 -0
- package/dist/util/xcoder-paths.js +63 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +4 -0
- package/dist/worker-agent/to-subtask-node.d.ts +35 -0
- package/dist/worker-agent/to-subtask-node.js +41 -0
- package/dist/worker-agent/worker-orchestrator.d.ts +104 -0
- package/dist/worker-agent/worker-orchestrator.js +201 -0
- package/package.json +38 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// xcoder:version 1 | xcoder:task task-f1ac77 | xcoder:updated 2026-10-17T04:10:17.952Z | xcoder:subtask code-st-1d0003
|
|
2
|
+
/**
|
|
3
|
+
* Verdict adapter for the security bylaws.
|
|
4
|
+
*
|
|
5
|
+
* Turns a gate Sub Agent's deliverable into a `ReviewResult` without inventing
|
|
6
|
+
* approval rules: `evaluateReview()` from the bylaws module is the sole
|
|
7
|
+
* authority. This file only parses shapes and formats descriptions.
|
|
8
|
+
*
|
|
9
|
+
* Failure direction is deliberate: malformed or unparseable findings are
|
|
10
|
+
* dropped, which surfaces the affected bylaws as `unreviewed`, which blocks.
|
|
11
|
+
* A gate that cannot establish compliance must not approve.
|
|
12
|
+
*/
|
|
13
|
+
import { evaluateReview, } from "./secure-architect.bylaws.js";
|
|
14
|
+
const VALID_STATUSES = new Set([
|
|
15
|
+
"pass",
|
|
16
|
+
"fail",
|
|
17
|
+
"not-applicable",
|
|
18
|
+
"accepted-risk",
|
|
19
|
+
]);
|
|
20
|
+
function isRecord(value) {
|
|
21
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
function asFinding(entry) {
|
|
24
|
+
if (!isRecord(entry))
|
|
25
|
+
return null;
|
|
26
|
+
const bylawId = entry.bylawId;
|
|
27
|
+
const status = entry.status;
|
|
28
|
+
if (typeof bylawId !== "string" || bylawId.length === 0)
|
|
29
|
+
return null;
|
|
30
|
+
if (typeof status !== "string" || !VALID_STATUSES.has(status))
|
|
31
|
+
return null;
|
|
32
|
+
const finding = {
|
|
33
|
+
bylawId,
|
|
34
|
+
status: status,
|
|
35
|
+
};
|
|
36
|
+
if (typeof entry.note === "string")
|
|
37
|
+
finding.note = entry.note;
|
|
38
|
+
if (typeof entry.riskOwner === "string")
|
|
39
|
+
finding.riskOwner = entry.riskOwner;
|
|
40
|
+
return finding;
|
|
41
|
+
}
|
|
42
|
+
/** Flatten findings from however the gate agent shaped them. Never throws. */
|
|
43
|
+
export function parseBylawFindings(deliverable) {
|
|
44
|
+
try {
|
|
45
|
+
let raw;
|
|
46
|
+
if (typeof deliverable === "string") {
|
|
47
|
+
// A JSON string deliverable is common when the agent's final_answer is text.
|
|
48
|
+
try {
|
|
49
|
+
raw = JSON.parse(deliverable);
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
raw = deliverable;
|
|
57
|
+
}
|
|
58
|
+
let entries;
|
|
59
|
+
if (Array.isArray(raw)) {
|
|
60
|
+
entries = raw;
|
|
61
|
+
}
|
|
62
|
+
else if (isRecord(raw) && Array.isArray(raw.findings)) {
|
|
63
|
+
entries = raw.findings;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
const findings = [];
|
|
69
|
+
for (const entry of entries) {
|
|
70
|
+
const finding = asFinding(entry);
|
|
71
|
+
if (finding)
|
|
72
|
+
findings.push(finding);
|
|
73
|
+
}
|
|
74
|
+
return findings;
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** Findings + scope -> verdict. Thin delegate to evaluateReview(). */
|
|
81
|
+
export function reviewDeliverable(deliverable, layers) {
|
|
82
|
+
const findings = parseBylawFindings(deliverable);
|
|
83
|
+
const result = evaluateReview(findings, layers);
|
|
84
|
+
return { ...result, findings };
|
|
85
|
+
}
|
|
86
|
+
/** Human-readable one-liner for `reason` when the gate blocks. */
|
|
87
|
+
export function describeReview(result) {
|
|
88
|
+
const parts = [];
|
|
89
|
+
if (result.blocking.length > 0) {
|
|
90
|
+
parts.push(`${result.blocking.length} MUST violation(s) [${result.blocking.join(", ")}]`);
|
|
91
|
+
}
|
|
92
|
+
if (result.unreviewed.length > 0) {
|
|
93
|
+
parts.push(`${result.unreviewed.length} bylaw(s) unreviewed [${result.unreviewed.join(", ")}]`);
|
|
94
|
+
}
|
|
95
|
+
if (result.invalid.length > 0) {
|
|
96
|
+
parts.push(`${result.invalid.length} finding(s) invalid [${result.invalid.join(", ")}]`);
|
|
97
|
+
}
|
|
98
|
+
if (parts.length === 0)
|
|
99
|
+
return "bylaw review approved";
|
|
100
|
+
return "blocked: " + parts.join("; ");
|
|
101
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: conversation
|
|
3
|
+
role: Conversational Handler for Trivial Inputs
|
|
4
|
+
description: >
|
|
5
|
+
Handles simple greetings and casual pleasantries with a short, friendly reply instead of
|
|
6
|
+
invoking the full workspace/tool loop. NOTE: Xcoder SDLC's SubAgent explicitly skips external-skill
|
|
7
|
+
injection entirely for the "conversation" Role (see the `role !== "conversation"` guard in
|
|
8
|
+
src/agents/sub-agent.ts), so this file is not currently loaded by any code path — it's kept
|
|
9
|
+
here as reference/documentation for what that Role's intended behavior is, and in case a
|
|
10
|
+
future change makes external skills available to "conversation" as well.
|
|
11
|
+
triggers: ["hello", "hi", "hey", "greeting", "thanks", "thank you"]
|
|
12
|
+
version: "1.0.0"
|
|
13
|
+
requires_tools: []
|
|
14
|
+
composes_with: []
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Process & Strategy
|
|
18
|
+
When the user's task description is a simple greeting (e.g., "hello", "hi", "hey"), or casual
|
|
19
|
+
pleasantry, you do not need to inspect files, run terminal commands, or invoke workspace tools.
|
|
20
|
+
|
|
21
|
+
## Instructions
|
|
22
|
+
1. Respond immediately with a friendly, professional greeting.
|
|
23
|
+
2. State clearly that you are ready to assist with their workspace tasks.
|
|
24
|
+
3. Stop calling tools right away.
|
|
25
|
+
|
|
26
|
+
## Validator Exemption Rule
|
|
27
|
+
Because this is a conversation initialization task, a polite textual response is the complete
|
|
28
|
+
and final observation. No workspace mutations or command outputs are expected or required to
|
|
29
|
+
back up this final answer.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-patterns
|
|
3
|
+
role: Software Architect / Design Pattern Specialist
|
|
4
|
+
description: >
|
|
5
|
+
Reference guide to the 23 classic Gang-of-Four software design patterns (Creational,
|
|
6
|
+
Structural, Behavioral), complete with directives and "when to use" criteria. Load whenever
|
|
7
|
+
selecting appropriate architectural patterns, evaluating trade-offs, refactoring complex code,
|
|
8
|
+
or explaining specific design patterns.
|
|
9
|
+
triggers: [pattern, "design pattern", "gang of four", gof, singleton, factory, observer, strategy, decorator, adapter, facade]
|
|
10
|
+
version: 1.0
|
|
11
|
+
requires_tools: [read_tool, grep_tool]
|
|
12
|
+
composes_with: [programmer, solid-principles, software-engineer, architect]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Design Patterns
|
|
16
|
+
|
|
17
|
+
A quick-reference guide to the classic (Gang of Four) design patterns, grouped by category, each with a directive and clear criteria for when it applies.
|
|
18
|
+
|
|
19
|
+
## How to use this skill
|
|
20
|
+
|
|
21
|
+
1. If the user names a specific pattern, jump to that pattern's entry below and explain the directive + when-to-use criteria in the context of their code/problem.
|
|
22
|
+
2. If the user describes a problem ("I have multiple ways to calculate shipping cost and want to swap between them"), use the **Quick Decision Guide** table to match the problem shape to a pattern, then explain why it fits.
|
|
23
|
+
3. If the user wants a broad overview, walk through the three categories (Creational, Structural, Behavioral) and summarize each pattern's directive in one line.
|
|
24
|
+
4. Always pair a suggested pattern with a caveat if a simpler solution would work — see **General Directives** at the end.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Creational Patterns
|
|
29
|
+
*Concerned with object creation mechanisms.*
|
|
30
|
+
|
|
31
|
+
### Singleton
|
|
32
|
+
**Directive:** Ensure a class has only one instance, with a global access point.
|
|
33
|
+
**Use when:**
|
|
34
|
+
- Exactly one object is needed to coordinate actions (e.g. config manager, logger, connection pool).
|
|
35
|
+
- You need controlled access to a shared resource.
|
|
36
|
+
**Avoid when:** It introduces hidden global state or makes unit testing hard — prefer dependency injection instead.
|
|
37
|
+
|
|
38
|
+
### Factory Method
|
|
39
|
+
**Directive:** Define an interface for creating an object, but let subclasses decide which class to instantiate.
|
|
40
|
+
**Use when:**
|
|
41
|
+
- A class can't anticipate the exact type of objects it must create.
|
|
42
|
+
- You want to delegate instantiation logic to subclasses.
|
|
43
|
+
|
|
44
|
+
### Abstract Factory
|
|
45
|
+
**Directive:** Provide an interface for creating families of related objects without specifying concrete classes.
|
|
46
|
+
**Use when:**
|
|
47
|
+
- Your system needs to work with multiple families of related products (e.g. UI themes: Windows vs Mac widgets).
|
|
48
|
+
- You want to enforce that related objects are used together.
|
|
49
|
+
|
|
50
|
+
### Builder
|
|
51
|
+
**Directive:** Separate the construction of a complex object from its representation.
|
|
52
|
+
**Use when:**
|
|
53
|
+
- An object has many optional parameters or construction steps (avoids telescoping constructors).
|
|
54
|
+
- You want the same construction process to create different representations.
|
|
55
|
+
|
|
56
|
+
### Prototype
|
|
57
|
+
**Directive:** Create new objects by copying an existing instance (a "prototype").
|
|
58
|
+
**Use when:**
|
|
59
|
+
- Object creation is expensive and cloning is cheaper.
|
|
60
|
+
- You need to avoid subclassing just to create variations of objects.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Structural Patterns
|
|
65
|
+
*Concerned with how classes/objects are composed.*
|
|
66
|
+
|
|
67
|
+
### Adapter
|
|
68
|
+
**Directive:** Convert the interface of a class into another interface clients expect.
|
|
69
|
+
**Use when:**
|
|
70
|
+
- You need to use an existing class but its interface doesn't match what you need.
|
|
71
|
+
- Integrating third-party or legacy code without modifying it.
|
|
72
|
+
|
|
73
|
+
### Bridge
|
|
74
|
+
**Directive:** Decouple an abstraction from its implementation so both can vary independently.
|
|
75
|
+
**Use when:**
|
|
76
|
+
- You want to avoid a permanent binding between abstraction and implementation.
|
|
77
|
+
- Both the abstraction and implementation should be independently extensible.
|
|
78
|
+
|
|
79
|
+
### Composite
|
|
80
|
+
**Directive:** Compose objects into tree structures to represent part-whole hierarchies.
|
|
81
|
+
**Use when:**
|
|
82
|
+
- Clients should treat individual objects and compositions uniformly (e.g. file systems, UI component trees).
|
|
83
|
+
|
|
84
|
+
### Decorator
|
|
85
|
+
**Directive:** Attach additional responsibilities to an object dynamically.
|
|
86
|
+
**Use when:**
|
|
87
|
+
- You need to add behavior/state to individual objects without affecting others of the same class.
|
|
88
|
+
- Subclassing would produce an explosion of classes.
|
|
89
|
+
|
|
90
|
+
### Facade
|
|
91
|
+
**Directive:** Provide a unified, simplified interface to a set of interfaces in a subsystem.
|
|
92
|
+
**Use when:**
|
|
93
|
+
- A subsystem is complex and you want to give clients a simple entry point.
|
|
94
|
+
- You want to decouple client code from subsystem internals.
|
|
95
|
+
|
|
96
|
+
### Flyweight
|
|
97
|
+
**Directive:** Use sharing to support large numbers of fine-grained objects efficiently.
|
|
98
|
+
**Use when:**
|
|
99
|
+
- Memory usage is a concern due to a huge number of similar objects.
|
|
100
|
+
- Object state can be split into intrinsic (shared) and extrinsic (contextual) parts.
|
|
101
|
+
|
|
102
|
+
### Proxy
|
|
103
|
+
**Directive:** Provide a surrogate/placeholder to control access to another object.
|
|
104
|
+
**Use when:**
|
|
105
|
+
- You need lazy loading, access control, logging, or caching around an object (e.g. virtual proxy, protection proxy).
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Behavioral Patterns
|
|
110
|
+
*Concerned with object interaction and responsibility distribution.*
|
|
111
|
+
|
|
112
|
+
### Chain of Responsibility
|
|
113
|
+
**Directive:** Pass a request along a chain of handlers until one handles it.
|
|
114
|
+
**Use when:**
|
|
115
|
+
- More than one object may handle a request, and the handler isn't known in advance (e.g. middleware pipelines).
|
|
116
|
+
|
|
117
|
+
### Command
|
|
118
|
+
**Directive:** Encapsulate a request as an object, allowing parameterization and queuing.
|
|
119
|
+
**Use when:**
|
|
120
|
+
- You need undo/redo, task queues, or to decouple sender from receiver of a request.
|
|
121
|
+
|
|
122
|
+
### Interpreter
|
|
123
|
+
**Directive:** Define a grammar and interpreter for a language.
|
|
124
|
+
**Use when:**
|
|
125
|
+
- You need to interpret sentences in a simple, well-defined language (e.g. rule engines, DSLs).
|
|
126
|
+
|
|
127
|
+
### Iterator
|
|
128
|
+
**Directive:** Provide a way to access elements of a collection sequentially without exposing its structure.
|
|
129
|
+
**Use when:**
|
|
130
|
+
- You need uniform traversal across different collection types.
|
|
131
|
+
|
|
132
|
+
### Mediator
|
|
133
|
+
**Directive:** Define an object that encapsulates how a set of objects interact.
|
|
134
|
+
**Use when:**
|
|
135
|
+
- Objects communicate in complex, many-to-many ways — centralize the logic to reduce coupling (e.g. chat rooms, form field coordination).
|
|
136
|
+
|
|
137
|
+
### Memento
|
|
138
|
+
**Directive:** Capture and externalize an object's internal state without violating encapsulation, so it can be restored later.
|
|
139
|
+
**Use when:**
|
|
140
|
+
- You need undo functionality or state checkpoints/rollback.
|
|
141
|
+
|
|
142
|
+
### Observer
|
|
143
|
+
**Directive:** Define a one-to-many dependency so that when one object changes state, all dependents are notified.
|
|
144
|
+
**Use when:**
|
|
145
|
+
- Changes to one object require updating others, and you don't want tight coupling (e.g. event systems, pub/sub, MVC views).
|
|
146
|
+
|
|
147
|
+
### State
|
|
148
|
+
**Directive:** Allow an object to alter its behavior when its internal state changes.
|
|
149
|
+
**Use when:**
|
|
150
|
+
- An object's behavior depends on its state, and it has many conditional branches based on that state.
|
|
151
|
+
|
|
152
|
+
### Strategy
|
|
153
|
+
**Directive:** Define a family of interchangeable algorithms and make them interchangeable at runtime.
|
|
154
|
+
**Use when:**
|
|
155
|
+
- You have multiple ways to perform a task (e.g. sorting, payment methods) and want to switch between them without conditionals.
|
|
156
|
+
|
|
157
|
+
### Template Method
|
|
158
|
+
**Directive:** Define the skeleton of an algorithm in a method, deferring some steps to subclasses.
|
|
159
|
+
**Use when:**
|
|
160
|
+
- Multiple classes share the same algorithm structure but differ in specific steps.
|
|
161
|
+
|
|
162
|
+
### Visitor
|
|
163
|
+
**Directive:** Represent an operation to be performed on elements of an object structure, without changing their classes.
|
|
164
|
+
**Use when:**
|
|
165
|
+
- You need to add new operations to a stable class hierarchy without modifying the classes themselves.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Quick Decision Guide
|
|
170
|
+
|
|
171
|
+
| Problem | Pattern |
|
|
172
|
+
|---|---|
|
|
173
|
+
| Need exactly one instance | Singleton |
|
|
174
|
+
| Complex object construction | Builder |
|
|
175
|
+
| Incompatible interfaces | Adapter |
|
|
176
|
+
| Add behavior without subclassing | Decorator |
|
|
177
|
+
| Simplify a complex subsystem | Facade |
|
|
178
|
+
| Notify multiple objects of changes | Observer |
|
|
179
|
+
| Swap algorithms at runtime | Strategy |
|
|
180
|
+
| Undo/redo functionality | Command / Memento |
|
|
181
|
+
| Traverse a collection | Iterator |
|
|
182
|
+
| Behavior changes with state | State |
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## General Directives
|
|
187
|
+
- Favor **composition over inheritance** where a pattern offers both options (Decorator, Strategy, Bridge).
|
|
188
|
+
- Don't force a pattern where simple code suffices — patterns solve *specific* recurring problems, not every problem.
|
|
189
|
+
- Recognize patterns from the *problem shape* first, then pick the pattern — not the reverse.
|
|
190
|
+
- Combine patterns when appropriate (e.g. Composite + Visitor, Factory + Singleton).
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devops
|
|
3
|
+
role: DevOps Engineer
|
|
4
|
+
description: >
|
|
5
|
+
Owns the path from committed code to running system: build, test-gate, package, deploy,
|
|
6
|
+
rollback, and environment configuration.
|
|
7
|
+
triggers: [deploy, pipeline, CI, CD, "CI/CD", release, rollback, staging, production, artifact]
|
|
8
|
+
version: 1.0
|
|
9
|
+
requires_tools: [read_tool, glob_tool, grep_tool, write_edit_tool, run_command_tool, ssh_tool, schedule_task_tool, github_tool, docker_deploy_ssh_tool]
|
|
10
|
+
composes_with: [docker-expert, kubernetes-expert, secops, performance-tester]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Role
|
|
14
|
+
Owns the path from committed code to running system: build, test-gate, package, deploy,
|
|
15
|
+
rollback, and environment configuration.
|
|
16
|
+
|
|
17
|
+
## Process
|
|
18
|
+
1. **Map the pipeline** — source → build → test gate → package → deploy stages; identify
|
|
19
|
+
which exist and which are missing.
|
|
20
|
+
2. **Automate the gap** — write/edit pipeline config (CI YAML, scripts) for the missing stage.
|
|
21
|
+
3. **Make it idempotent** — deploys and infra changes should be safely re-runnable.
|
|
22
|
+
4. **Define rollback** — every deploy path needs a documented/automated way back.
|
|
23
|
+
5. **Validate** — run the pipeline (or a dry-run) and read the Observation before calling it
|
|
24
|
+
done.
|
|
25
|
+
|
|
26
|
+
## Strategies
|
|
27
|
+
- Fail fast: put cheap checks (lint, unit tests) before expensive ones (integration, deploy).
|
|
28
|
+
- Keep secrets out of pipeline files — reference environment/secret store, never hardcode.
|
|
29
|
+
- Version infra config alongside app code; avoid manual, undocumented server changes.
|
|
30
|
+
- Prefer immutable deploys (new artifact/instance) over in-place mutation.
|
|
31
|
+
|
|
32
|
+
## Planning Approach
|
|
33
|
+
- Stage rollout: local → staging → production, with explicit gates between them.
|
|
34
|
+
- Document environment differences explicitly (config, scale, data) rather than assuming
|
|
35
|
+
parity.
|
|
36
|
+
|
|
37
|
+
## Instructions for This Task Type
|
|
38
|
+
- Always include a rollback path in artifact.md when proposing a deploy pipeline.
|
|
39
|
+
- Validate pipeline changes with a dry-run or a non-prod run before declaring done.
|
|
40
|
+
|
|
41
|
+
## Experience / Common Pitfalls
|
|
42
|
+
- Pipelines that only get tested by "will it work" hope, rather than an actual dry-run, are a
|
|
43
|
+
common source of prod incidents.
|
|
44
|
+
- Missing rollback plans turn small deploy issues into extended outages.
|
|
45
|
+
|
|
46
|
+
## Output Artifacts
|
|
47
|
+
- CI/CD pipeline config
|
|
48
|
+
- Deployment scripts
|
|
49
|
+
- artifact.md (deploy file list + rollback plan)
|
|
50
|
+
- Deploy report (via docker_deploy_ssh_tool: pre-check results, rollback status, per-service health)
|
|
51
|
+
|
|
52
|
+
## SSH Access
|
|
53
|
+
- SSH access to the target environment is required for deploys and health checks.
|
|
54
|
+
- Use the `ssh_tool` to run commands on the target environment, and `ssh_copy_tool` to copy files.
|
|
55
|
+
- Use `docker_deploy_ssh_tool` to deploy Docker containers via SSH.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Role } from "../types.js";
|
|
2
|
+
export interface RoleDirective {
|
|
3
|
+
directive: string;
|
|
4
|
+
skills: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One directive + skill set per role. This is the "technical knowledge"
|
|
8
|
+
* layer: what a role should already know how to do well, and in what
|
|
9
|
+
* order, before it ever gets to reasoning about a specific subtask.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ROLE_DIRECTIVES: Record<Role, RoleDirective>;
|
|
12
|
+
/**
|
|
13
|
+
* A specialized directive for the one-shot --ba flag that derives
|
|
14
|
+
* technical requirements from raw business-language documents.
|
|
15
|
+
* Distinct from the UI-focused business-analyst directive in ROLE_DIRECTIVES.
|
|
16
|
+
* This directive tells the agent to produce a structured requirements doc
|
|
17
|
+
* (goal, non-goals, constraints, acceptance criteria) rather than UI flows,
|
|
18
|
+
* page specs, or component trees.
|
|
19
|
+
*/
|
|
20
|
+
export declare const BA_REQUIREMENTS_DIRECTIVE: RoleDirective;
|