intentdna 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/LICENSE +69 -0
  2. package/README.md +251 -0
  3. package/dist/audit/index.d.ts +109 -0
  4. package/dist/audit/index.d.ts.map +1 -0
  5. package/dist/audit/index.js +144 -0
  6. package/dist/audit/index.js.map +1 -0
  7. package/dist/cli/commands/compile.d.ts +14 -0
  8. package/dist/cli/commands/compile.d.ts.map +1 -0
  9. package/dist/cli/commands/compile.js +89 -0
  10. package/dist/cli/commands/compile.js.map +1 -0
  11. package/dist/cli/commands/epigenetic.d.ts +20 -0
  12. package/dist/cli/commands/epigenetic.d.ts.map +1 -0
  13. package/dist/cli/commands/epigenetic.js +112 -0
  14. package/dist/cli/commands/epigenetic.js.map +1 -0
  15. package/dist/cli/commands/evolve.d.ts +12 -0
  16. package/dist/cli/commands/evolve.d.ts.map +1 -0
  17. package/dist/cli/commands/evolve.js +52 -0
  18. package/dist/cli/commands/evolve.js.map +1 -0
  19. package/dist/cli/commands/guard.d.ts +22 -0
  20. package/dist/cli/commands/guard.d.ts.map +1 -0
  21. package/dist/cli/commands/guard.js +257 -0
  22. package/dist/cli/commands/guard.js.map +1 -0
  23. package/dist/cli/commands/import.d.ts +71 -0
  24. package/dist/cli/commands/import.d.ts.map +1 -0
  25. package/dist/cli/commands/import.js +428 -0
  26. package/dist/cli/commands/import.js.map +1 -0
  27. package/dist/cli/commands/init.d.ts +13 -0
  28. package/dist/cli/commands/init.d.ts.map +1 -0
  29. package/dist/cli/commands/init.js +171 -0
  30. package/dist/cli/commands/init.js.map +1 -0
  31. package/dist/cli/commands/run.d.ts +59 -0
  32. package/dist/cli/commands/run.d.ts.map +1 -0
  33. package/dist/cli/commands/run.js +350 -0
  34. package/dist/cli/commands/run.js.map +1 -0
  35. package/dist/cli/commands/show.d.ts +12 -0
  36. package/dist/cli/commands/show.d.ts.map +1 -0
  37. package/dist/cli/commands/show.js +78 -0
  38. package/dist/cli/commands/show.js.map +1 -0
  39. package/dist/cli/commands/sync.d.ts +31 -0
  40. package/dist/cli/commands/sync.d.ts.map +1 -0
  41. package/dist/cli/commands/sync.js +307 -0
  42. package/dist/cli/commands/sync.js.map +1 -0
  43. package/dist/cli/commands/validate.d.ts +11 -0
  44. package/dist/cli/commands/validate.d.ts.map +1 -0
  45. package/dist/cli/commands/validate.js +30 -0
  46. package/dist/cli/commands/validate.js.map +1 -0
  47. package/dist/cli/commands/verify.d.ts +33 -0
  48. package/dist/cli/commands/verify.d.ts.map +1 -0
  49. package/dist/cli/commands/verify.js +102 -0
  50. package/dist/cli/commands/verify.js.map +1 -0
  51. package/dist/cli/index.d.ts +15 -0
  52. package/dist/cli/index.d.ts.map +1 -0
  53. package/dist/cli/index.js +358 -0
  54. package/dist/cli/index.js.map +1 -0
  55. package/dist/cli/util/format.d.ts +24 -0
  56. package/dist/cli/util/format.d.ts.map +1 -0
  57. package/dist/cli/util/format.js +67 -0
  58. package/dist/cli/util/format.js.map +1 -0
  59. package/dist/cli/util/prompt.d.ts +11 -0
  60. package/dist/cli/util/prompt.d.ts.map +1 -0
  61. package/dist/cli/util/prompt.js +51 -0
  62. package/dist/cli/util/prompt.js.map +1 -0
  63. package/dist/compiler/activate.d.ts +29 -0
  64. package/dist/compiler/activate.d.ts.map +1 -0
  65. package/dist/compiler/activate.js +141 -0
  66. package/dist/compiler/activate.js.map +1 -0
  67. package/dist/compiler/cascade.d.ts +27 -0
  68. package/dist/compiler/cascade.d.ts.map +1 -0
  69. package/dist/compiler/cascade.js +124 -0
  70. package/dist/compiler/cascade.js.map +1 -0
  71. package/dist/compiler/compile.d.ts +17 -0
  72. package/dist/compiler/compile.d.ts.map +1 -0
  73. package/dist/compiler/compile.js +219 -0
  74. package/dist/compiler/compile.js.map +1 -0
  75. package/dist/compiler/index.d.ts +28 -0
  76. package/dist/compiler/index.d.ts.map +1 -0
  77. package/dist/compiler/index.js +51 -0
  78. package/dist/compiler/index.js.map +1 -0
  79. package/dist/compiler/workflow.d.ts +37 -0
  80. package/dist/compiler/workflow.d.ts.map +1 -0
  81. package/dist/compiler/workflow.js +274 -0
  82. package/dist/compiler/workflow.js.map +1 -0
  83. package/dist/evolution/collector.d.ts +52 -0
  84. package/dist/evolution/collector.d.ts.map +1 -0
  85. package/dist/evolution/collector.js +72 -0
  86. package/dist/evolution/collector.js.map +1 -0
  87. package/dist/evolution/fitness.d.ts +33 -0
  88. package/dist/evolution/fitness.d.ts.map +1 -0
  89. package/dist/evolution/fitness.js +96 -0
  90. package/dist/evolution/fitness.js.map +1 -0
  91. package/dist/evolution/index.d.ts +53 -0
  92. package/dist/evolution/index.d.ts.map +1 -0
  93. package/dist/evolution/index.js +69 -0
  94. package/dist/evolution/index.js.map +1 -0
  95. package/dist/evolution/marker-gen.d.ts +31 -0
  96. package/dist/evolution/marker-gen.d.ts.map +1 -0
  97. package/dist/evolution/marker-gen.js +141 -0
  98. package/dist/evolution/marker-gen.js.map +1 -0
  99. package/dist/evolution/store.d.ts +24 -0
  100. package/dist/evolution/store.d.ts.map +1 -0
  101. package/dist/evolution/store.js +78 -0
  102. package/dist/evolution/store.js.map +1 -0
  103. package/dist/evolution/types.d.ts +73 -0
  104. package/dist/evolution/types.d.ts.map +1 -0
  105. package/dist/evolution/types.js +14 -0
  106. package/dist/evolution/types.js.map +1 -0
  107. package/dist/index.d.ts +4 -0
  108. package/dist/index.d.ts.map +1 -0
  109. package/dist/index.js +4 -0
  110. package/dist/index.js.map +1 -0
  111. package/dist/log/logger.d.ts +15 -0
  112. package/dist/log/logger.d.ts.map +1 -0
  113. package/dist/log/logger.js +36 -0
  114. package/dist/log/logger.js.map +1 -0
  115. package/dist/runtime/agent-md.d.ts +56 -0
  116. package/dist/runtime/agent-md.d.ts.map +1 -0
  117. package/dist/runtime/agent-md.js +257 -0
  118. package/dist/runtime/agent-md.js.map +1 -0
  119. package/dist/runtime/claude-sdk.d.ts +51 -0
  120. package/dist/runtime/claude-sdk.d.ts.map +1 -0
  121. package/dist/runtime/claude-sdk.js +78 -0
  122. package/dist/runtime/claude-sdk.js.map +1 -0
  123. package/dist/runtime/hooks.d.ts +67 -0
  124. package/dist/runtime/hooks.d.ts.map +1 -0
  125. package/dist/runtime/hooks.js +645 -0
  126. package/dist/runtime/hooks.js.map +1 -0
  127. package/dist/runtime/index.d.ts +9 -0
  128. package/dist/runtime/index.d.ts.map +1 -0
  129. package/dist/runtime/index.js +5 -0
  130. package/dist/runtime/index.js.map +1 -0
  131. package/dist/runtime/markdown.d.ts +36 -0
  132. package/dist/runtime/markdown.d.ts.map +1 -0
  133. package/dist/runtime/markdown.js +214 -0
  134. package/dist/runtime/markdown.js.map +1 -0
  135. package/dist/runtime/settings-adapter.d.ts +33 -0
  136. package/dist/runtime/settings-adapter.d.ts.map +1 -0
  137. package/dist/runtime/settings-adapter.js +78 -0
  138. package/dist/runtime/settings-adapter.js.map +1 -0
  139. package/dist/runtime/skill-adapter.d.ts +22 -0
  140. package/dist/runtime/skill-adapter.d.ts.map +1 -0
  141. package/dist/runtime/skill-adapter.js +170 -0
  142. package/dist/runtime/skill-adapter.js.map +1 -0
  143. package/dist/runtime/workflow-runner.d.ts +53 -0
  144. package/dist/runtime/workflow-runner.d.ts.map +1 -0
  145. package/dist/runtime/workflow-runner.js +420 -0
  146. package/dist/runtime/workflow-runner.js.map +1 -0
  147. package/dist/schema/index.d.ts +2 -0
  148. package/dist/schema/index.d.ts.map +1 -0
  149. package/dist/schema/index.js +2 -0
  150. package/dist/schema/index.js.map +1 -0
  151. package/dist/schema/types.d.ts +275 -0
  152. package/dist/schema/types.d.ts.map +1 -0
  153. package/dist/schema/types.js +11 -0
  154. package/dist/schema/types.js.map +1 -0
  155. package/dist/schema/validate.d.ts +20 -0
  156. package/dist/schema/validate.d.ts.map +1 -0
  157. package/dist/schema/validate.js +379 -0
  158. package/dist/schema/validate.js.map +1 -0
  159. package/dist/schema/yaml-parser.d.ts +12 -0
  160. package/dist/schema/yaml-parser.d.ts.map +1 -0
  161. package/dist/schema/yaml-parser.js +298 -0
  162. package/dist/schema/yaml-parser.js.map +1 -0
  163. package/dist/species/default.dna.json +62 -0
  164. package/dist/templates/api-backend.dna.yaml +77 -0
  165. package/dist/templates/brainstorming-first.dna.yaml +71 -0
  166. package/dist/templates/branch-finishing.dna.yaml +54 -0
  167. package/dist/templates/code-review-pipeline.dna.yaml +91 -0
  168. package/dist/templates/devops-cicd.dna.yaml +67 -0
  169. package/dist/templates/documentation-writer.dna.yaml +71 -0
  170. package/dist/templates/enterprise-baseline.dna.yaml +66 -0
  171. package/dist/templates/frontend-quality.dna.yaml +88 -0
  172. package/dist/templates/full-pipeline.dna.yaml +129 -0
  173. package/dist/templates/mobile-dev.dna.yaml +68 -0
  174. package/dist/templates/monorepo-governance.dna.yaml +60 -0
  175. package/dist/templates/multi-perspective-review.dna.yaml +109 -0
  176. package/dist/templates/pr-submitter.dna.yaml +55 -0
  177. package/dist/templates/safe-refactoring.dna.yaml +65 -0
  178. package/dist/templates/secure-dev.dna.yaml +90 -0
  179. package/dist/templates/subagent-parallel.dna.yaml +98 -0
  180. package/dist/templates/systematic-debugging.dna.yaml +55 -0
  181. package/dist/templates/tdd-strict.dna.yaml +69 -0
  182. package/dist/templates/verification-loop.dna.yaml +53 -0
  183. package/dist/templates/yolo-with-guardrails.dna.yaml +56 -0
  184. package/package.json +43 -0
