archgen-skill 0.0.7 → 0.1.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/README.md +1 -10
- package/bin/archgen.mjs +13 -1
- package/lib/bootstrap.js +25 -3
- package/lib/doctor.js +3 -3
- package/lib/global-server.js +154 -0
- package/lib/init.js +8 -1
- package/lib/mcp-server.js +66 -26
- package/lib/migrations/001-stamp-provenance.mjs +3 -3
- package/lib/spawn-npm.js +14 -4
- package/lib/uninstall-project.js +25 -5
- package/lib/version-stamp.js +2 -2
- package/package.json +3 -3
- package/vendor/skills/archgen/SKILL.md +156 -375
- package/vendor/skills/archgen/archgen.config.json +1 -1
- package/vendor/skills/archgen/references/code-standards.md +28 -44
|
@@ -1,70 +1,54 @@
|
|
|
1
1
|
# Code standards — contractual, verifier-enforced
|
|
2
2
|
|
|
3
|
-
Workers and planners follow these. The verifier rejects
|
|
4
|
-
output violates them. Every rule exists because its absence produced real
|
|
5
|
-
production incidents somewhere.
|
|
3
|
+
Workers and planners must follow these rules. The verifier rejects plans or outputs that violate them.
|
|
6
4
|
|
|
7
5
|
## Typing (TypeScript projects)
|
|
8
6
|
|
|
9
|
-
- NO
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
result objects for fallible operations.
|
|
14
|
-
- Prefer discriminated unions over boolean-flag parameters.
|
|
15
|
-
- Generated Python/Rust/Go equivalents: type hints mandatory / no `unwrap()` on
|
|
16
|
-
fallibles / handle errors explicitly — same discipline per language.
|
|
7
|
+
- **NO `any`:** Explicit `any`, implicit `any`, and `as any` casts are BANNED. Enforce `"strict": true`, `noImplicitAny`, `strictNullChecks`, and `noUncheckedIndexedAccess`.
|
|
8
|
+
- **No unhandled `undefined`/`null`:** Validate external boundaries (env vars, API payloads) with schemas; internally use non-optional types and explicit result unions for fallible operations.
|
|
9
|
+
- **Discriminated unions:** Prefer discriminated unions over boolean-flag parameters.
|
|
10
|
+
- **Other languages:** Mandatory type hints in Python; no `.unwrap()` on fallible types in Rust; explicit error handling in Go.
|
|
17
11
|
|
|
18
12
|
## File & module limits
|
|
19
13
|
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
- One public purpose per module. If the docstring needs "and", split.
|
|
14
|
+
- **Hard ceiling:** Files MUST stay `< 1000 LOC`. Split immediately when a file acquires a second responsibility.
|
|
15
|
+
- **Single responsibility:** One public purpose per module. If its summary requires `"and"`, split it.
|
|
23
16
|
|
|
24
17
|
## Folder structure (planned in architecture.yaml BEFORE coding)
|
|
25
18
|
|
|
26
19
|
```
|
|
27
20
|
src/
|
|
28
|
-
features/<name>/
|
|
29
|
-
api/
|
|
30
|
-
internal/
|
|
31
|
-
tests/
|
|
32
|
-
shared/
|
|
33
|
-
config/
|
|
21
|
+
features/<name>/ # Feature-first: everything a feature owns
|
|
22
|
+
api/ # Inbound contracts (routes/handlers)
|
|
23
|
+
internal/ # Private implementation
|
|
24
|
+
tests/ # Colocated tests mirroring structure
|
|
25
|
+
shared/ # Cross-feature utilities ONLY; MUST NOT import features/
|
|
26
|
+
config/ # Typed env parsing + constants
|
|
34
27
|
```
|
|
35
28
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
29
|
+
- `features/*` may import `shared/`; `shared/` imports NOTHING from `features/`.
|
|
30
|
+
- Colocate tests beside the code they test—never in a disconnected root `/tests` directory.
|
|
38
31
|
|
|
39
32
|
## File naming
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| Language | Source files | Components/classes | Tests |
|
|
34
|
+
| Language | Source files | Components / Classes | Tests |
|
|
44
35
|
|---|---|---|---|
|
|
45
|
-
| TypeScript | `kebab-case.ts` | `PascalCase.tsx` components, `PascalCase` classes | `<subject>.test.ts` colocated |
|
|
46
|
-
| Python | `snake_case.py`
|
|
47
|
-
| Rust | `snake_case.rs`
|
|
48
|
-
| Go | `snake_case.go`
|
|
36
|
+
| TypeScript | `kebab-case.ts` | `PascalCase.tsx` components, `PascalCase` classes | `<subject>.test.ts` (colocated) |
|
|
37
|
+
| Python | `snake_case.py` | `PascalCase` classes, `snake_case` functions | `test_<subject>.py` (mirrored) |
|
|
38
|
+
| Rust | `snake_case.rs` | `PascalCase` types/traits | `#[cfg(test)] mod tests` or `tests/` |
|
|
39
|
+
| Go | `snake_case.go` | `PascalCase` exported, `camelCase` internal | `<subject>_test.go` (same dir) |
|
|
49
40
|
|
|
50
|
-
- Descriptive
|
|
51
|
-
|
|
52
|
-
- BANNED names: `utils.ts`, `misc.ts`, `helpers.ts`, `temp*`, `final*`,
|
|
53
|
-
`copy*`, numbered duplicates (`auth2.ts`) — split by responsibility instead.
|
|
41
|
+
- **Descriptive over terse:** Use `rate-limiter.ts` (not `rl.ts`) and `parse-config.ts` (not `utils2.ts`).
|
|
42
|
+
- **BANNED names:** `utils.*`, `misc.*`, `helpers.*`, `temp*`, `final*`, `copy*`, or numbered duplicates (`auth2.ts`). Split by specific responsibility.
|
|
54
43
|
|
|
55
44
|
## Comments
|
|
56
45
|
|
|
57
|
-
- WHY
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
- NO noise: no `// increment i`, no commented-out code, no change-log comments
|
|
61
|
-
(git remembers).
|
|
46
|
+
- **Document WHY:** Explain trade-offs, non-obvious constraints, and ADR references (`see ADR D3`) at decision points.
|
|
47
|
+
- **Public APIs:** Document purpose, parameters, and failure modes.
|
|
48
|
+
- **Zero noise:** No restating code (`// increment i`), no commented-out code, no inline changelogs.
|
|
62
49
|
|
|
63
50
|
## Enforcement hooks
|
|
64
51
|
|
|
65
|
-
- tasks.yaml acceptance
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
file; violations = ISSUES, not warnings.
|
|
69
|
-
- Workers receive this reference in their prompt contract; "I didn't know" is
|
|
70
|
-
not available to them.
|
|
52
|
+
- Every `tasks.yaml` acceptance list MUST include $\ge 1$ objectively verifiable check (exit code or observable output).
|
|
53
|
+
- The verifier runs `archgen_plan{action:'verify'}` and audits plans against this file; violations trigger `ISSUES`.
|
|
54
|
+
- Workers receive this file path in their prompt contract and are strictly bound by it.
|