codeforge-dev 1.5.8 → 1.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/.devcontainer/.env +4 -5
- package/.devcontainer/.env.example +29 -0
- package/.devcontainer/.gitignore +8 -0
- package/.devcontainer/.secrets.example +12 -0
- package/.devcontainer/CHANGELOG.md +186 -0
- package/.devcontainer/CLAUDE.md +108 -21
- package/.devcontainer/README.md +173 -57
- package/.devcontainer/config/defaults/keybindings.json +5 -0
- package/.devcontainer/config/{main-system-prompt.md → defaults/main-system-prompt.md} +135 -2
- package/.devcontainer/config/{settings.json → defaults/settings.json} +25 -6
- package/.devcontainer/config/file-manifest.json +20 -0
- package/.devcontainer/devcontainer.json +38 -2
- package/.devcontainer/docs/configuration-reference.md +90 -0
- package/.devcontainer/docs/keybindings.md +100 -0
- package/.devcontainer/docs/optional-features.md +129 -0
- package/.devcontainer/docs/plugins.md +154 -0
- package/.devcontainer/docs/troubleshooting.md +128 -0
- package/.devcontainer/features/README.md +21 -7
- package/.devcontainer/features/agent-browser/install.sh +6 -0
- package/.devcontainer/features/ast-grep/install.sh +6 -0
- package/.devcontainer/features/biome/README.md +27 -0
- package/.devcontainer/features/biome/install.sh +6 -0
- package/.devcontainer/features/ccburn/README.md +60 -0
- package/.devcontainer/features/ccburn/devcontainer-feature.json +38 -0
- package/.devcontainer/features/ccburn/install.sh +180 -0
- package/.devcontainer/features/ccstatusline/README.md +22 -21
- package/.devcontainer/features/ccstatusline/devcontainer-feature.json +6 -1
- package/.devcontainer/features/ccstatusline/install.sh +55 -16
- package/.devcontainer/features/ccusage/install.sh +6 -0
- package/.devcontainer/features/claude-monitor/install.sh +6 -0
- package/.devcontainer/features/dprint/README.md +30 -0
- package/.devcontainer/features/dprint/devcontainer-feature.json +18 -0
- package/.devcontainer/features/dprint/install.sh +131 -0
- package/.devcontainer/features/hadolint/README.md +35 -0
- package/.devcontainer/features/hadolint/devcontainer-feature.json +13 -0
- package/.devcontainer/features/hadolint/install.sh +86 -0
- package/.devcontainer/features/lsp-servers/devcontainer-feature.json +5 -0
- package/.devcontainer/features/lsp-servers/install.sh +7 -0
- package/.devcontainer/features/mcp-qdrant/devcontainer-feature.json +6 -1
- package/.devcontainer/features/mcp-qdrant/install.sh +13 -6
- package/.devcontainer/features/mcp-reasoner/devcontainer-feature.json +6 -1
- package/.devcontainer/features/mcp-reasoner/install.sh +8 -1
- package/.devcontainer/features/notify-hook/devcontainer-feature.json +5 -0
- package/.devcontainer/features/notify-hook/install.sh +7 -0
- package/.devcontainer/features/ruff/README.md +26 -0
- package/.devcontainer/features/ruff/devcontainer-feature.json +21 -0
- package/.devcontainer/features/ruff/install.sh +74 -0
- package/.devcontainer/features/shellcheck/README.md +38 -0
- package/.devcontainer/features/shellcheck/devcontainer-feature.json +13 -0
- package/.devcontainer/features/shellcheck/install.sh +24 -0
- package/.devcontainer/features/shfmt/README.md +37 -0
- package/.devcontainer/features/shfmt/devcontainer-feature.json +13 -0
- package/.devcontainer/features/shfmt/install.sh +85 -0
- package/.devcontainer/features/splitrail/devcontainer-feature.json +5 -0
- package/.devcontainer/features/splitrail/install.sh +7 -0
- package/.devcontainer/features/tmux/install.sh +8 -0
- package/.devcontainer/features/tree-sitter/install.sh +6 -0
- package/.devcontainer/plugins/devs-marketplace/.claude-plugin/marketplace.json +3 -10
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/__pycache__/format-on-stop.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-formatter/scripts/format-on-stop.py +133 -13
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/hooks/hooks.json +4 -5
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/__pycache__/lint-file.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/auto-linter/scripts/lint-file.py +477 -78
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/.claude-plugin/plugin.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/AGENT-REDIRECTION.md +226 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/REVIEW-RUBRIC.md +440 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/architect.md +207 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/bash-exec.md +173 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/claude-guide.md +146 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/debug-logs.md +2 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/dependency-analyst.md +250 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/doc-writer.md +246 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/explorer.md +237 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/generalist.md +134 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/git-archaeologist.md +242 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/migrator.md +201 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/perf-profiler.md +265 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/refactorer.md +213 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/researcher.md +195 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/security-auditor.md +289 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/spec-writer.md +297 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/statusline-config.md +188 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/agents/test-writer.md +248 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/hooks/hooks.json +51 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/advisory-test-runner.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/collect-edited-files.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/commit-reminder.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/git-state-injector.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/guard-readonly-bash.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/redirect-builtin-agents.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/skill-suggester.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/syntax-validator.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/ticket-linker.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/todo-harvester.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/verify-no-regression.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/__pycache__/verify-tests-pass.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/advisory-test-runner.py +174 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/collect-edited-files.py +8 -6
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/commit-reminder.py +90 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/git-state-injector.py +114 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/guard-readonly-bash.py +611 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/redirect-builtin-agents.py +83 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/skill-suggester.py +146 -2
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/syntax-validator.py +9 -4
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/ticket-linker.py +137 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/todo-harvester.py +130 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/verify-no-regression.py +221 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/scripts/verify-tests-pass.py +176 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/SKILL.md +224 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/references/error-handling.md +166 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/api-design/references/rest-conventions.md +215 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/ast-grep-patterns/SKILL.md +211 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/ast-grep-patterns/references/language-patterns.md +327 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/claude-agent-sdk/SKILL.md +599 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/claude-agent-sdk/references/sdk-typescript-reference.md +954 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/SKILL.md +134 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/references/ecosystem-commands.md +264 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/dependency-management/references/license-compliance.md +80 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/SKILL.md +153 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/references/api-doc-templates.md +221 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/documentation-patterns/references/docstring-formats.md +296 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/git-forensics/SKILL.md +276 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/git-forensics/references/advanced-commands.md +332 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/git-forensics/references/investigation-playbooks.md +319 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/SKILL.md +150 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/references/javascript-migrations.md +179 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/migration-patterns/references/python-migrations.md +141 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/performance-profiling/SKILL.md +341 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/performance-profiling/references/interpreting-results.md +235 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/performance-profiling/references/tool-commands.md +395 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/refactoring-patterns/SKILL.md +344 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/refactoring-patterns/references/safe-transformations.md +247 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/refactoring-patterns/references/smell-catalog.md +332 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/security-checklist/SKILL.md +277 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/security-checklist/references/owasp-patterns.md +269 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/security-checklist/references/secrets-patterns.md +253 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/SKILL.md +320 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/references/criteria-patterns.md +245 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/specification-writing/references/ears-templates.md +239 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/dangerous-command-blocker/scripts/__pycache__/block-dangerous.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/notify-hook/hooks/hooks.json +1 -1
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/__pycache__/guard-protected.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/protected-files-guard/scripts/guard-protected.py +40 -39
- package/.devcontainer/scripts/check-setup.sh +72 -0
- package/.devcontainer/scripts/setup-aliases.sh +51 -6
- package/.devcontainer/scripts/setup-auth.sh +74 -0
- package/.devcontainer/scripts/setup-config.sh +112 -20
- package/.devcontainer/scripts/setup-plugins.sh +38 -46
- package/.devcontainer/scripts/setup-projects.sh +175 -0
- package/.devcontainer/scripts/setup-symlink-claude.sh +36 -0
- package/.devcontainer/scripts/setup-update-claude.sh +19 -8
- package/.devcontainer/scripts/setup.sh +49 -14
- package/README.md +23 -190
- package/package.json +1 -1
- package/setup.js +245 -71
- package/.devcontainer/features/claude-code/README.md +0 -498
- package/.devcontainer/features/claude-code/config/settings.json +0 -36
- package/.devcontainer/features/claude-code/config/system-prompt.md +0 -118
- package/.devcontainer/features/claude-code/config/world-building-sp.md +0 -1432
- package/.devcontainer/features/claude-code/devcontainer-feature.json +0 -42
- package/.devcontainer/features/claude-code/install.sh +0 -466
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/.claude-plugin/plugin.json +0 -7
- package/.devcontainer/plugins/devs-marketplace/plugins/planning-reminder/hooks/hooks.json +0 -17
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/.claude-plugin/plugin.json +0 -6
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/config/planning-instructions.md +0 -14
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/functional-conjuring-map.md +0 -989
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/hooks/hooks.json +0 -33
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/__pycache__/post-enhance-task.cpython-314.pyc +0 -0
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhance-planning.py +0 -71
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-plan.sh +0 -68
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/enhancers/enhance-task.sh +0 -120
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-plan.py +0 -133
- package/.devcontainer/plugins/devs-marketplace/plugins/workflow-enhancer/scripts/post-enhance-task.py +0 -253
- package/.devcontainer/scripts/setup-irie-claude.sh +0 -32
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# EARS Requirement Templates
|
|
2
|
+
|
|
3
|
+
Templates and filled examples for each EARS (Easy Approach to Requirements Syntax) pattern type.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Ubiquitous Requirements](#ubiquitous-requirements)
|
|
8
|
+
- [Event-Driven Requirements](#event-driven-requirements)
|
|
9
|
+
- [State-Driven Requirements](#state-driven-requirements)
|
|
10
|
+
- [Unwanted Behavior Requirements](#unwanted-behavior-requirements)
|
|
11
|
+
- [Optional Feature Requirements](#optional-feature-requirements)
|
|
12
|
+
- [Compound Requirements](#compound-requirements)
|
|
13
|
+
- [Writing Tips](#writing-tips)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Ubiquitous Requirements
|
|
18
|
+
|
|
19
|
+
**Template:**
|
|
20
|
+
```
|
|
21
|
+
The <system> shall <action>.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requirements that are always active, with no trigger condition. These define invariant behaviors.
|
|
25
|
+
|
|
26
|
+
### Examples
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
The API shall return responses in JSON format with UTF-8 encoding.
|
|
30
|
+
|
|
31
|
+
The system shall log all authentication events with timestamp, user ID, and outcome.
|
|
32
|
+
|
|
33
|
+
The application shall enforce HTTPS for all client-server communication.
|
|
34
|
+
|
|
35
|
+
The database shall store timestamps in UTC.
|
|
36
|
+
|
|
37
|
+
The API shall include a request-id header in every response.
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Anti-patterns
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
❌ The system should be fast.
|
|
44
|
+
→ Not testable. How fast? Measured how?
|
|
45
|
+
|
|
46
|
+
❌ The system shall be user-friendly.
|
|
47
|
+
→ Not testable. Define specific interaction requirements.
|
|
48
|
+
|
|
49
|
+
✅ The API shall respond to health check requests within 50ms (p99).
|
|
50
|
+
✅ The login form shall support keyboard navigation (tab order: email → password → submit).
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Event-Driven Requirements
|
|
56
|
+
|
|
57
|
+
**Template:**
|
|
58
|
+
```
|
|
59
|
+
When <event>, the <system> shall <action>.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Requirements triggered by a specific, detectable event. The event is the precondition.
|
|
63
|
+
|
|
64
|
+
### Examples
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
When a user submits a registration form, the system shall validate all fields
|
|
68
|
+
and return validation errors within 200ms.
|
|
69
|
+
|
|
70
|
+
When a payment transaction fails, the system shall:
|
|
71
|
+
1. Log the failure with transaction ID, error code, and timestamp.
|
|
72
|
+
2. Send a failure notification to the user within 60 seconds.
|
|
73
|
+
3. Release the reserved inventory.
|
|
74
|
+
|
|
75
|
+
When a file upload exceeds 50MB, the system shall reject the upload with
|
|
76
|
+
HTTP 413 and a message indicating the maximum file size.
|
|
77
|
+
|
|
78
|
+
When a user's session has been inactive for 30 minutes, the system shall
|
|
79
|
+
invalidate the session and redirect to the login page.
|
|
80
|
+
|
|
81
|
+
When the system receives a webhook event with an unrecognized event type,
|
|
82
|
+
the system shall log the event payload and return HTTP 200 (acknowledge but ignore).
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Anti-patterns
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
❌ When the user does something wrong, show an error.
|
|
89
|
+
→ What action? What error? How displayed?
|
|
90
|
+
|
|
91
|
+
✅ When the user submits a form with an invalid email format,
|
|
92
|
+
the system shall display an inline error message below the email field
|
|
93
|
+
stating "Please enter a valid email address".
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## State-Driven Requirements
|
|
99
|
+
|
|
100
|
+
**Template:**
|
|
101
|
+
```
|
|
102
|
+
While <state>, the <system> shall <action>.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Requirements that apply continuously while the system is in a specific state.
|
|
106
|
+
|
|
107
|
+
### Examples
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
While the system is in maintenance mode, the API shall return HTTP 503
|
|
111
|
+
with a "Retry-After" header for all endpoints except /health.
|
|
112
|
+
|
|
113
|
+
While a user account is locked, the system shall reject all login attempts
|
|
114
|
+
and display a message with the unlock time.
|
|
115
|
+
|
|
116
|
+
While the message queue depth exceeds 10,000 messages, the system shall
|
|
117
|
+
activate the secondary consumer group.
|
|
118
|
+
|
|
119
|
+
While the database is performing a backup, the system shall serve read
|
|
120
|
+
requests from the read replica and queue write requests.
|
|
121
|
+
|
|
122
|
+
While the system is operating in degraded mode, the dashboard shall display
|
|
123
|
+
a banner indicating limited functionality and estimated recovery time.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Unwanted Behavior Requirements
|
|
129
|
+
|
|
130
|
+
**Template:**
|
|
131
|
+
```
|
|
132
|
+
If <unwanted condition>, then the <system> shall <action>.
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Requirements for handling errors, failures, and edge cases. These cover what happens when things go wrong.
|
|
136
|
+
|
|
137
|
+
### Examples
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
If the external payment gateway does not respond within 5 seconds,
|
|
141
|
+
then the system shall retry once after 2 seconds, and if the retry
|
|
142
|
+
also fails, return a "payment processing delayed" message to the user.
|
|
143
|
+
|
|
144
|
+
If the database connection pool is exhausted, then the system shall
|
|
145
|
+
queue incoming requests for up to 30 seconds before returning HTTP 503.
|
|
146
|
+
|
|
147
|
+
If a user attempts to access a resource they do not own, then the system
|
|
148
|
+
shall return HTTP 403, log the access attempt with the user ID and resource ID,
|
|
149
|
+
and increment the security audit counter.
|
|
150
|
+
|
|
151
|
+
If the uploaded file contains an unsupported MIME type, then the system shall
|
|
152
|
+
reject the file with a message listing the supported types.
|
|
153
|
+
|
|
154
|
+
If the disk usage exceeds 90%, then the system shall send an alert to the
|
|
155
|
+
operations team and begin purging temporary files older than 24 hours.
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Optional Feature Requirements
|
|
161
|
+
|
|
162
|
+
**Template:**
|
|
163
|
+
```
|
|
164
|
+
Where <feature is enabled>, the <system> shall <action>.
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Requirements that depend on a configurable feature flag or setting.
|
|
168
|
+
|
|
169
|
+
### Examples
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
Where two-factor authentication is enabled, the system shall require
|
|
173
|
+
a TOTP code after successful password verification.
|
|
174
|
+
|
|
175
|
+
Where the audit log feature is enabled, the system shall record all
|
|
176
|
+
CRUD operations with the actor, action, resource, and timestamp.
|
|
177
|
+
|
|
178
|
+
Where dark mode is enabled, the system shall render all pages using
|
|
179
|
+
the dark color palette defined in the theme configuration.
|
|
180
|
+
|
|
181
|
+
Where rate limiting is configured, the system shall enforce the configured
|
|
182
|
+
request limit per API key per minute and return HTTP 429 when exceeded.
|
|
183
|
+
|
|
184
|
+
Where email notifications are enabled for a user, the system shall send
|
|
185
|
+
a daily digest of unread notifications at the user's configured time.
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Compound Requirements
|
|
191
|
+
|
|
192
|
+
Complex requirements often combine multiple EARS patterns:
|
|
193
|
+
|
|
194
|
+
### Event + Unwanted Behavior
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
When a user submits a password reset request:
|
|
198
|
+
- The system shall send a reset email within 60 seconds.
|
|
199
|
+
- If the email address is not associated with an account, then the system
|
|
200
|
+
shall still return a success message (to prevent email enumeration).
|
|
201
|
+
- If the email service is unavailable, then the system shall queue the
|
|
202
|
+
email for retry and inform the user that the email may be delayed.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### State + Event
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
While the system is in read-only mode:
|
|
209
|
+
- When a user attempts a write operation, the system shall return HTTP 503
|
|
210
|
+
with a message indicating when write access will be restored.
|
|
211
|
+
- When an admin issues a "restore write access" command, the system shall
|
|
212
|
+
exit read-only mode and process any queued write operations in order.
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Requirement Hierarchies
|
|
216
|
+
|
|
217
|
+
For complex features, use parent-child numbering:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
FR-1: User Registration
|
|
221
|
+
FR-1.1: When a user submits the registration form, the system shall
|
|
222
|
+
create an account and send a verification email.
|
|
223
|
+
FR-1.2: If the email is already registered, then the system shall
|
|
224
|
+
display "An account with this email already exists".
|
|
225
|
+
FR-1.3: The system shall require passwords of at least 12 characters
|
|
226
|
+
with at least one uppercase letter and one digit.
|
|
227
|
+
FR-1.4: Where CAPTCHA is enabled, the registration form shall include
|
|
228
|
+
a CAPTCHA challenge before submission.
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Writing Tips
|
|
234
|
+
|
|
235
|
+
1. **One requirement per statement.** Don't combine multiple behaviors in one sentence.
|
|
236
|
+
2. **Use "shall" for requirements, "should" for recommendations, "may" for optional.** This is standard requirement language (RFC 2119).
|
|
237
|
+
3. **Be specific about quantities.** Not "quickly" but "within 200ms". Not "many" but "up to 1000".
|
|
238
|
+
4. **Name the actor.** "The system shall..." or "The user shall..." -- never the passive "It should be done".
|
|
239
|
+
5. **State the observable behavior.** Requirements describe what the system does, not how it does it internally.
|
|
Binary file
|
|
Binary file
|
|
@@ -14,47 +14,50 @@ import sys
|
|
|
14
14
|
# Patterns that should be protected from modification
|
|
15
15
|
PROTECTED_PATTERNS = [
|
|
16
16
|
# Environment secrets
|
|
17
|
-
(r
|
|
18
|
-
(
|
|
19
|
-
|
|
17
|
+
(r"(^|/)\.env$", "Blocked: .env contains secrets - edit manually if needed"),
|
|
18
|
+
(
|
|
19
|
+
r"(^|/)\.env\.[^/]+$",
|
|
20
|
+
"Blocked: .env.* files contain secrets - edit manually if needed",
|
|
21
|
+
),
|
|
20
22
|
# Git internals
|
|
21
|
-
(r
|
|
22
|
-
|
|
23
|
+
(r"(^|/)\.git/", "Blocked: .git/ directory is managed by git"),
|
|
23
24
|
# Lock files (should be modified via package manager)
|
|
24
|
-
(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(r
|
|
29
|
-
(r
|
|
30
|
-
(r
|
|
31
|
-
(r
|
|
32
|
-
|
|
25
|
+
(
|
|
26
|
+
r"(^|/)package-lock\.json$",
|
|
27
|
+
"Blocked: package-lock.json - use npm install instead",
|
|
28
|
+
),
|
|
29
|
+
(r"(^|/)yarn\.lock$", "Blocked: yarn.lock - use yarn install instead"),
|
|
30
|
+
(r"(^|/)pnpm-lock\.yaml$", "Blocked: pnpm-lock.yaml - use pnpm install instead"),
|
|
31
|
+
(r"(^|/)Gemfile\.lock$", "Blocked: Gemfile.lock - use bundle install instead"),
|
|
32
|
+
(r"(^|/)poetry\.lock$", "Blocked: poetry.lock - use poetry install instead"),
|
|
33
|
+
(r"(^|/)Cargo\.lock$", "Blocked: Cargo.lock - use cargo build instead"),
|
|
34
|
+
(r"(^|/)composer\.lock$", "Blocked: composer.lock - use composer install instead"),
|
|
35
|
+
(r"(^|/)uv\.lock$", "Blocked: uv.lock - use uv sync instead"),
|
|
33
36
|
# Certificates and keys
|
|
34
|
-
(r
|
|
35
|
-
(r
|
|
36
|
-
(r
|
|
37
|
-
(r
|
|
38
|
-
(r
|
|
39
|
-
|
|
37
|
+
(r"\.pem$", "Blocked: .pem files contain sensitive cryptographic material"),
|
|
38
|
+
(r"\.key$", "Blocked: .key files contain sensitive cryptographic material"),
|
|
39
|
+
(r"\.crt$", "Blocked: .crt certificate files should not be edited directly"),
|
|
40
|
+
(r"\.p12$", "Blocked: .p12 files contain sensitive cryptographic material"),
|
|
41
|
+
(r"\.pfx$", "Blocked: .pfx files contain sensitive cryptographic material"),
|
|
40
42
|
# Credential files
|
|
41
|
-
(r
|
|
42
|
-
(r
|
|
43
|
-
(r
|
|
44
|
-
(r
|
|
45
|
-
(r
|
|
46
|
-
|
|
43
|
+
(r"(^|/)credentials\.json$", "Blocked: credentials.json contains secrets"),
|
|
44
|
+
(r"(^|/)secrets\.yaml$", "Blocked: secrets.yaml contains secrets"),
|
|
45
|
+
(r"(^|/)secrets\.yml$", "Blocked: secrets.yml contains secrets"),
|
|
46
|
+
(r"(^|/)secrets\.json$", "Blocked: secrets.json contains secrets"),
|
|
47
|
+
(r"(^|/)\.secrets$", "Blocked: .secrets file contains secrets"),
|
|
47
48
|
# Auth directories and files
|
|
48
|
-
(r
|
|
49
|
-
(r
|
|
50
|
-
(r
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
(r"(^|/)\.ssh/", "Blocked: .ssh/ contains sensitive authentication data"),
|
|
50
|
+
(r"(^|/)\.aws/", "Blocked: .aws/ contains AWS credentials"),
|
|
51
|
+
(r"(^|/)\.netrc$", "Blocked: .netrc contains authentication credentials"),
|
|
52
|
+
(
|
|
53
|
+
r"(^|/)\.npmrc$",
|
|
54
|
+
"Blocked: .npmrc may contain auth tokens - edit manually if needed",
|
|
55
|
+
),
|
|
56
|
+
(r"(^|/)\.pypirc$", "Blocked: .pypirc contains PyPI credentials"),
|
|
54
57
|
# Other sensitive files
|
|
55
|
-
(r
|
|
56
|
-
(r
|
|
57
|
-
(r
|
|
58
|
+
(r"(^|/|-)id_rsa($|\.)", "Blocked: SSH private key file"),
|
|
59
|
+
(r"(^|/)id_ed25519", "Blocked: SSH private key file"),
|
|
60
|
+
(r"(^|/)id_ecdsa", "Blocked: SSH private key file"),
|
|
58
61
|
]
|
|
59
62
|
|
|
60
63
|
|
|
@@ -65,7 +68,7 @@ def check_path(file_path: str) -> tuple[bool, str]:
|
|
|
65
68
|
(is_protected, message)
|
|
66
69
|
"""
|
|
67
70
|
# Normalize path for consistent matching
|
|
68
|
-
normalized = file_path.replace(
|
|
71
|
+
normalized = file_path.replace("\\", "/")
|
|
69
72
|
|
|
70
73
|
for pattern, message in PROTECTED_PATTERNS:
|
|
71
74
|
if re.search(pattern, normalized, re.IGNORECASE):
|
|
@@ -87,9 +90,7 @@ def main():
|
|
|
87
90
|
|
|
88
91
|
if is_protected:
|
|
89
92
|
# Output error message and exit 2 to block
|
|
90
|
-
print(json.dumps({
|
|
91
|
-
"error": message
|
|
92
|
-
}))
|
|
93
|
+
print(json.dumps({"error": message}))
|
|
93
94
|
sys.exit(2)
|
|
94
95
|
|
|
95
96
|
# Allow edit to proceed
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Verify CodeForge setup is working correctly
|
|
3
|
+
# Run anytime with: check-setup
|
|
4
|
+
|
|
5
|
+
echo "CodeForge Setup Check"
|
|
6
|
+
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
7
|
+
|
|
8
|
+
PASS=0; FAIL=0; WARN=0
|
|
9
|
+
|
|
10
|
+
check() {
|
|
11
|
+
local label="$1" cmd="$2"
|
|
12
|
+
if eval "$cmd" >/dev/null 2>&1; then
|
|
13
|
+
printf " ✓ %s\n" "$label"
|
|
14
|
+
PASS=$((PASS + 1))
|
|
15
|
+
else
|
|
16
|
+
printf " ✗ %s\n" "$label"
|
|
17
|
+
FAIL=$((FAIL + 1))
|
|
18
|
+
fi
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
warn_check() {
|
|
22
|
+
local label="$1" cmd="$2"
|
|
23
|
+
if eval "$cmd" >/dev/null 2>&1; then
|
|
24
|
+
printf " ✓ %s\n" "$label"
|
|
25
|
+
PASS=$((PASS + 1))
|
|
26
|
+
else
|
|
27
|
+
printf " ⚠ %s\n" "$label"
|
|
28
|
+
WARN=$((WARN + 1))
|
|
29
|
+
fi
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
echo ""
|
|
33
|
+
echo "Core:"
|
|
34
|
+
check "Claude Code installed" "command -v claude"
|
|
35
|
+
check "cc alias available" "type cc"
|
|
36
|
+
check "Config directory exists" "[ -d '${CLAUDE_CONFIG_DIR:-/workspaces/.claude}' ]"
|
|
37
|
+
check "Settings file exists" "[ -f '${CLAUDE_CONFIG_DIR:-/workspaces/.claude}/settings.json' ]"
|
|
38
|
+
|
|
39
|
+
echo ""
|
|
40
|
+
echo "Authentication:"
|
|
41
|
+
warn_check "GitHub CLI authenticated" "gh auth status"
|
|
42
|
+
warn_check "Git user configured" "git config --global user.name"
|
|
43
|
+
|
|
44
|
+
echo ""
|
|
45
|
+
echo "Tools:"
|
|
46
|
+
check "Node.js" "command -v node"
|
|
47
|
+
check "Python" "command -v python3"
|
|
48
|
+
check "uv" "command -v uv"
|
|
49
|
+
warn_check "Go" "command -v go"
|
|
50
|
+
warn_check "Bun" "command -v bun"
|
|
51
|
+
warn_check "Docker" "command -v docker"
|
|
52
|
+
|
|
53
|
+
echo ""
|
|
54
|
+
echo "Development:"
|
|
55
|
+
warn_check "biome" "command -v biome"
|
|
56
|
+
warn_check "ruff" "command -v ruff"
|
|
57
|
+
warn_check "dprint" "command -v dprint"
|
|
58
|
+
warn_check "shfmt" "command -v shfmt"
|
|
59
|
+
warn_check "shellcheck" "command -v shellcheck"
|
|
60
|
+
warn_check "hadolint" "command -v hadolint"
|
|
61
|
+
warn_check "ast-grep" "command -v ast-grep"
|
|
62
|
+
warn_check "tmux" "command -v tmux"
|
|
63
|
+
|
|
64
|
+
echo ""
|
|
65
|
+
echo "━━━━━━━━━━━━━━━━━━━━"
|
|
66
|
+
echo " $PASS passed, $FAIL failed, $WARN warnings"
|
|
67
|
+
|
|
68
|
+
if [ $FAIL -gt 0 ]; then
|
|
69
|
+
echo ""
|
|
70
|
+
echo " Run 'cc-tools' for detailed version info."
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
@@ -6,12 +6,17 @@ CLAUDE_DIR="${CLAUDE_CONFIG_DIR:?CLAUDE_CONFIG_DIR not set}"
|
|
|
6
6
|
echo "[setup-aliases] Configuring Claude aliases..."
|
|
7
7
|
|
|
8
8
|
# Simple alias definitions (not functions — functions don't behave reliably across shell contexts)
|
|
9
|
-
ALIAS_CC='alias cc='"'"'command claude --system-prompt-file
|
|
10
|
-
ALIAS_CLAUDE='alias claude='"'"'command claude --system-prompt-file
|
|
9
|
+
ALIAS_CC='alias cc='"'"'CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 command claude --system-prompt-file "$CLAUDE_CONFIG_DIR/system-prompt.md" --permission-mode plan --allow-dangerously-skip-permissions'"'"''
|
|
10
|
+
ALIAS_CLAUDE='alias claude='"'"'CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 command claude --system-prompt-file "$CLAUDE_CONFIG_DIR/system-prompt.md" --permission-mode plan --allow-dangerously-skip-permissions'"'"''
|
|
11
11
|
ALIAS_CCRAW='alias ccraw="command claude"'
|
|
12
12
|
|
|
13
13
|
for rc in ~/.bashrc ~/.zshrc; do
|
|
14
14
|
if [ -f "$rc" ]; then
|
|
15
|
+
# --- Backup before modifying ---
|
|
16
|
+
cp "$rc" "${rc}.bak.$(date +%s)" 2>/dev/null || true
|
|
17
|
+
# Clean old backups (keep last 3)
|
|
18
|
+
ls -t "${rc}.bak."* 2>/dev/null | tail -n +4 | xargs rm -f 2>/dev/null || true
|
|
19
|
+
|
|
15
20
|
# --- Cleanup old definitions ---
|
|
16
21
|
|
|
17
22
|
# Remove old cc alias
|
|
@@ -46,8 +51,20 @@ for rc in ~/.bashrc ~/.zshrc; do
|
|
|
46
51
|
if grep -q "alias specwright=" "$rc" 2>/dev/null; then
|
|
47
52
|
sed -i '/alias specwright=/d' "$rc"
|
|
48
53
|
fi
|
|
54
|
+
# Remove old cc-tools/check-setup functions
|
|
55
|
+
if grep -q "^cc-tools()" "$rc" 2>/dev/null; then
|
|
56
|
+
sed -i '/^cc-tools() {/,/^}/d' "$rc"
|
|
57
|
+
fi
|
|
58
|
+
if grep -q "alias check-setup=" "$rc" 2>/dev/null; then
|
|
59
|
+
sed -i '/alias check-setup=/d' "$rc"
|
|
60
|
+
fi
|
|
49
61
|
|
|
50
|
-
# --- Add environment
|
|
62
|
+
# --- Add environment and aliases (idempotent) ---
|
|
63
|
+
# Guard: skip if aliases already present from a previous run
|
|
64
|
+
if grep -q '# Claude Code environment and aliases' "$rc" 2>/dev/null; then
|
|
65
|
+
echo "[setup-aliases] Aliases already present in $(basename $rc), skipping"
|
|
66
|
+
continue
|
|
67
|
+
fi
|
|
51
68
|
echo "" >> "$rc"
|
|
52
69
|
echo "# Claude Code environment and aliases (managed by setup-aliases.sh)" >> "$rc"
|
|
53
70
|
# Export CLAUDE_CONFIG_DIR so it's available in all shells (not just VS Code remoteEnv)
|
|
@@ -62,11 +79,39 @@ for rc in ~/.bashrc ~/.zshrc; do
|
|
|
62
79
|
echo "$ALIAS_CC" >> "$rc"
|
|
63
80
|
echo "$ALIAS_CLAUDE" >> "$rc"
|
|
64
81
|
echo "$ALIAS_CCRAW" >> "$rc"
|
|
82
|
+
|
|
83
|
+
# cc-tools: list all available CodeForge tools with version info
|
|
84
|
+
cat >> "$rc" << 'CCTOOLS_EOF'
|
|
85
|
+
cc-tools() {
|
|
86
|
+
echo "CodeForge Available Tools"
|
|
87
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
88
|
+
printf " %-20s %s\n" "COMMAND" "STATUS"
|
|
89
|
+
echo " ────────────────────────────────────"
|
|
90
|
+
for cmd in claude cc ccraw ccusage ccburn claude-monitor \
|
|
91
|
+
ruff biome dprint shfmt shellcheck hadolint \
|
|
92
|
+
ast-grep tree-sitter pyright typescript-language-server \
|
|
93
|
+
agent-browser gh docker git jq tmux bun go; do
|
|
94
|
+
if command -v "$cmd" >/dev/null 2>&1; then
|
|
95
|
+
ver=$("$cmd" --version 2>/dev/null | head -1 || echo "installed")
|
|
96
|
+
printf " %-20s ✓ %s\n" "$cmd" "$ver"
|
|
97
|
+
else
|
|
98
|
+
printf " %-20s ✗ not found\n" "$cmd"
|
|
99
|
+
fi
|
|
100
|
+
done
|
|
101
|
+
}
|
|
102
|
+
CCTOOLS_EOF
|
|
103
|
+
|
|
104
|
+
# check-setup: alias to the health check script
|
|
105
|
+
DEVCONTAINER_SCRIPTS="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
106
|
+
echo "alias check-setup='bash ${DEVCONTAINER_SCRIPTS}/check-setup.sh'" >> "$rc"
|
|
107
|
+
|
|
65
108
|
echo "[setup-aliases] Added aliases to $(basename $rc)"
|
|
66
109
|
fi
|
|
67
110
|
done
|
|
68
111
|
|
|
69
112
|
echo "[setup-aliases] Aliases configured:"
|
|
70
|
-
echo " cc
|
|
71
|
-
echo " claude
|
|
72
|
-
echo " ccraw
|
|
113
|
+
echo " cc -> claude with \$CLAUDE_CONFIG_DIR/system-prompt.md"
|
|
114
|
+
echo " claude -> claude with \$CLAUDE_CONFIG_DIR/system-prompt.md"
|
|
115
|
+
echo " ccraw -> vanilla claude without any config"
|
|
116
|
+
echo " cc-tools -> list all available CodeForge tools"
|
|
117
|
+
echo " check-setup -> verify CodeForge setup health"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Configure Git (GitHub CLI) and NPM authentication from .secrets file or environment variables.
|
|
3
|
+
# Environment variables override .secrets values, supporting Codespaces secrets and localEnv.
|
|
4
|
+
# Auth failure should not block other setup steps, so set -e is intentionally omitted.
|
|
5
|
+
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
7
|
+
DEVCONTAINER_DIR="$(dirname "$SCRIPT_DIR")"
|
|
8
|
+
SECRETS_FILE="$DEVCONTAINER_DIR/.secrets"
|
|
9
|
+
|
|
10
|
+
# Source .secrets file if it exists (env vars take precedence via :- defaults below)
|
|
11
|
+
if [ -f "$SECRETS_FILE" ]; then
|
|
12
|
+
echo "[setup-auth] Loading tokens from .secrets file"
|
|
13
|
+
set -a
|
|
14
|
+
source "$SECRETS_FILE"
|
|
15
|
+
set +a
|
|
16
|
+
else
|
|
17
|
+
echo "[setup-auth] No .secrets file found, using environment variables only"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
AUTH_CONFIGURED=false
|
|
21
|
+
|
|
22
|
+
# --- GitHub CLI auth ---
|
|
23
|
+
if [ -n "$GH_TOKEN" ]; then
|
|
24
|
+
echo "[setup-auth] Authenticating GitHub CLI..."
|
|
25
|
+
# Capture token value then unset env var — gh refuses --with-token when
|
|
26
|
+
# GH_TOKEN is already exported (it says "use the env var instead").
|
|
27
|
+
_gh_token="$GH_TOKEN"
|
|
28
|
+
unset GH_TOKEN
|
|
29
|
+
if gh auth login --with-token <<< "$_gh_token" 2>/dev/null; then
|
|
30
|
+
echo "[setup-auth] GitHub CLI authenticated"
|
|
31
|
+
gh auth setup-git 2>/dev/null && echo "[setup-auth] Git credential helper configured"
|
|
32
|
+
AUTH_CONFIGURED=true
|
|
33
|
+
else
|
|
34
|
+
echo "[setup-auth] WARNING: GitHub CLI authentication failed"
|
|
35
|
+
fi
|
|
36
|
+
unset _gh_token
|
|
37
|
+
else
|
|
38
|
+
echo "[setup-auth] GH_TOKEN not set, skipping GitHub CLI auth"
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# --- Git user config ---
|
|
42
|
+
if [ -n "$GH_USERNAME" ]; then
|
|
43
|
+
git config --global user.name "$GH_USERNAME"
|
|
44
|
+
echo "[setup-auth] Git user.name set to $GH_USERNAME"
|
|
45
|
+
unset GH_USERNAME
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if [ -n "$GH_EMAIL" ]; then
|
|
49
|
+
git config --global user.email "$GH_EMAIL"
|
|
50
|
+
echo "[setup-auth] Git user.email set to $GH_EMAIL"
|
|
51
|
+
unset GH_EMAIL
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
# --- NPM auth ---
|
|
55
|
+
if [ -n "$NPM_TOKEN" ]; then
|
|
56
|
+
echo "[setup-auth] Configuring NPM registry auth..."
|
|
57
|
+
if npm config set "//registry.npmjs.org/:_authToken=$NPM_TOKEN" 2>/dev/null; then
|
|
58
|
+
echo "[setup-auth] NPM auth token configured"
|
|
59
|
+
AUTH_CONFIGURED=true
|
|
60
|
+
else
|
|
61
|
+
echo "[setup-auth] WARNING: NPM auth configuration failed"
|
|
62
|
+
fi
|
|
63
|
+
unset NPM_TOKEN
|
|
64
|
+
else
|
|
65
|
+
echo "[setup-auth] NPM_TOKEN not set, skipping NPM auth"
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
# --- Summary ---
|
|
69
|
+
if [ "$AUTH_CONFIGURED" = true ]; then
|
|
70
|
+
echo "[setup-auth] Auth configuration complete"
|
|
71
|
+
else
|
|
72
|
+
echo "[setup-auth] No tokens provided — auth configuration skipped"
|
|
73
|
+
echo "[setup-auth] To configure, copy .secrets.example to .secrets and fill in your tokens"
|
|
74
|
+
fi
|