@nlaprell/shipit 1.0.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/.cursor/commands/create_intent_from_issue.md +28 -0
- package/.cursor/commands/create_pr.md +28 -0
- package/.cursor/commands/dashboard.md +39 -0
- package/.cursor/commands/deploy.md +152 -0
- package/.cursor/commands/drift_check.md +36 -0
- package/.cursor/commands/fix.md +39 -0
- package/.cursor/commands/generate_release_plan.md +31 -0
- package/.cursor/commands/generate_roadmap.md +38 -0
- package/.cursor/commands/help.md +37 -0
- package/.cursor/commands/init_project.md +26 -0
- package/.cursor/commands/kill.md +72 -0
- package/.cursor/commands/new_intent.md +68 -0
- package/.cursor/commands/pr.md +77 -0
- package/.cursor/commands/revert-plan.md +58 -0
- package/.cursor/commands/risk.md +64 -0
- package/.cursor/commands/rollback.md +43 -0
- package/.cursor/commands/scope_project.md +53 -0
- package/.cursor/commands/ship.md +345 -0
- package/.cursor/commands/status.md +71 -0
- package/.cursor/commands/suggest.md +44 -0
- package/.cursor/commands/test_shipit.md +197 -0
- package/.cursor/commands/verify.md +50 -0
- package/.cursor/rules/architect.mdc +84 -0
- package/.cursor/rules/assumption-extractor.mdc +95 -0
- package/.cursor/rules/docs.mdc +66 -0
- package/.cursor/rules/implementer.mdc +112 -0
- package/.cursor/rules/pm.mdc +136 -0
- package/.cursor/rules/qa.mdc +97 -0
- package/.cursor/rules/security.mdc +90 -0
- package/.cursor/rules/steward.mdc +99 -0
- package/.cursor/rules/test-runner.mdc +196 -0
- package/AGENTS.md +121 -0
- package/README.md +264 -0
- package/_system/architecture/CANON.md +159 -0
- package/_system/architecture/invariants.yml +87 -0
- package/_system/architecture/project-schema.json +98 -0
- package/_system/architecture/workflow-state-layout.md +68 -0
- package/_system/artifacts/SYSTEM_STATE.md +43 -0
- package/_system/artifacts/confidence-calibration.json +16 -0
- package/_system/artifacts/dependencies.md +46 -0
- package/_system/artifacts/framework-files-manifest.json +179 -0
- package/_system/artifacts/usage.json +1 -0
- package/_system/behaviors/DO_RELEASE.md +371 -0
- package/_system/behaviors/DO_RELEASE_AI.md +329 -0
- package/_system/behaviors/PREPARE_RELEASE.md +373 -0
- package/_system/behaviors/PREPARE_RELEASE_AI.md +234 -0
- package/_system/behaviors/WORK_ROOT_PLATFORM_ISSUES.md +140 -0
- package/_system/behaviors/WORK_TEST_PLAN_ISSUES.md +380 -0
- package/_system/do-not-repeat/abandoned-designs.md +18 -0
- package/_system/do-not-repeat/bad-patterns.md +19 -0
- package/_system/do-not-repeat/failed-experiments.md +18 -0
- package/_system/do-not-repeat/rejected-libraries.md +19 -0
- package/_system/drift/baselines.md +49 -0
- package/_system/drift/metrics.md +33 -0
- package/_system/golden-data/.gitkeep +0 -0
- package/_system/golden-data/README.md +47 -0
- package/_system/reports/mutation/mutation.html +492 -0
- package/_system/security/audit-allowlist.json +4 -0
- package/bin/create-shipit-app +29 -0
- package/bin/shipit +183 -0
- package/cli/src/commands/check.js +82 -0
- package/cli/src/commands/create.js +195 -0
- package/cli/src/commands/init.js +267 -0
- package/cli/src/commands/upgrade.js +196 -0
- package/cli/src/utils/config.js +27 -0
- package/cli/src/utils/file-copy.js +144 -0
- package/cli/src/utils/gitignore-merge.js +44 -0
- package/cli/src/utils/manifest.js +105 -0
- package/cli/src/utils/package-json-merge.js +163 -0
- package/cli/src/utils/project-json-merge.js +57 -0
- package/cli/src/utils/prompts.js +30 -0
- package/cli/src/utils/stack-detection.js +56 -0
- package/cli/src/utils/stack-files.js +364 -0
- package/cli/src/utils/upgrade-backup.js +159 -0
- package/cli/src/utils/version.js +64 -0
- package/dashboard-app/README.md +73 -0
- package/dashboard-app/eslint.config.js +23 -0
- package/dashboard-app/index.html +13 -0
- package/dashboard-app/package.json +30 -0
- package/dashboard-app/pnpm-lock.yaml +2721 -0
- package/dashboard-app/public/dashboard.json +66 -0
- package/dashboard-app/public/vite.svg +1 -0
- package/dashboard-app/src/App.css +141 -0
- package/dashboard-app/src/App.tsx +155 -0
- package/dashboard-app/src/assets/react.svg +1 -0
- package/dashboard-app/src/index.css +68 -0
- package/dashboard-app/src/main.tsx +10 -0
- package/dashboard-app/tsconfig.app.json +28 -0
- package/dashboard-app/tsconfig.json +4 -0
- package/dashboard-app/tsconfig.node.json +26 -0
- package/dashboard-app/vite.config.ts +7 -0
- package/package.json +116 -0
- package/scripts/README.md +70 -0
- package/scripts/audit-check.sh +125 -0
- package/scripts/calibration-report.sh +198 -0
- package/scripts/check-readiness.sh +155 -0
- package/scripts/collect-metrics.sh +116 -0
- package/scripts/command-manifest.yml +131 -0
- package/scripts/create-test-plan-issue.sh +110 -0
- package/scripts/dashboard-start.sh +16 -0
- package/scripts/deploy.sh +170 -0
- package/scripts/drift-check.sh +93 -0
- package/scripts/execute-rollback.sh +177 -0
- package/scripts/export-dashboard-json.js +208 -0
- package/scripts/fix-intents.sh +239 -0
- package/scripts/generate-dashboard.sh +136 -0
- package/scripts/generate-docs.sh +279 -0
- package/scripts/generate-project-context.sh +142 -0
- package/scripts/generate-release-plan.sh +443 -0
- package/scripts/generate-roadmap.sh +189 -0
- package/scripts/generate-system-state.sh +95 -0
- package/scripts/gh/create-intent-from-issue.sh +82 -0
- package/scripts/gh/create-issue-from-intent.sh +59 -0
- package/scripts/gh/create-pr.sh +41 -0
- package/scripts/gh/link-issue.sh +44 -0
- package/scripts/gh/on-ship-update-issue.sh +42 -0
- package/scripts/headless/README.md +8 -0
- package/scripts/headless/call-llm.js +109 -0
- package/scripts/headless/run-phase.sh +99 -0
- package/scripts/help.sh +271 -0
- package/scripts/init-project.sh +976 -0
- package/scripts/kill-intent.sh +125 -0
- package/scripts/lib/common.sh +29 -0
- package/scripts/lib/intent.sh +61 -0
- package/scripts/lib/progress.sh +57 -0
- package/scripts/lib/suggest-next.sh +131 -0
- package/scripts/lib/validate-intents.sh +240 -0
- package/scripts/lib/verify-outputs.sh +55 -0
- package/scripts/lib/workflow_state.sh +201 -0
- package/scripts/new-intent.sh +271 -0
- package/scripts/publish-npm.sh +28 -0
- package/scripts/scope-project.sh +380 -0
- package/scripts/setup-worktrees.sh +125 -0
- package/scripts/status.sh +278 -0
- package/scripts/suggest.sh +173 -0
- package/scripts/test-headless.sh +47 -0
- package/scripts/test-shipit.sh +52 -0
- package/scripts/test-workflow-state.sh +49 -0
- package/scripts/usage-report.sh +47 -0
- package/scripts/usage.sh +58 -0
- package/scripts/validate-cursor.sh +151 -0
- package/scripts/validate-project.sh +71 -0
- package/scripts/validate-vscode.sh +146 -0
- package/scripts/verify.sh +153 -0
- package/scripts/workflow-orchestrator.sh +97 -0
- package/scripts/workflow-templates/01_analysis.md.tpl +25 -0
- package/scripts/workflow-templates/02_plan.md.tpl +30 -0
- package/scripts/workflow-templates/03_implementation.md.tpl +25 -0
- package/scripts/workflow-templates/04_verification.md.tpl +29 -0
- package/scripts/workflow-templates/05_release_notes.md.tpl +16 -0
- package/scripts/workflow-templates/05_verification_legacy.md.tpl +6 -0
- package/scripts/workflow-templates/active.md.tpl +18 -0
- package/scripts/workflow-templates/phases.yml +39 -0
- package/stryker.conf.json +8 -0
- package/work/intent/templates/api-endpoint.md +124 -0
- package/work/intent/templates/bugfix.md +116 -0
- package/work/intent/templates/frontend-feature.md +115 -0
- package/work/intent/templates/generic.md +122 -0
- package/work/intent/templates/infra-change.md +121 -0
- package/work/intent/templates/refactor.md +116 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Project: ShipIt
|
|
4
|
+
|
|
5
|
+
This repository implements an AI-native Software Development Life Cycle optimized for AI agent teams rather than human limitations.
|
|
6
|
+
|
|
7
|
+
> **Note:** For quick start and usage instructions, see [README.md](./README.md)
|
|
8
|
+
|
|
9
|
+
## Definition of Done
|
|
10
|
+
|
|
11
|
+
A feature/bugfix is "done" when ALL of these pass:
|
|
12
|
+
|
|
13
|
+
- [ ] All tests pass (`pnpm test`)
|
|
14
|
+
- [ ] Lint + typecheck pass (`pnpm lint && pnpm typecheck`)
|
|
15
|
+
- [ ] New/changed behavior has corresponding tests
|
|
16
|
+
- [ ] Public APIs are documented
|
|
17
|
+
- [ ] Intent acceptance criteria all checked
|
|
18
|
+
- [ ] No unresolved security findings
|
|
19
|
+
- [ ] Rollback plan documented
|
|
20
|
+
|
|
21
|
+
## Conventions
|
|
22
|
+
|
|
23
|
+
### Code Style
|
|
24
|
+
|
|
25
|
+
- TypeScript strict mode enabled
|
|
26
|
+
- ESLint + Prettier enforced via pre-commit hooks
|
|
27
|
+
- Prefer configuration over custom code
|
|
28
|
+
|
|
29
|
+
### Development Process
|
|
30
|
+
|
|
31
|
+
- **Tests before implementation** (Spec → Tests → Code)
|
|
32
|
+
- All assumptions must be explicit
|
|
33
|
+
- Check `_system/do-not-repeat/` before proposing designs
|
|
34
|
+
- Small, reviewable diffs preferred
|
|
35
|
+
|
|
36
|
+
### Forbidden Patterns
|
|
37
|
+
|
|
38
|
+
- No `any` type (use `unknown` if needed)
|
|
39
|
+
- No `eval()`
|
|
40
|
+
- No `innerHTML` (use safe DOM methods)
|
|
41
|
+
- No circular dependencies
|
|
42
|
+
|
|
43
|
+
## Agent System
|
|
44
|
+
|
|
45
|
+
This repo uses an AI-native SDLC. Key directories (agent-visible):
|
|
46
|
+
|
|
47
|
+
| Directory | Purpose |
|
|
48
|
+
| ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
49
|
+
| `work/intent/` | Planned work (features, bugs, tech-debt); templates/ for kind-specific (API, frontend, infra, bugfix, refactor). New templates must include required fields from \_TEMPLATE.md (Type, Status, Motivation, Acceptance, etc.). |
|
|
50
|
+
| `work/workflow-state/` | Current execution state (flat for single intent; per-intent dirs when multiple intents active — see [workflow-state-layout.md](./_system/architecture/workflow-state-layout.md) and [parallel-workflow.md](./docs/parallel-workflow.md)) |
|
|
51
|
+
| `_system/architecture/CANON.md` | System boundaries and constraints |
|
|
52
|
+
| `_system/architecture/invariants.yml` | Machine-verifiable constraints |
|
|
53
|
+
| `_system/do-not-repeat/` | Failed approaches (don't rediscover) |
|
|
54
|
+
| `_system/drift/` | Entropy monitoring |
|
|
55
|
+
| `work/roadmap/` | Planning views (now, next, later) |
|
|
56
|
+
| `_system/behaviors/` | Procedures and policies (release, issue tracking) |
|
|
57
|
+
| `.override/` | User customizations (rules, commands, scripts, config) that persist across framework upgrades. NEVER touched by `shipit upgrade`. |
|
|
58
|
+
| `tests/test-project/` | Internal test project for framework validation (gitignored). Created by `scripts/init-project.sh` for `/test_shipit` command. |
|
|
59
|
+
|
|
60
|
+
`_system/artifacts/SYSTEM_STATE.md` is generated by `scripts/generate-system-state.sh` and read by the Steward. `_system/artifacts/usage.json` holds token/cost entries per phase/intent (aggregate only; no prompt or response content). Record with `pnpm usage-record`; view with `pnpm usage-report` or `/status`. `_system/artifacts/confidence-calibration.json` stores stated confidence vs actual outcome per verification; view with `pnpm calibration-report` or `/calibration-report`.
|
|
61
|
+
|
|
62
|
+
**Calibration:** How well stated confidence matches reality. The report shows (a) calibration error (MAE) and Brier score, (b) success rate by confidence bin (well-calibrated: e.g. 0.8–0.9 bin has ~85% success), (c) over/under-confidence summary. **Improve calibration:** Lower stated confidence when uncertain; tune analysis/Steward prompts to output more accurate confidence; use `calibration-report --fail-on-threshold 0.2` in CI to catch drift. Optional alert: script warns when recent high-confidence decisions have <50% success.
|
|
63
|
+
|
|
64
|
+
**Full directory map:** See [\_system/architecture/CANON.md](./_system/architecture/CANON.md) Directory Boundaries and [docs/DIRECTORY_STRUCTURE.md](./docs/DIRECTORY_STRUCTURE.md).
|
|
65
|
+
|
|
66
|
+
## Human Interrupts Required For
|
|
67
|
+
|
|
68
|
+
Humans intervene **ONLY** at these gates:
|
|
69
|
+
|
|
70
|
+
| Gate | When |
|
|
71
|
+
| --------------------- | ------------------------------------------- |
|
|
72
|
+
| **Plan Approval** | Before implementation starts |
|
|
73
|
+
| **High-Risk Changes** | Auth, payments, permissions, infra, PII |
|
|
74
|
+
| **Kill/Rollback** | Kill criteria triggered or major regression |
|
|
75
|
+
|
|
76
|
+
**Rollback safety:** Use `/rollback <intent-id>` for guided rollback. High-risk steps (force, drop, delete, migration down, production, auth, secret) are **display only** — run manually. No automatic force-push or data deletion. Run rollback for one intent at a time.
|
|
77
|
+
| **Product Judgment** | Subjective UX/taste/value tradeoffs |
|
|
78
|
+
|
|
79
|
+
**Response time expectation:** Minutes (real-time collaboration)
|
|
80
|
+
|
|
81
|
+
## Slash Commands
|
|
82
|
+
|
|
83
|
+
| Command | Purpose |
|
|
84
|
+
| -------------- | ----------------------------------- |
|
|
85
|
+
| `/ship` | Run full SDLC workflow (Phases 1-6) |
|
|
86
|
+
| `/new_intent` | Create a new intent file |
|
|
87
|
+
| `/verify` | Run verification phase only |
|
|
88
|
+
| `/kill` | Kill an intent with rationale |
|
|
89
|
+
| `/drift_check` | Calculate drift metrics |
|
|
90
|
+
|
|
91
|
+
### Commands and scripts
|
|
92
|
+
|
|
93
|
+
- **Slash command files** live in `.cursor/commands/` and use **underscores** in filenames (e.g. `init_project.md`, `drift_check.md`).
|
|
94
|
+
- **Command manifest:** The full list of slash commands, pnpm scripts, and categories lives in `scripts/command-manifest.yml`. Run `/help` (or `pnpm help`) to see the list; help output is built from the manifest.
|
|
95
|
+
- **Executable scripts** live in `scripts/` and use **hyphens** (e.g. `init-project.sh`, `fix-intents.sh`). New scripts should source `scripts/lib/common.sh` (error handling, colors) or `scripts/lib/intent.sh` (intent resolution); see `scripts/README.md`.
|
|
96
|
+
- **Multiple active intents:** When more than one intent is active, pass intent-id explicitly (e.g. `/ship F-001`, `/verify F-002`). "Current" for a session is the intent-id passed to the last command or the single intent in `work/workflow-state/active.md`. See [docs/parallel-workflow.md](./docs/parallel-workflow.md).
|
|
97
|
+
- Prefer **`pnpm run <script>`** when a script exists: pnpm script names use hyphens. Examples: `/fix` → `pnpm fix`, `/help` → `pnpm help`, `/verify` → `pnpm verify`, `/drift_check` → `pnpm drift-check`, `/new_intent` → `pnpm new-intent`. See `package.json` scripts for the full list.
|
|
98
|
+
|
|
99
|
+
## Truth Hierarchy
|
|
100
|
+
|
|
101
|
+
When facts conflict, agents MUST know which source wins. This prevents 30–40% of "AI confusion" bugs.
|
|
102
|
+
|
|
103
|
+
**Truth Stack (highest to lowest precedence):**
|
|
104
|
+
|
|
105
|
+
1. **Runtime behavior** — What the system actually does
|
|
106
|
+
2. **Tests** — Executable assertions
|
|
107
|
+
3. **Invariants** — Hard constraints that must never be violated
|
|
108
|
+
4. **Specs** — Formal requirements
|
|
109
|
+
5. **Architecture canon** — CANON.md boundaries
|
|
110
|
+
6. **Comments** — Human annotations in code
|
|
111
|
+
7. **Human opinion** — Always last
|
|
112
|
+
|
|
113
|
+
> **Rule:** If tests contradict comments, tests win. If runtime contradicts tests, that's a bug to fix—runtime is truth, tests are intent.
|
|
114
|
+
|
|
115
|
+
## Risk Levels
|
|
116
|
+
|
|
117
|
+
| Level | Domains | Review |
|
|
118
|
+
| ---------- | ------------------------------------------ | -------------- |
|
|
119
|
+
| **High** | Auth, payments, permissions, infra, PII | Human required |
|
|
120
|
+
| **Medium** | New dependencies, API changes, performance | AI review |
|
|
121
|
+
| **Low** | Docs, refactors, tests, internal tooling | Automerge |
|
package/README.md
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="shipit.png" width="240" alt="ShipIt logo">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
# ShipIt 🚀
|
|
6
|
+
|
|
7
|
+
[](https://github.com/NJLaPrell/ShipIt/releases/tag/v1.0.0)
|
|
8
|
+
[](https://www.npmjs.com/package/@nlaprell/shipit)
|
|
9
|
+
[](./tests/ISSUES.md)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
|
|
12
|
+
> **Stop optimizing for humans. Start optimizing for AI.**
|
|
13
|
+
|
|
14
|
+
An SDLC built for AI-assisted development: state in files, tests as truth, gates instead of meetings. Replaces handoffs and docs with executable truth and state-anchored workflows. **Production ready** — CLI-first; see [tests/ISSUES.md](./tests/ISSUES.md) for validation.
|
|
15
|
+
|
|
16
|
+
**Repository:** [github.com/NJLaPrell/ShipIt](https://github.com/NJLaPrell/ShipIt)
|
|
17
|
+
|
|
18
|
+
## Table of Contents
|
|
19
|
+
|
|
20
|
+
- [1. Quick Start](#1-quick-start)
|
|
21
|
+
- [2. Prerequisites](#2-prerequisites)
|
|
22
|
+
- [3. What You Get](#3-what-you-get)
|
|
23
|
+
- [4. Core Workflow](#4-core-workflow)
|
|
24
|
+
- [5. The Problem & The Solution](#5-the-problem--the-solution)
|
|
25
|
+
- [6. Installation](#6-installation)
|
|
26
|
+
- [7. Key Concepts](#7-key-concepts)
|
|
27
|
+
- [8. Commands Reference](#8-commands-reference)
|
|
28
|
+
- [9. Documentation & Help](#9-documentation--help)
|
|
29
|
+
- [10. FAQ](#10-faq)
|
|
30
|
+
- [11. License](#11-license)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 1. Quick Start
|
|
35
|
+
|
|
36
|
+
Get from zero to a running project in under two minutes. Steps 3–4 run in **Cursor** or **VS Code** as slash commands.
|
|
37
|
+
|
|
38
|
+
### 1.1 Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g @nlaprell/shipit
|
|
42
|
+
# Or: npx @nlaprell/shipit init
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 1.2 Create a new project (or attach to existing)
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# New project
|
|
49
|
+
create-shipit-app my-awesome-app
|
|
50
|
+
|
|
51
|
+
# Existing project
|
|
52
|
+
cd my-existing-app && shipit init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
You’ll be prompted for tech stack (TypeScript/Node, Python, Other), project description, and high-risk domains.
|
|
56
|
+
|
|
57
|
+
### 1.3 Open in editor and run first commands
|
|
58
|
+
|
|
59
|
+
1. Open the project in **Cursor** or **VS Code**.
|
|
60
|
+
2. In the editor, run:
|
|
61
|
+
- `/scope-project "Build a todo app with auth"` — AI-assisted feature breakdown, generates intents and runs release plan + roadmap.
|
|
62
|
+
- `/ship F-001` — Runs the full 5-phase workflow (analysis → plan → tests → code → verify → release).
|
|
63
|
+
|
|
64
|
+
That’s it. The framework drives the rest with progress indicators and gates.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 2. Prerequisites
|
|
69
|
+
|
|
70
|
+
- **Node.js 20+**
|
|
71
|
+
- **Cursor** or **VS Code** (with ShipIt extension for VS Code). See [Using ShipIt in VS Code](docs/vscode-usage.md).
|
|
72
|
+
- **Git**
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 3. What You Get
|
|
77
|
+
|
|
78
|
+
After `create-shipit-app` or `shipit init`, your project has:
|
|
79
|
+
|
|
80
|
+
- **`project.json`** — Project metadata and ShipIt version.
|
|
81
|
+
- **`work/intent/`** — Features, bugs, tech-debt as markdown (F-001.md, etc.).
|
|
82
|
+
- **`work/workflow-state/`** — Active phase and per-intent state (see [parallel workflow](docs/parallel-workflow.md)).
|
|
83
|
+
- **`work/roadmap/`** — now / next / later triage.
|
|
84
|
+
- **`work/release/`** — Release plan (what ships when).
|
|
85
|
+
- **`scripts/`** — Framework scripts (verify, fix, status, workflow-orchestrator, etc.).
|
|
86
|
+
- **`.cursor/`** — Slash commands and rules (or equivalent for VS Code).
|
|
87
|
+
- **`_system/`** — Architecture (CANON, invariants), artifacts, behaviors, security, drift. **Do not edit.** Upgraded via `shipit upgrade` only.
|
|
88
|
+
- **`.override/`** — Your customizations (rules, commands, scripts, config); never touched by upgrade.
|
|
89
|
+
|
|
90
|
+
**Do not edit** `_system/` — framework internals. Use `.override/` for customizations.
|
|
91
|
+
|
|
92
|
+
Optional: **`dashboard-app/`** — Web dashboard; run with `pnpm dashboard`.
|
|
93
|
+
|
|
94
|
+
Full tree and planning outputs: [docs/DIRECTORY_STRUCTURE.md](./docs/DIRECTORY_STRUCTURE.md).
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## 4. Core Workflow
|
|
99
|
+
|
|
100
|
+
One path: **Install CLI → create or init project → open in editor → scope → ship.**
|
|
101
|
+
|
|
102
|
+
| Phase | Commands |
|
|
103
|
+
| --------------- | --------------------------------------------------------------------------------------------- |
|
|
104
|
+
| **Setup** | CLI: `create-shipit-app` or `shipit init`. Editor: `/scope-project`, `/status`, `/dashboard`. |
|
|
105
|
+
| **Planning** | `/new_intent`, `/generate-release-plan`, `/generate-roadmap`, `/fix`. |
|
|
106
|
+
| **Execution** | `/ship <id>`, `/verify <id>`, `/status`. |
|
|
107
|
+
| **Maintenance** | `shipit upgrade`, `/rollback <id>`, `/kill <id>`, `/drift_check`, `/deploy`. |
|
|
108
|
+
|
|
109
|
+
Slash commands run in Cursor or VS Code. Full phase details: [AGENTS.md](./AGENTS.md#workflow).
|
|
110
|
+
|
|
111
|
+
<details>
|
|
112
|
+
<summary><strong>Detailed workflow diagram</strong></summary>
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
116
|
+
│ ShipIt Workflow │
|
|
117
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
118
|
+
|
|
119
|
+
SETUP PHASE
|
|
120
|
+
├─ create-shipit-app <name> or shipit init (CLI)
|
|
121
|
+
├─ /scope-project "Description" → intents, release plan, roadmap
|
|
122
|
+
└─ /status, /dashboard
|
|
123
|
+
|
|
124
|
+
PLANNING PHASE
|
|
125
|
+
├─ /new_intent → /generate-release-plan → /generate-roadmap
|
|
126
|
+
└─ /fix (auto-fix intent issues)
|
|
127
|
+
|
|
128
|
+
EXECUTION PHASE
|
|
129
|
+
├─ /ship <id> → [1] Analysis → [2] Plan → [3] Tests → [4] Code → [5] Verify → Release
|
|
130
|
+
├─ /verify <id>, /status
|
|
131
|
+
└─ /rollback <id>, /kill <id>
|
|
132
|
+
|
|
133
|
+
MAINTENANCE
|
|
134
|
+
├─ shipit upgrade (backup in ._shipit_backup/)
|
|
135
|
+
├─ /drift_check, /deploy
|
|
136
|
+
└─ /test_shipit (framework E2E)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
</details>
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## 5. The Problem & The Solution
|
|
144
|
+
|
|
145
|
+
**The problem:** Traditional SDLC assumes humans are the bottleneck. AI agents need state files, executable tests, explicit gates, and do-not-repeat ledgers — not meetings and handoffs. Most failures are unstated assumptions and ambiguous truth, not coding errors.
|
|
146
|
+
|
|
147
|
+
**The solution:** ShipIt optimizes for **what counts as truth**: tests and invariants over docs, state in files over meetings, explicit gates over tribal knowledge. Add adversarial verification, intent ledger in `work/intent/`, drift detection, and context-aware suggestions. How the 7 agents (Steward, PM, Architect, Implementer, QA, Security, Docs) work together: [AGENTS.md](./AGENTS.md).
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 6. Installation
|
|
152
|
+
|
|
153
|
+
### 6.1 For app developers
|
|
154
|
+
|
|
155
|
+
See [Quick Start](#1-quick-start) for the full flow. Quick reference:
|
|
156
|
+
|
|
157
|
+
| Action | Command |
|
|
158
|
+
| ------------------ | ------------------------------------------------- |
|
|
159
|
+
| Install CLI | `npm install -g @nlaprell/shipit` |
|
|
160
|
+
| New project | `create-shipit-app my-app` |
|
|
161
|
+
| Attach to existing | `cd my-app && shipit init` |
|
|
162
|
+
| Upgrade framework | `shipit upgrade` (backs up to `._shipit_backup/`) |
|
|
163
|
+
| Check installation | `shipit check` |
|
|
164
|
+
|
|
165
|
+
No global install: `npx @nlaprell/shipit init` from your project root. Full options: [docs/CLI_REFERENCE.md](./docs/CLI_REFERENCE.md).
|
|
166
|
+
|
|
167
|
+
### 6.2 From source (contributors)
|
|
168
|
+
|
|
169
|
+
**pnpm** is used when developing the framework itself:
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
git clone https://github.com/NJLaPrell/ShipIt.git
|
|
173
|
+
cd ShipIt
|
|
174
|
+
pnpm install
|
|
175
|
+
pnpm test && pnpm test:cli && pnpm test:shipit -- --clean
|
|
176
|
+
# Optional: pnpm validate-cursor or pnpm validate-vscode
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
See [docs/CONTRIBUTING.md](./docs/CONTRIBUTING.md).
|
|
180
|
+
|
|
181
|
+
### 6.3 User customizations (`.override/`)
|
|
182
|
+
|
|
183
|
+
Put customizations in `.override/rules/`, `.override/commands/`, `.override/scripts/`, `.override/config/`. They are **never** touched by `shipit upgrade`. [docs/USER_OVERRIDES_DESIGN.md](./docs/USER_OVERRIDES_DESIGN.md).
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## 7. Key Concepts
|
|
188
|
+
|
|
189
|
+
- **Intent ledger** — All work lives in `work/intent/` as markdown with executable acceptance criteria, confidence scores, invariants, kill criteria, and rollback plan. Use `/fix` to auto-fix common issues. Templates: [AGENTS.md](./AGENTS.md) and `work/intent/templates/`.
|
|
190
|
+
- **Tests first** — The workflow enforces Spec → Tests → Code. QA writes tests (they fail); Implementer writes code (tests pass). No production code before tests.
|
|
191
|
+
- **Truth hierarchy** — When facts conflict: runtime behavior > tests > invariants > specs > architecture > comments > opinion. [AGENTS.md](./AGENTS.md).
|
|
192
|
+
- **High-risk gates** — Auth, payments, permissions, infrastructure, PII require human approval before implementation.
|
|
193
|
+
|
|
194
|
+
**More:** GitHub integration, usage/cost, security allowlist, confidence calibration → [AGENTS.md](./AGENTS.md).
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## 8. Commands Reference
|
|
199
|
+
|
|
200
|
+
**CLI:** `shipit init | upgrade | check | create | list-backups | restore` — see [docs/CLI_REFERENCE.md](./docs/CLI_REFERENCE.md).
|
|
201
|
+
|
|
202
|
+
**Editor (slash commands):**
|
|
203
|
+
|
|
204
|
+
| Category | Commands |
|
|
205
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
206
|
+
| **Setup** | `create-shipit-app` / `shipit init`, `/scope-project`, `/status`, `/dashboard` |
|
|
207
|
+
| **Planning** | `/new_intent`, `/generate-release-plan`, `/generate-roadmap`, `/fix`, `/pr`, `/create-pr`, `/create-intent-from-issue`, `/risk`, `/revert-plan` |
|
|
208
|
+
| **Execution** | `/ship <id>`, `/verify <id>`, `/rollback <id>`, `/kill <id>` |
|
|
209
|
+
| **Maintenance** | `/drift_check`, `/deploy`, `/test_shipit` |
|
|
210
|
+
| **Utility** | `/help`, `/suggest`, `/dashboard`, `/usage-record`, `/usage-report`, `/calibration-report` |
|
|
211
|
+
|
|
212
|
+
All slash commands are in [.cursor/commands/](./.cursor/commands/). Scripts: `pnpm run <script>` (e.g. `pnpm fix`, `pnpm verify`). Headless/VS Code: [docs/headless-mode.md](./docs/headless-mode.md), [docs/vscode-usage.md](./docs/vscode-usage.md).
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## 9. Documentation & Help
|
|
217
|
+
|
|
218
|
+
- [docs/CLI_REFERENCE.md](./docs/CLI_REFERENCE.md) — All CLI commands and options
|
|
219
|
+
- [docs/LIMITATIONS.md](./docs/LIMITATIONS.md) — What ShipIt doesn’t do, when not to use
|
|
220
|
+
- [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) — Exit codes, common issues, rollback
|
|
221
|
+
- [docs/EXAMPLES.md](./docs/EXAMPLES.md) — New project, existing project, upgrade, CI
|
|
222
|
+
- [docs/PILOT_GUIDE.md](./docs/PILOT_GUIDE.md) — Step-by-step first feature
|
|
223
|
+
- [docs/DIRECTORY_STRUCTURE.md](./docs/DIRECTORY_STRUCTURE.md) — Project layout
|
|
224
|
+
- [docs/STABILITY.md](./docs/STABILITY.md) — Stable vs experimental APIs
|
|
225
|
+
- [AGENTS.md](./AGENTS.md) — Roles, workflow, conventions
|
|
226
|
+
- [CHANGELOG.md](./CHANGELOG.md) — Version history
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## 10. FAQ
|
|
231
|
+
|
|
232
|
+
**Q: How do I install ShipIt?**
|
|
233
|
+
A: `npm install -g @nlaprell/shipit`. Then `create-shipit-app <name>` or `shipit init`. [CLI_REFERENCE](./docs/CLI_REFERENCE.md).
|
|
234
|
+
|
|
235
|
+
**Q: Can I use ShipIt with an existing project?**
|
|
236
|
+
A: Yes. Run `shipit init` in the project root. It merges framework files and package.json. [EXAMPLES](./docs/EXAMPLES.md).
|
|
237
|
+
|
|
238
|
+
**Q: How do I upgrade?**
|
|
239
|
+
A: `shipit upgrade`. Backups go to `._shipit_backup/`. Use `--dry-run` first. [TROUBLESHOOTING](./docs/TROUBLESHOOTING.md#after-a-failed-or-unwanted-shipit-upgrade).
|
|
240
|
+
|
|
241
|
+
**Q: Will upgrade overwrite my changes?**
|
|
242
|
+
A: Framework-owned files are updated (with backup). App code and non-framework paths are not. Use `.override/` for customizations so they’re never touched.
|
|
243
|
+
|
|
244
|
+
**Q: How do I customize Cursor/VS Code rules?**
|
|
245
|
+
A: Add files under `.override/rules/`. [USER_OVERRIDES_DESIGN](./docs/USER_OVERRIDES_DESIGN.md).
|
|
246
|
+
|
|
247
|
+
**Q: Do I need to understand all 7 agents?**
|
|
248
|
+
A: No. Use the commands; agents run during `/ship`. [AGENTS.md](./AGENTS.md) for depth.
|
|
249
|
+
|
|
250
|
+
**Q: What about deployment?**
|
|
251
|
+
A: `/deploy` runs readiness checks; actual deployment is your pipeline. See [LIMITATIONS](./docs/LIMITATIONS.md).
|
|
252
|
+
|
|
253
|
+
**Q: Where do I get help?**
|
|
254
|
+
A: [TROUBLESHOOTING](./docs/TROUBLESHOOTING.md), [GitHub Issues](https://github.com/NJLaPrell/ShipIt/issues).
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 11. License
|
|
259
|
+
|
|
260
|
+
MIT. See [CHANGELOG.md](./CHANGELOG.md) for version history.
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
**Next:** Once you’ve created a project, open it in Cursor or VS Code, run `/scope-project "your goal"`, then `/ship F-001`. Full walkthrough: [docs/PILOT_GUIDE.md](./docs/PILOT_GUIDE.md).
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Architecture Canon
|
|
2
|
+
|
|
3
|
+
> **This document is the authoritative source for system architecture.**
|
|
4
|
+
> Code that violates this canon is illegal. Update this document before implementing violations.
|
|
5
|
+
|
|
6
|
+
## System Overview
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
10
|
+
│ ShipIt System │
|
|
11
|
+
├─────────────────────────────────────────────────────────────┤
|
|
12
|
+
│ Intent Layer │ Execution Layer │ Verification │
|
|
13
|
+
│ ───────────────── │ ──────────────── │ ───────────── │
|
|
14
|
+
│ work/intent/ │ work/workflow-state/ │ CI/CD │
|
|
15
|
+
│ work/roadmap/ │ .cursor/rules/ │ Tests │
|
|
16
|
+
│ _system/do-not-repeat/ │ .cursor/commands/ │ Linting │
|
|
17
|
+
└─────────────────────────────────────────────────────────────┘
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Boundaries
|
|
21
|
+
|
|
22
|
+
### Layer Responsibilities
|
|
23
|
+
|
|
24
|
+
| Layer | Responsibility | Cannot Do |
|
|
25
|
+
| ------------------ | ---------------------------- | -------------------------- |
|
|
26
|
+
| **Intent** | Define WHAT to build | Specify HOW to implement |
|
|
27
|
+
| **Architecture** | Define HOW systems connect | Write production code |
|
|
28
|
+
| **Implementation** | Write code that passes tests | Change architecture |
|
|
29
|
+
| **Verification** | Prove correctness | Weaken acceptance criteria |
|
|
30
|
+
|
|
31
|
+
### Directory Boundaries
|
|
32
|
+
|
|
33
|
+
**Full map:** See [docs/DIRECTORY_STRUCTURE.md](../../docs/DIRECTORY_STRUCTURE.md) for a quick reference.
|
|
34
|
+
|
|
35
|
+
| Directory | Purpose | Owner | Modification Rules |
|
|
36
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------- |
|
|
37
|
+
| `work/intent/` | Planned work (features, bugs, tech-debt) | PM, Steward | Anyone can propose; Steward approves |
|
|
38
|
+
| `_system/architecture/` | System boundaries, invariants, schemas, ADRs | Architect, Steward | Requires ADR for changes |
|
|
39
|
+
| `work/workflow-state/` | Current execution state (phases, status, assumptions). Layout: flat or per-intent; see [workflow-state-layout.md](./workflow-state-layout.md). | All agents | Append-only during execution; consumers must support both layouts |
|
|
40
|
+
| `_system/do-not-repeat/` | Failed approaches (abandoned designs, bad patterns, rejected libs) | All agents | Append-only; never delete |
|
|
41
|
+
| `/src/` | Production source code | Implementer | Must follow approved plan |
|
|
42
|
+
| `/tests/` | Test code, fixtures, run logs, process docs (see tests/README.md) | QA, Implementer | Tests before implementation |
|
|
43
|
+
| `_system/artifacts/` | Generated files (SYSTEM_STATE.md, dependencies.md, confidence-calibration.json) | Scripts | Regenerated by generate-\* and verify scripts |
|
|
44
|
+
| `work/release/` | Generated release plan (ordered intents by release target) | Scripts | Regenerated by generate-release-plan.sh |
|
|
45
|
+
| `work/roadmap/` | Planning views (now, next, later triage) | Scripts | Regenerated by generate-roadmap.sh |
|
|
46
|
+
| `/scripts/` | Shell scripts for workflow, generation, validation, deploy | All | Add with approval; follow lib/ for shared code |
|
|
47
|
+
| `_system/security/` | Audit allowlist, security config | Security, Steward | Append-only for allowlist |
|
|
48
|
+
| `_system/behaviors/` | Procedures and policies (release, issue tracking, platform work) | All | Document how we work |
|
|
49
|
+
| `_system/reports/` | Generated reports (mutation, coverage, etc.) | Scripts | Regenerated; often gitignored |
|
|
50
|
+
| `_system/golden-data/` | Replay validation test data for regression testing | QA | Append-only; capture known-good inputs/outputs |
|
|
51
|
+
| `/projects/` | Initialized ShipIt projects (from /init-project) | Scripts | Contents gitignored; .gitkeep only committed |
|
|
52
|
+
| `_system/drift/` | Entropy baselines and metrics | Scripts | Regenerated by drift-check.sh |
|
|
53
|
+
| `/.cursor/` | Cursor config (commands/, rules/, agents/) | All | Commands and rules are first-class; version controlled |
|
|
54
|
+
|
|
55
|
+
## Allowed Dependencies
|
|
56
|
+
|
|
57
|
+
### External Dependencies
|
|
58
|
+
|
|
59
|
+
| Category | Allowed | Forbidden |
|
|
60
|
+
| ------------ | ------------------ | -------------------------- |
|
|
61
|
+
| **Runtime** | Node.js LTS | Experimental Node features |
|
|
62
|
+
| **Language** | TypeScript 5.x | JavaScript (must be TS) |
|
|
63
|
+
| **Testing** | Vitest, fast-check | Jest (use Vitest instead) |
|
|
64
|
+
| **Linting** | ESLint, Prettier | TSLint (deprecated) |
|
|
65
|
+
| **Build** | esbuild, tsup | Webpack (too complex) |
|
|
66
|
+
|
|
67
|
+
### Internal Dependencies
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
┌──────────────┐
|
|
71
|
+
│ /src/ │
|
|
72
|
+
├──────────────┤
|
|
73
|
+
│ domain/ │ ← Pure business logic, no I/O
|
|
74
|
+
│ services/ │ ← Orchestration, uses domain
|
|
75
|
+
│ adapters/ │ ← External integrations
|
|
76
|
+
│ utils/ │ ← Shared utilities
|
|
77
|
+
└──────────────┘
|
|
78
|
+
|
|
79
|
+
Allowed: domain ← services ← adapters
|
|
80
|
+
utils can be used by any layer
|
|
81
|
+
Forbidden: domain → services (no upward deps)
|
|
82
|
+
circular dependencies
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Forbidden Patterns
|
|
86
|
+
|
|
87
|
+
### Code Patterns
|
|
88
|
+
|
|
89
|
+
| Pattern | Reason | Alternative |
|
|
90
|
+
| --------------------- | ------------------- | --------------------------- |
|
|
91
|
+
| `any` type | Defeats type safety | Use `unknown` + type guards |
|
|
92
|
+
| `eval()` | Security risk | Use safe alternatives |
|
|
93
|
+
| `innerHTML` | XSS vulnerability | Use textContent or DOM APIs |
|
|
94
|
+
| `console.log` in prod | Leaks info | Use structured logger |
|
|
95
|
+
| Circular imports | Architectural smell | Refactor dependencies |
|
|
96
|
+
|
|
97
|
+
### Architectural Patterns
|
|
98
|
+
|
|
99
|
+
| Pattern | Reason | Alternative |
|
|
100
|
+
| -------------------- | --------------- | --------------------- |
|
|
101
|
+
| God objects | Unmaintainable | Single responsibility |
|
|
102
|
+
| Deep inheritance | Fragile | Composition |
|
|
103
|
+
| Global mutable state | Race conditions | Dependency injection |
|
|
104
|
+
| Magic strings | Typo-prone | Constants/enums |
|
|
105
|
+
|
|
106
|
+
## Performance Budgets
|
|
107
|
+
|
|
108
|
+
| Metric | Budget | Measurement |
|
|
109
|
+
| ----------- | ------- | ----------------- |
|
|
110
|
+
| p95 latency | < 200ms | API response time |
|
|
111
|
+
| p99 latency | < 500ms | API response time |
|
|
112
|
+
| Memory | < 512MB | Process RSS |
|
|
113
|
+
| Bundle size | < 1MB | Production build |
|
|
114
|
+
| Test suite | < 60s | Full test run |
|
|
115
|
+
|
|
116
|
+
## Security Requirements
|
|
117
|
+
|
|
118
|
+
### Authentication & Authorization
|
|
119
|
+
|
|
120
|
+
- All endpoints require authentication except: `/health`, `/metrics`
|
|
121
|
+
- Use principle of least privilege
|
|
122
|
+
- Session tokens expire after 24h max
|
|
123
|
+
- Refresh tokens require re-authentication after 7 days
|
|
124
|
+
|
|
125
|
+
### Data Handling
|
|
126
|
+
|
|
127
|
+
- PII must be encrypted at rest
|
|
128
|
+
- Secrets never logged
|
|
129
|
+
- All user input validated and sanitized
|
|
130
|
+
- SQL queries must use parameterized statements
|
|
131
|
+
|
|
132
|
+
### High-Risk Domains (Require Human Approval)
|
|
133
|
+
|
|
134
|
+
- 🔐 Authentication changes
|
|
135
|
+
- 💰 Payment processing
|
|
136
|
+
- 🔑 Permission/RBAC changes
|
|
137
|
+
- 🏗️ Infrastructure changes
|
|
138
|
+
- 📋 PII handling changes
|
|
139
|
+
|
|
140
|
+
## Schema Compatibility
|
|
141
|
+
|
|
142
|
+
- Database migrations must be backward compatible for 3 versions
|
|
143
|
+
- API changes must maintain backward compatibility
|
|
144
|
+
- Breaking changes require deprecation period (minimum 1 version)
|
|
145
|
+
|
|
146
|
+
## ADR Log
|
|
147
|
+
|
|
148
|
+
Architecture Decision Records are stored in `_system/architecture/ADR-###.md`.
|
|
149
|
+
|
|
150
|
+
| ADR | Decision | Date |
|
|
151
|
+
| ------- | ------------------------------ | ---------- |
|
|
152
|
+
| ADR-001 | Use TypeScript + Node.js | 2026-01-12 |
|
|
153
|
+
| ADR-002 | Use Vitest over Jest | 2026-01-12 |
|
|
154
|
+
| ADR-003 | Prefer config over custom code | 2026-01-12 |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
_Last updated: 2026-02-04_
|
|
159
|
+
_Approved by: Steward_
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Invariants Configuration
|
|
2
|
+
# These constraints are enforced via ESLint, TypeScript, and CI checks
|
|
3
|
+
# See README.md and AGENTS.md for more details on the invariants system
|
|
4
|
+
|
|
5
|
+
version: 1
|
|
6
|
+
|
|
7
|
+
# Security invariants - enforced via ESLint + custom CI
|
|
8
|
+
security:
|
|
9
|
+
- id: no_pii_unencrypted
|
|
10
|
+
description: PII must be encrypted at rest
|
|
11
|
+
enforcement: ci_test
|
|
12
|
+
|
|
13
|
+
- id: all_endpoints_authenticated
|
|
14
|
+
description: All endpoints require auth except health/metrics
|
|
15
|
+
exceptions:
|
|
16
|
+
- '/health'
|
|
17
|
+
- '/metrics'
|
|
18
|
+
- '/api/v1/public/*'
|
|
19
|
+
enforcement: ci_test
|
|
20
|
+
|
|
21
|
+
- id: secrets_never_logged
|
|
22
|
+
description: Secrets and tokens must never appear in logs
|
|
23
|
+
enforcement: eslint_no_console_in_prod
|
|
24
|
+
|
|
25
|
+
# Code quality invariants - enforced via ESLint
|
|
26
|
+
code_quality:
|
|
27
|
+
- id: no_explicit_any
|
|
28
|
+
description: No 'any' type allowed
|
|
29
|
+
enforcement: '@typescript-eslint/no-explicit-any'
|
|
30
|
+
|
|
31
|
+
- id: no_eval
|
|
32
|
+
description: No eval() calls
|
|
33
|
+
enforcement: 'no-eval'
|
|
34
|
+
|
|
35
|
+
- id: no_inner_html
|
|
36
|
+
description: No innerHTML assignments
|
|
37
|
+
enforcement: 'no-unsanitized/property'
|
|
38
|
+
|
|
39
|
+
- id: no_circular_deps
|
|
40
|
+
description: No circular dependencies
|
|
41
|
+
enforcement: 'import/no-cycle'
|
|
42
|
+
|
|
43
|
+
# Performance invariants - enforced via CI benchmarks
|
|
44
|
+
performance:
|
|
45
|
+
p95_latency_ms: 200
|
|
46
|
+
p99_latency_ms: 500
|
|
47
|
+
max_memory_mb: 512
|
|
48
|
+
max_bundle_size_kb: 1024
|
|
49
|
+
max_test_duration_s: 60
|
|
50
|
+
|
|
51
|
+
# Data invariants - enforced via CI tests
|
|
52
|
+
data:
|
|
53
|
+
schema_backward_compat_versions: 3
|
|
54
|
+
require_idempotent_writes: true
|
|
55
|
+
require_migration_rollback: true
|
|
56
|
+
|
|
57
|
+
# Architecture invariants - enforced via ESLint import rules
|
|
58
|
+
architecture:
|
|
59
|
+
max_import_depth: 5
|
|
60
|
+
forbidden_patterns:
|
|
61
|
+
- pattern: 'any'
|
|
62
|
+
reason: 'Defeats type safety'
|
|
63
|
+
- pattern: 'eval('
|
|
64
|
+
reason: 'Security vulnerability'
|
|
65
|
+
- pattern: '.innerHTML'
|
|
66
|
+
reason: 'XSS vulnerability'
|
|
67
|
+
- pattern: 'console.log'
|
|
68
|
+
context: 'src/**'
|
|
69
|
+
reason: 'Use structured logger'
|
|
70
|
+
|
|
71
|
+
# Success metrics - tracked in drift/metrics.md
|
|
72
|
+
success_metrics:
|
|
73
|
+
test_pass_rate_minimum: 99.5
|
|
74
|
+
code_coverage_minimum: 80
|
|
75
|
+
max_cyclomatic_complexity: 10
|
|
76
|
+
max_file_lines: 500
|
|
77
|
+
|
|
78
|
+
# ESLint rule mapping (for reference)
|
|
79
|
+
# These map invariants to actual ESLint configuration
|
|
80
|
+
eslint_mapping:
|
|
81
|
+
'@typescript-eslint/no-explicit-any': 'error'
|
|
82
|
+
'@typescript-eslint/ban-types': 'error'
|
|
83
|
+
'no-eval': 'error'
|
|
84
|
+
'import/no-cycle': 'error'
|
|
85
|
+
'no-console':
|
|
86
|
+
- 'error'
|
|
87
|
+
- allow: ['warn', 'error']
|