@flydocs/cli 0.6.0-alpha.3 → 0.6.0-alpha.30
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.
- package/dist/cli.js +2054 -470
- package/package.json +1 -1
- package/template/.claude/CLAUDE.md +43 -48
- package/template/.claude/agents/implementation-agent.md +1 -1
- package/template/.claude/agents/pm-agent.md +1 -1
- package/template/.claude/commands/activate.md +1 -1
- package/template/.claude/commands/attach.md +1 -1
- package/template/.claude/commands/block.md +2 -2
- package/template/.claude/commands/capture.md +1 -1
- package/template/.claude/commands/close.md +1 -1
- package/template/.claude/commands/flydocs-setup.md +359 -72
- package/template/.claude/commands/flydocs-upgrade.md +26 -27
- package/template/.claude/commands/implement.md +1 -1
- package/template/.claude/commands/knowledge.md +61 -0
- package/template/.claude/commands/new-project.md +1 -1
- package/template/.claude/commands/onboard.md +275 -0
- package/template/.claude/commands/project-update.md +1 -1
- package/template/.claude/commands/refine.md +1 -1
- package/template/.claude/commands/review.md +1 -1
- package/template/.claude/commands/start-session.md +1 -1
- package/template/.claude/commands/status.md +1 -1
- package/template/.claude/commands/validate.md +1 -1
- package/template/.claude/commands/wrap-session.md +1 -1
- package/template/.claude/hooks/auto-approve.py +212 -0
- package/template/.claude/hooks/post-pr-check.py +108 -0
- package/template/.claude/hooks/post-transition-check.py +281 -0
- package/template/.claude/hooks/prompt-submit.py +554 -0
- package/template/.claude/hooks/session-start.py +262 -0
- package/template/.claude/hooks/stop-gate.py +162 -0
- package/template/.claude/settings.json +41 -4
- package/template/.claude/skills/README.md +23 -25
- package/template/.claude/skills/flydocs-workflow/SKILL.md +134 -42
- package/template/.claude/skills/flydocs-workflow/cursor-rule.mdc +9 -8
- package/template/.claude/skills/flydocs-workflow/reference/comment-templates.md +1 -0
- package/template/.claude/skills/flydocs-workflow/reference/golden-rules.md +28 -17
- package/template/.claude/skills/flydocs-workflow/reference/graph-schema.md +116 -0
- package/template/.claude/skills/flydocs-workflow/reference/pr-workflow.md +120 -0
- package/template/.claude/skills/flydocs-workflow/reference/priority-estimates.md +37 -15
- package/template/.claude/skills/flydocs-workflow/reference/service-descriptor-schema.md +260 -0
- package/template/.claude/skills/flydocs-workflow/reference/status-workflow.md +26 -26
- package/template/.claude/skills/flydocs-workflow/scripts/_local/__init__.py +0 -0
- package/template/.claude/skills/{flydocs-local/scripts/flydocs_api.py → flydocs-workflow/scripts/_local/file_store.py} +137 -47
- package/template/.claude/skills/flydocs-workflow/scripts/flydocs_api.py +724 -0
- package/template/{.flydocs → .claude/skills/flydocs-workflow}/scripts/generate_manifest.py +4 -4
- package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_build.py +132 -1
- package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_query.py +18 -5
- package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_session.py +1 -10
- package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_update.py +4 -4
- package/template/.claude/skills/{flydocs-context-graph → flydocs-workflow}/scripts/graph_utils.py +2 -1
- package/template/.claude/skills/flydocs-workflow/scripts/issues.py +738 -0
- package/template/.claude/skills/flydocs-workflow/scripts/projects.py +144 -0
- package/template/.claude/skills/flydocs-workflow/scripts/pull_services.py +128 -0
- package/template/.claude/skills/flydocs-workflow/scripts/push_service.py +132 -0
- package/template/.claude/skills/flydocs-workflow/scripts/session.py +54 -0
- package/template/.claude/skills/flydocs-workflow/scripts/test_enforcement.py +225 -0
- package/template/.claude/skills/flydocs-workflow/scripts/workspace.py +902 -0
- package/template/.claude/skills/flydocs-workflow/session.md +87 -29
- package/template/.claude/skills/flydocs-workflow/stages/activate.md +18 -7
- package/template/.claude/skills/flydocs-workflow/stages/capture.md +10 -5
- package/template/.claude/skills/flydocs-workflow/stages/close.md +4 -3
- package/template/.claude/skills/flydocs-workflow/stages/implement.md +33 -9
- package/template/.claude/skills/flydocs-workflow/stages/refine.md +22 -6
- package/template/.claude/skills/flydocs-workflow/stages/review.md +16 -4
- package/template/.claude/skills/flydocs-workflow/stages/validate.md +3 -1
- package/template/.claude/skills/flydocs-workflow/templates/pr/default.md +33 -0
- package/template/.cursor/agents/implementation-agent.md +1 -1
- package/template/.cursor/agents/pm-agent.md +2 -2
- package/template/.cursor/hooks.json +10 -3
- package/template/.env.example +6 -6
- package/template/.flydocs/config.json +5 -18
- package/template/.flydocs/templates/README.md +13 -14
- package/template/.flydocs/templates/bug.md +17 -153
- package/template/.flydocs/templates/chore.md +10 -98
- package/template/.flydocs/templates/feature.md +12 -158
- package/template/.flydocs/templates/idea.md +11 -111
- package/template/.flydocs/templates/quick-capture.md +4 -8
- package/template/.flydocs/version +1 -1
- package/template/AGENTS.md +44 -32
- package/template/CHANGELOG.md +37 -0
- package/template/flydocs/README.md +1 -3
- package/template/flydocs/context/project.md +6 -3
- package/template/flydocs/design-system/README.md +3 -3
- package/template/flydocs/knowledge/INDEX.md +38 -53
- package/template/flydocs/knowledge/README.md +60 -9
- package/template/flydocs/knowledge/templates/decision.md +47 -0
- package/template/flydocs/knowledge/templates/feature.md +35 -0
- package/template/flydocs/knowledge/templates/note.md +25 -0
- package/template/manifest.json +24 -20
- package/template/.claude/skills/flydocs-cloud/SKILL.md +0 -113
- package/template/.claude/skills/flydocs-cloud/cursor-rule.mdc +0 -50
- package/template/.claude/skills/flydocs-cloud/scripts/assign.py +0 -22
- package/template/.claude/skills/flydocs-cloud/scripts/assign_cycle.py +0 -28
- package/template/.claude/skills/flydocs-cloud/scripts/assign_milestone.py +0 -22
- package/template/.claude/skills/flydocs-cloud/scripts/comment.py +0 -29
- package/template/.claude/skills/flydocs-cloud/scripts/create_issue.py +0 -66
- package/template/.claude/skills/flydocs-cloud/scripts/create_milestone.py +0 -35
- package/template/.claude/skills/flydocs-cloud/scripts/create_project.py +0 -33
- package/template/.claude/skills/flydocs-cloud/scripts/create_team.py +0 -39
- package/template/.claude/skills/flydocs-cloud/scripts/estimate.py +0 -29
- package/template/.claude/skills/flydocs-cloud/scripts/flydocs_api.py +0 -210
- package/template/.claude/skills/flydocs-cloud/scripts/get_issue.py +0 -24
- package/template/.claude/skills/flydocs-cloud/scripts/link.py +0 -28
- package/template/.claude/skills/flydocs-cloud/scripts/list_cycles.py +0 -28
- package/template/.claude/skills/flydocs-cloud/scripts/list_issues.py +0 -44
- package/template/.claude/skills/flydocs-cloud/scripts/list_labels.py +0 -19
- package/template/.claude/skills/flydocs-cloud/scripts/list_milestones.py +0 -28
- package/template/.claude/skills/flydocs-cloud/scripts/list_projects.py +0 -31
- package/template/.claude/skills/flydocs-cloud/scripts/list_providers.py +0 -19
- package/template/.claude/skills/flydocs-cloud/scripts/list_teams.py +0 -19
- package/template/.claude/skills/flydocs-cloud/scripts/priority.py +0 -29
- package/template/.claude/skills/flydocs-cloud/scripts/project_update.py +0 -45
- package/template/.claude/skills/flydocs-cloud/scripts/set_labels.py +0 -68
- package/template/.claude/skills/flydocs-cloud/scripts/set_provider.py +0 -46
- package/template/.claude/skills/flydocs-cloud/scripts/set_team.py +0 -41
- package/template/.claude/skills/flydocs-cloud/scripts/transition.py +0 -26
- package/template/.claude/skills/flydocs-cloud/scripts/update_description.py +0 -36
- package/template/.claude/skills/flydocs-cloud/scripts/update_issue.py +0 -82
- package/template/.claude/skills/flydocs-context-graph/SKILL.md +0 -87
- package/template/.claude/skills/flydocs-context-graph/schema.md +0 -78
- package/template/.claude/skills/flydocs-context-graph/scripts/graph_context.py +0 -338
- package/template/.claude/skills/flydocs-context7/SKILL.md +0 -105
- package/template/.claude/skills/flydocs-context7/cursor-rule.mdc +0 -49
- package/template/.claude/skills/flydocs-context7/scripts/context7.py +0 -293
- package/template/.claude/skills/flydocs-estimates/SKILL.md +0 -384
- package/template/.claude/skills/flydocs-figma/SKILL.md +0 -377
- package/template/.claude/skills/flydocs-figma/references/PROMPTING.md +0 -108
- package/template/.claude/skills/flydocs-figma/references/TROUBLESHOOTING.md +0 -112
- package/template/.claude/skills/flydocs-local/SKILL.md +0 -103
- package/template/.claude/skills/flydocs-local/cursor-rule.mdc +0 -43
- package/template/.claude/skills/flydocs-local/scripts/assign.py +0 -20
- package/template/.claude/skills/flydocs-local/scripts/comment.py +0 -27
- package/template/.claude/skills/flydocs-local/scripts/create_issue.py +0 -44
- package/template/.claude/skills/flydocs-local/scripts/estimate.py +0 -37
- package/template/.claude/skills/flydocs-local/scripts/get_issue.py +0 -20
- package/template/.claude/skills/flydocs-local/scripts/link.py +0 -41
- package/template/.claude/skills/flydocs-local/scripts/list_issues.py +0 -34
- package/template/.claude/skills/flydocs-local/scripts/priority.py +0 -37
- package/template/.claude/skills/flydocs-local/scripts/project_update.py +0 -67
- package/template/.claude/skills/flydocs-local/scripts/status_summary.py +0 -16
- package/template/.claude/skills/flydocs-local/scripts/transition.py +0 -24
- package/template/.claude/skills/flydocs-local/scripts/update_description.py +0 -35
- package/template/.claude/skills/flydocs-local/scripts/update_issue.py +0 -84
- package/template/.flydocs/hooks/auto-approve.py +0 -71
- package/template/.flydocs/hooks/prompt-submit.py +0 -277
- package/template/.flydocs/scripts/skill_manager.py +0 -541
- /package/template/{.flydocs → .claude}/hooks/post-edit.py +0 -0
- /package/template/.claude/skills/{flydocs-estimates/references → flydocs-workflow/reference}/provider-costs.md +0 -0
- /package/template/.claude/skills/flydocs-workflow/templates/{bug.md → issues/bug.md} +0 -0
- /package/template/.claude/skills/flydocs-workflow/templates/{chore.md → issues/chore.md} +0 -0
- /package/template/.claude/skills/flydocs-workflow/templates/{feature.md → issues/feature.md} +0 -0
- /package/template/.claude/skills/flydocs-workflow/templates/{idea.md → issues/idea.md} +0 -0
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Set provider preference via the FlyDocs Relay API.
|
|
3
|
-
|
|
4
|
-
Stores the provider type on the relay (for server-side routing)
|
|
5
|
-
and updates the local config (for display/reference).
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import argparse
|
|
9
|
-
import json
|
|
10
|
-
import sys
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
|
|
13
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
14
|
-
from flydocs_api import get_client, output_json, fail
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def main():
|
|
18
|
-
parser = argparse.ArgumentParser(description="Set provider preference")
|
|
19
|
-
parser.add_argument(
|
|
20
|
-
"provider_type",
|
|
21
|
-
choices=["linear", "jira"],
|
|
22
|
-
help="Provider type",
|
|
23
|
-
)
|
|
24
|
-
args = parser.parse_args()
|
|
25
|
-
|
|
26
|
-
client = get_client()
|
|
27
|
-
result = client.post("/auth/provider", {"providerType": args.provider_type})
|
|
28
|
-
|
|
29
|
-
# Update local config with provider type
|
|
30
|
-
config_path = client.config_path
|
|
31
|
-
if config_path.exists():
|
|
32
|
-
with open(config_path, "r") as f:
|
|
33
|
-
config = json.load(f)
|
|
34
|
-
if "provider" not in config:
|
|
35
|
-
config["provider"] = {"type": args.provider_type, "teamId": None}
|
|
36
|
-
else:
|
|
37
|
-
config["provider"]["type"] = args.provider_type
|
|
38
|
-
with open(config_path, "w") as f:
|
|
39
|
-
json.dump(config, f, indent=2)
|
|
40
|
-
f.write("\n")
|
|
41
|
-
|
|
42
|
-
output_json(result)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if __name__ == "__main__":
|
|
46
|
-
main()
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Set team preference via the FlyDocs Relay API.
|
|
3
|
-
|
|
4
|
-
Stores the team preference on the relay (for server-side scoping)
|
|
5
|
-
and updates the local config (for display/reference).
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
import argparse
|
|
9
|
-
import json
|
|
10
|
-
import sys
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
|
|
13
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
14
|
-
from flydocs_api import get_client, output_json, fail
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def main():
|
|
18
|
-
parser = argparse.ArgumentParser(description="Set team preference")
|
|
19
|
-
parser.add_argument("team_id", help="Linear team UUID")
|
|
20
|
-
args = parser.parse_args()
|
|
21
|
-
|
|
22
|
-
client = get_client()
|
|
23
|
-
result = client.post("/auth/team", {"teamId": args.team_id})
|
|
24
|
-
|
|
25
|
-
# Update local config with team ID
|
|
26
|
-
config_path = client.config_path
|
|
27
|
-
if config_path.exists():
|
|
28
|
-
with open(config_path, "r") as f:
|
|
29
|
-
config = json.load(f)
|
|
30
|
-
if "provider" not in config:
|
|
31
|
-
config["provider"] = {"type": "linear", "teamId": None}
|
|
32
|
-
config["provider"]["teamId"] = args.team_id
|
|
33
|
-
with open(config_path, "w") as f:
|
|
34
|
-
json.dump(config, f, indent=2)
|
|
35
|
-
f.write("\n")
|
|
36
|
-
|
|
37
|
-
output_json(result)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if __name__ == "__main__":
|
|
41
|
-
main()
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Transition an issue to a new status with a required comment."""
|
|
3
|
-
|
|
4
|
-
import sys
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
|
|
7
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
8
|
-
from flydocs_api import get_client, output_json, fail
|
|
9
|
-
|
|
10
|
-
if len(sys.argv) < 4:
|
|
11
|
-
fail("Usage: transition.py <ref> <STATUS> <comment>")
|
|
12
|
-
|
|
13
|
-
ref, status, comment = sys.argv[1], sys.argv[2].upper(), sys.argv[3]
|
|
14
|
-
client = get_client()
|
|
15
|
-
|
|
16
|
-
result = client.post(f"/issues/{ref}/transition", {
|
|
17
|
-
"status": status,
|
|
18
|
-
"comment": comment,
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
output_json({
|
|
22
|
-
"success": result.get("success", True),
|
|
23
|
-
"issue": result.get("issue", ref),
|
|
24
|
-
"previousStatus": result.get("previousStatus", ""),
|
|
25
|
-
"newStatus": result.get("newStatus", status),
|
|
26
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Update an issue's description via the FlyDocs Relay API."""
|
|
3
|
-
|
|
4
|
-
import argparse
|
|
5
|
-
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
9
|
-
from flydocs_api import get_client, output_json, fail
|
|
10
|
-
|
|
11
|
-
parser = argparse.ArgumentParser(description="Update issue description")
|
|
12
|
-
parser.add_argument("ref", help="Issue reference (e.g., ENG-123)")
|
|
13
|
-
parser.add_argument("--text", default=None)
|
|
14
|
-
parser.add_argument("--file", default=None)
|
|
15
|
-
args = parser.parse_args()
|
|
16
|
-
|
|
17
|
-
# Resolve text: --file > stdin > --text
|
|
18
|
-
text = args.text
|
|
19
|
-
if args.file:
|
|
20
|
-
try:
|
|
21
|
-
text = Path(args.file).read_text()
|
|
22
|
-
except FileNotFoundError:
|
|
23
|
-
fail(f"File not found: {args.file}")
|
|
24
|
-
elif text is None and not sys.stdin.isatty():
|
|
25
|
-
text = sys.stdin.read().strip()
|
|
26
|
-
|
|
27
|
-
if not text:
|
|
28
|
-
fail("Provide text via --text, --file, or stdin")
|
|
29
|
-
|
|
30
|
-
client = get_client()
|
|
31
|
-
result = client.put(f"/issues/{args.ref}/description", {"text": text})
|
|
32
|
-
|
|
33
|
-
output_json({
|
|
34
|
-
"success": result.get("success", True),
|
|
35
|
-
"issue": result.get("issue", args.ref),
|
|
36
|
-
})
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Bulk update an issue — set multiple fields in a single API call."""
|
|
3
|
-
|
|
4
|
-
import argparse
|
|
5
|
-
import sys
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
|
|
8
|
-
sys.path.insert(0, str(Path(__file__).parent))
|
|
9
|
-
from flydocs_api import get_client, output_json, fail
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def main():
|
|
13
|
-
parser = argparse.ArgumentParser(description="Update issue fields")
|
|
14
|
-
parser.add_argument("ref", help="Issue reference (e.g., ENG-123)")
|
|
15
|
-
parser.add_argument("--title", default=None)
|
|
16
|
-
parser.add_argument("--priority", type=int, choices=range(5))
|
|
17
|
-
parser.add_argument("--estimate", type=int, choices=range(1, 6))
|
|
18
|
-
parser.add_argument("--assignee", default=None)
|
|
19
|
-
parser.add_argument("--state", default=None)
|
|
20
|
-
parser.add_argument("--description", default=None)
|
|
21
|
-
parser.add_argument("--description-file", default=None)
|
|
22
|
-
parser.add_argument("--labels", default=None, help="Comma-separated label names")
|
|
23
|
-
parser.add_argument("--comment", default=None)
|
|
24
|
-
args = parser.parse_args()
|
|
25
|
-
|
|
26
|
-
# Build request body from provided args
|
|
27
|
-
body: dict = {}
|
|
28
|
-
updated_fields: list[str] = []
|
|
29
|
-
|
|
30
|
-
if args.title is not None:
|
|
31
|
-
body["title"] = args.title
|
|
32
|
-
updated_fields.append("title")
|
|
33
|
-
|
|
34
|
-
if args.priority is not None:
|
|
35
|
-
body["priority"] = args.priority
|
|
36
|
-
updated_fields.append("priority")
|
|
37
|
-
|
|
38
|
-
if args.estimate is not None:
|
|
39
|
-
body["estimate"] = args.estimate
|
|
40
|
-
updated_fields.append("estimate")
|
|
41
|
-
|
|
42
|
-
if args.assignee is not None:
|
|
43
|
-
body["assignee"] = args.assignee
|
|
44
|
-
updated_fields.append("assignee")
|
|
45
|
-
|
|
46
|
-
if args.state is not None:
|
|
47
|
-
body["state"] = args.state.upper()
|
|
48
|
-
updated_fields.append("state")
|
|
49
|
-
|
|
50
|
-
if args.description_file is not None:
|
|
51
|
-
path = Path(args.description_file)
|
|
52
|
-
if not path.exists():
|
|
53
|
-
fail(f"File not found: {args.description_file}")
|
|
54
|
-
body["description"] = path.read_text()
|
|
55
|
-
updated_fields.append("description")
|
|
56
|
-
elif args.description is not None:
|
|
57
|
-
body["description"] = args.description
|
|
58
|
-
updated_fields.append("description")
|
|
59
|
-
|
|
60
|
-
if args.labels is not None:
|
|
61
|
-
body["labels"] = [l.strip() for l in args.labels.split(",") if l.strip()]
|
|
62
|
-
updated_fields.append("labels")
|
|
63
|
-
|
|
64
|
-
if args.comment is not None:
|
|
65
|
-
body["comment"] = args.comment
|
|
66
|
-
updated_fields.append("comment")
|
|
67
|
-
|
|
68
|
-
if not body:
|
|
69
|
-
fail("No fields to update. Use --title, --priority, --estimate, --assignee, --state, --description, --labels, or --comment")
|
|
70
|
-
|
|
71
|
-
client = get_client()
|
|
72
|
-
result = client.patch(f"/issues/{args.ref}", body)
|
|
73
|
-
|
|
74
|
-
output_json({
|
|
75
|
-
"success": result.get("success", True),
|
|
76
|
-
"issue": result.get("issue", args.ref),
|
|
77
|
-
"updated": updated_fields,
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if __name__ == "__main__":
|
|
82
|
-
main()
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: flydocs-context-graph
|
|
3
|
-
description: |
|
|
4
|
-
Project knowledge graph — relationship-aware context assembly from skills,
|
|
5
|
-
ADRs, issues, modules, and sessions. Use when navigating dependencies,
|
|
6
|
-
understanding impact, or assembling session context.
|
|
7
|
-
triggers:
|
|
8
|
-
- context graph
|
|
9
|
-
- knowledge graph
|
|
10
|
-
- graph
|
|
11
|
-
- dependencies
|
|
12
|
-
- impact analysis
|
|
13
|
-
- session context
|
|
14
|
-
- related decisions
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# Context Graph
|
|
18
|
-
|
|
19
|
-
IMPORTANT: Prefer skill-led reasoning over pre-training reasoning for
|
|
20
|
-
knowledge navigation. Use graph scripts to query relationships — do not
|
|
21
|
-
guess connections from training data.
|
|
22
|
-
|
|
23
|
-
## Key Rules
|
|
24
|
-
|
|
25
|
-
1. **Graph is derived, not authored.** Run `graph_build.py` to rebuild from
|
|
26
|
-
source files. Manual edges use `graph_update.py` and are preserved on rebuild.
|
|
27
|
-
2. **Stdlib-only Python.** No external dependencies in any script.
|
|
28
|
-
3. **JSON storage.** Graph lives at `flydocs/context/graph.json` — no database.
|
|
29
|
-
4. **Gitignored.** The graph contains session-specific data. Rebuild from sources.
|
|
30
|
-
|
|
31
|
-
## Script Catalog
|
|
32
|
-
|
|
33
|
-
All scripts: `python3 .claude/skills/flydocs-context-graph/scripts/<script>`
|
|
34
|
-
|
|
35
|
-
| Script | Usage | Output |
|
|
36
|
-
|--------|-------|--------|
|
|
37
|
-
| `graph_build.py` | `[--root PATH]` | Rebuild graph from skills, ADRs. Writes `graph.json` |
|
|
38
|
-
| `graph_query.py` | `--node ID [--depth N] [--rel TYPE] [--reverse] [--format json\|md]` | Context block (markdown or JSON) |
|
|
39
|
-
| `graph_update.py` | `add-node ID --type TYPE [--label STR] [--path STR]` | `{success, node}` |
|
|
40
|
-
| | `remove-node ID` | `{success, removed}` |
|
|
41
|
-
| | `add-edge FROM TO REL [--weight N] [--manual]` | `{success, edge}` |
|
|
42
|
-
| | `remove-edge FROM TO REL` | `{success, removed}` |
|
|
43
|
-
| `graph_context.py` | `[--issue REF] [--branch NAME]` | Plain text context block for prime hook |
|
|
44
|
-
| `graph_session.py` | `--summary "..." [--issue REF]... [--decision NNN]...` | `{success, sessionId, edges[]}` |
|
|
45
|
-
|
|
46
|
-
### Script Notes
|
|
47
|
-
|
|
48
|
-
- **`graph_build.py`**: Scans `.claude/skills/*/SKILL.md` and
|
|
49
|
-
`flydocs/knowledge/decisions/*.md`. Extracts cross-references from ADR
|
|
50
|
-
"Relationship to Other ADRs" sections. Preserves edges marked `"manual": true`.
|
|
51
|
-
- **`graph_query.py --depth`**: BFS traversal depth (default 2). Higher depth
|
|
52
|
-
returns more context but may be noisy.
|
|
53
|
-
- **`graph_query.py --reverse`**: Follow edges in reverse direction (who points to this node?).
|
|
54
|
-
- **`graph_update.py --manual`**: Mark edge as manually added (preserved on rebuild).
|
|
55
|
-
- **`graph_context.py`**: Called by the prime hook automatically. Assembles compressed
|
|
56
|
-
context from active issue/branch traversal + recent session nodes. ~200-400 tokens max.
|
|
57
|
-
- **`graph_session.py`**: Called during session wrap. Creates a session node with
|
|
58
|
-
WORKED_ON edges to issues. Session nodes older than 30 days get reduced weight;
|
|
59
|
-
nodes within 7 days get full weight.
|
|
60
|
-
|
|
61
|
-
## Node Types
|
|
62
|
-
|
|
63
|
-
| Type | ID Pattern | Source |
|
|
64
|
-
|------|-----------|--------|
|
|
65
|
-
| `skill` | `skill:{name}` | SKILL.md frontmatter |
|
|
66
|
-
| `decision` | `decision:{number}` | ADR directory |
|
|
67
|
-
| `issue` | `issue:{identifier}` | Issue tracker |
|
|
68
|
-
| `module` | `module:{name}` | Manual |
|
|
69
|
-
| `session` | `session:{date-seq}` | Session wrap |
|
|
70
|
-
| `concept` | `concept:{name}` | Manual |
|
|
71
|
-
|
|
72
|
-
## Edge Types
|
|
73
|
-
|
|
74
|
-
| Relationship | Meaning |
|
|
75
|
-
|-------------|---------|
|
|
76
|
-
| `EXTENDS` | Builds on, refines |
|
|
77
|
-
| `IMPLEMENTS` | Realizes in code/config |
|
|
78
|
-
| `DELEGATES_TO` | Hands off execution |
|
|
79
|
-
| `PRECEDES` | Should load/execute before |
|
|
80
|
-
| `MODIFIES` | Changes/affects |
|
|
81
|
-
| `WORKED_ON` | Session activity |
|
|
82
|
-
| `PRODUCED` | Created as output |
|
|
83
|
-
| `RELATES_TO` | General association |
|
|
84
|
-
| `SUPERSEDES` | Replaces |
|
|
85
|
-
| `BLOCKS` | Prevents progress |
|
|
86
|
-
|
|
87
|
-
For full schema details, see `schema.md`.
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Context Graph Schema
|
|
2
|
-
|
|
3
|
-
Reference for the graph JSON structure stored at `flydocs/context/graph.json`.
|
|
4
|
-
|
|
5
|
-
## Top-Level Structure
|
|
6
|
-
|
|
7
|
-
```json
|
|
8
|
-
{
|
|
9
|
-
"version": 1,
|
|
10
|
-
"updated": "ISO-8601 timestamp",
|
|
11
|
-
"nodes": { "<id>": { ... } },
|
|
12
|
-
"edges": [ { ... } ]
|
|
13
|
-
}
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Node Schema
|
|
17
|
-
|
|
18
|
-
```json
|
|
19
|
-
{
|
|
20
|
-
"type": "skill | decision | issue | module | session | concept",
|
|
21
|
-
"label": "Human-readable name",
|
|
22
|
-
"path": "Relative file path (optional)",
|
|
23
|
-
"status": "Node-specific status (optional)",
|
|
24
|
-
"date": "ISO date for temporal nodes (optional)",
|
|
25
|
-
"tier": "Skill tier: behavioral | mechanism | premium (optional)",
|
|
26
|
-
"manual": true
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**ID conventions:**
|
|
31
|
-
|
|
32
|
-
| Type | Pattern | Example |
|
|
33
|
-
|------|---------|---------|
|
|
34
|
-
| skill | `skill:{directory-name}` | `skill:typescript-strict` |
|
|
35
|
-
| decision | `decision:{3-digit-number}` | `decision:001` |
|
|
36
|
-
| issue | `issue:{identifier}` | `issue:FLY-56` |
|
|
37
|
-
| module | `module:{kebab-name}` | `module:install-script` |
|
|
38
|
-
| session | `session:{YYYY-MM-DD-seq}` | `session:2026-02-03-a` |
|
|
39
|
-
| concept | `concept:{kebab-name}` | `concept:progressive-disclosure` |
|
|
40
|
-
|
|
41
|
-
## Edge Schema
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
{
|
|
45
|
-
"from": "source node ID",
|
|
46
|
-
"to": "target node ID",
|
|
47
|
-
"rel": "RELATIONSHIP_TYPE",
|
|
48
|
-
"weight": 0.0-1.0,
|
|
49
|
-
"manual": true
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Weight guidelines:**
|
|
54
|
-
|
|
55
|
-
| Weight | Meaning |
|
|
56
|
-
|--------|---------|
|
|
57
|
-
| 1.0 | Direct, strong relationship |
|
|
58
|
-
| 0.7-0.9 | Strong but indirect |
|
|
59
|
-
| 0.4-0.6 | Moderate association |
|
|
60
|
-
| 0.1-0.3 | Weak or tangential |
|
|
61
|
-
|
|
62
|
-
**Edges with `"manual": true`** are preserved when `graph_build.py` rebuilds
|
|
63
|
-
the graph from sources. Auto-derived edges are regenerated on each build.
|
|
64
|
-
|
|
65
|
-
## Relationship Types
|
|
66
|
-
|
|
67
|
-
| Relationship | Direction | Example |
|
|
68
|
-
|-------------|-----------|---------|
|
|
69
|
-
| `EXTENDS` | A extends B | ADR-004 extends ADR-001 |
|
|
70
|
-
| `IMPLEMENTS` | A implements B | Issue implements a decision |
|
|
71
|
-
| `DELEGATES_TO` | A delegates to B | Workflow delegates to mechanism |
|
|
72
|
-
| `PRECEDES` | A should load before B | typescript-strict precedes implementation |
|
|
73
|
-
| `MODIFIES` | A modifies B | Issue modifies a module |
|
|
74
|
-
| `WORKED_ON` | A worked on B | Session worked on an issue |
|
|
75
|
-
| `PRODUCED` | A produced B | Session produced a decision |
|
|
76
|
-
| `RELATES_TO` | A relates to B | General association |
|
|
77
|
-
| `SUPERSEDES` | A supersedes B | New decision replaces old |
|
|
78
|
-
| `BLOCKS` | A blocks B | Issue blocks another issue |
|