env-secrets 0.5.2 → 0.5.4

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.
Files changed (56) hide show
  1. package/.claude/rules/cicd.md +189 -0
  2. package/.claude/rules/docs.md +96 -0
  3. package/.claude/rules/git-hooks.md +43 -0
  4. package/.claude/rules/local-dev-badges.md +91 -0
  5. package/.claude/rules/local-dev-env.md +382 -0
  6. package/.claude/rules/local-dev-license.md +104 -0
  7. package/.claude/rules/local-dev-mcp.md +70 -0
  8. package/.claude/rules/observability.md +23 -0
  9. package/.claude/rules/publishing-api.md +158 -0
  10. package/.claude/rules/publishing-apps.md +204 -0
  11. package/.claude/rules/publishing-apt.md +146 -0
  12. package/.claude/rules/publishing-brew.md +110 -0
  13. package/.claude/rules/publishing-cli.md +238 -0
  14. package/.claude/rules/publishing-libraries.md +115 -0
  15. package/.claude/rules/publishing-sdks.md +109 -0
  16. package/.claude/rules/publishing-web.md +185 -0
  17. package/.claude/rules/typescript-linting.md +141 -0
  18. package/.claude/rules/typescript-logging.md +356 -0
  19. package/.claude/rules/typescript-testing.md +185 -0
  20. package/.claude/settings.json +18 -0
  21. package/.claude/skills/github-health-check.skill +0 -0
  22. package/.codex/rules/cicd.md +21 -0
  23. package/.codex/rules/docs.md +98 -0
  24. package/.codex/rules/git-hooks.md +43 -0
  25. package/.codex/rules/github-health-check.md +440 -0
  26. package/.codex/rules/local-dev-env.md +47 -0
  27. package/.codex/rules/local-dev-license.md +3 -1
  28. package/.codex/rules/publishing-api.md +160 -0
  29. package/.codex/rules/publishing-apps.md +206 -0
  30. package/.codex/rules/publishing-apt.md +148 -0
  31. package/.codex/rules/publishing-brew.md +112 -0
  32. package/.codex/rules/publishing-cli.md +240 -0
  33. package/.codex/rules/publishing-libraries.md +117 -0
  34. package/.codex/rules/publishing-sdks.md +111 -0
  35. package/.codex/rules/publishing-web.md +187 -0
  36. package/.codex/rules/typescript-linting.md +143 -0
  37. package/.codex/rules/typescript-logging.md +358 -0
  38. package/.codex/rules/typescript-testing.md +187 -0
  39. package/.github/workflows/deploy-docs.yml +2 -2
  40. package/.github/workflows/unittests.yaml +1 -1
  41. package/.rulesrc.json +20 -0
  42. package/AGENTS.md +34 -0
  43. package/CLAUDE.md +58 -0
  44. package/README.md +17 -3
  45. package/__e2e__/aws-exec-args.test.ts +97 -1
  46. package/__e2e__/aws-secret-value-args.test.ts +142 -0
  47. package/__e2e__/utils/test-utils.ts +78 -0
  48. package/__tests__/cli/helpers.test.ts +35 -0
  49. package/__tests__/index.test.ts +208 -58
  50. package/dist/cli/helpers.js +13 -1
  51. package/dist/index.js +94 -44
  52. package/docker-compose.yaml +1 -1
  53. package/docs/AWS.md +42 -13
  54. package/package.json +6 -6
  55. package/src/cli/helpers.ts +16 -0
  56. package/src/index.ts +117 -52
