lcp 1.0.1__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.
- lcp-1.0.1/.claude/skills/git-commit-convention/SKILL.md +165 -0
- lcp-1.0.1/.claude/skills/lcp-writing-documentation/SKILL.md +240 -0
- lcp-1.0.1/.claude-plugin/marketplace.json +20 -0
- lcp-1.0.1/.github/CODEOWNERS +10 -0
- lcp-1.0.1/.github/ISSUE_TEMPLATE/bug_report.yml +98 -0
- lcp-1.0.1/.github/ISSUE_TEMPLATE/config.yml +8 -0
- lcp-1.0.1/.github/ISSUE_TEMPLATE/feature_request.yml +65 -0
- lcp-1.0.1/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- lcp-1.0.1/.github/copilot-instructions.md +82 -0
- lcp-1.0.1/.github/dependabot.yml +34 -0
- lcp-1.0.1/.github/labels.yml +153 -0
- lcp-1.0.1/.github/release-drafter.yml +73 -0
- lcp-1.0.1/.github/workflows/codeql.yml +39 -0
- lcp-1.0.1/.github/workflows/labels.yml +27 -0
- lcp-1.0.1/.github/workflows/pages.yml +39 -0
- lcp-1.0.1/.github/workflows/pr-title.yml +37 -0
- lcp-1.0.1/.github/workflows/publish.yml +38 -0
- lcp-1.0.1/.github/workflows/release-drafter.yml +22 -0
- lcp-1.0.1/.github/workflows/stale.yml +51 -0
- lcp-1.0.1/.github/workflows/tests.yml +106 -0
- lcp-1.0.1/.gitignore +232 -0
- lcp-1.0.1/CLAUDE.md +130 -0
- lcp-1.0.1/CODE_OF_CONDUCT.md +128 -0
- lcp-1.0.1/CONTRIBUTING.md +133 -0
- lcp-1.0.1/LICENSE +21 -0
- lcp-1.0.1/PKG-INFO +336 -0
- lcp-1.0.1/README.md +299 -0
- lcp-1.0.1/SECURITY.md +34 -0
- lcp-1.0.1/docs/api/ai.md +11 -0
- lcp-1.0.1/docs/api/coverage.md +3 -0
- lcp-1.0.1/docs/api/diff.md +3 -0
- lcp-1.0.1/docs/api/generator.md +3 -0
- lcp-1.0.1/docs/api/index.md +20 -0
- lcp-1.0.1/docs/api/mcp-server.md +3 -0
- lcp-1.0.1/docs/api/models.md +5 -0
- lcp-1.0.1/docs/api/publish.md +3 -0
- lcp-1.0.1/docs/api/scanner.md +7 -0
- lcp-1.0.1/docs/api/validator.md +3 -0
- lcp-1.0.1/docs/architecture/ai_docgen/architecture.md +111 -0
- lcp-1.0.1/docs/architecture/ai_docgen/index.md +34 -0
- lcp-1.0.1/docs/architecture/coverage/index.md +84 -0
- lcp-1.0.1/docs/architecture/diff/architecture.md +123 -0
- lcp-1.0.1/docs/architecture/diff/index.md +133 -0
- lcp-1.0.1/docs/architecture/index.md +35 -0
- lcp-1.0.1/docs/architecture/manifest/architecture.md +158 -0
- lcp-1.0.1/docs/architecture/manifest/index.md +102 -0
- lcp-1.0.1/docs/architecture/mcp_server/architecture.md +166 -0
- lcp-1.0.1/docs/architecture/mcp_server/index.md +76 -0
- lcp-1.0.1/docs/architecture/plugin/architecture.md +153 -0
- lcp-1.0.1/docs/architecture/plugin/index.md +67 -0
- lcp-1.0.1/docs/architecture/publish/architecture.md +151 -0
- lcp-1.0.1/docs/architecture/publish/index.md +92 -0
- lcp-1.0.1/docs/assets/logo.32.png +0 -0
- lcp-1.0.1/docs/assets/logo.png +0 -0
- lcp-1.0.1/docs/assets/schema.json +386 -0
- lcp-1.0.1/docs/cli.md +173 -0
- lcp-1.0.1/docs/guides/ai-docgen.md +124 -0
- lcp-1.0.1/docs/guides/claude-code-plugin.md +128 -0
- lcp-1.0.1/docs/guides/mcp-server.md +198 -0
- lcp-1.0.1/docs/guides/publishing.md +97 -0
- lcp-1.0.1/docs/index.md +46 -0
- lcp-1.0.1/docs/introduction.md +58 -0
- lcp-1.0.1/docs/quickstart.md +70 -0
- lcp-1.0.1/docs/spec/examples.md +71 -0
- lcp-1.0.1/docs/spec/index.md +352 -0
- lcp-1.0.1/docs/spec/schema.md +90 -0
- lcp-1.0.1/docs/stylesheets/extra.css +63 -0
- lcp-1.0.1/mkdocs.yml +136 -0
- lcp-1.0.1/plugin/lcp/.claude-plugin/plugin.json +21 -0
- lcp-1.0.1/plugin/lcp/.mcp.json +7 -0
- lcp-1.0.1/plugin/lcp/README.md +147 -0
- lcp-1.0.1/plugin/lcp/agents/library-explorer.md +28 -0
- lcp-1.0.1/plugin/lcp/bin/serve.sh +22 -0
- lcp-1.0.1/plugin/lcp/commands/resolve.md +10 -0
- lcp-1.0.1/plugin/lcp/commands/scan.md +13 -0
- lcp-1.0.1/plugin/lcp/hooks/hooks.json +14 -0
- lcp-1.0.1/plugin/lcp/skills/lcp-universal/SKILL.md +89 -0
- lcp-1.0.1/plugin/lcp/skills/lcp-usage/SKILL.md +78 -0
- lcp-1.0.1/pyproject.toml +66 -0
- lcp-1.0.1/skill/lcp-serve-all/SKILL.md +112 -0
- lcp-1.0.1/skill/lcp-serve-all.skill +0 -0
- lcp-1.0.1/skill/lcp-usage/SKILL.md +86 -0
- lcp-1.0.1/skill/lcp-usage.skill +0 -0
- lcp-1.0.1/src/lcp/__init__.py +135 -0
- lcp-1.0.1/src/lcp/ai/__init__.py +18 -0
- lcp-1.0.1/src/lcp/ai/agent.py +539 -0
- lcp-1.0.1/src/lcp/ai/connectors/__init__.py +6 -0
- lcp-1.0.1/src/lcp/ai/connectors/anthropic.py +110 -0
- lcp-1.0.1/src/lcp/ai/connectors/openai.py +140 -0
- lcp-1.0.1/src/lcp/ai/hierarchy.py +385 -0
- lcp-1.0.1/src/lcp/ai/models.py +78 -0
- lcp-1.0.1/src/lcp/ai/prompts.py +144 -0
- lcp-1.0.1/src/lcp/ai/provider.py +24 -0
- lcp-1.0.1/src/lcp/ai/writer.py +235 -0
- lcp-1.0.1/src/lcp/cli.py +789 -0
- lcp-1.0.1/src/lcp/coverage.py +271 -0
- lcp-1.0.1/src/lcp/diff.py +173 -0
- lcp-1.0.1/src/lcp/generator.py +189 -0
- lcp-1.0.1/src/lcp/mcp_server.py +1425 -0
- lcp-1.0.1/src/lcp/models.py +283 -0
- lcp-1.0.1/src/lcp/publish.py +501 -0
- lcp-1.0.1/src/lcp/scanner.py +542 -0
- lcp-1.0.1/src/lcp/schema.json +386 -0
- lcp-1.0.1/src/lcp/validator.py +113 -0
- lcp-1.0.1/tests/__init__.py +0 -0
- lcp-1.0.1/tests/conftest.py +69 -0
- lcp-1.0.1/tests/sample_module.py +142 -0
- lcp-1.0.1/tests/test_ai_agent.py +400 -0
- lcp-1.0.1/tests/test_ai_connectors.py +191 -0
- lcp-1.0.1/tests/test_ai_hierarchy.py +294 -0
- lcp-1.0.1/tests/test_ai_models.py +159 -0
- lcp-1.0.1/tests/test_ai_writer.py +275 -0
- lcp-1.0.1/tests/test_cli.py +439 -0
- lcp-1.0.1/tests/test_cli_docgen.py +23 -0
- lcp-1.0.1/tests/test_coverage.py +219 -0
- lcp-1.0.1/tests/test_diff.py +386 -0
- lcp-1.0.1/tests/test_generator.py +328 -0
- lcp-1.0.1/tests/test_integration.py +216 -0
- lcp-1.0.1/tests/test_mcp_server.py +1014 -0
- lcp-1.0.1/tests/test_models.py +277 -0
- lcp-1.0.1/tests/test_publish.py +499 -0
- lcp-1.0.1/tests/test_scanner.py +434 -0
- lcp-1.0.1/tests/test_validator.py +281 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-commit-convention
|
|
3
|
+
description: Use when creating any git commit - enforces structured commit messages with a 3-letter action code, title, and description following the project convention
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Git Commit Convention
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
All commits in this project MUST follow the format: `CODE: Title` with a descriptive body.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Every commit message clearly communicates WHAT action was taken and WHY through a structured, scannable format.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of this convention is violating the spirit of this convention.**
|
|
15
|
+
|
|
16
|
+
## The Iron Law
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
NO COMMIT WITHOUT A PROPERLY FORMATTED MESSAGE
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Commit Message Format
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
CODE: Short descriptive title (imperative mood, max ~72 chars)
|
|
26
|
+
|
|
27
|
+
Detailed description of what was done and why.
|
|
28
|
+
Context, motivation, and any relevant details.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Never insert co-authors.**
|
|
32
|
+
|
|
33
|
+
## Action Codes
|
|
34
|
+
|
|
35
|
+
| Code | Meaning | Use When |
|
|
36
|
+
|------|---------|----------|
|
|
37
|
+
| `ADD` | Addition | New files, features, dependencies, or capabilities |
|
|
38
|
+
| `UPD` | Update | Enhancements, modifications to existing functionality |
|
|
39
|
+
| `FIX` | Fix | Bug fixes, error corrections, broken behavior |
|
|
40
|
+
| `DEL` | Delete | Removing files, features, dead code, dependencies |
|
|
41
|
+
| `DOC` | Documentation | README, comments, docstrings, CHANGELOG |
|
|
42
|
+
| `REF` | Refactor | Code restructuring without behavior change |
|
|
43
|
+
| `TST` | Test | Adding or updating tests |
|
|
44
|
+
| `STY` | Style | Formatting, linting, whitespace (no logic change) |
|
|
45
|
+
| `CFG` | Config | Configuration files, environment, build settings |
|
|
46
|
+
| `SEC` | Security | Security patches, vulnerability fixes, auth changes |
|
|
47
|
+
| `DEP` | Dependency | Dependency upgrades, additions, removals |
|
|
48
|
+
| `MRG` | Merge | Merging branches, resolving merge conflicts |
|
|
49
|
+
| `WIP` | Work in Progress | Incomplete work saved to branch (never on main) |
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
### Good
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
ADD: User authentication with JWT tokens
|
|
57
|
+
|
|
58
|
+
Implement JWT-based auth system with login/logout endpoints,
|
|
59
|
+
token refresh, and role-based access control middleware.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
FIX: Payslip parser failing on multi-page PDFs
|
|
64
|
+
|
|
65
|
+
The Azure CU response handler assumed single-page output.
|
|
66
|
+
Updated to iterate all pages and merge extracted fields.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
REF: Extract payslip validation into dedicated service
|
|
71
|
+
|
|
72
|
+
Moved validation logic from workflow into PayslipValidator
|
|
73
|
+
service class to improve testability and separation of concerns.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
DEL: Remove legacy CSV export endpoint
|
|
78
|
+
|
|
79
|
+
CSV export was replaced by the JSON export in v2.1.
|
|
80
|
+
Endpoint had no consumers for 3 months per access logs.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
CFG: Add CORS configuration for staging environment
|
|
85
|
+
|
|
86
|
+
Added staging domain to allowed origins in FastAPI middleware
|
|
87
|
+
to support the new staging deployment pipeline.
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Bad
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
# Missing code
|
|
94
|
+
Updated stuff
|
|
95
|
+
|
|
96
|
+
# Vague title
|
|
97
|
+
UPD: Changes
|
|
98
|
+
|
|
99
|
+
# Wrong code (this is a fix, not an update)
|
|
100
|
+
UPD: Fix login crash on empty password
|
|
101
|
+
|
|
102
|
+
# No description
|
|
103
|
+
ADD: New component
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Rules
|
|
107
|
+
|
|
108
|
+
1. **Code is mandatory** - Every commit starts with a 3-letter code from the table above
|
|
109
|
+
2. **Title is imperative** - "Add feature" not "Added feature" or "Adding feature"
|
|
110
|
+
3. **Title is concise** - Max ~72 characters including the code prefix
|
|
111
|
+
4. **Description is required** - Explain the what and why, not just restate the title
|
|
112
|
+
5. **One code per commit** - If work spans multiple codes, split into multiple commits
|
|
113
|
+
6. **Choose the most specific code** - `SEC` over `FIX` for security fixes, `TST` over `ADD` for test files
|
|
114
|
+
|
|
115
|
+
## Choosing the Right Code
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
Is it brand new?
|
|
119
|
+
Yes → ADD
|
|
120
|
+
No ↓
|
|
121
|
+
Is something removed?
|
|
122
|
+
Yes → DEL
|
|
123
|
+
No ↓
|
|
124
|
+
Is it fixing broken behavior?
|
|
125
|
+
Yes → Is it a security issue?
|
|
126
|
+
Yes → SEC
|
|
127
|
+
No → FIX
|
|
128
|
+
No ↓
|
|
129
|
+
Is it changing how code is organized (no behavior change)?
|
|
130
|
+
Yes → Is it formatting/whitespace only?
|
|
131
|
+
Yes → STY
|
|
132
|
+
No → REF
|
|
133
|
+
No ↓
|
|
134
|
+
Is it modifying existing behavior or features?
|
|
135
|
+
Yes → UPD
|
|
136
|
+
No ↓
|
|
137
|
+
Is it only documentation?
|
|
138
|
+
Yes → DOC
|
|
139
|
+
No ↓
|
|
140
|
+
Is it only tests?
|
|
141
|
+
Yes → TST
|
|
142
|
+
No ↓
|
|
143
|
+
Is it config/build/environment?
|
|
144
|
+
Yes → CFG
|
|
145
|
+
No ↓
|
|
146
|
+
Is it dependency changes only?
|
|
147
|
+
Yes → DEP
|
|
148
|
+
No ↓
|
|
149
|
+
Is it a branch merge or merge conflict resolution?
|
|
150
|
+
Yes → MRG
|
|
151
|
+
No → Pick the most dominant action
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Red Flags - STOP
|
|
155
|
+
|
|
156
|
+
- Commit message without a code prefix
|
|
157
|
+
- Using a code not in the table
|
|
158
|
+
- Title longer than 72 characters
|
|
159
|
+
- Empty or missing description
|
|
160
|
+
- Code that doesn't match the actual changes
|
|
161
|
+
- Multiple unrelated changes in one commit (split them)
|
|
162
|
+
|
|
163
|
+
## When to Apply
|
|
164
|
+
|
|
165
|
+
**ALWAYS** - this skill applies to every single `git commit` in this project. No exceptions.
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: lcp-writing-documentation
|
|
3
|
+
description: Use when writing or updating documentation for the LCP project — new functionality requires docs, existing docs need updating after a feature change, documentation must be created or reorganized in the docs/ folder, or a significant system behavior or data flow changes. Authoritative guideline for LCP documentation conventions (architecture docs, user-facing guides, and the auto-generated API reference).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing Documentation
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
All documentation lives under `docs/`, which is the MkDocs source tree (`docs_dir: docs`) published to GitHub Pages. The folder holds **three kinds of documentation with different conventions** — pick the right area first, then follow its rules.
|
|
11
|
+
|
|
12
|
+
**Core principle:** Match the conventions of the area you are writing in. The strict "concepts not code" rules apply to architecture docs; user-facing guides and the auto-generated API reference follow their own conventions.
|
|
13
|
+
|
|
14
|
+
**Violating the letter of these rules is violating the spirit of these rules.**
|
|
15
|
+
|
|
16
|
+
## Documentation Map
|
|
17
|
+
|
|
18
|
+
| Area | Location | Audience | Conventions | Code snippets? |
|
|
19
|
+
|------|----------|----------|-------------|----------------|
|
|
20
|
+
| **Architecture** | `docs/architecture/` | Contributors / maintainers | `snake_case` folders, `index.md` + `architecture.md` per topic, this skill's strict rules | **No** — refer to objects by name |
|
|
21
|
+
| **User-facing** | `docs/guides/`, `docs/spec/`, `docs/introduction.md`, `docs/quickstart.md`, `docs/cli.md` | Users of the SDK/CLI | `kebab-case.md`, task-oriented prose | **Yes** — bash/CLI/Python examples expected |
|
|
22
|
+
| **API Reference** | `docs/api/` | Users browsing the public API | Auto-generated by mkdocstrings from docstrings | N/A — **do not hand-write** |
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
docs/
|
|
26
|
+
├── index.md # Site home (user-facing landing page)
|
|
27
|
+
├── introduction.md # User-facing
|
|
28
|
+
├── quickstart.md # User-facing
|
|
29
|
+
├── cli.md # User-facing
|
|
30
|
+
├── guides/ # User-facing how-tos (kebab-case)
|
|
31
|
+
├── spec/ # LCP specification (user-facing)
|
|
32
|
+
├── api/ # Auto-generated API reference (mkdocstrings)
|
|
33
|
+
└── architecture/ # ← THIS SKILL'S PRIMARY DOMAIN
|
|
34
|
+
├── index.md # Architecture overview + table of contents
|
|
35
|
+
└── topic_name/ # snake_case (e.g. manifest, mcp_server, ai_docgen)
|
|
36
|
+
├── index.md # Topic overview + section table of contents
|
|
37
|
+
└── architecture.md # System design, data flow, internals
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Adding a doc to the site nav requires an entry in `mkdocs.yml` under the matching section, regardless of area.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Architecture Docs (`docs/architecture/`)
|
|
45
|
+
|
|
46
|
+
This is what this skill primarily governs: conceptual, design-level documentation for contributors. It focuses on concepts, data flows, and component relationships — **not** implementation code. The audience can read source code themselves.
|
|
47
|
+
|
|
48
|
+
### When to Write or Update
|
|
49
|
+
|
|
50
|
+
- New major feature or system is implemented
|
|
51
|
+
- Core functionality changes behavior or architecture
|
|
52
|
+
- Data flow between components changes significantly
|
|
53
|
+
- New integrations or external dependencies are added
|
|
54
|
+
- Existing documented behavior is modified or removed
|
|
55
|
+
|
|
56
|
+
**Do NOT create architecture docs for:**
|
|
57
|
+
|
|
58
|
+
- Minor bug fixes or cosmetic changes
|
|
59
|
+
- Internal refactors that don't change behavior or interfaces
|
|
60
|
+
- Trivial configuration changes
|
|
61
|
+
|
|
62
|
+
### File Conventions
|
|
63
|
+
|
|
64
|
+
| Rule | Convention |
|
|
65
|
+
|------|-----------|
|
|
66
|
+
| Location | Under `docs/architecture/` |
|
|
67
|
+
| Format | Markdown (`.md`), mkdocs-compatible |
|
|
68
|
+
| Naming | `snake_case` folders; files are `index.md` and `architecture.md` |
|
|
69
|
+
| Organization | Topic-based subfolders (e.g., `docs/architecture/manifest/`, `docs/architecture/mcp_server/`) |
|
|
70
|
+
|
|
71
|
+
### Index Files
|
|
72
|
+
|
|
73
|
+
Every architecture folder MUST have an `index.md` containing:
|
|
74
|
+
|
|
75
|
+
1. **Overview** — Brief description of what this section covers
|
|
76
|
+
2. **Key features** — Bullet list of main capabilities (if applicable)
|
|
77
|
+
3. **Table of contents** — Links to all documents in the folder with one-line descriptions
|
|
78
|
+
4. **Key components table** — Component name, location (file path), and purpose
|
|
79
|
+
5. **Related documentation** — Cross-references to related sections
|
|
80
|
+
|
|
81
|
+
**Maintenance rule:** When adding or removing an architecture document, ALWAYS update:
|
|
82
|
+
|
|
83
|
+
- The folder's `index.md`
|
|
84
|
+
- The architecture root `docs/architecture/index.md`
|
|
85
|
+
- The `mkdocs.yml` nav (under the `Architecture` section)
|
|
86
|
+
|
|
87
|
+
**No exceptions.** An orphaned document with no index entry is a documentation bug.
|
|
88
|
+
|
|
89
|
+
### Document Structure
|
|
90
|
+
|
|
91
|
+
```markdown
|
|
92
|
+
# Document Title
|
|
93
|
+
|
|
94
|
+
## Overview
|
|
95
|
+
Brief description of the topic (2-3 sentences max).
|
|
96
|
+
|
|
97
|
+
## [Core Sections]
|
|
98
|
+
Organized by the topic's natural structure.
|
|
99
|
+
|
|
100
|
+
## Related Documentation
|
|
101
|
+
Cross-references to related documents.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
**Last Updated:** Month Year
|
|
105
|
+
**Status:** Implemented | In Progress | Planned
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Content Guidelines
|
|
109
|
+
|
|
110
|
+
**DO**
|
|
111
|
+
|
|
112
|
+
- Write clear, concise prose accessible to developers of all levels
|
|
113
|
+
- Describe functional behavior and data flows
|
|
114
|
+
- Use tables for structured reference data (components, configurations)
|
|
115
|
+
- Use Mermaid diagrams for architecture, data flows, and component relationships
|
|
116
|
+
- Reference classes, functions, and files by name and path
|
|
117
|
+
- Cross-reference related documentation sections
|
|
118
|
+
- Explain the WHY behind design decisions
|
|
119
|
+
|
|
120
|
+
**DO NOT**
|
|
121
|
+
|
|
122
|
+
- Include code snippets or source code blocks
|
|
123
|
+
- Copy-paste implementation details
|
|
124
|
+
- Write tutorials or step-by-step coding guides
|
|
125
|
+
- Document obvious behavior that the code itself makes clear
|
|
126
|
+
- Duplicate information that belongs in README or project config files
|
|
127
|
+
|
|
128
|
+
### Referring to Code Objects
|
|
129
|
+
|
|
130
|
+
Instead of embedding code, refer to objects by their qualified name and location.
|
|
131
|
+
|
|
132
|
+
**Bad:** A 10-line code block showing how to call a service method.
|
|
133
|
+
|
|
134
|
+
**Good:** "Scanning is handled by `scan_package()` in `src/lcp/scanner.py`, which imports the package and walks its modules with `inspect`, producing a `ScannedModule`."
|
|
135
|
+
|
|
136
|
+
The developer reading this can open the file and understand the implementation. The documentation's job is to explain the concept, purpose, and context — not to replicate the code.
|
|
137
|
+
|
|
138
|
+
### Diagrams
|
|
139
|
+
|
|
140
|
+
Use [Mermaid](https://mermaid.js.org/) to illustrate architecture and data flows. Declare diagrams in a fenced code block with the `mermaid` language identifier (rendered natively on the MkDocs site and in GitHub Markdown).
|
|
141
|
+
|
|
142
|
+
**Flowcharts** — for component interactions, data pipelines, and decision flows:
|
|
143
|
+
|
|
144
|
+
```mermaid
|
|
145
|
+
flowchart LR
|
|
146
|
+
A[Component A] --> B[Component B]
|
|
147
|
+
A --> C[Component C]
|
|
148
|
+
B --> D[(Storage)]
|
|
149
|
+
C --> D
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Sequence diagrams** — for request/response cycles and multi-service interactions:
|
|
153
|
+
|
|
154
|
+
```mermaid
|
|
155
|
+
sequenceDiagram
|
|
156
|
+
participant Client
|
|
157
|
+
participant ServiceA
|
|
158
|
+
participant ServiceB
|
|
159
|
+
Client->>ServiceA: request
|
|
160
|
+
ServiceA->>ServiceB: forward
|
|
161
|
+
ServiceB-->>ServiceA: response
|
|
162
|
+
ServiceA-->>Client: result
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
| Type | Mermaid keyword | Best for |
|
|
166
|
+
|------|-----------------|---------|
|
|
167
|
+
| Flowchart | `flowchart` | Component topology, data pipelines, decision trees |
|
|
168
|
+
| Sequence | `sequenceDiagram` | API calls, multi-service request flows |
|
|
169
|
+
| Class | `classDiagram` | Data models, inheritance hierarchies |
|
|
170
|
+
| State | `stateDiagram-v2` | Lifecycle states, status transitions |
|
|
171
|
+
| Entity-Relationship | `erDiagram` | Database schemas, domain models |
|
|
172
|
+
|
|
173
|
+
Use a diagram when multiple components interact in a non-obvious way, data transforms across several layers, or a chain spans services.
|
|
174
|
+
|
|
175
|
+
### Tables for Reference Data
|
|
176
|
+
|
|
177
|
+
Use tables for component inventories and configuration:
|
|
178
|
+
|
|
179
|
+
| Component | Location | Purpose |
|
|
180
|
+
|-----------|----------|---------|
|
|
181
|
+
| `scan_package` | `src/lcp/scanner.py` | Introspects an installed package into `ScannedModule` |
|
|
182
|
+
|
|
183
|
+
### Architecture Quality Checklist
|
|
184
|
+
|
|
185
|
+
- [ ] File is `index.md` or `architecture.md` in a `snake_case` topic folder under `docs/architecture/`
|
|
186
|
+
- [ ] Folder's `index.md` updated with link and description
|
|
187
|
+
- [ ] `docs/architecture/index.md` updated if a new topic or document was added
|
|
188
|
+
- [ ] `mkdocs.yml` nav updated under the `Architecture` section
|
|
189
|
+
- [ ] **No code snippets** — only references to objects, classes, and file paths
|
|
190
|
+
- [ ] Data flows use Mermaid diagrams where helpful (fenced ` ```mermaid ` block)
|
|
191
|
+
- [ ] Tables used for structured reference data
|
|
192
|
+
- [ ] Cross-references to related docs included
|
|
193
|
+
- [ ] Footer has "Last Updated" and "Status"
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## User-facing Docs (`docs/guides/`, `docs/spec/`, getting started)
|
|
198
|
+
|
|
199
|
+
These are written FOR users of the SDK and CLI, not contributors. Conventions differ from architecture docs:
|
|
200
|
+
|
|
201
|
+
- **Naming:** `kebab-case.md` (e.g., `mcp-server.md`, `ai-docgen.md`).
|
|
202
|
+
- **Code is expected:** include `bash`, CLI, and Python examples — users need copy-pasteable commands.
|
|
203
|
+
- **Task-oriented:** show how to accomplish a goal step by step.
|
|
204
|
+
- **No "Last Updated/Status" footer** — these pages are living user docs.
|
|
205
|
+
- **Nav:** add new pages to `mkdocs.yml` under `Get Started`, `Guides`, or `Specification`.
|
|
206
|
+
|
|
207
|
+
When in doubt about depth, link to the relevant `docs/architecture/` page rather than duplicating internals.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## API Reference (`docs/api/`)
|
|
212
|
+
|
|
213
|
+
The API reference is **auto-generated by mkdocstrings** from the source docstrings — do not hand-write API descriptions here.
|
|
214
|
+
|
|
215
|
+
- Each page is a thin stub with a `::: lcp.<module>` directive; the content comes from docstrings in `src/lcp/`.
|
|
216
|
+
- To improve the rendered reference, **edit the docstrings in the source code**, not the markdown.
|
|
217
|
+
- To document a new public module, add a stub page in `docs/api/` and a nav entry under `API Reference` in `mkdocs.yml`.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Red Flags — STOP and Revise
|
|
222
|
+
|
|
223
|
+
- Writing in `docs/architecture/` and about to paste a code block → refer to the object by name instead
|
|
224
|
+
- Architecture document has no entry in its folder's `index.md` → update the index first
|
|
225
|
+
- Architecture file/folder uses camelCase or kebab-case → use `snake_case` (files are `index.md`/`architecture.md`)
|
|
226
|
+
- Guide uses `snake_case.md` → rename to `kebab-case.md`
|
|
227
|
+
- Hand-writing API descriptions in `docs/api/` → edit the source docstring instead
|
|
228
|
+
- Added any page but forgot the `mkdocs.yml` nav entry → add it
|
|
229
|
+
- Content duplicates another document → cross-reference instead
|
|
230
|
+
|
|
231
|
+
## Common Mistakes
|
|
232
|
+
|
|
233
|
+
| Mistake | Fix |
|
|
234
|
+
|---------|-----|
|
|
235
|
+
| Adding an architecture doc but forgetting the index | Update folder `index.md` AND `docs/architecture/index.md` |
|
|
236
|
+
| Adding any page but forgetting the nav | Update the matching section in `mkdocs.yml` |
|
|
237
|
+
| Code snippets in architecture docs | Replace with prose describing the object and its parameters |
|
|
238
|
+
| Editing `docs/api/*.md` to fix API wording | Edit the docstring in `src/lcp/` instead |
|
|
239
|
+
| Mixing user-facing and architecture conventions | Decide the area first (see Documentation Map), then follow its rules |
|
|
240
|
+
| Flat file dump in `docs/architecture/` | Group related files into `snake_case` topic subfolders |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lcp",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Andrea Zanini",
|
|
5
|
+
"email": "andrea.za94@gmail.com"
|
|
6
|
+
},
|
|
7
|
+
"description": "Library Context Protocol — universal Python library documentation for AI coding agents.",
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "lcp",
|
|
11
|
+
"source": "./plugin/lcp",
|
|
12
|
+
"description": "Universal Python library documentation for AI coding agents via the Library Context Protocol. Resolves any pip-installed package on demand through browsable MCP tools.",
|
|
13
|
+
"category": "documentation",
|
|
14
|
+
"tags": ["python", "mcp", "documentation", "api-introspection", "lcp"],
|
|
15
|
+
"homepage": "https://github.com/zazza123/lcp",
|
|
16
|
+
"repository": "https://github.com/zazza123/lcp",
|
|
17
|
+
"license": "MIT"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Code owners for the lcp repository.
|
|
2
|
+
#
|
|
3
|
+
# When a PR touches a matching path, GitHub auto-requests review from the
|
|
4
|
+
# listed owners. Pairs with branch protection's "Require review from Code
|
|
5
|
+
# Owners" option.
|
|
6
|
+
#
|
|
7
|
+
# Syntax reference: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
|
8
|
+
|
|
9
|
+
# Default owner for everything in the repo.
|
|
10
|
+
* @zazza123
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report something that is broken or behaves unexpectedly in lcp.
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: ["bug", "status:needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for taking the time to file a bug report! Please fill in the
|
|
10
|
+
fields below so the issue can be triaged quickly.
|
|
11
|
+
|
|
12
|
+
For **security vulnerabilities**, do not use this form — report
|
|
13
|
+
privately via
|
|
14
|
+
[GitHub Security Advisories](https://github.com/zazza123/lcp/security/advisories/new).
|
|
15
|
+
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: summary
|
|
18
|
+
attributes:
|
|
19
|
+
label: Summary
|
|
20
|
+
description: A clear, one-paragraph description of what is wrong.
|
|
21
|
+
placeholder: Calling `lcp scan foo` raises a `TypeError` on Python 3.12.
|
|
22
|
+
validations:
|
|
23
|
+
required: true
|
|
24
|
+
|
|
25
|
+
- type: input
|
|
26
|
+
id: lcp-version
|
|
27
|
+
attributes:
|
|
28
|
+
label: lcp version
|
|
29
|
+
description: Output of `lcp --version` or `pip show lcp | grep -i version`.
|
|
30
|
+
placeholder: "0.1.0"
|
|
31
|
+
validations:
|
|
32
|
+
required: true
|
|
33
|
+
|
|
34
|
+
- type: input
|
|
35
|
+
id: python-version
|
|
36
|
+
attributes:
|
|
37
|
+
label: Python version
|
|
38
|
+
description: Output of `python --version`.
|
|
39
|
+
placeholder: "Python 3.12.4"
|
|
40
|
+
validations:
|
|
41
|
+
required: true
|
|
42
|
+
|
|
43
|
+
- type: input
|
|
44
|
+
id: os
|
|
45
|
+
attributes:
|
|
46
|
+
label: Operating system
|
|
47
|
+
description: e.g. macOS 14.5, Ubuntu 22.04, Windows 11.
|
|
48
|
+
placeholder: "macOS 14.5"
|
|
49
|
+
validations:
|
|
50
|
+
required: true
|
|
51
|
+
|
|
52
|
+
- type: textarea
|
|
53
|
+
id: reproducer
|
|
54
|
+
attributes:
|
|
55
|
+
label: Minimal reproducer
|
|
56
|
+
description: |
|
|
57
|
+
A command, code snippet, or pointer to a small repo that reproduces
|
|
58
|
+
the problem. Smaller is better.
|
|
59
|
+
render: shell
|
|
60
|
+
placeholder: |
|
|
61
|
+
$ lcp scan requests -o requests.lcp.json
|
|
62
|
+
validations:
|
|
63
|
+
required: true
|
|
64
|
+
|
|
65
|
+
- type: textarea
|
|
66
|
+
id: expected
|
|
67
|
+
attributes:
|
|
68
|
+
label: Expected behavior
|
|
69
|
+
description: What did you expect to happen?
|
|
70
|
+
validations:
|
|
71
|
+
required: true
|
|
72
|
+
|
|
73
|
+
- type: textarea
|
|
74
|
+
id: actual
|
|
75
|
+
attributes:
|
|
76
|
+
label: Actual behavior
|
|
77
|
+
description: What actually happened?
|
|
78
|
+
validations:
|
|
79
|
+
required: true
|
|
80
|
+
|
|
81
|
+
- type: textarea
|
|
82
|
+
id: traceback
|
|
83
|
+
attributes:
|
|
84
|
+
label: Full traceback (if any)
|
|
85
|
+
description: Paste the complete stack trace. No need to truncate.
|
|
86
|
+
render: shell
|
|
87
|
+
validations:
|
|
88
|
+
required: false
|
|
89
|
+
|
|
90
|
+
- type: textarea
|
|
91
|
+
id: extra
|
|
92
|
+
attributes:
|
|
93
|
+
label: Additional context
|
|
94
|
+
description: |
|
|
95
|
+
Anything else that might be relevant — related packages, virtualenv
|
|
96
|
+
details, recent changes, screenshots, etc.
|
|
97
|
+
validations:
|
|
98
|
+
required: false
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: false
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Security vulnerability
|
|
4
|
+
url: https://github.com/zazza123/lcp/security/advisories/new
|
|
5
|
+
about: Report a security issue privately via GitHub Security Advisories.
|
|
6
|
+
- name: Question or discussion
|
|
7
|
+
url: https://github.com/zazza123/lcp/discussions
|
|
8
|
+
about: Use Discussions for usage questions or design conversations.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Suggest a new capability, API, or improvement for lcp.
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: ["feature", "status:needs-triage"]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: |
|
|
9
|
+
Thanks for proposing an improvement! Filling in the fields below
|
|
10
|
+
helps reach a decision faster. For broader design discussions,
|
|
11
|
+
consider opening a
|
|
12
|
+
[GitHub Discussion](https://github.com/zazza123/lcp/discussions)
|
|
13
|
+
first.
|
|
14
|
+
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: problem
|
|
17
|
+
attributes:
|
|
18
|
+
label: Problem statement
|
|
19
|
+
description: What is hard or impossible today? Who is affected and why?
|
|
20
|
+
placeholder: |
|
|
21
|
+
When scanning packages with namespace subpackages, the resulting
|
|
22
|
+
manifest does not include ...
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: solution
|
|
28
|
+
attributes:
|
|
29
|
+
label: Proposed solution
|
|
30
|
+
description: |
|
|
31
|
+
How should `lcp` solve this? Describe the user-visible behaviour,
|
|
32
|
+
new CLI flag / API, or change in output.
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
35
|
+
|
|
36
|
+
- type: textarea
|
|
37
|
+
id: alternatives
|
|
38
|
+
attributes:
|
|
39
|
+
label: Alternatives considered
|
|
40
|
+
description: |
|
|
41
|
+
Other approaches you thought about and why you rejected them. Even
|
|
42
|
+
a short note here helps avoid re-litigating during review.
|
|
43
|
+
validations:
|
|
44
|
+
required: true
|
|
45
|
+
|
|
46
|
+
- type: textarea
|
|
47
|
+
id: example
|
|
48
|
+
attributes:
|
|
49
|
+
label: Example usage
|
|
50
|
+
description: |
|
|
51
|
+
A short CLI invocation or Python API sketch showing how the feature
|
|
52
|
+
would be used in practice.
|
|
53
|
+
render: shell
|
|
54
|
+
placeholder: |
|
|
55
|
+
$ lcp scan mypkg --include-namespaces -o mypkg.lcp.json
|
|
56
|
+
validations:
|
|
57
|
+
required: true
|
|
58
|
+
|
|
59
|
+
- type: textarea
|
|
60
|
+
id: extra
|
|
61
|
+
attributes:
|
|
62
|
+
label: Additional context
|
|
63
|
+
description: Links to related issues, prior art, or relevant background.
|
|
64
|
+
validations:
|
|
65
|
+
required: false
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- One paragraph describing what this PR changes and why. Focus on the
|
|
4
|
+
"why" — the diff already shows the "what". -->
|
|
5
|
+
|
|
6
|
+
## Type of change
|
|
7
|
+
|
|
8
|
+
- [ ] Bug fix
|
|
9
|
+
- [ ] New feature
|
|
10
|
+
- [ ] Refactor / code cleanup
|
|
11
|
+
- [ ] Documentation
|
|
12
|
+
- [ ] Tests
|
|
13
|
+
- [ ] Other:
|
|
14
|
+
|
|
15
|
+
## Checklist
|
|
16
|
+
|
|
17
|
+
- [ ] Linked issue: closes #
|
|
18
|
+
- [ ] Tests added or updated
|
|
19
|
+
- [ ] Documentation updated (README / docs / docstrings)
|
|
20
|
+
- [ ] `ruff check src/lcp tests` passes locally
|
|
21
|
+
- [ ] `pytest` passes locally
|
|
22
|
+
- [ ] Commit messages follow the project convention (`CODE: title`)
|