feature-map-cli 1.0.0__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.
- feature_map_cli-1.0.0/.gitignore +13 -0
- feature_map_cli-1.0.0/CHANGELOG.md +37 -0
- feature_map_cli-1.0.0/Formula/feature-map.rb +31 -0
- feature_map_cli-1.0.0/LICENSE +21 -0
- feature_map_cli-1.0.0/PKG-INFO +121 -0
- feature_map_cli-1.0.0/README.md +94 -0
- feature_map_cli-1.0.0/pyproject.toml +64 -0
- feature_map_cli-1.0.0/share/feature_map/schema/feature-map.schema.json +39 -0
- feature_map_cli-1.0.0/share/feature_map/skill/SKILL.md +58 -0
- feature_map_cli-1.0.0/share/feature_map/skill/references/authoring.md +37 -0
- feature_map_cli-1.0.0/share/feature_map/skill/references/commands.md +47 -0
- feature_map_cli-1.0.0/share/feature_map/skill/references/existing-repos.md +43 -0
- feature_map_cli-1.0.0/share/feature_map/templates/feature.yaml.tpl +17 -0
- feature_map_cli-1.0.0/src/feature_map/__init__.py +3 -0
- feature_map_cli-1.0.0/src/feature_map/__main__.py +3 -0
- feature_map_cli-1.0.0/src/feature_map/_version.py +1 -0
- feature_map_cli-1.0.0/src/feature_map/bootstrap.py +189 -0
- feature_map_cli-1.0.0/src/feature_map/cli.py +273 -0
- feature_map_cli-1.0.0/src/feature_map/commands/__init__.py +0 -0
- feature_map_cli-1.0.0/src/feature_map/commands/check_cmd.py +23 -0
- feature_map_cli-1.0.0/src/feature_map/commands/find_cmd.py +36 -0
- feature_map_cli-1.0.0/src/feature_map/commands/graph_cmd.py +18 -0
- feature_map_cli-1.0.0/src/feature_map/commands/impact_cmd.py +55 -0
- feature_map_cli-1.0.0/src/feature_map/commands/init_cmd.py +72 -0
- feature_map_cli-1.0.0/src/feature_map/commands/install_cmd.py +54 -0
- feature_map_cli-1.0.0/src/feature_map/commands/list_cmd.py +37 -0
- feature_map_cli-1.0.0/src/feature_map/commands/search_cmd.py +21 -0
- feature_map_cli-1.0.0/src/feature_map/commands/show_cmd.py +34 -0
- feature_map_cli-1.0.0/src/feature_map/commands/stats_cmd.py +85 -0
- feature_map_cli-1.0.0/src/feature_map/commands/validate_cmd.py +59 -0
- feature_map_cli-1.0.0/src/feature_map/config.py +24 -0
- feature_map_cli-1.0.0/src/feature_map/discover.py +59 -0
- feature_map_cli-1.0.0/src/feature_map/errors.py +17 -0
- feature_map_cli-1.0.0/src/feature_map/graph.py +79 -0
- feature_map_cli-1.0.0/src/feature_map/loader.py +62 -0
- feature_map_cli-1.0.0/src/feature_map/output.py +54 -0
- feature_map_cli-1.0.0/src/feature_map/path_extract.py +139 -0
- feature_map_cli-1.0.0/src/feature_map/path_normalize.py +100 -0
- feature_map_cli-1.0.0/src/feature_map/path_resolve.py +36 -0
- feature_map_cli-1.0.0/src/feature_map/paths.py +34 -0
- feature_map_cli-1.0.0/src/feature_map/text_index.py +49 -0
- feature_map_cli-1.0.0/src/feature_map/validate.py +148 -0
- feature_map_cli-1.0.0/tests/fixtures/.features/auth.yaml +19 -0
- feature_map_cli-1.0.0/tests/fixtures/.features/billing.yaml +18 -0
- feature_map_cli-1.0.0/tests/fixtures/.features/notifications.yaml +17 -0
- feature_map_cli-1.0.0/tests/fixtures/repo/src/app.py +2 -0
- feature_map_cli-1.0.0/tests/fixtures/repo/src/auth/session.py +1 -0
- feature_map_cli-1.0.0/tests/fixtures/repo/src/billing/plans.py +1 -0
- feature_map_cli-1.0.0/tests/fixtures/repo/src/notify/send.py +1 -0
- feature_map_cli-1.0.0/tests/helpers.py +54 -0
- feature_map_cli-1.0.0/tests/test_bootstrap.py +118 -0
- feature_map_cli-1.0.0/tests/test_cli.py +123 -0
- feature_map_cli-1.0.0/tests/test_paths.py +37 -0
- feature_map_cli-1.0.0/tests/test_validate.py +39 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] — 2026-08-29
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `feature-map` CLI
|
|
15
|
+
- Full command surface: `list`, `show`, `search`, `find`, `graph`, `validate`,
|
|
16
|
+
`check`, `impact`, `stats`, `init`, `install`, `--json`, `--version`
|
|
17
|
+
- `feature-map init` bootstraps any repo: `.features/`, agent skill, `.feature-map.yaml`,
|
|
18
|
+
`AGENTS.md` snippet, and `bin/feature-map` shim
|
|
19
|
+
- `feature-map init <name>` scaffolds a new map from the bundled template
|
|
20
|
+
- `feature-map init --upgrade-skill` refreshes the agent skill from the installed package
|
|
21
|
+
- Fixture-based test suite
|
|
22
|
+
- Homebrew formula draft in `Formula/feature-map.rb`
|
|
23
|
+
- pip-installable entrypoint via `pyproject.toml`
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- Public CLI and Homebrew name is `feature-map` (`brew install feature-map`).
|
|
28
|
+
The PyPI project is `feature-map-cli` (`pip install feature-map-cli`) because
|
|
29
|
+
PyPI treats `feature-map` as too similar to the existing biology package
|
|
30
|
+
`featuremap`. The Python import is `feature_map`.
|
|
31
|
+
- Repo-local `bin/feature-map` shim execs `feature-map` without recursing if
|
|
32
|
+
`bin/` is on PATH.
|
|
33
|
+
- `init` writes `<!-- feature-map:start -->` in `AGENTS.md` and migrates the
|
|
34
|
+
older `<!-- featuremap:start -->` block.
|
|
35
|
+
|
|
36
|
+
[Unreleased]: https://github.com/markschellhas/feature-map/compare/v1.0.0...HEAD
|
|
37
|
+
[1.0.0]: https://github.com/markschellhas/feature-map/releases/tag/v1.0.0
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Draft Homebrew formula. Fill url/sha256 from the PyPI sdist after the
|
|
2
|
+
# first upload. Full steps: PUBLISH.md.
|
|
3
|
+
#
|
|
4
|
+
# Until then, install from this tree:
|
|
5
|
+
#
|
|
6
|
+
# pip install -e .
|
|
7
|
+
#
|
|
8
|
+
# or from a tap:
|
|
9
|
+
#
|
|
10
|
+
# brew install --HEAD markschellhas/tap/feature-map
|
|
11
|
+
|
|
12
|
+
class FeatureMap < Formula
|
|
13
|
+
desc "Cross-app architecture research CLI"
|
|
14
|
+
homepage "https://github.com/markschellhas/feature-map"
|
|
15
|
+
license "MIT"
|
|
16
|
+
head "https://github.com/markschellhas/feature-map.git", branch: "master"
|
|
17
|
+
|
|
18
|
+
depends_on "python@3.12"
|
|
19
|
+
|
|
20
|
+
def install
|
|
21
|
+
virtualenv = libexec/"venv"
|
|
22
|
+
system Formula["python@3.12"].opt_libexec/"bin/python", "-m", "venv", virtualenv
|
|
23
|
+
system virtualenv/"bin/pip", "install", "."
|
|
24
|
+
bin.install_symlink virtualenv/"bin/feature-map"
|
|
25
|
+
(share/"feature-map").install Dir["share/feature_map/*"] if File.directory?("share/feature_map")
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
test do
|
|
29
|
+
assert_match "1.0.0", shell_output("#{bin}/feature-map --version")
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Taptics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: feature-map-cli
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Cross-app architecture research CLI driven by .features/*.yaml maps
|
|
5
|
+
Project-URL: Homepage, https://github.com/markschellhas/feature-map
|
|
6
|
+
Project-URL: Repository, https://github.com/markschellhas/feature-map
|
|
7
|
+
Author: Taptics
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: agents,architecture,cli,feature-map
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Requires-Dist: pyyaml>=6.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Feature Map
|
|
29
|
+
|
|
30
|
+
Cross-app architecture research CLI. Agents and engineers keep authoritative
|
|
31
|
+
feature maps in `.features/*.yaml`; `feature-map` lists, searches, validates,
|
|
32
|
+
and graphs them.
|
|
33
|
+
|
|
34
|
+
A wiki stores architecture as prose — agents re-read a whole page to find three
|
|
35
|
+
files. Feature Map stores **fields** (`purpose`, `entry_points`, `apps`) and a
|
|
36
|
+
CLI that returns **names and sections**, so lookup is cheap and `check` can
|
|
37
|
+
prove paths still exist.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install -e .
|
|
43
|
+
# pip install feature-map-cli
|
|
44
|
+
# brew install feature-map
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Requires Python 3.8+ and PyYAML. The CLI is `feature-map`. Install from PyPI as
|
|
48
|
+
`feature-map-cli` — `pip install featuremap` is a different (biology) project,
|
|
49
|
+
and `feature-map` is blocked on PyPI as too similar to that name.
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd my-repo
|
|
55
|
+
feature-map init
|
|
56
|
+
feature-map init auth # scaffold .features/auth.yaml
|
|
57
|
+
feature-map list
|
|
58
|
+
feature-map search billing
|
|
59
|
+
feature-map validate
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`feature-map init` is idempotent. It:
|
|
63
|
+
|
|
64
|
+
1. Creates `.features/`
|
|
65
|
+
2. Copies the agent skill to `.agents/skills/feature-map/` (or `.grok/skills/` if that tree already exists)
|
|
66
|
+
3. Writes `.feature-map.yaml` defaults when missing
|
|
67
|
+
4. Appends an `AGENTS.md` block (skip with `--no-agents`)
|
|
68
|
+
5. Writes `bin/feature-map` as a repo-local shim (skip with `--no-shim`)
|
|
69
|
+
|
|
70
|
+
Refresh the skill after upgrading the package:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
feature-map init --upgrade-skill
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
| Command | Purpose |
|
|
79
|
+
|---------|---------|
|
|
80
|
+
| `list` | All feature slugs |
|
|
81
|
+
| `show <name>` / `<name>` | Print a map (or `--section`) |
|
|
82
|
+
| `search <query>` | Full-text search |
|
|
83
|
+
| `find <path>` | Reverse lookup by path fragment |
|
|
84
|
+
| `graph [name]` | `related_features` graph (`mermaid`, `json`, `dot`) |
|
|
85
|
+
| `validate [--strict]` | Structural checks |
|
|
86
|
+
| `check` | Stale `entry_points` / `core_components` paths |
|
|
87
|
+
| `impact <file>` | Which maps reference a file |
|
|
88
|
+
| `stats` | Coverage summary |
|
|
89
|
+
| `init` / `init <name>` | Bootstrap repo or scaffold a map |
|
|
90
|
+
| `install` | Setup status |
|
|
91
|
+
| `--json` / `--version` | Machine output / version |
|
|
92
|
+
|
|
93
|
+
Exit codes: `0` ok, `1` user error, `2` validation failure (`--strict`).
|
|
94
|
+
|
|
95
|
+
## Per-repo config
|
|
96
|
+
|
|
97
|
+
`.feature-map.yaml` at the git root:
|
|
98
|
+
|
|
99
|
+
```yaml
|
|
100
|
+
features_dir: .features
|
|
101
|
+
apps:
|
|
102
|
+
- api
|
|
103
|
+
- web
|
|
104
|
+
required_sections:
|
|
105
|
+
- purpose
|
|
106
|
+
- entry_points
|
|
107
|
+
min_cli_version: "1.0.0"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`apps` prefixes are used by `check` when resolving paths.
|
|
111
|
+
|
|
112
|
+
## Develop
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
pip install -e ".[dev]"
|
|
116
|
+
python -m pytest -q
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Feature Map
|
|
2
|
+
|
|
3
|
+
Cross-app architecture research CLI. Agents and engineers keep authoritative
|
|
4
|
+
feature maps in `.features/*.yaml`; `feature-map` lists, searches, validates,
|
|
5
|
+
and graphs them.
|
|
6
|
+
|
|
7
|
+
A wiki stores architecture as prose — agents re-read a whole page to find three
|
|
8
|
+
files. Feature Map stores **fields** (`purpose`, `entry_points`, `apps`) and a
|
|
9
|
+
CLI that returns **names and sections**, so lookup is cheap and `check` can
|
|
10
|
+
prove paths still exist.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install -e .
|
|
16
|
+
# pip install feature-map-cli
|
|
17
|
+
# brew install feature-map
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Requires Python 3.8+ and PyYAML. The CLI is `feature-map`. Install from PyPI as
|
|
21
|
+
`feature-map-cli` — `pip install featuremap` is a different (biology) project,
|
|
22
|
+
and `feature-map` is blocked on PyPI as too similar to that name.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cd my-repo
|
|
28
|
+
feature-map init
|
|
29
|
+
feature-map init auth # scaffold .features/auth.yaml
|
|
30
|
+
feature-map list
|
|
31
|
+
feature-map search billing
|
|
32
|
+
feature-map validate
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`feature-map init` is idempotent. It:
|
|
36
|
+
|
|
37
|
+
1. Creates `.features/`
|
|
38
|
+
2. Copies the agent skill to `.agents/skills/feature-map/` (or `.grok/skills/` if that tree already exists)
|
|
39
|
+
3. Writes `.feature-map.yaml` defaults when missing
|
|
40
|
+
4. Appends an `AGENTS.md` block (skip with `--no-agents`)
|
|
41
|
+
5. Writes `bin/feature-map` as a repo-local shim (skip with `--no-shim`)
|
|
42
|
+
|
|
43
|
+
Refresh the skill after upgrading the package:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
feature-map init --upgrade-skill
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
|
|
51
|
+
| Command | Purpose |
|
|
52
|
+
|---------|---------|
|
|
53
|
+
| `list` | All feature slugs |
|
|
54
|
+
| `show <name>` / `<name>` | Print a map (or `--section`) |
|
|
55
|
+
| `search <query>` | Full-text search |
|
|
56
|
+
| `find <path>` | Reverse lookup by path fragment |
|
|
57
|
+
| `graph [name]` | `related_features` graph (`mermaid`, `json`, `dot`) |
|
|
58
|
+
| `validate [--strict]` | Structural checks |
|
|
59
|
+
| `check` | Stale `entry_points` / `core_components` paths |
|
|
60
|
+
| `impact <file>` | Which maps reference a file |
|
|
61
|
+
| `stats` | Coverage summary |
|
|
62
|
+
| `init` / `init <name>` | Bootstrap repo or scaffold a map |
|
|
63
|
+
| `install` | Setup status |
|
|
64
|
+
| `--json` / `--version` | Machine output / version |
|
|
65
|
+
|
|
66
|
+
Exit codes: `0` ok, `1` user error, `2` validation failure (`--strict`).
|
|
67
|
+
|
|
68
|
+
## Per-repo config
|
|
69
|
+
|
|
70
|
+
`.feature-map.yaml` at the git root:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
features_dir: .features
|
|
74
|
+
apps:
|
|
75
|
+
- api
|
|
76
|
+
- web
|
|
77
|
+
required_sections:
|
|
78
|
+
- purpose
|
|
79
|
+
- entry_points
|
|
80
|
+
min_cli_version: "1.0.0"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`apps` prefixes are used by `check` when resolving paths.
|
|
84
|
+
|
|
85
|
+
## Develop
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install -e ".[dev]"
|
|
89
|
+
python -m pytest -q
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.24"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "feature-map-cli"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Cross-app architecture research CLI driven by .features/*.yaml maps"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Taptics" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["architecture", "feature-map", "cli", "agents"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.8",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Topic :: Software Development :: Documentation",
|
|
28
|
+
]
|
|
29
|
+
dependencies = [
|
|
30
|
+
"pyyaml>=6.0",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.optional-dependencies]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=7.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
feature-map = "feature_map.cli:main"
|
|
40
|
+
|
|
41
|
+
[project.urls]
|
|
42
|
+
Homepage = "https://github.com/markschellhas/feature-map"
|
|
43
|
+
Repository = "https://github.com/markschellhas/feature-map"
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.wheel]
|
|
46
|
+
packages = ["src/feature_map"]
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
49
|
+
"share/feature_map" = "feature_map/share"
|
|
50
|
+
|
|
51
|
+
[tool.hatch.build.targets.sdist]
|
|
52
|
+
include = [
|
|
53
|
+
"src/feature_map",
|
|
54
|
+
"share/feature_map",
|
|
55
|
+
"tests",
|
|
56
|
+
"Formula",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE",
|
|
59
|
+
"CHANGELOG.md",
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
[tool.pytest.ini_options]
|
|
63
|
+
testpaths = ["tests"]
|
|
64
|
+
pythonpath = ["src", "tests"]
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "Feature Map",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["feature_name", "purpose", "entry_points"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"feature_name": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"minLength": 1
|
|
10
|
+
},
|
|
11
|
+
"purpose": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1
|
|
14
|
+
},
|
|
15
|
+
"entry_points": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "string"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"apps": {
|
|
23
|
+
"type": ["array", "object"]
|
|
24
|
+
},
|
|
25
|
+
"user_flow": {
|
|
26
|
+
"type": "object"
|
|
27
|
+
},
|
|
28
|
+
"related_features": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"notes": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"additionalProperties": true
|
|
39
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-map
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: "Research cross-app architecture via the Feature Map CLI before feature work, debugging, PRDs, or implementation plans. Run list, show, search, find, graph, validate, and check against .features/*.yaml. On existing repos with no maps, scour the code and author maps first."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Feature Map
|
|
8
|
+
|
|
9
|
+
Authoritative cross-app architecture lives in `.features/*.yaml`. **Always**
|
|
10
|
+
use this skill before touching a feature. Do not plan, debug, or implement
|
|
11
|
+
from a cold grep when a map exists — or when one should exist and does not.
|
|
12
|
+
|
|
13
|
+
Maps are **fields, not a wiki**. Prefer `list` / `search` / `show --section`
|
|
14
|
+
over reading a long markdown doc. That keeps token use on paths and purpose,
|
|
15
|
+
not narrative. When writing or updating a map, same rule: cover every door
|
|
16
|
+
and coupling; do not write narrative (`references/authoring.md`, Density).
|
|
17
|
+
See the package `GUIDE.md` ("Why this, not a wiki").
|
|
18
|
+
|
|
19
|
+
## When to invoke
|
|
20
|
+
|
|
21
|
+
- Before feature implementation, debugging, PRDs, implementation plans, or pre-mortems
|
|
22
|
+
- When unsure which feature map applies
|
|
23
|
+
- After shipping changes that affect architecture (update maps, then validate)
|
|
24
|
+
- When `list` is empty or `search`/`find` miss: **scour the repo and author maps** before other work (see `references/existing-repos.md`)
|
|
25
|
+
|
|
26
|
+
## Research sequence
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
feature-map list
|
|
30
|
+
feature-map search <keyword> # when the feature name is unclear
|
|
31
|
+
feature-map find <path-fragment>
|
|
32
|
+
feature-map <feature-name> # or: show <feature-name>
|
|
33
|
+
feature-map graph <feature> # cross-cutting dependencies
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`./bin/feature-map` is a repo-local shim for the same CLI (created by `feature-map init`).
|
|
37
|
+
|
|
38
|
+
Use `show <name> --section entry_points` (or `purpose`, `user_flow`, etc.) to limit token use on large maps.
|
|
39
|
+
|
|
40
|
+
If the list is empty, or nothing matches the area you are about to change,
|
|
41
|
+
**stop**. Follow `references/existing-repos.md`: inventory apps, cluster
|
|
42
|
+
capabilities, `feature-map init <slug>`, fill real paths, `validate` + `check`.
|
|
43
|
+
Then resume the research sequence.
|
|
44
|
+
|
|
45
|
+
## After implementation
|
|
46
|
+
|
|
47
|
+
1. Patch the fields that changed. Do not grow the map with prose.
|
|
48
|
+
2. Run `feature-map validate`
|
|
49
|
+
3. Run `feature-map check`
|
|
50
|
+
|
|
51
|
+
## Commands
|
|
52
|
+
|
|
53
|
+
See `references/commands.md` for the full CLI reference.
|
|
54
|
+
|
|
55
|
+
## Authoring
|
|
56
|
+
|
|
57
|
+
See `references/authoring.md` for shape, density, and conventions.
|
|
58
|
+
See `references/existing-repos.md` when adopting Feature Map on a codebase that already exists.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Authoring Feature Maps
|
|
2
|
+
|
|
3
|
+
Feature maps live in `.features/<slug>.yaml` at the repo root.
|
|
4
|
+
|
|
5
|
+
## Required sections
|
|
6
|
+
|
|
7
|
+
- `feature_name` — must match the filename stem (normalized)
|
|
8
|
+
- `purpose` — one sentence: what it does. Skip motivation unless it changes where you look.
|
|
9
|
+
- `entry_points` — primary doors only (routes, screens, jobs, CLIs); real paths
|
|
10
|
+
- `apps` — app names as a list, not descriptions (recommended; warning if missing)
|
|
11
|
+
|
|
12
|
+
## Recommended sections
|
|
13
|
+
|
|
14
|
+
- `user_flow` — one line per distinct path: `Actor → step → result`. Add `alt`/`error` only if code diverges.
|
|
15
|
+
- `related_features` — `slug (coupling)`; parenthetical is a phrase
|
|
16
|
+
|
|
17
|
+
## Optional
|
|
18
|
+
|
|
19
|
+
- `notes` — caveats and unknowns only; omit the key if none. Never history, README, or process tips. `validate` does not warn when this key is absent.
|
|
20
|
+
|
|
21
|
+
## Density
|
|
22
|
+
|
|
23
|
+
Index, not essay. Completeness is doors, apps, and couplings. Delete a sentence if it would not change which file the next agent opens. Do not drop a real door, app, or related slug to stay short. Do not add narrative keys (`overview`, `history`, `architecture`, `background`). `core_components` is the only extra path group `check` understands.
|
|
24
|
+
|
|
25
|
+
## Conventions
|
|
26
|
+
|
|
27
|
+
- Use underscores in filenames: `user_signup.yaml`
|
|
28
|
+
- `related_features` entries should start with a resolvable slug
|
|
29
|
+
- Run `feature-map validate` and `feature-map check` after edits
|
|
30
|
+
- Scaffold new maps: `feature-map init <name>`
|
|
31
|
+
- Bootstrap a new repo: `feature-map init`
|
|
32
|
+
- Existing repo with no maps: scour the code first (`existing-repos.md`); do not skip maps because the codebase predates Feature Map
|
|
33
|
+
- Patch fields in place when the architecture changes; do not append prose
|
|
34
|
+
|
|
35
|
+
## Schema
|
|
36
|
+
|
|
37
|
+
JSON Schema ships with the package at `share/feature_map/schema/feature-map.schema.json`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Feature Map CLI Reference
|
|
2
|
+
|
|
3
|
+
Invocation: `feature-map` (on PATH) or `./bin/feature-map` (repo-local shim).
|
|
4
|
+
|
|
5
|
+
Global flags: `--json`, `--version`
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
| Command | Description |
|
|
10
|
+
|---------|-------------|
|
|
11
|
+
| `list [--json]` | All feature slugs; JSON includes mtime and app count |
|
|
12
|
+
| `show <name> [--section <key>] [--json]` | Full map or one top-level section |
|
|
13
|
+
| `<name>` | Alias for `show <name>` |
|
|
14
|
+
| `search <query> [--json]` | Full-text search across all maps |
|
|
15
|
+
| `find <path-fragment> [--json]` | Reverse lookup by path string |
|
|
16
|
+
| `graph [name] [--format mermaid\|json\|dot]` | `related_features` graph |
|
|
17
|
+
| `validate [--strict] [--json]` | Structural validation |
|
|
18
|
+
| `check [--json]` | Staleness check for entry-point paths |
|
|
19
|
+
| `impact <file> [--transitive] [--json]` | Features referencing a file |
|
|
20
|
+
| `stats [--json]` | Coverage statistics |
|
|
21
|
+
| `init` | Bootstrap `.features/`, agent skill, config, AGENTS.md, shim |
|
|
22
|
+
| `init <name> [--force]` | Scaffold `.features/<name>.yaml` |
|
|
23
|
+
| `init --upgrade-skill` | Refresh the agent skill from the installed package |
|
|
24
|
+
| `install [--json]` | Verify install and repo setup |
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
feature-map list
|
|
30
|
+
feature-map auth
|
|
31
|
+
feature-map show auth --section entry_points
|
|
32
|
+
feature-map search billing
|
|
33
|
+
feature-map find src/app.py
|
|
34
|
+
feature-map graph auth --format mermaid
|
|
35
|
+
feature-map validate
|
|
36
|
+
feature-map check --json
|
|
37
|
+
feature-map impact src/app.py
|
|
38
|
+
feature-map stats --json
|
|
39
|
+
feature-map init
|
|
40
|
+
feature-map init billing --force
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Exit codes
|
|
44
|
+
|
|
45
|
+
- `0` — success
|
|
46
|
+
- `1` — user error (e.g. feature not found)
|
|
47
|
+
- `2` — validation failure (`validate --strict`)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Bootstrapping maps on an existing repository
|
|
2
|
+
|
|
3
|
+
`feature-map init` creates the workflow. It does **not** invent maps from
|
|
4
|
+
source. On a repo that already has code, you must **scour the tree and
|
|
5
|
+
author** `.features/*.yaml` before doing feature work.
|
|
6
|
+
|
|
7
|
+
## When this applies
|
|
8
|
+
|
|
9
|
+
- `feature-map list` is empty
|
|
10
|
+
- `search` / `find` miss the area you are about to change
|
|
11
|
+
- `.feature-map.yaml` `apps` is `[]` but the repo has multiple packages
|
|
12
|
+
|
|
13
|
+
Do not skip this and "just grep". Author maps first, then implement.
|
|
14
|
+
|
|
15
|
+
## Playbook
|
|
16
|
+
|
|
17
|
+
1. **Inventory apps** — top-level directories and manifests (`Gemfile`,
|
|
18
|
+
`package.json`, `pyproject.toml`, `go.mod`, `pubspec.yaml`, `apps/`,
|
|
19
|
+
`packages/`). Write them under `apps:` in `.feature-map.yaml`.
|
|
20
|
+
2. **Find seams** — routes, app shells, domain models, jobs, CLIs, docs,
|
|
21
|
+
and test names. These are where features show up.
|
|
22
|
+
3. **Cluster** — one map per user-visible capability or subsystem, not
|
|
23
|
+
per file. Cross-app journeys are one map with several `apps` and
|
|
24
|
+
`entry_points`.
|
|
25
|
+
4. **Scaffold + fill** — `feature-map init <slug>`, then replace
|
|
26
|
+
placeholders with real paths and a one-sentence `purpose` you
|
|
27
|
+
verified in code (`authoring.md`, Density).
|
|
28
|
+
5. **Verify** — `feature-map validate` and `feature-map check`. Prefer
|
|
29
|
+
paths that exist on disk. Record uncertainty in `notes`.
|
|
30
|
+
6. **Stop the first pass** when every listed app appears on at least one
|
|
31
|
+
map and the README's product nouns `search` successfully.
|
|
32
|
+
|
|
33
|
+
Full narrative: the package `GUIDE.md` §3.4 (existing repos).
|
|
34
|
+
|
|
35
|
+
## Anti-patterns
|
|
36
|
+
|
|
37
|
+
- One map per source file
|
|
38
|
+
- Invented `entry_points` that `check` would mark missing
|
|
39
|
+
- `entry_points` as a file inventory (doors only)
|
|
40
|
+
- Essays in `purpose`, `user_flow`, or `notes`
|
|
41
|
+
- Extra narrative keys (`overview`, `history`, `architecture`)
|
|
42
|
+
- `related_features` that do not start with a real slug
|
|
43
|
+
- Planning or coding a feature that has no map "because the repo is old"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
feature_name: {{feature_name}}
|
|
2
|
+
purpose: "One sentence: what {{FEATURE_TITLE}} does."
|
|
3
|
+
|
|
4
|
+
entry_points:
|
|
5
|
+
- path/to/primary/entry_point
|
|
6
|
+
- path/to/secondary/surface
|
|
7
|
+
|
|
8
|
+
apps:
|
|
9
|
+
- app_name
|
|
10
|
+
|
|
11
|
+
user_flow:
|
|
12
|
+
primary: "Actor → action → result."
|
|
13
|
+
|
|
14
|
+
related_features:
|
|
15
|
+
- related_feature_slug (coupling)
|
|
16
|
+
|
|
17
|
+
# notes: caveats/unknowns only — omit this key if none
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0"
|