guardian-framework 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +463 -0
  3. package/dist/cli.js +12958 -0
  4. package/dist/exports.js +12765 -0
  5. package/package.json +61 -0
  6. package/templates/languages/go-patterns.md +411 -0
  7. package/templates/languages/java-patterns.md +545 -0
  8. package/templates/languages/python-patterns.md +312 -0
  9. package/templates/languages/rust-patterns.md +232 -0
  10. package/templates/languages/typescript-patterns.md +313 -0
  11. package/templates/pi/INDEX.md +437 -0
  12. package/templates/pi/agent/AGENTS.md +166 -0
  13. package/templates/pi/agents/architecture-coordinator.md +40 -0
  14. package/templates/pi/agents/architecture-validator.md +36 -0
  15. package/templates/pi/agents/bootstrap-implementer.md +37 -0
  16. package/templates/pi/agents/issue-factory.md +31 -0
  17. package/templates/pi/agents/operations-validator.md +32 -0
  18. package/templates/pi/agents/security-validator.md +33 -0
  19. package/templates/pi/architecture/CHANGELOG.md +78 -0
  20. package/templates/pi/architecture/decisions/ADR-template.md +76 -0
  21. package/templates/pi/architecture/diagrams/system-overview.md +159 -0
  22. package/templates/pi/architecture/modules/module-template.md +152 -0
  23. package/templates/pi/context/checklists.md +91 -0
  24. package/templates/pi/context/domain-workflow.md +180 -0
  25. package/templates/pi/context/output-formats.md +135 -0
  26. package/templates/pi/context/patterns-base.md +47 -0
  27. package/templates/pi/context/patterns.md +38 -0
  28. package/templates/pi/context/project.md +88 -0
  29. package/templates/pi/domain/exploration.md +93 -0
  30. package/templates/pi/domain/ubiquitous-language.md +24 -0
  31. package/templates/pi/extensions/architect-lib/generators.ts +528 -0
  32. package/templates/pi/extensions/architect-lib/helpers.ts +344 -0
  33. package/templates/pi/extensions/architect-lib/types.ts +117 -0
  34. package/templates/pi/extensions/architect.ts +1425 -0
  35. package/templates/pi/extensions/ask-user-question.ts +579 -0
  36. package/templates/pi/extensions/bash-guard.ts +556 -0
  37. package/templates/pi/extensions/config-reload.ts +115 -0
  38. package/templates/pi/extensions/coordinator.ts +304 -0
  39. package/templates/pi/extensions/curator.ts +543 -0
  40. package/templates/pi/extensions/domain-explorer.ts +990 -0
  41. package/templates/pi/extensions/filechanges.ts +656 -0
  42. package/templates/pi/extensions/goal-loop.ts +717 -0
  43. package/templates/pi/extensions/hooks.ts +452 -0
  44. package/templates/pi/extensions/kanban.ts +547 -0
  45. package/templates/pi/extensions/pipeline.ts +1246 -0
  46. package/templates/pi/extensions/plan-mode.ts +209 -0
  47. package/templates/pi/extensions/project-scaffolder.ts +284 -0
  48. package/templates/pi/extensions/read-only-mode.ts +192 -0
  49. package/templates/pi/extensions/redaction.ts +128 -0
  50. package/templates/pi/extensions/session-persistence.ts +174 -0
  51. package/templates/pi/extensions/slash-commands.ts +229 -0
  52. package/templates/pi/extensions/snippets.ts +201 -0
  53. package/templates/pi/extensions/validation-runner.ts +100 -0
  54. package/templates/pi/github/agents/architecture-coordinator.agent.md +27 -0
  55. package/templates/pi/github/agents/architecture-validator.agent.md +20 -0
  56. package/templates/pi/github/agents/bootstrap-implementer.agent.md +20 -0
  57. package/templates/pi/github/agents/epic-planner.agent.md +70 -0
  58. package/templates/pi/github/agents/issue-factory.agent.md +20 -0
  59. package/templates/pi/github/agents/operations-validator.agent.md +20 -0
  60. package/templates/pi/github/agents/security-validator.agent.md +20 -0
  61. package/templates/pi/github/copilot/settings.json +16 -0
  62. package/templates/pi/github/copilot-instructions.md +155 -0
  63. package/templates/pi/github/instructions/architecture.instructions.md +71 -0
  64. package/templates/pi/github/instructions/validation.instructions.md +69 -0
  65. package/templates/pi/github/workflows/01-planning-workflow.md +75 -0
  66. package/templates/pi/github/workflows/02-issue-generation-workflow.md +69 -0
  67. package/templates/pi/github/workflows/03-implementation-workflow.md +80 -0
  68. package/templates/pi/github/workflows/04-validation-workflow.md +68 -0
  69. package/templates/pi/preflight_report.json +99 -0
  70. package/templates/pi/prompts/blueprint-update.md +262 -0
  71. package/templates/pi/prompts/blueprint-validate.md +218 -0
  72. package/templates/pi/prompts/bug-fix.md +50 -0
  73. package/templates/pi/prompts/ci-blueprint.md +131 -0
  74. package/templates/pi/prompts/context-refresh.md +258 -0
  75. package/templates/pi/prompts/epic-plan.md +356 -0
  76. package/templates/pi/prompts/epic-template.md +186 -0
  77. package/templates/pi/prompts/feature-development.md +131 -0
  78. package/templates/pi/prompts/git-issues.md +243 -0
  79. package/templates/pi/prompts/hotfix.md +71 -0
  80. package/templates/pi/prompts/issue-closeout.md +342 -0
  81. package/templates/pi/prompts/issue-draft.md +218 -0
  82. package/templates/pi/prompts/issue-implementation-series.md +173 -0
  83. package/templates/pi/prompts/issue-merge.md +372 -0
  84. package/templates/pi/prompts/issue-template-set.md +392 -0
  85. package/templates/pi/prompts/issue-template.md +207 -0
  86. package/templates/pi/prompts/pattern-extract.md +269 -0
  87. package/templates/pi/prompts/plan-to-issues.md +430 -0
  88. package/templates/pi/prompts/refactoring.md +82 -0
  89. package/templates/pi/prompts/scope-analyzer.md +254 -0
  90. package/templates/pi/prompts/sync-check.md +230 -0
  91. package/templates/pi/scripts/categorize-issues.sh +171 -0
  92. package/templates/pi/scripts/ci/check_architecture_conformance.sh +748 -0
  93. package/templates/pi/scripts/ci/check_planning_packet.py +228 -0
  94. package/templates/pi/scripts/ci/run_hardening_stages.sh +264 -0
  95. package/templates/pi/scripts/ci/run_preflight.sh +649 -0
  96. package/templates/pi/scripts/ci/run_stage.sh +193 -0
  97. package/templates/pi/scripts/ci/stage_docs_policy.sh +82 -0
  98. package/templates/pi/scripts/ci/stage_integration.sh +3 -0
  99. package/templates/pi/scripts/ci/stage_lint.sh +130 -0
  100. package/templates/pi/scripts/ci/stage_migration_verify.sh +3 -0
  101. package/templates/pi/scripts/ci/stage_package_build.sh +3 -0
  102. package/templates/pi/scripts/ci/stage_release_readiness.sh +3 -0
  103. package/templates/pi/scripts/ci/stage_remaining.sh +242 -0
  104. package/templates/pi/scripts/ci/stage_security.sh +3 -0
  105. package/templates/pi/scripts/ci/stage_static_analysis.sh +114 -0
  106. package/templates/pi/scripts/ci/stage_unit.sh +119 -0
  107. package/templates/pi/scripts/ci/validate_agent_output.py +181 -0
  108. package/templates/pi/scripts/ci/validate_agent_output.sh +243 -0
  109. package/templates/pi/scripts/create-feature-branch.sh +136 -0
  110. package/templates/pi/scripts/create-mr.sh +117 -0
  111. package/templates/pi/scripts/fetch-issues.sh +131 -0
  112. package/templates/pi/scripts/generate-architecture.sh +161 -0
  113. package/templates/pi/scripts/git/close-epic.sh +69 -0
  114. package/templates/pi/scripts/git/close-issue.sh +35 -0
  115. package/templates/pi/scripts/git/create-tracking-issue.sh +174 -0
  116. package/templates/pi/scripts/git/link-issue-to-epic.sh +51 -0
  117. package/templates/pi/scripts/git/update-tracking-issue.sh +66 -0
  118. package/templates/pi/scripts/languages/go/validate-architecture.sh +139 -0
  119. package/templates/pi/scripts/languages/go/validate-canonical.sh +129 -0
  120. package/templates/pi/scripts/languages/go/validate-ci.sh +132 -0
  121. package/templates/pi/scripts/languages/go/validate-integration.sh +156 -0
  122. package/templates/pi/scripts/languages/go/validate-operations.sh +146 -0
  123. package/templates/pi/scripts/languages/go/validate-security.sh +135 -0
  124. package/templates/pi/scripts/languages/go/validate-tests.sh +125 -0
  125. package/templates/pi/scripts/languages/java/validate-annotations.sh +185 -0
  126. package/templates/pi/scripts/languages/java/validate-architecture.sh +159 -0
  127. package/templates/pi/scripts/languages/java/validate-canonical.sh +114 -0
  128. package/templates/pi/scripts/languages/java/validate-ci.sh +269 -0
  129. package/templates/pi/scripts/languages/java/validate-integration.sh +149 -0
  130. package/templates/pi/scripts/languages/java/validate-operations.sh +142 -0
  131. package/templates/pi/scripts/languages/java/validate-security.sh +174 -0
  132. package/templates/pi/scripts/languages/java/validate-spring-architecture.sh +227 -0
  133. package/templates/pi/scripts/languages/java/validate-tests.sh +159 -0
  134. package/templates/pi/scripts/languages/python/validate-architecture.sh +99 -0
  135. package/templates/pi/scripts/languages/python/validate-canonical.sh +124 -0
  136. package/templates/pi/scripts/languages/python/validate-ci.sh +130 -0
  137. package/templates/pi/scripts/languages/python/validate-integration.sh +119 -0
  138. package/templates/pi/scripts/languages/python/validate-operations.sh +107 -0
  139. package/templates/pi/scripts/languages/python/validate-security.sh +68 -0
  140. package/templates/pi/scripts/languages/python/validate-tests.sh +102 -0
  141. package/templates/pi/scripts/languages/rust/validate-architecture.sh +188 -0
  142. package/templates/pi/scripts/languages/rust/validate-canonical.sh +146 -0
  143. package/templates/pi/scripts/languages/rust/validate-ci.sh +147 -0
  144. package/templates/pi/scripts/languages/rust/validate-integration.sh +149 -0
  145. package/templates/pi/scripts/languages/rust/validate-operations.sh +154 -0
  146. package/templates/pi/scripts/languages/rust/validate-security.sh +153 -0
  147. package/templates/pi/scripts/languages/rust/validate-tests.sh +150 -0
  148. package/templates/pi/scripts/languages/typescript/validate-architecture.sh +157 -0
  149. package/templates/pi/scripts/languages/typescript/validate-canonical.sh +135 -0
  150. package/templates/pi/scripts/languages/typescript/validate-ci.sh +244 -0
  151. package/templates/pi/scripts/languages/typescript/validate-integration.sh +166 -0
  152. package/templates/pi/scripts/languages/typescript/validate-operations.sh +162 -0
  153. package/templates/pi/scripts/languages/typescript/validate-security.sh +169 -0
  154. package/templates/pi/scripts/languages/typescript/validate-tests.sh +158 -0
  155. package/templates/pi/scripts/merge-mr.sh +95 -0
  156. package/templates/pi/scripts/mr-validation.sh +228 -0
  157. package/templates/pi/scripts/validate-architecture-readiness.sh +153 -0
  158. package/templates/pi/scripts/validate-architecture.sh +22 -0
  159. package/templates/pi/scripts/validate-canonical.sh +22 -0
  160. package/templates/pi/scripts/validate-ci.sh +37 -0
  161. package/templates/pi/scripts/validate-integration.sh +22 -0
  162. package/templates/pi/scripts/validate-operations.sh +22 -0
  163. package/templates/pi/scripts/validate-security.sh +22 -0
  164. package/templates/pi/scripts/validate-tests.sh +22 -0
  165. package/templates/pi/scripts/validate-ubiquitous-language.sh +291 -0
  166. package/templates/pi/scripts/validation-cache.sh +139 -0
  167. package/templates/pi/skills/agents/architecture-coordinator.md +178 -0
  168. package/templates/pi/skills/agents/architecture-generator.md +79 -0
  169. package/templates/pi/skills/agents/architecture-validator.md +74 -0
  170. package/templates/pi/skills/agents/ci-mr-validator.md +46 -0
  171. package/templates/pi/skills/agents/code-developer.md +76 -0
  172. package/templates/pi/skills/agents/commit.md +46 -0
  173. package/templates/pi/skills/agents/curator.md +71 -0
  174. package/templates/pi/skills/agents/debug.md +59 -0
  175. package/templates/pi/skills/agents/documentation-maintainer.md +36 -0
  176. package/templates/pi/skills/agents/goal-loop.md +125 -0
  177. package/templates/pi/skills/agents/hooks.md +122 -0
  178. package/templates/pi/skills/agents/integration-validator.md +35 -0
  179. package/templates/pi/skills/agents/issue-creator.md +75 -0
  180. package/templates/pi/skills/agents/issue-factory.md +143 -0
  181. package/templates/pi/skills/agents/kanban.md +85 -0
  182. package/templates/pi/skills/agents/land.md +59 -0
  183. package/templates/pi/skills/agents/operations-validator.md +43 -0
  184. package/templates/pi/skills/agents/pipeline.md +113 -0
  185. package/templates/pi/skills/agents/plan-mode.md +77 -0
  186. package/templates/pi/skills/agents/pull.md +40 -0
  187. package/templates/pi/skills/agents/push.md +41 -0
  188. package/templates/pi/skills/agents/security-validator.md +85 -0
  189. package/templates/pi/skills/agents/session-persistence.md +119 -0
  190. package/templates/pi/skills/agents/slash-commands.md +117 -0
  191. package/templates/pi/skills/agents/snippets.md +99 -0
  192. package/templates/pi/skills/agents/subagent-registry.md +78 -0
  193. package/templates/pi/skills/agents/test-validator.md +42 -0
  194. package/templates/pi/skills/validators/architecture-validator.md +43 -0
  195. package/templates/pi/skills/validators/ci-validator.md +27 -0
  196. package/templates/pi/skills/validators/context-compaction.md +73 -0
  197. package/templates/pi/skills/validators/integration-validator.md +38 -0
  198. package/templates/pi/skills/validators/model-registry.md +96 -0
  199. package/templates/pi/skills/validators/operations-validator.md +34 -0
  200. package/templates/pi/skills/validators/security-guards.md +72 -0
  201. package/templates/pi/skills/validators/security-validator.md +41 -0
  202. package/templates/pi/skills/validators/system-prompt-tiers.md +69 -0
  203. package/templates/pi/skills/validators/test-validator.md +33 -0
  204. package/templates/pi/types.ts +62 -0
  205. package/templates/pi/validators/README.md +93 -0
  206. package/templates/pi/validators/default.toml +209 -0
  207. package/templates/pi/validators/spring.toml +142 -0
  208. package/templates/pi/workpad.md +53 -0
  209. package/templates/project/java/Dockerfile +14 -0
  210. package/templates/project/java/README.md +40 -0
  211. package/templates/project/java/pom.xml +132 -0
  212. package/templates/project/typescript/Dockerfile +15 -0
  213. package/templates/project/typescript/README.md +29 -0
  214. package/templates/project/typescript/package.json +23 -0
  215. package/templates/project/typescript/tsconfig.json +21 -0
  216. package/templates/workflow.md +123 -0
