lanternspec 0.2.2__tar.gz → 0.2.4__tar.gz
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.
- {lanternspec-0.2.2/src/lanternspec.egg-info → lanternspec-0.2.4}/PKG-INFO +4 -3
- {lanternspec-0.2.2 → lanternspec-0.2.4}/README.md +3 -2
- {lanternspec-0.2.2 → lanternspec-0.2.4}/pyproject.toml +1 -1
- lanternspec-0.2.4/src/lanternspec/check/budget.py +161 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/doctor.py +64 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/core.py +52 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/principles.py +104 -5
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/profile.py +45 -3
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md +5 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md +5 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/messages.yaml +27 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/principles.yaml +6 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/agent_hooks.py +105 -7
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/antigravity.py +8 -5
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/base.py +15 -1
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/claude.py +6 -19
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/codex.py +12 -5
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/install.py +41 -1
- lanternspec-0.2.4/src/lanternspec/tools/parts.py +211 -0
- lanternspec-0.2.4/src/lanternspec/tools/rules.py +228 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4/src/lanternspec.egg-info}/PKG-INFO +4 -3
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec.egg-info/SOURCES.txt +5 -0
- lanternspec-0.2.4/tests/test_budget.py +54 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_later_features.py +4 -3
- lanternspec-0.2.4/tests/test_part_delivery.py +97 -0
- lanternspec-0.2.4/tests/test_parts.py +110 -0
- lanternspec-0.2.2/src/lanternspec/tools/rules.py +0 -113
- {lanternspec-0.2.2 → lanternspec-0.2.4}/LICENSE +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/setup.cfg +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/__main__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/check_docs.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/githooks.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/layout.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/legacy.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/check/templates.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/check.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/common.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/learn.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/report.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/tools.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/cli/work.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/enums.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/frontmatter.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/links.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/messages.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/meta.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/names.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/new_id.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/project.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/sections.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/state.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/taskfile.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/core/templating.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/debt.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/knowledge/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/knowledge/drafts.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/knowledge/mcp_server.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/knowledge/notion.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/learn/knowledge/obsidian.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/doc_map.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/evaluate.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/harness.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/obsidian.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/principles_doc.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/resume.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/scan.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/sections_doc.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/status.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/report/views.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/conventions/go.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/conventions/python.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/conventions/rust.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/conventions/swift.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/conventions/typescript.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/agents/AGENTS.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-build/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-design/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-idea/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-plan/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-template/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/ADR.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/API.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Architecture.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Collaboration Rules.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Competency Card.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Data.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Debt Card.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Deployment.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Design.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Docs MOC.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Feature List.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Idea.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Known Tech.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Legacy Map.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Log.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Meeting Notes.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Plan.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Platform Integration.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Project Definition.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Screens.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Server Operations.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Session Log.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Tasks.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/Work Division Rules.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/templates/_meta/enums.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/agents/AGENTS.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-adr/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-build/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-check/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-design/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-idea/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-learn/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-map/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-plan/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-report/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-resume/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-sync/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-task/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-template/SKILL.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates/ADR.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates/API.md +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates/_meta/enums.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//352/260/234/353/260/234/353/254/270/354/204/234 MOC.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/212/245 /353/252/251/353/241/235.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//352/270/260/353/241/235.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//352/270/260/354/241/264 /353/254/270/354/204/234 /354/247/200/353/217/204.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//352/270/260/355/232/215.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//353/215/260/354/235/264/355/204/260.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//353/260/260/355/217/254.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//353/266/200/354/261/204 /354/271/264/353/223/234.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/204/234/353/262/204 /353/260/260/355/217/254 /302/267 /354/232/264/354/230/201.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/204/244/352/263/204.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/204/270/354/205/230 /352/270/260/353/241/235.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/213/234/354/212/244/355/205/234 /352/265/254/354/241/260.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/225/204/353/212/224 /352/270/260/354/210/240.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/225/204/354/235/264/353/224/224/354/226/264.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/227/255/353/237/211 /354/271/264/353/223/234.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//354/236/221/354/227/205 /353/202/230/353/210/204/352/270/260 /352/270/260/354/244/200.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/224/204/353/241/234/354/240/235/355/212/270 /354/240/225/354/235/230/354/204/234.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/224/214/353/236/253/355/217/274 /354/227/260/353/217/231.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/225/240 /354/235/274.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/230/221/354/227/205 /352/267/234/354/271/231.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/231/224/353/251/264.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/templates//355/232/214/354/235/230/353/241/235.md" +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/names.yaml +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/close.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/docs_mode.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/health.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/runlog.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/sessions.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/tools/skills.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/__init__.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/branches.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/dbml.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/epic_rules.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/ideas.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/pack.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/progress.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/scaffold.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/screen.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/stages.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/work/tasks.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec.egg-info/dependency_links.txt +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec.egg-info/entry_points.txt +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec.egg-info/requires.txt +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec.egg-info/top_level.txt +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_checks.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_core.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_english.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_enums_single_source.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_git.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_install_and_aux.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_layout.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_learning_line.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_messages.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_name_overlap.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_names.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_obsidian.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_principles.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_principles_data.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_release_script.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_resume.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_skill_commands.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_tool_health.py +0 -0
- {lanternspec-0.2.2 → lanternspec-0.2.4}/tests/test_work_line.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lanternspec
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Spec-driven development for agentic software engineering
|
|
5
5
|
Author: Jihyeok Jeong
|
|
6
6
|
License-Expression: MIT
|
|
@@ -181,7 +181,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
|
|
|
181
181
|
| Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
|
|
182
182
|
| Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
|
|
183
183
|
|
|
184
|
-
- **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone.
|
|
184
|
+
- **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone. When a file goes past what the installed tools read in full, `lantern doctor` tells you.
|
|
185
185
|
- **Codex and Antigravity share the skills folder.** When you use both, skill bodies say `/l-build`, and `AGENTS.md` tells Codex to use `$` instead.
|
|
186
186
|
|
|
187
187
|
## Keeping documents and code in line
|
|
@@ -239,6 +239,7 @@ Picks design principles and code conventions from a table, based on the project
|
|
|
239
239
|
|
|
240
240
|
- Languages: Python · TypeScript · Swift · Rust · Go
|
|
241
241
|
- The essentials go into `AGENTS.md`; the full explanation goes into `Development Principles.md`.
|
|
242
|
+
- When two or more folders have their own package file (`pyproject.toml`, `package.json` …) (such as `backend` and `web`, `lantern parts`), each part gets its own `AGENTS.md` with its language conventions and check commands, and hooks hand it to tools that don't read folder `AGENTS.md` files themselves (Codex · Antigravity).
|
|
242
243
|
- In existing projects, lint and format settings already in use are recorded, never changed.
|
|
243
244
|
- When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
|
|
244
245
|
- The language of code comments can be set apart from the documents with `project.comment_language`.
|
|
@@ -262,7 +263,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
262
263
|
|
|
263
264
|
```text
|
|
264
265
|
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
|
|
265
|
-
profile profile show|docs|write|set · principles show|detect · enums list|rename · sections list|rename|off|on
|
|
266
|
+
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
266
267
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
267
268
|
checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
|
|
268
269
|
work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
|
|
@@ -166,7 +166,7 @@ When Obsidian first asks whether to turn on community plugins, turn them on (lea
|
|
|
166
166
|
| Codex | `.agents/skills` (`$l-…`) | `AGENTS.md` | `.codex/hooks.json` | `.codex/config.toml` |
|
|
167
167
|
| Antigravity CLI (`agy`) | `.agents/skills` | `AGENTS.md` | `.agents/hooks.json` (no save-before-compaction — there is no compaction hook) | `.agents/plugins/lanternspec/` |
|
|
168
168
|
|
|
169
|
-
- **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone.
|
|
169
|
+
- **Rules live in `AGENTS.md`.** LanternSpec manages only the `<!-- lanternspec:start -->` block inside it and leaves everything outside the block alone. When a file goes past what the installed tools read in full, `lantern doctor` tells you.
|
|
170
170
|
- **Codex and Antigravity share the skills folder.** When you use both, skill bodies say `/l-build`, and `AGENTS.md` tells Codex to use `$` instead.
|
|
171
171
|
|
|
172
172
|
## Keeping documents and code in line
|
|
@@ -224,6 +224,7 @@ Picks design principles and code conventions from a table, based on the project
|
|
|
224
224
|
|
|
225
225
|
- Languages: Python · TypeScript · Swift · Rust · Go
|
|
226
226
|
- The essentials go into `AGENTS.md`; the full explanation goes into `Development Principles.md`.
|
|
227
|
+
- When two or more folders have their own package file (`pyproject.toml`, `package.json` …) (such as `backend` and `web`, `lantern parts`), each part gets its own `AGENTS.md` with its language conventions and check commands, and hooks hand it to tools that don't read folder `AGENTS.md` files themselves (Codex · Antigravity).
|
|
227
228
|
- In existing projects, lint and format settings already in use are recorded, never changed.
|
|
228
229
|
- When the code grows past a size boundary, `lantern doctor` asks whether to raise the principles one level.
|
|
229
230
|
- The language of code comments can be set apart from the documents with `project.comment_language`.
|
|
@@ -247,7 +248,7 @@ Import mockups with `lantern screen import`; `lantern screen compare` finds wher
|
|
|
247
248
|
|
|
248
249
|
```text
|
|
249
250
|
setup install [--language] [--tools] [--mcp] [--ci|--no-ci] · upgrade [--apply] · doctor · harness suggest
|
|
250
|
-
profile profile show|docs|write|set · principles show|detect · enums list|rename · sections list|rename|off|on
|
|
251
|
+
profile profile show|docs|write|set · principles show|detect · parts [add|ignore] · enums list|rename · sections list|rename|off|on
|
|
251
252
|
documents scaffold init [--plan] | work | doc | idea | adr | meeting | custom · new-id · map · meta get|set
|
|
252
253
|
checks check [--changed] [--epic W-012] · lint · check-dbml · dbml render|from-sql|diff
|
|
253
254
|
work task next [--all]|start|done|ac|list|estimate · task add [--parallel] · pack · screen import|compare
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"""How big a rules file may be, from the limits of the installed AI tools — measured in bytes and lines, never tokens.
|
|
2
|
+
|
|
3
|
+
Every tokenizer spends at least one byte per token, so a text of N bytes is at most N tokens for any
|
|
4
|
+
model. Comparing bytes with a token limit is therefore safe whatever the model, needs no tokenizer
|
|
5
|
+
or API, and always gives the same answer for the same file. Korean (3 bytes a letter) and English
|
|
6
|
+
(1 byte) weigh differently on their own.
|
|
7
|
+
|
|
8
|
+
Responsibilities:
|
|
9
|
+
- the budget of the root AGENTS.md and of a folder's AGENTS.md, from the installed tools' limits
|
|
10
|
+
- measure a rules file and say which part (LanternSpec's block or the person's text) is large
|
|
11
|
+
|
|
12
|
+
Not here:
|
|
13
|
+
- each tool's limits → the tool files (Tool.rules_max_lines · rules_max_bytes · rules_chain_max_bytes · hook_context_max_tokens)
|
|
14
|
+
- showing the result → check/doctor.py · tools/install.py
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from __future__ import annotations
|
|
18
|
+
|
|
19
|
+
from collections.abc import Iterable
|
|
20
|
+
from dataclasses import dataclass
|
|
21
|
+
|
|
22
|
+
from ..core.messages import msg
|
|
23
|
+
|
|
24
|
+
MARGIN = 0.9 # stay this far inside the tightest limit
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclass
|
|
28
|
+
class Budget:
|
|
29
|
+
"""How big one rules file may be; None where no installed tool sets a limit.
|
|
30
|
+
|
|
31
|
+
Attributes:
|
|
32
|
+
max_lines: Lines.
|
|
33
|
+
max_bytes: Bytes (UTF-8).
|
|
34
|
+
|
|
35
|
+
Example:
|
|
36
|
+
>>> Budget(200, None).max_lines
|
|
37
|
+
200
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
max_lines: int | None
|
|
41
|
+
max_bytes: int | None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _tightest(values: Iterable[int]) -> int | None:
|
|
45
|
+
found = [v for v in values if v > 0]
|
|
46
|
+
return min(found) if found else None
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def root_budget(tools: Iterable[object]) -> Budget:
|
|
50
|
+
"""The budget of the root AGENTS.md, which every tool reads at the start of a session.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
tools: The installed tool adapters.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
The tightest line limit as is (a guideline), and the tightest byte limit with a margin.
|
|
57
|
+
|
|
58
|
+
Example:
|
|
59
|
+
>>> from lanternspec.tools import resolve
|
|
60
|
+
>>> root_budget(resolve(["claude", "antigravity"]))
|
|
61
|
+
Budget(max_lines=200, max_bytes=21600)
|
|
62
|
+
"""
|
|
63
|
+
tools = list(tools)
|
|
64
|
+
lines = _tightest(getattr(t, "rules_max_lines", 0) for t in tools)
|
|
65
|
+
raw = _tightest([*(getattr(t, "rules_max_bytes", 0) for t in tools), *(getattr(t, "rules_chain_max_bytes", 0) for t in tools)])
|
|
66
|
+
return Budget(lines, int(raw * MARGIN) if raw else None)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def folder_budget(tools: Iterable[object]) -> Budget:
|
|
70
|
+
"""The budget of a folder's AGENTS.md, which a hook may have to hand to the AI in one go.
|
|
71
|
+
|
|
72
|
+
A hook's token limit counts as that many bytes (one token is at least one byte).
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
tools: The installed tool adapters.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
The budget, with a margin on bytes.
|
|
79
|
+
|
|
80
|
+
Example:
|
|
81
|
+
>>> from lanternspec.tools import resolve
|
|
82
|
+
>>> folder_budget(resolve(["claude", "codex"]))
|
|
83
|
+
Budget(max_lines=200, max_bytes=7200)
|
|
84
|
+
"""
|
|
85
|
+
tools = list(tools)
|
|
86
|
+
lines = _tightest(getattr(t, "rules_max_lines", 0) for t in tools)
|
|
87
|
+
raw = _tightest([*(getattr(t, "rules_max_bytes", 0) for t in tools), *(getattr(t, "hook_context_max_tokens", 0) for t in tools)])
|
|
88
|
+
return Budget(lines, int(raw * MARGIN) if raw else None)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def size(text: str) -> tuple[int, int]:
|
|
92
|
+
r"""Measure a text.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
text: The text.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
(UTF-8 bytes, lines).
|
|
99
|
+
|
|
100
|
+
Example:
|
|
101
|
+
>>> size("가나\nab\n")
|
|
102
|
+
(10, 2)
|
|
103
|
+
"""
|
|
104
|
+
return len(text.encode("utf-8")), len(text.splitlines())
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def parts(text: str, start: str, end: str) -> tuple[int, int]:
|
|
108
|
+
r"""Split a rules file's bytes into LanternSpec's block and the person's own text.
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
text: The rules file.
|
|
112
|
+
start: The mark opening LanternSpec's block.
|
|
113
|
+
end: The mark closing it.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
(bytes of the block, bytes of everything else).
|
|
117
|
+
|
|
118
|
+
Example:
|
|
119
|
+
>>> parts("# 우리\n<!-- s -->\nab\n<!-- e -->\n", "<!-- s -->", "<!-- e -->")
|
|
120
|
+
(24, 10)
|
|
121
|
+
"""
|
|
122
|
+
s, e = text.find(start), text.find(end)
|
|
123
|
+
if s == -1 or e < s:
|
|
124
|
+
return 0, size(text)[0]
|
|
125
|
+
block = text[s : e + len(end)]
|
|
126
|
+
return size(block)[0], size(text)[0] - size(block)[0]
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def check(name: str, text: str, budget: Budget, start: str, end: str) -> tuple[str, str]:
|
|
130
|
+
r"""Compare a rules file with its budget.
|
|
131
|
+
|
|
132
|
+
Args:
|
|
133
|
+
name: How to call the file, e.g. "AGENTS.md".
|
|
134
|
+
text: Its text.
|
|
135
|
+
budget: Its budget.
|
|
136
|
+
start: The mark opening LanternSpec's block.
|
|
137
|
+
end: The mark closing it.
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
("ok" | "warn", message); over budget says which part is large.
|
|
141
|
+
|
|
142
|
+
Example:
|
|
143
|
+
>>> check("AGENTS.md", "a\n" * 300, Budget(200, None), "<s>", "<e>")[0]
|
|
144
|
+
'warn'
|
|
145
|
+
"""
|
|
146
|
+
n_bytes, n_lines = size(text)
|
|
147
|
+
over_lines = budget.max_lines is not None and n_lines > budget.max_lines
|
|
148
|
+
over_bytes = budget.max_bytes is not None and n_bytes > budget.max_bytes
|
|
149
|
+
limits = [f"{budget.max_bytes / 1024:.1f}KB"] if budget.max_bytes else []
|
|
150
|
+
limits += [msg("{count} lines", count=budget.max_lines)] if budget.max_lines else []
|
|
151
|
+
now = msg(
|
|
152
|
+
"{name} {kb:.1f}KB · {lines} lines (budget {budget})", name=name, kb=n_bytes / 1024, lines=n_lines, budget=" · ".join(limits) or "-"
|
|
153
|
+
)
|
|
154
|
+
if not (over_lines or over_bytes):
|
|
155
|
+
return "ok", now
|
|
156
|
+
block, own = parts(text, start, end)
|
|
157
|
+
return "warn", now + msg(
|
|
158
|
+
" — over budget: LanternSpec's block {block:.1f}KB · your own text {own:.1f}KB; move details into documents and link them",
|
|
159
|
+
block=block / 1024,
|
|
160
|
+
own=own / 1024,
|
|
161
|
+
)
|
|
@@ -123,10 +123,74 @@ def run(project: Project) -> list[tuple[str, str]]:
|
|
|
123
123
|
agents = project.root / "AGENTS.md"
|
|
124
124
|
if not agents.exists() or AGENTS_START not in read(agents):
|
|
125
125
|
out.append((WARN, msg("AGENTS.md has no LanternSpec rules — lantern upgrade")))
|
|
126
|
+
out += _part_rows(project)
|
|
127
|
+
out += _budget_rows(project, list(st.get("tools") or []))
|
|
126
128
|
out += _tool_rows(project, list(st.get("tools") or []))
|
|
127
129
|
return out
|
|
128
130
|
|
|
129
131
|
|
|
132
|
+
def _part_rows(project: Project) -> list[tuple[str, str]]:
|
|
133
|
+
"""Ask about undecided part candidates, and point out folder AGENTS.md files some tools never get."""
|
|
134
|
+
from ..tools import REGISTRY
|
|
135
|
+
from ..tools.parts import statuses, unseen_rules
|
|
136
|
+
|
|
137
|
+
out = []
|
|
138
|
+
found = statuses(project)
|
|
139
|
+
open_ = [s.path for s in found if s.state == "new"]
|
|
140
|
+
if open_ and sum(1 for s in found if s.state != "ignored") >= 2:
|
|
141
|
+
out.append(
|
|
142
|
+
(
|
|
143
|
+
WARN,
|
|
144
|
+
msg(
|
|
145
|
+
"Sub-projects that could get their own rules (parts), not decided yet: {items} — lantern parts", items=", ".join(open_)
|
|
146
|
+
),
|
|
147
|
+
)
|
|
148
|
+
)
|
|
149
|
+
tools = [REGISTRY[n] for n in state.load(project).get("tools") or [] if n in REGISTRY]
|
|
150
|
+
unseen, blind = unseen_rules(project, tools)
|
|
151
|
+
if unseen:
|
|
152
|
+
out.append((WARN, unseen_note(unseen, blind)))
|
|
153
|
+
return out
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def unseen_note(files: list[str], tools: list[str]) -> str:
|
|
157
|
+
"""Say which folder AGENTS.md files some tools never get, and where to put what matters.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
files: The AGENTS.md files.
|
|
161
|
+
tools: The tools that won't get them.
|
|
162
|
+
|
|
163
|
+
Returns:
|
|
164
|
+
One line.
|
|
165
|
+
|
|
166
|
+
Example:
|
|
167
|
+
>>> unseen_note(["backend/app/AGENTS.md"], ["Codex"]).split(":")[0]
|
|
168
|
+
'backend/app/AGENTS.md'
|
|
169
|
+
"""
|
|
170
|
+
return msg(
|
|
171
|
+
"{items}: not handed to {tools} — only the AGENTS.md right in a part's folder is; move what matters there (lantern parts)",
|
|
172
|
+
items=", ".join(files),
|
|
173
|
+
tools=" · ".join(tools),
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def _budget_rows(project: Project, names: list[str]) -> list[tuple[str, str]]:
|
|
178
|
+
"""Check the root and every folder's AGENTS.md against the budget the installed AI tools allow."""
|
|
179
|
+
from ..tools import REGISTRY
|
|
180
|
+
from ..tools.rules import AGENTS_END, nested_agents
|
|
181
|
+
from .budget import check, folder_budget, root_budget
|
|
182
|
+
|
|
183
|
+
tools = [REGISTRY[n] for n in names if n in REGISTRY]
|
|
184
|
+
files = [("AGENTS.md", root_budget(tools))] + [(rel, folder_budget(tools)) for rel in nested_agents(project)]
|
|
185
|
+
out = []
|
|
186
|
+
for rel, budget in files:
|
|
187
|
+
path = project.root / rel
|
|
188
|
+
if path.exists():
|
|
189
|
+
level, text = check(rel, read(path), budget, AGENTS_START, AGENTS_END)
|
|
190
|
+
out.append((LEVELS[level], text))
|
|
191
|
+
return out
|
|
192
|
+
|
|
193
|
+
|
|
130
194
|
def _tool_rows(project: Project, names: list[str]) -> list[tuple[str, str]]:
|
|
131
195
|
"""Check each installed AI tool: it reads our rules, its version against the checked ones, its hooks still running, odd payloads."""
|
|
132
196
|
from ..tools import REGISTRY, health
|
|
@@ -102,6 +102,51 @@ def cmd_profile(a: argparse.Namespace) -> int:
|
|
|
102
102
|
return 1
|
|
103
103
|
|
|
104
104
|
|
|
105
|
+
def cmd_parts(a: argparse.Namespace) -> int:
|
|
106
|
+
"""`lantern parts [add|ignore <folder>]` — folders that get their own rules: candidates and decisions."""
|
|
107
|
+
from ..tools import parts
|
|
108
|
+
|
|
109
|
+
project = _p()
|
|
110
|
+
try:
|
|
111
|
+
if a.action == "add":
|
|
112
|
+
part = parts.add(project, a.path)
|
|
113
|
+
print(
|
|
114
|
+
msg("✔ Part {path} ({items}) — lantern upgrade writes its AGENTS.md", path=part["path"], items=", ".join(part["languages"]))
|
|
115
|
+
)
|
|
116
|
+
elif a.action == "ignore":
|
|
117
|
+
parts.ignore(project, a.path)
|
|
118
|
+
print(msg("✔ {path} is not a part — not asked again", path=a.path))
|
|
119
|
+
except ValueError as e:
|
|
120
|
+
raise CliError(str(e)) from e
|
|
121
|
+
if a.action:
|
|
122
|
+
return 0
|
|
123
|
+
found = parts.statuses(project)
|
|
124
|
+
print(
|
|
125
|
+
msg(
|
|
126
|
+
"A part is a sub-project inside this repository: a folder such as backend (Python) or frontend (TypeScript) "
|
|
127
|
+
"with its own language and check commands."
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
print(msg("With two or more parts, each gets its own AGENTS.md, and the AI follows that folder's rules while it works there."))
|
|
131
|
+
print()
|
|
132
|
+
if not found:
|
|
133
|
+
print(
|
|
134
|
+
msg(
|
|
135
|
+
"No sub-folder has its own package file (pyproject.toml · package.json …) — "
|
|
136
|
+
"no need to split; the root AGENTS.md covers the whole project"
|
|
137
|
+
)
|
|
138
|
+
)
|
|
139
|
+
else:
|
|
140
|
+
print(msg("Candidates — folders with their own package file (pyproject.toml · package.json …):"))
|
|
141
|
+
label = {"added": msg("part"), "ignored": msg("ignored"), "new": msg("not decided")}
|
|
142
|
+
for s in found:
|
|
143
|
+
why = ", ".join(s.evidence) or msg("no package file found any more")
|
|
144
|
+
print(f" {s.path} ({', '.join(s.languages) or '-'}) · {label[s.state]} · {why}")
|
|
145
|
+
if any(s.state == "new" for s in found):
|
|
146
|
+
print(msg("→ make it a part: lantern parts add <folder> · not a part: lantern parts ignore <folder>"))
|
|
147
|
+
return 0
|
|
148
|
+
|
|
149
|
+
|
|
105
150
|
def cmd_principles(a: argparse.Namespace) -> int:
|
|
106
151
|
"""`lantern principles show|detect` — show the chosen design principles · detect languages and tools already in use."""
|
|
107
152
|
from ..core import principles
|
|
@@ -338,6 +383,13 @@ def register(add: Add) -> None:
|
|
|
338
383
|
):
|
|
339
384
|
p.add_argument(f"--{flag}")
|
|
340
385
|
p.add_argument("--external", choices=["yes", "no"], help=msg("Connects to outside tools · services"))
|
|
386
|
+
p = add(
|
|
387
|
+
"parts",
|
|
388
|
+
cmd_parts,
|
|
389
|
+
msg("Split the repository into sub-projects (parts), each with its own AI rules (AGENTS.md) — candidates · add · ignore"),
|
|
390
|
+
)
|
|
391
|
+
p.add_argument("action", nargs="?", choices=["add", "ignore"])
|
|
392
|
+
p.add_argument("path", nargs="?")
|
|
341
393
|
p = add("principles", cmd_principles, msg("Design principles · code conventions — show the choice · detect languages and tools in use"))
|
|
342
394
|
p.add_argument("action", choices=["show", "detect"])
|
|
343
395
|
p.add_argument("--write", action="store_true", help=msg("detect: write code size · languages · check commands to lantern.yaml"))
|
|
@@ -7,6 +7,7 @@ Responsibilities:
|
|
|
7
7
|
- pick code conventions by language and size
|
|
8
8
|
- turn line and people counts into sizes (small · medium · large)
|
|
9
9
|
- detect languages, runners and tools already in use from the project's top-level files
|
|
10
|
+
- find folders with their own manifest (candidates for parts with their own rules)
|
|
10
11
|
|
|
11
12
|
Not here:
|
|
12
13
|
- counting lines of code → report/harness.py (code_lines)
|
|
@@ -402,15 +403,39 @@ def select(profile: Profile) -> Selection | None:
|
|
|
402
403
|
note = str(p.get("data_note") or "") if kind == "data" else ""
|
|
403
404
|
principles.append(Principle(pid, p["name"], level, why, p["explain"], tuple(p["rules"]), note))
|
|
404
405
|
always = tuple((a["name"], tuple(a["rules"])) for a in t["always"].values())
|
|
405
|
-
|
|
406
|
-
convs
|
|
407
|
-
|
|
406
|
+
convs = conventions_for(profile, list(profile.get("project.languages") or []))
|
|
407
|
+
return Selection(kind, external, code, people, tuple(principles), always, convs, locale)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def conventions_for(profile: Profile, languages: list[str]) -> tuple[Convention, ...]:
|
|
411
|
+
"""Pick the code conventions of some languages for the project's size (and kind, for doc comments).
|
|
412
|
+
|
|
413
|
+
Args:
|
|
414
|
+
profile: Project profile (code size · kind · languages of documents and comments).
|
|
415
|
+
languages: Programming languages, e.g. the languages of one part of the project.
|
|
416
|
+
|
|
417
|
+
Returns:
|
|
418
|
+
One convention per known language, in the given order.
|
|
419
|
+
|
|
420
|
+
Example:
|
|
421
|
+
>>> from lanternspec.core.profile import DEFAULTS, Profile
|
|
422
|
+
>>> [c.label for c in conventions_for(Profile(DEFAULTS), ["typescript", "cobol"])]
|
|
423
|
+
['TypeScript']
|
|
424
|
+
"""
|
|
425
|
+
locale = profile.language
|
|
426
|
+
code = str(profile.get("project.code_size") or SIZES[0])
|
|
427
|
+
kind = profile.get("project.kind")
|
|
428
|
+
docs_size = (table(locale)["kinds"][kind].get("docs") if kind else None) or code
|
|
429
|
+
out = []
|
|
430
|
+
for lang in languages:
|
|
431
|
+
if lang not in language_names():
|
|
432
|
+
continue
|
|
408
433
|
c = conventions(lang, locale, profile.comment_language)
|
|
409
434
|
rules = dict(c["levels"][code])
|
|
410
435
|
rules["docs"] = c["levels"][docs_size]["docs"]
|
|
411
436
|
tools = {role: (spec["name"], _default_command(c, role)) for role, spec in c["tools"].items()}
|
|
412
|
-
|
|
413
|
-
return
|
|
437
|
+
out.append(Convention(lang, c["label"], code, tools, rules, c["docs"]["style"], c["docs"]["example"]))
|
|
438
|
+
return tuple(out)
|
|
414
439
|
|
|
415
440
|
|
|
416
441
|
@dataclass
|
|
@@ -501,6 +526,80 @@ def detect(root: Path) -> Detected:
|
|
|
501
526
|
return out
|
|
502
527
|
|
|
503
528
|
|
|
529
|
+
# A folder that groups other packages (a workspace root) is not a part itself; its members are.
|
|
530
|
+
WORKSPACE_MARKS = (
|
|
531
|
+
"pnpm-workspace.yaml",
|
|
532
|
+
"go.work",
|
|
533
|
+
"lerna.json",
|
|
534
|
+
'package.json:"workspaces"',
|
|
535
|
+
"pyproject.toml:[tool.uv.workspace]",
|
|
536
|
+
"Cargo.toml:[workspace]",
|
|
537
|
+
)
|
|
538
|
+
PART_DEPTH = 3 # how deep below the root a part's folder may be
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
@dataclass
|
|
542
|
+
class PartCandidate:
|
|
543
|
+
"""A folder that looks like a part of the project with its own toolchain (its own manifest).
|
|
544
|
+
|
|
545
|
+
Attributes:
|
|
546
|
+
path: The folder, relative to the project root ("backend").
|
|
547
|
+
languages: Languages whose manifest is in it.
|
|
548
|
+
evidence: The manifest files that show it.
|
|
549
|
+
|
|
550
|
+
Example:
|
|
551
|
+
>>> PartCandidate("backend", ["python"], ["pyproject.toml"]).path
|
|
552
|
+
'backend'
|
|
553
|
+
"""
|
|
554
|
+
|
|
555
|
+
path: str
|
|
556
|
+
languages: list[str]
|
|
557
|
+
evidence: list[str]
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
def part_candidates(root: Path, files: list[str]) -> list[PartCandidate]:
|
|
561
|
+
"""Find the folders below the root that carry their own manifest — candidates for a part with its own rules.
|
|
562
|
+
|
|
563
|
+
Only the given file list is searched (the caller passes what git tracks, so ignored folders such
|
|
564
|
+
as node_modules never show up). A workspace root is left out when its members are candidates.
|
|
565
|
+
|
|
566
|
+
Args:
|
|
567
|
+
root: Project root (manifests are read to tell workspace roots).
|
|
568
|
+
files: Paths relative to the root, with "/" separators.
|
|
569
|
+
|
|
570
|
+
Returns:
|
|
571
|
+
The candidates, sorted by path; the root itself is never one.
|
|
572
|
+
|
|
573
|
+
Example:
|
|
574
|
+
>>> found = part_candidates(Path("/nowhere"), ["backend/pyproject.toml", "web/package.json", "web/tsconfig.json", "README.md"])
|
|
575
|
+
>>> [(c.path, c.languages) for c in found]
|
|
576
|
+
[('backend', ['python']), ('web', ['typescript'])]
|
|
577
|
+
"""
|
|
578
|
+
from fnmatch import fnmatch
|
|
579
|
+
from pathlib import PurePosixPath
|
|
580
|
+
|
|
581
|
+
patterns = {lang: [str(pat).partition(":")[0] for pat in conventions(lang)["detect"]] for lang in language_names()}
|
|
582
|
+
found: dict[str, dict[str, str]] = {}
|
|
583
|
+
for rel in files:
|
|
584
|
+
path = PurePosixPath(rel)
|
|
585
|
+
parts = path.parts
|
|
586
|
+
for i in range(len(parts)): # a manifest file, or a bundle folder such as App.xcodeproj
|
|
587
|
+
folder, name = "/".join(parts[:i]), parts[i]
|
|
588
|
+
if not folder or len(PurePosixPath(folder).parts) > PART_DEPTH:
|
|
589
|
+
continue
|
|
590
|
+
for lang, pats in patterns.items():
|
|
591
|
+
if any(fnmatch(name, pat) for pat in pats) and (i == len(parts) - 1 or "*" in "".join(pats)):
|
|
592
|
+
found.setdefault(folder, {}).setdefault(lang, name)
|
|
593
|
+
workspaces = {d for d in found if any(_found(root / d, mark) for mark in WORKSPACE_MARKS)}
|
|
594
|
+
out = []
|
|
595
|
+
for folder in sorted(found):
|
|
596
|
+
if folder in workspaces and any(other.startswith(folder + "/") for other in found):
|
|
597
|
+
continue # its members are the parts
|
|
598
|
+
langs = [lang for lang in language_names() if lang in found[folder]]
|
|
599
|
+
out.append(PartCandidate(folder, langs, [found[folder][lang] for lang in langs]))
|
|
600
|
+
return out
|
|
601
|
+
|
|
602
|
+
|
|
504
603
|
def find_runner(root: Path, language: str) -> dict[str, Any]:
|
|
505
604
|
"""Find the runner for a language from its lock file.
|
|
506
605
|
|
|
@@ -56,6 +56,7 @@ DEFAULTS: dict[str, Any] = {
|
|
|
56
56
|
"build": {"report_cycle": "work", "merge_approval": "required", "loop": "off", "loop_limit": 3},
|
|
57
57
|
"check": {"max_lines": 300},
|
|
58
58
|
"report": {"views": ["kanban", "timeline", "debt"]},
|
|
59
|
+
"code": {"parts": [], "ignored_parts": []}, # parts with their own toolchain and rules (lantern parts)
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
KNOWLEDGE_DEFAULTS: dict[str, Any] = {"type": "obsidian", "path": "", "areas_from": None, "write": "direct"}
|
|
@@ -339,6 +340,7 @@ def validate(data: dict[str, Any]) -> list[str]:
|
|
|
339
340
|
if not isinstance(k, dict) or not k.get("path"):
|
|
340
341
|
problems.append(msg("knowledge.path: the knowledge store path is empty (delete the knowledge block if there is none)"))
|
|
341
342
|
problems += _section_problems(data)
|
|
343
|
+
problems += _part_problems(data)
|
|
342
344
|
if get_path(data, "project.team") == "team" and not get_path(data, "project.members"):
|
|
343
345
|
problems.append(msg("project.members: for a team (2 or more), list the owner candidates"))
|
|
344
346
|
if get_path(data, "lantern") != PROFILE_VERSION:
|
|
@@ -346,6 +348,32 @@ def validate(data: dict[str, Any]) -> list[str]:
|
|
|
346
348
|
return problems
|
|
347
349
|
|
|
348
350
|
|
|
351
|
+
def _part_problems(data: dict[str, Any]) -> list[str]:
|
|
352
|
+
"""Check code.parts (folders with their own rules) and code.ignored_parts."""
|
|
353
|
+
problems: list[str] = []
|
|
354
|
+
parts = get_path(data, "code.parts") or []
|
|
355
|
+
if not isinstance(parts, list):
|
|
356
|
+
return [msg("code.parts: must be a list of parts (e.g. - path: backend)")]
|
|
357
|
+
for part in parts:
|
|
358
|
+
path = part.get("path") if isinstance(part, dict) else None
|
|
359
|
+
if not isinstance(path, str) or not path or path.startswith(("/", ".")) or ".." in path.split("/"):
|
|
360
|
+
problems.append(msg("code.parts: each part needs a folder path inside the project (e.g. path: backend)"))
|
|
361
|
+
continue
|
|
362
|
+
for lang in part.get("languages") or []:
|
|
363
|
+
if lang not in principles.language_names():
|
|
364
|
+
problems.append(
|
|
365
|
+
msg(
|
|
366
|
+
"code.parts {path}: '{lang}' is not a known language ({items})",
|
|
367
|
+
path=path,
|
|
368
|
+
lang=lang,
|
|
369
|
+
items=", ".join(principles.language_names()),
|
|
370
|
+
)
|
|
371
|
+
)
|
|
372
|
+
if not isinstance(get_path(data, "code.ignored_parts") or [], list):
|
|
373
|
+
problems.append(msg("code.ignored_parts: must be a list of folders"))
|
|
374
|
+
return problems
|
|
375
|
+
|
|
376
|
+
|
|
349
377
|
def _section_problems(data: dict[str, Any]) -> list[str]:
|
|
350
378
|
"""Check project.language and the protected-section decisions (docs.sections · docs.unused_sections)."""
|
|
351
379
|
language = str(get_path(data, "project.language") or "ko")
|
|
@@ -568,8 +596,21 @@ def render(data: dict[str, Any]) -> str:
|
|
|
568
596
|
msg(" max_lines: {s} # warn to split when longer (doesn't block)", s=s(d["check"]["max_lines"])),
|
|
569
597
|
"report:",
|
|
570
598
|
f" views: {s(d['report']['views'])}",
|
|
571
|
-
"",
|
|
572
599
|
]
|
|
600
|
+
code = d.get("code") or {}
|
|
601
|
+
if code.get("parts") or code.get("ignored_parts"):
|
|
602
|
+
lines += [
|
|
603
|
+
"code:",
|
|
604
|
+
msg(
|
|
605
|
+
" # parts = sub-projects with their own package file (pyproject.toml · package.json …) — "
|
|
606
|
+
"lantern parts (each gets its own AGENTS.md)"
|
|
607
|
+
),
|
|
608
|
+
]
|
|
609
|
+
body = yaml.safe_dump(
|
|
610
|
+
{"parts": code.get("parts") or [], "ignored_parts": code.get("ignored_parts") or []}, allow_unicode=True, sort_keys=False
|
|
611
|
+
)
|
|
612
|
+
lines += [" " + line for line in body.rstrip("\n").split("\n")]
|
|
613
|
+
lines.append("")
|
|
573
614
|
return "\n".join(lines)
|
|
574
615
|
|
|
575
616
|
|
|
@@ -623,8 +664,9 @@ def update(root: Path, updates: dict[str, Any]) -> None:
|
|
|
623
664
|
raise ValueError("\n".join(problems))
|
|
624
665
|
text: str | None = path.read_text(encoding="utf-8")
|
|
625
666
|
for k, v in updates.items():
|
|
626
|
-
# a mapping spans several lines: render the whole file again instead of editing one line
|
|
627
|
-
|
|
667
|
+
# a mapping (or a list of them) spans several lines: render the whole file again instead of editing one line
|
|
668
|
+
flat = not isinstance(v, dict) and not (isinstance(v, list) and any(isinstance(x, dict) for x in v))
|
|
669
|
+
text = set_in_text(text, k, v) if text is not None and flat else None
|
|
628
670
|
if text is None: # a key not written in the file yet: render the whole file again
|
|
629
671
|
save(root, data)
|
|
630
672
|
else:
|
{lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/en/skills/l-init/SKILL.md
RENAMED
|
@@ -75,6 +75,11 @@ lantern scaffold init --plan # the folders · documents it would create (
|
|
|
75
75
|
```
|
|
76
76
|
Tell the user the `principles show` result in a line or two (e.g. "CLI tool · external integrations → single responsibility and extension points are Must; Python uses ruff · pyright").
|
|
77
77
|
|
|
78
|
+
**Parts (each folder its own rules):** a part is a sub-project inside the repository — a folder with its own language and check commands.
|
|
79
|
+
`lantern parts` lists the sub-folders with their own package file (`pyproject.toml` · `package.json` …, e.g. `backend` · `frontend/apps/web`) as candidates.
|
|
80
|
+
With **two or more**, ask about all of them at once, each with its evidence — "Make this folder a part?" — then `lantern parts add <folder>` · `lantern parts ignore <folder>` as answered.
|
|
81
|
+
Two or more parts each get their own `AGENTS.md` (that language's conventions · that folder's check commands), and the root AGENTS.md keeps a map of the parts. With one candidate or none, don't ask.
|
|
82
|
+
|
|
78
83
|
**Tool settings files:**
|
|
79
84
|
- 🏠 brownfield: settings `detect` finds **already in use are only recorded** — don't change settings files (`pyproject.toml` · `.eslintrc` …) or suggest switching tools. For a tool in the conventions that has no settings, only ask "add it?".
|
|
80
85
|
- 🌱 greenfield: **ask** whether to add the convention's tools as dev dependencies (e.g. `uv add --dev ruff pyright` · `pnpm add -D @biomejs/biome typescript`) and create their settings (e.g. `[tool.ruff]` · `[tool.pyright]` in `pyproject.toml`), and **do it once approved**. They must be dev dependencies so CI installs the same tools. If declined, clear them with `lantern profile set build.lint= build.typecheck=`.
|
{lanternspec-0.2.2 → lanternspec-0.2.4}/src/lanternspec/resources/locales/ko/skills/l-init/SKILL.md
RENAMED
|
@@ -76,6 +76,11 @@ lantern scaffold init --plan # 만들 폴더 · 문서 목록 (아직 아
|
|
|
76
76
|
```
|
|
77
77
|
`principles show` 결과를 한두 줄로 알려 준다 (예: "CLI 도구 · 바깥 연결 → 단일 책임 · 확장 지점은 지킴, Python은 ruff · pyright").
|
|
78
78
|
|
|
79
|
+
**영역 (폴더마다 자기 규칙):** 영역은 저장소 안의 하위 프로젝트다 — 언어와 검사 명령이 따로인 폴더.
|
|
80
|
+
`lantern parts`가 패키지 설정 파일(`pyproject.toml` · `package.json` 등)을 따로 가진 하위 폴더(예: `backend` · `frontend/apps/web`)를 후보로 보여 준다.
|
|
81
|
+
후보가 **둘 이상**이면 각각 근거와 함께 "이 폴더를 영역으로 둘까요?"를 한 번에 묻고, 답대로 `lantern parts add <폴더>` · `lantern parts ignore <폴더>`.
|
|
82
|
+
영역이 둘 이상이면 영역마다 `AGENTS.md`(그 언어의 컨벤션 · 그 폴더의 확인 명령)가 생기고, 루트 AGENTS.md에는 영역 지도가 남는다. 후보가 하나 이하면 묻지 않는다.
|
|
83
|
+
|
|
79
84
|
**도구 설정 파일:**
|
|
80
85
|
- 🏠 brownfield: `detect`가 찾은 **이미 쓰는 설정은 기록만** 한다 — 설정 파일(`pyproject.toml` · `.eslintrc` 등)을 바꾸거나 다른 도구로 갈아타자고 하지 않는다. 컨벤션에 있는데 설정이 없는 도구는 "들일까요?"만 묻는다.
|
|
81
86
|
- 🌱 greenfield: 컨벤션의 도구를 개발 의존성에 넣고(예: `uv add --dev ruff pyright` · `pnpm add -D @biomejs/biome typescript`) 설정(예: `pyproject.toml`의 `[tool.ruff]` · `[tool.pyright]`)을 만들지 **묻고, 승인하면** 한다. 개발 의존성에 있어야 CI에서도 같은 도구가 설치된다. 거절하면 `lantern profile set build.lint= build.typecheck=`로 비운다.
|