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
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Save checkpoint and check context status
|
|
3
|
+
allowed-tools: Write, Bash, Read
|
|
4
|
+
argument-hint: [task-id]
|
|
5
|
+
visibility: public
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /checkpoint - Save Progress
|
|
9
|
+
|
|
10
|
+
Save current work state as a thread to survive context loss.
|
|
11
|
+
|
|
12
|
+
**Task ID (optional):** $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
## Process
|
|
15
|
+
|
|
16
|
+
1. **Generate thread ID** if not provided
|
|
17
|
+
- Format: `T-{YYYYMMDD}-{HHMMSS}-{slug}`
|
|
18
|
+
- Derive slug from recent work (e.g., `mrr-report`, `email-fix`)
|
|
19
|
+
|
|
20
|
+
2. **Capture git state**
|
|
21
|
+
```bash
|
|
22
|
+
git rev-parse --abbrev-ref HEAD # branch
|
|
23
|
+
git remote get-url origin 2>/dev/null # remote
|
|
24
|
+
git rev-parse --short HEAD # current commit
|
|
25
|
+
git log --oneline -5 # recent commits
|
|
26
|
+
git diff --name-only HEAD~3 # recently touched files
|
|
27
|
+
git status --porcelain # dirty check
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
3. **Capture knowledge repo git states**
|
|
31
|
+
Knowledge folders are separate git repos (symlinked). For any knowledge path in files_touched, capture its repo state:
|
|
32
|
+
```bash
|
|
33
|
+
# For each knowledge repo with changes:
|
|
34
|
+
for symlink in knowledge/public/* knowledge/private/* companies/*/knowledge; do
|
|
35
|
+
[ -L "$symlink" ] || continue
|
|
36
|
+
repo_dir=$(cd "$symlink" && git rev-parse --show-toplevel 2>/dev/null) || continue
|
|
37
|
+
dirty=$(cd "$repo_dir" && git status --porcelain)
|
|
38
|
+
[ -z "$dirty" ] && continue
|
|
39
|
+
echo "$symlink: $(cd "$repo_dir" && git rev-parse --short HEAD) (dirty)"
|
|
40
|
+
done
|
|
41
|
+
```
|
|
42
|
+
Include dirty knowledge repos in the thread JSON under `git.knowledge_repos`.
|
|
43
|
+
|
|
44
|
+
4. **Gather session state**
|
|
45
|
+
- Summarize what was accomplished
|
|
46
|
+
- List files touched
|
|
47
|
+
- Identify next steps
|
|
48
|
+
|
|
49
|
+
5. **Write thread** to `workspace/threads/{thread_id}.json` (include knowledge_repos from step 3):
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"thread_id": "T-20260123-143052-mrr-report",
|
|
53
|
+
"version": 1,
|
|
54
|
+
"created_at": "ISO8601",
|
|
55
|
+
"updated_at": "ISO8601",
|
|
56
|
+
|
|
57
|
+
"workspace_root": "~/Documents/HQ",
|
|
58
|
+
"cwd": "current/working/dir",
|
|
59
|
+
|
|
60
|
+
"git": {
|
|
61
|
+
"branch": "main",
|
|
62
|
+
"remote_url": "git@github.com:...",
|
|
63
|
+
"initial_commit": "abc1234",
|
|
64
|
+
"current_commit": "def5678",
|
|
65
|
+
"commits_made": ["hash: message"],
|
|
66
|
+
"dirty": false,
|
|
67
|
+
"knowledge_repos": {
|
|
68
|
+
"knowledge-acme": {"commit": "abc1234", "dirty": true},
|
|
69
|
+
"knowledge-ralph": {"commit": "def5678", "dirty": false}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
"worker": {
|
|
74
|
+
"id": "worker-id or null",
|
|
75
|
+
"skill": "skill-name or null",
|
|
76
|
+
"state": "completed"
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
"conversation_summary": "1-2 sentence summary",
|
|
80
|
+
"files_touched": ["relative/paths"],
|
|
81
|
+
"next_steps": ["remaining tasks"],
|
|
82
|
+
|
|
83
|
+
"metadata": {
|
|
84
|
+
"title": "Human-readable title",
|
|
85
|
+
"tags": ["searchable", "tags"]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
6. **Also write legacy checkpoint** to `workspace/checkpoints/{task-id}.json` for backward compat
|
|
91
|
+
|
|
92
|
+
7. **Update INDEX.md files**
|
|
93
|
+
- Regenerate `INDEX.md` at HQ root with current:
|
|
94
|
+
- Workers from `workers/registry.yaml`
|
|
95
|
+
- Recent threads from `workspace/threads/`
|
|
96
|
+
- Update timestamp
|
|
97
|
+
- Regenerate `workspace/threads/INDEX.md` (all threads, full table)
|
|
98
|
+
- Check files_touched for any `companies/*/knowledge/` paths — if found, regenerate that company's `knowledge/INDEX.md`
|
|
99
|
+
- See `knowledge/public/hq-core/index-md-spec.md` for INDEX format
|
|
100
|
+
|
|
101
|
+
8. **Report**
|
|
102
|
+
```
|
|
103
|
+
Thread saved: workspace/threads/{thread_id}.json
|
|
104
|
+
|
|
105
|
+
Summary: {summary}
|
|
106
|
+
Git: {branch} @ {commit} ({dirty ? "dirty" : "clean"})
|
|
107
|
+
Files: {count} files touched
|
|
108
|
+
Next: {next_steps or "Work complete"}
|
|
109
|
+
|
|
110
|
+
To hand off to fresh session: /handoff
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Thread vs Checkpoint
|
|
114
|
+
|
|
115
|
+
| Feature | Thread (new) | Checkpoint (legacy) |
|
|
116
|
+
|---------|--------------|---------------------|
|
|
117
|
+
| Git context | Full (branch, commits, dirty) | Minimal |
|
|
118
|
+
| Worker state | Captured | Not captured |
|
|
119
|
+
| Location | workspace/threads/ | workspace/checkpoints/ |
|
|
120
|
+
| Format | Rich JSON | Simple JSON |
|
|
121
|
+
|
|
122
|
+
## Notes
|
|
123
|
+
|
|
124
|
+
- Threads ensure work survives context clears
|
|
125
|
+
- Run frequently during long sessions
|
|
126
|
+
- If session feels long, suggest `/handoff`
|
|
127
|
+
- Threads are searchable via `/search`
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Audit and clean HQ to enforce current policies and migrate outdated structures
|
|
3
|
+
allowed-tools: Task, Read, Glob, Grep, Bash, Write, Edit, AskUserQuestion
|
|
4
|
+
argument-hint: [--audit | --migrate | --fix]
|
|
5
|
+
visibility: public
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /cleanup - HQ Maintenance
|
|
9
|
+
|
|
10
|
+
Audit HQ for policy violations, migrate outdated structures, and fix inconsistencies.
|
|
11
|
+
|
|
12
|
+
**User's input:** $ARGUMENTS
|
|
13
|
+
|
|
14
|
+
## Modes
|
|
15
|
+
|
|
16
|
+
- **No args / --audit**: Report issues only (default, safe)
|
|
17
|
+
- **--migrate**: Convert old formats to new (prd.json → README.md)
|
|
18
|
+
- **--fix**: Auto-fix simple issues (git cleanup, archive stale files)
|
|
19
|
+
- **--reindex**: Regenerate ALL INDEX.md files from disk (full rebuild)
|
|
20
|
+
|
|
21
|
+
## The Job
|
|
22
|
+
|
|
23
|
+
1. Run audit checks
|
|
24
|
+
2. Report findings
|
|
25
|
+
3. If --migrate or --fix: propose changes, ask confirmation, execute
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Audit Checks
|
|
30
|
+
|
|
31
|
+
### 1. Project Structure
|
|
32
|
+
|
|
33
|
+
**Policy**: All projects in `projects/` folder with `README.md`
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Find projects with only prd.json (no README)
|
|
37
|
+
for dir in projects/*/; do
|
|
38
|
+
if [[ -f "${dir}prd.json" && ! -f "${dir}README.md" ]]; then
|
|
39
|
+
echo "MIGRATE: $dir has prd.json but no README.md"
|
|
40
|
+
fi
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
# Find projects outside projects/ folder
|
|
44
|
+
find companies apps -name "prd.json" 2>/dev/null
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Violations**:
|
|
48
|
+
- prd.json without README.md → needs migration
|
|
49
|
+
- prd.json in companies/ or apps/ → needs relocation
|
|
50
|
+
|
|
51
|
+
### 2. Worker Registry
|
|
52
|
+
|
|
53
|
+
**Policy**: All workers indexed in `workers/registry.yaml`
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Find workers not in registry
|
|
57
|
+
for dir in workers/public/*/ workers/private/*/; do
|
|
58
|
+
worker=$(basename "$dir")
|
|
59
|
+
if ! grep -q "id: $worker" workers/registry.yaml; then
|
|
60
|
+
echo "UNINDEXED: $worker"
|
|
61
|
+
fi
|
|
62
|
+
done
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. Deprecated Directories
|
|
66
|
+
|
|
67
|
+
**Policy**: No apps/ directory (use projects/ or workers/)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Check if apps/ still exists
|
|
71
|
+
if [[ -d "apps" ]]; then
|
|
72
|
+
echo "DEPRECATED: apps/ directory still exists"
|
|
73
|
+
ls apps/
|
|
74
|
+
fi
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 4. Git Status
|
|
78
|
+
|
|
79
|
+
**Policy**: Clean working tree, no orphaned deletions
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
git status --short
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Issues**:
|
|
86
|
+
- Deleted files not committed
|
|
87
|
+
- Untracked new files (should commit or ignore)
|
|
88
|
+
- Modified submodules
|
|
89
|
+
|
|
90
|
+
**Note:** Knowledge folders are symlinks to repos in `repos/public/` and `repos/private/` (gitignored). Symlinks themselves should be tracked by HQ git. Knowledge file changes are invisible to HQ git (they live in their own repos).
|
|
91
|
+
|
|
92
|
+
### 4b. Knowledge Repo Status
|
|
93
|
+
|
|
94
|
+
**Policy**: Knowledge repos should be clean (committed)
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
for symlink in knowledge/public/* knowledge/private/* companies/*/knowledge; do
|
|
98
|
+
[ -L "$symlink" ] || continue
|
|
99
|
+
repo_dir=$(cd "$symlink" && git rev-parse --show-toplevel 2>/dev/null) || continue
|
|
100
|
+
dirty=$(cd "$repo_dir" && git status --porcelain)
|
|
101
|
+
[ -z "$dirty" ] && continue
|
|
102
|
+
echo "DIRTY: $symlink → $repo_dir"
|
|
103
|
+
done
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**With --fix**: Auto-commit dirty knowledge repos:
|
|
107
|
+
```bash
|
|
108
|
+
(cd "$repo_dir" && git add -A && git commit -m "chore: cleanup commit")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 5. Stale Threads & Checkpoints
|
|
112
|
+
|
|
113
|
+
**Policy**: Archive threads/checkpoints older than 30 days
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# Stale threads (new format)
|
|
117
|
+
find workspace/threads -name "*.json" -mtime +30 2>/dev/null
|
|
118
|
+
|
|
119
|
+
# Stale checkpoints (legacy format)
|
|
120
|
+
find workspace/checkpoints -name "*.json" -mtime +30 2>/dev/null
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 6. Worker State Machine
|
|
124
|
+
|
|
125
|
+
**Policy**: Workers should have state_machine section (Loom pattern)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Find workers without state_machine
|
|
129
|
+
for f in workers/*/worker.yaml workers/public/dev-team/*/worker.yaml; do
|
|
130
|
+
if [[ -f "$f" ]] && ! grep -q "state_machine:" "$f"; then
|
|
131
|
+
echo "MISSING: $f lacks state_machine section"
|
|
132
|
+
fi
|
|
133
|
+
done
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### 7. Orphaned Skills
|
|
137
|
+
|
|
138
|
+
**Policy**: Skills only in `.claude/commands/` (not SKILL.md format)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Find old SKILL.md format
|
|
142
|
+
find . -name "SKILL.md" -not -path "./repos/*"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### 8. Stale INDEX.md Files
|
|
146
|
+
|
|
147
|
+
**Policy**: INDEX.md files should exist and match directory contents. See `knowledge/public/hq-core/index-md-spec.md` for spec.
|
|
148
|
+
|
|
149
|
+
**Expected locations:**
|
|
150
|
+
- `projects/INDEX.md`
|
|
151
|
+
- `companies/{company}/knowledge/INDEX.md` (for each company)
|
|
152
|
+
- `knowledge/public/INDEX.md`
|
|
153
|
+
- `workers/public/INDEX.md`
|
|
154
|
+
- `workers/private/INDEX.md`
|
|
155
|
+
- `workspace/orchestrator/INDEX.md`
|
|
156
|
+
- `workspace/reports/INDEX.md`
|
|
157
|
+
- `workspace/social-drafts/INDEX.md`
|
|
158
|
+
|
|
159
|
+
For each:
|
|
160
|
+
1. Check if INDEX.md exists → flag MISSING if not
|
|
161
|
+
2. Count entries in INDEX table vs actual directory contents → flag STALE if mismatch
|
|
162
|
+
|
|
163
|
+
**With --reindex or --fix**: Regenerate all INDEX.md files from disk per spec.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Migration: prd.json → README.md
|
|
168
|
+
|
|
169
|
+
For each project with only `prd.json`:
|
|
170
|
+
|
|
171
|
+
1. Read prd.json
|
|
172
|
+
2. Extract fields:
|
|
173
|
+
- `name` → title
|
|
174
|
+
- `description` → overview
|
|
175
|
+
- `metadata.goal` → Goal line
|
|
176
|
+
- `metadata.successCriteria` → Success line
|
|
177
|
+
- `userStories[]` → User Stories section
|
|
178
|
+
3. Generate README.md
|
|
179
|
+
4. Keep prd.json as backup (rename to `prd.json.bak`)
|
|
180
|
+
|
|
181
|
+
**Template**:
|
|
182
|
+
```markdown
|
|
183
|
+
# {name}
|
|
184
|
+
|
|
185
|
+
**Goal:** {metadata.goal}
|
|
186
|
+
**Success:** {metadata.successCriteria}
|
|
187
|
+
|
|
188
|
+
## Overview
|
|
189
|
+
{description}
|
|
190
|
+
|
|
191
|
+
## User Stories
|
|
192
|
+
|
|
193
|
+
### US-001: {story.title}
|
|
194
|
+
**Description:** {story.description}
|
|
195
|
+
|
|
196
|
+
**Acceptance Criteria:**
|
|
197
|
+
{story.acceptanceCriteria as checklist}
|
|
198
|
+
|
|
199
|
+
## Non-Goals
|
|
200
|
+
{if present}
|
|
201
|
+
|
|
202
|
+
## Technical Considerations
|
|
203
|
+
{if present}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## Fix Actions
|
|
209
|
+
|
|
210
|
+
### Git Cleanup
|
|
211
|
+
```bash
|
|
212
|
+
# Stage deleted files
|
|
213
|
+
git add -u
|
|
214
|
+
|
|
215
|
+
# Commit cleanup
|
|
216
|
+
git commit -m "chore: cleanup orphaned files"
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Archive Stale Threads & Checkpoints
|
|
220
|
+
```bash
|
|
221
|
+
mkdir -p archives/threads archives/checkpoints
|
|
222
|
+
find workspace/threads -name "*.json" -mtime +30 -exec mv {} archives/threads/ \;
|
|
223
|
+
find workspace/checkpoints -name "*.json" -mtime +30 -exec mv {} archives/checkpoints/ \;
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Relocate Misplaced Projects
|
|
227
|
+
```bash
|
|
228
|
+
# Move apps/{name}/prd.json to projects/{name}/
|
|
229
|
+
mkdir -p projects/{name}
|
|
230
|
+
mv apps/{name}/prd.json projects/{name}/
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Regenerate INDEX.md Files (--reindex)
|
|
234
|
+
|
|
235
|
+
For each expected INDEX.md location (see Audit Check #8):
|
|
236
|
+
1. List all files and subdirectories (skip INDEX.md, .DS_Store, node_modules, dotfiles)
|
|
237
|
+
2. Extract description per spec: `.md` → first `#` heading, `.yaml` → `description:`, `.json` → `name`/`description`, dirs → file count + purpose
|
|
238
|
+
3. Write INDEX.md using template from `knowledge/public/hq-core/index-md-spec.md`
|
|
239
|
+
4. Directories first, then files, alphabetical within each group
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Output Format
|
|
244
|
+
|
|
245
|
+
### Audit Report
|
|
246
|
+
```
|
|
247
|
+
HQ Cleanup Audit
|
|
248
|
+
================
|
|
249
|
+
|
|
250
|
+
✓ Worker registry: 15 workers indexed
|
|
251
|
+
✗ Project structure: 8 issues
|
|
252
|
+
- projects/customer-cube: prd.json without README.md
|
|
253
|
+
- projects/deel-analytics: prd.json without README.md
|
|
254
|
+
...
|
|
255
|
+
✗ Deprecated directories: apps/ still exists (4 items)
|
|
256
|
+
✗ Git status: 3 uncommitted changes
|
|
257
|
+
✓ Checkpoints: all recent
|
|
258
|
+
✗ INDEX.md: 2 stale, 1 missing
|
|
259
|
+
- projects/INDEX.md: 30 entries vs 33 actual (stale)
|
|
260
|
+
- workspace/reports/INDEX.md: missing
|
|
261
|
+
|
|
262
|
+
Summary: 14 issues found
|
|
263
|
+
Run `/cleanup --migrate` to convert prd.json files
|
|
264
|
+
Run `/cleanup --fix` to clean git and archive stale files
|
|
265
|
+
Run `/cleanup --reindex` to regenerate all INDEX.md files
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### After Migration
|
|
269
|
+
```
|
|
270
|
+
Migrated 8 projects to README.md format:
|
|
271
|
+
- projects/customer-cube/README.md (created)
|
|
272
|
+
- projects/deel-analytics/README.md (created)
|
|
273
|
+
...
|
|
274
|
+
|
|
275
|
+
Original prd.json files renamed to prd.json.bak
|
|
276
|
+
Run `/cleanup --fix` to commit changes
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Rules
|
|
282
|
+
|
|
283
|
+
- **--audit is safe**: Never modifies files, only reports
|
|
284
|
+
- **Always ask before destructive actions**: deletions, moves
|
|
285
|
+
- **Backup before migration**: rename, don't delete
|
|
286
|
+
- **Commit after changes**: keep git clean
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Current HQ Policies
|
|
291
|
+
|
|
292
|
+
Reference for what we're enforcing:
|
|
293
|
+
|
|
294
|
+
| Area | Policy |
|
|
295
|
+
|------|--------|
|
|
296
|
+
| Projects | Live in `projects/{name}/` with `README.md` |
|
|
297
|
+
| PRD format | Markdown README.md (not prd.json) |
|
|
298
|
+
| Workers | Indexed in `workers/registry.yaml` |
|
|
299
|
+
| Worker FSM | `state_machine:` section in worker.yaml (Loom pattern) |
|
|
300
|
+
| Apps | Deprecated - migrate to projects/ or workers/ |
|
|
301
|
+
| Skills | `.claude/commands/*.md` format |
|
|
302
|
+
| Threads | Primary session persistence (`workspace/threads/`) |
|
|
303
|
+
| Checkpoints | Legacy format, archive after 30 days |
|
|
304
|
+
| Metrics | Append to `workspace/metrics/metrics.jsonl` |
|
|
305
|
+
| Git | Clean working tree |
|
|
306
|
+
| Knowledge repos | Symlinks in `knowledge/` and `companies/*/knowledge/` point to repos; all repos committed |
|
|
307
|
+
| INDEX.md | Exist at key dirs, match contents (see spec) |
|