solokit 0.1.1__py3-none-any.whl
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.
- solokit/__init__.py +10 -0
- solokit/__version__.py +3 -0
- solokit/cli.py +374 -0
- solokit/core/__init__.py +1 -0
- solokit/core/cache.py +102 -0
- solokit/core/command_runner.py +278 -0
- solokit/core/config.py +453 -0
- solokit/core/config_validator.py +204 -0
- solokit/core/constants.py +291 -0
- solokit/core/error_formatter.py +279 -0
- solokit/core/error_handlers.py +346 -0
- solokit/core/exceptions.py +1567 -0
- solokit/core/file_ops.py +309 -0
- solokit/core/logging_config.py +166 -0
- solokit/core/output.py +99 -0
- solokit/core/performance.py +57 -0
- solokit/core/protocols.py +141 -0
- solokit/core/types.py +312 -0
- solokit/deployment/__init__.py +1 -0
- solokit/deployment/executor.py +411 -0
- solokit/git/__init__.py +1 -0
- solokit/git/integration.py +619 -0
- solokit/init/__init__.py +41 -0
- solokit/init/claude_commands_installer.py +87 -0
- solokit/init/dependency_installer.py +313 -0
- solokit/init/docs_structure.py +90 -0
- solokit/init/env_generator.py +160 -0
- solokit/init/environment_validator.py +334 -0
- solokit/init/git_hooks_installer.py +71 -0
- solokit/init/git_setup.py +188 -0
- solokit/init/gitignore_updater.py +195 -0
- solokit/init/initial_commit.py +145 -0
- solokit/init/initial_scans.py +109 -0
- solokit/init/orchestrator.py +246 -0
- solokit/init/readme_generator.py +207 -0
- solokit/init/session_structure.py +239 -0
- solokit/init/template_installer.py +424 -0
- solokit/learning/__init__.py +1 -0
- solokit/learning/archiver.py +115 -0
- solokit/learning/categorizer.py +126 -0
- solokit/learning/curator.py +428 -0
- solokit/learning/extractor.py +352 -0
- solokit/learning/reporter.py +351 -0
- solokit/learning/repository.py +254 -0
- solokit/learning/similarity.py +342 -0
- solokit/learning/validator.py +144 -0
- solokit/project/__init__.py +1 -0
- solokit/project/init.py +1162 -0
- solokit/project/stack.py +436 -0
- solokit/project/sync_plugin.py +438 -0
- solokit/project/tree.py +375 -0
- solokit/quality/__init__.py +1 -0
- solokit/quality/api_validator.py +424 -0
- solokit/quality/checkers/__init__.py +25 -0
- solokit/quality/checkers/base.py +114 -0
- solokit/quality/checkers/context7.py +221 -0
- solokit/quality/checkers/custom.py +162 -0
- solokit/quality/checkers/deployment.py +323 -0
- solokit/quality/checkers/documentation.py +179 -0
- solokit/quality/checkers/formatting.py +161 -0
- solokit/quality/checkers/integration.py +394 -0
- solokit/quality/checkers/linting.py +159 -0
- solokit/quality/checkers/security.py +261 -0
- solokit/quality/checkers/spec_completeness.py +127 -0
- solokit/quality/checkers/tests.py +184 -0
- solokit/quality/env_validator.py +306 -0
- solokit/quality/gates.py +655 -0
- solokit/quality/reporters/__init__.py +10 -0
- solokit/quality/reporters/base.py +25 -0
- solokit/quality/reporters/console.py +98 -0
- solokit/quality/reporters/json_reporter.py +34 -0
- solokit/quality/results.py +98 -0
- solokit/session/__init__.py +1 -0
- solokit/session/briefing/__init__.py +245 -0
- solokit/session/briefing/documentation_loader.py +53 -0
- solokit/session/briefing/formatter.py +476 -0
- solokit/session/briefing/git_context.py +282 -0
- solokit/session/briefing/learning_loader.py +212 -0
- solokit/session/briefing/milestone_builder.py +78 -0
- solokit/session/briefing/orchestrator.py +137 -0
- solokit/session/briefing/stack_detector.py +51 -0
- solokit/session/briefing/tree_generator.py +52 -0
- solokit/session/briefing/work_item_loader.py +209 -0
- solokit/session/briefing.py +353 -0
- solokit/session/complete.py +1188 -0
- solokit/session/status.py +246 -0
- solokit/session/validate.py +452 -0
- solokit/templates/.claude/commands/end.md +109 -0
- solokit/templates/.claude/commands/init.md +159 -0
- solokit/templates/.claude/commands/learn-curate.md +88 -0
- solokit/templates/.claude/commands/learn-search.md +62 -0
- solokit/templates/.claude/commands/learn-show.md +69 -0
- solokit/templates/.claude/commands/learn.md +136 -0
- solokit/templates/.claude/commands/start.md +114 -0
- solokit/templates/.claude/commands/status.md +22 -0
- solokit/templates/.claude/commands/validate.md +27 -0
- solokit/templates/.claude/commands/work-delete.md +119 -0
- solokit/templates/.claude/commands/work-graph.md +139 -0
- solokit/templates/.claude/commands/work-list.md +26 -0
- solokit/templates/.claude/commands/work-new.md +114 -0
- solokit/templates/.claude/commands/work-next.md +25 -0
- solokit/templates/.claude/commands/work-show.md +24 -0
- solokit/templates/.claude/commands/work-update.md +141 -0
- solokit/templates/CHANGELOG.md +17 -0
- solokit/templates/WORK_ITEM_TYPES.md +141 -0
- solokit/templates/__init__.py +1 -0
- solokit/templates/bug_spec.md +217 -0
- solokit/templates/config.schema.json +150 -0
- solokit/templates/dashboard_refine/base/.gitignore +36 -0
- solokit/templates/dashboard_refine/base/app/(dashboard)/layout.tsx +22 -0
- solokit/templates/dashboard_refine/base/app/(dashboard)/page.tsx +68 -0
- solokit/templates/dashboard_refine/base/app/(dashboard)/users/page.tsx +77 -0
- solokit/templates/dashboard_refine/base/app/globals.css +60 -0
- solokit/templates/dashboard_refine/base/app/layout.tsx +23 -0
- solokit/templates/dashboard_refine/base/app/page.tsx +9 -0
- solokit/templates/dashboard_refine/base/components/client-refine-wrapper.tsx +21 -0
- solokit/templates/dashboard_refine/base/components/layout/header.tsx +44 -0
- solokit/templates/dashboard_refine/base/components/layout/sidebar.tsx +82 -0
- solokit/templates/dashboard_refine/base/components/ui/button.tsx +53 -0
- solokit/templates/dashboard_refine/base/components/ui/card.tsx +78 -0
- solokit/templates/dashboard_refine/base/components/ui/table.tsx +116 -0
- solokit/templates/dashboard_refine/base/components.json +16 -0
- solokit/templates/dashboard_refine/base/lib/refine.tsx +65 -0
- solokit/templates/dashboard_refine/base/lib/utils.ts +13 -0
- solokit/templates/dashboard_refine/base/next.config.ts +10 -0
- solokit/templates/dashboard_refine/base/package.json.template +40 -0
- solokit/templates/dashboard_refine/base/postcss.config.mjs +8 -0
- solokit/templates/dashboard_refine/base/providers/refine-provider.tsx +26 -0
- solokit/templates/dashboard_refine/base/tailwind.config.ts +57 -0
- solokit/templates/dashboard_refine/base/tsconfig.json +27 -0
- solokit/templates/dashboard_refine/docker/Dockerfile +57 -0
- solokit/templates/dashboard_refine/docker/docker-compose.prod.yml +31 -0
- solokit/templates/dashboard_refine/docker/docker-compose.yml +21 -0
- solokit/templates/dashboard_refine/tier-1-essential/.eslintrc.json +7 -0
- solokit/templates/dashboard_refine/tier-1-essential/jest.config.ts +17 -0
- solokit/templates/dashboard_refine/tier-1-essential/jest.setup.ts +1 -0
- solokit/templates/dashboard_refine/tier-1-essential/package.json.tier1.template +57 -0
- solokit/templates/dashboard_refine/tier-1-essential/tests/setup.ts +26 -0
- solokit/templates/dashboard_refine/tier-1-essential/tests/unit/example.test.tsx +73 -0
- solokit/templates/dashboard_refine/tier-2-standard/package.json.tier2.template +62 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/eslint.config.mjs +22 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/package.json.tier3.template +79 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/playwright.config.ts +66 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/stryker.conf.json +38 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/tests/e2e/dashboard.spec.ts +88 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/tests/e2e/user-management.spec.ts +102 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/tests/integration/dashboard.test.tsx +90 -0
- solokit/templates/dashboard_refine/tier-3-comprehensive/type-coverage.json +16 -0
- solokit/templates/dashboard_refine/tier-4-production/instrumentation.ts +9 -0
- solokit/templates/dashboard_refine/tier-4-production/k6/dashboard-load-test.js +70 -0
- solokit/templates/dashboard_refine/tier-4-production/next.config.ts +46 -0
- solokit/templates/dashboard_refine/tier-4-production/package.json.tier4.template +89 -0
- solokit/templates/dashboard_refine/tier-4-production/sentry.client.config.ts +26 -0
- solokit/templates/dashboard_refine/tier-4-production/sentry.edge.config.ts +11 -0
- solokit/templates/dashboard_refine/tier-4-production/sentry.server.config.ts +11 -0
- solokit/templates/deployment_spec.md +500 -0
- solokit/templates/feature_spec.md +248 -0
- solokit/templates/fullstack_nextjs/base/.gitignore +36 -0
- solokit/templates/fullstack_nextjs/base/app/api/example/route.ts +65 -0
- solokit/templates/fullstack_nextjs/base/app/globals.css +27 -0
- solokit/templates/fullstack_nextjs/base/app/layout.tsx +20 -0
- solokit/templates/fullstack_nextjs/base/app/page.tsx +32 -0
- solokit/templates/fullstack_nextjs/base/components/example-component.tsx +20 -0
- solokit/templates/fullstack_nextjs/base/lib/prisma.ts +17 -0
- solokit/templates/fullstack_nextjs/base/lib/utils.ts +13 -0
- solokit/templates/fullstack_nextjs/base/lib/validations.ts +20 -0
- solokit/templates/fullstack_nextjs/base/next.config.ts +7 -0
- solokit/templates/fullstack_nextjs/base/package.json.template +32 -0
- solokit/templates/fullstack_nextjs/base/postcss.config.mjs +8 -0
- solokit/templates/fullstack_nextjs/base/prisma/schema.prisma +21 -0
- solokit/templates/fullstack_nextjs/base/tailwind.config.ts +19 -0
- solokit/templates/fullstack_nextjs/base/tsconfig.json +27 -0
- solokit/templates/fullstack_nextjs/docker/Dockerfile +60 -0
- solokit/templates/fullstack_nextjs/docker/docker-compose.prod.yml +57 -0
- solokit/templates/fullstack_nextjs/docker/docker-compose.yml +47 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/.eslintrc.json +7 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/jest.config.ts +17 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/jest.setup.ts +1 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/package.json.tier1.template +48 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/tests/api/example.test.ts +88 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/tests/setup.ts +22 -0
- solokit/templates/fullstack_nextjs/tier-1-essential/tests/unit/example.test.tsx +22 -0
- solokit/templates/fullstack_nextjs/tier-2-standard/package.json.tier2.template +52 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/eslint.config.mjs +39 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/package.json.tier3.template +68 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/playwright.config.ts +66 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/stryker.conf.json +33 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/tests/e2e/flow.spec.ts +59 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/tests/integration/api.test.ts +165 -0
- solokit/templates/fullstack_nextjs/tier-3-comprehensive/type-coverage.json +12 -0
- solokit/templates/fullstack_nextjs/tier-4-production/instrumentation.ts +9 -0
- solokit/templates/fullstack_nextjs/tier-4-production/k6/load-test.js +45 -0
- solokit/templates/fullstack_nextjs/tier-4-production/next.config.ts +46 -0
- solokit/templates/fullstack_nextjs/tier-4-production/package.json.tier4.template +77 -0
- solokit/templates/fullstack_nextjs/tier-4-production/sentry.client.config.ts +26 -0
- solokit/templates/fullstack_nextjs/tier-4-production/sentry.edge.config.ts +11 -0
- solokit/templates/fullstack_nextjs/tier-4-production/sentry.server.config.ts +11 -0
- solokit/templates/git-hooks/prepare-commit-msg +24 -0
- solokit/templates/integration_test_spec.md +363 -0
- solokit/templates/learnings.json +15 -0
- solokit/templates/ml_ai_fastapi/base/.gitignore +104 -0
- solokit/templates/ml_ai_fastapi/base/alembic/env.py +96 -0
- solokit/templates/ml_ai_fastapi/base/alembic.ini +114 -0
- solokit/templates/ml_ai_fastapi/base/pyproject.toml.template +91 -0
- solokit/templates/ml_ai_fastapi/base/requirements.txt.template +28 -0
- solokit/templates/ml_ai_fastapi/base/src/__init__.py +5 -0
- solokit/templates/ml_ai_fastapi/base/src/api/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/base/src/api/dependencies.py +20 -0
- solokit/templates/ml_ai_fastapi/base/src/api/routes/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/base/src/api/routes/example.py +134 -0
- solokit/templates/ml_ai_fastapi/base/src/api/routes/health.py +66 -0
- solokit/templates/ml_ai_fastapi/base/src/core/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/base/src/core/config.py +64 -0
- solokit/templates/ml_ai_fastapi/base/src/core/database.py +50 -0
- solokit/templates/ml_ai_fastapi/base/src/main.py +64 -0
- solokit/templates/ml_ai_fastapi/base/src/models/__init__.py +7 -0
- solokit/templates/ml_ai_fastapi/base/src/models/example.py +61 -0
- solokit/templates/ml_ai_fastapi/base/src/services/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/base/src/services/example.py +115 -0
- solokit/templates/ml_ai_fastapi/docker/Dockerfile +59 -0
- solokit/templates/ml_ai_fastapi/docker/docker-compose.prod.yml +112 -0
- solokit/templates/ml_ai_fastapi/docker/docker-compose.yml +77 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/pyproject.toml.tier1.template +112 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/pyrightconfig.json +41 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/pytest.ini +69 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/requirements-dev.txt +17 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/ruff.toml +81 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/tests/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/tests/conftest.py +72 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/tests/test_main.py +49 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/tests/unit/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/tier-1-essential/tests/unit/test_example.py +113 -0
- solokit/templates/ml_ai_fastapi/tier-2-standard/pyproject.toml.tier2.template +130 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/locustfile.py +99 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/mutmut_config.py +53 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/pyproject.toml.tier3.template +150 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/conftest.py +74 -0
- solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/test_api.py +131 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/pyproject.toml.tier4.template +162 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/requirements-prod.txt +25 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/api/routes/metrics.py +19 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/core/logging.py +74 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/core/monitoring.py +68 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/core/sentry.py +66 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/__init__.py +3 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/logging.py +79 -0
- solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/tracing.py +60 -0
- solokit/templates/refactor_spec.md +287 -0
- solokit/templates/saas_t3/base/.gitignore +36 -0
- solokit/templates/saas_t3/base/app/api/trpc/[trpc]/route.ts +33 -0
- solokit/templates/saas_t3/base/app/globals.css +27 -0
- solokit/templates/saas_t3/base/app/layout.tsx +23 -0
- solokit/templates/saas_t3/base/app/page.tsx +31 -0
- solokit/templates/saas_t3/base/lib/api.tsx +77 -0
- solokit/templates/saas_t3/base/lib/utils.ts +13 -0
- solokit/templates/saas_t3/base/next.config.ts +7 -0
- solokit/templates/saas_t3/base/package.json.template +38 -0
- solokit/templates/saas_t3/base/postcss.config.mjs +8 -0
- solokit/templates/saas_t3/base/prisma/schema.prisma +20 -0
- solokit/templates/saas_t3/base/server/api/root.ts +19 -0
- solokit/templates/saas_t3/base/server/api/routers/example.ts +28 -0
- solokit/templates/saas_t3/base/server/api/trpc.ts +52 -0
- solokit/templates/saas_t3/base/server/db.ts +17 -0
- solokit/templates/saas_t3/base/tailwind.config.ts +19 -0
- solokit/templates/saas_t3/base/tsconfig.json +27 -0
- solokit/templates/saas_t3/docker/Dockerfile +60 -0
- solokit/templates/saas_t3/docker/docker-compose.prod.yml +59 -0
- solokit/templates/saas_t3/docker/docker-compose.yml +49 -0
- solokit/templates/saas_t3/tier-1-essential/.eslintrc.json +7 -0
- solokit/templates/saas_t3/tier-1-essential/jest.config.ts +17 -0
- solokit/templates/saas_t3/tier-1-essential/jest.setup.ts +1 -0
- solokit/templates/saas_t3/tier-1-essential/package.json.tier1.template +54 -0
- solokit/templates/saas_t3/tier-1-essential/tests/setup.ts +22 -0
- solokit/templates/saas_t3/tier-1-essential/tests/unit/example.test.tsx +24 -0
- solokit/templates/saas_t3/tier-2-standard/package.json.tier2.template +58 -0
- solokit/templates/saas_t3/tier-3-comprehensive/eslint.config.mjs +39 -0
- solokit/templates/saas_t3/tier-3-comprehensive/package.json.tier3.template +74 -0
- solokit/templates/saas_t3/tier-3-comprehensive/playwright.config.ts +66 -0
- solokit/templates/saas_t3/tier-3-comprehensive/stryker.conf.json +34 -0
- solokit/templates/saas_t3/tier-3-comprehensive/tests/e2e/home.spec.ts +41 -0
- solokit/templates/saas_t3/tier-3-comprehensive/tests/integration/api.test.ts +44 -0
- solokit/templates/saas_t3/tier-3-comprehensive/type-coverage.json +12 -0
- solokit/templates/saas_t3/tier-4-production/instrumentation.ts +9 -0
- solokit/templates/saas_t3/tier-4-production/k6/load-test.js +51 -0
- solokit/templates/saas_t3/tier-4-production/next.config.ts +46 -0
- solokit/templates/saas_t3/tier-4-production/package.json.tier4.template +83 -0
- solokit/templates/saas_t3/tier-4-production/sentry.client.config.ts +26 -0
- solokit/templates/saas_t3/tier-4-production/sentry.edge.config.ts +11 -0
- solokit/templates/saas_t3/tier-4-production/sentry.server.config.ts +11 -0
- solokit/templates/saas_t3/tier-4-production/vercel.json +37 -0
- solokit/templates/security_spec.md +287 -0
- solokit/templates/stack-versions.yaml +617 -0
- solokit/templates/status_update.json +6 -0
- solokit/templates/template-registry.json +257 -0
- solokit/templates/work_items.json +11 -0
- solokit/testing/__init__.py +1 -0
- solokit/testing/integration_runner.py +550 -0
- solokit/testing/performance.py +637 -0
- solokit/visualization/__init__.py +1 -0
- solokit/visualization/dependency_graph.py +788 -0
- solokit/work_items/__init__.py +1 -0
- solokit/work_items/creator.py +217 -0
- solokit/work_items/delete.py +264 -0
- solokit/work_items/get_dependencies.py +185 -0
- solokit/work_items/get_dependents.py +113 -0
- solokit/work_items/get_metadata.py +121 -0
- solokit/work_items/get_next_recommendations.py +133 -0
- solokit/work_items/manager.py +235 -0
- solokit/work_items/milestones.py +137 -0
- solokit/work_items/query.py +376 -0
- solokit/work_items/repository.py +267 -0
- solokit/work_items/scheduler.py +184 -0
- solokit/work_items/spec_parser.py +838 -0
- solokit/work_items/spec_validator.py +493 -0
- solokit/work_items/updater.py +157 -0
- solokit/work_items/validator.py +205 -0
- solokit-0.1.1.dist-info/METADATA +640 -0
- solokit-0.1.1.dist-info/RECORD +323 -0
- solokit-0.1.1.dist-info/WHEEL +5 -0
- solokit-0.1.1.dist-info/entry_points.txt +2 -0
- solokit-0.1.1.dist-info/licenses/LICENSE +21 -0
- solokit-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"""
|
|
2
|
+
README Generator Module
|
|
3
|
+
|
|
4
|
+
Generates project README.md with stack-specific information.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from solokit.core.exceptions import FileOperationError
|
|
13
|
+
from solokit.init.template_installer import get_template_info, load_template_registry
|
|
14
|
+
|
|
15
|
+
logger = logging.getLogger(__name__)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def generate_readme(
|
|
19
|
+
template_id: str,
|
|
20
|
+
tier: str,
|
|
21
|
+
coverage_target: int,
|
|
22
|
+
additional_options: list[str],
|
|
23
|
+
project_root: Path | None = None,
|
|
24
|
+
) -> Path:
|
|
25
|
+
"""
|
|
26
|
+
Generate README.md for the project.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
template_id: Template identifier
|
|
30
|
+
tier: Quality tier
|
|
31
|
+
coverage_target: Test coverage target percentage
|
|
32
|
+
additional_options: List of additional options installed
|
|
33
|
+
project_root: Project root directory
|
|
34
|
+
|
|
35
|
+
Returns:
|
|
36
|
+
Path to generated README.md
|
|
37
|
+
|
|
38
|
+
Raises:
|
|
39
|
+
FileOperationError: If README generation fails
|
|
40
|
+
"""
|
|
41
|
+
if project_root is None:
|
|
42
|
+
project_root = Path.cwd()
|
|
43
|
+
|
|
44
|
+
template_info = get_template_info(template_id)
|
|
45
|
+
registry = load_template_registry()
|
|
46
|
+
|
|
47
|
+
tier_info = registry["quality_tiers"].get(tier, {})
|
|
48
|
+
|
|
49
|
+
# Get project name from directory
|
|
50
|
+
project_name = project_root.name
|
|
51
|
+
|
|
52
|
+
# Build README content
|
|
53
|
+
readme_content = f"""# {project_name}
|
|
54
|
+
|
|
55
|
+
A {template_info["display_name"]} project built with Session-Driven Development.
|
|
56
|
+
|
|
57
|
+
## Tech Stack
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
# Add stack information
|
|
62
|
+
for key, value in template_info["stack"].items():
|
|
63
|
+
formatted_key = key.replace("_", " ").title()
|
|
64
|
+
readme_content += f"- **{formatted_key}**: {value}\n"
|
|
65
|
+
|
|
66
|
+
readme_content += f"\n## Quality Gates: {tier_info.get('name', tier)}\n\n"
|
|
67
|
+
|
|
68
|
+
if "includes" in tier_info:
|
|
69
|
+
for item in tier_info["includes"]:
|
|
70
|
+
readme_content += f"- ✓ {item}\n"
|
|
71
|
+
|
|
72
|
+
if "adds" in tier_info:
|
|
73
|
+
for item in tier_info["adds"]:
|
|
74
|
+
readme_content += f"- ✓ {item}\n"
|
|
75
|
+
|
|
76
|
+
readme_content += f"\n**Test Coverage Target**: {coverage_target}%\n"
|
|
77
|
+
|
|
78
|
+
# Add getting started section
|
|
79
|
+
readme_content += "\n## Getting Started\n\n"
|
|
80
|
+
|
|
81
|
+
if template_info["package_manager"] == "npm":
|
|
82
|
+
readme_content += """```bash
|
|
83
|
+
# Install dependencies
|
|
84
|
+
npm install
|
|
85
|
+
|
|
86
|
+
# Run development server
|
|
87
|
+
npm run dev
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Visit http://localhost:3000
|
|
91
|
+
|
|
92
|
+
"""
|
|
93
|
+
else: # Python
|
|
94
|
+
readme_content += """```bash
|
|
95
|
+
# Activate virtual environment
|
|
96
|
+
source venv/bin/activate # Unix
|
|
97
|
+
# or
|
|
98
|
+
venv\\Scripts\\activate # Windows
|
|
99
|
+
|
|
100
|
+
# Run development server
|
|
101
|
+
uvicorn main:app --reload
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Visit http://localhost:8000
|
|
105
|
+
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
# Add testing section
|
|
109
|
+
readme_content += "## Testing\n\n"
|
|
110
|
+
|
|
111
|
+
if template_info["package_manager"] == "npm":
|
|
112
|
+
readme_content += """```bash
|
|
113
|
+
# Run tests
|
|
114
|
+
npm test
|
|
115
|
+
|
|
116
|
+
# Run tests with coverage
|
|
117
|
+
npm run test:coverage
|
|
118
|
+
|
|
119
|
+
# Run linting
|
|
120
|
+
npm run lint
|
|
121
|
+
|
|
122
|
+
# Run type checking
|
|
123
|
+
npm run type-check
|
|
124
|
+
```
|
|
125
|
+
"""
|
|
126
|
+
else: # Python
|
|
127
|
+
readme_content += """```bash
|
|
128
|
+
# Run tests
|
|
129
|
+
pytest
|
|
130
|
+
|
|
131
|
+
# Run tests with coverage
|
|
132
|
+
pytest --cov --cov-report=html
|
|
133
|
+
|
|
134
|
+
# Run linting
|
|
135
|
+
ruff check .
|
|
136
|
+
|
|
137
|
+
# Run type checking
|
|
138
|
+
pyright
|
|
139
|
+
```
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
# Add additional options documentation
|
|
143
|
+
if additional_options:
|
|
144
|
+
readme_content += "\n## Additional Features\n\n"
|
|
145
|
+
for option in additional_options:
|
|
146
|
+
option_key = option.replace("_", " ").title()
|
|
147
|
+
readme_content += f"- ✓ {option_key}\n"
|
|
148
|
+
|
|
149
|
+
# Add known issues if any
|
|
150
|
+
if template_info.get("known_issues"):
|
|
151
|
+
critical_issues = [
|
|
152
|
+
issue
|
|
153
|
+
for issue in template_info["known_issues"]
|
|
154
|
+
if issue["severity"] in ["CRITICAL", "HIGH"]
|
|
155
|
+
]
|
|
156
|
+
if critical_issues:
|
|
157
|
+
readme_content += "\n## Known Issues\n\n"
|
|
158
|
+
for issue in critical_issues:
|
|
159
|
+
readme_content += (
|
|
160
|
+
f"**{issue['package']}** ({issue['severity']}): {issue['description']}\n\n"
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Add Session-Driven Development section
|
|
164
|
+
readme_content += """## Session-Driven Development
|
|
165
|
+
|
|
166
|
+
This project uses Session-Driven Development (Solokit) for organized, AI-augmented development.
|
|
167
|
+
|
|
168
|
+
### Commands
|
|
169
|
+
|
|
170
|
+
- `/sk:work-new` - Create a new work item
|
|
171
|
+
- `/sk:work-list` - List all work items
|
|
172
|
+
- `/sk:start` - Start working on a work item
|
|
173
|
+
- `/sk:status` - Check current session status
|
|
174
|
+
- `/sk:validate` - Validate quality gates
|
|
175
|
+
- `/sk:end` - Complete current session
|
|
176
|
+
- `/sk:learn` - Capture a learning
|
|
177
|
+
|
|
178
|
+
### Documentation
|
|
179
|
+
|
|
180
|
+
See `.session/` directory for:
|
|
181
|
+
- Work item specifications (`.session/specs/`)
|
|
182
|
+
- Session briefings (`.session/briefings/`)
|
|
183
|
+
- Session summaries (`.session/history/`)
|
|
184
|
+
- Captured learnings (`.session/tracking/learnings.json`)
|
|
185
|
+
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
# Add footer
|
|
189
|
+
readme_content += """---
|
|
190
|
+
|
|
191
|
+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
|
192
|
+
"""
|
|
193
|
+
|
|
194
|
+
# Write README
|
|
195
|
+
readme_path = project_root / "README.md"
|
|
196
|
+
|
|
197
|
+
try:
|
|
198
|
+
readme_path.write_text(readme_content)
|
|
199
|
+
logger.info(f"Generated {readme_path.name}")
|
|
200
|
+
return readme_path
|
|
201
|
+
except Exception as e:
|
|
202
|
+
raise FileOperationError(
|
|
203
|
+
operation="write",
|
|
204
|
+
file_path=str(readme_path),
|
|
205
|
+
details=f"Failed to write README.md: {str(e)}",
|
|
206
|
+
cause=e,
|
|
207
|
+
)
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Session Structure Module
|
|
3
|
+
|
|
4
|
+
Creates .session directory structure and tracking files.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
import logging
|
|
11
|
+
import shutil
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
|
|
14
|
+
from solokit.core.exceptions import FileOperationError
|
|
15
|
+
|
|
16
|
+
logger = logging.getLogger(__name__)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_session_directories(project_root: Path | None = None) -> list[Path]:
|
|
20
|
+
"""
|
|
21
|
+
Create .session directory structure.
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
project_root: Project root directory
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
List of created directory paths
|
|
28
|
+
|
|
29
|
+
Raises:
|
|
30
|
+
FileOperationError: If directory creation fails
|
|
31
|
+
"""
|
|
32
|
+
if project_root is None:
|
|
33
|
+
project_root = Path.cwd()
|
|
34
|
+
|
|
35
|
+
session_dir = project_root / ".session"
|
|
36
|
+
created_dirs = []
|
|
37
|
+
|
|
38
|
+
directories = [
|
|
39
|
+
session_dir / "tracking",
|
|
40
|
+
session_dir / "briefings",
|
|
41
|
+
session_dir / "history",
|
|
42
|
+
session_dir / "specs",
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
try:
|
|
46
|
+
for dir_path in directories:
|
|
47
|
+
dir_path.mkdir(parents=True, exist_ok=True)
|
|
48
|
+
created_dirs.append(dir_path)
|
|
49
|
+
logger.debug(f"Created {dir_path.relative_to(project_root)}")
|
|
50
|
+
|
|
51
|
+
logger.info(f"Created .session/ structure with {len(created_dirs)} directories")
|
|
52
|
+
return created_dirs
|
|
53
|
+
|
|
54
|
+
except Exception as e:
|
|
55
|
+
raise FileOperationError(
|
|
56
|
+
operation="create",
|
|
57
|
+
file_path=str(session_dir),
|
|
58
|
+
details=f"Failed to create .session directory structure: {str(e)}",
|
|
59
|
+
cause=e,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def initialize_tracking_files(
|
|
64
|
+
tier: str, coverage_target: int, project_root: Path | None = None
|
|
65
|
+
) -> list[Path]:
|
|
66
|
+
"""
|
|
67
|
+
Initialize tracking files from templates with tier-specific config.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
tier: Quality tier (e.g., "tier-2-standard")
|
|
71
|
+
coverage_target: Test coverage target percentage
|
|
72
|
+
project_root: Project root directory
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
List of created file paths
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
FileOperationError: If file operations fail
|
|
79
|
+
TemplateNotFoundError: If required template files are missing
|
|
80
|
+
"""
|
|
81
|
+
if project_root is None:
|
|
82
|
+
project_root = Path.cwd()
|
|
83
|
+
|
|
84
|
+
session_dir = project_root / ".session"
|
|
85
|
+
template_dir = Path(__file__).parent.parent / "templates"
|
|
86
|
+
created_files = []
|
|
87
|
+
|
|
88
|
+
logger.info("Initializing tracking files...")
|
|
89
|
+
|
|
90
|
+
# Copy template tracking files
|
|
91
|
+
tracking_files = [
|
|
92
|
+
("work_items.json", "tracking/work_items.json"),
|
|
93
|
+
("learnings.json", "tracking/learnings.json"),
|
|
94
|
+
("status_update.json", "tracking/status_update.json"),
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
for src, dst in tracking_files:
|
|
98
|
+
src_path = template_dir / src
|
|
99
|
+
dst_path = session_dir / dst
|
|
100
|
+
if src_path.exists():
|
|
101
|
+
try:
|
|
102
|
+
shutil.copy(src_path, dst_path)
|
|
103
|
+
created_files.append(dst_path)
|
|
104
|
+
logger.debug(f"Created {dst}")
|
|
105
|
+
except Exception as e:
|
|
106
|
+
raise FileOperationError(
|
|
107
|
+
operation="copy",
|
|
108
|
+
file_path=str(dst_path),
|
|
109
|
+
details=f"Failed to copy tracking file template: {str(e)}",
|
|
110
|
+
cause=e,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
# Create empty update tracking files
|
|
114
|
+
try:
|
|
115
|
+
updates_files = [
|
|
116
|
+
session_dir / "tracking" / "stack_updates.json",
|
|
117
|
+
session_dir / "tracking" / "tree_updates.json",
|
|
118
|
+
]
|
|
119
|
+
for update_file in updates_files:
|
|
120
|
+
update_file.write_text(json.dumps({"updates": []}, indent=2))
|
|
121
|
+
created_files.append(update_file)
|
|
122
|
+
logger.debug(f"Created {update_file.name}")
|
|
123
|
+
except Exception as e:
|
|
124
|
+
raise FileOperationError(
|
|
125
|
+
operation="create",
|
|
126
|
+
file_path=str(session_dir / "tracking"),
|
|
127
|
+
details=f"Failed to create tracking files: {str(e)}",
|
|
128
|
+
cause=e,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
# Create config.json with tier-specific settings
|
|
132
|
+
config_data = {
|
|
133
|
+
"curation": {
|
|
134
|
+
"auto_curate": True,
|
|
135
|
+
"frequency": 5,
|
|
136
|
+
"dry_run": False,
|
|
137
|
+
"similarity_threshold": 0.7,
|
|
138
|
+
"categories": [
|
|
139
|
+
"architecture_patterns",
|
|
140
|
+
"gotchas",
|
|
141
|
+
"best_practices",
|
|
142
|
+
"technical_debt",
|
|
143
|
+
"performance_insights",
|
|
144
|
+
"security",
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
"quality_gates": {
|
|
148
|
+
"tier": tier,
|
|
149
|
+
"coverage_threshold": coverage_target,
|
|
150
|
+
"test_execution": {"enabled": True, "required": True},
|
|
151
|
+
"linting": {"enabled": True, "required": True},
|
|
152
|
+
"formatting": {"enabled": True, "required": True},
|
|
153
|
+
"security": {"enabled": True, "required": True},
|
|
154
|
+
"documentation": {
|
|
155
|
+
"enabled": True,
|
|
156
|
+
"required": True,
|
|
157
|
+
"check_changelog": True,
|
|
158
|
+
"check_docstrings": True,
|
|
159
|
+
"check_readme": False,
|
|
160
|
+
},
|
|
161
|
+
"context7": {
|
|
162
|
+
"enabled": False,
|
|
163
|
+
"required": True,
|
|
164
|
+
"important_libraries": [],
|
|
165
|
+
},
|
|
166
|
+
"custom_validations": {"rules": []},
|
|
167
|
+
},
|
|
168
|
+
"integration_tests": {
|
|
169
|
+
"enabled": True,
|
|
170
|
+
"docker_compose_file": "docker-compose.integration.yml",
|
|
171
|
+
"environment_validation": True,
|
|
172
|
+
"health_check_timeout": 300,
|
|
173
|
+
"test_data_fixtures": True,
|
|
174
|
+
"parallel_execution": True,
|
|
175
|
+
"performance_benchmarks": {
|
|
176
|
+
"enabled": True,
|
|
177
|
+
"required": True,
|
|
178
|
+
"regression_threshold": 0.10,
|
|
179
|
+
"baseline_storage": ".session/tracking/performance_baselines.json",
|
|
180
|
+
"load_test_tool": "wrk",
|
|
181
|
+
"metrics": ["response_time", "throughput", "resource_usage"],
|
|
182
|
+
},
|
|
183
|
+
"api_contracts": {
|
|
184
|
+
"enabled": True,
|
|
185
|
+
"required": True,
|
|
186
|
+
"contract_format": "openapi",
|
|
187
|
+
"breaking_change_detection": True,
|
|
188
|
+
"version_storage": ".session/tracking/api_contracts/",
|
|
189
|
+
"fail_on_breaking_changes": True,
|
|
190
|
+
},
|
|
191
|
+
"documentation": {
|
|
192
|
+
"architecture_diagrams": True,
|
|
193
|
+
"sequence_diagrams": True,
|
|
194
|
+
"contract_documentation": True,
|
|
195
|
+
"performance_baseline_docs": True,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
"git_workflow": {
|
|
199
|
+
"mode": "pr",
|
|
200
|
+
"auto_push": True,
|
|
201
|
+
"auto_create_pr": True,
|
|
202
|
+
"delete_branch_after_merge": True,
|
|
203
|
+
"pr_title_template": "{type}: {title}",
|
|
204
|
+
"pr_body_template": "## Summary\n\n{description}\n\n## Work Item\n- ID: {work_item_id}\n- Type: {type}\n- Session: {session_num}\n\n## Changes\n{commit_messages}\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude <noreply@anthropic.com>",
|
|
205
|
+
},
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
try:
|
|
209
|
+
config_path = session_dir / "config.json"
|
|
210
|
+
config_path.write_text(json.dumps(config_data, indent=2))
|
|
211
|
+
created_files.append(config_path)
|
|
212
|
+
logger.info("Created config.json with tier-specific settings")
|
|
213
|
+
except Exception as e:
|
|
214
|
+
raise FileOperationError(
|
|
215
|
+
operation="create",
|
|
216
|
+
file_path=str(session_dir / "config.json"),
|
|
217
|
+
details=f"Failed to create config.json: {str(e)}",
|
|
218
|
+
cause=e,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
# Copy config schema file
|
|
222
|
+
schema_source = template_dir / "config.schema.json"
|
|
223
|
+
schema_dest = session_dir / "config.schema.json"
|
|
224
|
+
|
|
225
|
+
if schema_source.exists() and not schema_dest.exists():
|
|
226
|
+
try:
|
|
227
|
+
shutil.copy(schema_source, schema_dest)
|
|
228
|
+
created_files.append(schema_dest)
|
|
229
|
+
logger.info("Created config.schema.json")
|
|
230
|
+
except Exception as e:
|
|
231
|
+
raise FileOperationError(
|
|
232
|
+
operation="copy",
|
|
233
|
+
file_path=str(schema_dest),
|
|
234
|
+
details=f"Failed to copy config schema: {str(e)}",
|
|
235
|
+
cause=e,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
logger.info(f"Initialized {len(created_files)} tracking files")
|
|
239
|
+
return created_files
|