@torus-engineering/tas-kit 1.9.0 → 1.11.1
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/.claude/commands/ado-create.md +17 -17
- package/.claude/commands/ado-delete.md +11 -11
- package/.claude/commands/ado-get.md +12 -12
- package/.claude/commands/ado-status.md +12 -12
- package/.claude/commands/ado-update.md +15 -15
- package/.claude/commands/tas-adr.md +33 -33
- package/.claude/commands/tas-apitest-plan.md +173 -173
- package/.claude/commands/tas-apitest.md +143 -143
- package/.claude/commands/tas-brainstorm.md +14 -14
- package/.claude/commands/tas-bug.md +113 -113
- package/.claude/commands/tas-design.md +37 -37
- package/.claude/commands/tas-dev.md +128 -128
- package/.claude/commands/tas-e2e-mobile.md +155 -155
- package/.claude/commands/tas-e2e-web.md +163 -163
- package/.claude/commands/tas-e2e.md +102 -102
- package/.claude/commands/tas-epic.md +35 -35
- package/.claude/commands/tas-feature.md +47 -47
- package/.claude/commands/tas-fix.md +51 -51
- package/.claude/commands/tas-functest-mobile.md +144 -144
- package/.claude/commands/tas-functest-web.md +192 -192
- package/.claude/commands/tas-functest.md +76 -76
- package/.claude/commands/tas-init.md +14 -14
- package/.claude/commands/tas-plan.md +198 -200
- package/.claude/commands/tas-prd.md +37 -37
- package/.claude/commands/tas-review.md +111 -111
- package/.claude/commands/tas-sad.md +43 -43
- package/.claude/commands/tas-security.md +87 -81
- package/.claude/commands/tas-spec.md +20 -20
- package/.claude/commands/tas-status.md +13 -13
- package/.claude/commands/tas-story.md +91 -91
- package/.claude/commands/tas-verify.md +51 -51
- package/.claude/rules/common/post-review-agent.md +49 -49
- package/.claude/rules/common/project-status.md +14 -14
- package/.claude/rules/common/stack-detection.md +6 -6
- package/.claude/rules/common/token-logging.md +27 -27
- package/.claude/rules/csharp/api-testing.md +171 -171
- package/.claude/skills/ado-integration/SKILL.md +36 -36
- package/.claude/skills/tas-conventions/SKILL.md +32 -32
- package/.claude/skills/tas-implementation-complete/SKILL.md +100 -99
- package/.claude/skills/tas-tdd/SKILL.md +123 -123
- package/.claude/skills/token-logger/SKILL.md +19 -19
- package/.tas/README.md +266 -1520
- package/.tas/checklists/code-review.md +13 -13
- package/.tas/checklists/security.md +3 -3
- package/.tas/checklists/story-done.md +11 -11
- package/.tas/hooks/README.md +138 -0
- package/.tas/hooks/pre-commit +26 -0
- package/.tas/hooks/security-scan.js +599 -0
- package/.tas/project-status-example.yaml +3 -3
- package/.tas/tas-example.yaml +25 -8
- package/.tas/templates/ADR.md +16 -16
- package/.tas/templates/API-Test-Spec.md +3 -3
- package/.tas/templates/Bug.md +12 -12
- package/.tas/templates/Design-Spec.md +8 -8
- package/.tas/templates/E2E-Execution-Report.md +1 -1
- package/.tas/templates/Epic.md +1 -1
- package/.tas/templates/Feature.md +10 -10
- package/.tas/templates/Func-Test-Spec.md +3 -3
- package/.tas/templates/SAD.md +106 -106
- package/.tas/templates/Security-Report.md +3 -3
- package/.tas/templates/Story.md +9 -9
- package/.tas/tools/tas-ado-readme.md +169 -169
- package/.tas/tools/tas-ado.py +1 -1
- package/CLAUDE-Example.md +37 -58
- package/README.md +294 -42
- package/bin/cli.js +24 -7
- package/lib/install.js +161 -47
- package/package.json +1 -1
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
# Code Review Checklist
|
|
2
2
|
|
|
3
3
|
## Architecture
|
|
4
|
-
- [ ] Code
|
|
5
|
-
- [ ]
|
|
6
|
-
- [ ]
|
|
4
|
+
- [ ] Code aligns with SAD
|
|
5
|
+
- [ ] No ADR violations
|
|
6
|
+
- [ ] Correct layer separation
|
|
7
7
|
|
|
8
8
|
## Code Quality
|
|
9
|
-
- [ ] Naming
|
|
10
|
-
- [ ]
|
|
11
|
-
- [ ] Error handling
|
|
12
|
-
- [ ]
|
|
13
|
-
- [ ]
|
|
9
|
+
- [ ] Naming follows conventions in CLAUDE.md
|
|
10
|
+
- [ ] No magic numbers/strings
|
|
11
|
+
- [ ] Error handling complete
|
|
12
|
+
- [ ] Meaningful logging
|
|
13
|
+
- [ ] No code duplication
|
|
14
14
|
|
|
15
15
|
## Security
|
|
16
16
|
- [ ] Input validation
|
|
17
17
|
- [ ] No SQL injection risk
|
|
18
18
|
- [ ] No XSS risk
|
|
19
|
-
- [ ] Sensitive data
|
|
19
|
+
- [ ] Sensitive data not logged
|
|
20
20
|
|
|
21
21
|
## Testing
|
|
22
22
|
- [ ] Unit tests cover happy path
|
|
23
23
|
- [ ] Unit tests cover edge cases
|
|
24
|
-
- [ ] Tests
|
|
24
|
+
- [ ] Tests have clear assertions
|
|
25
25
|
|
|
26
26
|
## Performance
|
|
27
|
-
- [ ]
|
|
28
|
-
- [ ] Async/await
|
|
29
|
-
- [ ]
|
|
27
|
+
- [ ] No N+1 queries
|
|
28
|
+
- [ ] Async/await used correctly
|
|
29
|
+
- [ ] Resources disposed properly
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Security Checklist - .NET Specific
|
|
2
2
|
|
|
3
3
|
## Authentication & Authorization
|
|
4
|
-
- [ ] JWT validation
|
|
4
|
+
- [ ] JWT validation correct
|
|
5
5
|
- [ ] Role-based authorization
|
|
6
|
-
- [ ] Anti-forgery token
|
|
6
|
+
- [ ] Anti-forgery token for forms
|
|
7
7
|
|
|
8
8
|
## Data Protection
|
|
9
|
-
- [ ] Connection strings
|
|
9
|
+
- [ ] Connection strings in secrets, not hardcoded
|
|
10
10
|
- [ ] PII data encrypted at rest
|
|
11
11
|
- [ ] HTTPS enforced
|
|
12
12
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# Definition of Done Checklist
|
|
2
2
|
|
|
3
3
|
## Code
|
|
4
|
-
- [ ] Code implemented
|
|
5
|
-
- [ ]
|
|
6
|
-
- [ ]
|
|
4
|
+
- [ ] Code implemented per acceptance criteria
|
|
5
|
+
- [ ] Follows conventions in CLAUDE.md
|
|
6
|
+
- [ ] Each public method has XML doc comment
|
|
7
7
|
|
|
8
8
|
## Testing
|
|
9
9
|
- [ ] Unit tests pass (happy path + edge cases + negative cases)
|
|
10
|
-
- [ ] No regression
|
|
10
|
+
- [ ] No regression on existing tests
|
|
11
11
|
|
|
12
12
|
## Review
|
|
13
|
-
- [ ] Code review passed (
|
|
14
|
-
- [ ]
|
|
13
|
+
- [ ] Code review passed (per code-review checklist)
|
|
14
|
+
- [ ] If auto_review = true, passed automated review
|
|
15
15
|
|
|
16
16
|
## Documentation
|
|
17
|
-
- [ ] Technical notes
|
|
18
|
-
- [ ]
|
|
17
|
+
- [ ] Technical notes in Story updated
|
|
18
|
+
- [ ] If API changes, corresponding docs updated
|
|
19
19
|
|
|
20
20
|
## Status
|
|
21
|
-
- [ ] Story status
|
|
22
|
-
- [ ] project-status.yaml
|
|
23
|
-
- [ ] Commit message
|
|
21
|
+
- [ ] Story status updated in Story file
|
|
22
|
+
- [ ] project-status.yaml updated
|
|
23
|
+
- [ ] Commit message follows correct format
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# TAS Kit — Pre-commit Security Hook
|
|
2
|
+
|
|
3
|
+
Fast, deterministic scan of staged files on every `git commit`. Blocks commits
|
|
4
|
+
that contain hardcoded secrets, private keys, `.env` files, or (optionally)
|
|
5
|
+
findings from a deeper AI-powered audit.
|
|
6
|
+
|
|
7
|
+
## Files
|
|
8
|
+
|
|
9
|
+
| File | Role |
|
|
10
|
+
|---|---|
|
|
11
|
+
| `security-scan.js` | Vanilla Node scanner. No runtime deps. Reads `tas.yaml` for config. |
|
|
12
|
+
| `pre-commit` | Shell wrapper invoked by git. Calls the scanner via `node`. |
|
|
13
|
+
| `README.md` | This file. |
|
|
14
|
+
|
|
15
|
+
## How it gets wired
|
|
16
|
+
|
|
17
|
+
The installer offers two modes during `npx @torus-engineering/tas-kit install`:
|
|
18
|
+
|
|
19
|
+
### 1. Husky mode (recommended for Node/TS projects)
|
|
20
|
+
|
|
21
|
+
Adds `husky` to devDependencies, sets a `"prepare": "husky"` script, and creates
|
|
22
|
+
`.husky/pre-commit` that sources `.tas/hooks/pre-commit`. The hook is shared
|
|
23
|
+
across the team via git — anyone cloning the repo gets it after `npm install`.
|
|
24
|
+
|
|
25
|
+
### 2. Native mode (works for any stack)
|
|
26
|
+
|
|
27
|
+
Copies `.tas/hooks/pre-commit` directly into `.git/hooks/pre-commit` (and
|
|
28
|
+
`chmod +x` on Unix). Local to each clone — each teammate has to re-run the
|
|
29
|
+
installer or copy the hook themselves. Zero Node dependency added.
|
|
30
|
+
|
|
31
|
+
### 3. Skip
|
|
32
|
+
|
|
33
|
+
No hook wiring. You can always run `/tas-security --staged` manually, or wire
|
|
34
|
+
it later by re-running the installer.
|
|
35
|
+
|
|
36
|
+
## 3-Tier Scan
|
|
37
|
+
|
|
38
|
+
| Tier | When | What runs | Blocks? | Cost |
|
|
39
|
+
|---|---|---|---|---|
|
|
40
|
+
| 1 | Always | Built-in regex on staged files (~45 secret patterns) | Yes, if severity ∈ `block_on` | < 1s |
|
|
41
|
+
| 2 | If tool on PATH | `gitleaks` or `trufflehog` — community-maintained rules | Yes, if severity ∈ `block_on` | 2–10s |
|
|
42
|
+
| 3 | Opt-in, **local only** | AI deep scan via `claude` / `codex` / `gemini`, writes `docs/security-report.md` | **No — report-only** | 15–60s |
|
|
43
|
+
|
|
44
|
+
**Tier 1 & 2** are the hard gate — they stop obvious credential leaks on every
|
|
45
|
+
commit.
|
|
46
|
+
|
|
47
|
+
**Tier 3** is optional and local-only. It's designed for devs who want a
|
|
48
|
+
second-opinion AI review before pushing. Uses your personal Claude Code (or
|
|
49
|
+
Codex / Gemini) subscription — no per-call API charges because quota resets
|
|
50
|
+
on a rolling window. Output goes to `docs/security-report.md`; if you want
|
|
51
|
+
reviewers to see it, `git add` it into your commit. This tier is deliberately
|
|
52
|
+
NOT wired into CI — running it there would burn paid API tokens, and PR
|
|
53
|
+
review already gives humans a chance to catch issues.
|
|
54
|
+
|
|
55
|
+
## Config (in `tas.yaml`)
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
security:
|
|
59
|
+
pre_commit_hook: true # false → disable hook without uninstalling
|
|
60
|
+
external_scanner: auto # auto | gitleaks | trufflehog | none — tier 2
|
|
61
|
+
tool: claude # claude | codex | gemini | none — tier 3 AI
|
|
62
|
+
deep_scan_on_every_commit: false
|
|
63
|
+
block_on: [critical, high]
|
|
64
|
+
allow_bypass: true
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- **pre_commit_hook** — master switch. `false` → scanner exits early.
|
|
68
|
+
- **external_scanner** — tier 2 control.
|
|
69
|
+
- `auto` (default) → try `gitleaks` first, then `trufflehog`. Silent skip if
|
|
70
|
+
neither is on PATH. Zero cost when not installed.
|
|
71
|
+
- `gitleaks` / `trufflehog` → force that specific tool; warn if missing.
|
|
72
|
+
- `none` → disable tier 2 entirely.
|
|
73
|
+
- **tool** — tier 3 AI CLI. Must be on `PATH` when deep scan is triggered.
|
|
74
|
+
- **deep_scan_on_every_commit** — `false` = skip tier 3 locally (default).
|
|
75
|
+
`true` = also invoke `tool` on the staged diff every commit (slow).
|
|
76
|
+
- **block_on** — severities that cause exit code 1. Medium/Low always pass.
|
|
77
|
+
- **allow_bypass** — cosmetic: when `true`, scanner prints bypass hints.
|
|
78
|
+
Git always honors `--no-verify` regardless.
|
|
79
|
+
|
|
80
|
+
## Installing tier 2 scanners (optional)
|
|
81
|
+
|
|
82
|
+
**gitleaks** — fastest, purpose-built for pre-commit:
|
|
83
|
+
- Windows: `scoop install gitleaks` or download binary from releases
|
|
84
|
+
- macOS: `brew install gitleaks`
|
|
85
|
+
- Linux: `brew install gitleaks` or apt/download
|
|
86
|
+
|
|
87
|
+
**trufflehog** — slower but can verify secrets against live APIs:
|
|
88
|
+
- Windows: `scoop install trufflehog`
|
|
89
|
+
- macOS: `brew install trufflehog`
|
|
90
|
+
- Linux: `curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/bin`
|
|
91
|
+
|
|
92
|
+
No action needed if you don't want tier 2 — the hook silently skips it.
|
|
93
|
+
|
|
94
|
+
## Behavior on CI
|
|
95
|
+
|
|
96
|
+
If `CI=true` (or `CI=1`) is in the environment, the scanner force-enables
|
|
97
|
+
deep scan regardless of `deep_scan_on_every_commit`. This lets CI gates run
|
|
98
|
+
the full AI audit even when local commits stay fast.
|
|
99
|
+
|
|
100
|
+
## Bypass
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
SKIP_SECURITY_SCAN=1 git commit -m "..."
|
|
104
|
+
git commit --no-verify -m "..."
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Document the reason in the commit body when bypassing.
|
|
108
|
+
|
|
109
|
+
## What the fast scan catches
|
|
110
|
+
|
|
111
|
+
- AWS access keys (`AKIA...`)
|
|
112
|
+
- GitHub / Slack / Google API tokens
|
|
113
|
+
- Private keys (RSA, OpenSSH, EC, DSA, PGP)
|
|
114
|
+
- Hardcoded secrets: `api_key|secret|password|token = "..."` patterns
|
|
115
|
+
- JWTs embedded in source
|
|
116
|
+
- DB connection strings with credentials
|
|
117
|
+
- `.env` files staged (except `.env.example` / `.sample` / `.template`)
|
|
118
|
+
|
|
119
|
+
Binary files, large files (>2MB), and common asset extensions are skipped.
|
|
120
|
+
|
|
121
|
+
## What deep scan catches (when enabled)
|
|
122
|
+
|
|
123
|
+
OWASP Top 10, injection, authz flaws, unsafe deserialization — whatever the
|
|
124
|
+
configured AI CLI reports. Output must follow the grep-friendly format:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
<SEVERITY> | <file:line> | <description>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Anything not in that format is ignored. If the tool reports `NO FINDINGS`,
|
|
131
|
+
scan passes.
|
|
132
|
+
|
|
133
|
+
## Extending
|
|
134
|
+
|
|
135
|
+
- **Add a pattern:** edit `PATTERNS` array in `security-scan.js`.
|
|
136
|
+
- **Change tool invocation:** edit the `tools` map (bin + args).
|
|
137
|
+
- **Report findings to `docs/security-report.md`:** not done by default.
|
|
138
|
+
Use `/tas-security` command for a proper run that writes the report.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# TAS Kit — pre-commit security hook
|
|
3
|
+
#
|
|
4
|
+
# Invoked by either:
|
|
5
|
+
# - husky (.husky/pre-commit sources this file), or
|
|
6
|
+
# - native git hook (.git/hooks/pre-commit is a copy of this file)
|
|
7
|
+
#
|
|
8
|
+
# Delegates to .tas/hooks/security-scan.js. Exits 0 if ok, 1 to block commit.
|
|
9
|
+
|
|
10
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
11
|
+
echo "[TAS Security] node not found on PATH — skipping scan" >&2
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
16
|
+
if [ -z "$REPO_ROOT" ]; then
|
|
17
|
+
exit 0
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
SCANNER="$REPO_ROOT/.tas/hooks/security-scan.js"
|
|
21
|
+
if [ ! -f "$SCANNER" ]; then
|
|
22
|
+
echo "[TAS Security] Scanner not found at $SCANNER — did you run 'npx @torus-engineering/tas-kit install'?" >&2
|
|
23
|
+
exit 0
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
exec node "$SCANNER"
|