create-hq 5.0.0 → 5.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/dist/deps.d.ts +2 -2
- package/dist/deps.d.ts.map +1 -1
- package/dist/deps.js +138 -29
- package/dist/deps.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts +1 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +125 -26
- package/dist/scaffold.js.map +1 -1
- package/dist/ui.js +1 -1
- package/package.json +4 -8
- package/template/.claude/CLAUDE.md +0 -202
- package/template/.claude/commands/checkpoint.md +0 -127
- package/template/.claude/commands/cleanup.md +0 -307
- package/template/.claude/commands/execute-task.md +0 -440
- package/template/.claude/commands/exit-plan.md +0 -41
- package/template/.claude/commands/handoff.md +0 -97
- package/template/.claude/commands/learn.md +0 -218
- package/template/.claude/commands/metrics.md +0 -118
- package/template/.claude/commands/newworker.md +0 -162
- package/template/.claude/commands/nexttask.md +0 -67
- package/template/.claude/commands/prd.md +0 -238
- package/template/.claude/commands/reanchor.md +0 -51
- package/template/.claude/commands/remember.md +0 -126
- package/template/.claude/commands/run-project.md +0 -348
- package/template/.claude/commands/run.md +0 -110
- package/template/.claude/commands/search-reindex.md +0 -62
- package/template/.claude/commands/search.md +0 -100
- package/template/.claude/commands/setup.md +0 -381
- package/template/.claude/scripts/pure-ralph-loop.ps1 +0 -312
- package/template/.claude/scripts/pure-ralph-loop.sh +0 -859
- package/template/CHANGELOG.md +0 -220
- package/template/LICENSE +0 -21
- package/template/MIGRATION.md +0 -259
- package/template/README.md +0 -368
- package/template/data/journal/.gitkeep +0 -0
- package/template/docs/images/ascii-banner-options.md +0 -122
- package/template/docs/images/hq-banner.svg +0 -105
- package/template/knowledge/Ralph/01-overview.md +0 -71
- package/template/knowledge/Ralph/02-core-concepts.md +0 -114
- package/template/knowledge/Ralph/03-how-ralph-works.md +0 -184
- package/template/knowledge/Ralph/04-back-pressure.md +0 -222
- package/template/knowledge/Ralph/05-specifications.md +0 -210
- package/template/knowledge/Ralph/06-agents-md.md +0 -222
- package/template/knowledge/Ralph/07-implementation.md +0 -316
- package/template/knowledge/Ralph/08-economics.md +0 -182
- package/template/knowledge/Ralph/09-resources.md +0 -145
- package/template/knowledge/Ralph/10-claude-code-workflow.md +0 -212
- package/template/knowledge/Ralph/11-team-training-guide.md +0 -383
- package/template/knowledge/Ralph/README.md +0 -40
- package/template/knowledge/ai-security-framework/CONTRIBUTING.md +0 -139
- package/template/knowledge/ai-security-framework/GLOSSARY.md +0 -176
- package/template/knowledge/ai-security-framework/LICENSE +0 -21
- package/template/knowledge/ai-security-framework/QUICK-START.md +0 -172
- package/template/knowledge/ai-security-framework/README.md +0 -232
- package/template/knowledge/ai-security-framework/checklists/browser-security.md +0 -301
- package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +0 -322
- package/template/knowledge/ai-security-framework/checklists/incident-response.md +0 -288
- package/template/knowledge/ai-security-framework/checklists/pre-flight.md +0 -249
- package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +0 -159
- package/template/knowledge/ai-security-framework/configs/audit-logging.md +0 -372
- package/template/knowledge/ai-security-framework/configs/kill-switches.md +0 -354
- package/template/knowledge/ai-security-framework/docs/01-core-principles.md +0 -256
- package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +0 -326
- package/template/knowledge/ai-security-framework/docs/03-security-posture.md +0 -250
- package/template/knowledge/ai-security-framework/templates/agents-security.md +0 -233
- package/template/knowledge/design-styles/README.md +0 -42
- package/template/knowledge/design-styles/american-industrial.md +0 -136
- package/template/knowledge/design-styles/ethereal-abstract.md +0 -133
- package/template/knowledge/design-styles/liminal-portal.md +0 -111
- package/template/knowledge/design-styles/swipes/american-industrial/G-3m4YPW0AADdu2.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJlt5WwAABK3K.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G-JJmj5W0AEbJ-7.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ (1).jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G59fgNuXkAAKLJQ.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G7fVkn3WEAAM-ST.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G8ECO5JWEAIksyn.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9-3GQSWoAA8eqZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G9xEOqrXkAEZRcs.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_MVeJrXQAA8sx4.jpeg +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/G_RSkmGXkAAgAVZ.png +0 -0
- package/template/knowledge/design-styles/swipes/american-industrial/README.md +0 -31
- package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
- package/template/knowledge/dev-team/README.md +0 -35
- package/template/knowledge/dev-team/patterns/README.md +0 -34
- package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +0 -178
- package/template/knowledge/dev-team/troubleshooting/README.md +0 -31
- package/template/knowledge/dev-team/workflows/README.md +0 -49
- package/template/knowledge/hq/checkpoint-schema.json +0 -51
- package/template/knowledge/hq/index-md-spec.md +0 -74
- package/template/knowledge/hq/thread-schema.md +0 -153
- package/template/knowledge/hq-core/checkpoint-schema.json +0 -51
- package/template/knowledge/hq-core/index-md-spec.md +0 -74
- package/template/knowledge/hq-core/thread-schema.md +0 -153
- package/template/knowledge/loom/README.md +0 -51
- package/template/knowledge/loom/architecture.md +0 -125
- package/template/knowledge/loom/code-style.md +0 -169
- package/template/knowledge/loom/llm-proxy.md +0 -132
- package/template/knowledge/loom/state-machine.md +0 -131
- package/template/knowledge/loom/thread-system.md +0 -117
- package/template/knowledge/loom/tools.md +0 -94
- package/template/knowledge/loom/weaver.md +0 -96
- package/template/knowledge/loom/web-frontend.md +0 -131
- package/template/knowledge/projects/README.md +0 -72
- package/template/knowledge/projects/templates/README.template.md +0 -28
- package/template/knowledge/workers/README.md +0 -195
- package/template/knowledge/workers/ralph-loop-pattern.md +0 -157
- package/template/knowledge/workers/skill-schema.md +0 -182
- package/template/knowledge/workers/state-machine.md +0 -102
- package/template/knowledge/workers/templates/base-worker.yaml +0 -73
- package/template/knowledge/workers/templates/code-worker.yaml +0 -85
- package/template/knowledge/workers/templates/skill.yaml +0 -49
- package/template/knowledge/workers/templates/social-worker.yaml +0 -70
- package/template/modules/examples/full-manifest.yaml +0 -92
- package/template/modules/examples/minimal.yaml +0 -14
- package/template/modules/modules.yaml +0 -59
- package/template/projects/.gitkeep +0 -0
- package/template/projects/incorporate-workers-into-pure-ralph/prd.json +0 -88
- package/template/projects/pure-ralph-branch-isolation/README.md +0 -114
- package/template/projects/pure-ralph-branch-isolation/prd.json +0 -123
- package/template/projects/purist-ralph-loop/README.md +0 -148
- package/template/projects/purist-ralph-loop/prd.json +0 -135
- package/template/projects/ralph-test/prd.json +0 -50
- package/template/prompts/pure-ralph-base.md +0 -551
- package/template/settings/.gitkeep +0 -0
- package/template/settings/pure-ralph.json +0 -42
- package/template/social-content/drafts/INDEX.md +0 -21
- package/template/social-content/drafts/linkedin/.gitkeep +0 -1
- package/template/social-content/drafts/x/.gitkeep +0 -1
- package/template/social-content/images/.gitkeep +0 -1
- package/template/starter-projects/code-worker/README.md +0 -97
- package/template/starter-projects/code-worker/prd.json +0 -45
- package/template/starter-projects/personal-assistant/README.md +0 -42
- package/template/starter-projects/personal-assistant/prd.json +0 -43
- package/template/starter-projects/social-media/README.md +0 -60
- package/template/starter-projects/social-media/prd.json +0 -43
- package/template/workers/content-brand/README.md +0 -59
- package/template/workers/content-brand/skills/messaging-alignment.md +0 -91
- package/template/workers/content-brand/skills/tone-check.md +0 -76
- package/template/workers/content-brand/skills/voice-analysis.md +0 -68
- package/template/workers/content-brand/worker.yaml +0 -81
- package/template/workers/content-legal/README.md +0 -80
- package/template/workers/content-legal/skills/claim-substantiation.md +0 -150
- package/template/workers/content-legal/skills/compliance-scan.md +0 -123
- package/template/workers/content-legal/skills/disclaimer-check.md +0 -146
- package/template/workers/content-legal/worker.yaml +0 -118
- package/template/workers/content-product/README.md +0 -77
- package/template/workers/content-product/skills/claim-verification.md +0 -96
- package/template/workers/content-product/skills/feature-accuracy.md +0 -117
- package/template/workers/content-product/skills/stats-check.md +0 -128
- package/template/workers/content-product/worker.yaml +0 -97
- package/template/workers/content-sales/README.md +0 -70
- package/template/workers/content-sales/skills/conversion-analysis.md +0 -96
- package/template/workers/content-sales/skills/cta-audit.md +0 -107
- package/template/workers/content-sales/skills/value-prop-check.md +0 -114
- package/template/workers/content-sales/worker.yaml +0 -93
- package/template/workers/content-shared/cli.ts +0 -242
- package/template/workers/content-shared/index.ts +0 -234
- package/template/workers/content-shared/lib/accuracy-analyzer.ts +0 -661
- package/template/workers/content-shared/lib/analyze.ts +0 -370
- package/template/workers/content-shared/lib/brand-analyzer.ts +0 -526
- package/template/workers/content-shared/lib/cms-integration.ts +0 -446
- package/template/workers/content-shared/lib/compliance-analyzer.ts +0 -655
- package/template/workers/content-shared/lib/conversion-analyzer.ts +0 -555
- package/template/workers/content-shared/lib/github-integration.ts +0 -582
- package/template/workers/content-shared/lib/output.ts +0 -373
- package/template/workers/content-shared/lib/parser.ts +0 -771
- package/template/workers/content-shared/lib/priority.ts +0 -439
- package/template/workers/content-shared/lib/recommendations.ts +0 -512
- package/template/workers/content-shared/lib/reporter.ts +0 -749
- package/template/workers/content-shared/lib/restructure.ts +0 -664
- package/template/workers/content-shared/lib/scorer.ts +0 -140
- package/template/workers/content-shared/lib/types.ts +0 -227
- package/template/workers/content-shared/lib/variants.ts +0 -595
- package/template/workers/content-shared/package.json +0 -51
- package/template/workers/content-shared/pnpm-lock.yaml +0 -39
- package/template/workers/content-shared/test/sample-page.json +0 -115
- package/template/workers/content-shared/tsconfig.json +0 -20
- package/template/workers/dev-team/README.md +0 -166
- package/template/workers/dev-team/_template.yaml +0 -70
- package/template/workers/dev-team/architect/package.json +0 -27
- package/template/workers/dev-team/architect/skills/api-design.md +0 -89
- package/template/workers/dev-team/architect/skills/refactor-plan.md +0 -96
- package/template/workers/dev-team/architect/skills/system-design.md +0 -100
- package/template/workers/dev-team/architect/src/index.ts +0 -49
- package/template/workers/dev-team/architect/src/mcp-server.ts +0 -122
- package/template/workers/dev-team/architect/src/skills/api-design.ts +0 -316
- package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +0 -264
- package/template/workers/dev-team/architect/src/skills/system-design.ts +0 -212
- package/template/workers/dev-team/architect/tsconfig.json +0 -19
- package/template/workers/dev-team/architect/worker.yaml +0 -128
- package/template/workers/dev-team/backend-dev/package-lock.json +0 -1252
- package/template/workers/dev-team/backend-dev/package.json +0 -27
- package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +0 -70
- package/template/workers/dev-team/backend-dev/skills/implement-service.md +0 -62
- package/template/workers/dev-team/backend-dev/src/index.ts +0 -51
- package/template/workers/dev-team/backend-dev/src/mcp-server.ts +0 -109
- package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +0 -122
- package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +0 -126
- package/template/workers/dev-team/backend-dev/tsconfig.json +0 -19
- package/template/workers/dev-team/backend-dev/worker.yaml +0 -128
- package/template/workers/dev-team/code-reviewer/package-lock.json +0 -1080
- package/template/workers/dev-team/code-reviewer/package.json +0 -24
- package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +0 -61
- package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +0 -54
- package/template/workers/dev-team/code-reviewer/skills/request-changes.md +0 -63
- package/template/workers/dev-team/code-reviewer/skills/review-pr.md +0 -77
- package/template/workers/dev-team/code-reviewer/src/index.ts +0 -56
- package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +0 -101
- package/template/workers/dev-team/code-reviewer/tsconfig.json +0 -19
- package/template/workers/dev-team/code-reviewer/worker.yaml +0 -90
- package/template/workers/dev-team/database-dev/package.json +0 -22
- package/template/workers/dev-team/database-dev/skills/create-schema.md +0 -48
- package/template/workers/dev-team/database-dev/src/index.ts +0 -50
- package/template/workers/dev-team/database-dev/src/mcp-server.ts +0 -76
- package/template/workers/dev-team/database-dev/tsconfig.json +0 -18
- package/template/workers/dev-team/database-dev/worker.yaml +0 -90
- package/template/workers/dev-team/frontend-dev/package.json +0 -22
- package/template/workers/dev-team/frontend-dev/skills/create-component.md +0 -26
- package/template/workers/dev-team/frontend-dev/src/index.ts +0 -50
- package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +0 -77
- package/template/workers/dev-team/frontend-dev/tsconfig.json +0 -18
- package/template/workers/dev-team/frontend-dev/worker.yaml +0 -132
- package/template/workers/dev-team/infra-dev/package.json +0 -24
- package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +0 -73
- package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +0 -80
- package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +0 -62
- package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +0 -63
- package/template/workers/dev-team/infra-dev/src/index.ts +0 -55
- package/template/workers/dev-team/infra-dev/src/mcp-server.ts +0 -82
- package/template/workers/dev-team/infra-dev/tsconfig.json +0 -19
- package/template/workers/dev-team/infra-dev/worker.yaml +0 -92
- package/template/workers/dev-team/knowledge-curator/package.json +0 -24
- package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +0 -63
- package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +0 -61
- package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +0 -76
- package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +0 -63
- package/template/workers/dev-team/knowledge-curator/src/index.ts +0 -53
- package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +0 -92
- package/template/workers/dev-team/knowledge-curator/tsconfig.json +0 -19
- package/template/workers/dev-team/knowledge-curator/worker.yaml +0 -80
- package/template/workers/dev-team/motion-designer/package.json +0 -22
- package/template/workers/dev-team/motion-designer/skills/add-animation.md +0 -25
- package/template/workers/dev-team/motion-designer/skills/generate-image.md +0 -36
- package/template/workers/dev-team/motion-designer/src/index.ts +0 -63
- package/template/workers/dev-team/motion-designer/src/mcp-server.ts +0 -79
- package/template/workers/dev-team/motion-designer/tsconfig.json +0 -18
- package/template/workers/dev-team/motion-designer/worker.yaml +0 -84
- package/template/workers/dev-team/product-planner/queue.json +0 -4
- package/template/workers/dev-team/product-planner/worker.yaml +0 -220
- package/template/workers/dev-team/project-manager/package-lock.json +0 -1252
- package/template/workers/dev-team/project-manager/package.json +0 -27
- package/template/workers/dev-team/project-manager/skills/create-prd.md +0 -66
- package/template/workers/dev-team/project-manager/skills/next-issue.md +0 -51
- package/template/workers/dev-team/project-manager/skills/project-status.md +0 -59
- package/template/workers/dev-team/project-manager/skills/update-learnings.md +0 -65
- package/template/workers/dev-team/project-manager/src/index.ts +0 -54
- package/template/workers/dev-team/project-manager/src/mcp-server.ts +0 -207
- package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +0 -86
- package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +0 -137
- package/template/workers/dev-team/project-manager/src/skills/project-status.ts +0 -131
- package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +0 -94
- package/template/workers/dev-team/project-manager/tsconfig.json +0 -19
- package/template/workers/dev-team/project-manager/worker.yaml +0 -96
- package/template/workers/dev-team/qa-tester/package.json +0 -24
- package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +0 -36
- package/template/workers/dev-team/qa-tester/skills/run-tests.md +0 -36
- package/template/workers/dev-team/qa-tester/skills/write-test.md +0 -27
- package/template/workers/dev-team/qa-tester/src/index.ts +0 -61
- package/template/workers/dev-team/qa-tester/src/mcp-server.ts +0 -88
- package/template/workers/dev-team/qa-tester/tsconfig.json +0 -18
- package/template/workers/dev-team/qa-tester/worker.yaml +0 -116
- package/template/workers/dev-team/task-executor/package-lock.json +0 -1252
- package/template/workers/dev-team/task-executor/package.json +0 -27
- package/template/workers/dev-team/task-executor/skills/analyze-issue.md +0 -101
- package/template/workers/dev-team/task-executor/skills/execute.md +0 -133
- package/template/workers/dev-team/task-executor/skills/report-learnings.md +0 -106
- package/template/workers/dev-team/task-executor/skills/validate-completion.md +0 -121
- package/template/workers/dev-team/task-executor/src/index.ts +0 -54
- package/template/workers/dev-team/task-executor/src/mcp-server.ts +0 -139
- package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +0 -219
- package/template/workers/dev-team/task-executor/src/skills/execute.ts +0 -132
- package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +0 -119
- package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +0 -142
- package/template/workers/dev-team/task-executor/tsconfig.json +0 -19
- package/template/workers/dev-team/task-executor/worker.yaml +0 -110
- package/template/workers/registry.yaml +0 -171
- package/template/workers/security-scanner/README.md +0 -73
- package/template/workers/security-scanner/skills/pre-deploy-check.md +0 -205
- package/template/workers/security-scanner/worker.yaml +0 -26
- package/template/workspace/checkpoints/.gitkeep +0 -0
- package/template/workspace/content-ideas/inbox.jsonl +0 -0
- package/template/workspace/drafts/.gitkeep +0 -0
- package/template/workspace/learnings/.gitkeep +0 -3
- package/template/workspace/orchestrator/.gitkeep +0 -0
- package/template/workspace/ralph-test/COMPLETE.md +0 -18
- package/template/workspace/ralph-test/hello.txt +0 -2
- package/template/workspace/reports/.gitkeep +0 -0
- package/template/workspace/scratch/.gitkeep +0 -0
- package/template/workspace/threads/.gitkeep +0 -3
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
|
|
4
|
-
interface Story {
|
|
5
|
-
id: string;
|
|
6
|
-
title: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
acceptance_criteria: string[];
|
|
9
|
-
priority: number;
|
|
10
|
-
passes: boolean;
|
|
11
|
-
worker_hints?: string[];
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface AnalyzeOptions {
|
|
15
|
-
issue: string;
|
|
16
|
-
project: string;
|
|
17
|
-
repo?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface AnalysisResult {
|
|
21
|
-
issue: string;
|
|
22
|
-
title: string;
|
|
23
|
-
workers: string[];
|
|
24
|
-
sequence: Array<{ worker: string; phase: string }>;
|
|
25
|
-
estimated_files: string[];
|
|
26
|
-
complexity: 'simple' | 'medium' | 'complex';
|
|
27
|
-
reasoning: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Worker detection patterns
|
|
31
|
-
const WORKER_PATTERNS: Record<string, string[]> = {
|
|
32
|
-
'backend-dev': ['api', 'endpoint', 'route', 'server', 'middleware', 'controller'],
|
|
33
|
-
'database-dev': ['database', 'schema', 'migration', 'table', 'query', 'sql'],
|
|
34
|
-
'frontend-dev': ['component', 'ui', 'page', 'form', 'button', 'modal', 'react', 'next'],
|
|
35
|
-
'motion-designer': ['animation', 'transition', 'motion', 'polish', 'effect', 'visual'],
|
|
36
|
-
'infra-dev': ['ci/cd', 'deploy', 'pipeline', 'docker', 'kubernetes', 'terraform'],
|
|
37
|
-
'qa-tester': ['test', 'coverage', 'accessibility', 'a11y', 'e2e', 'integration'],
|
|
38
|
-
'architect': ['architecture', 'design', 'refactor', 'restructure', 'pattern'],
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Standard worker sequences
|
|
42
|
-
const SEQUENCES: Record<string, string[]> = {
|
|
43
|
-
'api': ['backend-dev', 'qa-tester'],
|
|
44
|
-
'api-with-db': ['architect', 'database-dev', 'backend-dev', 'qa-tester'],
|
|
45
|
-
'frontend': ['frontend-dev', 'qa-tester'],
|
|
46
|
-
'frontend-polished': ['frontend-dev', 'motion-designer', 'qa-tester'],
|
|
47
|
-
'fullstack': ['architect', 'database-dev', 'backend-dev', 'frontend-dev', 'qa-tester'],
|
|
48
|
-
'infra': ['architect', 'infra-dev', 'qa-tester'],
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export async function analyzeIssue(options: AnalyzeOptions): Promise<AnalysisResult | null> {
|
|
52
|
-
const { issue, project, repo } = options;
|
|
53
|
-
|
|
54
|
-
// Find PRD
|
|
55
|
-
const prdPath = path.join(process.cwd(), '..', '..', '..', 'projects', project, 'prd.json');
|
|
56
|
-
|
|
57
|
-
if (!fs.existsSync(prdPath)) {
|
|
58
|
-
console.error(`PRD not found at ${prdPath}`);
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const prd = JSON.parse(fs.readFileSync(prdPath, 'utf-8'));
|
|
63
|
-
|
|
64
|
-
// Find the issue
|
|
65
|
-
let story: Story | null = null;
|
|
66
|
-
for (const epic of prd.epics) {
|
|
67
|
-
for (const s of epic.stories) {
|
|
68
|
-
if (s.id === issue) {
|
|
69
|
-
story = s;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!story) {
|
|
76
|
-
console.error(`Issue ${issue} not found in PRD`);
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
console.log(`\n=== Analysis: ${issue} ===\n`);
|
|
81
|
-
console.log(`Title: ${story.title}`);
|
|
82
|
-
if (story.description) {
|
|
83
|
-
console.log(`Description: ${story.description}`);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Check for explicit worker hints
|
|
87
|
-
let workers: string[] = [];
|
|
88
|
-
let reasoning = '';
|
|
89
|
-
|
|
90
|
-
if (story.worker_hints && story.worker_hints.length > 0) {
|
|
91
|
-
workers = story.worker_hints;
|
|
92
|
-
reasoning = 'Using explicit worker_hints from PRD';
|
|
93
|
-
console.log(`\nUsing worker_hints: ${workers.join(', ')}`);
|
|
94
|
-
} else {
|
|
95
|
-
// Auto-detect workers
|
|
96
|
-
const text = `${story.title} ${story.description || ''} ${story.acceptance_criteria.join(' ')}`.toLowerCase();
|
|
97
|
-
|
|
98
|
-
const detectedWorkers: Set<string> = new Set();
|
|
99
|
-
const detectedPatterns: string[] = [];
|
|
100
|
-
|
|
101
|
-
for (const [worker, patterns] of Object.entries(WORKER_PATTERNS)) {
|
|
102
|
-
for (const pattern of patterns) {
|
|
103
|
-
if (text.includes(pattern)) {
|
|
104
|
-
detectedWorkers.add(worker);
|
|
105
|
-
detectedPatterns.push(`"${pattern}" → ${worker}`);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Always add qa-tester at the end if not present
|
|
112
|
-
if (!detectedWorkers.has('qa-tester')) {
|
|
113
|
-
detectedWorkers.add('qa-tester');
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
workers = Array.from(detectedWorkers);
|
|
117
|
-
reasoning = `Detected patterns: ${detectedPatterns.join(', ')}`;
|
|
118
|
-
|
|
119
|
-
console.log('\nDetected patterns:');
|
|
120
|
-
for (const p of detectedPatterns) {
|
|
121
|
-
console.log(` - ${p}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Order workers properly
|
|
126
|
-
const orderedWorkers = orderWorkers(workers);
|
|
127
|
-
|
|
128
|
-
// Build sequence with descriptions
|
|
129
|
-
const sequence = orderedWorkers.map(worker => ({
|
|
130
|
-
worker,
|
|
131
|
-
phase: getPhaseDescription(worker, story!.title),
|
|
132
|
-
}));
|
|
133
|
-
|
|
134
|
-
// Estimate complexity
|
|
135
|
-
const complexity = estimateComplexity(sequence.length, story.acceptance_criteria.length);
|
|
136
|
-
|
|
137
|
-
// Estimate files (placeholder - would need repo analysis)
|
|
138
|
-
const estimated_files = estimateFiles(workers, repo);
|
|
139
|
-
|
|
140
|
-
const result: AnalysisResult = {
|
|
141
|
-
issue,
|
|
142
|
-
title: story.title,
|
|
143
|
-
workers: orderedWorkers,
|
|
144
|
-
sequence,
|
|
145
|
-
estimated_files,
|
|
146
|
-
complexity,
|
|
147
|
-
reasoning,
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
console.log(`\nRecommended sequence:`);
|
|
151
|
-
for (let i = 0; i < sequence.length; i++) {
|
|
152
|
-
console.log(` ${i + 1}. ${sequence[i].worker}: ${sequence[i].phase}`);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
console.log(`\nEstimated files: ${estimated_files.join(', ')}`);
|
|
156
|
-
console.log(`Complexity: ${complexity}`);
|
|
157
|
-
|
|
158
|
-
console.log('\n[Human approval required]');
|
|
159
|
-
console.log('Confirm sequence? [y/n/modify]');
|
|
160
|
-
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function orderWorkers(workers: string[]): string[] {
|
|
165
|
-
const order = [
|
|
166
|
-
'architect',
|
|
167
|
-
'database-dev',
|
|
168
|
-
'backend-dev',
|
|
169
|
-
'frontend-dev',
|
|
170
|
-
'motion-designer',
|
|
171
|
-
'infra-dev',
|
|
172
|
-
'qa-tester',
|
|
173
|
-
'code-reviewer',
|
|
174
|
-
];
|
|
175
|
-
|
|
176
|
-
return workers.sort((a, b) => {
|
|
177
|
-
const aIndex = order.indexOf(a);
|
|
178
|
-
const bIndex = order.indexOf(b);
|
|
179
|
-
return (aIndex === -1 ? 99 : aIndex) - (bIndex === -1 ? 99 : bIndex);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
function getPhaseDescription(worker: string, issueTitle: string): string {
|
|
184
|
-
const descriptions: Record<string, string> = {
|
|
185
|
-
'architect': `Design approach for: ${issueTitle}`,
|
|
186
|
-
'database-dev': `Schema changes for: ${issueTitle}`,
|
|
187
|
-
'backend-dev': `Implement backend for: ${issueTitle}`,
|
|
188
|
-
'frontend-dev': `Build UI for: ${issueTitle}`,
|
|
189
|
-
'motion-designer': `Add polish/animations for: ${issueTitle}`,
|
|
190
|
-
'infra-dev': `Configure infrastructure for: ${issueTitle}`,
|
|
191
|
-
'qa-tester': `Verify: ${issueTitle}`,
|
|
192
|
-
'code-reviewer': `Review changes for: ${issueTitle}`,
|
|
193
|
-
};
|
|
194
|
-
return descriptions[worker] || `Execute: ${issueTitle}`;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function estimateComplexity(phases: number, criteria: number): 'simple' | 'medium' | 'complex' {
|
|
198
|
-
const score = phases + criteria / 2;
|
|
199
|
-
if (score <= 3) return 'simple';
|
|
200
|
-
if (score <= 6) return 'medium';
|
|
201
|
-
return 'complex';
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function estimateFiles(workers: string[], repo?: string): string[] {
|
|
205
|
-
// Placeholder - would analyze repo in production
|
|
206
|
-
const files: string[] = [];
|
|
207
|
-
|
|
208
|
-
if (workers.includes('backend-dev')) {
|
|
209
|
-
files.push('src/api/*.ts');
|
|
210
|
-
}
|
|
211
|
-
if (workers.includes('database-dev')) {
|
|
212
|
-
files.push('src/db/*.ts', 'migrations/*.sql');
|
|
213
|
-
}
|
|
214
|
-
if (workers.includes('frontend-dev')) {
|
|
215
|
-
files.push('src/components/*.tsx', 'src/pages/*.tsx');
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return files.length > 0 ? files : ['(analysis requires --repo)'];
|
|
219
|
-
}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import * as fs from 'fs';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { analyzeIssue, AnalysisResult } from './analyze-issue';
|
|
4
|
-
import { validateCompletion } from './validate-completion';
|
|
5
|
-
|
|
6
|
-
interface ExecuteOptions {
|
|
7
|
-
issue: string;
|
|
8
|
-
project: string;
|
|
9
|
-
repo?: string;
|
|
10
|
-
skipValidation?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface ExecutionPhase {
|
|
14
|
-
worker: string;
|
|
15
|
-
description: string;
|
|
16
|
-
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
17
|
-
result?: string;
|
|
18
|
-
error?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
interface ExecutionState {
|
|
22
|
-
issue: string;
|
|
23
|
-
project: string;
|
|
24
|
-
phases: ExecutionPhase[];
|
|
25
|
-
currentPhase: number;
|
|
26
|
-
learnings: Array<{ type: string; content: string }>;
|
|
27
|
-
startTime: Date;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export async function execute(options: ExecuteOptions): Promise<void> {
|
|
31
|
-
const { issue, project, repo, skipValidation } = options;
|
|
32
|
-
|
|
33
|
-
console.log(`\n=== Executing ${issue} ===\n`);
|
|
34
|
-
|
|
35
|
-
// Step 1: Analyze issue
|
|
36
|
-
console.log('Analyzing issue...');
|
|
37
|
-
const analysis = await analyzeIssue({ issue, project, repo });
|
|
38
|
-
|
|
39
|
-
if (!analysis) {
|
|
40
|
-
console.error('Failed to analyze issue');
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Step 2: Present plan
|
|
45
|
-
console.log('\nPlanned execution:');
|
|
46
|
-
for (let i = 0; i < analysis.sequence.length; i++) {
|
|
47
|
-
const phase = analysis.sequence[i];
|
|
48
|
-
console.log(` ${i + 1}. ${phase.worker}: ${phase.phase}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
console.log(`\nComplexity: ${analysis.complexity}`);
|
|
52
|
-
console.log(`Estimated files: ${analysis.estimated_files.join(', ')}`);
|
|
53
|
-
|
|
54
|
-
console.log('\n[Human approval required]');
|
|
55
|
-
console.log('Approve plan? [y/n/modify]');
|
|
56
|
-
console.log('(In production, this waits for human input)\n');
|
|
57
|
-
|
|
58
|
-
// Step 3: Execute phases
|
|
59
|
-
const state: ExecutionState = {
|
|
60
|
-
issue,
|
|
61
|
-
project,
|
|
62
|
-
phases: analysis.sequence.map(s => ({
|
|
63
|
-
worker: s.worker,
|
|
64
|
-
description: s.phase,
|
|
65
|
-
status: 'pending' as const,
|
|
66
|
-
})),
|
|
67
|
-
currentPhase: 0,
|
|
68
|
-
learnings: [],
|
|
69
|
-
startTime: new Date(),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
for (let i = 0; i < state.phases.length; i++) {
|
|
73
|
-
state.currentPhase = i;
|
|
74
|
-
const phase = state.phases[i];
|
|
75
|
-
|
|
76
|
-
console.log(`\n--- Phase ${i + 1}/${state.phases.length} ---`);
|
|
77
|
-
console.log(`Spawning ${phase.worker}: ${phase.description}`);
|
|
78
|
-
console.log('\n[Human approval required]');
|
|
79
|
-
console.log('Approve? [y/inject context/skip]');
|
|
80
|
-
|
|
81
|
-
// Mark as running
|
|
82
|
-
phase.status = 'running';
|
|
83
|
-
|
|
84
|
-
// In production, this would spawn the worker via Task tool
|
|
85
|
-
console.log(`\n[Would spawn ${phase.worker} worker here]`);
|
|
86
|
-
console.log('Task tool call:');
|
|
87
|
-
console.log(JSON.stringify({
|
|
88
|
-
description: `${phase.worker}: ${phase.description}`,
|
|
89
|
-
prompt: `Execute ${phase.worker} worker for issue ${issue}...`,
|
|
90
|
-
subagent_type: 'general-purpose',
|
|
91
|
-
}, null, 2));
|
|
92
|
-
|
|
93
|
-
// Simulate completion
|
|
94
|
-
phase.status = 'completed';
|
|
95
|
-
phase.result = `Completed ${phase.description}`;
|
|
96
|
-
|
|
97
|
-
console.log(`\n${phase.worker} completed:`);
|
|
98
|
-
console.log(` Result: ${phase.result}`);
|
|
99
|
-
console.log('\n[Human approval required]');
|
|
100
|
-
console.log('Approve changes? [y/n/rollback]');
|
|
101
|
-
|
|
102
|
-
// Step 4: Validate (if not skipped)
|
|
103
|
-
if (!skipValidation && repo) {
|
|
104
|
-
console.log('\nRunning validation...');
|
|
105
|
-
await validateCompletion({ repo });
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Step 5: Extract learnings
|
|
110
|
-
console.log('\n=== Execution Complete ===\n');
|
|
111
|
-
|
|
112
|
-
const duration = Math.round((Date.now() - state.startTime.getTime()) / 1000);
|
|
113
|
-
console.log(`Duration: ${duration}s`);
|
|
114
|
-
console.log(`Phases: ${state.phases.filter(p => p.status === 'completed').length}/${state.phases.length} completed`);
|
|
115
|
-
|
|
116
|
-
// Sample learnings
|
|
117
|
-
state.learnings.push({
|
|
118
|
-
type: 'workflow',
|
|
119
|
-
content: `Sequence ${analysis.sequence.map(s => s.worker).join(' → ')} worked well for ${issue}`,
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
console.log('\nLearnings extracted:');
|
|
123
|
-
for (const learning of state.learnings) {
|
|
124
|
-
console.log(` - [${learning.type}] ${learning.content}`);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
console.log('\n[Human approval required]');
|
|
128
|
-
console.log('Mark issue as passing? [y/n]');
|
|
129
|
-
|
|
130
|
-
console.log('\nTo route learnings, run:');
|
|
131
|
-
console.log(` project-manager update-learnings --project ${project}`);
|
|
132
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
interface Learning {
|
|
2
|
-
type: 'project' | 'pattern' | 'troubleshoot' | 'workflow';
|
|
3
|
-
category?: string;
|
|
4
|
-
content: string;
|
|
5
|
-
source?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface ReportOptions {
|
|
9
|
-
verbose?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface ExecutionContext {
|
|
13
|
-
task: string;
|
|
14
|
-
project: string;
|
|
15
|
-
phases: number;
|
|
16
|
-
retries: number;
|
|
17
|
-
duration: string;
|
|
18
|
-
workers: string[];
|
|
19
|
-
errors: string[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function reportLearnings(options: ReportOptions): Promise<void> {
|
|
23
|
-
const { verbose } = options;
|
|
24
|
-
|
|
25
|
-
console.log('=== Learning Extraction ===\n');
|
|
26
|
-
|
|
27
|
-
// In production, this would receive context from execute skill
|
|
28
|
-
// For now, show the expected format and process
|
|
29
|
-
|
|
30
|
-
console.log('This skill extracts learnings from task execution.\n');
|
|
31
|
-
|
|
32
|
-
console.log('Expected input (from execute skill):');
|
|
33
|
-
const sampleContext: ExecutionContext = {
|
|
34
|
-
task: 'US-003',
|
|
35
|
-
project: 'auth-feature',
|
|
36
|
-
phases: 2,
|
|
37
|
-
retries: 0,
|
|
38
|
-
duration: '5m',
|
|
39
|
-
workers: ['backend-dev', 'qa-tester'],
|
|
40
|
-
errors: [],
|
|
41
|
-
};
|
|
42
|
-
console.log(JSON.stringify(sampleContext, null, 2));
|
|
43
|
-
|
|
44
|
-
console.log('\n' + '-'.repeat(40) + '\n');
|
|
45
|
-
|
|
46
|
-
// Learning extraction logic
|
|
47
|
-
const learnings: Learning[] = [];
|
|
48
|
-
|
|
49
|
-
// Analyze execution for learnings
|
|
50
|
-
learnings.push({
|
|
51
|
-
type: 'workflow',
|
|
52
|
-
content: `Sequence ${sampleContext.workers.join(' → ')} worked well for auth endpoints`,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
if (sampleContext.retries === 0) {
|
|
56
|
-
learnings.push({
|
|
57
|
-
type: 'pattern',
|
|
58
|
-
category: 'general',
|
|
59
|
-
content: 'Clean execution with no retries indicates well-scoped task',
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Format output
|
|
64
|
-
console.log('Extracted learnings:\n');
|
|
65
|
-
|
|
66
|
-
for (let i = 0; i < learnings.length; i++) {
|
|
67
|
-
const l = learnings[i];
|
|
68
|
-
const category = l.category ? `/${l.category}` : '';
|
|
69
|
-
console.log(`${i + 1}. [${l.type}${category}]`);
|
|
70
|
-
console.log(` ${l.content}`);
|
|
71
|
-
if (l.source) {
|
|
72
|
-
console.log(` Source: ${l.source}`);
|
|
73
|
-
}
|
|
74
|
-
console.log();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Routing info
|
|
78
|
-
console.log('Routing destinations:');
|
|
79
|
-
for (const l of learnings) {
|
|
80
|
-
let dest = '';
|
|
81
|
-
switch (l.type) {
|
|
82
|
-
case 'project':
|
|
83
|
-
dest = `projects/${sampleContext.project}/learnings/`;
|
|
84
|
-
break;
|
|
85
|
-
case 'pattern':
|
|
86
|
-
dest = `knowledge/dev-team/patterns/${l.category || 'general'}/`;
|
|
87
|
-
break;
|
|
88
|
-
case 'troubleshoot':
|
|
89
|
-
dest = 'knowledge/dev-team/troubleshooting/';
|
|
90
|
-
break;
|
|
91
|
-
case 'workflow':
|
|
92
|
-
dest = 'knowledge/dev-team/workflows/';
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
console.log(` - [${l.type}] → ${dest}`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
console.log('\n[Human approval required]');
|
|
99
|
-
console.log('Approve learnings for routing? [y/n/edit]');
|
|
100
|
-
|
|
101
|
-
console.log('\nTo route approved learnings:');
|
|
102
|
-
console.log(` project-manager update-learnings --project ${sampleContext.project}`);
|
|
103
|
-
|
|
104
|
-
// Output format for project-manager
|
|
105
|
-
if (verbose) {
|
|
106
|
-
console.log('\n' + '-'.repeat(40));
|
|
107
|
-
console.log('\nJSON output for project-manager:');
|
|
108
|
-
console.log(JSON.stringify({
|
|
109
|
-
task: sampleContext.task,
|
|
110
|
-
project: sampleContext.project,
|
|
111
|
-
execution: {
|
|
112
|
-
phases: sampleContext.phases,
|
|
113
|
-
retries: sampleContext.retries,
|
|
114
|
-
duration: sampleContext.duration,
|
|
115
|
-
},
|
|
116
|
-
learnings,
|
|
117
|
-
}, null, 2));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
|
|
4
|
-
interface ValidateOptions {
|
|
5
|
-
repo: string;
|
|
6
|
-
checks?: string;
|
|
7
|
-
strict?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface CheckResult {
|
|
11
|
-
name: string;
|
|
12
|
-
passed: boolean;
|
|
13
|
-
output: string;
|
|
14
|
-
errors: string[];
|
|
15
|
-
warnings: string[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export async function validateCompletion(options: ValidateOptions): Promise<boolean> {
|
|
19
|
-
const { repo, checks, strict } = options;
|
|
20
|
-
|
|
21
|
-
const checksToRun = checks ? checks.split(',') : ['typecheck', 'lint', 'test'];
|
|
22
|
-
const results: CheckResult[] = [];
|
|
23
|
-
|
|
24
|
-
console.log('\nRunning validation checks...\n');
|
|
25
|
-
|
|
26
|
-
// Type check
|
|
27
|
-
if (checksToRun.includes('typecheck')) {
|
|
28
|
-
const result = runCheck('typecheck', 'npm run typecheck', repo);
|
|
29
|
-
results.push(result);
|
|
30
|
-
printCheckResult(result, 1, checksToRun.length);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Lint
|
|
34
|
-
if (checksToRun.includes('lint')) {
|
|
35
|
-
const result = runCheck('lint', 'npm run lint', repo);
|
|
36
|
-
results.push(result);
|
|
37
|
-
printCheckResult(result, 2, checksToRun.length);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// Test
|
|
41
|
-
if (checksToRun.includes('test')) {
|
|
42
|
-
const result = runCheck('test', 'npm test', repo);
|
|
43
|
-
results.push(result);
|
|
44
|
-
printCheckResult(result, 3, checksToRun.length);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Build (optional)
|
|
48
|
-
if (checksToRun.includes('build')) {
|
|
49
|
-
const result = runCheck('build', 'npm run build', repo);
|
|
50
|
-
results.push(result);
|
|
51
|
-
printCheckResult(result, checksToRun.indexOf('build') + 1, checksToRun.length);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Summary
|
|
55
|
-
const failed = results.filter(r => !r.passed);
|
|
56
|
-
const hasWarnings = results.some(r => r.warnings.length > 0);
|
|
57
|
-
|
|
58
|
-
console.log('\n' + '='.repeat(40));
|
|
59
|
-
|
|
60
|
-
if (failed.length === 0) {
|
|
61
|
-
if (hasWarnings && strict) {
|
|
62
|
-
console.log('Overall: FAIL (strict mode, warnings present)');
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
console.log('Overall: PASS');
|
|
66
|
-
console.log('Ready to commit.');
|
|
67
|
-
return true;
|
|
68
|
-
} else {
|
|
69
|
-
console.log(`Overall: FAIL (${failed.length} check(s) failed)`);
|
|
70
|
-
console.log('\nFailed checks:');
|
|
71
|
-
for (const f of failed) {
|
|
72
|
-
console.log(` - ${f.name}`);
|
|
73
|
-
for (const err of f.errors.slice(0, 5)) {
|
|
74
|
-
console.log(` ${err}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
console.log('\nFix errors and re-run validation.');
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function runCheck(name: string, command: string, cwd: string): CheckResult {
|
|
83
|
-
const result: CheckResult = {
|
|
84
|
-
name,
|
|
85
|
-
passed: false,
|
|
86
|
-
output: '',
|
|
87
|
-
errors: [],
|
|
88
|
-
warnings: [],
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
const output = execSync(command, {
|
|
93
|
-
cwd: path.resolve(cwd),
|
|
94
|
-
encoding: 'utf-8',
|
|
95
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
result.passed = true;
|
|
99
|
-
result.output = output;
|
|
100
|
-
|
|
101
|
-
// Extract warnings from output
|
|
102
|
-
const warningLines = output.split('\n').filter(line =>
|
|
103
|
-
line.toLowerCase().includes('warning') ||
|
|
104
|
-
line.includes('⚠')
|
|
105
|
-
);
|
|
106
|
-
result.warnings = warningLines.slice(0, 10);
|
|
107
|
-
|
|
108
|
-
} catch (error: any) {
|
|
109
|
-
result.passed = false;
|
|
110
|
-
result.output = error.stdout || error.stderr || error.message;
|
|
111
|
-
|
|
112
|
-
// Extract errors from output
|
|
113
|
-
const errorLines = result.output.split('\n').filter(line =>
|
|
114
|
-
line.toLowerCase().includes('error') ||
|
|
115
|
-
line.includes('✖') ||
|
|
116
|
-
line.includes('❌')
|
|
117
|
-
);
|
|
118
|
-
result.errors = errorLines.slice(0, 10);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return result;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function printCheckResult(result: CheckResult, index: number, total: number): void {
|
|
125
|
-
const status = result.passed ? '✅' : '❌';
|
|
126
|
-
console.log(`[${index}/${total}] ${result.name}...`);
|
|
127
|
-
console.log(` ${status} ${result.passed ? 'passed' : 'failed'}`);
|
|
128
|
-
|
|
129
|
-
if (result.errors.length > 0) {
|
|
130
|
-
console.log(' Errors:');
|
|
131
|
-
for (const err of result.errors.slice(0, 3)) {
|
|
132
|
-
console.log(` ${err}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (result.warnings.length > 0 && result.passed) {
|
|
137
|
-
console.log(' Warnings:');
|
|
138
|
-
for (const warn of result.warnings.slice(0, 3)) {
|
|
139
|
-
console.log(` ${warn}`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"declarationMap": true,
|
|
15
|
-
"sourceMap": true
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*"],
|
|
18
|
-
"exclude": ["node_modules", "dist"]
|
|
19
|
-
}
|