Skip to content

Commit 5f4d3e2

Browse files
mickmickshclaude
andcommitted
chore: bump to v0.4.1 -- default to L1 skill generation
L2 (AI-enhanced) skill generation scored lower than L1 at higher cost. Remove auto-detection of claude CLI; default to Layer 1 (mechanical). Use --ai to explicitly opt in to L2. Also: refactor skill_llm prompt to be additive rather than destructive, add releasing docs to CLAUDE.md, track .claude/commands/ in gitignore. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 9edd6f5 commit 5f4d3e2

8 files changed

Lines changed: 56 additions & 27 deletions

File tree

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ env/
2424
# Confidential / internal
2525
private/
2626

27-
# Claude Code local settings
28-
.claude/
27+
# Claude Code local settings (keep commands tracked)
28+
.claude/*
29+
!.claude/commands/
2930

3031
# Generated output
3132
output/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to LAP (Lean API Platform) will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.1] - 2026-03-09
9+
10+
### Changed
11+
- Default skill generation no longer auto-detects L2 (AI-enhanced). Defaults to L1 (mechanical). Use `--ai` to opt in.
12+
813
## [0.4.0] - 2026-03-04
914

1015
### Added

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ API Spec (YAML/JSON/SDL/proto)
6565
- All compilers follow the same pattern: take spec input, return format-specific data model, call `.to_lap()`
6666
- All file reads use `encoding='utf-8'` (Windows cp1255 fix)
6767

68+
## Releasing
69+
70+
- **Command**: Use `/release <version>` (e.g. `/release 0.5.0`) to bump, publish, and monitor
71+
- **Version files** (must stay in sync): `lap/__init__.py`, `pyproject.toml`, `sdks/typescript/package.json`
72+
- **Publishing**: GitHub Actions workflows triggered by creating a GitHub Release
73+
- `publish-pypi.yml` -- builds and uploads to PyPI via trusted publishing
74+
- `publish-npm.yml` -- builds and publishes to npm with `NPM_TOKEN` secret
75+
- **PyPI package**: `lapsh` at https://pypi.org/project/lapsh/
76+
- **npm package**: `@lap-platform/lapsh` at https://www.npmjs.com/package/@lap-platform/lapsh
77+
- Never publish manually -- always go through GitHub Releases
78+
6879
## Rules
6980

7081
- Run `python -m pytest tests/ -q` and confirm all tests pass before committing

lap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""LAP -- Lean API Platform. Token-efficient API specs for AI agents."""
22

3-
__version__ = "0.4.0"
3+
__version__ = "0.4.1"

lap/cli/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _resolve_ai(args, ai_attr="ai", layer_attr="layer"):
7474
- --ai flag: force AI enhancement
7575
- --no-ai flag: skip AI
7676
- --layer (deprecated): mapped to 1 or 2
77-
- Default: auto-detect (AI if claude CLI on PATH, else skip)
77+
- Default: no AI (Layer 1). Use --ai to opt in.
7878
"""
7979
ai = getattr(args, ai_attr, None)
8080
if ai is True:
@@ -85,8 +85,7 @@ def _resolve_ai(args, ai_attr="ai", layer_attr="layer"):
8585
if layer is not None:
8686
warn("--layer is deprecated, use --ai or --no-ai")
8787
return layer
88-
import shutil
89-
return 2 if shutil.which("claude") else 1
88+
return 1
9089

9190

9291
def _collect_spec_files(directory):

lap/core/compilers/skill_llm.py

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,27 @@
1414

1515

1616
ENHANCE_PROMPT = """You are enhancing a Claude Code skill for an API. Given the LAP spec below,
17-
generate the following sections in markdown:
17+
generate ADDITIONAL content to supplement (not replace) the existing skill document.
1818
19-
1. **Question Mapping** (10-15 entries): Natural language questions mapped to API endpoints.
20-
Format each as: - "Question?" -> METHOD /path
21-
Cover common use cases, edge cases, and multi-step workflows.
19+
Use ### (level 3) headings only -- never ## (level 2). The output will be appended to an existing
20+
document that already has ## sections.
2221
23-
2. **Response Tips** (one line per endpoint category): How to interpret responses.
24-
Focus on pagination, error patterns, and nested objects.
22+
Generate these sections:
2523
26-
3. **Anomaly Flags**: What should an agent surface proactively?
27-
(e.g., rate limits approaching, deprecated fields, unusual status codes)
24+
### Workflow Playbooks
25+
3-5 common multi-step workflows as numbered lists under descriptive ### headings.
26+
Focus on tasks that chain multiple endpoints together.
2827
29-
4. **Playbook** (3-5 common workflows): Step-by-step guides for typical tasks.
30-
Format as numbered lists under descriptive headings.
28+
### Response Interpretation
29+
One line per endpoint category: how to interpret responses.
30+
Focus on pagination patterns, error codes, nested objects, and status fields.
31+
32+
### Edge Cases and Gotchas
33+
5-10 practical warnings: rate limits, deprecated fields, required-but-undocumented params,
34+
common mistakes, and order-of-operations requirements.
35+
36+
IMPORTANT: Do NOT generate question-to-endpoint mappings -- the existing skill already has a
37+
comprehensive endpoint catalog. Do NOT repeat endpoint names or paths.
3138
3239
Return ONLY the markdown content -- no preamble, no code fences.
3340
@@ -125,11 +132,14 @@ def enhance_skill(spec, skill: SkillOutput, api_key: str = None) -> SkillOutput:
125132
# Fallback: anthropic SDK (deferred import inside _enhance_via_sdk)
126133
enhanced_content = _enhance_via_sdk(prompt, api_key)
127134

128-
# Replace mechanical sections in SKILL.md with LLM-enhanced ones
135+
# Append LLM-enhanced content after existing SKILL.md (additive, not destructive)
129136
skill_md = skill.file_map["SKILL.md"]
130137

131-
# Replace Common Questions section
132-
skill_md = _replace_section(skill_md, "Common Questions", enhanced_content)
138+
# Strip any ## headings from LLM output (force ### only)
139+
enhanced_content = _demote_headings(enhanced_content)
140+
141+
# Append under a new ## section
142+
skill_md = skill_md.rstrip() + "\n\n## LLM-Enhanced Guidance\n\n" + enhanced_content.strip() + "\n"
133143

134144
# Update file map
135145
new_file_map = dict(skill.file_map)
@@ -146,10 +156,13 @@ def enhance_skill(spec, skill: SkillOutput, api_key: str = None) -> SkillOutput:
146156
)
147157

148158

149-
def _replace_section(md: str, section_name: str, new_content: str) -> str:
150-
"""Replace everything from ## {section_name} to the next ## heading."""
159+
def _demote_headings(content: str) -> str:
160+
"""Ensure all headings in LLM output are ### or lower (never ##)."""
151161
import re
152-
pattern = rf'(## {re.escape(section_name)}\n).*?(?=\n## |\Z)'
153-
replacement = f"## Enhanced Skill Content\n{new_content}\n"
154-
result = re.sub(pattern, replacement, md, flags=re.DOTALL)
155-
return result
162+
lines = content.split("\n")
163+
result = []
164+
for line in lines:
165+
if re.match(r'^## [^#]', line):
166+
line = "#" + line # ## -> ###
167+
result.append(line)
168+
return "\n".join(result)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "lapsh"
7-
version = "0.4.0"
7+
version = "0.4.1"
88
description = "Lean API Platform -- Token-efficient API specs for AI agents"
99
readme = "README.md"
1010
license = "Apache-2.0"

sdks/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lap-platform/lapsh",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "TypeScript SDK for LAP (Lean API Platform) -- Parse and work with LAP API specifications",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",

0 commit comments

Comments
 (0)