featureparity 0.0.31 → 0.0.33
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.
- checksums.yaml +4 -4
- data/lib/fp/cli.rb +7 -1
- data/lib/fp/client.rb +5 -0
- data/lib/fp/commands/analyze.rb +2 -2
- data/lib/fp/commands/attach.rb +2 -2
- data/lib/fp/commands/attachments.rb +1 -1
- data/lib/fp/commands/check.rb +29 -0
- data/lib/fp/commands/ci_report.rb +1 -1
- data/lib/fp/commands/comment.rb +1 -1
- data/lib/fp/commands/comments.rb +1 -1
- data/lib/fp/commands/export.rb +2 -2
- data/lib/fp/commands/help.rb +66 -48
- data/lib/fp/commands/history.rb +2 -2
- data/lib/fp/commands/init.rb +42 -11
- data/lib/fp/commands/list.rb +3 -3
- data/lib/fp/commands/mark.rb +242 -50
- data/lib/fp/commands/matrix.rb +2 -2
- data/lib/fp/commands/profile.rb +2 -1
- data/lib/fp/commands/propose.rb +1 -1
- data/lib/fp/commands/propose_change.rb +1 -1
- data/lib/fp/commands/report.rb +2 -2
- data/lib/fp/commands/repos.rb +6 -6
- data/lib/fp/commands/setup.rb +2 -1
- data/lib/fp/commands/show.rb +10 -2
- data/lib/fp/commands/showroom.rb +6 -6
- data/lib/fp/commands/skill.rb +153 -0
- data/lib/fp/commands/surfaces.rb +5 -5
- data/lib/fp/commands/whoami.rb +34 -3
- data/lib/fp/commands.rb +1 -0
- data/lib/fp/config.rb +16 -6
- data/lib/fp/junit.rb +13 -0
- data/lib/fp/repo_detector.rb +17 -2
- data/lib/fp/version.rb +1 -1
- data/skills/fp/SKILL.md +31 -29
- data/skills/fp/references/cli.md +110 -75
- metadata +4 -4
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'fileutils'
|
|
4
|
+
|
|
5
|
+
module Fp
|
|
6
|
+
module Commands
|
|
7
|
+
# fp skill install [--agent claude|agents|all] [--dir PATH] [--global] [--path DIR] [--force]
|
|
8
|
+
# fp skill path
|
|
9
|
+
#
|
|
10
|
+
# Copies the Agent Skills package that ships inside the gem (`skills/fp/`) into an
|
|
11
|
+
# agent's skills directory (Fizzy #1984). The docs used to send agents to
|
|
12
|
+
# `npx skills add stowzilla/feature_parity`, which 404s because that repository is
|
|
13
|
+
# private. Installing from the gem needs no network, and the copy always matches the
|
|
14
|
+
# fp the agent will run, so re-running after `gem update featureparity` refreshes it.
|
|
15
|
+
#
|
|
16
|
+
# Targets, relative to the repo (or $HOME with --global):
|
|
17
|
+
# .claude/skills/fp Claude Code
|
|
18
|
+
# .agents/skills/fp Codex, Cursor, Gemini CLI, Copilot and the other agents that
|
|
19
|
+
# read the shared Agent Skills location
|
|
20
|
+
class Skill < Base
|
|
21
|
+
help_summary 'Install the fp agent skill bundled with this gem into a skills directory'
|
|
22
|
+
help_usage 'fp skill install [--agent claude|agents|all] [--dir PATH] [--global] [--force]',
|
|
23
|
+
'fp skill install --path <skills-dir>',
|
|
24
|
+
'fp skill path'
|
|
25
|
+
help_flag :agent, 'Which skills directory: claude (.claude/skills), agents (.agents/skills), or all (default)'
|
|
26
|
+
help_flag :dir, 'Repository to install into (defaults to the working directory)'
|
|
27
|
+
help_flag :global, 'Install into your home directory (~/.claude/skills, ~/.agents/skills) instead of a repo'
|
|
28
|
+
help_flag :path, 'An explicit skills directory; the skill is written to <path>/fp'
|
|
29
|
+
help_flag :force, "Replace a directory named fp that isn't the fp skill"
|
|
30
|
+
help_example 'fp skill install', 'Into .claude/skills/fp and .agents/skills/fp in this repo'
|
|
31
|
+
help_example 'fp skill install --agent claude --global', 'For Claude Code in every repo'
|
|
32
|
+
help_example 'fp skill path', 'Where the bundled skill lives, to copy it yourself'
|
|
33
|
+
help_note "Makes no API calls and needs no key. Re-run after upgrading the gem to refresh the copy.\n" \
|
|
34
|
+
'An existing fp skill is replaced; files you added inside it are removed.'
|
|
35
|
+
|
|
36
|
+
KNOWN_FLAGS = {
|
|
37
|
+
agent: :string,
|
|
38
|
+
dir: :string,
|
|
39
|
+
path: :string,
|
|
40
|
+
global: :boolean,
|
|
41
|
+
force: :boolean
|
|
42
|
+
}.freeze
|
|
43
|
+
|
|
44
|
+
SOURCE_DIR = File.expand_path('../../../skills/fp', __dir__)
|
|
45
|
+
SKILL_NAME = 'fp'
|
|
46
|
+
|
|
47
|
+
AGENT_DIRS = {
|
|
48
|
+
'claude' => File.join('.claude', 'skills'),
|
|
49
|
+
'agents' => File.join('.agents', 'skills')
|
|
50
|
+
}.freeze
|
|
51
|
+
|
|
52
|
+
def run(args)
|
|
53
|
+
opts, positional = parse_flags(args, KNOWN_FLAGS)
|
|
54
|
+
|
|
55
|
+
case positional.first
|
|
56
|
+
when 'install' then install(opts)
|
|
57
|
+
when 'path' then print_path
|
|
58
|
+
else
|
|
59
|
+
output.error("Usage: #{self.class.help_usage.join(' | ')}")
|
|
60
|
+
exit 1
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
private
|
|
65
|
+
|
|
66
|
+
def print_path
|
|
67
|
+
ensure_source!
|
|
68
|
+
output.success({ path: SOURCE_DIR, version: Fp::VERSION }) { puts SOURCE_DIR }
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def install(opts)
|
|
72
|
+
ensure_source!
|
|
73
|
+
|
|
74
|
+
installed = targets(opts).map { |skills_dir| install_into(skills_dir, opts[:force]) }
|
|
75
|
+
|
|
76
|
+
output.success({ version: Fp::VERSION, source: SOURCE_DIR, installed: installed }) do
|
|
77
|
+
installed.each do |i|
|
|
78
|
+
puts " #{i[:action].ljust(9)} #{i[:path]}"
|
|
79
|
+
end
|
|
80
|
+
puts
|
|
81
|
+
puts "Installed the fp #{Fp::VERSION} skill. Re-run `fp skill install` after upgrading the gem."
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def targets(opts)
|
|
86
|
+
return [File.expand_path(opts[:path])] if opts[:path]
|
|
87
|
+
|
|
88
|
+
agent = opts[:agent] || 'all'
|
|
89
|
+
dirs = agent == 'all' ? AGENT_DIRS.values : [AGENT_DIRS[agent]]
|
|
90
|
+
unless dirs.all?
|
|
91
|
+
output.error("--agent must be one of: #{(AGENT_DIRS.keys + ['all']).join(', ')}")
|
|
92
|
+
exit 1
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
root = opts[:global] ? Dir.home : File.expand_path(opts[:dir] || Dir.pwd)
|
|
96
|
+
unless File.directory?(root)
|
|
97
|
+
output.error("Not a directory: #{root}")
|
|
98
|
+
exit 1
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
dirs.map { |d| File.join(root, d) }
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def install_into(skills_dir, force)
|
|
105
|
+
dest = File.join(skills_dir, SKILL_NAME)
|
|
106
|
+
action = if !File.exist?(dest) then 'installed'
|
|
107
|
+
elsif same_tree?(dest) then 'unchanged'
|
|
108
|
+
else 'updated'
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if action == 'updated' && !fp_skill?(dest) && !force
|
|
112
|
+
output.error("#{dest} exists and isn't the fp skill. Pass --force to replace it.")
|
|
113
|
+
exit 1
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
unless action == 'unchanged'
|
|
117
|
+
FileUtils.rm_rf(dest)
|
|
118
|
+
FileUtils.mkdir_p(skills_dir)
|
|
119
|
+
FileUtils.cp_r(SOURCE_DIR, dest)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
{ path: dest, action: action }
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# A previous copy of this skill (any version) says `name: fp` in its frontmatter.
|
|
126
|
+
def fp_skill?(dir)
|
|
127
|
+
File.read(File.join(dir, 'SKILL.md'))[/\A---\n.*?^name:\s*["']?fp["']?\s*$/m]
|
|
128
|
+
rescue SystemCallError
|
|
129
|
+
false
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def same_tree?(dest)
|
|
133
|
+
relative_files(SOURCE_DIR) == relative_files(dest) &&
|
|
134
|
+
relative_files(SOURCE_DIR).all? do |f|
|
|
135
|
+
FileUtils.compare_file(File.join(SOURCE_DIR, f), File.join(dest, f))
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def relative_files(root)
|
|
140
|
+
Dir.glob('**/*', File::FNM_DOTMATCH, base: root)
|
|
141
|
+
.reject { |f| File.basename(f) == '.' || File.directory?(File.join(root, f)) }
|
|
142
|
+
.sort
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def ensure_source!
|
|
146
|
+
return if File.file?(File.join(SOURCE_DIR, 'SKILL.md'))
|
|
147
|
+
|
|
148
|
+
output.error("The fp skill isn't in this install (looked in #{SOURCE_DIR}). Reinstall the featureparity gem.")
|
|
149
|
+
exit 1
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
data/lib/fp/commands/surfaces.rb
CHANGED
|
@@ -71,11 +71,11 @@ module Fp
|
|
|
71
71
|
help_flag :showroom_instructions_file, 'Read --showroom-instructions from a file (multi-line)'
|
|
72
72
|
help_flag :showroom_position, 'Client showroom order: 1 is first; empty clears (unplaced surfaces follow, A-Z) (edit)'
|
|
73
73
|
help_flag :yes, 'Skip the typed-key confirmation on delete'
|
|
74
|
-
help_example 'fp surfaces --project
|
|
75
|
-
help_example 'fp surfaces add customer_android --project
|
|
76
|
-
help_example 'fp surfaces delete web --project
|
|
77
|
-
help_example 'fp surfaces edit web --project
|
|
78
|
-
help_example 'fp surfaces edit web --project
|
|
74
|
+
help_example 'fp surfaces --project acme'
|
|
75
|
+
help_example 'fp surfaces add customer_android --project acme --kind android --repo acme/customer-android'
|
|
76
|
+
help_example 'fp surfaces delete web --project acme --yes'
|
|
77
|
+
help_example 'fp surfaces edit web --project acme --showroom-url https://dev.example.com --showroom-instructions-file docs/showroom/web.txt'
|
|
78
|
+
help_example 'fp surfaces edit web --project acme --showroom-position 1'
|
|
79
79
|
|
|
80
80
|
def run(args)
|
|
81
81
|
# Subcommand dispatch. Bare `fp surfaces --project X` stays a list, so existing
|
data/lib/fp/commands/whoami.rb
CHANGED
|
@@ -7,17 +7,19 @@ module Fp
|
|
|
7
7
|
# Show the *resolved* configuration the CLI would actually use for this
|
|
8
8
|
# invocation: which profile is active, the API URL and where it came from,
|
|
9
9
|
# the environment that URL targets, and whether an API key is present
|
|
10
|
-
# (masked — never the full token)
|
|
11
|
-
# works even without a valid key. Honors --profile / --api-url / --json.
|
|
10
|
+
# (masked — never the full token), then asks the API who that key acts as
|
|
11
|
+
# (best-effort, so it works even without a valid key). Honors --profile / --api-url / --json.
|
|
12
12
|
class Whoami < Base
|
|
13
13
|
help_summary 'Show the resolved config (profile, API URL, environment, masked key)'
|
|
14
14
|
help_usage 'fp whoami [--json]'
|
|
15
15
|
help_example 'fp whoami'
|
|
16
16
|
help_example 'fp --profile staging whoami'
|
|
17
|
-
help_note
|
|
17
|
+
help_note "Config is resolved locally; the 'Acting as' line asks the API who the key belongs to and is skipped if that fails."
|
|
18
18
|
|
|
19
19
|
def run(_args)
|
|
20
20
|
r = config.resolved
|
|
21
|
+
identity = fetch_identity(r)
|
|
22
|
+
r = r.merge(identity: identity[:data], identity_error: identity[:error]).compact
|
|
21
23
|
|
|
22
24
|
output.success(r) do
|
|
23
25
|
puts 'Resolved FeatureParity CLI configuration:'
|
|
@@ -27,6 +29,7 @@ module Fp
|
|
|
27
29
|
puts " API URL: #{format_value(r[:api_url], r[:api_url_source])}"
|
|
28
30
|
puts " API key: #{key_line(r)}"
|
|
29
31
|
puts " Config file: #{r[:config_file]}"
|
|
32
|
+
puts " Acting as: #{identity_line(r)}"
|
|
30
33
|
|
|
31
34
|
if r[:profile_environment] && r[:profile_environment] != r[:environment]
|
|
32
35
|
puts
|
|
@@ -48,6 +51,34 @@ module Fp
|
|
|
48
51
|
|
|
49
52
|
private
|
|
50
53
|
|
|
54
|
+
# Asks the API who the key is. Never fatal: whoami must still print the local
|
|
55
|
+
# config offline or with a bad key, so a failure is reported on the Acting as line.
|
|
56
|
+
def fetch_identity(r)
|
|
57
|
+
return {} unless client && r[:api_key_present]
|
|
58
|
+
|
|
59
|
+
result = client.whoami
|
|
60
|
+
return { data: result[:data]['whoami'] || result[:data] } if result[:ok]
|
|
61
|
+
|
|
62
|
+
{ error: result[:error] }
|
|
63
|
+
rescue StandardError => e
|
|
64
|
+
{ error: e.message }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def identity_line(r)
|
|
68
|
+
id = r[:identity]
|
|
69
|
+
return "(unknown: #{r[:identity_error]})" if r[:identity_error]
|
|
70
|
+
return '(not checked)' unless id
|
|
71
|
+
|
|
72
|
+
if id['type'] == 'agent'
|
|
73
|
+
key = id['key'] || {}
|
|
74
|
+
owner = id['owner']
|
|
75
|
+
who = owner ? "#{owner['email']}'s agent" : 'an agent'
|
|
76
|
+
"#{key['name']} (#{key['token_hint']}), #{who}"
|
|
77
|
+
else
|
|
78
|
+
"#{id['email']} (signed in as a person)"
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
51
82
|
def format_value(value, source)
|
|
52
83
|
display = value.nil? || value.to_s.empty? ? '(none)' : value
|
|
53
84
|
source && source != 'none' ? "#{display} [from #{source}]" : display.to_s
|
data/lib/fp/commands.rb
CHANGED
|
@@ -33,6 +33,7 @@ require_relative 'commands/config_cmd'
|
|
|
33
33
|
require_relative 'commands/repos'
|
|
34
34
|
require_relative 'commands/setup'
|
|
35
35
|
require_relative 'commands/whoami'
|
|
36
|
+
require_relative 'commands/skill'
|
|
36
37
|
require_relative 'commands/version'
|
|
37
38
|
require_relative 'commands/help'
|
|
38
39
|
require_relative 'commands/attach'
|
data/lib/fp/config.rb
CHANGED
|
@@ -116,6 +116,16 @@ module Fp
|
|
|
116
116
|
end
|
|
117
117
|
|
|
118
118
|
class << self
|
|
119
|
+
# The base URL has no path: Client adds "/api/..." itself. People are handed
|
|
120
|
+
# "https://api.featureparity.dev/api" though, so strip trailing slashes and then
|
|
121
|
+
# one trailing "/api" path segment, and nothing else. Only a path segment that is
|
|
122
|
+
# exactly "api" goes ("https://x/v2/api" -> "https://x/v2", an "api" host is untouched).
|
|
123
|
+
def normalize_api_url(url)
|
|
124
|
+
return url unless url.is_a?(String)
|
|
125
|
+
|
|
126
|
+
url.strip.sub(%r{/+\z}, '').sub(%r{/api\z}i, '').sub(%r{/+\z}, '')
|
|
127
|
+
end
|
|
128
|
+
|
|
119
129
|
def load_config
|
|
120
130
|
return {} unless File.exist?(CONFIG_FILE)
|
|
121
131
|
|
|
@@ -241,10 +251,10 @@ module Fp
|
|
|
241
251
|
# Stored under a top-level `repos` key in config.yml, scoped by project slug:
|
|
242
252
|
#
|
|
243
253
|
# repos:
|
|
244
|
-
#
|
|
254
|
+
# acme:
|
|
245
255
|
# customer_android:
|
|
246
256
|
# path: /home/dev/code/customer-android
|
|
247
|
-
# repo:
|
|
257
|
+
# repo: acme/customer-android
|
|
248
258
|
#
|
|
249
259
|
# This is intentionally local (per fp installation) — it maps FeatureParity
|
|
250
260
|
# surfaces to wherever the code lives on THIS machine, so an agent working a
|
|
@@ -371,13 +381,13 @@ module Fp
|
|
|
371
381
|
# 1. Explicit --api-url flag
|
|
372
382
|
if @explicit_api_url && !@explicit_api_url.empty?
|
|
373
383
|
@api_url_source = 'flag'
|
|
374
|
-
return @explicit_api_url
|
|
384
|
+
return self.class.normalize_api_url(@explicit_api_url)
|
|
375
385
|
end
|
|
376
386
|
|
|
377
387
|
# 2. FP_API_URL env var
|
|
378
388
|
if ENV['FP_API_URL'] && !ENV['FP_API_URL'].empty?
|
|
379
389
|
@api_url_source = 'env (FP_API_URL)'
|
|
380
|
-
return ENV['FP_API_URL']
|
|
390
|
+
return self.class.normalize_api_url(ENV['FP_API_URL'])
|
|
381
391
|
end
|
|
382
392
|
|
|
383
393
|
# 3. Profile-specific URL
|
|
@@ -386,7 +396,7 @@ module Fp
|
|
|
386
396
|
profile = profiles[@profile_name]
|
|
387
397
|
if profile && profile['api_url']
|
|
388
398
|
@api_url_source = "profile (#{@profile_name})"
|
|
389
|
-
return profile['api_url']
|
|
399
|
+
return self.class.normalize_api_url(profile['api_url'])
|
|
390
400
|
end
|
|
391
401
|
end
|
|
392
402
|
|
|
@@ -394,7 +404,7 @@ module Fp
|
|
|
394
404
|
global_url = self.class.get_setting('api_url')
|
|
395
405
|
if global_url && !global_url.empty?
|
|
396
406
|
@api_url_source = 'global setting'
|
|
397
|
-
return global_url
|
|
407
|
+
return self.class.normalize_api_url(global_url)
|
|
398
408
|
end
|
|
399
409
|
|
|
400
410
|
# 5. Default
|
data/lib/fp/junit.rb
CHANGED
|
@@ -823,6 +823,19 @@ module Fp
|
|
|
823
823
|
[/\b(?:def|fun|func)\s+(test_?\w+)/i, :test] # minitest / xctest / pytest
|
|
824
824
|
].freeze
|
|
825
825
|
|
|
826
|
+
# The [name, kind] a single line declares, or nil when it declares no test we recognise.
|
|
827
|
+
# `fp mark <file>::<name>` finds its target with this, so it reads names exactly as the
|
|
828
|
+
# scanner will when the marker is bound.
|
|
829
|
+
def test_declared_on(line)
|
|
830
|
+
return nil if line.match?(COMMENT_LINE_RE)
|
|
831
|
+
|
|
832
|
+
TEST_DECL_PATTERNS.each do |re, kind|
|
|
833
|
+
match = line.match(re)
|
|
834
|
+
return [unescape_name(match.captures.last), kind] if match
|
|
835
|
+
end
|
|
836
|
+
nil
|
|
837
|
+
end
|
|
838
|
+
|
|
826
839
|
# The name of the first test declaration at or below `idx`, as [title, kind].
|
|
827
840
|
# Intervening comment and blank lines are skipped (a marker is often followed by more
|
|
828
841
|
# comments), but the search gives up at the first line of real code that declares
|
data/lib/fp/repo_detector.rb
CHANGED
|
@@ -339,7 +339,22 @@ module Fp
|
|
|
339
339
|
PY_MANIFESTS = %w[pyproject.toml requirements.txt requirements-dev.txt setup.cfg setup.py Pipfile].freeze
|
|
340
340
|
|
|
341
341
|
def python?(dir)
|
|
342
|
-
PY_MANIFESTS.any? { |f| file?(dir, f) } || file?(dir, 'pytest.ini')
|
|
342
|
+
PY_MANIFESTS.any? { |f| file?(dir, f) } || file?(dir, 'pytest.ini') || pytest_files?(dir)
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# pytest-style tests with no manifest beside them (Fizzy #1991): a small repo is often
|
|
346
|
+
# just `tests/test_*.py`. A test directory is read as part of its parent, so `tests/`
|
|
347
|
+
# isn't also reported as a runner of its own.
|
|
348
|
+
PY_TEST_DIRS = %w[tests test].freeze
|
|
349
|
+
|
|
350
|
+
def pytest_files?(dir)
|
|
351
|
+
return false if PY_TEST_DIRS.include?(File.basename(dir))
|
|
352
|
+
|
|
353
|
+
files = Dir.glob(path(dir, '{test_*,*_test}.py')) +
|
|
354
|
+
Dir.glob(path(dir, "{#{PY_TEST_DIRS.join(',')}}", '**', '{test_*,*_test}.py'))
|
|
355
|
+
files.first(50).any? { |f| File.read(f).match?(/^\s*(?:async\s+)?def test_|^\s*import pytest|^\s*from pytest /) }
|
|
356
|
+
rescue SystemCallError
|
|
357
|
+
false
|
|
343
358
|
end
|
|
344
359
|
|
|
345
360
|
def inspect_python(dir, frameworks, runners, surfaces, databases)
|
|
@@ -356,7 +371,7 @@ module Fp
|
|
|
356
371
|
end
|
|
357
372
|
end
|
|
358
373
|
|
|
359
|
-
if has.call('pytest') || file?(dir, 'pytest.ini') || file?(dir, 'conftest.py')
|
|
374
|
+
if has.call('pytest') || file?(dir, 'pytest.ini') || file?(dir, 'conftest.py') || pytest_files?(dir)
|
|
360
375
|
runners << runner('pytest', dir,
|
|
361
376
|
command: 'pytest',
|
|
362
377
|
report_command: 'pytest -o junit_family=xunit1 --junitxml=junit.xml',
|
data/lib/fp/version.rb
CHANGED
data/skills/fp/SKILL.md
CHANGED
|
@@ -17,6 +17,7 @@ command -v fp && fp --version
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
If missing: `gem install featureparity` (or `bundle exec fp` inside an app that already depends on the gem).
|
|
20
|
+
This skill ships inside the gem; `fp skill install` refreshes an installed copy after an upgrade.
|
|
20
21
|
`fp doctor` checks the install, the config and the repo without an API key. If `fp` fails
|
|
21
22
|
inside a repo but works elsewhere, see Troubleshooting.
|
|
22
23
|
|
|
@@ -54,17 +55,17 @@ every project the user belongs to; never ask for a per-project key.
|
|
|
54
55
|
### 1. Inventory and model the complete requirement scope
|
|
55
56
|
|
|
56
57
|
```bash
|
|
57
|
-
fp list --project
|
|
58
|
-
fp list --project
|
|
59
|
-
fp list --project
|
|
60
|
-
fp list --project
|
|
61
|
-
fp coverage --project
|
|
62
|
-
fp show <slug> --project
|
|
63
|
-
fp history <slug> --project
|
|
58
|
+
fp list --project acme # All active requirements
|
|
59
|
+
fp list --project acme --status draft # Proposed work; avoid duplicates
|
|
60
|
+
fp list --project acme --gaps # Requirements with a required surface lacking evidence
|
|
61
|
+
fp list --project acme --status draft --gaps # Drafts with a required surface lacking evidence
|
|
62
|
+
fp coverage --project acme # Drafts × surfaces, then the drafts with no evidence
|
|
63
|
+
fp show <slug> --project acme # Requirement details and evidence
|
|
64
|
+
fp history <slug> --project acme # Origins and pending changes
|
|
64
65
|
fp changes --source-url <work-item-url> # Activity prompted by one card, issue, or thread
|
|
65
|
-
fp matrix --project
|
|
66
|
-
fp matrix --project
|
|
67
|
-
fp check --project
|
|
66
|
+
fp matrix --project acme # ASCII parity matrix
|
|
67
|
+
fp matrix --project acme --csv # Export as CSV
|
|
68
|
+
fp check --project acme # Enforce parity (exits 1 on violations)
|
|
68
69
|
```
|
|
69
70
|
|
|
70
71
|
<!-- fp-shared:begin modeling -->
|
|
@@ -150,10 +151,10 @@ end
|
|
|
150
151
|
|
|
151
152
|
```bash
|
|
152
153
|
fp report <slug> \
|
|
153
|
-
--project
|
|
154
|
+
--project acme \
|
|
154
155
|
--surface api \
|
|
155
156
|
--file spec/qr_spec.rb \
|
|
156
|
-
--repo
|
|
157
|
+
--repo acme/marketplace \
|
|
157
158
|
--work-item https://app.fizzy.do/123/cards/456
|
|
158
159
|
```
|
|
159
160
|
|
|
@@ -179,7 +180,7 @@ report formatter to rspec, pytest, vitest or playwright itself, so the project n
|
|
|
179
180
|
new dependency, then reports exactly as `fp report --junit` would:
|
|
180
181
|
|
|
181
182
|
```bash
|
|
182
|
-
fp run --surface api --repo
|
|
183
|
+
fp run --surface api --repo acme/marketplace \
|
|
183
184
|
--work-item https://app.fizzy.do/123/cards/456 -- bundle exec rspec
|
|
184
185
|
```
|
|
185
186
|
|
|
@@ -192,9 +193,9 @@ bundle exec rspec --format progress --format json --out rspec.json
|
|
|
192
193
|
|
|
193
194
|
# 2. Upload — one call covers every marked test
|
|
194
195
|
fp report --junit rspec.json \
|
|
195
|
-
--project
|
|
196
|
+
--project acme \
|
|
196
197
|
--surface api \
|
|
197
|
-
--repo
|
|
198
|
+
--repo acme/marketplace \
|
|
198
199
|
--work-item https://app.fizzy.do/123/cards/456
|
|
199
200
|
```
|
|
200
201
|
|
|
@@ -297,7 +298,7 @@ this review, revise it or ask before writing the record.
|
|
|
297
298
|
Then create the proposal as a draft:
|
|
298
299
|
|
|
299
300
|
```bash
|
|
300
|
-
fp propose --project
|
|
301
|
+
fp propose --project acme \
|
|
301
302
|
--slug current_shipment_status \
|
|
302
303
|
--name "Dispatchers see current shipment status" \
|
|
303
304
|
--why "Dispatchers need to spot delayed shipments before they miss a delivery window" \
|
|
@@ -316,8 +317,8 @@ place you read it from.
|
|
|
316
317
|
Proposing several at once? Put them in a YAML file and run `fp propose --file reqs.yml
|
|
317
318
|
--dry-run` first. It lints every entry's wording and checks slugs and parents against the
|
|
318
319
|
catalog without writing anything. Then run it without `--dry-run`: the batch is created only if
|
|
319
|
-
every entry is valid. Bind tests with `fp mark <slug> <file>:<line>`
|
|
320
|
-
markers by hand.
|
|
320
|
+
every entry is valid. Bind tests with `fp mark <slug> <file>::<test name>` (or `<file>:<line>`)
|
|
321
|
+
rather than typing markers by hand; a name doesn't go stale when an earlier mark shifts the file.
|
|
321
322
|
|
|
322
323
|
**Confirm draft coverage with `fp coverage`.** The gate measures only active requirements,
|
|
323
324
|
so while everything you proposed is still a draft `fp check` says "Nothing to enforce yet"
|
|
@@ -347,7 +348,7 @@ change and say what prompted it. The requirement drops back to **draft** and a h
|
|
|
347
348
|
reviews the old-vs-new diff before it counts again.
|
|
348
349
|
|
|
349
350
|
```bash
|
|
350
|
-
fp propose-change print_container_qr --project
|
|
351
|
+
fp propose-change print_container_qr --project acme \
|
|
351
352
|
--why "Labels must survive a freezer" \
|
|
352
353
|
--acceptance "QR scans after 24h at -20C" \
|
|
353
354
|
--reason "Cold-chain rollout changed the requirement" \
|
|
@@ -358,7 +359,7 @@ fp propose-change print_container_qr --project stowzilla \
|
|
|
358
359
|
To propose deleting one instead (nothing is destroyed — a human decides):
|
|
359
360
|
|
|
360
361
|
```bash
|
|
361
|
-
fp propose-change print_container_qr --project
|
|
362
|
+
fp propose-change print_container_qr --project acme \
|
|
362
363
|
--removal --reason "Superseded by print_container_label"
|
|
363
364
|
```
|
|
364
365
|
|
|
@@ -375,8 +376,8 @@ Rules:
|
|
|
375
376
|
### 7. See what changed and why
|
|
376
377
|
|
|
377
378
|
```bash
|
|
378
|
-
fp history print_container_qr --project
|
|
379
|
-
fp history print_container_qr --project
|
|
379
|
+
fp history print_container_qr --project acme
|
|
380
|
+
fp history print_container_qr --project acme --pending # just what's awaiting review
|
|
380
381
|
```
|
|
381
382
|
|
|
382
383
|
Shows the timeline (who changed what, when, and what prompted it), the field-by-field
|
|
@@ -549,8 +550,9 @@ The per-task loop assumes a catalog already describes the product. On a repo's f
|
|
|
549
550
|
there isn't one yet, so the job is to write it down, as drafts a human activates, rather
|
|
550
551
|
than to check work against it.
|
|
551
552
|
|
|
552
|
-
1. `fp doctor` confirms fp runs
|
|
553
|
-
|
|
553
|
+
1. `fp doctor` confirms fp runs in this repo and shows which API it writes to, then lists
|
|
554
|
+
the repo's test runners, database and devcontainer. fp is a Ruby gem whatever language
|
|
555
|
+
the repo is written in, so a repo that pins its own Ruby can hide it (see Troubleshooting).
|
|
554
556
|
2. `fp init --detect` suggests a project slug, surfaces, and the command that makes each
|
|
555
557
|
test runner write a report. If the project doesn't exist yet, create it with
|
|
556
558
|
`fp projects create <slug> --name "..." --surfaces <keys>`, then run
|
|
@@ -585,11 +587,11 @@ and marks its evidence `suspect`, and a requirement holds one open proposal at a
|
|
|
585
587
|
proposing on every flag could put dozens of requirements in review at once.
|
|
586
588
|
|
|
587
589
|
```bash
|
|
588
|
-
fp analyze --project
|
|
589
|
-
fp analyze print_container_qr --project
|
|
590
|
-
fp analyze --project
|
|
591
|
-
fp analyze --project
|
|
592
|
-
fp analyze --project
|
|
590
|
+
fp analyze --project acme # sweep active + draft requirements
|
|
591
|
+
fp analyze print_container_qr --project acme # one requirement, with suggestions
|
|
592
|
+
fp analyze --project acme --conflicts # also check for contradictions (slower)
|
|
593
|
+
fp analyze --project acme --cached # read saved results only, no model calls
|
|
594
|
+
fp analyze --project acme --json
|
|
593
595
|
```
|
|
594
596
|
|
|
595
597
|
It goes one requirement at a time. Results are cached until the wording changes, so a
|