Skip to content

Commit 3dd6c8a

Browse files
Add open-source project scaffolding
Adds the community health files and CI this repository was missing: MIT license, contributing guide, code of conduct, security policy, CODEOWNERS, issue and pull request templates, Dependabot config, and a lint workflow that runs on every pull request.
1 parent 40a019a commit 3dd6c8a

11 files changed

Lines changed: 263 additions & 0 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @HarnageaGabriel
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Bug report
2+
description: Something behaves differently from what the docs say
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: what-happened
7+
attributes:
8+
label: What happened
9+
description: What you observed, and what you expected instead.
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: repro
14+
attributes:
15+
label: Steps to reproduce
16+
description: The shortest path from a clean checkout to the wrong behaviour.
17+
placeholder: |
18+
1. ...
19+
2. ...
20+
3. observed: ...
21+
validations:
22+
required: true
23+
- type: textarea
24+
id: environment
25+
attributes:
26+
label: Environment
27+
description: OS, shell, runner type, tool versions — whatever is relevant.
28+
validations:
29+
required: true
30+
- type: textarea
31+
id: logs
32+
attributes:
33+
label: Relevant output
34+
description: Paste the decisive lines, not the whole log. Redact secrets and tenant identifiers.
35+
render: shell

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Security vulnerability
4+
url: https://github.com/HarnageaGabriel/token-optimization/security/advisories/new
5+
about: Report privately. Do not open a public issue for a security problem.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Feature request
2+
description: Propose something this repository should also cover
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: The problem
9+
description: What are you unable to do today, and in what real situation did it come up?
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: proposal
14+
attributes:
15+
label: Proposed change
16+
description: What should exist. Concrete beats abstract.
17+
validations:
18+
required: true
19+
- type: textarea
20+
id: alternatives
21+
attributes:
22+
label: Alternatives considered
23+
description: What you tried or rejected, and why it did not fit.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## What this changes
2+
3+
<!-- One or two sentences. What behaviour is different after this PR? -->
4+
5+
## Why
6+
7+
<!-- The problem this solves. Link the issue if there is one: Fixes #123 -->
8+
9+
## How it was verified
10+
11+
<!-- Commands run, workflows executed, output observed. "It should work" is not verification. -->
12+
13+
## Checklist
14+
15+
- [ ] The change is scoped to one problem
16+
- [ ] Docs/README updated if behaviour or usage changed
17+
- [ ] No credentials, tenant ids, subscription ids, or internal hostnames in the diff

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
commit-message:
8+
prefix: "ci"

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ci-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
analyze:
19+
name: PSScriptAnalyzer
20+
runs-on: windows-latest
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v5
24+
25+
- name: Install PSScriptAnalyzer
26+
shell: pwsh
27+
run: Install-Module PSScriptAnalyzer -Force -Scope CurrentUser -ErrorAction Stop
28+
29+
- name: Analyze PowerShell scripts
30+
shell: pwsh
31+
run: |
32+
$results = Invoke-ScriptAnalyzer -Path . -Recurse -Severity Warning, Error
33+
if ($results) {
34+
$results | Format-Table -AutoSize | Out-String -Width 200 | Write-Host
35+
Write-Host "::error::PSScriptAnalyzer reported $($results.Count) finding(s)"
36+
exit 1
37+
}
38+
Write-Host 'No findings.'
39+
40+
json:
41+
name: Validate JSON
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Check out repository
45+
uses: actions/checkout@v5
46+
47+
- name: Parse every JSON file
48+
run: |
49+
set -euo pipefail
50+
find . -name '*.json' -not -path './.git/*' -print0 |
51+
xargs -0 -r -I{} sh -c 'python3 -c "import json,sys; json.load(open(sys.argv[1]))" "{}" || exit 1'
52+
echo "All JSON files parse."

CODE_OF_CONDUCT.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Code of Conduct
2+
3+
## Our pledge
4+
5+
This project is open to anyone. Participants are expected to make it a
6+
harassment-free experience for everyone, regardless of age, body size, visible or
7+
invisible disability, ethnicity, sex characteristics, gender identity and
8+
expression, level of experience, education, socio-economic status, nationality,
9+
personal appearance, race, religion, or sexual identity and orientation.
10+
11+
## Standards
12+
13+
Behaviour that keeps this project healthy:
14+
15+
- being direct about technical disagreement without being personal
16+
- accepting review feedback and giving it with reasons attached
17+
- assuming the other person read the docs and still got stuck
18+
19+
Behaviour that is not acceptable:
20+
21+
- harassment, insults, or personal attacks, public or private
22+
- publishing others' private information without explicit permission
23+
- sustained disruption of discussions or review threads
24+
25+
## Enforcement
26+
27+
Report unacceptable behaviour to `gabriel.harnagea06@gmail.com`. Reports are
28+
reviewed and handled in confidence. The maintainer may remove comments, commits,
29+
issues, and pull requests that violate this Code of Conduct, and may block
30+
repeat offenders.
31+
32+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
33+
version 2.1.

CONTRIBUTING.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Contributing
2+
3+
Thanks for taking the time. This repository bootstraps AI coding-agent
4+
configuration on a machine or a repo, so a broken change costs someone their
5+
working setup. That shapes the rules below.
6+
7+
## Ground rules
8+
9+
- **Idempotence is the contract.** Every script must be safe to re-run. Never
10+
overwrite an existing file or an existing settings key that holds a different
11+
value — skip it and report what was skipped and why.
12+
- **No silent installs.** Do not download or install binaries on the user's
13+
behalf. Detect, report, and let the user decide.
14+
- **No secrets.** No API keys, tokens, tenant ids, or internal hostnames, not
15+
even as placeholders that look real.
16+
17+
## Making a change
18+
19+
1. Fork the repository and branch off `main`.
20+
2. Keep the change scoped to one problem. Two unrelated fixes are two pull requests.
21+
3. Run the script you touched on a clean machine or a throwaway profile, then run
22+
it a second time to prove it is idempotent.
23+
4. Update `README.md` when behaviour or usage changes.
24+
5. Open a pull request and fill in the template, including what you actually ran.
25+
26+
## PowerShell style
27+
28+
- `Set-StrictMode -Version Latest` and `$ErrorActionPreference = 'Stop'` at the top
29+
- Approved verbs for function names (`Get-`, `Set-`, `Test-`, `Install-`)
30+
- Full parameter names in scripts — no positional guessing, no aliases
31+
- Prefer `Test-Path` guards over `try`/`catch` for expected conditions
32+
- The pull-request CI runs PSScriptAnalyzer; warnings and errors block the merge
33+
34+
## Adding a provider
35+
36+
Providers live under `providers/<name>/` and each ships its own `install.ps1`.
37+
A new provider should follow the layout of an existing one, stay idempotent, and
38+
be selectable through `.\init.ps1 -Provider <name>`.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Gabriel Harnagea
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.

0 commit comments

Comments
 (0)