code-warden 3.3.0 → 3.3.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/CONFIGURE.md +39 -39
- package/DECISIONS.md +107 -107
- package/README.md +6 -0
- package/SKILL.md +169 -169
- package/bin/code-warden.js +82 -82
- package/codewarden.json +14 -14
- package/examples/governed-session.md +132 -132
- package/install.js +399 -399
- package/install.ps1 +32 -32
- package/install.sh +33 -33
- package/package.json +62 -62
- package/references/anti-drift.md +55 -55
- package/references/architecture.md +26 -26
- package/references/cleanup.md +30 -30
- package/references/cognition.md +36 -36
- package/references/operations.md +45 -45
- package/references/planning-gates.md +83 -83
- package/references/research-and-fit.md +51 -51
- package/references/safety.md +31 -31
- package/tools/auto-detect.js +91 -91
- package/tools/auto-targets.js +104 -104
- package/tools/auto-windsurf-adapter.js +75 -75
- package/tools/get-context.js +50 -50
- package/tools/governance-report.js +302 -302
- package/tools/hooks/claude/install-hooks.js +112 -112
- package/tools/hooks/claude/uninstall-hooks.js +75 -75
- package/tools/hooks/claude/warden-lint-hook.js +106 -106
- package/tools/hooks/claude/warden-secrets-hook.js +73 -73
- package/tools/hooks/codex/install-hooks.js +100 -100
- package/tools/hooks/codex/uninstall-hooks.js +53 -53
- package/tools/hooks/codex/warden-apply-patch-hook.js +113 -113
- package/tools/hooks/codex/warden-bash-hook.js +51 -51
- package/tools/lib/config.js +49 -49
- package/tools/lib/file-collection.js +5 -2
- package/tools/lib/line-count.js +28 -28
- package/tools/lib/secret-patterns.js +57 -57
- package/tools/tests/fixtures/clean.js +9 -9
- package/tools/tests/run-tests.js +210 -210
- package/tools/verify-secrets.js +26 -26
- package/tools/warden-lint.js +27 -27
package/install.ps1
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# PowerShell installer for CodeWarden.
|
|
2
|
-
# Run from the skill folder: .\install.ps1
|
|
3
|
-
param(
|
|
4
|
-
[ValidateSet('agents', 'codex', 'claude')]
|
|
5
|
-
[string]$Target = 'agents'
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
$ErrorActionPreference = 'Stop'
|
|
9
|
-
|
|
10
|
-
$targetMap = @{
|
|
11
|
-
agents = Join-Path $HOME '.agents\skills\code-warden'
|
|
12
|
-
codex = Join-Path $HOME '.codex\skills\code-warden'
|
|
13
|
-
claude = Join-Path $HOME '.claude\skills\code-warden'
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
$targetDir = $targetMap[$Target]
|
|
17
|
-
$skillsDir = Split-Path -Parent $targetDir
|
|
18
|
-
|
|
19
|
-
Write-Host "Installing CodeWarden skill for $Target..."
|
|
20
|
-
|
|
21
|
-
if (Test-Path $targetDir) {
|
|
22
|
-
Remove-Item -Recurse -Force $targetDir
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (-not (Test-Path $skillsDir)) {
|
|
26
|
-
New-Item -ItemType Directory -Force -Path $skillsDir | Out-Null
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
Copy-Item -Recurse -Force . $targetDir
|
|
30
|
-
|
|
31
|
-
Write-Host "CodeWarden installed successfully to: $targetDir"
|
|
32
|
-
Write-Host "Restart or refresh your agent session so the updated skill metadata is loaded."
|
|
1
|
+
# PowerShell installer for CodeWarden.
|
|
2
|
+
# Run from the skill folder: .\install.ps1
|
|
3
|
+
param(
|
|
4
|
+
[ValidateSet('agents', 'codex', 'claude')]
|
|
5
|
+
[string]$Target = 'agents'
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
$ErrorActionPreference = 'Stop'
|
|
9
|
+
|
|
10
|
+
$targetMap = @{
|
|
11
|
+
agents = Join-Path $HOME '.agents\skills\code-warden'
|
|
12
|
+
codex = Join-Path $HOME '.codex\skills\code-warden'
|
|
13
|
+
claude = Join-Path $HOME '.claude\skills\code-warden'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
$targetDir = $targetMap[$Target]
|
|
17
|
+
$skillsDir = Split-Path -Parent $targetDir
|
|
18
|
+
|
|
19
|
+
Write-Host "Installing CodeWarden skill for $Target..."
|
|
20
|
+
|
|
21
|
+
if (Test-Path $targetDir) {
|
|
22
|
+
Remove-Item -Recurse -Force $targetDir
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (-not (Test-Path $skillsDir)) {
|
|
26
|
+
New-Item -ItemType Directory -Force -Path $skillsDir | Out-Null
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Copy-Item -Recurse -Force . $targetDir
|
|
30
|
+
|
|
31
|
+
Write-Host "CodeWarden installed successfully to: $targetDir"
|
|
32
|
+
Write-Host "Restart or refresh your agent session so the updated skill metadata is loaded."
|
package/install.sh
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
TARGET="${1:-agents}"
|
|
5
|
-
|
|
6
|
-
case "$TARGET" in
|
|
7
|
-
agents)
|
|
8
|
-
TARGET_DIR="$HOME/.agents/skills/code-warden"
|
|
9
|
-
;;
|
|
10
|
-
codex)
|
|
11
|
-
TARGET_DIR="$HOME/.codex/skills/code-warden"
|
|
12
|
-
;;
|
|
13
|
-
claude)
|
|
14
|
-
TARGET_DIR="$HOME/.claude/skills/code-warden"
|
|
15
|
-
;;
|
|
16
|
-
*)
|
|
17
|
-
echo "Usage: install.sh [agents|codex|claude]" >&2
|
|
18
|
-
exit 1
|
|
19
|
-
;;
|
|
20
|
-
esac
|
|
21
|
-
|
|
22
|
-
echo "Installing CodeWarden skill for $TARGET..."
|
|
23
|
-
mkdir -p "$(dirname "$TARGET_DIR")"
|
|
24
|
-
|
|
25
|
-
if [ -d "$TARGET_DIR" ]; then
|
|
26
|
-
rm -rf "$TARGET_DIR"
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
cp -r . "$TARGET_DIR"
|
|
30
|
-
chmod +x "$TARGET_DIR/tools/"*.js 2>/dev/null || true
|
|
31
|
-
|
|
32
|
-
echo "CodeWarden installed successfully to $TARGET_DIR"
|
|
33
|
-
echo "Restart or refresh your agent session so the updated skill metadata is loaded."
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
TARGET="${1:-agents}"
|
|
5
|
+
|
|
6
|
+
case "$TARGET" in
|
|
7
|
+
agents)
|
|
8
|
+
TARGET_DIR="$HOME/.agents/skills/code-warden"
|
|
9
|
+
;;
|
|
10
|
+
codex)
|
|
11
|
+
TARGET_DIR="$HOME/.codex/skills/code-warden"
|
|
12
|
+
;;
|
|
13
|
+
claude)
|
|
14
|
+
TARGET_DIR="$HOME/.claude/skills/code-warden"
|
|
15
|
+
;;
|
|
16
|
+
*)
|
|
17
|
+
echo "Usage: install.sh [agents|codex|claude]" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
;;
|
|
20
|
+
esac
|
|
21
|
+
|
|
22
|
+
echo "Installing CodeWarden skill for $TARGET..."
|
|
23
|
+
mkdir -p "$(dirname "$TARGET_DIR")"
|
|
24
|
+
|
|
25
|
+
if [ -d "$TARGET_DIR" ]; then
|
|
26
|
+
rm -rf "$TARGET_DIR"
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
cp -r . "$TARGET_DIR"
|
|
30
|
+
chmod +x "$TARGET_DIR/tools/"*.js 2>/dev/null || true
|
|
31
|
+
|
|
32
|
+
echo "CodeWarden installed successfully to $TARGET_DIR"
|
|
33
|
+
echo "Restart or refresh your agent session so the updated skill metadata is loaded."
|
package/package.json
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "code-warden",
|
|
3
|
-
"version": "3.3.
|
|
4
|
-
"description": "Verifiable governance for AI-assisted development — checks, hooks, and evidence.",
|
|
5
|
-
"main": "SKILL.md",
|
|
6
|
-
"bin": {
|
|
7
|
-
"code-warden": "bin/code-warden.js"
|
|
8
|
-
},
|
|
9
|
-
"files": [
|
|
10
|
-
"bin/",
|
|
11
|
-
"tools/",
|
|
12
|
-
"references/",
|
|
13
|
-
"templates/",
|
|
14
|
-
"examples/",
|
|
15
|
-
"SKILL.md",
|
|
16
|
-
"CONFIGURE.md",
|
|
17
|
-
"DECISIONS.md",
|
|
18
|
-
"README.md",
|
|
19
|
-
"codewarden.json",
|
|
20
|
-
"install.js",
|
|
21
|
-
"install.ps1",
|
|
22
|
-
"install.sh"
|
|
23
|
-
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"lint": "node tools/warden-lint.js .",
|
|
26
|
-
"check-secrets": "node tools/verify-secrets.js .",
|
|
27
|
-
"get-context": "node tools/get-context.js",
|
|
28
|
-
"report": "node tools/governance-report.js .",
|
|
29
|
-
"report:json": "node tools/governance-report.js . --format=json",
|
|
30
|
-
"report:md": "node tools/governance-report.js . --format=md",
|
|
31
|
-
"install-auto": "node install.js",
|
|
32
|
-
"install-dry-run": "node install.js --dry-run",
|
|
33
|
-
"install-list": "node install.js --list",
|
|
34
|
-
"install-doctor": "node install.js --doctor",
|
|
35
|
-
"test": "node tools/tests/run-tests.js",
|
|
36
|
-
"ci": "npm run lint && npm run check-secrets && npm run test && node install.js --doctor"
|
|
37
|
-
},
|
|
38
|
-
"engines": {
|
|
39
|
-
"node": ">=18"
|
|
40
|
-
},
|
|
41
|
-
"keywords": [
|
|
42
|
-
"ai",
|
|
43
|
-
"governance",
|
|
44
|
-
"claude",
|
|
45
|
-
"codex",
|
|
46
|
-
"cursor",
|
|
47
|
-
"windsurf",
|
|
48
|
-
"code-review",
|
|
49
|
-
"linter",
|
|
50
|
-
"secrets",
|
|
51
|
-
"ci",
|
|
52
|
-
"hooks"
|
|
53
|
-
],
|
|
54
|
-
"repository": {
|
|
55
|
-
"type": "git",
|
|
56
|
-
"url": "https://github.com/Kodaxadev/Code-Warden.git"
|
|
57
|
-
},
|
|
58
|
-
"homepage": "https://github.com/Kodaxadev/Code-Warden",
|
|
59
|
-
"bugs": "https://github.com/Kodaxadev/Code-Warden/issues",
|
|
60
|
-
"author": "Justin Davis",
|
|
61
|
-
"license": "MIT"
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "code-warden",
|
|
3
|
+
"version": "3.3.1",
|
|
4
|
+
"description": "Verifiable governance for AI-assisted development — checks, hooks, and evidence.",
|
|
5
|
+
"main": "SKILL.md",
|
|
6
|
+
"bin": {
|
|
7
|
+
"code-warden": "bin/code-warden.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"tools/",
|
|
12
|
+
"references/",
|
|
13
|
+
"templates/",
|
|
14
|
+
"examples/",
|
|
15
|
+
"SKILL.md",
|
|
16
|
+
"CONFIGURE.md",
|
|
17
|
+
"DECISIONS.md",
|
|
18
|
+
"README.md",
|
|
19
|
+
"codewarden.json",
|
|
20
|
+
"install.js",
|
|
21
|
+
"install.ps1",
|
|
22
|
+
"install.sh"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "node tools/warden-lint.js .",
|
|
26
|
+
"check-secrets": "node tools/verify-secrets.js .",
|
|
27
|
+
"get-context": "node tools/get-context.js",
|
|
28
|
+
"report": "node tools/governance-report.js .",
|
|
29
|
+
"report:json": "node tools/governance-report.js . --format=json",
|
|
30
|
+
"report:md": "node tools/governance-report.js . --format=md",
|
|
31
|
+
"install-auto": "node install.js",
|
|
32
|
+
"install-dry-run": "node install.js --dry-run",
|
|
33
|
+
"install-list": "node install.js --list",
|
|
34
|
+
"install-doctor": "node install.js --doctor",
|
|
35
|
+
"test": "node tools/tests/run-tests.js",
|
|
36
|
+
"ci": "npm run lint && npm run check-secrets && npm run test && node install.js --doctor"
|
|
37
|
+
},
|
|
38
|
+
"engines": {
|
|
39
|
+
"node": ">=18"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"ai",
|
|
43
|
+
"governance",
|
|
44
|
+
"claude",
|
|
45
|
+
"codex",
|
|
46
|
+
"cursor",
|
|
47
|
+
"windsurf",
|
|
48
|
+
"code-review",
|
|
49
|
+
"linter",
|
|
50
|
+
"secrets",
|
|
51
|
+
"ci",
|
|
52
|
+
"hooks"
|
|
53
|
+
],
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "https://github.com/Kodaxadev/Code-Warden.git"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/Kodaxadev/Code-Warden",
|
|
59
|
+
"bugs": "https://github.com/Kodaxadev/Code-Warden/issues",
|
|
60
|
+
"author": "Justin Davis",
|
|
61
|
+
"license": "MIT"
|
|
62
|
+
}
|
package/references/anti-drift.md
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
# Context Integrity and Anti-Drift
|
|
2
|
-
|
|
3
|
-
## Anchor Check (Pre-Flight)
|
|
4
|
-
|
|
5
|
-
Before delivering any contiguous code block exceeding the `pre_flight_trigger_lines`
|
|
6
|
-
from `codewarden.json` (default 150 lines), output a structurally valid JSON
|
|
7
|
-
pre-flight manifest:
|
|
8
|
-
|
|
9
|
-
```json
|
|
10
|
-
{
|
|
11
|
-
"pre_flight": {
|
|
12
|
-
"file": "[filename]",
|
|
13
|
-
"estimated_lines": "[count]",
|
|
14
|
-
"concern": "[single stated responsibility of this file]",
|
|
15
|
-
"secrets": ["[none]", "env-var sourced: [vars]"],
|
|
16
|
-
"files_changed_this_action": ["[filenames]"]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
This JSON manifest is parsed by downstream UI/tools. The human should be able to
|
|
22
|
-
spot-check every field. If any field cannot be filled accurately, stop and re-scope.
|
|
23
|
-
|
|
24
|
-
## Session Scoping
|
|
25
|
-
|
|
26
|
-
- Start a fresh session at each logical module boundary.
|
|
27
|
-
- Never carry one session across unrelated modules or features.
|
|
28
|
-
- When switching domains, start clean.
|
|
29
|
-
|
|
30
|
-
## Re-injection Rule
|
|
31
|
-
|
|
32
|
-
- Output the architecture state block from `SKILL.md` as the first response in any session.
|
|
33
|
-
- Do not greet, ask questions, or gather requirements until the architecture state block has been output and the user has confirmed or provided missing info.
|
|
34
|
-
- If no doc exists, apply the Re-injection Fallback from `architecture.md`.
|
|
35
|
-
- Never assume prior context survived a session boundary.
|
|
36
|
-
|
|
37
|
-
## Drift Trigger Response Protocol
|
|
38
|
-
|
|
39
|
-
When a drift signal is detected:
|
|
40
|
-
1. Stop generating output immediately.
|
|
41
|
-
2. State which rule was violated.
|
|
42
|
-
3. Re-state the relevant rule from the appropriate reference file.
|
|
43
|
-
4. Correct and continue only after re-anchoring.
|
|
44
|
-
|
|
45
|
-
Drift signals:
|
|
46
|
-
- Guessed syntax without searching live docs.
|
|
47
|
-
- Used stale training data for current facts.
|
|
48
|
-
- Chose a familiar default stack or product shape without a fit check.
|
|
49
|
-
- Unexplained block >150 lines contiguous.
|
|
50
|
-
- Skipped Blast Radius Check before a rewrite.
|
|
51
|
-
- Claimed completion without verification evidence.
|
|
52
|
-
- Changed dependencies without version/source evidence.
|
|
53
|
-
- Edited in a dirty repo without checking ownership.
|
|
54
|
-
- No `[AWAITING CONFIRMATION]` before a >2-file change.
|
|
55
|
-
- Monolithic output without module split.
|
|
1
|
+
# Context Integrity and Anti-Drift
|
|
2
|
+
|
|
3
|
+
## Anchor Check (Pre-Flight)
|
|
4
|
+
|
|
5
|
+
Before delivering any contiguous code block exceeding the `pre_flight_trigger_lines`
|
|
6
|
+
from `codewarden.json` (default 150 lines), output a structurally valid JSON
|
|
7
|
+
pre-flight manifest:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"pre_flight": {
|
|
12
|
+
"file": "[filename]",
|
|
13
|
+
"estimated_lines": "[count]",
|
|
14
|
+
"concern": "[single stated responsibility of this file]",
|
|
15
|
+
"secrets": ["[none]", "env-var sourced: [vars]"],
|
|
16
|
+
"files_changed_this_action": ["[filenames]"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This JSON manifest is parsed by downstream UI/tools. The human should be able to
|
|
22
|
+
spot-check every field. If any field cannot be filled accurately, stop and re-scope.
|
|
23
|
+
|
|
24
|
+
## Session Scoping
|
|
25
|
+
|
|
26
|
+
- Start a fresh session at each logical module boundary.
|
|
27
|
+
- Never carry one session across unrelated modules or features.
|
|
28
|
+
- When switching domains, start clean.
|
|
29
|
+
|
|
30
|
+
## Re-injection Rule
|
|
31
|
+
|
|
32
|
+
- Output the architecture state block from `SKILL.md` as the first response in any session.
|
|
33
|
+
- Do not greet, ask questions, or gather requirements until the architecture state block has been output and the user has confirmed or provided missing info.
|
|
34
|
+
- If no doc exists, apply the Re-injection Fallback from `architecture.md`.
|
|
35
|
+
- Never assume prior context survived a session boundary.
|
|
36
|
+
|
|
37
|
+
## Drift Trigger Response Protocol
|
|
38
|
+
|
|
39
|
+
When a drift signal is detected:
|
|
40
|
+
1. Stop generating output immediately.
|
|
41
|
+
2. State which rule was violated.
|
|
42
|
+
3. Re-state the relevant rule from the appropriate reference file.
|
|
43
|
+
4. Correct and continue only after re-anchoring.
|
|
44
|
+
|
|
45
|
+
Drift signals:
|
|
46
|
+
- Guessed syntax without searching live docs.
|
|
47
|
+
- Used stale training data for current facts.
|
|
48
|
+
- Chose a familiar default stack or product shape without a fit check.
|
|
49
|
+
- Unexplained block >150 lines contiguous.
|
|
50
|
+
- Skipped Blast Radius Check before a rewrite.
|
|
51
|
+
- Claimed completion without verification evidence.
|
|
52
|
+
- Changed dependencies without version/source evidence.
|
|
53
|
+
- Edited in a dirty repo without checking ownership.
|
|
54
|
+
- No `[AWAITING CONFIRMATION]` before a >2-file change.
|
|
55
|
+
- Monolithic output without module split.
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# Architecture & Memory Management
|
|
2
|
-
|
|
3
|
-
## Blueprint Rule
|
|
4
|
-
Before generating any new module:
|
|
5
|
-
- Verify alignment with the master architecture doc or PRD
|
|
6
|
-
- Explicitly state which other files or modules will be impacted
|
|
7
|
-
- Never generate a module in isolation without tracing upstream/downstream dependencies
|
|
8
|
-
|
|
9
|
-
## State Update Rule
|
|
10
|
-
If a change alters data flow or architecture:
|
|
11
|
-
- Prompt to update the architecture doc or dependency map immediately
|
|
12
|
-
- Do not leave docs out of sync with code
|
|
13
|
-
- Flag affected interface contracts or type definitions
|
|
14
|
-
|
|
15
|
-
## Re-injection Rule
|
|
16
|
-
Any session involving structural changes must open by re-stating:
|
|
17
|
-
- The architecture doc or PRD summary
|
|
18
|
-
- Never assume prior session context has carried over
|
|
19
|
-
|
|
20
|
-
## Re-injection Fallback
|
|
21
|
-
If no architecture doc exists in context:
|
|
22
|
-
- Execute `~/.claude/skills/code-warden/tools/get-context.js` to attempt to automatically locate and parse the project's foundational documents.
|
|
23
|
-
- If the tool fails or no docs exist:
|
|
24
|
-
- Restate the last 3 file dependencies
|
|
25
|
-
- Restate the current data flow
|
|
26
|
-
- Flag that a formal architecture doc should be created
|
|
1
|
+
# Architecture & Memory Management
|
|
2
|
+
|
|
3
|
+
## Blueprint Rule
|
|
4
|
+
Before generating any new module:
|
|
5
|
+
- Verify alignment with the master architecture doc or PRD
|
|
6
|
+
- Explicitly state which other files or modules will be impacted
|
|
7
|
+
- Never generate a module in isolation without tracing upstream/downstream dependencies
|
|
8
|
+
|
|
9
|
+
## State Update Rule
|
|
10
|
+
If a change alters data flow or architecture:
|
|
11
|
+
- Prompt to update the architecture doc or dependency map immediately
|
|
12
|
+
- Do not leave docs out of sync with code
|
|
13
|
+
- Flag affected interface contracts or type definitions
|
|
14
|
+
|
|
15
|
+
## Re-injection Rule
|
|
16
|
+
Any session involving structural changes must open by re-stating:
|
|
17
|
+
- The architecture doc or PRD summary
|
|
18
|
+
- Never assume prior session context has carried over
|
|
19
|
+
|
|
20
|
+
## Re-injection Fallback
|
|
21
|
+
If no architecture doc exists in context:
|
|
22
|
+
- Execute `~/.claude/skills/code-warden/tools/get-context.js` to attempt to automatically locate and parse the project's foundational documents.
|
|
23
|
+
- If the tool fails or no docs exist:
|
|
24
|
+
- Restate the last 3 file dependencies
|
|
25
|
+
- Restate the current data flow
|
|
26
|
+
- Flag that a formal architecture doc should be created
|
package/references/cleanup.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# Refactoring and Cleanup
|
|
2
|
-
|
|
3
|
-
## Leave It Better
|
|
4
|
-
|
|
5
|
-
When touching a file to add a feature or fix a bug:
|
|
6
|
-
- Flag any obvious technical debt, deprecated methods, or unhandled edge cases.
|
|
7
|
-
- Use this exact format:
|
|
8
|
-
`TECH DEBT FLAGGED: [file:line] [issue] [suggested fix]`
|
|
9
|
-
- Do not fix flagged debt without asking first; fixes expand scope unexpectedly.
|
|
10
|
-
|
|
11
|
-
## Test Contract
|
|
12
|
-
|
|
13
|
-
- Structural modules ship with unit tests.
|
|
14
|
-
- Any rewritten logic includes regression tests before merge.
|
|
15
|
-
- **Exempt:** Standalone utility scripts under 200 lines with no external dependencies.
|
|
16
|
-
|
|
17
|
-
## Decision Log
|
|
18
|
-
|
|
19
|
-
Append to `DECISIONS.md` when:
|
|
20
|
-
- A change affects >2 files.
|
|
21
|
-
- A change alters data flow or module boundaries.
|
|
22
|
-
|
|
23
|
-
Each entry must include:
|
|
24
|
-
- Decision made.
|
|
25
|
-
- Alternatives considered.
|
|
26
|
-
- Reasoning or citation link.
|
|
27
|
-
- Date.
|
|
28
|
-
|
|
29
|
-
`DECISIONS.md` is created on first use if it does not exist.
|
|
30
|
-
Do not log minor fixes or cosmetic changes.
|
|
1
|
+
# Refactoring and Cleanup
|
|
2
|
+
|
|
3
|
+
## Leave It Better
|
|
4
|
+
|
|
5
|
+
When touching a file to add a feature or fix a bug:
|
|
6
|
+
- Flag any obvious technical debt, deprecated methods, or unhandled edge cases.
|
|
7
|
+
- Use this exact format:
|
|
8
|
+
`TECH DEBT FLAGGED: [file:line] [issue] [suggested fix]`
|
|
9
|
+
- Do not fix flagged debt without asking first; fixes expand scope unexpectedly.
|
|
10
|
+
|
|
11
|
+
## Test Contract
|
|
12
|
+
|
|
13
|
+
- Structural modules ship with unit tests.
|
|
14
|
+
- Any rewritten logic includes regression tests before merge.
|
|
15
|
+
- **Exempt:** Standalone utility scripts under 200 lines with no external dependencies.
|
|
16
|
+
|
|
17
|
+
## Decision Log
|
|
18
|
+
|
|
19
|
+
Append to `DECISIONS.md` when:
|
|
20
|
+
- A change affects >2 files.
|
|
21
|
+
- A change alters data flow or module boundaries.
|
|
22
|
+
|
|
23
|
+
Each entry must include:
|
|
24
|
+
- Decision made.
|
|
25
|
+
- Alternatives considered.
|
|
26
|
+
- Reasoning or citation link.
|
|
27
|
+
- Date.
|
|
28
|
+
|
|
29
|
+
`DECISIONS.md` is created on first use if it does not exist.
|
|
30
|
+
Do not log minor fixes or cosmetic changes.
|
package/references/cognition.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
# Cognitive Routing
|
|
2
|
-
|
|
3
|
-
## Think Before Coding
|
|
4
|
-
|
|
5
|
-
For any complex logic or architecture decision:
|
|
6
|
-
- Write a step-by-step execution plan before writing code.
|
|
7
|
-
- Wait for explicit confirmation if structural changes are involved.
|
|
8
|
-
|
|
9
|
-
Complex means any of the following:
|
|
10
|
-
- >2 file changes
|
|
11
|
-
- >3 conditional branches
|
|
12
|
-
- Any async or concurrent logic
|
|
13
|
-
- Any change to a public interface or shared data model
|
|
14
|
-
|
|
15
|
-
## Don't Guess Syntax
|
|
16
|
-
|
|
17
|
-
For niche libraries, newly released APIs, or unfamiliar frameworks:
|
|
18
|
-
- Stop. Do not approximate from training data.
|
|
19
|
-
- Search live documentation.
|
|
20
|
-
- Output only verified, exact usage.
|
|
21
|
-
|
|
22
|
-
## Don't Guess Direction
|
|
23
|
-
|
|
24
|
-
For stack, architecture, or product-shape choices:
|
|
25
|
-
- Stop before using the most familiar pattern.
|
|
26
|
-
- Run the fit check in `references/research-and-fit.md`.
|
|
27
|
-
- Prefer the shape that matches the user's domain and constraints, not the easiest pattern to generate.
|
|
28
|
-
|
|
29
|
-
## Human Checkpoint
|
|
30
|
-
|
|
31
|
-
Output `[AWAITING CONFIRMATION]` and pause before execution when:
|
|
32
|
-
- Changes affect **>2 files**
|
|
33
|
-
- Changes generate **>300 lines** total
|
|
34
|
-
- Changes alter architecture or data flow in any way
|
|
35
|
-
|
|
36
|
-
Do not proceed until explicit confirmation is received.
|
|
1
|
+
# Cognitive Routing
|
|
2
|
+
|
|
3
|
+
## Think Before Coding
|
|
4
|
+
|
|
5
|
+
For any complex logic or architecture decision:
|
|
6
|
+
- Write a step-by-step execution plan before writing code.
|
|
7
|
+
- Wait for explicit confirmation if structural changes are involved.
|
|
8
|
+
|
|
9
|
+
Complex means any of the following:
|
|
10
|
+
- >2 file changes
|
|
11
|
+
- >3 conditional branches
|
|
12
|
+
- Any async or concurrent logic
|
|
13
|
+
- Any change to a public interface or shared data model
|
|
14
|
+
|
|
15
|
+
## Don't Guess Syntax
|
|
16
|
+
|
|
17
|
+
For niche libraries, newly released APIs, or unfamiliar frameworks:
|
|
18
|
+
- Stop. Do not approximate from training data.
|
|
19
|
+
- Search live documentation.
|
|
20
|
+
- Output only verified, exact usage.
|
|
21
|
+
|
|
22
|
+
## Don't Guess Direction
|
|
23
|
+
|
|
24
|
+
For stack, architecture, or product-shape choices:
|
|
25
|
+
- Stop before using the most familiar pattern.
|
|
26
|
+
- Run the fit check in `references/research-and-fit.md`.
|
|
27
|
+
- Prefer the shape that matches the user's domain and constraints, not the easiest pattern to generate.
|
|
28
|
+
|
|
29
|
+
## Human Checkpoint
|
|
30
|
+
|
|
31
|
+
Output `[AWAITING CONFIRMATION]` and pause before execution when:
|
|
32
|
+
- Changes affect **>2 files**
|
|
33
|
+
- Changes generate **>300 lines** total
|
|
34
|
+
- Changes alter architecture or data flow in any way
|
|
35
|
+
|
|
36
|
+
Do not proceed until explicit confirmation is received.
|
package/references/operations.md
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
# Operational Discipline
|
|
2
|
-
|
|
3
|
-
## Verification Before Completion
|
|
4
|
-
|
|
5
|
-
Before claiming work is complete, fixed, or safe:
|
|
6
|
-
- Run the narrowest meaningful verification command for the change.
|
|
7
|
-
- Report the exact command and result.
|
|
8
|
-
- If verification cannot run, state why and name the residual risk.
|
|
9
|
-
- Do not say tests pass unless the relevant command was run in this session.
|
|
10
|
-
|
|
11
|
-
Minimum verification by change type:
|
|
12
|
-
- Code behavior: unit, integration, or smoke test that exercises the changed path.
|
|
13
|
-
- Frontend UI: browser or screenshot check for the touched workflow.
|
|
14
|
-
- Build/config: build, typecheck, or config validation.
|
|
15
|
-
- Documentation-only: link, formatting, or spelling check when available.
|
|
16
|
-
|
|
17
|
-
## Source-Control Hygiene
|
|
18
|
-
|
|
19
|
-
Before editing files in a repository:
|
|
20
|
-
- Check whether the workspace is under git.
|
|
21
|
-
- Inspect dirty files when git metadata is available.
|
|
22
|
-
- Never revert user changes unless the user explicitly requests it.
|
|
23
|
-
- Keep unrelated local changes out of the patch, commit, or summary.
|
|
24
|
-
|
|
25
|
-
Before destructive operations:
|
|
26
|
-
- State the exact target path.
|
|
27
|
-
- Verify the target resolves inside the intended workspace or explicitly named directory.
|
|
28
|
-
- Prefer reversible operations or a one-step rollback.
|
|
29
|
-
|
|
30
|
-
## Dependency and Supply-Chain Control
|
|
31
|
-
|
|
32
|
-
Before adding, removing, upgrading, or replacing dependencies:
|
|
33
|
-
- Identify the current package manager and lockfile.
|
|
34
|
-
- Prefer existing dependencies and local patterns over new packages.
|
|
35
|
-
- Use official package docs or registry metadata for version-specific behavior.
|
|
36
|
-
- Explain why the dependency change is necessary and what alternative was rejected.
|
|
37
|
-
- Run the package manager's lockfile/update command intentionally; never hand-edit lockfiles.
|
|
38
|
-
|
|
39
|
-
## Evidence Standard
|
|
40
|
-
|
|
41
|
-
For technical claims and recommendations:
|
|
42
|
-
- Cite local evidence with file paths, command output, or linked official docs.
|
|
43
|
-
- Use live documentation for time-sensitive, version-specific, or rapidly changing APIs.
|
|
44
|
-
- Clearly label unverified assumptions.
|
|
45
|
-
- Record durable decisions in `DECISIONS.md` when the choice affects architecture, dependencies, safety, or workflow.
|
|
1
|
+
# Operational Discipline
|
|
2
|
+
|
|
3
|
+
## Verification Before Completion
|
|
4
|
+
|
|
5
|
+
Before claiming work is complete, fixed, or safe:
|
|
6
|
+
- Run the narrowest meaningful verification command for the change.
|
|
7
|
+
- Report the exact command and result.
|
|
8
|
+
- If verification cannot run, state why and name the residual risk.
|
|
9
|
+
- Do not say tests pass unless the relevant command was run in this session.
|
|
10
|
+
|
|
11
|
+
Minimum verification by change type:
|
|
12
|
+
- Code behavior: unit, integration, or smoke test that exercises the changed path.
|
|
13
|
+
- Frontend UI: browser or screenshot check for the touched workflow.
|
|
14
|
+
- Build/config: build, typecheck, or config validation.
|
|
15
|
+
- Documentation-only: link, formatting, or spelling check when available.
|
|
16
|
+
|
|
17
|
+
## Source-Control Hygiene
|
|
18
|
+
|
|
19
|
+
Before editing files in a repository:
|
|
20
|
+
- Check whether the workspace is under git.
|
|
21
|
+
- Inspect dirty files when git metadata is available.
|
|
22
|
+
- Never revert user changes unless the user explicitly requests it.
|
|
23
|
+
- Keep unrelated local changes out of the patch, commit, or summary.
|
|
24
|
+
|
|
25
|
+
Before destructive operations:
|
|
26
|
+
- State the exact target path.
|
|
27
|
+
- Verify the target resolves inside the intended workspace or explicitly named directory.
|
|
28
|
+
- Prefer reversible operations or a one-step rollback.
|
|
29
|
+
|
|
30
|
+
## Dependency and Supply-Chain Control
|
|
31
|
+
|
|
32
|
+
Before adding, removing, upgrading, or replacing dependencies:
|
|
33
|
+
- Identify the current package manager and lockfile.
|
|
34
|
+
- Prefer existing dependencies and local patterns over new packages.
|
|
35
|
+
- Use official package docs or registry metadata for version-specific behavior.
|
|
36
|
+
- Explain why the dependency change is necessary and what alternative was rejected.
|
|
37
|
+
- Run the package manager's lockfile/update command intentionally; never hand-edit lockfiles.
|
|
38
|
+
|
|
39
|
+
## Evidence Standard
|
|
40
|
+
|
|
41
|
+
For technical claims and recommendations:
|
|
42
|
+
- Cite local evidence with file paths, command output, or linked official docs.
|
|
43
|
+
- Use live documentation for time-sensitive, version-specific, or rapidly changing APIs.
|
|
44
|
+
- Clearly label unverified assumptions.
|
|
45
|
+
- Record durable decisions in `DECISIONS.md` when the choice affects architecture, dependencies, safety, or workflow.
|