@aimlsuperagent/agent 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 (44) hide show
  1. package/AGENTS.md +86 -0
  2. package/CONTRIBUTING.md +31 -0
  3. package/DEPLOYMENT_LOG.md +39 -0
  4. package/LICENSE +21 -0
  5. package/README.md +253 -0
  6. package/REPO_SOURCE_OF_TRUTH.json +77 -0
  7. package/SAFE_ENV_AUDIT.md +12 -0
  8. package/SECURITY.md +32 -0
  9. package/WORKING_NOTES.md +27 -0
  10. package/adapters/claude/CLAUDE.md +27 -0
  11. package/adapters/codex/AGENTS.md +24 -0
  12. package/adapters/cursor/rules.md +12 -0
  13. package/bin/aiml-superagent.js +477 -0
  14. package/docs/01-operating-model.md +95 -0
  15. package/docs/02-context-minimizer.md +113 -0
  16. package/docs/03-project-memory.md +83 -0
  17. package/docs/04-verification-loop.md +82 -0
  18. package/docs/05-secret-safe-operations.md +63 -0
  19. package/docs/06-deployment-discipline.md +50 -0
  20. package/docs/07-note-hygiene.md +51 -0
  21. package/docs/08-model-agnostic-use.md +53 -0
  22. package/docs/09-agent-evaluation.md +95 -0
  23. package/docs/10-adoption-playbook.md +62 -0
  24. package/docs/11-anti-patterns.md +85 -0
  25. package/docs/12-context-budget.md +52 -0
  26. package/docs/comparison-claude-md.md +56 -0
  27. package/docs/npm-private-publishing.md +89 -0
  28. package/docs/release-checklist.md +42 -0
  29. package/examples/nextjs-vercel-app/AGENTS.md +26 -0
  30. package/examples/nextjs-vercel-app/DEPLOYMENT_LOG.md +13 -0
  31. package/examples/nextjs-vercel-app/README.md +12 -0
  32. package/examples/nextjs-vercel-app/REPO_SOURCE_OF_TRUTH.json +65 -0
  33. package/examples/nextjs-vercel-app/SAFE_ENV_AUDIT.md +9 -0
  34. package/examples/nextjs-vercel-app/WORKING_NOTES.md +16 -0
  35. package/package.json +57 -0
  36. package/schemas/repo-source-of-truth.schema.json +122 -0
  37. package/templates/AGENTS.template.md +42 -0
  38. package/templates/DEPLOYMENT_LOG.template.md +11 -0
  39. package/templates/INCIDENT_REPORT.template.md +26 -0
  40. package/templates/PRODUCTION_CHECK.template.md +24 -0
  41. package/templates/REPO_SOURCE_OF_TRUTH.template.json +57 -0
  42. package/templates/SAFE_ENV_AUDIT.template.md +8 -0
  43. package/templates/TASK_BRIEF.template.md +22 -0
  44. package/templates/WORKING_NOTES.template.md +18 -0
