docguard-cli 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/PHILOSOPHY.md +150 -0
- package/README.md +309 -0
- package/STANDARD.md +751 -0
- package/cli/commands/agents.mjs +221 -0
- package/cli/commands/audit.mjs +92 -0
- package/cli/commands/badge.mjs +72 -0
- package/cli/commands/ci.mjs +80 -0
- package/cli/commands/diagnose.mjs +273 -0
- package/cli/commands/diff.mjs +360 -0
- package/cli/commands/fix.mjs +610 -0
- package/cli/commands/generate.mjs +842 -0
- package/cli/commands/guard.mjs +158 -0
- package/cli/commands/hooks.mjs +227 -0
- package/cli/commands/init.mjs +249 -0
- package/cli/commands/score.mjs +396 -0
- package/cli/commands/watch.mjs +143 -0
- package/cli/docguard.mjs +458 -0
- package/cli/validators/architecture.mjs +380 -0
- package/cli/validators/changelog.mjs +39 -0
- package/cli/validators/docs-sync.mjs +110 -0
- package/cli/validators/drift.mjs +101 -0
- package/cli/validators/environment.mjs +70 -0
- package/cli/validators/freshness.mjs +224 -0
- package/cli/validators/security.mjs +101 -0
- package/cli/validators/structure.mjs +88 -0
- package/cli/validators/test-spec.mjs +115 -0
- package/docs/ai-integration.md +179 -0
- package/docs/commands.md +239 -0
- package/docs/configuration.md +96 -0
- package/docs/faq.md +155 -0
- package/docs/installation.md +81 -0
- package/docs/profiles.md +103 -0
- package/docs/quickstart.md +79 -0
- package/package.json +57 -0
- package/templates/ADR.md.template +64 -0
- package/templates/AGENTS.md.template +88 -0
- package/templates/ARCHITECTURE.md.template +78 -0
- package/templates/CHANGELOG.md.template +16 -0
- package/templates/CURRENT-STATE.md.template +64 -0
- package/templates/DATA-MODEL.md.template +66 -0
- package/templates/DEPLOYMENT.md.template +66 -0
- package/templates/DRIFT-LOG.md.template +18 -0
- package/templates/ENVIRONMENT.md.template +43 -0
- package/templates/KNOWN-GOTCHAS.md.template +69 -0
- package/templates/ROADMAP.md.template +82 -0
- package/templates/RUNBOOKS.md.template +115 -0
- package/templates/SECURITY.md.template +42 -0
- package/templates/TEST-SPEC.md.template +55 -0
- package/templates/TROUBLESHOOTING.md.template +96 -0
- package/templates/VENDOR-BUGS.md.template +74 -0
- package/templates/ci/github-actions.yml +39 -0
- package/templates/commands/docguard.fix.md +65 -0
- package/templates/commands/docguard.guard.md +40 -0
- package/templates/commands/docguard.init.md +62 -0
- package/templates/commands/docguard.review.md +44 -0
- package/templates/commands/docguard.update.md +44 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# DocGuard — Quick Start
|
|
2
|
+
|
|
3
|
+
Get AI-enforced documentation in under 5 minutes.
|
|
4
|
+
|
|
5
|
+
## For New Projects
|
|
6
|
+
|
|
7
|
+
### Option A: Minimal (side projects)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd your-project
|
|
11
|
+
npx docguard init --profile starter
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Creates only ARCHITECTURE.md + CHANGELOG — the bare minimum.
|
|
15
|
+
|
|
16
|
+
### Option B: Full CDD (team projects)
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cd your-project
|
|
20
|
+
npx docguard init
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Creates all 5 canonical docs + tracking files + AI slash commands.
|
|
24
|
+
|
|
25
|
+
### Option C: From existing code (best for established projects)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
cd your-project
|
|
29
|
+
npx docguard generate
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Scans your codebase and generates pre-filled documentation.
|
|
33
|
+
|
|
34
|
+
## Fill the Docs (AI Does It)
|
|
35
|
+
|
|
36
|
+
After init creates skeleton templates, run **one command**:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx docguard diagnose
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This outputs a complete AI remediation plan. If you're using Claude Code, Cursor, Copilot, or Antigravity, the AI reads the output and writes every doc automatically.
|
|
43
|
+
|
|
44
|
+
**That's it.** The AI loop:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
diagnose → AI reads prompts → AI fixes docs → guard verifies
|
|
48
|
+
↑ ↓
|
|
49
|
+
└───────────────── issues found? ←──────────────────────┘
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Verify
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npx docguard guard # Pass/fail check
|
|
56
|
+
npx docguard score # 0-100 maturity score
|
|
57
|
+
npx docguard score --tax # How much time docs cost you
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Automate
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Git hooks (auto-check on commit/push)
|
|
64
|
+
npx docguard hooks
|
|
65
|
+
|
|
66
|
+
# CI/CD pipelines
|
|
67
|
+
npx docguard ci --threshold 70
|
|
68
|
+
|
|
69
|
+
# Live watch mode with auto-fix
|
|
70
|
+
npx docguard watch --auto-fix
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## What's Next?
|
|
74
|
+
|
|
75
|
+
- [Commands Reference](./commands.md) — All 13 commands
|
|
76
|
+
- [Configuration](./configuration.md) — `.docguard.json` options
|
|
77
|
+
- [Profiles](./profiles.md) — Starter vs Standard vs Enterprise
|
|
78
|
+
- [AI Integration](./ai-integration.md) — How AI agents use DocGuard
|
|
79
|
+
- [FAQ](./faq.md) — Common questions
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docguard-cli",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "The enforcement tool for Canonical-Driven Development (CDD). Audit, generate, and guard your project documentation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"docguard": "./cli/docguard.mjs"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"docguard": "node cli/docguard.mjs",
|
|
11
|
+
"audit": "node cli/docguard.mjs audit",
|
|
12
|
+
"guard": "node cli/docguard.mjs guard",
|
|
13
|
+
"init": "node cli/docguard.mjs init",
|
|
14
|
+
"score": "node cli/docguard.mjs score",
|
|
15
|
+
"diff": "node cli/docguard.mjs diff",
|
|
16
|
+
"generate": "node cli/docguard.mjs generate",
|
|
17
|
+
"hooks": "node cli/docguard.mjs hooks",
|
|
18
|
+
"prepublishOnly": "node cli/docguard.mjs --version",
|
|
19
|
+
"test": "node --test tests/*.test.mjs"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"canonical-driven-development",
|
|
23
|
+
"cdd",
|
|
24
|
+
"documentation",
|
|
25
|
+
"governance",
|
|
26
|
+
"ai-agents",
|
|
27
|
+
"spec-guard",
|
|
28
|
+
"docguard",
|
|
29
|
+
"validation",
|
|
30
|
+
"cli",
|
|
31
|
+
"developer-tools",
|
|
32
|
+
"documentation-standard"
|
|
33
|
+
],
|
|
34
|
+
"author": "Ricardo Accioly",
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/raccioly/docguard"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://github.com/raccioly/docguard#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/raccioly/docguard/issues"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18.0.0"
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"cli/",
|
|
49
|
+
"templates/",
|
|
50
|
+
"docs/",
|
|
51
|
+
"STANDARD.md",
|
|
52
|
+
"PHILOSOPHY.md",
|
|
53
|
+
"README.md",
|
|
54
|
+
"LICENSE"
|
|
55
|
+
],
|
|
56
|
+
"dependencies": {}
|
|
57
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Architecture Decision Records (ADR)
|
|
2
|
+
|
|
3
|
+
<!-- docguard:version 0.1.0 -->
|
|
4
|
+
<!-- docguard:status living -->
|
|
5
|
+
<!-- docguard:last-reviewed YYYY-MM-DD -->
|
|
6
|
+
|
|
7
|
+
> **Canonical document** — Design intent. Records significant architectural decisions and their rationale.
|
|
8
|
+
> Once accepted, ADRs are immutable. Superseded ADRs are preserved with a link to their replacement.
|
|
9
|
+
|
|
10
|
+
| Metadata | Value |
|
|
11
|
+
|----------|-------|
|
|
12
|
+
| **Status** |  |
|
|
13
|
+
| **Version** | `0.1.0` |
|
|
14
|
+
| **Last Updated** | YYYY-MM-DD |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Index
|
|
19
|
+
|
|
20
|
+
| # | Title | Status | Date |
|
|
21
|
+
|---|-------|:---:|:---:|
|
|
22
|
+
| ADR-001 | <!-- e.g. Use PostgreSQL over MongoDB --> | ✅ Accepted | YYYY-MM-DD |
|
|
23
|
+
| ADR-002 | | | |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## ADR-001: <!-- Title -->
|
|
28
|
+
|
|
29
|
+
**Status**: ✅ Accepted
|
|
30
|
+
**Date**: YYYY-MM-DD
|
|
31
|
+
**Author**: @your-github-username
|
|
32
|
+
|
|
33
|
+
### Context
|
|
34
|
+
|
|
35
|
+
<!-- What is the issue that we're seeing that motivates this decision? -->
|
|
36
|
+
|
|
37
|
+
### Decision
|
|
38
|
+
|
|
39
|
+
<!-- What is the change that we're proposing and/or doing? -->
|
|
40
|
+
|
|
41
|
+
### Consequences
|
|
42
|
+
|
|
43
|
+
<!-- What becomes easier or more difficult to do because of this change? -->
|
|
44
|
+
|
|
45
|
+
#### Positive
|
|
46
|
+
- <!-- Benefit 1 -->
|
|
47
|
+
|
|
48
|
+
#### Negative
|
|
49
|
+
- <!-- Tradeoff 1 -->
|
|
50
|
+
|
|
51
|
+
#### Risks
|
|
52
|
+
- <!-- Risk 1 -->
|
|
53
|
+
|
|
54
|
+
### Alternatives Considered
|
|
55
|
+
|
|
56
|
+
| Alternative | Pros | Cons | Why Not |
|
|
57
|
+
|------------|------|------|---------|
|
|
58
|
+
| <!-- e.g. MongoDB --> | <!-- e.g. Flexible schema --> | <!-- e.g. Weak joins --> | <!-- e.g. We need relational queries --> |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ADR-002: <!-- Title -->
|
|
63
|
+
|
|
64
|
+
<!-- Same format as ADR-001 -->
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
> This project follows **Canonical-Driven Development (CDD)**.
|
|
4
|
+
> Read canonical docs before making changes. Log drift when deviating.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Overview
|
|
9
|
+
|
|
10
|
+
<!-- What this project is, in 2-3 sentences -->
|
|
11
|
+
|
|
12
|
+
## Project Documentation (CDD)
|
|
13
|
+
|
|
14
|
+
This project uses Canonical-Driven Development. Key locations:
|
|
15
|
+
|
|
16
|
+
- **Canonical docs** (design intent, READ-ONLY): `docs-canonical/`
|
|
17
|
+
- **Implementation docs** (current state): `docs-implementation/`
|
|
18
|
+
- **Drift tracking**: `DRIFT-LOG.md`
|
|
19
|
+
- **Change tracking**: `CHANGELOG.md`
|
|
20
|
+
|
|
21
|
+
## Build & Dev Commands
|
|
22
|
+
|
|
23
|
+
| Command | Purpose |
|
|
24
|
+
|---------|---------|
|
|
25
|
+
| <!-- e.g. npm install --> | Install dependencies |
|
|
26
|
+
| <!-- e.g. npm run dev --> | Start development server |
|
|
27
|
+
| <!-- e.g. npm test --> | Run unit tests |
|
|
28
|
+
|
|
29
|
+
## DocGuard — Documentation Enforcement
|
|
30
|
+
|
|
31
|
+
This project uses **DocGuard** for CDD compliance. Run these commands to validate:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Check documentation status
|
|
35
|
+
npx docguard audit
|
|
36
|
+
|
|
37
|
+
# Validate compliance (errors + warnings)
|
|
38
|
+
npx docguard guard
|
|
39
|
+
|
|
40
|
+
# See CDD maturity score
|
|
41
|
+
npx docguard score
|
|
42
|
+
|
|
43
|
+
# Find and fix CDD issues
|
|
44
|
+
npx docguard fix
|
|
45
|
+
|
|
46
|
+
# Get AI-ready fix prompt
|
|
47
|
+
npx docguard fix --format prompt
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### AI Agent Workflow (IMPORTANT)
|
|
51
|
+
|
|
52
|
+
When working on this project, follow this workflow:
|
|
53
|
+
|
|
54
|
+
1. **Before any work**: Run `npx docguard guard` to understand current compliance state
|
|
55
|
+
2. **After making changes**: Run `npx docguard fix --format prompt` to find remaining issues
|
|
56
|
+
3. **Fix what DocGuard reports**: Each issue includes an `ai_instruction` telling you exactly what to do
|
|
57
|
+
4. **Run guard again**: Verify all issues are resolved before committing
|
|
58
|
+
5. **Update CHANGELOG.md**: All changes need a changelog entry
|
|
59
|
+
|
|
60
|
+
### Auto-Fix Available Issues
|
|
61
|
+
|
|
62
|
+
If DocGuard detects missing files, run:
|
|
63
|
+
```bash
|
|
64
|
+
npx docguard fix --auto
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
This auto-creates required documentation from templates. Then review and fill in project-specific content.
|
|
68
|
+
|
|
69
|
+
## Workflow Rules
|
|
70
|
+
|
|
71
|
+
1. **Research first** — Check `docs-canonical/` before suggesting changes
|
|
72
|
+
2. **Confirm before implementing** — Show a plan, wait for approval
|
|
73
|
+
3. **Match existing patterns** — Search codebase for similar implementations
|
|
74
|
+
4. **Document drift** — If deviating from canonical docs, add `// DRIFT: reason`
|
|
75
|
+
5. **Update changelog** — All changes need a `CHANGELOG.md` entry
|
|
76
|
+
6. **Run DocGuard** — After any documentation changes, run `npx docguard guard`
|
|
77
|
+
|
|
78
|
+
## Code Conventions
|
|
79
|
+
|
|
80
|
+
<!-- Project-specific style rules -->
|
|
81
|
+
|
|
82
|
+
## File Change Rules
|
|
83
|
+
|
|
84
|
+
- Changes to >3 files require explicit approval
|
|
85
|
+
- Schema/data model changes require `DATA-MODEL.md` update
|
|
86
|
+
- New dependencies require justification
|
|
87
|
+
- Never commit without explicit approval
|
|
88
|
+
- Documentation changes must pass `docguard guard` before commit
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Architecture
|
|
2
|
+
|
|
3
|
+
<!-- docguard:version 0.1.0 -->
|
|
4
|
+
<!-- docguard:status draft | review | approved -->
|
|
5
|
+
<!-- docguard:last-reviewed YYYY-MM-DD -->
|
|
6
|
+
<!-- docguard:owner @your-github-username -->
|
|
7
|
+
|
|
8
|
+
> **Canonical document** — Design intent. This file describes WHAT the system is designed to be.
|
|
9
|
+
> ⚠️ Changes to this file require team review. Update `DRIFT-LOG.md` if code deviates.
|
|
10
|
+
|
|
11
|
+
| Metadata | Value |
|
|
12
|
+
|----------|-------|
|
|
13
|
+
| **Status** |  |
|
|
14
|
+
| **Version** | `0.1.0` |
|
|
15
|
+
| **Last Updated** | YYYY-MM-DD |
|
|
16
|
+
| **Owner** | @your-github-username |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## System Overview
|
|
21
|
+
|
|
22
|
+
<!-- One paragraph: What does this system do? Who is it for? -->
|
|
23
|
+
|
|
24
|
+
## Component Map
|
|
25
|
+
|
|
26
|
+
<!-- Major modules/packages and their responsibilities -->
|
|
27
|
+
|
|
28
|
+
| Component | Responsibility | Location | Tests |
|
|
29
|
+
|-----------|---------------|----------|-------|
|
|
30
|
+
| <!-- e.g. API Server --> | <!-- e.g. Handles HTTP requests --> | <!-- e.g. src/server/ --> | <!-- e.g. tests/server/ --> |
|
|
31
|
+
| | | | |
|
|
32
|
+
|
|
33
|
+
## Layer Boundaries
|
|
34
|
+
|
|
35
|
+
<!-- Which layers can call which? Prevents architecture drift. -->
|
|
36
|
+
|
|
37
|
+
| Layer | Can Import From | Cannot Import From |
|
|
38
|
+
|-------|----------------|-------------------|
|
|
39
|
+
| <!-- e.g. Handlers --> | <!-- e.g. Services, Middleware --> | <!-- e.g. Repositories --> |
|
|
40
|
+
| | | |
|
|
41
|
+
|
|
42
|
+
## Tech Stack
|
|
43
|
+
|
|
44
|
+
| Category | Technology | Version | License |
|
|
45
|
+
|----------|-----------|---------|---------|
|
|
46
|
+
| Language | | | |
|
|
47
|
+
| Framework | | | |
|
|
48
|
+
| Database | | | |
|
|
49
|
+
| Auth | | | |
|
|
50
|
+
| Hosting | | | |
|
|
51
|
+
| CI/CD | | | |
|
|
52
|
+
|
|
53
|
+
## External Dependencies
|
|
54
|
+
|
|
55
|
+
<!-- Third-party services, APIs, and integrations -->
|
|
56
|
+
|
|
57
|
+
| Service | Purpose | SLA | Fallback |
|
|
58
|
+
|---------|---------|-----|----------|
|
|
59
|
+
| <!-- e.g. Stripe --> | <!-- e.g. Payments --> | <!-- e.g. 99.99% --> | <!-- e.g. Queue + retry --> |
|
|
60
|
+
|
|
61
|
+
## Diagrams
|
|
62
|
+
|
|
63
|
+
<!-- Architecture diagrams using Mermaid, ASCII art, or linked images -->
|
|
64
|
+
|
|
65
|
+
```mermaid
|
|
66
|
+
graph TD
|
|
67
|
+
A[Client] --> B[API Gateway]
|
|
68
|
+
B --> C[Service Layer]
|
|
69
|
+
C --> D[Database]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Revision History
|
|
75
|
+
|
|
76
|
+
| Version | Date | Author | Changes |
|
|
77
|
+
|---------|------|--------|---------|
|
|
78
|
+
| 0.1.0 | YYYY-MM-DD | | Initial draft |
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Current State
|
|
2
|
+
|
|
3
|
+
<!-- docguard:version 0.1.0 -->
|
|
4
|
+
<!-- docguard:status living -->
|
|
5
|
+
<!-- docguard:last-reviewed YYYY-MM-DD -->
|
|
6
|
+
|
|
7
|
+
> **Implementation document** — Current state. What is actually deployed and working right now.
|
|
8
|
+
> Updated continuously as implementation progresses.
|
|
9
|
+
|
|
10
|
+
| Metadata | Value |
|
|
11
|
+
|----------|-------|
|
|
12
|
+
| **Status** |  |
|
|
13
|
+
| **Version** | `0.1.0` |
|
|
14
|
+
| **Last Updated** | YYYY-MM-DD |
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Deployment Status
|
|
19
|
+
|
|
20
|
+
| Environment | URL | Status | Last Deploy |
|
|
21
|
+
|------------|-----|:---:|:---:|
|
|
22
|
+
| Production | <!-- URL --> | <!-- 🟢 Up / 🔴 Down --> | YYYY-MM-DD |
|
|
23
|
+
| Staging | <!-- URL --> | | |
|
|
24
|
+
| Local Dev | `localhost:3000` | | |
|
|
25
|
+
|
|
26
|
+
## Feature Completion
|
|
27
|
+
|
|
28
|
+
<!-- Track what's built vs what's planned -->
|
|
29
|
+
|
|
30
|
+
| Feature | Canonical Doc | Implementation | Status |
|
|
31
|
+
|---------|:---:|:---:|:---:|
|
|
32
|
+
| <!-- e.g. User Auth --> | ✅ Documented | ✅ Implemented | 🟢 Live |
|
|
33
|
+
| <!-- e.g. Payments --> | ✅ Documented | ⚠️ Partial | 🟡 In Progress |
|
|
34
|
+
| <!-- e.g. Webhooks --> | ✅ Documented | ❌ Not Started | 🔴 Planned |
|
|
35
|
+
|
|
36
|
+
## Active Drift
|
|
37
|
+
|
|
38
|
+
<!-- Summary of all active drift entries — see DRIFT-LOG.md for details -->
|
|
39
|
+
|
|
40
|
+
| Area | Drift Count | Severity |
|
|
41
|
+
|------|:---:|----------|
|
|
42
|
+
| <!-- e.g. API routes --> | <!-- e.g. 2 --> | <!-- e.g. Low --> |
|
|
43
|
+
|
|
44
|
+
## Technical Debt
|
|
45
|
+
|
|
46
|
+
<!-- Known shortcuts, TODO items, and planned refactors -->
|
|
47
|
+
|
|
48
|
+
| # | Description | File(s) | Priority | Ticket |
|
|
49
|
+
|---|------------|---------|:---:|--------|
|
|
50
|
+
| 1 | | | <!-- P1/P2/P3 --> | |
|
|
51
|
+
|
|
52
|
+
## Dependencies Health
|
|
53
|
+
|
|
54
|
+
| Dependency | Current | Latest | Status |
|
|
55
|
+
|-----------|---------|--------|:---:|
|
|
56
|
+
| <!-- e.g. Node.js --> | <!-- e.g. 20.11 --> | <!-- e.g. 22.x --> | <!-- 🟢/🟡/🔴 --> |
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Revision History
|
|
61
|
+
|
|
62
|
+
| Date | Description |
|
|
63
|
+
|------|------------|
|
|
64
|
+
| YYYY-MM-DD | Initial state capture |
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Data Model
|
|
2
|
+
|
|
3
|
+
<!-- docguard:version 0.1.0 -->
|
|
4
|
+
<!-- docguard:status draft | review | approved -->
|
|
5
|
+
<!-- docguard:last-reviewed YYYY-MM-DD -->
|
|
6
|
+
<!-- docguard:owner @your-github-username -->
|
|
7
|
+
|
|
8
|
+
> **Canonical document** — Design intent. This file describes the data structures and their relationships.
|
|
9
|
+
> ⚠️ Schema changes require this doc to be updated FIRST.
|
|
10
|
+
|
|
11
|
+
| Metadata | Value |
|
|
12
|
+
|----------|-------|
|
|
13
|
+
| **Status** |  |
|
|
14
|
+
| **Version** | `0.1.0` |
|
|
15
|
+
| **Last Updated** | YYYY-MM-DD |
|
|
16
|
+
| **Owner** | @your-github-username |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Entities
|
|
21
|
+
|
|
22
|
+
<!-- All data entities (tables, collections, models) -->
|
|
23
|
+
|
|
24
|
+
| Entity | Storage | Primary Key | Description |
|
|
25
|
+
|--------|---------|-------------|-------------|
|
|
26
|
+
| <!-- e.g. User --> | <!-- e.g. users table --> | <!-- e.g. userId (UUID) --> | <!-- e.g. Registered users --> |
|
|
27
|
+
|
|
28
|
+
## Schema Definitions
|
|
29
|
+
|
|
30
|
+
<!-- Define fields for each entity -->
|
|
31
|
+
|
|
32
|
+
### <!-- EntityName -->
|
|
33
|
+
|
|
34
|
+
| Field | Type | Required | Default | Constraints | Description |
|
|
35
|
+
|-------|------|----------|---------|-------------|-------------|
|
|
36
|
+
| | | | | | |
|
|
37
|
+
|
|
38
|
+
## Relationships
|
|
39
|
+
|
|
40
|
+
| From | To | Type | FK/Reference | Cascade |
|
|
41
|
+
|------|-----|------|-------------|---------|
|
|
42
|
+
| | | <!-- 1:1, 1:many, many:many --> | | <!-- ON DELETE behavior --> |
|
|
43
|
+
|
|
44
|
+
## Indexes
|
|
45
|
+
|
|
46
|
+
<!-- Indexes for query performance — document which index each query uses -->
|
|
47
|
+
|
|
48
|
+
| Table | Index Name | Fields | Type | Purpose |
|
|
49
|
+
|-------|-----------|--------|------|---------|
|
|
50
|
+
| | | | <!-- B-tree, GSI, LSI --> | |
|
|
51
|
+
|
|
52
|
+
## Migration Strategy
|
|
53
|
+
|
|
54
|
+
<!-- How schema changes are applied -->
|
|
55
|
+
|
|
56
|
+
| Strategy | Tool | Notes |
|
|
57
|
+
|----------|------|-------|
|
|
58
|
+
| <!-- e.g. Migrations --> | <!-- e.g. Drizzle, Prisma, Alembic --> | |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Revision History
|
|
63
|
+
|
|
64
|
+
| Version | Date | Author | Changes |
|
|
65
|
+
|---------|------|--------|---------|
|
|
66
|
+
| 0.1.0 | YYYY-MM-DD | | Initial draft |
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Deployment
|
|
2
|
+
|
|
3
|
+
<!-- docguard:version 0.1.0 -->
|
|
4
|
+
<!-- docguard:status draft | review | approved -->
|
|
5
|
+
<!-- docguard:last-reviewed YYYY-MM-DD -->
|
|
6
|
+
<!-- docguard:owner @your-github-username -->
|
|
7
|
+
|
|
8
|
+
> **Canonical document** — Design intent. Describes how the system is deployed.
|
|
9
|
+
> For step-by-step procedures, see `docs-implementation/RUNBOOKS.md`.
|
|
10
|
+
|
|
11
|
+
| Metadata | Value |
|
|
12
|
+
|----------|-------|
|
|
13
|
+
| **Status** |  |
|
|
14
|
+
| **Version** | `0.1.0` |
|
|
15
|
+
| **Last Updated** | YYYY-MM-DD |
|
|
16
|
+
| **Owner** | @your-github-username |
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Infrastructure Overview
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
graph LR
|
|
24
|
+
A[Developer] -->|git push| B[GitHub]
|
|
25
|
+
B -->|webhook| C[CI/CD]
|
|
26
|
+
C -->|deploy| D[Production]
|
|
27
|
+
D --> E[Database]
|
|
28
|
+
D --> F[Cache]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Environments
|
|
32
|
+
|
|
33
|
+
| Environment | Provider | URL | Branch | Auto-Deploy |
|
|
34
|
+
|------------|---------|-----|--------|:-----------:|
|
|
35
|
+
| Production | <!-- e.g. AWS App Runner --> | | `main` | ✅ |
|
|
36
|
+
| Staging | | | `staging` | ✅ |
|
|
37
|
+
| Local | Docker | `localhost:3000` | — | — |
|
|
38
|
+
|
|
39
|
+
## CI/CD Pipeline
|
|
40
|
+
|
|
41
|
+
| Stage | Tool | Trigger | Duration |
|
|
42
|
+
|-------|------|---------|:--------:|
|
|
43
|
+
| Lint | <!-- e.g. ESLint --> | Push | ~1 min |
|
|
44
|
+
| Test | <!-- e.g. Vitest --> | Push | ~3 min |
|
|
45
|
+
| Build | <!-- e.g. Docker --> | Push | ~5 min |
|
|
46
|
+
| Deploy | <!-- e.g. App Runner --> | Merge to main | ~5 min |
|
|
47
|
+
|
|
48
|
+
## DNS & Domains
|
|
49
|
+
|
|
50
|
+
| Domain | Provider | Record Type | Points To |
|
|
51
|
+
|--------|---------|:-----------:|-----------|
|
|
52
|
+
| <!-- e.g. app.example.com --> | <!-- e.g. Cloudflare --> | CNAME | <!-- e.g. App Runner URL --> |
|
|
53
|
+
|
|
54
|
+
## Monitoring
|
|
55
|
+
|
|
56
|
+
| Service | What It Monitors | Alert Channel |
|
|
57
|
+
|---------|-----------------|-------------|
|
|
58
|
+
| <!-- e.g. CloudWatch --> | <!-- e.g. Error rates --> | <!-- e.g. Slack #alerts --> |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Revision History
|
|
63
|
+
|
|
64
|
+
| Version | Date | Author | Changes |
|
|
65
|
+
|---------|------|--------|---------|
|
|
66
|
+
| 0.1.0 | YYYY-MM-DD | | Initial draft |
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Drift Log
|
|
2
|
+
|
|
3
|
+
> Documents conscious deviations from canonical specifications.
|
|
4
|
+
> Every `// DRIFT:` comment in code MUST have a matching entry here.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Active Drift
|
|
9
|
+
|
|
10
|
+
| ID | File | Line | Canonical Doc | Deviation | Reason | Date |
|
|
11
|
+
|----|------|------|--------------|-----------|--------|------|
|
|
12
|
+
| <!-- D-001 --> | <!-- src/file.ts --> | <!-- 42 --> | <!-- ARCHITECTURE.md --> | <!-- What deviates --> | <!-- Why --> | <!-- YYYY-MM-DD --> |
|
|
13
|
+
|
|
14
|
+
## Resolved Drift
|
|
15
|
+
|
|
16
|
+
| ID | Resolution | Date |
|
|
17
|
+
|----|-----------|------|
|
|
18
|
+
| <!-- D-000 --> | <!-- How it was resolved --> | <!-- YYYY-MM-DD --> |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Environment & Configuration
|
|
2
|
+
|
|
3
|
+
> **Canonical document** — Design intent. This file documents everything needed to run this project.
|
|
4
|
+
> Last updated: YYYY-MM-DD
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
<!-- Runtime requirements, tools, and accounts needed -->
|
|
11
|
+
|
|
12
|
+
| Requirement | Version | Purpose |
|
|
13
|
+
|------------|---------|----------|
|
|
14
|
+
| <!-- e.g. Node.js --> | <!-- e.g. 20.x+ --> | <!-- e.g. Runtime --> |
|
|
15
|
+
| | | |
|
|
16
|
+
|
|
17
|
+
## Environment Variables
|
|
18
|
+
|
|
19
|
+
<!-- All environment variables the project needs -->
|
|
20
|
+
|
|
21
|
+
| Variable | Required | Default | Description | Where to Get |
|
|
22
|
+
|----------|----------|---------|-------------|-------------|
|
|
23
|
+
| <!-- e.g. DATABASE_URL --> | ✅ Yes | — | <!-- e.g. DB connection string --> | <!-- e.g. AWS Console → RDS --> |
|
|
24
|
+
| <!-- e.g. API_PORT --> | ❌ No | 3000 | <!-- e.g. Server port --> | — |
|
|
25
|
+
|
|
26
|
+
## Configuration Files
|
|
27
|
+
|
|
28
|
+
<!-- Config files, their purpose, and whether templates exist -->
|
|
29
|
+
|
|
30
|
+
| File | Purpose | Template |
|
|
31
|
+
|------|---------|----------|
|
|
32
|
+
| <!-- e.g. .env.local --> | <!-- e.g. Local dev secrets --> | <!-- e.g. .env.example --> |
|
|
33
|
+
| | | |
|
|
34
|
+
|
|
35
|
+
## Setup Steps
|
|
36
|
+
|
|
37
|
+
<!-- How to go from a fresh clone to a running project -->
|
|
38
|
+
|
|
39
|
+
1. Clone the repository
|
|
40
|
+
2. <!-- e.g. Copy `.env.example` to `.env.local` -->
|
|
41
|
+
3. <!-- e.g. Fill in required environment variables -->
|
|
42
|
+
4. <!-- e.g. Run `npm install` -->
|
|
43
|
+
5. <!-- e.g. Run `npm run dev` -->
|