nemonix-cli 1.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/LICENSE +21 -0
- package/README.md +186 -0
- package/dist/cli.js +6870 -0
- package/package.json +48 -0
- package/src/config/claude-code-config/.claude/commands/setup-tmux.md +0 -0
- package/src/config/claude-code-config/CHANGELOG.md +261 -0
- package/src/config/claude-code-config/README.md +1 -0
- package/src/config/claude-code-config/agents/action.md +36 -0
- package/src/config/claude-code-config/agents/clean-code-runner.md +61 -0
- package/src/config/claude-code-config/agents/code-reviewer.md +172 -0
- package/src/config/claude-code-config/agents/code-simplifier.md +49 -0
- package/src/config/claude-code-config/agents/explore-codebase.md +65 -0
- package/src/config/claude-code-config/agents/explore-docs.md +65 -0
- package/src/config/claude-code-config/agents/explore-fast.md +22 -0
- package/src/config/claude-code-config/agents/implementer.md +181 -0
- package/src/config/claude-code-config/agents/snipper.md +36 -0
- package/src/config/claude-code-config/agents/websearch.md +42 -0
- package/src/config/claude-code-config/commands/prompts/create-vitejs-app.md +272 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-add-prisma-db.md +136 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-better-auth.md +173 -0
- package/src/config/claude-code-config/commands/prompts/nextjs-setup-project.md +200 -0
- package/src/config/claude-code-config/commands/prompts/prompt.md +55 -0
- package/src/config/claude-code-config/commands/prompts/saas-challenge-idea.md +135 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-architecture.md +242 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-headline.md +132 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-landing-copywritting.md +267 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-legals-docs.md +176 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-logos.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-prd.md +195 -0
- package/src/config/claude-code-config/commands/prompts/saas-create-tasks.md +240 -0
- package/src/config/claude-code-config/commands/prompts/saas-define-pricing.md +293 -0
- package/src/config/claude-code-config/commands/prompts/saas-find-domain-name.md +190 -0
- package/src/config/claude-code-config/commands/prompts/saas-implement-landing-page.md +257 -0
- package/src/config/claude-code-config/commands/prompts/setup-tmux.md +160 -0
- package/src/config/claude-code-config/commands/prompts/tools.md +148 -0
- package/src/config/claude-code-config/hooks/hook-post-file.ts +162 -0
- package/src/config/claude-code-config/scripts/.claude/skills/fix-on-my-computer/SKILL.md +81 -0
- package/src/config/claude-code-config/scripts/CLAUDE.md +50 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/CLAUDE.md +59 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/shared.test.ts +185 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/__tests__/title-generation.test.ts +44 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/sample-transcript.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-short-message.jsonl +2 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/fixtures/transcript-with-title.jsonl +3 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/index.ts +113 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/rename-all.ts +148 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/shared.ts +157 -0
- package/src/config/claude-code-config/scripts/auto-rename-session/src/worker.ts +58 -0
- package/src/config/claude-code-config/scripts/biome.json +37 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/CLAUDE.md +84 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/claude.test.ts +19 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/__tests__/paths.test.ts +68 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/claude.ts +56 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/cli.ts +46 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/credentials.ts +76 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/index.ts +9 -0
- package/src/config/claude-code-config/scripts/claude-code-ai/helper/paths.ts +51 -0
- package/src/config/claude-code-config/scripts/command-validator/CLAUDE.md +112 -0
- package/src/config/claude-code-config/scripts/command-validator/README.md +147 -0
- package/src/config/claude-code-config/scripts/command-validator/src/__tests__/validator.test.ts +99 -0
- package/src/config/claude-code-config/scripts/command-validator/src/cli.ts +121 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/security-rules.ts +174 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/types.ts +34 -0
- package/src/config/claude-code-config/scripts/command-validator/src/lib/validator.ts +90 -0
- package/src/config/claude-code-config/scripts/package.json +43 -0
- package/src/config/claude-code-config/scripts/statusline/CLAUDE.md +205 -0
- package/src/config/claude-code-config/scripts/statusline/README.md +193 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/context.test.ts +229 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/formatters.test.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/__tests__/statusline.test.ts +309 -0
- package/src/config/claude-code-config/scripts/statusline/data/.gitkeep +0 -0
- package/src/config/claude-code-config/scripts/statusline/defaults.json +82 -0
- package/src/config/claude-code-config/scripts/statusline/docs/ARCHITECTURE.md +166 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/mock-transcript.jsonl +4 -0
- package/src/config/claude-code-config/scripts/statusline/fixtures/test-input.json +35 -0
- package/src/config/claude-code-config/scripts/statusline/src/analyze-daily-usage.ts +151 -0
- package/src/config/claude-code-config/scripts/statusline/src/commands/interactive-config.ts +515 -0
- package/src/config/claude-code-config/scripts/statusline/src/debug-payloads.ts +195 -0
- package/src/config/claude-code-config/scripts/statusline/src/index.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config-types.ts +110 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/config.ts +21 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/context.ts +103 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/commands/weekly-analysis.ts +108 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/index.ts +111 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/limits/types.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/migrate-to-sqlite.ts +136 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-day.ts +79 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-month.ts +66 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/commands/spend-project.ts +85 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/database.ts +395 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/index.ts +178 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/payload-logger.ts +161 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/features/spend/types.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/formatters.ts +426 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/git.ts +100 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/menu-factories.ts +224 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/presets.ts +177 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/render-pure.ts +516 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/types.ts +36 -0
- package/src/config/claude-code-config/scripts/statusline/src/lib/utils.ts +15 -0
- package/src/config/claude-code-config/scripts/statusline/src/stats.ts +119 -0
- package/src/config/claude-code-config/scripts/statusline/src/tests/spend-v2.test.ts +377 -0
- package/src/config/claude-code-config/scripts/statusline/src/tools/fixed-cost-calc.ts +317 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.free.json +79 -0
- package/src/config/claude-code-config/scripts/statusline/statusline.config.json +100 -0
- package/src/config/claude-code-config/scripts/statusline/test-with-fixtures.ts +37 -0
- package/src/config/claude-code-config/scripts/statusline/test.ts +20 -0
- package/src/config/claude-code-config/scripts/statusline/tsconfig.json +27 -0
- package/src/config/claude-code-config/scripts/tsconfig.json +27 -0
- package/src/config/claude-code-config/settings.json +92 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/SKILL.md +176 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/architecture-template.md +436 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/challenge-framework.md +289 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/discovery-framework.md +338 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/prd-template.md +452 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/task-template.md +263 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/references/tools.md +132 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/rename-project.sh +42 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/scripts/setup.sh +104 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-00-init.md +174 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-01-discovery.md +342 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-02-brainstorm.md +230 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-03-validate.md +372 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-04-prd.md +364 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-05-architecture.md +904 -0
- package/src/config/claude-code-config/skills/aibuilder-create-saas/steps/step-06-tasks.md +446 -0
- package/src/config/claude-code-config/skills/explore/SKILL.md +119 -0
- package/src/config/claude-code-config/skills/frontend-design/LICENSE.txt +177 -0
- package/src/config/claude-code-config/skills/frontend-design/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-commit/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/git-create-pr/SKILL.md +53 -0
- package/src/config/claude-code-config/skills/git-fix-pr-comments/SKILL.md +51 -0
- package/src/config/claude-code-config/skills/git-merge/SKILL.md +68 -0
- package/src/config/claude-code-config/skills/marketing-copywriting/SKILL.md +72 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/SKILL.md +694 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/comprehensive-example.md +175 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/project-patterns.md +334 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/prompting-techniques.md +411 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/rules-directory-guide.md +298 -0
- package/src/config/claude-code-config/skills/meta-claude-memory/references/section-templates.md +347 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/SKILL.md +357 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/command-vs-prompt.md +287 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/examples.md +689 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/hook-types.md +495 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/input-output-schemas.md +503 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/matchers.md +517 -0
- package/src/config/claude-code-config/skills/meta-hooks-creator/references/troubleshooting.md +653 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/SKILL.md +285 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anthropic-best-practices.md +126 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/anti-patterns.md +57 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/clarity-principles.md +54 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/context-management.md +389 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/few-shot-patterns.md +47 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/openai-best-practices.md +50 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/prompt-templates.md +110 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/reasoning-techniques.md +52 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/system-prompt-patterns.md +48 -0
- package/src/config/claude-code-config/skills/meta-prompt-creator/references/xml-structure.md +36 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/LICENSE.txt +202 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/SKILL.md +421 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/package.json +5 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/output-patterns.md +82 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/progressive-disclosure-patterns.md +374 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/prompting-integration.md +363 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/real-world-examples.md +513 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/script-patterns.md +385 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/workflows.md +28 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/references/xml-tag-guide.md +606 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/init-skill.ts +214 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/package-skill.ts +146 -0
- package/src/config/claude-code-config/skills/meta-skill-creator/scripts/validate.ts +138 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/SKILL.md +390 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/ask-patterns.md +225 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/prompt-engineering.md +377 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/state-management.md +275 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/step-template.md +334 -0
- package/src/config/claude-code-config/skills/meta-skill-workflow-creator/references/workflow-patterns.md +300 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/SKILL.md +451 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/context-management.md +567 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/debugging-agents.md +714 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/error-handling-and-recovery.md +502 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/evaluation-and-testing.md +374 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/orchestration-patterns.md +591 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/subagents.md +599 -0
- package/src/config/claude-code-config/skills/meta-subagent-creator/references/writing-subagent-prompts.md +513 -0
- package/src/config/claude-code-config/skills/ralph-loop/SKILL.md +117 -0
- package/src/config/claude-code-config/skills/ralph-loop/scripts/setup.sh +278 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-00-init.md +215 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-01-interactive-prd.md +366 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-02-create-stories.md +273 -0
- package/src/config/claude-code-config/skills/ralph-loop/steps/step-03-finish.md +245 -0
- package/src/config/claude-code-config/skills/ralph-tasks/SKILL.md +88 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/add-task.sh +36 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/list-tasks.sh +66 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/remove-task.sh +47 -0
- package/src/config/claude-code-config/skills/ralph-tasks/scripts/setup.sh +201 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add-search.md +131 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-add.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-init.md +123 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-list.md +58 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-remove.md +48 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-setup.md +46 -0
- package/src/config/claude-code-config/skills/ralph-tasks/steps/action-wake-up.md +62 -0
- package/src/config/claude-code-config/skills/utils-fix-errors/SKILL.md +61 -0
- package/src/config/claude-code-config/skills/utils-fix-grammar/SKILL.md +59 -0
- package/src/config/claude-code-config/skills/utils-oneshot/SKILL.md +56 -0
- package/src/config/claude-code-config/skills/utils-refactor/SKILL.md +89 -0
- package/src/config/claude-code-config/skills/utils-save-docs/SKILL.md +74 -0
- package/src/config/claude-code-config/skills/utils-ultrathink/SKILL.md +42 -0
- package/src/config/claude-code-config/skills/workflow-apex/SKILL.md +116 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/setup-templates.sh +144 -0
- package/src/config/claude-code-config/skills/workflow-apex/scripts/update-progress.sh +80 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00-init.md +273 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-branch.md +126 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-economy.md +244 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-interactive.md +165 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-00b-save.md +123 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-01-analyze.md +361 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02-plan.md +422 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-02b-tasks.md +301 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute-teams.md +297 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-03-execute.md +239 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-04-validate.md +264 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-05-examine.md +294 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-06-resolve.md +237 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-07-tests.md +250 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-08-run-tests.md +308 -0
- package/src/config/claude-code-config/skills/workflow-apex/steps/step-09-finish.md +193 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/00-context.md +53 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/01-analyze.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/02-plan.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/03-execute.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/04-validate.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/05-examine.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/06-resolve.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/07-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/08-run-tests.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/09-finish.md +10 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/README.md +195 -0
- package/src/config/claude-code-config/skills/workflow-apex/templates/step-complete.md +7 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/SKILL.md +127 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-01-explore.md +230 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-02-challenge.md +238 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-03-synthesize.md +337 -0
- package/src/config/claude-code-config/skills/workflow-brainstorm/steps/step-04-action.md +285 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/SKILL.md +150 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/cli-commands.md +122 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/github-cli.md +243 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/troubleshooting.md +362 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/references/vercel-cli.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-00-init.md +157 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-01-watch-ci.md +192 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-02-analyze-errors.md +263 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-03-fix-locally.md +312 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-04-commit-push.md +206 -0
- package/src/config/claude-code-config/skills/workflow-ci-fixer/steps/step-05-cleanup.md +196 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/SKILL.md +129 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/general-clean-code.md +347 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/nextjs-clean-code.md +458 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/react-clean-code.md +406 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/tanstack-query-best-practices.md +516 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/references/zustand-best-practices.md +491 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-01-scan.md +137 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-02-apply.md +152 -0
- package/src/config/claude-code-config/skills/workflow-clean-code/steps/step-03-verify.md +143 -0
- package/src/config/claude-code-config/skills/workflow-debug/SKILL.md +126 -0
- package/src/config/claude-code-config/skills/workflow-debug/references/log-technique.md +285 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-00-init.md +94 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01-analyze.md +180 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-01b-log-instrumentation.md +271 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-02-find-solutions.md +141 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-03-propose.md +142 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-04-fix.md +176 -0
- package/src/config/claude-code-config/skills/workflow-debug/steps/step-05-verify.md +279 -0
- package/src/config/claude-code-config/skills/workflow-review-code/SKILL.md +219 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/clean-code-principles.md +140 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/code-quality-metrics.md +174 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/feedback-patterns.md +149 -0
- package/src/config/claude-code-config/skills/workflow-review-code/references/security-checklist.md +127 -0
- package/src/config/claude-code-config/song/finish.mp3 +0 -0
- package/src/config/claude-code-config/song/need-human.mp3 +0 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# GitHub CLI Complete Reference for CI/CD
|
|
2
|
+
|
|
3
|
+
<workflow_runs>
|
|
4
|
+
## List Workflow Runs
|
|
5
|
+
```bash
|
|
6
|
+
gh run list # All recent runs
|
|
7
|
+
gh run list --limit 20 # Limit results
|
|
8
|
+
gh run list --workflow ci.yml # Specific workflow
|
|
9
|
+
gh run list --branch main # Specific branch
|
|
10
|
+
gh run list --user username # By user
|
|
11
|
+
gh run list --status failure # Failed only
|
|
12
|
+
gh run list --status success # Successful only
|
|
13
|
+
gh run list --status in_progress # Currently running
|
|
14
|
+
gh run list --event push # By trigger event
|
|
15
|
+
gh run list --event pull_request # PR triggered
|
|
16
|
+
|
|
17
|
+
# JSON output with specific fields
|
|
18
|
+
gh run list --json databaseId,status,conclusion,name,headBranch,createdAt
|
|
19
|
+
gh run list --json databaseId,conclusion -q '.[] | select(.conclusion=="failure")'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## View Run Details
|
|
23
|
+
```bash
|
|
24
|
+
gh run view <run-id> # Summary view
|
|
25
|
+
gh run view <run-id> --log # Full logs
|
|
26
|
+
gh run view <run-id> --log-failed # Only failed job logs
|
|
27
|
+
gh run view <run-id> --exit-status # Exit with run's status
|
|
28
|
+
gh run view <run-id> --web # Open in browser
|
|
29
|
+
|
|
30
|
+
# JSON output
|
|
31
|
+
gh run view <run-id> --json jobs
|
|
32
|
+
gh run view <run-id> --json jobs,status,conclusion
|
|
33
|
+
gh run view <run-id> --json jobs -q '.jobs[] | {name, conclusion, steps}'
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Watch Running Workflow
|
|
37
|
+
```bash
|
|
38
|
+
gh run watch # Interactive selection
|
|
39
|
+
gh run watch <run-id> # Watch specific run
|
|
40
|
+
gh run watch <run-id> --exit-status # Exit with final status
|
|
41
|
+
gh run watch <run-id> --interval 5 # Custom refresh interval
|
|
42
|
+
```
|
|
43
|
+
</workflow_runs>
|
|
44
|
+
|
|
45
|
+
<rerun_workflows>
|
|
46
|
+
## Re-run Workflows
|
|
47
|
+
```bash
|
|
48
|
+
gh run rerun <run-id> # Re-run all jobs
|
|
49
|
+
gh run rerun <run-id> --failed # Re-run only failed jobs
|
|
50
|
+
gh run rerun <run-id> --debug # Re-run with debug logging
|
|
51
|
+
gh run rerun <run-id> --job <job-id> # Re-run specific job
|
|
52
|
+
|
|
53
|
+
# Get job IDs first
|
|
54
|
+
gh run view <run-id> --json jobs -q '.jobs[].databaseId'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Cancel Running Workflow
|
|
58
|
+
```bash
|
|
59
|
+
gh run cancel <run-id>
|
|
60
|
+
```
|
|
61
|
+
</rerun_workflows>
|
|
62
|
+
|
|
63
|
+
<artifacts>
|
|
64
|
+
## Download Artifacts
|
|
65
|
+
```bash
|
|
66
|
+
gh run download <run-id> # All artifacts to current dir
|
|
67
|
+
gh run download <run-id> --dir ./artifacts # Specific directory
|
|
68
|
+
gh run download <run-id> -n artifact-name # Specific artifact
|
|
69
|
+
gh run download <run-id> -n "name-*" # Pattern matching
|
|
70
|
+
gh run download <run-id> -p "*.zip" # Glob pattern
|
|
71
|
+
|
|
72
|
+
# Download from multiple runs
|
|
73
|
+
gh run download -n test-results # Latest artifact with name
|
|
74
|
+
|
|
75
|
+
# Download interactively
|
|
76
|
+
gh run download
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## List Artifacts via API
|
|
80
|
+
```bash
|
|
81
|
+
gh api repos/{owner}/{repo}/actions/artifacts
|
|
82
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
|
|
83
|
+
gh api repos/{owner}/{repo}/actions/artifacts/{artifact_id}/zip > artifact.zip
|
|
84
|
+
```
|
|
85
|
+
</artifacts>
|
|
86
|
+
|
|
87
|
+
<workflow_management>
|
|
88
|
+
## List Workflows
|
|
89
|
+
```bash
|
|
90
|
+
gh workflow list # All workflows
|
|
91
|
+
gh workflow list --all # Include disabled
|
|
92
|
+
gh workflow list --json id,name,state
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## View Workflow
|
|
96
|
+
```bash
|
|
97
|
+
gh workflow view <workflow> # Summary
|
|
98
|
+
gh workflow view <workflow> --yaml # Show YAML content
|
|
99
|
+
gh workflow view <workflow> --web # Open in browser
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Run Workflow Manually
|
|
103
|
+
```bash
|
|
104
|
+
gh workflow run <workflow> # Trigger on default branch
|
|
105
|
+
gh workflow run <workflow> --ref feature # Specific branch
|
|
106
|
+
gh workflow run ci.yml -f input1=value # With inputs
|
|
107
|
+
gh workflow run ci.yml --json # Read inputs from stdin
|
|
108
|
+
|
|
109
|
+
# Example with JSON input
|
|
110
|
+
echo '{"environment": "staging"}' | gh workflow run deploy.yml --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Enable/Disable Workflow
|
|
114
|
+
```bash
|
|
115
|
+
gh workflow enable <workflow>
|
|
116
|
+
gh workflow disable <workflow>
|
|
117
|
+
```
|
|
118
|
+
</workflow_management>
|
|
119
|
+
|
|
120
|
+
<cache_management>
|
|
121
|
+
## Cache Commands
|
|
122
|
+
```bash
|
|
123
|
+
gh cache list # List caches
|
|
124
|
+
gh cache list --limit 50
|
|
125
|
+
gh cache list --json id,key,sizeInBytes
|
|
126
|
+
gh cache list --key "npm-" # Filter by key prefix
|
|
127
|
+
|
|
128
|
+
gh cache delete <cache-id> # Delete specific cache
|
|
129
|
+
gh cache delete --all # Delete all caches
|
|
130
|
+
```
|
|
131
|
+
</cache_management>
|
|
132
|
+
|
|
133
|
+
<api_access>
|
|
134
|
+
## Direct API Access
|
|
135
|
+
```bash
|
|
136
|
+
# Get workflow runs
|
|
137
|
+
gh api repos/{owner}/{repo}/actions/runs
|
|
138
|
+
gh api repos/{owner}/{repo}/actions/runs?status=failure
|
|
139
|
+
|
|
140
|
+
# Get specific run
|
|
141
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}
|
|
142
|
+
|
|
143
|
+
# Get jobs for a run
|
|
144
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/jobs
|
|
145
|
+
|
|
146
|
+
# Download logs (returns redirect URL)
|
|
147
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/logs
|
|
148
|
+
|
|
149
|
+
# Get artifacts
|
|
150
|
+
gh api repos/{owner}/{repo}/actions/artifacts
|
|
151
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
|
|
152
|
+
|
|
153
|
+
# Re-run workflow
|
|
154
|
+
gh api -X POST repos/{owner}/{repo}/actions/runs/{run_id}/rerun
|
|
155
|
+
|
|
156
|
+
# Re-run failed jobs
|
|
157
|
+
gh api -X POST repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs
|
|
158
|
+
|
|
159
|
+
# Cancel run
|
|
160
|
+
gh api -X POST repos/{owner}/{repo}/actions/runs/{run_id}/cancel
|
|
161
|
+
|
|
162
|
+
# Delete run
|
|
163
|
+
gh api -X DELETE repos/{owner}/{repo}/actions/runs/{run_id}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Using jq for Filtering
|
|
167
|
+
```bash
|
|
168
|
+
# Get failed runs
|
|
169
|
+
gh api repos/{owner}/{repo}/actions/runs \
|
|
170
|
+
--jq '.workflow_runs[] | select(.conclusion=="failure") | {id, name, created_at}'
|
|
171
|
+
|
|
172
|
+
# Get latest successful run ID
|
|
173
|
+
gh api repos/{owner}/{repo}/actions/runs?status=success \
|
|
174
|
+
--jq '.workflow_runs[0].id'
|
|
175
|
+
|
|
176
|
+
# Get failed job names
|
|
177
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/jobs \
|
|
178
|
+
--jq '.jobs[] | select(.conclusion=="failure") | .name'
|
|
179
|
+
```
|
|
180
|
+
</api_access>
|
|
181
|
+
|
|
182
|
+
<pr_checks>
|
|
183
|
+
## Check PR Status
|
|
184
|
+
```bash
|
|
185
|
+
gh pr checks # Current branch PR checks
|
|
186
|
+
gh pr checks <pr-number> # Specific PR
|
|
187
|
+
gh pr checks --required # Required checks only
|
|
188
|
+
gh pr checks --watch # Watch until complete
|
|
189
|
+
gh pr checks --fail-fast # Exit on first failure
|
|
190
|
+
gh pr checks --json name,state,conclusion
|
|
191
|
+
gh pr checks --web # Open in browser
|
|
192
|
+
```
|
|
193
|
+
</pr_checks>
|
|
194
|
+
|
|
195
|
+
<useful_scripts>
|
|
196
|
+
## Useful One-liners
|
|
197
|
+
```bash
|
|
198
|
+
# Get latest failed run ID
|
|
199
|
+
gh run list --status failure --limit 1 --json databaseId -q '.[0].databaseId'
|
|
200
|
+
|
|
201
|
+
# Re-run latest failed
|
|
202
|
+
gh run rerun $(gh run list --status failure -L1 --json databaseId -q '.[0].databaseId') --failed
|
|
203
|
+
|
|
204
|
+
# Watch latest run
|
|
205
|
+
gh run watch $(gh run list -L1 --json databaseId -q '.[0].databaseId')
|
|
206
|
+
|
|
207
|
+
# Download all failed run artifacts
|
|
208
|
+
for id in $(gh run list --status failure --json databaseId -q '.[].databaseId'); do
|
|
209
|
+
gh run download $id --dir /tmp/artifacts/$id 2>/dev/null
|
|
210
|
+
done
|
|
211
|
+
|
|
212
|
+
# List all workflow files
|
|
213
|
+
ls .github/workflows/*.yml
|
|
214
|
+
|
|
215
|
+
# Get run URL
|
|
216
|
+
gh run view <run-id> --json url -q '.url'
|
|
217
|
+
|
|
218
|
+
# Check if workflow exists
|
|
219
|
+
gh workflow view ci.yml >/dev/null 2>&1 && echo "exists" || echo "not found"
|
|
220
|
+
```
|
|
221
|
+
</useful_scripts>
|
|
222
|
+
|
|
223
|
+
<environment_secrets>
|
|
224
|
+
## Secrets and Variables (for reference)
|
|
225
|
+
```bash
|
|
226
|
+
# List secrets (names only, not values)
|
|
227
|
+
gh secret list
|
|
228
|
+
gh secret list --env production
|
|
229
|
+
|
|
230
|
+
# Set secret
|
|
231
|
+
gh secret set SECRET_NAME
|
|
232
|
+
gh secret set SECRET_NAME --body "value"
|
|
233
|
+
gh secret set SECRET_NAME < secret.txt
|
|
234
|
+
|
|
235
|
+
# Delete secret
|
|
236
|
+
gh secret delete SECRET_NAME
|
|
237
|
+
|
|
238
|
+
# Variables
|
|
239
|
+
gh variable list
|
|
240
|
+
gh variable set VAR_NAME --body "value"
|
|
241
|
+
gh variable delete VAR_NAME
|
|
242
|
+
```
|
|
243
|
+
</environment_secrets>
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
# CI/CD Troubleshooting Guide
|
|
2
|
+
|
|
3
|
+
<vercel_issues>
|
|
4
|
+
## Vercel Build Failures
|
|
5
|
+
|
|
6
|
+
<memory_issues>
|
|
7
|
+
### Out of Memory (OOM)
|
|
8
|
+
**Symptoms:**
|
|
9
|
+
- Build cancelled with memory error
|
|
10
|
+
- Process killed unexpectedly
|
|
11
|
+
- "JavaScript heap out of memory"
|
|
12
|
+
|
|
13
|
+
**Solutions:**
|
|
14
|
+
```bash
|
|
15
|
+
# Enable memory report
|
|
16
|
+
VERCEL_DEBUG_MEMORY_REPORT=1 vercel build
|
|
17
|
+
|
|
18
|
+
# Increase Node memory (in build command)
|
|
19
|
+
NODE_OPTIONS='--max-old-space-size=4096' npm run build
|
|
20
|
+
|
|
21
|
+
# For Next.js, in next.config.js:
|
|
22
|
+
module.exports = {
|
|
23
|
+
experimental: {
|
|
24
|
+
workerThreads: false,
|
|
25
|
+
cpus: 1
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Prevention:**
|
|
31
|
+
- Analyze bundle size: `npx @next/bundle-analyzer`
|
|
32
|
+
- Use dynamic imports for large modules
|
|
33
|
+
- Upgrade to Pro/Enterprise for more memory
|
|
34
|
+
</memory_issues>
|
|
35
|
+
|
|
36
|
+
<module_not_found>
|
|
37
|
+
### Module Not Found
|
|
38
|
+
**Symptoms:**
|
|
39
|
+
- "Cannot find module 'xxx'"
|
|
40
|
+
- "Module not found: Can't resolve 'xxx'"
|
|
41
|
+
|
|
42
|
+
**Solutions:**
|
|
43
|
+
```bash
|
|
44
|
+
# Check if package is in dependencies (not devDependencies for production)
|
|
45
|
+
cat package.json | jq '.dependencies'
|
|
46
|
+
|
|
47
|
+
# Clear node_modules and reinstall
|
|
48
|
+
rm -rf node_modules package-lock.json
|
|
49
|
+
npm install
|
|
50
|
+
|
|
51
|
+
# For monorepos, check workspace configuration
|
|
52
|
+
npm ls <package-name>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Common causes:**
|
|
56
|
+
- Package in devDependencies but needed at build time
|
|
57
|
+
- Missing peer dependencies
|
|
58
|
+
- Incorrect import path (case sensitivity)
|
|
59
|
+
- Missing `@types/*` packages for TypeScript
|
|
60
|
+
</module_not_found>
|
|
61
|
+
|
|
62
|
+
<build_timeout>
|
|
63
|
+
### Build Timeout (45 min limit)
|
|
64
|
+
**Symptoms:**
|
|
65
|
+
- Build cancelled after 45 minutes
|
|
66
|
+
- "Build exceeded maximum duration"
|
|
67
|
+
|
|
68
|
+
**Solutions:**
|
|
69
|
+
```bash
|
|
70
|
+
# Use build cache effectively
|
|
71
|
+
vercel deploy # Don't use --force unless necessary
|
|
72
|
+
|
|
73
|
+
# Skip unnecessary steps
|
|
74
|
+
SKIP_ENV_VALIDATION=1 npm run build
|
|
75
|
+
|
|
76
|
+
# For Next.js ISR, reduce pages built at build time
|
|
77
|
+
# In getStaticPaths:
|
|
78
|
+
export async function getStaticPaths() {
|
|
79
|
+
return { paths: [], fallback: 'blocking' }
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Optimization tips:**
|
|
84
|
+
- Enable Turborepo/Nx caching
|
|
85
|
+
- Use `next build` with `output: 'standalone'`
|
|
86
|
+
- Reduce number of pages generated at build time
|
|
87
|
+
</build_timeout>
|
|
88
|
+
|
|
89
|
+
<env_var_issues>
|
|
90
|
+
### Environment Variable Issues
|
|
91
|
+
**Symptoms:**
|
|
92
|
+
- "undefined" values in app
|
|
93
|
+
- Different behavior in preview vs production
|
|
94
|
+
|
|
95
|
+
**Debug:**
|
|
96
|
+
```bash
|
|
97
|
+
# List all env vars
|
|
98
|
+
vercel env ls
|
|
99
|
+
|
|
100
|
+
# Pull to local
|
|
101
|
+
vercel pull
|
|
102
|
+
cat .vercel/.env.*.local
|
|
103
|
+
|
|
104
|
+
# Check in build logs what's available
|
|
105
|
+
echo "Available env vars:"
|
|
106
|
+
vercel build --debug 2>&1 | grep -i "environment"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Common issues:**
|
|
110
|
+
- Var only set for Production, not Preview
|
|
111
|
+
- Missing `NEXT_PUBLIC_` prefix for client-side vars
|
|
112
|
+
- Var set after deployment (need redeploy)
|
|
113
|
+
</env_var_issues>
|
|
114
|
+
|
|
115
|
+
<cache_issues>
|
|
116
|
+
### Build Cache Issues
|
|
117
|
+
**Symptoms:**
|
|
118
|
+
- Old code still appearing
|
|
119
|
+
- Dependencies not updating
|
|
120
|
+
- Inconsistent builds
|
|
121
|
+
|
|
122
|
+
**Solutions:**
|
|
123
|
+
```bash
|
|
124
|
+
# Force fresh build
|
|
125
|
+
vercel deploy --force
|
|
126
|
+
|
|
127
|
+
# Or via env var
|
|
128
|
+
VERCEL_FORCE_NO_BUILD_CACHE=1 vercel deploy
|
|
129
|
+
|
|
130
|
+
# Clear Turborepo cache
|
|
131
|
+
TURBO_FORCE=1 npm run build
|
|
132
|
+
|
|
133
|
+
# Via dashboard: Deployments > Redeploy > Uncheck "Use existing Build Cache"
|
|
134
|
+
```
|
|
135
|
+
</cache_issues>
|
|
136
|
+
</vercel_issues>
|
|
137
|
+
|
|
138
|
+
<github_actions_issues>
|
|
139
|
+
## GitHub Actions Failures
|
|
140
|
+
|
|
141
|
+
<artifact_issues>
|
|
142
|
+
### Artifact Issues
|
|
143
|
+
**Symptoms:**
|
|
144
|
+
- "no valid artifacts found to download"
|
|
145
|
+
- Artifact expired
|
|
146
|
+
- Wrong artifact downloaded
|
|
147
|
+
|
|
148
|
+
**Solutions:**
|
|
149
|
+
```bash
|
|
150
|
+
# List artifacts for a run
|
|
151
|
+
gh api repos/{owner}/{repo}/actions/runs/{run_id}/artifacts
|
|
152
|
+
|
|
153
|
+
# Check artifact name exactly
|
|
154
|
+
gh run view <run-id> --json artifacts -q '.artifacts[].name'
|
|
155
|
+
|
|
156
|
+
# Download from specific run (not latest)
|
|
157
|
+
gh run download <run-id> -n "exact-artifact-name"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Common causes:**
|
|
161
|
+
- Artifact name mismatch (case sensitive)
|
|
162
|
+
- Artifact expired (default 90 days)
|
|
163
|
+
- Downloading from wrong workflow run
|
|
164
|
+
- Matrix jobs uploading to same artifact name
|
|
165
|
+
</artifact_issues>
|
|
166
|
+
|
|
167
|
+
<permission_issues>
|
|
168
|
+
### Permission Denied
|
|
169
|
+
**Symptoms:**
|
|
170
|
+
- "Resource not accessible by integration"
|
|
171
|
+
- "Permission denied"
|
|
172
|
+
- 403 errors
|
|
173
|
+
|
|
174
|
+
**Solutions:**
|
|
175
|
+
```yaml
|
|
176
|
+
# Add permissions to workflow
|
|
177
|
+
jobs:
|
|
178
|
+
build:
|
|
179
|
+
permissions:
|
|
180
|
+
contents: read
|
|
181
|
+
packages: write
|
|
182
|
+
actions: read
|
|
183
|
+
|
|
184
|
+
# For GITHUB_TOKEN in workflow_run events
|
|
185
|
+
permissions:
|
|
186
|
+
actions: read
|
|
187
|
+
checks: write
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Check token permissions:**
|
|
191
|
+
```bash
|
|
192
|
+
gh auth status
|
|
193
|
+
gh api user
|
|
194
|
+
```
|
|
195
|
+
</permission_issues>
|
|
196
|
+
|
|
197
|
+
<timeout_issues>
|
|
198
|
+
### Job Timeout
|
|
199
|
+
**Symptoms:**
|
|
200
|
+
- Job cancelled after timeout
|
|
201
|
+
- "The job running on runner xxx has exceeded the maximum execution time"
|
|
202
|
+
|
|
203
|
+
**Solutions:**
|
|
204
|
+
```yaml
|
|
205
|
+
jobs:
|
|
206
|
+
build:
|
|
207
|
+
timeout-minutes: 60 # Increase timeout (max 360 for private repos)
|
|
208
|
+
steps:
|
|
209
|
+
- name: Long step
|
|
210
|
+
timeout-minutes: 30 # Per-step timeout
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Prevention:**
|
|
214
|
+
- Add step timeouts for flaky operations
|
|
215
|
+
- Use matrix to parallelize
|
|
216
|
+
- Cache dependencies
|
|
217
|
+
</timeout_issues>
|
|
218
|
+
|
|
219
|
+
<cache_gh_issues>
|
|
220
|
+
### Cache Issues
|
|
221
|
+
**Symptoms:**
|
|
222
|
+
- Cache miss every time
|
|
223
|
+
- "Cache not found for key"
|
|
224
|
+
- Stale cache
|
|
225
|
+
|
|
226
|
+
**Debug:**
|
|
227
|
+
```bash
|
|
228
|
+
# List caches
|
|
229
|
+
gh cache list
|
|
230
|
+
gh cache list --json id,key,createdAt,sizeInBytes
|
|
231
|
+
|
|
232
|
+
# Delete specific cache
|
|
233
|
+
gh cache delete <cache-id>
|
|
234
|
+
|
|
235
|
+
# Delete all caches
|
|
236
|
+
gh cache delete --all
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Common causes:**
|
|
240
|
+
- Cache key changes (dependency lockfile hash)
|
|
241
|
+
- Cache evicted (7 day limit, 10GB total)
|
|
242
|
+
- Different runner OS than cached
|
|
243
|
+
</cache_gh_issues>
|
|
244
|
+
|
|
245
|
+
<checkout_issues>
|
|
246
|
+
### Checkout Issues
|
|
247
|
+
**Symptoms:**
|
|
248
|
+
- "fatal: reference is not a tree"
|
|
249
|
+
- Wrong commit checked out
|
|
250
|
+
- Missing files
|
|
251
|
+
|
|
252
|
+
**Solutions:**
|
|
253
|
+
```yaml
|
|
254
|
+
- uses: actions/checkout@v4
|
|
255
|
+
with:
|
|
256
|
+
fetch-depth: 0 # Full history
|
|
257
|
+
ref: ${{ github.event.pull_request.head.sha }} # Exact commit
|
|
258
|
+
submodules: recursive # Include submodules
|
|
259
|
+
```
|
|
260
|
+
</checkout_issues>
|
|
261
|
+
|
|
262
|
+
<workflow_run_issues>
|
|
263
|
+
### Workflow Run Event Issues
|
|
264
|
+
**Symptoms:**
|
|
265
|
+
- workflow_run not triggering
|
|
266
|
+
- Can't download artifacts from triggering workflow
|
|
267
|
+
|
|
268
|
+
**Solutions:**
|
|
269
|
+
```yaml
|
|
270
|
+
# Correct workflow_run setup
|
|
271
|
+
on:
|
|
272
|
+
workflow_run:
|
|
273
|
+
workflows: ["CI"] # Exact name from triggering workflow
|
|
274
|
+
types: [completed]
|
|
275
|
+
|
|
276
|
+
# Download artifacts from triggering workflow
|
|
277
|
+
- uses: dawidd6/action-download-artifact@v2
|
|
278
|
+
with:
|
|
279
|
+
workflow: ci.yml
|
|
280
|
+
run_id: ${{ github.event.workflow_run.id }}
|
|
281
|
+
```
|
|
282
|
+
</workflow_run_issues>
|
|
283
|
+
</github_actions_issues>
|
|
284
|
+
|
|
285
|
+
<debugging_scripts>
|
|
286
|
+
## Debugging Scripts
|
|
287
|
+
|
|
288
|
+
### Save All CI State
|
|
289
|
+
```bash
|
|
290
|
+
#!/bin/bash
|
|
291
|
+
PROJECT="${1:-$(basename $(pwd))}"
|
|
292
|
+
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
|
293
|
+
OUTPUT="/tmp/$PROJECT/ci-debug-$TIMESTAMP"
|
|
294
|
+
mkdir -p $OUTPUT
|
|
295
|
+
|
|
296
|
+
echo "Collecting CI state..."
|
|
297
|
+
|
|
298
|
+
# Vercel state
|
|
299
|
+
mkdir -p $OUTPUT/vercel
|
|
300
|
+
vercel ls --output json > $OUTPUT/vercel/deployments.json 2>/dev/null
|
|
301
|
+
vercel env ls > $OUTPUT/vercel/env-vars.txt 2>/dev/null
|
|
302
|
+
|
|
303
|
+
# GitHub state
|
|
304
|
+
mkdir -p $OUTPUT/github
|
|
305
|
+
gh run list --limit 20 --json databaseId,status,conclusion,name,headBranch,createdAt > $OUTPUT/github/runs.json
|
|
306
|
+
|
|
307
|
+
# Get latest failure
|
|
308
|
+
FAILED=$(jq -r '[.[] | select(.conclusion=="failure")][0].databaseId // empty' $OUTPUT/github/runs.json)
|
|
309
|
+
if [ -n "$FAILED" ]; then
|
|
310
|
+
echo "Getting logs for failed run: $FAILED"
|
|
311
|
+
gh run view $FAILED --log-failed > $OUTPUT/github/failed-logs.txt 2>&1
|
|
312
|
+
gh run download $FAILED --dir $OUTPUT/github/artifacts 2>/dev/null
|
|
313
|
+
fi
|
|
314
|
+
|
|
315
|
+
# Git state
|
|
316
|
+
git log --oneline -10 > $OUTPUT/git-log.txt
|
|
317
|
+
git status > $OUTPUT/git-status.txt
|
|
318
|
+
git branch -a > $OUTPUT/git-branches.txt
|
|
319
|
+
|
|
320
|
+
echo "CI state saved to: $OUTPUT"
|
|
321
|
+
ls -la $OUTPUT
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Compare Two Deployments
|
|
325
|
+
```bash
|
|
326
|
+
#!/bin/bash
|
|
327
|
+
DEPLOY1="$1"
|
|
328
|
+
DEPLOY2="$2"
|
|
329
|
+
OUTPUT="/tmp/compare-deployments"
|
|
330
|
+
mkdir -p $OUTPUT
|
|
331
|
+
|
|
332
|
+
vercel inspect $DEPLOY1 > $OUTPUT/deploy1.txt
|
|
333
|
+
vercel inspect $DEPLOY2 > $OUTPUT/deploy2.txt
|
|
334
|
+
|
|
335
|
+
diff $OUTPUT/deploy1.txt $OUTPUT/deploy2.txt > $OUTPUT/diff.txt
|
|
336
|
+
|
|
337
|
+
echo "Differences:"
|
|
338
|
+
cat $OUTPUT/diff.txt
|
|
339
|
+
```
|
|
340
|
+
</debugging_scripts>
|
|
341
|
+
|
|
342
|
+
<quick_fixes>
|
|
343
|
+
## Quick Fix Checklist
|
|
344
|
+
|
|
345
|
+
### Vercel Build Failed
|
|
346
|
+
- [ ] Pull latest env: `vercel pull`
|
|
347
|
+
- [ ] Build locally: `vercel build --debug`
|
|
348
|
+
- [ ] Check error in logs (look for red text)
|
|
349
|
+
- [ ] Try force deploy: `vercel deploy --force`
|
|
350
|
+
|
|
351
|
+
### GitHub Action Failed
|
|
352
|
+
- [ ] View failed logs: `gh run view <id> --log-failed`
|
|
353
|
+
- [ ] Re-run with debug: `gh run rerun <id> --debug`
|
|
354
|
+
- [ ] Check permissions in workflow file
|
|
355
|
+
- [ ] Verify secrets are set: `gh secret list`
|
|
356
|
+
|
|
357
|
+
### Both Failing
|
|
358
|
+
- [ ] Check if recent code change broke build
|
|
359
|
+
- [ ] Verify dependencies: `npm ci` locally
|
|
360
|
+
- [ ] Check for env var differences
|
|
361
|
+
- [ ] Review recent changes: `git diff HEAD~5`
|
|
362
|
+
</quick_fixes>
|