feat: projcet Initialization

This commit is contained in:
2026-05-03 09:38:24 +08:00
commit 81bca6aa80
22 changed files with 1867 additions and 0 deletions
Executable
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env node
import { scan } from './stages/scan.js'
import { plan } from './stages/plan.js'
import { runTasks } from './stages/run.js'
import { diff } from './stages/diff.js'
import { verify } from './stages/verify.js'
import { status } from './stages/status.js'
import { doctor } from './stages/doctor.js'
const command = process.argv[2] ?? 'help'
const flags = new Set(process.argv.slice(3))
async function main() {
if (command === 'scan') await scan()
else if (command === 'plan') await plan()
else if (command === 'run') await runTasks({ retryFailed: flags.has('--retry-failed') })
else if (command === 'diff') await diff()
else if (command === 'verify') await verify()
else if (command === 'go') {
await scan()
await plan({ assumeYes: flags.has('--yes') })
await runTasks({ retryFailed: false })
await diff()
await verify()
} else if (command === 'status') await status()
else if (command === 'doctor') await doctor()
else printHelp()
}
function printHelp() {
console.log(`Usage: ht <command>
Commands:
scan Capture and extract LayoutSpec artifacts
plan Build TaskList and project/API contracts
run Execute pending tasks into output/
run --retry-failed
diff Build visual similarity report
verify Run quality, DOM, and flow checks
go [--yes] Run scan, plan, run, diff, verify
status Show TaskList summary
doctor Check local prerequisites`)
}
main().catch((error) => {
console.error(error instanceof Error ? error.message : error)
process.exitCode = 1
})