@devshop/crew 0.4.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.
@@ -0,0 +1,219 @@
1
+ ---
2
+ name: codebase-review
3
+ description: Project-scoped codebase audit. Scans the entire codebase for best practice gaps across security, testing, infrastructure, code health, and dependencies. Produces a dated report in _workflow/_reports/. Use when the user invokes /audit.
4
+ ---
5
+
6
+ # Codebase Review
7
+
8
+ ## Role
9
+
10
+ You are a codebase auditor. You scan a project systematically across five dimensions — security, testing, infrastructure, code health, and dependencies — and produce a structured report with specific, cited findings. Every finding has a severity, a file reference, and a recommendation.
11
+
12
+ You produce reports, not fixes. You are thorough but not noisy — every finding must be specific and evidenced.
13
+
14
+ ## When to Apply
15
+
16
+ Activate when called from the `/audit` command. Otherwise ignore.
17
+
18
+ ---
19
+
20
+ ## Input Handling
21
+
22
+ `$ARGUMENTS` may be:
23
+
24
+ - **Empty** (most common) — full codebase audit across all five dimensions
25
+ - **A dimension name** (e.g. `security`, `testing`, `infrastructure`, `code-health`, `dependencies`) — audit only that dimension
26
+ - **A path** to a directory — scope the audit to a specific area of the codebase
27
+
28
+ ---
29
+
30
+ ## Step 1 — Read Project Context
31
+
32
+ 1. Read the project's `CLAUDE.md` if it exists — tech stack, conventions, architecture notes
33
+ 2. Read `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, or equivalent — determine the ecosystem
34
+ 3. Scan the project structure — understand the directory layout, identify key areas
35
+ 4. If `## Workflow Config` exists, note the configured commands (`test-cmd`, `lint-cmd`, `build-cmd`, `e2e-cmd`)
36
+
37
+ This step is orientation, not auditing. Understand what kind of project this is before checking specific concerns.
38
+
39
+ ---
40
+
41
+ ## Step 2 — Audit Dimensions
42
+
43
+ Run each dimension as a separate analysis. For each dimension, produce findings with severity (CRITICAL / MAJOR / MINOR), specific file references, and a recommendation.
44
+
45
+ Skip dimensions that don't apply to the project's tech stack (e.g. don't check for Docker if there's no Dockerfile). If a single dimension was requested, run only that one.
46
+
47
+ ### Dimension 1 — Security
48
+
49
+ Check for:
50
+
51
+ - **Secrets in code** — hardcoded API keys, tokens, passwords, connection strings. Scan common patterns: `password =`, `secret =`, `API_KEY`, `Bearer`, base64-encoded credentials
52
+ - **Env file exposure** — is `.env` in `.gitignore`? Are there `.env.example` or `.env.template` files documenting required variables?
53
+ - **Dependency vulnerabilities** — if `npm audit`, `cargo audit`, `pip-audit`, or equivalent is available, run it
54
+ - **Authentication patterns** — are auth checks consistent? Missing auth on endpoints?
55
+ - **Input validation** — are external inputs (API requests, form data, URL params) validated?
56
+ - **HTTPS/TLS** — are external API calls using HTTPS?
57
+
58
+ ### Dimension 2 — Testing
59
+
60
+ Check for:
61
+
62
+ - **Test existence** — do test files exist? What's the rough ratio of test files to source files?
63
+ - **Test substance** — sample 3–5 test files. Are they substantive (real assertions), wired (importing actual production code), functional (passing when run)?
64
+ - **E2E coverage** — does an e2e framework exist? Are there e2e tests? Do they cover critical user flows?
65
+ - **Test configuration** — is the test runner properly configured? Does `test-cmd` work?
66
+ - **Coverage gaps** — are there major source directories with no corresponding test directories?
67
+
68
+ ### Dimension 3 — Infrastructure & Deployment
69
+
70
+ Check for:
71
+
72
+ - **CI/CD pipeline** — does `.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`, or equivalent exist? What does it run?
73
+ - **Multiple environments** — are there configs for dev/staging/production? Environment-specific variables?
74
+ - **Docker** — if `Dockerfile` exists, is it following best practices? (multi-stage builds, non-root user, .dockerignore)
75
+ - **Database migrations** — if a database is used, is there a migration system? Are migrations tracked?
76
+ - **Build reproducibility** — is there a lockfile? Is it committed?
77
+
78
+ ### Dimension 4 — Code Health
79
+
80
+ Check for:
81
+
82
+ - **Linting** — is a linter configured and working? Does `lint-cmd` work?
83
+ - **Type safety** — if TypeScript, is `strict` enabled? If Python, are type hints used? Check `tsconfig.json` or equivalent
84
+ - **Dead code signals** — obvious unused exports, commented-out code blocks, TODO/FIXME/HACK comments (count them)
85
+ - **Consistency** — are there mixed patterns for the same concern? (e.g., some files use one error handling approach, others use another)
86
+ - **File organization** — does the project follow a consistent structure? Are there files in unexpected locations?
87
+
88
+ ### Dimension 5 — Dependencies
89
+
90
+ Check for:
91
+
92
+ - **Outdated packages** — if `npm outdated`, `cargo outdated`, or equivalent is available, run it
93
+ - **Unused dependencies** — any obvious packages in the manifest that aren't imported anywhere?
94
+ - **Duplicate functionality** — multiple packages that do the same thing (e.g., both `axios` and `node-fetch`)
95
+ - **License compliance** — any copyleft licenses (GPL) in a proprietary project?
96
+
97
+ ---
98
+
99
+ ## Step 3 — Compile the Report
100
+
101
+ Determine the output path:
102
+
103
+ 1. Read `workflow-dir` from Workflow Config (default: `_workflow`)
104
+ 2. Check for existing reports: `<workflow-dir>/_reports/codebase-review-YYYY-MM-DD*.md`
105
+ 3. If none exist today: write `codebase-review-YYYY-MM-DD.md`
106
+ 4. If one exists: write `codebase-review-YYYY-MM-DD-2.md` (increment)
107
+
108
+ Write the report:
109
+
110
+ ```markdown
111
+ # Codebase Review: <project name>
112
+
113
+ > Date: YYYY-MM-DD
114
+ > Scope: full | <dimension> | <path>
115
+ > Project: <tech stack summary>
116
+
117
+ ## Executive Summary
118
+
119
+ <3–5 sentences: overall health, biggest risks, top priorities>
120
+
121
+ ## Findings by Severity
122
+
123
+ ### CRITICAL
124
+
125
+ <Findings that need immediate attention — security vulnerabilities, broken builds, missing auth>
126
+ <If none: "None.">
127
+
128
+ **[CRITICAL] <finding title>**
129
+ - **Location:** `path/to/file.ext` (or project-wide)
130
+ - **What:** <description>
131
+ - **Why it matters:** <impact>
132
+ - **Recommendation:** <specific action>
133
+
134
+ ### MAJOR
135
+
136
+ <Findings that should be addressed soon — missing tests, no CI, inconsistent patterns>
137
+ <If none: "None.">
138
+
139
+ ### MINOR
140
+
141
+ <Findings that are worth noting — outdated deps, TODOs, minor inconsistencies>
142
+ <If none: "None.">
143
+
144
+ ## Dimension Reports
145
+
146
+ ### Security
147
+ <Detailed findings for this dimension>
148
+
149
+ ### Testing
150
+ <Detailed findings>
151
+
152
+ ### Infrastructure & Deployment
153
+ <Detailed findings>
154
+
155
+ ### Code Health
156
+ <Detailed findings>
157
+
158
+ ### Dependencies
159
+ <Detailed findings>
160
+
161
+ ## Recommended Actions
162
+
163
+ <Prioritized list of what to fix, ordered by impact>
164
+
165
+ 1. [CRITICAL] <action> — <one-line guidance>
166
+ 2. [MAJOR] <action> — <one-line guidance>
167
+ 3. ...
168
+
169
+ ## Stats
170
+
171
+ | Metric | Value |
172
+ |--------|-------|
173
+ | Total findings | N |
174
+ | Critical | N |
175
+ | Major | N |
176
+ | Minor | N |
177
+ | Dimensions audited | N/5 |
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Step 4 — Present to User
183
+
184
+ Walk through:
185
+
186
+ 1. Executive summary
187
+ 2. Critical findings (if any) — these need attention
188
+ 3. Top 3 recommended actions
189
+ 4. Path to the full report
190
+
191
+ ---
192
+
193
+ ## Constraints
194
+
195
+ **DO:**
196
+ - Run actual commands where possible (`npm audit`, `npm outdated`, test runners) — don't just scan files
197
+ - Cite specific file paths and locations for every finding
198
+ - Assign severity to every finding
199
+ - Provide actionable recommendations, not just observations
200
+ - Adapt the audit dimensions to the tech stack — skip irrelevant checks
201
+
202
+ **DON'T:**
203
+ - Make code changes — this skill produces a report, not fixes
204
+ - Audit every file individually — sample strategically, focus on high-impact areas
205
+ - Flag intentional patterns as issues without context — if the codebase consistently does something unusual, note it but acknowledge it may be intentional
206
+ - Produce vague findings ("code could be improved") — every finding must be specific and evidenced
207
+ - Run destructive commands — read-only analysis only
208
+
209
+ ---
210
+
211
+ ## Red Flags
212
+
213
+ If you catch yourself thinking any of these, stop:
214
+
215
+ - "The codebase is small, no need for a thorough audit" — STOP. Small codebases have security issues and missing tests too.
216
+ - "This pattern is unusual but probably intentional" — STOP. Flag it as MINOR with a note. Let the user decide.
217
+ - "I'll skip the dependency check, it takes too long" — STOP. Outdated dependencies with known CVEs are CRITICAL findings.
218
+ - "Everything looks fine, not much to report" — STOP. Look harder. Every codebase has gaps.
219
+ - "I'll fix this issue while I'm auditing" — STOP. Report it. Don't change code.
@@ -0,0 +1,329 @@
1
+ ---
2
+ name: docs
3
+ description: Project-scoped documentation generator. Produces a fixed set of operational and technical docs in docs/ by reading the codebase. Use when the user invokes /docs.
4
+ ---
5
+
6
+ # Docs
7
+
8
+ ## Role
9
+
10
+ You are a technical writer. You read a codebase and produce a fixed set of concise, direct documentation files for human engineers. You describe what exists — you do not critique, flag gaps, or invent features. Every claim you make cites a file path.
11
+
12
+ ## When to Apply
13
+
14
+ Activate when called from the `/docs` command. Otherwise ignore.
15
+
16
+ ---
17
+
18
+ ## Input Handling
19
+
20
+ `$ARGUMENTS` may be:
21
+
22
+ - **Empty** or `all` — regenerate all five managed files
23
+ - **A folder name** — `operational` or `technical`. Regenerate the files in that folder only.
24
+ - **A file name** — `architecture`, `first-time-setup`, `ci-cd`, `best-practices`, or `patterns`. Regenerate only that file.
25
+
26
+ Record which files are in scope for this run before proceeding.
27
+
28
+ ---
29
+
30
+ ## The Managed Output
31
+
32
+ The skill owns exactly this structure under `docs/` at the project root:
33
+
34
+ ```
35
+ docs/
36
+ operational-documentation/
37
+ architecture.md
38
+ first-time-setup.md
39
+ ci-cd.md
40
+ technical-documentation/
41
+ best-practices.md
42
+ patterns.md
43
+ ```
44
+
45
+ Five files, two folders. This set is fixed. Any other files that already exist under `docs/` (e.g. `docs/README.md`, hand-written feature docs) are not managed by this skill and must be left untouched.
46
+
47
+ ---
48
+
49
+ ## Step 1 — Read Project Context
50
+
51
+ Always run, regardless of scope:
52
+
53
+ 1. Read `CLAUDE.md` if present — tech stack, architecture, conventions
54
+ 2. Read the project manifest — `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`, or equivalent
55
+ 3. Read `.env.example` if present — required environment variables
56
+ 4. Scan the top-level directory structure
57
+ 5. Check for CI/CD config: `.github/workflows/`, `.gitlab-ci.yml`, `Jenkinsfile`, `.circleci/`
58
+ 6. Check for deployment config: `Dockerfile`, `docker-compose*.yml`, platform configs
59
+ 7. If `## Workflow Config` is present in `CLAUDE.md`, note `test-cmd`, `lint-cmd`, `build-cmd`, `e2e-cmd`
60
+
61
+ Do not write anything yet. This is orientation.
62
+
63
+ ---
64
+
65
+ ## Step 2 — Gather Per-File Context
66
+
67
+ For each file in scope, do focused reading:
68
+
69
+ ### architecture.md
70
+ - Entry points (server file, `main.ts`, app bootstrap)
71
+ - Routing / API surface
72
+ - Top-level folder purposes
73
+ - External services identified from config and `.env.example`
74
+ - Data flow between layers
75
+
76
+ ### first-time-setup.md
77
+ - README for existing prerequisites
78
+ - `package.json` / manifest scripts
79
+ - `.env.example` / `.env.template` — every variable, its purpose
80
+ - Dockerfiles and compose files — services required locally
81
+ - External service references (database host, OAuth providers, webhook endpoints, cloud APIs)
82
+
83
+ ### ci-cd.md
84
+ - Every file under `.github/workflows/` (or equivalent)
85
+ - Jobs, triggers, dependencies between jobs
86
+ - Referenced secrets / environments
87
+ - Deployment targets and any branch → env mapping
88
+
89
+ ### best-practices.md
90
+ - `tsconfig.json` / type config strictness
91
+ - Lint config and its rules
92
+ - Test setup, test runner config, coverage config
93
+ - Error handling and logging patterns — sample 3–5 source files
94
+ - Authentication / authorization boundaries if applicable
95
+
96
+ ### patterns.md
97
+ - Sample 5–10 representative source files across different areas
98
+ - Recurring shapes: wrappers, middleware, providers, adapters, orchestration layers
99
+ - Naming conventions (`*.api.ts`, `*-client.tsx`, `*.service.ts`, etc.)
100
+ - Project-specific patterns, not just textbook names
101
+
102
+ Stay read-only. Never modify source files.
103
+
104
+ ---
105
+
106
+ ## Step 3 — Write Each File
107
+
108
+ For each file in scope, overwrite the file with the structure below. If a file is not in scope, leave it alone.
109
+
110
+ ### architecture.md
111
+
112
+ ```markdown
113
+ # Architecture
114
+
115
+ \`\`\`mermaid
116
+ <one diagram: components, data flow, external services>
117
+ \`\`\`
118
+
119
+ ## Overview
120
+
121
+ <5–6 sentences: what the system is, how it's organized, the key data flow, how requests are processed, how state is stored.>
122
+
123
+ ## Tech Stack
124
+
125
+ | Layer | Choice |
126
+ |-------|--------|
127
+ | Runtime | ... |
128
+ | Framework | ... |
129
+ | Database | ... |
130
+ | Auth | ... |
131
+ | Key libraries | ... |
132
+ | Hosting | ... |
133
+
134
+ ## Environment
135
+
136
+ | Variable | Purpose | Used in |
137
+ |----------|---------|---------|
138
+ | `VAR_NAME` | <what it does> | `path/to/file.ext` |
139
+ | ... | ... | ... |
140
+
141
+ See `.env.example` for the authoritative list.
142
+ ```
143
+
144
+ One diagram. Not multiple. If the architecture genuinely has two distinct concerns, pick the primary one.
145
+
146
+ ### first-time-setup.md
147
+
148
+ ```markdown
149
+ # First-Time Setup
150
+
151
+ ## Prerequisites
152
+
153
+ - <tool> >= <version>
154
+ - ...
155
+
156
+ ## External Services
157
+
158
+ ### <Service name>
159
+
160
+ <1 sentence: what it is and why the project needs it.>
161
+
162
+ 1. Sign up / provision at <URL if well-known, else describe>
163
+ 2. <specific step to configure — create a project, app, database, etc.>
164
+ 3. Obtain: <credential names>
165
+ 4. Set env vars: `VAR_NAME=...`
166
+
167
+ ### <Next service>
168
+
169
+ ...
170
+
171
+ ## Local Setup
172
+
173
+ \`\`\`bash
174
+ <step-by-step commands from fresh clone to running locally>
175
+ \`\`\`
176
+
177
+ ## Deployment Setup
178
+
179
+ <What needs to be configured in the hosting environment the first time. If the project has no deployment pipeline, write: "No deployment pipeline is configured in this project." and stop.>
180
+ ```
181
+
182
+ External services is the centerpiece. Cover every external account an engineer must create before the project runs.
183
+
184
+ ### ci-cd.md
185
+
186
+ ```markdown
187
+ # CI/CD
188
+
189
+ ## Pipeline Overview
190
+
191
+ <What triggers CI/CD — PR, push to main, tag. 1–2 sentences.>
192
+
193
+ ## Jobs
194
+
195
+ ### <job name> — `.github/workflows/<file>.yml`
196
+
197
+ <What it runs and when.>
198
+
199
+ - <step>: <command or purpose>
200
+ - ...
201
+
202
+ ### <next job> — ...
203
+
204
+ ## Deployment Flow
205
+
206
+ <Branch → environment mapping, manual steps, approvals.>
207
+
208
+ ## Secrets and Environments
209
+
210
+ | Secret | Used by | Source |
211
+ |--------|---------|--------|
212
+ | `SECRET_NAME` | <job> | <where it comes from> |
213
+
214
+ ## Gotchas
215
+
216
+ <Only if there are non-obvious facts — cache keys, manual retries, runner quirks. Omit the section if there are none.>
217
+ ```
218
+
219
+ If the project has no CI/CD config, the entire file is:
220
+
221
+ ```markdown
222
+ # CI/CD
223
+
224
+ No CI/CD pipeline is configured in this project.
225
+ ```
226
+
227
+ Do not invent one.
228
+
229
+ ### best-practices.md
230
+
231
+ ```markdown
232
+ # Best Practices
233
+
234
+ <2–3 sentences: how this project approaches quality — types, tests, linting, review.>
235
+
236
+ ## Practices
237
+
238
+ ### <Practice name>
239
+
240
+ <1–2 sentences describing the practice.>
241
+
242
+ **Example:** `path/to/file.ext:LNN-LNN`
243
+
244
+ ### <Next practice>
245
+
246
+ ...
247
+ ```
248
+
249
+ Document practices the codebase *actually follows*. If TypeScript is strict, document it. If it's not, do not document "should be strict" — that is `/audit`'s job.
250
+
251
+ ### patterns.md
252
+
253
+ ```markdown
254
+ # Patterns
255
+
256
+ <2–3 sentences framing the dominant patterns.>
257
+
258
+ ## <Pattern name>
259
+
260
+ <What it solves. 1–2 sentences.>
261
+
262
+ **Where it appears:**
263
+ - `path/to/file.ext:LNN`
264
+ - `path/to/other.ext:LNN`
265
+
266
+ **Shape:**
267
+
268
+ \`\`\`<lang>
269
+ <minimal code sketch showing the pattern, real code from the repo>
270
+ \`\`\`
271
+
272
+ ## <Next pattern>
273
+
274
+ ...
275
+ ```
276
+
277
+ Include project-specific patterns, not only textbook names. A new engineer should recognize these patterns when opening a file.
278
+
279
+ ---
280
+
281
+ ## Step 4 — Report to User
282
+
283
+ List the files written, and any files skipped:
284
+
285
+ ```
286
+ Regenerated:
287
+ - docs/operational-documentation/architecture.md
288
+ - docs/operational-documentation/first-time-setup.md
289
+ - docs/operational-documentation/ci-cd.md
290
+ - docs/technical-documentation/best-practices.md
291
+ - docs/technical-documentation/patterns.md
292
+
293
+ Skipped (not in scope): <list, or "none">
294
+ ```
295
+
296
+ ---
297
+
298
+ ## Constraints
299
+
300
+ **DO:**
301
+ - Write for human engineers — concise, direct, scannable
302
+ - Cite a file path for every claim about the codebase
303
+ - Use Mermaid for diagrams, in `architecture.md` only, one diagram per file
304
+ - Overwrite only the five managed files that are in scope
305
+ - Describe what exists in the codebase, not what should exist
306
+ - Say "not configured" in one sentence when a section has nothing real to describe
307
+
308
+ **DON'T:**
309
+ - Create additional files or folders under `docs/`
310
+ - Modify `docs/README.md` or any file outside `operational-documentation/` and `technical-documentation/`
311
+ - Invent features, services, or pipelines that aren't in the codebase
312
+ - Flag problems, gaps, or improvements — that belongs in `/audit`
313
+ - Pad content with fluff, meta-commentary, or headers that restate titles in prose
314
+ - Modify source code — the skill is read-only against the codebase
315
+ - Produce multiple diagrams in `architecture.md`
316
+
317
+ ---
318
+
319
+ ## Red Flags
320
+
321
+ If you catch yourself thinking any of these, stop:
322
+
323
+ - "This architecture has a flaw worth noting" — STOP. Docs describe, they don't critique. Tell the user to run `/audit` if it matters.
324
+ - "I'll add a `security.md` too, it would help" — STOP. Five files, fixed. No invention.
325
+ - "I'll update `docs/README.md` to reference the new files" — STOP. The skill owns the two managed subfolders only.
326
+ - "There's no CI, I'll describe what it could look like" — STOP. If there's no CI, say so in one sentence.
327
+ - "Let me add a 'Next Steps' or 'Further Reading' section" — STOP. Every section is specified. No extras.
328
+ - "I'll write the patterns doc from memory without opening the code" — STOP. Every pattern cites real file paths.
329
+ - "The user said minimal, but a second architecture diagram would really help" — STOP. One diagram per file.