@buba_71/levit 0.3.4 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +192 -7
- package/dist/bin/cli.js +67 -24
- package/dist/src/commands/decision.js +74 -0
- package/dist/src/commands/feature.js +159 -0
- package/dist/src/commands/handoff.js +71 -0
- package/dist/src/commands/index.js +13 -0
- package/dist/src/commands/init.js +53 -39
- package/dist/src/commands/validate.js +84 -0
- package/dist/src/core/cli_args.js +35 -0
- package/dist/src/core/error_helper.js +93 -0
- package/dist/src/core/errors.js +25 -0
- package/dist/src/core/frontmatter.js +62 -0
- package/dist/src/core/ids.js +34 -0
- package/dist/src/core/levit_project.js +30 -0
- package/dist/src/core/logger.js +77 -0
- package/dist/src/core/table.js +63 -0
- package/dist/src/core/write_file.js +15 -0
- package/dist/src/init.js +9 -0
- package/dist/src/readers/decision_reader.js +47 -0
- package/dist/src/readers/feature_reader.js +48 -0
- package/dist/src/readers/handoff_reader.js +47 -0
- package/dist/src/services/decision_service.js +49 -0
- package/dist/src/services/feature_service.js +89 -0
- package/dist/src/services/handoff_service.js +37 -0
- package/dist/src/services/manifest_service.js +89 -0
- package/dist/src/services/project_service.js +39 -0
- package/dist/src/services/validation_service.js +461 -0
- package/dist/src/types/domain.js +2 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/manifest.js +26 -0
- package/dist/tests/cli/integration.test.js +165 -0
- package/dist/tests/services/decision_service.test.js +27 -0
- package/dist/tests/services/feature_service.test.js +42 -0
- package/dist/tests/services/handoff_service.test.js +28 -0
- package/dist/tests/services/manifest_service.test.js +189 -0
- package/dist/tests/services/validation_service.test.js +196 -0
- package/package.json +7 -2
- package/templates/default/.github/workflows/README.md +56 -0
- package/templates/default/.github/workflows/levit-validate.yml +93 -0
- package/templates/default/.gitlab-ci.yml +73 -0
- package/templates/default/.levit/AGENT_CONTRACT.md +34 -0
- package/templates/default/.levit/AGENT_ONBOARDING.md +29 -0
- package/templates/default/.levit/evals/README.md +14 -0
- package/templates/default/.levit/evals/conformance.eval.ts +16 -0
- package/templates/default/.levit/features/INTENT.md +32 -0
- package/templates/default/.levit/features/README.md +11 -0
- package/templates/default/.levit/handoff/.gitkeep +0 -0
- package/templates/default/.levit/prompts/global-rules.md +10 -0
- package/templates/default/.levit/prompts/refactoring-guidelines.md +9 -0
- package/templates/default/.levit/workflows/example-task.md +9 -0
- package/templates/default/.levit/workflows/submit-for-review.md +18 -0
- package/templates/default/HUMAN_AGENT_MANAGER.md +654 -0
- package/templates/default/MIGRATION_GUIDE.md +597 -0
- package/templates/default/README.md +49 -11
- package/templates/default/SOCIAL_CONTRACT.md +5 -0
- package/templates/symfony/.github/workflows/README.md +56 -0
- package/templates/symfony/.github/workflows/levit-validate.yml +82 -0
- package/templates/symfony/.gitlab-ci.yml +62 -0
- package/templates/symfony/.levit/AGENT_CONTRACT.md +34 -0
- package/templates/symfony/.levit/AGENT_ONBOARDING.md +124 -0
- package/templates/symfony/.levit/decisions/.gitkeep +0 -0
- package/templates/symfony/.levit/features/INTENT.md +32 -0
- package/templates/symfony/.levit/features/README.md +11 -0
- package/templates/symfony/.levit/handoff/.gitkeep +0 -0
- package/templates/symfony/.levit/prompts/global-rules.md +10 -0
- package/templates/symfony/.levit/prompts/refactoring-guidelines.md +9 -0
- package/templates/symfony/.levit/workflows/example-task.md +9 -0
- package/templates/symfony/.levit/workflows/submit-for-review.md +18 -0
- package/templates/symfony/HUMAN_AGENT_MANAGER.md +654 -0
- package/templates/symfony/MIGRATION_GUIDE.md +597 -0
- package/templates/symfony/README.md +101 -0
- package/templates/symfony/SOCIAL_CONTRACT.md +34 -0
- package/dist/tests/init.test.js +0 -58
- package/templates/default/features/README.md +0 -12
- /package/templates/default/{agents → .levit/agents}/AGENTS.md +0 -0
- /package/templates/default/{agents → .levit/agents}/boundaries.md +0 -0
- /package/templates/default/{package.json → .levit/decisions/.gitkeep} +0 -0
- /package/templates/default/{docs → .levit/docs}/architecture.md +0 -0
- /package/templates/default/{pipelines → .levit/pipelines}/README.md +0 -0
- /package/templates/default/{roles → .levit/roles}/README.md +0 -0
- /package/templates/default/{roles → .levit/roles}/devops.md +0 -0
- /package/templates/default/{roles → .levit/roles}/qa.md +0 -0
- /package/templates/default/{roles → .levit/roles}/security.md +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Project Social Contract
|
|
2
|
+
|
|
3
|
+
This Symfony project follows the levit-kit social contract.
|
|
4
|
+
|
|
5
|
+
## Principles
|
|
6
|
+
|
|
7
|
+
- Humans remain responsible for decisions
|
|
8
|
+
- Agents are assistants, not decision-makers
|
|
9
|
+
- Structure is explicit
|
|
10
|
+
- Conventions are preferred over configuration
|
|
11
|
+
- **Agents (AI) are onboarded through specific protocols**
|
|
12
|
+
- **Symfony conventions are respected**
|
|
13
|
+
|
|
14
|
+
## Agent (AI) Role
|
|
15
|
+
|
|
16
|
+
This project is AI-friendly. Agents must follow the instructions located in `.levit/AGENT_ONBOARDING.md`.
|
|
17
|
+
|
|
18
|
+
When working with Symfony:
|
|
19
|
+
- Follow PSR-12 coding standards
|
|
20
|
+
- Use Symfony best practices (dependency injection, service autowiring)
|
|
21
|
+
- Respect Doctrine ORM conventions
|
|
22
|
+
- Write PHPUnit tests for new features
|
|
23
|
+
- Use Symfony Console for CLI commands
|
|
24
|
+
|
|
25
|
+
## What this project does not do
|
|
26
|
+
|
|
27
|
+
- No hidden automation
|
|
28
|
+
- No implicit decisions
|
|
29
|
+
- No enforced workflow
|
|
30
|
+
- No framework magic without documentation
|
|
31
|
+
|
|
32
|
+
This contract exists to preserve clarity over time.
|
|
33
|
+
|
|
34
|
+
|
package/dist/tests/init.test.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_test_1 = __importDefault(require("node:test"));
|
|
7
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
11
|
-
const node_child_process_1 = require("node:child_process");
|
|
12
|
-
const init_1 = require("../src/commands/init");
|
|
13
|
-
function exists(p) {
|
|
14
|
-
return node_fs_1.default.existsSync(p);
|
|
15
|
-
}
|
|
16
|
-
(0, node_test_1.default)("levit init copies default template exactly", () => {
|
|
17
|
-
const tempDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), "levit-kit-test-"));
|
|
18
|
-
const projectName = "test-project";
|
|
19
|
-
const projectPath = node_path_1.default.join(tempDir, projectName);
|
|
20
|
-
(0, init_1.initProject)(projectName, projectPath);
|
|
21
|
-
// Core structure assertions
|
|
22
|
-
node_assert_1.default.ok(exists(projectPath), "Project directory should exist");
|
|
23
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "README.md")));
|
|
24
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "SOCIAL_CONTRACT.md")));
|
|
25
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "features")));
|
|
26
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "agents")));
|
|
27
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "roles")));
|
|
28
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "pipelines")));
|
|
29
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "docs")));
|
|
30
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "roles", "README.md")), "Roles README should exist");
|
|
31
|
-
// New files assertions
|
|
32
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, ".gitignore")), ".gitignore should exist");
|
|
33
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "package.json")), "package.json should exist");
|
|
34
|
-
// Agent boundaries
|
|
35
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "agents", "AGENTS.md")), "Agent guidelines should exist");
|
|
36
|
-
// Feature contract
|
|
37
|
-
node_assert_1.default.ok(exists(node_path_1.default.join(projectPath, "features", "README.md")), "Feature README should exist");
|
|
38
|
-
// Clean up
|
|
39
|
-
node_fs_1.default.rmSync(tempDir, { recursive: true, force: true });
|
|
40
|
-
});
|
|
41
|
-
(0, node_test_1.default)("CLI --help works", () => {
|
|
42
|
-
const output = (0, node_child_process_1.execSync)("node dist/bin/cli.js --help").toString();
|
|
43
|
-
node_assert_1.default.ok(output.includes("Usage: levit [command] [options]"));
|
|
44
|
-
node_assert_1.default.ok(output.includes("init <project-name>"));
|
|
45
|
-
});
|
|
46
|
-
(0, node_test_1.default)("CLI --version works", () => {
|
|
47
|
-
const output = (0, node_child_process_1.execSync)("node dist/bin/cli.js --version").toString();
|
|
48
|
-
node_assert_1.default.ok(output.startsWith("levit-kit v"));
|
|
49
|
-
});
|
|
50
|
-
(0, node_test_1.default)("CLI name validation works", () => {
|
|
51
|
-
try {
|
|
52
|
-
(0, node_child_process_1.execSync)("node dist/bin/cli.js init invalid/name");
|
|
53
|
-
node_assert_1.default.fail("Should have failed with invalid name");
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
node_assert_1.default.ok(error.stderr.toString().includes("Error: Invalid project name"));
|
|
57
|
-
}
|
|
58
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|