@@ -0,0 +1,83 @@
1
+ # Project Memory
2
+
3
+ AiML SuperAgent memory is not a transcript. It is an operating index.
4
+
5
+ ## Memory Types
6
+
7
+ ### Source Of Truth
8
+
9
+ File: `REPO_SOURCE_OF_TRUTH.json`
10
+
11
+ Stores stable facts:
12
+
13
+ - project name and purpose
14
+ - production owners
15
+ - deploy surfaces
16
+ - package manager
17
+ - default verification commands
18
+ - context minimizer rules
19
+ - secret policy
20
+
21
+ ### Working Notes
22
+
23
+ File: `WORKING_NOTES.md`
24
+
25
+ Stores current durable facts:
26
+
27
+ - active architecture decisions
28
+ - recent production findings
29
+ - unresolved risks
30
+ - test devices or accounts
31
+ - known temporary workarounds
32
+
33
+ ### Deployment Log
34
+
35
+ File: `DEPLOYMENT_LOG.md`
36
+
37
+ Stores:
38
+
39
+ - deployed version
40
+ - date
41
+ - environment
42
+ - URL or platform
43
+ - verification result
44
+ - rollback note
45
+
46
+ ### Incident Reports
47
+
48
+ File: `INCIDENT_REPORT.md` or dated files under `incidents/`
49
+
50
+ Stores only incidents that change future behavior.
51
+
52
+ ### Safe Environment Audit
53
+
54
+ File: `SAFE_ENV_AUDIT.md`
55
+
56
+ Stores env var names, roles, owners, and expected environments. Never store values.
57
+
58
+ ## Memory Quality Test
59
+
60
+ A note is worth keeping if it helps answer one of these:
61
+
62
+ - Which repo owns production?
63
+ - Which backend is live?
64
+ - Which env var is still active?
65
+ - Which failure was already fixed?
66
+ - Which command proves the current behavior?
67
+ - Which files are dangerous to edit blindly?
68
+
69
+ If not, archive or delete it.
70
+
71
+ ## Staleness Policy
72
+
73
+ Every durable fact should be easy to challenge.
74
+
75
+ Use labels:
76
+
77
+ - `verified`
78
+ - `assumed`
79
+ - `deprecated`
80
+ - `needs-check`
81
+
82
+ Do not let assumptions age into facts.
83
+
@@ -0,0 +1,82 @@
1
+ # Verification Loop
2
+
3
+ AiML SuperAgent treats verification as part of implementation, not an optional afterthought.
4
+
5
+ ## Verification Hierarchy
6
+
7
+ Use the cheapest proof that meaningfully reduces risk.
8
+
9
+ 1. Static check
10
+ 2. Unit or focused test
11
+ 3. Build
12
+ 4. Local smoke test
13
+ 5. Staging probe
14
+ 6. Production read-only probe
15
+ 7. Production mutation test with approval
16
+
17
+ ## Production-First Verification
18
+
19
+ Verify production reality before code changes when the issue depends on:
20
+
21
+ - deployed environment variables
22
+ - external APIs
23
+ - app store metadata
24
+ - browser behavior
25
+ - cloud routing
26
+ - database schema
27
+ - background jobs
28
+ - push notification credentials
29
+ - live webhooks
30
+
31
+ The repo can be correct while production is wrong.
32
+
33
+ ## Proof Statement
34
+
35
+ Every completed task should end with a proof statement:
36
+
37
+ ```text
38
+ Verified with:
39
+ - npm run build
40
+ - curl -sSI https://example.com/route returned 200
41
+ ```
42
+
43
+ If not verified:
44
+
45
+ ```text
46
+ Not verified because:
47
+ - device was not connected
48
+ - credentials were not available
49
+ - network access was blocked
50
+ ```
51
+
52
+ ## Avoid False Proof
53
+
54
+ Do not claim success from:
55
+
56
+ - code inspection only
57
+ - unrelated tests
58
+ - old logs
59
+ - successful deploy without route check
60
+ - local build when the bug was production configuration
61
+
62
+ ## Fast Proof Examples
63
+
64
+ Next.js route:
65
+
66
+ ```bash
67
+ npm run build
68
+ curl -sSI https://example.com/api/health
69
+ ```
70
+
71
+ Database migration:
72
+
73
+ ```bash
74
+ node scripts/validate-schema.mjs
75
+ ```
76
+
77
+ CLI script:
78
+
79
+ ```bash
80
+ node bin/aiml-superagent.js check .
81
+ ```
82
+
@@ -0,0 +1,63 @@
1
+ # Secret-Safe Operations
2
+
3
+ AiML SuperAgent requires secret-safe memory.
4
+
5
+ Agents need to know which credentials exist and what they do. They do not need credential values in notes.
6
+
7
+ ## Allowed
8
+
9
+ - variable names
10
+ - credential role
11
+ - service owner
12
+ - environment scope
13
+ - rotation date
14
+ - where to update the value
15
+ - placeholder examples
16
+
17
+ Example:
18
+
19
+ ```text
20
+ OPENAI_API_KEY
21
+ Role: server-side model calls
22
+ Environments: production, preview
23
+ Owner: platform
24
+ Value: never stored in repo
25
+ ```
26
+
27
+ ## Forbidden
28
+
29
+ - actual API keys
30
+ - database URLs with passwords
31
+ - private keys
32
+ - access tokens
33
+ - refresh tokens
34
+ - production passwords
35
+ - customer PII
36
+ - password hashes tied to real users
37
+
38
+ ## Redaction Pattern
39
+
40
+ Use this form:
41
+
42
+ ```text
43
+ sk-...abcd
44
+ postgres://USER@HOST/DB
45
+ CR...1234
46
+ ```
47
+
48
+ ## Environment Audits
49
+
50
+ Use `SAFE_ENV_AUDIT.md` to record:
51
+
52
+ - env var name
53
+ - expected environment
54
+ - role
55
+ - source of truth
56
+ - stale duplicate risk
57
+ - verification date
58
+
59
+ Never paste values.
60
+
61
+ ## Agent Rule
62
+
63
+ If a user gives a secret in chat or terminal, use it only for the immediate task when necessary. Do not write it to durable notes, examples, commit messages, logs, or documentation.
@@ -0,0 +1,50 @@
1
+ # Deployment Discipline
2
+
3
+ Long-running agent work fails when deployment state is vague.
4
+
5
+ AiML SuperAgent records deployments as operational facts.
6
+
7
+ ## Deployment Log Fields
8
+
9
+ Each deployment entry should include:
10
+
11
+ - date and time
12
+ - environment
13
+ - platform
14
+ - commit or build ID
15
+ - changed behavior
16
+ - verification command
17
+ - rollback note
18
+ - open risks
19
+
20
+ ## Deployment Entry
21
+
22
+ ```text
23
+ ## 2026-05-31 - Production
24
+
25
+ Platform: Vercel
26
+ Commit: abc1234
27
+ Change: Added /api/health route.
28
+ Verify: curl -sSI https://example.com/api/health returned 200.
29
+ Rollback: redeploy previous production deployment.
30
+ Risks: none known.
31
+ ```
32
+
33
+ ## Deploy Before Or After Notes?
34
+
35
+ Update the deployment log after verification, not before.
36
+
37
+ Do not record planned deployments as completed deployments.
38
+
39
+ ## Release Gates
40
+
41
+ Before public release:
42
+
43
+ - checker passes
44
+ - no secrets in repo
45
+ - README quick start works
46
+ - examples are fictional or sanitized
47
+ - license is intentional
48
+ - public/private repo state is intentional
49
+ - deployment target is documented
50
+
@@ -0,0 +1,51 @@
1
+ # Note Hygiene
2
+
3
+ Notes are useful only when they reduce future work.
4
+
5
+ ## Keep
6
+
7
+ - durable project facts
8
+ - surprising production behavior
9
+ - deployment history
10
+ - incident outcomes
11
+ - known stale credentials
12
+ - exact verification commands
13
+ - decisions that prevent future mistakes
14
+
15
+ ## Remove Or Archive
16
+
17
+ - resolved logs
18
+ - speculative guesses
19
+ - duplicate notes
20
+ - stale TODOs
21
+ - one-off command output
22
+ - old screenshots
23
+ - copied documentation
24
+
25
+ ## Compression Pattern
26
+
27
+ Turn raw logs into a useful memory:
28
+
29
+ ```text
30
+ Observed:
31
+ Route /api/catalog/sync returned 413 for large payloads.
32
+
33
+ Cause:
34
+ Payload exceeded platform body limit.
35
+
36
+ Fix:
37
+ Chunk upload into product batches.
38
+
39
+ Verified:
40
+ 227 products and 1068 variants synced on 2026-05-31.
41
+ ```
42
+
43
+ ## Note Review Cadence
44
+
45
+ For active projects:
46
+
47
+ - review `WORKING_NOTES.md` weekly
48
+ - archive resolved incidents monthly
49
+ - update `REPO_SOURCE_OF_TRUTH.json` whenever production ownership changes
50
+ - prune logs as soon as they stop helping
51
+
@@ -0,0 +1,53 @@
1
+ # Model-Agnostic Use
2
+
3
+ AiML SuperAgent is not tied to one model or vendor.
4
+
5
+ The framework can be used with:
6
+
7
+ - Claude
8
+ - GPT-5.5
9
+ - Codex
10
+ - Cursor
11
+ - Perplexity
12
+ - Gemini
13
+ - local models
14
+ - future coding assistants
15
+
16
+ ## Why Model-Agnostic Matters
17
+
18
+ Models change quickly. Project operation should not.
19
+
20
+ The stable layer should be:
21
+
22
+ - memory structure
23
+ - verification loop
24
+ - secret policy
25
+ - deployment discipline
26
+ - note hygiene
27
+ - context minimization
28
+
29
+ ## Adapter Pattern
30
+
31
+ Different tools can read different files:
32
+
33
+ - `AGENTS.md` for general coding agents
34
+ - `CLAUDE.md` for Claude-specific behavior
35
+ - `.cursor/rules` for Cursor
36
+ - local skill files for specialized workflows
37
+
38
+ AiML SuperAgent can generate or coexist with those files. The source of truth remains the project memory, not the vendor-specific wrapper.
39
+
40
+ ## Prompt Starter
41
+
42
+ Use this with any coding assistant:
43
+
44
+ ```text
45
+ Follow AiML SuperAgent for this task.
46
+ Read AGENTS.md, REPO_SOURCE_OF_TRUTH.json, and only the relevant working notes.
47
+ Use targeted search before loading broad folders.
48
+ Verify production reality when the task depends on live state.
49
+ Make the smallest safe diff.
50
+ Run the fastest meaningful proof.
51
+ Update durable notes only if reality changed.
52
+ ```
53
+
@@ -0,0 +1,95 @@
1
+ # Agent Evaluation
2
+
3
+ AiML SuperAgent should be evaluated by operational behavior, not by how impressive the response sounds.
4
+
5
+ ## Evaluation Dimensions
6
+
7
+ ### Context Discipline
8
+
9
+ Good:
10
+
11
+ - reads source-of-truth files first
12
+ - searches before loading broad folders
13
+ - avoids generated files and stale logs
14
+ - summarizes long proof output
15
+
16
+ Bad:
17
+
18
+ - opens unrelated files
19
+ - loads old notes without checking relevance
20
+ - pastes logs into durable memory
21
+ - assumes the current repo owns production
22
+
23
+ ### Production Awareness
24
+
25
+ Good:
26
+
27
+ - verifies live URLs, deployed env names, current schema, or current package versions when relevant
28
+ - distinguishes repo state from production state
29
+ - records the proof after verification
30
+
31
+ Bad:
32
+
33
+ - says a change is fixed because code looks right
34
+ - trusts old deployment notes
35
+ - ignores hosted configuration
36
+
37
+ ### Diff Quality
38
+
39
+ Good:
40
+
41
+ - small patch
42
+ - no unrelated refactors
43
+ - changed lines trace to the task
44
+ - existing style is preserved
45
+
46
+ Bad:
47
+
48
+ - broad cleanup during bug fix
49
+ - rewrites working code without proof
50
+ - changes public behavior outside scope
51
+
52
+ ### Memory Quality
53
+
54
+ Good:
55
+
56
+ - records only durable facts
57
+ - marks assumptions
58
+ - archives resolved incidents
59
+ - removes stale facts
60
+
61
+ Bad:
62
+
63
+ - notes become a transcript
64
+ - secrets appear in memory
65
+ - temporary guesses become permanent facts
66
+
67
+ ## Simple Scorecard
68
+
69
+ | Dimension | 0 | 1 | 2 |
70
+ | --- | --- | --- | --- |
71
+ | Context discipline | Loads broadly | Some targeting | Minimal targeted context |
72
+ | Production awareness | Assumes | Checks sometimes | Verifies when live state matters |
73
+ | Diff quality | Broad | Mostly focused | Small and traceable |
74
+ | Memory quality | Noisy | Useful but stale risk | Durable and compressed |
75
+ | Secret safety | Unsafe | Manual caution | Explicit policy and checks |
76
+
77
+ Target score: 8 or higher out of 10.
78
+
79
+ ## Test Task Pattern
80
+
81
+ Use tasks that include ambiguity:
82
+
83
+ ```text
84
+ Production route is returning 404. Fix it.
85
+ ```
86
+
87
+ A good agent should:
88
+
89
+ 1. identify the likely route owner
90
+ 2. verify production route behavior
91
+ 3. inspect only relevant route/config files
92
+ 4. patch the smallest diff
93
+ 5. build or probe
94
+ 6. record the production fact if it changed
95
+
@@ -0,0 +1,62 @@
1
+ # Adoption Playbook
2
+
3
+ AiML SuperAgent can be adopted gradually.
4
+
5
+ ## Phase 1: Add Operating Files
6
+
7
+ Add:
8
+
9
+ - `AGENTS.md`
10
+ - `REPO_SOURCE_OF_TRUTH.json`
11
+ - `WORKING_NOTES.md`
12
+
13
+ Run:
14
+
15
+ ```bash
16
+ node bin/aiml-superagent.js check .
17
+ ```
18
+
19
+ Replace every placeholder before relying on the output.
20
+
21
+ ## Phase 2: Add Verification
22
+
23
+ Define the fastest meaningful proof commands:
24
+
25
+ - typecheck
26
+ - build
27
+ - unit test
28
+ - smoke probe
29
+ - read-only production check
30
+
31
+ Store them in `REPO_SOURCE_OF_TRUTH.json`.
32
+
33
+ ## Phase 3: Add Deployment Memory
34
+
35
+ Add:
36
+
37
+ - `DEPLOYMENT_LOG.md`
38
+ - `SAFE_ENV_AUDIT.md`
39
+
40
+ Record only verified deployments. Do not record planned deployments as completed.
41
+
42
+ ## Phase 4: Add Tool Adapters
43
+
44
+ Use adapter files for each assistant:
45
+
46
+ - `adapters/claude/CLAUDE.md`
47
+ - `adapters/codex/AGENTS.md`
48
+ - `adapters/cursor/rules.md`
49
+
50
+ Keep the project source of truth centralized. Vendor-specific files should be thin wrappers.
51
+
52
+ ## Phase 5: Maintain Notes
53
+
54
+ Review notes regularly:
55
+
56
+ - archive resolved incidents
57
+ - compress long logs
58
+ - remove stale facts
59
+ - mark assumptions explicitly
60
+
61
+ The framework fails if notes become a junk drawer.
62
+
@@ -0,0 +1,85 @@
1
+ # Anti-Patterns
2
+
3
+ AiML SuperAgent exists to prevent common long-running agent failures.
4
+
5
+ ## Giant Prompt Syndrome
6
+
7
+ The assistant receives every rule, every note, every log, and every file.
8
+
9
+ Result:
10
+
11
+ - slow reasoning
12
+ - higher cost
13
+ - stale assumptions
14
+ - lower precision
15
+
16
+ Fix:
17
+
18
+ - read durable memory first
19
+ - search for task-specific context
20
+ - summarize proof output
21
+
22
+ ## Transcript Memory
23
+
24
+ Working notes become a chronological chat transcript.
25
+
26
+ Result:
27
+
28
+ - important facts buried
29
+ - contradictions accumulate
30
+ - old incidents keep resurfacing
31
+
32
+ Fix:
33
+
34
+ - record conclusions, not conversations
35
+ - archive resolved incidents
36
+ - mark stale facts
37
+
38
+ ## Production Blindness
39
+
40
+ The assistant treats the repo as the whole system.
41
+
42
+ Result:
43
+
44
+ - wrong backend patched
45
+ - env var mismatch missed
46
+ - hosted config ignored
47
+ - deployment assumed but not verified
48
+
49
+ Fix:
50
+
51
+ - verify production reality when live state matters
52
+ - record deploy surfaces
53
+ - keep env audits secret-safe
54
+
55
+ ## Helpful Refactor Drift
56
+
57
+ The assistant improves adjacent code while fixing a narrow issue.
58
+
59
+ Result:
60
+
61
+ - hard-to-review diffs
62
+ - regressions
63
+ - merge conflicts
64
+
65
+ Fix:
66
+
67
+ - changed lines must trace to the task
68
+ - mention unrelated cleanup instead of doing it
69
+
70
+ ## Secret Memory
71
+
72
+ The assistant saves credential values to notes for convenience.
73
+
74
+ Result:
75
+
76
+ - leaked secrets
77
+ - unsafe examples
78
+ - polluted commit history
79
+
80
+ Fix:
81
+
82
+ - store names and roles only
83
+ - use placeholders
84
+ - run the checker before release
85
+
@@ -0,0 +1,52 @@
1
+ # Context Budget
2
+
3
+ Context is a budget, not a warehouse.
4
+
5
+ AiML SuperAgent expects the assistant to spend context deliberately.
6
+
7
+ ## Default Budget
8
+
9
+ For most tasks:
10
+
11
+ | Layer | Budget |
12
+ | --- | --- |
13
+ | Operating files | 3 files |
14
+ | Source files | 1 to 6 files |
15
+ | Logs | shortest relevant excerpt |
16
+ | Tests/proof | summarized output |
17
+ | Notes update | only durable facts |
18
+
19
+ ## Escalation
20
+
21
+ Load more context only when:
22
+
23
+ - the first targeted search fails
24
+ - the dependency graph requires it
25
+ - tests show a wider regression
26
+ - the user asks for broad review
27
+ - architecture-level changes are explicitly requested
28
+
29
+ ## Compression Rules
30
+
31
+ Compress before saving:
32
+
33
+ - logs longer than one screen
34
+ - repeated errors
35
+ - deployment output
36
+ - browser console dumps
37
+ - stack traces after the root cause is known
38
+
39
+ ## Budget Failure Signals
40
+
41
+ The assistant is likely over budget if it:
42
+
43
+ - repeatedly reopens the same files
44
+ - references unrelated history
45
+ - edits broad areas without a narrow proof
46
+ - loses track of which repo or deployment is active
47
+ - cannot explain why a file is in context
48
+
49
+ ## Practical Rule
50
+
51
+ If a file cannot plausibly affect the current task, do not load it yet.
52
+