@@ -0,0 +1,209 @@
1
+ # GuardianCLI Default TOML Validators
2
+ #
3
+ # Declarative validation rules with inline tests.
4
+ # Pipeline stages: strip_ansi → replace → match_output → strip/keep_lines → truncate → head/tail → max_lines → on_empty
5
+ #
6
+ # Usage: guardian validate --filter <name>
7
+ # Verify: guardian validate --verify
8
+
9
+ schema_version = 1
10
+
11
+ # ── CI Validator ────────────────────────────────────────────────────────────
12
+
13
+ [filters.ci-build]
14
+ command = "build"
15
+ description = "Filter build output to show errors and warnings only"
16
+ strip_ansi = true
17
+ keep_lines_matching = ["error", "warning", "Error", "Warning", "FAILED", "failed", "^Build failed"]
18
+ max_lines = 50
19
+ on_empty = "✅ Build passed with no errors or warnings"
20
+
21
+ [[tests.ci-build]]
22
+ name = "strips successful build noise"
23
+ input = """
24
+ Compiling my-project v0.1.0
25
+ Compiling serde v1.0.197
26
+ Compiling tokio v1.36.0
27
+ Finished dev [unoptimized + debuginfo] target(s) in 12.34s
28
+ """
29
+ expected = "✅ Build passed with no errors or warnings"
30
+
31
+ [[tests.ci-build]]
32
+ name = "keeps errors"
33
+ input = """
34
+ Compiling my-project v0.1.0
35
+ error[E0425]: cannot find function `foo` in this scope
36
+ --> src/main.rs:10:5
37
+ |
38
+ 10 | foo();
39
+ | ^^^ not found in this scope
40
+ Finished dev [unoptimized + debuginfo] target(s) in 0.50s
41
+ """
42
+ expected = """
43
+ error[E0425]: cannot find function `foo` in this scope
44
+ --> src/main.rs:10:5
45
+ |
46
+ 10 | foo();
47
+ | ^^^ not found in this scope
48
+ """
49
+
50
+ # ── Test Validator ──────────────────────────────────────────────────────────
51
+
52
+ [filters.test-results]
53
+ command = "test"
54
+ description = "Show only test failures, hide passing tests"
55
+ strip_ansi = true
56
+ keep_lines_matching = ["FAILED", "failed", "error", "panic", "Error", "AssertionError", "test.*FAILED", "✗", "×", "Summary:.*failed", "^Running.*test"]
57
+ replace = [
58
+ { pattern = "^test (.+) \\.\\.\\. ok$", replacement = "" },
59
+ { pattern = "^\\s+$", replacement = "" }
60
+ ]
61
+ max_lines = 100
62
+ on_empty = "✅ All tests passed"
63
+
64
+ [[tests.test-results]]
65
+ name = "hides passing tests, shows failures"
66
+ input = """
67
+ running 15 tests
68
+ test utils::test_parse ... ok
69
+ test utils::test_format ... ok
70
+ test auth::test_login ... FAILED
71
+ test auth::test_logout ... ok
72
+ test auth::test_refresh ... FAILED
73
+ test db::test_connect ... ok
74
+
75
+ failures:
76
+
77
+ ---- auth::test_login stdout ----
78
+ thread 'auth::test_login' panicked at 'assertion failed'
79
+
80
+ ---- auth::test_refresh stdout ----
81
+ thread 'auth::test_refresh' panicked at 'timeout'
82
+
83
+ failures:
84
+ auth::test_login
85
+ auth::test_refresh
86
+
87
+ test result: FAILED. 13 passed; 2 failed; 0 ignored
88
+ """
89
+ expected = """
90
+ test auth::test_login ... FAILED
91
+ test auth::test_refresh ... FAILED
92
+
93
+ failures:
94
+
95
+ ---- auth::test_login stdout ----
96
+ thread 'auth::test_login' panicked at 'assertion failed'
97
+
98
+ ---- auth::test_refresh stdout ----
99
+ thread 'auth::test_refresh' panicked at 'timeout'
100
+
101
+ failures:
102
+ auth::test_login
103
+ auth::test_refresh
104
+
105
+ test result: FAILED. 13 passed; 2 failed; 0 ignored
106
+ """
107
+
108
+ # ── Security Validator ──────────────────────────────────────────────────────
109
+
110
+ [filters.security-scan]
111
+ command = "security"
112
+ description = "Filter security scan output to show only findings"
113
+ strip_ansi = true
114
+ keep_lines_matching = ["CRITICAL", "HIGH", "MEDIUM", "vulnerability", "CVE-", "finding", "⚠", "failed", "FAILED"]
115
+ max_lines = 80
116
+ on_empty = "✅ No security issues found"
117
+
118
+ [[tests.security-scan]]
119
+ name = "shows only findings"
120
+ input = """
121
+ Scanning dependencies...
122
+ Found 234 packages
123
+ Checking for known vulnerabilities...
124
+
125
+ CVE-2024-1234 [CRITICAL] lodash < 4.17.21
126
+ Prototype pollution in lodash
127
+ Fixed in: 4.17.21
128
+
129
+ CVE-2024-5678 [HIGH] express < 4.18.2
130
+ Open redirect vulnerability
131
+ Fixed in: 4.18.2
132
+
133
+ All other packages are up to date.
134
+ Scan complete: 2 vulnerabilities found
135
+ """
136
+ expected = """
137
+ CVE-2024-1234 [CRITICAL] lodash < 4.17.21
138
+ Prototype pollution in lodash
139
+ Fixed in: 4.17.21
140
+
141
+ CVE-2024-5678 [HIGH] express < 4.18.2
142
+ Open redirect vulnerability
143
+ Fixed in: 4.18.2
144
+
145
+ Scan complete: 2 vulnerabilities found
146
+ """
147
+
148
+ # ── Lint Validator ──────────────────────────────────────────────────────────
149
+
150
+ [filters.lint-output]
151
+ command = "lint"
152
+ description = "Group lint issues by file and rule"
153
+ strip_ansi = true
154
+ replace = [
155
+ { pattern = "^\\s+$", replacement = "" }
156
+ ]
157
+ keep_lines_matching = ["error", "warning", "Error", "Warning", "✗", ":", "found", "issue", "unused", "unused-import"]
158
+ max_lines = 60
159
+ on_empty = "✅ No lint issues found"
160
+
161
+ # ── Architecture Validator ──────────────────────────────────────────────────
162
+
163
+ [filters.architecture-check]
164
+ command = "architecture"
165
+ description = "Filter architecture validation output"
166
+ strip_ansi = true
167
+ keep_lines_matching = ["FAIL", "WARN", "VIOLATION", "missing", "error", "Error", "❌", "⚠"]
168
+ max_lines = 40
169
+ on_empty = "✅ Architecture validation passed"
170
+
171
+ # ── Integration Validator ───────────────────────────────────────────────────
172
+
173
+ [filters.integration-check]
174
+ command = "integration"
175
+ description = "Filter integration test output"
176
+ strip_ansi = true
177
+ keep_lines_matching = ["FAILED", "error", "timeout", "connection refused", "assertion", "panic", "Error", "failed"]
178
+ max_lines = 80
179
+ on_empty = "✅ All integration tests passed"
180
+
181
+ # ── Git Status Validator ────────────────────────────────────────────────────
182
+
183
+ [filters.git-status]
184
+ command = "git-status"
185
+ description = "Compact git status output"
186
+ strip_ansi = true
187
+ replace = [
188
+ { pattern = "^On branch (.+)$", replacement = "branch: $1" },
189
+ { pattern = "^nothing to commit, working tree clean$", replacement = "✅ clean" }
190
+ ]
191
+ max_lines = 20
192
+
193
+ # ── Docker Validator ────────────────────────────────────────────────────────
194
+
195
+ [filters.docker-ps]
196
+ command = "docker-ps"
197
+ description = "Compact docker ps output"
198
+ strip_ansi = true
199
+ head_lines = 1
200
+ truncate_lines_at = 120
201
+ max_lines = 30
202
+
203
+ # ── Ubiquitous Language Validator ────────────────────────────────────────────
204
+
205
+ [filters.ubiquitous-language]
206
+ command = "validate-ubiquitous-language"
207
+ description = "Detect code drift from .pi/domain/ubiquitous-language.md glossary"
208
+ strip_ansi = false
209
+ keep_lines_matching = ["FAIL", "WARN", "Drift:", "alias", "canonical"]
@@ -0,0 +1,142 @@
1
+ # Guardian Spring Boot TOML Validators
2
+ #
3
+ # Declarative validation rules for Spring Boot convention enforcement.
4
+ # Pipeline stages: strip_ansi → replace → match_output → strip/keep_lines → truncate → head/tail → max_lines → on_empty
5
+ #
6
+ # Package ring conventions (shared with validate-annotations.sh and validate-spring-architecture.sh):
7
+ # domain/ → zero external dependencies
8
+ # application/ → domain/ only
9
+ # infrastructure/ → domain/ + application/
10
+ # web/ → application/ only
11
+
12
+ schema_version = 1
13
+
14
+ # ── @Transactional Coverage ─────────────────────────────────────────────────
15
+
16
+ [filters.transactional-coverage]
17
+ command = "validate-annotations"
18
+ description = "Detect @Service classes missing @Transactional on public methods"
19
+ strip_ansi = true
20
+ keep_lines_matching = ["Service class without @Transactional", "Missing @Transactional", "FAIL"]
21
+ max_lines = 20
22
+ on_empty = "✅ All @Service classes have @Transactional annotations"
23
+
24
+ [[tests.transactional-coverage]]
25
+ name = "passes when all services have @Transactional"
26
+ input = """
27
+ [PASS] All @Service classes have @Transactional annotations
28
+ """
29
+ expected = "✅ All @Service classes have @Transactional annotations"
30
+
31
+ [[tests.transactional-coverage]]
32
+ name = "flags missing @Transactional"
33
+ input = """
34
+ [WARN] Service class without @Transactional: src/main/java/com/myapp/service/BadService.java (3 public methods, 0 @Transactional)
35
+ """
36
+ expected = "src/main/java/com/myapp/service/BadService.java"
37
+
38
+ # ── @PostConstruct Placement ────────────────────────────────────────────────
39
+
40
+ [filters.postconstruct-placement]
41
+ command = "validate-annotations"
42
+ description = "Detect @PostConstruct in controller classes (should be in service/config/component)"
43
+ strip_ansi = true
44
+ keep_lines_matching = ["@PostConstruct found in controller", "FAIL"]
45
+ max_lines = 10
46
+ on_empty = "✅ No @PostConstruct in controller classes"
47
+
48
+ [[tests.postconstruct-placement]]
49
+ name = "passes when @PostConstruct is in valid packages"
50
+ input = """
51
+ [PASS] No @PostConstruct found in controller classes
52
+ """
53
+ expected = "✅ No @PostConstruct in controller classes"
54
+
55
+ [[tests.postconstruct-placement]]
56
+ name = "flags @PostConstruct in controllers"
57
+ input = """
58
+ [FAIL] @PostConstruct found in controller: src/main/java/com/myapp/web/BadController.java
59
+ """
60
+ expected = "BadController.java"
61
+
62
+ # ── Field Injection Detection ──────────────────────────────────────────────
63
+
64
+ [filters.field-injection]
65
+ command = "validate-annotations"
66
+ description = "Detect field-level @Autowired (prefer constructor injection)"
67
+ strip_ansi = true
68
+ keep_lines_matching = ["@Autowired", "field-level", "field injection", "WARN", "FAIL"]
69
+ max_lines = 20
70
+ on_empty = "✅ No field-level @Autowired found (constructor injection used)"
71
+
72
+ [[tests.field-injection]]
73
+ name = "passes with constructor injection"
74
+ input = """
75
+ [PASS] No field-level @Autowired found (constructor injection used)
76
+ """
77
+ expected = "✅ No field-level @Autowired found (constructor injection used)"
78
+
79
+ [[tests.field-injection]]
80
+ name = "flags field injection"
81
+ input = """
82
+ [FAIL] Field-level @Autowired found (5 occurrences) — prefer constructor injection
83
+ """
84
+ expected = "Field-level @Autowired found"
85
+
86
+ # ── Layering: Web → Infrastructure ─────────────────────────────────────────
87
+
88
+ [filters.layering-web-infrastructure]
89
+ command = "validate-annotations"
90
+ description = "Detect web layer importing repository/infrastructure directly"
91
+ strip_ansi = true
92
+ keep_lines_matching = ["imports repository/infrastructure", "imports infrastructure/repository", "FAIL"]
93
+ max_lines = 20
94
+ on_empty = "✅ Web layer has no direct repository imports (correct layering)"
95
+
96
+ [[tests.layering-web-infrastructure]]
97
+ name = "passes with clean layering"
98
+ input = """
99
+ [PASS] Web layer has no direct repository imports (correct layering)
100
+ """
101
+ expected = "✅ Web layer has no direct repository imports (correct layering)"
102
+
103
+ [[tests.layering-web-infrastructure]]
104
+ name = "flags direct repository import"
105
+ input = """
106
+ [FAIL] Web layer imports repository/infrastructure directly: src/main/java/com/myapp/web/UserController.java
107
+ """
108
+ expected = "UserController.java"
109
+
110
+ # ── Domain Layer Purity ────────────────────────────────────────────────────
111
+
112
+ [filters.domain-layer-purity]
113
+ command = "validate-spring-architecture"
114
+ description = "Ensure domain layer has no external dependencies (no imports from other layers)"
115
+ strip_ansi = true
116
+ keep_lines_matching = ["Domain layer import from", "Domain ring", "FAIL"]
117
+ max_lines = 20
118
+ on_empty = "✅ Domain ring has no external dependencies (clean)"
119
+
120
+ [[tests.domain-layer-purity]]
121
+ name = "passes with clean domain"
122
+ input = """
123
+ [PASS] Domain ring has no external dependencies (clean)
124
+ """
125
+ expected = "✅ Domain ring has no external dependencies (clean)"
126
+
127
+ # ── Application Layer Purity ───────────────────────────────────────────────
128
+
129
+ [filters.application-layer-purity]
130
+ command = "validate-spring-architecture"
131
+ description = "Ensure application layer only imports from domain layer"
132
+ strip_ansi = true
133
+ keep_lines_matching = ["Application layer imports from", "imports.*infrastructure", "imports.*repository", "FAIL"]
134
+ max_lines = 20
135
+ on_empty = "✅ Application ring only depends on domain (clean)"
136
+
137
+ [[tests.application-layer-purity]]
138
+ name = "passes with clean application layer"
139
+ input = """
140
+ [PASS] Application ring only depends on domain (clean)
141
+ """
142
+ expected = "✅ Application ring only depends on domain (clean)"
@@ -0,0 +1,53 @@
1
+ # Workpad
2
+
3
+ > **Purpose:** Persistent progress tracker for agent sessions. Updated in-place throughout execution.
4
+ > **Pattern:** Single file per session/issue. Do not create duplicate workpads.
5
+
6
+ ## Context
7
+
8
+ ```text
9
+ <hostname>:<abs-path>@<short-sha>
10
+ ```
11
+
12
+ - **Issue:** [issue-id or session identifier]
13
+ - **Scope:** [simple/moderate/complex/critical]
14
+ - **Started:** [timestamp]
15
+
16
+ ## Plan
17
+
18
+ - [ ] 1\. Parent task
19
+ - [ ] 1.1 Child task
20
+ - [ ] 1.2 Child task
21
+ - [ ] 2\. Parent task
22
+
23
+ ## Acceptance Criteria
24
+
25
+ - [ ] Criterion 1
26
+ - [ ] Criterion 2
27
+ - [ ] Criterion 3
28
+
29
+ ## Validation
30
+
31
+ - [ ] Targeted test: `[command]`
32
+ - [ ] Build: `[command]`
33
+ - [ ] Lint: `[command]`
34
+
35
+ ## Architecture Review
36
+
37
+ - [ ] ADRs reviewed: [list relevant ADRs]
38
+ - [ ] Module boundaries respected
39
+ - [ ] Cross-module dependencies documented
40
+
41
+ ## Notes
42
+
43
+ - [Progress notes with timestamps]
44
+
45
+ ## Cross-Module Dependencies
46
+
47
+ | Dependency | Module | Status | Notes |
48
+ |-----------|--------|--------|-------|
49
+ | [contract] | [name] | ✅ Ready / ⏳ Pending / ❌ Blocked | [details] |
50
+
51
+ ## Confusions
52
+
53
+ - [Only include when something was confusing during execution]
@@ -0,0 +1,14 @@
1
+ # Stage 1: Build with Maven
2
+ FROM maven:3.9-eclipse-temurin-21 AS build
3
+ WORKDIR /app
4
+ COPY pom.xml .
5
+ RUN mvn dependency:go-offline -q
6
+ COPY src/ src/
7
+ RUN mvn package -q -DskipTests
8
+
9
+ # Stage 2: Run
10
+ FROM eclipse-temurin:21-jre
11
+ WORKDIR /app
12
+ COPY --from=build /app/target/{{PROJECTNAME}}-*.jar app.jar
13
+ EXPOSE 8080
14
+ ENTRYPOINT ["java", "-jar", "app.jar"]
@@ -0,0 +1,40 @@
1
+ # {{PROJECTNAME}}
2
+
3
+ > Generated by Guardian Framework
4
+ > Language: Java (Spring Boot) | Build Tool: {{BUILD_TOOL}}
5
+
6
+ ## Modules
7
+
8
+ {{#MODULES}}
9
+ - {{.}}
10
+ {{/MODULES}}
11
+
12
+ ## Architecture
13
+
14
+ Clean Architecture with decomposed interface sub-layers:
15
+ - `domain/` — Enterprise business rules
16
+ - `application/` — Application business rules
17
+ - `infrastructure/` — External concerns (DB, messaging, etc.)
18
+ - `interfaces/http/` — REST endpoints, DTOs
19
+ - `interfaces/messaging/` — Event publishers/subscribers
20
+
21
+ ## Getting Started
22
+
23
+ ```bash
24
+ # Build
25
+ {{BUILD_COMMAND}}
26
+
27
+ # Test
28
+ {{TEST_COMMAND}}
29
+
30
+ # Run
31
+ mvn spring-boot:run
32
+ ```
33
+
34
+ ## CI Pipeline
35
+
36
+ This project uses Guardian's hardening pipeline. Run locally:
37
+
38
+ ```bash
39
+ bash .pi/scripts/ci/run_hardening_stages.sh
40
+ ```
@@ -0,0 +1,132 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5
+ <modelVersion>4.0.0</modelVersion>
6
+
7
+ <parent>
8
+ <groupId>org.springframework.boot</groupId>
9
+ <artifactId>spring-boot-starter-parent</artifactId>
10
+ <version>3.2.0</version>
11
+ <relativePath/>
12
+ </parent>
13
+
14
+ <groupId>{{GROUP}}</groupId>
15
+ <artifactId>{{PROJECTNAME}}</artifactId>
16
+ <version>{{VERSION}}</version>
17
+ <name>{{PROJECTNAME}}</name>
18
+ <description>Project generated by Guardian Framework</description>
19
+
20
+ <properties>
21
+ <java.version>21</java.version>
22
+ </properties>
23
+
24
+ <dependencies>
25
+ <!-- Web / REST -->
26
+ <dependency>
27
+ <groupId>org.springframework.boot</groupId>
28
+ <artifactId>spring-boot-starter-web</artifactId>
29
+ </dependency>
30
+
31
+ <!-- Validation -->
32
+ <dependency>
33
+ <groupId>org.springframework.boot</groupId>
34
+ <artifactId>spring-boot-starter-validation</artifactId>
35
+ </dependency>
36
+
37
+ <!-- Actuator / Health checks -->
38
+ <dependency>
39
+ <groupId>org.springframework.boot</groupId>
40
+ <artifactId>spring-boot-starter-actuator</artifactId>
41
+ </dependency>
42
+
43
+ <!-- Messaging (if interfaces/messaging layer selected) -->
44
+ <dependency>
45
+ <groupId>org.springframework.boot</groupId>
46
+ <artifactId>spring-boot-starter-amqp</artifactId>
47
+ </dependency>
48
+
49
+ <!-- Database -->
50
+ <dependency>
51
+ <groupId>org.springframework.boot</groupId>
52
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
53
+ </dependency>
54
+ <dependency>
55
+ <groupId>org.postgresql</groupId>
56
+ <artifactId>postgresql</artifactId>
57
+ <scope>runtime</scope>
58
+ </dependency>
59
+
60
+ <!-- Observability -->
61
+ <dependency>
62
+ <groupId>io.micrometer</groupId>
63
+ <artifactId>micrometer-tracing-bridge-brave</artifactId>
64
+ </dependency>
65
+
66
+ <!-- Test -->
67
+ <dependency>
68
+ <groupId>org.springframework.boot</groupId>
69
+ <artifactId>spring-boot-starter-test</artifactId>
70
+ <scope>test</scope>
71
+ </dependency>
72
+ </dependencies>
73
+
74
+ <build>
75
+ <plugins>
76
+ <!-- Test runner -->
77
+ <plugin>
78
+ <groupId>org.springframework.boot</groupId>
79
+ <artifactId>spring-boot-maven-plugin</artifactId>
80
+ </plugin>
81
+
82
+ <!-- Coverage -->
83
+ <plugin>
84
+ <groupId>org.jacoco</groupId>
85
+ <artifactId>jacoco-maven-plugin</artifactId>
86
+ <version>0.8.11</version>
87
+ <executions>
88
+ <execution>
89
+ <goals><goal>prepare-agent</goal></goals>
90
+ </execution>
91
+ <execution>
92
+ <id>report</id>
93
+ <phase>verify</phase>
94
+ <goals><goal>report</goal></goals>
95
+ </execution>
96
+ </executions>
97
+ </plugin>
98
+
99
+ <!-- Lint -->
100
+ <plugin>
101
+ <groupId>org.apache.maven.plugins</groupId>
102
+ <artifactId>maven-checkstyle-plugin</artifactId>
103
+ <version>3.3.1</version>
104
+ <configuration>
105
+ <failOnViolation>true</failOnViolation>
106
+ </configuration>
107
+ </plugin>
108
+
109
+ <!-- Security audit -->
110
+ <plugin>
111
+ <groupId>org.owasp</groupId>
112
+ <artifactId>dependency-check-maven</artifactId>
113
+ <version>9.0.9</version>
114
+ <configuration>
115
+ <failBuildOnCVSS>7</failBuildOnCVSS>
116
+ </configuration>
117
+ </plugin>
118
+
119
+ <!-- Format -->
120
+ <plugin>
121
+ <groupId>com.diffplug.spotless</groupId>
122
+ <artifactId>spotless-maven-plugin</artifactId>
123
+ <version>2.43.0</version>
124
+ <configuration>
125
+ <java>
126
+ <palantirJavaFormat/>
127
+ </java>
128
+ </configuration>
129
+ </plugin>
130
+ </plugins>
131
+ </build>
132
+ </project>
@@ -0,0 +1,15 @@
1
+ # Stage 1: Build
2
+ FROM oven/bun:1 AS build
3
+ WORKDIR /app
4
+ COPY package.json bun.lock .
5
+ RUN bun install --frozen-lockfile
6
+ COPY . .
7
+ RUN bun run build
8
+
9
+ # Stage 2: Run
10
+ FROM oven/bun:1-slim
11
+ WORKDIR /app
12
+ COPY --from=build /app/dist ./dist
13
+ COPY --from=build /app/node_modules ./node_modules
14
+ EXPOSE 3000
15
+ ENTRYPOINT ["bun", "run", "./dist/index.js"]
@@ -0,0 +1,29 @@
1
+ # {{PROJECTNAME}}
2
+
3
+ > Generated by Guardian Framework
4
+ > Language: TypeScript (Bun)
5
+
6
+ ## Architecture
7
+
8
+ Clean Architecture with decomposed interface sub-layers:
9
+ - `domain/` — Enterprise business rules
10
+ - `application/` — Application business rules
11
+ - `infrastructure/` — External concerns (DB, APIs, etc.)
12
+ - `interfaces/http/` — REST API routes (Hono)
13
+ - `interfaces/graphql/` — GraphQL resolvers (Yoga)
14
+
15
+ ## Getting Started
16
+
17
+ ```bash
18
+ # Install
19
+ bun install
20
+
21
+ # Dev
22
+ bun run dev
23
+
24
+ # Test
25
+ bun test
26
+
27
+ # Lint
28
+ bun run lint
29
+ ```
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "{{PROJECTNAME}}",
3
+ "version": "{{VERSION}}",
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "bun build ./src/index.ts --outdir ./dist",
7
+ "test": "bun test",
8
+ "lint": "biome check .",
9
+ "format": "biome format . --write",
10
+ "format:check": "biome format . --check",
11
+ "audit": "bun audit"
12
+ },
13
+ "dependencies": {
14
+ "hono": "^4.0.0",
15
+ "graphql-yoga": "^5.0.0",
16
+ "zod": "^3.22.0"
17
+ },
18
+ "devDependencies": {
19
+ "@types/bun": "latest",
20
+ "vitest": "^1.0.0",
21
+ "@biomejs/biome": "^1.5.0"
22
+ }
23
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ES2022",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "noUncheckedIndexedAccess": true,
8
+ "noImplicitReturns": true,
9
+ "noFallthroughCasesInSwitch": true,
10
+ "exactOptionalPropertyTypes": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "outDir": "./dist",
14
+ "rootDir": "./src",
15
+ "declaration": true,
16
+ "declarationMap": true,
17
+ "sourceMap": true
18
+ },
19
+ "include": ["src/**/*.ts"],
20
+ "exclude": ["node_modules", "dist"]
21
+ }