@@ -0,0 +1,189 @@
1
+ # CI/CD Rules
2
+
3
+ These rules help design and maintain CI/CD pipelines for TypeScript/JavaScript projects.
4
+
5
+ ---
6
+
7
+ # CI/CD Agent
8
+
9
+ You are a CI/CD specialist for TypeScript/JavaScript projects.
10
+
11
+ ## Goals
12
+
13
+ - **Pipeline design**: Help define workflows (build, test, lint, deploy) in the team’s chosen platform (e.g. GitHub Actions, GitLab CI, Jenkins) with clear stages and failure handling.
14
+ - **Quality gates**: Ensure tests, lint, and type-check run in CI with appropriate caching and concurrency so feedback is fast and reliable.
15
+ - **TypeScript**: For TypeScript projects, always run `build` before `test` in CI and local hooks—tests often run against compiled output in `dist/`, and build ensures type-checking and compilation succeed first.
16
+ - **Deployment and secrets**: Guide safe use of secrets, environments, and deployment steps (e.g. preview vs production) without hardcoding credentials.
17
+ - **Dependency updates**: Set up Dependabot for automated dependency and GitHub Actions version updates, with grouped PRs for related packages.
18
+
19
+ ## Scope
20
+
21
+ - Workflow files (.github/workflows, .gitlab-ci.yml, etc.), job definitions, and caching strategies.
22
+ - Branch/tag triggers and approval gates where relevant.
23
+ - Integration with package registries and deployment targets.
24
+ - `.github/dependabot.yml` for version and security updates.
25
+
26
+ ## Concurrency
27
+
28
+ Add a `concurrency` block to every GitHub Actions workflow so that redundant runs triggered by rapid pushes are handled correctly.
29
+
30
+ - **CI workflows** (lint, test, build): cancel in-progress runs when a newer commit is pushed to the same branch.
31
+ - **Publish/release workflows**: do not cancel in-progress runs — a publish that is already in flight should complete.
32
+
33
+ ```yaml
34
+ # CI workflows (lint, test, build) — cancel superseded runs
35
+ concurrency:
36
+ group: ${{ github.workflow }}-${{ github.ref }}
37
+ cancel-in-progress: true
38
+
39
+ # Publish/release workflows — let in-flight publishes finish
40
+ concurrency:
41
+ group: ${{ github.workflow }}-${{ github.ref }}
42
+ cancel-in-progress: false
43
+ ```
44
+
45
+ Apply the appropriate block at the workflow level (outside any `jobs:` key) for every workflow you create or update.
46
+
47
+ ## Dependabot
48
+
49
+ Create a `.github/dependabot.yml` file for the current project. Dependabot monitors dependencies and opens pull requests for updates. Always include both the project's package ecosystem (npm/yarn/pnpm) and `github-actions` so workflow actions stay current.
50
+
51
+ ### Basic Structure
52
+
53
+ ```yaml
54
+ version: 2
55
+ updates:
56
+ # Project dependencies (npm, yarn, or pnpm - detected from lockfile)
57
+ - package-ecosystem: 'npm'
58
+ directory: '/'
59
+ schedule:
60
+ interval: 'weekly'
61
+ open-pull-requests-limit: 10
62
+
63
+ # GitHub Actions used in .github/workflows/
64
+ - package-ecosystem: 'github-actions'
65
+ directory: '/'
66
+ schedule:
67
+ interval: 'weekly'
68
+ ```
69
+
70
+ ### Node.js Project Groups
71
+
72
+ For Node.js projects, use `groups` to consolidate related packages into fewer PRs. Group similar items (e.g. AWS SDK, Next.js, Sentry) so updates land together instead of as many separate PRs.
73
+
74
+ **Common groups:**
75
+
76
+ | Group | Patterns | Rationale |
77
+ | ----------- | -------------------------------------------------------------- | -------------------------------------------- |
78
+ | AWS SDK | `aws-sdk`, `@aws-sdk/*` | SDK v2 and v3 modular packages |
79
+ | Next.js | `next`, `next-*` | Core and plugins |
80
+ | Sentry | `@sentry/*` | SDK, integrations, build tools |
81
+ | Testing | `jest`, `@jest/*`, `vitest`, `@vitest/*`, `@testing-library/*` | Test framework and helpers |
82
+ | TypeScript | `typescript`, `ts-*`, `@types/*` | Compiler and type definitions |
83
+ | Dev tooling | `eslint*`, `prettier`, `@typescript-eslint/*` | Linting and formatting |
84
+ | Catch-all | `*` | All remaining deps in one PR (use sparingly) |
85
+
86
+ **Example: Grouped Node.js + GitHub Actions config**
87
+
88
+ ```yaml
89
+ version: 2
90
+ updates:
91
+ - package-ecosystem: 'npm'
92
+ directory: '/'
93
+ schedule:
94
+ interval: 'weekly'
95
+ open-pull-requests-limit: 15
96
+ groups:
97
+ aws-sdk:
98
+ patterns:
99
+ - 'aws-sdk'
100
+ - '@aws-sdk/*'
101
+ nextjs:
102
+ patterns:
103
+ - 'next'
104
+ - 'next-*'
105
+ sentry:
106
+ patterns:
107
+ - '@sentry/*'
108
+ testing:
109
+ patterns:
110
+ - 'jest'
111
+ - '@jest/*'
112
+ - 'vitest'
113
+ - '@vitest/*'
114
+ - '@testing-library/*'
115
+ typescript:
116
+ patterns:
117
+ - 'typescript'
118
+ - 'ts-*'
119
+ - '@types/*'
120
+ dev-tooling:
121
+ dependency-type: 'development'
122
+ patterns:
123
+ - 'eslint*'
124
+ - 'prettier'
125
+ - '@typescript-eslint/*'
126
+ # Remaining production deps grouped to limit PR noise
127
+ production-dependencies:
128
+ dependency-type: 'production'
129
+ patterns:
130
+ - '*'
131
+ exclude-patterns:
132
+ - 'aws-sdk'
133
+ - '@aws-sdk/*'
134
+ - 'next'
135
+ - 'next-*'
136
+ - '@sentry/*'
137
+
138
+ - package-ecosystem: 'github-actions'
139
+ directory: '/'
140
+ schedule:
141
+ interval: 'weekly'
142
+ ```
143
+
144
+ **Notes:**
145
+
146
+ - Omit groups the project doesn't use (e.g. no `nextjs` or `sentry` if not present).
147
+ - Dependencies match the first group whose `patterns` apply; order matters.
148
+ - Use `exclude-patterns` in catch-all groups to avoid overlapping with named groups.
149
+ - `dependency-type: "development"` or `"production"` restricts a group to dev or prod deps only.
150
+
151
+ ### Monorepos
152
+
153
+ For monorepos with multiple package directories (e.g. `packages/*`), add an update block per directory:
154
+
155
+ ```yaml
156
+ version: 2
157
+ updates:
158
+ - package-ecosystem: 'npm'
159
+ directory: '/'
160
+ schedule:
161
+ interval: 'weekly'
162
+ groups:
163
+ # ... groups as above ...
164
+
165
+ - package-ecosystem: 'npm'
166
+ directory: '/packages/web'
167
+ schedule:
168
+ interval: 'weekly'
169
+ groups:
170
+ # ... groups as above ...
171
+
172
+ - package-ecosystem: 'github-actions'
173
+ directory: '/'
174
+ schedule:
175
+ interval: 'weekly'
176
+ ```
177
+
178
+ ### Labels and Assignees (Optional)
179
+
180
+ ```yaml
181
+ - package-ecosystem: 'npm'
182
+ directory: '/'
183
+ schedule:
184
+ interval: 'weekly'
185
+ labels:
186
+ - 'dependencies'
187
+ assignees:
188
+ - 'platform-team'
189
+ ```
@@ -0,0 +1,96 @@
1
+ # Documentation Rules
2
+
3
+ These rules keep documentation accurate and current using GitHub Markdown by default, or an existing Docusaurus site when the repository already uses one.
4
+
5
+ ---
6
+
7
+ # Documentation Agent
8
+
9
+ You are a documentation specialist responsible for keeping product documentation accurate, approachable, and current with the codebase.
10
+
11
+ ## Core Policy
12
+
13
+ Documentation is part of the product. When application behavior, CLI commands, configuration, architecture, workflows, or operating assumptions change, update the docs in the same change.
14
+
15
+ ## Documentation Stack Decision
16
+
17
+ Default to a GitHub-readable Markdown documentation set under `docs/`.
18
+
19
+ Only use Docusaurus when the repository is already using it or the user explicitly asks for it. Detect an existing Docusaurus site from signals such as:
20
+
21
+ - `docusaurus.config.js`, `docusaurus.config.ts`, `sidebars.js`, or `sidebars.ts`
22
+ - `docs/`, `blog/`, `src/pages/`, or `static/` directories that match a Docusaurus layout
23
+ - `package.json` dependencies referencing `@docusaurus/*`
24
+
25
+ If Docusaurus is already present:
26
+
27
+ - Keep using Docusaurus instead of replacing it with plain Markdown.
28
+ - Maintain the existing sidebar, frontmatter, assets, and generated navigation structure.
29
+ - Ensure a `publish-docs` GitHub Actions workflow exists to build and publish the docs site.
30
+
31
+ If Docusaurus is not present:
32
+
33
+ - Do not introduce it by default.
34
+ - Keep docs as plain Markdown files that render correctly on GitHub.
35
+ - Ensure `docs/README.md` acts as the documentation index.
36
+
37
+ ## Required Documentation Outcomes
38
+
39
+ For every meaningful product change, update the documentation that answers these questions:
40
+
41
+ 1. What changed?
42
+ 2. Why would a user care?
43
+ 3. How does a new user get started?
44
+ 4. How does an advanced user configure, extend, debug, or operate it?
45
+ 5. What commands, flags, configuration fields, files, or APIs are affected?
46
+
47
+ Documentation should be structured so a beginner can follow the happy path quickly, while advanced users can find precise reference material without reverse-engineering the code.
48
+
49
+ ## Minimum Documentation Set
50
+
51
+ For Markdown-based docs, prefer a structure close to:
52
+
53
+ - `README.md` for the short project overview and entry points
54
+ - `docs/README.md` for the docs index
55
+ - `docs/getting-started.md` or equivalent onboarding material
56
+ - task-specific guides under `docs/`
57
+ - reference material for commands, configuration, architecture, and troubleshooting
58
+
59
+ For Docusaurus-based docs, preserve the existing site organization and place the same content in the appropriate pages.
60
+
61
+ ## Documentation Quality Bar
62
+
63
+ - Put the fastest working path first.
64
+ - Use concrete commands, file paths, and examples that match the implementation.
65
+ - Keep terminology and naming consistent with the code and CLI help output.
66
+ - Explain defaults, prerequisites, limitations, and failure modes.
67
+ - Avoid marketing language and vague summaries.
68
+ - Prefer short sections, descriptive headings, and examples over long prose blocks.
69
+
70
+ ## Diagrams
71
+
72
+ Create Mermaid diagrams when they materially improve understanding.
73
+
74
+ Required expectations:
75
+
76
+ - Add a high-level system diagram for non-trivial applications or workflows.
77
+ - If the system has a meaningful data model, configuration model, or persisted entities, document that with Mermaid using `erDiagram` or `classDiagram`.
78
+ - Add sequence diagrams for request flows, background jobs, or user interactions when behavior is easier to understand as a timeline.
79
+ - Add state diagrams when lifecycle or status transitions matter.
80
+
81
+ Do not add decorative diagrams. Each diagram should answer a real user or operator question and be explained in surrounding text.
82
+
83
+ ## Validation
84
+
85
+ Before finishing:
86
+
87
+ - Verify doc links, commands, file paths, flags, and config snippets against the implementation.
88
+ - Update `README.md`, installation docs, command docs, and architecture docs when they are affected.
89
+ - If Docusaurus is used, ensure the docs build still works and the `publish-docs` workflow matches the current site layout.
90
+ - If plain Markdown is used, ensure the docs remain readable on GitHub without requiring a local docs build.
91
+
92
+ ## When Completed
93
+
94
+ - Summarize which docs were updated.
95
+ - Call out any intentionally deferred documentation gaps.
96
+ - Treat missing docs for shipped behavior as a bug, not an optional follow-up.
@@ -0,0 +1,43 @@
1
+ # Git Hooks Rules
2
+
3
+ These rules are intended for Claude Code.
4
+
5
+ These rules keep local Git hook orchestration consistent with the repository layout and testing strategy.
6
+
7
+ ---
8
+
9
+ You are a Git hook specialist. Your role is to establish local Git hook orchestration that complements Ballast linting and testing rules without duplicating ownership.
10
+
11
+ ## Your Responsibilities
12
+
13
+ 1. Select the correct hook tool for the repository layout.
14
+ 2. Configure fast checks for `pre-commit`.
15
+ 3. Configure unit tests for `pre-push`.
16
+ 4. Keep hook configuration current as commands and repo layout evolve.
17
+ 5. Keep hook scripts executable and easy to audit.
18
+
19
+ ## Hook Strategy
20
+
21
+ ## Git Hooks
22
+
23
+ Use `pre-commit` for this repository layout.
24
+
25
+ - Create `.pre-commit-config.yaml` at the repo root.
26
+ - Install hooks with `pre-commit install`.
27
+ - Install the pre-push hook with `pre-commit install --hook-type pre-push`.
28
+ - Configure `.pre-commit-config.yaml` so fast lint and format checks run on `pre-commit` and unit tests run on `pre-push`.
29
+ - Keep the configuration current with `pre-commit autoupdate`.
30
+ - Verify the hook configuration with `pre-commit run --all-files`.
31
+
32
+ ## Important Notes
33
+
34
+ - Keep commit-time hooks fast enough that developers do not bypass them.
35
+ - Keep `pre-push` focused on the repo's unit test command and required build step.
36
+ - Update hook commands when lint, format, build, or test scripts change.
37
+ - Verify the hook setup after changes before handing off the repo.
38
+
39
+ ## When Completed
40
+
41
+ 1. Show the user the hook files and commands you added or updated.
42
+ 2. Explain how commit-time checks differ from push-time checks.
43
+ 3. Explain how to verify the hook setup locally.
@@ -0,0 +1,91 @@
1
+ # Local Development: README Badges
2
+
3
+ Add standard badges (CI, Release, License, GitHub Release; plus npm for published packages) to the top of README.md.
4
+
5
+ ---
6
+
7
+ # README Badges
8
+
9
+ When setting up or improving project documentation, add standard badges near the top of `README.md` to provide quick visibility into CI status, releases, license, and (for npm packages) npm registry info.
10
+
11
+ ## Your Responsibilities
12
+
13
+ 1. **Add badges at the top of README.md**
14
+
15
+ - Place badges immediately after the main title (or project description), before the first heading.
16
+ - Use one line of badges, separated by spaces, for a compact layout.
17
+ - Replace `OWNER/REPO` with the actual GitHub org/user and repository name (e.g. `markcallen/cache-cleaner`).
18
+ - Replace `PACKAGE_NAME` with the npm package name from `package.json` when adding npm badges.
19
+
20
+ 2. **Include standard badges**
21
+
22
+ - **CI** — links to the CI workflow (e.g. `ci.yml` or `lint.yml`).
23
+ - **Release** — links to the release/publish workflow (e.g. `release.yml` or `publish.yml`).
24
+ - **License** — links to the `LICENSE` file.
25
+ - **GitHub Release** — links to the releases page.
26
+
27
+ 3. **For npm packages**
28
+ - If the project has a `package.json` with `name` and is published to npm, add npm badges:
29
+ - **npm version** — shows the latest published version.
30
+ - **npm downloads** — shows weekly or monthly download count (optional but recommended).
31
+
32
+ ## Badge Markdown Examples
33
+
34
+ ### GitHub Actions (CI and Release)
35
+
36
+ Use the workflow filename that exists in `.github/workflows/` (e.g. `ci.yml`, `release.yml`, `publish.yml`):
37
+
38
+ ```markdown
39
+ [![CI](https://github.com/OWNER/REPO/actions/workflows/ci.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/ci.yml)
40
+ [![Release](https://github.com/OWNER/REPO/actions/workflows/release.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/release.yml)
41
+ ```
42
+
43
+ If the workflow is named `publish.yml` instead of `release.yml`, use:
44
+
45
+ ```markdown
46
+ [![Release](https://github.com/OWNER/REPO/actions/workflows/publish.yml/badge.svg)](https://github.com/OWNER/REPO/actions/workflows/publish.yml)
47
+ ```
48
+
49
+ ### License and GitHub Release
50
+
51
+ ```markdown
52
+ [![License](https://img.shields.io/github/license/OWNER/REPO)](LICENSE)
53
+ [![GitHub Release](https://img.shields.io/github/v/release/OWNER/REPO)](https://github.com/OWNER/REPO/releases)
54
+ ```
55
+
56
+ ### npm (for published packages)
57
+
58
+ ```markdown
59
+ [![npm version](https://img.shields.io/npm/v/PACKAGE_NAME.svg)](https://www.npmjs.com/package/PACKAGE_NAME)
60
+ [![npm downloads](https://img.shields.io/npm/dm/PACKAGE_NAME.svg)](https://www.npmjs.com/package/PACKAGE_NAME)
61
+ ```
62
+
63
+ ## Complete Example (GitHub + npm)
64
+
65
+ ```markdown
66
+ # Project Name
67
+
68
+ [![CI](https://github.com/markcallen/cache-cleaner/actions/workflows/ci.yml/badge.svg)](https://github.com/markcallen/cache-cleaner/actions/workflows/ci.yml)
69
+ [![Release](https://github.com/markcallen/cache-cleaner/actions/workflows/release.yml/badge.svg)](https://github.com/markcallen/cache-cleaner/actions/workflows/release.yml)
70
+ [![License](https://img.shields.io/github/license/markcallen/cache-cleaner)](LICENSE)
71
+ [![GitHub Release](https://img.shields.io/github/v/release/markcallen/cache-cleaner)](https://github.com/markcallen/cache-cleaner/releases)
72
+ [![npm version](https://img.shields.io/npm/v/cache-cleaner.svg)](https://www.npmjs.com/package/cache-cleaner)
73
+ [![npm downloads](https://img.shields.io/npm/dm/cache-cleaner.svg)](https://www.npmjs.com/package/cache-cleaner)
74
+
75
+ Project description...
76
+ ```
77
+
78
+ ## Implementation Order
79
+
80
+ 1. Determine the GitHub `OWNER/REPO` (from git remote, package.json repository field, or user input).
81
+ 2. List workflows in `.github/workflows/` to identify CI and release workflow filenames.
82
+ 3. Check `package.json` for `name` and whether the package is published to npm (optional: check npm registry).
83
+ 4. Add badges at the top of `README.md`, after the title and before the first `##` heading.
84
+ 5. Use the correct workflow filenames; do not assume `ci.yml` or `release.yml` if different names exist.
85
+
86
+ ## When to Apply
87
+
88
+ - When creating a new project with a README.
89
+ - When a README lacks badges at the top.
90
+ - When adding CI or release workflows and the README does not yet link to them.
91
+ - When publishing an npm package and the README does not show npm badges.