devflow-toolkit 0.3.16__py3-none-any.whl → 0.3.17__py3-none-any.whl
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.
- devflow/cli.py +1 -1
- devflow/commands/approve.py +1 -1
- devflow/core/spec_workflow.py +0 -101
- devflow/core/specification.py +80 -109
- devflow/profiles/base/constitution/code-standards.md +5 -4
- devflow/profiles/base/constitution/constitution.md +25 -8
- devflow/prompts/__init__.py +90 -100
- devflow/prompts/discovery.md +23 -24
- devflow/prompts/spec.md +108 -11
- {devflow_toolkit-0.3.16.dist-info → devflow_toolkit-0.3.17.dist-info}/METADATA +44 -20
- {devflow_toolkit-0.3.16.dist-info → devflow_toolkit-0.3.17.dist-info}/RECORD +14 -15
- devflow/prompts/spec.greenfield.md +0 -159
- {devflow_toolkit-0.3.16.dist-info → devflow_toolkit-0.3.17.dist-info}/WHEEL +0 -0
- {devflow_toolkit-0.3.16.dist-info → devflow_toolkit-0.3.17.dist-info}/entry_points.txt +0 -0
- {devflow_toolkit-0.3.16.dist-info → devflow_toolkit-0.3.17.dist-info}/licenses/LICENSE +0 -0
devflow/cli.py
CHANGED
devflow/commands/approve.py
CHANGED
|
@@ -57,7 +57,7 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
|
|
|
57
57
|
normalized = stage.strip().lower()
|
|
58
58
|
if normalized != "spec":
|
|
59
59
|
msg = (
|
|
60
|
-
f"Stage '{stage}' is not available in DevFlow 0.3.
|
|
60
|
+
f"Stage '{stage}' is not available in DevFlow 0.3.17. "
|
|
61
61
|
"Only the 'spec' stage can be approved."
|
|
62
62
|
)
|
|
63
63
|
raise UnsupportedStageError(msg)
|
devflow/core/spec_workflow.py
CHANGED
|
@@ -48,7 +48,6 @@ from devflow.models.project import (
|
|
|
48
48
|
)
|
|
49
49
|
from devflow.models.profile import Profile
|
|
50
50
|
from devflow.prompts import (
|
|
51
|
-
build_decision_context,
|
|
52
51
|
build_discovery_prompt,
|
|
53
52
|
build_spec_prompt,
|
|
54
53
|
)
|
|
@@ -317,9 +316,6 @@ class SpecWorkflow:
|
|
|
317
316
|
),
|
|
318
317
|
config=config,
|
|
319
318
|
project=project,
|
|
320
|
-
constitution=constitution,
|
|
321
|
-
profiles=profiles,
|
|
322
|
-
architecture=architecture,
|
|
323
319
|
warnings=warnings,
|
|
324
320
|
)
|
|
325
321
|
)
|
|
@@ -348,15 +344,6 @@ class SpecWorkflow:
|
|
|
348
344
|
)
|
|
349
345
|
|
|
350
346
|
self.manager.materialize_context(prepared)
|
|
351
|
-
self._materialize_decision_context(
|
|
352
|
-
prepared=prepared,
|
|
353
|
-
config=config,
|
|
354
|
-
project=project,
|
|
355
|
-
profiles=profiles,
|
|
356
|
-
constitution=constitution,
|
|
357
|
-
architecture=architecture,
|
|
358
|
-
discovery=discovery,
|
|
359
|
-
)
|
|
360
347
|
|
|
361
348
|
if not discovery.is_complete:
|
|
362
349
|
return self._build_result(
|
|
@@ -510,17 +497,6 @@ class SpecWorkflow:
|
|
|
510
497
|
)
|
|
511
498
|
|
|
512
499
|
context_path = self.manager.materialize_context(prepared)
|
|
513
|
-
decision_context_path, decision_context_digest = (
|
|
514
|
-
self._materialize_decision_context(
|
|
515
|
-
prepared=prepared,
|
|
516
|
-
config=config,
|
|
517
|
-
project=project,
|
|
518
|
-
profiles=profiles,
|
|
519
|
-
constitution=constitution,
|
|
520
|
-
architecture=architecture,
|
|
521
|
-
discovery=discovery,
|
|
522
|
-
)
|
|
523
|
-
)
|
|
524
500
|
prompt = build_spec_prompt(
|
|
525
501
|
request=description,
|
|
526
502
|
project_name=project.name,
|
|
@@ -555,9 +531,6 @@ class SpecWorkflow:
|
|
|
555
531
|
else ""
|
|
556
532
|
),
|
|
557
533
|
discovery_digest=discovery_digest,
|
|
558
|
-
discovery_decisions=list(discovery.decisions()),
|
|
559
|
-
decision_context_path=self._relative(config, decision_context_path),
|
|
560
|
-
decision_context_digest=decision_context_digest,
|
|
561
534
|
)
|
|
562
535
|
|
|
563
536
|
output_path = (
|
|
@@ -623,15 +596,6 @@ class SpecWorkflow:
|
|
|
623
596
|
spec_id=prepared.spec_id,
|
|
624
597
|
)
|
|
625
598
|
self.manager.materialize_context(prepared)
|
|
626
|
-
self._materialize_decision_context(
|
|
627
|
-
prepared=prepared,
|
|
628
|
-
config=config,
|
|
629
|
-
project=project,
|
|
630
|
-
profiles=profiles,
|
|
631
|
-
constitution=constitution,
|
|
632
|
-
architecture=architecture,
|
|
633
|
-
discovery=discovery,
|
|
634
|
-
)
|
|
635
599
|
warnings.append(
|
|
636
600
|
"the specification agent found decisions that were not "
|
|
637
601
|
"answered during Discovery. They were added to discovery.yaml "
|
|
@@ -726,9 +690,6 @@ class SpecWorkflow:
|
|
|
726
690
|
language: str,
|
|
727
691
|
config: DevFlowConfig,
|
|
728
692
|
project: Project,
|
|
729
|
-
constitution: Constitution,
|
|
730
|
-
profiles: list[Profile],
|
|
731
|
-
architecture: ArchitectureManifest | None,
|
|
732
693
|
warnings: list[str],
|
|
733
694
|
) -> tuple[DiscoveryDocument, str, bool]:
|
|
734
695
|
context_path = self.manager.materialize_context(prepared)
|
|
@@ -738,17 +699,6 @@ class SpecWorkflow:
|
|
|
738
699
|
prepared.directory,
|
|
739
700
|
)
|
|
740
701
|
backlog_before = len(discovery.pending_material)
|
|
741
|
-
decision_context_path, decision_context_digest = (
|
|
742
|
-
self._materialize_decision_context(
|
|
743
|
-
prepared=prepared,
|
|
744
|
-
config=config,
|
|
745
|
-
project=project,
|
|
746
|
-
profiles=profiles,
|
|
747
|
-
constitution=constitution,
|
|
748
|
-
architecture=architecture,
|
|
749
|
-
discovery=discovery,
|
|
750
|
-
)
|
|
751
|
-
)
|
|
752
702
|
spec_existed = prepared.path.exists()
|
|
753
703
|
settings = config.discovery
|
|
754
704
|
prompt = build_discovery_prompt(
|
|
@@ -767,11 +717,6 @@ class SpecWorkflow:
|
|
|
767
717
|
question_budget_maximum=settings.question_budget_maximum,
|
|
768
718
|
max_rounds=settings.max_rounds,
|
|
769
719
|
assumptions_enabled=settings.assumptions_enabled,
|
|
770
|
-
decision_context_path=self._relative(
|
|
771
|
-
config,
|
|
772
|
-
decision_context_path,
|
|
773
|
-
),
|
|
774
|
-
decision_context_digest=decision_context_digest,
|
|
775
720
|
)
|
|
776
721
|
run_context = RunContext(
|
|
777
722
|
root=config.root,
|
|
@@ -835,54 +780,8 @@ class SpecWorkflow:
|
|
|
835
780
|
"Critical or material decisions are never converted into "
|
|
836
781
|
"assumptions to close Discovery."
|
|
837
782
|
)
|
|
838
|
-
self._materialize_decision_context(
|
|
839
|
-
prepared=prepared,
|
|
840
|
-
config=config,
|
|
841
|
-
project=project,
|
|
842
|
-
profiles=profiles,
|
|
843
|
-
constitution=constitution,
|
|
844
|
-
architecture=architecture,
|
|
845
|
-
discovery=updated,
|
|
846
|
-
)
|
|
847
783
|
return updated, digest, digest != original_digest
|
|
848
784
|
|
|
849
|
-
def _materialize_decision_context(
|
|
850
|
-
self,
|
|
851
|
-
*,
|
|
852
|
-
prepared: PreparedSpec,
|
|
853
|
-
config: DevFlowConfig,
|
|
854
|
-
project: Project,
|
|
855
|
-
profiles: list[Profile],
|
|
856
|
-
constitution: Constitution,
|
|
857
|
-
architecture: ArchitectureManifest | None,
|
|
858
|
-
discovery: DiscoveryDocument,
|
|
859
|
-
) -> tuple[Path, str]:
|
|
860
|
-
"""Write the deterministic decision context for Discovery and specs."""
|
|
861
|
-
content = build_decision_context(
|
|
862
|
-
project_name=project.name,
|
|
863
|
-
project_type=project.project_type,
|
|
864
|
-
project_mode=discovery.project_mode,
|
|
865
|
-
languages=project.languages,
|
|
866
|
-
frameworks=project.frameworks,
|
|
867
|
-
databases=project.databases,
|
|
868
|
-
profiles=tuple(profile.name for profile in profiles),
|
|
869
|
-
constitution_files=tuple(
|
|
870
|
-
document.name for document in constitution.documents
|
|
871
|
-
),
|
|
872
|
-
architecture_path=(
|
|
873
|
-
architecture.relative_path(config.root)
|
|
874
|
-
if architecture is not None
|
|
875
|
-
else ""
|
|
876
|
-
),
|
|
877
|
-
architecture_style=(
|
|
878
|
-
architecture.style if architecture is not None else ""
|
|
879
|
-
),
|
|
880
|
-
discovery=discovery,
|
|
881
|
-
)
|
|
882
|
-
path = prepared.directory / "decision-context.md"
|
|
883
|
-
digest = ArtifactStore(prepared.root).write(path, content)
|
|
884
|
-
return path, digest
|
|
885
|
-
|
|
886
785
|
@staticmethod
|
|
887
786
|
def _effective_batch_size(
|
|
888
787
|
adapter: HarnessPort,
|
devflow/core/specification.py
CHANGED
|
@@ -30,6 +30,7 @@ from devflow.models.project import (
|
|
|
30
30
|
Project,
|
|
31
31
|
canonical_project_mode,
|
|
32
32
|
)
|
|
33
|
+
from devflow.prompts import build_decision_context
|
|
33
34
|
|
|
34
35
|
ANALYSIS_EXTENSIONS = {
|
|
35
36
|
".py",
|
|
@@ -1259,58 +1260,6 @@ class SpecificationManager:
|
|
|
1259
1260
|
f"| Discovery digest | `{digest}` |",
|
|
1260
1261
|
]
|
|
1261
1262
|
|
|
1262
|
-
def _discovery_context_lines(
|
|
1263
|
-
self,
|
|
1264
|
-
discovery: DiscoveryDocument | None,
|
|
1265
|
-
digest: str | None,
|
|
1266
|
-
specs_path: Path,
|
|
1267
|
-
root: Path,
|
|
1268
|
-
) -> list[str]:
|
|
1269
|
-
if discovery is None:
|
|
1270
|
-
return []
|
|
1271
|
-
path = specs_path / discovery.change / "discovery.yaml"
|
|
1272
|
-
try:
|
|
1273
|
-
relative = path.relative_to(root).as_posix()
|
|
1274
|
-
except ValueError:
|
|
1275
|
-
relative = path.as_posix()
|
|
1276
|
-
lines = [
|
|
1277
|
-
"## Discovery",
|
|
1278
|
-
"",
|
|
1279
|
-
f"- File: `{relative}`",
|
|
1280
|
-
f"- Status: `{discovery.status}`",
|
|
1281
|
-
f"- Digest: `{digest or 'unknown'}`",
|
|
1282
|
-
f"- Project mode: `{discovery.project_mode}`",
|
|
1283
|
-
"",
|
|
1284
|
-
]
|
|
1285
|
-
if discovery.questions:
|
|
1286
|
-
lines.extend(
|
|
1287
|
-
[
|
|
1288
|
-
"| Question | Category | Blocking | Status | Answer |",
|
|
1289
|
-
"| --- | --- | --- | --- | --- |",
|
|
1290
|
-
]
|
|
1291
|
-
)
|
|
1292
|
-
for question in discovery.questions:
|
|
1293
|
-
answer = question.answer or "-"
|
|
1294
|
-
lines.append(
|
|
1295
|
-
f"| {question.id} | {question.category} | "
|
|
1296
|
-
f"{'yes' if question.blocking else 'no'} | "
|
|
1297
|
-
f"{question.status} | {answer} |"
|
|
1298
|
-
)
|
|
1299
|
-
else:
|
|
1300
|
-
lines.append("No discovery questions were recorded.")
|
|
1301
|
-
if discovery.assumptions:
|
|
1302
|
-
lines.extend(["", "### Proposed assumptions", ""])
|
|
1303
|
-
for assumption in discovery.assumptions:
|
|
1304
|
-
accepted = (
|
|
1305
|
-
f"accepted by {assumption.accepted_by}"
|
|
1306
|
-
if assumption.is_accepted
|
|
1307
|
-
else "pending acceptance"
|
|
1308
|
-
)
|
|
1309
|
-
lines.append(
|
|
1310
|
-
f"- {assumption.id}: {assumption.value} ({accepted})"
|
|
1311
|
-
)
|
|
1312
|
-
return lines
|
|
1313
|
-
|
|
1314
1263
|
def _open_questions_lines(
|
|
1315
1264
|
self,
|
|
1316
1265
|
questions: list[str],
|
|
@@ -1518,47 +1467,62 @@ class SpecificationManager:
|
|
|
1518
1467
|
config.specifications_path / f"{spec_id}-{slugify(description)}"
|
|
1519
1468
|
)
|
|
1520
1469
|
spec_path = target_directory / "spec.md"
|
|
1470
|
+
decision_context = build_decision_context(
|
|
1471
|
+
project_name=project.name,
|
|
1472
|
+
project_type=project.project_type,
|
|
1473
|
+
project_mode="greenfield",
|
|
1474
|
+
languages=project.languages,
|
|
1475
|
+
frameworks=project.frameworks,
|
|
1476
|
+
databases=project.databases,
|
|
1477
|
+
profiles=tuple(profile.name for profile in profiles),
|
|
1478
|
+
constitution_files=tuple(
|
|
1479
|
+
document.name for document in constitution.documents
|
|
1480
|
+
),
|
|
1481
|
+
architecture_path=architecture.relative_path(config.root),
|
|
1482
|
+
architecture_style=architecture.style,
|
|
1483
|
+
architecture_digest=architecture.digest,
|
|
1484
|
+
discovery=discovery,
|
|
1485
|
+
discovery_digest=discovery_digest or "",
|
|
1486
|
+
)
|
|
1521
1487
|
lines = [
|
|
1522
|
-
f"# DevFlow
|
|
1488
|
+
f"# DevFlow Change Context {spec_id}: {title}",
|
|
1523
1489
|
"",
|
|
1524
1490
|
"This file contains the declared architecture and requirements "
|
|
1525
1491
|
"gathered by DevFlow. There is no existing implementation to "
|
|
1526
|
-
"analyze. Do not invent source files or claim that code exists."
|
|
1492
|
+
"analyze. Do not invent source files or claim that code exists. "
|
|
1493
|
+
"The Decision Context is authoritative for decisions; the Project "
|
|
1494
|
+
"Evidence supports it.",
|
|
1495
|
+
"",
|
|
1496
|
+
decision_context.rstrip(),
|
|
1527
1497
|
"",
|
|
1528
|
-
"##
|
|
1498
|
+
"## 2. Project Evidence",
|
|
1499
|
+
"",
|
|
1500
|
+
"### Request",
|
|
1529
1501
|
"",
|
|
1530
1502
|
"> " + "\n> ".join(description.strip().splitlines()),
|
|
1531
1503
|
"",
|
|
1532
|
-
"
|
|
1504
|
+
"### Project",
|
|
1533
1505
|
"",
|
|
1534
|
-
f"-
|
|
1535
|
-
f"-
|
|
1536
|
-
"- Project mode: `greenfield`",
|
|
1506
|
+
f"- Source files: {len(project.source_files)}",
|
|
1507
|
+
f"- Manifests: {', '.join(project.manifests) or 'none'}",
|
|
1537
1508
|
"",
|
|
1538
|
-
"
|
|
1509
|
+
"### Constitution",
|
|
1539
1510
|
"",
|
|
1540
1511
|
"Apply these documents. Do not copy their contents into the "
|
|
1541
1512
|
"specification.",
|
|
1542
1513
|
"",
|
|
1543
1514
|
]
|
|
1544
1515
|
lines.extend(self._constitution_table(constitution, profiles))
|
|
1545
|
-
lines.extend(["", "## Declared Architecture", ""])
|
|
1546
|
-
lines.extend(
|
|
1547
|
-
self._architecture_context_lines(architecture, config.root)
|
|
1548
|
-
)
|
|
1549
|
-
discovery_lines = self._discovery_context_lines(
|
|
1550
|
-
discovery,
|
|
1551
|
-
discovery_digest,
|
|
1552
|
-
config.specifications_path,
|
|
1553
|
-
config.root,
|
|
1554
|
-
)
|
|
1555
|
-
if discovery_lines:
|
|
1556
|
-
lines.extend(["", *discovery_lines])
|
|
1557
|
-
lines.extend(["", "## Initial Open Questions", ""])
|
|
1558
|
-
lines.extend(self._open_questions_lines(questions, discovery))
|
|
1559
|
-
|
|
1560
1516
|
lines.extend(
|
|
1561
1517
|
[
|
|
1518
|
+
"",
|
|
1519
|
+
"### Declared Architecture",
|
|
1520
|
+
"",
|
|
1521
|
+
*self._architecture_context_lines(architecture, config.root),
|
|
1522
|
+
"",
|
|
1523
|
+
"### Initial Open Questions",
|
|
1524
|
+
"",
|
|
1525
|
+
*self._open_questions_lines(questions, discovery),
|
|
1562
1526
|
"",
|
|
1563
1527
|
"## Required Output",
|
|
1564
1528
|
"",
|
|
@@ -1916,40 +1880,56 @@ class SpecificationManager:
|
|
|
1916
1880
|
discovery_digest: str | None = None,
|
|
1917
1881
|
directory: Path | None = None,
|
|
1918
1882
|
) -> str:
|
|
1919
|
-
detected_profiles = [
|
|
1920
|
-
profile for profile in profiles if profile.name != "base"
|
|
1921
|
-
]
|
|
1922
|
-
profile_names = ", ".join(
|
|
1923
|
-
profile.name for profile in detected_profiles
|
|
1924
|
-
)
|
|
1925
1883
|
target_directory = directory or (
|
|
1926
1884
|
config.specifications_path / f"{spec_id}-{slugify(description)}"
|
|
1927
1885
|
)
|
|
1928
1886
|
spec_path = target_directory / "spec.md"
|
|
1887
|
+
decision_context = build_decision_context(
|
|
1888
|
+
project_name=project.name,
|
|
1889
|
+
project_type=project.project_type,
|
|
1890
|
+
project_mode=project_mode,
|
|
1891
|
+
languages=project.languages,
|
|
1892
|
+
frameworks=project.frameworks,
|
|
1893
|
+
databases=project.databases,
|
|
1894
|
+
profiles=tuple(profile.name for profile in profiles),
|
|
1895
|
+
constitution_files=tuple(
|
|
1896
|
+
document.name for document in constitution.documents
|
|
1897
|
+
),
|
|
1898
|
+
architecture_path=(
|
|
1899
|
+
architecture.relative_path(config.root)
|
|
1900
|
+
if architecture is not None
|
|
1901
|
+
else ""
|
|
1902
|
+
),
|
|
1903
|
+
architecture_style=(
|
|
1904
|
+
architecture.style if architecture is not None else ""
|
|
1905
|
+
),
|
|
1906
|
+
architecture_digest=(
|
|
1907
|
+
architecture.digest if architecture is not None else ""
|
|
1908
|
+
),
|
|
1909
|
+
discovery=discovery,
|
|
1910
|
+
discovery_digest=discovery_digest or "",
|
|
1911
|
+
)
|
|
1929
1912
|
lines = [
|
|
1930
|
-
f"# DevFlow
|
|
1913
|
+
f"# DevFlow Change Context {spec_id}: {title}",
|
|
1914
|
+
"",
|
|
1915
|
+
"This file contains the deterministic context gathered by DevFlow. "
|
|
1916
|
+
"It is not the specification. The Decision Context is authoritative "
|
|
1917
|
+
"for decisions; the Project Evidence supports it.",
|
|
1931
1918
|
"",
|
|
1932
|
-
|
|
1933
|
-
"It is not the specification. Use it to understand the project, "
|
|
1934
|
-
"then write the specification to the target path.",
|
|
1919
|
+
decision_context.rstrip(),
|
|
1935
1920
|
"",
|
|
1936
|
-
"##
|
|
1921
|
+
"## 2. Project Evidence",
|
|
1922
|
+
"",
|
|
1923
|
+
"### Request",
|
|
1937
1924
|
"",
|
|
1938
1925
|
"> " + "\n> ".join(description.strip().splitlines()),
|
|
1939
1926
|
"",
|
|
1940
|
-
"
|
|
1927
|
+
"### Project",
|
|
1941
1928
|
"",
|
|
1942
|
-
f"- Name: `{project.name}`",
|
|
1943
|
-
f"- Type: `{project.project_type}`",
|
|
1944
|
-
f"- Project mode: `{project_mode}`",
|
|
1945
|
-
f"- Languages: {', '.join(project.languages) or 'not detected'}",
|
|
1946
|
-
f"- Frameworks: {', '.join(project.frameworks) or 'not detected'}",
|
|
1947
|
-
f"- Databases: {', '.join(project.databases) or 'not detected'}",
|
|
1948
|
-
f"- Profiles: {profile_names or 'none'}",
|
|
1949
1929
|
f"- Source files: {len(project.source_files)}",
|
|
1950
1930
|
f"- Manifests: {', '.join(project.manifests) or 'none'}",
|
|
1951
1931
|
"",
|
|
1952
|
-
"
|
|
1932
|
+
"### Constitution",
|
|
1953
1933
|
"",
|
|
1954
1934
|
"Apply these documents. Do not copy their contents into the "
|
|
1955
1935
|
"specification.",
|
|
@@ -1974,7 +1954,7 @@ class SpecificationManager:
|
|
|
1974
1954
|
lines.extend(
|
|
1975
1955
|
[
|
|
1976
1956
|
"",
|
|
1977
|
-
"
|
|
1957
|
+
"### Declared Architecture",
|
|
1978
1958
|
"",
|
|
1979
1959
|
*self._architecture_context_lines(
|
|
1980
1960
|
architecture,
|
|
@@ -1983,19 +1963,10 @@ class SpecificationManager:
|
|
|
1983
1963
|
]
|
|
1984
1964
|
)
|
|
1985
1965
|
|
|
1986
|
-
discovery_lines = self._discovery_context_lines(
|
|
1987
|
-
discovery,
|
|
1988
|
-
discovery_digest,
|
|
1989
|
-
config.specifications_path,
|
|
1990
|
-
config.root,
|
|
1991
|
-
)
|
|
1992
|
-
if discovery_lines:
|
|
1993
|
-
lines.extend(["", *discovery_lines])
|
|
1994
|
-
|
|
1995
1966
|
lines.extend(
|
|
1996
1967
|
[
|
|
1997
1968
|
"",
|
|
1998
|
-
"
|
|
1969
|
+
"### Static Analysis",
|
|
1999
1970
|
"",
|
|
2000
1971
|
"- Request keywords: "
|
|
2001
1972
|
+ (
|
|
@@ -2006,7 +1977,7 @@ class SpecificationManager:
|
|
|
2006
1977
|
f"- Existing tests detected: "
|
|
2007
1978
|
f"{'yes' if analysis.has_tests else 'no'}",
|
|
2008
1979
|
"",
|
|
2009
|
-
"
|
|
1980
|
+
"### Relevant Existing Code",
|
|
2010
1981
|
"",
|
|
2011
1982
|
]
|
|
2012
1983
|
)
|
|
@@ -2043,7 +2014,7 @@ class SpecificationManager:
|
|
|
2043
2014
|
lines.extend(
|
|
2044
2015
|
[
|
|
2045
2016
|
"",
|
|
2046
|
-
"
|
|
2017
|
+
"### Dependencies",
|
|
2047
2018
|
"",
|
|
2048
2019
|
(
|
|
2049
2020
|
"Declared dependencies found in the relevant files: "
|
|
@@ -2056,7 +2027,7 @@ class SpecificationManager:
|
|
|
2056
2027
|
"the matched code. Confirm whether the change requires one."
|
|
2057
2028
|
),
|
|
2058
2029
|
"",
|
|
2059
|
-
"
|
|
2030
|
+
"### Initial Open Questions",
|
|
2060
2031
|
"",
|
|
2061
2032
|
]
|
|
2062
2033
|
)
|
|
@@ -79,7 +79,8 @@ Example:
|
|
|
79
79
|
|
|
80
80
|
- Keep functions focused on a single responsibility.
|
|
81
81
|
- Avoid unnecessarily large functions.
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
- Prefer a small, cohesive parameter list. Group related
|
|
83
|
+
parameters when that improves readability, and avoid
|
|
84
|
+
boolean flags that obscure intent.
|
|
85
|
+
- Use multiline formatting when it improves readability
|
|
86
|
+
or when the declaration exceeds the maximum line length.
|
|
@@ -11,7 +11,24 @@ These principles apply to all development activities,
|
|
|
11
11
|
including new features, bug fixes, refactoring,
|
|
12
12
|
integrations and optimizations.
|
|
13
13
|
|
|
14
|
-
## 2.
|
|
14
|
+
## 2. Instruction Precedence
|
|
15
|
+
|
|
16
|
+
When instructions conflict, apply them in this order,
|
|
17
|
+
highest priority first:
|
|
18
|
+
|
|
19
|
+
1. Explicit decisions approved by the user.
|
|
20
|
+
2. The approved specification.
|
|
21
|
+
3. This constitution and the enabled technology profiles.
|
|
22
|
+
4. The declared architecture and verified project conventions.
|
|
23
|
+
5. General good practices.
|
|
24
|
+
6. Agent preferences.
|
|
25
|
+
|
|
26
|
+
A lower-priority instruction never overrides a higher-priority
|
|
27
|
+
one. When two instructions at the same level conflict, ask for
|
|
28
|
+
clarification and record the decision instead of resolving it
|
|
29
|
+
silently. Never treat an assumption as an explicit decision.
|
|
30
|
+
|
|
31
|
+
## 3. Existing Project First
|
|
15
32
|
|
|
16
33
|
- Always inspect the existing codebase before proposing
|
|
17
34
|
or implementing changes.
|
|
@@ -24,7 +41,7 @@ integrations and optimizations.
|
|
|
24
41
|
- Never assume that a feature must be implemented
|
|
25
42
|
from scratch.
|
|
26
43
|
|
|
27
|
-
##
|
|
44
|
+
## 4. Respect Existing Architecture
|
|
28
45
|
|
|
29
46
|
- Follow the established project architecture.
|
|
30
47
|
- Respect module boundaries and separation of concerns.
|
|
@@ -33,14 +50,14 @@ integrations and optimizations.
|
|
|
33
50
|
- Do not introduce abstractions without a clear benefit.
|
|
34
51
|
- Consider the impact of changes on existing components.
|
|
35
52
|
|
|
36
|
-
##
|
|
53
|
+
## 5. Code Quality
|
|
37
54
|
|
|
38
55
|
- Follow the standards defined in code-standards.md.
|
|
39
56
|
- Follow the architectural principles defined in
|
|
40
57
|
architecture.md.
|
|
41
58
|
- Apply technology-specific standards when applicable.
|
|
42
59
|
|
|
43
|
-
##
|
|
60
|
+
## 6. Technology-Specific Standards
|
|
44
61
|
|
|
45
62
|
When the project includes a technology-specific profile,
|
|
46
63
|
follow the guidelines installed for that profile.
|
|
@@ -52,7 +69,7 @@ Technology-specific guidelines must only be applied
|
|
|
52
69
|
when the corresponding technology is present and its
|
|
53
70
|
profile is enabled for the project.
|
|
54
71
|
|
|
55
|
-
##
|
|
72
|
+
## 7. Change Safety
|
|
56
73
|
|
|
57
74
|
- Analyze potential regressions before modifying code.
|
|
58
75
|
- Preserve compatibility with existing integrations
|
|
@@ -61,7 +78,7 @@ profile is enabled for the project.
|
|
|
61
78
|
- Include or update automated tests when appropriate.
|
|
62
79
|
- Never silently discard existing functionality.
|
|
63
80
|
|
|
64
|
-
##
|
|
81
|
+
## 8. Specification Compliance
|
|
65
82
|
|
|
66
83
|
- Implement only what is required by the approved
|
|
67
84
|
specification.
|
|
@@ -69,14 +86,14 @@ profile is enabled for the project.
|
|
|
69
86
|
- Identify ambiguities instead of inventing requirements.
|
|
70
87
|
- Report assumptions and relevant technical limitations.
|
|
71
88
|
|
|
72
|
-
##
|
|
89
|
+
## 9. Documentation
|
|
73
90
|
|
|
74
91
|
- Keep technical documentation consistent with the
|
|
75
92
|
actual implementation.
|
|
76
93
|
- Update documentation when a change affects existing
|
|
77
94
|
behavior, configuration or integrations.
|
|
78
95
|
|
|
79
|
-
##
|
|
96
|
+
## 10. Decision Making
|
|
80
97
|
|
|
81
98
|
- Prefer simple, maintainable solutions.
|
|
82
99
|
- Avoid over-engineering.
|