package/LICENSE ADDED
@@ -0,0 +1,69 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ Copyright 2026 Samuel
58
+
59
+ Licensed under the Apache License, Version 2.0 (the "License");
60
+ you may not use this file except in compliance with the License.
61
+ You may obtain a copy of the License at
62
+
63
+ http://www.apache.org/licenses/LICENSE-2.0
64
+
65
+ Unless required by applicable law or agreed to in writing, software
66
+ distributed under the License is distributed on an "AS IS" BASIS,
67
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
68
+ See the License for the specific language governing permissions and
69
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,251 @@
1
+ # Intent DNA
2
+
3
+ **AI Agent Guardrails in 30 seconds.**
4
+
5
+ ```bash
6
+ npm install -g intentdna
7
+ cd your-project
8
+ dna guard
9
+ ```
10
+
11
+ That's it. Your AI agent (Claude Code, Cursor, Cline) now has safety boundaries — no more accidental `rm -rf`, force-push to main, or production deletes.
12
+
13
+ ---
14
+
15
+ ## Why?
16
+
17
+ AI agents are powerful, but **one wrong move can be expensive**:
18
+
19
+ - Deletes production database
20
+ - Force-pushes over main branch
21
+ - Exposes secrets in logs
22
+ - Runs up $500 API bills overnight
23
+
24
+ **Intent DNA** gives agents clear rules about what they can and cannot do — enforced at the harness level, not just in prompts.
25
+
26
+ ---
27
+
28
+ ## Quick Start
29
+
30
+ ### Option 1: Zero-Config Guardrails (Recommended)
31
+
32
+ ```bash
33
+ npm install -g intentdna
34
+ cd your-project
35
+ dna guard # Auto-detects Claude Code/Cursor/Cline
36
+ ```
37
+
38
+ **What it does:**
39
+ - Detects your AI coding environment
40
+ - Injects safety rules (no production deletes, no force-push, etc.)
41
+ - Generates enforcement hooks (hard blocks, not suggestions)
42
+ - Creates audit logs at `~/.intentdna/audit/`
43
+
44
+ **Levels:**
45
+ ```bash
46
+ dna guard --level standard # Safety baseline (default)
47
+ dna guard --level yolo # Max autonomy + safety net
48
+ dna guard --level strict # Enterprise-grade
49
+ ```
50
+
51
+ **Audit:**
52
+ ```bash
53
+ dna guard --audit # Show last 7 days of violations
54
+ dna guard --remove # Remove all guardrails
55
+ ```
56
+
57
+ ---
58
+
59
+ ### Option 2: Custom DNA (Advanced)
60
+
61
+ Start from a template:
62
+
63
+ ```bash
64
+ dna init --template secure-dev
65
+ dna sync .dna.yaml --inject CLAUDE.md --hooks .claude/hooks
66
+ ```
67
+
68
+ Or import your existing config:
69
+
70
+ ```bash
71
+ dna import . # Reads CLAUDE.md, hooks → generates .dna.yaml
72
+ # Edit .dna.yaml to customize
73
+ dna sync .dna.yaml --inject CLAUDE.md --hooks .claude/hooks
74
+ ```
75
+
76
+ ---
77
+
78
+ ## 20 Built-in Templates
79
+
80
+ **Workflows (Superpowers-inspired):**
81
+ - `brainstorming-first` — Socratic design before coding
82
+ - `subagent-parallel` — Multi-agent with two-phase review
83
+ - `verification-loop` — Confirm fix before marking done
84
+ - `branch-finishing` — Merge/PR/cleanup decisions
85
+ - `pr-submitter` — Pre-review checklist
86
+
87
+ **Quality & Safety:**
88
+ - `secure-dev` — Security + quality baseline
89
+ - `tdd-strict` — Strict test-driven development
90
+ - `safe-refactoring` — Step-by-step refactoring
91
+ - `systematic-debugging` — Structured debugging
92
+ - `code-review-pipeline` — Review workflow with retry
93
+
94
+ **Domain-Specific:**
95
+ - `frontend-quality` — React/accessibility/performance
96
+ - `api-backend` — API security + database safety
97
+ - `mobile-dev` — Flutter/React Native standards
98
+ - `devops-cicd` — CI/CD agent guardrails
99
+ - `monorepo-governance` — Multi-package isolation
100
+
101
+ **Collaboration:**
102
+ - `multi-perspective-review` — Bull/Bear debate review
103
+ - `documentation-writer` — Technical docs
104
+ - `enterprise-baseline` — Organization security
105
+ - `yolo-with-guardrails` — Full autonomy + limits
106
+ - `full-pipeline` — Complete plan→implement→test→review
107
+
108
+ List all:
109
+ ```bash
110
+ dna init --template list
111
+ ```
112
+
113
+ ---
114
+
115
+ ## How It Works
116
+
117
+ DNA compiles to your AI tool's native format:
118
+
119
+ ```
120
+ .dna.yaml → dna sync → CLAUDE.md + hooks + agents + skills + settings
121
+ ```
122
+
123
+ | Output | Purpose |
124
+ |--------|---------|
125
+ | `CLAUDE.md` | Behavioral guidelines (soft) |
126
+ | `.claude/hooks/*.sh` | Hard constraints (exit 2 = block) |
127
+ | `.claude/agents/*.md` | Role definitions |
128
+ | `.cursorrules` | Cursor integration |
129
+
130
+ **Key insight:** Prompts can be ignored. Hooks cannot. DNA generates both.
131
+
132
+ ---
133
+
134
+ ## DNA Structure (Advanced)
135
+
136
+ <details>
137
+ <summary>Click to expand</summary>
138
+
139
+ ```yaml
140
+ # .dna.yaml
141
+ version: "0.1.0"
142
+ id: project_my_app
143
+ name: My App
144
+ type: project
145
+
146
+ cascade:
147
+ inherits: ["species:default"] # Inherit safety baseline
148
+ priority: 100
149
+
150
+ genes:
151
+ code_quality:
152
+ description: Code quality standards
153
+ codons:
154
+ - type: attract
155
+ target: tested_code
156
+ - type: threshold
157
+ condition: "test_coverage >= 80%"
158
+ action: warn
159
+
160
+ roles:
161
+ reviewer:
162
+ description: Code reviewer — read only
163
+ tool_permissions:
164
+ allow: [Read, Grep, Glob]
165
+ deny: [Edit, Write]
166
+ scope:
167
+ read: ["**/*"]
168
+ instructions:
169
+ - Never modify source code
170
+ - Give clear PASS/FAIL verdict
171
+
172
+ workflows:
173
+ dev-pipeline:
174
+ name: Development Pipeline
175
+ steps:
176
+ - id: implement
177
+ role: implementer
178
+ description: Implement the feature
179
+ - id: review
180
+ role: reviewer
181
+ depends_on: [implement]
182
+ description: Review the implementation
183
+ ```
184
+
185
+ **Cascade:** DNA files inherit and override by priority. `threshold` codons (safety rules) can never be relaxed — even by higher priority DNA.
186
+
187
+ **Genes:** Behavioral traits (attract/repel/threshold/weight/sense).
188
+
189
+ **Roles:** Agent identities with tool permissions and scope.
190
+
191
+ **Workflows:** Multi-step procedures with retry logic.
192
+
193
+ </details>
194
+
195
+ ---
196
+
197
+ ## Supported Environments
198
+
199
+ - ✅ **Claude Code** (CLAUDE.md + hooks + agents + skills + settings)
200
+ - ✅ **Cursor** (.cursorrules)
201
+ - ✅ **Cline** (.clinerules)
202
+ - 🚧 **AgentScope** (coming soon)
203
+ - 🚧 **Gemini CLI** (GEMINI.md)
204
+
205
+ ---
206
+
207
+ ## Commands
208
+
209
+ ```bash
210
+ dna guard # Zero-config guardrails
211
+ dna init --template <name> # Start from template
212
+ dna sync <file> # Compile DNA → harness config
213
+ dna import . # Import existing config → DNA
214
+ dna verify # Check config integrity
215
+ dna evolve <dna-id> # Generate epigenetic markers from outcomes
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Philosophy
221
+
222
+ **Intent DNA** is inspired by biological DNA:
223
+
224
+ - **Genes** encode behavioral traits
225
+ - **Codons** are the atomic instructions
226
+ - **Cascade** mimics genetic inheritance
227
+ - **Epigenetics** learns from experience without changing genes
228
+
229
+ Read more: [DESIGN.md](DESIGN.md)
230
+
231
+ ---
232
+
233
+ ## License
234
+
235
+ Apache-2.0
236
+
237
+ ---
238
+
239
+ ## Contributing
240
+
241
+ Issues and PRs welcome. See [ROADMAP.md](ROADMAP.md) for planned features.
242
+
243
+ ---
244
+
245
+ ## Related Projects
246
+
247
+ - [Superpowers](https://github.com/superpowersai/superpowers) — 123K users, skill-based agent workflows
248
+ - [Cline KanBan](https://github.com/cline/cline-kanban) — Multi-agent task orchestration
249
+ - [AgentScope](https://github.com/modelscope/agentscope) — Multi-agent framework from Alibaba
250
+
251
+ Intent DNA compiles to these frameworks' native formats.
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Intent DNA — Audit System
3
+ *
4
+ * Structured audit event recording for agent behavior tracking.
5
+ * Stores events as JSONL (one JSON object per line) for easy
6
+ * streaming, querying, and future export to external systems
7
+ * (OpenTelemetry, Portkey, webhooks, etc.)
8
+ */
9
+ /** Base fields for all audit events */
10
+ export interface AuditEvent {
11
+ timestamp: string;
12
+ event_type: AuditEventType;
13
+ session_id?: string;
14
+ agent_type?: string;
15
+ role?: string;
16
+ task_id?: string;
17
+ workflow?: string;
18
+ step_id?: string;
19
+ }
20
+ export type AuditEventType = "tool_call" | "tool_failure" | "policy_violation" | "completion_check" | "step_complete" | "session_start" | "session_end" | "config_drift";
21
+ /** Tool call event */
22
+ export interface ToolCallEvent extends AuditEvent {
23
+ event_type: "tool_call";
24
+ tool_name: string;
25
+ tool_input_summary?: string;
26
+ duration_ms?: number;
27
+ result: "success" | "failure" | "blocked";
28
+ }
29
+ /** Policy violation event */
30
+ export interface PolicyViolationEvent extends AuditEvent {
31
+ event_type: "policy_violation";
32
+ rule_type: "threshold" | "scope" | "tool_filter" | "output_schema";
33
+ rule_description: string;
34
+ action_taken: "block" | "warn" | "escalate";
35
+ tool_name?: string;
36
+ }
37
+ /** Completion check event */
38
+ export interface CompletionCheckEvent extends AuditEvent {
39
+ event_type: "completion_check";
40
+ check_type: "file_exists" | "file_not_empty" | "file_contains" | "command_success";
41
+ target: string;
42
+ result: "pass" | "fail";
43
+ }
44
+ /** Session event */
45
+ export interface SessionEvent extends AuditEvent {
46
+ event_type: "session_start" | "session_end";
47
+ duration_ms?: number;
48
+ tool_calls_count?: number;
49
+ violations_count?: number;
50
+ outcome?: "success" | "failure" | "interrupted";
51
+ }
52
+ /** Config drift event */
53
+ export interface ConfigDriftEvent extends AuditEvent {
54
+ event_type: "config_drift";
55
+ file_path: string;
56
+ expected_checksum: string;
57
+ actual_checksum: string;
58
+ }
59
+ export interface AuditConfig {
60
+ enabled: boolean;
61
+ storage: string;
62
+ retention?: string;
63
+ track: AuditTrackOption[];
64
+ }
65
+ export type AuditTrackOption = "tool_calls" | "policy_violations" | "completion_checks" | "session_lifecycle" | "config_drift";
66
+ /**
67
+ * Write an audit event to the log.
68
+ * Events are stored as JSONL (one JSON per line) in daily files.
69
+ */
70
+ export declare function writeAuditEvent(event: AuditEvent, config: AuditConfig): Promise<void>;
71
+ /**
72
+ * Read audit events for a date range.
73
+ */
74
+ export declare function readAuditEvents(logDir: string, options?: {
75
+ from?: string;
76
+ to?: string;
77
+ event_type?: AuditEventType;
78
+ }): Promise<AuditEvent[]>;
79
+ export interface AuditSummary {
80
+ period: {
81
+ from: string;
82
+ to: string;
83
+ };
84
+ total_events: number;
85
+ tool_calls: number;
86
+ policy_violations: number;
87
+ completion_checks: {
88
+ pass: number;
89
+ fail: number;
90
+ };
91
+ sessions: {
92
+ total: number;
93
+ success: number;
94
+ failure: number;
95
+ };
96
+ top_violations: Array<{
97
+ rule: string;
98
+ count: number;
99
+ }>;
100
+ }
101
+ /**
102
+ * Generate an audit summary for a date range.
103
+ */
104
+ export declare function generateAuditSummary(logDir: string, from: string, to: string): Promise<AuditSummary>;
105
+ /**
106
+ * Render audit summary as markdown.
107
+ */
108
+ export declare function renderAuditReport(summary: AuditSummary): string;
109
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/audit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,cAAc,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,eAAe,GACf,aAAa,GACb,cAAc,CAAC;AAEnB,sBAAsB;AACtB,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;CAC3C;AAED,6BAA6B;AAC7B,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,UAAU,EAAE,kBAAkB,CAAC;IAC/B,SAAS,EAAE,WAAW,GAAG,OAAO,GAAG,aAAa,GAAG,eAAe,CAAC;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6BAA6B;AAC7B,MAAM,WA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,CAAA;CAAE,GACpE,OAAO,CAAC,UAAU,EAAE,CAAC,CA+BvB;AAID,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAClD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,YAAY,CAAC,CA0CvB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CA8B/D"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Intent DNA — Audit System
3
+ *
4
+ * Structured audit event recording for agent behavior tracking.
5
+ * Stores events as JSONL (one JSON object per line) for easy
6
+ * streaming, querying, and future export to external systems
7
+ * (OpenTelemetry, Portkey, webhooks, etc.)
8
+ */
9
+ import { mkdir, appendFile, readFile, readdir } from "node:fs/promises";
10
+ import { join } from "node:path";
11
+ // ── Audit Writer ───────────────────────────────────────────
12
+ /**
13
+ * Write an audit event to the log.
14
+ * Events are stored as JSONL (one JSON per line) in daily files.
15
+ */
16
+ export async function writeAuditEvent(event, config) {
17
+ if (!config.enabled)
18
+ return;
19
+ // Check if event type should be tracked
20
+ if (!shouldTrack(event, config))
21
+ return;
22
+ const date = event.timestamp.slice(0, 10); // YYYY-MM-DD
23
+ const logDir = config.storage;
24
+ await mkdir(logDir, { recursive: true });
25
+ const logFile = join(logDir, `${date}.jsonl`);
26
+ const line = JSON.stringify(event) + "\n";
27
+ await appendFile(logFile, line, "utf-8");
28
+ }
29
+ function shouldTrack(event, config) {
30
+ const typeToTrack = {
31
+ tool_call: "tool_calls",
32
+ tool_failure: "tool_calls",
33
+ policy_violation: "policy_violations",
34
+ completion_check: "completion_checks",
35
+ step_complete: "completion_checks",
36
+ session_start: "session_lifecycle",
37
+ session_end: "session_lifecycle",
38
+ config_drift: "config_drift",
39
+ };
40
+ return config.track.includes(typeToTrack[event.event_type]);
41
+ }
42
+ // ── Audit Reader ───────────────────────────────────────────
43
+ /**
44
+ * Read audit events for a date range.
45
+ */
46
+ export async function readAuditEvents(logDir, options) {
47
+ const events = [];
48
+ let files;
49
+ try {
50
+ files = await readdir(logDir);
51
+ }
52
+ catch {
53
+ return [];
54
+ }
55
+ const jsonlFiles = files.filter((f) => f.endsWith(".jsonl")).sort();
56
+ for (const file of jsonlFiles) {
57
+ const date = file.replace(".jsonl", "");
58
+ if (options?.from && date < options.from)
59
+ continue;
60
+ if (options?.to && date > options.to)
61
+ continue;
62
+ const content = await readFile(join(logDir, file), "utf-8");
63
+ for (const line of content.split("\n")) {
64
+ if (!line.trim())
65
+ continue;
66
+ try {
67
+ const event = JSON.parse(line);
68
+ if (options?.event_type && event.event_type !== options.event_type)
69
+ continue;
70
+ events.push(event);
71
+ }
72
+ catch {
73
+ // Skip malformed lines
74
+ }
75
+ }
76
+ }
77
+ return events;
78
+ }
79
+ /**
80
+ * Generate an audit summary for a date range.
81
+ */
82
+ export async function generateAuditSummary(logDir, from, to) {
83
+ const events = await readAuditEvents(logDir, { from, to });
84
+ const violations = events.filter((e) => e.event_type === "policy_violation");
85
+ const completions = events.filter((e) => e.event_type === "completion_check");
86
+ const sessions = events.filter((e) => e.event_type === "session_end");
87
+ // Count violations by rule
88
+ const violationCounts = new Map();
89
+ for (const v of violations) {
90
+ const key = v.rule_description;
91
+ violationCounts.set(key, (violationCounts.get(key) ?? 0) + 1);
92
+ }
93
+ const topViolations = [...violationCounts.entries()]
94
+ .sort((a, b) => b[1] - a[1])
95
+ .slice(0, 10)
96
+ .map(([rule, count]) => ({ rule, count }));
97
+ return {
98
+ period: { from, to },
99
+ total_events: events.length,
100
+ tool_calls: events.filter((e) => e.event_type === "tool_call").length,
101
+ policy_violations: violations.length,
102
+ completion_checks: {
103
+ pass: completions.filter((c) => c.result === "pass").length,
104
+ fail: completions.filter((c) => c.result === "fail").length,
105
+ },
106
+ sessions: {
107
+ total: sessions.length,
108
+ success: sessions.filter((s) => s.outcome === "success").length,
109
+ failure: sessions.filter((s) => s.outcome === "failure").length,
110
+ },
111
+ top_violations: topViolations,
112
+ };
113
+ }
114
+ /**
115
+ * Render audit summary as markdown.
116
+ */
117
+ export function renderAuditReport(summary) {
118
+ const lines = [];
119
+ lines.push(`# Agent Audit Report`);
120
+ lines.push(`Period: ${summary.period.from} to ${summary.period.to}\n`);
121
+ lines.push(`## Overview`);
122
+ lines.push(`| Metric | Value |`);
123
+ lines.push(`|--------|-------|`);
124
+ lines.push(`| Total events | ${summary.total_events} |`);
125
+ lines.push(`| Tool calls | ${summary.tool_calls} |`);
126
+ lines.push(`| Policy violations | ${summary.policy_violations} |`);
127
+ lines.push(`| Completion checks (pass) | ${summary.completion_checks.pass} |`);
128
+ lines.push(`| Completion checks (fail) | ${summary.completion_checks.fail} |`);
129
+ lines.push(`| Sessions | ${summary.sessions.total} |`);
130
+ lines.push(`| Sessions (success) | ${summary.sessions.success} |`);
131
+ lines.push(`| Sessions (failure) | ${summary.sessions.failure} |`);
132
+ lines.push("");
133
+ if (summary.top_violations.length > 0) {
134
+ lines.push(`## Top Policy Violations`);
135
+ lines.push(`| Rule | Count |`);
136
+ lines.push(`|------|-------|`);
137
+ for (const v of summary.top_violations) {
138
+ lines.push(`| ${v.rule} | ${v.count} |`);
139
+ }
140
+ lines.push("");
141
+ }
142
+ return lines.join("\n");
143
+ }
144
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/audit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqFjC,8DAA8D;AAE9D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,KAAiB,EACjB,MAAmB;IAEnB,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO;IAE5B,wCAAwC;IACxC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;QAAE,OAAO;IAExC,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa;IACxD,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;IAC9B,MAAM,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,QAAQ,CAAC,CAAC;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAC1C,MAAM,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,WAAW,CAAC,KAAiB,EAAE,MAAmB;IACzD,MAAM,WAAW,GAA6C;QAC5D,SAAS,EAAE,YAAY;QACvB,YAAY,EAAE,YAAY;QAC1B,gBAAgB,EAAE,mBAAmB;QACrC,gBAAgB,EAAE,mBAAmB;QACrC,aAA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AI,CAAC,kBAAkB,CAAC,CAAC;QAC/B,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QAC3C,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * dna compile <files...> [--target claude-sdk] [--context <name>] [--output <path>] [--ir]
3
+ *
4
+ * Compile DNA files to framework-specific configuration.
5
+ */
6
+ export interface CompileOptions {
7
+ files: string[];
8
+ target: string;
9
+ context?: string;
10
+ output?: string;
11
+ ir: boolean;
12
+ }
13
+ export declare function runCompile(opts: CompileOptions): Promise<number>;
14
+ //# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/compile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;CACb;AA+CD,wBAAsB,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoCtE"}