create-hq 5.0.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 +4 -0
- package/dist/deps.d.ts.map +1 -0
- package/dist/deps.js +65 -0
- package/dist/deps.js.map +1 -0
- package/dist/git.d.ts +3 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +19 -0
- package/dist/git.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/scaffold.d.ts +8 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +130 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/ui.d.ts +7 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +36 -0
- package/dist/ui.js.map +1 -0
- package/package.json +41 -0
- package/template/.claude/CLAUDE.md +202 -0
- package/template/.claude/commands/checkpoint.md +127 -0
- package/template/.claude/commands/cleanup.md +307 -0
- package/template/.claude/commands/execute-task.md +440 -0
- package/template/.claude/commands/exit-plan.md +41 -0
- package/template/.claude/commands/handoff.md +97 -0
- package/template/.claude/commands/learn.md +218 -0
- package/template/.claude/commands/metrics.md +118 -0
- package/template/.claude/commands/newworker.md +162 -0
- package/template/.claude/commands/nexttask.md +67 -0
- package/template/.claude/commands/prd.md +238 -0
- package/template/.claude/commands/reanchor.md +51 -0
- package/template/.claude/commands/remember.md +126 -0
- package/template/.claude/commands/run-project.md +348 -0
- package/template/.claude/commands/run.md +110 -0
- package/template/.claude/commands/search-reindex.md +62 -0
- package/template/.claude/commands/search.md +100 -0
- package/template/.claude/commands/setup.md +381 -0
- package/template/.claude/scripts/pure-ralph-loop.ps1 +312 -0
- package/template/.claude/scripts/pure-ralph-loop.sh +859 -0
- package/template/CHANGELOG.md +220 -0
- package/template/LICENSE +21 -0
- package/template/MIGRATION.md +259 -0
- package/template/README.md +368 -0
- package/template/data/journal/.gitkeep +0 -0
- package/template/docs/images/ascii-banner-options.md +122 -0
- package/template/docs/images/hq-banner.svg +105 -0
- package/template/knowledge/Ralph/01-overview.md +71 -0
- package/template/knowledge/Ralph/02-core-concepts.md +114 -0
- package/template/knowledge/Ralph/03-how-ralph-works.md +184 -0
- package/template/knowledge/Ralph/04-back-pressure.md +222 -0
- package/template/knowledge/Ralph/05-specifications.md +210 -0
- package/template/knowledge/Ralph/06-agents-md.md +222 -0
- package/template/knowledge/Ralph/07-implementation.md +316 -0
- package/template/knowledge/Ralph/08-economics.md +182 -0
- package/template/knowledge/Ralph/09-resources.md +145 -0
- package/template/knowledge/Ralph/10-claude-code-workflow.md +212 -0
- package/template/knowledge/Ralph/11-team-training-guide.md +383 -0
- package/template/knowledge/Ralph/README.md +40 -0
- package/template/knowledge/ai-security-framework/CONTRIBUTING.md +139 -0
- package/template/knowledge/ai-security-framework/GLOSSARY.md +176 -0
- package/template/knowledge/ai-security-framework/LICENSE +21 -0
- package/template/knowledge/ai-security-framework/QUICK-START.md +172 -0
- package/template/knowledge/ai-security-framework/README.md +232 -0
- package/template/knowledge/ai-security-framework/checklists/browser-security.md +301 -0
- package/template/knowledge/ai-security-framework/checklists/credential-isolation.md +322 -0
- package/template/knowledge/ai-security-framework/checklists/incident-response.md +288 -0
- package/template/knowledge/ai-security-framework/checklists/pre-flight.md +249 -0
- package/template/knowledge/ai-security-framework/checklists/weekly-audit.md +159 -0
- package/template/knowledge/ai-security-framework/configs/audit-logging.md +372 -0
- package/template/knowledge/ai-security-framework/configs/kill-switches.md +354 -0
- package/template/knowledge/ai-security-framework/docs/01-core-principles.md +256 -0
- package/template/knowledge/ai-security-framework/docs/02-threat-landscape.md +326 -0
- package/template/knowledge/ai-security-framework/docs/03-security-posture.md +250 -0
- package/template/knowledge/ai-security-framework/templates/agents-security.md +233 -0
- package/template/knowledge/design-styles/README.md +42 -0
- package/template/knowledge/design-styles/american-industrial.md +136 -0
- package/template/knowledge/design-styles/ethereal-abstract.md +133 -0
- package/template/knowledge/design-styles/liminal-portal.md +111 -0
- 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 +31 -0
- package/template/knowledge/design-styles/swipes/american-industrial/qyqtg7Dq.png +0 -0
- package/template/knowledge/dev-team/README.md +35 -0
- package/template/knowledge/dev-team/patterns/README.md +34 -0
- package/template/knowledge/dev-team/patterns/frontend/react-best-practices.md +178 -0
- package/template/knowledge/dev-team/troubleshooting/README.md +31 -0
- package/template/knowledge/dev-team/workflows/README.md +49 -0
- package/template/knowledge/hq/checkpoint-schema.json +51 -0
- package/template/knowledge/hq/index-md-spec.md +74 -0
- package/template/knowledge/hq/thread-schema.md +153 -0
- package/template/knowledge/hq-core/checkpoint-schema.json +51 -0
- package/template/knowledge/hq-core/index-md-spec.md +74 -0
- package/template/knowledge/hq-core/thread-schema.md +153 -0
- package/template/knowledge/loom/README.md +51 -0
- package/template/knowledge/loom/architecture.md +125 -0
- package/template/knowledge/loom/code-style.md +169 -0
- package/template/knowledge/loom/llm-proxy.md +132 -0
- package/template/knowledge/loom/state-machine.md +131 -0
- package/template/knowledge/loom/thread-system.md +117 -0
- package/template/knowledge/loom/tools.md +94 -0
- package/template/knowledge/loom/weaver.md +96 -0
- package/template/knowledge/loom/web-frontend.md +131 -0
- package/template/knowledge/projects/README.md +72 -0
- package/template/knowledge/projects/templates/README.template.md +28 -0
- package/template/knowledge/workers/README.md +195 -0
- package/template/knowledge/workers/ralph-loop-pattern.md +157 -0
- package/template/knowledge/workers/skill-schema.md +182 -0
- package/template/knowledge/workers/state-machine.md +102 -0
- package/template/knowledge/workers/templates/base-worker.yaml +73 -0
- package/template/knowledge/workers/templates/code-worker.yaml +85 -0
- package/template/knowledge/workers/templates/skill.yaml +49 -0
- package/template/knowledge/workers/templates/social-worker.yaml +70 -0
- package/template/modules/examples/full-manifest.yaml +92 -0
- package/template/modules/examples/minimal.yaml +14 -0
- package/template/modules/modules.yaml +59 -0
- package/template/projects/.gitkeep +0 -0
- package/template/projects/incorporate-workers-into-pure-ralph/prd.json +88 -0
- package/template/projects/pure-ralph-branch-isolation/README.md +114 -0
- package/template/projects/pure-ralph-branch-isolation/prd.json +123 -0
- package/template/projects/purist-ralph-loop/README.md +148 -0
- package/template/projects/purist-ralph-loop/prd.json +135 -0
- package/template/projects/ralph-test/prd.json +50 -0
- package/template/prompts/pure-ralph-base.md +551 -0
- package/template/settings/.gitkeep +0 -0
- package/template/settings/pure-ralph.json +42 -0
- package/template/social-content/drafts/INDEX.md +21 -0
- package/template/social-content/drafts/linkedin/.gitkeep +1 -0
- package/template/social-content/drafts/x/.gitkeep +1 -0
- package/template/social-content/images/.gitkeep +1 -0
- package/template/starter-projects/code-worker/README.md +97 -0
- package/template/starter-projects/code-worker/prd.json +45 -0
- package/template/starter-projects/personal-assistant/README.md +42 -0
- package/template/starter-projects/personal-assistant/prd.json +43 -0
- package/template/starter-projects/social-media/README.md +60 -0
- package/template/starter-projects/social-media/prd.json +43 -0
- package/template/workers/content-brand/README.md +59 -0
- package/template/workers/content-brand/skills/messaging-alignment.md +91 -0
- package/template/workers/content-brand/skills/tone-check.md +76 -0
- package/template/workers/content-brand/skills/voice-analysis.md +68 -0
- package/template/workers/content-brand/worker.yaml +81 -0
- package/template/workers/content-legal/README.md +80 -0
- package/template/workers/content-legal/skills/claim-substantiation.md +150 -0
- package/template/workers/content-legal/skills/compliance-scan.md +123 -0
- package/template/workers/content-legal/skills/disclaimer-check.md +146 -0
- package/template/workers/content-legal/worker.yaml +118 -0
- package/template/workers/content-product/README.md +77 -0
- package/template/workers/content-product/skills/claim-verification.md +96 -0
- package/template/workers/content-product/skills/feature-accuracy.md +117 -0
- package/template/workers/content-product/skills/stats-check.md +128 -0
- package/template/workers/content-product/worker.yaml +97 -0
- package/template/workers/content-sales/README.md +70 -0
- package/template/workers/content-sales/skills/conversion-analysis.md +96 -0
- package/template/workers/content-sales/skills/cta-audit.md +107 -0
- package/template/workers/content-sales/skills/value-prop-check.md +114 -0
- package/template/workers/content-sales/worker.yaml +93 -0
- package/template/workers/content-shared/cli.ts +242 -0
- package/template/workers/content-shared/index.ts +234 -0
- package/template/workers/content-shared/lib/accuracy-analyzer.ts +661 -0
- package/template/workers/content-shared/lib/analyze.ts +370 -0
- package/template/workers/content-shared/lib/brand-analyzer.ts +526 -0
- package/template/workers/content-shared/lib/cms-integration.ts +446 -0
- package/template/workers/content-shared/lib/compliance-analyzer.ts +655 -0
- package/template/workers/content-shared/lib/conversion-analyzer.ts +555 -0
- package/template/workers/content-shared/lib/github-integration.ts +582 -0
- package/template/workers/content-shared/lib/output.ts +373 -0
- package/template/workers/content-shared/lib/parser.ts +771 -0
- package/template/workers/content-shared/lib/priority.ts +439 -0
- package/template/workers/content-shared/lib/recommendations.ts +512 -0
- package/template/workers/content-shared/lib/reporter.ts +749 -0
- package/template/workers/content-shared/lib/restructure.ts +664 -0
- package/template/workers/content-shared/lib/scorer.ts +140 -0
- package/template/workers/content-shared/lib/types.ts +227 -0
- package/template/workers/content-shared/lib/variants.ts +595 -0
- package/template/workers/content-shared/package.json +51 -0
- package/template/workers/content-shared/pnpm-lock.yaml +39 -0
- package/template/workers/content-shared/test/sample-page.json +115 -0
- package/template/workers/content-shared/tsconfig.json +20 -0
- package/template/workers/dev-team/README.md +166 -0
- package/template/workers/dev-team/_template.yaml +70 -0
- package/template/workers/dev-team/architect/package.json +27 -0
- package/template/workers/dev-team/architect/skills/api-design.md +89 -0
- package/template/workers/dev-team/architect/skills/refactor-plan.md +96 -0
- package/template/workers/dev-team/architect/skills/system-design.md +100 -0
- package/template/workers/dev-team/architect/src/index.ts +49 -0
- package/template/workers/dev-team/architect/src/mcp-server.ts +122 -0
- package/template/workers/dev-team/architect/src/skills/api-design.ts +316 -0
- package/template/workers/dev-team/architect/src/skills/refactor-plan.ts +264 -0
- package/template/workers/dev-team/architect/src/skills/system-design.ts +212 -0
- package/template/workers/dev-team/architect/tsconfig.json +19 -0
- package/template/workers/dev-team/architect/worker.yaml +128 -0
- package/template/workers/dev-team/backend-dev/package-lock.json +1252 -0
- package/template/workers/dev-team/backend-dev/package.json +27 -0
- package/template/workers/dev-team/backend-dev/skills/implement-endpoint.md +70 -0
- package/template/workers/dev-team/backend-dev/skills/implement-service.md +62 -0
- package/template/workers/dev-team/backend-dev/src/index.ts +51 -0
- package/template/workers/dev-team/backend-dev/src/mcp-server.ts +109 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-endpoint.ts +122 -0
- package/template/workers/dev-team/backend-dev/src/skills/implement-service.ts +126 -0
- package/template/workers/dev-team/backend-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/backend-dev/worker.yaml +128 -0
- package/template/workers/dev-team/code-reviewer/package-lock.json +1080 -0
- package/template/workers/dev-team/code-reviewer/package.json +24 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-production.md +61 -0
- package/template/workers/dev-team/code-reviewer/skills/merge-to-staging.md +54 -0
- package/template/workers/dev-team/code-reviewer/skills/request-changes.md +63 -0
- package/template/workers/dev-team/code-reviewer/skills/review-pr.md +77 -0
- package/template/workers/dev-team/code-reviewer/src/index.ts +56 -0
- package/template/workers/dev-team/code-reviewer/src/mcp-server.ts +101 -0
- package/template/workers/dev-team/code-reviewer/tsconfig.json +19 -0
- package/template/workers/dev-team/code-reviewer/worker.yaml +90 -0
- package/template/workers/dev-team/database-dev/package.json +22 -0
- package/template/workers/dev-team/database-dev/skills/create-schema.md +48 -0
- package/template/workers/dev-team/database-dev/src/index.ts +50 -0
- package/template/workers/dev-team/database-dev/src/mcp-server.ts +76 -0
- package/template/workers/dev-team/database-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/database-dev/worker.yaml +90 -0
- package/template/workers/dev-team/frontend-dev/package.json +22 -0
- package/template/workers/dev-team/frontend-dev/skills/create-component.md +26 -0
- package/template/workers/dev-team/frontend-dev/src/index.ts +50 -0
- package/template/workers/dev-team/frontend-dev/src/mcp-server.ts +77 -0
- package/template/workers/dev-team/frontend-dev/tsconfig.json +18 -0
- package/template/workers/dev-team/frontend-dev/worker.yaml +132 -0
- package/template/workers/dev-team/infra-dev/package.json +24 -0
- package/template/workers/dev-team/infra-dev/skills/add-monitoring.md +73 -0
- package/template/workers/dev-team/infra-dev/skills/configure-deployment.md +80 -0
- package/template/workers/dev-team/infra-dev/skills/create-dockerfile.md +62 -0
- package/template/workers/dev-team/infra-dev/skills/setup-cicd.md +63 -0
- package/template/workers/dev-team/infra-dev/src/index.ts +55 -0
- package/template/workers/dev-team/infra-dev/src/mcp-server.ts +82 -0
- package/template/workers/dev-team/infra-dev/tsconfig.json +19 -0
- package/template/workers/dev-team/infra-dev/worker.yaml +92 -0
- package/template/workers/dev-team/knowledge-curator/package.json +24 -0
- package/template/workers/dev-team/knowledge-curator/skills/curate-troubleshooting.md +63 -0
- package/template/workers/dev-team/knowledge-curator/skills/process-learnings.md +61 -0
- package/template/workers/dev-team/knowledge-curator/skills/sync-documentation.md +76 -0
- package/template/workers/dev-team/knowledge-curator/skills/update-patterns.md +63 -0
- package/template/workers/dev-team/knowledge-curator/src/index.ts +53 -0
- package/template/workers/dev-team/knowledge-curator/src/mcp-server.ts +92 -0
- package/template/workers/dev-team/knowledge-curator/tsconfig.json +19 -0
- package/template/workers/dev-team/knowledge-curator/worker.yaml +80 -0
- package/template/workers/dev-team/motion-designer/package.json +22 -0
- package/template/workers/dev-team/motion-designer/skills/add-animation.md +25 -0
- package/template/workers/dev-team/motion-designer/skills/generate-image.md +36 -0
- package/template/workers/dev-team/motion-designer/src/index.ts +63 -0
- package/template/workers/dev-team/motion-designer/src/mcp-server.ts +79 -0
- package/template/workers/dev-team/motion-designer/tsconfig.json +18 -0
- package/template/workers/dev-team/motion-designer/worker.yaml +84 -0
- package/template/workers/dev-team/product-planner/queue.json +4 -0
- package/template/workers/dev-team/product-planner/worker.yaml +220 -0
- package/template/workers/dev-team/project-manager/package-lock.json +1252 -0
- package/template/workers/dev-team/project-manager/package.json +27 -0
- package/template/workers/dev-team/project-manager/skills/create-prd.md +66 -0
- package/template/workers/dev-team/project-manager/skills/next-issue.md +51 -0
- package/template/workers/dev-team/project-manager/skills/project-status.md +59 -0
- package/template/workers/dev-team/project-manager/skills/update-learnings.md +65 -0
- package/template/workers/dev-team/project-manager/src/index.ts +54 -0
- package/template/workers/dev-team/project-manager/src/mcp-server.ts +207 -0
- package/template/workers/dev-team/project-manager/src/skills/create-prd.ts +86 -0
- package/template/workers/dev-team/project-manager/src/skills/next-issue.ts +137 -0
- package/template/workers/dev-team/project-manager/src/skills/project-status.ts +131 -0
- package/template/workers/dev-team/project-manager/src/skills/update-learnings.ts +94 -0
- package/template/workers/dev-team/project-manager/tsconfig.json +19 -0
- package/template/workers/dev-team/project-manager/worker.yaml +96 -0
- package/template/workers/dev-team/qa-tester/package.json +24 -0
- package/template/workers/dev-team/qa-tester/skills/create-demo-account.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/run-tests.md +36 -0
- package/template/workers/dev-team/qa-tester/skills/write-test.md +27 -0
- package/template/workers/dev-team/qa-tester/src/index.ts +61 -0
- package/template/workers/dev-team/qa-tester/src/mcp-server.ts +88 -0
- package/template/workers/dev-team/qa-tester/tsconfig.json +18 -0
- package/template/workers/dev-team/qa-tester/worker.yaml +116 -0
- package/template/workers/dev-team/task-executor/package-lock.json +1252 -0
- package/template/workers/dev-team/task-executor/package.json +27 -0
- package/template/workers/dev-team/task-executor/skills/analyze-issue.md +101 -0
- package/template/workers/dev-team/task-executor/skills/execute.md +133 -0
- package/template/workers/dev-team/task-executor/skills/report-learnings.md +106 -0
- package/template/workers/dev-team/task-executor/skills/validate-completion.md +121 -0
- package/template/workers/dev-team/task-executor/src/index.ts +54 -0
- package/template/workers/dev-team/task-executor/src/mcp-server.ts +139 -0
- package/template/workers/dev-team/task-executor/src/skills/analyze-issue.ts +219 -0
- package/template/workers/dev-team/task-executor/src/skills/execute.ts +132 -0
- package/template/workers/dev-team/task-executor/src/skills/report-learnings.ts +119 -0
- package/template/workers/dev-team/task-executor/src/skills/validate-completion.ts +142 -0
- package/template/workers/dev-team/task-executor/tsconfig.json +19 -0
- package/template/workers/dev-team/task-executor/worker.yaml +110 -0
- package/template/workers/registry.yaml +171 -0
- package/template/workers/security-scanner/README.md +73 -0
- package/template/workers/security-scanner/skills/pre-deploy-check.md +205 -0
- package/template/workers/security-scanner/worker.yaml +26 -0
- 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 +3 -0
- package/template/workspace/orchestrator/.gitkeep +0 -0
- package/template/workspace/ralph-test/COMPLETE.md +18 -0
- package/template/workspace/ralph-test/hello.txt +2 -0
- package/template/workspace/reports/.gitkeep +0 -0
- package/template/workspace/scratch/.gitkeep +0 -0
- package/template/workspace/threads/.gitkeep +3 -0
package/dist/deps.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.d.ts","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAqDA,wBAAgB,SAAS,IAAI;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAoBpD"}
|
package/dist/deps.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { success, warn, info } from "./ui.js";
|
|
3
|
+
const deps = [
|
|
4
|
+
{
|
|
5
|
+
name: "Node.js",
|
|
6
|
+
command: "node --version",
|
|
7
|
+
required: true,
|
|
8
|
+
installHint: "https://nodejs.org",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: "Claude Code CLI",
|
|
12
|
+
command: "claude --version",
|
|
13
|
+
required: true,
|
|
14
|
+
installHint: "npm install -g @anthropic-ai/claude-code",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "qmd (search)",
|
|
18
|
+
command: "qmd --version",
|
|
19
|
+
required: true,
|
|
20
|
+
installHint: "brew install tobi/tap/qmd",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "gh CLI",
|
|
24
|
+
command: "gh --version",
|
|
25
|
+
required: false,
|
|
26
|
+
installHint: "brew install gh",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "Vercel CLI",
|
|
30
|
+
command: "vercel --version",
|
|
31
|
+
required: false,
|
|
32
|
+
installHint: "npm install -g vercel",
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
function checkCommand(command) {
|
|
36
|
+
try {
|
|
37
|
+
const output = execSync(command, { stdio: "pipe", encoding: "utf-8" });
|
|
38
|
+
const version = output.trim().split("\n")[0];
|
|
39
|
+
return version;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export function checkDeps() {
|
|
46
|
+
console.log();
|
|
47
|
+
console.log(" Checking dependencies...");
|
|
48
|
+
let allRequired = true;
|
|
49
|
+
for (const dep of deps) {
|
|
50
|
+
const version = checkCommand(dep.command);
|
|
51
|
+
if (version) {
|
|
52
|
+
success(`${dep.name} ${version}`);
|
|
53
|
+
}
|
|
54
|
+
else if (dep.required) {
|
|
55
|
+
warn(`${dep.name} not found`);
|
|
56
|
+
info(`Install: ${dep.installHint}`);
|
|
57
|
+
allRequired = false;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
info(`${dep.name} (optional) — ${dep.installHint}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { allRequired };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=deps.js.map
|
package/dist/deps.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAS9C,MAAM,IAAI,GAAU;IAClB;QACE,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,oBAAoB;KAClC;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,0CAA0C;KACxD;IACD;QACE,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,2BAA2B;KACzC;IACD;QACE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,iBAAiB;KAC/B;IACD;QACE,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,uBAAuB;KACrC;CACF,CAAC;AAEF,SAAS,YAAY,CAAC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,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAOzC;AAED,wBAAgB,MAAM,IAAI,OAAO,CAOhC"}
|
package/dist/git.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
export function initGit(dir) {
|
|
3
|
+
execSync("git init", { cwd: dir, stdio: "pipe" });
|
|
4
|
+
execSync("git add -A", { cwd: dir, stdio: "pipe" });
|
|
5
|
+
execSync('git commit -m "Initial HQ setup via create-hq"', {
|
|
6
|
+
cwd: dir,
|
|
7
|
+
stdio: "pipe",
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
export function hasGit() {
|
|
11
|
+
try {
|
|
12
|
+
execSync("git --version", { stdio: "pipe" });
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=git.js.map
|
package/dist/git.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IACpD,QAAQ,CAAC,gDAAgD,EAAE;QACzD,GAAG,EAAE,GAAG;QACR,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,MAAM;IACpB,IAAI,CAAC;QACH,QAAQ,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { scaffold } from "./scaffold.js";
|
|
4
|
+
const program = new Command();
|
|
5
|
+
program
|
|
6
|
+
.name("create-hq")
|
|
7
|
+
.description("Create a new HQ — Personal OS for AI Workers")
|
|
8
|
+
.version("5.0.0")
|
|
9
|
+
.argument("[directory]", "where to create HQ", "hq")
|
|
10
|
+
.option("--skip-deps", "skip dependency checks")
|
|
11
|
+
.option("--skip-cli", "don't install @indigoai/hq-cli globally")
|
|
12
|
+
.option("--skip-sync", "don't prompt for cloud sync setup")
|
|
13
|
+
.action(async (directory, options) => {
|
|
14
|
+
try {
|
|
15
|
+
await scaffold(directory, options);
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
console.error(err instanceof Error ? err.message : "An unexpected error occurred");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
program.parse();
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,WAAW,CAAC;KACjB,WAAW,CAAC,8CAA8C,CAAC;KAC3D,OAAO,CAAC,OAAO,CAAC;KAChB,QAAQ,CAAC,aAAa,EAAE,oBAAoB,EAAE,IAAI,CAAC;KACnD,MAAM,CAAC,aAAa,EAAE,wBAAwB,CAAC;KAC/C,MAAM,CAAC,YAAY,EAAE,yCAAyC,CAAC;KAC/D,MAAM,CAAC,aAAa,EAAE,mCAAmC,CAAC;KAC1D,MAAM,CAAC,KAAK,EAAE,SAAiB,EAAE,OAAO,EAAE,EAAE;IAC3C,IAAI,CAAC;QACH,MAAM,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CACX,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,8BAA8B,CACpE,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAYA,UAAU,eAAe;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAyCD,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAoGf"}
|
package/dist/scaffold.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { createInterface } from "readline";
|
|
4
|
+
import { banner, success, warn, step, nextSteps } from "./ui.js";
|
|
5
|
+
import { checkDeps } from "./deps.js";
|
|
6
|
+
import { initGit, hasGit } from "./git.js";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
import { execSync } from "child_process";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
async function prompt(question, defaultVal) {
|
|
12
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
13
|
+
const suffix = defaultVal ? ` (${defaultVal})` : "";
|
|
14
|
+
return new Promise((resolve) => {
|
|
15
|
+
rl.question(` ? ${question}${suffix} `, (answer) => {
|
|
16
|
+
rl.close();
|
|
17
|
+
resolve(answer.trim() || defaultVal || "");
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
async function confirm(question, defaultYes = true) {
|
|
22
|
+
const hint = defaultYes ? "Y/n" : "y/N";
|
|
23
|
+
const answer = await prompt(`${question} (${hint})`);
|
|
24
|
+
if (!answer)
|
|
25
|
+
return defaultYes;
|
|
26
|
+
return answer.toLowerCase().startsWith("y");
|
|
27
|
+
}
|
|
28
|
+
function getTemplateDir() {
|
|
29
|
+
// When installed from npm: dist/scaffold.js -> ../template
|
|
30
|
+
// In monorepo dev from dist: packages/create-hq/dist/scaffold.js -> ../../template
|
|
31
|
+
// In monorepo dev from src: packages/create-hq/src/scaffold.ts -> ../../template
|
|
32
|
+
const candidates = [
|
|
33
|
+
path.resolve(__dirname, "..", "template"), // npm installed (dist/../template)
|
|
34
|
+
path.resolve(__dirname, "..", "..", "template"), // monorepo (packages/create-hq/template or ../../template)
|
|
35
|
+
path.resolve(__dirname, "..", "..", "..", "template"), // monorepo from dist (../../template)
|
|
36
|
+
];
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
if (fs.existsSync(candidate) && fs.existsSync(path.join(candidate, ".claude"))) {
|
|
39
|
+
return candidate;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
throw new Error("Could not find HQ template directory. This is a packaging error — please report at https://github.com/indigoai-us/hq/issues");
|
|
43
|
+
}
|
|
44
|
+
export async function scaffold(directory, options) {
|
|
45
|
+
banner();
|
|
46
|
+
// 1. Resolve target directory
|
|
47
|
+
const targetDir = path.resolve(directory);
|
|
48
|
+
const displayDir = directory.startsWith("/")
|
|
49
|
+
? directory
|
|
50
|
+
: path.relative(process.cwd(), targetDir) || ".";
|
|
51
|
+
// Check if directory already exists
|
|
52
|
+
if (fs.existsSync(targetDir)) {
|
|
53
|
+
const contents = fs.readdirSync(targetDir);
|
|
54
|
+
if (contents.length > 0) {
|
|
55
|
+
const proceed = await confirm(`Directory ${displayDir} already exists and is not empty. Continue anyway?`, false);
|
|
56
|
+
if (!proceed) {
|
|
57
|
+
console.log(" Aborted.");
|
|
58
|
+
process.exit(0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// 2. Copy template
|
|
63
|
+
step("Creating HQ...");
|
|
64
|
+
const templateDir = getTemplateDir();
|
|
65
|
+
await fs.copy(templateDir, targetDir, {
|
|
66
|
+
filter: (src) => {
|
|
67
|
+
const rel = path.relative(templateDir, src);
|
|
68
|
+
// Skip git internals and node_modules
|
|
69
|
+
if (rel.includes(".git/") || rel.includes("node_modules/"))
|
|
70
|
+
return false;
|
|
71
|
+
return true;
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// Count what we copied
|
|
75
|
+
const commandCount = fs.existsSync(path.join(targetDir, ".claude", "commands"))
|
|
76
|
+
? fs.readdirSync(path.join(targetDir, ".claude", "commands")).filter((f) => f.endsWith(".md")).length
|
|
77
|
+
: 0;
|
|
78
|
+
const workerCount = fs.existsSync(path.join(targetDir, "workers"))
|
|
79
|
+
? fs.readdirSync(path.join(targetDir, "workers"), { recursive: true })
|
|
80
|
+
.filter((f) => String(f).endsWith("worker.yaml")).length
|
|
81
|
+
: 0;
|
|
82
|
+
success(`Copied template (${commandCount} commands, ${workerCount} workers)`);
|
|
83
|
+
// 3. Git init
|
|
84
|
+
if (hasGit()) {
|
|
85
|
+
initGit(targetDir);
|
|
86
|
+
success("Initialized git repository");
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
warn("git not found — skipping git init");
|
|
90
|
+
}
|
|
91
|
+
// 4. Check dependencies
|
|
92
|
+
if (!options.skipDeps) {
|
|
93
|
+
checkDeps();
|
|
94
|
+
}
|
|
95
|
+
// 5. Install hq-cli
|
|
96
|
+
if (!options.skipCli) {
|
|
97
|
+
console.log();
|
|
98
|
+
const installCli = await confirm("Install @indigoai/hq-cli globally for module management?");
|
|
99
|
+
if (installCli) {
|
|
100
|
+
try {
|
|
101
|
+
step("Installing @indigoai/hq-cli...");
|
|
102
|
+
execSync("npm install -g @indigoai/hq-cli", { stdio: "pipe" });
|
|
103
|
+
success("Installed @indigoai/hq-cli");
|
|
104
|
+
}
|
|
105
|
+
catch {
|
|
106
|
+
warn("Failed to install @indigoai/hq-cli — you can install it later with: npm install -g @indigoai/hq-cli");
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// 6. Cloud sync setup
|
|
111
|
+
if (!options.skipSync) {
|
|
112
|
+
console.log();
|
|
113
|
+
const setupSync = await confirm("Set up cloud sync? (enables mobile access via hq.indigoai.com)");
|
|
114
|
+
if (setupSync) {
|
|
115
|
+
step("Cloud sync setup will be available after running /setup in Claude Code");
|
|
116
|
+
step("Run: hq sync init");
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// 7. Index with qmd
|
|
120
|
+
try {
|
|
121
|
+
execSync("qmd index .", { cwd: targetDir, stdio: "pipe" });
|
|
122
|
+
success("Indexed HQ for search");
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// qmd not installed, skip silently — already warned in deps check
|
|
126
|
+
}
|
|
127
|
+
// 8. Next steps
|
|
128
|
+
nextSteps(displayDir);
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,C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AC;YACxC,CAAC;YAAC,MAAM,CAAC;gBACP,IAAI,CAAC,qGAAqG,CAAC,CAAC;YAC9G,CAAC;QACH,CAAC;IACH,CAAC;IAED,sBAAsB;IACtB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,MAAM,SAAS,GAAG,MAAM,OAAO,CAC7B,gEAAgE,CACjE,CAAC;QACF,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,wEAAwE,CAAC,CAAC;YAC/E,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,oBAAoB;IACpB,IAAI,CAAC;QACH,QAAQ,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,kEAAkE;IACpE,CAAC;IAED,gBAAgB;IAChB,SAAS,CAAC,UAAU,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function banner(): void;
|
|
2
|
+
export declare function success(msg: string): void;
|
|
3
|
+
export declare function warn(msg: string): void;
|
|
4
|
+
export declare function info(msg: string): void;
|
|
5
|
+
export declare function step(msg: string): void;
|
|
6
|
+
export declare function nextSteps(dir: string): void;
|
|
7
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,IAAI,IAAI,CAa7B;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEzC;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAW3C"}
|
package/dist/ui.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
export function banner() {
|
|
3
|
+
console.log();
|
|
4
|
+
console.log(chalk.bold.white(" ██ ██ ██████ "));
|
|
5
|
+
console.log(chalk.bold.white(" ██ ██ ██ ██ "));
|
|
6
|
+
console.log(chalk.bold.white(" ███████ ██ ██ "));
|
|
7
|
+
console.log(chalk.bold.white(" ██ ██ ██ ▄▄ ██ "));
|
|
8
|
+
console.log(chalk.bold.white(" ██ ██ ██████ "));
|
|
9
|
+
console.log(chalk.dim(" ▀▀ "));
|
|
10
|
+
console.log();
|
|
11
|
+
console.log(chalk.dim(" Personal OS for AI Workers") + chalk.dim(" v5.0.0"));
|
|
12
|
+
console.log();
|
|
13
|
+
}
|
|
14
|
+
export function success(msg) {
|
|
15
|
+
console.log(chalk.green(" ✓") + " " + msg);
|
|
16
|
+
}
|
|
17
|
+
export function warn(msg) {
|
|
18
|
+
console.log(chalk.yellow(" ✗") + " " + msg);
|
|
19
|
+
}
|
|
20
|
+
export function info(msg) {
|
|
21
|
+
console.log(chalk.dim(" ~") + " " + msg);
|
|
22
|
+
}
|
|
23
|
+
export function step(msg) {
|
|
24
|
+
console.log(chalk.cyan(" →") + " " + msg);
|
|
25
|
+
}
|
|
26
|
+
export function nextSteps(dir) {
|
|
27
|
+
console.log();
|
|
28
|
+
console.log(chalk.bold(" All done! Next steps:"));
|
|
29
|
+
console.log();
|
|
30
|
+
console.log(chalk.white(` cd ${dir}`));
|
|
31
|
+
console.log(chalk.white(" claude"));
|
|
32
|
+
console.log(chalk.white(" /setup") +
|
|
33
|
+
chalk.dim(" ← interactive wizard to personalize your HQ"));
|
|
34
|
+
console.log();
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,MAAM;IACpB,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAC9C,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CAAC,8BAA8B,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAClE,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,GAAW;IAC9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,EAAE,CAAC;IACd,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;IAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC;QACvB,KAAK,CAAC,GAAG,CAAC,uDAAuD,CAAC,CACrE,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,CAAC;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-hq",
|
|
3
|
+
"version": "5.0.0",
|
|
4
|
+
"description": "Create a new HQ — Personal OS for AI Workers",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-hq": "./dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"template"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"clean": "node -e \"const fs=require('fs-extra');fs.removeSync('dist');fs.removeSync('template')\"",
|
|
16
|
+
"prepack": "npm run build && node -e \"require('fs-extra').copySync('../../template','./template')\"",
|
|
17
|
+
"postpack": "node -e \"require('fs-extra').removeSync('template')\""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"chalk": "^5.3.0",
|
|
21
|
+
"commander": "^12.1.0",
|
|
22
|
+
"fs-extra": "^11.2.0",
|
|
23
|
+
"ora": "^8.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/fs-extra": "^11.0.4",
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"typescript": "^5.7.0"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/indigoai-us/hq.git",
|
|
36
|
+
"directory": "packages/create-hq"
|
|
37
|
+
},
|
|
38
|
+
"keywords": ["hq", "ai", "workers", "claude", "personal-os"],
|
|
39
|
+
"license": "MIT",
|
|
40
|
+
"type": "module"
|
|
41
|
+
}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# HQ - Personal OS for AI Workers
|
|
2
|
+
|
|
3
|
+
Personal OS for orchestrating work across companies, workers, and AI.
|
|
4
|
+
|
|
5
|
+
## Key Files
|
|
6
|
+
|
|
7
|
+
- `INDEX.md` - Root directory map, recent threads, workers (start here)
|
|
8
|
+
- `USER-GUIDE.md` - Commands, workers, typical session
|
|
9
|
+
- `agents.md` - Your profile, preferences, companies (load for writing/communication tasks)
|
|
10
|
+
- `workers/registry.yaml` - Worker index
|
|
11
|
+
|
|
12
|
+
## INDEX.md System
|
|
13
|
+
|
|
14
|
+
Hierarchical INDEX.md files provide a navigable map of HQ. Read parent INDEX before diving into subdirectories.
|
|
15
|
+
|
|
16
|
+
**Key indexes:** `projects/INDEX.md`, `workspace/orchestrator/INDEX.md`, `companies/*/knowledge/INDEX.md`, `workers/*/INDEX.md`, `knowledge/INDEX.md`, `workspace/reports/INDEX.md`
|
|
17
|
+
|
|
18
|
+
**Spec:** `knowledge/hq-core/index-md-spec.md`
|
|
19
|
+
**Rebuild all:** `/cleanup --reindex`
|
|
20
|
+
**Auto-updated by:** `/checkpoint`, `/handoff`, `/reanchor`, `/prd`, `/run-project`, `/newworker`, content commands
|
|
21
|
+
|
|
22
|
+
## Structure
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
HQ/
|
|
26
|
+
├── .claude/commands/ # Slash commands (17, visibility: public|private in frontmatter)
|
|
27
|
+
├── agents.md # Your profile
|
|
28
|
+
├── companies/ # Company-scoped resources (optional)
|
|
29
|
+
│ └── {company}/ # settings/, data/, knowledge/
|
|
30
|
+
├── knowledge/ # HQ-level (Ralph, workers, security, projects)
|
|
31
|
+
├── projects/ # Project PRDs
|
|
32
|
+
├── workers/ # Worker definitions
|
|
33
|
+
│ ├── dev-team/ # 12 code workers
|
|
34
|
+
│ └── content-*/ # 5 content workers
|
|
35
|
+
├── social-content/ # Content drafts
|
|
36
|
+
│ └── drafts/ # x/, linkedin/
|
|
37
|
+
└── workspace/
|
|
38
|
+
├── checkpoints/ # Manual saves
|
|
39
|
+
├── threads/ # Auto-saved sessions
|
|
40
|
+
├── orchestrator/ # Project state
|
|
41
|
+
├── learnings/ # Task insights (event log)
|
|
42
|
+
└── content-ideas/ # Idea capture
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Workers
|
|
46
|
+
|
|
47
|
+
Workers are autonomous agents with defined skills. They *do things*.
|
|
48
|
+
|
|
49
|
+
| Type | Purpose | Examples |
|
|
50
|
+
|------|---------|----------|
|
|
51
|
+
| CodeWorker | Implement features, fix bugs | dev-team/* |
|
|
52
|
+
| ContentWorker | Draft content, maintain voice | content-brand, content-sales |
|
|
53
|
+
| SocialWorker | Post to platforms | x-worker |
|
|
54
|
+
| ResearchWorker | Analysis, market research | analyst |
|
|
55
|
+
| OpsWorker | Reports, automation | cfo-worker |
|
|
56
|
+
|
|
57
|
+
**Run a worker:** `/run {worker} {skill}`
|
|
58
|
+
|
|
59
|
+
**Build a worker:** `/newworker`
|
|
60
|
+
|
|
61
|
+
## Commands
|
|
62
|
+
|
|
63
|
+
### Session Management
|
|
64
|
+
| Command | Purpose |
|
|
65
|
+
|---------|---------|
|
|
66
|
+
| `/checkpoint` | Save state + context status |
|
|
67
|
+
| `/handoff` | Prepare for fresh session |
|
|
68
|
+
| `/reanchor` | Pause and realign |
|
|
69
|
+
| `/nexttask` | Find next thing to work on |
|
|
70
|
+
| `/remember` | Capture learnings as rules in relevant files |
|
|
71
|
+
| `/learn` | Auto-capture and classify learnings from task execution |
|
|
72
|
+
|
|
73
|
+
### Projects
|
|
74
|
+
| Command | Purpose |
|
|
75
|
+
|---------|---------|
|
|
76
|
+
| `/prd` | Generate PRD through discovery |
|
|
77
|
+
| `/run-project` | Execute project via Ralph loop |
|
|
78
|
+
| `/execute-task` | Run single task with workers |
|
|
79
|
+
|
|
80
|
+
### Workers
|
|
81
|
+
| Command | Purpose |
|
|
82
|
+
|---------|---------|
|
|
83
|
+
| `/run` | List/execute workers |
|
|
84
|
+
| `/newworker` | Create new worker |
|
|
85
|
+
| `/metrics` | View execution metrics |
|
|
86
|
+
|
|
87
|
+
### System
|
|
88
|
+
| Command | Purpose |
|
|
89
|
+
|---------|---------|
|
|
90
|
+
| `/search` | Semantic + full-text search across HQ (qmd-powered) |
|
|
91
|
+
| `/search-reindex` | Reindex and re-embed HQ for qmd search |
|
|
92
|
+
| `/cleanup` | Audit and clean HQ |
|
|
93
|
+
| `/setup` | Interactive setup wizard |
|
|
94
|
+
| `/exit-plan` | Force exit from plan mode |
|
|
95
|
+
|
|
96
|
+
## Knowledge Repos
|
|
97
|
+
|
|
98
|
+
Knowledge folders can be their own git repos, symlinked into HQ. This enables independent versioning, sharing, and publishing per knowledge base.
|
|
99
|
+
|
|
100
|
+
**Convention:** Repos live in `repos/public/` or `repos/private/`. Symlinks in `knowledge/` and `companies/*/knowledge` point to them. The symlinks are tracked by HQ git; the repo contents are gitignored.
|
|
101
|
+
|
|
102
|
+
**Reading/searching:** Transparent. `qmd`, `Glob`, `Grep`, `Read` all follow symlinks.
|
|
103
|
+
|
|
104
|
+
**Committing knowledge changes:** Changes show in `git status` of the *target repo* (not HQ). To commit:
|
|
105
|
+
1. `cd` to the symlink target (e.g. `repos/public/knowledge-ralph/`)
|
|
106
|
+
2. `git add`, `git commit`, `git push` in that repo
|
|
107
|
+
|
|
108
|
+
**Adding new knowledge:** Create repo in `repos/{public|private}/knowledge-{name}`, symlink into the appropriate knowledge path.
|
|
109
|
+
|
|
110
|
+
## Search (qmd)
|
|
111
|
+
|
|
112
|
+
HQ can be indexed with [qmd](https://github.com/tobi/qmd) for local semantic + full-text search.
|
|
113
|
+
|
|
114
|
+
**When to search:** Before any planning, research, or context-gathering task, search HQ first with `qmd` to find relevant knowledge, workers, skills, and prior work.
|
|
115
|
+
|
|
116
|
+
**Commands (run via Bash tool):**
|
|
117
|
+
- `qmd search "<query>" --json -n 10` — BM25 keyword search (fast, default)
|
|
118
|
+
- `qmd vsearch "<query>" --json -n 10` — semantic/conceptual search
|
|
119
|
+
- `qmd query "<query>" --json -n 10` — hybrid BM25 + vector + re-ranking (best quality, slower)
|
|
120
|
+
|
|
121
|
+
**Slash commands:** `/search <query>`, `/search-reindex`
|
|
122
|
+
|
|
123
|
+
### Search rules (all commands/skills must follow)
|
|
124
|
+
|
|
125
|
+
| Need | Tool | Example |
|
|
126
|
+
|------|------|---------|
|
|
127
|
+
| Find HQ content by topic | `qmd search` or `qmd vsearch` | "Find knowledge about API integration" |
|
|
128
|
+
| Find files by path pattern | `Glob` | `workers/*/worker.yaml`, `projects/*/prd.json` |
|
|
129
|
+
| Search code in `repos/` | `Grep` | Pattern matching in source code |
|
|
130
|
+
| Validate structured files | `grep` in Bash | Checking YAML fields, git branch filtering |
|
|
131
|
+
|
|
132
|
+
**Never use Grep/Glob to search HQ content by topic.** That's what qmd does. Commands and skills that scan HQ for related context must use `qmd vsearch` (semantic) or `qmd search` (keyword), not Grep.
|
|
133
|
+
|
|
134
|
+
## Learned Rules
|
|
135
|
+
|
|
136
|
+
<!-- Max 20. Overflow removed (rule still lives in its source file). -->
|
|
137
|
+
<!-- Auto-managed by /learn. Manual: /remember -->
|
|
138
|
+
|
|
139
|
+
(none yet — rules accumulate as the system runs)
|
|
140
|
+
|
|
141
|
+
## Learning System
|
|
142
|
+
|
|
143
|
+
Learnings are rules injected directly into the files they govern:
|
|
144
|
+
- Worker rules → `worker.yaml` `instructions:` block
|
|
145
|
+
- Command rules → command `.md` `## Rules` section
|
|
146
|
+
- Knowledge rules → relevant knowledge file
|
|
147
|
+
- Global rules → this file `## Learned Rules`
|
|
148
|
+
|
|
149
|
+
- `/learn` captures and classifies learnings automatically after task execution
|
|
150
|
+
- `/remember` delegates to `/learn` — user corrections always promote to Tier 1
|
|
151
|
+
|
|
152
|
+
Event log: `workspace/learnings/*.json` (append-only, for analysis/dedup).
|
|
153
|
+
|
|
154
|
+
## Auto-Learn (Build Activities)
|
|
155
|
+
|
|
156
|
+
When building HQ infrastructure (new workers, knowledge bases, commands, projects), auto-capture structural changes so future sessions know what exists:
|
|
157
|
+
|
|
158
|
+
**Triggers:**
|
|
159
|
+
- `/newworker` completes → `/learn` with scope: global, rule: "Worker {id} exists at {path} for {purpose}"
|
|
160
|
+
- `/prd` completes → `/learn` with scope: global, rule: "Project {name} exists with {N} stories targeting {repo}"
|
|
161
|
+
- New knowledge files created → `/learn` with scope: global, rule: "Knowledge {topic} available at {path}"
|
|
162
|
+
- New command created → `/learn` with scope: global, rule: "Command /{name} available for {purpose}"
|
|
163
|
+
|
|
164
|
+
**Why:** Fresh sessions load CLAUDE.md but don't scan every directory. Learned rules act as an index of what has been built, preventing re-creation of existing resources and enabling discovery.
|
|
165
|
+
|
|
166
|
+
**Also:** After any structural change, run `qmd update 2>/dev/null || true` to keep search current.
|
|
167
|
+
|
|
168
|
+
## Auto-Checkpoint (PostToolsHook)
|
|
169
|
+
|
|
170
|
+
After completing any of these actions, automatically save thread state to `workspace/threads/`:
|
|
171
|
+
|
|
172
|
+
**Triggers:**
|
|
173
|
+
- Worker skill completion (via `/run`)
|
|
174
|
+
- Git commit
|
|
175
|
+
- File generation (reports, social drafts)
|
|
176
|
+
- Significant file edits in project repos
|
|
177
|
+
|
|
178
|
+
**Thread Format:** See `knowledge/hq-core/thread-schema.md`
|
|
179
|
+
|
|
180
|
+
**Why:** Prevents lost work, enables session resumption, provides audit trail.
|
|
181
|
+
|
|
182
|
+
**How:** After a triggering action, capture git state + summary and write to `workspace/threads/T-{timestamp}-{slug}.json`
|
|
183
|
+
|
|
184
|
+
**Knowledge repos:** When edits touch knowledge files (symlinked to `repos/`), commit those changes to the knowledge repo — not HQ git. See "Knowledge Repos" section above for commit instructions.
|
|
185
|
+
|
|
186
|
+
## Auto-Handoff (Context Limit)
|
|
187
|
+
|
|
188
|
+
When context usage reaches 70% (remaining drops to 30%), automatically run `/handoff`.
|
|
189
|
+
|
|
190
|
+
**Rules:**
|
|
191
|
+
- Check context status line — when `remaining_percentage` ≤ 30, trigger handoff
|
|
192
|
+
- Before handoff, finish current atomic task (don't interrupt mid-edit)
|
|
193
|
+
- Notify user: "Context at {X}% remaining. Running /handoff to preserve continuity."
|
|
194
|
+
- Run `/handoff` with summary of remaining work
|
|
195
|
+
- This overrides manual handoff — don't wait for user to request it
|
|
196
|
+
|
|
197
|
+
## Core Principles
|
|
198
|
+
|
|
199
|
+
1. **Infrastructure scales, effort doesn't** - Build reusable systems
|
|
200
|
+
2. **Workers should grow smarter** - Capture learnings in knowledge bases
|
|
201
|
+
3. **Context is precious** - Checkpoint often, don't let work evaporate
|
|
202
|
+
4. **Ship, then iterate** - Working > perfect
|