agentloopkit 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 (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +240 -0
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.js +1144 -0
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/schema/agentloop.config.schema.json +142 -0
  7. package/dist/templates/agents/claude-code.md +18 -0
  8. package/dist/templates/agents/codex.md +27 -0
  9. package/dist/templates/agents/cursor.md +17 -0
  10. package/dist/templates/agents/gemini-cli.md +19 -0
  11. package/dist/templates/agents/generic.md +27 -0
  12. package/dist/templates/agents/github-copilot-cli.md +18 -0
  13. package/dist/templates/agents/opencode.md +18 -0
  14. package/dist/templates/gates/dependency-gate.md +24 -0
  15. package/dist/templates/gates/docs-gate.md +24 -0
  16. package/dist/templates/gates/implementation-gate.md +28 -0
  17. package/dist/templates/gates/regression-gate.md +25 -0
  18. package/dist/templates/gates/review-gate.md +24 -0
  19. package/dist/templates/gates/security-gate.md +26 -0
  20. package/dist/templates/gates/test-gate.md +24 -0
  21. package/dist/templates/handoffs/decision-log.md +13 -0
  22. package/dist/templates/handoffs/pr-summary.md +36 -0
  23. package/dist/templates/handoffs/release-notes.md +15 -0
  24. package/dist/templates/handoffs/reviewer-brief.md +13 -0
  25. package/dist/templates/handoffs/rollback-plan.md +11 -0
  26. package/dist/templates/handoffs/verification-report.md +13 -0
  27. package/dist/templates/harness/autonomous-work-rules.md +22 -0
  28. package/dist/templates/harness/commands.md +16 -0
  29. package/dist/templates/harness/definition-of-done.md +16 -0
  30. package/dist/templates/harness/release-checklist.md +11 -0
  31. package/dist/templates/harness/repo-map.md +16 -0
  32. package/dist/templates/harness/review-checklist.md +9 -0
  33. package/dist/templates/harness/working-agreement.md +11 -0
  34. package/dist/templates/loops/bugfix.md +36 -0
  35. package/dist/templates/loops/dependency-upgrade.md +34 -0
  36. package/dist/templates/loops/docs.md +35 -0
  37. package/dist/templates/loops/feature.md +38 -0
  38. package/dist/templates/loops/migration.md +35 -0
  39. package/dist/templates/loops/refactor.md +35 -0
  40. package/dist/templates/loops/release.md +35 -0
  41. package/dist/templates/loops/security-review.md +35 -0
  42. package/dist/templates/loops/test-generation.md +34 -0
  43. package/dist/templates/policies/database-change-policy.md +11 -0
  44. package/dist/templates/policies/dependency-change-policy.md +11 -0
  45. package/dist/templates/policies/git-policy.md +11 -0
  46. package/dist/templates/policies/no-destructive-actions.md +17 -0
  47. package/dist/templates/policies/public-api-change-policy.md +11 -0
  48. package/dist/templates/policies/secrets-policy.md +11 -0
  49. package/dist/templates/policies/security-policy.md +11 -0
  50. package/dist/templates/policies/ui-change-policy.md +11 -0
  51. package/dist/templates/root/AGENTLOOP.md +39 -0
  52. package/dist/templates/root/AGENTS.md +24 -0
  53. package/dist/templates/root/agentloop-directory-readme.md +36 -0
  54. package/dist/templates/root/agentloop.config.json +37 -0
  55. package/dist/templates/tasks/README.md +9 -0
  56. package/package.json +71 -0
  57. package/schema/agentloop.config.schema.json +142 -0
@@ -0,0 +1,39 @@
1
+ # AgentLoopKit
2
+
3
+ AgentLoopKit gives coding agents a repeatable engineering loop inside this repo.
4
+
5
+ ## Loop
6
+
7
+ 1. Specify: turn the request into a task contract with outcome, constraints, non-goals, likely files, and files not to touch.
8
+ 2. Constrain: define safety rules, dependency rules, verification commands, and rollback notes.
9
+ 3. Plan: inspect relevant files, identify risks, and write a short implementation plan.
10
+ 4. Implement: make focused changes and avoid unrelated formatting churn.
11
+ 5. Verify: run configured checks and capture pass or fail results.
12
+ 6. Review: inspect the diff against the task contract and identify risks.
13
+ 7. Handoff: summarize changed files, verification, risks, rollback notes, and reviewer checklist.
14
+
15
+ ## Repo Layout
16
+
17
+ - .agentloop/loops/: workflow templates for different task types.
18
+ - .agentloop/gates/: checklists for implementation, tests, review, regression, docs, security, and dependencies.
19
+ - .agentloop/policies/: practical safety policies for agents.
20
+ - .agentloop/tasks/: task contracts for agentic coding sessions.
21
+ - .agentloop/reports/: verification reports generated by `agentloop verify`.
22
+ - .agentloop/handoffs/: PR summaries and reviewer handoffs.
23
+ - .agentloop/harness/: repo-specific working agreement, commands, and checklists.
24
+
25
+ ## Commands Detected During Init
26
+
27
+ - Package manager: {{ packageManager }}
28
+ - Project type: {{ projectType }}
29
+ - Test: {{ testCommand }}
30
+ - Lint: {{ lintCommand }}
31
+ - Typecheck: {{ typecheckCommand }}
32
+ - Build: {{ buildCommand }}
33
+ - Format: {{ formatCommand }}
34
+
35
+ ## Autonomous Work
36
+
37
+ Agents may work autonomously inside the task contract. They should stop and ask before changing protected areas, adding dependencies, introducing breaking public APIs, or taking destructive actions.
38
+
39
+ No agent should claim completion without verification evidence or a clear statement of what was not verified.
@@ -0,0 +1,24 @@
1
+ # AGENTS
2
+
3
+ <!-- agentloopkit:start -->
4
+
5
+ This repository uses AgentLoopKit.
6
+
7
+ Before changing code:
8
+
9
+ - Read AGENTLOOP.md.
10
+ - Check .agentloop/tasks/ for an active task contract.
11
+ - Follow the Specify, Constrain, Plan, Implement, Verify, Review, Handoff loop.
12
+ - Keep changes small and tied to the task contract.
13
+ - Do not run destructive git or filesystem commands unless the user asks for them.
14
+ - Do not read or print secrets. If env files exist, mention only their paths.
15
+ - Run the configured verification commands before claiming completion.
16
+ - Generate a handoff summary with changed files, tests run, risks, and rollback notes.
17
+
18
+ Safety rules:
19
+
20
+ - Treat migrations, auth, billing, deployment, lockfiles, public APIs, and security code as high-risk.
21
+ - Do not change dependencies without a clear reason and verification plan.
22
+ - Preserve existing user work. Do not revert unrelated changes.
23
+ - Update DECISIONS.md when architecture or public behavior changes.
24
+ <!-- agentloopkit:end -->
@@ -0,0 +1,36 @@
1
+ # AgentLoopKit Workspace
2
+
3
+ This directory contains repo-local engineering loop artifacts for coding agents and reviewers.
4
+
5
+ ## Start Here
6
+
7
+ 1. Read `../AGENTS.md`.
8
+ 2. Read `../AGENTLOOP.md`.
9
+ 3. Create or inspect a task contract:
10
+
11
+ ```bash
12
+ agentloop create-task --title "Describe the next focused change" --type feature
13
+ ```
14
+
15
+ 4. Run verification when work is ready:
16
+
17
+ ```bash
18
+ agentloop verify
19
+ ```
20
+
21
+ 5. Generate a reviewer handoff:
22
+
23
+ ```bash
24
+ agentloop summarize --write
25
+ ```
26
+
27
+ ## Directories
28
+
29
+ - `loops/`: task-specific workflows
30
+ - `gates/`: pass/fail checklists
31
+ - `policies/`: safety rules
32
+ - `tasks/`: task contracts
33
+ - `reports/`: verification reports
34
+ - `handoffs/`: PR summaries and reviewer briefs
35
+ - `agents/`: agent-specific instructions
36
+ - `harness/`: repo working agreement and commands
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://agentloopkit.dev/schema/agentloop.config.schema.json",
3
+ "version": 1,
4
+ "project": {
5
+ "name": "{{ projectName }}",
6
+ "type": "{{ projectType }}",
7
+ "packageManager": "{{ packageManager }}"
8
+ },
9
+ "paths": {
10
+ "root": ".",
11
+ "agentloopDir": ".agentloop",
12
+ "tasksDir": ".agentloop/tasks",
13
+ "reportsDir": ".agentloop/reports",
14
+ "handoffsDir": ".agentloop/handoffs"
15
+ },
16
+ "commands": {
17
+ "test": "",
18
+ "lint": "",
19
+ "typecheck": "",
20
+ "build": "",
21
+ "format": ""
22
+ },
23
+ "safety": {
24
+ "requireCleanWorkingTree": false,
25
+ "warnOnDirtyWorkingTree": true,
26
+ "protectEnvFiles": true,
27
+ "protectMigrations": true,
28
+ "protectLockfiles": false
29
+ },
30
+ "summary": {
31
+ "includeDiffStats": true,
32
+ "includeChangedFiles": true,
33
+ "includeVerification": true,
34
+ "includeRisks": true,
35
+ "includeRollback": true
36
+ }
37
+ }
@@ -0,0 +1,9 @@
1
+ # Task Contracts
2
+
3
+ Create task contracts with:
4
+
5
+ ```bash
6
+ agentloop create-task
7
+ ```
8
+
9
+ Task contracts turn fuzzy requests into scoped engineering work. A good contract names the desired outcome, constraints, non-goals, likely files, files not to touch, acceptance criteria, verification commands, and rollback notes.
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "agentloopkit",
3
+ "version": "0.1.0",
4
+ "description": "A drop-in engineering loop for coding agents.",
5
+ "type": "module",
6
+ "bin": {
7
+ "agentloop": "dist/cli/index.js",
8
+ "agentloopkit": "dist/cli/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "schema",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "keywords": [
17
+ "ai",
18
+ "agents",
19
+ "coding-agents",
20
+ "codex",
21
+ "claude-code",
22
+ "cursor",
23
+ "opencode",
24
+ "gemini-cli",
25
+ "agentic-engineering",
26
+ "vibe-coding",
27
+ "developer-tools",
28
+ "cli"
29
+ ],
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/abhiyoheswaran1/AgentLoopKit.git"
34
+ },
35
+ "homepage": "https://github.com/abhiyoheswaran1/AgentLoopKit#readme",
36
+ "bugs": {
37
+ "url": "https://github.com/abhiyoheswaran1/AgentLoopKit/issues"
38
+ },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
42
+ "packageManager": "pnpm@10.12.1",
43
+ "scripts": {
44
+ "build": "tsup && node scripts/copy-assets.mjs",
45
+ "dev": "tsx src/cli/index.ts",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest",
48
+ "typecheck": "tsc --noEmit",
49
+ "lint": "eslint .",
50
+ "format": "prettier --write .",
51
+ "prepublishOnly": "npm run typecheck && npm test && npm run build"
52
+ },
53
+ "dependencies": {
54
+ "commander": "^14.0.2",
55
+ "execa": "^9.6.0",
56
+ "prompts": "^2.4.2",
57
+ "zod": "^4.1.13"
58
+ },
59
+ "devDependencies": {
60
+ "@eslint/js": "^10.0.1",
61
+ "@types/node": "^25.0.0",
62
+ "@types/prompts": "^2.4.9",
63
+ "eslint": "^10.4.1",
64
+ "prettier": "^3.7.4",
65
+ "tsup": "^8.5.1",
66
+ "tsx": "^4.21.0",
67
+ "typescript": "^5.9.3",
68
+ "typescript-eslint": "^8.61.0",
69
+ "vitest": "^4.0.15"
70
+ }
71
+ }
@@ -0,0 +1,142 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://agentloopkit.dev/schema/agentloop.config.schema.json",
4
+ "title": "AgentLoopKit Configuration",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["version", "project", "paths", "commands", "safety", "summary"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "version": {
13
+ "const": 1
14
+ },
15
+ "project": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["name", "type", "packageManager"],
19
+ "properties": {
20
+ "name": {
21
+ "type": "string"
22
+ },
23
+ "type": {
24
+ "type": "string",
25
+ "enum": [
26
+ "nextjs",
27
+ "react-vite",
28
+ "node",
29
+ "typescript-package",
30
+ "python",
31
+ "docs-only",
32
+ "generic"
33
+ ]
34
+ },
35
+ "packageManager": {
36
+ "type": "string",
37
+ "enum": ["pnpm", "npm", "yarn", "bun"]
38
+ }
39
+ }
40
+ },
41
+ "paths": {
42
+ "type": "object",
43
+ "additionalProperties": false,
44
+ "required": ["root", "agentloopDir", "tasksDir", "reportsDir", "handoffsDir"],
45
+ "properties": {
46
+ "root": {
47
+ "type": "string"
48
+ },
49
+ "agentloopDir": {
50
+ "type": "string"
51
+ },
52
+ "tasksDir": {
53
+ "type": "string"
54
+ },
55
+ "reportsDir": {
56
+ "type": "string"
57
+ },
58
+ "handoffsDir": {
59
+ "type": "string"
60
+ }
61
+ }
62
+ },
63
+ "commands": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["test", "lint", "typecheck", "build", "format"],
67
+ "properties": {
68
+ "test": {
69
+ "type": "string"
70
+ },
71
+ "lint": {
72
+ "type": "string"
73
+ },
74
+ "typecheck": {
75
+ "type": "string"
76
+ },
77
+ "build": {
78
+ "type": "string"
79
+ },
80
+ "format": {
81
+ "type": "string"
82
+ }
83
+ }
84
+ },
85
+ "safety": {
86
+ "type": "object",
87
+ "additionalProperties": false,
88
+ "required": [
89
+ "requireCleanWorkingTree",
90
+ "warnOnDirtyWorkingTree",
91
+ "protectEnvFiles",
92
+ "protectMigrations",
93
+ "protectLockfiles"
94
+ ],
95
+ "properties": {
96
+ "requireCleanWorkingTree": {
97
+ "type": "boolean"
98
+ },
99
+ "warnOnDirtyWorkingTree": {
100
+ "type": "boolean"
101
+ },
102
+ "protectEnvFiles": {
103
+ "type": "boolean"
104
+ },
105
+ "protectMigrations": {
106
+ "type": "boolean"
107
+ },
108
+ "protectLockfiles": {
109
+ "type": "boolean"
110
+ }
111
+ }
112
+ },
113
+ "summary": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "includeDiffStats",
118
+ "includeChangedFiles",
119
+ "includeVerification",
120
+ "includeRisks",
121
+ "includeRollback"
122
+ ],
123
+ "properties": {
124
+ "includeDiffStats": {
125
+ "type": "boolean"
126
+ },
127
+ "includeChangedFiles": {
128
+ "type": "boolean"
129
+ },
130
+ "includeVerification": {
131
+ "type": "boolean"
132
+ },
133
+ "includeRisks": {
134
+ "type": "boolean"
135
+ },
136
+ "includeRollback": {
137
+ "type": "boolean"
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }