@r3dlex/ai-catapult 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/LICENSE +21 -0
- package/README.md +139 -0
- package/bin/ai-catapult.js +229 -0
- package/dist/claude-plugin/.claude-plugin/marketplace.json +28 -0
- package/dist/claude-plugin/.claude-plugin/plugin.json +21 -0
- package/dist/claude-plugin/skills/ai-catapult-init/REFERENCE.md +1284 -0
- package/dist/claude-plugin/skills/ai-catapult-init/SKILL.md +79 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/README.md +48 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/archgate.md +42 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/brd-prd-traceability.md +64 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/cascade.md +110 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/ci-policy.md +107 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/documentation-blueprint.md +185 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/evals.md +93 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/foundation.md +19 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/host-policy-automation.md +151 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/language-packs.md +63 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/mcp-a2a.md +63 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/memory.md +102 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/migration.md +107 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/phases/01-discover-decide.md +33 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/phases/README.md +33 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/readme-documentation.md +120 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/release-versioning.md +188 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/skill-modernization.md +72 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/sync.md +111 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/topology.md +102 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/traceability.md +136 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/tracker-adapters.md +51 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/validation.md +276 -0
- package/dist/claude-plugin/skills/ai-catapult-init/modules/workflow.md +45 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/AGENTS.md +69 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/CLAUDE.md +3 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/GEMINI.md +3 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/boundary-manifest.json +247 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/drift/backups/.gitkeep +0 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/drift/last-drift.json +7 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/evals/.gitkeep +0 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/evals/coverage-exceptions.json +1 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/handoff/.gitkeep +0 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/matrix.json +19 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/mcp/a2a-handoff.md +51 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/mcp/registry.json +27 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/observability/audit-checklist.md +32 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/observability/conventions.md +35 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/phases/01-discover-decide/status.json +16 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/phases/02-govern-plan/status.json +15 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/phases/03-configure-generate/status.json +22 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/phases/04-validate-handoff/status.json +18 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/policies/model-routing.json +29 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/reviews/ai-failure-modes.md +42 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/rules/security.md +38 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/rules/technical-bounds.md +38 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/skills/git-ops.json +6 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/skills/workspace-sync.json +6 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/architect.md +31 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/developer.md +31 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/qa-engineer.md +31 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/traceability/.gitkeep +0 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.json +42 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.md +52 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-github/workflows/ci-prek.yml +21 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-rules.ts +178 -0
- package/dist/claude-plugin/skills/ai-catapult-init/templates/prek.toml +13 -0
- package/dist/codex-plugin/.codex-plugin/plugin.json +11 -0
- package/dist/codex-plugin/skills/ai-catapult-init/REFERENCE.md +1284 -0
- package/dist/codex-plugin/skills/ai-catapult-init/SKILL.md +79 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/README.md +48 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/archgate.md +42 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/brd-prd-traceability.md +64 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/cascade.md +110 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/ci-policy.md +107 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/documentation-blueprint.md +185 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/evals.md +93 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/foundation.md +19 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/host-policy-automation.md +151 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/language-packs.md +63 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/mcp-a2a.md +63 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/memory.md +102 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/migration.md +107 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/phases/01-discover-decide.md +33 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/phases/README.md +33 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/readme-documentation.md +120 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/release-versioning.md +188 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/skill-modernization.md +72 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/sync.md +111 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/topology.md +102 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/traceability.md +136 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/tracker-adapters.md +51 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/validation.md +276 -0
- package/dist/codex-plugin/skills/ai-catapult-init/modules/workflow.md +45 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/AGENTS.md +69 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/CLAUDE.md +3 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/GEMINI.md +3 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/boundary-manifest.json +247 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/drift/backups/.gitkeep +0 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/drift/last-drift.json +7 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/evals/.gitkeep +0 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/evals/coverage-exceptions.json +1 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/handoff/.gitkeep +0 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/matrix.json +19 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/mcp/a2a-handoff.md +51 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/mcp/registry.json +27 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/observability/audit-checklist.md +32 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/observability/conventions.md +35 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/phases/01-discover-decide/status.json +16 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/phases/02-govern-plan/status.json +15 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/phases/03-configure-generate/status.json +22 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/phases/04-validate-handoff/status.json +18 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/policies/model-routing.json +29 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/reviews/ai-failure-modes.md +42 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/rules/security.md +38 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/rules/technical-bounds.md +38 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/skills/git-ops.json +6 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/skills/workspace-sync.json +6 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/architect.md +31 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/developer.md +31 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/qa-engineer.md +31 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/traceability/.gitkeep +0 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.json +42 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.md +52 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-github/workflows/ci-prek.yml +21 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/dot-rules.ts +178 -0
- package/dist/codex-plugin/skills/ai-catapult-init/templates/prek.toml +13 -0
- package/package.json +51 -0
- package/scripts/build-claude-plugin.sh +179 -0
- package/scripts/build-codex-plugin.sh +104 -0
- package/scripts/snapshot-dist.sh +26 -0
- package/setup.sh +63 -0
- package/skills.lock.json +6 -0
- package/src/install.js +380 -0
- package/src/scaffold.js +220 -0
package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/architect.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Architect Role — System Prompt
|
|
2
|
+
|
|
3
|
+
**Generated by:** ai-catapult-init
|
|
4
|
+
|
|
5
|
+
You are the **Architect** agent for `{{REPO_ID}}`. Your responsibilities:
|
|
6
|
+
|
|
7
|
+
## Primary responsibilities
|
|
8
|
+
|
|
9
|
+
- Evaluate proposed changes against the ADRs in `docs/architecture/adr/`.
|
|
10
|
+
- Identify architectural drift: dependency-direction violations, layer-boundary
|
|
11
|
+
crossings, circular imports, and deviations from recorded decisions.
|
|
12
|
+
- Produce structured drift reports (AC coverage, ADR conflicts, rule violations).
|
|
13
|
+
- Recommend architectural options with trade-offs; do not make binding decisions
|
|
14
|
+
without human confirmation.
|
|
15
|
+
|
|
16
|
+
## Constraints
|
|
17
|
+
|
|
18
|
+
- Read-only by default. Do not edit production code; emit recommendations only.
|
|
19
|
+
- Load `.ai/rules/security.md` and `.ai/rules/technical-bounds.md` before
|
|
20
|
+
every review.
|
|
21
|
+
- Apply Karpathy Rule 1 (Think Before Coding) and Rule 2 (Simplicity First)
|
|
22
|
+
when evaluating proposals.
|
|
23
|
+
- Cite the specific ADR or rule that applies to each finding.
|
|
24
|
+
|
|
25
|
+
## Context sources
|
|
26
|
+
|
|
27
|
+
| Type | Source |
|
|
28
|
+
|------|--------|
|
|
29
|
+
| Instructions | `AGENTS.md`, `.ai/rules/` |
|
|
30
|
+
| Knowledge | `docs/architecture/adr/`, `docs/specifications/ACTIVE/` |
|
|
31
|
+
| Guardrails | `.ai/rules/security.md`, `.ai/rules/technical-bounds.md`, `.ai/policies/` |
|
package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/developer.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Developer Role — System Prompt
|
|
2
|
+
|
|
3
|
+
**Generated by:** ai-catapult-init
|
|
4
|
+
|
|
5
|
+
You are the **Developer** agent for `{{REPO_ID}}`. Your responsibilities:
|
|
6
|
+
|
|
7
|
+
## Primary responsibilities
|
|
8
|
+
|
|
9
|
+
- Implement changes precisely as specified, with the smallest viable diff.
|
|
10
|
+
- Match existing codebase patterns: naming conventions, error handling, import
|
|
11
|
+
style, function signatures, test patterns.
|
|
12
|
+
- Run verification (build, tests, lsp diagnostics) before claiming completion.
|
|
13
|
+
- Never introduce new abstractions for single-use logic.
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
|
|
17
|
+
- Load `AGENTS.md` and `.ai/rules/technical-bounds.md` before starting any task.
|
|
18
|
+
- Apply all four Karpathy rules: Think Before Coding, Simplicity First,
|
|
19
|
+
Surgical Changes, Goal-Driven Execution.
|
|
20
|
+
- Do not modify files outside the task scope (no "while I'm here" changes).
|
|
21
|
+
- Do not self-approve your own output — request a separate review pass.
|
|
22
|
+
|
|
23
|
+
## Context sources
|
|
24
|
+
|
|
25
|
+
| Type | Source |
|
|
26
|
+
|------|--------|
|
|
27
|
+
| Instructions | `AGENTS.md`, `.ai/rules/` |
|
|
28
|
+
| Knowledge | `docs/architecture/adr/`, `docs/specifications/ACTIVE/` |
|
|
29
|
+
| Memory | `.memory/human-override/`, `.memory/self-learned/` |
|
|
30
|
+
| Tools | `.ai/skills/git-ops.json`, `.ai/skills/workspace-sync.json` |
|
|
31
|
+
| Guardrails | `.ai/rules/security.md`, `.ai/rules/technical-bounds.md` |
|
package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/system-prompts/qa-engineer.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# QA Engineer Role — System Prompt
|
|
2
|
+
|
|
3
|
+
**Generated by:** ai-catapult-init
|
|
4
|
+
|
|
5
|
+
You are the **QA Engineer** agent for `{{REPO_ID}}`. Your responsibilities:
|
|
6
|
+
|
|
7
|
+
## Primary responsibilities
|
|
8
|
+
|
|
9
|
+
- Design and execute test strategies that cover the failure modes enumerated in
|
|
10
|
+
`.ai/reviews/ai-failure-modes.md`.
|
|
11
|
+
- Verify that acceptance criteria are fully covered before approving a PR.
|
|
12
|
+
- Identify flaky tests and their root causes.
|
|
13
|
+
- Enforce Arrange-Act-Assert structure and one-assertion-group-per-test.
|
|
14
|
+
|
|
15
|
+
## Constraints
|
|
16
|
+
|
|
17
|
+
- Load `AGENTS.md` and `.ai/reviews/ai-failure-modes.md` before every review.
|
|
18
|
+
- Treat test failures as signals about production code — fix the root cause,
|
|
19
|
+
not the test assertion.
|
|
20
|
+
- Do not use `test.skip`, `.only`, or stub assertions as completion evidence.
|
|
21
|
+
- Verify coverage of off-by-one boundaries, concurrency assumptions, and
|
|
22
|
+
error-handling paths.
|
|
23
|
+
|
|
24
|
+
## Context sources
|
|
25
|
+
|
|
26
|
+
| Type | Source |
|
|
27
|
+
|------|--------|
|
|
28
|
+
| Instructions | `AGENTS.md`, `.ai/rules/` |
|
|
29
|
+
| Knowledge | `docs/architecture/adr/`, `docs/specifications/ACTIVE/` |
|
|
30
|
+
| Examples | `.ai/evals/`, `docs/learning/concept-maps/` |
|
|
31
|
+
| Guardrails | `.ai/rules/security.md`, `.ai/reviews/ai-failure-modes.md` |
|
|
File without changes
|
package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0",
|
|
3
|
+
"workflow_id": "init-ai-repo",
|
|
4
|
+
"repo_id": "{{REPO_ID}}",
|
|
5
|
+
"description": "Four-phase AI-SDLC initialization workflow for this repository.",
|
|
6
|
+
"phases": [
|
|
7
|
+
{
|
|
8
|
+
"id": "01-discover-decide",
|
|
9
|
+
"title": "Discover & Decide",
|
|
10
|
+
"status_file": ".ai/phases/01-discover-decide/status.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "02-govern-plan",
|
|
14
|
+
"title": "Govern & Plan",
|
|
15
|
+
"status_file": ".ai/phases/02-govern-plan/status.json"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "03-configure-generate",
|
|
19
|
+
"title": "Configure & Generate",
|
|
20
|
+
"status_file": ".ai/phases/03-configure-generate/status.json"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "04-validate-handoff",
|
|
24
|
+
"title": "Validate & Handoff",
|
|
25
|
+
"status_file": ".ai/phases/04-validate-handoff/status.json"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"optional_branches": [
|
|
29
|
+
{
|
|
30
|
+
"id": "multi-repo-cascade",
|
|
31
|
+
"title": "Multi-repo Cascade",
|
|
32
|
+
"status": "available",
|
|
33
|
+
"enabled": false
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "skill-modernization",
|
|
37
|
+
"title": "Skill Modernization Audit",
|
|
38
|
+
"status": "available",
|
|
39
|
+
"enabled": false
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
package/dist/claude-plugin/skills/ai-catapult-init/templates/dot-ai/workflows/repo-workflow.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# {{REPO_ID}} — AI-SDLC Workflow
|
|
2
|
+
|
|
3
|
+
This document describes the four-phase AI-SDLC initialization workflow for this repository.
|
|
4
|
+
For the machine-readable version see `.ai/workflows/repo-workflow.json`.
|
|
5
|
+
|
|
6
|
+
## Phases
|
|
7
|
+
|
|
8
|
+
### Phase 01 — Discover & Decide
|
|
9
|
+
|
|
10
|
+
Profile the repository: detect topology type (standalone vs umbrella), measure
|
|
11
|
+
depth, confirm sync strategy, and write `.ai/init/repo-profile.json` and
|
|
12
|
+
`.ai/init/sdlc-path.md`. Update `.ai/matrix.json` with the confirmed topology.
|
|
13
|
+
|
|
14
|
+
**Status file:** `.ai/phases/01-discover-decide/status.json`
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### Phase 02 — Govern & Plan
|
|
19
|
+
|
|
20
|
+
Establish governance artifacts: confirm or author ADRs in `docs/architecture/adr/`,
|
|
21
|
+
confirm model-routing policy at `.ai/policies/model-routing.json`, decide which
|
|
22
|
+
optional branches (cascade, skill-modernization) are enabled.
|
|
23
|
+
|
|
24
|
+
**Status file:** `.ai/phases/02-govern-plan/status.json`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### Phase 03 — Configure & Generate
|
|
29
|
+
|
|
30
|
+
Emit the full v3 scaffold: traceability graph, workflow manifest, entry files
|
|
31
|
+
(AGENTS.md, CLAUDE.md, GEMINI.md), Archgate rules, CI hooks, and all `.ai/`
|
|
32
|
+
subdirectory artifacts. Existing files are never overwritten silently.
|
|
33
|
+
|
|
34
|
+
**Status file:** `.ai/phases/03-configure-generate/status.json`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### Phase 04 — Validate & Handoff
|
|
39
|
+
|
|
40
|
+
Run offline structural validation, emit the validation report, and write the
|
|
41
|
+
initialization handoff document at `.ai/handoff/init-ai-repo-handoff.md`.
|
|
42
|
+
|
|
43
|
+
**Status file:** `.ai/phases/04-validate-handoff/status.json`
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Optional Branches
|
|
48
|
+
|
|
49
|
+
| Branch | Description | Default |
|
|
50
|
+
|--------|-------------|---------|
|
|
51
|
+
| `multi-repo-cascade` | Cascade inherited-asset propagation to managed sub-repos | disabled |
|
|
52
|
+
| `skill-modernization` | Audit and modernize the skill catalog in `.ai/skills/` | disabled |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: AI SDLC Pre-commit Checks
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
prek-check:
|
|
11
|
+
name: Pre-commit Hooks
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Run prek
|
|
19
|
+
uses: j178/prek-action@v2
|
|
20
|
+
with:
|
|
21
|
+
extra-args: '--all-files'
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// .rules.ts — Archgate domain rules
|
|
2
|
+
// Each rule: name, severity ("error" | "warn" | "info"), match pattern, and example.
|
|
3
|
+
// This file is validated by scripts/validate-rules.sh (structural check only).
|
|
4
|
+
// Semantic enforcement is an agent behavior at PR review time.
|
|
5
|
+
// Generated by: ai-catapult-init
|
|
6
|
+
|
|
7
|
+
export interface Rule {
|
|
8
|
+
name: string;
|
|
9
|
+
severity: "error" | "warn" | "info";
|
|
10
|
+
match: string;
|
|
11
|
+
violation?: string;
|
|
12
|
+
correction?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ─── backend ────────────────────────────────────────────────────────────────
|
|
16
|
+
|
|
17
|
+
export const backend: Rule[] = [
|
|
18
|
+
{
|
|
19
|
+
name: "api-versioning",
|
|
20
|
+
severity: "error",
|
|
21
|
+
match: "All public REST endpoints must include a version prefix (/v1/, /v2/, …).",
|
|
22
|
+
violation: "POST /users/create",
|
|
23
|
+
correction: "POST /v1/users",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "error-shape",
|
|
27
|
+
severity: "error",
|
|
28
|
+
match: "Error responses must use { error: { code, message, details? } } shape.",
|
|
29
|
+
violation: 'res.status(400).json({ msg: "bad input" })',
|
|
30
|
+
correction: 'res.status(400).json({ error: { code: "INVALID_INPUT", message: "…" } })',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "no-sql-injection-patterns",
|
|
34
|
+
severity: "error",
|
|
35
|
+
match: "String interpolation must not be used to build SQL queries.",
|
|
36
|
+
violation: '`SELECT * FROM users WHERE id = ${req.params.id}`',
|
|
37
|
+
correction: "db.query('SELECT * FROM users WHERE id = $1', [req.params.id])",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "middleware-order",
|
|
41
|
+
severity: "warn",
|
|
42
|
+
match: "Auth middleware must be registered before route handlers.",
|
|
43
|
+
violation: "router.get('/admin', handler, authMiddleware)",
|
|
44
|
+
correction: "router.get('/admin', authMiddleware, handler)",
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
// ─── frontend ────────────────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
export const frontend: Rule[] = [
|
|
51
|
+
{
|
|
52
|
+
name: "component-naming",
|
|
53
|
+
severity: "error",
|
|
54
|
+
match: "React components must use PascalCase filenames and exports.",
|
|
55
|
+
violation: "export function userCard() { … } // file: userCard.tsx",
|
|
56
|
+
correction: "export function UserCard() { … } // file: UserCard.tsx",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "props-interface",
|
|
60
|
+
severity: "error",
|
|
61
|
+
match: "Component props must be defined as a named TypeScript interface, not inline.",
|
|
62
|
+
violation: "function Button({ label }: { label: string }) { … }",
|
|
63
|
+
correction: "interface ButtonProps { label: string }\nfunction Button({ label }: ButtonProps) { … }",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "hook-patterns",
|
|
67
|
+
severity: "warn",
|
|
68
|
+
match: "Custom hooks must start with 'use' and return a typed object, not a tuple.",
|
|
69
|
+
violation: "function getUser() { … } // not a hook",
|
|
70
|
+
correction: "function useUser(): { user: User; loading: boolean } { … }",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "css-methodology",
|
|
74
|
+
severity: "info",
|
|
75
|
+
match: "Style declarations must use the project's CSS methodology. Inline styles are prohibited except for dynamic values.",
|
|
76
|
+
violation: '<div style={{ color: "red" }}>',
|
|
77
|
+
correction: '<div className="text-red-500"> // or CSS module equivalent',
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
// ─── data ────────────────────────────────────────────────────────────────────
|
|
82
|
+
|
|
83
|
+
export const data: Rule[] = [
|
|
84
|
+
{
|
|
85
|
+
name: "migration-naming",
|
|
86
|
+
severity: "error",
|
|
87
|
+
match: "Database migration files must follow the pattern YYYYMMDDHHMMSS_<slug>.sql.",
|
|
88
|
+
violation: "add_users_table.sql",
|
|
89
|
+
correction: "20260101120000_add_users_table.sql",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: "query-batching",
|
|
93
|
+
severity: "warn",
|
|
94
|
+
match: "ORM queries inside loops are prohibited. Use batch/bulk methods or DataLoader.",
|
|
95
|
+
violation: "for (const id of ids) { await User.findOne(id); }",
|
|
96
|
+
correction: "await User.findAll({ where: { id: ids } });",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "cache-invalidation",
|
|
100
|
+
severity: "warn",
|
|
101
|
+
match: "Cache entries must be invalidated in the same transaction/service that mutates the source data.",
|
|
102
|
+
violation: "updateUser(id, data); // cache cleared in a separate cron",
|
|
103
|
+
correction: "await Promise.all([updateUser(id, data), cache.del(`user:${id}`)])",
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
// ─── architecture ────────────────────────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
export const architecture: Rule[] = [
|
|
110
|
+
{
|
|
111
|
+
name: "layer-boundaries",
|
|
112
|
+
severity: "error",
|
|
113
|
+
match: "Route handlers must not import from the data layer directly. All data access goes through a service layer.",
|
|
114
|
+
violation: "import { db } from '../db' // inside routes/users.ts",
|
|
115
|
+
correction: "import { UserService } from '../services/UserService'",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "dependency-direction",
|
|
119
|
+
severity: "error",
|
|
120
|
+
match: "Dependencies must only flow inward (domain ← application ← infrastructure).",
|
|
121
|
+
violation: "import { User } from '../../domain/User' // inside infrastructure/",
|
|
122
|
+
correction: "Depend on the port interface, not the domain entity directly.",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "module-exports",
|
|
126
|
+
severity: "warn",
|
|
127
|
+
match: "Each module directory must have an index.ts that re-exports only its public surface.",
|
|
128
|
+
violation: "import { helper } from '../auth/internal/helper'",
|
|
129
|
+
correction: "import { helper } from '../auth' // via index.ts barrel",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "no-circular-dependencies",
|
|
133
|
+
severity: "error",
|
|
134
|
+
match: "Circular imports between modules are prohibited.",
|
|
135
|
+
violation: "// moduleA imports moduleB, moduleB imports moduleA",
|
|
136
|
+
correction: "Extract shared logic into a third module that neither A nor B imports.",
|
|
137
|
+
},
|
|
138
|
+
];
|
|
139
|
+
|
|
140
|
+
// ─── general ─────────────────────────────────────────────────────────────────
|
|
141
|
+
|
|
142
|
+
export const general: Rule[] = [
|
|
143
|
+
{
|
|
144
|
+
name: "file-naming",
|
|
145
|
+
severity: "warn",
|
|
146
|
+
match: "Source files must use kebab-case. Test files must end in .test.ts or .spec.ts.",
|
|
147
|
+
violation: "UserService.ts, userservice.spec.ts",
|
|
148
|
+
correction: "user-service.ts, user-service.spec.ts",
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "function-length",
|
|
152
|
+
severity: "warn",
|
|
153
|
+
match: "Functions must not exceed 40 lines. Extract logical sections into named helpers.",
|
|
154
|
+
violation: "// 80-line parseAndValidateAndSaveUser function",
|
|
155
|
+
correction: "parseUser(), validateUser(), saveUser() — each ≤ 40 lines",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "test-structure",
|
|
159
|
+
severity: "error",
|
|
160
|
+
match: "Tests must follow the Arrange-Act-Assert pattern with one assertion group per test.",
|
|
161
|
+
violation: "it('works', () => { /* 20 lines of mixed setup and assertions */ })",
|
|
162
|
+
correction: "it('returns 404 when user not found', () => { /* Arrange / Act / Assert */ })",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "import-ordering",
|
|
166
|
+
severity: "info",
|
|
167
|
+
match: "Imports must be ordered: Node built-ins → external packages → internal modules. Groups separated by a blank line.",
|
|
168
|
+
violation: "import { UserService } from './services'\nimport path from 'path'\nimport express from 'express'",
|
|
169
|
+
correction: "import path from 'path'\n\nimport express from 'express'\n\nimport { UserService } from './services'",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "comment-policy",
|
|
173
|
+
severity: "info",
|
|
174
|
+
match: "Comments must explain WHY, not WHAT. Do not comment code that is self-explanatory.",
|
|
175
|
+
violation: "// increment counter\ncounter++;",
|
|
176
|
+
correction: "// Retry budget: max 3 attempts before circuit-breaker trips\ncounter++;",
|
|
177
|
+
},
|
|
178
|
+
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# prek configuration — pre-commit hook manager (Rust-based, github.com/j178/prek)
|
|
2
|
+
# Schema mirrors `.pre-commit-config.yaml` (top-level `repos` field).
|
|
3
|
+
|
|
4
|
+
[[repos]]
|
|
5
|
+
repo = "local"
|
|
6
|
+
|
|
7
|
+
[[repos.hooks]]
|
|
8
|
+
id = "validate-rules"
|
|
9
|
+
name = "Validate Archgate rules structure"
|
|
10
|
+
entry = "bash scripts/validate-rules.sh"
|
|
11
|
+
language = "system"
|
|
12
|
+
files = '\.rules\.ts$'
|
|
13
|
+
pass_filenames = false
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ai-catapult",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI + Claude Code and Codex plugins for init-ai-repo v3 AI-SDLC governance scaffolding",
|
|
5
|
+
"skills": "./skills/",
|
|
6
|
+
"interface": {
|
|
7
|
+
"displayName": "ai-catapult",
|
|
8
|
+
"shortDescription": "Scaffold init-ai-repo v3 AI-SDLC governance structure in any repo.",
|
|
9
|
+
"category": "Developer Tools"
|
|
10
|
+
}
|
|
11
|
+
}
|