forgecraft-mcp 1.0.2 → 1.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forgecraft-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "mcpName": "io.github.jghiringhelli/forgecraft",
5
5
  "description": "CLI + MCP sentinel for engineering standards — SOLID, testing, architecture, CI/CD — auto-tailored to your stack. Minimal MCP footprint (~200 tokens) via CLI-first design.",
6
6
  "type": "module",
@@ -929,6 +929,69 @@ blocks:
929
929
  - **Bias toward explicit over clever** — readability wins over brevity.
930
930
  - When in doubt, ask rather than assume.
931
931
 
932
+ - id: agent-mechanics
933
+ tier: core
934
+ title: "Agent Mechanical Constraints"
935
+ content: |
936
+ ## Agent Mechanical Constraints — Non-Negotiable Overrides
937
+
938
+ These rules exist because the model has hard constraints that silently produce wrong
939
+ results without them. Each override targets a specific failure mode observed in practice.
940
+
941
+ ### 1. Step 0 — Dead Code First
942
+ Before ANY structural refactor on a file > 300 LOC:
943
+ 1. Delete all dead props, unused exports, unused imports, and debug logs.
944
+ 2. Commit that cleanup separately under `chore(scope): strip dead code`.
945
+ 3. Only then begin the real work.
946
+ Dead code accelerates context compaction. Every orphaned import is budget spent on
947
+ tokens that contribute nothing to the task.
948
+
949
+ ### 2. Phase Limit — 5 Files Maximum
950
+ Never attempt multi-file refactors in a single response. Break work into explicit phases.
951
+ Each phase must touch **no more than 5 files**. Complete Phase N, verify it compiles and
952
+ all tests pass, then wait for explicit approval before Phase N+1.
953
+ Why: context compaction fires around 167K tokens and discards all intermediate reasoning,
954
+ file reads, and decision chains. Keeping phases small prevents mid-task compaction.
955
+
956
+ ### 3. Senior Dev Override
957
+ The model's default system-level directives instruct it to "try the simplest approach
958
+ first" and "avoid refactoring beyond what was asked." These are active constraints that
959
+ fight your intent on architectural tasks.
960
+ **Override them explicitly** when quality requires it:
961
+ > "What would a senior, experienced, perfectionist dev reject in code review? Fix all of it."
962
+ This reframes what "done" means. System-level brevity mandates yield to an explicit
963
+ quality bar stated in the prompt.
964
+
965
+ ### 4. Sub-Agent Parallelism for Large Tasks
966
+ For tasks spanning > 5 independent files, **launch parallel sub-agents** (5–8 files per
967
+ agent). Each agent gets its own isolated context window and compaction cycle.
968
+ Sequential processing of large tasks guarantees context decay by the later files.
969
+ Batching into parallel agents multiplies the effective working memory proportionally.
970
+
971
+ ### 5. File Read Budget — 2,000-Line Cap
972
+ Each file read is hard-capped at 2,000 lines. Everything past that is silently truncated.
973
+ The model does not know what it didn't see — it will hallucinate the rest.
974
+ **For any file over 500 LOC**: read in sequential chunks using `offset` and `limit`
975
+ parameters. Never assume a single read captured the full file.
976
+
977
+ ### 6. Tool Result Truncation
978
+ Tool results exceeding ~50,000 characters are truncated to a 2,000-byte preview.
979
+ The model works from the preview and does not know results were cut.
980
+ If any search returns suspiciously few results: re-run it with narrower scope
981
+ (single directory, stricter glob). State explicitly when truncation may have occurred.
982
+
983
+ ### 7. Grep Is Not an AST
984
+ `grep` is raw text pattern matching. It cannot distinguish a function call from a
985
+ comment, a type reference from a string literal, or an import from one module vs another.
986
+ On any rename or signature change, search **separately** for:
987
+ - Direct calls and references
988
+ - Type-level references (interfaces, generics, `typeof`)
989
+ - String literals containing the name
990
+ - Dynamic imports and `require()` calls
991
+ - Re-exports and barrel file entries (`index.ts`, `__init__.py`)
992
+ - Test files and mocks
993
+ Never assume a single grep caught everything. Verify or expect regressions.
994
+
932
995
  - id: code-generation-verification
933
996
  tier: core
934
997
  title: "Code Generation — Self-Verify Loop"