@erclx/aitk 0.8.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 +99 -0
- package/claude/.claude-plugin/plugin.json +19 -0
- package/claude/skills/bash-script/SKILL.md +96 -0
- package/claude/skills/bash-script/references/patterns.md +349 -0
- package/claude/skills/ci-workflow/SKILL.md +52 -0
- package/claude/skills/ci-workflow/references/workflows.md +74 -0
- package/claude/skills/claude-address-review/SKILL.md +107 -0
- package/claude/skills/claude-autoship/SKILL.md +137 -0
- package/claude/skills/claude-design-extract/SKILL.md +69 -0
- package/claude/skills/claude-design-propose/SKILL.md +75 -0
- package/claude/skills/claude-diagram/SKILL.md +126 -0
- package/claude/skills/claude-docs/SKILL.md +204 -0
- package/claude/skills/claude-feature/REQUIREMENT.md +35 -0
- package/claude/skills/claude-feature/SKILL.md +148 -0
- package/claude/skills/claude-groundwork/SKILL.md +148 -0
- package/claude/skills/claude-groundwork/references/folder-format.md +107 -0
- package/claude/skills/claude-memory-capture/SKILL.md +80 -0
- package/claude/skills/claude-memory-review/REQUIREMENT.md +37 -0
- package/claude/skills/claude-memory-review/SKILL.md +206 -0
- package/claude/skills/claude-orchestrate/SKILL.md +125 -0
- package/claude/skills/claude-pr-review/SKILL.md +150 -0
- package/claude/skills/claude-review/SKILL.md +136 -0
- package/claude/skills/claude-roadmap/SKILL.md +61 -0
- package/claude/skills/claude-roadmap/references/roadmap.md +52 -0
- package/claude/skills/claude-screencast/SKILL.md +160 -0
- package/claude/skills/claude-seed-sync/SKILL.md +141 -0
- package/claude/skills/claude-slides-draft/SKILL.md +62 -0
- package/claude/skills/claude-standards-audit/REQUIREMENT.md +33 -0
- package/claude/skills/claude-standards-audit/SKILL.md +79 -0
- package/claude/skills/claude-standards-audit/references/branch.md +49 -0
- package/claude/skills/claude-standards-audit/references/pr.md +124 -0
- package/claude/skills/claude-tasks/SKILL.md +123 -0
- package/claude/skills/claude-ui-test/SKILL.md +75 -0
- package/claude/skills/claude-ux-audit/SKILL.md +78 -0
- package/claude/skills/claude-worktree/SKILL.md +79 -0
- package/claude/skills/cli-script/SKILL.md +47 -0
- package/claude/skills/cli-script/references/template.md +43 -0
- package/claude/skills/create-rule/SKILL.md +68 -0
- package/claude/skills/create-skill/REQUIREMENT.md +30 -0
- package/claude/skills/create-skill/SKILL.md +24 -0
- package/claude/skills/create-snippet/SKILL.md +28 -0
- package/claude/skills/create-snippet/references/snippets.md +57 -0
- package/claude/skills/create-standard/SKILL.md +31 -0
- package/claude/skills/create-standard/references/standard.md +52 -0
- package/claude/skills/docs-sync/SKILL.md +87 -0
- package/claude/skills/git-branch/REQUIREMENT.md +38 -0
- package/claude/skills/git-branch/SKILL.md +60 -0
- package/claude/skills/git-branch/references/branch.md +49 -0
- package/claude/skills/git-commit/REQUIREMENT.md +33 -0
- package/claude/skills/git-commit/SKILL.md +51 -0
- package/claude/skills/git-commit/references/commit.md +63 -0
- package/claude/skills/git-followup/REQUIREMENT.md +38 -0
- package/claude/skills/git-followup/SKILL.md +35 -0
- package/claude/skills/git-issue/REQUIREMENT.md +38 -0
- package/claude/skills/git-issue/SKILL.md +69 -0
- package/claude/skills/git-issue/references/issue.md +84 -0
- package/claude/skills/git-pr/REQUIREMENT.md +37 -0
- package/claude/skills/git-pr/SKILL.md +119 -0
- package/claude/skills/git-pr/references/branch.md +49 -0
- package/claude/skills/git-pr/references/pr.md +124 -0
- package/claude/skills/git-ship/REQUIREMENT.md +34 -0
- package/claude/skills/git-ship/SKILL.md +39 -0
- package/claude/skills/git-split/REQUIREMENT.md +38 -0
- package/claude/skills/git-split/SKILL.md +160 -0
- package/claude/skills/git-split/references/branch.md +49 -0
- package/claude/skills/git-split/references/pr.md +124 -0
- package/claude/skills/git-stage/REQUIREMENT.md +36 -0
- package/claude/skills/git-stage/SKILL.md +74 -0
- package/claude/skills/git-stage/references/commit.md +63 -0
- package/claude/skills/git-worktree/REQUIREMENT.md +37 -0
- package/claude/skills/git-worktree/SKILL.md +120 -0
- package/claude/skills/migration-claude-md/SKILL.md +74 -0
- package/claude/skills/migration-context/SKILL.md +93 -0
- package/claude/skills/migration-standards/SKILL.md +75 -0
- package/claude/skills/project-commands/SKILL.md +73 -0
- package/claude/skills/session-resume/SKILL.md +36 -0
- package/claude/skills/setup-gov/SKILL.md +71 -0
- package/claude/skills/setup-indexes/SKILL.md +148 -0
- package/claude/skills/setup-init/SKILL.md +114 -0
- package/claude/skills/setup-plugins/SKILL.md +81 -0
- package/claude/skills/setup-plugins/references/plugin-catalog.md +53 -0
- package/claude/skills/setup-verify/SKILL.md +51 -0
- package/claude/skills/systematic-debugging/SKILL.md +70 -0
- package/claude/skills/toolkit-cli/SKILL.md +38 -0
- package/claude/skills/toolkit-feedback/SKILL.md +80 -0
- package/claude/skills/toolkit-operator/SKILL.md +45 -0
- package/claude/skills/toolkit-triage/SKILL.md +63 -0
- package/claude/skills/youtube-transcripts/SKILL.md +34 -0
- package/docs/agents.md +371 -0
- package/docs/ai-workflow.md +157 -0
- package/docs/index.md +20 -0
- package/docs/operating-model.md +106 -0
- package/docs/target-projects.md +183 -0
- package/docs/visual-design-workflow.md +136 -0
- package/docs/zshrc-aliases.md +65 -0
- package/governance/rules/claude/500-prose.md +12 -0
- package/governance/rules/claude/510-context.md +16 -0
- package/governance/rules/claude/520-wireframes.md +12 -0
- package/governance/rules/claude/530-requirements.md +11 -0
- package/governance/rules/claude/540-architecture.md +11 -0
- package/governance/rules/claude/550-design.md +11 -0
- package/governance/rules/claude/555-tasks.md +12 -0
- package/governance/rules/claude/560-diagrams.md +11 -0
- package/governance/rules/claude/570-skill.md +18 -0
- package/governance/rules/claude/580-readme.md +11 -0
- package/governance/rules/claude/590-rule-authoring.md +12 -0
- package/governance/rules/core/000-constitution.md +30 -0
- package/governance/rules/core/010-testing.md +35 -0
- package/governance/rules/core/020-concurrency.md +22 -0
- package/governance/rules/core/030-error-handling.md +31 -0
- package/governance/rules/core/040-performance.md +20 -0
- package/governance/rules/core/050-logging.md +20 -0
- package/governance/rules/core/060-naming.md +19 -0
- package/governance/rules/core/070-planning.md +13 -0
- package/governance/rules/core/080-config-comments.md +22 -0
- package/governance/rules/framework/200-react.md +51 -0
- package/governance/rules/framework/210-astro.md +41 -0
- package/governance/rules/framework/220-fastapi.md +43 -0
- package/governance/rules/framework/230-nextjs.md +48 -0
- package/governance/rules/framework/250-tailwind.md +32 -0
- package/governance/rules/framework/260-shadcn.md +34 -0
- package/governance/rules/lang/100-typescript.md +40 -0
- package/governance/rules/lang/110-python.md +42 -0
- package/governance/rules/lib/300-testing-ts.md +38 -0
- package/governance/rules/lib/310-zod.md +25 -0
- package/governance/rules/lib/320-tanstack-query.md +32 -0
- package/governance/rules/lib/330-testing-py.md +44 -0
- package/governance/rules/lib/340-pydantic.md +38 -0
- package/governance/rules/lib/350-security-web.md +31 -0
- package/governance/rules/ui/400-ui.md +34 -0
- package/governance/rules/ui/410-a11y.md +44 -0
- package/governance/rules/ui/420-forms.md +34 -0
- package/governance/rules/ui/430-ux-completeness.md +62 -0
- package/governance/stacks/astro.toml +2 -0
- package/governance/stacks/base.toml +2 -0
- package/governance/stacks/node.toml +2 -0
- package/governance/stacks/python-fastapi.toml +2 -0
- package/governance/stacks/python.toml +2 -0
- package/governance/stacks/react.toml +2 -0
- package/package.json +67 -0
- package/scripts/config.sh +11 -0
- package/scripts/core/bootstrap.sh +81 -0
- package/scripts/core/check-plugin-boundary.sh +45 -0
- package/scripts/core/check-skill-paths.sh +25 -0
- package/scripts/core/clean.sh +36 -0
- package/scripts/core/install-check.sh +93 -0
- package/scripts/core/regen-claude-copies.sh +26 -0
- package/scripts/core/regen-indexes.sh +10 -0
- package/scripts/core/regen-skill-references.sh +27 -0
- package/scripts/core/snapshot.sh +132 -0
- package/scripts/core/update.sh +35 -0
- package/scripts/core/verify.sh +201 -0
- package/scripts/docs/list.sh +129 -0
- package/scripts/gov/list.sh +234 -0
- package/scripts/lib/frontmatter.sh +30 -0
- package/scripts/lib/gov.sh +14 -0
- package/scripts/lib/sandbox-fixtures.sh +109 -0
- package/scripts/lib/sandbox-git.sh +73 -0
- package/scripts/lib/tooling.sh +24 -0
- package/scripts/lib/ui.sh +173 -0
- package/scripts/lib/worktree.sh +20 -0
- package/scripts/manage-sandbox.sh +453 -0
- package/scripts/snippets/create.sh +156 -0
- package/scripts/standards/list.sh +91 -0
- package/scripts/tooling/create.sh +109 -0
- package/scripts/tooling/ref.sh +141 -0
- package/scripts/tooling/verify.sh +179 -0
- package/snippets/claude/decision-memo.md +39 -0
- package/snippets/claude/feature-recap.md +19 -0
- package/snippets/claude/figma-steps.md +18 -0
- package/snippets/claude/orchestrator-resume.md +23 -0
- package/snippets/claude/orchestrator-sweep.md +10 -0
- package/snippets/compact-summary.md +5 -0
- package/snippets/create-snippet.md +7 -0
- package/snippets/decision-help.md +6 -0
- package/snippets/meta-prompt.md +14 -0
- package/snippets/research-prompt.md +7 -0
- package/snippets/session-notes.md +11 -0
- package/snippets/snippets.toml +6 -0
- package/snippets/step-by-step.md +10 -0
- package/snippets/web-research.md +21 -0
- package/src/claude/gitignore.ts +51 -0
- package/src/claude/seeds-list.ts +47 -0
- package/src/claude/seeds.ts +124 -0
- package/src/claude/settings.ts +151 -0
- package/src/cli-run.ts +43 -0
- package/src/cli.ts +111 -0
- package/src/commands/claude.ts +349 -0
- package/src/commands/design.ts +39 -0
- package/src/commands/docs.ts +59 -0
- package/src/commands/feedback-format.ts +23 -0
- package/src/commands/feedback.ts +103 -0
- package/src/commands/gov.ts +268 -0
- package/src/commands/indexes.ts +182 -0
- package/src/commands/init.ts +117 -0
- package/src/commands/pass-through.ts +39 -0
- package/src/commands/sandbox.ts +315 -0
- package/src/commands/slides.ts +106 -0
- package/src/commands/snippets.ts +236 -0
- package/src/commands/standards.ts +89 -0
- package/src/commands/sync.ts +211 -0
- package/src/commands/tasks.ts +185 -0
- package/src/commands/tooling.ts +432 -0
- package/src/commands/transcripts.ts +48 -0
- package/src/commands/wiki.ts +101 -0
- package/src/copy.ts +30 -0
- package/src/design/parse.ts +79 -0
- package/src/design/render.ts +170 -0
- package/src/docs/read.ts +59 -0
- package/src/exec.ts +17 -0
- package/src/frontmatter.ts +13 -0
- package/src/github-format.ts +13 -0
- package/src/github.ts +20 -0
- package/src/gov/adapter.ts +73 -0
- package/src/gov/install.ts +103 -0
- package/src/gov/payload.ts +39 -0
- package/src/gov/stacks.ts +124 -0
- package/src/indexes/frontmatter.ts +46 -0
- package/src/indexes/regen.ts +84 -0
- package/src/indexes/render.ts +181 -0
- package/src/indexes/walk.ts +111 -0
- package/src/init/flags.ts +66 -0
- package/src/init/plan.ts +128 -0
- package/src/init/run.ts +46 -0
- package/src/init/steps.ts +91 -0
- package/src/sandbox/coverage.ts +115 -0
- package/src/sandbox/expect.ts +412 -0
- package/src/slides/layouts.ts +391 -0
- package/src/slides/open.ts +18 -0
- package/src/slides/parse.ts +84 -0
- package/src/slides/render.ts +88 -0
- package/src/slides/styles.ts +44 -0
- package/src/snippets/adapter.ts +34 -0
- package/src/snippets/categories.ts +59 -0
- package/src/snippets/install.ts +125 -0
- package/src/snippets/list.ts +32 -0
- package/src/snippets/presets.ts +50 -0
- package/src/standards/adapter.ts +51 -0
- package/src/standards/index-refresh.ts +44 -0
- package/src/standards/install.ts +52 -0
- package/src/sync/check.ts +269 -0
- package/src/sync/engine.ts +416 -0
- package/src/sync/git.ts +204 -0
- package/src/sync/stamp.ts +202 -0
- package/src/sync/target.ts +79 -0
- package/src/sync/workflow.ts +201 -0
- package/src/target.ts +43 -0
- package/src/tasks/archive.ts +304 -0
- package/src/tooling/gitignore.ts +122 -0
- package/src/tooling/inject.ts +214 -0
- package/src/tooling/list.ts +39 -0
- package/src/tooling/manifest.ts +178 -0
- package/src/tooling/package.ts +166 -0
- package/src/tooling/scan.ts +186 -0
- package/src/transcripts/fetch.ts +156 -0
- package/src/transcripts/metadata.ts +54 -0
- package/src/transcripts/vtt.ts +114 -0
- package/src/ui.ts +187 -0
- package/src/wiki/init.ts +85 -0
- package/standards/architecture.md +41 -0
- package/standards/bundled/branch.md +49 -0
- package/standards/bundled/commit.md +63 -0
- package/standards/bundled/issue.md +84 -0
- package/standards/bundled/pr.md +124 -0
- package/standards/bundled/roadmap.md +52 -0
- package/standards/bundled/snippets.md +57 -0
- package/standards/bundled/standard.md +52 -0
- package/standards/context.md +132 -0
- package/standards/design.md +31 -0
- package/standards/diagrams.md +55 -0
- package/standards/index.md +21 -0
- package/standards/prose.md +122 -0
- package/standards/readme.md +163 -0
- package/standards/requirements.md +61 -0
- package/standards/rule.md +79 -0
- package/standards/skill.md +257 -0
- package/standards/tasks.md +140 -0
- package/standards/versioning.md +47 -0
- package/standards/wireframes.md +67 -0
- package/tooling/astro/configs/astro.config.mjs +17 -0
- package/tooling/astro/configs/eslint.config.js +79 -0
- package/tooling/astro/configs/playwright.config.ts +25 -0
- package/tooling/astro/configs/tsconfig.json +12 -0
- package/tooling/astro/configs/vitest.config.ts +22 -0
- package/tooling/astro/manifest.toml +32 -0
- package/tooling/astro/reference.md +60 -0
- package/tooling/base/configs/.editorconfig +5 -0
- package/tooling/base/configs/.github/pull_request_template.md +18 -0
- package/tooling/base/configs/.github/workflows/verify.yml +35 -0
- package/tooling/base/configs/.husky/commit-msg +1 -0
- package/tooling/base/configs/.husky/post-merge +61 -0
- package/tooling/base/configs/.husky/post-rewrite +21 -0
- package/tooling/base/configs/.husky/pre-commit +1 -0
- package/tooling/base/configs/.husky/pre-push +1 -0
- package/tooling/base/configs/.prettierrc +12 -0
- package/tooling/base/configs/.shellcheckrc +1 -0
- package/tooling/base/configs/.vscode/extensions.json +9 -0
- package/tooling/base/configs/.vscode/settings.json +3 -0
- package/tooling/base/configs/commitlint.config.js +11 -0
- package/tooling/base/configs/scripts/clean.sh +45 -0
- package/tooling/base/configs/scripts/update.sh +49 -0
- package/tooling/base/configs/scripts/verify.sh +64 -0
- package/tooling/base/manifest.toml +32 -0
- package/tooling/base/reference.md +114 -0
- package/tooling/base/seeds/.claude/context/ci.md +27 -0
- package/tooling/base/seeds/.claude/context/development.md +32 -0
- package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
- package/tooling/base/seeds/.cspell/tech-stack.txt +19 -0
- package/tooling/base/seeds/.lintstagedrc +8 -0
- package/tooling/base/seeds/.prettierignore +0 -0
- package/tooling/base/seeds/cspell.json +20 -0
- package/tooling/claude/manifest.toml +11 -0
- package/tooling/claude/reference.md +62 -0
- package/tooling/claude/seeds/.claude/ARCHITECTURE.md +13 -0
- package/tooling/claude/seeds/.claude/DESIGN.md +62 -0
- package/tooling/claude/seeds/.claude/REQUIREMENTS.md +18 -0
- package/tooling/claude/seeds/.claude/context/index.md +8 -0
- package/tooling/claude/seeds/.claude/hooks/index-reminder.sh +43 -0
- package/tooling/claude/seeds/.claude/hooks/scratch-guard.sh +45 -0
- package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +61 -0
- package/tooling/claude/seeds/.claude/hooks/tasks-index.sh +60 -0
- package/tooling/claude/seeds/.claude/settings.json +39 -0
- package/tooling/claude/seeds/.claude/tasks/index.md +8 -0
- package/tooling/claude/seeds/.claude/wireframes/index.md +8 -0
- package/tooling/claude/seeds/CLAUDE.md +87 -0
- package/tooling/claude/user/settings.template.json +10 -0
- package/tooling/claude/user/statusline-command.sh +53 -0
- package/tooling/python/configs/.coveragerc +14 -0
- package/tooling/python/configs/.python-version +1 -0
- package/tooling/python/configs/mypy.ini +6 -0
- package/tooling/python/configs/pytest.ini +4 -0
- package/tooling/python/configs/ruff.toml +15 -0
- package/tooling/python/configs/scripts/verify.sh +77 -0
- package/tooling/python/manifest.toml +16 -0
- package/tooling/python/reference.md +66 -0
- package/tooling/python/seeds/.cspell/tech-stack.txt +19 -0
- package/tooling/python/seeds/tests/test_smoke.py +2 -0
- package/tooling/vite-react/configs/playwright.config.ts +25 -0
- package/tooling/vite-react/configs/tsconfig.json +35 -0
- package/tooling/vite-react/configs/vite.config.ts +14 -0
- package/tooling/vite-react/configs/vitest.config.ts +26 -0
- package/tooling/vite-react/manifest.toml +21 -0
- package/tooling/vite-react/reference.md +55 -0
- package/tooling/vite-react/seeds/.cspell/project-terms.txt +1 -0
- package/tooling/vite-react/seeds/.cspell/tech-stack.txt +1 -0
- package/tooling/web/configs/.github/workflows/verify.yml +134 -0
- package/tooling/web/configs/.vscode/extensions.json +13 -0
- package/tooling/web/configs/.vscode/settings.json +10 -0
- package/tooling/web/configs/e2e/home.spec.ts +6 -0
- package/tooling/web/configs/e2e/screenshot.ts +41 -0
- package/tooling/web/configs/eslint.config.js +82 -0
- package/tooling/web/configs/scripts/screenshot.sh +28 -0
- package/tooling/web/configs/scripts/verify.sh +80 -0
- package/tooling/web/configs/src/test/setup.ts +8 -0
- package/tooling/web/manifest.toml +57 -0
- package/tooling/web/reference.md +95 -0
- package/tooling/web/seeds/.cspell/tech-stack.txt +18 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Eric Le
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# aitk
|
|
2
|
+
|
|
3
|
+
One source for your repos' AI conventions. Install once, sync everywhere.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Add the marketplace, then install the Claude Code plugin.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
claude plugin marketplace add https://github.com/erclx/aitk
|
|
13
|
+
claude plugin install aitk@aitk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The skills are then available as `/aitk:<name>`. Run `/reload-plugins` to pick them up inside a session that was already open. Updates arrive on release, so a push to this repo does not reach an installed copy.
|
|
17
|
+
|
|
18
|
+
Several skills call the `aitk` CLI to read catalogs and run installs, and the plugin does not put it on your path. Install it from the registry.
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bun install --global @erclx/aitk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
[Bun](https://bun.sh) is the CLI runtime and has to be on the path first. Confirm the install by resolving `aitk --help`.
|
|
25
|
+
|
|
26
|
+
## Why
|
|
27
|
+
|
|
28
|
+
Every AI coding setup accumulates the same assets. Prompts to reuse, rules agents should follow, slash commands, skills, seed docs, sync scripts. Across enough projects the copies drift, and agents stop getting consistent signals.
|
|
29
|
+
|
|
30
|
+
Three design choices shape the toolkit.
|
|
31
|
+
|
|
32
|
+
- Agent-first: every command has a non-interactive path and a JSON catalog. If a Claude Code skill or any other agent cannot drive the CLI without prompts, the design is wrong.
|
|
33
|
+
- Text-native: conventions, rules, and prompts are authored as markdown that humans and agents read the same way. No hidden behavior, no compiled state.
|
|
34
|
+
- One source, many consumers: this repo is the authoritative copy. Target projects install and sync on demand, never author in place.
|
|
35
|
+
|
|
36
|
+
## What is inside
|
|
37
|
+
|
|
38
|
+
Each domain has a canonical source in this repo and a thin install or sync CLI on the target side. The links run to internal narrative, written for someone maintaining the toolkit rather than installing it.
|
|
39
|
+
|
|
40
|
+
- [Claude Code plugin](.claude/context/claude-plugin.md): skills for planning, review, docs sync, and the git ship chain
|
|
41
|
+
- [Governance rules](.claude/context/governance.md): Cursor rules and stacks, installable per project
|
|
42
|
+
- [Standards](.claude/context/standards.md): shared authoring conventions, synced to projects
|
|
43
|
+
- [Snippets](.claude/context/snippets.md): reusable prompts for Claude and Gemini chat
|
|
44
|
+
- [Tooling stacks](.claude/context/tooling.md): golden configs, seeds, and references per framework
|
|
45
|
+
- [Design system](.claude/context/design.md): `DESIGN.md` token shape, extract skill, render command
|
|
46
|
+
- [Slides](.claude/context/slides.md): `SLIDES.md` source, layout catalog, render command, draft skill
|
|
47
|
+
- [Transcripts](.claude/context/transcripts.md): fetch a YouTube transcript with metadata frontmatter via `aitk transcripts`
|
|
48
|
+
- [Sandbox](.claude/context/sandbox.md): scenario-based scaffolds for verifying each domain flow
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
- [AI workflow](docs/ai-workflow.md): feature-development loop inside a toolkit-managed project
|
|
53
|
+
- [Operating model](docs/operating-model.md): orchestrator and worker roles for building across parallel sessions
|
|
54
|
+
- [Visual design workflow](docs/visual-design-workflow.md): tiered guide for design and wireframe authoring
|
|
55
|
+
- [Target projects](docs/target-projects.md): scaffold, add a domain later, sync upstream drift
|
|
56
|
+
- [Agents](docs/agents.md): CLI flags, exit codes, and JSON output shapes
|
|
57
|
+
- [Docs index](docs/index.md): every reference doc in this repo
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
Working on the toolkit starts from a clone. Running the CLI does not, since it installs from the registry.
|
|
62
|
+
|
|
63
|
+
### Prerequisites
|
|
64
|
+
|
|
65
|
+
- [Bun](https://bun.sh) for the CLI runtime and scripts
|
|
66
|
+
- [Git](https://git-scm.com) with worktree support
|
|
67
|
+
- [GitHub CLI](https://cli.github.com) (optional) for ship flows
|
|
68
|
+
- Shell: `zsh` or bash 4+ (`brew install bash` on macOS).
|
|
69
|
+
|
|
70
|
+
Clone the repo, then run the bootstrap script. It installs dependencies, links the CLI globally, and adds the Claude Code shell aliases to `~/.zshrc`.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/erclx/aitk.git
|
|
74
|
+
cd aitk
|
|
75
|
+
bun install
|
|
76
|
+
bun run bootstrap
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
The script is idempotent. Re-run it after pulling upstream changes without duplicating anything. It confirms the install by resolving `aitk --help` on the last step. See [zshrc aliases](docs/zshrc-aliases.md) for what each alias does.
|
|
80
|
+
|
|
81
|
+
With the CLI linked, scaffold a fresh project.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
mkdir ~/my-project && cd ~/my-project
|
|
85
|
+
git init
|
|
86
|
+
aitk init
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`aitk init` installs base tooling configs, Claude seeds, governance rules, standards, and snippets in one pass, and scaffolds a `.claude/wiki/` stub for the project's own reference pages. Governance defaults to the `base` stack, so a bare init lands the coding and doc-authoring rules in `.claude/rules/` alongside the standards they route to. Pass `--stack <name>` for a framework stack, or `--skip governance` to leave rules out. Run `aitk tooling list --json` to see the catalog.
|
|
90
|
+
|
|
91
|
+
For the full outsider journey (scaffold, add a domain later, sync upstream drift), see [target projects](docs/target-projects.md).
|
|
92
|
+
|
|
93
|
+
## Contributing
|
|
94
|
+
|
|
95
|
+
Portfolio project. Issues are welcome. Pull requests are accepted by invitation only. See the [contributing guidelines](CONTRIBUTING.md) for the local loop, the authoring split, and the commit convention.
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "aitk",
|
|
3
|
+
"description": "Automated governance, versioning, and discovery tools for Claude Code.",
|
|
4
|
+
"version": "0.8.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Eric Le",
|
|
7
|
+
"url": "https://github.com/erclx"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/erclx/aitk",
|
|
10
|
+
"repository": "https://github.com/erclx/aitk",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"governance",
|
|
14
|
+
"standards",
|
|
15
|
+
"skills",
|
|
16
|
+
"workflow",
|
|
17
|
+
"tooling"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bash-script
|
|
3
|
+
description: Generates production Bash scripts with a visual timeline UI, state-based interactive prompts, and strict error handling. Use when asked to write an interactive or human-facing bash or shell script, or a DevOps tool with framed terminal output. Do NOT use for a non-interactive automation, CI, or pipeline script, that is `cli-script`.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Bash script
|
|
7
|
+
|
|
8
|
+
Generate production-ready Bash scripts for DevOps and CLI workflows. Enforce strict formatting with a visual timeline UI and state-based interactivity.
|
|
9
|
+
|
|
10
|
+
Load `${CLAUDE_SKILL_DIR}/references/patterns.md` for the timeline lifecycle, logging, interactive prompt, help-screen, and full-script code templates. `${CLAUDE_SKILL_DIR}` expands to this skill's own directory, so the path resolves from any project. Copy those definitions verbatim, keeping only the colors and functions the script actually uses.
|
|
11
|
+
|
|
12
|
+
## Script setup
|
|
13
|
+
|
|
14
|
+
- Start with `#!/usr/bin/env bash`, `set -e`, and `set -o pipefail`.
|
|
15
|
+
- Bash 4+ features (namerefs, associative arrays) are allowed.
|
|
16
|
+
- Implement a visual help screen via `show_help` if the script accepts arguments.
|
|
17
|
+
- Do not rely on unset variables. Use `${VAR:-default}`.
|
|
18
|
+
|
|
19
|
+
## Visual timeline
|
|
20
|
+
|
|
21
|
+
- Maintain a vertical timeline (`│`) from `┌` to `└` throughout all output.
|
|
22
|
+
- Write all frame output (`┌`, `│`, `├`, `└`, log lines, prompts) to stderr via `>&2`. Write data (JSON, lists, piped values) to stdout. `--help` is the exception and prints to stdout.
|
|
23
|
+
- Open the timeline once at the start of `main()` via `open_timeline "Title"`, before any logic, prompts, or checks.
|
|
24
|
+
- Close the timeline via `trap close_timeline EXIT`, registered immediately after `open_timeline`.
|
|
25
|
+
- On success, disable with `trap - EXIT`, then print `└\n` and the success message manually.
|
|
26
|
+
- On cancellation and error, never print `└` manually. The trap owns those exits.
|
|
27
|
+
- Use state transitions for interactive prompts: `◆` active, `◇` inactive.
|
|
28
|
+
- Do not add diamonds (`◆` or `◇`) to non-interactive log functions.
|
|
29
|
+
- On cancellation, show `◇ ... Cancelled`, exit 1, and make no `log_error` call. Both `ask()` and `select_option()` handle escape cancellation identically.
|
|
30
|
+
- Guard interactive prompts against non-TTY stdin with `[ -t 0 ]` and render a framed `log_error` when a TTY is required but absent. Never let `read` block silently on piped input.
|
|
31
|
+
|
|
32
|
+
## Code style
|
|
33
|
+
|
|
34
|
+
- Decompose by responsibility: each function does one thing, `main()` orchestrates only.
|
|
35
|
+
- Name functions verb-first: `validate_input`, `deploy_service`, `install_dependencies`.
|
|
36
|
+
- Do not use global variables except exports from `ask()`.
|
|
37
|
+
- Do not define unused color variables.
|
|
38
|
+
- Do not include comments except the shebang line.
|
|
39
|
+
- Use sentence case for section headers and log messages. Proper nouns and product names retain their casing.
|
|
40
|
+
- Quote variables inside parameter expansions: `"${file#"$dir"/}"` not `"${file#$dir/}"`.
|
|
41
|
+
- Quote variables in test brackets: `[ "$i" -eq "$cur" ]` not `[ $i -eq $cur ]`.
|
|
42
|
+
- Guard commands that return non-zero on valid empty results: `grep ... || true`, `diff ... || true`.
|
|
43
|
+
|
|
44
|
+
## Output hygiene
|
|
45
|
+
|
|
46
|
+
- Show external tool output by default (git, npm, gh).
|
|
47
|
+
- Include context in error messages: `log_error "npm install failed: check package.json"`.
|
|
48
|
+
- Do not echo command names before running them. Output speaks for itself.
|
|
49
|
+
- Do not log "Starting..." and "Finished..." around every action.
|
|
50
|
+
- Do not log intermediate variable assignments.
|
|
51
|
+
- Use `log_add` for item writes (files created, entries added, keys written).
|
|
52
|
+
- Use `log_info` for status confirmations only ("up to date", "check passed").
|
|
53
|
+
- Use `log_warn` for drift, skipped states, or recoverable issues.
|
|
54
|
+
- Never use `log_info` for file or entry writes.
|
|
55
|
+
|
|
56
|
+
## Icon usage
|
|
57
|
+
|
|
58
|
+
Interactive prompts only:
|
|
59
|
+
|
|
60
|
+
- `◆` (green): active user input required
|
|
61
|
+
- `◇` (grey): completed input, transition via `\r\033[K` to rewrite the `◆` line in place
|
|
62
|
+
- `❯` (green): selected option in a menu
|
|
63
|
+
- plain text (grey): unselected option in a menu
|
|
64
|
+
|
|
65
|
+
Non-interactive logs:
|
|
66
|
+
|
|
67
|
+
- `├` section branch (`log_step`)
|
|
68
|
+
- `✓` (green): success (`log_info`)
|
|
69
|
+
- `!` (yellow): warning (`log_warn`)
|
|
70
|
+
- `✗` (red): error (`log_error`)
|
|
71
|
+
- `+` (green): add item (`log_add`)
|
|
72
|
+
- `-` (red): remove item (`log_rem`)
|
|
73
|
+
|
|
74
|
+
## Validation
|
|
75
|
+
|
|
76
|
+
Before responding, verify:
|
|
77
|
+
|
|
78
|
+
- File starts with `#!/usr/bin/env bash`, `set -e`, `set -o pipefail` and uses exactly 2 spaces for indentation.
|
|
79
|
+
- Timeline opens via `open_timeline "Title"`, which writes `┌` and `│ Title` to stderr.
|
|
80
|
+
- Timeline closes via `trap close_timeline EXIT` registered immediately after `open_timeline`. Success paths use `trap - EXIT` then manual `└\n` (to stderr) then the success message. Cancellation and error paths never print `└` manually.
|
|
81
|
+
- `open_timeline` and `close_timeline` are defined and write to stderr via `>&2`.
|
|
82
|
+
- All frame output (`│`, `├`, `└`, log lines, interactive prompts) writes to stderr via `>&2`. Stdout carries data only. `--help` is the exception.
|
|
83
|
+
- Interactive prompts (`ask`, `select_option`) guard with `[ -t 0 ]` and call `log_error` if stdin is not a TTY.
|
|
84
|
+
- The timeline (`│`) appears in all log functions, and interactive prompts use `◆` → `◇` transitions.
|
|
85
|
+
- `ask()` uses `\r\033[K` to rewrite the `◆` line in place, with no `\033[1A` cursor-up sequences.
|
|
86
|
+
- `ask()` drains trailing escape bytes with `read -rsn2 -t 0.001 _ || true` before cancelling.
|
|
87
|
+
- All log messages use sentence case (proper nouns and product names exempt).
|
|
88
|
+
- Only defined color variables are used in the script.
|
|
89
|
+
- Cancellation shows a single `◇ ... Cancelled` line without a subsequent `log_error`.
|
|
90
|
+
- Escape key in `ask()` triggers `◇ ... Cancelled` and exits, consistent with `select_option()`.
|
|
91
|
+
- Functions follow single responsibility: each does one thing, `main()` delegates to helpers.
|
|
92
|
+
- Logging is concise: no "Starting.../Finished..." bloat, no intermediate variable logging.
|
|
93
|
+
- `log_add` is used for all file, entry, and key writes.
|
|
94
|
+
- `log_info` is used for status confirmations only, not writes.
|
|
95
|
+
- Every section header uses `log_step`, including the first one after the title block.
|
|
96
|
+
- File ends with exactly one empty line.
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# Bash script patterns
|
|
2
|
+
|
|
3
|
+
Code templates for the `bash-script` skill. Copy verbatim, keeping only the colors and functions the script uses.
|
|
4
|
+
|
|
5
|
+
## Timeline structure
|
|
6
|
+
|
|
7
|
+
```plaintext
|
|
8
|
+
┌ # Start boundary (alone on its own line)
|
|
9
|
+
│ Title # Script or context title (immediately after ┌)
|
|
10
|
+
│ # Persistent vertical line (grey)
|
|
11
|
+
├ Section Branch # Section headers (no diamond)
|
|
12
|
+
│ ✓ Log message # Info/success logs
|
|
13
|
+
│ ! Warning # Warning logs
|
|
14
|
+
│ ✗ Error # Error logs
|
|
15
|
+
└ # End boundary
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Color palette
|
|
19
|
+
|
|
20
|
+
Define only the colors the script uses from this set:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
GREEN='\033[0;32m' # Success/Active
|
|
24
|
+
RED='\033[0;31m' # Error/Delete
|
|
25
|
+
YELLOW='\033[0;33m' # Warning
|
|
26
|
+
WHITE='\033[1;37m' # Active text
|
|
27
|
+
GREY='\033[0;90m' # Timeline/Inactive
|
|
28
|
+
CYAN='\033[0;36m' # Optional accent
|
|
29
|
+
MAGENTA='\033[0;35m' # Optional highlight
|
|
30
|
+
NC='\033[0m' # Reset
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Timeline lifecycle
|
|
34
|
+
|
|
35
|
+
Define `open_timeline` and `close_timeline`. Call `open_timeline "Title"` at the start of `main()`, then register `close_timeline` as the EXIT trap. The trap guarantees `└` prints on every exit path: normal completion, `exit 1` from cancellation, or unexpected errors. Do not print `└` manually anywhere else.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
open_timeline() {
|
|
39
|
+
echo -e "${GREY}┌${NC}" >&2
|
|
40
|
+
[ -n "${1:-}" ] && echo -e "${GREY}│${NC} ${WHITE}$1${NC}" >&2
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
close_timeline() {
|
|
44
|
+
echo -e "${GREY}└${NC}" >&2
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Register the trap inside `main()` right after opening:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
open_timeline "Script title"
|
|
52
|
+
trap close_timeline EXIT
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Logging
|
|
56
|
+
|
|
57
|
+
All log functions include the `│` prefix and write to stderr.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
log_info() { echo -e "${GREY}│${NC} ${GREEN}✓${NC} $1" >&2; }
|
|
61
|
+
log_warn() { echo -e "${GREY}│${NC} ${YELLOW}!${NC} $1" >&2; }
|
|
62
|
+
log_error() { echo -e "${GREY}│${NC} ${RED}✗${NC} $1" >&2; exit 1; }
|
|
63
|
+
log_step() { echo -e "${GREY}│${NC}\n${GREY}├${NC} ${WHITE}$1${NC}" >&2; }
|
|
64
|
+
log_add() { echo -e "${GREY}│${NC} ${GREEN}+${NC} $1" >&2; }
|
|
65
|
+
log_rem() { echo -e "${GREY}│${NC} ${RED}-${NC} $1" >&2; }
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Section headers
|
|
69
|
+
|
|
70
|
+
Use `log_step` for every section header, including the first. It emits a leading blank `│` line to separate the banner from the first section and to give breathing room between subsequent sections:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
open_timeline "Script title"
|
|
74
|
+
trap close_timeline EXIT
|
|
75
|
+
|
|
76
|
+
log_step "Deploy"
|
|
77
|
+
log_step "Verify"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Renders as:
|
|
81
|
+
|
|
82
|
+
```plaintext
|
|
83
|
+
┌
|
|
84
|
+
│ Script title
|
|
85
|
+
│
|
|
86
|
+
├ Deploy
|
|
87
|
+
...
|
|
88
|
+
│
|
|
89
|
+
├ Verify
|
|
90
|
+
...
|
|
91
|
+
└
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Interactive prompts
|
|
95
|
+
|
|
96
|
+
Both prompts transition `◆` to `◇`, guard against non-TTY stdin with `[ -t 0 ]`, and write UI to stderr.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
ask() {
|
|
100
|
+
local prompt_text=$1
|
|
101
|
+
local var_name=$2
|
|
102
|
+
local default_val=$3
|
|
103
|
+
local input=""
|
|
104
|
+
local char
|
|
105
|
+
local display_default=""
|
|
106
|
+
if [ -n "$default_val" ]; then
|
|
107
|
+
display_default=" (${default_val})"
|
|
108
|
+
fi
|
|
109
|
+
if [ ! -t 0 ]; then
|
|
110
|
+
log_error "${prompt_text} requires a TTY"
|
|
111
|
+
fi
|
|
112
|
+
echo -e "${GREY}│${NC}" >&2
|
|
113
|
+
echo -ne "${GREEN}◆${NC} ${prompt_text}${display_default} " >&2
|
|
114
|
+
while IFS= read -r -s -n1 char; do
|
|
115
|
+
if [[ $char == $'\x1b' ]]; then
|
|
116
|
+
read -rsn2 -t 0.001 _ || true
|
|
117
|
+
echo -ne "\r\033[K" >&2
|
|
118
|
+
echo -e "${GREY}◇${NC} ${prompt_text} ${RED}Cancelled${NC}" >&2
|
|
119
|
+
exit 1
|
|
120
|
+
elif [[ $char == $'\x7f' || $char == $'\x08' ]]; then
|
|
121
|
+
if [ -n "$input" ]; then
|
|
122
|
+
input="${input%?}"
|
|
123
|
+
echo -ne "\b \b" >&2
|
|
124
|
+
fi
|
|
125
|
+
elif [[ -z "$char" ]]; then
|
|
126
|
+
break
|
|
127
|
+
else
|
|
128
|
+
input+="$char"
|
|
129
|
+
echo -n "$char" >&2
|
|
130
|
+
fi
|
|
131
|
+
done
|
|
132
|
+
[ -z "$input" ] && input="$default_val"
|
|
133
|
+
echo -ne "\r\033[K" >&2
|
|
134
|
+
echo -e "${GREY}◇${NC} ${prompt_text} ${WHITE}${input}${NC}" >&2
|
|
135
|
+
export "$var_name"="$input"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
select_option() {
|
|
141
|
+
local prompt_text=$1
|
|
142
|
+
shift
|
|
143
|
+
local options=("$@")
|
|
144
|
+
local cur=0
|
|
145
|
+
local count=${#options[@]}
|
|
146
|
+
|
|
147
|
+
if [ ! -t 0 ]; then
|
|
148
|
+
log_error "${prompt_text} requires a TTY"
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
echo -ne "${GREY}│${NC}\n${GREEN}◆${NC} ${prompt_text}\n" >&2
|
|
152
|
+
|
|
153
|
+
while true; do
|
|
154
|
+
for i in "${!options[@]}"; do
|
|
155
|
+
if [ "$i" -eq "$cur" ]; then
|
|
156
|
+
echo -e "${GREY}│${NC} ${GREEN}❯ ${options[$i]}${NC}" >&2
|
|
157
|
+
else
|
|
158
|
+
echo -e "${GREY}│${NC} ${GREY}${options[$i]}${NC}" >&2
|
|
159
|
+
fi
|
|
160
|
+
done
|
|
161
|
+
|
|
162
|
+
read -rsn1 key
|
|
163
|
+
case "$key" in
|
|
164
|
+
$'\x1b')
|
|
165
|
+
if read -rsn2 -t 0.001 key_seq; then
|
|
166
|
+
if [[ "$key_seq" == "[A" ]]; then cur=$(( (cur - 1 + count) % count )); fi
|
|
167
|
+
if [[ "$key_seq" == "[B" ]]; then cur=$(( (cur + 1) % count )); fi
|
|
168
|
+
else
|
|
169
|
+
echo -en "\033[$((count + 1))A\033[J" >&2
|
|
170
|
+
echo -e "\033[1A${GREY}│${NC}\n${GREY}◇${NC} ${prompt_text} ${RED}Cancelled${NC}" >&2
|
|
171
|
+
exit 1
|
|
172
|
+
fi
|
|
173
|
+
;;
|
|
174
|
+
"k") cur=$(( (cur - 1 + count) % count ));;
|
|
175
|
+
"j") cur=$(( (cur + 1) % count ));;
|
|
176
|
+
"q")
|
|
177
|
+
echo -en "\033[$((count + 1))A\033[J" >&2
|
|
178
|
+
echo -e "\033[1A${GREY}│${NC}\n${GREY}◇${NC} ${prompt_text} ${RED}Cancelled${NC}" >&2
|
|
179
|
+
exit 1
|
|
180
|
+
;;
|
|
181
|
+
"") break ;;
|
|
182
|
+
esac
|
|
183
|
+
|
|
184
|
+
echo -en "\033[${count}A" >&2
|
|
185
|
+
done
|
|
186
|
+
|
|
187
|
+
echo -en "\033[$((count + 1))A\033[J" >&2
|
|
188
|
+
echo -e "\033[1A${GREY}│${NC}\n${GREY}◇${NC} ${prompt_text} ${WHITE}${options[$cur]}${NC}" >&2
|
|
189
|
+
SELECTED_OPTION="${options[$cur]}"
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Help system
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
show_help() {
|
|
197
|
+
echo -e "${GREY}┌${NC}"
|
|
198
|
+
echo -e "${GREY}├${NC} ${WHITE}Usage:${NC} ./script.sh [options]"
|
|
199
|
+
echo -e "${GREY}│${NC}"
|
|
200
|
+
echo -e "${GREY}│${NC} ${WHITE}Options:${NC}"
|
|
201
|
+
echo -e "${GREY}│${NC} -h, --help ${GREY}# Show this help message${NC}"
|
|
202
|
+
echo -e "${GREY}│${NC} [flag] ${GREY}# [Description]${NC}"
|
|
203
|
+
echo -e "${GREY}└${NC}"
|
|
204
|
+
exit 0
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Error handling helper
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
run_check() {
|
|
212
|
+
local cmd=$1
|
|
213
|
+
local err_msg=$2
|
|
214
|
+
if ! eval "$cmd"; then
|
|
215
|
+
log_error "$err_msg"
|
|
216
|
+
fi
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Full script structure
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
#!/usr/bin/env bash
|
|
224
|
+
set -e
|
|
225
|
+
set -o pipefail
|
|
226
|
+
|
|
227
|
+
[Color definitions - only used colors]
|
|
228
|
+
|
|
229
|
+
[Function definitions - only needed functions]
|
|
230
|
+
|
|
231
|
+
open_timeline() {
|
|
232
|
+
echo -e "${GREY}┌${NC}" >&2
|
|
233
|
+
[ -n "${1:-}" ] && echo -e "${GREY}│${NC} ${WHITE}$1${NC}" >&2
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
close_timeline() {
|
|
237
|
+
echo -e "${GREY}└${NC}" >&2
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
check_dependencies() {
|
|
241
|
+
[Verify required tools installed]
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
main() {
|
|
245
|
+
check_dependencies
|
|
246
|
+
|
|
247
|
+
open_timeline "Script title"
|
|
248
|
+
trap close_timeline EXIT
|
|
249
|
+
|
|
250
|
+
log_step "First section"
|
|
251
|
+
[Script logic with timeline maintained]
|
|
252
|
+
|
|
253
|
+
trap - EXIT
|
|
254
|
+
echo -e "${GREY}└${NC}\n" >&2
|
|
255
|
+
echo -e "${GREEN}✓ Final success message${NC}"
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
main "$@"
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Worked example
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
#!/usr/bin/env bash
|
|
265
|
+
set -e
|
|
266
|
+
set -o pipefail
|
|
267
|
+
|
|
268
|
+
GREEN='\033[0;32m'
|
|
269
|
+
RED='\033[0;31m'
|
|
270
|
+
YELLOW='\033[0;33m'
|
|
271
|
+
WHITE='\033[1;37m'
|
|
272
|
+
GREY='\033[0;90m'
|
|
273
|
+
NC='\033[0m'
|
|
274
|
+
|
|
275
|
+
log_info() { echo -e "${GREY}│${NC} ${GREEN}✓${NC} $1" >&2; }
|
|
276
|
+
log_error() { echo -e "${GREY}│${NC} ${RED}✗${NC} $1" >&2; exit 1; }
|
|
277
|
+
log_step() { echo -e "${GREY}│${NC}\n${GREY}├${NC} ${WHITE}$1${NC}" >&2; }
|
|
278
|
+
log_add() { echo -e "${GREY}│${NC} ${GREEN}+${NC} $1" >&2; }
|
|
279
|
+
|
|
280
|
+
open_timeline() {
|
|
281
|
+
echo -e "${GREY}┌${NC}" >&2
|
|
282
|
+
[ -n "${1:-}" ] && echo -e "${GREY}│${NC} ${WHITE}$1${NC}" >&2
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
close_timeline() {
|
|
286
|
+
echo -e "${GREY}└${NC}" >&2
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
ask() {
|
|
290
|
+
local prompt_text=$1
|
|
291
|
+
local var_name=$2
|
|
292
|
+
local default_val=$3
|
|
293
|
+
local input=""
|
|
294
|
+
local char
|
|
295
|
+
local display_default=""
|
|
296
|
+
if [ -n "$default_val" ]; then
|
|
297
|
+
display_default=" (${default_val})"
|
|
298
|
+
fi
|
|
299
|
+
if [ ! -t 0 ]; then
|
|
300
|
+
log_error "${prompt_text} requires a TTY"
|
|
301
|
+
fi
|
|
302
|
+
echo -e "${GREY}│${NC}" >&2
|
|
303
|
+
echo -ne "${GREEN}◆${NC} ${prompt_text}${display_default} " >&2
|
|
304
|
+
while IFS= read -r -s -n1 char; do
|
|
305
|
+
if [[ $char == $'\x1b' ]]; then
|
|
306
|
+
read -rsn2 -t 0.001 _ || true
|
|
307
|
+
echo -ne "\r\033[K" >&2
|
|
308
|
+
echo -e "${GREY}◇${NC} ${prompt_text} ${RED}Cancelled${NC}" >&2
|
|
309
|
+
exit 1
|
|
310
|
+
elif [[ $char == $'\x7f' || $char == $'\x08' ]]; then
|
|
311
|
+
if [ -n "$input" ]; then
|
|
312
|
+
input="${input%?}"
|
|
313
|
+
echo -ne "\b \b" >&2
|
|
314
|
+
fi
|
|
315
|
+
elif [[ -z "$char" ]]; then
|
|
316
|
+
break
|
|
317
|
+
else
|
|
318
|
+
input+="$char"
|
|
319
|
+
echo -n "$char" >&2
|
|
320
|
+
fi
|
|
321
|
+
done
|
|
322
|
+
[ -z "$input" ] && input="$default_val"
|
|
323
|
+
echo -ne "\r\033[K" >&2
|
|
324
|
+
echo -e "${GREY}◇${NC} ${prompt_text} ${WHITE}${input}${NC}" >&2
|
|
325
|
+
export "$var_name"="$input"
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
check_dependencies() {
|
|
329
|
+
command -v npm >/dev/null 2>&1 || log_error "npm not installed"
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
main() {
|
|
333
|
+
check_dependencies
|
|
334
|
+
|
|
335
|
+
open_timeline "Project Setup"
|
|
336
|
+
trap close_timeline EXIT
|
|
337
|
+
|
|
338
|
+
ask "Project name?" "PROJECT_NAME" "my-app"
|
|
339
|
+
|
|
340
|
+
log_step "Installing dependencies"
|
|
341
|
+
npm install vite
|
|
342
|
+
log_add "vite@latest"
|
|
343
|
+
|
|
344
|
+
log_info "Setup complete"
|
|
345
|
+
echo -e "\n${GREEN}✓ Project created successfully${NC}"
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
main "$@"
|
|
349
|
+
```
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ci-workflow
|
|
3
|
+
description: Generates GitHub Actions CI workflow files with parallel jobs, emoji job names, and gated deploy stages. Use when asked to write a CI workflow, add GitHub Actions, set up a CI pipeline, or create a `.github/workflows` file.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CI workflow
|
|
7
|
+
|
|
8
|
+
Generate GitHub Actions workflow files for CI pipelines. Enforce parallel job execution, emoji job naming, and gated deployment stages.
|
|
9
|
+
|
|
10
|
+
## Workflow setup
|
|
11
|
+
|
|
12
|
+
- Include `workflow_dispatch` on every workflow alongside the primary trigger.
|
|
13
|
+
- Pin all actions to major version tags (`@v4`, never `@latest` or `@main`).
|
|
14
|
+
- Use `runs-on: ubuntu-latest` for all jobs.
|
|
15
|
+
|
|
16
|
+
## Job naming
|
|
17
|
+
|
|
18
|
+
- Name jobs with emoji + title: `🛡️ Static Checks`, `🧪 Unit Tests`, `📦 Build Check`, `🎭 E2E Tests`, `🚀 Deploy`, `🔍 Code Quality`, `🏷️ Release`, `🔒 Security`.
|
|
19
|
+
|
|
20
|
+
## Job dependencies
|
|
21
|
+
|
|
22
|
+
- Run independent jobs in parallel.
|
|
23
|
+
- Use `needs` only when there is a data dependency (a job requires an artifact) or the job is prohibitively expensive relative to its gate.
|
|
24
|
+
- Run static, unit, and build jobs in parallel.
|
|
25
|
+
- Gate E2E on build, since it requires the built artifact.
|
|
26
|
+
- Gate release and deploy on E2E.
|
|
27
|
+
|
|
28
|
+
## Artifacts
|
|
29
|
+
|
|
30
|
+
- Upload artifacts on `if: failure()` only. Set `retention-days: 7`.
|
|
31
|
+
|
|
32
|
+
## Bun stack
|
|
33
|
+
|
|
34
|
+
- Use `oven-sh/setup-bun@v2` with `bun-version: latest`.
|
|
35
|
+
- Install with `bun install --frozen-lockfile`.
|
|
36
|
+
- Cache Playwright browsers keyed on the Playwright version string, never a static key.
|
|
37
|
+
|
|
38
|
+
## Template
|
|
39
|
+
|
|
40
|
+
Load `${CLAUDE_SKILL_DIR}/references/workflows.md` for the base workflow template. Adapt it to the project's stack, test commands, and build output. Add or remove jobs as needed while preserving the parallel and gated structure.
|
|
41
|
+
|
|
42
|
+
## Validation
|
|
43
|
+
|
|
44
|
+
Before responding, verify:
|
|
45
|
+
|
|
46
|
+
- `workflow_dispatch` is present alongside the primary trigger.
|
|
47
|
+
- All actions pinned to major version tags, no `@latest` or `@main`.
|
|
48
|
+
- Static, unit, and build jobs have no `needs` and run in parallel.
|
|
49
|
+
- E2E uses `needs: build`. Release and deploy use `needs: e2e`.
|
|
50
|
+
- Artifacts upload on `if: failure()` only with `retention-days: 7`.
|
|
51
|
+
- Job names use emoji + title format.
|
|
52
|
+
- Bun projects use `oven-sh/setup-bun@v2` with `bun install --frozen-lockfile`.
|